code
stringlengths
22
1.05M
apis
listlengths
1
3.31k
extract_api
stringlengths
75
3.25M
# -*- coding: utf-8 -*- # Author:w k import nonebot as rcnb __plugin_name = 'Bilibili' Bilibili = rcnb.CommandGroup('Bilibili', only_to_me=False) from . import get_cover from . import live_subscription
[ "nonebot.CommandGroup" ]
[((102, 149), 'nonebot.CommandGroup', 'rcnb.CommandGroup', (['"""Bilibili"""'], {'only_to_me': '(False)'}), "('Bilibili', only_to_me=False)\n", (119, 149), True, 'import nonebot as rcnb\n')]
import math import numpy as np import random import torch from torch.autograd import Variable import torch.nn as nn import torch.nn.functional as F import torch.optim as optim class Net(nn.Module): def __init__(self): super(Net, self).__init__() self.fc1 = nn.Linear(2, 96) self.fc2 = nn.Lin...
[ "random.choice", "numpy.random.rand", "torch.nn.CrossEntropyLoss", "numpy.nanmax", "torch.nn.Linear" ]
[((278, 294), 'torch.nn.Linear', 'nn.Linear', (['(2)', '(96)'], {}), '(2, 96)\n', (287, 294), True, 'import torch.nn as nn\n'), ((314, 331), 'torch.nn.Linear', 'nn.Linear', (['(96)', '(96)'], {}), '(96, 96)\n', (323, 331), True, 'import torch.nn as nn\n'), ((351, 368), 'torch.nn.Linear', 'nn.Linear', (['(96)', '(96)'],...
import numpy as np import cv2 as cv from abc import ABC class ins_pos_kalman_filter(ABC): def __init__(self, F, Q, H, R, initial_state_mean, initial_state_covariance): """ abstract initialization of kalman filter for INS data fusion for position estimation Matrix notation matches that prov...
[ "numpy.block", "numpy.eye", "numpy.hstack", "numpy.array", "numpy.zeros", "cv2.KalmanFilter" ]
[((1212, 1251), 'cv2.KalmanFilter', 'cv.KalmanFilter', (['F.shape[1]', 'Q.shape[1]'], {}), '(F.shape[1], Q.shape[1])\n', (1227, 1251), True, 'import cv2 as cv\n'), ((2369, 2378), 'numpy.eye', 'np.eye', (['(3)'], {}), '(3)\n', (2375, 2378), True, 'import numpy as np\n'), ((2392, 2408), 'numpy.zeros', 'np.zeros', (['(3, ...
import pandas as pd import os import random class MetaData: def __init__(self, db): self.db = db self.ljs_path = '/data2/sungjaecho/data_tts/LJSpeech-1.1' self.emovdb_path = '/data2/sungjaecho/data_tts/EmoV-DB/EmoV-DB' self.metadata_path = 'metadata' self.df = None...
[ "os.path.join", "random.shuffle", "random.seed", "pandas.read_csv" ]
[((2865, 2882), 'random.seed', 'random.seed', (['(3141)'], {}), '(3141)\n', (2876, 2882), False, 'import random\n'), ((2892, 2920), 'random.shuffle', 'random.shuffle', (['split_labels'], {}), '(split_labels)\n', (2906, 2920), False, 'import random\n'), ((4645, 4666), 'pandas.read_csv', 'pd.read_csv', (['csv_path'], {})...
from RestrictedPython import compile_restricted from RestrictedPython import Eval from RestrictedPython import Guards from RestrictedPython import safe_globals from RestrictedPython import utility_builtins from RestrictedPython.PrintCollector import PrintCollector from multiprocessing import Process from multipr...
[ "local_libs.ProblemFileHandler.ProblemFileHandler", "multiprocessing.Process", "time.sleep", "multiprocessing.Manager", "RestrictedPython.compile_restricted" ]
[((791, 819), 'local_libs.ProblemFileHandler.ProblemFileHandler', 'Handler.ProblemFileHandler', ([], {}), '()\n', (817, 819), True, 'import local_libs.ProblemFileHandler as Handler\n'), ((4387, 4434), 'RestrictedPython.compile_restricted', 'compile_restricted', (['py_code', '"""<inline>"""', '"""exec"""'], {}), "(py_co...
"""MimicDB Key subclass wrapper """ import re from boto.s3.key import Key as BotoKey import mimicdb from ..backends import tpl class Key(BotoKey): def __init__(self, *args, **kwargs): """Add the key to the bucket set if the key name is set and metadata is available for it, otherwise wait until...
[ "re.match", "mimicdb.backend.hgetall", "mimicdb.backend.sadd" ]
[((1119, 1153), 're.match', 're.match', (['"""^[a-fA-F0-9]{32}$"""', 'md5'], {}), "('^[a-fA-F0-9]{32}$', md5)\n", (1127, 1153), False, 'import re\n'), ((2266, 2328), 'mimicdb.backend.sadd', 'mimicdb.backend.sadd', (['(tpl.bucket % self.bucket.name)', 'self.name'], {}), '(tpl.bucket % self.bucket.name, self.name)\n', (2...
from definitions import SYSTEM, System, GameStatus import os import asyncio import logging as log from consts import UBISOFT_REGISTRY_LAUNCHER_INSTALLS if SYSTEM == System.WINDOWS: import winreg def _get_registry_value_from_path(top_key, registry_path, key): with winreg.OpenKey(top_key, registry...
[ "os.path.getsize", "winreg.QueryValueEx", "winreg.OpenKey", "os.access", "os.path.join", "os.path.isfile", "os.path.normpath", "os.path.isdir", "asyncio.sleep", "os.path.islink", "os.walk" ]
[((2072, 2091), 'os.walk', 'os.walk', (['start_path'], {}), '(start_path)\n', (2079, 2091), False, 'import os\n'), ((2366, 2385), 'os.path.isdir', 'os.path.isdir', (['path'], {}), '(path)\n', (2379, 2385), False, 'import os\n'), ((288, 346), 'winreg.OpenKey', 'winreg.OpenKey', (['top_key', 'registry_path', '(0)', 'winr...
""" This module contains all that methods that determine if user provided details are correct. """ from AllDBFields import BaseFields from AllDBFields import AuthenticationFields import CryptKeeper import DatabaseLayer import re import cherrypy def is_login_taken(login): """ checks the database to dete...
[ "cherrypy.session.get", "CryptKeeper.password_is_right", "CryptKeeper.encrypt_str", "cherrypy.Tool", "re.match", "DatabaseLayer.get_table", "Account.Account.create_new_account_in_db", "Hero.Hero.construct_new_hero_in_db", "cherrypy.HTTPRedirect" ]
[((8882, 8939), 'cherrypy.Tool', 'cherrypy.Tool', (['"""before_handler"""', 'redirect_unauthenticated'], {}), "('before_handler', redirect_unauthenticated)\n", (8895, 8939), False, 'import cherrypy\n'), ((8979, 9034), 'cherrypy.Tool', 'cherrypy.Tool', (['"""before_handler"""', 'redirect_authenticated'], {}), "('before_...
from setuptools import setup, find_packages setup( name="torchsummary", version="1.5.1.1", description="(Advanced Pytorch-Summary)Model summary in PyTorch similar to `model.summary()` in Keras", url="https://github.com/sksq96/pytorch-summary", author="(Modified)skyguidance - (Original)<NAME> @sksq9...
[ "setuptools.setup" ]
[((45, 373), 'setuptools.setup', 'setup', ([], {'name': '"""torchsummary"""', 'version': '"""1.5.1.1"""', 'description': '"""(Advanced Pytorch-Summary)Model summary in PyTorch similar to `model.summary()` in Keras"""', 'url': '"""https://github.com/sksq96/pytorch-summary"""', 'author': '"""(Modified)skyguidance - (Orig...
#! /usr/bin/env python import rospy import time import actionlib from basics.msg import TimerAction, TimerGoal, TimerResult, TimerFeedback # Callback funtion, invoked when a new goal is received def do_timer(goal): start_time = time.time() # Save current time update_count = 0 # Initialize update counter # Th...
[ "rospy.init_node", "actionlib.SimpleActionServer", "time.sleep", "basics.msg.TimerResult", "rospy.spin", "basics.msg.TimerFeedback", "time.time" ]
[((1707, 1745), 'rospy.init_node', 'rospy.init_node', (['"""fancy_action_server"""'], {}), "('fancy_action_server')\n", (1722, 1745), False, 'import rospy\n'), ((1834, 1901), 'actionlib.SimpleActionServer', 'actionlib.SimpleActionServer', (['"""timer"""', 'TimerAction', 'do_timer', '(False)'], {}), "('timer', TimerActi...
from typing import Callable, List, Optional, OrderedDict # for OrderedMeta from enum import Enum class OrderedMeta(type): """Replaces the inheriting object's dict of attributes with an OrderedDict that preserves enumeration order Reference: https://stackoverflow.com/questions/11296010/iterate-through-class-...
[ "typing.OrderedDict", "inspect.getfullargspec" ]
[((1840, 1874), 'inspect.getfullargspec', 'inspect.getfullargspec', (['a_callable'], {}), '(a_callable)\n', (1862, 1874), False, 'import inspect\n'), ((917, 930), 'typing.OrderedDict', 'OrderedDict', ([], {}), '()\n', (928, 930), False, 'from typing import Callable, List, Optional, OrderedDict\n')]
from lxml import html import requests import os import csv #Deleting the csv file if it exists csvfile = "US_State_Measures.csv" try: os.remove(csvfile) except OSError: pass htmlfiles = [] for root, dirs, files in os.walk("."): for file in files: if file.endswith(".html"): htmlfiles.ap...
[ "csv.writer", "os.path.join", "os.walk", "os.remove" ]
[((224, 236), 'os.walk', 'os.walk', (['"""."""'], {}), "('.')\n", (231, 236), False, 'import os\n'), ((139, 157), 'os.remove', 'os.remove', (['csvfile'], {}), '(csvfile)\n', (148, 157), False, 'import os\n'), ((1632, 1646), 'csv.writer', 'csv.writer', (['cf'], {}), '(cf)\n', (1642, 1646), False, 'import csv\n'), ((325,...
############################################################################## # Copyright (c) 2018 <NAME>, <NAME>, and others. # # All rights reserved. This program and the accompanying materials # are made available under the terms of the Apache License, Version 2.0 # which accompanies this distribution, and is avail...
[ "logging.getLogger", "django.shortcuts.render", "workflow.workflow_manager.SessionManager", "account.models.Lab.objects.get", "django.http.HttpResponse", "uuid.uuid4", "workflow.workflow_manager.ManagerTracker.getInstance" ]
[((666, 693), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (683, 693), False, 'import logging\n'), ((2194, 2249), 'django.shortcuts.render', 'render', (['request', '"""workflow/viewport-base.html"""', 'context'], {}), "(request, 'workflow/viewport-base.html', context)\n", (2200, 2249), ...
import code.book_plots as bp import code.gh_internal as gh import matplotlib.pyplot as plt import matplotlib.pyplot as plt import numpy as np; from filterpy.discrete_bayes import normalize def scaled_update (hall, belief, z, prob): scale_ = prob/(1-prob) belief[hall==1] *=scale_ normalize(belief) ...
[ "filterpy.discrete_bayes.normalize", "numpy.array", "matplotlib.pyplot.figure", "code.book_plots.bar_plot" ]
[((332, 352), 'numpy.array', 'np.array', (['([0.1] * 10)'], {}), '([0.1] * 10)\n', (340, 352), True, 'import numpy as np\n'), ((361, 401), 'numpy.array', 'np.array', (['[1, 1, 0, 0, 0, 0, 0, 0, 1, 0]'], {}), '([1, 1, 0, 0, 0, 0, 0, 0, 1, 0])\n', (369, 401), True, 'import numpy as np\n'), ((545, 557), 'matplotlib.pyplot...
import pytest from pytest_django.fixtures import _django_db_fixture_helper @pytest.fixture(scope="session", autouse=True) def db_session(request, django_db_setup, django_db_blocker): """ Changed scope to 'session' """ if "django_db_reset_sequences" in request.funcargnames: request.getfixturev...
[ "pytest.fixture", "pytest_django.fixtures._django_db_fixture_helper" ]
[((79, 124), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""', 'autouse': '(True)'}), "(scope='session', autouse=True)\n", (93, 124), False, 'import pytest\n'), ((540, 614), 'pytest_django.fixtures._django_db_fixture_helper', '_django_db_fixture_helper', (['request', 'django_db_blocker'], {'transactio...
import os import json def load_data(filepath="data", filename="arrays.json"): full_file_path=os.path.join(filepath, filename) with open(full_file_path, 'r') as f: lst = json.load(f) return lst def check_data(data): error = "Data Error: {}" passed = True if not data: passed = F...
[ "json.load", "os.path.join", "json.dump" ]
[((98, 130), 'os.path.join', 'os.path.join', (['filepath', 'filename'], {}), '(filepath, filename)\n', (110, 130), False, 'import os\n'), ((849, 881), 'os.path.join', 'os.path.join', (['filepath', 'filename'], {}), '(filepath, filename)\n', (861, 881), False, 'import os\n'), ((1230, 1262), 'os.path.join', 'os.path.join...
from django.shortcuts import render from django.db.models import Avg from register.models import Project from projects.models import Task from projects.forms import TaskRegistrationForm from projects.forms import ProjectRegistrationForm from django.contrib.auth.models import User from django.shortcuts import redirect f...
[ "django.shortcuts.render", "django.http.JsonResponse", "projects.forms.ProjectRegistrationForm", "projects.models.Task.objects.all", "projects.models.Task.objects.get", "register.models.Project.objects.all", "django.contrib.auth.models.User.objects.get", "projects.forms.TaskRegistrationForm" ]
[((908, 929), 'register.models.Project.objects.all', 'Project.objects.all', ([], {}), '()\n', (927, 929), False, 'from register.models import Project\n'), ((942, 960), 'projects.models.Task.objects.all', 'Task.objects.all', ([], {}), '()\n', (958, 960), False, 'from projects.models import Task\n'), ((1294, 1344), 'djan...
import unittest from test.test_utils import get_repository from unittest.mock import Mock from autopr.database import Database class DatabaseTest(unittest.TestCase): def test_needs_pulling_empty(self): db = Database() self.assertTrue(db.needs_pulling()) def test_needs_pulling_not_empty(self)...
[ "unittest.main", "autopr.database.Database", "unittest.mock.Mock", "test.test_utils.get_repository" ]
[((2230, 2245), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2243, 2245), False, 'import unittest\n'), ((222, 232), 'autopr.database.Database', 'Database', ([], {}), '()\n', (230, 232), False, 'from autopr.database import Database\n'), ((614, 637), 'test.test_utils.get_repository', 'get_repository', (['"""first...
import math import collections import intergalactic ''' gas_H = diffuse gas in the galactic Halo gas_D = diffuse gas in the galactic Disc cloud_H = molecular gas in the halo cloud_D = molecular gas in the disc f = infall rate Stars are divided in two groups: 1) Low/intermediate mass stars (m <= 4 Msun...
[ "math.sqrt", "collections.defaultdict" ]
[((1749, 1779), 'collections.defaultdict', 'collections.defaultdict', (['float'], {}), '(float)\n', (1772, 1779), False, 'import collections\n'), ((3944, 4013), 'math.sqrt', 'math.sqrt', (['(halo_radio_kpc ** 2 - region_galactocentric_radio_kpc ** 2)'], {}), '(halo_radio_kpc ** 2 - region_galactocentric_radio_kpc ** 2)...
"""demo URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.0/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based vi...
[ "django.views.generic.TemplateView.as_view", "api.video.views.VideoList.as_view", "rest_framework_swagger.views.get_swagger_view", "rest_framework.schemas.get_schema_view", "api.video.views.VideoRecordsView.as_view", "api.video.views.CustomAuthToken.as_view", "django.urls.path", "api.video.views.Video...
[((1151, 1189), 'rest_framework_swagger.views.get_swagger_view', 'get_swagger_view', ([], {'title': '"""Pastebin API"""'}), "(title='Pastebin API')\n", (1167, 1189), False, 'from rest_framework_swagger.views import get_swagger_view\n'), ((1213, 1240), 'django.urls.path', 'path', (['"""index/"""', 'views.index'], {}), "...
# mfield / mfield.py import numpy as np try: import matlab import matlab.engine except ImportError: pass import time import io import os class MField(object): ''' Implementation of FIELD II using the MATLAB engine for python. ''' def __init__(self, path=None): # set default pat...
[ "matlab.engine.start_matlab", "time.sleep", "os.path.normpath", "numpy.array", "os.path.abspath", "io.StringIO" ]
[((7976, 7998), 'numpy.array', 'np.array', (['[0, 0, 0.03]'], {}), '([0, 0, 0.03])\n', (7984, 7998), True, 'import numpy as np\n'), ((8062, 8075), 'numpy.array', 'np.array', (['[1]'], {}), '([1])\n', (8070, 8075), True, 'import numpy as np\n'), ((8172, 8194), 'numpy.array', 'np.array', (['[0, 0, 0.03]'], {}), '([0, 0, ...
from past.builtins import basestring from builtins import object from itertools import chain import re # from copy import copy import operator from collections import OrderedDict from nineml.exceptions import ( NineMLUsageError, NineMLNameError, NineMLInvalidElementTypeException) from .visitors.cloner import Cloner...
[ "itertools.chain", "collections.OrderedDict", "re.compile", "nineml.document.AddToDocumentVisitor", "nineml.annotations.Annotations", "nineml.unserialize", "nineml.write", "nineml.serialize" ]
[((634, 662), 're.compile', 're.compile', (['"""([a-z])([A-Z])"""'], {}), "('([a-z])([A-Z])')\n", (644, 662), False, 'import re\n'), ((4877, 4910), 'nineml.write', 'nineml.write', (['url', 'self'], {}), '(url, self, **kwargs)\n', (4889, 4910), False, 'import nineml\n'), ((5450, 5482), 'nineml.serialize', 'nineml.serial...
from pymongo import MongoClient import gridfs import os from dotenv import load_dotenv, find_dotenv """ MongoDB setup """ # load MongoDB details as environmental variables from .env file load_dotenv(find_dotenv()) MONGODB_URI = os.environ.get('MONGODB_URI') DB_NAME = os.environ.get('DB_NAME') # create MongoDB client...
[ "gridfs.GridFS", "pymongo.MongoClient", "dotenv.find_dotenv", "os.environ.get" ]
[((230, 259), 'os.environ.get', 'os.environ.get', (['"""MONGODB_URI"""'], {}), "('MONGODB_URI')\n", (244, 259), False, 'import os\n'), ((270, 295), 'os.environ.get', 'os.environ.get', (['"""DB_NAME"""'], {}), "('DB_NAME')\n", (284, 295), False, 'import os\n'), ((379, 403), 'pymongo.MongoClient', 'MongoClient', (['MONGO...
import json import jieba import pickle import csv, h5py import pandas as pd import numpy as np from tqdm import * import torch from torch import Tensor from torch.autograd import Variable import torch.utils.data as data from main import Hyperparameters from collections import Counter STOP_TAG = "#stop#" UNK_TAG = "...
[ "pandas.Series", "json.loads", "pickle.dump", "pickle.load", "h5py.File", "collections.Counter", "main.Hyperparameters", "torch.utils.data.items" ]
[((1240, 1265), 'pickle.dump', 'pickle.dump', (['input2idx', 'f'], {}), '(input2idx, f)\n', (1251, 1265), False, 'import pickle\n'), ((1368, 1382), 'pickle.load', 'pickle.load', (['f'], {}), '(f)\n', (1379, 1382), False, 'import pickle\n'), ((4618, 4642), 'h5py.File', 'h5py.File', (['new_path', '"""w"""'], {}), "(new_p...
import paramiko import sys import datetime import threading import logging """ Edit this line and add your command """ #cmd2run = "for f in $(ioscli lsdev -type adapter | grep fcs | grep 8Gb | awk {'print $1'}); do wwpn=$(ioscli lsdev -dev $f -vpd | grep Network | sed s'/\.//g;s/Network Address//g;s/ //g');echo $f,$ww...
[ "sys.exit", "threading.Thread", "datetime.date.today", "paramiko.SSHClient", "logging.error" ]
[((500, 520), 'paramiko.SSHClient', 'paramiko.SSHClient', ([], {}), '()\n', (518, 520), False, 'import paramiko\n'), ((621, 642), 'datetime.date.today', 'datetime.date.today', ([], {}), '()\n', (640, 642), False, 'import datetime\n'), ((439, 476), 'logging.error', 'logging.error', (['"""Not enough arguments"""'], {}), ...
import librosa from numba import jit import numpy as np @jit(nopython=True, cache=True) def __C_to_DE(C: np.ndarray = None, dn: np.ndarray = np.array([1, 1, 0], np.int64), dm: np.ndarray = np.array([1, 0, 1], np.int64), dw: np.ndarray = np.array([1.0, 1.0, 1.0], np.float64), ...
[ "numpy.ones", "numpy.max", "numpy.array", "numpy.zeros", "numba.jit" ]
[((59, 89), 'numba.jit', 'jit', ([], {'nopython': '(True)', 'cache': '(True)'}), '(nopython=True, cache=True)\n', (62, 89), False, 'from numba import jit\n'), ((2478, 2508), 'numba.jit', 'jit', ([], {'nopython': '(True)', 'cache': '(True)'}), '(nopython=True, cache=True)\n', (2481, 2508), False, 'from numba import jit\...
import sys as _sys import pandas as _pd from apodeixi.testing_framework.a6i_unit_test import ApodeixiUnitTest from apodeixi.testing_framework.controllers.mock_controller import Mock_Controller from apodeixi.tes...
[ "apodeixi.xli.posting_controller_utils.PostingConfig", "apodeixi.util.a6i_error.FunctionalTrace", "apodeixi.xli.update_policy.UpdatePolicy", "apodeixi.xli.uid_acronym_schema.UID_Acronym_Schema", "apodeixi.xli.interval.Interval", "apodeixi.testing_framework.mock_kb_store.UnitTest_KnowledgeBaseStore", "pa...
[((1647, 1708), 'pandas.DataFrame', '_pd.DataFrame', ([], {'columns': 'columns', 'data': '[row0, row1, row2, row3]'}), '(columns=columns, data=[row0, row1, row2, row3])\n', (1660, 1708), True, 'import pandas as _pd\n'), ((2395, 2456), 'pandas.DataFrame', '_pd.DataFrame', ([], {'columns': 'columns', 'data': '[row0, row1...
import sys, hashlib, base64 if len(sys.argv) < 2: sys.stderr.write("usage: sha_passgen.py password") sys.exit(-1) pas = sys.argv[1] hash = hashlib.sha1() hash.update(bytes(pas, "latin-1")) hash = hash.digest() ret = b"{SHA}"+base64.b64encode(hash) print(ret)
[ "sys.stderr.write", "base64.b64encode", "hashlib.sha1", "sys.exit" ]
[((148, 162), 'hashlib.sha1', 'hashlib.sha1', ([], {}), '()\n', (160, 162), False, 'import sys, hashlib, base64\n'), ((53, 103), 'sys.stderr.write', 'sys.stderr.write', (['"""usage: sha_passgen.py password"""'], {}), "('usage: sha_passgen.py password')\n", (69, 103), False, 'import sys, hashlib, base64\n'), ((106, 118)...
import fibonacci print(fibonacci.version()) result = fibonacci.fib(1000000) print(result)
[ "fibonacci.version", "fibonacci.fib" ]
[((55, 77), 'fibonacci.fib', 'fibonacci.fib', (['(1000000)'], {}), '(1000000)\n', (68, 77), False, 'import fibonacci\n'), ((24, 43), 'fibonacci.version', 'fibonacci.version', ([], {}), '()\n', (41, 43), False, 'import fibonacci\n')]
import os import typing import importlib from importlib.util import find_spec def get_package_path(package_path: str) -> str: if ":" in package_path: package, path = package_path.split(":", 1) spec = find_spec(package) if spec and spec.origin: package_dir = os.path.dirname(spec...
[ "importlib.import_module", "importlib.util.find_spec", "os.path.join", "os.path.dirname", "typing.TypeVar" ]
[((500, 519), 'typing.TypeVar', 'typing.TypeVar', (['"""T"""'], {}), "('T')\n", (514, 519), False, 'import typing\n'), ((825, 854), 'importlib.import_module', 'importlib.import_module', (['path'], {}), '(path)\n', (848, 854), False, 'import importlib\n'), ((222, 240), 'importlib.util.find_spec', 'find_spec', (['package...
# FileName: QAP3 # Honest Harry Car Sales (Looking for a program to keep track of his sales) # Author: <NAME> # Date: October 27, 2021 # imports import datetime # Constants TAX_RATE = .15 STAND_FEE = 75 #Lincence Fee for vechiles <= $5,000 LUX_FEE = 165 #Lincence Fee for Vechiles >$5,000 TRANS_RATE...
[ "datetime.datetime.strptime", "datetime.datetime.now", "datetime.timedelta" ]
[((1529, 1575), 'datetime.datetime.strptime', 'datetime.datetime.strptime', (['MIN_CAR_DATE', '"""%Y"""'], {}), "(MIN_CAR_DATE, '%Y')\n", (1555, 1575), False, 'import datetime\n'), ((1654, 1677), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (1675, 1677), False, 'import datetime\n'), ((1065, 1109)...
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright INRIA # Contributors: <NAME> (<EMAIL>) # <NAME> (<EMAIL>) # # This software is governed by the CeCILL license under French law and abiding # by the rules of distribution of free software. Yo...
[ "numpy.linspace", "numpy.ones" ]
[((2374, 2411), 'numpy.linspace', 'np.linspace', (['(-np.pi / 2)', '(np.pi / 2)', 'n'], {}), '(-np.pi / 2, np.pi / 2, n)\n', (2385, 2411), True, 'import numpy as np\n'), ((2961, 2981), 'numpy.linspace', 'np.linspace', (['(0)', '(1)', 'n'], {}), '(0, 1, n)\n', (2972, 2981), True, 'import numpy as np\n'), ((4499, 4536), ...
from flask_wtf import Form from wtforms import (TextField, StringField, BooleanField,PasswordField, validators) from .utils import Unique from .models import User from .constants import (USER_LEN_MSG, USER_REQ_MSG, USER_DUPL_MSG, EMAIL_FORMAT_MSG, EMAIL_REQ_MSG, EMAIL_DUPL_M...
[ "wtforms.validators.Email", "wtforms.PasswordField", "wtforms.validators.EqualTo", "wtforms.validators.Required", "wtforms.validators.Length", "wtforms.validators.InputRequired" ]
[((1615, 1647), 'wtforms.PasswordField', 'PasswordField', (['"""Repeat Password"""'], {}), "('Repeat Password')\n", (1628, 1647), False, 'from wtforms import TextField, StringField, BooleanField, PasswordField, validators\n'), ((491, 538), 'wtforms.validators.Length', 'validators.Length', ([], {'max': '(25)', 'message'...
# Copyright 2020 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, soft...
[ "unittest.defaultTestLoader.loadTestsFromModule", "unittest.TextTestRunner" ]
[((4064, 4133), 'unittest.defaultTestLoader.loadTestsFromModule', 'unittest.defaultTestLoader.loadTestsFromModule', (['sys.modules[__name__]'], {}), '(sys.modules[__name__])\n', (4110, 4133), False, 'import unittest\n'), ((4189, 4227), 'unittest.TextTestRunner', 'unittest.TextTestRunner', ([], {'failfast': '(True)'}), ...
"""Unit tests for radar_statistics.py.""" import unittest import numpy from gewittergefahr.gg_utils import radar_statistics as radar_stats TOLERANCE = 1e-6 FAKE_STATISTIC_NAME = 'foo' FAKE_PERCENTILE_LEVEL = -9999. # The following constants are used to test # radar_field_and_statistic_to_column_name, # radar_field_a...
[ "gewittergefahr.gg_utils.radar_statistics._check_statistic_params", "gewittergefahr.gg_utils.radar_statistics.get_spatial_statistics", "numpy.allclose", "gewittergefahr.gg_utils.radar_statistics.radar_field_and_percentile_to_column_name", "numpy.array", "gewittergefahr.gg_utils.radar_statistics.radar_fiel...
[((815, 947), 'numpy.array', 'numpy.array', (['[[-1, -1, 10, 20, 30, 40], [-1, 5, 15, 25, 35, 50], [5, 10, 25, 40, 55, 70],\n [10, 30, 50, 70, 75, -1]]'], {'dtype': 'float'}), '([[-1, -1, 10, 20, 30, 40], [-1, 5, 15, 25, 35, 50], [5, 10, 25,\n 40, 55, 70], [10, 30, 50, 70, 75, -1]], dtype=float)\n', (826, 947), F...
import math import re import time from dataclasses import dataclass from enum import Enum from typing import List, NoReturn class Direction(Enum): LEFT = 'L' RIGHT = 'R' FORWARD = 'F' @staticmethod def is_direction(value: str) -> bool: return value in {e.value for e in set(Direction)} c...
[ "math.fabs", "time.time", "re.finditer" ]
[((3453, 3464), 'time.time', 'time.time', ([], {}), '()\n', (3462, 3464), False, 'import time\n'), ((2677, 2708), 'math.fabs', 'math.fabs', (['self.ship_position.x'], {}), '(self.ship_position.x)\n', (2686, 2708), False, 'import math\n'), ((2711, 2742), 'math.fabs', 'math.fabs', (['self.ship_position.y'], {}), '(self.s...
from sklearn.decomposition import NMF from nltk.tokenize import sent_tokenize import numpy as np class NonNegativeFactorization(): def __init__(self, A, r, feature_names, num_top_words, num_top_documents, corpus): self.A = A self.r = r self.features_names = feature_names self.corpu...
[ "numpy.argsort", "sklearn.decomposition.NMF" ]
[((475, 582), 'sklearn.decomposition.NMF', 'NMF', ([], {'n_components': 'self.r', 'init': '"""nndsvdar"""', 'solver': '"""mu"""', 'beta_loss': '"""frobenius"""', 'tol': '(0.1)', 'random_state': '(1)'}), "(n_components=self.r, init='nndsvdar', solver='mu', beta_loss=\n 'frobenius', tol=0.1, random_state=1)\n", (478, ...
from ..utils import entropy_gaussian from ..core import cmutinf, centropy, ncmutinf from ..metrics import (AlphaAngleTransferEntropy, ContactTransferEntropy, DihedralTransferEntropy) from msmbuilder.example_datasets import FsPeptide import numpy as np from numpy.testing import assert_almost_eq...
[ "numpy.atleast_2d", "msmbuilder.example_datasets.FsPeptide", "numpy.array", "numpy.dot", "numpy.testing.assert_almost_equal", "numpy.random.RandomState" ]
[((362, 387), 'numpy.random.RandomState', 'np.random.RandomState', (['(42)'], {}), '(42)\n', (383, 387), True, 'import numpy as np\n'), ((409, 462), 'numpy.array', 'np.array', (['[[1, 0.5, 0.25], [0.5, 1, 0], [0.25, 0, 1]]'], {}), '([[1, 0.5, 0.25], [0.5, 1, 0], [0.25, 0, 1]])\n', (417, 462), True, 'import numpy as np\...
import setuptools import os def get_files_in_dir(dirName): listOfFile = os.listdir(dirName) completeFileList = list() for file in listOfFile: completePath = os.path.join(dirName, file) if os.path.isdir(completePath): completeFileList = completeFileList + get_files_in_dir(comple...
[ "os.listdir", "setuptools.find_packages", "os.path.join", "os.path.splitext", "os.path.isdir" ]
[((78, 97), 'os.listdir', 'os.listdir', (['dirName'], {}), '(dirName)\n', (88, 97), False, 'import os\n'), ((179, 206), 'os.path.join', 'os.path.join', (['dirName', 'file'], {}), '(dirName, file)\n', (191, 206), False, 'import os\n'), ((218, 245), 'os.path.isdir', 'os.path.isdir', (['completePath'], {}), '(completePath...
import tensorflow as tf import numpy as np import os from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense, Activation from sklearn.utils import shuffle import matplotlib.pyplot as plt from dl_utils.tf.plot_weights import plot_weights # CUDA GPU os.environ['CUDA_DEVICE_ORDER']='PCI_B...
[ "tensorflow.keras.utils.to_categorical", "tensorflow.reduce_sum", "tensorflow.placeholder", "tensorflow.Session", "sklearn.utils.shuffle", "tensorflow.nn.softmax_cross_entropy_with_logits_v2", "numpy.max", "tensorflow.train.GradientDescentOptimizer", "tensorflow.examples.tutorials.mnist.input_data.r...
[((750, 807), 'tensorflow.examples.tutorials.mnist.input_data.read_data_sets', 'input_data.read_data_sets', (['"""MNIST_data/"""'], {'one_hot': 'one_hot'}), "('MNIST_data/', one_hot=one_hot)\n", (775, 807), False, 'from tensorflow.examples.tutorials.mnist import input_data\n'), ((1606, 1618), 'tensorflow.keras.models.S...
#!/usr/local/bin/python import pybullet import time import pybullet_data import math, random import sys import numpy import OpenGL import pygame from pygame.locals import * from OpenGL.GL import * from OpenGL.GLU import * import ctypes from OpenGL.GL import shaders import render.cubeRender as cubeRender import rende...
[ "pygame.init", "pygame.quit", "math.floor", "pybullet.setGravity", "math.cos", "numpy.array", "gui.inventory.inv_contains", "pybullet.createCollisionShape", "gui.inventory.add_to_inv", "render.renderLoop.gui_render", "gui.inventory.remove_from_inv", "pygame.mouse.set_pos", "pygame.display.se...
[((889, 919), 'numpy.array', 'numpy.array', (['[]', 'numpy.float32'], {}), '([], numpy.float32)\n', (900, 919), False, 'import numpy\n'), ((932, 962), 'numpy.array', 'numpy.array', (['[]', 'numpy.float32'], {}), '([], numpy.float32)\n', (943, 962), False, 'import numpy\n'), ((1135, 1165), 'numpy.array', 'numpy.array', ...
import random import string import unittest import warnings from libs import jenkinslib from libs.JAF.BaseCommandLineParser import BaseCommandLineParser from libs.JAF.plugin_CreateAPIToken import CreateAPIToken, CreateAPITokenParser from libs.JAF.plugin_DeleteAPIToken import DeleteAPIToken, DeleteAPITokenParser from l...
[ "unittest.main", "warnings.simplefilter", "random.choices" ]
[((20897, 20912), 'unittest.main', 'unittest.main', ([], {}), '()\n', (20910, 20912), False, 'import unittest\n'), ((698, 746), 'warnings.simplefilter', 'warnings.simplefilter', (['"""ignore"""', 'ResourceWarning'], {}), "('ignore', ResourceWarning)\n", (719, 746), False, 'import warnings\n'), ((4261, 4309), 'warnings....
import pytest from ethereum import tester @pytest.mark.xfail def test_get_block_by_hash(rpc_server, rpc_client, eth_coinbase): block_number = rpc_client.get_block_number() assert block_number == 0 to_addr = "0x" + tester.encode_hex(tester.accounts[1]) txn_hash = rpc_client.send_transaction(_from=eth...
[ "ethereum.tester.encode_hex" ]
[((230, 267), 'ethereum.tester.encode_hex', 'tester.encode_hex', (['tester.accounts[1]'], {}), '(tester.accounts[1])\n', (247, 267), False, 'from ethereum import tester\n')]
import numpy as np import tensorflow as tf from gym import utils from gym.envs.mujoco import mujoco_env from meta_mb.meta_envs.base import MetaEnv class InvertedPendulumEnv(mujoco_env.MujocoEnv, utils.EzPickle, MetaEnv): def __init__(self): utils.EzPickle.__init__(self) mujoco_env.MujocoEnv.__in...
[ "numpy.concatenate", "gym.utils.EzPickle.__init__", "gym.envs.mujoco.mujoco_env.MujocoEnv.__init__", "tensorflow.square" ]
[((257, 286), 'gym.utils.EzPickle.__init__', 'utils.EzPickle.__init__', (['self'], {}), '(self)\n', (280, 286), False, 'from gym import utils\n'), ((295, 358), 'gym.envs.mujoco.mujoco_env.MujocoEnv.__init__', 'mujoco_env.MujocoEnv.__init__', (['self', '"""inverted_pendulum.xml"""', '(2)'], {}), "(self, 'inverted_pendul...
# Code generated by `typeddictgen`. DO NOT EDIT. """CoreV1EventListDict generated type.""" from typing import TypedDict, List from kubernetes_typed.client import CoreV1EventDict, V1ListMetaDict CoreV1EventListDict = TypedDict( "CoreV1EventListDict", { "apiVersion": str, "items": List[CoreV1Eve...
[ "typing.TypedDict" ]
[((218, 362), 'typing.TypedDict', 'TypedDict', (['"""CoreV1EventListDict"""', "{'apiVersion': str, 'items': List[CoreV1EventDict], 'kind': str, 'metadata':\n V1ListMetaDict}"], {'total': '(False)'}), "('CoreV1EventListDict', {'apiVersion': str, 'items': List[\n CoreV1EventDict], 'kind': str, 'metadata': V1ListMet...
#!/usr/bin/env python3 # vim: set ft=python:sw=4:ts=4 import os import sys # This location is set within the Dockerfile. sys.path.insert(0, '/opt/infra/lib') from infra import ( load_definitions_file, parse_args, get_org_repo, cleanup_boilerplate, write_tf_backend_file, write_tfvars_file, ...
[ "infra.write_awstf_file", "sys.path.insert", "infra.write_tf_backend_file", "infra.run_terraform", "infra.save_outputs", "infra.get_org_repo", "infra.cleanup_boilerplate", "infra.load_definitions_file" ]
[((123, 159), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""/opt/infra/lib"""'], {}), "(0, '/opt/infra/lib')\n", (138, 159), False, 'import sys\n'), ((474, 497), 'infra.load_definitions_file', 'load_definitions_file', ([], {}), '()\n', (495, 497), False, 'from infra import load_definitions_file, parse_args, get_or...
import requests from crypto_package.conf import service_config as conf def subscribe_on_topics(currency_pairs:[str], ticker:str, exchange:str): args = _make_sub_args(currency_pairs, ticker, exchange) try: res = requests.post(conf.CANDLE_DATA_SERVICE + conf.EP_SUBSCRIBE, json=args) except requests...
[ "requests.post" ]
[((230, 300), 'requests.post', 'requests.post', (['(conf.CANDLE_DATA_SERVICE + conf.EP_SUBSCRIBE)'], {'json': 'args'}), '(conf.CANDLE_DATA_SERVICE + conf.EP_SUBSCRIBE, json=args)\n', (243, 300), False, 'import requests\n'), ((728, 800), 'requests.post', 'requests.post', (['(conf.CANDLE_DATA_SERVICE + conf.EP_UNSUBSCRIB...
import unittest import numpy as np import os from optimising import optimise def test_initial_matrix(): matrix = np.load(os.path.join('initialmatrices', 'U_initial.npy')) assert len(matrix) == 100 def test_turing_pattern(): pattern = np.load(os.path.join('data', '1.0.npy')) matrix = np.load(os.path.j...
[ "unittest.main", "optimising.optimise", "os.path.join" ]
[((742, 833), 'optimising.optimise', 'optimise', ([], {'time': '(1.0)', 'a_initial': '(0.0)', 'a_final': '(0.001)', 'b_initial': '(0.0)', 'b_final': '(0.01)', 'iters': '(5)'}), '(time=1.0, a_initial=0.0, a_final=0.001, b_initial=0.0, b_final=\n 0.01, iters=5)\n', (750, 833), False, 'from optimising import optimise\n...
from torch_geometric.nn import GCNConv, ChebConv #from torch_geometric.nn import SAGEConv import torch from torch.nn import BatchNorm1d import torch.nn.functional as F import os os.path.abspath(__file__) import sys sys.path.append(".") from .phygeograph import PhyGeoGrapH from torch.autograd import grad class PhyGeoGr...
[ "torch.ones_like", "torch.nn.ModuleList", "torch.nn.BatchNorm1d", "torch.nn.Linear", "torch.nn.functional.relu", "os.path.abspath", "sys.path.append" ]
[((178, 203), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (193, 203), False, 'import os\n'), ((215, 235), 'sys.path.append', 'sys.path.append', (['"""."""'], {}), "('.')\n", (230, 235), False, 'import sys\n'), ((2829, 2850), 'torch.nn.ModuleList', 'torch.nn.ModuleList', ([], {}), '()\n', (...
######### # GLOBALS ######### from itertools import islice import pandas as pd import dateutil.parser as dp from scipy.stats import boxcox from realtime_talib import Indicator #from nltk import word_tokenize #from nltk.corpus import stopwords #from nltk.stem.porter import * #from scipy.integrate import simps #from sk...
[ "pandas.Series", "dateutil.parser.parse", "scipy.stats.boxcox", "pandas.merge", "realtime_talib.Indicator", "pandas.DataFrame" ]
[((4804, 4845), 'pandas.DataFrame', 'pd.DataFrame', (['new_df_dict'], {'index': 'df.index'}), '(new_df_dict, index=df.index)\n', (4816, 4845), True, 'import pandas as pd\n'), ((947, 968), 'pandas.Series', 'pd.Series', (['unix_times'], {}), '(unix_times)\n', (956, 968), True, 'import pandas as pd\n'), ((3119, 3147), 'pa...
#!/usr/bin/env python # coding: utf-8 """ Script to train a resnet to determine if a Stokes-I radio cutout contains a giant radio galaxy candidate. Copyright (c) 2022 <NAME> See LICENSE.md in root directory for full BSD-3 license. Adapted from Author: <NAME> License: BSD Source: https://pytorch.org/tutorials/beginner...
[ "numpy.clip", "numpy.sqrt", "torch.nn.CrossEntropyLoss", "torch.max", "torchvision.models.resnet18", "torch.cuda.is_available", "torch.sum", "datetime.datetime.today", "torchvision.utils.make_grid", "matplotlib.pyplot.imshow", "torch.set_grad_enabled", "torchvision.transforms.ToTensor", "soc...
[((979, 990), 'time.time', 'time.time', ([], {}), '()\n', (988, 990), False, 'import time\n'), ((1070, 1090), 'socket.gethostname', 'socket.gethostname', ([], {}), '()\n', (1088, 1090), False, 'import socket\n'), ((1525, 1562), 'os.path.join', 'os.path.join', (['base_path', 'dataset_name'], {}), '(base_path, dataset_na...
#!/usr/bin/python -u # # create STAR files for "production" validator # # # from __future__ import absolute_import import sys import os import sqlite3 import ConfigParser import re import pprint if __package__ is None : __package__ = "nmr-star-dictionary-scripts" sys.path.append( os.path.abspath( os.path.join...
[ "os.path.exists", "sqlite3.connect", "os.makedirs", "re.compile", "ConfigParser.SafeConfigParser", "scripts.quote4star", "os.path.join", "os.path.split", "sys.stderr.write", "os.path.isdir", "pprint.pprint", "sys.stdout.write" ]
[((30286, 30317), 'ConfigParser.SafeConfigParser', 'ConfigParser.SafeConfigParser', ([], {}), '()\n', (30315, 30317), False, 'import ConfigParser\n'), ((2656, 2683), 'sqlite3.connect', 'sqlite3.connect', (['""":memory:"""'], {}), "(':memory:')\n", (2671, 2683), False, 'import sqlite3\n'), ((7617, 7668), 're.compile', '...
from panini import app as panini_app from panini.middleware.debug_middleware import DebugMiddleware app = panini_app.App( service_name="debug_middleware_example", host="127.0.0.1", port=4222, ) message = { "key1": "value1", "key2": 2, "key3": 3.0, "key4": [1, 2, 3, 4], "key5": {"1": 1...
[ "panini.app.App" ]
[((107, 195), 'panini.app.App', 'panini_app.App', ([], {'service_name': '"""debug_middleware_example"""', 'host': '"""127.0.0.1"""', 'port': '(4222)'}), "(service_name='debug_middleware_example', host='127.0.0.1',\n port=4222)\n", (121, 195), True, 'from panini import app as panini_app\n')]
import matplotlib.pyplot as plt import numpy as np from sklearn.metrics import mean_squared_error from sklearn.metrics import r2_score, roc_auc_score from sklearn.preprocessing import RobustScaler from sklearn.linear_model import LogisticRegression from sklearn.linear_model import LinearRegression from sklearn.model_se...
[ "src.plotutils.set_mpl_default_settings", "matplotlib.pyplot.grid", "pandas.read_csv", "math.floor", "matplotlib.pyplot.ylabel", "src.model.lupts.LogisticStatLUPTS", "numpy.array", "numpy.mean", "matplotlib.pyplot.xlabel", "src.model.baseline.LogisticBaseline", "numpy.random.seed", "sklearn.mo...
[((2145, 2166), 'pandas.read_csv', 'pd.read_csv', (['set_path'], {}), '(set_path)\n', (2156, 2166), True, 'import pandas as pd\n'), ((2870, 2913), 'pandas.get_dummies', 'pd.get_dummies', (['D'], {'columns': 'cols_categorical'}), '(D, columns=cols_categorical)\n', (2884, 2913), True, 'import pandas as pd\n'), ((5554, 55...
import os import pandas as pd import re import subprocess df = pd.read_csv("analysis_output/base_image_version_count.csv") print(df.head()) df = df[:25].copy() java_version = [] for i in range(len(df)): try: run_cmd = "docker run " + df["base-image:version"][i] + " java -version" result = subprocess.check_output...
[ "subprocess.check_output", "re.findall", "pandas.read_csv" ]
[((64, 123), 'pandas.read_csv', 'pd.read_csv', (['"""analysis_output/base_image_version_count.csv"""'], {}), "('analysis_output/base_image_version_count.csv')\n", (75, 123), True, 'import pandas as pd\n'), ((297, 367), 'subprocess.check_output', 'subprocess.check_output', (['run_cmd'], {'stderr': 'subprocess.STDOUT', '...
#!/usr/bin/python # # HRLAnalysis(TM) Software License - Version 1.0 - August 27th, 2013 # # Permission is hereby granted, free of charge, to any person or # organization obtaining a copy of the software and accompanying # documentation covered by this license (the "Software") to use, # reproduce, display,...
[ "biggles.Points", "biggles.Table", "biggles.FramedPlot" ]
[((2157, 2177), 'biggles.FramedPlot', 'biggles.FramedPlot', ([], {}), '()\n', (2175, 2177), False, 'import biggles\n'), ((2563, 2583), 'biggles.FramedPlot', 'biggles.FramedPlot', ([], {}), '()\n', (2581, 2583), False, 'import biggles\n'), ((2969, 2989), 'biggles.FramedPlot', 'biggles.FramedPlot', ([], {}), '()\n', (298...
# Copyright (c) 2017 <NAME> <<EMAIL>> # # MIT License # # 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, me...
[ "django.shortcuts.render", "django.http.HttpResponseRedirect", "application.forms.AuthenticationForm", "application.views.models.Document.objects.get", "django.utils.decorators.method_decorator", "application.views.BusinessLogic", "application.views.models.Document.objects.filter", "django.urls.revers...
[((2468, 2500), 'django.utils.decorators.method_decorator', 'method_decorator', (['login_required'], {}), '(login_required)\n', (2484, 2500), False, 'from django.utils.decorators import method_decorator\n'), ((3005, 3081), 'django.urls.reverse', 'reverse', (['self.on_success', 'None', 'self.on_success_args', 'self.on_s...
#MenuTitle: CopyCat # -*- coding: utf-8 -*- from __future__ import division, print_function, unicode_literals __doc__=""" A tool for comparing two fonts. """ import sys, os, traceback import importlib from collections import OrderedDict class BaseTestClass: def setFonts(self, font1, font2): self.font1 = font1 se...
[ "traceback.format_exc", "collections.OrderedDict", "parsers.printOneLinerResultParser.PrintOneLinerResultParser" ]
[((3661, 3708), 'parsers.printOneLinerResultParser.PrintOneLinerResultParser', 'PrintOneLinerResultParser', ([], {'profileName': '"""simple"""'}), "(profileName='simple')\n", (3686, 3708), False, 'from parsers.printOneLinerResultParser import PrintOneLinerResultParser\n'), ((3205, 3276), 'collections.OrderedDict', 'Ord...
import glob import pathlib import unittest as ut import btorrent class TestTorrent(ut.TestCase): def test_torrent(self): path = pathlib.Path('tests/files/test_0.torrent') tt_0 = btorrent.Torrent(btorrent.TorrentFile.from_file(path)) tt_1 = btorrent.Torrent(path) for ilvl, lvl in ...
[ "btorrent.Torrent", "btorrent.TorrentFile.from_file", "pathlib.Path" ]
[((143, 185), 'pathlib.Path', 'pathlib.Path', (['"""tests/files/test_0.torrent"""'], {}), "('tests/files/test_0.torrent')\n", (155, 185), False, 'import pathlib\n'), ((271, 293), 'btorrent.Torrent', 'btorrent.Torrent', (['path'], {}), '(path)\n', (287, 293), False, 'import btorrent\n'), ((218, 254), 'btorrent.TorrentFi...
import glob import inspect import logging import os import shutil import sys import yaml from pathlib import Path from typing import List import multiply_data_access.data_access_component from multiply_core.models import get_forward_models from multiply_core.observations import INPUT_TYPES from multiply_core.variables...
[ "logging.getLogger", "sys.path.insert", "multiply_core.models.get_forward_models", "pathlib.Path.home", "share.bin.pmserver.PMServer", "logging.info", "os.remove", "os.path.exists", "multiply_post_processing.get_post_processor_creators", "multiply_post_processing.get_available_indicators", "insp...
[((848, 880), 'sys.path.insert', 'sys.path.insert', (['(0)', 'CALVALUS_DIR'], {}), '(0, CALVALUS_DIR)\n', (863, 880), False, 'import sys\n'), ((1649, 1693), 'os.path.exists', 'os.path.exists', (['path_to_multiply_config_file'], {}), '(path_to_multiply_config_file)\n', (1663, 1693), False, 'import os\n'), ((671, 690), '...
import csv import random exercises_filename = "exercises.csv" target_muscle = "triceps" surprise_me = False def get_list_of_exercies(muscle, surprise): exercises = [d for d in data if d["muscle"].lower() == muscle.lower()] if len(exercises) == 0: return [] if surprise: return [exercise...
[ "csv.DictReader" ]
[((531, 548), 'csv.DictReader', 'csv.DictReader', (['f'], {}), '(f)\n', (545, 548), False, 'import csv\n')]
import setuptools with open("README.md", "r", encoding="utf-8") as fh: long_description = fh.read() setuptools.setup( name="populate_ssm", version="0.2.0", author="<NAME>", author_email="<EMAIL>", description="Populate AWS SSM Parameter Store from .env File", long_description=long_descript...
[ "setuptools.find_packages" ]
[((742, 779), 'setuptools.find_packages', 'setuptools.find_packages', ([], {'where': '"""src"""'}), "(where='src')\n", (766, 779), False, 'import setuptools\n')]
import json import httplib2 from graphipy.graph.graph_base import BaseNode as Node, BaseEdge as Edge class Pinterest: def __init__(self, api): self.access_token = api["access_token"] # get a single user info in JSON format by username def get_single_user(self, username): url = "https://a...
[ "httplib2.Http", "graphipy.graph.graph_base.BaseNode.__init__" ]
[((536, 551), 'httplib2.Http', 'httplib2.Http', ([], {}), '()\n', (549, 551), False, 'import httplib2\n'), ((1008, 1023), 'httplib2.Http', 'httplib2.Http', ([], {}), '()\n', (1021, 1023), False, 'import httplib2\n'), ((1502, 1517), 'httplib2.Http', 'httplib2.Http', ([], {}), '()\n', (1515, 1517), False, 'import httplib...
import numpy as np import itertools import math class SubwayFinder: def find_subways(self, grouped_classifications): if not all(letter in grouped_classifications for letter in ("S","U","B","W","A","Y")): print("Can not find all parts of logo") return [] sorted_classificatio...
[ "numpy.mean", "itertools.product", "numpy.vectorize", "numpy.polyfit" ]
[((1286, 1305), 'numpy.polyfit', 'np.polyfit', (['x', 'y', '(1)'], {}), '(x, y, 1)\n', (1296, 1305), True, 'import numpy as np\n'), ((1327, 1360), 'numpy.vectorize', 'np.vectorize', (['(lambda x: a * x + b)'], {}), '(lambda x: a * x + b)\n', (1339, 1360), True, 'import numpy as np\n'), ((465, 507), 'itertools.product',...
import numpy as np import pandas as pd from autodcf.models._base import AbstractDCF from datetime import datetime class DCF(AbstractDCF): """Class for flexible DCF. Note that all _to_sales args take either an iterable or float. If given a float, the DCF will use this constant across all time periods (ex...
[ "numpy.repeat", "numpy.arange", "numpy.diff", "datetime.datetime.now", "numpy.concatenate", "numpy.cumprod" ]
[((8472, 8504), 'numpy.diff', 'np.diff', (["self._forecast['Sales']"], {}), "(self._forecast['Sales'])\n", (8479, 8504), True, 'import numpy as np\n'), ((8632, 8675), 'numpy.concatenate', 'np.concatenate', (['([0.0], future_changes_nwc)'], {}), '(([0.0], future_changes_nwc))\n', (8646, 8675), True, 'import numpy as np\...
import json import re import requests from lxml import etree def get(url: str) -> dict: """ title、imgs、videos """ data = {} headers = { "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25", ...
[ "re.findall", "lxml.etree.HTML", "requests.get", "json.loads" ]
[((429, 483), 're.findall', 're.findall', (['"""live\\\\.kuaishou\\\\.com/u/\\\\w+/(\\\\w+)"""', 'url'], {}), "('live\\\\.kuaishou\\\\.com/u/\\\\w+/(\\\\w+)', url)\n", (439, 483), False, 'import re\n'), ((572, 618), 'requests.get', 'requests.get', (['url'], {'headers': 'headers', 'timeout': '(10)'}), '(url, headers=hea...
# -*- coding: utf-8 -*- # Generated by Django 1.11.7 on 2018-01-18 09:35 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('dynamic_schemas', '0023_auto_20180118_1030'), ] operations = [ migrations.RenameMod...
[ "django.db.migrations.RenameModel" ]
[((300, 370), 'django.db.migrations.RenameModel', 'migrations.RenameModel', ([], {'old_name': '"""SchemaHelpUrl"""', 'new_name': '"""SchemaUrl"""'}), "(old_name='SchemaHelpUrl', new_name='SchemaUrl')\n", (322, 370), False, 'from django.db import migrations\n')]
import asyncio import json import logging from typing import List, Set import websockets class BrowserWebsocketServer: """ The BrowserWebsocketServer manages our connection to our browser extension, brokering messages between Google Meet and our plugin's EventHandler. We expect browser tabs (and our ...
[ "logging.getLogger", "websockets.serve", "json.loads" ]
[((884, 911), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (901, 911), False, 'import logging\n'), ((1426, 1486), 'websockets.serve', 'websockets.serve', (['self._message_receive_loop', 'hostname', 'port'], {}), '(self._message_receive_loop, hostname, port)\n', (1442, 1486), False, 'imp...
# Copyright 2014-2018 The PySCF Developers. 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 appl...
[ "sys.stderr.write" ]
[((623, 1004), 'sys.stderr.write', 'sys.stderr.write', (['"""\n\nWarning\n\nModules in the "future" directory (dmrgscf, fciqmcscf, shciscf, icmspt, xianci)\nhave been moved to pyscf/pyscf directory. You can still import these modules.\nfrom the "future" directory, and they work the same as before.\n\nTo avoid name con...
#!/usr/bin/env python3 # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import tempfile import megengine.data as data import pytest from basecls.configs import BaseConfig from basecls.data import ColorAugment, build_dataloader @pytest.mark.parametrize("train", [True, False]) def test_build_folderloader(tr...
[ "basecls.configs.BaseConfig", "tempfile.TemporaryDirectory", "basecls.data.build_dataloader", "pytest.mark.parametrize", "basecls.data.ColorAugment.build" ]
[((242, 289), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""train"""', '[True, False]'], {}), "('train', [True, False])\n", (265, 289), False, 'import pytest\n'), ((335, 364), 'tempfile.TemporaryDirectory', 'tempfile.TemporaryDirectory', ([], {}), '()\n', (362, 364), False, 'import tempfile\n'), ((542, 56...
from utils import BadID, ParsedData from .utils import get_page, get_file from bs4 import BeautifulSoup from loguru import logger BASE_LINK = "https://ok.ru/profile/{}" def _get_link(user_id: str) -> str: if not user_id.isdigit(): raise BadID if int(user_id) <= 0: raise BadID return BAS...
[ "loguru.logger.debug" ]
[((560, 596), 'loguru.logger.debug', 'logger.debug', (['f"""404 for {page_link}"""'], {}), "(f'404 for {page_link}')\n", (572, 596), False, 'from loguru import logger\n')]
import logging from django.contrib import auth from django.contrib.auth.decorators import login_required from django.http import HttpResponseRedirect from django.shortcuts import render from zapi.forms import LoginForm logger = logging.getLogger(__name__) def index(request): return render(request, "index.html"...
[ "logging.getLogger", "django.http.HttpResponseRedirect", "django.shortcuts.render", "zapi.forms.LoginForm", "django.contrib.auth.authenticate", "django.contrib.auth.login", "django.contrib.auth.logout" ]
[((231, 258), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (248, 258), False, 'import logging\n'), ((292, 321), 'django.shortcuts.render', 'render', (['request', '"""index.html"""'], {}), "(request, 'index.html')\n", (298, 321), False, 'from django.shortcuts import render\n'), ((1476, 1...
import numpy as np import heapq from typing import Union class Graph: def __init__(self, adjacency_mat: Union[np.ndarray, str]): """ Unlike project 2, this Graph class takes an adjacency matrix as input. `adjacency_mat` can either be a 2D numpy array of floats or the path to a CSV file containing ...
[ "heapq.heappush", "numpy.loadtxt", "heapq.heapify", "heapq.heappop" ]
[((2752, 2772), 'heapq.heapify', 'heapq.heapify', (['queue'], {}), '(queue)\n', (2765, 2772), False, 'import heapq\n'), ((925, 953), 'numpy.loadtxt', 'np.loadtxt', (['f'], {'delimiter': '""","""'}), "(f, delimiter=',')\n", (935, 953), True, 'import numpy as np\n'), ((3040, 3060), 'heapq.heappop', 'heapq.heappop', (['qu...
# # Copyright 2021 <NAME> # # MIT License # # 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, merge, publish...
[ "numpy.ones_like", "numpy.roll", "numpy.amin", "numpy.arange", "numpy.where", "numpy.asarray", "scipy.special.erfinv", "numpy.fft.rfftn", "numpy.sum", "numpy.array", "json.dump" ]
[((1429, 1463), 'numpy.arange', 'np.arange', (['(0)', 'nx'], {'dtype': 'np.float64'}), '(0, nx, dtype=np.float64)\n', (1438, 1463), True, 'import numpy as np\n'), ((1472, 1520), 'numpy.where', 'np.where', (['(qx <= nx // 2)', '(qx / Lx)', '((nx - qx) / Lx)'], {}), '(qx <= nx // 2, qx / Lx, (nx - qx) / Lx)\n', (1480, 15...
import pandas as pd from pandas.testing import assert_frame_equal import pytest def assert_dataframes_equals(expected, actual): assert expected.shape==actual.shape assert set(expected.columns) == set(actual.columns) columns_order = list(expected.columns) a = actual[columns_order].sort_values(by=list(a...
[ "pandas.read_sql_query", "pandas.testing.assert_frame_equal" ]
[((455, 498), 'pandas.testing.assert_frame_equal', 'assert_frame_equal', (['e', 'a'], {'check_dtype': '(False)'}), '(e, a, check_dtype=False)\n', (473, 498), False, 'from pandas.testing import assert_frame_equal\n'), ((770, 866), 'pandas.read_sql_query', 'pd.read_sql_query', (['actual_query_string', 'pytest.sql_connect...
from os import getcwd import re def parseIndex(rule: str): idxRegex = re.search(r"(\d+): ", rule) index = int(idxRegex.groups()[0]) rule = rule[idxRegex.span()[1]:] return (index, rule) def parsePattern(pattern: str, idxToPat: dict): # check 1: is this a final substring? reg...
[ "os.getcwd", "re.search" ]
[((81, 108), 're.search', 're.search', (['"""(\\\\d+): """', 'rule'], {}), "('(\\\\d+): ', rule)\n", (90, 108), False, 'import re\n'), ((325, 358), 're.search', 're.search', (['"""\\\\"(.*?)\\\\\\""""', 'pattern'], {}), '(\'\\\\"(.*?)\\\\"\', pattern)\n', (334, 358), False, 'import re\n'), ((493, 528), 're.search', 're...
""" entry point for execution """ import os import sys import argparse from workflow.common.config import cfg def parse_args(): """get main arguments from config file and command line """ parser = argparse.ArgumentParser(description="Project name") parser.add_argument( "-c", "--config-f...
[ "workflow.common.config.cfg.merge_from_file", "workflow.common.config.cfg.freeze", "workflow.common.config.cfg.merge_from_list", "argparse.ArgumentParser" ]
[((218, 269), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Project name"""'}), "(description='Project name')\n", (241, 269), False, 'import argparse\n'), ((669, 706), 'workflow.common.config.cfg.merge_from_file', 'cfg.merge_from_file', (['args.config_file'], {}), '(args.config_file)\n'...
#!/usr/bin/env python # -*- coding: utf-8 -*- from typing import Tuple import numpy as np import pytest from aicsimageio import exceptions from aicsimageio.readers.default_reader import DefaultReader from ..conftest import get_resource_full_path, host from ..image_container_test_utils import run_image_file_checks ...
[ "numpy.dtype", "pytest.mark.raises", "pytest.raises", "aicsimageio.readers.default_reader.DefaultReader" ]
[((2099, 2121), 'pytest.raises', 'pytest.raises', (['IOError'], {}), '(IOError)\n', (2112, 2121), False, 'import pytest\n'), ((2156, 2227), 'aicsimageio.readers.default_reader.DefaultReader', 'DefaultReader', (['"""https://archive.org/embed/archive-video-files/test.mp4"""'], {}), "('https://archive.org/embed/archive-vi...
# python3 code # import the opencv library import cv2 import tkinter as tk class Webcam_Capture: def __init__(self): # define a video capture object self.vid = cv2.VideoCapture(0) while(True): # Capture the video frame # by frame ...
[ "cv2.waitKey", "cv2.destroyAllWindows", "cv2.VideoCapture", "cv2.imshow" ]
[((182, 201), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (198, 201), False, 'import cv2\n'), ((791, 814), 'cv2.destroyAllWindows', 'cv2.destroyAllWindows', ([], {}), '()\n', (812, 814), False, 'import cv2\n'), ((416, 442), 'cv2.imshow', 'cv2.imshow', (['"""frame"""', 'frame'], {}), "('frame', frame...
import collections import numpy as np class Vectorizer(object): def __init__(self): self.mapping = {} self.inverse_mapping = {} self.embedding_size = 0 def vectorize_string(self, s): vec = np.empty(len(s)) for i in range(0,len(s)): char = s[i] if...
[ "numpy.array" ]
[((1519, 1536), 'numpy.array', 'np.array', (['vectors'], {}), '(vectors)\n', (1527, 1536), True, 'import numpy as np\n')]
#!/usr/bin/env python # -*- coding: utf-8 -*- try: from setuptools import setup, find_packages except ImportError: from distutils.core import setup, find_packages readme = open('README.md').read() requirements = open('requirements.txt').readlines() VERSION = open('VERSION').read().strip() setup( name='...
[ "distutils.core.find_packages" ]
[((682, 714), 'distutils.core.find_packages', 'find_packages', ([], {'exclude': "['test*']"}), "(exclude=['test*'])\n", (695, 714), False, 'from distutils.core import setup, find_packages\n')]
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'robotGUI.ui' # # Created by: PyQt5 UI code generator 5.9.2 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets import myFrame as mf class Ui_MainWindow(object): def setupUi(...
[ "PyQt5.QtWidgets.QWidget", "PyQt5.QtWidgets.QTextEdit", "PyQt5.QtGui.QFont", "PyQt5.QtCore.QMetaObject.connectSlotsByName", "PyQt5.QtWidgets.QSlider", "PyQt5.QtCore.QRect", "PyQt5.QtWidgets.QGridLayout", "myFrame.MyFrame", "PyQt5.QtWidgets.QLabel", "PyQt5.QtWidgets.QStatusBar", "PyQt5.QtCore.QSi...
[((455, 484), 'PyQt5.QtWidgets.QWidget', 'QtWidgets.QWidget', (['MainWindow'], {}), '(MainWindow)\n', (472, 484), False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((571, 612), 'PyQt5.QtWidgets.QGridLayout', 'QtWidgets.QGridLayout', (['self.centralwidget'], {}), '(self.centralwidget)\n', (592, 612), False, 'from ...
import csv import os from botocore.exceptions import ClientError from django import forms from django.conf import settings from django.contrib import messages from django.contrib.admin import helpers from django.contrib.auth.mixins import UserPassesTestMixin from django.core.exceptions import ValidationError from dja...
[ "dataworkspace.apps.datasets.models.ReferenceDatasetUploadLog.objects.get", "django.forms.HiddenInput", "dataworkspace.apps.core.boto3_client.get_s3_client", "django.urls.reverse", "dataworkspace.apps.datasets.models.ReferenceDatasetUploadLogRecord", "django.shortcuts.get_object_or_404", "dataworkspace....
[((1165, 1240), 'django.shortcuts.get_object_or_404', 'get_object_or_404', (['ReferenceDataset'], {'pk': "self.kwargs['reference_dataset_id']"}), "(ReferenceDataset, pk=self.kwargs['reference_dataset_id'])\n", (1182, 1240), False, 'from django.shortcuts import get_object_or_404\n'), ((5415, 5485), 'django.urls.reverse'...
from basecrawl import BaseCrawl import praw import string import time from datetime import date from praw.models import MoreComments from textprocess import * from mongo import Mongo import operator import re class RedditCrawl(BaseCrawl): def __init__(self,config_path = 'config.ini'): super().__init__('re...
[ "mongo.Mongo", "datetime.date.fromtimestamp", "praw.Reddit", "time.sleep" ]
[((665, 808), 'praw.Reddit', 'praw.Reddit', ([], {'client_id': 'self.__client_id', 'client_secret': 'self.__client_secret', 'redirect_url': 'self.__redirect_url', 'user_agent': 'self.__user_agent'}), '(client_id=self.__client_id, client_secret=self.__client_secret,\n redirect_url=self.__redirect_url, user_agent=self...
from flask import render_template,url_for,request,flash,redirect,abort from app.main import main from app.models import User,Blog,Comment from .. import db, photos from .forms import UpdateProfile,CreateBlog from flask_login import login_required,current_user import secrets import os from ..email import mail_message ...
[ "flask.render_template", "flask.request.args.get", "secrets.token_hex", "app.models.Blog.posted.desc", "flask.flash", "os.path.splitext", "os.path.join", "app.models.Blog", "flask.request.form.get", "app.models.Blog.query.get", "app.main.main.route", "flask.url_for", "flask_login.current_use...
[((322, 337), 'app.main.main.route', 'main.route', (['"""/"""'], {}), "('/')\n", (332, 337), False, 'from app.main import main\n'), ((556, 604), 'app.main.main.route', 'main.route', (['"""/new_post"""'], {'methods': "['GET', 'POST']"}), "('/new_post', methods=['GET', 'POST'])\n", (566, 604), False, 'from app.main impor...
""" test_nc_util.py Routines to test georef's nc_info.py code """ import os import georef import georef.nc_util def test_write_sample_netCDF_file(): """Test that can write a simple geo-referenced netCDF file""" test_filename = './test_georef.nc' try: assert not os.path.isfile(test_filename) ...
[ "os.remove", "os.path.isfile", "georef.nc_util.write_simple_netCDF_file" ]
[((437, 507), 'georef.nc_util.write_simple_netCDF_file', 'georef.nc_util.write_simple_netCDF_file', (['test_filename'], {'overwrite': '(True)'}), '(test_filename, overwrite=True)\n', (476, 507), False, 'import georef\n'), ((512, 536), 'os.remove', 'os.remove', (['test_filename'], {}), '(test_filename)\n', (521, 536), F...
# Generated by Django 4.0.2 on 2022-03-26 14:52 import datetime from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('cpovc_forms', '0002_initial'), ] operations = [ migrations.AlterField( model_name='ovchivmanagement', ...
[ "datetime.datetime" ]
[((405, 455), 'datetime.datetime', 'datetime.datetime', (['(2022)', '(3)', '(26)', '(17)', '(52)', '(28)', '(252242)'], {}), '(2022, 3, 26, 17, 52, 28, 252242)\n', (422, 455), False, 'import datetime\n')]
# # Copyright (c) 2014, 2016, 2018, 2020 LexisNexis Risk Data Management Inc. # # This file is part of the RadSSH software package. # # RadSSH is free software, released under the Revised BSD License. # You are permitted to use, modify, and redsitribute this software # according to the Revised BSD License, a copy of wh...
[ "logging.getLogger", "sys.platform.startswith", "readline.read_history_file", "sys.exit", "pprint.pprint", "readline.get_endidx", "readline.set_completer", "os.path.exists", "readline.parse_and_bind", "os.listdir", "colorama.initialise.init", "os.path.isdir", "os.mkdir", "atexit.register",...
[((1436, 1466), 'sys.platform.startswith', 'sys.platform.startswith', (['"""win"""'], {}), "('win')\n", (1459, 1466), False, 'import sys\n'), ((14052, 14079), 'logging.getLogger', 'logging.getLogger', (['"""radssh"""'], {}), "('radssh')\n", (14069, 14079), False, 'import logging\n'), ((14516, 14548), 'os.path.join', 'o...
import os import sys import logging file_dir = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(1, f"{file_dir}/../") from db import session, Protein, SequenceAlign, StructureValidation from utils import download_cif from sqlalchemy import or_ import requests logging.basicConfig(format="%(levelname)s: %(mes...
[ "logging.basicConfig", "sys.path.insert", "db.session.add", "db.StructureValidation", "requests.get", "db.session.query", "utils.download_cif", "db.SequenceAlign", "os.path.abspath", "db.session.commit", "sqlalchemy.or_", "logging.info", "logging.error" ]
[((91, 128), 'sys.path.insert', 'sys.path.insert', (['(1)', 'f"""{file_dir}/../"""'], {}), "(1, f'{file_dir}/../')\n", (106, 128), False, 'import sys\n'), ((272, 342), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(levelname)s: %(message)s"""', 'level': '"""INFO"""'}), "(format='%(levelname)s: %(me...
import os from typing import Type class Config(object): # Flask. DEBUG = True FLASK_ENV = os.getenv("FLASK_ENV", "DEBUG") # Telegram. TELEGRAM_TOKEN = "" class ProductionConfig(Config): DEBUG = False # Telegram. TELEGRAM_TOKEN = os.getenv("TELEGRAM_TOKEN", "") class DebugConfig(Con...
[ "os.getenv" ]
[((104, 135), 'os.getenv', 'os.getenv', (['"""FLASK_ENV"""', '"""DEBUG"""'], {}), "('FLASK_ENV', 'DEBUG')\n", (113, 135), False, 'import os\n'), ((265, 296), 'os.getenv', 'os.getenv', (['"""TELEGRAM_TOKEN"""', '""""""'], {}), "('TELEGRAM_TOKEN', '')\n", (274, 296), False, 'import os\n'), ((380, 416), 'os.getenv', 'os.g...
import click from gradient.cli import common from gradient.cli.clusters import clusters from gradient.cli.common import api_key_option from gradient.commands.machine_types import ListMachineTypesCommand @clusters.group("machineTypes", help="Manage machine types") def machine_types_group(): pass @machine_types_...
[ "click.option", "gradient.commands.machine_types.ListMachineTypesCommand", "gradient.cli.clusters.clusters.group" ]
[((207, 266), 'gradient.cli.clusters.clusters.group', 'clusters.group', (['"""machineTypes"""'], {'help': '"""Manage machine types"""'}), "('machineTypes', help='Manage machine types')\n", (221, 266), False, 'from gradient.cli.clusters import clusters\n'), ((380, 496), 'click.option', 'click.option', (['"""--clusterId"...
from logging import log from tensorflow.python.ops.variables import model_variables from signver.extractor import MetricExtractor def test_extractor_load(): model_path = "models/extractor/metric" extractor = MetricExtractor() extractor.load(model_path) assert extractor.model is not None
[ "signver.extractor.MetricExtractor" ]
[((219, 236), 'signver.extractor.MetricExtractor', 'MetricExtractor', ([], {}), '()\n', (234, 236), False, 'from signver.extractor import MetricExtractor\n')]
import threading import numpy as np import time import rospy from sensor_msgs import point_cloud2 from std_msgs.msg import Header from sensor_msgs.msg import PointCloud2, PointField from stella_nav_core.geometry_utils import GeometryUtils from stella_nav_core.config import CostConfig, MotionConfig class State(object)...
[ "numpy.array", "stella_nav_core.geometry_utils.GeometryUtils.get_yaw", "numpy.linalg.norm", "numpy.sin", "stella_nav_core.config.MotionConfig", "numpy.cross", "threading.RLock", "stella_nav_core.config.CostConfig", "numpy.linspace", "sensor_msgs.point_cloud2.create_cloud", "numpy.vstack", "num...
[((1289, 1310), 'stella_nav_core.config.CostConfig', 'CostConfig', (['(0.01)', '(1.0)'], {}), '(0.01, 1.0)\n', (1299, 1310), False, 'from stella_nav_core.config import CostConfig, MotionConfig\n'), ((1330, 1351), 'stella_nav_core.config.CostConfig', 'CostConfig', (['(0.01)', '(1.0)'], {}), '(0.01, 1.0)\n', (1340, 1351)...
"""Easily convert RGB video data (e.g. .avi) to the TensorFlow tfrecords file format with the provided 3 color channels. Allows to subsequently train a neural network in TensorFlow with the generated tfrecords. Due to common hardware/GPU RAM limitations, this implementation allows to limit the number of frames per v...
[ "cv2.normalize", "math.floor", "tensorflow.train.Int64List", "numpy.array", "numpy.asarray", "tensorflow.python_io.TFRecordWriter", "cv2.calcOpticalFlowFarneback", "cv2.waitKey", "tensorflow.python.platform.app.run", "tensorflow.python.platform.flags.DEFINE_integer", "tensorflow.train.BytesList"...
[((1141, 1241), 'tensorflow.python.platform.flags.DEFINE_integer', 'flags.DEFINE_integer', (['"""num_videos"""', '(1000)', '"""Number of videos stored in one single tfrecords file"""'], {}), "('num_videos', 1000,\n 'Number of videos stored in one single tfrecords file')\n", (1161, 1241), False, 'from tensorflow.pyth...
import numpy as np import SimpleITK as sitk def reference_image_build(spacing, size, direction, template_size, dim): #template size: image(array) dimension to resize to: a list of three elements reference_spacing = np.array(size)/np.array(template_size)*np.array(spacing) reference_spacing[0] = 1.2 reference_...
[ "numpy.random.rand", "SimpleITK.AffineTransform", "numpy.array", "numpy.sin", "numpy.reshape", "numpy.fft.fft2", "numpy.matmul", "numpy.min", "SimpleITK.Resample", "numpy.eye", "SimpleITK.TranslationTransform", "numpy.ceil", "SimpleITK.Image", "numpy.squeeze", "numpy.cos", "SimpleITK.C...
[((357, 385), 'SimpleITK.Image', 'sitk.Image', (['template_size', '(0)'], {}), '(template_size, 0)\n', (367, 385), True, 'import SimpleITK as sitk\n'), ((628, 659), 'SimpleITK.AffineTransform', 'sitk.AffineTransform', (['dimension'], {}), '(dimension)\n', (648, 659), True, 'import SimpleITK as sitk\n'), ((873, 909), 'S...
from django.contrib.auth import get_user_model from django.test import TestCase from django.urls import reverse from rest_framework import status from rest_framework.test import APIClient from core.models import Recipe, Tag, Ingredient from recipe.serializers import RecipeSerializer, RecipeDetailSerializer RECIPES_U...
[ "core.models.Recipe.objects.create", "django.contrib.auth.get_user_model", "recipe.serializers.RecipeSerializer", "core.models.Tag.objects.create", "core.models.Recipe.objects.all", "rest_framework.test.APIClient", "core.models.Recipe.objects.get", "core.models.Recipe.objects.filter", "django.urls.r...
[((325, 354), 'django.urls.reverse', 'reverse', (['"""recipe:recipe-list"""'], {}), "('recipe:recipe-list')\n", (332, 354), False, 'from django.urls import reverse\n'), ((422, 471), 'django.urls.reverse', 'reverse', (['"""recipe:recipe-detail"""'], {'args': '[recipe_id]'}), "('recipe:recipe-detail', args=[recipe_id])\n...
import gtfs_kit from representation.gtfs_metadata import GtfsMetadata from representation.gtfs_representation import GtfsRepresentation from representation.dataset_infos import DatasetInfos from requests.exceptions import MissingSchema from pandas.errors import ParserError GTFS_TYPE = "GTFS" GBFS_TYPE = "GBFS" def b...
[ "representation.gtfs_representation.GtfsRepresentation", "gtfs_kit.read_feed", "representation.gtfs_metadata.GtfsMetadata", "requests.exceptions.MissingSchema" ]
[((1859, 1886), 'representation.gtfs_metadata.GtfsMetadata', 'GtfsMetadata', (['dataset_infos'], {}), '(dataset_infos)\n', (1871, 1886), False, 'from representation.gtfs_metadata import GtfsMetadata\n'), ((1908, 1979), 'representation.gtfs_representation.GtfsRepresentation', 'GtfsRepresentation', (['dataset_infos.sourc...
#!/usr/bin/env python3 """ This script runs Clarity Chess in UCI (Universal Chess Interface) mode. """ import sys from .Board import Board from .Move import Move from .MoveType import MoveType from .recursion import negamax from .Sq import Sq def detect_move_type(board, init_sq, dest_sq): """ Parameters ...
[ "sys.stdin.readline" ]
[((875, 895), 'sys.stdin.readline', 'sys.stdin.readline', ([], {}), '()\n', (893, 895), False, 'import sys\n')]
__all__ = [ 'PyForwardRef', 'PyLiteral', 'PyProtocol', 'PyDeque', 'PyTypedDict', 'PyTypedDicts', 'FrozenKeys', 'DefFactory', 'NoneType', 'ExplicitNullType', 'ExplicitNull', 'JSONList', 'JSONObject', 'ListOfJSONObject', 'JSONValue', 'Encoder', 'Decoder'...
[ "functools.wraps", "typing.TypeVar" ]
[((923, 935), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (930, 935), False, 'from typing import Type, TypeVar, Sequence, Mapping, List, DefaultDict, FrozenSet, NamedTuple, Callable, AnyStr, Dict, Any, Union\n'), ((962, 986), 'typing.TypeVar', 'TypeVar', (['"""E"""'], {'bound': 'Enum'}), "('E', bound=Enu...
import re import math import numpy as np class UpstreamAUG: def __init__(self, allow_ORF=True, verbose_output=False): """ Constructor :param allow_ORF: bool, True by default, whether to check uORFs :param verbose_output: bool, False by default, whether to return dictionaries in pr...
[ "numpy.array", "math.ceil", "re.finditer" ]
[((2560, 2579), 'numpy.array', 'np.array', (['ATG_frame'], {}), '(ATG_frame)\n', (2568, 2579), True, 'import numpy as np\n'), ((4952, 4971), 'numpy.array', 'np.array', (['ATG_frame'], {}), '(ATG_frame)\n', (4960, 4971), True, 'import numpy as np\n'), ((2235, 2254), 'numpy.array', 'np.array', (['ATG_frame'], {}), '(ATG_...