code
stringlengths
22
1.05M
apis
listlengths
1
3.31k
extract_api
stringlengths
75
3.25M
# taken from http://python-packaging.readthedocs.io/en/latest/everything.html and modified a little from setuptools import setup, find_packages # random values __version__ = '0.1.0' # this part taken from https://github.com/dr-guangtou/riker with open('requirements.txt') as infd: INSTALL_REQUIRES = [x.strip('\n'...
[ "setuptools.find_packages" ]
[((982, 997), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (995, 997), False, 'from setuptools import setup, find_packages\n')]
from utils import * import logging import os import time import warnings import subprocess from subprocess import PIPE formatter = '%(levelname)s : %(asctime)s : %(message)s' logging.basicConfig(filename='mk8d.log', level=logging.INFO, format=formatter) warnings.simplefilter('ignore') """##########################...
[ "subprocess.run", "warnings.simplefilter", "logging.basicConfig", "time.sleep", "logging.info" ]
[((178, 256), 'logging.basicConfig', 'logging.basicConfig', ([], {'filename': '"""mk8d.log"""', 'level': 'logging.INFO', 'format': 'formatter'}), "(filename='mk8d.log', level=logging.INFO, format=formatter)\n", (197, 256), False, 'import logging\n'), ((257, 288), 'warnings.simplefilter', 'warnings.simplefilter', (['"""...
# 作者:西岛闲鱼 # https://github.com/globien/easy-python # https://gitee.com/globien/easy-python # 验证三门问题(Monty Hall problem) import random 获奖次数_不换 = 0 # 不换而获奖的计数器 获奖次数_换 = 0 # 换而获奖的计数器 试验次数 = 100000 # 换和不换各做这么多次实验 for i in range(试验次数): # 不换的实验 door_list = ["A","B","C"] # 三扇...
[ "random.choice" ]
[((335, 359), 'random.choice', 'random.choice', (['door_list'], {}), '(door_list)\n', (348, 359), False, 'import random\n'), ((388, 412), 'random.choice', 'random.choice', (['door_list'], {}), '(door_list)\n', (401, 412), False, 'import random\n'), ((619, 643), 'random.choice', 'random.choice', (['door_list'], {}), '(d...
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2018-06-03 06:54 from __future__ import unicode_literals from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('freefolks', '0005_auto_20180602_2334'), ] operations = [...
[ "django.db.models.CharField", "django.db.models.DateTimeField", "django.db.models.DecimalField" ]
[((435, 509), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'auto_now_add': '(True)', 'default': 'django.utils.timezone.now'}), '(auto_now_add=True, default=django.utils.timezone.now)\n', (455, 509), False, 'from django.db import migrations, models\n'), ((673, 708), 'django.db.models.DateTimeField', '...
from django.db import models from adapter import models as adapter_models class SensorUsage(models.Model): value = models.FloatField() sensor = models.ForeignKey(adapter_models.Sensor, on_delete=models.CASCADE) datetime = models.DateTimeField() @staticmethod def get_usage_by_day(day, monitors): ...
[ "django.db.models.ForeignKey", "django.db.models.DateTimeField", "django.db.models.CharField", "django.db.models.FloatField" ]
[((122, 141), 'django.db.models.FloatField', 'models.FloatField', ([], {}), '()\n', (139, 141), False, 'from django.db import models\n'), ((155, 221), 'django.db.models.ForeignKey', 'models.ForeignKey', (['adapter_models.Sensor'], {'on_delete': 'models.CASCADE'}), '(adapter_models.Sensor, on_delete=models.CASCADE)\n', ...
import requests from json import loads def _args_to_params(kwargs): """ Creates a tuple of keyword, value tuples and changes parameter names for ESI :param kwargs: :return: ((parameter, value), (parameter, value), ...) :rtype: tuple """ params = () for parameter, value in kwargs.items(...
[ "requests.request", "json.loads" ]
[((1235, 1361), 'requests.request', 'requests.request', (['HTTP_method', 'f"""https://esi.evetech.net/{version}{path}"""'], {'headers': 'headers', 'params': 'params', 'proxies': 'proxies'}), "(HTTP_method, f'https://esi.evetech.net/{version}{path}',\n headers=headers, params=params, proxies=proxies)\n", (1251, 1361)...
''' Present an interactive function explorer with slider widgets. Scrub the sliders to change the properties of the ``sin`` curve, or type into the title text box to update the title of the plot. Use the ``bokeh serve`` command to run the example by executing: bokeh serve sliders.py at your command prompt. Then nav...
[ "bokeh.plotting.figure", "sklearn.datasets.make_blobs", "bokeh.plotting.output_file", "bokeh.plotting.show", "numpy.dot", "numpy.vstack" ]
[((828, 886), 'sklearn.datasets.make_blobs', 'make_blobs', ([], {'n_samples': 'n_samples', 'random_state': 'random_state'}), '(n_samples=n_samples, random_state=random_state)\n', (838, 886), False, 'from sklearn.datasets import make_blobs\n'), ((1008, 1033), 'numpy.dot', 'np.dot', (['X', 'transformation'], {}), '(X, tr...
#!/usr/bin/env python3 """Command line tool for the tesseract-recognize API server.""" """ @version $Version: 2020.01.13$ @author <NAME> <<EMAIL>> @copyright Copyright(c) 2017-present, <NAME> <<EMAIL>> @requirements https://github.com/omni-us/pagexml/releases/download/2019.10.10/pagexml-2019.10.10-cp36-cp36m-linux_x8...
[ "flask_restplus.Api", "werkzeug.exceptions.BadRequest", "shutil.rmtree", "os.path.join", "json.loads", "pagexml.PageXML", "prance.convert.convert_url", "tempfile.mkdtemp", "flask.Response", "flask.request.base_url.replace", "threading.Thread", "subprocess.Popen", "os.path.basename", "pagex...
[((553, 580), 'pagexml.set_omnius_schema', 'pagexml.set_omnius_schema', ([], {}), '()\n', (578, 580), False, 'import pagexml\n'), ((1115, 1233), 'jsonargparse.ArgumentParser', 'ArgumentParser', ([], {'error_handler': '"""usage_and_exit_error_handler"""', 'logger': 'logger', 'default_env': '(True)', 'description': '__do...
import unittest from unittest.mock import ( patch, MagicMock ) from client.communication.messages import MessageCommand from client.communication.on_board import OnBoard, IncomingMessageHandler class OnBoardTest(unittest.TestCase): """ A suite of tests surrounding the OnBoard class functionality. ...
[ "unittest.mock.patch", "unittest.mock.MagicMock", "client.communication.on_board.IncomingMessageHandler", "client.communication.on_board.OnBoard" ]
[((529, 599), 'unittest.mock.patch', 'patch', (['"""client.communication.on_board.build_command_message_with_args"""'], {}), "('client.communication.on_board.build_command_message_with_args')\n", (534, 599), False, 'from unittest.mock import patch, MagicMock\n'), ((1254, 1324), 'unittest.mock.patch', 'patch', (['"""cli...
import pytest from django.contrib.auth.models import User from django.test import Client @pytest.fixture(scope="session") def superuser(django_db_setup, django_db_blocker) -> User: with django_db_blocker.unblock(): user: User = User.objects.get_or_create( username="x", em...
[ "pytest.fixture", "django.contrib.auth.models.User.objects.get_or_create", "django.test.Client" ]
[((97, 128), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (111, 128), False, 'import pytest\n'), ((487, 518), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (501, 518), False, 'import pytest\n'), ((599, 607), 'django.test.Clie...
import setuptools with open('README.md', 'r') as fh: long_description = fh.read() setuptools.setup( name='lambdata-pkutrich', version='0.0.4', author='<NAME>', author_email='<EMAIL>', description='Some very basic DataFrame tools.', long_description=long_description, long_description_co...
[ "setuptools.find_packages" ]
[((490, 516), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (514, 516), False, 'import setuptools\n')]
from rlutilities.simulation import Car, Ball from rlutilities.linear_algebra import * from analysis.throttle import * from analysis.boost import * from analysis.jump import * from rlbot.agents.base_agent import SimpleControllerState from rlbot.utils.game_state_util import CarState from util.drive import steer_toward_ta...
[ "rlbot.agents.base_agent.SimpleControllerState", "util.vec.Vec3", "util.rlutilities.rotation_to_euler", "math.atan2", "rlutilities.simulation.Car", "util.rlutilities.to_vec3", "util.drive.steer_toward_target", "rlutilities.simulation.Ball", "math.degrees" ]
[((968, 988), 'rlutilities.simulation.Car', 'Car', (['bot.game.my_car'], {}), '(bot.game.my_car)\n', (971, 988), False, 'from rlutilities.simulation import Car, Ball\n'), ((1001, 1020), 'rlutilities.simulation.Ball', 'Ball', (['bot.game.ball'], {}), '(bot.game.ball)\n', (1005, 1020), False, 'from rlutilities.simulation...
#!/usr/bin/env python # coding: utf-8 from typing import List import pandas as pd import rpy2.robjects as robjects from rpy2.robjects import pandas2ri def tsfeatures_r(ts: pd.DataFrame, freq: int, features: List[str] = ["length", "acf_features", "arch_stat", ...
[ "rpy2.robjects.pandas2ri.deactivate", "rpy2.robjects.pandas2ri.activate", "rpy2.robjects.r" ]
[((2616, 2636), 'rpy2.robjects.pandas2ri.activate', 'pandas2ri.activate', ([], {}), '()\n', (2634, 2636), False, 'from rpy2.robjects import pandas2ri\n'), ((2649, 2668), 'rpy2.robjects.r', 'robjects.r', (['rstring'], {}), '(rstring)\n', (2659, 2668), True, 'import rpy2.robjects as robjects\n'), ((2722, 2744), 'rpy2.rob...
#!/usr/bin/env python3 import logging from adb.adb import ADB if __name__ == "__main__": # Logging configuration. logger = logging.getLogger(__name__) logging.basicConfig( format="%(asctime)s> [%(levelname)s][%(name)s][%(funcName)s()] %(message)s", datefmt="%d/%m/%Y %H:%M:%S", le...
[ "adb.adb.ADB", "logging.basicConfig", "logging.getLogger" ]
[((135, 162), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (152, 162), False, 'import logging\n'), ((167, 321), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s> [%(levelname)s][%(name)s][%(funcName)s()] %(message)s"""', 'datefmt': '"""%d/%m/%Y %H:%M:%S"""',...
import numpy as np import xarray as xr from glob import glob import observation_operators as obs import tropomi_tools as tt import scipy.linalg as la import toolbox as tx from datetime import date,datetime,timedelta def getLETKFConfig(testing=False): data = tx.getSpeciesConfig(testing) err_config = data['OBS_ERROR_...
[ "toolbox.getSpeciesConfig", "numpy.load", "numpy.sum", "toolbox.getLatLonList", "numpy.abs", "numpy.ones", "numpy.isnan", "numpy.shape", "numpy.mean", "numpy.arange", "glob.glob", "toolbox.calcDist_km", "toolbox.getIndsOfInterest", "observation_operators.NatureHelper", "numpy.std", "nu...
[((261, 289), 'toolbox.getSpeciesConfig', 'tx.getSpeciesConfig', (['testing'], {}), '(testing)\n', (280, 289), True, 'import toolbox as tx\n'), ((1749, 1779), 'xarray.load_dataset', 'xr.load_dataset', (['self.filename'], {}), '(self.filename)\n', (1764, 1779), True, 'import xarray as xr\n'), ((1807, 1848), 'glob.glob',...
# This is where our imports go. from alembic.config import Config from flask import Flask from flask_migrate import Migrate from flask_sqlalchemy import SQLAlchemy from sqlalchemy import create_engine from flask_googlemaps import GoogleMaps from os import environ # make key.py with API_KEY='your_api_string' from flask...
[ "alembic.config.Config", "flask.Flask", "flask_migrate.Migrate", "flask_sqlalchemy.SQLAlchemy", "sqlalchemy.create_engine" ]
[((356, 364), 'alembic.config.Config', 'Config', ([], {}), '()\n', (362, 364), False, 'from alembic.config import Config\n'), ((432, 447), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (437, 447), False, 'from flask import Flask\n'), ((759, 774), 'flask_sqlalchemy.SQLAlchemy', 'SQLAlchemy', (['app'], {}),...
#Python wrapper / library for Einstein Analytics API import sys import browser_cookie3 import requests import json import time import datetime from dateutil import tz import pandas as pd import numpy as np import re from pandas import json_normalize from decimal import Decimal import base64 import csv import unicodecsv...
[ "json.dumps", "requests.utils.dict_from_cookiejar", "datetime.datetime.utcnow", "sys.exc_info", "sys.getsizeof", "pandas.DataFrame", "json.loads", "dateutil.tz.tzlocal", "re.findall", "datetime.timedelta", "requests.get", "math.ceil", "pandas.to_datetime", "numpy.issubdtype", "sys.exit",...
[((1998, 2104), 'requests.get', 'requests.get', (["(self.env_url + '/services/data/v48.0/wave/datasets')"], {'headers': 'self.header', 'params': 'params'}), "(self.env_url + '/services/data/v48.0/wave/datasets', headers=\n self.header, params=params)\n", (2010, 2104), False, 'import requests\n'), ((3753, 3790), 're....
""" Тестирование """ import sys sys.path.append('.') from objects import auto_type, equal_object, RegistryStore def test_auto_type(): """ Проверка преобразования значений """ assert auto_type('test') == str('test') assert auto_type('5') == 5 for i in ['true', 'y', 'yes']: asse...
[ "sys.path.append", "objects.equal_object", "objects.auto_type", "objects.RegistryStore" ]
[((37, 57), 'sys.path.append', 'sys.path.append', (['"""."""'], {}), "('.')\n", (52, 57), False, 'import sys\n'), ((519, 534), 'objects.RegistryStore', 'RegistryStore', ([], {}), '()\n', (532, 534), False, 'from objects import auto_type, equal_object, RegistryStore\n'), ((632, 697), 'objects.equal_object', 'equal_objec...
import PyQt5.QtWidgets as W class ProfilesTable(W.QTableWidget): def __init__(self, parent, profiles=[]): super(ProfilesTable, self).__init__(parent) self.init() self.update_profiles(profiles) def init(self): self.setColumnCount(2) self.setHorizontalHeaderLabels(["Na...
[ "PyQt5.QtWidgets.QTableWidgetItem" ]
[((677, 704), 'PyQt5.QtWidgets.QTableWidgetItem', 'W.QTableWidgetItem', (['profile'], {}), '(profile)\n', (695, 704), True, 'import PyQt5.QtWidgets as W\n')]
import click from parsec.cli import pass_context, json_loads from parsec.decorators import custom_exception, json_output @click.command('get_invocations') @click.option( "--workflow_id", help="Encoded workflow ID to filter on", type=str ) @click.option( "--history_id", help="Encoded history ID to ...
[ "click.option", "click.command" ]
[((124, 156), 'click.command', 'click.command', (['"""get_invocations"""'], {}), "('get_invocations')\n", (137, 156), False, 'import click\n'), ((158, 243), 'click.option', 'click.option', (['"""--workflow_id"""'], {'help': '"""Encoded workflow ID to filter on"""', 'type': 'str'}), "('--workflow_id', help='Encoded work...
import argparse import json import os import numpy as np import utils import util def main(args): config = utils.get_hocon_config(config_path="./config/main.conf", config_name="base") input_file = args.input_file if args.is_training == 0: is_training = False else: is_training = Tru...
[ "numpy.save", "numpy.sum", "argparse.ArgumentParser", "json.loads", "os.path.basename", "numpy.asarray", "util.get_tokenizer", "utils.DataInstance", "utils.get_hocon_config", "numpy.array", "os.path.join", "util.flatten" ]
[((116, 192), 'utils.get_hocon_config', 'utils.get_hocon_config', ([], {'config_path': '"""./config/main.conf"""', 'config_name': '"""base"""'}), "(config_path='./config/main.conf', config_name='base')\n", (138, 192), False, 'import utils\n'), ((338, 377), 'util.get_tokenizer', 'util.get_tokenizer', (['args.tokenizer_n...
from django.test import TestCase from basin3d.models import DataSource, SamplingMedium, \ ObservedPropertyVariable, ObservedProperty, DataSourceObservedPropertyVariable class DataSourceTestCase(TestCase): def setUp(self): DataSource.objects.create(name="Foo", plugin_module="foo.bar.plugins", plugin_...
[ "basin3d.models.ObservedProperty", "basin3d.models.SamplingMedium", "basin3d.models.ObservedPropertyVariable", "basin3d.models.DataSource.objects.create", "basin3d.models.DataSourceObservedPropertyVariable", "basin3d.models.DataSource.objects.get" ]
[((242, 351), 'basin3d.models.DataSource.objects.create', 'DataSource.objects.create', ([], {'name': '"""Foo"""', 'plugin_module': '"""foo.bar.plugins"""', 'plugin_class': '"""Baz"""', 'id_prefix': '"""F"""'}), "(name='Foo', plugin_module='foo.bar.plugins',\n plugin_class='Baz', id_prefix='F')\n", (267, 351), False,...
import functools import hashlib import json import random from urlparse import urlparse import uuid from operator import attrgetter from django import http from django.conf import settings from django.db.models import Q from django.shortcuts import get_list_or_404, get_object_or_404, redirect from django.utils.transla...
[ "abuse.models.send_abuse_report", "amo.utils.randslice", "random.shuffle", "reviews.models.GroupedRating.get", "mobility.decorators.mobile_template", "bandwagon.models.Collection.objects.filter", "django.views.decorators.cache.cache_control", "json.dumps", "users.views._login", "django.http.HttpRe...
[((3944, 3979), 'django.views.decorators.vary.vary_on_headers', 'vary_on_headers', (['"""X-Requested-With"""'], {}), "('X-Requested-With')\n", (3959, 3979), False, 'from django.views.decorators.vary import vary_on_headers\n'), ((6012, 6039), 'mobility.decorators.mobilized', 'mobilized', (['extension_detail'], {}), '(ex...
# Copyright 2022 MONAI Consortium # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, s...
[ "json.dump", "pandas.read_csv", "random.shuffle", "os.path.dirname", "os.path.isfile", "numpy.where", "numpy.array", "random.seed", "sklearn.model_selection.GroupKFold", "preprocess_dicom.dicom_preprocess", "numpy.array_split", "numpy.intersect1d", "os.path.join", "numpy.unique" ]
[((3213, 3227), 'random.seed', 'random.seed', (['(0)'], {}), '(0)\n', (3224, 3227), False, 'import random\n'), ((4820, 4846), 'random.shuffle', 'random.shuffle', (['label_data'], {}), '(label_data)\n', (4834, 4846), False, 'import random\n'), ((4959, 4985), 'numpy.array', 'np.array', (['breast_densities'], {}), '(breas...
"""Helpers to check core security.""" from datetime import timedelta from typing import List, Optional from ...const import CoreState from ...jobs.const import JobCondition, JobExecutionLimit from ...jobs.decorator import Job from ..const import ContextType, IssueType from .base import CheckBase class CheckAddonPwne...
[ "datetime.timedelta" ]
[((505, 524), 'datetime.timedelta', 'timedelta', ([], {'hours': '(24)'}), '(hours=24)\n', (514, 524), False, 'from datetime import timedelta\n')]
from rest_framework import viewsets, mixins from rest_framework.authentication import TokenAuthentication from rest_framework.permissions import IsAuthenticated from core.models import Tag, Ingredient from recipe import serializers # tag and ingredients are attributes of a recipe class BaseRecipeAttrViewSet(viewsets...
[ "core.models.Ingredient.objects.all", "core.models.Tag.objects.all" ]
[((974, 991), 'core.models.Tag.objects.all', 'Tag.objects.all', ([], {}), '()\n', (989, 991), False, 'from core.models import Tag, Ingredient\n'), ((1147, 1171), 'core.models.Ingredient.objects.all', 'Ingredient.objects.all', ([], {}), '()\n', (1169, 1171), False, 'from core.models import Tag, Ingredient\n')]
#!/usr/bin/env python3 import asyncio import sys import os class EchoServer(asyncio.Protocol): clients = {} def connection_made(self, transport): peername = transport.get_extra_info('peername') print('connection from {}'.format(peername)) self.transport = transport self.clients[...
[ "asyncio.get_event_loop", "os.unlink", "os.path.exists" ]
[((882, 906), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (904, 906), False, 'import asyncio\n'), ((779, 804), 'os.unlink', 'os.unlink', (['server_address'], {}), '(server_address)\n', (788, 804), False, 'import os\n'), ((828, 858), 'os.path.exists', 'os.path.exists', (['server_address'], {}),...
# Import required packages import sqlite3 import operations import os import time # Establish connection with database connection = sqlite3.connect("books.db") # Instantiate cursor cursor = connection.cursor() # Create the books table cursor.execute(""" CREATE TABLE IF NOT EXISTS books ( BookId INTEGER P...
[ "operations.clear_screen", "operations.write_to_csv_file", "operations.scrape_books", "time.sleep", "sqlite3.connect", "operations.scrape_book_urls" ]
[((133, 160), 'sqlite3.connect', 'sqlite3.connect', (['"""books.db"""'], {}), "('books.db')\n", (148, 160), False, 'import sqlite3\n'), ((482, 507), 'operations.clear_screen', 'operations.clear_screen', ([], {}), '()\n', (505, 507), False, 'import operations\n'), ((544, 557), 'time.sleep', 'time.sleep', (['(2)'], {}), ...
from .contribution import Contribution import numpy as np from taurex.cache import OpacityCache class AbsorptionContribution(Contribution): """ Computes the contribution to the optical depth occuring from molecular absorption. """ def __init__(self): super().__init__('Absorption') ...
[ "numpy.zeros", "taurex.cache.OpacityCache" ]
[((344, 358), 'taurex.cache.OpacityCache', 'OpacityCache', ([], {}), '()\n', (356, 358), False, 'from taurex.cache import OpacityCache\n'), ((975, 1023), 'numpy.zeros', 'np.zeros', ([], {'shape': '(model.nLayers, wngrid.shape[0])'}), '(shape=(model.nLayers, wngrid.shape[0]))\n', (983, 1023), True, 'import numpy as np\n...
import sys sys.path.append('../') import matplotlib; matplotlib.use('macosx') import time import numpy as np import matplotlib.pyplot as plt import dolfin as dl; dl.set_log_level(40) # ROMML imports from fom.forward_solve import Fin from fom.thermal_fin import get_space from rom.averaged_affine_ROM import AffineROMFi...
[ "matplotlib.pyplot.loglog", "gaussian_field.make_cov_chol", "fom.thermal_fin.get_space", "matplotlib.pyplot.clf", "rom.averaged_affine_ROM.AffineROMFin", "numpy.linalg.norm", "numpy.exp", "numpy.arange", "sys.path.append", "dolfin.inner", "matplotlib.pyplot.cla", "numpy.loadtxt", "numpy.lins...
[((11, 33), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (26, 33), False, 'import sys\n'), ((54, 78), 'matplotlib.use', 'matplotlib.use', (['"""macosx"""'], {}), "('macosx')\n", (68, 78), False, 'import matplotlib\n'), ((163, 183), 'dolfin.set_log_level', 'dl.set_log_level', (['(40)'], {}), '...
import json import pytest from ansiblemetrics.metrics_cal import MetricsCal class TestRoleTaskMetrics: def test_(self): metricCal = MetricsCal() js = json.loads(metricCal.calculate('testResources/configure.yml', 'atss')) assert 1 == js['bloc']['count'] assert 1 == js['cloc']['cou...
[ "ansiblemetrics.metrics_cal.MetricsCal" ]
[((148, 160), 'ansiblemetrics.metrics_cal.MetricsCal', 'MetricsCal', ([], {}), '()\n', (158, 160), False, 'from ansiblemetrics.metrics_cal import MetricsCal\n')]
''' VARIABLES EXPECTED: a) Trade-Off Parameter (Alpha) b) Weight/Reputation Score (Gamma) c) Last Time The Agent was selected (b) RETURNS a LIST of addresses of SAMPLED AGENTS ''' #agents_record = {"ETH_ADDRESS":[GAMMA,B_VAL]} from dataForAgentSelection import agents_record from collections import defaultdict,OrderedD...
[ "collections.defaultdict", "dataForAgentSelection.agents_record.keys" ]
[((398, 418), 'dataForAgentSelection.agents_record.keys', 'agents_record.keys', ([], {}), '()\n', (416, 418), False, 'from dataForAgentSelection import agents_record\n'), ((594, 610), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (605, 610), False, 'from collections import defaultdict, OrderedDict...
import urllib.request import os from pathlib import Path def get_project_root() -> Path: return Path(__file__).parent.parent PROTOCOL = "http://" FILES_URL_ROOT = PROTOCOL + "localhost:3000" ROOT_DIR = get_project_root() def download(uri): create_dirs_from_uri(uri) urllib.request.urlretrieve(f"{FILES_...
[ "os.path.isdir", "pathlib.Path", "os.makedirs" ]
[((464, 488), 'os.path.isdir', 'os.path.isdir', (['file_path'], {}), '(file_path)\n', (477, 488), False, 'import os\n'), ((498, 520), 'os.makedirs', 'os.makedirs', (['file_path'], {}), '(file_path)\n', (509, 520), False, 'import os\n'), ((102, 116), 'pathlib.Path', 'Path', (['__file__'], {}), '(__file__)\n', (106, 116)...
# Faça um programa que leia um ângulo qualquer e mostre na tela o valor do seno, cosseno e tangente desse ângulo. import math angulo = float(input('Digite o valor do angulo:')) coseno = math.cos(math.radians(angulo)) seno = math.sin(math.radians(angulo)) tangente = math.tan(math.radians(angulo)) print('Coseno de {} é...
[ "math.radians" ]
[((196, 216), 'math.radians', 'math.radians', (['angulo'], {}), '(angulo)\n', (208, 216), False, 'import math\n'), ((234, 254), 'math.radians', 'math.radians', (['angulo'], {}), '(angulo)\n', (246, 254), False, 'import math\n'), ((276, 296), 'math.radians', 'math.radians', (['angulo'], {}), '(angulo)\n', (288, 296), Fa...
import re from decimal import Decimal def decode_mutez(value): return Decimal(value) / 10000 def decode_percent(value, decimals=2): return Decimal(value) / 10 ** decimals def decode_split(value): return 1 - decode_percent(value, decimals=4) def decode_hex(value): return value.decode() def deco...
[ "re.match", "decimal.Decimal" ]
[((76, 90), 'decimal.Decimal', 'Decimal', (['value'], {}), '(value)\n', (83, 90), False, 'from decimal import Decimal\n'), ((151, 165), 'decimal.Decimal', 'Decimal', (['value'], {}), '(value)\n', (158, 165), False, 'from decimal import Decimal\n'), ((2445, 2473), 're.match', 're.match', (['"""^[0-9a-f]$"""', 'data'], {...
from dataclasses import astuple, dataclass, fields from importlib import resources import os import sqlite3 from .exception import ArtifactNotFoundError, DuplicateArtifactError import logging LOG = logging.getLogger(__name__) DATABASE_NAME = 'chameleon' @dataclass class Artifact: id: str path: str depos...
[ "importlib.resources.open_text", "os.path.dirname", "sqlite3.connect", "dataclasses.fields", "dataclasses.astuple", "logging.getLogger" ]
[((200, 227), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (217, 227), False, 'import logging\n'), ((392, 408), 'dataclasses.fields', 'fields', (['Artifact'], {}), '(Artifact)\n', (398, 408), False, 'from dataclasses import astuple, dataclass, fields\n'), ((903, 952), 'importlib.resourc...
# License: Apache-2.0 from gators.encoders import WOEEncoder import pytest def test_init(): with pytest.raises(TypeError): WOEEncoder(dtype=str)
[ "pytest.raises", "gators.encoders.WOEEncoder" ]
[((103, 127), 'pytest.raises', 'pytest.raises', (['TypeError'], {}), '(TypeError)\n', (116, 127), False, 'import pytest\n'), ((137, 158), 'gators.encoders.WOEEncoder', 'WOEEncoder', ([], {'dtype': 'str'}), '(dtype=str)\n', (147, 158), False, 'from gators.encoders import WOEEncoder\n')]
from email.utils import formataddr, parseaddr import re emails_to_validate = int(input()) EMAIL_RE = re.compile( r'^[a-zA-Z][a-zA-Z0-9._-]*@[a-zA-Z]+\.[a-zA-Z]{1,3}$' ) def validate_email(email_guess): return bool(EMAIL_RE.match(email_guess)) for i in range(emails_to_validate): real_name, email_addre...
[ "email.utils.formataddr", "re.compile" ]
[((104, 169), 're.compile', 're.compile', (['"""^[a-zA-Z][a-zA-Z0-9._-]*@[a-zA-Z]+\\\\.[a-zA-Z]{1,3}$"""'], {}), "('^[a-zA-Z][a-zA-Z0-9._-]*@[a-zA-Z]+\\\\.[a-zA-Z]{1,3}$')\n", (114, 169), False, 'import re\n'), ((477, 515), 'email.utils.formataddr', 'formataddr', (['(real_name, email_address)'], {}), '((real_name, emai...
import sys import pandas as pd from sqlalchemy import create_engine def load_data(messages_filepath, categories_filepath): """loads the specified message and category data Args: messages_filepath (string): The file path of the messages csv categories_filepath (string): The file path of the cate...
[ "pandas.read_csv", "pandas.merge", "sqlalchemy.create_engine", "pandas.concat" ]
[((438, 468), 'pandas.read_csv', 'pd.read_csv', (['messages_filepath'], {}), '(messages_filepath)\n', (449, 468), True, 'import pandas as pd\n'), ((486, 518), 'pandas.read_csv', 'pd.read_csv', (['categories_filepath'], {}), '(categories_filepath)\n', (497, 518), True, 'import pandas as pd\n'), ((530, 569), 'pandas.merg...
from flask import Flask, jsonify from flask.templating import render_template from threading import Thread from data import * # config app = Flask(__name__) app.config["JSON_SORT_KEYS"] = False app.config["JSONIFY_PRETTYPRINT_REGULAR"] = True # home route @app.route("/") def home(): return render_t...
[ "threading.Thread", "flask.jsonify", "flask.Flask", "flask.templating.render_template" ]
[((148, 163), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (153, 163), False, 'from flask import Flask, jsonify\n'), ((312, 341), 'flask.templating.render_template', 'render_template', (['"""index.html"""'], {}), "('index.html')\n", (327, 341), False, 'from flask.templating import render_template\n'), ((...
from pytube import YouTube YouTube('http://youtube.com/watch?v=9bZkp7q19f0').streams[0].download()
[ "pytube.YouTube" ]
[((27, 76), 'pytube.YouTube', 'YouTube', (['"""http://youtube.com/watch?v=9bZkp7q19f0"""'], {}), "('http://youtube.com/watch?v=9bZkp7q19f0')\n", (34, 76), False, 'from pytube import YouTube\n')]
from app import app app.run(host='0.0.0.0', port="5000")
[ "app.app.run" ]
[((21, 57), 'app.app.run', 'app.run', ([], {'host': '"""0.0.0.0"""', 'port': '"""5000"""'}), "(host='0.0.0.0', port='5000')\n", (28, 57), False, 'from app import app\n')]
from django.contrib.auth import get_user_model from .enums import LogReason, LogStatus from .models import Log class MandrillLogger(): REASON_TRANSLATOR = { 'hard-bounce': LogReason.HARD_BOUNCE, 'soft-bounce': LogReason.SOFT_BOUNCE, 'spam': LogReason.SPAM, 'unsub': LogReason.UNSUB...
[ "django.contrib.auth.get_user_model" ]
[((1814, 1830), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (1828, 1830), False, 'from django.contrib.auth import get_user_model\n')]
from talon import Context ctx = Context() ctx.matches = r""" tag: user.vim_ultisnips mode: user.markdown mode: command and code.language: markdown """ # spoken name -> ultisnips snippet name ctx.lists["user.snippets"] = { # Sections and Paragraphs # "section": "sec", "sub section": "ssec", "sub sub sec...
[ "talon.Context" ]
[((33, 42), 'talon.Context', 'Context', ([], {}), '()\n', (40, 42), False, 'from talon import Context\n')]
from django.db import models from community.models import Community from root import settings """ Subscription object model """ class Subscription(models.Model): user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.PROTECT, blank=False, null=False, db_index=True) community = models.ForeignKey...
[ "django.db.models.ForeignKey", "django.db.models.DateTimeField" ]
[((177, 291), 'django.db.models.ForeignKey', 'models.ForeignKey', (['settings.AUTH_USER_MODEL'], {'on_delete': 'models.PROTECT', 'blank': '(False)', 'null': '(False)', 'db_index': '(True)'}), '(settings.AUTH_USER_MODEL, on_delete=models.PROTECT, blank\n =False, null=False, db_index=True)\n', (194, 291), False, 'from...
from rest_framework import serializers from SIFUser.serializer import UserSerializer from .models import StudentVillage class StudentVillageSerializer(serializers.ModelSerializer): managers = UserSerializer(many=True) dormrooms = serializers.PrimaryKeyRelatedField(many=True, read_only=True) class Meta:...
[ "rest_framework.serializers.PrimaryKeyRelatedField", "SIFUser.serializer.UserSerializer" ]
[((200, 225), 'SIFUser.serializer.UserSerializer', 'UserSerializer', ([], {'many': '(True)'}), '(many=True)\n', (214, 225), False, 'from SIFUser.serializer import UserSerializer\n'), ((242, 303), 'rest_framework.serializers.PrimaryKeyRelatedField', 'serializers.PrimaryKeyRelatedField', ([], {'many': '(True)', 'read_onl...
import argparse import vulncat import logging import os loglevel='DEBUG' logpath=f'{os.getcwd()}/log' # create the log directory if it does not exist if os.path.exists(logpath) == False: os.mkdir(logpath) logging.basicConfig( level=loglevel, filename=f'{logpath}/app.log', format='%(asctime)s - %(levelna...
[ "os.mkdir", "argparse.ArgumentParser", "logging.basicConfig", "os.getcwd", "vulncat.scrape_filters", "os.path.exists" ]
[((208, 369), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'loglevel', 'filename': 'f"""{logpath}/app.log"""', 'format': '"""%(asctime)s - %(levelname)s - %(message)s"""', 'datefmt': '"""%a, %d %b %Y %H:%M:%S"""'}), "(level=loglevel, filename=f'{logpath}/app.log', format=\n '%(asctime)s - %(levelname...
#!/usr/bin/env python3 import json import base64 import random from io import BytesIO import socket from binascii import unhexlify, hexlify # Trusting SeedSigner's embit library # https://github.com/SeedSigner/embit from embit import bip32 from embit import bip39 from embit import wordlists from embit import script f...
[ "io.BytesIO", "embit.bip32.detect_version", "embit.bip39.mnemonic_from_bytes", "socket.socket", "flask.Flask", "random.randbytes", "embit.bip39.mnemonic_to_seed", "flask.render_template", "embit.bip32.HDKey.from_seed" ]
[((524, 539), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (529, 539), False, 'from flask import Flask, render_template, request\n'), ((753, 802), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (766, 802), False, 'import socket\...
# -*- coding: utf-8 -*- # Generated by Django 1.11.8 on 2018-02-07 21:09 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('auth',...
[ "django.db.models.OneToOneField", "django.db.migrations.swappable_dependency", "django.db.models.CharField", "django.db.models.ForeignKey", "django.db.models.BooleanField", "django.db.models.EmailField", "django.db.models.AutoField", "django.db.models.DateTimeField" ]
[((369, 426), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (400, 426), False, 'from django.db import migrations, models\n'), ((560, 710), 'django.db.models.OneToOneField', 'models.OneToOneField', ([], {'editable': '(F...
#!/usr/bin/env python3 import os import sys import json in_fmt = '%d.in' out_fmt = '%d.out' def get_test(path, test_num, test_fmt): return os.path.join(path, 'tests', test_fmt % test_num) def testerize(path): src_prob = json.loads(open(os.path.join(path, 'problem.json'), 'r').read())['problem'] dst_prob...
[ "os.path.join", "json.dumps" ]
[((146, 194), 'os.path.join', 'os.path.join', (['path', '"""tests"""', '(test_fmt % test_num)'], {}), "(path, 'tests', test_fmt % test_num)\n", (158, 194), False, 'import os\n'), ((695, 728), 'os.path.join', 'os.path.join', (['path', '"""checker.cpp"""'], {}), "(path, 'checker.cpp')\n", (707, 728), False, 'import os\n'...
#!/usr/bin/env python #-*- coding:utf-8 -*- """ File Name: setup.py Author: gadfy """ from setuptools import setup, find_packages #这个包没有的可以pip一下 with open("README.md", "r", encoding="utf-8") as f: long_description = f.read() setup( name = "samebirthdayrate", #这里是pip项目发布的名称 version = "1.0...
[ "setuptools.find_packages" ]
[((647, 662), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (660, 662), False, 'from setuptools import setup, find_packages\n')]
# -*- coding: utf-8 -*- from __future__ import unicode_literals try: from unittest.mock import patch, Mock except ImportError: from mock import patch, Mock import unittest import logging import os import tempfile from contextlib import contextmanager import six from v8cffi.platform import platform from v8c...
[ "tempfile.NamedTemporaryFile", "os.remove", "v8cffi.vm.VM", "mock.patch.object", "v8cffi.context.Context", "v8cffi.context._String", "mock.patch", "six.text_type", "logging.disable", "mock.Mock", "v8cffi.context.ffi.new", "v8cffi.context.ffi.typeof" ]
[((396, 429), 'logging.disable', 'logging.disable', (['logging.CRITICAL'], {}), '(logging.CRITICAL)\n', (411, 429), False, 'import logging\n'), ((2961, 3002), 'tempfile.NamedTemporaryFile', 'tempfile.NamedTemporaryFile', ([], {'delete': '(False)'}), '(delete=False)\n', (2988, 3002), False, 'import tempfile\n'), ((2227,...
#!/usr/bin/python3 #+-+-+-+-+-+-+-+-+-+-+-+ #|R|i|c|e|L|e|e|.|c|o|m| #+-+-+-+-+-+-+-+-+-+-+-+ # Copyright (c) 2021, <EMAIL> # All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # # Origin: p111 at https://hackspace.raspberrypi.org/books/micropython...
[ "utime.sleep", "machine.ADC" ]
[((370, 404), 'machine.ADC', 'machine.ADC', (['machine.ADC.CORE_TEMP'], {}), '(machine.ADC.CORE_TEMP)\n', (381, 404), False, 'import machine\n'), ((650, 665), 'utime.sleep', 'utime.sleep', (['(10)'], {}), '(10)\n', (661, 665), False, 'import utime\n')]
# Generated by Django 3.2 on 2021-04-18 06:36 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Meal', fields=[ ('id', models.BigAutoField(au...
[ "django.db.models.BigAutoField", "django.db.models.CharField", "django.db.models.SlugField" ]
[((298, 394), '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", (317, 394), False, 'from django.db import migrations, m...
# -*- coding: utf-8 -*- """ Created on Mon Dec 10 11:32:52 2018 @author: Eric """ import glob import pandas as pd files = glob.glob("./split_files/*.csv") for file_name in files: new_name = file_name.split(".csv")[0] + '.json' df = pd.read_csv(file_name, engine = 'python', encoding = 'utf-8') ...
[ "pandas.read_csv", "glob.glob" ]
[((133, 165), 'glob.glob', 'glob.glob', (['"""./split_files/*.csv"""'], {}), "('./split_files/*.csv')\n", (142, 165), False, 'import glob\n'), ((256, 313), 'pandas.read_csv', 'pd.read_csv', (['file_name'], {'engine': '"""python"""', 'encoding': '"""utf-8"""'}), "(file_name, engine='python', encoding='utf-8')\n", (267, ...
"""Test that types defined in shared libraries work correctly.""" import lldb import unittest2 from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * import lldbsuite.test.lldbutil as lldbutil class SharedLibTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) def setUp(self...
[ "lldbsuite.test.lldbutil.run_break_set_by_symbol", "lldbsuite.test.lldbutil.run_break_set_by_file_and_line", "lldbsuite.test.lldbutil.check_breakpoint", "lldbsuite.test.lldbutil.get_stack_frames" ]
[((1372, 1475), 'lldbsuite.test.lldbutil.run_break_set_by_file_and_line', 'lldbutil.run_break_set_by_file_and_line', (['self', '"""foo.c"""', '(4)'], {'num_expected_locations': '(1)', 'loc_exact': '(True)'}), "(self, 'foo.c', 4,\n num_expected_locations=1, loc_exact=True)\n", (1411, 1475), True, 'import lldbsuite.te...
import os import pathlib import platform import subprocess import unittest # Ensure we're running in the correct folder so we don't destroy anything important cwd = pathlib.Path(os.getcwd()) if cwd.name == "SenSchema": os.chdir("test") cwd = pathlib.Path(os.getcwd()) assert cwd.name == "test" assert cwd.paren...
[ "subprocess.run", "unittest.TextTestRunner", "os.getcwd", "pathlib.Path", "unittest.TestLoader", "os.link", "platform.system", "os.symlink", "os.chdir" ]
[((356, 373), 'platform.system', 'platform.system', ([], {}), '()\n', (371, 373), False, 'import platform\n'), ((945, 963), 'os.chdir', 'os.chdir', (['"""cs3tbl"""'], {}), "('cs3tbl')\n", (953, 963), False, 'import os\n'), ((1092, 1219), 'subprocess.run', 'subprocess.run', (["[executable_file, '-t', 'python', '--python...
# Generated by Django 3.0.3 on 2020-02-29 14:20 import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("Dormroom", "0004_auto_20200229_1420"), ("SIFUser", "0005_merge_20200228_1005"), ] operations = [ mi...
[ "django.db.models.ForeignKey" ]
[((419, 605), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'blank': '(True)', 'help_text': '"""Kollektivet personen bor i"""', 'null': '(True)', 'on_delete': 'django.db.models.deletion.SET_NULL', 'related_name': '"""residents"""', 'to': '"""Dormroom.Dormroom"""'}), "(blank=True, help_text='Kollektivet pers...
import uuid from datetime import datetime from typing import Optional, List import pydantic from sqlalchemy import Column, JSON from sqlmodel import Field, Relationship from api.db.models.base import BaseModel, BaseTable class SchemaDef(pydantic.BaseModel): id: Optional[str] = None name: Optional[str] = Non...
[ "sqlmodel.Relationship", "sqlmodel.Field", "sqlalchemy.Column" ]
[((614, 634), 'sqlmodel.Field', 'Field', ([], {'nullable': '(True)'}), '(nullable=True)\n', (619, 634), False, 'from sqlmodel import Field, Relationship\n'), ((846, 884), 'sqlmodel.Relationship', 'Relationship', ([], {'back_populates': '"""sandbox"""'}), "(back_populates='sandbox')\n", (858, 884), False, 'from sqlmodel...
import random class MagicMissile: def __init__(self, spell_slot_lvl, spell_mode): try: self.lvl = int(spell_slot_lvl) except: raise TypeError("spell_slot_level should be an integer") if spell_mode == "roll_die" or spell_mode == "roll_dice": self...
[ "random.randint" ]
[((798, 818), 'random.randint', 'random.randint', (['(1)', '(4)'], {}), '(1, 4)\n', (812, 818), False, 'import random\n')]
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import datetime import markupfield.fields from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] ...
[ "django.db.models.TextField", "django.db.migrations.swappable_dependency", "django.db.models.CharField", "django.db.models.ForeignKey", "django.db.models.FloatField", "django.db.models.BooleanField", "django.db.models.AutoField", "django.db.models.DateTimeField" ]
[((252, 309), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (283, 309), False, 'from django.db import models, migrations\n'), ((448, 541), 'django.db.models.AutoField', 'models.AutoField', ([], {'verbose_name': '"""ID"...
#!/usr/bin/env python import logging import tornado import tornado.web from tornado import httpserver from tornado import ioloop from tornado import websocket import os import sys import json import webbrowser import nbformat from queue import Queue from .execute import ThreadedExecutor from .cells import Executable...
[ "json.loads", "logging.basicConfig", "tornado.ioloop.IOLoop.instance", "tornado.ioloop.PeriodicCallback", "json.dumps", "logging.info", "os.path.split", "tornado.web.Application", "queue.Queue" ]
[((7401, 7440), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (7420, 7440), False, 'import logging\n'), ((7724, 7777), 'logging.info', 'logging.info', (['"""STARTED: Server started and listening"""'], {}), "('STARTED: Server started and listening')\n", (7736, 7...
import torch import torch.nn as nn from torchvision.datasets import CIFAR10 from torch.optim import Adam from torchvision.models import resnet50 from torch.utils.data import DataLoader import torchvision.transforms as transforms from torch.utils.tensorboard import SummaryWriter import torch.nn.functional as F import os...
[ "os.mkdir", "torch.argmax", "torchvision.datasets.CIFAR10", "torchvision.transforms.Normalize", "torch.no_grad", "torch.utils.data.DataLoader", "os.path.exists", "torch.utils.tensorboard.SummaryWriter", "torch.nn.Linear", "torchvision.transforms.RandomHorizontalFlip", "torchvision.models.resnet5...
[((2759, 2830), 'torchvision.datasets.CIFAR10', 'CIFAR10', ([], {'root': 'cifar_10_dir', 'train': '(True)', 'transform': 'train_data_preprocess'}), '(root=cifar_10_dir, train=True, transform=train_data_preprocess)\n', (2766, 2830), False, 'from torchvision.datasets import CIFAR10\n'), ((2846, 2918), 'torchvision.datase...
import discord from discord import app_commands from discord.ext import commands class owner(commands.Cog): def __init__(self, bot: commands.Bot) -> None: self.bot = bot @app_commands.command(name='eval', description='evaluate') async def eval(self, interaction: discord.Interaction, code: str) ->...
[ "discord.app_commands.command", "src.perms.perms" ]
[((190, 247), 'discord.app_commands.command', 'app_commands.command', ([], {'name': '"""eval"""', 'description': '"""evaluate"""'}), "(name='eval', description='evaluate')\n", (210, 247), False, 'from discord import app_commands\n'), ((769, 838), 'discord.app_commands.command', 'app_commands.command', ([], {'name': '""...
from astropy import cosmology as cosmo import autofit as af from autoarray import preloads as pload from autoarray.exc import PixelizationException, InversionException, GridException from autoarray.inversion import pixelizations as pix, inversions as inv from autofit.exc import FitException from autogalaxy.anal...
[ "autogalaxy.analysis.visualizer.Visualizer", "autogalaxy.plane.plane.Plane", "autoarray.inversion.pixelizations.SettingsPixelization", "autogalaxy.fit.fit_imaging.FitImaging", "autogalaxy.analysis.result.ResultInterferometer", "autogalaxy.analysis.result.ResultImaging", "autogalaxy.fit.fit_interferomete...
[((908, 934), 'autoarray.inversion.pixelizations.SettingsPixelization', 'pix.SettingsPixelization', ([], {}), '()\n', (932, 934), True, 'from autoarray.inversion import pixelizations as pix, inversions as inv\n'), ((964, 987), 'autoarray.inversion.inversions.SettingsInversion', 'inv.SettingsInversion', ([], {}), '()\n'...
from django.shortcuts import render from django.urls import reverse_lazy from customer.owner import * from .filters import * from .forms import * # class CustomerIndexView(LoginRequiredMixin, View): # login_url = '/login/' # redirect_field_name = 'redirect_to' class CustomerCreateView(OwnerCreateView): ...
[ "django.shortcuts.render", "django.urls.reverse_lazy" ]
[((502, 540), 'django.urls.reverse_lazy', 'reverse_lazy', (['"""customer:customer_list"""'], {}), "('customer:customer_list')\n", (514, 540), False, 'from django.urls import reverse_lazy\n'), ((976, 1014), 'django.urls.reverse_lazy', 'reverse_lazy', (['"""customer:customer_list"""'], {}), "('customer:customer_list')\n"...
from selenium import webdriver from selenium.webdriver.common.by import By from pageObjects.footer import Footer from utilities.customLogger import LogGen from utilities.siteConfig import siteconfig from selenium.common.exceptions import ElementNotInteractableException import pandas as pd import time class Test_1: ...
[ "pandas.DataFrame", "utilities.siteConfig.siteconfig.getfooterXPATH", "utilities.customLogger.LogGen.loggen", "time.sleep", "pageObjects.footer.Footer", "utilities.siteConfig.siteconfig.getsiteURl", "pandas.ExcelWriter" ]
[((332, 355), 'utilities.siteConfig.siteconfig.getsiteURl', 'siteconfig.getsiteURl', ([], {}), '()\n', (353, 355), False, 'from utilities.siteConfig import siteconfig\n'), ((373, 400), 'utilities.siteConfig.siteconfig.getfooterXPATH', 'siteconfig.getfooterXPATH', ([], {}), '()\n', (398, 400), False, 'from utilities.sit...
import concurrent.futures import logging import logging.handlers import os import re import shutil import sys import time import urllib import htsget import psutil from tqdm import tqdm from pyega3.libs import utils DOWNLOAD_FILE_MEMORY_BUFFER_SIZE = 32 * 1024 class DataFile: DEFAULT_SLICE_SIZE = 100 * 1024 * ...
[ "os.remove", "htsget.get", "pyega3.libs.utils.md5", "shutil.rmtree", "os.path.join", "logging.error", "os.path.abspath", "logging.warning", "os.path.dirname", "os.path.exists", "pyega3.libs.utils.merge_bin_files_on_disk", "pyega3.libs.utils.get_fname_md5", "urllib.parse.urlencode", "os.pat...
[((3521, 3665), 'logging.info', 'logging.info', (['f"""Download starting [using {num_connections} connection(s), file size {file_size} and chunk length {max_slice_size}]..."""'], {}), "(\n f'Download starting [using {num_connections} connection(s), file size {file_size} and chunk length {max_slice_size}]...'\n )\...
#!/usr/local/bin/python3.4 # # run.cgi -- run steps of the GISTEMP algorithm # # <NAME>, 2009-12-08 # <NAME>, Revision 2016-01-06 """run.cgi [options] -- run steps of the GISTEMP algorithm. Options: --help Print this text. --steps=STEPS Specify which steps to run, as a comma-separated list of ...
[ "gio.step3_output", "extension.step1.post_step1", "optparse.OptionParser", "gio.step4_input", "gio.step0_output", "gio.step5_input", "gio.step0_input", "os.path.abspath", "steps.step4.step4", "fetch.Fetcher", "os.path.exists", "steps.step5.step5", "steps.step1.step1", "steps.step3.step3", ...
[((1061, 1072), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (1070, 1072), False, 'import os\n'), ((2164, 2181), 'steps.step0.step0', 'step0.step0', (['data'], {}), '(data)\n', (2175, 2181), False, 'from steps import step0\n'), ((2193, 2217), 'gio.step0_output', 'gio.step0_output', (['result'], {}), '(result)\n', (2209,...
# -*- coding: utf-8 -*- # -------------------------------------------------------------------- # The MIT License (MIT) # # Copyright (c) 2016 <NAME> <<EMAIL>> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal...
[ "inspect.getsourcelines", "b3j0f.utils.path.lookup", "inspect.isclass", "b3j0f.utils.version.OrderedDict", "inspect.getargspec", "functools.wraps", "six.get_function_globals", "inspect.isbuiltin" ]
[((9501, 9514), 'b3j0f.utils.version.OrderedDict', 'OrderedDict', ([], {}), '()\n', (9512, 9514), False, 'from b3j0f.utils.version import OrderedDict\n'), ((14499, 14510), 'functools.wraps', 'wraps', (['func'], {}), '(func)\n', (14504, 14510), False, 'from functools import wraps\n'), ((2220, 2238), 'inspect.isclass', '...
#!/usr/bin/env python # coding: utf-8 # Copyright (c) Qotto, 2019 import uuid import pytest from tonga.services.coordinator.partitioner.statefulset_partitioner import StatefulsetPartitioner from tonga.errors import OutsideInstanceNumber def test_statefulset_partitioner_with_str_uuid_key(): statefulset_partition...
[ "pytest.raises", "uuid.uuid4", "tonga.services.coordinator.partitioner.statefulset_partitioner.StatefulsetPartitioner" ]
[((325, 359), 'tonga.services.coordinator.partitioner.statefulset_partitioner.StatefulsetPartitioner', 'StatefulsetPartitioner', ([], {'instance': '(1)'}), '(instance=1)\n', (347, 359), False, 'from tonga.services.coordinator.partitioner.statefulset_partitioner import StatefulsetPartitioner\n'), ((560, 596), 'tonga.ser...
#!/usr/bin/python """ TempMAGE model architecture """ import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers from tensorflow.keras.layers import Conv2D,MaxPool2D,Flatten,Conv1D,MaxPooling1D,Dense,Dropout def set_metrics(): """ metrics used to evaluate the model's perfromance ""...
[ "tensorflow.keras.layers.MaxPooling2D", "tensorflow.keras.layers.Dense", "tensorflow.keras.metrics.FalseNegatives", "tensorflow.keras.layers.concatenate", "tensorflow.keras.metrics.BinaryAccuracy", "tensorflow.keras.layers.Flatten", "tensorflow.keras.regularizers.l2", "tensorflow.keras.Input", "tens...
[((1054, 1106), 'tensorflow.keras.Input', 'keras.Input', ([], {'shape': '(400, 5, 1)', 'name': '"""sequence_conv"""'}), "(shape=(400, 5, 1), name='sequence_conv')\n", (1065, 1106), False, 'from tensorflow import keras\n'), ((1888, 1929), 'tensorflow.keras.Input', 'keras.Input', ([], {'shape': '(400, 1)', 'name': '"""de...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on 22/11/2018 @author: XXX """ import unittest import os, shutil from RecSysFramework.Recommender.NonPersonalized import TopPop, Random, GlobalEffects from RecSysFramework.Recommender.KNN import UserKNNCF from RecSysFramework.Recommender.KNN import ItemKNNC...
[ "unittest.main", "os.makedirs", "RecSysFramework.DataManager.Splitter.Holdout", "RecSysFramework.Evaluation.Evaluator.EvaluatorHoldout", "RecSysFramework.DataManager.Reader.Movielens1MReader", "shutil.rmtree" ]
[((4648, 4663), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4661, 4663), False, 'import unittest\n'), ((1321, 1380), 'RecSysFramework.DataManager.Splitter.Holdout', 'Holdout', ([], {'train_perc': '(0.8)', 'test_perc': '(0.2)', 'validation_perc': '(0.0)'}), '(train_perc=0.8, test_perc=0.2, validation_perc=0.0)\...
from django import setup setup() from scts.factory.build_app import build_app # noqa app = build_app()
[ "scts.factory.build_app.build_app", "django.setup" ]
[((26, 33), 'django.setup', 'setup', ([], {}), '()\n', (31, 33), False, 'from django import setup\n'), ((95, 106), 'scts.factory.build_app.build_app', 'build_app', ([], {}), '()\n', (104, 106), False, 'from scts.factory.build_app import build_app\n')]
import uvicorn uvicorn.run("bc_website.app:app", host="localhost", port=5000, reload=True)
[ "uvicorn.run" ]
[((17, 92), 'uvicorn.run', 'uvicorn.run', (['"""bc_website.app:app"""'], {'host': '"""localhost"""', 'port': '(5000)', 'reload': '(True)'}), "('bc_website.app:app', host='localhost', port=5000, reload=True)\n", (28, 92), False, 'import uvicorn\n')]
import argparse import list import depth VERSION = '1.0.2' def main(): parser = argparse.ArgumentParser() parser.add_argument('--version', action='version', version=VERSION) subparsers = parser.add_subparsers() list.init(subparsers) depth.init(subparsers) args = parser.parse_args() arg...
[ "list.init", "depth.init", "argparse.ArgumentParser" ]
[((87, 112), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (110, 112), False, 'import argparse\n'), ((232, 253), 'list.init', 'list.init', (['subparsers'], {}), '(subparsers)\n', (241, 253), False, 'import list\n'), ((258, 280), 'depth.init', 'depth.init', (['subparsers'], {}), '(subparsers)\n...
#!/usr/local/bin/python3 """ This program takes a filename as input and displays the count for each word length, ignoring punctuation and non-alphanumeric characters. """ import re, sys word_table = {} with open(sys.argv[1]) as f: for line in f: for word in line.split(): stripped = re.sub("[...
[ "re.sub" ]
[((311, 341), 're.sub', 're.sub', (['"""[^a-zA-Z ]"""', '""""""', 'word'], {}), "('[^a-zA-Z ]', '', word)\n", (317, 341), False, 'import re, sys\n')]
# Copyright 2018 The Google AI Language Team Authors and # The HuggingFace Inc. team. # Copyright (c) 2020, <NAME>. 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 # # ...
[ "sklearn.metrics.f1_score", "sklearn.metrics.matthews_corrcoef", "scipy.stats.pearsonr", "scipy.stats.spearmanr" ]
[((1049, 1086), 'sklearn.metrics.f1_score', 'f1_score', ([], {'y_true': 'labels', 'y_pred': 'preds'}), '(y_true=labels, y_pred=preds)\n', (1057, 1086), False, 'from sklearn.metrics import f1_score, matthews_corrcoef\n'), ((1193, 1225), 'sklearn.metrics.matthews_corrcoef', 'matthews_corrcoef', (['labels', 'preds'], {}),...
""" There are two useful functions: 1. correlationCoef will tell you the coreelation coefficient of two patches of same size the greater this coefficient is, the similar this two patches are. 2. matchTemplate will automatically go through the whole input 'img' with a sliding window and implement corre...
[ "numpy.std", "numpy.cov", "numpy.zeros" ]
[((938, 948), 'numpy.std', 'np.std', (['g1'], {}), '(g1)\n', (944, 948), True, 'import numpy as np\n'), ((960, 970), 'numpy.std', 'np.std', (['g2'], {}), '(g2)\n', (966, 970), True, 'import numpy as np\n'), ((1030, 1052), 'numpy.cov', 'np.cov', (['array1', 'array2'], {}), '(array1, array2)\n', (1036, 1052), True, 'impo...
'''Train CIFAR10 with PyTorch.''' import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F import torch.backends.cudnn as cudnn import torchvision import torchvision.transforms as transforms import os import argparse from sklearn.metrics import classification_report import pandas ...
[ "torch.optim.lr_scheduler.StepLR", "datasets.market1501.load_train_data", "argparse.ArgumentParser", "os.makedirs", "torch.nn.CrossEntropyLoss", "os.path.exists", "sklearn.metrics.classification_report", "torchvision.models.resnet50", "torch.cuda.is_available", "torch.nn.Linear", "optuna.create_...
[((446, 487), 'optuna.create_study', 'optuna.create_study', ([], {'direction': '"""maximize"""'}), "(direction='maximize')\n", (465, 487), False, 'import optuna\n'), ((1118, 1174), 'datasets.market1501.load_train_data', 'market1501.load_train_data', (['args.anno_path', 'args.n_batch'], {}), '(args.anno_path, args.n_bat...
import discord from discord.ext import commands import aiohttp import requests class Image(commands.Cog, name='Image'): def __init__(self, bot): self.bot = bot @commands.command() @commands.cooldown(1, 10, commands.BucketType.user) async def cat(self, ctx): """Gives You Random Image O...
[ "aiohttp.ClientSession", "discord.ext.commands.cooldown", "discord.ext.commands.command", "discord.Embed" ]
[((180, 198), 'discord.ext.commands.command', 'commands.command', ([], {}), '()\n', (196, 198), False, 'from discord.ext import commands\n'), ((204, 254), 'discord.ext.commands.cooldown', 'commands.cooldown', (['(1)', '(10)', 'commands.BucketType.user'], {}), '(1, 10, commands.BucketType.user)\n', (221, 254), False, 'f...
import os from oss_client.utils import content_md5 class FileObject(object): def __init__(self, name="", obj=None, hash_value=None, storage=None): if not (obj or hash_value): raise ValueError("obj and hash_value both are None") self.obj = obj self.name = name self.suffi...
[ "oss_client.utils.content_md5" ]
[((666, 686), 'oss_client.utils.content_md5', 'content_md5', (['content'], {}), '(content)\n', (677, 686), False, 'from oss_client.utils import content_md5\n')]
from matplotlib import pyplot as plt from ibm_botocore.client import Config, ClientError import rasterio import random import ibm_boto3 def plot_random_blocks(bucket, item, num): """ Plot num random blocks from IBM COS item located at bucket """ fig, axs = plt.subplots(num, figsize=(20,30)) co...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.subplot", "rasterio.open", "matplotlib.pyplot.show", "matplotlib.pyplot.imshow", "matplotlib.pyplot.colorbar", "matplotlib.pyplot.figure", "ibm_botocore.client.Config", "matplotlib.pyplot.gca", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", ...
[((279, 314), 'matplotlib.pyplot.subplots', 'plt.subplots', (['num'], {'figsize': '(20, 30)'}), '(num, figsize=(20, 30))\n', (291, 314), True, 'from matplotlib import pyplot as plt\n'), ((930, 940), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (938, 940), True, 'from matplotlib import pyplot as plt\n'), ((17...
import pytest import numpy as np from scipy.integrate import trapz from newdust.graindist import * from . import percent_diff MD = 1.e-5 # g cm^-2 RHO = 3.0 # g c^-3 SDEFAULT = 'Powerlaw' CDEFAULT = 'Silicate' ALLOWED_SIZES = ['Grain','Powerlaw','ExpCutoff'] ALLOWED_COMPS = ['Drude','Silicate','Graphite'] # T...
[ "pytest.mark.parametrize", "pytest.raises", "scipy.integrate.trapz" ]
[((368, 417), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""sstring"""', 'ALLOWED_SIZES'], {}), "('sstring', ALLOWED_SIZES)\n", (391, 417), False, 'import pytest\n'), ((526, 575), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""cstring"""', 'ALLOWED_COMPS'], {}), "('cstring', ALLOWED_COMPS)\n"...
#imported the Stack.py from Stack import Stack def intToBinary(num: int) -> str : stack = Stack() while num > 0: remender = num % 2 stack.push(remender) num = num // 2 binary = "" while not stack.is_empty(): binary += str(stack.pop()) return binary num = int(inp...
[ "Stack.Stack" ]
[((97, 104), 'Stack.Stack', 'Stack', ([], {}), '()\n', (102, 104), False, 'from Stack import Stack\n')]
# Copyright 2014 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
[ "unittest.TextTestRunner", "djhelpers.adminhelpers.ActionDecorator", "djhelpers.modelhelpers.short_description", "unittest.TestLoader" ]
[((872, 902), 'djhelpers.modelhelpers.short_description', 'short_description', (['description'], {}), '(description)\n', (889, 902), False, 'from djhelpers.modelhelpers import short_description\n'), ((1328, 1387), 'djhelpers.modelhelpers.short_description', 'short_description', (['description'], {'boolean': 'mock.senti...
from PyQt5.QtCore import * from PyQt5.QtWidgets import * from PyQt5.QtGui import * import requests apiserver = "" class ListView(QWidget): def __init__(self, parent=None): super(ListView, self).__init__(parent) self.setWindowTitle('Asphodel Downloader Test Client') self.resize(400, 100) ...
[ "requests.get" ]
[((1411, 1460), 'requests.get', 'requests.get', (['"""http://192.168.127.12:7474/savedb"""'], {}), "('http://192.168.127.12:7474/savedb')\n", (1423, 1460), False, 'import requests\n'), ((717, 770), 'requests.get', 'requests.get', (['"""http://192.168.127.12:7474/publicchat"""'], {}), "('http://192.168.127.12:7474/publi...
from django.contrib import admin from .models import Project,Profile,Review,Comment # Register your models here. class ReviewAdmin(admin.ModelAdmin): model = Review list_display = ('wine', 'rating', 'user_name', 'comment', 'pub_date') list_filter = ['pub_date', 'user_name'] search_fields = ['comment'] ...
[ "django.contrib.admin.site.register" ]
[((321, 349), 'django.contrib.admin.site.register', 'admin.site.register', (['Project'], {}), '(Project)\n', (340, 349), False, 'from django.contrib import admin\n'), ((350, 378), 'django.contrib.admin.site.register', 'admin.site.register', (['Profile'], {}), '(Profile)\n', (369, 378), False, 'from django.contrib impor...
from abc import ABC import chainer import chainer.functions as F import chainer.links as L class AbstractModel(ABC): def predict(self, blob): pass class DefaultModel: def __init__(self, n_units=100, n_out=6, colors=('red', 'blue', 'green', 'cyan', 'magenta', 'yellow')): self.n_units = n_uni...
[ "chainer.links.Linear" ]
[((480, 502), 'chainer.links.Linear', 'L.Linear', (['self.n_units'], {}), '(self.n_units)\n', (488, 502), True, 'import chainer.links as L\n'), ((565, 585), 'chainer.links.Linear', 'L.Linear', (['self.n_out'], {}), '(self.n_out)\n', (573, 585), True, 'import chainer.links as L\n')]
from collections import Counter from notify_run import Notify import os import time import dropbox import json dropboxkey="" notify = Notify() notifyendpoint="" notify.endpoint=notifyendpoint notify.write_config() from flask import Flask,request maindictionary={} dbx = dropbox.Dropbox(dropboxkey) dbx.files_download_to...
[ "flask.request.args.get", "dropbox.Dropbox", "flask.Flask", "json.dumps", "time.time", "notify_run.Notify", "os.environ.get" ]
[((134, 142), 'notify_run.Notify', 'Notify', ([], {}), '()\n', (140, 142), False, 'from notify_run import Notify\n'), ((271, 298), 'dropbox.Dropbox', 'dropbox.Dropbox', (['dropboxkey'], {}), '(dropboxkey)\n', (286, 298), False, 'import dropbox\n'), ((493, 508), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n'...
import sys from pathlib import Path sys.path.append(str(Path(".").absolute().parent)) from sheet2dict import Worksheet from io import BytesIO ws = Worksheet() ws.xlsx_to_dict(path="inventory.xlsx") print(">>", ws.header) print("ALL:", ws.sheet_items) print("SANITIZED:", ws.sanitize_sheet_items) path = "inventory....
[ "pathlib.Path", "sheet2dict.Worksheet" ]
[((151, 162), 'sheet2dict.Worksheet', 'Worksheet', ([], {}), '()\n', (160, 162), False, 'from sheet2dict import Worksheet\n'), ((399, 410), 'sheet2dict.Worksheet', 'Worksheet', ([], {}), '()\n', (408, 410), False, 'from sheet2dict import Worksheet\n'), ((473, 484), 'sheet2dict.Worksheet', 'Worksheet', ([], {}), '()\n',...
import sys from MyStrategy import MyStrategy from RemoteProcessClient import RemoteProcessClient from model.Move import Move from time import sleep class Runner: def __init__(self): sleep(4) if sys.argv.__len__() == 4: self.remote_process_client = RemoteProcessClient(sys.argv[1], int(s...
[ "MyStrategy.MyStrategy", "sys.argv.__len__", "RemoteProcessClient.RemoteProcessClient", "time.sleep", "model.Move.Move" ]
[((196, 204), 'time.sleep', 'sleep', (['(4)'], {}), '(4)\n', (201, 204), False, 'from time import sleep\n'), ((216, 234), 'sys.argv.__len__', 'sys.argv.__len__', ([], {}), '()\n', (232, 234), False, 'import sys\n'), ((425, 464), 'RemoteProcessClient.RemoteProcessClient', 'RemoteProcessClient', (['"""localhost"""', '(31...
''' Controllers/Bindings/table __________________________ Class with designed inheritance for copy/paste methods. :copyright: (c) 2015 The Regents of the University of California. :license: GNU GPL, see licenses/GNU GPLv3.txt for more details. ''' # load modules/submodules from PySide import QtCo...
[ "xldlib.qt.objects.threads.ContextMutex", "xldlib.onstart.main.APP.clipboard", "xldlib.definitions.partial" ]
[((550, 595), 'xldlib.qt.objects.threads.ContextMutex', 'threads.ContextMutex', (['QtCore.QMutex.Recursive'], {}), '(QtCore.QMutex.Recursive)\n', (570, 595), False, 'from xldlib.qt.objects import base, threads\n'), ((675, 690), 'xldlib.onstart.main.APP.clipboard', 'APP.clipboard', ([], {}), '()\n', (688, 690), False, '...
#Tocando um MP3 from pygame import mixer mixer.init() mixer.music.load('EX021.mp3') #Adicione o nome da musica mixer.music.play()
[ "pygame.mixer.init", "pygame.mixer.music.play", "pygame.mixer.music.load" ]
[((41, 53), 'pygame.mixer.init', 'mixer.init', ([], {}), '()\n', (51, 53), False, 'from pygame import mixer\n'), ((54, 83), 'pygame.mixer.music.load', 'mixer.music.load', (['"""EX021.mp3"""'], {}), "('EX021.mp3')\n", (70, 83), False, 'from pygame import mixer\n'), ((111, 129), 'pygame.mixer.music.play', 'mixer.music.pl...
# Generated by Django 3.1.3 on 2020-12-01 14:32 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('tweets', '0003_auto_2020...
[ "django.db.migrations.swappable_dependency", "django.db.models.ManyToManyField", "django.db.models.ForeignKey", "django.db.models.AutoField", "django.db.models.DateTimeField" ]
[((227, 284), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (258, 284), False, 'from django.db import migrations, models\n'), ((468, 507), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'auto_now_add':...
#!/usr/bin/env python from setuptools import setup from os.path import dirname, abspath, join setup(name='drunkardswalk', packages=['drunkardswalk'], )
[ "setuptools.setup" ]
[((95, 150), 'setuptools.setup', 'setup', ([], {'name': '"""drunkardswalk"""', 'packages': "['drunkardswalk']"}), "(name='drunkardswalk', packages=['drunkardswalk'])\n", (100, 150), False, 'from setuptools import setup\n')]
from docs_snippets.concepts.io_management.subselection import ( execute_full, execute_subselection, ) def test_execute_job(): execute_full() def test_execute_subselection(): execute_subselection()
[ "docs_snippets.concepts.io_management.subselection.execute_subselection", "docs_snippets.concepts.io_management.subselection.execute_full" ]
[((140, 154), 'docs_snippets.concepts.io_management.subselection.execute_full', 'execute_full', ([], {}), '()\n', (152, 154), False, 'from docs_snippets.concepts.io_management.subselection import execute_full, execute_subselection\n'), ((194, 216), 'docs_snippets.concepts.io_management.subselection.execute_subselection...
from datetime import datetime from django.conf import settings from django.core.exceptions import ImproperlyConfigured from requests import HTTPError from rest_framework import status from app.enquiries.common.client import APIClient from app.enquiries.common.hawk import HawkAuth CONSENT_SERVICE_PATH_PERSON = "/api/...
[ "django.core.exceptions.ImproperlyConfigured", "datetime.datetime.now", "app.enquiries.common.hawk.HawkAuth" ]
[((537, 612), 'django.core.exceptions.ImproperlyConfigured', 'ImproperlyConfigured', (['"""CONSENT_SERVICE_* environment variables must be set"""'], {}), "('CONSENT_SERVICE_* environment variables must be set')\n", (557, 612), False, 'from django.core.exceptions import ImproperlyConfigured\n'), ((702, 862), 'app.enquir...
"""Miscellaneous ECG Batch utils.""" import functools import pint import numpy as np from sklearn.preprocessing import LabelBinarizer as LB UNIT_REGISTRY = pint.UnitRegistry() def get_units_conversion_factor(old_units, new_units): """Return a multiplicative factor to convert a measured quantity from old t...
[ "functools.wraps", "pint.UnitRegistry", "numpy.hstack" ]
[((160, 179), 'pint.UnitRegistry', 'pint.UnitRegistry', ([], {}), '()\n', (177, 179), False, 'import pint\n'), ((1308, 1329), 'functools.wraps', 'functools.wraps', (['func'], {}), '(func)\n', (1323, 1329), False, 'import functools\n'), ((2239, 2260), 'numpy.hstack', 'np.hstack', (['(1 - Y, Y)'], {}), '((1 - Y, Y))\n', ...
import pytest from models.parser import Parser def test_new(): pass #TODO #data = '0.123,-0.123,5;0.456,-0.789,0.111;-0.212,0.001,1;' #parser = Parser(data) #assert parser.parsed_data==None # --- Creation Tests --- def test_create_combined_data(): data = '0.123,-0.123,5;0.456,-0.789,0.111;-0.21...
[ "models.parser.Parser" ]
[((345, 357), 'models.parser.Parser', 'Parser', (['data'], {}), '(data)\n', (351, 357), False, 'from models.parser import Parser\n'), ((764, 776), 'models.parser.Parser', 'Parser', (['data'], {}), '(data)\n', (770, 776), False, 'from models.parser import Parser\n'), ((1035, 1047), 'models.parser.Parser', 'Parser', (['d...