code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import unittest
# time complexity O(n**2)
# space complexity O(1)
def selection_sort(arr):
n = len(arr)
while n >= 2:
value_max = arr[0]
index_max = 0
for i in range(1, n):
if arr[i] > value_max:
value_max = arr[i]
index_max = i
arr[... | [
"unittest.main"
] | [((608, 623), 'unittest.main', 'unittest.main', ([], {}), '()\n', (621, 623), False, 'import unittest\n')] |
# !/usr/bin/python3
# -*- coding: utf-8 -*-
# *****************************************************************************/
# * Authors: <NAME>, <NAME>
# *****************************************************************************/
import os, datetime, traceback, optparse, shutil
import PyInstaller.__main__
... | [
"os.path.exists",
"os.path.join",
"optparse.OptionParser",
"os.getcwd",
"datetime.datetime.now",
"shutil.copyfile",
"os.path.isdir",
"os.mkdir",
"shutil.rmtree",
"traceback.print_exc"
] | [((482, 505), 'optparse.OptionParser', 'optparse.OptionParser', ([], {}), '()\n', (503, 505), False, 'import os, datetime, traceback, optparse, shutil\n'), ((2649, 2672), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (2670, 2672), False, 'import os, datetime, traceback, optparse, shutil\n'), ((283... |
from .database import db_session, init_db
from .models import User, Book, BookRental
from sqlalchemy import func
import datetime
import logging
init_db()
def get_tables(db_table):
"""
@author : <NAME>
:param db_table: database table in model.py
:type db_table: database model Object
... | [
"datetime.date.today",
"logging.info",
"sqlalchemy.func.max",
"datetime.timedelta"
] | [((996, 1040), 'logging.info', 'logging.info', (['"""Database : Add Entry Success"""'], {}), "('Database : Add Entry Success')\n", (1008, 1040), False, 'import logging\n'), ((1640, 1687), 'logging.info', 'logging.info', (['"""Database : Delete Entry Success"""'], {}), "('Database : Delete Entry Success')\n", (1652, 168... |
# -*- coding:utf-8 -*-
from django.db import models
import django.utils.timezone as timezone
# 用户登录信息表(服务器、虚拟机)
class ConnectionInfo(models.Model):
# 用户连接相关信息
ssh_username = models.CharField(max_length=10, default='', verbose_name=u'ssh用户名', null=True)
ssh_userpasswd = models.CharField(max_length=40, defa... | [
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.IntegerField",
"django.utils.timezone.now",
"django.db.models.CharField"
] | [((184, 262), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(10)', 'default': '""""""', 'verbose_name': 'u"""ssh用户名"""', 'null': '(True)'}), "(max_length=10, default='', verbose_name=u'ssh用户名', null=True)\n", (200, 262), False, 'from django.db import models\n'), ((284, 363), 'django.db.models.C... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-BASE 蓝鲸基础平台 is licensed under the MIT License.
License for BK-BASE 蓝鲸基础平台:
------------------------------------------... | [
"django.utils.translation.ugettext_lazy",
"dataflow.batch.periodic.param_info.builder.periodic_batch_job_builder.PeriodicBatchJobBuilder.calculate_output_offset",
"dataflow.batch.utils.time_util.BatchTimeTuple"
] | [((3964, 3980), 'dataflow.batch.utils.time_util.BatchTimeTuple', 'BatchTimeTuple', ([], {}), '()\n', (3978, 3980), False, 'from dataflow.batch.utils.time_util import BatchTimeTuple\n'), ((4067, 4083), 'dataflow.batch.utils.time_util.BatchTimeTuple', 'BatchTimeTuple', ([], {}), '()\n', (4081, 4083), False, 'from dataflo... |
"""Test app.routes.build."""
import responses
mock_product_data = {
"bucket_name": "lsst-the-docs",
"doc_repo": "https://github.com/lsst-sqre/test-059.git",
"domain": "test-059.lsst.io",
"fastly_domain": "n.global-ssl.fastly.net",
"published_url": "https://test-059.lsst.io",
"root_domain": "l... | [
"responses.add"
] | [((3453, 3621), 'responses.add', 'responses.add', (['responses.GET', '"""https://keeper-staging.lsst.codes/products/test-059/dashboard"""'], {'json': 'mock_bulk_data', 'status': '(200)', 'content_type': '"""application/json"""'}), "(responses.GET,\n 'https://keeper-staging.lsst.codes/products/test-059/dashboard', js... |
from sklearn import tree
from matplotlib import pyplot as plt
from sklearn.model_selection import cross_val_score
from sklearn.model_selection import train_test_split
from sklearn import model_selection
from sklearn import metrics
import numpy as np
import pandas as pd
import seaborn as sns
from sklearn.neighbors impor... | [
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"sklearn.neighbors.KNeighborsClassifier",
"sklearn.preprocessing.StandardScaler",
"sklearn.naive_bayes.GaussianNB",
"sklearn.metrics.accuracy_score"
] | [((725, 749), 'pandas.read_csv', 'pd.read_csv', (['"""heart.csv"""'], {}), "('heart.csv')\n", (736, 749), True, 'import pandas as pd\n'), ((1583, 1650), 'sklearn.model_selection.train_test_split', 'train_test_split', (['x', 'y'], {'test_size': '(0.2)', 'random_state': '(5)', 'shuffle': '(True)'}), '(x, y, test_size=0.2... |
# Generated by Django 3.2 on 2021-05-17 12:43
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('api', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Pavilhao',
fiel... | [
"django.db.models.ForeignKey",
"django.db.models.CharField",
"django.db.models.BigAutoField",
"django.db.models.IntegerField"
] | [((626, 722), 'django.db.models.BigAutoField', 'models.BigAutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (645, 722), False, 'from django.db import migrations, m... |
import torch
from torch import nn
import torch.nn.functional as F
#from helper_functions import process_image
class DeepNetworkClassifier(nn.Module):
def __init__(self, input_units, output_units, hidden_units,p_drop=0.2):
'''
Builds a classifier for a pretrained deep neural network for the flower d... | [
"torch.nn.Dropout",
"torch.from_numpy",
"torch.exp",
"torch.nn.functional.log_softmax",
"torch.nn.Linear",
"torch.no_grad"
] | [((6466, 6489), 'torch.from_numpy', 'torch.from_numpy', (['image'], {}), '(image)\n', (6482, 6489), False, 'import torch\n'), ((674, 710), 'torch.nn.Linear', 'nn.Linear', (['input_units', 'hidden_units'], {}), '(input_units, hidden_units)\n', (683, 710), False, 'from torch import nn\n'), ((804, 841), 'torch.nn.Linear',... |
from flask import Blueprint, redirect, url_for, g
from ..utils.utils import make_cache_key
from ..internals.cache.redis import get_conn
from ..internals.cache.flask_cache import cache
from ..internals.database.database import get_cursor
from ..lib.artist import get_artist, get_random_artist_keys
from ..lib.po... | [
"flask.redirect",
"flask.Blueprint",
"random.choice",
"flask.url_for"
] | [((478, 507), 'flask.Blueprint', 'Blueprint', (['"""random"""', '__name__'], {}), "('random', __name__)\n", (487, 507), False, 'from flask import Blueprint, redirect, url_for, g\n'), ((1150, 1172), 'random.choice', 'rand.choice', (['post_keys'], {}), '(post_keys)\n', (1161, 1172), True, 'import random as rand\n'), ((13... |
# -*- coding: utf-8 -*-
import scrapy
class BitcointalkSpider(scrapy.Spider):
name = 'bitcointalk'
allowed_domains = ['bitcointalk.org']
start_urls = [
'https://bitcointalk.org/index.php?board=1.0',
]
def parse(self, response):
topics = response.css('div.tborder table.bordercolor'... | [
"scrapy.Request"
] | [((844, 884), 'scrapy.Request', 'scrapy.Request', (['url'], {'callback': 'self.parse'}), '(url, callback=self.parse)\n', (858, 884), False, 'import scrapy\n'), ((1712, 1757), 'scrapy.Request', 'scrapy.Request', (['url'], {'callback': 'self.parseTopic'}), '(url, callback=self.parseTopic)\n', (1726, 1757), False, 'import... |
from typing import Any, Optional
import pyarrow as pa
from fugue.column.expressions import (
ColumnExpr,
_FuncExpr,
_to_col,
function,
)
from triad import Schema
def coalesce(*args: Any) -> ColumnExpr:
"""SQL ``COALESCE`` function
:param args: If a value is not :class:`~fugue.column.expressi... | [
"fugue.column.expressions._to_col"
] | [((779, 789), 'fugue.column.expressions._to_col', '_to_col', (['x'], {}), '(x)\n', (786, 789), False, 'from fugue.column.expressions import ColumnExpr, _FuncExpr, _to_col, function\n')] |
from functools import reduce
from itertools import groupby
from operator import add, itemgetter
def merge_records_by(key, combine):
return lambda first, second: {
k: first[k] if k == key else combine(first[k], second[k])
for k in first
}
def merge_list_of_records_by(key, combine):
keypr... | [
"operator.itemgetter"
] | [((325, 340), 'operator.itemgetter', 'itemgetter', (['key'], {}), '(key)\n', (335, 340), False, 'from operator import add, itemgetter\n')] |
from selenium import webdriver
from config import Config
from db import cursor
def get_venues():
driver = webdriver.Chrome()
try:
driver.get("https://tickets.edfringe.com/venues")
while True:
venues_container = driver.find_element_by_class_name("venues")
for venue in ... | [
"selenium.webdriver.Chrome",
"config.Config.from_env"
] | [((113, 131), 'selenium.webdriver.Chrome', 'webdriver.Chrome', ([], {}), '()\n', (129, 131), False, 'from selenium import webdriver\n'), ((1030, 1047), 'config.Config.from_env', 'Config.from_env', ([], {}), '()\n', (1045, 1047), False, 'from config import Config\n')] |
import unittest
import logging
import xml.etree.ElementTree as et
import dscraper.utils as utils
logger = logging.getLogger(__name__)
class TestUtils(unittest.TestCase):
XML_FILES = (
'tests/resources/1.xml',
)
def setUp(self):
pass
| [
"logging.getLogger"
] | [((108, 135), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (125, 135), False, 'import logging\n')] |
import numpy as np
import cv2
import glob
from matplotlib import pyplot as plt
class CameraCalibration():
def __init__(self):
pass
# ===========================================================
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@staticmethod
def find_chess(frame... | [
"cv2.norm",
"cv2.projectPoints",
"cv2.imshow",
"cv2.destroyAllWindows",
"cv2.calibrateCamera",
"cv2.findChessboardCorners",
"cv2.cornerSubPix",
"matplotlib.pyplot.imshow",
"cv2.line",
"cv2.undistort",
"matplotlib.pyplot.yticks",
"numpy.concatenate",
"cv2.waitKey",
"matplotlib.pyplot.xticks... | [((604, 660), 'numpy.zeros', 'np.zeros', (['(chess_size[0] * chess_size[1], 3)', 'np.float32'], {}), '((chess_size[0] * chess_size[1], 3), np.float32)\n', (612, 660), True, 'import numpy as np\n'), ((947, 992), 'cv2.cvtColor', 'cv2.cvtColor', (['frame_input', 'cv2.COLOR_BGR2GRAY'], {}), '(frame_input, cv2.COLOR_BGR2GRA... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
import torch
import torch.nn as nn
from .sdc_darknet import SDCCSPDarknet
# from .simo_darknet import SIMOCSPDarknet
from .network_blocks import BaseConv, CSPLayer, DWConv
from .network_blocks import get_activatio... | [
"torch.nn.ModuleList",
"torch.nn.BatchNorm2d",
"torch.nn.Upsample",
"torch.nn.Conv2d"
] | [((1131, 1174), 'torch.nn.Upsample', 'nn.Upsample', ([], {'scale_factor': '(2)', 'mode': '"""nearest"""'}), "(scale_factor=2, mode='nearest')\n", (1142, 1174), True, 'import torch.nn as nn\n'), ((1203, 1218), 'torch.nn.ModuleList', 'nn.ModuleList', ([], {}), '()\n', (1216, 1218), True, 'import torch.nn as nn\n'), ((149... |
import unittest
from minos.common import (
MinosException,
)
from minos.networks import (
MinosNetworkException,
)
class TestExceptions(unittest.TestCase):
def test_type(self):
self.assertTrue(issubclass(MinosNetworkException, MinosException))
if __name__ == "__main__":
unittest.main()
| [
"unittest.main"
] | [((300, 315), 'unittest.main', 'unittest.main', ([], {}), '()\n', (313, 315), False, 'import unittest\n')] |
__author__ = 'Vincent'
from protorpc import messages
class CsvFile(messages.Message):
file = messages.BytesField(1, required=True)
name = messages.StringField(2, required=False) | [
"protorpc.messages.BytesField",
"protorpc.messages.StringField"
] | [((99, 136), 'protorpc.messages.BytesField', 'messages.BytesField', (['(1)'], {'required': '(True)'}), '(1, required=True)\n', (118, 136), False, 'from protorpc import messages\n'), ((148, 187), 'protorpc.messages.StringField', 'messages.StringField', (['(2)'], {'required': '(False)'}), '(2, required=False)\n', (168, 1... |
import os
import numpy as np
import tensorflow as tf
from models.config import Config
from models.memory_gan import MemoryGAN
from models.test_generation import test_generation
from models.train import train
from utils import pp, visualize, to_json
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
flags = tf.app.flags
flags.... | [
"models.config.Config",
"tensorflow.Session",
"utils.pp.pprint",
"models.test_generation.test_generation",
"tensorflow.ConfigProto",
"models.train.train",
"tensorflow.app.run"
] | [((992, 1022), 'utils.pp.pprint', 'pp.pprint', (['flags.FLAGS.__flags'], {}), '(flags.FLAGS.__flags)\n', (1001, 1022), False, 'from utils import pp, visualize, to_json\n'), ((1037, 1050), 'models.config.Config', 'Config', (['FLAGS'], {}), '(FLAGS)\n', (1043, 1050), False, 'from models.config import Config\n'), ((1120, ... |
from django.views import View
from django.http import HttpResponseRedirect
from add2cal import Add2Cal
from pytz import timezone
import datetime
from django.http import (
JsonResponse,
HttpResponse
)
ADD2CAL_DATE_FORMAT = "%Y%m%dT%H%M%S"
CALENDAR_CONTENT_TYPE = 'text/calendar'
OUTLOOK_LINK_TYPE = 'outlook'
GOO... | [
"django.http.HttpResponseRedirect",
"pytz.timezone",
"django.http.HttpResponse",
"add2cal.Add2Cal",
"datetime.datetime.now"
] | [((1043, 1146), 'add2cal.Add2Cal', 'Add2Cal', ([], {'start': 'start', 'end': 'end', 'title': 'title', 'description': 'description', 'location': 'location', 'timezone': 'tz'}), '(start=start, end=end, title=title, description=description,\n location=location, timezone=tz)\n', (1050, 1146), False, 'from add2cal import... |
"""Traffic counts _jobs file."""
import pandas as pd
import logging
from subprocess import Popen, PIPE
from trident.util import general
conf = general.config
fy = general.get_FY_year()
def get_traffic_counts(out_fname='traffic_counts_file'):
"""Get traffic counts file from shared drive."""
logging.info(f'Ret... | [
"trident.util.general.get_FY_year",
"pandas.read_csv",
"subprocess.Popen",
"pandas.read_excel",
"trident.util.general.pos_write_csv",
"logging.info",
"pandas.to_datetime"
] | [((164, 185), 'trident.util.general.get_FY_year', 'general.get_FY_year', ([], {}), '()\n', (183, 185), False, 'from trident.util import general\n'), ((302, 347), 'logging.info', 'logging.info', (['f"""Retrieving data for FY {fy}."""'], {}), "(f'Retrieving data for FY {fy}.')\n", (314, 347), False, 'import logging\n'), ... |
import os
import subprocess
import json
from metaquantome.util.utils import BASE_DIR
from metaquantome.classes.SampleGroups import SampleGroups
def run_viz(plottype, img, infile, strip=None,
mode=None, meancol=None, nterms='5', target_rank=None, barcol=6, # barplot, stacked_bar
textannot=Non... | [
"metaquantome.classes.SampleGroups.SampleGroups",
"subprocess.run",
"json.dumps",
"os.path.join"
] | [((849, 891), 'os.path.join', 'os.path.join', (['BASE_DIR', '"""modules"""', '"""viz.R"""'], {}), "(BASE_DIR, 'modules', 'viz.R')\n", (861, 891), False, 'import os\n'), ((2016, 2035), 'metaquantome.classes.SampleGroups.SampleGroups', 'SampleGroups', (['sinfo'], {}), '(sinfo)\n', (2028, 2035), False, 'from metaquantome.... |
import json
import multiprocessing
import os
import requests
from requests_oauthlib import OAuth1
from time import sleep
import tweepy
def get_users_single(x,auth,output_folder):
while(True):
url=f"https://api.twitter.com/1.1/users/lookup.json?user_id={','.join([str(i) for i in x])}"
if(type... | [
"multiprocessing.Process",
"requests.get",
"time.sleep",
"os.path.isdir",
"requests_oauthlib.OAuth1",
"json.dump"
] | [((1714, 1742), 'os.path.isdir', 'os.path.isdir', (['output_folder'], {}), '(output_folder)\n', (1727, 1742), False, 'import os\n'), ((2118, 2232), 'multiprocessing.Process', 'multiprocessing.Process', ([], {'target': 'get_users_single_mp_aux', 'args': '(user_ids[i:i + n], index, auths, output_folder)'}), '(target=get_... |
# -*- coding: utf-8 -*-
"""
Utilities for reading and writing USID datasets that are highly model-dependent (with or without N-dimensional form)
Created on Tue Nov 3 21:14:25 2015
@author: <NAME>, <NAME>
"""
from __future__ import division, print_function, absolute_import, unicode_literals
from warnings import warn
... | [
"numpy.product",
"numpy.prod",
"sidpy.base.string_utils.validate_list_of_strings",
"numpy.hstack",
"numpy.argsort",
"numpy.array",
"numpy.divide",
"numpy.arange",
"numpy.atleast_2d",
"dask.array.reshape",
"sidpy.hdf.hdf_utils.copy_dataset",
"numpy.where",
"sidpy.hdf.hdf_utils.lazy_load_array... | [((4720, 4743), 'numpy.array', 'np.array', (["['Positions']"], {}), "(['Positions'])\n", (4728, 4743), True, 'import numpy as np\n'), ((4760, 4787), 'numpy.array', 'np.array', (["['Spectral_Step']"], {}), "(['Spectral_Step'])\n", (4768, 4787), True, 'import numpy as np\n'), ((10784, 10849), 'numpy.hstack', 'np.hstack',... |
from flask_wtf import Form
from wtforms import TextField, PasswordField, validators, IntegerField, BooleanField, SelectField, SubmitField
from wtforms.validators import Required, Length, Email, ValidationError, Regexp, EqualTo, NumberRange
from wtforms.widgets import SubmitInput
class SignUp(Form):
username = TextFie... | [
"wtforms.validators.NumberRange",
"wtforms.validators.Email",
"wtforms.BooleanField",
"wtforms.SubmitField",
"wtforms.validators.EqualTo",
"wtforms.validators.Required",
"wtforms.validators.Length",
"wtforms.validators.Regexp"
] | [((3527, 3575), 'wtforms.BooleanField', 'BooleanField', (['"""Horizontal Flip: """'], {'default': '(False)'}), "('Horizontal Flip: ', default=False)\n", (3539, 3575), False, 'from wtforms import TextField, PasswordField, validators, IntegerField, BooleanField, SelectField, SubmitField\n'), ((3586, 3632), 'wtforms.Boole... |
import torch
from shape_utils import Shape, load_shape_pair, scatter_shape_pair
from torch_geometric.nn import knn
from param import *
from arap_potential import arap_vert
def load_multiscale_shapes(folder_path, file_name, scales, offset=0.5*torch.ones([3], device=device, dtype=torch.float32)):
"""Like 'load_shap... | [
"torch.norm",
"torch_geometric.nn.knn",
"torch.sum",
"shape_utils.load_shape_pair",
"torch.ones"
] | [((244, 295), 'torch.ones', 'torch.ones', (['[3]'], {'device': 'device', 'dtype': 'torch.float32'}), '([3], device=device, dtype=torch.float32)\n', (254, 295), False, 'import torch\n'), ((611, 645), 'shape_utils.load_shape_pair', 'load_shape_pair', (['file_load', 'offset'], {}), '(file_load, offset)\n', (626, 645), Fal... |
import numpy as np
import scipy
import scipy.linalg as linalg
import scipy.spatial
import scipy.special
import scipy.optimize
import sklearn
def bases(name):
if name == 'linear':
f = lambda x: x
elif name == 'cubic':
f = lambda x: x**3
elif name == 'multiquadric':
f = lambda x, s: ... | [
"scipy.special.xlogy",
"numpy.sqrt",
"numpy.linalg.cond",
"matplotlib.pyplot.fill_between",
"numpy.sin",
"scipy.linalg.lstsq",
"matplotlib.pyplot.plot",
"sklearn.model_selection.ShuffleSplit",
"numpy.exp",
"numpy.linspace",
"numpy.dot",
"numpy.empty",
"scipy.optimize.minimize_scalar",
"mat... | [((7360, 7382), 'numpy.linspace', 'np.linspace', (['lo', 'hi', 'N'], {}), '(lo, hi, N)\n', (7371, 7382), True, 'import numpy as np\n'), ((7582, 7593), 'time.time', 'time.time', ([], {}), '()\n', (7591, 7593), False, 'import time\n'), ((7757, 7843), 'matplotlib.pyplot.fill_between', 'plt.fill_between', (['t', '(y_pred -... |
from recipe_compiler.recipe import Recipe
from recipe_compiler.recipe_category import RecipeCategory
def test_recipe_slug():
# Given
name = "<NAME>"
residence = "Seattle, WA"
category = RecipeCategory("dessert")
recipe_name = '"Pie" Shell Script'
quote = "Hello, World"
ingredients = [""]
... | [
"recipe_compiler.recipe_category.RecipeCategory",
"recipe_compiler.recipe.Recipe"
] | [((204, 229), 'recipe_compiler.recipe_category.RecipeCategory', 'RecipeCategory', (['"""dessert"""'], {}), "('dessert')\n", (218, 229), False, 'from recipe_compiler.recipe_category import RecipeCategory\n'), ((403, 488), 'recipe_compiler.recipe.Recipe', 'Recipe', (['name', 'residence', 'category', 'recipe_name', 'quote... |
from flask_restplus import Namespace, fields
class UserDataModel(object):
"""Represents the user data transfer object."""
api = Namespace(
'user', description='user authentication and signup resources'
)
this_user = api.model('Register input data', {
'username': fields.String(
... | [
"flask_restplus.fields.String",
"flask_restplus.Namespace",
"flask_restplus.fields.Integer"
] | [((138, 211), 'flask_restplus.Namespace', 'Namespace', (['"""user"""'], {'description': '"""user authentication and signup resources"""'}), "('user', description='user authentication and signup resources')\n", (147, 211), False, 'from flask_restplus import Namespace, fields\n'), ((297, 349), 'flask_restplus.fields.Stri... |
"""
The script declares functions used in 'data_analysis.py'
"""
import os
import yaml
from logzero import logger
import matplotlib.pyplot as plt
import seaborn as sns
from matplotlib.patches import Patch
import plotly.graph_objects as go
from utility import parse_config
config_path = "config/config.yaml"
con... | [
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"seaborn.catplot",
"seaborn.boxplot",
"matplotlib.pyplot.close",
"utility.parse_config",
"matplotlib.patches.Patch",
"seaborn.countplot",
"matplotlib.pyplot.title",
"matplotlib.pypl... | [((326, 351), 'utility.parse_config', 'parse_config', (['config_path'], {}), '(config_path)\n', (338, 351), False, 'from utility import parse_config\n'), ((425, 439), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (437, 439), True, 'import matplotlib.pyplot as plt\n'), ((444, 498), 'seaborn.countplot',... |
#!/usr/bin/env python3
import isce
from isceobj.Sensor import createSensor
import shelve
import argparse
import os
from isceobj.Util import Poly1D
from isceobj.Planet.AstronomicalHandbook import Const
from mroipac.dopiq.DopIQ import DopIQ
import copy
def cmdLineParse():
'''
Command line parser.
'''
... | [
"mroipac.dopiq.DopIQ.DopIQ",
"argparse.ArgumentParser",
"os.path.join",
"os.path.isdir",
"shelve.open",
"os.path.basename",
"os.mkdir",
"isceobj.Sensor.createSensor"
] | [((329, 429), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Unpack RISAT raw data and store metadata in pickle file."""'}), "(description=\n 'Unpack RISAT raw data and store metadata in pickle file.')\n", (352, 429), False, 'import argparse\n'), ((914, 936), 'isceobj.Sensor.createSen... |
"""Tests for qr.py."""
from jax import lax
import jax.numpy as jnp
import numpy as np
import pytest
import tempfile
from distla_core.linalg.utils import testutils
from distla_core.linalg.qr import qr_ooc
from distla_core.utils import pops
DTYPE = jnp.float32
seeds = [0, 1]
flags = [True, False]
def _dephase_qr(R,... | [
"distla_core.linalg.utils.testutils.eps",
"distla_core.linalg.utils.testutils.assert_allclose",
"numpy.diagonal",
"numpy.linalg.qr",
"numpy.ones",
"distla_core.linalg.qr.qr_ooc.qr_ooc",
"numpy.linalg.cond",
"numpy.linalg.norm",
"pytest.mark.parametrize",
"distla_core.utils.pops.undistribute",
"n... | [((697, 739), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""N"""', '[8, 32, 128]'], {}), "('N', [8, 32, 128])\n", (720, 739), False, 'import pytest\n'), ((741, 792), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""aspect_ratio"""', '[1, 2, 10]'], {}), "('aspect_ratio', [1, 2, 10])\n", (764, 79... |
import wpilib
import constants
import swerve
import lift
import winch
import sys
from teleop import Teleop
from autonomous.baseline_simple import Autonomous
from sensors.imu import IMU
def log(src, msg):
try:
full_msg = "[{:.3f}] [{}] {}".format(
wpilib.Timer.getMatchTime(), str(src), str(msg)... | [
"autonomous.baseline_simple.Autonomous",
"wpilib.Timer",
"swerve.SwerveDrive",
"lift.ManualControlLift",
"teleop.Teleop",
"wpilib.Timer.getMatchTime",
"wpilib.run",
"wpilib.Joystick",
"sensors.imu.IMU",
"sys.exc_info",
"wpilib.SendableChooser",
"wpilib.CameraServer.launch",
"wpilib.SmartDash... | [((7717, 7734), 'wpilib.run', 'wpilib.run', (['Robot'], {}), '(Robot)\n', (7727, 7734), False, 'import wpilib\n'), ((944, 975), 'constants.load_control_config', 'constants.load_control_config', ([], {}), '()\n', (973, 975), False, 'import constants\n'), ((985, 1036), 'wpilib.CameraServer.launch', 'wpilib.CameraServer.l... |
import requests
text = "0123456789abcdefghijklmnopqrstuvwxyz_}"
flag = "hsctf{"
for _ in range(30):
time = [0.1 for _ in range(38)]
for _ in range(5):
for i in range(38):
payload = {"password": flag + text[i]}
r = requests.post(
"https://networked-password.we... | [
"requests.post"
] | [((259, 335), 'requests.post', 'requests.post', (['"""https://networked-password.web.chal.hsctf.com"""'], {'data': 'payload'}), "('https://networked-password.web.chal.hsctf.com', data=payload)\n", (272, 335), False, 'import requests\n')] |
#!/usr/bin/env python
try:
from typing import Any, Dict, Union, Optional
except:
pass
import time
import string
import boto3
import random
import zstd
import sys
def rand_str(l):
# type: (int) -> str
return ''.join(random.choice(string.ascii_uppercase + string.digits)
for _ in ran... | [
"time.ctime",
"random.choice",
"boto3.client",
"time.time"
] | [((357, 375), 'boto3.client', 'boto3.client', (['"""s3"""'], {}), "('s3')\n", (369, 375), False, 'import boto3\n'), ((953, 965), 'time.ctime', 'time.ctime', ([], {}), '()\n', (963, 965), False, 'import time\n'), ((235, 288), 'random.choice', 'random.choice', (['(string.ascii_uppercase + string.digits)'], {}), '(string.... |
from __future__ import absolute_import
import argparse
import logging
import multiprocessing
import os
import sys
import uuid
from os.path import join, exists
import yaml
from phigaro.context import Context
from phigaro.batch.runner import run_tasks_chain
from phigaro.batch.task.path import sample_name
from phigaro.... | [
"logging.getLogger",
"yaml.load",
"multiprocessing.cpu_count",
"phigaro.batch.runner.run_tasks_chain",
"os.walk",
"os.path.exists",
"argparse.ArgumentParser",
"phigaro.context.Context.initialize",
"os.path.isdir",
"uuid.uuid4",
"os.path.dirname",
"phigaro.batch.task.path.sample_name",
"loggi... | [((1293, 1323), 'os.walk', 'os.walk', (['"""proc"""'], {'topdown': '(False)'}), "('proc', topdown=False)\n", (1300, 1323), False, 'import os\n'), ((1646, 1815), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'prog': '"""phigaro"""', 'description': '"""Phigaro is a scalable command-line tool for predictions... |
from conans import ConanFile, tools, AutoToolsBuildEnvironment
from conans.errors import ConanInvalidConfiguration
import os
class LibmountConan(ConanFile):
name = "libmount"
description = "The libmount library is used to parse /etc/fstab, /etc/mtab and /proc/self/mountinfo files, manage the mtab file, evalua... | [
"conans.errors.ConanInvalidConfiguration",
"os.rename",
"os.path.join",
"conans.tools.chdir",
"conans.tools.get",
"conans.AutoToolsBuildEnvironment"
] | [((1070, 1123), 'conans.tools.get', 'tools.get', ([], {}), "(**self.conan_data['sources'][self.version])\n", (1079, 1123), False, 'from conans import ConanFile, tools, AutoToolsBuildEnvironment\n'), ((1185, 1233), 'os.rename', 'os.rename', (['extracted_dir', 'self._source_subfolder'], {}), '(extracted_dir, self._source... |
BASE_URL="https://harpers.org/sections/readings/page/"
N_ARTICLE_LINK_PAGES = 50
OUTPUT_FILE = 'harpers-later-urls.json'
WORKER_THREADS = 32
import json
import datetime
import dateutil.parser
from dataclasses import dataclass
from dataclasses_json import dataclass_json
from datetime import datetime
from newspaper imp... | [
"pathlib.Path",
"urllib.request.Request",
"bs4.BeautifulSoup",
"pandas.DataFrame",
"queue.Queue",
"urllib.request.urlopen"
] | [((2662, 2669), 'queue.Queue', 'Queue', ([], {}), '()\n', (2667, 2669), False, 'from queue import Queue\n'), ((981, 998), 'pathlib.Path', 'Path', (['OUTPUT_FILE'], {}), '(OUTPUT_FILE)\n', (985, 998), False, 'from pathlib import Path\n'), ((1026, 1054), 'pandas.DataFrame', 'pd.DataFrame', (['existing_links'], {}), '(exi... |
from typing import Dict
import numpy as np
import torch
from torch.nn.functional import linear, log_softmax, embedding
from torch.nn import Dropout, LogSoftmax, NLLLoss
from allennlp.common import Params
from allennlp.models.model import Model
from allennlp.data.vocabulary import Vocabulary, DEFAULT_PADDING_TOKEN
from... | [
"torch.nn.functional.linear",
"torch.nn.Dropout",
"allennlp.modules.TimeDistributed",
"allennlp.nn.util.combine_initial_dims",
"allennlp.modules.sampled_softmax_loss.SampledSoftmaxLoss",
"allennlp.modules.token_embedders.TokenEmbedder.register",
"allennlp.modules.input_variational_dropout.InputVariation... | [((1757, 1805), 'allennlp.modules.token_embedders.TokenEmbedder.register', 'TokenEmbedder.register', (['"""embedding_with_dropout"""'], {}), "('embedding_with_dropout')\n", (1779, 1805), False, 'from allennlp.modules.token_embedders import Embedding, TokenEmbedder\n'), ((5592, 5622), 'allennlp.models.model.Model.regist... |
"""
Created on 22 Feb 2019
@author: <NAME> (<EMAIL>)
source repo: scs_analysis
"""
import optparse
# --------------------------------------------------------------------------------------------------------------------
class CmdCSVJoin(object):
"""unix command line handler"""
def __init__(self):
"... | [
"optparse.OptionParser"
] | [((379, 509), 'optparse.OptionParser', 'optparse.OptionParser', ([], {'usage': '"""%prog [-t TYPE] [-i] [-v] -l PREFIX PK FILENAME -r PREFIX PK FILENAME"""', 'version': '"""%prog 1.0"""'}), "(usage=\n '%prog [-t TYPE] [-i] [-v] -l PREFIX PK FILENAME -r PREFIX PK FILENAME',\n version='%prog 1.0')\n", (400, 509), F... |
# Generated by Django 3.2.9 on 2022-01-10 12:39
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('car', '0003_auto_20220110_1507'),
]
operations = [
migrations.AddField(
model_name='sale',
... | [
"django.db.models.CharField"
] | [((353, 420), 'django.db.models.CharField', 'models.CharField', ([], {'default': 'django.utils.timezone.now', 'max_length': '(100)'}), '(default=django.utils.timezone.now, max_length=100)\n', (369, 420), False, 'from django.db import migrations, models\n')] |
import pandas as pd
import pytask
from src.config import BLD
@pytask.mark.depends_on(BLD / "data" / "raw_time_series" / "reproduction_number.csv")
@pytask.mark.produces(BLD / "data" / "processed_time_series" / "r_effective.pkl")
def task_prepare_rki_r_effective_data(depends_on, produces):
df = pd.read_csv(depend... | [
"pandas.to_datetime",
"pytask.mark.depends_on",
"pytask.mark.produces",
"pandas.read_csv"
] | [((65, 153), 'pytask.mark.depends_on', 'pytask.mark.depends_on', (["(BLD / 'data' / 'raw_time_series' / 'reproduction_number.csv')"], {}), "(BLD / 'data' / 'raw_time_series' /\n 'reproduction_number.csv')\n", (87, 153), False, 'import pytask\n'), ((151, 236), 'pytask.mark.produces', 'pytask.mark.produces', (["(BLD /... |
from collections import defaultdict
import pytest
from radical_translations.agents.models import Organisation, Person
pytestmark = pytest.mark.django_db
@pytest.mark.usefixtures("vocabulary")
class TestOrganisation:
def test_agent_type(self, title):
obj = Person(name="<NAME>")
obj.save()
... | [
"radical_translations.agents.models.Person",
"radical_translations.agents.models.Person.objects.count",
"radical_translations.agents.models.Person.from_gsx_entry",
"radical_translations.agents.models.Organisation",
"pytest.mark.usefixtures",
"collections.defaultdict",
"radical_translations.agents.models... | [((159, 196), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""vocabulary"""'], {}), "('vocabulary')\n", (182, 196), False, 'import pytest\n'), ((1120, 1157), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""vocabulary"""'], {}), "('vocabulary')\n", (1143, 1157), False, 'import pytest\n'), ((273, ... |
from go.apps.tests.view_helpers import AppViewsHelper
from go.base.tests.helpers import GoDjangoTestCase
class TestHttpApiViews(GoDjangoTestCase):
def setUp(self):
self.app_helper = self.add_helper(AppViewsHelper(u'http_api'))
self.client = self.app_helper.get_client()
def test_show_stopped(... | [
"go.apps.tests.view_helpers.AppViewsHelper"
] | [((213, 240), 'go.apps.tests.view_helpers.AppViewsHelper', 'AppViewsHelper', (['u"""http_api"""'], {}), "(u'http_api')\n", (227, 240), False, 'from go.apps.tests.view_helpers import AppViewsHelper\n')] |
# -*- coding: utf-8 -*-
# Copyright: (c) 2019-2021, Dell EMC
"""Helper module for PowerStore"""
import logging
from pkg_resources import parse_version
provisioning_obj = None
def set_provisioning_obj(val):
global provisioning_obj
provisioning_obj = val
def prepare_querystring(*query_arguments, **kw_query_... | [
"logging.getLogger",
"pkg_resources.parse_version"
] | [((1041, 1071), 'logging.getLogger', 'logging.getLogger', (['module_name'], {}), '(module_name)\n', (1058, 1071), False, 'import logging\n'), ((1500, 1528), 'pkg_resources.parse_version', 'parse_version', (['array_version'], {}), '(array_version)\n', (1513, 1528), False, 'from pkg_resources import parse_version\n'), ((... |
# -*- coding: utf-8 -*-
# Copyright 2018, IBM.
#
# This source code is licensed under the Apache License, Version 2.0 found in
# the LICENSE.txt file in the root directory of this source tree.
# pylint: disable=redefined-builtin
"""Tests basic functionality of the transpile function"""
from qiskit import QuantumReg... | [
"qiskit.transpiler.transpile_dag",
"qiskit.transpiler.transpile",
"qiskit.transpiler.PassManager",
"qiskit.converters.circuit_to_dag",
"qiskit.BasicAer.get_backend",
"qiskit.QuantumCircuit",
"qiskit.compile",
"qiskit.QuantumRegister"
] | [((847, 865), 'qiskit.QuantumRegister', 'QuantumRegister', (['(2)'], {}), '(2)\n', (862, 865), False, 'from qiskit import QuantumRegister, QuantumCircuit\n'), ((884, 902), 'qiskit.QuantumCircuit', 'QuantumCircuit', (['qr'], {}), '(qr)\n', (898, 902), False, 'from qiskit import QuantumRegister, QuantumCircuit\n'), ((110... |
"""
MIT License
Copyright (c) 2020-present noaione
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, publis... | [
"vsutil.get_y",
"functools.partial",
"vsutil.get_w",
"pathlib.Path"
] | [((11970, 12014), 'functools.partial', 'partial', (['stack_compare'], {'interleave_only': '(True)'}), '(stack_compare, interleave_only=True)\n', (11977, 12014), False, 'from functools import partial\n'), ((5132, 5149), 'pathlib.Path', 'Path', (['sys.argv[0]'], {}), '(sys.argv[0])\n', (5136, 5149), False, 'from pathlib ... |
# This software is open source software available under the BSD-3 license.
#
# Copyright (c) 2020 Triad National Security, LLC. All rights reserved.
# Copyright (c) 2020 Lawrence Livermore National Security, LLC. All rights
# reserved.
# Copyright (c) 2020 UT-Battelle, LLC. All rights reserved.
#
# Additional copyright... | [
"mpas_analysis.shared.plot.savefig",
"mpas_analysis.shared.io.open_mpas_dataset",
"mpas_analysis.shared.io.utility.make_directories",
"mpas_analysis.shared.timekeeping.utility.date_to_days",
"mpas_analysis.shared.time_series.combine_time_series_with_ncrcat",
"mpas_analysis.shared.plot.timeseries_analysis_... | [((5396, 5462), 'mpas_analysis.shared.io.utility.build_config_full_path', 'build_config_full_path', (['config', '"""output"""', '"""timeseriesSubdirectory"""'], {}), "(config, 'output', 'timeseriesSubdirectory')\n", (5418, 5462), False, 'from mpas_analysis.shared.io.utility import build_config_full_path, make_directori... |
import sys
import os.path as osp
import math
import torchvision.utils
sys.path.append(osp.dirname(osp.dirname(osp.abspath(__file__))))
from data import create_dataloader, create_dataset # noqa: E402
from utils import util # noqa: E402
def main():
dataset = 'REDS' # REDS | Vimeo90K | DIV2K800_sub
opt = {}
... | [
"data.create_dataset",
"math.sqrt",
"utils.util.mkdir",
"os.path.abspath",
"data.create_dataloader"
] | [((2494, 2511), 'utils.util.mkdir', 'util.mkdir', (['"""tmp"""'], {}), "('tmp')\n", (2504, 2511), False, 'from utils import util\n'), ((2528, 2547), 'data.create_dataset', 'create_dataset', (['opt'], {}), '(opt)\n', (2542, 2547), False, 'from data import create_dataloader, create_dataset\n'), ((2567, 2611), 'data.creat... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | [
"re.compile"
] | [((1255, 1287), 're.compile', 're.compile', (['"""(\\\\w+)\\\\[(\\\\d+)\\\\]"""'], {}), "('(\\\\w+)\\\\[(\\\\d+)\\\\]')\n", (1265, 1287), False, 'import re\n')] |
# Copyright (c) Trainline Limited, 2016-2017. All rights reserved. See LICENSE.txt in the project root for license information.
from os.path import join
import unittest
from mock import patch
from agent.find_deployment import find_deployment_dir_win
class Fake(object):
def __init__(self, **kwargs):
self._... | [
"agent.find_deployment.find_deployment_dir_win",
"mock.patch",
"os.path.join"
] | [((1144, 1184), 'os.path.join', 'join', (['"""/deployments"""', '"""my_deployment_id"""'], {}), "('/deployments', 'my_deployment_id')\n", (1148, 1184), False, 'from os.path import join\n'), ((470, 527), 'mock.patch', 'patch', (['"""agent.find_deployment.exists"""'], {'return_value': '(False)'}), "('agent.find_deploymen... |
import os
import logging
import argparse
import numpy as np
import tensorflow as tf
from keras_preprocessing.text import Tokenizer
from tqdm import tqdm
from data import DataLoader
class EmbeddingsBuilder:
def __init__(self, args):
logging.info('initializing...')
self.args = args
self.da... | [
"logging.basicConfig",
"keras_preprocessing.text.Tokenizer",
"argparse.ArgumentParser",
"os.path.splitext",
"numpy.append",
"tensorflow.gfile.GFile",
"logging.info",
"data.DataLoader"
] | [((1951, 2025), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s %(message)s"""', 'level': 'logging.DEBUG'}), "(format='%(asctime)s %(message)s', level=logging.DEBUG)\n", (1970, 2025), False, 'import logging\n'), ((2030, 2066), 'logging.info', 'logging.info', (['"""initializing task..."""']... |
"""
stanCode Breakout Project
Adapted from <NAME>'s Breakout by
<NAME>, <NAME>, <NAME>,
and <NAME>
File: breakoutgraphics.py
Name: <NAME>
-------------------------
This python file will create a class named BreakoutGraphics for the break out game.
This class will contain the building block for creating that game.
"""... | [
"campy.graphics.gobjects.GLabel",
"campy.gui.events.mouse.onmousemoved",
"campy.graphics.gobjects.GRect",
"campy.graphics.gwindow.GWindow",
"campy.graphics.gobjects.GOval",
"random.random",
"random.randint",
"campy.gui.events.mouse.onmouseclicked"
] | [((2814, 2886), 'campy.graphics.gwindow.GWindow', 'GWindow', ([], {'width': 'self.window_width', 'height': 'self.window_height', 'title': 'title'}), '(width=self.window_width, height=self.window_height, title=title)\n', (2821, 2886), False, 'from campy.graphics.gwindow import GWindow\n'), ((2936, 3054), 'campy.graphics... |
# flake8: noqa
"""
Copyright 2021 - Present Okta, Inc.
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 ... | [
"okta.okta_collection.OktaCollection.form_list",
"okta.models.profile_enrollment_policy_rule_activation_requirement.ProfileEnrollmentPolicyRuleActivationRequirement"
] | [((2256, 2433), 'okta.okta_collection.OktaCollection.form_list', 'OktaCollection.form_list', (["(config['preRegistrationInlineHooks'] if 'preRegistrationInlineHooks' in\n config else [])", 'pre_registration_inline_hook.PreRegistrationInlineHook'], {}), "(config['preRegistrationInlineHooks'] if \n 'preRegistration... |
import datetime
import unittest
import luigi
import numpy as np
from netCDF4 import Dataset
from iasi.compression import (CompressDataset, CompressDateRange,
DecompressDataset)
class TestCompression(unittest.TestCase):
def test_dataset_compression(self):
task = CompressDat... | [
"luigi.build",
"luigi.date_interval.Custom.parse",
"iasi.compression.CompressDateRange",
"iasi.compression.CompressDataset",
"iasi.compression.DecompressDataset"
] | [((309, 435), 'iasi.compression.CompressDataset', 'CompressDataset', ([], {'file': '"""test/resources/MOTIV-single-event.nc"""', 'dst': '"""/tmp/iasi"""', 'force': '(True)', 'threshold': '(0.01)', 'log_file': '(False)'}), "(file='test/resources/MOTIV-single-event.nc', dst=\n '/tmp/iasi', force=True, threshold=0.01, ... |
# Copyright 2019 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, ... | [
"logging.basicConfig",
"pycoral.utils.dataset.read_label_file",
"argparse.ArgumentParser",
"pycoral.utils.edgetpu.make_interpreter",
"time.monotonic",
"playsound.playsound",
"pycoral.adapters.classify.get_classes",
"logging.info",
"gstreamer.run_pipeline"
] | [((1518, 1569), 'logging.info', 'logging.info', (['"""Image: %s Results: %s"""', 'tag', 'results'], {}), "('Image: %s Results: %s', tag, results)\n", (1530, 1569), False, 'import logging\n'), ((2477, 2502), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2500, 2502), False, 'import argparse\n')... |
import unittest
import uuid
from memory.client import MemoryClient
from hailtop.aiocloud.aiogoogle import GoogleStorageAsyncFS
from hailtop.config import get_user_config
from hailtop.utils import async_to_blocking
from gear.cloud_config import get_gcp_config
PROJECT = get_gcp_config().project
class BlockingMemoryC... | [
"memory.client.MemoryClient",
"gear.cloud_config.get_gcp_config",
"uuid.uuid4",
"hailtop.aiocloud.aiogoogle.GoogleStorageAsyncFS",
"hailtop.config.get_user_config"
] | [((272, 288), 'gear.cloud_config.get_gcp_config', 'get_gcp_config', ([], {}), '()\n', (286, 288), False, 'from gear.cloud_config import get_gcp_config\n'), ((462, 532), 'memory.client.MemoryClient', 'MemoryClient', (['gcs_project', 'fs', 'deploy_config', 'session', 'headers', '_token'], {}), '(gcs_project, fs, deploy_c... |
import librosa
import numpy as np
from . import base
from . import spectral
class OnsetStrength(base.Computation):
"""
Compute a spectral flux onset strength envelope.
Based on http://librosa.github.io/librosa/generated/librosa.onset.onset_strength.html
Args:
n_mels (int): Number of mel ban... | [
"librosa.onset.onset_strength",
"librosa.power_to_db",
"librosa.feature.melspectrogram"
] | [((845, 869), 'librosa.power_to_db', 'librosa.power_to_db', (['mel'], {}), '(mel)\n', (864, 869), False, 'import librosa\n'), ((920, 975), 'librosa.onset.onset_strength', 'librosa.onset.onset_strength', ([], {'S': 'mel_power', 'center': '(False)'}), '(S=mel_power, center=False)\n', (948, 975), False, 'import librosa\n'... |
from PyQt5.QtWidgets import QMainWindow, QApplication, QFileDialog
import sys
from .readNanoscopeForceRamps import *
import matplotlib.pyplot as plt
from ..qt5_ui_files.ForceRampGUI import *
from matplotlib.backends.backend_qt5agg import (NavigationToolbar2QT as NavigationToolbar)
import os
import math
from ..qt5_ui_fi... | [
"matplotlib.backends.backend_qt5agg.NavigationToolbar2QT",
"os.getcwd"
] | [((751, 797), 'matplotlib.backends.backend_qt5agg.NavigationToolbar2QT', 'NavigationToolbar', (['self.ui.widget.canvas', 'self'], {}), '(self.ui.widget.canvas, self)\n', (768, 797), True, 'from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT as NavigationToolbar\n'), ((893, 904), 'os.getcwd', 'os.getcwd'... |
"""Create your tests for the admin app here."""
import pytest
from django.contrib.auth import get_user_model
from django.urls import reverse
pytestmark = pytest.mark.django_db
User = get_user_model()
class TestUserAdmin:
"""Test the admin interface."""
def test_changelist(self, admin_client):
"""Tes... | [
"django.contrib.auth.get_user_model",
"django.urls.reverse"
] | [((184, 200), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (198, 200), False, 'from django.contrib.auth import get_user_model\n'), ((360, 398), 'django.urls.reverse', 'reverse', (['"""admin:users_user_changelist"""'], {}), "('admin:users_user_changelist')\n", (367, 398), False, 'from django... |
from flask_apispec import MethodResource, marshal_with, doc, use_kwargs
from webargs import fields
from ..models import Dataset
from ..core import cache
from .utils import first_or_404
from ..schemas.dataset import DatasetSchema
class DatasetResource(MethodResource):
@doc(tags=['dataset'], summary='Get dataset by... | [
"flask_apispec.marshal_with",
"flask_apispec.doc",
"webargs.fields.Boolean"
] | [((275, 326), 'flask_apispec.doc', 'doc', ([], {'tags': "['dataset']", 'summary': '"""Get dataset by id."""'}), "(tags=['dataset'], summary='Get dataset by id.')\n", (278, 326), False, 'from flask_apispec import MethodResource, marshal_with, doc, use_kwargs\n'), ((389, 416), 'flask_apispec.marshal_with', 'marshal_with'... |
import numpy as np
from graph_tiger.graphs import o4_graph, p4_graph, c4_graph, k4_1_graph, k4_2_graph
from graph_tiger.graphs import two_c4_0_bridge, two_c4_1_bridge, two_c4_2_bridge, two_c4_3_bridge
from graph_tiger.measures import run_measure
def test_measures():
measure_ground_truth = { # graph order: o4,... | [
"graph_tiger.graphs.two_c4_1_bridge",
"graph_tiger.graphs.c4_graph",
"graph_tiger.graphs.two_c4_2_bridge",
"graph_tiger.graphs.two_c4_0_bridge",
"graph_tiger.graphs.two_c4_3_bridge",
"graph_tiger.graphs.k4_1_graph",
"graph_tiger.graphs.k4_2_graph",
"graph_tiger.measures.run_measure",
"graph_tiger.gr... | [((1647, 1657), 'graph_tiger.graphs.o4_graph', 'o4_graph', ([], {}), '()\n', (1655, 1657), False, 'from graph_tiger.graphs import o4_graph, p4_graph, c4_graph, k4_1_graph, k4_2_graph\n'), ((1659, 1669), 'graph_tiger.graphs.p4_graph', 'p4_graph', ([], {}), '()\n', (1667, 1669), False, 'from graph_tiger.graphs import o4_... |
"""Association mining -- apriori algo"""
__author__ = 'thor'
from numpy import *
# Modified from:
# <NAME> & <NAME> (https://github.com/cse40647/cse40647/blob/sp.14/10%20-%20Apriori.ipynb)
#
# Itself Modified from:
# <NAME> (https://gist.github.com/marcelcaraciolo/1423287)
#
# Functions to compute and extract associ... | [
"statsmodels.stats.proportion.samplesize_confint_proportion",
"pandas.merge"
] | [((795, 911), 'statsmodels.stats.proportion.samplesize_confint_proportion', 'samplesize_confint_proportion', ([], {'proportion': 'min_confidence', 'half_length': 'half_length', 'alpha': 'alpha', 'method': '"""normal"""'}), "(proportion=min_confidence, half_length=\n half_length, alpha=alpha, method='normal')\n", (82... |
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
description='Tech@NYU API Python Client',
author='TechatNYU',
url='https://github.com/TechAtNYU/pytnyu',
author_email='<EMAIL>',
version='0.0.4',
install_requires=['requests'],
namespace_pa... | [
"distutils.core.setup"
] | [((96, 359), 'distutils.core.setup', 'setup', ([], {'description': '"""Tech@NYU API Python Client"""', 'author': '"""TechatNYU"""', 'url': '"""https://github.com/TechAtNYU/pytnyu"""', 'author_email': '"""<EMAIL>"""', 'version': '"""0.0.4"""', 'install_requires': "['requests']", 'namespace_packages': "['pytnyu']", 'pack... |
import spidev
columns = [0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8]
LEDOn = [0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF]
LEDOff = [0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0]
LEDEmoteSmile = [0x0,0x0,0x24,0x0,0x42,0x3C,0x0,0x0]
LEDEmoteSad = [0x0,0x0,0x24,0x0,0x0,0x3C,0x42,0x0]
LEDEmoteTongue = [0x0,0x0,0x24,0x0,0x42,0x3C,0xC,0x0]
LEDEmoteS... | [
"spidev.SpiDev"
] | [((576, 591), 'spidev.SpiDev', 'spidev.SpiDev', ([], {}), '()\n', (589, 591), False, 'import spidev\n')] |
#!/usr/bin/env python
from datapackage_pipelines.wrapper import ingest, spew
import logging, collections
from pipeline_params import get_pipeline_param_rows
from google.cloud import storage
from contextlib import contextmanager
from tempfile import mkdtemp
import os
import pywikibot
import time
from pywikibot.pagegener... | [
"os.path.exists",
"os.path.getsize",
"pywikibot.Site",
"google.cloud.storage.Client.from_service_account_json",
"datapackage.Package",
"pipeline_params.get_pipeline_param_rows",
"pywikibot.FilePage",
"os.path.join",
"os.environ.get",
"time.sleep",
"datetime.datetime.now",
"os.rmdir",
"tempfi... | [((1717, 1741), 'tempfile.mkdtemp', 'mkdtemp', (['*args'], {}), '(*args, **kwargs)\n', (1724, 1741), False, 'from tempfile import mkdtemp\n'), ((2683, 2706), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (2704, 2706), False, 'import datetime\n'), ((2978, 3045), 'google.cloud.storage.Client.from_se... |
#!/usr/bin/python
# -*- coding: UTF-8 -*
from db.it.db_it_mgr import it_mgr
__all__ = {"itSingleton"}
class itSingleton():
def get_cmd_sql(self, sql):
return it_mgr.get_cmd_sql(sql)
it_singleton = itSingleton()
| [
"db.it.db_it_mgr.it_mgr.get_cmd_sql"
] | [((177, 200), 'db.it.db_it_mgr.it_mgr.get_cmd_sql', 'it_mgr.get_cmd_sql', (['sql'], {}), '(sql)\n', (195, 200), False, 'from db.it.db_it_mgr import it_mgr\n')] |
#!/usr/bin/env python3
# Copyright (c) 2019, AT&T Intellectual Property.
# All rights reserved.
#
# SPDX-License-Identifier: LGPL-2.1-only
#
"""
Unit-tests for the qos_config.py module.
"""
from vyatta.res_grp.res_grp_config import ResGrpConfig
TEST_DATA = {
'vyatta-resources-v1:resources': {
'vyatta-re... | [
"vyatta.res_grp.res_grp_config.ResGrpConfig"
] | [((1584, 1607), 'vyatta.res_grp.res_grp_config.ResGrpConfig', 'ResGrpConfig', (['TEST_DATA'], {}), '(TEST_DATA)\n', (1596, 1607), False, 'from vyatta.res_grp.res_grp_config import ResGrpConfig\n')] |
import pytest
import json
import numpy as np
@pytest.mark.parametrize("candidate, expected", [
(1.345, True),
(-4.554, True),
('9999', True)
])
def test_number_please(candidate, expected):
from hrm_code import number_please
assert number_please(candidate) == expected
def test_import_data():
... | [
"hrm_code.num_beat",
"hrm_code.detect_peak",
"hrm_code.number_please",
"pytest.mark.parametrize",
"hrm_code.import_data",
"hrm_code.calc_bpm",
"hrm_code.create_jason",
"hrm_code.find_max_min_volt",
"hrm_code.calc_sample_freq",
"numpy.sin",
"hrm_code.create_metrics",
"numpy.arange",
"hrm_code... | [((48, 148), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""candidate, expected"""', "[(1.345, True), (-4.554, True), ('9999', True)]"], {}), "('candidate, expected', [(1.345, True), (-4.554, \n True), ('9999', True)])\n", (71, 148), False, 'import pytest\n'), ((375, 414), 'hrm_code.import_data', 'impor... |
# Generated by Django 2.1.7 on 2019-05-10 09:21
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0043_auto_20190424_1029'),
]
operations = [
migrations.RemoveField(
model_name='statetransition',
name='stat... | [
"django.db.migrations.RemoveField",
"django.db.models.CharField"
] | [((232, 298), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""statetransition"""', 'name': '"""state"""'}), "(model_name='statetransition', name='state')\n", (254, 298), False, 'from django.db import migrations, models\n'), ((468, 676), 'django.db.models.CharField', 'models.CharFie... |
from stk_sequence import *
from stk_tcp_server import *
from stk_tcp_client import *
from stk_data_flow import *
from stk_options import stk_clear_cb
import time
class stk_callback:
def __init__(self):
self._caller = None
self._mapobj = None
pass
def add_callback_ref(self,caller):
self._caller = caller
def ... | [
"time.sleep"
] | [((4749, 4764), 'time.sleep', 'time.sleep', (['(0.2)'], {}), '(0.2)\n', (4759, 4764), False, 'import time\n')] |
from __future__ import print_function
import pkgutil
import stream_decoders
# this module decodes stream based protocols.
# and resolves retransmissions.
decoders= []
# __path__ is used to find the location of all decoder submodules
for impimp, name, ii in pkgutil.iter_modules(stream_decoders.__path__):
impload= ... | [
"math.modf",
"time.localtime",
"struct.unpack",
"pkgutil.iter_modules"
] | [((259, 305), 'pkgutil.iter_modules', 'pkgutil.iter_modules', (['stream_decoders.__path__'], {}), '(stream_decoders.__path__)\n', (279, 305), False, 'import pkgutil\n'), ((2234, 2247), 'math.modf', 'math.modf', (['ts'], {}), '(ts)\n', (2243, 2247), False, 'import math\n'), ((2285, 2302), 'time.localtime', 'time.localti... |
import logging
import aioredis
from app.core.config import REDIS_DSN, REDIS_PASSWORD
logger = logging.getLogger(__name__)
async def get_redis_pool():
return await aioredis.create_redis(REDIS_DSN, encoding='utf-8', password=REDIS_PASSWORD)
| [
"logging.getLogger",
"aioredis.create_redis"
] | [((96, 123), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (113, 123), False, 'import logging\n'), ((171, 246), 'aioredis.create_redis', 'aioredis.create_redis', (['REDIS_DSN'], {'encoding': '"""utf-8"""', 'password': 'REDIS_PASSWORD'}), "(REDIS_DSN, encoding='utf-8', password=REDIS_PASS... |
import pathlib
from typing import Any, Dict, List, Tuple
from torchdata.datapipes.iter import IterDataPipe, Mapper, Filter
from torchvision.prototype.datasets.utils import Dataset, DatasetConfig, DatasetInfo, HttpResource, OnlineResource
from torchvision.prototype.datasets.utils._internal import path_comparator, hint_... | [
"torchdata.datapipes.iter.Mapper",
"torchvision.prototype.features.EncodedImage.from_file",
"torchvision.prototype.features.Label.from_category",
"torchvision.prototype.datasets.utils._internal.hint_sharding",
"pathlib.Path",
"torchvision.prototype.datasets.utils._internal.path_comparator",
"torchvision... | [((1862, 1880), 'torchvision.prototype.datasets.utils._internal.hint_shuffling', 'hint_shuffling', (['dp'], {}), '(dp)\n', (1876, 1880), False, 'from torchvision.prototype.datasets.utils._internal import path_comparator, hint_sharding, hint_shuffling\n'), ((1894, 1911), 'torchvision.prototype.datasets.utils._internal.h... |
import numpy as np
from math import sqrt
def robot_distance_incorrect(robot_actual_location, hexagon_pixel_values):
distance_to_get_back = []
distances = []
pixel_distance = []
for i in range(0, len(hexagon_pixel_values)):
dist = sqrt((robot_actual_location[0] - hexagon_pixel_values[i][0]) ** ... | [
"numpy.argmin",
"math.sqrt"
] | [((450, 470), 'numpy.argmin', 'np.argmin', (['distances'], {}), '(distances)\n', (459, 470), True, 'import numpy as np\n'), ((256, 390), 'math.sqrt', 'sqrt', (['((robot_actual_location[0] - hexagon_pixel_values[i][0]) ** 2 + (\n robot_actual_location[1] - hexagon_pixel_values[i][1]) ** 2)'], {}), '((robot_actual_loc... |
import warnings
from typing import List
from fastapi import APIRouter, FastAPI
from fastapi.routing import APIRoute
from fastapi.testclient import TestClient
from pydantic import BaseModel
def custom_generate_unique_id(route: APIRoute):
return f"foo_{route.name}"
def custom_generate_unique_id2(route: APIRoute)... | [
"fastapi.FastAPI",
"fastapi.testclient.TestClient",
"warnings.catch_warnings",
"fastapi.APIRouter",
"warnings.simplefilter"
] | [((608, 670), 'fastapi.FastAPI', 'FastAPI', ([], {'generate_unique_id_function': 'custom_generate_unique_id'}), '(generate_unique_id_function=custom_generate_unique_id)\n', (615, 670), False, 'from fastapi import APIRouter, FastAPI\n'), ((684, 695), 'fastapi.APIRouter', 'APIRouter', ([], {}), '()\n', (693, 695), False,... |
#!/usr/bin/env python
# encoding: utf-8
#------------------------------------------------------------------------------
# Naked | A Python command line application framework
# Copyright 2014 <NAME>
# MIT License
#------------------------------------------------------------------------------
#-------------------------... | [
"Naked.commands.make.MakeController",
"Naked.commands.profile.help",
"Naked.commands.dist.Dist",
"Naked.commandline.Command",
"Naked.commands.classifier.Classifier",
"sys.exit",
"Naked.commands.profile.Profiler",
"Naked.commands.test.help",
"Naked.commands.pyh.python_help",
"Naked.commands.classif... | [((1593, 1627), 'Naked.commandline.Command', 'Command', (['sys.argv[0]', 'sys.argv[1:]'], {}), '(sys.argv[0], sys.argv[1:])\n', (1600, 1627), False, 'from Naked.commandline import Command\n'), ((2327, 2338), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (2335, 2338), False, 'import sys\n'), ((2986, 2997), 'Naked.comm... |
import datetime
import re
import pytz
from django.utils.timezone import make_aware, is_aware
def seconds_resolution(dt):
return dt - dt.microsecond * datetime.timedelta(0, 0, 1)
def minutes_resolution(dt):
return dt - dt.second * datetime.timedelta(0, 1, 0) - dt.microsecond * datetime.timedelta(0, 0, 1)
... | [
"django.utils.timezone.is_aware",
"datetime.timedelta",
"re.match",
"django.utils.timezone.make_aware"
] | [((3273, 3415), 're.match', 're.match', (['"""^((?P<days>[-+]?\\\\d+) days?,? )?(?P<sign>[-+]?)(?P<hours>\\\\d+):(?P<minutes>\\\\d+)(:(?P<seconds>\\\\d+(\\\\.\\\\d+)?))?$"""', 'string'], {}), "(\n '^((?P<days>[-+]?\\\\d+) days?,? )?(?P<sign>[-+]?)(?P<hours>\\\\d+):(?P<minutes>\\\\d+)(:(?P<seconds>\\\\d+(\\\\.\\\\d+)... |
import time
import xappt
@xappt.register_plugin
class AutoAdvance(xappt.BaseTool):
message = xappt.ParamString(options={"ui": "label"})
next_iteration_advance_mode = xappt.ParamInt(choices=("no auto advance", "auto advance"))
def __init__(self, *, interface: xappt.BaseInterface, **kwargs):
super... | [
"xappt.ParamInt",
"xappt.humanize_ordinal",
"xappt.ParamString",
"time.sleep"
] | [((100, 142), 'xappt.ParamString', 'xappt.ParamString', ([], {'options': "{'ui': 'label'}"}), "(options={'ui': 'label'})\n", (117, 142), False, 'import xappt\n'), ((177, 236), 'xappt.ParamInt', 'xappt.ParamInt', ([], {'choices': "('no auto advance', 'auto advance')"}), "(choices=('no auto advance', 'auto advance'))\n",... |
"""Largest prime factor
The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number 600851475143?
"""
import math
import numpy as np
def largest_prime_factor_naive(number):
"""
Let the given number be n and let k = 2, 3, 4, 5, ... .
For each k, if it is a factor of n ... | [
"numpy.array",
"math.sqrt",
"numpy.arange"
] | [((2287, 2304), 'math.sqrt', 'math.sqrt', (['number'], {}), '(number)\n', (2296, 2304), False, 'import math\n'), ((2735, 2760), 'numpy.array', 'np.array', (['([True] * length)'], {}), '([True] * length)\n', (2743, 2760), True, 'import numpy as np\n'), ((2569, 2586), 'math.sqrt', 'math.sqrt', (['number'], {}), '(number)... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 OpenStack, LLC.
# 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... | [
"nova.hooks.add_hook",
"nova.hooks.reset"
] | [((1920, 1947), 'nova.hooks.add_hook', 'hooks.add_hook', (['"""test_hook"""'], {}), "('test_hook')\n", (1934, 1947), False, 'from nova import hooks\n'), ((1773, 1786), 'nova.hooks.reset', 'hooks.reset', ([], {}), '()\n', (1784, 1786), False, 'from nova import hooks\n')] |
""" This module defines the class QueryUniprot which connects to APIs at
http://www.uniprot.org/uploadlists/, querying reactome pathways from uniprot id.
* map_enzyme_commission_id_to_uniprot_ids(ec_id)
Description:
map enzyme commission id to UniProt ids
Args:
ec_id (str): enzyme commissio... | [
"sys.exit",
"cache_control_helper.CacheControlHelper",
"CachedMethods.cache_info",
"xmltodict.parse"
] | [((1700, 1720), 'cache_control_helper.CacheControlHelper', 'CacheControlHelper', ([], {}), '()\n', (1718, 1720), False, 'from cache_control_helper import CacheControlHelper\n'), ((3100, 3120), 'cache_control_helper.CacheControlHelper', 'CacheControlHelper', ([], {}), '()\n', (3118, 3120), False, 'from cache_control_hel... |
import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import validate
from streamlink.stream import HTTPStream
from streamlink import NoStreamsError
class Tamago(Plugin):
_url_re = re.compile(r"https?://(?:player\.)?tamago\.live/w/(?P<id>\d+)")
_api_url_base = "https://player.tamago.liv... | [
"streamlink.NoStreamsError",
"streamlink.plugin.api.validate.url",
"streamlink.stream.HTTPStream",
"re.compile"
] | [((209, 274), 're.compile', 're.compile', (['"""https?://(?:player\\\\.)?tamago\\\\.live/w/(?P<id>\\\\d+)"""'], {}), "('https?://(?:player\\\\.)?tamago\\\\.live/w/(?P<id>\\\\d+)')\n", (219, 274), False, 'import re\n'), ((1150, 1174), 'streamlink.NoStreamsError', 'NoStreamsError', (['self.url'], {}), '(self.url)\n', (11... |
"""
Name: modules.py
Desc: This script defines some base module for building networks.
"""
from typing import Any
import torch
import torch.nn as nn
import torch.nn.functional as F
class UNet_down_block(nn.Module):
def __init__(self, input_channel, output_channel, down_size=True):
super(UNet_down_block,... | [
"torch.nn.GroupNorm",
"torch.nn.ReLU",
"torch.nn.BatchNorm2d",
"torch.nn.Conv2d",
"torch.nn.MaxPool2d",
"torch.nn.Upsample",
"torch.nn.ConvTranspose2d",
"torch.cat"
] | [((359, 413), 'torch.nn.Conv2d', 'nn.Conv2d', (['input_channel', 'output_channel', '(3)'], {'padding': '(1)'}), '(input_channel, output_channel, 3, padding=1)\n', (368, 413), True, 'import torch.nn as nn\n'), ((433, 464), 'torch.nn.GroupNorm', 'nn.GroupNorm', (['(8)', 'output_channel'], {}), '(8, output_channel)\n', (4... |
import os
from flask_unchained import AppConfig
class Config(AppConfig):
WEBPACK_MANIFEST_PATH = os.path.join(
AppConfig.STATIC_FOLDER, 'assets', 'manifest.json')
class ProdConfig:
# use relative paths by default, ie, the same host as the backend
WEBPACK_ASSETS_HOST = ''
class StagingConfig(P... | [
"os.path.join"
] | [((104, 168), 'os.path.join', 'os.path.join', (['AppConfig.STATIC_FOLDER', '"""assets"""', '"""manifest.json"""'], {}), "(AppConfig.STATIC_FOLDER, 'assets', 'manifest.json')\n", (116, 168), False, 'import os\n')] |
import logging
import torch
import torch.nn as nn
import torch.nn.functional as F
from .... import extensions as E
from . import accuracy as A
logger = logging.getLogger('global')
def _reduce(loss, reduction, **kwargs):
if reduction == 'none':
ret = loss
elif reduction == 'mean':
normalizer... | [
"logging.getLogger",
"torch.sort",
"torch.abs",
"torch.cuda.FloatTensor",
"torch.log",
"torch.nn.Softmax",
"torch.sqrt",
"torch.pow",
"torch.tensor",
"torch.sum",
"torch.nn.functional.log_softmax",
"torch.nn.functional.cross_entropy",
"torch.zeros_like",
"torch.nn.functional.binary_cross_e... | [((155, 182), 'logging.getLogger', 'logging.getLogger', (['"""global"""'], {}), "('global')\n", (172, 182), False, 'import logging\n'), ((912, 937), 'torch.abs', 'torch.abs', (['(input - target)'], {}), '(input - target)\n', (921, 937), False, 'import torch\n'), ((1168, 1193), 'torch.abs', 'torch.abs', (['(input - targ... |
import inspect
import os
from collections import Callable
from asyncorm.application.configure import get_model
from asyncorm.exceptions import AsyncOrmFieldError, AsyncOrmModelDoesNotExist, AsyncOrmModelError
from asyncorm.manager import ModelManager
from asyncorm.models.fields import AutoField, Field, ForeignKey, Man... | [
"inspect.getmodule",
"asyncorm.models.fields.AutoField",
"asyncorm.exceptions.AsyncOrmFieldError",
"asyncorm.application.configure.get_model",
"asyncorm.exceptions.AsyncOrmModelError",
"asyncorm.manager.ModelManager"
] | [((4214, 4237), 'asyncorm.application.configure.get_model', 'get_model', (['other_column'], {}), '(other_column)\n', (4223, 4237), False, 'from asyncorm.application.configure import get_model\n'), ((4257, 4295), 'asyncorm.manager.ModelManager', 'ModelManager', (['other_model'], {'field': 'field'}), '(other_model, field... |
#
# Jasy - Web Tooling Framework
# Copyright 2010-2012 Zynga Inc.
# Copyright 2013-2014 <NAME>
#
import os
import jasy
import jasy.core.Console as Console
from jasy.item.Script import ScriptError
from jasy.item.Script import ScriptItem
import jasy.script.Resolver as ScriptResolver
from jasy.script.Resolver import R... | [
"jasy.script.Resolver.Resolver",
"jasy.script.output.Optimization.Optimization",
"jasy.core.Console.indent",
"jasy.core.Console.info",
"os.path.join",
"jasy.UserError",
"jasy.script.output.Formatting.Formatting",
"jasy.core.Console.outdent"
] | [((1086, 1119), 'jasy.script.output.Optimization.Optimization', 'ScriptOptimization.Optimization', ([], {}), '()\n', (1117, 1119), True, 'import jasy.script.output.Optimization as ScriptOptimization\n'), ((1154, 1183), 'jasy.script.output.Formatting.Formatting', 'ScriptFormatting.Formatting', ([], {}), '()\n', (1181, 1... |
# coding=utf-8
# Copyright 2020 The Google Research Authors.
#
# 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 applicab... | [
"tensorflow.random.uniform",
"tensorflow.tile",
"tensorflow.shape",
"tensorflow.TensorArray",
"tensorflow.keras.initializers.GlorotUniform",
"tensorflow_probability.experimental.as_composite",
"snlds.utils.tensor_for_ta",
"snlds.model_base.SwitchingNLDS",
"tensorflow.concat",
"snlds.utils.write_up... | [((3313, 3350), 'tensorflow.keras.initializers.GlorotUniform', 'tf.keras.initializers.GlorotUniform', ([], {}), '()\n', (3348, 3350), True, 'import tensorflow as tf\n'), ((4680, 4722), 'tensorflow_probability.experimental.as_composite', 'tfp.experimental.as_composite', (['return_dist'], {}), '(return_dist)\n', (4709, 4... |
import matplotlib.pyplt as plt
from bermuda import ellipse, polygon, rectangle
plt.plot([1,2,3], [2,3,4])
ax = plg.gca()
# default choices for everything
e = ellipse(ax)
# custom position, genric interface for all shapes
e = ellipse(ax, bbox = (x, y, w, h, theta))
e = ellipse(ax, cen=(x, y), width=w, height=h, the... | [
"bermuda.ellipse",
"matplotlib.pyplt.plot"
] | [((82, 112), 'matplotlib.pyplt.plot', 'plt.plot', (['[1, 2, 3]', '[2, 3, 4]'], {}), '([1, 2, 3], [2, 3, 4])\n', (90, 112), True, 'import matplotlib.pyplt as plt\n'), ((162, 173), 'bermuda.ellipse', 'ellipse', (['ax'], {}), '(ax)\n', (169, 173), False, 'from bermuda import ellipse, polygon, rectangle\n'), ((230, 267), '... |
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0
"""BraTS (Brain Tumor Segmentation) dataset hyperparameters."""
from dataclasses import dataclass
import torch
import yahp as hp
from composer.datasets.brats import PytTrain, PytVal, get_data_split
from composer.datasets.dataset_hparam... | [
"torch.Tensor",
"yahp.optional",
"composer.datasets.brats.get_data_split",
"composer.datasets.brats.PytVal",
"composer.datasets.brats.PytTrain",
"composer.utils.dist.get_sampler"
] | [((884, 925), 'yahp.optional', 'hp.optional', (['"""oversampling"""'], {'default': '(0.33)'}), "('oversampling', default=0.33)\n", (895, 925), True, 'import yahp as hp\n'), ((588, 606), 'torch.Tensor', 'torch.Tensor', (['data'], {}), '(data)\n', (600, 606), False, 'import torch\n'), ((608, 628), 'torch.Tensor', 'torch.... |
from quo.getchar import getchar
getchar()
| [
"quo.getchar.getchar"
] | [((33, 42), 'quo.getchar.getchar', 'getchar', ([], {}), '()\n', (40, 42), False, 'from quo.getchar import getchar\n')] |
from setuptools import setup, find_packages
setup(
name='syntaxerrors',
version='0.0.1',
description='Report better SyntaxErrors',
author='<NAME>',
author_email='<EMAIL>',
packages=['syntaxerrors'],
package_dir={'': 'src'},
include_package_data=True,
)
| [
"setuptools.setup"
] | [((45, 263), 'setuptools.setup', 'setup', ([], {'name': '"""syntaxerrors"""', 'version': '"""0.0.1"""', 'description': '"""Report better SyntaxErrors"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'packages': "['syntaxerrors']", 'package_dir': "{'': 'src'}", 'include_package_data': '(True)'}), "(name='... |
import operator
from amino.either import Left, Right
from amino import Empty, Just, Maybe, List, Either, _
from amino.test.spec_spec import Spec
from amino.list import Lists
class EitherSpec(Spec):
def map(self) -> None:
a = 'a'
b = 'b'
Right(a).map(_ + b).value.should.equal(a + b)
... | [
"amino.either.Right",
"amino.either.Left",
"amino.List",
"amino.list.Lists.range",
"amino.Just"
] | [((565, 573), 'amino.either.Right', 'Right', (['a'], {}), '(a)\n', (570, 573), False, 'from amino.either import Left, Right\n'), ((617, 624), 'amino.either.Left', 'Left', (['a'], {}), '(a)\n', (621, 624), False, 'from amino.either import Left, Right\n'), ((744, 756), 'amino.either.Right', 'Right', (['(a + b)'], {}), '(... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""*******************************************************************************
* MIT License
* Copyright (c) <NAME> 2021
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the... | [
"tf.transformations.euler_from_quaternion",
"rospy.Subscriber",
"rospy.signal_shutdown",
"rospy.is_shutdown",
"geometry_msgs.msg.Twist",
"rospy.init_node",
"enpm808x_inspection_robot.msg.flag_array",
"math.sqrt",
"rospy.Time",
"rospy.Rate",
"tf.TransformListener",
"rospy.spin",
"geometry_msg... | [((2335, 2364), 'rospy.init_node', 'rospy.init_node', (['"""move_robot"""'], {}), "('move_robot')\n", (2350, 2364), False, 'import rospy\n'), ((2372, 2419), 'rospy.Publisher', 'rospy.Publisher', (['"""cmd_vel"""', 'Twist'], {'queue_size': '(1)'}), "('cmd_vel', Twist, queue_size=1)\n", (2387, 2419), False, 'import rospy... |
import pandas as pd
class ProcessCSV:
"""
A general class to read in and process a csv format file using pandas.
"""
def __init__(self, filename, delim=',', header=None, usecols=None, dtype=None, ignore=False, *args):
self._filename = filename
self._args = args
self._df = self.... | [
"pandas.read_csv"
] | [((506, 593), 'pandas.read_csv', 'pd.read_csv', (['self._filename'], {'sep': 'delim', 'header': 'header', 'usecols': 'usecols', 'dtype': 'dtype'}), '(self._filename, sep=delim, header=header, usecols=usecols,\n dtype=dtype)\n', (517, 593), True, 'import pandas as pd\n')] |
from functools import lru_cache
from itertools import product
from pathlib import Path
from typing import Optional, List, Tuple
from pydantic import validate_arguments
import pyhmmer
import requests as r
from yarl import URL
from sadie.typing import Species, Chain, Source
class G3:
"""API Wrapper with OpenAPI f... | [
"pyhmmer.plan7.Background",
"pyhmmer.easel.MSAFile",
"pyhmmer.easel.Alphabet.amino",
"pyhmmer.plan7.Builder",
"pathlib.Path",
"itertools.product",
"requests.get",
"pyhmmer.plan7.HMMFile",
"functools.lru_cache",
"yarl.URL"
] | [((1183, 1203), 'functools.lru_cache', 'lru_cache', ([], {'maxsize': '(1)'}), '(maxsize=1)\n', (1192, 1203), False, 'from functools import lru_cache\n'), ((1389, 1409), 'functools.lru_cache', 'lru_cache', ([], {'maxsize': '(1)'}), '(maxsize=1)\n', (1398, 1409), False, 'from functools import lru_cache\n'), ((1695, 1718)... |
# coding: utf-8
from nlp_components.content_items_processors import process_list_content_sentences
from nlp_components.content_items_processors import process_list_content_sentences_real
import dals.os_io.io_wrapper as dal
import json
# NO DRY!!
def read_utf_txt_file(fname):
sets = dal.get_utf8_template()
se... | [
"json.loads",
"dals.os_io.io_wrapper.file2list",
"nlp_components.content_items_processors.process_list_content_sentences_real",
"dals.os_io.io_wrapper.get_utf8_template",
"nlp_components.content_items_processors.process_list_content_sentences"
] | [((290, 313), 'dals.os_io.io_wrapper.get_utf8_template', 'dal.get_utf8_template', ([], {}), '()\n', (311, 313), True, 'import dals.os_io.io_wrapper as dal\n'), ((350, 369), 'dals.os_io.io_wrapper.file2list', 'dal.file2list', (['sets'], {}), '(sets)\n', (363, 369), True, 'import dals.os_io.io_wrapper as dal\n'), ((631, ... |
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013,2014,2015,2017 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You ma... | [
"operator.attrgetter",
"aquilon.worker.formats.formatters.ObjectFormatter.redirect_proto",
"aquilon.worker.formats.formatters.ObjectFormatter.format_raw"
] | [((1228, 1330), 'aquilon.worker.formats.formatters.ObjectFormatter.format_raw', 'ObjectFormatter.format_raw', (['self', 'result', 'indent'], {'embedded': 'embedded', 'indirect_attrs': 'indirect_attrs'}), '(self, result, indent, embedded=embedded,\n indirect_attrs=indirect_attrs)\n', (1254, 1330), False, 'from aquilo... |