code
stringlengths
22
1.05M
apis
listlengths
1
3.31k
extract_api
stringlengths
75
3.25M
import os, re from lxml import etree from file_paths import etl_source, etl_dest from Section import Section class EchoTarget: def __init__(self, out_path = etl_dest): self.level = 0 self.ent_id = None self.form = None self.pos = None self.ss_id = None self.synset = None self.tx_pos = Section('Wor...
[ "lxml.etree.parse", "Section.Section" ]
[((308, 375), 'Section.Section', 'Section', (['"""WordNet"""', '"""tx-pos"""', "(out_path + '/WordNet')"], {'num_rows': '(10000)'}), "('WordNet', 'tx-pos', out_path + '/WordNet', num_rows=10000)\n", (315, 375), False, 'from Section import Section\n'), ((394, 461), 'Section.Section', 'Section', (['"""WordNet"""', '"""tx...
from __future__ import annotations from typing import Union, Tuple, List import warnings import numpy as np class Question: """Question is a thershold/matching concept for splitting the node of the Decision Tree Args: column_index (int): Column index to be chosen from the array passed at the matching...
[ "numpy.mean", "numpy.unique", "numpy.square", "numpy.array", "warnings.warn", "numpy.log2", "numpy.var" ]
[((4092, 4124), 'numpy.unique', 'np.unique', (['a'], {'return_counts': '(True)'}), '(a, return_counts=True)\n', (4101, 4124), True, 'import numpy as np\n'), ((4464, 4498), 'numpy.unique', 'np.unique', (['arr'], {'return_counts': '(True)'}), '(arr, return_counts=True)\n', (4473, 4498), True, 'import numpy as np\n'), ((4...
""" Utilities for creating simulated data sets. """ from typing import Optional, Sequence import numpy as np import pandas as pd from scipy.linalg import toeplitz from ..api import AllTracker __all__ = ["sim_data"] __tracker = AllTracker(globals()) def sim_data( n: int = 100, intercept: float = -5, t...
[ "numpy.random.normal", "numpy.ones", "numpy.random.multivariate_normal", "numpy.fill_diagonal", "numpy.exp", "numpy.array", "numpy.linspace", "scipy.linalg.toeplitz", "numpy.zeros", "numpy.random.seed", "numpy.random.uniform", "numpy.sin", "numpy.arange" ]
[((3611, 3640), 'numpy.random.seed', 'np.random.seed', ([], {'seed': 'seed_val'}), '(seed=seed_val)\n', (3625, 3640), True, 'import numpy as np\n'), ((3765, 3795), 'numpy.array', 'np.array', (['[[2, 1.3], [1.3, 2]]'], {}), '([[2, 1.3], [1.3, 2]])\n', (3773, 3795), True, 'import numpy as np\n'), ((3849, 3897), 'numpy.ra...
import math import brownie from brownie import chain def test_only_distributor_allowed(alice, stream): with brownie.reverts("dev: only distributor"): stream.notify_reward_amount(10 ** 18, {"from": alice}) def test_retrieves_reward_token(bob, stream, reward_token): stream.notify_reward_amount(10 ** ...
[ "brownie.reverts", "math.isclose", "brownie.chain.sleep" ]
[((762, 784), 'brownie.chain.sleep', 'chain.sleep', (['(86400 * 5)'], {}), '(86400 * 5)\n', (773, 784), False, 'from brownie import chain\n'), ((1037, 1102), 'math.isclose', 'math.isclose', (['post_notify', '(10 ** 18 / (86400 * 10))'], {'rel_tol': '(1e-05)'}), '(post_notify, 10 ** 18 / (86400 * 10), rel_tol=1e-05)\n',...
import wavefront_dispatch import random @wavefront_dispatch.wrapper def handle(ctx, payload): # Fibonacci f_2, f_1 = 0, 1 for n in range(random.randint(800, 900)): f = f_1 + f_2 f_2, f_1 = f_1, f # Customized metrics registry = wavefront_dispatch.get_registry() # Report Gauge...
[ "wavefront_dispatch.get_registry", "random.randint" ]
[((267, 300), 'wavefront_dispatch.get_registry', 'wavefront_dispatch.get_registry', ([], {}), '()\n', (298, 300), False, 'import wavefront_dispatch\n'), ((151, 175), 'random.randint', 'random.randint', (['(800)', '(900)'], {}), '(800, 900)\n', (165, 175), False, 'import random\n')]
import itertools import logging from typing import Any, Dict, Set, Tuple from pycoin.coins.bitcoin import Tx as pycoin_tx from electrum_gui.common.basic.functional.require import require from electrum_gui.common.coin import data as coin_data from electrum_gui.common.conf import settings from electrum_gui.common.provi...
[ "logging.getLogger", "itertools.chain", "electrum_gui.common.provider.chains.btc.sdk.transaction.debug_dump_tx", "electrum_gui.common.basic.functional.require.require", "electrum_gui.common.provider.data.AddressValidation", "electrum_gui.common.provider.chains.btc.sdk.network.get_network_by_chain_code", ...
[((658, 688), 'logging.getLogger', 'logging.getLogger', (['"""app.chain"""'], {}), "('app.chain')\n", (675, 688), False, 'import logging\n'), ((3087, 3204), 'electrum_gui.common.provider.data.AddressValidation', 'data.AddressValidation', ([], {'normalized_address': 'address', 'display_address': 'address', 'is_valid': '...
from __future__ import print_function import torch import torch.nn as nn import torch.optim as optim import torch.backends.cudnn as cudnn import os, sys from tensorboardX import SummaryWriter import time import numpy as np import pprint import socket import pickle from resnet import * from kwng import * from gaussi...
[ "torch.manual_seed", "torch.optim.SGD", "tensorboardX.SummaryWriter", "torch.nn.CrossEntropyLoss", "os.makedirs", "torch.optim.lr_scheduler.MultiStepLR", "torch.load", "os.path.join", "torch.nn.DataParallel", "torch.tensor", "os.path.isdir", "torch.cuda.is_available", "pprint.PrettyPrinter",...
[((4759, 4816), 'torch.save', 'torch.save', (['state', "(checkpoint_dir + '/checkpoint/ckpt.t7')"], {}), "(state, checkpoint_dir + '/checkpoint/ckpt.t7')\n", (4769, 4816), False, 'import torch\n'), ((410, 438), 'torch.manual_seed', 'torch.manual_seed', (['args.seed'], {}), '(args.seed)\n', (427, 438), False, 'import to...
""" Copyright 2021 <NAME> """ # built-in import argparse from typing import List, Generator, Optional, Tuple, Union # dual_tape import dual_tape as dt from . import assembler from . import error from . import vm from .log import enable_log class DualTapeAPI(error.DualTapeError): @classmethod def hit_timeout...
[ "argparse.ArgumentParser" ]
[((493, 541), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""dual_tape"""'}), "(description='dual_tape')\n", (516, 541), False, 'import argparse\n')]
""" https://stackoverflow.com/questions/4827207/how-do-i-filter-the-pyqt-qcombobox-items-based-on-the-text-input """ import sys from Qt import QtCore from Qt import QtWidgets class ExtendedCombo(QtWidgets.QComboBox): def __init__(self, parent=None): super(ExtendedCombo, self).__init__(parent) sel...
[ "Qt.QtWidgets.QCompleter", "Qt.QtWidgets.QApplication", "Qt.QtWidgets.QSortFilterProxyModel", "Qt.QtWidgets.QStandardItem", "Qt.QtWidgets.QStandardItemModel" ]
[((1646, 1674), 'Qt.QtWidgets.QApplication', 'QtWidgets.QApplication', (['argv'], {}), '(argv)\n', (1668, 1674), False, 'from Qt import QtWidgets\n'), ((1688, 1718), 'Qt.QtWidgets.QStandardItemModel', 'QtWidgets.QStandardItemModel', ([], {}), '()\n', (1716, 1718), False, 'from Qt import QtWidgets\n'), ((416, 442), 'Qt....
from distutils.core import setup, Extension cGeo = Extension("cGeo", sources = ["cGeo.c"]) setup (name = "cGeo", version = "0.1", author = "<NAME>", description = "Fast geometric functionality.", ext_modules = [cGeo])
[ "distutils.core.Extension", "distutils.core.setup" ]
[((52, 89), 'distutils.core.Extension', 'Extension', (['"""cGeo"""'], {'sources': "['cGeo.c']"}), "('cGeo', sources=['cGeo.c'])\n", (61, 89), False, 'from distutils.core import setup, Extension\n'), ((93, 213), 'distutils.core.setup', 'setup', ([], {'name': '"""cGeo"""', 'version': '"""0.1"""', 'author': '"""<NAME>"""'...
import json from codegen import json_definitions as jd from codegen import json_writer as jw from codegen import fblas_routine from codegen import fblas_types import codegen.generator_definitions as gd from codegen.fblas_helper import FBLASHelper import logging import os import jinja2 from typing import List class Ho...
[ "logging.basicConfig", "logging.getLogger", "codegen.json_writer.add_commons", "codegen.json_writer.add_incy", "jinja2.Environment", "codegen.json_writer.add_item", "codegen.json_writer.add_incx", "codegen.json_writer.write_to_file", "os.path.dirname", "jinja2.make_logging_undefined", "jinja2.Fi...
[((1100, 1177), 'codegen.json_writer.write_to_file', 'jw.write_to_file', (["(self._output_path + 'generated_routines.json')", 'json_content'], {}), "(self._output_path + 'generated_routines.json', json_content)\n", (1116, 1177), True, 'from codegen import json_writer as jw\n'), ((1558, 1603), 'jinja2.FileSystemLoader',...
# coding=utf-8 """Batch convert the world traj in actev to carla traj.""" import argparse import os from glob import glob from tqdm import tqdm import sys if sys.version_info > (3, 0): import subprocess as commands else: import commands parser = argparse.ArgumentParser() parser.add_argument("traj_world_path") pa...
[ "os.path.exists", "commands.getoutput", "os.makedirs", "argparse.ArgumentParser", "tqdm.tqdm", "os.path.join", "os.path.realpath", "os.path.basename" ]
[((253, 278), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (276, 278), False, 'import argparse\n'), ((1908, 1935), 'os.path.exists', 'os.path.exists', (['script_path'], {}), '(script_path)\n', (1922, 1935), False, 'import os\n'), ((1973, 1993), 'tqdm.tqdm', 'tqdm', (['ped_traj_files'], {}), '...
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云(BlueKing) available. Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obt...
[ "django.conf.urls.patterns" ]
[((776, 1076), 'django.conf.urls.patterns', 'patterns', (['"""lpp_test.views"""', "('^$', 'hello')", "('^test$', 'test')", "('^init_business$', 'init_business')", "('^init_host$', 'init_host')", "('^create_business$', 'create_business')", "('^delete_business$', 'delete_business')", "('^search_host$', 'search_host')", "...
# -*- coding:utf-8 -*- #!/usr/bin/env python import os, typing, datetime, glob, warnings, pathlib, pkg_resources from setuptools import setup as setuptools_setup from .cmd import bdist_app,cleanup from ..utility.os import walk_relative_file from ..utility.pkg import cov_to_program_name, cov_program_name_to_module_name...
[ "os.path.exists", "os.listdir", "setuptools.setup", "os.path.join", "os.getcwd", "datetime.datetime.now", "os.path.dirname", "warnings.warn", "pkg_resources.get_distribution", "glob.glob" ]
[((1058, 1085), 'os.path.exists', 'os.path.exists', (['"""README.md"""'], {}), "('README.md')\n", (1072, 1085), False, 'import os, typing, datetime, glob, warnings, pathlib, pkg_resources\n'), ((3942, 3962), 'os.path.exists', 'os.path.exists', (['name'], {}), '(name)\n', (3956, 3962), False, 'import os, typing, datetim...
# Lint as: python3 # Copyright 2019 DeepMind Technologies 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 # # ...
[ "numpy.testing.assert_allclose", "absl.testing.absltest.main", "absl.testing.parameterized.named_parameters", "jax.numpy.array", "jax.grad", "jax.numpy.zeros_like" ]
[((1173, 1371), 'absl.testing.parameterized.named_parameters', 'parameterized.named_parameters', (["('JitOnp', jax.jit, lambda t: t)", "('NoJitOnp', lambda fn: fn, lambda t: t)", "('JitJnp', jax.jit, jax.device_put)", "('NoJitJnp', lambda fn: fn, jax.device_put)"], {}), "(('JitOnp', jax.jit, lambda t: t), (\n 'NoJit...
#!/usr/bin/env python from distutils.core import setup setup(name='oxford_term_dates', version='1.3.0', description='A Python library for translating between real dates and Oxford term dates', author='IT Services, University of Oxford', author_email='<EMAIL>', url='https://github.com/ox-...
[ "distutils.core.setup" ]
[((57, 709), 'distutils.core.setup', 'setup', ([], {'name': '"""oxford_term_dates"""', 'version': '"""1.3.0"""', 'description': '"""A Python library for translating between real dates and Oxford term dates"""', 'author': '"""IT Services, University of Oxford"""', 'author_email': '"""<EMAIL>"""', 'url': '"""https://gith...
# Generated by Django 2.1.2 on 2018-10-12 14:18 from __future__ import absolute_import, unicode_literals from django.db import migrations, models import django_celery_beat.validators import timezone_field.fields class Migration(migrations.Migration): replaces = [ ('django_celery_beat', '0005_add_solarsch...
[ "django.db.migrations.AlterModelOptions", "django.db.models.CharField", "django.db.models.DateTimeField", "django.db.models.BooleanField" ]
[((1396, 1621), 'django.db.migrations.AlterModelOptions', 'migrations.AlterModelOptions', ([], {'name': '"""crontabschedule"""', 'options': "{'ordering': ['month_of_year', 'day_of_month', 'day_of_week', 'hour',\n 'minute', 'timezone'], 'verbose_name': 'crontab', 'verbose_name_plural':\n 'crontabs'}"}), "(name='cr...
# Columnar Transposition Hack per Cracking Codes with Python # https://www.nostarch.com/crackingcodes/ (BSD Licensed) import pyperclip from j_detect_english import is_english from g_decrypt_columnar_transposition_cipher import decrypt_message as decrypt def hack_transposition(text): print('Press Ctrl-C to quit a...
[ "pyperclip.copy", "j_detect_english.is_english", "g_decrypt_columnar_transposition_cipher.decrypt_message" ]
[((482, 500), 'g_decrypt_columnar_transposition_cipher.decrypt_message', 'decrypt', (['key', 'text'], {}), '(key, text)\n', (489, 500), True, 'from g_decrypt_columnar_transposition_cipher import decrypt_message as decrypt\n'), ((538, 564), 'j_detect_english.is_english', 'is_english', (['decrypted_text'], {}), '(decrypt...
# -*- coding: utf-8 -*- """ test queen """ __author__ = "<NAME> <<EMAIL>>" __copyright__ = "3-clause BSD License" __version__ = '1.0' __date__ = "15 January 2015" from nose.tools import assert_equal import dis from progressmonitor.formatter import (progressbar_formatter_factory, ...
[ "nose.tools.assert_equal", "progressmonitor.util.call_with" ]
[((751, 787), 'progressmonitor.util.call_with', 'call_with', (['rate_rule_factory', 'kwargs'], {}), '(rate_rule_factory, kwargs)\n', (760, 787), False, 'from progressmonitor.util import call_with\n'), ((797, 833), 'progressmonitor.util.call_with', 'call_with', (['span_rule_factory', 'kwargs'], {}), '(span_rule_factory,...
import socket import time import random import logging from _thread import start_new_thread from threading import Lock import utils class Channel: MAX_CONNECTION = 100 BUFFER_SIZE = 65536 CHANNEL_PORT = 10000 CLIENT_PORTS = { 0: 10001, 1: 10002, 2: 10003 } SERVER_PORTS...
[ "logging.getLogger", "utils.send_message", "random.uniform", "socket.socket", "threading.Lock", "logging.Formatter", "time.sleep", "utils.read_first_blockchain", "logging.FileHandler", "utils.receive_message", "socket.gethostname", "_thread.start_new_thread" ]
[((662, 686), 'random.uniform', 'random.uniform', (['(1.0)', '(5.0)'], {}), '(1.0, 5.0)\n', (676, 686), False, 'import random\n'), ((695, 712), 'time.sleep', 'time.sleep', (['delay'], {}), '(delay)\n', (705, 712), False, 'import time\n'), ((862, 868), 'threading.Lock', 'Lock', ([], {}), '()\n', (866, 868), False, 'from...
#!~/envs/udacity-python-env import turtle def draw_flower(some_turtle): for i in range(1, 3): some_turtle.forward(100) some_turtle.right(60) some_turtle.forward(100) some_turtle.right(120) def draw_art(): window = turtle.Screen() window.bgcolor("grey") # Create the ...
[ "turtle.Screen", "turtle.Turtle" ]
[((259, 274), 'turtle.Screen', 'turtle.Screen', ([], {}), '()\n', (272, 274), False, 'import turtle\n'), ((360, 375), 'turtle.Turtle', 'turtle.Turtle', ([], {}), '()\n', (373, 375), False, 'import turtle\n')]
from tornado import httpserver from tornado import gen from tornado.ioloop import IOLoop import tornado.web class MainHandler(tornado.web.RequestHandler): def get(self): self.write('Hello, world') class Application(tornado.web.Application): def __init__(self): handlers = [ (r"/?", ...
[ "tornado.ioloop.IOLoop.instance" ]
[((460, 477), 'tornado.ioloop.IOLoop.instance', 'IOLoop.instance', ([], {}), '()\n', (475, 477), False, 'from tornado.ioloop import IOLoop\n')]
#!/usr/bin/env python3 """ Evolve network architecture on a classification dataset, while at the same time training the weights with one of several learning algorithms. """ import joblib import time import torch.utils.data import logging import numpy as np import copy import os import pickle from networks import Weigh...
[ "numpy.random.rand", "numpy.array", "copy.deepcopy", "utils.init_output", "utils.store_performance", "logging.info", "utils.write_champion_info", "utils.log_champion_info", "utils.load_params", "numpy.maximum", "learning.get_performance_value", "learning.train", "networks.WeightLearningNetwo...
[((582, 612), 'utils.load_params', 'utils.load_params', ([], {'mode': '"""wlnn"""'}), "(mode='wlnn')\n", (599, 612), False, 'import utils\n'), ((697, 760), 'utils.init_output', 'utils.init_output', (['params'], {'overwrite': "params['overwrite_output']"}), "(params, overwrite=params['overwrite_output'])\n", (714, 760),...
import time as t import hashlib class Calibrate: """ Calibration class for CPU mining """ def __init__(self): pass def calibrate(self): """ Calibrates the cpu power """ time_started = t.time() for x in range(10000000): hashlib.sha512('hash'.encode()) hashlib.blake2b('hash'.encode()) time_finished ...
[ "time.time" ]
[((196, 204), 'time.time', 't.time', ([], {}), '()\n', (202, 204), True, 'import time as t\n'), ((322, 330), 'time.time', 't.time', ([], {}), '()\n', (328, 330), True, 'import time as t\n'), ((1205, 1213), 'time.time', 't.time', ([], {}), '()\n', (1211, 1213), True, 'import time as t\n'), ((1381, 1389), 'time.time', 't...
""" This module use the networkx package to deal with graphs. """ from networkx import Graph, shortest_path from networkx.algorithms.shortest_paths.unweighted import all_pairs_shortest_path from networkx.algorithms.shortest_paths.unweighted import single_source_shortest_path import constants as c def build_networkXG...
[ "networkx.algorithms.shortest_paths.unweighted.single_source_shortest_path", "networkx.Graph", "networkx.algorithms.shortest_paths.unweighted.all_pairs_shortest_path" ]
[((444, 451), 'networkx.Graph', 'Graph', ([], {}), '()\n', (449, 451), False, 'from networkx import Graph, shortest_path\n'), ((996, 1022), 'networkx.algorithms.shortest_paths.unweighted.all_pairs_shortest_path', 'all_pairs_shortest_path', (['g'], {}), '(g)\n', (1019, 1022), False, 'from networkx.algorithms.shortest_pa...
""" import peewee, datetime, argparse from database.database import db from database.models import SQLAuthToken from utils.security.auth import gen_account_keypair """ from utils.security.auth import gen_account_keypair from database.database import PGDatabase if __name__ == "__main__": """ parser = argparse....
[ "utils.security.auth.gen_account_keypair", "database.database.PGDatabase" ]
[((1049, 1061), 'database.database.PGDatabase', 'PGDatabase', ([], {}), '()\n', (1059, 1061), False, 'from database.database import PGDatabase\n'), ((1097, 1118), 'utils.security.auth.gen_account_keypair', 'gen_account_keypair', ([], {}), '()\n', (1116, 1118), False, 'from utils.security.auth import gen_account_keypair...
import os import sys import numpy as np import time from utils_io import get_job_config from utils.model_utils import read_data from utils.args import parse_job_args from fedsem import Fedsem_Trainer from fedavg import Fedavg_Trainer from fedprox import Fedprox_Trainer from fedsgd import Fedsgd_Trainer from fedbaye...
[ "fedbayes.Fedbayes_Sing_Trainer", "fedprox.Fedprox_Trainer", "os.path.join", "utils.args.parse_job_args", "fedsgd.Fedsgd_Trainer", "modelsaver.Model_Saver", "utils.model_utils.read_data", "numpy.array", "fedsem.Fedsem_Trainer", "utils_io.get_job_config", "fedavg.Fedavg_Trainer", "os.path.expan...
[((430, 496), 'os.path.join', 'os.path.join', (['""".."""', '"""configs"""', 'args.experiment', 'args.configuration'], {}), "('..', 'configs', args.experiment, args.configuration)\n", (442, 496), False, 'import os\n'), ((507, 532), 'utils_io.get_job_config', 'get_job_config', (['yaml_file'], {}), '(yaml_file)\n', (521,...
import argparse import os import re def main(args): folder_path = os.path.join('..', 'exp', args.dataset) res = re.compile('Best val accuracy: ([.\d]+)') best_acc = 0 best_model = None for folder in os.listdir(folder_path): train_hist_file = os.path.join(folder_path, folder, 'train_history...
[ "os.listdir", "argparse.ArgumentParser", "re.compile", "os.path.join", "os.path.isfile" ]
[((71, 110), 'os.path.join', 'os.path.join', (['""".."""', '"""exp"""', 'args.dataset'], {}), "('..', 'exp', args.dataset)\n", (83, 110), False, 'import os\n'), ((121, 163), 're.compile', 're.compile', (['"""Best val accuracy: ([.\\\\d]+)"""'], {}), "('Best val accuracy: ([.\\\\d]+)')\n", (131, 163), False, 'import re\...
import os.path from setuptools import setup version = "0.1" install_requires = ["pyramid", "PyJWT", "cryptography", "requests", "zope.interface"] tests_require = ["pytest", "pytest-flake8", "requests-mock", "WebTest"] here = os.path.abspath(os.path.dirname(__file__)) README = open(os.path.join(here, "README.rst"))....
[ "setuptools.setup" ]
[((385, 1414), 'setuptools.setup', 'setup', ([], {'name': '"""pyramid_iap"""', 'version': 'version', 'description': '"""Google Cloud Identity-Aware Proxy authentication policy for Pyramid"""', 'long_description': "(README + '\\n\\n' + CHANGES)", 'keywords': '"""Pyramid JWT IAP authentication security"""', 'classifiers'...
import urllib2 import json global base_url global auth_key global ticket def get_ticket(): url = base_url + "/alfresco/service/api/login" headers = {"Content-Type": "application/json"} data = auth_key try: response = make_post_request(url, data, headers) return json.load(response).get...
[ "urllib2.Request", "json.dumps", "urllib2.urlopen", "json.load" ]
[((486, 506), 'urllib2.Request', 'urllib2.Request', (['url'], {}), '(url)\n', (501, 506), False, 'import urllib2\n'), ((596, 620), 'urllib2.urlopen', 'urllib2.urlopen', (['request'], {}), '(request)\n', (611, 620), False, 'import urllib2\n'), ((680, 700), 'urllib2.Request', 'urllib2.Request', (['url'], {}), '(url)\n', ...
from cjax.continuation.methods.predictor.base_predictor import Predictor from cjax.utils.math_trees import pytree_element_add class NaturalPredictor(Predictor): """Natural Predictor only updates continuation parameter""" def __init__(self, concat_states, delta_s): super().__init__(concat_states) ...
[ "cjax.utils.math_trees.pytree_element_add" ]
[((649, 695), 'cjax.utils.math_trees.pytree_element_add', 'pytree_element_add', (['self._bparam', 'self.delta_s'], {}), '(self._bparam, self.delta_s)\n', (667, 695), False, 'from cjax.utils.math_trees import pytree_element_add\n')]
from pydantic import EmailStr from awesome_sso.mail.mailgun import MailGun def test_send_message(mailgun: MailGun): resp = mailgun.send_simple_message( from_name="test", from_email=EmailStr("<EMAIL>"), to=[EmailStr("<EMAIL>")], subject="test title", text="test content", ...
[ "pydantic.EmailStr" ]
[((204, 223), 'pydantic.EmailStr', 'EmailStr', (['"""<EMAIL>"""'], {}), "('<EMAIL>')\n", (212, 223), False, 'from pydantic import EmailStr\n'), ((464, 483), 'pydantic.EmailStr', 'EmailStr', (['"""<EMAIL>"""'], {}), "('<EMAIL>')\n", (472, 483), False, 'from pydantic import EmailStr\n'), ((237, 256), 'pydantic.EmailStr',...
# Copyright 2021 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
[ "onnxruntime.transformers.fusion_options.FusionOptions.parse", "transformers.onnx.validate_model_outputs" ]
[((1473, 1573), 'transformers.onnx.validate_model_outputs', 'validate_model_outputs', (['onnx_config', 'tokenizer', 'model', 'args.output', 'onnx_outputs'], {'atol': 'args.atol'}), '(onnx_config, tokenizer, model, args.output,\n onnx_outputs, atol=args.atol)\n', (1495, 1573), False, 'from transformers.onnx import va...
from django.db import models from django.utils.translation import ugettext as _ from django.contrib.postgres.fields import JSONField from django.conf import settings class Profile(models.Model): mobile_number = JSONField(default={}) user = models.OneToOneField( settings.AUTH_USER_MODEL, on_del...
[ "django.db.models.OneToOneField", "django.contrib.postgres.fields.JSONField", "django.db.models.BooleanField" ]
[((217, 238), 'django.contrib.postgres.fields.JSONField', 'JSONField', ([], {'default': '{}'}), '(default={})\n', (226, 238), False, 'from django.contrib.postgres.fields import JSONField\n'), ((250, 350), 'django.db.models.OneToOneField', 'models.OneToOneField', (['settings.AUTH_USER_MODEL'], {'on_delete': 'models.CASC...
import pygame from pygame.locals import * from constants import * from pacman import Pacman, LifeIcon from nodes import NodeGroup from ghosts import GhostGroup from pellets import Pellets_Group from sprites import Spritesheet from maze import Maze from welcome import Welcome class GameController: """ This the...
[ "pygame.init", "pacman.Pacman", "pygame.event.get", "pygame.surface.Surface", "pygame.display.set_mode", "pygame.time.Clock", "maze.Maze", "pacman.LifeIcon", "sprites.Spritesheet", "pellets.Pellets_Group", "nodes.NodeGroup", "pygame.display.update", "ghosts.GhostGroup" ]
[((536, 549), 'pygame.init', 'pygame.init', ([], {}), '()\n', (547, 549), False, 'import pygame\n'), ((708, 750), 'pygame.display.set_mode', 'pygame.display.set_mode', (['SCREENSIZE', '(0)', '(32)'], {}), '(SCREENSIZE, 0, 32)\n', (731, 750), False, 'import pygame\n'), ((833, 852), 'pygame.time.Clock', 'pygame.time.Cloc...
# Written by <NAME> 2021-09-23 import itertools import random import time import phue as hue max_number_of_exercises = 100 enable_hue = True hue_bridge_ip = '10.0.0.169' hue_light_name = 'Stue ved skyvedør høyre' def input_integer_number(message): while True: try: return int(input(message)) ...
[ "phue.Bridge", "random.shuffle", "time.sleep" ]
[((2881, 2906), 'random.shuffle', 'random.shuffle', (['exercises'], {}), '(exercises)\n', (2895, 2906), False, 'import random\n'), ((3698, 3711), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (3708, 3711), False, 'import time\n'), ((1613, 1638), 'phue.Bridge', 'hue.Bridge', (['hue_bridge_ip'], {}), '(hue_bridge_i...
#!/bin/python # Extracts messages.data into headers and the actual message import binascii import pprint import click def hexToStr(byte): return binascii.hexlify(byte).decode() def printByte(label, byte): print(label + ':\t' + hexToStr(byte)) @click.command() @click.argument('path') def extractMessage(pa...
[ "click.argument", "click.command", "binascii.hexlify" ]
[((259, 274), 'click.command', 'click.command', ([], {}), '()\n', (272, 274), False, 'import click\n'), ((276, 298), 'click.argument', 'click.argument', (['"""path"""'], {}), "('path')\n", (290, 298), False, 'import click\n'), ((152, 174), 'binascii.hexlify', 'binascii.hexlify', (['byte'], {}), '(byte)\n', (168, 174), ...
# polar.py Fast floating point cartesian to polar coordinate conversion # Author: <NAME> # 31st Oct 2015 Updated to match latest firmware # 21st April 2015 # Now uses recently implemented FPU mnemonics # Arctan is based on the following approximation applicable to octant zero where q = x/y : # arctan(q) = q*pi/4- q*(q ...
[ "array.array" ]
[((462, 534), 'array.array', 'array', (['"""f"""', '[0.0, 0.0, 1.0, pi, pi / 2, -pi / 2, pi / 4, 0.2447, 0.0663]'], {}), "('f', [0.0, 0.0, 1.0, pi, pi / 2, -pi / 2, pi / 4, 0.2447, 0.0663])\n", (467, 534), False, 'from array import array\n')]
#! /usr/bin/env python3 import rospy import numpy as np import random from geometry_msgs.msg import Twist, Pose from nav_msgs.msg import Odometry from std_srvs.srv import SetBool, Trigger from kr_tracker_msgs.msg import TrajectoryTrackerAction, TrajectoryTrackerGoal, CircleTrackerAction, CircleTrackerGoal from kr_pyt...
[ "random.uniform", "geometry_msgs.msg.Pose", "rospy.logwarn", "rospy.init_node", "kr_python_interface.mav_interface.KrMavInterface", "rospy.sleep", "kr_tracker_msgs.msg.TrajectoryTrackerGoal", "rospy.loginfo", "kr_tracker_msgs.msg.CircleTrackerGoal" ]
[((385, 431), 'rospy.init_node', 'rospy.init_node', (['"""mav_example"""'], {'anonymous': '(True)'}), "('mav_example', anonymous=True)\n", (400, 431), False, 'import rospy\n'), ((513, 548), 'kr_python_interface.mav_interface.KrMavInterface', 'KrMavInterface', (['"""dragonfly"""', 'mav_id'], {}), "('dragonfly', mav_id)\...
from bacprop.bacnet.network import VirtualSensorNetwork from bacprop.bacnet import network from bacpypes.pdu import Address from bacpypes.comm import service_map from bacprop.bacnet.sensor import Sensor from pytest_mock import MockFixture import pytest # Required for full coverage network._debug = 1 class TestVirtu...
[ "bacprop.bacnet.network.get_sensor", "bacpypes.comm.service_map.clear", "bacprop.bacnet.network.VirtualSensorNetwork", "bacprop.bacnet.network.create_sensor", "bacpypes.pdu.Address", "bacprop.bacnet.network._router.bind.assert_called_once_with", "bacprop.bacnet.network._router.mux.close_socket", "bacp...
[((481, 512), 'bacprop.bacnet.network.VirtualSensorNetwork', 'VirtualSensorNetwork', (['"""0.0.0.0"""'], {}), "('0.0.0.0')\n", (501, 512), False, 'from bacprop.bacnet.network import VirtualSensorNetwork\n'), ((719, 750), 'bacprop.bacnet.network.VirtualSensorNetwork', 'VirtualSensorNetwork', (['"""0.0.0.0"""'], {}), "('...
import numpy as np from touchstone.environments.make import make_vec_envs NUM_ENVS = 2 if __name__ == '__main__': env = make_vec_envs("Pendulum-v0", 42, NUM_ENVS) np.random.seed(42) state = env.reset() for i in range(1000): actions = env.action_space.sample() out = env.step([actions f...
[ "touchstone.environments.make.make_vec_envs", "numpy.random.seed" ]
[((126, 168), 'touchstone.environments.make.make_vec_envs', 'make_vec_envs', (['"""Pendulum-v0"""', '(42)', 'NUM_ENVS'], {}), "('Pendulum-v0', 42, NUM_ENVS)\n", (139, 168), False, 'from touchstone.environments.make import make_vec_envs\n'), ((173, 191), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (...
"""Package for playdeliver modules.""" from pkg_resources import get_distribution, DistributionNotFound import os.path try: _dist = get_distribution('playdeliver') # Normalize case for Windows systems dist_loc = os.path.normcase(_dist.location) here = os.path.normcase(__file__) if not here.startswi...
[ "pkg_resources.get_distribution" ]
[((137, 168), 'pkg_resources.get_distribution', 'get_distribution', (['"""playdeliver"""'], {}), "('playdeliver')\n", (153, 168), False, 'from pkg_resources import get_distribution, DistributionNotFound\n')]
""" Consolidate Services Description of all APIs # noqa: E501 The version of the OpenAPI document: version not set Generated by: https://openapi-generator.tech """ import sys import unittest import argocd_python_client from argocd_python_client.model.v1alpha1_application_destination import V1alpha...
[ "unittest.main" ]
[((1552, 1567), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1565, 1567), False, 'import unittest\n')]
#!bin/python3 import os import sys import time import random from datetime import datetime book = sys.argv[1] startChapter = sys.argv[2] endChapter = sys.argv[3] for it in range(int(startChapter), int(endChapter) + 1): # Get random wait time waitTime = random.randrange(2, 5) # Get current time now = d...
[ "random.randrange", "time.sleep", "datetime.datetime.now", "os.popen", "sys.exit" ]
[((263, 285), 'random.randrange', 'random.randrange', (['(2)', '(5)'], {}), '(2, 5)\n', (279, 285), False, 'import random\n'), ((319, 333), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (331, 333), False, 'from datetime import datetime\n'), ((492, 517), 'time.sleep', 'time.sleep', (['(60 * waitTime)'], {})...
from rest_framework import routers from website.api import UserViewSet, PostViewSet, CommentViewSet, \ CategoryViewSet, CrowdViewSet router = routers.SimpleRouter() router.register(r'users', UserViewSet) router.register(r'posts', PostViewSet) router.register(r'categories', CategoryViewSet) router.register(r'commen...
[ "rest_framework.routers.SimpleRouter" ]
[((147, 169), 'rest_framework.routers.SimpleRouter', 'routers.SimpleRouter', ([], {}), '()\n', (167, 169), False, 'from rest_framework import routers\n')]
import numpy as np import asyncio import time import ntplib import json import os import yaml import websockets import threading import uuid import logging MODULE_DIR = os.path.dirname(__file__) with open(os.path.join(MODULE_DIR, "hardwareconstants.yaml"), "r") as f: constants = yaml.load(f, Loader=yaml.FullLoader...
[ "json.loads", "asyncio.new_event_loop", "json.dumps", "os.path.join", "yaml.load", "time.sleep", "uuid.uuid4", "os.path.dirname", "ntplib.NTPClient", "websockets.connect", "threading.Thread", "asyncio.set_event_loop", "time.time" ]
[((170, 195), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (185, 195), False, 'import os\n'), ((206, 256), 'os.path.join', 'os.path.join', (['MODULE_DIR', '"""hardwareconstants.yaml"""'], {}), "(MODULE_DIR, 'hardwareconstants.yaml')\n", (218, 256), False, 'import os\n'), ((285, 321), 'yaml....
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # # Description: generate inputs and targets for the DLRM benchmark # # Utility function(s) to download and pre-process public data sets # - Cr...
[ "os.path.exists", "numpy.transpose", "multiprocessing.Process", "numpy.int32", "numpy.sum", "numpy.zeros", "numpy.random.uniform", "numpy.array", "numpy.concatenate", "sys.exit", "multiprocessing.Manager", "numpy.savez_compressed", "numpy.load" ]
[((1153, 1179), 'os.path.exists', 'os.path.exists', (['filename_i'], {}), '(filename_i)\n', (1167, 1179), False, 'import os\n'), ((3617, 3716), 'numpy.savez_compressed', 'np.savez_compressed', (["(d_path + o_filename + '.npz')"], {'X_cat': 'X_cat', 'X_int': 'X_int', 'y': 'y', 'counts': 'counts'}), "(d_path + o_filename...
from functools import lru_cache from pydantic import BaseSettings, Field class Settings(BaseSettings): LEVEL: str PROJECT_TITLE: str = 'FastAPI with GraphQL and REST' GRAPHQL_API: str = '/graphql' REST_API: str = '/rest' COMMON_API: str = '/api' class Config: env_file = ".env" ...
[ "pydantic.Field" ]
[((371, 398), 'pydantic.Field', 'Field', ([], {'env': '"""DEVELOP_DB_URL"""'}), "(env='DEVELOP_DB_URL')\n", (376, 398), False, 'from pydantic import BaseSettings, Field\n'), ((457, 480), 'pydantic.Field', 'Field', (['"""PRODUCT_DB_URL"""'], {}), "('PRODUCT_DB_URL')\n", (462, 480), False, 'from pydantic import BaseSetti...
""" family_names wordlists """ import os import csv import json from .. import word_list_counter from .. import parse_assoc from .. import dictionaries NAME = 'family_name' raw_nl_family_names_1_path = os.path.join( os.path.dirname(os.path.realpath(__file__)), 'raw', 'DutchNameGenerator', 'MarkovDu...
[ "os.path.realpath" ]
[((241, 267), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (257, 267), False, 'import os\n'), ((424, 450), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (440, 450), False, 'import os\n'), ((623, 649), 'os.path.realpath', 'os.path.realpath', (['__file__'], {})...
#!/usr/bin/env python # # Author: <NAME> (mmckerns @caltech and @uqfoundation) # Copyright (c) 1997-2016 California Institute of Technology. # Copyright (c) 2016-2020 The Uncertainty Quantification Foundation. # License: 3-clause BSD. The full license text is available at: # - https://github.com/uqfoundation/pathos/b...
[ "pathos.helpers.mp_helper.starargs", "pathos.abstract_launcher.AbstractWorkerPool._AbstractWorkerPool__map", "pathos.abstract_launcher.AbstractWorkerPool._AbstractWorkerPool__imap", "itertools.izip", "pathos.helpers.cpu_count", "pathos.helpers.ProcessPool" ]
[((4991, 5058), 'pathos.abstract_launcher.AbstractWorkerPool._AbstractWorkerPool__map', 'AbstractWorkerPool._AbstractWorkerPool__map', (['self', 'f', '*args'], {}), '(self, f, *args, **kwds)\n', (5034, 5058), False, 'from pathos.abstract_launcher import AbstractWorkerPool\n'), ((5242, 5310), 'pathos.abstract_launcher.A...
__copyright__ = "Copyright 2016, http://radical.rutgers.edu" __license__ = "MIT" import radical.utils as ru from .base import LaunchMethod # ------------------------------------------------------------------------------ # class DPlace(LaunchMethod): # -------------------------------------------------------...
[ "radical.utils.which" ]
[((649, 667), 'radical.utils.which', 'ru.which', (['"""dplace"""'], {}), "('dplace')\n", (657, 667), True, 'import radical.utils as ru\n')]
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Jun 23 10:06:05 2021 @author: ngbla """ import os import cv2 import numpy as np # Command: pip install pillow from PIL import Image #Initialize names and path to empty list names = [] path = [] # Get the names of all the users for users in os.list...
[ "numpy.array", "os.listdir", "cv2.face.LBPHFaceRecognizer_create", "PIL.Image.open" ]
[((313, 339), 'os.listdir', 'os.listdir', (['"""img_training"""'], {}), "('img_training')\n", (323, 339), False, 'import os\n'), ((940, 953), 'numpy.array', 'np.array', (['ids'], {}), '(ids)\n', (948, 953), True, 'import numpy as np\n'), ((1170, 1206), 'cv2.face.LBPHFaceRecognizer_create', 'cv2.face.LBPHFaceRecognizer_...
#%% import numpy as np from scipy import integrate import matplotlib.pyplot as plt import matplotlib as mpl import random import time import copy from matplotlib import animation, rc from IPython.display import HTML def _update_plot (i,fig,scat,qax) : scat.set_offsets(P[i]) qax.set_offsets(P[i]) VVV=...
[ "random.uniform", "matplotlib.animation.FuncAnimation", "matplotlib.pyplot.figure", "matplotlib.pyplot.scatter", "copy.deepcopy", "random.randint", "matplotlib.pyplot.show" ]
[((3950, 3962), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (3960, 3962), True, 'import matplotlib.pyplot as plt\n'), ((4139, 4170), 'matplotlib.pyplot.scatter', 'plt.scatter', (['PP[0]', 'PP[1]'], {'s': '(20)'}), '(PP[0], PP[1], s=20)\n', (4150, 4170), True, 'import matplotlib.pyplot as plt\n'), ((4281...
from typing import List, Dict, Optional, Tuple import pandas as pd from datasets import load_dataset from os.path import join from datasets import DatasetDict from nerblackbox.modules.datasets.formatter.base_formatter import ( BaseFormatter, SENTENCES_ROWS, ) SUCX_SUBSETS = [ "original_cased", "origin...
[ "pandas.DataFrame", "os.path.join", "datasets.load_dataset", "pandas.read_csv" ]
[((1778, 1834), 'datasets.load_dataset', 'load_dataset', (['"""KBLab/sucx3_ner"""', 'self.ner_dataset_subset'], {}), "('KBLab/sucx3_ner', self.ner_dataset_subset)\n", (1790, 1834), False, 'from datasets import load_dataset\n'), ((2318, 2356), 'pandas.DataFrame', 'pd.DataFrame', (['sentences_rows_formatted'], {}), '(sen...
import os import sys sys.path.insert(1, f'{os.path.dirname(os.getcwd())}\\models\\') import pandas as pd import requests from Mapper import df_ISO3_mapper def get_PL_table(url): x = requests.get(url) league_table = pd.read_html(x.content)[0] del league_table['Last 6'] return league_table d...
[ "pandas.read_html", "Mapper.df_ISO3_mapper", "requests.get", "os.getcwd" ]
[((193, 210), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (205, 210), False, 'import requests\n'), ((638, 670), 'Mapper.df_ISO3_mapper', 'df_ISO3_mapper', (['pl_table', 'mapper'], {}), '(pl_table, mapper)\n', (652, 670), False, 'from Mapper import df_ISO3_mapper\n'), ((230, 253), 'pandas.read_html', 'pd.r...
from factoryModel.config import mt_config as confFile from factoryModel.preprocessing import SentenceSplit, cleanData, TrainMaker, Embedding from factoryModel.dataLoaders import textLoader from factoryModel.models import ModelBuilding from tensorflow.keras.callbacks import ModelCheckpoint from tensorflow.keras.models i...
[ "factoryModel.preprocessing.Embedding", "factoryModel.preprocessing.TrainMaker", "factoryModel.utils.helperFunctions.save_clean_data", "factoryModel.dataLoaders.textLoader", "factoryModel.preprocessing.cleanData", "tensorflow.keras.callbacks.ModelCheckpoint", "factoryModel.models.ModelBuilding", "fact...
[((459, 479), 'factoryModel.preprocessing.SentenceSplit', 'SentenceSplit', (['(10000)'], {}), '(10000)\n', (472, 479), False, 'from factoryModel.preprocessing import SentenceSplit, cleanData, TrainMaker, Embedding\n'), ((485, 496), 'factoryModel.preprocessing.cleanData', 'cleanData', ([], {}), '()\n', (494, 496), False...
from ..api import _v1 from pathlib import Path from app.error import Error import pandas as pd from app.components._data import dataframeHandler import numpy as np from sklearn.impute import KNNImputer from sklearn import preprocessing # ** ALL CONTENT COMENTED BETWEEN ASTERISCS MUST BE EDITED ** # ** Set the plugin ...
[ "app.components._data.dataframeHandler.getAllData", "app.components._data.dataframeHandler.getDataframe", "app.components._data.dataframeHandler.saveDataframe" ]
[((2221, 2252), 'app.components._data.dataframeHandler.getDataframe', 'dataframeHandler.getDataframe', ([], {}), '()\n', (2250, 2252), False, 'from app.components._data import dataframeHandler\n'), ((3105, 3139), 'app.components._data.dataframeHandler.saveDataframe', 'dataframeHandler.saveDataframe', (['df'], {}), '(df...
from wagtail.admin.edit_handlers import FieldPanel from wagtail.images.edit_handlers import ImageChooserPanel from wagtail_blog.models import BlogPage, BlogIndexPage # Add your Wagtail panels here. BlogIndexPage.content_panels = [ FieldPanel('title', classname="full title"), FieldPanel('headline'), ] BlogPa...
[ "wagtail.admin.edit_handlers.FieldPanel", "wagtail.images.edit_handlers.ImageChooserPanel" ]
[((238, 281), 'wagtail.admin.edit_handlers.FieldPanel', 'FieldPanel', (['"""title"""'], {'classname': '"""full title"""'}), "('title', classname='full title')\n", (248, 281), False, 'from wagtail.admin.edit_handlers import FieldPanel\n'), ((287, 309), 'wagtail.admin.edit_handlers.FieldPanel', 'FieldPanel', (['"""headli...
# -*- coding: utf-8 -*- import os import time import unittest import inspect from mock import patch import requests from configparser import ConfigParser from kb_Amplicon.kb_AmpliconImpl import kb_Amplicon from kb_Amplicon.kb_AmpliconServer import MethodContext from installed_clients.authclient import KBaseAuth as _KB...
[ "os.listdir", "installed_clients.authclient.KBaseAuth", "configparser.ConfigParser", "inspect.stack", "os.environ.get", "installed_clients.WorkspaceClient.Workspace", "kb_Amplicon.kb_AmpliconImpl.kb_Amplicon", "os.path.join", "mock.patch.object", "requests.delete", "kb_Amplicon.Utils.MDSUtils.MD...
[((13524, 13599), 'mock.patch.object', 'patch.object', (['DataFileUtil', '"""file_to_shock"""'], {'side_effect': 'mock_file_to_shock'}), "(DataFileUtil, 'file_to_shock', side_effect=mock_file_to_shock)\n", (13536, 13599), False, 'from mock import patch\n'), ((16098, 16173), 'mock.patch.object', 'patch.object', (['DataF...
# -*- coding: utf-8 -*- """ Helper functions to organize CHDI imaging data Created on Fri Jan 15 11:07:53 2016 @author: <NAME> Python Version: Python 3.5.1 |Anaconda 2.4.1 (64-bit) """ import glob as gl import pandas as pd import numpy as np import os from functools import partial def linear_pred(m,b,x): y = m ...
[ "os.listdir", "numpy.unique", "pandas.read_csv", "numpy.ones", "os.path.join", "os.path.isfile", "numpy.array", "functools.partial", "numpy.isnan", "numpy.concatenate", "pandas.DataFrame" ]
[((20722, 20767), 'os.path.join', 'os.path.join', (['datadir', '"""track_pheno_data.csv"""'], {}), "(datadir, 'track_pheno_data.csv')\n", (20734, 20767), False, 'import os\n'), ((20775, 20799), 'os.path.isfile', 'os.path.isfile', (['pheno_fn'], {}), '(pheno_fn)\n', (20789, 20799), False, 'import os\n'), ((25366, 25393)...
import sys import os import requests from datetime import datetime, timedelta import argparse import json def parseArgs(): parser = argparse.ArgumentParser() parser.add_argument('--startdate', nargs='?', default=getTodayStr(), type=str, help="Provide a start date, for example: 2019-06-13. \nDefaults to today's...
[ "json.loads", "argparse.ArgumentParser", "datetime.datetime.strptime", "requests.get", "datetime.datetime.now", "os.system" ]
[((137, 162), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (160, 162), False, 'import argparse\n'), ((1587, 1601), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (1599, 1601), False, 'from datetime import datetime, timedelta\n'), ((2374, 2414), 'datetime.datetime.strptime', 'datet...
# Copyright (c) 2020 Dell Inc. or its subsidiaries. # 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 requi...
[ "logging.getLogger", "PyPowerFlex.exceptions.PowerFlexClientException", "re.compile", "PyPowerFlex.utils.prepare_params", "PyPowerFlex.exceptions.PowerFlexFailQuerying" ]
[((775, 802), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (792, 802), False, 'import logging\n'), ((1171, 1250), 'PyPowerFlex.utils.prepare_params', 'utils.prepare_params', (["{'volumeId': volume_id, 'snapshotName': name}"], {'dump': '(False)'}), "({'volumeId': volume_id, 'snapshotName...
from adrian.cgen import Include stdlib = Include("stdlib.h") stdint = Include("stdint.h") stdio = Include("stdio.h") assert_ = Include("assert.h")
[ "adrian.cgen.Include" ]
[((43, 62), 'adrian.cgen.Include', 'Include', (['"""stdlib.h"""'], {}), "('stdlib.h')\n", (50, 62), False, 'from adrian.cgen import Include\n'), ((72, 91), 'adrian.cgen.Include', 'Include', (['"""stdint.h"""'], {}), "('stdint.h')\n", (79, 91), False, 'from adrian.cgen import Include\n'), ((100, 118), 'adrian.cgen.Inclu...
from dataclasses import dataclass import pygame import pymunk import pymunk.pygame_util from . import style from . import display from . import structures @dataclass(unsafe_hash=True) class Game: __metaclass__ = structures.IterableObject name = "" entities = {} style = style.GGSTYLE() space:...
[ "pygame.init", "pymunk.pygame_util.DrawOptions", "pygame.quit", "pygame.event.get", "dataclasses.dataclass", "pygame.time.Clock", "pymunk.Space", "pygame.display.set_caption", "pygame.display.update" ]
[((159, 186), 'dataclasses.dataclass', 'dataclass', ([], {'unsafe_hash': '(True)'}), '(unsafe_hash=True)\n', (168, 186), False, 'from dataclasses import dataclass\n'), ((567, 580), 'pygame.init', 'pygame.init', ([], {}), '()\n', (578, 580), False, 'import pygame\n'), ((589, 621), 'pygame.display.set_caption', 'pygame.d...
# TODO: move this to __init__.py? this was in a separate file because # setup.py used to import porcupine but it doesn't do it anymore import os import platform import appdirs from porcupine import __author__ as _author if platform.system() in {'Windows', 'Darwin'}: # these platforms like path names like "Prog...
[ "appdirs.user_cache_dir", "os.makedirs", "appdirs.user_config_dir", "os.path.join", "platform.system", "porcupine.__author__.lower", "os.path.abspath" ]
[((464, 505), 'appdirs.user_cache_dir', 'appdirs.user_cache_dir', (['_appname', '_author'], {}), '(_appname, _author)\n', (486, 505), False, 'import appdirs\n'), ((518, 560), 'appdirs.user_config_dir', 'appdirs.user_config_dir', (['_appname', '_author'], {}), '(_appname, _author)\n', (541, 560), False, 'import appdirs\...
from datetime import time from vnpy.app.cta_strategy import ( CtaTemplate, StopOrder, TickData, BarData, TradeData, OrderData, BarGenerator, ArrayManager ) from vnpy.app.cta_strategy.base import ( EngineType, STOPORDER_PREFIX, StopOrder, StopOrderStatus, ) from vnpy.app.c...
[ "vnpy.app.cta_strategy.TSMtools.TSMArrayManager", "datetime.time", "vnpy.app.cta_strategy.BarGenerator" ]
[((964, 987), 'datetime.time', 'time', ([], {'hour': '(21)', 'minute': '(0)'}), '(hour=21, minute=0)\n', (968, 987), False, 'from datetime import time\n'), ((1015, 1037), 'datetime.time', 'time', ([], {'hour': '(9)', 'minute': '(0)'}), '(hour=9, minute=0)\n', (1019, 1037), False, 'from datetime import time\n'), ((1063,...
from __future__ import print_function import numpy as np import yt from hyperion.model import Model import matplotlib as mpl mpl.use('Agg') import powderday.config as cfg from powderday.grid_construction import yt_octree_generate from powderday.find_order import find_order import powderday.powderday_test_octree as pt...
[ "powderday.helpers.energy_density_absorbed_by_CMB", "numpy.repeat", "powderday.find_order.find_order", "matplotlib.use", "hyperion.model.Model", "hyperion.dust.SphericalDust", "numpy.squeeze", "numpy.max", "numpy.array", "powderday.powderday_test_octree.test_octree", "numpy.min", "powderday.hy...
[((126, 140), 'matplotlib.use', 'mpl.use', (['"""Agg"""'], {}), "('Agg')\n", (133, 140), True, 'import matplotlib as mpl\n'), ((596, 632), 'powderday.grid_construction.yt_octree_generate', 'yt_octree_generate', (['fname', 'field_add'], {}), '(fname, field_add)\n', (614, 632), False, 'from powderday.grid_construction im...
# 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, software # distribu...
[ "fixtures.MonkeyPatch", "ceilometerclient.shell.CeilometerShell", "mock.patch", "testtools.matchers.MatchesRegex", "ceilometerclient.shell.main", "mock.Mock", "sys.stderr.getvalue", "ceilometerclient.exc.HTTPUnauthorized", "ceilometerclient.exc.CommandError", "mock.patch.object", "sys.exc_info",...
[((3955, 3995), 'mock.patch.object', 'mock.patch.object', (['ks_session', '"""Session"""'], {}), "(ks_session, 'Session')\n", (3972, 3995), False, 'import mock\n'), ((4389, 4429), 'mock.patch.object', 'mock.patch.object', (['ks_session', '"""Session"""'], {}), "(ks_session, 'Session')\n", (4406, 4429), False, 'import m...
#!/usr/bin/env python # coding: utf-8 import argparse import os import sys from pathlib import Path import matplotlib.pyplot as plt import pytorch_lightning as pl from src.config.config import SEED from src.dataset.seg_datamodule import Lyft3DdetSegDatamodule from src.modeling.seg_pl_model import LitModel from src.ut...
[ "pytorch_lightning.callbacks.ModelCheckpoint", "argparse.ArgumentParser", "pathlib.Path", "pytorch_lightning.trainer.seed_everything", "src.dataset.seg_datamodule.Lyft3DdetSegDatamodule", "src.utils.util.set_random_seed", "sys.exit", "src.utils.util.print_argparse_arguments", "matplotlib.pyplot.show...
[((429, 450), 'src.utils.util.set_random_seed', 'set_random_seed', (['SEED'], {}), '(SEED)\n', (444, 450), False, 'from src.utils.util import print_argparse_arguments, set_random_seed\n'), ((587, 769), 'src.dataset.seg_datamodule.Lyft3DdetSegDatamodule', 'Lyft3DdetSegDatamodule', (['args.bev_data_dir'], {'val_hosts': '...
"""A simple library to ask the user for a password. Similar to getpass.getpass() but allows to specify a default mask (like '*' instead of blank).""" __version__ = "0.5.5" from sys import platform, stdin if platform == "win32": from msvcrt import getch as __getch def getch(): return __getch().decode...
[ "termios.tcsetattr", "msvcrt.getch", "termios.tcgetattr", "sys.stdin.read", "tty.setraw" ]
[((602, 618), 'termios.tcgetattr', 'tcgetattr', (['stdin'], {}), '(stdin)\n', (611, 618), False, 'from termios import tcgetattr, tcsetattr, TCSADRAIN\n'), ((644, 661), 'tty.setraw', 'tty_setraw', (['stdin'], {}), '(stdin)\n', (654, 661), True, 'from tty import setraw as tty_setraw\n'), ((681, 694), 'sys.stdin.read', 's...
#!/usr/bin/python # -*- coding: utf-8 -*- """ Copyright 2012-2021 Smartling, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this work except in compliance with the License. * You may obtain a copy of the License in the LICENSE file, or at: * * http://www.apache.org/l...
[ "smartlingApiSdk.ApiV2.ApiV2.__init__" ]
[((863, 985), 'smartlingApiSdk.ApiV2.ApiV2.__init__', 'ApiV2.__init__', (['self', 'userIdentifier', 'userSecret', 'projectId', 'proxySettings'], {'permanentHeaders': 'permanentHeaders', 'env': 'env'}), '(self, userIdentifier, userSecret, projectId, proxySettings,\n permanentHeaders=permanentHeaders, env=env)\n', (87...
# List all valid strings containing n opening and n closing parenthesis. # Note that parens1 happens to be faster and more space efficient than parens2, # which is faster than parens3. The slowest is parens4 only because it is not # memoized. def parens1(n): parens_of_length = [[""]] if n == 0: return parens...
[ "unittest.main" ]
[((3115, 3130), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3128, 3130), False, 'import unittest\n')]
# -*- coding: utf-8 -*- """ Calculations provided by aiida_ase3. Register calculations via the "aiida.calculations" entry point in setup.json. """ from aiida.common import datastructures from aiida.engine import CalcJob from aiida.orm import SinglefileData, Str from aiida.plugins import DataFactory DiffParameters = D...
[ "aiida.common.datastructures.CalcInfo", "aiida.orm.Str", "aiida.plugins.DataFactory", "aiida.common.datastructures.CodeInfo" ]
[((319, 338), 'aiida.plugins.DataFactory', 'DataFactory', (['"""ase3"""'], {}), "('ase3')\n", (330, 338), False, 'from aiida.plugins import DataFactory\n'), ((2369, 2394), 'aiida.common.datastructures.CodeInfo', 'datastructures.CodeInfo', ([], {}), '()\n', (2392, 2394), False, 'from aiida.common import datastructures\n...
# Generated by Django 3.2.12 on 2022-04-08 12:37 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ("webhook", "0008_webhook_subscription_query"), ("core", "0004_delete_delivery_without_webhook"), ] operatio...
[ "django.db.models.ForeignKey" ]
[((444, 533), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'on_delete': 'django.db.models.deletion.CASCADE', 'to': '"""webhook.webhook"""'}), "(on_delete=django.db.models.deletion.CASCADE, to=\n 'webhook.webhook')\n", (461, 533), False, 'from django.db import migrations, models\n')]
import json from flask import Flask from flask import render_template import csv import os import pandas as pd APP_ROOT = os.path.dirname(os.path.abspath(__file__)) APP_STATIC = os.path.join(APP_ROOT, 'static') app = Flask(__name__) @app.route('/') def index(): return render_template('index.html', name='abc') ...
[ "flask.render_template", "flask.Flask", "json.dumps", "os.path.join", "pdb.set_trace", "os.path.abspath", "csv.reader" ]
[((180, 212), 'os.path.join', 'os.path.join', (['APP_ROOT', '"""static"""'], {}), "(APP_ROOT, 'static')\n", (192, 212), False, 'import os\n'), ((219, 234), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (224, 234), False, 'from flask import Flask\n'), ((140, 165), 'os.path.abspath', 'os.path.abspath', (['_...
"""Compile, run and lint files.""" import dataclasses import logging import os import pathlib import shlex import sys from functools import partial from typing import List, Optional if sys.version_info >= (3, 8): from typing import Literal else: from typing_extensions import Literal from porcupine import get...
[ "logging.getLogger", "pathlib.Path", "shlex.split", "porcupine.menubar.get_menu", "functools.partial", "porcupine.get_tab_manager" ]
[((392, 419), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (409, 419), False, 'import logging\n'), ((999, 1021), 'pathlib.Path', 'pathlib.Path', (['basename'], {}), '(basename)\n', (1011, 1021), False, 'import pathlib\n'), ((953, 975), 'pathlib.Path', 'pathlib.Path', (['basename'], {}),...
from price_picker.common.database import CRUDMixin from price_picker import db class Shop(CRUDMixin, db.Model): """ Shops """ __tablename__ = 'shops' name = db.Column(db.String(128), primary_key=True, unique=True, default="Zentrale") @classmethod def query_factory_all(cls): # insert defau...
[ "price_picker.db.String" ]
[((181, 195), 'price_picker.db.String', 'db.String', (['(128)'], {}), '(128)\n', (190, 195), False, 'from price_picker import db\n')]
import numpy as np from lib.lif import LIF, ParamsLIF from lib.causal import causaleffect #Set x = 0, sigma = 10 #wvals = 2..20 sigma = 10 mu = 1 tau = 1 t = 500 params = ParamsLIF(sigma = sigma, mu = mu, tau = tau) lif = LIF(params, t = t) lif.x = 0 #Simulate for a range of $W$ values. N = 19 nsims = 1 wmax = 20 n =...
[ "numpy.savez", "lib.lif.ParamsLIF", "lib.lif.LIF", "numpy.array", "numpy.linspace", "numpy.zeros" ]
[((172, 210), 'lib.lif.ParamsLIF', 'ParamsLIF', ([], {'sigma': 'sigma', 'mu': 'mu', 'tau': 'tau'}), '(sigma=sigma, mu=mu, tau=tau)\n', (181, 210), False, 'from lib.lif import LIF, ParamsLIF\n'), ((223, 239), 'lib.lif.LIF', 'LIF', (['params'], {'t': 't'}), '(params, t=t)\n', (226, 239), False, 'from lib.lif import LIF, ...
#!/usr/bin/env python from argparse import ArgumentParser import os import sys if __name__ == '__main__': arg_parser = ArgumentParser(description='list all files with given ' 'extension in directory') arg_parser.add_argument('--dir', default='.', ...
[ "os.path.join", "os.walk", "os.path.splitext", "argparse.ArgumentParser" ]
[((126, 204), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'description': '"""list all files with given extension in directory"""'}), "(description='list all files with given extension in directory')\n", (140, 204), False, 'from argparse import ArgumentParser\n'), ((604, 624), 'os.walk', 'os.walk', (['options.dir...
from redesigned_barnacle.buffer import CircularBuffer from redesigned_barnacle.graph import Sparkline from redesigned_barnacle.mock import MockFramebuffer from unittest import TestCase class SparkTest(TestCase): def test_line(self): buf = CircularBuffer() sl = Sparkline(32, 64, buf) sl.push(16) sl.d...
[ "redesigned_barnacle.mock.MockFramebuffer", "redesigned_barnacle.buffer.CircularBuffer", "redesigned_barnacle.graph.Sparkline" ]
[((247, 263), 'redesigned_barnacle.buffer.CircularBuffer', 'CircularBuffer', ([], {}), '()\n', (261, 263), False, 'from redesigned_barnacle.buffer import CircularBuffer\n'), ((273, 295), 'redesigned_barnacle.graph.Sparkline', 'Sparkline', (['(32)', '(64)', 'buf'], {}), '(32, 64, buf)\n', (282, 295), False, 'from redesi...
import os import sys import codecs from setuptools import setup tests_require = [ 'pytest', 'pytest-mock', ] if sys.version_info < (3, 0): tests_require.append('mock') def read(fname): file_path = os.path.join(os.path.dirname(__file__), fname) return codecs.open(file_path, encoding='utf-8').rea...
[ "os.path.dirname", "codecs.open" ]
[((231, 256), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (246, 256), False, 'import os\n'), ((276, 316), 'codecs.open', 'codecs.open', (['file_path'], {'encoding': '"""utf-8"""'}), "(file_path, encoding='utf-8')\n", (287, 316), False, 'import codecs\n')]
from setuptools import find_packages, setup # Read more here: https://pypi.org/project/twine/ setup( name='simple_django_logger', # packages=[ # 'simple_django_logger', # this must be the same as the name above # 'simple_django_logger.middleware', # 'simple_django_logger.migrations'], ...
[ "setuptools.find_packages" ]
[((333, 348), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (346, 348), False, 'from setuptools import find_packages, setup\n')]
"""Strategic cache-control. Module usage: 1. Plan your cache-control storategy. (ex: "long" caches content until 3600 seconds) 2. Set storategy store to your app.state and add rules. 3. Set cache strategy as Depends to your path routing. .. code-block: python app = FastAPI() strategy = StrategyStore() stra...
[ "fastapi.HTTPException", "dataclasses.field" ]
[((912, 939), 'dataclasses.field', 'field', ([], {'default_factory': 'dict'}), '(default_factory=dict)\n', (917, 939), False, 'from dataclasses import dataclass, field\n'), ((2536, 2598), 'fastapi.HTTPException', 'HTTPException', ([], {'status_code': '(500)', 'detail': '"""invalid-cache-control"""'}), "(status_code=500...
# Generated by Django 3.2.6 on 2021-08-30 14:17 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("village_api", "0007_auto_20210830_1327"), ] operations = [ migrations.AlterField( model_name="relationship", name="p...
[ "django.db.models.ManyToManyField" ]
[((346, 460), 'django.db.models.ManyToManyField', 'models.ManyToManyField', ([], {'related_name': '"""relationships"""', 'through': '"""village_api.Relation"""', 'to': '"""village_api.Person"""'}), "(related_name='relationships', through=\n 'village_api.Relation', to='village_api.Person')\n", (368, 460), False, 'fro...
#- # ========================================================================== # Copyright (C) 1995 - 2006 Autodesk, Inc. and/or its licensors. All # rights reserved. # # The coded instructions, statements, computer programs, and/or related # material (collectively the "Data") in these files contain unpublished...
[ "maya.OpenMayaMPx.MPxControlCommand.__init__", "maya.OpenMayaMPx.MPxUITableControl.__init__", "maya.OpenMayaMPx.MPxControlCommand.doEditFlags", "maya.OpenMayaMPx.MFnPlugin", "sys.stderr.write", "maya.OpenMayaMPx.asMPxPtr", "maya.OpenMayaMPx.MPxControlCommand.doQueryFlags", "maya.OpenMayaMPx.asHashable...
[((5003, 5059), 'maya.OpenMayaMPx.MFnPlugin', 'OpenMayaMPx.MFnPlugin', (['mobject', '"""Autodesk"""', '"""1.0"""', '"""Any"""'], {}), "(mobject, 'Autodesk', '1.0', 'Any')\n", (5024, 5059), True, 'import maya.OpenMayaMPx as OpenMayaMPx\n'), ((5272, 5302), 'maya.OpenMayaMPx.MFnPlugin', 'OpenMayaMPx.MFnPlugin', (['mobject...
#! /usr/bin/env python import sys import pathogenseq as ps import json infile = sys.argv[1] ref = sys.argv[2] outfile = sys.argv[3] bcf = ps.bcf(infile) stats = bcf.load_stats(convert=True,ref=ref) genome_len = sum([len(x) for x in ps.fasta(ref).fa_dict.values()]) print("sample\tnRefHom\tnNonRefHom\tnHets\tnMissing")...
[ "pathogenseq.fasta", "pathogenseq.bcf" ]
[((139, 153), 'pathogenseq.bcf', 'ps.bcf', (['infile'], {}), '(infile)\n', (145, 153), True, 'import pathogenseq as ps\n'), ((233, 246), 'pathogenseq.fasta', 'ps.fasta', (['ref'], {}), '(ref)\n', (241, 246), True, 'import pathogenseq as ps\n')]
import re import yaml from mapproxy.wsgiapp import make_wsgi_app import gws import gws.config import gws.tools.os2 import gws.tools.json2 import gws.types as t class _Config: def __init__(self): self.c = 0 self.services = { 'wms': { 'image_formats': ['image/png'], ...
[ "gws.tools.os2.unlink", "gws.config.MapproxyConfigError", "gws.random_string", "yaml.dump", "gws.log.warn", "mapproxy.wsgiapp.make_wsgi_app", "gws.get", "gws.tools.json2.to_hash" ]
[((3969, 4000), 'gws.tools.os2.unlink', 'gws.tools.os2.unlink', (['test_path'], {}), '(test_path)\n', (3989, 4000), False, 'import gws\n'), ((4379, 4410), 'gws.tools.os2.unlink', 'gws.tools.os2.unlink', (['test_path'], {}), '(test_path)\n', (4399, 4410), False, 'import gws\n'), ((4049, 4084), 'gws.log.warn', 'gws.log.w...
from flask import Flask app = Flask(__name__) posts = { 0: { 'title': 'Hello, world', 'content': 'This is my first blog post!' } } @app.route('/') def home(): return 'Hello, world!' # This route expects to be in the format of /post/0 (for example). # Then it will pass 0 as argument to ...
[ "flask.Flask" ]
[((32, 47), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (37, 47), False, 'from flask import Flask\n')]
from datetime import date ano_nascimento = int(input("Informe seu ano de nascimento: ")) ano_atual = date.today().year idade = ano_atual - ano_nascimento if(idade <= 9): categoria = "MIRIM" elif(idade <= 14): categoria = "INFANTIL" elif(idade <= 19): categoria = "JUNIOR" elif(idade <= 20): categoria...
[ "datetime.date.today" ]
[((103, 115), 'datetime.date.today', 'date.today', ([], {}), '()\n', (113, 115), False, 'from datetime import date\n')]
from impala.dbapi import connect import api.resources.configurator as Config def create_connection(): impala_host, impala_port = Config.impala() db = Config.db() conn = connect(host=impala_host, port=int(impala_port),database=db) return conn.cursor() def execute_query(query,fetch=False): impala...
[ "api.resources.configurator.db", "api.resources.configurator.impala" ]
[((136, 151), 'api.resources.configurator.impala', 'Config.impala', ([], {}), '()\n', (149, 151), True, 'import api.resources.configurator as Config\n'), ((161, 172), 'api.resources.configurator.db', 'Config.db', ([], {}), '()\n', (170, 172), True, 'import api.resources.configurator as Config\n')]
from spacenetutilities.labeltools import coreLabelTools import json import glob import argparse from datetime import datetime import os def modifyTimeField(geoJson, geoJsonNew, featureItemsToAdd=['ingest_tim', 'ingest_time', 'edit_date'], featureKeyListToRemove=[]): now = datetime.today() with open(geoJson) a...
[ "os.path.exists", "os.path.join", "json.load", "datetime.datetime.today", "json.dump", "os.remove" ]
[((279, 295), 'datetime.datetime.today', 'datetime.today', ([], {}), '()\n', (293, 295), False, 'from datetime import datetime\n'), ((1207, 1233), 'os.path.exists', 'os.path.exists', (['geoJsonNew'], {}), '(geoJsonNew)\n', (1221, 1233), False, 'import os\n'), ((1945, 1971), 'os.path.exists', 'os.path.exists', (['geoJso...
from os import times import smtplib from time import sleep from getpass import getpass import sys class colors(): red = "\u001b[31m" yel = "\u001b[33m" gre = "\u001b[32m" blu = "\u001b[34m" pur = "\u001b[35m" cya = "\u001b[36m" whi = "\u001b[37m" res = "\u001b[0m" bred = "\u001b[31;...
[ "smtplib.SMTP", "getpass.getpass", "time.sleep", "sys.exit" ]
[((6032, 6040), 'time.sleep', 'sleep', (['(1)'], {}), '(1)\n', (6037, 6040), False, 'from time import sleep\n'), ((1948, 1983), 'smtplib.SMTP', 'smtplib.SMTP', (['"""smtp.gmail.com"""', '(587)'], {}), "('smtp.gmail.com', 587)\n", (1960, 1983), False, 'import smtplib\n'), ((4043, 4056), 'getpass.getpass', 'getpass', (['...
#!/usr/bin/env python # # Public Domain 2014-present MongoDB, Inc. # Public Domain 2008-2014 WiredTiger, Inc. # # This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publish, use, compile, sell, or # distribute this software, either in source code form or as a com...
[ "wtscenario.make_scenarios" ]
[((3127, 3160), 'wtscenario.make_scenarios', 'make_scenarios', (['key_format_values'], {}), '(key_format_values)\n', (3141, 3160), False, 'from wtscenario import make_scenarios\n')]
from fastapi import APIRouter from ormar import Model from typing import Type, Dict, NewType from pydantic import BaseModel from fastapi_helpers.crud import BaseCrud from typing import ( List, Dict, Optional, Union, TypeVar ) from fastapi import ( APIRouter, Request, Depends, ) from fastapi_helpers.crud import ...
[ "fastapi.APIRouter", "fastapi.Depends", "typing.NewType", "typing.TypeVar" ]
[((517, 542), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {'bound': 'Model'}), "('T', bound=Model)\n", (524, 542), False, 'from typing import List, Dict, Optional, Union, TypeVar\n'), ((1040, 1083), 'typing.NewType', 'NewType', (['f"""{model_name}"""', 'pydantic_instance'], {}), "(f'{model_name}', pydantic_instance)\n",...
from hlo import ShardingSpec, ShardingSpecType from cluster_env import ClusterEnvironment from common import compute_bytes def test_tile(): cluster_env = ClusterEnvironment([[0, 1, 2], [3, 4, 5]], [1,1], [1,1], None) sharding = ShardingSpec.tile((12, 12), [0, 1], [0, 1], cluster_env) assert sharding.tile...
[ "hlo.ShardingSpec.tile", "hlo.ShardingSpec.replicated", "common.compute_bytes", "hlo.ShardingSpec.split", "cluster_env.ClusterEnvironment" ]
[((160, 224), 'cluster_env.ClusterEnvironment', 'ClusterEnvironment', (['[[0, 1, 2], [3, 4, 5]]', '[1, 1]', '[1, 1]', 'None'], {}), '([[0, 1, 2], [3, 4, 5]], [1, 1], [1, 1], None)\n', (178, 224), False, 'from cluster_env import ClusterEnvironment\n'), ((239, 295), 'hlo.ShardingSpec.tile', 'ShardingSpec.tile', (['(12, 1...
#!/usr/bin/env python3 import sys import numpy as np import cv2 import time def get_time(start_time): return int((time.time() - start_time) * 1000) def is_inside(inside, outside, limit_val=-1): point_limit = limit_val * len(inside) if limit_val < 0: point_limit = 1 in_point = 0; for i in ...
[ "cv2.rectangle", "cv2.imshow", "cv2.destroyAllWindows", "sys.exit", "cv2.Laplacian", "cv2.resizeWindow", "cv2.threshold", "cv2.contourArea", "cv2.minAreaRect", "numpy.concatenate", "cv2.matchTemplate", "cv2.waitKey", "cv2.drawContours", "cv2.boxPoints", "numpy.int0", "cv2.cvtColor", ...
[((542, 553), 'time.time', 'time.time', ([], {}), '()\n', (551, 553), False, 'import time\n'), ((943, 983), 'cv2.imread', 'cv2.imread', (["(input_name + '.' + input_ext)"], {}), "(input_name + '.' + input_ext)\n", (953, 983), False, 'import cv2\n'), ((1506, 1563), 'cv2.fastNlMeansDenoisingColored', 'cv2.fastNlMeansDeno...
# Part of code was adpated from https://github.com/r9y9/deepvoice3_pytorch/tree/master/compute_timestamp_ratio.py # Copyright (c) 2017: <NAME>. import argparse import sys import numpy as np from hparams import hparams, hparams_debug_string from deepvoice3_paddle.data import TextDataSource, MelSpecDataSource from nnmnk...
[ "argparse.ArgumentParser", "deepvoice3_paddle.data.TextDataSource", "deepvoice3_paddle.data.MelSpecDataSource", "hparams.hparams.parse", "numpy.array", "numpy.sum", "sys.exit" ]
[((456, 532), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Compute output/input timestamp ratio."""'}), "(description='Compute output/input timestamp ratio.')\n", (479, 532), False, 'import argparse\n'), ((1188, 1215), 'hparams.hparams.parse', 'hparams.parse', (['args.hparams'], {}), '...
from google.cloud import storage import os client = storage.Client() bucket = client.get_bucket('noah-water.appspot.com') blobs = bucket.list_blobs(prefix='trends3/Part6') os.system("gsutil acl ch -u <EMAIL>:W gs://noah-water.appspot.com") for blob in blobs: print(blob.name) file_read_perm = "gsutil acl ch -u <E...
[ "google.cloud.storage.Client", "os.system" ]
[((53, 69), 'google.cloud.storage.Client', 'storage.Client', ([], {}), '()\n', (67, 69), False, 'from google.cloud import storage\n'), ((176, 243), 'os.system', 'os.system', (['"""gsutil acl ch -u <EMAIL>:W gs://noah-water.appspot.com"""'], {}), "('gsutil acl ch -u <EMAIL>:W gs://noah-water.appspot.com')\n", (185, 243)...
from math import sin, cos, sqrt, atan2, radians from random import * from datetime import * from dateutil.parser import parse from enum import Enum import csv class DataAccess: DOWNVOTE = 0 UPVOTE = 1 Type = Enum('Type', 'sport party animal hackathon culture food') def __init__(self): self....
[ "dateutil.parser.parse", "math.sqrt", "math.radians", "math.cos", "enum.Enum", "math.sin", "csv.reader" ]
[((224, 281), 'enum.Enum', 'Enum', (['"""Type"""', '"""sport party animal hackathon culture food"""'], {}), "('Type', 'sport party animal hackathon culture food')\n", (228, 281), False, 'from enum import Enum\n'), ((3675, 3688), 'math.radians', 'radians', (['lat1'], {}), '(lat1)\n', (3682, 3688), False, 'from math impo...
""" Copyright 2020 <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 w...
[ "json.dumps" ]
[((2768, 2825), 'json.dumps', 'json.dumps', (['err.data'], {'indent': 'constants.JSON_FORMAT_INDENT'}), '(err.data, indent=constants.JSON_FORMAT_INDENT)\n', (2778, 2825), False, 'import json\n')]