code
stringlengths
22
1.05M
apis
listlengths
1
3.31k
extract_api
stringlengths
75
3.25M
from pathlib import Path from sources.datasets.client_dataset_definitions.client_dataset import ClientDataset from sources.datasets.client_dataset_factory_definitions.file_system_based_client_dataset_factory import \ FileSystemBasedClientDatasetFactory from sources.datasets.client_dataset_definitions.client_datase...
[ "sources.datasets.client_dataset_definitions.client_dataset.ClientDataset", "sources.datasets.shakespeare.shakespeare_client_dataset_processor.ShakespeareClientDatasetProcessor", "sources.datasets.client_dataset_definitions.client_dataset_loaders.pickle_file_client_dataset_loader.PickleFileClientDatasetLoader" ...
[((958, 1056), 'sources.datasets.client_dataset_definitions.client_dataset_loaders.pickle_file_client_dataset_loader.PickleFileClientDatasetLoader', 'PickleFileClientDatasetLoader', ([], {'folder_containing_client_datasets': 'self.path_to_client_datasets'}), '(folder_containing_client_datasets=self.\n path_to_client...
import os from setuptools import setup here = os.path.abspath(os.path.dirname(__file__)) about = {} with open(os.path.join(here, 'slocust', '__version__.py'), 'r', encoding='utf-8') as f: exec(f.read(), about) packages = ['slocust'] with open('requirements.txt') as f: requires = f.read().splitlines...
[ "os.path.dirname", "os.path.join" ]
[((63, 88), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (78, 88), False, 'import os\n'), ((111, 158), 'os.path.join', 'os.path.join', (['here', '"""slocust"""', '"""__version__.py"""'], {}), "(here, 'slocust', '__version__.py')\n", (123, 158), False, 'import os\n')]
""" BSD 2-Clause License Copyright (c) 2021, timre13 All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions an...
[ "os.path.realpath", "string.Template", "os.chmod" ]
[((1464, 1690), 'string.Template', 'Template', (['"""[Desktop Entry]\nVersion=1.0\nType=Application\nName=LightMusic\nGenericName=Music Player\nTerminal=false\nExec=sh -c "cd $binDir; ./lightmusic %F"\nIcon=$binDir/img/icon.png\nComment=LightMusic music player\n"""'], {}), '(\n """[Desktop Entry]\nVersion=1.0\nType=...
import os import sys sys.path.insert(0, os.path.abspath( os.path.join(os.path.dirname(__file__), '..'))) import numpy as np import util from ebnn.utils import binary_util if __name__ == '__main__': parser = util.default_parser('MLP Example') args = parser.parse_args() # get the dataset (default is ...
[ "util.default_parser", "ebnn.utils.binary_util.np_to_packed_uint8C", "os.path.dirname", "util.get_dataset", "ebnn.utils.binary_util.np_to_floatC" ]
[((219, 253), 'util.default_parser', 'util.default_parser', (['"""MLP Example"""'], {}), "('MLP Example')\n", (238, 253), False, 'import util\n'), ((345, 375), 'util.get_dataset', 'util.get_dataset', (['args.dataset'], {}), '(args.dataset)\n', (361, 375), False, 'import util\n'), ((667, 746), 'ebnn.utils.binary_util.np...
""" """ import copy import random, sys, time import torch import numpy as np from gmpy2 import mpz, powmod, invert, is_prime, random_state, mpz_urandomb, rint_round, log2, gcd, f_mod, f_div, sub, \ mul, add rand = random_state(random.randrange(sys.maxsize)) digits = 10e8 b = 10 class PrivateKey(obj...
[ "random.randrange", "gmpy2.gcd", "torch.Tensor", "gmpy2.powmod", "torch.from_numpy", "gmpy2.sub", "gmpy2.log2", "gmpy2.mpz_urandomb", "gmpy2.invert", "gmpy2.mul", "gmpy2.is_prime", "time.time", "gmpy2.mpz", "numpy.arange" ]
[((241, 270), 'random.randrange', 'random.randrange', (['sys.maxsize'], {}), '(sys.maxsize)\n', (257, 270), False, 'import random, sys, time\n'), ((1744, 1776), 'gmpy2.powmod', 'powmod', (['cipher', 'priv.l', 'pub.n_sq'], {}), '(cipher, priv.l, pub.n_sq)\n', (1750, 1776), False, 'from gmpy2 import mpz, powmod, invert, ...
from agent.TradingAgent import TradingAgent from util.util import log_print from math import sqrt import numpy as np import pandas as pd class TraderAgent(TradingAgent): def __init__(self, id, name, type, symbol='IBM', starting_cash=100000, log_orders=False, random_state=None): # Base ...
[ "util.util.log_print" ]
[((2913, 3133), 'util.util.log_print', 'log_print', (['"""{} final report. Holdings {}, end cash {}, start cash {}, orders_done {}, orders_received {}"""', 'self.name', 'H', "self.holdings['CASH']", 'self.starting_cash', 'self.placed_orders', 'self.received_orders'], {}), "(\n '{} final report. Holdings {}, end ca...
import pytest import os @pytest.fixture def voila_notebook(notebook_directory): return os.path.join(notebook_directory, 'sleep.ipynb') @pytest.fixture def voila_args_extra(): return ['--VoilaExecutePreprocessor.timeout=1', '--KernelManager.shutdown_wait_time=0.1'] @pytest.mark.gen_test def test_timeout(h...
[ "os.path.join" ]
[((94, 141), 'os.path.join', 'os.path.join', (['notebook_directory', '"""sleep.ipynb"""'], {}), "(notebook_directory, 'sleep.ipynb')\n", (106, 141), False, 'import os\n')]
from abc import ABC, abstractmethod from core import occurs_dispatch, unify_dispatch, extend_substitution, Term, Mismatch from variable import Var from typing import Any, Optional # For now, assume constraints can't contain variables. # We can say things like >0 or >10 & <20, but not <X. class Constraint(ABC): ...
[ "core.Mismatch", "core.unify_dispatch.register" ]
[((484, 518), 'core.unify_dispatch.register', 'unify_dispatch.register', ([], {'swap': '(True)'}), '(swap=True)\n', (507, 518), False, 'from core import occurs_dispatch, unify_dispatch, extend_substitution, Term, Mismatch\n'), ((632, 657), 'core.unify_dispatch.register', 'unify_dispatch.register', ([], {}), '()\n', (65...
import requests, urllib.parse, json from flask import request from models import Language, Product_translation def translateOrder(cookieKey, pageLang): ## This function translates cookie file(Order) to desired language # DONE Check id for specific language lang_id = Language.query.filter_by(name=pageLang)...
[ "json.loads", "json.dumps", "requests.request", "models.Language.query.filter_by", "flask.request.cookies.get", "json.load", "models.Product_translation.query.filter_by" ]
[((373, 406), 'flask.request.cookies.get', 'request.cookies.get', (['cookieKey', '(0)'], {}), '(cookieKey, 0)\n', (392, 406), False, 'from flask import request\n'), ((560, 581), 'json.loads', 'json.loads', (['strCookie'], {}), '(strCookie)\n', (570, 581), False, 'import requests, urllib.parse, json\n'), ((1798, 1815), ...
# Copyright 2017-2018 FUJTISU LIMITED. # All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
[ "osc_lib.exceptions.CommandError", "osc_lib.utils.columns.get_column_definitions", "neutronclient.osc.utils.add_project_owner_option_to_parser", "osc_lib.utils.get_dict_properties", "oslo_log.log.getLogger", "neutronclient.osc.utils.find_project", "copy.deepcopy", "neutronclient._i18n._", "osc_lib.u...
[((1035, 1062), 'oslo_log.log.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1052, 1062), True, 'from oslo_log import log as logging\n'), ((3713, 3742), 'neutronclient._i18n._', '_', (['"""Create a new network log"""'], {}), "('Create a new network log')\n", (3714, 3742), False, 'from neutronclie...
import glob import logging from . import Reader LOG = logging.getLogger(__name__) def load_all(path, recursive=True, scene_type=None, sample=None): """Parsed scenes at the given path returned as a generator. Each scene contains a list of `Row`s where the first pedestrian is the pedestrian of interest. ...
[ "logging.getLogger", "glob.iglob" ]
[((56, 83), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (73, 83), False, 'import logging\n'), ((502, 539), 'glob.iglob', 'glob.iglob', (['path'], {'recursive': 'recursive'}), '(path, recursive=recursive)\n', (512, 539), False, 'import glob\n')]
import numpy as np import vrep import buffer class Script: def __init__(self, my_robot): self.robot = my_robot self.buffer = buffer.ReplayMemory(100) self.client_id = self.robot.client_id self.states = [] self.object_position = None self.euler_angles2 = None ...
[ "vrep.simxSynchronousTrigger", "vrep.simxGetPingTime", "vrep.simxSetObjectOrientation", "numpy.asarray", "numpy.floor", "vrep.simxGetObjectPosition", "numpy.array", "vrep.simxSetObjectPosition", "numpy.random.uniform", "numpy.linalg.norm", "vrep.simxGetObjectOrientation", "buffer.ReplayMemory"...
[((147, 171), 'buffer.ReplayMemory', 'buffer.ReplayMemory', (['(100)'], {}), '(100)\n', (166, 171), False, 'import buffer\n'), ((811, 928), 'vrep.simxGetObjectPosition', 'vrep.simxGetObjectPosition', (['self.robot.client_id', 'self.robot.sawyer_target_handle', '(-1)', 'vrep.simx_opmode_blocking'], {}), '(self.robot.cli...
# ./claml.py # -*- coding: utf-8 -*- # PyXB bindings for NM:e92452c8d3e28a9e27abfc9994d2007779e7f4c9 # Generated 2019-04-05 19:48:40.632175 by PyXB version 1.2.6 using Python 3.6.7.final.0 # Namespace AbsentNamespace0 from __future__ import unicode_literals import pyxb import pyxb.binding import pyxb.binding.saxer imp...
[ "pyxb.utils.domutils.StringToDOM", "pyxb.binding.facets.CF_enumeration", "pyxb.utils.utility.Location", "pyxb.utils.utility.UniqueIdentifier", "pyxb.utils.fac.State", "io.BytesIO", "pyxb.namespace.CreateAbsentNamespace", "pyxb.utils.utility.Object", "pyxb.utils.fac.UpdateInstruction", "pyxb.bindin...
[((496, 585), 'pyxb.utils.utility.UniqueIdentifier', 'pyxb.utils.utility.UniqueIdentifier', (['"""urn:uuid:0c295e4a-57cb-11e9-80c6-e86a649bf8c8"""'], {}), "(\n 'urn:uuid:0c295e4a-57cb-11e9-80c6-e86a649bf8c8')\n", (531, 585), False, 'import pyxb\n'), ((954, 981), 'pyxb.utils.utility.Object', 'pyxb.utils.utility.Objec...
import numpy as np def xr_merge(ds1, ds2, on, how='left', dim1='dim_0', dim2='dim_0', fill_value=np.nan): if how != 'left': raise NotImplementedError ds1 = ds1.copy() ds1 = ds1.reset_coords().set_coords(on) ds2 = ds2.reset_coords().set_coords(on) ds2 = ds2.rename({dim2: dim1})...
[ "numpy.array", "numpy.isfinite" ]
[((666, 683), 'numpy.isfinite', 'np.isfinite', (['idx2'], {}), '(idx2)\n', (677, 683), True, 'import numpy as np\n'), ((1160, 1174), 'numpy.array', 'np.array', (['fill'], {}), '(fill)\n', (1168, 1174), True, 'import numpy as np\n')]
from kafka.producer import KafkaProducer import sys import os sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))) from lib.commonsplunk import check_events_from_splunk from lib.commonkafka import * from lib.helper import * from datetime import datetime import threading import loggin...
[ "logging.getLogger", "subprocess.Popen", "os.environ.get", "yaml.load", "time.sleep", "datetime.datetime.now", "os.path.dirname", "datetime.datetime.timestamp", "threading.Thread" ]
[((471, 509), 'logging.getLogger', 'logging.getLogger', (['"""connector_upgrade"""'], {}), "('connector_upgrade')\n", (488, 509), False, 'import logging\n'), ((656, 670), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (668, 670), False, 'from datetime import datetime\n'), ((629, 649), 'yaml.load', 'yaml.loa...
"""JSON implementations of grading queries.""" # pylint: disable=no-init # Numerous classes don't require __init__. # pylint: disable=too-many-public-methods,too-few-public-methods # Number of methods are defined in specification # pylint: disable=protected-access # Access to protected methods allowed in p...
[ "dlkit.abstract_osid.osid.errors.Unimplemented" ]
[((2860, 2882), 'dlkit.abstract_osid.osid.errors.Unimplemented', 'errors.Unimplemented', ([], {}), '()\n', (2880, 2882), False, 'from dlkit.abstract_osid.osid import errors\n'), ((3347, 3369), 'dlkit.abstract_osid.osid.errors.Unimplemented', 'errors.Unimplemented', ([], {}), '()\n', (3367, 3369), False, 'from dlkit.abs...
#!/usr/bin/env python # Copyright (c) 2017, The MITRE Corporation. All rights reserved. # See LICENSE.txt for complete terms. """Creates the CybOX content for CybOX_Simple_Email_Pattern.xml """ from cybox.core import Observables from cybox.objects.email_message_object import EmailMessage def main(): m = EmailM...
[ "cybox.objects.email_message_object.EmailMessage", "cybox.core.Observables" ]
[((314, 328), 'cybox.objects.email_message_object.EmailMessage', 'EmailMessage', ([], {}), '()\n', (326, 328), False, 'from cybox.objects.email_message_object import EmailMessage\n'), ((543, 557), 'cybox.core.Observables', 'Observables', (['m'], {}), '(m)\n', (554, 557), False, 'from cybox.core import Observables\n')]
import os from functools import partial import argparse from absl import logging from lib import settings, train, model, utils from tensorflow.python.eager import profiler import tensorflow.compat.v2 as tf tf.enable_v2_behavior() """ Enhanced Super Resolution GAN. Citation: @article{DBLP:journals/corr/abs-180...
[ "tensorflow.compat.v2.distribute.cluster_resolver.TPUClusterResolver", "tensorflow.compat.v2.random.set_seed", "absl.logging.info", "lib.utils.assign_to_worker", "tensorflow.compat.v2.config.experimental.list_physical_devices", "argparse.ArgumentParser", "lib.settings.Settings", "lib.utils.SingleDevic...
[((206, 229), 'tensorflow.compat.v2.enable_v2_behavior', 'tf.enable_v2_behavior', ([], {}), '()\n', (227, 229), True, 'import tensorflow.compat.v2 as tf\n'), ((1574, 1625), 'tensorflow.compat.v2.config.experimental.list_physical_devices', 'tf.config.experimental.list_physical_devices', (['"""GPU"""'], {}), "('GPU')\n",...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. from difflib import SequenceMatcher from typing import List, Dict, Set, Sequence, Tuple, Union import re from collections import namedtuple from docopt import docopt from utils.dataloading import load_json_gz DIFF_OP_RE = re.comp...
[ "difflib.SequenceMatcher", "re.compile" ]
[((313, 352), 're.compile', 're.compile', (['"""(equal,)?replace(,equal)?"""'], {}), "('(equal,)?replace(,equal)?')\n", (323, 352), False, 'import re\n'), ((488, 544), 'difflib.SequenceMatcher', 'SequenceMatcher', ([], {'a': 'prev_code_chunk', 'b': 'updated_code_chunk'}), '(a=prev_code_chunk, b=updated_code_chunk)\n', ...
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
[ "redis.Redis", "pytest.mark.usefixtures", "pytest.mark.skipif", "pytest.fixture", "rq.job.Job.fetch_many" ]
[((796, 825), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""class"""'}), "(scope='class')\n", (810, 825), False, 'import pytest\n'), ((982, 1086), 'pytest.mark.skipif', 'pytest.mark.skipif', (["('E2E_INTEGRATION_TEST' not in os.environ)"], {'reason': '"""Not running end-to-end test."""'}), "('E2E_INTEGRATION_T...
##################################################################################### # MIT License # # # # Copyright (C) 2019 <NAME> ...
[ "python_speech_features.base.mfcc", "python_speech_features.delta", "python_speech_features.base.logfbank", "numpy.concatenate" ]
[((2554, 2595), 'python_speech_features.base.mfcc', 'mfcc', (['signal', 'rate'], {'numcep': 'filters_number'}), '(signal, rate, numcep=filters_number)\n', (2558, 2595), False, 'from python_speech_features.base import mfcc, logfbank\n'), ((2681, 2704), 'python_speech_features.delta', 'delta', (['mfcc_features', '(2)'], ...
import csv import json import os import requests import sys from os.path import join import tqdm from multiprocessing import Process, Queue from threading import Thread STARTING_PORT_NUM = 8080 def read_sem_types(fn): st_to_path = {} with open(fn, 'rt') as f: for line in f.readlines(): lin...
[ "requests.post", "multiprocessing.Process", "tqdm.tqdm", "os.path.join", "csv.writer", "json.dumps", "sys.stderr.write", "os.path.basename", "sys.exit", "multiprocessing.Queue" ]
[((3114, 3121), 'multiprocessing.Queue', 'Queue', ([], {}), '()\n', (3119, 3121), False, 'from multiprocessing import Process, Queue\n'), ((3139, 3146), 'multiprocessing.Queue', 'Queue', ([], {}), '()\n', (3144, 3146), False, 'from multiprocessing import Process, Queue\n'), ((3800, 3857), 'multiprocessing.Process', 'Pr...
import os import re import logging import pandas as pd from googleapiclient.discovery import build import yaml logging.getLogger('googleapiclient.discovery_cache').setLevel(logging.ERROR) # load personal websites with open("_data/websites.yml", "r") as f: WEBSITES = yaml.load(f, Loader=yaml.BaseLoader) def membe...
[ "logging.getLogger", "yaml.load", "googleapiclient.discovery.build", "pandas.DataFrame", "pandas.MultiIndex.from_tuples" ]
[((736, 786), 'googleapiclient.discovery.build', 'build', (['"""sheets"""', '"""v4"""'], {'developerKey': 'GOOGLE_API_KEY'}), "('sheets', 'v4', developerKey=GOOGLE_API_KEY)\n", (741, 786), False, 'from googleapiclient.discovery import build\n'), ((1144, 1207), 'pandas.MultiIndex.from_tuples', 'pd.MultiIndex.from_tuples...
from solvers.evolution.Chromosome_RandKey import Chromosome_RK import numpy as np import random, bisect class Population(object): def __init__(self, graph, size): self.specimen = list() self.graph = graph self.edgeList = list() for edge in graph.edgeList: self.edgeList....
[ "solvers.evolution.Chromosome_RandKey.Chromosome_RK", "numpy.argsort", "bisect.insort_left", "random.randint" ]
[((954, 990), 'bisect.insort_left', 'bisect.insort_left', (['self.specimen', 'x'], {}), '(self.specimen, x)\n', (972, 990), False, 'import random, bisect\n'), ((416, 435), 'solvers.evolution.Chromosome_RandKey.Chromosome_RK', 'Chromosome_RK', (['self'], {}), '(self)\n', (429, 435), False, 'from solvers.evolution.Chromo...
import copy from windc_data import gams_windc def build_data(version, windc_notation, windc_data): # build data structure that is compatible with gmsxfr data = {} # windc version numbers data["version"] = { "type": "set", "elements": "windc_2_1", "text": "WiNDC data version nu...
[ "copy.deepcopy" ]
[((362, 406), 'copy.deepcopy', 'copy.deepcopy', (["windc_notation['region.abbv']"], {}), "(windc_notation['region.abbv'])\n", (375, 406), False, 'import copy\n'), ((615, 637), 'copy.deepcopy', 'copy.deepcopy', (['regions'], {}), '(regions)\n', (628, 637), False, 'import copy\n')]
''' root/problems/problem_multiGaussian.py ''' ### packages import os import numpy as np import logging ### sys relative to root dir import sys from os.path import dirname, realpath sys.path.append(dirname(dirname(realpath(__file__)))) ### absolute imports wrt root from problems.problem_definition import ProblemDefi...
[ "misc.fake_mixturegauss.XLocations", "numpy.array", "logging.info", "misc.fake_mixturegauss.main", "matplotlib.pyplot.close", "os.path.isdir", "data.data_tools.ezData.ezData", "post_process.plot_things.plot_regression", "post_process.save_things.save_fitness_scores", "numpy.abs", "logging.warnin...
[((2961, 2985), 'misc.fake_mixturegauss.main', 'fake_mixturegauss.main', ([], {}), '()\n', (2983, 2985), False, 'from misc import fake_mixturegauss\n'), ((2998, 3029), 'misc.fake_mixturegauss.XLocations', 'fake_mixturegauss.XLocations', (['x'], {}), '(x)\n', (3026, 3029), False, 'from misc import fake_mixturegauss\n'),...
from typing import Dict, List import logging from pydoc import locate from attrdict import AttrDict from flask_sqlalchemy import Model from api.models import * # noqa logger = logging.getLogger(__name__) class Endpoint(object): def __init__( self, name: str, model: str, versio...
[ "logging.getLogger", "pydoc.locate", "config.get_active_config", "attrdict.AttrDict" ]
[((181, 208), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (198, 208), False, 'import logging\n'), ((3946, 3965), 'config.get_active_config', 'get_active_config', ([], {}), '()\n', (3963, 3965), False, 'from config import get_active_config\n'), ((784, 808), 'attrdict.AttrDict', 'AttrDic...
from SDM.util import get_dirs, get_params class Rule(object): """ A class that represents a rule in the switch table. """ def __init__(self, datapath, table_id=0, priority=0, father_rule=None): self.datapath = datapath self.table_id = table_id self.priority = priority ...
[ "SDM.util.get_dirs" ]
[((491, 501), 'SDM.util.get_dirs', 'get_dirs', ([], {}), '()\n', (499, 501), False, 'from SDM.util import get_dirs, get_params\n')]
import sys from qtpy import QtWidgets from pymodaq.daq_utils.gui_utils import DockArea from pymodaq.daq_viewer.daq_viewer_main import DAQ_Viewer def main(): app = QtWidgets.QApplication(sys.argv) win = QtWidgets.QMainWindow() area = DockArea() win.setCentralWidget(area) win.resize(1000, 500) wi...
[ "qtpy.QtWidgets.QApplication", "pymodaq.daq_viewer.daq_viewer_main.DAQ_Viewer", "pymodaq.daq_utils.gui_utils.DockArea", "qtpy.QtWidgets.QMainWindow" ]
[((168, 200), 'qtpy.QtWidgets.QApplication', 'QtWidgets.QApplication', (['sys.argv'], {}), '(sys.argv)\n', (190, 200), False, 'from qtpy import QtWidgets\n'), ((211, 234), 'qtpy.QtWidgets.QMainWindow', 'QtWidgets.QMainWindow', ([], {}), '()\n', (232, 234), False, 'from qtpy import QtWidgets\n'), ((246, 256), 'pymodaq.d...
from django.db import models STATUS_CHOICES = [ ('1', "Ready to Harvest"), ('2', "Currently Harvesting"), ('3', "Completed"), ('4', "Error: Digital Object Too Large"), ('5', "Error: Bag Verification Failed"), ('6', "Error: Transfer Error"), ('7', "Error: Duplicate Entry"), ('8', "Error:...
[ "django.db.models.TextField", "django.db.models.IntegerField", "django.db.models.BigIntegerField", "django.db.models.DateTimeField", "django.db.models.CharField" ]
[((482, 587), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(255)', 'help_text': '"""The object\'s ARK identifier"""', 'unique': '(True)', 'db_index': '(True)'}), '(max_length=255, help_text="The object\'s ARK identifier",\n unique=True, db_index=True)\n', (498, 587), False, 'from django.db ...
from flask import ( jsonify, request, current_app ) from functools import wraps def login_required(func): @wraps(func) def decorator(*args, **kwargs): auth_header = request.headers.get('Authorization') error_message = current_app.login_manager.login_message if auth_header: try: ...
[ "flask.current_app.login_manager._user_callback", "flask.current_app.login_manager.decode_token", "flask.request.headers.get", "functools.wraps" ]
[((124, 135), 'functools.wraps', 'wraps', (['func'], {}), '(func)\n', (129, 135), False, 'from functools import wraps\n'), ((189, 225), 'flask.request.headers.get', 'request.headers.get', (['"""Authorization"""'], {}), "('Authorization')\n", (208, 225), False, 'from flask import jsonify, request, current_app\n'), ((540...
# Write a program that prompts the user to provide a single character from the alpha­ # bet. Print Vowel or Consonant, depending on the user input. If the user input is # not a letter (between a and z or A and Z), or is a string of length > 1, print an error # message. from sys import exit character = str(input("Ente...
[ "sys.exit" ]
[((709, 773), 'sys.exit', 'exit', (['"""Invalid input. Not a character or more than 1 character."""'], {}), "('Invalid input. Not a character or more than 1 character.')\n", (713, 773), False, 'from sys import exit\n')]
__author__ = 'Luis' from django.core import signals #the sender will be the banned user ban_applied = signals.Signal(providing_args=["new_ban"]) ban_terminated = signals.Signal(providing_args=["ban"]) bans_expired = signals.Signal(providing_args=["current_ban", "ban_list"])
[ "django.core.signals.Signal" ]
[((103, 145), 'django.core.signals.Signal', 'signals.Signal', ([], {'providing_args': "['new_ban']"}), "(providing_args=['new_ban'])\n", (117, 145), False, 'from django.core import signals\n'), ((163, 201), 'django.core.signals.Signal', 'signals.Signal', ([], {'providing_args': "['ban']"}), "(providing_args=['ban'])\n"...
from django.core.management.base import BaseCommand, CommandError from apps.university.models import Faculties, Departaments, StudyGroups, Auditories, Disciplines class Command(BaseCommand): """Base command for load data for app University into database""" help = '>>> load data for app University into datab...
[ "apps.university.models.Auditories.objects.create", "apps.university.models.Disciplines.objects.create", "apps.university.models.Departaments.objects.create", "apps.university.models.StudyGroups.objects.create", "apps.university.models.Faculties.objects.create" ]
[((2047, 2117), 'apps.university.models.Faculties.objects.create', 'Faculties.objects.create', ([], {'name': 'faculty_names[0]', 'slug': 'faculty_slugs[0]'}), '(name=faculty_names[0], slug=faculty_slugs[0])\n', (2071, 2117), False, 'from apps.university.models import Faculties, Departaments, StudyGroups, Auditories, Di...
""" Tests the serialization and deserialization of all the types in Fw/Python/src/fprime/common/models/serialize/ Created on Jun 25, 2020 @author: hpaulson, mstarch """ import json from collections.abc import Iterable import pytest from fprime.common.models.serialize.array_type import ArrayType from fprime.common.mo...
[ "fprime.common.models.serialize.time_type.TimeType", "fprime.common.models.serialize.numerical_types.I32Type", "fprime.common.models.serialize.string_type.StringType", "json.dumps", "fprime.common.models.serialize.numerical_types.U32Type", "pytest.raises", "fprime.common.models.serialize.type_base.Value...
[((4245, 4285), 'fprime.common.models.serialize.time_type.TimeType', 'TimeType', (['t_base', 't_context', 'secs', 'usecs'], {}), '(t_base, t_context, secs, usecs)\n', (4253, 4285), False, 'from fprime.common.models.serialize.time_type import TimeBase, TimeType\n'), ((4326, 4336), 'fprime.common.models.serialize.time_ty...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Copyright (c) 2018-present mundialis GmbH & Co. KG 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 ...
[ "jsonmodels.fields.ListField", "jsonmodels.fields.StringField" ]
[((944, 964), 'jsonmodels.fields.StringField', 'fields.StringField', ([], {}), '()\n', (962, 964), False, 'from jsonmodels import models, fields\n'), ((986, 1016), 'jsonmodels.fields.ListField', 'fields.ListField', (['[int, float]'], {}), '([int, float])\n', (1002, 1016), False, 'from jsonmodels import models, fields\n...
#!/usr/bin/env python3 import argparse import socket as s import math import time import os import logging import statistics import threading import prometheus_client from prometheus_client.samples import Timestamp from pyparsing import * from collections import deque from prometheus_client.core import ( InfoMe...
[ "argparse.ArgumentParser", "socket.socket", "prometheus_client.core.GaugeMetricFamily", "threading.Lock", "prometheus_client.samples.Timestamp", "os.environ.get", "time.sleep", "prometheus_client.core.CounterMetricFamily", "threading.Thread", "prometheus_client.start_http_server", "time.time" ]
[((3781, 3797), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (3795, 3797), False, 'import threading\n'), ((8196, 8221), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (8219, 8221), False, 'import argparse\n'), ((8718, 8759), 'prometheus_client.start_http_server', 'prometheus_client.sta...
import abc import traceback import copy from core.languages.python.helpers.job_config_helpers import read_job_config class PythonJob(abc.ABC): def __init__(self, input_args): super().__init__() self.json_pathname = input_args[1] self.config = read_job_config(self.json_pathname) ...
[ "core.languages.python.helpers.job_config_helpers.read_job_config", "traceback.print_tb", "copy.deepcopy" ]
[((276, 311), 'core.languages.python.helpers.job_config_helpers.read_job_config', 'read_job_config', (['self.json_pathname'], {}), '(self.json_pathname)\n', (291, 311), False, 'from core.languages.python.helpers.job_config_helpers import read_job_config\n'), ((422, 458), 'copy.deepcopy', 'copy.deepcopy', (["self.config...
# -*- coding: utf-8 -*- """ Created on Mon Feb 1 22:07:15 2021 @author: m-lin """ ''' アンサンブル ''' # ライブラリのインポート import pandas as pd # 提出用サンプルの読み込み sub = pd.read_csv('./data/sample_submission.csv') # 予測データの読み込み lgb_sub = pd.read_csv('./submit/houseprices_LightGBM.csv') xgb_sub = pd.read_csv('./su...
[ "pandas.read_csv" ]
[((172, 215), 'pandas.read_csv', 'pd.read_csv', (['"""./data/sample_submission.csv"""'], {}), "('./data/sample_submission.csv')\n", (183, 215), True, 'import pandas as pd\n'), ((243, 291), 'pandas.read_csv', 'pd.read_csv', (['"""./submit/houseprices_LightGBM.csv"""'], {}), "('./submit/houseprices_LightGBM.csv')\n", (25...
import os import random import yaml from collections import Counter from nltk.corpus import movie_reviews from nltk.corpus import senseval import pandas as pd import json class datasetGenerator: """ creates a base dataset from senseval in NLTK it generates data.json dataset by instanciating it or by...
[ "nltk.corpus.senseval.instances", "os.path.join", "random.seed", "json.load", "collections.Counter", "pandas.DataFrame" ]
[((2090, 2121), 'pandas.DataFrame', 'pd.DataFrame', (["data['sentences']"], {}), "(data['sentences'])\n", (2102, 2121), True, 'import pandas as pd\n'), ((2686, 2709), 'random.seed', 'random.seed', (['randomSeed'], {}), '(randomSeed)\n', (2697, 2709), False, 'import random\n'), ((3080, 3151), 'pandas.DataFrame', 'pd.Dat...
#!/usr/bin/python3 #This object is used by the GUI to get and hold information #from the WSPR device that it needs to display. #all calls to the WSPR device should come through here. #This will allow us to swap out the manager if we ever want to #connect this to a different WSPR device from lib.WSPRInterfaceManager im...
[ "lib.WSPRInterfaceManager.WSPRInterfaceManager", "obj.ErrorObjects.logError", "obj.ConfigurationObjects.ConfigObject" ]
[((651, 717), 'obj.ErrorObjects.logError', 'logError', (['ErrorLevel.LOW', '"""*********** START UP *****************"""'], {}), "(ErrorLevel.LOW, '*********** START UP *****************')\n", (659, 717), False, 'from obj.ErrorObjects import logError, ErrorLevel\n'), ((804, 835), 'obj.ConfigurationObjects.ConfigObject'...
""" Module for content aggregation to give data """ import collections class ContentAggregator: def __init__(self, config): self.tags = collections.defaultdict(list) self.content = collections.defaultdict(dict) self.config = config def get_content_items(self, tag=None): pages_...
[ "collections.OrderedDict", "collections.defaultdict" ]
[((150, 179), 'collections.defaultdict', 'collections.defaultdict', (['list'], {}), '(list)\n', (173, 179), False, 'import collections\n'), ((203, 232), 'collections.defaultdict', 'collections.defaultdict', (['dict'], {}), '(dict)\n', (226, 232), False, 'import collections\n'), ((1366, 1396), 'collections.OrderedDict',...
import unittest from unittest.mock import Mock, MagicMock, patch from requests import Response from pdp import PolicyDecisionPointClient, PolicyDecisionPointInput, AuthzException class TestPolicyDecisionPointClient(unittest.TestCase): mock_response = Mock(spec=Response) def test_authorize_true(self): ...
[ "pdp.PolicyDecisionPointClient", "unittest.mock.Mock", "unittest.mock.MagicMock", "pdp.PolicyDecisionPointInput", "unittest.main" ]
[((260, 279), 'unittest.mock.Mock', 'Mock', ([], {'spec': 'Response'}), '(spec=Response)\n', (264, 279), False, 'from unittest.mock import Mock, MagicMock, patch\n'), ((1426, 1441), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1439, 1441), False, 'import unittest\n'), ((333, 360), 'pdp.PolicyDecisionPointClient...
from eve import Eve from flask.ext.cors import CORS import json from flask import request from pymongo import MongoClient import os app = Eve() cors = CORS(app) @app.route("/version") def version(): return 'Deep API v0.0.2' @app.route("/_status/healthcheck") def healthcheck(): return 'Deep is healthy' @a...
[ "eve.Eve", "json.loads", "flask.ext.cors.CORS", "os.environ.get", "pymongo.MongoClient" ]
[((139, 144), 'eve.Eve', 'Eve', ([], {}), '()\n', (142, 144), False, 'from eve import Eve\n'), ((152, 161), 'flask.ext.cors.CORS', 'CORS', (['app'], {}), '(app)\n', (156, 161), False, 'from flask.ext.cors import CORS\n'), ((395, 431), 'os.environ.get', 'os.environ.get', (['"""MONGO_SERVICE_HOST"""'], {}), "('MONGO_SERV...
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from django.core.urlresolvers import reverse from django.test import TestCase from ralph.cmdb.tests.utils import CIRelationFactory from ralph.acc...
[ "ralph_assets.tests.utils.assets.AssetModelFactory", "ralph.account.models.Region.get_default_region", "ralph_assets.models_assets.AssetCategory.objects.get", "ralph.cmdb.tests.utils.CIRelationFactory", "ralph_assets.tests.utils.assets.get_device_info_dict", "ralph.ui.tests.global_utils.login_as_su", "d...
[((746, 776), 'ralph.ui.tests.global_utils.login_as_su', 'login_as_su', ([], {'is_superuser': '(True)'}), '(is_superuser=True)\n', (757, 776), False, 'from ralph.ui.tests.global_utils import login_as_su\n'), ((807, 853), 'ralph_assets.models_assets.AssetCategory.objects.get', 'AssetCategory.objects.get', ([], {'name': ...
import math import numpy as np import matplotlib.pyplot as plt from scipy.stats import norm, binom from kmeans import kmeans ######################### def adc_range(adc): # make sure you pick the right type, zeros_like copies type. adc_low = np.zeros_like(adc, dtype=np.float32) adc_high = np.zeros_like(...
[ "numpy.mean", "numpy.ceil", "numpy.reshape", "numpy.sqrt", "numpy.absolute", "kmeans.kmeans", "numpy.sum", "numpy.zeros", "numpy.array", "numpy.all", "numpy.zeros_like", "numpy.arange" ]
[((254, 290), 'numpy.zeros_like', 'np.zeros_like', (['adc'], {'dtype': 'np.float32'}), '(adc, dtype=np.float32)\n', (267, 290), True, 'import numpy as np\n'), ((306, 342), 'numpy.zeros_like', 'np.zeros_like', (['adc'], {'dtype': 'np.float32'}), '(adc, dtype=np.float32)\n', (319, 342), True, 'import numpy as np\n'), ((6...
import os import re import sys if sys.version_info < (2, 7): import unittest2 as unittest else: import unittest import configuration from resource_suite import ResourceBase import lib class Test_iPut_Options(ResourceBase, unittest.TestCase): def setUp(self): super(Test_iPut_Options, self).setUp...
[ "lib.make_file", "os.path.join", "lib.touch" ]
[((678, 728), 'os.path.join', 'os.path.join', (['self.admin.local_session_dir', '"""zero"""'], {}), "(self.admin.local_session_dir, 'zero')\n", (690, 728), False, 'import os\n'), ((737, 761), 'lib.touch', 'lib.touch', (['zero_filepath'], {}), '(zero_filepath)\n', (746, 761), False, 'import lib\n'), ((1429, 1479), 'os.p...
""" A validator for greek social security number (AMKA) More information is available on [AMKA.gr](https://www.amka.gr/tieinai.html). """ from datetime import datetime def validate(amka: str) -> (bool, str): """ Validates a greek social security number (AMKA) Args: amka (string): The string to v...
[ "datetime.datetime.strptime" ]
[((686, 723), 'datetime.datetime.strptime', 'datetime.strptime', (['amka[:6]', '"""%d%m%y"""'], {}), "(amka[:6], '%d%m%y')\n", (703, 723), False, 'from datetime import datetime\n')]
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Test WebVTT support """ # This code is a part of speach library: https://github.com/neocl/speach/ # :copyright: (c) 2018 <NAME> <<EMAIL>> # :license: MIT, see LICENSE for more details. import os import unittest import logging from speach import vtt # ------------...
[ "logging.getLogger", "speach.vtt.sec2ts", "speach.vtt.ts2sec", "os.path.realpath", "unittest.main" ]
[((514, 540), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (530, 540), False, 'import os\n'), ((572, 599), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (589, 599), False, 'import logging\n'), ((3215, 3230), 'unittest.main', 'unittest.main', ([], {}), '()\n...
import io import json import logging from pathlib import Path import kraken.binarization import kraken.repo import kraken.pageseg from PIL import Image from .grpc import mocri_pb2 as pb from .grpc import mocri_pb2_grpc as grpc APP_DIR = Path('~/.config/kraken').expanduser() logger = logging.getLogger('mocri') cla...
[ "logging.getLogger", "json.load", "io.BytesIO", "pathlib.Path" ]
[((288, 314), 'logging.getLogger', 'logging.getLogger', (['"""mocri"""'], {}), "('mocri')\n", (305, 314), False, 'import logging\n'), ((240, 264), 'pathlib.Path', 'Path', (['"""~/.config/kraken"""'], {}), "('~/.config/kraken')\n", (244, 264), False, 'from pathlib import Path\n'), ((513, 544), 'pathlib.Path', 'Path', ([...
#!/usr/bin/python """ This script calculates all the basic length metrics for the given input genome assembly. Usage: python assembly_stats.py <genome assembly file (fasta format)> <output file name> """ from Bio import SeqIO import sys import statistics import numpy as np inputfile = sys.argv[1] outputfile = ...
[ "sys.stdout.close", "Bio.SeqIO.parse" ]
[((3585, 3603), 'sys.stdout.close', 'sys.stdout.close', ([], {}), '()\n', (3601, 3603), False, 'import sys\n'), ((381, 412), 'Bio.SeqIO.parse', 'SeqIO.parse', (['inputfile', '"""fasta"""'], {}), "(inputfile, 'fasta')\n", (392, 412), False, 'from Bio import SeqIO\n')]
import io import numpy as np import pdb import sys import tensorflow as tf import tensorflow_addons as tfa import tensorflow_datasets as tfds ''' Q: what is variables? ''' def get_char_LSTM(batch_size, vocab_size=11, embedding_size=512, variables=1, bidirectional=True, share_embeddings=True): lstm_features = 512 ...
[ "tensorflow.unstack", "tensorflow.keras.layers.Input", "numpy.round", "tensorflow.keras.losses.SparseCategoricalCrossentropy", "tensorflow.keras.optimizers.Adam", "tensorflow.keras.layers.Embedding", "tensorflow.GradientTape", "numpy.random.randint", "tensorflow.keras.layers.Dense", "numpy.sum", ...
[((4705, 4768), 'tensorflow.keras.losses.SparseCategoricalCrossentropy', 'tf.keras.losses.SparseCategoricalCrossentropy', ([], {'from_logits': '(True)'}), '(from_logits=True)\n', (4750, 4768), True, 'import tensorflow as tf\n'), ((4789, 4820), 'tensorflow.keras.optimizers.Adam', 'tf.keras.optimizers.Adam', (['(0.001)']...
#!/usr/bin/env python3 """Detect vanishing points in non-Manhattan world. Usage: eval_nyu.py [options] <yaml-config> <checkpoint> eval_nyu.py ( -h | --help ) Arguments: <yaml-config> Path to the yaml hyper-parameter file <checkpoint> Path to the checkpoint Options: -h...
[ "vpd.config.M.update", "numpy.arccos", "vpd.config.C.io.dataset.upper", "torch.cuda.device_count", "numpy.argsort", "numpy.array", "torch.cuda.is_available", "pprint.pprint", "docopt.docopt", "vpd.models.VanishingNet", "numpy.searchsorted", "numpy.random.seed", "numpy.concatenate", "numpy....
[((1383, 1402), 'numpy.argsort', 'np.argsort', (['(-scores)'], {}), '(-scores)\n', (1393, 1402), True, 'import numpy as np\n'), ((2287, 2316), 'numpy.searchsorted', 'np.searchsorted', (['x', 'threshold'], {}), '(x, threshold)\n', (2302, 2316), True, 'import numpy as np\n'), ((2325, 2365), 'numpy.concatenate', 'np.conca...
#!/usr/bin/python # -*- coding: utf-8 -*- """ align_tmp.py Align reads to corrected PacBio sequences at all correction steps. Created on Fri Aug 22 10:46:18 2014 @author: cjg """ import sys import os import argparse import time import re import glob sys.path.append("/chongle/shared/software/metalrec/src") import me...
[ "os.path.exists", "argparse.ArgumentParser", "os.path.dirname", "sys.exit", "os.path.abspath", "sys.path.append", "glob.glob" ]
[((254, 310), 'sys.path.append', 'sys.path.append', (['"""/chongle/shared/software/metalrec/src"""'], {}), "('/chongle/shared/software/metalrec/src')\n", (269, 310), False, 'import sys\n'), ((497, 782), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Align reads to corrected PacBio sequen...
import pytest import logging import json import random import string from typing import List # from flask import FlaskClient from werkzeug.wrappers import Response from . import common ENDPOINT: str = common.BASE_URL + "/depot" @pytest.fixture() def random_depot(): """Return random generated depot""" ret...
[ "random.uniform", "logging.debug", "pytest.mark.parametrize", "pytest.fixture", "random.randint" ]
[((235, 251), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (249, 251), False, 'import pytest\n'), ((405, 421), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (419, 421), False, 'import pytest\n'), ((640, 2414), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""content_type"""', "['audio/aac', ...
from sklearn.metrics import mean_squared_error from matplotlib import pyplot as plt from keras.models import Sequential from keras.layers import Dense from keras.layers import LSTM from math import sqrt import numpy as np from P2_get_data import get_data epochs = 150 batch_size = 100 time_steps = 3 def LSTM_train(x_...
[ "matplotlib.pyplot.ylabel", "numpy.arange", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "P2_get_data.get_data", "keras.models.Sequential", "sklearn.metrics.mean_squared_error", "keras.layers.LSTM", "numpy.concatenate", "keras.layers.Dense", "matplotlib.pyplot.legend", "matplotlib.pyp...
[((365, 377), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (375, 377), False, 'from keras.models import Sequential\n'), ((712, 760), 'matplotlib.pyplot.plot', 'plt.plot', (["history.history['loss']"], {'label': '"""train"""'}), "(history.history['loss'], label='train')\n", (720, 760), True, 'from matplotl...
import decimal import json import os from datetime import datetime from pprint import pprint from smart_open import open from opennem.api.controllers import ( bom_observation, wem_demand, wem_energy_all, wem_energy_year, wem_market_value_all, wem_market_value_year, wem_power_groups, we...
[ "opennem.api.controllers.wem_price", "opennem.api.controllers.wem_market_value_all", "opennem.api.controllers.wem_power_groups", "opennem.api.controllers.bom_observation", "opennem.api.controllers.wem_demand", "os.path.dirname", "opennem.api.controllers.wem_energy_all", "opennem.api.controllers.wem_en...
[((833, 851), 'opennem.api.controllers.wem_power_groups', 'wem_power_groups', ([], {}), '()\n', (849, 851), False, 'from opennem.api.controllers import bom_observation, wem_demand, wem_energy_all, wem_energy_year, wem_market_value_all, wem_market_value_year, wem_power_groups, wem_price\n'), ((871, 896), 'opennem.api.co...
# SExp - A S-Expression Parser for Python # Copyright (C) 2015 <NAME> <<EMAIL>> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later...
[ "sexp.value.Real", "sexp.value.Integer", "sexp.parser.Parser.from_string" ]
[((889, 924), 'sexp.parser.Parser.from_string', 'Parser.from_string', (['"""(1.0 2 3 4 5)"""'], {}), "('(1.0 2 3 4 5)')\n", (907, 924), False, 'from sexp.parser import Parser\n'), ((947, 956), 'sexp.value.Real', 'Real', (['(1.0)'], {}), '(1.0)\n', (951, 956), False, 'from sexp.value import Integer, Real, Array\n'), ((9...
# -*- coding: utf-8 -*- """Init and utils.""" from zope.i18nmessageid import MessageFactory import monkey _ = MessageFactory('parruc.violareggiocalabria') monkey # pyflakes
[ "zope.i18nmessageid.MessageFactory" ]
[((114, 158), 'zope.i18nmessageid.MessageFactory', 'MessageFactory', (['"""parruc.violareggiocalabria"""'], {}), "('parruc.violareggiocalabria')\n", (128, 158), False, 'from zope.i18nmessageid import MessageFactory\n')]
# This file is part of Indico. # Copyright (C) 2002 - 2019 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. import pytest from indico.modules.rb import rb_settings from indico.modules.rb.util import rb_check_user_...
[ "indico.modules.rb.util.rb_check_user_access", "indico.modules.rb.util.rb_is_admin", "indico.testing.util.bool_matrix", "indico.modules.rb.rb_settings.acls.add_principal" ]
[((463, 493), 'indico.testing.util.bool_matrix', 'bool_matrix', (['"""..."""'], {'expect': 'any'}), "('...', expect=any)\n", (474, 493), False, 'from indico.testing.util import bool_matrix\n'), ((1017, 1046), 'indico.testing.util.bool_matrix', 'bool_matrix', (['""".."""'], {'expect': 'any'}), "('..', expect=any)\n", (1...
import os import pathlib import re from os.path import join as _ from generate_map import generate_dynasty_name_mapping, generate_first_name_mapping from special_escape import generate_printer, generate_encoder encoder = generate_encoder("eu4", "txt") printer = generate_printer("eu4", "txt") # 万能ではないが、とりあえずこれで force...
[ "os.path.exists", "special_escape.generate_printer", "os.makedirs", "re.compile", "pathlib.Path", "special_escape.generate_encoder", "os.path.join", "os.path.dirname", "re.sub", "generate_map.generate_first_name_mapping", "generate_map.generate_dynasty_name_mapping" ]
[((223, 253), 'special_escape.generate_encoder', 'generate_encoder', (['"""eu4"""', '"""txt"""'], {}), "('eu4', 'txt')\n", (239, 253), False, 'from special_escape import generate_printer, generate_encoder\n'), ((264, 294), 'special_escape.generate_printer', 'generate_printer', (['"""eu4"""', '"""txt"""'], {}), "('eu4',...
# Generated by Django 3.1.6 on 2021-04-14 09:38 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('cluster', '0002_logicalcluster_partial_reload'), ('manager', '0002_auto_20210225_1216'), ] operations = [ migrations.AddField( ...
[ "django.db.models.ManyToManyField", "django.db.models.BooleanField" ]
[((396, 430), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'default': '(False)'}), '(default=False)\n', (415, 430), False, 'from django.db import migrations, models\n'), ((555, 606), 'django.db.models.ManyToManyField', 'models.ManyToManyField', ([], {'to': '"""cluster.LogicalCluster"""'}), "(to='cluste...
import numpy as np from sklearn.metrics import r2_score as sklearn_r2_score from tensorflow import convert_to_tensor from scikeras.wrappers import KerasRegressor from .mlp_models import dynamic_regressor def test_kerasregressor_r2_correctness(): """Test custom R^2 implementation against scikit-learn's.""" ...
[ "numpy.random.random_sample", "scikeras.wrappers.KerasRegressor", "numpy.random.randint", "numpy.testing.assert_almost_equal", "tensorflow.convert_to_tensor", "scikeras.wrappers.KerasRegressor.r_squared", "sklearn.metrics.r2_score", "numpy.arange" ]
[((367, 400), 'numpy.arange', 'np.arange', (['n_samples'], {'dtype': 'float'}), '(n_samples, dtype=float)\n', (376, 400), True, 'import numpy as np\n'), ((506, 548), 'numpy.random.random_sample', 'np.random.random_sample', ([], {'size': 'y_true.shape'}), '(size=y_true.shape)\n', (529, 548), True, 'import numpy as np\n'...
from .conftest import base_config import numpy as np from numpy.testing import assert_allclose, assert_array_equal import openamundsen as oa import openamundsen.errors as errors import pandas as pd import pytest import xarray as xr @pytest.mark.parametrize('fmt', ['netcdf', 'csv', 'memory']) def test_formats(fmt, tmp...
[ "pandas.Series", "openamundsen.OpenAmundsen", "pandas.read_csv", "numpy.testing.assert_allclose", "pytest.mark.parametrize", "numpy.issubdtype", "pytest.raises", "numpy.all", "xarray.open_dataset", "numpy.testing.assert_array_equal" ]
[((235, 294), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""fmt"""', "['netcdf', 'csv', 'memory']"], {}), "('fmt', ['netcdf', 'csv', 'memory'])\n", (258, 294), False, 'import pytest\n'), ((2693, 2758), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""write_freq"""', "['M', '7H', '3H', '10min']"...
import logging from reportportal_client.helpers import gen_attributes from .variables import Variables from .model import Keyword, Test, Suite, LogMessage from .service import RobotService class DryRunRP: def __init__(self, verbose=False): self._logger = logging.getLogger('RP(DRYRUN)') if verbos...
[ "logging.getLogger", "reportportal_client.helpers.gen_attributes" ]
[((271, 302), 'logging.getLogger', 'logging.getLogger', (['"""RP(DRYRUN)"""'], {}), "('RP(DRYRUN)')\n", (288, 302), False, 'import logging\n'), ((607, 630), 'logging.getLogger', 'logging.getLogger', (['"""RP"""'], {}), "('RP')\n", (624, 630), False, 'import logging\n'), ((1301, 1344), 'reportportal_client.helpers.gen_a...
#/* # * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more # * contributor license agreements. See the NOTICE file distributed with # * this work for additional information regarding copyright ownership. # * The OpenAirInterface Software Alliance licenses this file to You under # * the OAI Publ...
[ "ipaddress.ip_network", "re.match", "sys.exit", "os.getcwd" ]
[((15335, 15346), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (15344, 15346), False, 'import os\n'), ((15429, 15476), 're.match', 're.match', (['"""^\\\\-\\\\-help$"""', 'myArgv', 're.IGNORECASE'], {}), "('^\\\\-\\\\-help$', myArgv, re.IGNORECASE)\n", (15437, 15476), False, 'import re\n'), ((17113, 17147), 'sys.exit', ...
import json def json_string_to_dict(content): """ Attempt to convert a JSON string to a dict. Args: content (string): JSON string to parse to a dictionary. Returns: dict: Dictionary from parsed string. """ try: response_json = json.loads(content) if isinstance...
[ "json.loads" ]
[((279, 298), 'json.loads', 'json.loads', (['content'], {}), '(content)\n', (289, 298), False, 'import json\n')]
from matplotlib.pyplot import figure, show from PIL import ImageDraw from numpy import array, linspace, meshgrid, pi, cos, sin def cylinderize(text:str) -> None: w,h = (len(max(text.split("\n"), key=len))+1)*6,(text.count("\n")+1)*15 im=ImageDraw.Image.new("L",(w,h)) ImageDraw.Draw(im).text((0,0),text...
[ "PIL.ImageDraw.Image.new", "numpy.linspace", "PIL.ImageDraw.Draw", "matplotlib.pyplot.figure", "numpy.cos", "numpy.array", "numpy.sin", "matplotlib.pyplot.show" ]
[((250, 282), 'PIL.ImageDraw.Image.new', 'ImageDraw.Image.new', (['"""L"""', '(w, h)'], {}), "('L', (w, h))\n", (269, 282), False, 'from PIL import ImageDraw\n'), ((565, 571), 'matplotlib.pyplot.show', 'show', ([], {}), '()\n', (569, 571), False, 'from matplotlib.pyplot import figure, show\n'), ((354, 376), 'numpy.lins...
import sys sys.path.insert(0, '.') import os import argparse import torch import torch.nn as nn from PIL import Image import numpy as np import cv2 import time import lib.transform_cv2 as T from lib.models import model_factory from configs import cfg_factory from lib.cityscapes_labels import trainId2color torch.set_...
[ "os.path.exists", "lib.transform_cv2.ToTensor", "sys.path.insert", "cv2.imwrite", "argparse.ArgumentParser", "os.path.makedirs", "torch.load", "torch.tensor", "numpy.random.randint", "numpy.random.seed", "time.time", "torch.set_grad_enabled", "cv2.resize", "cv2.imread", "torch.ones" ]
[((12, 35), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""."""'], {}), "(0, '.')\n", (27, 35), False, 'import sys\n'), ((310, 339), 'torch.set_grad_enabled', 'torch.set_grad_enabled', (['(False)'], {}), '(False)\n', (332, 339), False, 'import torch\n'), ((340, 359), 'numpy.random.seed', 'np.random.seed', (['(123)'...
# -*- coding: utf-8 -*- """ Created on Sat Jul 20 12:07:57 2019 @author: johnmount """ import numpy import pandas import vtreat.util import vtreat.transform class VarTransform: """build a treatment plan for a numeric outcome (regression)""" def __init__(self, incoming_column_name, derived_column_names, tr...
[ "numpy.mean", "numpy.sqrt", "pandas.merge", "numpy.log", "numpy.asarray", "pandas.SparseArray", "numpy.logical_not", "numpy.max", "numpy.isnan", "numpy.min", "pandas.DataFrame", "pandas.concat" ]
[((4277, 4299), 'numpy.sqrt', 'numpy.sqrt', (["sf['_var']"], {}), "(sf['_var'])\n", (4287, 4299), False, 'import numpy\n'), ((7099, 7142), 'pandas.DataFrame', 'pandas.DataFrame', (['{incoming_column_name: x}'], {}), '({incoming_column_name: x})\n', (7115, 7142), False, 'import pandas\n'), ((7766, 7792), 'pandas.DataFra...
""" User-configurable settings for the Part app """ # -*- coding: utf-8 -*- from __future__ import unicode_literals from common.models import InvenTreeSetting def part_assembly_default(): """ Returns the default value for the 'assembly' field of a Part object """ return InvenTreeSetting.get_setting...
[ "common.models.InvenTreeSetting.get_setting" ]
[((292, 337), 'common.models.InvenTreeSetting.get_setting', 'InvenTreeSetting.get_setting', (['"""PART_ASSEMBLY"""'], {}), "('PART_ASSEMBLY')\n", (320, 337), False, 'from common.models import InvenTreeSetting\n'), ((472, 517), 'common.models.InvenTreeSetting.get_setting', 'InvenTreeSetting.get_setting', (['"""PART_TEMP...
# inspired by https://github.com/renatoviolin/next_word_prediction import torch import string import transformers transformers.logging.set_verbosity_error() from transformers import BertTokenizerFast, BertForMaskedLM bert_tokenizer = BertTokenizerFast.from_pretrained('kykim/bert-kor-base') bert_model = BertForMasked...
[ "transformers.BertTokenizerFast.from_pretrained", "transformers.BertForMaskedLM.from_pretrained", "transformers.XLMRobertaForMaskedLM.from_pretrained", "torch.no_grad", "transformers.AlbertForMaskedLM.from_pretrained", "transformers.logging.set_verbosity_error", "transformers.XLMRobertaTokenizerFast.fro...
[((116, 158), 'transformers.logging.set_verbosity_error', 'transformers.logging.set_verbosity_error', ([], {}), '()\n', (156, 158), False, 'import transformers\n'), ((237, 293), 'transformers.BertTokenizerFast.from_pretrained', 'BertTokenizerFast.from_pretrained', (['"""kykim/bert-kor-base"""'], {}), "('kykim/bert-kor-...
from typing import Optional, List import fastapi from fastapi import Depends from models.tenant import Tenant, TenantSubmittal from models.validation_error import ValidationError from models.location import Location from services import tenant_service router = fastapi.APIRouter() @router.get('/api/tenants', name='all...
[ "services.tenant_service.add_tenant", "fastapi.APIRouter", "services.tenant_service.get_tenants" ]
[((262, 281), 'fastapi.APIRouter', 'fastapi.APIRouter', ([], {}), '()\n', (279, 281), False, 'import fastapi\n'), ((419, 447), 'services.tenant_service.get_tenants', 'tenant_service.get_tenants', ([], {}), '()\n', (445, 447), False, 'from services import tenant_service\n'), ((908, 1010), 'services.tenant_service.add_te...
import json from dataclasses import dataclass, asdict @dataclass class BaseModelMixin: @property def as_json(self): return json.dumps(asdict(self)) @classmethod def from_json(cls, jstr): d = json.loads(jstr) return cls(**d)
[ "json.loads", "dataclasses.asdict" ]
[((226, 242), 'json.loads', 'json.loads', (['jstr'], {}), '(jstr)\n', (236, 242), False, 'import json\n'), ((152, 164), 'dataclasses.asdict', 'asdict', (['self'], {}), '(self)\n', (158, 164), False, 'from dataclasses import dataclass, asdict\n')]
from __future__ import division import logging import traceback from sqlalchemy.sql import select from database import get_engine, engine_disposal, anomalies_table_meta # @added 20210420 - Task #4022: Move mysql_select calls to SQLAlchemy # Add a global method to query the DB for the latest_anomalies def latest_ano...
[ "logging.getLogger", "traceback.format_exc", "sqlalchemy.sql.select", "database.get_engine", "database.engine_disposal", "database.anomalies_table_meta" ]
[((577, 622), 'logging.getLogger', 'logging.getLogger', (['current_skyline_app_logger'], {}), '(current_skyline_app_logger)\n', (594, 622), False, 'import logging\n'), ((685, 716), 'database.get_engine', 'get_engine', (['current_skyline_app'], {}), '(current_skyline_app)\n', (695, 716), False, 'from database import get...
#!/usr/bin/env python # -*- coding: utf-8 -*- # clingen_pars.py # made by <NAME> # 2020-03-03 15:42:28 ######################### import sys import os SVRNAME = os.uname()[1] if "MBI" in SVRNAME.upper(): sys_path = "/Users/pcaso/bin/python_lib" elif SVRNAME == "T7": sys_path = "/ms1/bin/python_lib" else: sys...
[ "file_util.is_exist", "web_util.get_url", "file_util.fileOpen", "str_util.strip_tag", "file_util.gzopen", "file_util.fileSave", "csv.reader", "time_util.getToday", "sys.path.append", "str_util.substr", "os.uname" ]
[((357, 382), 'sys.path.append', 'sys.path.append', (['sys_path'], {}), '(sys_path)\n', (372, 382), False, 'import sys\n'), ((160, 170), 'os.uname', 'os.uname', ([], {}), '()\n', (168, 170), False, 'import os\n'), ((2108, 2129), 'web_util.get_url', 'web_util.get_url', (['url'], {}), '(url)\n', (2124, 2129), False, 'imp...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Jun 9 16:11:56 2019 @author: sjmoneyboss """ import pandas as pd import statsmodels from statsmodels.tsa.stattools import adfuller import statsmodels.api as sm import datetime import math import pandas_datareader.data as web import datetime as dt from...
[ "datetime.datetime", "numpy.roll", "statsmodels.tsa.stattools.adfuller", "pandas.read_csv", "pandas_datareader.data.DataReader", "numpy.log", "numpy.subtract", "math.log", "matplotlib.pyplot.axhline", "statsmodels.api.add_constant", "numpy.std", "statsmodels.api.OLS", "matplotlib.pyplot.lege...
[((1820, 1842), 'pandas.read_csv', 'pd.read_csv', (['filename1'], {}), '(filename1)\n', (1831, 1842), True, 'import pandas as pd\n'), ((1849, 1871), 'pandas.read_csv', 'pd.read_csv', (['filename2'], {}), '(filename2)\n', (1860, 1871), True, 'import pandas as pd\n'), ((2202, 2217), 'statsmodels.tsa.stattools.adfuller', ...
import pytest from deslib.des.knora_u import KNORAU from deslib.tests.examples_test import * from sklearn.linear_model import Perceptron @pytest.mark.parametrize('index, expected', [(0, [4.0, 3.0, 4.0]), (1, [5.0, 2.0, 5.0]), (...
[ "pytest.mark.parametrize", "sklearn.linear_model.Perceptron", "deslib.des.knora_u.KNORAU" ]
[((141, 255), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""index, expected"""', '[(0, [4.0, 3.0, 4.0]), (1, [5.0, 2.0, 5.0]), (2, [2.0, 5.0, 2.0])]'], {}), "('index, expected', [(0, [4.0, 3.0, 4.0]), (1, [5.0,\n 2.0, 5.0]), (2, [2.0, 5.0, 2.0])])\n", (164, 255), False, 'import pytest\n'), ((816, 884),...
''' Task: Count minimal number of jumps from position X to Y. Approach: Subtract position X from position Y to get the distance between them. Return the smallest integer greater than or equal to the result obtained from dividing the distance (Y-X) by jump distance D. ''' # you can write to s...
[ "math.ceil" ]
[((473, 495), 'math.ceil', 'math.ceil', (['((Y - X) / D)'], {}), '((Y - X) / D)\n', (482, 495), False, 'import math\n')]
import re from logging import getLogger from os import makedirs from os.path import dirname import pandas as pd from jinja2 import Template from pyinaturalist.converters import try_datetime from inat_backlog_slogger.constants import ( JSON_OBSERVATIONS, JSON_OBSERVATION_EXPORT, RANKING_WEIGHTS, REPOR...
[ "logging.getLogger", "pyinaturalist.converters.try_datetime", "inat_backlog_slogger.image_downloads.get_image_url", "inat_backlog_slogger.observations.load_observations", "os.path.dirname", "pandas.read_json", "inat_backlog_slogger.ranking.get_ranked_subset" ]
[((1397, 1416), 'logging.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (1406, 1416), False, 'from logging import getLogger\n'), ((2940, 2974), 'inat_backlog_slogger.ranking.get_ranked_subset', 'get_ranked_subset', (['df', 'top', 'bottom'], {}), '(df, top, bottom)\n', (2957, 2974), False, 'from inat_backl...
from ws_connection import ClientClosedError from ws_server import WebSocketServer, WebSocketClient import time import random class TestClient(WebSocketClient): t=30 h=50 def __init__(self, conn): super().__init__(conn) def process(self): try: msg = self.connection.read() ...
[ "random.randint", "time.sleep" ]
[((476, 491), 'time.sleep', 'time.sleep', (['(0.2)'], {}), '(0.2)\n', (486, 491), False, 'import time\n'), ((338, 359), 'random.randint', 'random.randint', (['(0)', '(10)'], {}), '(0, 10)\n', (352, 359), False, 'import random\n'), ((381, 402), 'random.randint', 'random.randint', (['(0)', '(20)'], {}), '(0, 20)\n', (395...
# encoding: utf-8 import unittest from django.contrib.auth import models from django.test import TestCase from cool.core import utils class SplitCamelNameTests(unittest.TestCase): def test_simple(self): self.assertListEqual(utils.split_camel_name("GetSimpleView"), ['Get', 'Simple', 'View']) def te...
[ "cool.core.utils.split_camel_name", "cool.core.utils.construct_search" ]
[((241, 280), 'cool.core.utils.split_camel_name', 'utils.split_camel_name', (['"""GetSimpleView"""'], {}), "('GetSimpleView')\n", (263, 280), False, 'from cool.core import utils\n'), ((389, 426), 'cool.core.utils.split_camel_name', 'utils.split_camel_name', (['"""GenerateURL"""'], {}), "('GenerateURL')\n", (411, 426), ...
#! /usr/bin/env python # -*- coding: utf-8 -*- """ Initialization module for artellapipe """ from __future__ import print_function, division, absolute_import __author__ = "<NAME>" __license__ = "MIT" __maintainer__ = "<NAME>" __email__ = "<EMAIL>" # For autocompletion if False: from artellapipe.core import asse...
[ "pkgutil.extend_path" ]
[((1466, 1497), 'pkgutil.extend_path', 'extend_path', (['__path__', '__name__'], {}), '(__path__, __name__)\n', (1477, 1497), False, 'from pkgutil import extend_path\n')]
from __future__ import print_function import pickle import numpy import theano numpy.random.seed(42) def prepare_data(seqs, labels): """Create the matrices from the datasets. This pad each sequence to the same lenght: the lenght of the longuest sequence or maxlen. if maxlen is set, we will cut all ...
[ "numpy.ones", "numpy.round", "pickle.load", "numpy.max", "numpy.zeros", "numpy.random.seed", "numpy.arange", "numpy.random.shuffle" ]
[((80, 101), 'numpy.random.seed', 'numpy.random.seed', (['(42)'], {}), '(42)\n', (97, 101), False, 'import numpy\n'), ((496, 514), 'numpy.max', 'numpy.max', (['lengths'], {}), '(lengths)\n', (505, 514), False, 'import numpy\n'), ((1850, 1865), 'pickle.load', 'pickle.load', (['f1'], {}), '(f1)\n', (1861, 1865), False, '...
""" 用于减少编码中的多个简单条件if分支, 实现类似 java spring 中通过 application context 生命周期回调实现的工厂路由 实例见下方test """ import functools from blinker import Signal def dispatch(func): """ 入口方法装饰器 :param func: 入口方法 :return: 装饰后的方法 """ # 路由表 signal_ = Signal() @functools.wraps(func) def wrapper(arg0, *arg...
[ "blinker.Signal", "functools.wraps" ]
[((257, 265), 'blinker.Signal', 'Signal', ([], {}), '()\n', (263, 265), False, 'from blinker import Signal\n'), ((272, 293), 'functools.wraps', 'functools.wraps', (['func'], {}), '(func)\n', (287, 293), False, 'import functools\n')]
from Simulation.calculation_status import CalculationStatus from Simulation.exponential_moving_average import ExponentialMovingAverage __author__ = 'raymond' class Mcad: ema15_constant = 15 ema40_constant = 40 def __init__(self): self.ema15 = ExponentialMovingAverage(Mcad.ema15_constant) self.ema40 = Exponen...
[ "Simulation.exponential_moving_average.ExponentialMovingAverage" ]
[((252, 297), 'Simulation.exponential_moving_average.ExponentialMovingAverage', 'ExponentialMovingAverage', (['Mcad.ema15_constant'], {}), '(Mcad.ema15_constant)\n', (276, 297), False, 'from Simulation.exponential_moving_average import ExponentialMovingAverage\n'), ((313, 358), 'Simulation.exponential_moving_average.Ex...
import math from collections import OrderedDict import logging logger = logging.getLogger(__name__) import numpy as np import torch import tensorflow as tf from paragen.generators import AbstractGenerator, register_generator from paragen.utils.io import remove from paragen.utils.runtime import Environment @register...
[ "logging.getLogger", "paragen.utils.runtime.Environment", "collections.OrderedDict", "tensorflow.device", "tensorflow.io.gfile.GFile", "operator.attrgetter", "tensorflow.math.cos", "tensorflow.math.sin", "torch.from_numpy", "h5py.File", "tensorflow.range", "numpy.concatenate", "paragen.utils...
[((72, 99), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (89, 99), False, 'import logging\n'), ((9774, 10507), 'collections.OrderedDict', 'OrderedDict', (["{'multihead_norm_scale': 'self_attn_norm.weight', 'multihead_norm_bias':\n 'self_attn_norm.bias', 'multihead_project_kernel_qkv'...
# ---------------------------------------------------------------------- # | # | StringSerialization_UnitTest.py # | # | <NAME> <<EMAIL>> # | 2018-04-26 22:06:18 # | # ---------------------------------------------------------------------- # | # | Copyright <NAME> 2018-22. # | Distributed under the Bo...
[ "datetime.datetime", "CommonEnvironment.TypeInfo.FundamentalTypes.Serialization.StringSerialization.RegularExpressionVisitor.OnDateTime", "CommonEnvironment.TypeInfo.FundamentalTypes.Serialization.StringSerialization.RegularExpressionVisitor.OnDuration", "uuid.UUID", "datetime.time", "CommonEnvironment.Ty...
[((1188, 1220), 'CommonEnvironment.ThisFullpath', 'CommonEnvironment.ThisFullpath', ([], {}), '()\n', (1218, 1220), False, 'import CommonEnvironment\n'), ((1250, 1281), 'os.path.split', 'os.path.split', (['_script_fullpath'], {}), '(_script_fullpath)\n', (1263, 1281), False, 'import os\n'), ((17391, 17465), 'datetime.d...
""" Models Dealing with Payments """ from django.contrib.auth.models import User from django.db.models import Model, ForeignKey, CharField, IntegerField, TextField, DateField, DateTimeField from django.utils import timezone class Payment(Model): SHARES = 'shares' SAVINGS = 'savings' FINE = 'fine' OPER...
[ "django.db.models.DateField", "django.db.models.TextField", "django.db.models.IntegerField", "django.db.models.ForeignKey", "django.utils.timezone.now", "django.db.models.DateTimeField", "django.db.models.CharField" ]
[((741, 782), 'django.db.models.ForeignKey', 'ForeignKey', (['User'], {'related_name': '"""payments"""'}), "(User, related_name='payments')\n", (751, 782), False, 'from django.db.models import Model, ForeignKey, CharField, IntegerField, TextField, DateField, DateTimeField\n'), ((794, 840), 'django.db.models.CharField',...
#!/usr/bin/env python # -*- encoding: utf-8 -*- """This script demonstrates the use of the tiling generators to draw some simple grids. When run from the command-line, it generates three images which demonstrate black-and-white tilings of the plain. """ from PIL import Image, ImageDraw from specktre.tilings import ...
[ "PIL.Image.new", "PIL.ImageDraw.Draw" ]
[((629, 679), 'PIL.Image.new', 'Image.new', (['"""L"""'], {'size': '(CANVAS_WIDTH, CANVAS_HEIGHT)'}), "('L', size=(CANVAS_WIDTH, CANVAS_HEIGHT))\n", (638, 679), False, 'from PIL import Image, ImageDraw\n'), ((751, 769), 'PIL.ImageDraw.Draw', 'ImageDraw.Draw', (['im'], {}), '(im)\n', (765, 769), False, 'from PIL import ...
# -*- coding: utf-8 -*- from django.urls import path # Uncomment the next two lines to enable the admin: import xadmin xadmin.autodiscover() # version模块自动注册需要版本控制的 Model from xadmin.plugins import xversion xversion.register_models() from django.contrib import admin urlpatterns = [ path(r'admin/', admin.site.url...
[ "django.urls.path", "xadmin.plugins.xversion.register_models", "xadmin.autodiscover" ]
[((120, 141), 'xadmin.autodiscover', 'xadmin.autodiscover', ([], {}), '()\n', (139, 141), False, 'import xadmin\n'), ((208, 234), 'xadmin.plugins.xversion.register_models', 'xversion.register_models', ([], {}), '()\n', (232, 234), False, 'from xadmin.plugins import xversion\n'), ((290, 321), 'django.urls.path', 'path',...
import collections.abc from itertools import product from typing import Sequence, Any, overload, Iterable, Union, Dict from coba.contexts import CobaContext from coba.registry import JsonMakerV1, CobaRegistry, JsonMakerV2 from coba.pipes import Source, JsonDecode, UrlSource, Pipes from coba.exceptions import CobaExce...
[ "coba.contexts.CobaContext.logger.log", "coba.pipes.UrlSource", "coba.exceptions.CobaException", "coba.pipes.JsonDecode", "coba.pipes.Pipes.join", "itertools.product", "coba.registry.JsonMakerV1", "coba.registry.JsonMakerV2" ]
[((653, 667), 'coba.pipes.UrlSource', 'UrlSource', (['arg'], {}), '(arg)\n', (662, 667), False, 'from coba.pipes import Source, JsonDecode, UrlSource, Pipes\n'), ((2527, 2541), 'coba.pipes.UrlSource', 'UrlSource', (['arg'], {}), '(arg)\n', (2536, 2541), False, 'from coba.pipes import Source, JsonDecode, UrlSource, Pipe...
from analyzer import Analyzer class RangeCharAnalyzer(Analyzer): """Parses one input character (first of the sequence), if it is in-between a fixed range""" def analyze(self, text, init_pos, end_pos, super_result): self.result = [] # initially creates an empty result self.state = 1000 # ass...
[ "analyzer.Analyzer.__init__" ]
[((828, 851), 'analyzer.Analyzer.__init__', 'Analyzer.__init__', (['self'], {}), '(self)\n', (845, 851), False, 'from analyzer import Analyzer\n'), ((1105, 1128), 'analyzer.Analyzer.__init__', 'Analyzer.__init__', (['self'], {}), '(self)\n', (1122, 1128), False, 'from analyzer import Analyzer\n'), ((2561, 2584), 'analy...
"""The code in this module is used when a patient module does not have `__doc_url__`, or that `__doc_url__` has failed to resolve. """ import json from urllib.request import urlopen # By default this'll be pypi.org, but can be package index mirror, or an # internal package index. API_BASE_URL = "https://pypi.org" AP...
[ "json.load" ]
[((750, 765), 'json.load', 'json.load', (['resp'], {}), '(resp)\n', (759, 765), False, 'import json\n')]
import argparse import os import mmcv import torch from mmcv import Config, DictAction from mmcv.parallel import MMDataParallel, MMDistributedDataParallel from mmcv.runner import get_dist_info, init_dist, load_checkpoint from tools.fuse_conv_bn import fuse_module from mmdet.apis import multi_gpu_test, single_gpu_test...
[ "mmcv.Config.fromfile", "mmdet.datasets.build_dataset", "argparse.ArgumentParser" ]
[((652, 720), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""MMDet test (and eval) a model"""'}), "(description='MMDet test (and eval) a model')\n", (675, 720), False, 'import argparse\n'), ((1182, 1210), 'mmcv.Config.fromfile', 'Config.fromfile', (['args.config'], {}), '(args.config)\n'...
#!/usr/bin/env python import rospy from std_msgs.msg import Int32, Bool,Header, Float64 from geometry_msgs.msg import PoseStamped, Pose from styx_msgs.msg import TrafficLightArray, TrafficLight from styx_msgs.msg import Lane from sensor_msgs.msg import Image from cv_bridge import CvBridge from light_classification.tl_c...
[ "rospy.logerr", "PyKDL.Rotation.Quaternion", "rospy.logwarn", "rospy.init_node", "math.sqrt", "yaml.load", "tf.TransformListener", "cv_bridge.CvBridge", "styx_msgs.msg.TrafficLight", "rospy.spin", "std_msgs.msg.Bool", "rospy.Subscriber", "rospy.get_param", "std_msgs.msg.Int32", "light_cl...
[((578, 608), 'rospy.init_node', 'rospy.init_node', (['"""tl_detector"""'], {}), "('tl_detector')\n", (593, 608), False, 'import rospy\n'), ((1096, 1156), 'rospy.Subscriber', 'rospy.Subscriber', (['"""/current_pose"""', 'PoseStamped', 'self.pose_cb'], {}), "('/current_pose', PoseStamped, self.pose_cb)\n", (1112, 1156),...
""" test_fitting_tanh.py Author: <NAME> Affiliation: University of Colorado at Boulder Created on: Mon May 12 14:19:33 MDT 2014 Description: Can run this in parallel. """ import time, ares import numpy as np import matplotlib.pyplot as pl # These go to every calculation base_pars = \ { 'problem_type': 101, 'tan...
[ "ares.inference.Priors.UniformPrior", "ares.inference.PriorSet", "ares.inference.FitGlobal21cm", "ares.inference.Priors.GaussianPrior", "time.time", "numpy.arange" ]
[((544, 585), 'ares.inference.FitGlobal21cm', 'ares.inference.FitGlobal21cm', ([], {}), '(**base_pars)\n', (572, 585), False, 'import time, ares\n'), ((857, 882), 'ares.inference.PriorSet', 'ares.inference.PriorSet', ([], {}), '()\n', (880, 882), False, 'import time, ares\n'), ((1365, 1376), 'time.time', 'time.time', (...
# -*- coding: utf-8 -*- from django.utils import timezone from django.utils.dateparse import parse_datetime from django.contrib.auth.models import User, Group from rest_framework import status from rest_framework.test import APITestCase from v1.models.Board import Boards from v1.models.Permissions import Permissions...
[ "v1.models.UserBoardPermissions.UserBoardPermissions.objects.create", "v1.models.GroupBoardPermissions.GroupBoardPermissions.objects.create", "v1.models.State.States.objects.create", "v1.models.Permissions.Permissions.objects.create", "django.utils.timezone.now", "django.utils.timezone.timedelta", "v1.m...
[((629, 667), 'django.contrib.auth.models.User.objects.create', 'User.objects.create', ([], {'username': '"""Pepito"""'}), "(username='Pepito')\n", (648, 667), False, 'from django.contrib.auth.models import User, Group\n'), ((689, 727), 'django.contrib.auth.models.User.objects.create', 'User.objects.create', ([], {'use...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from . import ...
[ "pulumi.getter", "pulumi.set", "pulumi.ResourceOptions", "pulumi.get" ]
[((2398, 2435), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""firewallGroupId"""'}), "(name='firewallGroupId')\n", (2411, 2435), False, 'import pulumi\n'), ((2796, 2824), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""ipType"""'}), "(name='ipType')\n", (2809, 2824), False, 'import pulumi\n'), ((3888, 3920), ...
import datetime def celcius_to_fahrenheit(celsius): """ Converts a temperature from celcius to fahrenheit :param celsius: The temperature in Celcius :return: The converted fahrenheit temperature """ return round((celsius * 9 / 5) + 32, 2) def get_tomorrow_date(): """ Creates and retu...
[ "datetime.datetime.today", "datetime.timedelta" ]
[((461, 486), 'datetime.datetime.today', 'datetime.datetime.today', ([], {}), '()\n', (484, 486), False, 'import datetime\n'), ((575, 601), 'datetime.timedelta', 'datetime.timedelta', ([], {'days': '(1)'}), '(days=1)\n', (593, 601), False, 'import datetime\n')]