code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
try:
import bmtk.simulator.bionet as bionet
from bmtk.simulator.bionet.gids import GidPool
from bmtk.simulator.bionet.pyfunction_cache import *
from neuron import h
h.load_file('stdrun.hoc')
nrn_installed = True
except ImportError:
nrn_installed = False
has_mechanism = False
if nrn_... | [
"neuron.h.VecStim",
"neuron.h.load_file"
] | [((186, 211), 'neuron.h.load_file', 'h.load_file', (['"""stdrun.hoc"""'], {}), "('stdrun.hoc')\n", (197, 211), False, 'from neuron import h\n'), ((358, 369), 'neuron.h.VecStim', 'h.VecStim', ([], {}), '()\n', (367, 369), False, 'from neuron import h\n')] |
import sqlalchemy as sa
import sqlalchemy.ext as ext
import sqlalchemy.ext.declarative
import sqlalchemy.orm as orm
from .database import Base
class InterestingTrend():
def __init__(self, title, description):
self.title = title
self.description = description
def to_dict(self):
return ... | [
"sqlalchemy.String",
"sqlalchemy.Date"
] | [((601, 610), 'sqlalchemy.Date', 'sa.Date', ([], {}), '()\n', (608, 610), True, 'import sqlalchemy as sa\n'), ((651, 662), 'sqlalchemy.String', 'sa.String', ([], {}), '()\n', (660, 662), True, 'import sqlalchemy as sa\n'), ((686, 697), 'sqlalchemy.String', 'sa.String', ([], {}), '()\n', (695, 697), True, 'import sqlalc... |
import json
import requests
class GimmeProxyAPI(object):
"""docstring for proxy"""
def __init__(self, **args):
self.base_url = "https://gimmeproxy.com/api/getProxy"
self.response = None
if self.response is None:
self.response = self.get_proxy(args=args)
def response(self):
return sel... | [
"requests.get"
] | [((431, 471), 'requests.get', 'requests.get', (['self.base_url'], {'params': 'args'}), '(self.base_url, params=args)\n', (443, 471), False, 'import requests\n')] |
from __future__ import absolute_import, division, print_function
from tap.api_resources.abstract.createable_api_resource import CreateableAPIResource
from tap.api_resources.abstract.updateable_api_resource import UpdateableAPIResource
from tap.api_resources.abstract.deleteable_api_resource import DeleteableAPIResource... | [
"tap.api_resources.abstract.nested_resource_class_methods"
] | [((419, 541), 'tap.api_resources.abstract.nested_resource_class_methods', 'tap.api_resources.abstract.nested_resource_class_methods', (['"""card"""'], {'operations': "['create', 'retrieve', 'delete', 'list']"}), "('card', operations\n =['create', 'retrieve', 'delete', 'list'])\n", (475, 541), False, 'import tap\n')] |
# This file is part of Pynguin.
#
# Pynguin is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pynguin is distributed in the ho... | [
"pynguin.ga.fitnessfunction.FitnessValues",
"pytest.raises",
"unittest.mock.MagicMock"
] | [((903, 932), 'unittest.mock.MagicMock', 'MagicMock', (['ff.FitnessFunction'], {}), '(ff.FitnessFunction)\n', (912, 932), False, 'from unittest.mock import MagicMock\n'), ((1975, 2004), 'unittest.mock.MagicMock', 'MagicMock', (['ff.FitnessFunction'], {}), '(ff.FitnessFunction)\n', (1984, 2004), False, 'from unittest.mo... |
from cv2 import destroyAllWindows, imread, imshow, imwrite, split, waitKey
# Choose one for these image path.
# IMAGE_PATH = "../0_assets/cmyk_paint.png"
IMAGE_PATH = "../0_assets/RGB_paint.png"
DISPLAY_WINDOW_COLOR_STRING = [
"Blue",
"Green",
"Red",
]
image = imread(IMAGE_PATH)
# Get Color Buffer to St... | [
"cv2.waitKey",
"cv2.destroyAllWindows",
"cv2.imread",
"cv2.split",
"cv2.imshow"
] | [((276, 294), 'cv2.imread', 'imread', (['IMAGE_PATH'], {}), '(IMAGE_PATH)\n', (282, 294), False, 'from cv2 import destroyAllWindows, imread, imshow, imwrite, split, waitKey\n'), ((355, 367), 'cv2.split', 'split', (['image'], {}), '(image)\n', (360, 367), False, 'from cv2 import destroyAllWindows, imread, imshow, imwrit... |
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name="Todo-List",
version=2.0,
description='a todo-list cli',
author='<NAME>',
license='MIT',
url='http://github.com/Jonas-Luetolf/Todo-List',
python_requires='>=3.10',
install_requi... | [
"distutils.core.setup"
] | [((96, 408), 'distutils.core.setup', 'setup', ([], {'name': '"""Todo-List"""', 'version': '(2.0)', 'description': '"""a todo-list cli"""', 'author': '"""<NAME>"""', 'license': '"""MIT"""', 'url': '"""http://github.com/Jonas-Luetolf/Todo-List"""', 'python_requires': '""">=3.10"""', 'install_requires': "['PyYAML (>= 3.12... |
"""Application Models."""
from marshmallow import fields, Schema
from marshmallow.validate import OneOf
from ..enums import *
from ..models.BaseSchema import BaseSchema
from .SellerPhoneNumber import SellerPhoneNumber
class StoreManagerSerializer(BaseSchema):
# Catalog swagger.json
mobile_no = fie... | [
"marshmallow.fields.Str",
"marshmallow.fields.Nested"
] | [((317, 365), 'marshmallow.fields.Nested', 'fields.Nested', (['SellerPhoneNumber'], {'required': '(False)'}), '(SellerPhoneNumber, required=False)\n', (330, 365), False, 'from marshmallow import fields, Schema\n'), ((383, 409), 'marshmallow.fields.Str', 'fields.Str', ([], {'required': '(False)'}), '(required=False)\n',... |
from typing import List, Iterator, Optional
import argparse
import sys
import json
from overrides import overrides
from allennlp.commands.subcommand import Subcommand
from allennlp.common.checks import check_for_gpu, ConfigurationError
from allennlp.common.file_utils import cached_path
from allennlp.common.util impor... | [
"allennlp.common.checks.check_for_gpu",
"argparse.ArgumentParser",
"predict_utils.create_tokens_view",
"allennlp.common.util.sanitize",
"predict_utils.create_token_char_offsets",
"json.dumps",
"predict_utils.create_sentence_view",
"allennlp.models.archival.load_archive",
"nominal_srl.nominal_srl_pre... | [((651, 692), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': 'desc'}), '(description=desc)\n', (674, 692), False, 'import argparse\n'), ((1471, 1502), 'allennlp.common.checks.check_for_gpu', 'check_for_gpu', (['args.cuda_device'], {}), '(args.cuda_device)\n', (1484, 1502), False, 'from allen... |
from accelerator.managers.member_profile_manager import MemberProfileManager
from accelerator.models import CoreProfile
class MemberProfile(CoreProfile):
user_type = 'member'
default_page = "member_homepage"
objects = MemberProfileManager()
class Meta:
db_table = 'accelerator_memberprofile'
| [
"accelerator.managers.member_profile_manager.MemberProfileManager"
] | [((233, 255), 'accelerator.managers.member_profile_manager.MemberProfileManager', 'MemberProfileManager', ([], {}), '()\n', (253, 255), False, 'from accelerator.managers.member_profile_manager import MemberProfileManager\n')] |
# OrdiNeu's auto incrementor for Dugnutt
import keyboard
import wx
# Globals
Filename = "test.txt"
Format = "Number of times pressed: {}"
count = 0
hotkey = "ctrl+alt+z"
dehotkey = "ctrl+alt+x"
error = ""
refresh = None
# Callback to automatically write in the text file
def changeCount(amount, auto):
global count... | [
"wx.BoxSizer",
"keyboard.remove_hotkey",
"keyboard.unhook",
"wx.Panel",
"wx.StaticText",
"wx.Button",
"wx.TextCtrl",
"wx.App",
"keyboard.add_hotkey",
"keyboard.hook",
"keyboard.get_hotkey_name",
"wx.FileDialog",
"keyboard.is_modifier"
] | [((755, 793), 'keyboard.add_hotkey', 'keyboard.add_hotkey', (['hotkey', 'increment'], {}), '(hotkey, increment)\n', (774, 793), False, 'import keyboard\n'), ((794, 834), 'keyboard.add_hotkey', 'keyboard.add_hotkey', (['dehotkey', 'decrement'], {}), '(dehotkey, decrement)\n', (813, 834), False, 'import keyboard\n'), ((6... |
import glob
import os
import random
import cv2
def crop_image(src_image_path, dst_image_path):
output_side_length=256
img = cv2.imread(src_image_path)
height, width, depth = img.shape
new_height = output_side_length
new_width = output_side_length
if height > width:
new_height = int(outp... | [
"os.makedirs",
"os.path.basename",
"cv2.imwrite",
"random.shuffle",
"os.path.exists",
"cv2.imread",
"os.path.join",
"cv2.resize"
] | [((133, 159), 'cv2.imread', 'cv2.imread', (['src_image_path'], {}), '(src_image_path)\n', (143, 159), False, 'import cv2\n'), ((442, 482), 'cv2.resize', 'cv2.resize', (['img', '(new_width, new_height)'], {}), '(img, (new_width, new_height))\n', (452, 482), False, 'import cv2\n'), ((743, 783), 'cv2.imwrite', 'cv2.imwrit... |
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | [
"numpy.iinfo",
"numpy.ones",
"tensorflow.python.framework.ops.device",
"tensorflow.python.ipu.utils.set_ipu_model_options",
"tensorflow.python.client.session.Session",
"tensorflow.python.ipu.ipu_compiler.compile",
"tensorflow.python.platform.googletest.main",
"tensorflow.python.ops.array_ops.placehold... | [((2023, 2065), 'itertools.product', 'itertools.product', (['rate', 'seed', 'noise_shape'], {}), '(rate, seed, noise_shape)\n', (2040, 2065), False, 'import itertools\n'), ((3961, 4004), 'absl.testing.parameterized.named_parameters', 'parameterized.named_parameters', (['*TEST_CASES'], {}), '(*TEST_CASES)\n', (3991, 400... |
from static import *
from lib import map_value
from point import Point
from ray import Ray
import numpy as np
import random
import math
class Source:
def __init__(self, x, y, fov, pg, screen):
self.pos = Point(x, y)
self.angle = np.random.randint(0, 360)
self.view_mode = 0
self.... | [
"numpy.sum",
"lib.map_value",
"random.choice",
"numpy.random.randint",
"ray.Ray",
"point.Point"
] | [((220, 231), 'point.Point', 'Point', (['x', 'y'], {}), '(x, y)\n', (225, 231), False, 'from point import Point\n'), ((253, 278), 'numpy.random.randint', 'np.random.randint', (['(0)', '(360)'], {}), '(0, 360)\n', (270, 278), True, 'import numpy as np\n'), ((876, 897), 'random.choice', 'random.choice', (['COLORS'], {}),... |
# Copyright 2020 - 2021 MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in wri... | [
"monai.transforms.AddChanneld",
"monai.transforms.ScaleIntensityRanged",
"monai.transforms.ToDeviced",
"monai.inferers.SlidingWindowInferer",
"monai.losses.DiceCELoss",
"monai.transforms.AsDiscreted",
"monai.transforms.RandShiftIntensityd",
"monai.transforms.LoadImaged",
"monai.transforms.RandCropBy... | [((1064, 1091), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1081, 1091), False, 'import logging\n'), ((1606, 1679), 'monai.losses.DiceCELoss', 'DiceCELoss', ([], {'to_onehot_y': '(True)', 'softmax': '(True)', 'squared_pred': '(True)', 'batch': '(True)'}), '(to_onehot_y=True, softmax=T... |
"""Simple client to the Channel Archiver using xmlrpc."""
import logging as log
from xmlrpc.client import ServerProxy
import numpy
from . import data, utils
from .fetcher import Fetcher
__all__ = [
"CaClient",
"CaFetcher",
]
class CaClient(object):
"""Class to handle XMLRPC interaction with a channel a... | [
"numpy.zeros",
"xmlrpc.client.ServerProxy"
] | [((468, 484), 'xmlrpc.client.ServerProxy', 'ServerProxy', (['url'], {}), '(url)\n', (479, 484), False, 'from xmlrpc.client import ServerProxy\n'), ((2181, 2198), 'numpy.zeros', 'numpy.zeros', (['(0,)'], {}), '((0,))\n', (2192, 2198), False, 'import numpy\n')] |
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
import os
import tensorflow as tf
import math
ROOT_PATH = os.path.abspath('../../')
print(ROOT_PATH)
SUMMARY_PATH = os.path.join(ROOT_PATH, 'output/summary')
# backbone
NET_NAME = 'resnet50_v1d'
RESTORE_FROM_RPN = False
FIXED_BL... | [
"os.path.abspath",
"tensorflow.constant_initializer",
"tensorflow.random_normal_initializer",
"math.log",
"os.path.join"
] | [((149, 174), 'os.path.abspath', 'os.path.abspath', (['"""../../"""'], {}), "('../../')\n", (164, 174), False, 'import os\n'), ((207, 248), 'os.path.join', 'os.path.join', (['ROOT_PATH', '"""output/summary"""'], {}), "(ROOT_PATH, 'output/summary')\n", (219, 248), False, 'import os\n'), ((953, 1015), 'tensorflow.random_... |
import random as rn
import numpy as np
import matplotlib.pyplot as plt
import math
from matplotlib import patches
from matplotlib.patches import Polygon
def random_population(_nv, n, _lb, _ub):
_pop = np.zeros((n, 2 * nv))
for i in range(n):
_pop[i, :] = np.random.uniform(lb, ub)
f... | [
"matplotlib.pyplot.title",
"numpy.sum",
"numpy.ones",
"numpy.argsort",
"matplotlib.patches.Polygon",
"matplotlib.pyplot.figure",
"numpy.random.randint",
"numpy.arange",
"math.copysign",
"matplotlib.patches.Patch",
"random.randint",
"matplotlib.patches.Rectangle",
"numpy.append",
"math.cos"... | [((14013, 14075), 'matplotlib.patches.Patch', 'patches.Patch', ([], {'color': '"""blue"""', 'label': '"""Osobniki Pareto Optymalne"""'}), "(color='blue', label='Osobniki Pareto Optymalne')\n", (14026, 14075), False, 'from matplotlib import patches\n'), ((14089, 14141), 'matplotlib.patches.Patch', 'patches.Patch', ([], ... |
# -*- coding: utf-8 -*-
from providerModules.a4kScrapers import core
class sources(core.DefaultSources):
def __init__(self, *args, **kwargs):
super(sources, self).__init__(__name__, *args, **kwargs)
def _get_token_and_cookies(self, url):
response = self._request.get(url.base)
token_id... | [
"providerModules.a4kScrapers.core.re.findall",
"providerModules.a4kScrapers.core.tools.log",
"providerModules.a4kScrapers.core.json.loads",
"providerModules.a4kScrapers.core.quote_plus",
"providerModules.a4kScrapers.core.database.get"
] | [((718, 806), 'providerModules.a4kScrapers.core.database.get', 'core.database.get', (['self._get_token_and_cookies', '(0 if force_token_refresh else 1)', 'url'], {}), '(self._get_token_and_cookies, 0 if force_token_refresh else\n 1, url)\n', (735, 806), False, 'from providerModules.a4kScrapers import core\n'), ((919... |
import os
import numpy as np
from typing import Dict, Generic, List, NamedTuple, Tuple, TypeVar
TTensorizedNodeData = TypeVar("TTensorizedNodeData")
def enforce_not_None(e):
"""Enforce non-nullness of input. Used for typechecking and runtime safety."""
if e is None:
raise Exception("Input is None.")
... | [
"typing.TypeVar"
] | [((118, 148), 'typing.TypeVar', 'TypeVar', (['"""TTensorizedNodeData"""'], {}), "('TTensorizedNodeData')\n", (125, 148), False, 'from typing import Dict, Generic, List, NamedTuple, Tuple, TypeVar\n')] |
"""NDG XACML ElementTree Policy Reader
NERC DataGrid
"""
__author__ = "<NAME>"
__date__ = "16/03/10"
__copyright__ = "(C) 2010 Science and Technology Facilities Council"
__contact__ = "<EMAIL>"
__license__ = "BSD - see LICENSE file in top-level directory"
__contact__ = "<EMAIL>"
__revision__ = "$Id$"
from ndg.xacml.... | [
"ndg.xacml.parsers.etree.QName.getLocalPart",
"ndg.xacml.parsers.etree.factory.ReaderFactory.getReader",
"ndg.xacml.parsers.etree.getElementChildren",
"ndg.xacml.parsers.XMLParseError"
] | [((3025, 3053), 'ndg.xacml.parsers.etree.QName.getLocalPart', 'QName.getLocalPart', (['elem.tag'], {}), '(elem.tag)\n', (3043, 3053), False, 'from ndg.xacml.parsers.etree import QName, getElementChildren\n'), ((4252, 4276), 'ndg.xacml.parsers.etree.getElementChildren', 'getElementChildren', (['elem'], {}), '(elem)\n', ... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
outbursts --- Lightcurve and outburst analysis
==============================================
"""
__all__ = [
'CometaryTrends'
]
from collections import namedtuple
import logging
import numpy as np
from scipy.cluster import hierarchy
from scipy.... | [
"numpy.sum",
"scipy.optimize.leastsq",
"numpy.exp",
"numpy.diag",
"numpy.round",
"numpy.unique",
"astropy.stats.sigma_clip",
"numpy.std",
"numpy.isfinite",
"astropy.units.Quantity",
"numpy.average",
"astropy.time.Time",
"scipy.cluster.hierarchy.fclusterdata",
"numpy.hypot",
"numpy.ma.ave... | [((475, 551), 'collections.namedtuple', 'namedtuple', (['"""dmdtFit"""', "['m0', 'dmdt', 'm0_unc', 'dmdt_unc', 'rms', 'rchisq']"], {}), "('dmdtFit', ['m0', 'dmdt', 'm0_unc', 'dmdt_unc', 'rms', 'rchisq'])\n", (485, 551), False, 'from collections import namedtuple\n'), ((567, 640), 'collections.namedtuple', 'namedtuple',... |
from insertion_sort.insertion_sort import insertion_Sort
import pytest
@pytest.mark.parametrize(
"input,expected_value",
[
([8, 4, 23, 42, 16, 15], [4, 8, 15, 16, 23, 42]),
([20, 18, 12, 8, 5, -2], [-2, 5, 8, 12, 18, 20]),
([5, 12, 7, 5, 5, 7], [5, 5, 5, 7, 7, 12]),
([2, 3, 5, ... | [
"pytest.mark.parametrize",
"insertion_sort.insertion_sort.insertion_Sort"
] | [((74, 328), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""input,expected_value"""', '[([8, 4, 23, 42, 16, 15], [4, 8, 15, 16, 23, 42]), ([20, 18, 12, 8, 5, -2],\n [-2, 5, 8, 12, 18, 20]), ([5, 12, 7, 5, 5, 7], [5, 5, 5, 7, 7, 12]), ([\n 2, 3, 5, 7, 13, 11], [2, 3, 5, 7, 11, 13])]'], {}), "('input,e... |
import boto3
from botocore.exceptions import ClientError
import json
import time
dynamodb = boto3.resource('dynamodb', region_name='us-east-1')
ddb_table = dynamodb.Table('GomokuPlayerInfo')
def lambda_handler(event, context):
print(event)
# You can also use TicketId to track Matchmaking Event.
ticke... | [
"boto3.resource",
"json.loads",
"json.dumps",
"time.time"
] | [((93, 144), 'boto3.resource', 'boto3.resource', (['"""dynamodb"""'], {'region_name': '"""us-east-1"""'}), "('dynamodb', region_name='us-east-1')\n", (107, 144), False, 'import boto3\n'), ((732, 784), 'json.loads', 'json.loads', (["match_response['Item']['ConnectionInfo']"], {}), "(match_response['Item']['ConnectionInf... |
#!/usr/bin/env python
import rospy
from geometry_msgs.msg import Twist
from std_msgs.msg import Int64
class Twist2int64():
def __init__(self):
self.command_left = Int64()
self.command_right = Int64()
self.received_twist = None
rospy.init_node('Twist2int64')
rospy.Subscriber('motor/twist/cmd_vel',... | [
"std_msgs.msg.Int64",
"rospy.Subscriber",
"rospy.Publisher",
"rospy.init_node",
"rospy.spin"
] | [((170, 177), 'std_msgs.msg.Int64', 'Int64', ([], {}), '()\n', (175, 177), False, 'from std_msgs.msg import Int64\n'), ((203, 210), 'std_msgs.msg.Int64', 'Int64', ([], {}), '()\n', (208, 210), False, 'from std_msgs.msg import Int64\n'), ((246, 276), 'rospy.init_node', 'rospy.init_node', (['"""Twist2int64"""'], {}), "('... |
from django.core.management.base import BaseCommand, CommandError
from main.models import Project, Person
import csv
# This file is part of https://github.com/cpina/science-cruise-data-management
#
# This project was programmed in a hurry without any prior Django experience,
# while circumnavigating the Antarctic on t... | [
"csv.DictReader",
"main.models.Project",
"main.models.Person.objects.filter"
] | [((1073, 1096), 'csv.DictReader', 'csv.DictReader', (['csvfile'], {}), '(csvfile)\n', (1087, 1096), False, 'import csv\n'), ((1181, 1190), 'main.models.Project', 'Project', ([], {}), '()\n', (1188, 1190), False, 'from main.models import Project, Person\n'), ((1578, 1629), 'main.models.Person.objects.filter', 'Person.ob... |
#!/usr/bin/env python
import time
from ... import base
class FindSlotSM(base.StateMachine):
"""
verify tape untensioned
setup stats and beam
move to approximate center
find edge(s)
move to center
set center
set roi (outside?)
state = {
'center': {
'x': ...... | [
"time.time"
] | [((914, 925), 'time.time', 'time.time', ([], {}), '()\n', (923, 925), False, 'import time\n'), ((8446, 8457), 'time.time', 'time.time', ([], {}), '()\n', (8455, 8457), False, 'import time\n'), ((6528, 6539), 'time.time', 'time.time', ([], {}), '()\n', (6537, 6539), False, 'import time\n')] |
#!/usr/bin/env python3
# Copyright 2021 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
r"""Creates Android resources directories and boilerplate files for a module.
This is a utility script for conveniently creating resou... | [
"argparse.ArgumentParser",
"build_gn_editor.VariableContentList",
"build_gn_editor.TargetVariable",
"build_gn_editor.BuildFile",
"pathlib.Path",
"datetime.datetime.now"
] | [((1549, 1671), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Creates Android resources directories and boilerplate files for a module."""'}), "(description=\n 'Creates Android resources directories and boilerplate files for a module.'\n )\n", (1572, 1671), False, 'import argparse... |
import argparse
import numpy as np
import chainer
from siam_rpn.general.eval_sot_vot import eval_sot_vot
from siam_rpn.siam_rpn import SiamRPN
from siam_rpn.siam_rpn_tracker import SiamRPNTracker
from siam_rpn.siam_mask_tracker import SiamMaskTracker
from siam_rpn.general.vot_tracking_dataset import VOTTrackingDatase... | [
"siam_rpn.siam_rpn.SiamRPN",
"chainer.datasets.TupleDataset",
"argparse.ArgumentParser",
"chainer.serializers.load_npz",
"siam_rpn.general.predictor_with_gt.PredictorWithGT",
"siam_rpn.siam_mask_tracker.SiamMaskTracker",
"siam_rpn.general.eval_sot_vot.eval_sot_vot",
"numpy.sort",
"numpy.where",
"c... | [((1213, 1238), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1236, 1238), False, 'import argparse\n'), ((1448, 1474), 'siam_rpn.general.vot_tracking_dataset.VOTTrackingDataset', 'VOTTrackingDataset', (['"""data"""'], {}), "('data')\n", (1466, 1474), False, 'from siam_rpn.general.vot_tracking... |
# -*- coding: utf-8 -*-
# Copyright 2017 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | [
"sydent.http.servlets.get_args",
"sydent.db.threepid_associations.GlobalAssociationStore",
"json.dumps",
"sydent.http.servlets.send_cors",
"logging.getLogger"
] | [((839, 866), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (856, 866), False, 'import logging\n'), ((1451, 1469), 'sydent.http.servlets.send_cors', 'send_cors', (['request'], {}), '(request)\n', (1460, 1469), False, 'from sydent.http.servlets import get_args, jsonwrap, send_cors\n'), ((... |
from django.db import models
from django.utils import timezone
from django.contrib.auth.models import User
from django.urls import reverse
class Hobbies(models.Model):
title = models.CharField(max_length=100)
content = models.TextField()
img_url = models.URLField(max_length=1000, default="https://www.okea.... | [
"django.db.models.TextField",
"django.db.models.URLField",
"django.db.models.CharField",
"django.db.models.ForeignKey",
"django.urls.reverse",
"django.db.models.DateTimeField"
] | [((181, 213), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)'}), '(max_length=100)\n', (197, 213), False, 'from django.db import models\n'), ((228, 246), 'django.db.models.TextField', 'models.TextField', ([], {}), '()\n', (244, 246), False, 'from django.db import models\n'), ((261, 373), '... |
from django.dispatch import receiver
from django.contrib.auth import get_user_model
from messenger_channels.querysets import get_pvchat_ids_cached
from user.signals import user_online
from user.serializers import UserLastSeenSerializer
from messenger_channels.utils import send_event
User = get_user_model()
@receive... | [
"messenger_channels.querysets.get_pvchat_ids_cached",
"django.dispatch.receiver",
"django.contrib.auth.get_user_model",
"user.serializers.UserLastSeenSerializer"
] | [((293, 309), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (307, 309), False, 'from django.contrib.auth import get_user_model\n'), ((313, 347), 'django.dispatch.receiver', 'receiver', (['user_online'], {'sender': 'User'}), '(user_online, sender=User)\n', (321, 347), False, 'from django.disp... |
# Generated by Django 3.1.1 on 2021-03-24 16:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main_app', '0003_auto_20210324_2124'),
]
operations = [
migrations.AddField(
model_name='profile',
name='about_me',
... | [
"django.db.models.TextField"
] | [((338, 394), 'django.db.models.TextField', 'models.TextField', ([], {'blank': '(True)', 'default': '""""""', 'max_length': '(500)'}), "(blank=True, default='', max_length=500)\n", (354, 394), False, 'from django.db import migrations, models\n')] |
#
# Copyright <NAME>, 2019-2020
#
# Ship class and supporting classes
from collections import OrderedDict
from enum import Enum
import torch
from dice import ArmadaDice
from game_constants import (
ArmadaDimensions,
ArmadaTypes
)
class UpgradeType(Enum):
commander = 1
officer ... | [
"dice.ArmadaDice.random_roll",
"game_constants.ArmadaTypes.hull_zones.index",
"dice.ArmadaDice.die_colors.index",
"torch.cuda.is_available",
"game_constants.ArmadaTypes.defense_tokens.index",
"collections.OrderedDict",
"torch.no_grad",
"torch.tensor"
] | [((5769, 5782), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (5780, 5782), False, 'from collections import OrderedDict\n'), ((5807, 5820), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (5818, 5820), False, 'from collections import OrderedDict\n'), ((10757, 10801), 'game_constants.ArmadaType... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Answer',
fields=[
('id', models.AutoField(prima... | [
"django.db.models.TextField",
"django.db.models.CharField",
"django.db.models.AutoField",
"django.db.models.GenericIPAddressField",
"django.db.models.DateTimeField"
] | [((298, 391), 'django.db.models.AutoField', 'models.AutoField', ([], {'primary_key': '(True)', 'auto_created': '(True)', 'verbose_name': '"""ID"""', 'serialize': '(False)'}), "(primary_key=True, auto_created=True, verbose_name='ID',\n serialize=False)\n", (314, 391), False, 'from django.db import models, migrations\... |
from machine import Pin, I2C
from neopixel import NeoPixel
from time import sleep, ticks_ms, ticks_diff
import framebuf
import gc
import sh1106
# Wemos pins - for our and our users' convenience
D0 = const(16)
D1 = const(5)
D2 = const(4)
D3 = const(0)
D4 = const(2)
D5 = const(14)
D6 = const(12)
D7 = const(13)
D8 = con... | [
"framebuf.FrameBuffer",
"time.ticks_ms",
"sh1106.SH1106_I2C",
"gc.collect",
"neopixel.NeoPixel",
"machine.Pin"
] | [((432, 485), 'sh1106.SH1106_I2C', 'sh1106.SH1106_I2C', (['(128)', '(64)', 'i2c', 'None', '(60)'], {'rotate': '(180)'}), '(128, 64, i2c, None, 60, rotate=180)\n', (449, 485), False, 'import sh1106\n'), ((726, 742), 'machine.Pin', 'Pin', (['D8', 'Pin.OUT'], {}), '(D8, Pin.OUT)\n', (729, 742), False, 'from machine import... |
from olc_webportalv2.data import views
from django.conf.urls import url, include
from django.utils.translation import gettext_lazy as _
urlpatterns = [
url(_(r'^data_home/'), views.data_home, name='data_home'),
url(_(r'^raw_data/'), views.raw_data, name='raw_data'),
url(_(r'^assembled_data/'), views.assemb... | [
"django.utils.translation.gettext_lazy"
] | [((161, 177), 'django.utils.translation.gettext_lazy', '_', (['"""^data_home/"""'], {}), "('^data_home/')\n", (162, 177), True, 'from django.utils.translation import gettext_lazy as _\n'), ((224, 239), 'django.utils.translation.gettext_lazy', '_', (['"""^raw_data/"""'], {}), "('^raw_data/')\n", (225, 239), True, 'from ... |
#!/usr/bin/env python3
import inspect
import logging
from typing import Any, Mapping, Sequence, Union
from functools import reduce
from schematic import CONFIG
from schematic.exceptions import (
MissingConfigValueError,
MissingConfigAndArgumentValueError,
)
logger = logging.getLogger(__name__)
def query_d... | [
"functools.reduce",
"schematic.exceptions.MissingConfigValueError",
"schematic.exceptions.MissingConfigAndArgumentValueError",
"logging.getLogger"
] | [((279, 306), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (296, 306), False, 'import logging\n'), ((1038, 1071), 'functools.reduce', 'reduce', (['extract', 'keys', 'dictionary'], {}), '(extract, keys, dictionary)\n', (1044, 1071), False, 'from functools import reduce\n'), ((1813, 1842)... |
import datetime as dt
from django.db import models
from cloudinary.models import CloudinaryField
class photos(models.Model):
# title field
title = models.CharField(max_length=100)
#image field
image = CloudinaryField('image')
| [
"django.db.models.CharField",
"cloudinary.models.CloudinaryField"
] | [((157, 189), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)'}), '(max_length=100)\n', (173, 189), False, 'from django.db import models\n'), ((219, 243), 'cloudinary.models.CloudinaryField', 'CloudinaryField', (['"""image"""'], {}), "('image')\n", (234, 243), False, 'from cloudinary.models... |
# coding: utf-8
"""
mzTab-M reference implementation and validation API.
This is the mzTab-M reference implementation and validation API service. # noqa: E501
OpenAPI spec version: 2.0.0
Contact: <EMAIL>
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import ... | [
"six.iteritems"
] | [((3023, 3056), 'six.iteritems', 'six.iteritems', (['self.swagger_types'], {}), '(self.swagger_types)\n', (3036, 3056), False, 'import six\n')] |
from bsc.config.helper import get_key_from_file
ADDRESS = get_key_from_file('address.json')
API_KEY = get_key_from_file('api_key.json')
| [
"bsc.config.helper.get_key_from_file"
] | [((59, 92), 'bsc.config.helper.get_key_from_file', 'get_key_from_file', (['"""address.json"""'], {}), "('address.json')\n", (76, 92), False, 'from bsc.config.helper import get_key_from_file\n'), ((103, 136), 'bsc.config.helper.get_key_from_file', 'get_key_from_file', (['"""api_key.json"""'], {}), "('api_key.json')\n", ... |
import json
from src.dfa import DFA
from src.state import State
def get_state_by_label(label, states):
for state in states:
if state.label == label:
return state
def from_json(filename):
d = DFA()
d.states = set()
d.initial_state = None
with open(filename, 'r') as r_file:
... | [
"json.load",
"src.dfa.DFA",
"src.state.State"
] | [((223, 228), 'src.dfa.DFA', 'DFA', ([], {}), '()\n', (226, 228), False, 'from src.dfa import DFA\n'), ((336, 353), 'json.load', 'json.load', (['r_file'], {}), '(r_file)\n', (345, 353), False, 'import json\n'), ((490, 550), 'src.state.State', 'State', (['label', "state_data['accepting']", "state_data['initial']"], {}),... |
import random
def coinToss():
number = input("Number of times to flip coin: ")
recordList = []
heads = 0
tails = 0
for amount in range(number):
flip = random.randint(0, 1)
if (flip == 0):
print("Heads")
recordList.append("Heads")
else:
... | [
"random.randint"
] | [((180, 200), 'random.randint', 'random.randint', (['(0)', '(1)'], {}), '(0, 1)\n', (194, 200), False, 'import random\n')] |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.AP_list, name='AP_list'),
]
| [
"django.conf.urls.url"
] | [((74, 114), 'django.conf.urls.url', 'url', (['"""^$"""', 'views.AP_list'], {'name': '"""AP_list"""'}), "('^$', views.AP_list, name='AP_list')\n", (77, 114), False, 'from django.conf.urls import url\n')] |
#!/usr/bin/python3
# -*- coding: UTF-8 -*-
"""
Copyright (C) 2019. Huawei Technologies Co., Ltd. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the Apache License Version 2.0.You may not use
this file except in compliance with the License.
This program ... | [
"caffe.set_mode_gpu",
"argparse.ArgumentParser",
"amct_caffe.set_gpu_mode",
"amct_caffe.create_quant_config",
"os.path.realpath",
"numpy.zeros",
"sys.path.insert",
"caffe.set_mode_cpu",
"amct_caffe.accuracy_based_auto_calibration",
"cv2.imread",
"caffe.set_device",
"pathlib.Path",
"datasets.... | [((1070, 1095), 'os.path.join', 'os.path.join', (['PATH', '"""tmp"""'], {}), "(PATH, 'tmp')\n", (1082, 1095), False, 'import os\n'), ((1105, 1134), 'os.path.join', 'os.path.join', (['PATH', '"""results"""'], {}), "(PATH, 'results')\n", (1117, 1134), False, 'import os\n'), ((1248, 1281), 'os.path.join', 'os.path.join', ... |
#!/usr/bin/python3.5
'''
MIT License
Copyright (c) 2018 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, ... | [
"Cache.Cache",
"gzip.open",
"argparse.ArgumentParser",
"re.compile"
] | [((1317, 1342), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1340, 1342), False, 'import argparse\n'), ((1769, 1789), 're.compile', 're.compile', (['"""[0-9]+"""'], {}), "('[0-9]+')\n", (1779, 1789), False, 'import re\n'), ((3861, 3886), 'gzip.open', 'gzip.open', (['filePath', '"""rt"""'], {... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from copy import deepcopy
from typing import Any, Generator, Iterable, Iterator
__author__ = "<NAME>"
__doc__ = r"""
Created on 28/10/2019
"""
__all__ = ["unzip", "unzipper"]
def unzip(iterable: Iterable) -> Iterable:
""" """
return zip(*... | [
"copy.deepcopy"
] | [((2116, 2137), 'copy.deepcopy', 'deepcopy', (['zippy_twice'], {}), '(zippy_twice)\n', (2124, 2137), False, 'from copy import deepcopy\n'), ((2251, 2272), 'copy.deepcopy', 'deepcopy', (['zippy_trice'], {}), '(zippy_trice)\n', (2259, 2272), False, 'from copy import deepcopy\n'), ((2887, 2907), 'copy.deepcopy', 'deepcopy... |
import dask
from fidesops.graph.config import (
CollectionAddress,
)
from fidesops.graph.traversal import Traversal
from fidesops.models.connectionconfig import ConnectionConfig, ConnectionType
from fidesops.models.policy import Policy
from fidesops.task.graph_task import collect_queries, TaskResources, EMPTY_REQU... | [
"fidesops.graph.config.CollectionAddress",
"dask.config.set",
"fidesops.models.connectionconfig.ConnectionConfig",
"fidesops.models.policy.Policy"
] | [((427, 465), 'dask.config.set', 'dask.config.set', ([], {'scheduler': '"""processes"""'}), "(scheduler='processes')\n", (442, 465), False, 'import dask\n'), ((494, 564), 'fidesops.models.connectionconfig.ConnectionConfig', 'ConnectionConfig', ([], {'key': '"""mysql"""', 'connection_type': 'ConnectionType.postgres'}), ... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.core.files.storage
import django.utils.timezone
import django_extensions.db.fields
from django.conf import settings
from django.db import migrations, models
import stackdio.core.fields
def get_config_file_path(instance, filename):
ret... | [
"django.db.models.TextField",
"django.db.models.CharField",
"django.db.models.ForeignKey",
"django.db.models.BooleanField",
"django.db.models.AutoField",
"django.db.models.IntegerField"
] | [((1026, 1119), 'django.db.models.AutoField', 'models.AutoField', ([], {'verbose_name': '"""ID"""', 'serialize': '(False)', 'auto_created': '(True)', 'primary_key': '(True)'}), "(verbose_name='ID', serialize=False, auto_created=True,\n primary_key=True)\n", (1042, 1119), False, 'from django.db import migrations, mod... |
# Generated by Django 2.0.1 on 2019-06-10 15:07
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('ticket', '0013_auto_20190603_0738'),
]
operations = [
migrations.AddField(
model_name='ticket',... | [
"django.db.models.ForeignKey"
] | [((369, 519), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'blank': '(True)', 'default': 'None', 'null': '(True)', 'on_delete': 'django.db.models.deletion.CASCADE', 'related_name': '"""ticket_team"""', 'to': '"""ticket.Team"""'}), "(blank=True, default=None, null=True, on_delete=django.db.\n models.dele... |
from pywim.utils.stats import iqr
import numpy as np
import pandas as pd
import peakutils
def sensors_estimation(
signal_data: pd.DataFrame, sensors_delta_distance: list
) -> [np.array]:
"""
:param signal_data:
:param sensors_delta_distance:
:return:
"""
# x axis: time
x = signal_dat... | [
"peakutils.indexes",
"numpy.array",
"pandas.Series",
"numpy.concatenate"
] | [((1659, 1671), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (1667, 1671), True, 'import numpy as np\n'), ((506, 550), 'peakutils.indexes', 'peakutils.indexes', (['y'], {'thres': '(0.5)', 'min_dist': '(30)'}), '(y, thres=0.5, min_dist=30)\n', (523, 550), False, 'import peakutils\n'), ((1746, 1791), 'numpy.concate... |
from setuptools import find_packages, setup
INSTALL_REQUIRES = [
'cheroot==8.3.0',
'flask==1.1.2',
'flask-sqlalchemy==2.4.3',
'sqlalchemy==1.3.7',
'bcrypt==3.1.7',
'hashids==1.2.0',
'click==7.1.2',
'markdown==2.6.9',
'mdx-linkify==1.0',
]
DEV_REQUIRES = [
'wheel',
'twi... | [
"setuptools.find_packages"
] | [((562, 594), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "['tests']"}), "(exclude=['tests'])\n", (575, 594), False, 'from setuptools import find_packages, setup\n')] |
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework.renderers import JSONRenderer
from cantusdata.models import Manuscript
from cantusdata.serializers.search import SearchSerializer
from cantusdata.helpers.solrsearch import SolrSearchQueryless
class ManuscriptGlyp... | [
"cantusdata.models.Manuscript.objects.get",
"rest_framework.response.Response"
] | [((485, 524), 'cantusdata.models.Manuscript.objects.get', 'Manuscript.objects.get', ([], {'id': "kwargs['pk']"}), "(id=kwargs['pk'])\n", (507, 524), False, 'from cantusdata.models import Manuscript\n'), ((846, 862), 'rest_framework.response.Response', 'Response', (['result'], {}), '(result)\n', (854, 862), False, 'from... |
import requests
import json
import os
import logging
from random import randint
from bs4 import BeautifulSoup
class AFITop100:
def __init__(self, quotes):
self.quotes = quotes
def get_random_quote(self):
firstquote_index = min(self.quotes.keys())
lastquote_index = max(self.quotes.key... | [
"json.dump",
"logging.error",
"json.load",
"random.randint",
"os.path.dirname",
"os.path.exists",
"os.path.expandvars",
"requests.get",
"bs4.BeautifulSoup",
"os.path.join"
] | [((1104, 1131), 'os.path.exists', 'os.path.exists', (['quotes_file'], {}), '(quotes_file)\n', (1118, 1131), False, 'import os\n'), ((1175, 1207), 'os.path.expandvars', 'os.path.expandvars', (['"""$HOME/data"""'], {}), "('$HOME/data')\n", (1193, 1207), False, 'import os\n'), ((1219, 1255), 'os.path.join', 'os.path.join'... |
from typing import Any
from .logging import logger, LogLevelEnum
from clubbi_utils import json
from typing import Callable
import logging
class JsonLogger:
def __init__(self, logger:logging.Logger):
self.logger = logger
setattr(self, "fatal", self._log(LogLevelEnum.fatal))
setattr(self, "e... | [
"clubbi_utils.json.dumps"
] | [((855, 874), 'clubbi_utils.json.dumps', 'json.dumps', (['payload'], {}), '(payload)\n', (865, 874), False, 'from clubbi_utils import json\n')] |
from typing import List, Dict, Tuple
from collections import Counter
import random
import lesson3
from lesson5 import inverse_normal_cdf
import math
import matplotlib.pyplot as plt
from lesson4 import correlation, standard_deviation
from lesson3 import Matrix, Vector, make_matrix, vector_mean, subtract, magnitude, sca... | [
"matplotlib.pyplot.title",
"csv.reader",
"collections.defaultdict",
"lesson3.dot",
"lesson3.subtract",
"lesson3.vector_mean",
"lesson4.standard_deviation",
"lesson4.correlation",
"random.seed",
"matplotlib.pyplot.subplots",
"lesson3.distance",
"dateutil.parser.parse",
"matplotlib.pyplot.show... | [((1054, 1068), 'random.seed', 'random.seed', (['(0)'], {}), '(0)\n', (1065, 1068), False, 'import random\n'), ((1728, 1788), 'matplotlib.pyplot.scatter', 'plt.scatter', (['xs', 'ys1'], {'marker': '"""."""', 'color': '"""black"""', 'label': '"""ys1"""'}), "(xs, ys1, marker='.', color='black', label='ys1')\n", (1739, 17... |
# -*- coding: utf-8 -*-
import os
import subprocess
import sys
import platform
from ruamel.yaml import YAML
from ruamel.yaml.compat import StringIO
class MyYAML(YAML):
def dump(self, data, stream=None, **kw):
inefficient = False
if stream is None:
inefficient = True
stre... | [
"subprocess.Popen",
"os.remove",
"ruamel.yaml.compat.StringIO",
"ruamel.yaml.YAML.dump",
"platform.system"
] | [((485, 534), 'subprocess.Popen', 'subprocess.Popen', (['command'], {'stderr': 'subprocess.PIPE'}), '(command, stderr=subprocess.PIPE)\n', (501, 534), False, 'import subprocess\n'), ((344, 379), 'ruamel.yaml.YAML.dump', 'YAML.dump', (['self', 'data', 'stream'], {}), '(self, data, stream, **kw)\n', (353, 379), False, 'f... |
import li
import json
# testing util
if __name__ == "__main__":
# execute only if run as a script
users=["Le_Scratch","justmaker","kazeriahm","Khrok","fauzi061089", "Vladismen", "kapuso", "Vadum-tv", "El-Nino9", "mathemagician18", "jongy", "shtrubi", "Teju12345", "papasi", "dalmatinac101"]
for line in li... | [
"li.game_to_message",
"li.stream"
] | [((318, 334), 'li.stream', 'li.stream', (['users'], {}), '(users)\n', (327, 334), False, 'import li\n'), ((350, 374), 'li.game_to_message', 'li.game_to_message', (['line'], {}), '(line)\n', (368, 374), False, 'import li\n')] |
import os, sys
import unittest
from tilde.core.api import API
from tilde.core.settings import BASE_DIR, EXAMPLE_DIR
class Test_API(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.sample = API()
def test_count_classifiers(self):
available_classifiers = []
path = os.path... | [
"os.path.realpath",
"tilde.core.api.API",
"os.path.join",
"os.listdir"
] | [((218, 223), 'tilde.core.api.API', 'API', ([], {}), '()\n', (221, 223), False, 'from tilde.core.api import API\n'), ((313, 359), 'os.path.realpath', 'os.path.realpath', (["(BASE_DIR + '/../classifiers')"], {}), "(BASE_DIR + '/../classifiers')\n", (329, 359), False, 'import os, sys\n'), ((390, 406), 'os.listdir', 'os.l... |
"""Records new images for workers and uploads targets."""
import aiohttp
import aioredis
from .app import create_app
class Service:
def __init__(self, port, imagery_host, imagery_port, interop_host,
interop_port, redis_host, redis_port, max_auto_targets):
"""Create a new image-rec-maste... | [
"aiohttp.web.AppRunner",
"aiohttp.ClientSession",
"aiohttp.web.TCPSite"
] | [((681, 713), 'aiohttp.web.AppRunner', 'aiohttp.web.AppRunner', (['self._app'], {}), '(self._app)\n', (702, 713), False, 'import aiohttp\n'), ((859, 895), 'aiohttp.ClientSession', 'aiohttp.ClientSession', ([], {'loop': 'app.loop'}), '(loop=app.loop)\n', (880, 895), False, 'import aiohttp\n'), ((1080, 1130), 'aiohttp.we... |
import json, os
from flask import current_app, url_for
from flask.ext.script import Command
from flask.ext.security.confirmable import confirm_user
from flask_application.models import FlaskDocument
from flask_application.profiles.models import Profile, ImageTable
from flask_application.guides.models import Guide, S... | [
"flask.current_app.user_datastore.commit",
"flask_application.models.FlaskDocument.all_subclasses",
"flask_application.profiles.models.Profile.create_default_profile",
"flask_application.profiles.models.Profile",
"json.loads",
"flask_application.guides.models.Guide",
"flask_application.guides.models.Gui... | [((525, 555), 'flask_application.models.FlaskDocument.all_subclasses', 'FlaskDocument.all_subclasses', ([], {}), '()\n', (553, 555), False, 'from flask_application.models import FlaskDocument\n'), ((1091, 1126), 'flask.current_app.user_datastore.commit', 'current_app.user_datastore.commit', ([], {}), '()\n', (1124, 112... |
"""
CentalService.auth.views
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Contains all the forms for the CentralService authorization functions.
The two forms that are used are for login and for creating a new user.
@copyright: (c) 2016 SynergyLabs
@license: UCSD License. See License file for details.
"""
from flask_wtf import Form... | [
"wtforms.ValidationError",
"wtforms.validators.Email",
"wtforms.BooleanField",
"wtforms.SubmitField",
"wtforms.validators.EqualTo",
"wtforms.validators.DataRequired"
] | [((718, 751), 'wtforms.BooleanField', 'BooleanField', (['"""Keep me logged in"""'], {}), "('Keep me logged in')\n", (730, 751), False, 'from wtforms import StringField, PasswordField, BooleanField, SubmitField\n'), ((765, 786), 'wtforms.SubmitField', 'SubmitField', (['"""Log In"""'], {}), "('Log In')\n", (776, 786), Fa... |
# Generated by Django 2.1.7 on 2019-04-10 01:21
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('movies', '0005_auto_20190410_0659'),
]
operations = [
migrations.AddField(
model_name='movies',
name='ph_credit',
... | [
"django.db.models.IntegerField"
] | [((336, 378), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'blank': '(True)', 'null': '(True)'}), '(blank=True, null=True)\n', (355, 378), False, 'from django.db import migrations, models\n')] |
import sys
import unittest
try:
from StringIO import StringIO
except:
from io import StringIO
class TestControllerPlugin(unittest.TestCase):
# Factory
def test_make_cache_controllerplugin_factory(self):
from supervisor_cache import controllerplugin
controller = DummyController()
... | [
"unittest.main",
"io.StringIO",
"supervisor_cache.controllerplugin.make_cache_controllerplugin",
"supervisor_cache.rpcinterface.CacheNamespaceRPCInterface",
"unittest.findTestCases",
"supervisor.tests.base.DummySupervisor"
] | [((8366, 8411), 'unittest.findTestCases', 'unittest.findTestCases', (['sys.modules[__name__]'], {}), '(sys.modules[__name__])\n', (8388, 8411), False, 'import unittest\n'), ((8444, 8483), 'unittest.main', 'unittest.main', ([], {'defaultTest': '"""test_suite"""'}), "(defaultTest='test_suite')\n", (8457, 8483), False, 'i... |
''' Pytest corresponding to calc_norm_v '''
# import numpy as np
import shortrate_model_vasicek as vas
import interest_rate_capfloor_convenience as intconv
mdl = vas.short_rate_vasicek(kappa=0.86, theta=0.08, sigma=0.01, r0=0.06,
norm_method=intconv.calc_v_norm_1d, dbg=True)
def test_norm... | [
"shortrate_model_vasicek.short_rate_vasicek"
] | [((163, 280), 'shortrate_model_vasicek.short_rate_vasicek', 'vas.short_rate_vasicek', ([], {'kappa': '(0.86)', 'theta': '(0.08)', 'sigma': '(0.01)', 'r0': '(0.06)', 'norm_method': 'intconv.calc_v_norm_1d', 'dbg': '(True)'}), '(kappa=0.86, theta=0.08, sigma=0.01, r0=0.06,\n norm_method=intconv.calc_v_norm_1d, dbg=Tru... |
from bokeh.plotting import figure, output_file, show
from bokeh.models import Arrow, OpenHead, NormalHead, VeeHead
output_file("arrow.html", title="arrow.py example")
p = figure(plot_width=600, plot_height=600, x_range=(-0.1,1.1), y_range=(-0.1,0.8))
p.circle(x=[0, 1, 0.5], y=[0, 0, 0.7], radius=0.1, color=["navy", ... | [
"bokeh.plotting.figure",
"bokeh.models.NormalHead",
"bokeh.plotting.output_file",
"bokeh.plotting.show",
"bokeh.models.OpenHead",
"bokeh.models.VeeHead"
] | [((116, 167), 'bokeh.plotting.output_file', 'output_file', (['"""arrow.html"""'], {'title': '"""arrow.py example"""'}), "('arrow.html', title='arrow.py example')\n", (127, 167), False, 'from bokeh.plotting import figure, output_file, show\n'), ((173, 258), 'bokeh.plotting.figure', 'figure', ([], {'plot_width': '(600)',... |
from django.core.exceptions import PermissionDenied
from django.utils.crypto import get_random_string
from rest_framework_jwt.settings import api_settings
from utils.constants import AUTO_GENERATED_PASSWORD_LENGTH
# binding.pry equivalent
# import code; code.interact(local=locals())
def get_hustler_data(hustler_obj... | [
"django.utils.crypto.get_random_string",
"hustlers.api.serializers.HustlerSerializer",
"django.core.exceptions.PermissionDenied"
] | [((1700, 1737), 'django.utils.crypto.get_random_string', 'get_random_string', (['length_of_password'], {}), '(length_of_password)\n', (1717, 1737), False, 'from django.utils.crypto import get_random_string\n'), ((535, 568), 'hustlers.api.serializers.HustlerSerializer', 'HustlerSerializer', (['hustler_object'], {}), '(h... |
from datetime import datetime
from flask import Flask
from flask import request
from flask import send_file
try:
# restplus is dead: https://github.com/noirbizarre/flask-restplus/issues/770
from flask_restx import Resource, Api
from flask_restx import reqparse
except ImportError:
try:
from f... | [
"flask_restplus.Api",
"flask.Flask",
"flask_restplus.reqparse.RequestParser",
"datetime.datetime.fromtimestamp",
"flask.send_file"
] | [((612, 627), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (617, 627), False, 'from flask import Flask\n'), ((634, 642), 'flask_restplus.Api', 'Api', (['app'], {}), '(app)\n', (637, 642), False, 'from flask_restplus import Resource, Api\n'), ((799, 823), 'flask_restplus.reqparse.RequestParser', 'reqparse... |
#!/usr/bin/env python
# Copyright (c) 2018, 2019 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT f... | [
"shutil.rmtree",
"argparse.ArgumentParser",
"sys.exit"
] | [((1025, 1100), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Script to uninstall oci-ansible-role"""'}), "(description='Script to uninstall oci-ansible-role')\n", (1048, 1100), False, 'import argparse\n'), ((1473, 1484), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (1481, 1484), Fal... |
from geopy.distance import geodesic
from pprint import pprint
from itertools import permutations
from tqdm import tqdm
import gmplot
from math import cos, sin, atan2, sqrt
import time
import re
home = (43.077589, -89.414075)
with open('wisc-coords-local.txt', 'r') as f:
text = f.read()
def dist_between(coords, ... | [
"geopy.distance.geodesic",
"re.split",
"gmplot.GoogleMapPlotter"
] | [((1452, 1501), 'gmplot.GoogleMapPlotter', 'gmplot.GoogleMapPlotter', (['center[0]', 'center[1]', '(13)'], {}), '(center[0], center[1], 13)\n', (1475, 1501), False, 'import gmplot\n'), ((474, 494), 're.split', 're.split', (['"""0{4},"""', 'x'], {}), "('0{4},', x)\n", (482, 494), False, 'import re\n'), ((343, 365), 'geo... |
# -*- coding: utf-8 -*-
import pytest
from giraffez._teradata import RequestEnded, StatementEnded, StatementInfoEnded
import giraffez
from giraffez.constants import *
from giraffez.errors import *
from giraffez.types import *
class ResultsHelper:
"""
Helps to emulate how exceptions are raised when working w... | [
"giraffez.Cmd",
"pytest.raises",
"pytest.mark.usefixtures"
] | [((826, 870), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""config"""', '"""context"""'], {}), "('config', 'context')\n", (849, 870), False, 'import pytest\n'), ((2444, 2500), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""config"""', '"""context"""', '"""tmpfiles"""'], {}), "('config', 'cont... |
#!/usr/bin/env python3
"""Command line tasks to build and deploy the ACW Battle Data."""
import os
import shutil
from os import path
import logging
from invoke import task
LOGGER = logging.getLogger(__name__)
@task
def setup(ctx):
"""Setup directory structure."""
os.makedirs(ctx.dst, exist_ok=True)
@task... | [
"os.makedirs",
"os.path.basename",
"os.path.exists",
"invoke.task",
"os.path.join",
"logging.getLogger"
] | [((184, 211), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (201, 211), False, 'import logging\n'), ((316, 327), 'invoke.task', 'task', (['setup'], {}), '(setup)\n', (320, 327), False, 'from invoke import task\n'), ((601, 612), 'invoke.task', 'task', (['setup'], {}), '(setup)\n', (605, 6... |
from Agent import Agent
from Color import Color
from State import State
class MiniMaxAgent(Agent):
def make_decision(self, board):
self.receive_armies(board)
state = State(board, self.available_armies_count, 1)
place_armies_result, _ = self.maximize_place_armies(state, -999999, 999999)
... | [
"State.State"
] | [((189, 233), 'State.State', 'State', (['board', 'self.available_armies_count', '(1)'], {}), '(board, self.available_armies_count, 1)\n', (194, 233), False, 'from State import State\n')] |
from django.shortcuts import render
from django.http import HttpResponseRedirect
from django.urls import reverse
from django.contrib.flatpages.forms import FlatpageForm
from django.contrib.flatpages.models import FlatPage
from django.contrib.auth.decorators import login_required
"""Views for editing legal pages."""
#... | [
"django.shortcuts.render",
"django.urls.reverse",
"django.contrib.flatpages.forms.FlatpageForm",
"django.contrib.flatpages.models.FlatPage.objects.get"
] | [((680, 723), 'django.contrib.flatpages.models.FlatPage.objects.get', 'FlatPage.objects.get', ([], {'url': '"""/legal/imprint/"""'}), "(url='/legal/imprint/')\n", (700, 723), False, 'from django.contrib.flatpages.models import FlatPage\n'), ((1012, 1073), 'django.shortcuts.render', 'render', (['request', '"""om/legal/e... |
from types import FunctionType
from fullcontact import FullContact
from nose.tools import assert_equal, assert_true
class TestFullContact(object):
def test_init(self):
fc = FullContact('test_key')
assert_equal(fc.api_key, 'test_key')
def test__prepare_batch_url(self):
fc = FullContact... | [
"fullcontact.FullContact",
"nose.tools.assert_equal"
] | [((187, 210), 'fullcontact.FullContact', 'FullContact', (['"""test_key"""'], {}), "('test_key')\n", (198, 210), False, 'from fullcontact import FullContact\n'), ((219, 255), 'nose.tools.assert_equal', 'assert_equal', (['fc.api_key', '"""test_key"""'], {}), "(fc.api_key, 'test_key')\n", (231, 255), False, 'from nose.too... |
from time import time
from django.core.urlresolvers import reverse
from rest_framework.test import APIClient
# todo: Backend?
# from accounts.business.authentication import Backend
from accounts.business.fields import RecoverTypeField
from vaultier.test.tools import FileAccessMixin, VaultierAPIClient
from django.utils ... | [
"vaultier.test.tools.VaultierAPIClient",
"django.core.urlresolvers.reverse",
"django.utils.timezone.now",
"time.time",
"rest_framework.test.APIClient",
"vaultier.test.tools.FileAccessMixin"
] | [((406, 426), 'django.core.urlresolvers.reverse', 'reverse', (['"""auth-auth"""'], {}), "('auth-auth')\n", (413, 426), False, 'from django.core.urlresolvers import reverse\n'), ((440, 451), 'rest_framework.test.APIClient', 'APIClient', ([], {}), '()\n', (449, 451), False, 'from rest_framework.test import APIClient\n'),... |
from glustercli2.parsers import parsed_pool_list
class Peer:
def __init__(self, cli, hostname):
self.cli = cli
self.hostname = hostname
@classmethod
def peer_cmd(cls, cli, cmd):
return cli.exec_gluster_command(
["peer"] + cmd
)
@classmethod
def list(cl... | [
"glustercli2.parsers.parsed_pool_list"
] | [((402, 423), 'glustercli2.parsers.parsed_pool_list', 'parsed_pool_list', (['out'], {}), '(out)\n', (418, 423), False, 'from glustercli2.parsers import parsed_pool_list\n')] |
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase
from django.test.utils import override_settings
from django.utils import six
from .middleware import RedirectFallbackMiddleware
from .models import Redirect
@override_settings(
APPEND_SLASH=F... | [
"django.utils.six.text_type",
"django.test.utils.override_settings"
] | [((977, 1013), 'django.test.utils.override_settings', 'override_settings', ([], {'APPEND_SLASH': '(True)'}), '(APPEND_SLASH=True)\n', (994, 1013), False, 'from django.test.utils import override_settings\n'), ((1317, 1353), 'django.test.utils.override_settings', 'override_settings', ([], {'APPEND_SLASH': '(True)'}), '(A... |
import argparse
import csv
import sys
from core_data_modules.cleaners import Codes
from core_data_modules.logging import Logger
from core_data_modules.traced_data.io import TracedDataJsonIO
from core_data_modules.util import PhoneNumberUuidTable
Logger.set_project_name("OCHA")
log = Logger(__name__)
if __name__ == "... | [
"core_data_modules.logging.Logger.set_project_name",
"sys.setrecursionlimit",
"argparse.ArgumentParser",
"core_data_modules.traced_data.io.TracedDataJsonIO.import_json_to_traced_data_iterable",
"core_data_modules.logging.Logger",
"core_data_modules.util.PhoneNumberUuidTable.load",
"csv.DictWriter"
] | [((248, 279), 'core_data_modules.logging.Logger.set_project_name', 'Logger.set_project_name', (['"""OCHA"""'], {}), "('OCHA')\n", (271, 279), False, 'from core_data_modules.logging import Logger\n'), ((286, 302), 'core_data_modules.logging.Logger', 'Logger', (['__name__'], {}), '(__name__)\n', (292, 302), False, 'from ... |
from matplotlib.colors import hsv_to_rgb, to_hex
def get_n_colours(n, s=0.5, v=0.95):
return [hsv_to_rgb((i/n, s, v)) for i in range(n)]
def extend_colour_map(data, colour_map, date_colour):
missing_values = [x for x in data.dropna().unique() if x not in colour_map] # All events that don't have a specified... | [
"matplotlib.colors.to_hex",
"matplotlib.colors.hsv_to_rgb"
] | [((100, 125), 'matplotlib.colors.hsv_to_rgb', 'hsv_to_rgb', (['(i / n, s, v)'], {}), '((i / n, s, v))\n', (110, 125), False, 'from matplotlib.colors import hsv_to_rgb, to_hex\n'), ((752, 761), 'matplotlib.colors.to_hex', 'to_hex', (['c'], {}), '(c)\n', (758, 761), False, 'from matplotlib.colors import hsv_to_rgb, to_he... |
# Generated by Django 2.2.5 on 2019-10-27 02:27
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('helloWorldApp', '0010_auto_20191025_2008'),
]
op... | [
"django.db.migrations.swappable_dependency",
"django.db.models.ManyToManyField"
] | [((194, 251), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (225, 251), False, 'from django.db import migrations, models\n'), ((444, 540), 'django.db.models.ManyToManyField', 'models.ManyToManyField', ([], {'blank': '(... |
from sense_hat import SenseHat
import threading
import firebase_admin
from firebase_admin import credentials, firestore
# constants
COLLECTION = 'raspberry'
DOCUMENT = 'omgeving'
# firebase
cred = credentials.Certificate("../config/firebase_admin.json")
firebase_admin.initialize_app(cred)
# connect firestore
db = fi... | [
"firebase_admin.credentials.Certificate",
"threading.Timer",
"sense_hat.SenseHat",
"firebase_admin.firestore.client",
"firebase_admin.initialize_app"
] | [((199, 255), 'firebase_admin.credentials.Certificate', 'credentials.Certificate', (['"""../config/firebase_admin.json"""'], {}), "('../config/firebase_admin.json')\n", (222, 255), False, 'from firebase_admin import credentials, firestore\n'), ((256, 291), 'firebase_admin.initialize_app', 'firebase_admin.initialize_app... |
# -*- coding: utf-8 -*-
"""
Created on Sat Sep 15 17:25:09 2018
@author: Heller
"""
import os
inde="1"
inde=int(inde)
flag=0
for f in os.listdir("notes/"):
flag=flag+1
if(flag==inde):
file="notes/"+f
with open(file) as fa:
content = fa.readlines()
content=[x.strip() for x in content... | [
"os.listdir"
] | [((135, 155), 'os.listdir', 'os.listdir', (['"""notes/"""'], {}), "('notes/')\n", (145, 155), False, 'import os\n')] |
from setuptools import setup, find_packages
setup(name='pydukeenergy',
version='0.0.6',
description='Interface to the unofficial Duke Energy API',
url='http://github.com/w1ll1am23/pyduke-energy',
author='<NAME>',
license='MIT',
install_requires=['requests>=2.0', 'beautifulsoup4>=4.6... | [
"setuptools.find_packages"
] | [((397, 468), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "['dist', '*.test', '*.test.*', 'test.*', 'test']"}), "(exclude=['dist', '*.test', '*.test.*', 'test.*', 'test'])\n", (410, 468), False, 'from setuptools import setup, find_packages\n')] |
import collections
import random
def next_move_state(map, head_xy, direction):
switcher = {
'left': (-1, 0),
'right': (1, 0),
'up': (0, -1),
'down': (0, 1)
}
return map[head_xy[1] + switcher.get(direction)[1]][head_xy[0] + switcher.get(direction)[0]]
def next_direction(map,... | [
"random.choice",
"collections.deque"
] | [((592, 641), 'collections.deque', 'collections.deque', (['[[(starting[0], starting[1])]]'], {}), '([[(starting[0], starting[1])]])\n', (609, 641), False, 'import collections\n'), ((1637, 1662), 'random.choice', 'random.choice', (['directions'], {}), '(directions)\n', (1650, 1662), False, 'import random\n')] |
from google_images_download import google_images_download
food_list = ['food with protein','unhealthy food','carbs','food with sugar','vegetables']
for food in food_list:
args = {"keywords":food, "format": "jpg", "limit":1000, "output_directory":"./tf_files/food_images"}
response = google_images_downl... | [
"google_images_download.google_images_download.googleimagesdownload"
] | [((301, 346), 'google_images_download.google_images_download.googleimagesdownload', 'google_images_download.googleimagesdownload', ([], {}), '()\n', (344, 346), False, 'from google_images_download import google_images_download\n')] |
"""@package MuSCADeT
"""
from scipy import signal as scp
import numpy as np
import matplotlib.pyplot as plt
import astropy.io.fits as pf
import scipy.ndimage.filters as med
import MuSCADeT.pca_ring_spectrum as pcas
import MuSCADeT.wave_transform as mw
NOISE_TAB = np.array([ 0.8907963 , 0.20066385, 0.08550751, 0... | [
"matplotlib.pyplot.title",
"MuSCADeT.pca_ring_spectrum.pca_lines",
"numpy.abs",
"numpy.sum",
"numpy.ones",
"numpy.shape",
"numpy.mean",
"scipy.signal.fftconvolve",
"numpy.int_",
"numpy.multiply",
"numpy.copy",
"numpy.max",
"numpy.reshape",
"MuSCADeT.wave_transform.wave_transform",
"numpy... | [((269, 379), 'numpy.array', 'np.array', (['[0.8907963, 0.20066385, 0.08550751, 0.04121745, 0.02042497, 0.01018976, \n 0.00504662, 0.00368314]'], {}), '([0.8907963, 0.20066385, 0.08550751, 0.04121745, 0.02042497, \n 0.01018976, 0.00504662, 0.00368314])\n', (277, 379), True, 'import numpy as np\n'), ((407, 494), '... |
import os
import typing as T
import warnings
import fsspec # type: ignore
import numpy as np
import numpy.typing as NT
import pandas as pd # type: ignore
import rioxarray # type: ignore
import xarray as xr
from xarray_sentinel import conventions, esa_safe
def open_calibration_dataset(calibration: esa_safe.PathTy... | [
"numpy.allclose",
"xarray.Variable",
"numpy.arange",
"os.path.join",
"numpy.full",
"rioxarray.open_rasterio",
"fsspec.get_fs_token_paths",
"os.path.dirname",
"numpy.linspace",
"numpy.fromstring",
"xarray_sentinel.esa_safe.get_ancillary_data_paths",
"xarray_sentinel.conventions.update_attribute... | [((365, 440), 'xarray_sentinel.esa_safe.parse_tag_list', 'esa_safe.parse_tag_list', (['calibration', '""".//calibrationVector"""', '"""calibration"""'], {}), "(calibration, './/calibrationVector', 'calibration')\n", (388, 440), False, 'from xarray_sentinel import conventions, esa_safe\n'), ((1404, 1424), 'numpy.array',... |
"""
Authors: <NAME>, <NAME>
Helper functions:
1. Overall score between, explainability and performance with normalization between 0-1 (logaritmic_power, sigmoid_power).
2. An explainability minimization (smaller is better) with additive constrains according the number of leaves and the error for the optimization.
... | [
"numpy.log2",
"sklearn.metrics.accuracy_score",
"math.exp"
] | [((500, 530), 'sklearn.metrics.accuracy_score', 'accuracy_score', (['y_true', 'y_pred'], {}), '(y_true, y_pred)\n', (514, 530), False, 'from sklearn.metrics import accuracy_score\n'), ((796, 811), 'numpy.log2', 'np.log2', (['(y ** z)'], {}), '(y ** z)\n', (803, 811), True, 'import numpy as np\n'), ((1104, 1116), 'math.... |
# Copyright 2016, AT&T
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | [
"gluon.api.baseObject.APIBase",
"datetime.datetime.today",
"gluon.api.baseObject.RootObjectController.class_builder",
"mock.patch",
"gluon.api.baseObject.APIBaseObject.class_builder",
"gluon.api.baseObject.APIBaseList.class_builder",
"mock.Mock",
"datetime.datetime.now"
] | [((2628, 2676), 'mock.patch', 'patch', (['"""gluon.api.baseObject.dbapi.get_instance"""'], {}), "('gluon.api.baseObject.dbapi.get_instance')\n", (2633, 2676), False, 'from mock import patch\n'), ((4263, 4311), 'mock.patch', 'patch', (['"""gluon.api.baseObject.dbapi.get_instance"""'], {}), "('gluon.api.baseObject.dbapi.... |
from SenseCells.tts import tts
def go_to_sleep():
tts('Goodbye! Have a great day!')
quit()
| [
"SenseCells.tts.tts"
] | [((55, 88), 'SenseCells.tts.tts', 'tts', (['"""Goodbye! Have a great day!"""'], {}), "('Goodbye! Have a great day!')\n", (58, 88), False, 'from SenseCells.tts import tts\n')] |
"""Replicate win32 time.clock() behavior for all platforms"""
import time
import sys
_MAXFORWARD = 100
_FUDGE = 1
class RelativeTime:
def __init__(self):
self.time = time.time()
self.offset = 0
def get_time(self):
t = time.time() + self.offset
if t < self.time or t > self.ti... | [
"time.time"
] | [((182, 193), 'time.time', 'time.time', ([], {}), '()\n', (191, 193), False, 'import time\n'), ((255, 266), 'time.time', 'time.time', ([], {}), '()\n', (264, 266), False, 'import time\n')] |
# Author : <NAME>
# Contact : <EMAIL>
# Date : Feb 16, 2020
import random
import time
import numpy as np
import random
import time
import numpy as np
try:
from CS5313_Localization_Env import maze
except:
print(
'Problem finding CS5313_Localization_Env.maze... Trying to "import maze" only...'... | [
"pandas.DataFrame",
"numpy.sum",
"random.randint",
"RobotLocalization.Game",
"maze.make_maze",
"time.sleep",
"random.random",
"random.seed",
"numpy.random.rand"
] | [((6124, 6146), 'random.seed', 'random.seed', (['self.seed'], {}), '(self.seed)\n', (6135, 6146), False, 'import random\n'), ((6214, 6264), 'maze.make_maze', 'maze.make_maze', (['dimensions[0]', 'dimensions[1]', 'seed'], {}), '(dimensions[0], dimensions[1], seed)\n', (6228, 6264), False, 'import maze\n'), ((7779, 7789)... |
# -*- coding: utf-8 -*-
"""Simple authenticaton backend based on HTTP basic authentication.
:copyright: (c) 2016-2019 by <NAME>
:license: Apache 2.0, see LICENSE
"""
import logging
import requests
from django.contrib.auth import get_user_model
from django.contrib.auth.backends import ModelBackend
from django.conf ... | [
"requests.head",
"django.contrib.auth.get_user_model",
"logging.getLogger"
] | [((347, 374), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (364, 374), False, 'import logging\n'), ((2610, 2626), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (2624, 2626), False, 'from django.contrib.auth import get_user_model\n'), ((1438, 1483), 'requests.... |
#############################START LICENSE##########################################
# Copyright (C) 2019 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/l... | [
"pymedphys.labs.pedromartinez.utils.utils.range_invert",
"tqdm.tqdm",
"pydicom.dcmread",
"argparse.ArgumentParser",
"os.path.dirname",
"numpy.zeros",
"skimage.feature.blob_log",
"numpy.argmin",
"pymedphys.labs.pedromartinez.utils.utils.norm01",
"numpy.shape",
"matplotlib.pyplot.figure",
"numpy... | [((1874, 1890), 'tqdm.tqdm', 'tqdm', (['imcirclist'], {}), '(imcirclist)\n', (1878, 1890), False, 'from tqdm import tqdm\n'), ((2983, 3006), 'pydicom.dcmread', 'pydicom.dcmread', (['filenm'], {}), '(filenm)\n', (2998, 3006), False, 'import pydicom\n'), ((3017, 3031), 'datetime.datetime.now', 'datetime.now', ([], {}), '... |
import nltk
import json
import numpy as np
from nltk import word_tokenize
import triton_python_backend_utils as pb_utils
class TritonPythonModel:
"""Your Python model must use the same class name. Every Python model
that is created must have "TritonPythonModel" as the class name.
"""
def initialize... | [
"triton_python_backend_utils.get_output_config_by_name",
"json.loads",
"triton_python_backend_utils.Tensor",
"triton_python_backend_utils.get_input_tensor_by_name",
"numpy.array",
"triton_python_backend_utils.InferenceResponse",
"triton_python_backend_utils.triton_string_to_numpy",
"nltk.download",
... | [((1180, 1212), 'json.loads', 'json.loads', (["args['model_config']"], {}), "(args['model_config'])\n", (1190, 1212), False, 'import json\n'), ((1275, 1334), 'triton_python_backend_utils.get_output_config_by_name', 'pb_utils.get_output_config_by_name', (['model_config', '"""OUTPUT0"""'], {}), "(model_config, 'OUTPUT0')... |
from arlo import Arlo
from datetime import timedelta, date
import datetime
import sys
import platform
import os.path
from os import path
USERNAME = ''
PASSWORD = ''
try:
# Instantiating the Arlo object automatically calls Login(), which returns an oAuth token that gets cached.
# Subsequent successful calls to lo... | [
"platform.node",
"arlo.Arlo",
"os.path.exists",
"datetime.date.today",
"datetime.timedelta"
] | [((361, 385), 'arlo.Arlo', 'Arlo', (['USERNAME', 'PASSWORD'], {}), '(USERNAME, PASSWORD)\n', (365, 385), False, 'from arlo import Arlo\n'), ((696, 711), 'platform.node', 'platform.node', ([], {}), '()\n', (709, 711), False, 'import platform\n'), ((777, 792), 'platform.node', 'platform.node', ([], {}), '()\n', (790, 792... |
# SPDX-FileCopyrightText: 2022 <NAME> <<EMAIL>>
#
# SPDX-License-Identifier: MIT
import re
from allauth.account.models import EmailAddress
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group
from django.core.exceptions import ValidationError
from django.db import models
def f... | [
"django.db.models.TextField",
"django.core.exceptions.ValidationError",
"django.db.models.CharField",
"django.db.models.ForeignKey",
"django.contrib.auth.get_user_model",
"re.match",
"django.db.models.BooleanField",
"django.db.models.EmailField",
"allauth.account.models.EmailAddress.objects.get",
... | [((854, 898), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(64)', 'unique': '(True)'}), '(max_length=64, unique=True)\n', (870, 898), False, 'from django.db import models\n'), ((917, 961), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(255)', 'blank': '(True)'}), '(max... |
from __future__ import absolute_import, division, print_function, unicode_literals
from divvy.ledger.Args import ARGS
from divvy.ledger import SearchLedgers
import json
SAFE = True
HELP = """print
Print the ledgers to stdout. The default command."""
def run_print(server):
ARGS.display(print, server, SearchLe... | [
"divvy.ledger.SearchLedgers.search"
] | [((312, 340), 'divvy.ledger.SearchLedgers.search', 'SearchLedgers.search', (['server'], {}), '(server)\n', (332, 340), False, 'from divvy.ledger import SearchLedgers\n')] |
#!/usr/bin/python3
from PIL import Image
import math, sys
figure=" "
regular=" "
em = " "
en = " "
scale=[
"\x1b[30m█",
"\x1b[3{}m░",
"\x1b[9{}m░",
"\x1b[3{}m▒",
"\x1b[9{}m▒",
"\x1b[3{}m▓",
"\x1b[9{}m▓",
"\x1b[3{}m█",
"\x1b[9{}m█"
]
def hue_raw(fullpixel):
global threshhold_global
hue_arr = [Fals... | [
"math.floor",
"sys.exit",
"PIL.Image.open"
] | [((3302, 3313), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (3310, 3313), False, 'import math, sys\n'), ((1076, 1096), 'PIL.Image.open', 'Image.open', (['filename'], {}), '(filename)\n', (1086, 1096), False, 'from PIL import Image\n'), ((3465, 3476), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (3473, 3476), Fal... |