code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
r"""
读取非标准数据集为标准输出格式
"""
import json
from nlper.utils.io import read_data
def iflytek_convert(datafile, load_label=True):
raw_data = [
json.loads(instance) for instance in read_data(datafile, 'txt')
]
target_data = []
if load_label:
for instance in raw_data:
target_data.ap... | [
"nlper.utils.io.read_data",
"json.loads"
] | [((1580, 1613), 'nlper.utils.io.read_data', 'read_data', (['datafile'], {'f_type': '"""tsv"""'}), "(datafile, f_type='tsv')\n", (1589, 1613), False, 'from nlper.utils.io import read_data\n'), ((150, 170), 'json.loads', 'json.loads', (['instance'], {}), '(instance)\n', (160, 170), False, 'import json\n'), ((870, 890), '... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" Example for computing the RIR between several sources and receivers in GPU.
@author: <EMAIL>
pyrirgen: https://github.com/phecda-xu/RIR-Generator
"""
import numpy as np
import soundfile as sf
import math
import pyrirgen
import argparse
import os
from mult... | [
"os.path.exists",
"numpy.abs",
"numpy.sqrt",
"os.makedirs",
"argparse.ArgumentParser",
"multiprocessing.Process",
"math.degrees",
"soundfile.write",
"pyrirgen.generateRir",
"numpy.array",
"numpy.zeros",
"numpy.stack",
"numpy.arctan2",
"numpy.cos",
"numpy.random.uniform",
"numpy.sin"
] | [((5909, 5934), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (5932, 5934), False, 'import argparse\n'), ((383, 409), 'os.path.exists', 'os.path.exists', (['output_dir'], {}), '(output_dir)\n', (397, 409), False, 'import os\n'), ((420, 443), 'os.makedirs', 'os.makedirs', (['output_dir'], {}), ... |
# -*- coding: utf-8 -*-
import six
from nose2 import util
from nose2.tests._common import TestCase, support_file
class UtilTests(TestCase):
def test_name_from_path(self):
test_module = support_file("scenario/tests_in_package/pkg1/test/test_things.py")
test_package_path = support_file("scenario/te... | [
"nose2.util._WritelnDecorator",
"six.u",
"nose2.tests._common.support_file",
"nose2.util.name_from_path"
] | [((200, 266), 'nose2.tests._common.support_file', 'support_file', (['"""scenario/tests_in_package/pkg1/test/test_things.py"""'], {}), "('scenario/tests_in_package/pkg1/test/test_things.py')\n", (212, 266), False, 'from nose2.tests._common import TestCase, support_file\n'), ((295, 336), 'nose2.tests._common.support_file... |
#
# General-purpose Photovoltaic Device Model - a drift diffusion base/Shockley-Read-Hall
# model for 1st, 2nd and 3rd generation solar cells.
# Copyright (C) 2008-2022 <NAME> r.c.i.m<EMAIL>enzie at googlemail.com
#
# https://www.gpvdm.com
#
# This program is free software; you can redistribute it and/... | [
"PyQt5.QtWidgets.QWidget",
"PyQt5.QtGui.QPainter",
"PyQt5.QtWidgets.QSlider",
"PyQt5.QtGui.QColor",
"PyQt5.QtWidgets.QHBoxLayout",
"PyQt5.QtWidgets.QWidget.__init__",
"PyQt5.QtWidgets.QVBoxLayout",
"icon_lib.icon_get",
"PyQt5.QtCore.QRectF",
"PyQt5.QtWidgets.QLabel",
"PyQt5.QtGui.QPainterPath",
... | [((1676, 1698), 'PyQt5.QtWidgets.QWidget.__init__', 'QWidget.__init__', (['self'], {}), '(self)\n', (1692, 1698), False, 'from PyQt5.QtWidgets import QWidget, QSizePolicy, QHBoxLayout, QPushButton, QDialog, QFileDialog, QToolBar, QVBoxLayout, QTabWidget, QLabel, QSlider, QWidgetItem\n'), ((1842, 1855), 'PyQt5.QtWidgets... |
"""Bouncing Lines, by <NAME> <EMAIL>
A bouncing line animation. Press Ctrl-C to stop.
NOTE: Do not resize the terminal window while this program is running."""
__version__ = 1
import sys, random, time
try:
import bext
except ImportError:
print('''This program requires the bext module, which you can
install ... | [
"bext.goto",
"random.choice",
"bext.fg",
"bext.clear",
"time.sleep",
"bext.size",
"sys.exit",
"sys.stdout.flush",
"random.randint"
] | [((573, 584), 'bext.size', 'bext.size', ([], {}), '()\n', (582, 584), False, 'import bext\n'), ((1015, 1027), 'bext.clear', 'bext.clear', ([], {}), '()\n', (1025, 1027), False, 'import bext\n'), ((522, 532), 'sys.exit', 'sys.exit', ([], {}), '()\n', (530, 532), False, 'import sys, random, time\n'), ((1953, 1971), 'sys.... |
import json
import os
import pytest
import requests
from csgo.parser import DemoParser
class TestDemoParser:
"""Class to test the match parser
We use the demofiles in test_data.json
"""
def setup_class(self):
"""Setup class by defining the base parser, demofile list, demofile to use for spe... | [
"os.path.exists",
"os.listdir",
"csgo.parser.DemoParser",
"requests.get",
"os.getcwd",
"pytest.raises",
"json.load",
"os.remove"
] | [((357, 464), 'csgo.parser.DemoParser', 'DemoParser', ([], {'demofile': '"""tests/og-vs-natus-vincere-m1-dust2.dem"""', 'log': '(True)', 'demo_id': '"""test"""', 'parse_rate': '(256)'}), "(demofile='tests/og-vs-natus-vincere-m1-dust2.dem', log=True,\n demo_id='test', parse_rate=256)\n", (367, 464), False, 'from csgo... |
# -*- coding: utf-8 -*-
# This file as well as the whole tsfresh package are licenced under the MIT licence (see the LICENCE.txt)
# <NAME> (<EMAIL>), Blue Yonder Gmbh, 2016
import os
import tempfile
import numpy as np
import pandas as pd
from mock import Mock
from tests.fixtures import DataTestCase
from tsfresh.feat... | [
"numpy.random.normal",
"numpy.testing.assert_array_almost_equal",
"numpy.repeat",
"tsfresh.feature_extraction.settings.ComprehensiveFCParameters",
"mock.Mock",
"os.path.join",
"tsfresh.feature_extraction.settings.PickeableSettings",
"os.path.isfile",
"numpy.array",
"tempfile.gettempdir",
"tsfres... | [((763, 784), 'tempfile.gettempdir', 'tempfile.gettempdir', ([], {}), '()\n', (782, 784), False, 'import tempfile\n'), ((957, 1077), 'tsfresh.feature_extraction.extraction.extract_features', 'extract_features', (['df'], {'column_id': '"""id"""', 'column_sort': '"""sort"""', 'column_kind': '"""kind"""', 'column_value': ... |
import csv
from sklearn.model_selection import train_test_split
from classifiers.datasets import TrainTestDataset, Dataset
class KeywordSelectionClassifierDatasetLoader(object):
"""Keyword selection classifier dataset loader object"""
def __init__(self, dataset_file):
"""Create a newKeywordSelectio... | [
"sklearn.model_selection.train_test_split",
"classifiers.datasets.Dataset",
"csv.reader"
] | [((1265, 1362), 'sklearn.model_selection.train_test_split', 'train_test_split', (['keywords', 'is_valid'], {'test_size': 'test_size', 'random_state': '(42)', 'stratify': 'is_valid'}), '(keywords, is_valid, test_size=test_size, random_state=42,\n stratify=is_valid)\n', (1281, 1362), False, 'from sklearn.model_selecti... |
# Generated by Django 4.0.1 on 2022-02-07 23:15
import books.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Author',
... | [
"django.db.models.ForeignKey",
"django.db.models.ManyToManyField",
"django.db.models.BigAutoField",
"django.db.models.URLField",
"django.db.models.PositiveSmallIntegerField",
"django.db.models.CharField"
] | [((359, 455), 'django.db.models.BigAutoField', 'models.BigAutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (378, 455), False, 'from django.db import migrations, m... |
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
# -----------------------------------------------------------------------------
#
# P A G E B O T N A N O
#
# Copyright (c) 2020+ <NAME> + <NAME>
# www.pagebot.io
# Licensed under MIT conditions
#
# Supporting DrawBot, www.drawbot.com
# -------------------------... | [
"sys.path.insert",
"doctest.testmod",
"pagebotnano_060.toolbox.markdown.parseMarkdown"
] | [((2456, 2483), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""../.."""'], {}), "(0, '../..')\n", (2471, 2483), False, 'import sys\n'), ((19218, 19235), 'doctest.testmod', 'doctest.testmod', ([], {}), '()\n', (19233, 19235), False, 'import doctest\n'), ((5557, 5592), 'pagebotnano_060.toolbox.markdown.parseMarkdown'... |
""" Functions for finding and replacing pronouns etc in strings"""
import re
# Just a small table for development
pronoun_replacements = {
'he': 'they',
'him': 'them',
'his': 'their',
'himself': 'themselves',
'she': 'they',
'her': 'them',
'hers': 'theirs',
'herself': 'themselves'
}
d... | [
"re.sub"
] | [((942, 977), 're.sub', 're.sub', (['"""[^\\\\w\\\\s]"""', '""""""', 'input_word'], {}), "('[^\\\\w\\\\s]', '', input_word)\n", (948, 977), False, 'import re\n')] |
# =============================================================================== #
# #
# This file has been generated automatically!! Do not change this manually! #
# ... | [
"pydantic.Field"
] | [((775, 812), 'pydantic.Field', 'Field', (['"""testSquareInt"""'], {'alias': '"""@type"""'}), "('testSquareInt', alias='@type')\n", (780, 812), False, 'from pydantic import Field\n')] |
# coding=utf-8
#
# created by kpe on 28.Mar.2019 at 12:33
#
from __future__ import absolute_import, division, print_function
import tensorflow as tf
import params_flow as pf
from tensorflow import keras
from tensorflow.keras import backend as K
import bert
class PositionEmbeddingLayer(bert.Layer):
class Param... | [
"tensorflow.slice",
"tensorflow.keras.backend.floatx",
"tensorflow.compat.v1.assert_less_equal",
"tensorflow.assert_equal",
"tensorflow.shape",
"params_flow.LayerNormalization",
"tensorflow.keras.layers.InputSpec",
"tensorflow.keras.layers.Dropout",
"tensorflow.not_equal",
"tensorflow.keras.layers... | [((1531, 1607), 'tensorflow.compat.v1.assert_less_equal', 'tf.compat.v1.assert_less_equal', (['seq_len', 'self.params.max_position_embeddings'], {}), '(seq_len, self.params.max_position_embeddings)\n', (1561, 1607), True, 'import tensorflow as tf\n'), ((2652, 2691), 'tensorflow.keras.layers.InputSpec', 'keras.layers.In... |
# Copyright 2021, <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software... | [
"rad.rest.client.api.zfsmgr_1.zpool_resource.ZpoolResource.get_property_names",
"rad.rest.client.api.zfsmgr_1.zpool_resource.ZpoolResource"
] | [((1438, 1453), 'rad.rest.client.api.zfsmgr_1.zpool_resource.ZpoolResource', 'ZpoolResource', ([], {}), '()\n', (1451, 1453), False, 'from rad.rest.client.api.zfsmgr_1.zpool_resource import ZpoolResource\n'), ((1042, 1076), 'rad.rest.client.api.zfsmgr_1.zpool_resource.ZpoolResource.get_property_names', 'ZpoolResource.g... |
import numpy as np
import pytest
import pandas as pd
from pandas import DataFrame, Index, Series, date_range, offsets
import pandas._testing as tm
class TestDataFrameShift:
def test_shift(self, datetime_frame, int_frame):
# naive shift
shiftedFrame = datetime_frame.shift(5)
tm.assert_inde... | [
"pandas.Series",
"pandas.offsets.BDay",
"pandas._testing.assert_series_equal",
"pytest.mark.filterwarnings",
"numpy.random.rand",
"numpy.asarray",
"pandas._testing.assert_index_equal",
"numpy.array",
"pandas._testing.makePeriodFrame",
"numpy.random.randint",
"pandas.concat",
"pytest.raises",
... | [((5919, 5990), 'pytest.mark.filterwarnings', 'pytest.mark.filterwarnings', (['"""ignore:tshift is deprecated:FutureWarning"""'], {}), "('ignore:tshift is deprecated:FutureWarning')\n", (5945, 5990), False, 'import pytest\n'), ((306, 369), 'pandas._testing.assert_index_equal', 'tm.assert_index_equal', (['shiftedFrame.i... |
import numpy as np
from gym.spaces.dict import Dict as GymDict
from rlpyt.utils.collections import NamedTupleSchema, NamedTuple
from rlpyt.spaces.composite import Composite
class GymSpaceWrapper:
"""Wraps a gym space to match the rlpyt interface; most of
the functionality is for automatically converting a G... | [
"rlpyt.spaces.composite.Composite",
"numpy.asarray"
] | [((4641, 4676), 'numpy.asarray', 'np.asarray', (['value'], {'dtype': 'np.float32'}), '(value, dtype=np.float32)\n', (4651, 4676), True, 'import numpy as np\n'), ((1762, 1783), 'rlpyt.spaces.composite.Composite', 'Composite', (['spaces', 'nt'], {}), '(spaces, nt)\n', (1771, 1783), False, 'from rlpyt.spaces.composite imp... |
from django.apps import apps
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class CountrywareConfig(AppConfig):
"""
Configuration entry point for the countryware app
"""
label = name = 'countryware'
verbose_name = _("countryware app")
| [
"django.utils.translation.ugettext_lazy"
] | [((279, 299), 'django.utils.translation.ugettext_lazy', '_', (['"""countryware app"""'], {}), "('countryware app')\n", (280, 299), True, 'from django.utils.translation import ugettext_lazy as _\n')] |
# coding: utf-8
import datetime as dt
from flask import Blueprint, jsonify
from flask_apispec import marshal_with, use_kwargs
from flask_jwt import jwt_required, current_identity
from marshmallow import fields
from .models import Article, Tags, Comment
from .serializers import (article_schema, articles_schema, comme... | [
"marshmallow.fields.Int",
"conduit.exceptions.InvalidUsage.article_not_found",
"marshmallow.fields.Str",
"flask_apispec.use_kwargs",
"flask_apispec.marshal_with",
"flask_jwt.jwt_required",
"conduit.utils.jwt_optional",
"flask.Blueprint"
] | [((544, 575), 'flask.Blueprint', 'Blueprint', (['"""articles"""', '__name__'], {}), "('articles', __name__)\n", (553, 575), False, 'from flask import Blueprint, jsonify\n'), ((665, 679), 'conduit.utils.jwt_optional', 'jwt_optional', ([], {}), '()\n', (677, 679), False, 'from conduit.utils import jwt_optional\n'), ((827... |
"""PROGRAM FOR LEC COMPUTATION.
The module contains the following functions:
- lorenz: it is the main program, calling functions that compute the
reservoirs and conversion terms, storing them separately in
NetCDF files and providing a flux diagram and a table outputs,
the ... | [
"numpy.fft.irfft",
"math.sqrt",
"numpy.nanmean",
"sys.exit",
"numpy.imag",
"numpy.arange",
"os.remove",
"numpy.fft.fft",
"netCDF4.Dataset",
"numpy.fft.rfft",
"numpy.real",
"cdo.Cdo",
"numpy.conj",
"numpy.deg2rad",
"numpy.cos",
"numpy.shape",
"numpy.nansum",
"numpy.transpose",
"nu... | [((2768, 2827), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {'message': '"""ComplexWarning"""'}), "('ignore', message='ComplexWarning')\n", (2791, 2827), False, 'import warnings\n'), ((3801, 3825), 'numpy.nanmean', 'np.nanmean', (['ta_c'], {'axis': '(1)'}), '(ta_c, axis=1)\n', (3811, 3825),... |
# services/cert_server/project/apit/cert_gen.py
import subprocess
from flask import current_app
from shutil import rmtree
class EasyRSA:
def __init__(self):
pass
def init_pki(self):
cmd = f'easyrsa --batch init-pki'
try:
subprocess.check_output(cmd.split(' '))
e... | [
"shutil.rmtree"
] | [((549, 565), 'shutil.rmtree', 'rmtree', (['pki_path'], {}), '(pki_path)\n', (555, 565), False, 'from shutil import rmtree\n')] |
import toolz
import toolz.curried
from toolz.curried import (take, first, second, sorted, merge_with, reduce,
merge, operator as cop)
from collections import defaultdict
from importlib import import_module
from operator import add
def test_take():
assert list(take(2)([1, 2, 3])) == [1, ... | [
"toolz.curry",
"toolz.curried.merge_with",
"toolz.functoolz.has_keywords",
"importlib.import_module",
"toolz.curried.merge",
"toolz.merge",
"toolz.valfilter",
"toolz.curried.sorted",
"toolz.curried.take",
"toolz.functoolz.num_required_args",
"collections.defaultdict",
"toolz.curried.reduce",
... | [((1677, 1718), 'importlib.import_module', 'import_module', (['"""toolz.curried.exceptions"""'], {}), "('toolz.curried.exceptions')\n", (1690, 1718), False, 'from importlib import import_module\n'), ((2398, 2434), 'toolz.valfilter', 'toolz.valfilter', (['callable', 'namespace'], {}), '(callable, namespace)\n', (2413, 2... |
# coding: utf-8
"""
An example of generating swagger via gRPC ecosystem.
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: 1.0
Contact: <EMAIL>
Generated by: https://openapi-generator.tech
... | [
"unittest.main",
"openapi_client.api.example_service_api.ExampleServiceApi"
] | [((928, 943), 'unittest.main', 'unittest.main', ([], {}), '()\n', (941, 943), False, 'import unittest\n'), ((668, 726), 'openapi_client.api.example_service_api.ExampleServiceApi', 'openapi_client.api.example_service_api.ExampleServiceApi', ([], {}), '()\n', (724, 726), False, 'import openapi_client\n')] |
import argparse
import collections
import random
import numpy
class ValueRange(collections.Container):
'''A class wrapping a list with some extra functional magic, like head,
tail, init, last, drop, and take.'''
def __init__(self, min=0., max=1., dtype=float):
self.dtype = dtype
if dtype... | [
"argparse.ArgumentParser",
"numpy.random.random",
"numpy.random.choice",
"numpy.exp",
"numpy.array",
"numpy.random.randint",
"random.getrandbits"
] | [((2323, 2356), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '(**kwargs)\n', (2346, 2356), False, 'import argparse\n'), ((1243, 1310), 'numpy.random.randint', 'numpy.random.randint', (['self.min_value', '(self.max_value + 1)'], {'size': 'size'}), '(self.min_value, self.max_value + 1, size=size)\n', (... |
# stdlib
import inspect
from typing import Any
from typing import Callable
from typing import Dict
from typing import List
from typing import Optional
from typing import Tuple
# syft relative
from .typecheck import type_hints
# this flag is set in syft.__init__.py
LONG_TYPECHECK_STACK_TRACES = None
def syft_decorat... | [
"inspect.signature"
] | [((1573, 1600), 'inspect.signature', 'inspect.signature', (['function'], {}), '(function)\n', (1590, 1600), False, 'import inspect\n')] |
# predict probabilities for counts, given a set of future features
# execute: python predict.py
# This file can be scheduled to run at any time.
# It will generate hourly predictions for the remaining hours in today and N-additional days:
# - current hour - if the job is running at 8:45, the first prediction will be fo... | [
"logging.basicConfig",
"datetime.datetime",
"numpy.unique",
"pandas.read_csv",
"numpy.random.poisson",
"pickle.load",
"numpy.argmax",
"requests.get",
"os.path.isfile",
"datetime.datetime.now",
"numpy.quantile",
"pandas.date_range",
"pandas.DataFrame",
"datetime.timedelta",
"logging.info"... | [((2627, 2683), 'pandas.date_range', 'pd.date_range', ([], {'start': 'start_date', 'end': 'end_date', 'freq': '"""1H"""'}), "(start=start_date, end=end_date, freq='1H')\n", (2640, 2683), True, 'import pandas as pd\n'), ((2700, 2725), 'pandas.DataFrame', 'pd.DataFrame', (["{'dt': idx}"], {}), "({'dt': idx})\n", (2712, 2... |
from setuptools import find_packages
from setuptools import setup
setup(
name="qontract-reconcile",
version="0.3.0",
license="Apache License 2.0",
author="<NAME>",
author_email="<EMAIL>",
python_requires=">=3.9",
description="Collection of tools to reconcile services with their desired "
... | [
"setuptools.find_packages"
] | [((453, 486), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "('tests',)"}), "(exclude=('tests',))\n", (466, 486), False, 'from setuptools import find_packages\n')] |
#!/usr/bin/env python3
# Create a csv file containing all the Azure REST API docs files in the form:
# tup0, tup1, latest_stable, latest_preview
import glob
import os
import subprocess
import sys
# Create a mapping of a "two-tuple" to all JSON files matching the tuple
# The components of the tuple are:
# - the file ... | [
"os.chdir",
"os.system",
"subprocess.run",
"glob.glob"
] | [((1411, 1451), 'os.system', 'os.system', (['"""rm -rf azure-rest-api-specs"""'], {}), "('rm -rf azure-rest-api-specs')\n", (1420, 1451), False, 'import os\n'), ((1452, 1524), 'os.system', 'os.system', (['"""git clone https://github.com/Azure/azure-rest-api-specs.git"""'], {}), "('git clone https://github.com/Azure/azu... |
__import__("pkg_resources").declare_namespace(__name__)
from logging import getLogger
from ..base import PackagingRecipe, RECIPE_DEFAULTS
from .. import utils
from os import path, curdir, makedirs, listdir
from shutil import rmtree, copy
from pkg_resources import resource_filename
logger = getLogger(__name__)
class ... | [
"logging.getLogger",
"os.path.exists",
"os.listdir",
"os.makedirs",
"os.path.join",
"pkg_resources.resource_filename",
"os.path.isfile",
"os.path.dirname",
"os.path.basename",
"shutil.copy",
"shutil.rmtree",
"os.path.abspath"
] | [((293, 312), 'logging.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (302, 312), False, 'from logging import getLogger\n'), ((1455, 1488), 'os.path.join', 'path.join', (['parent_directory', 'name'], {}), '(parent_directory, name)\n', (1464, 1488), False, 'from os import path, curdir, makedirs, listdir\n'... |
import sys
import unittest
from random import randint
import numpy as np
import crocoddyl
import pinocchio
from crocoddyl.utils import DDPDerived
class SolverAbstractTestCase(unittest.TestCase):
MODEL = None
SOLVER = None
SOLVER_DER = None
def setUp(self):
# Set up the solvers
self.... | [
"unittest.TestSuite",
"random.randint",
"numpy.allclose",
"crocoddyl.ShootingProblem",
"crocoddyl.CostModelControl",
"crocoddyl.CostModelState",
"pinocchio.utils.rand",
"pinocchio.SE3.Random",
"crocoddyl.CostModelSum",
"pinocchio.buildSampleModelManipulator",
"crocoddyl.StateMultibody",
"croco... | [((4457, 4488), 'crocoddyl.ActionModelUnicycle', 'crocoddyl.ActionModelUnicycle', ([], {}), '()\n', (4486, 4488), False, 'import crocoddyl\n'), ((4620, 4659), 'pinocchio.buildSampleModelManipulator', 'pinocchio.buildSampleModelManipulator', ([], {}), '()\n', (4657, 4659), False, 'import pinocchio\n'), ((4672, 4709), 'c... |
"""Interaction between the reference machinery and content objects."""
import gocept.reference.interfaces
import gocept.reference.reference
import transaction
import zope.component
import zope.container.interfaces
import zope.interface
import zope.location
import zope.traversing.api
import zope.traversing.interfaces
... | [
"transaction.doom"
] | [((3488, 3506), 'transaction.doom', 'transaction.doom', ([], {}), '()\n', (3504, 3506), False, 'import transaction\n')] |
#!/usr/bin/python
# Copyright (C) 2013 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of c... | [
"idl_reader.IdlReader",
"os.path.splitext",
"optparse.OptionParser",
"os.path.realpath",
"os.path.basename",
"cPickle.load"
] | [((2072, 2086), 'optparse.OptionParser', 'OptionParser', ([], {}), '()\n', (2084, 2086), False, 'from optparse import OptionParser\n'), ((2894, 2919), 'os.path.realpath', 'os.path.realpath', (['args[0]'], {}), '(args[0])\n', (2910, 2919), False, 'import os\n'), ((3020, 3050), 'os.path.basename', 'os.path.basename', (['... |
from django.contrib.auth import get_user_model
from django.db import models
from cajas.users.models.charges import Charge
from cajas.office.models.office import Office
from cajas.office.models.officeCountry import OfficeCountry
User = get_user_model()
def user_passport_path(instance, filename):
return 'archivo... | [
"django.contrib.auth.get_user_model",
"django.db.models.FloatField",
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.ManyToManyField",
"django.db.models.FileField",
"cajas.users.models.charges.Charge.objects.get",
"django.db.models.CharField"
] | [((238, 254), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (252, 254), False, 'from django.contrib.auth import get_user_model\n'), ((708, 818), 'django.db.models.ForeignKey', 'models.ForeignKey', (['User'], {'verbose_name': '"""Usuario"""', 'on_delete': 'models.CASCADE', 'related_name': '""... |
import tornado.wsgi
class MainHandler(tornado.web.RequestHandler):
def get(self):
self.write("Zirconi's TEST SERVER<br /><br />")
self.write("Usage: /MAGIC?num=[your id]&pwd=[<PASSWORD>]&server=[0 or 1]<br /><br /><br /><br /><br /><br />")
self.write("Wuhan University of technology Huaxia... | [
"bae.core.wsgi.WSGIApplication"
] | [((487, 507), 'bae.core.wsgi.WSGIApplication', 'WSGIApplication', (['app'], {}), '(app)\n', (502, 507), False, 'from bae.core.wsgi import WSGIApplication\n')] |
# Adaptation of the VNet model from https://arxiv.org/pdf/1606.04797.pdf
# This 3D deep neural network model is regularized with 3D spatial dropout
# and Group normalization.
from tensorflow.keras.layers import (
Conv3D,
Input,
MaxPooling3D,
SpatialDropout3D,
UpSampling3D,
concatenate,
)
from t... | [
"tensorflow.keras.layers.Conv3D",
"tensorflow.keras.layers.Input",
"tensorflow.keras.layers.MaxPooling3D",
"tensorflow.keras.layers.concatenate",
"tensorflow.keras.layers.UpSampling3D",
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.SpatialDropout3D"
] | [((2092, 2115), 'tensorflow.keras.layers.concatenate', 'concatenate', (['[skip, up]'], {}), '([skip, up])\n', (2103, 2115), False, 'from tensorflow.keras.layers import Conv3D, Input, MaxPooling3D, SpatialDropout3D, UpSampling3D, concatenate\n'), ((4219, 4237), 'tensorflow.keras.layers.Input', 'Input', (['input_shape'],... |
#!/usr/bin/env python3
#title : poisson.py
#description : Poisson distribution.
#author : <NAME>
#date : 2015.06.19
#version : 0.1
#usage : python poisson.py
#=====================================================
import numpy as np
from scipy import special as sp
from scipy... | [
"core.core.delta.log_likelihood",
"numpy.random.poisson",
"numpy.power",
"numpy.where",
"core.core.delta.pmf",
"numpy.log",
"core.core.delta.samples",
"numpy.sum",
"mpmath.ln",
"numpy.arange"
] | [((932, 957), 'core.core.delta.pmf', 'co.delta.pmf', (['[0]', 'domain'], {}), '([0], domain)\n', (944, 957), True, 'from core import core as co\n'), ((1457, 1484), 'core.core.delta.samples', 'co.delta.samples', (['[0]', 'size'], {}), '([0], size)\n', (1473, 1484), True, 'from core import core as co\n'), ((1518, 1552), ... |
#!/usr/bin/env python3
# Copyright 2020 The Google Font Tools Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | [
"yaml.dump",
"gftools.builder.GFBuilder",
"argparse.ArgumentParser",
"sys.exit"
] | [((735, 896), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Build a font family"""', 'formatter_class': 'argparse.RawDescriptionHelpFormatter', 'epilog': "('#' * 79 + '\\n' + GFBuilder_doc)"}), "(description='Build a font family', formatter_class=\n argparse.RawDescriptionHelpFormatt... |
import numpy as np
from collections import Counter
from lidar_interpolate_toolbox import *
from path import Path
from PIL import Image
from imageio import imread
from visdom import Visdom
from color_utils import *
vis = Visdom()
def read_raw_calib_file(filepath):
# From https://github.com/utiasSTARS/pykitti/blob... | [
"numpy.uint8",
"numpy.eye",
"PIL.Image.fromarray",
"numpy.reshape",
"numpy.fromfile",
"numpy.where",
"collections.Counter",
"path.Path",
"numpy.dot",
"numpy.array",
"numpy.zeros",
"imageio.imread",
"numpy.transpose",
"numpy.round",
"visdom.Visdom"
] | [((221, 229), 'visdom.Visdom', 'Visdom', ([], {}), '()\n', (227, 229), False, 'from visdom import Visdom\n'), ((1133, 1142), 'numpy.eye', 'np.eye', (['(4)'], {}), '(4)\n', (1139, 1142), True, 'import numpy as np\n'), ((3074, 3084), 'path.Path', 'Path', (['root'], {}), '(root)\n', (3078, 3084), False, 'from path import ... |
from __main__ import sio
''' Events handlers for Join room and leave room ,
This method contains join room and leave room for all name spaces. This was introduced to ensure join room and leave
room happens within the namespace'''
@sio.on('join_room', namespace='/project')
async def join_room(sid, room_name):
pri... | [
"__main__.sio.enter_room",
"__main__.sio.on",
"__main__.sio.leave_room"
] | [((234, 275), '__main__.sio.on', 'sio.on', (['"""join_room"""'], {'namespace': '"""/project"""'}), "('join_room', namespace='/project')\n", (240, 275), False, 'from __main__ import sio\n'), ((565, 607), '__main__.sio.on', 'sio.on', (['"""leave_room"""'], {'namespace': '"""/project"""'}), "('leave_room', namespace='/pro... |
import pandas as pd
import numpy as np
import dash
dash.__version__
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output,State
import plotly.graph_objects as go
from scipy import optimize
from scipy import integrate
import os
print(os.getcwd())
df_analyse... | [
"pandas.read_csv",
"dash.dependencies.Output",
"os.getcwd",
"dash.dependencies.Input",
"plotly.graph_objects.Figure",
"dash_core_components.Markdown",
"dash_core_components.Graph",
"dash.Dash"
] | [((323, 384), 'pandas.read_csv', 'pd.read_csv', (['"""../data/processed/COVID_final_set.csv"""'], {'sep': '""";"""'}), "('../data/processed/COVID_final_set.csv', sep=';')\n", (334, 384), True, 'import pandas as pd\n'), ((394, 405), 'plotly.graph_objects.Figure', 'go.Figure', ([], {}), '()\n', (403, 405), True, 'import ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#import flask dependencies for web GUI
from flask import Flask, render_template, flash, redirect, url_for, session, request, logging
from passlib.hash import sha256_crypt
from flask_mysqldb import MySQL
from functools import wraps
#import other functions and classes
from sqlh... | [
"flask.render_template",
"passlib.hash.sha256_crypt.encrypt",
"flask_mysqldb.MySQL",
"flask.flash",
"flask.session.get",
"flask.Flask",
"time.strftime",
"passlib.hash.sha256_crypt.verify",
"functools.wraps",
"flask.url_for",
"flask.session.clear"
] | [((416, 431), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (421, 431), False, 'from flask import Flask, render_template, flash, redirect, url_for, session, request, logging\n'), ((942, 952), 'flask_mysqldb.MySQL', 'MySQL', (['app'], {}), '(app)\n', (947, 952), False, 'from flask_mysqldb import MySQL\n'),... |
import time
import mido
from logger import *
# The default tempo is 120 BPM.
# (500000 microseconds per beat (quarter note).)
DEFAULT_TEMPO = 500000
DEFAULT_TICKS_PER_BEAT = 480
def to_abstime(messages, i):
now = 0
for msg in messages:
now += msg.time
yield msg.copy(time=now), i
def to_rel... | [
"mido.MetaMessage",
"mido.tick2second"
] | [((1115, 1159), 'mido.MetaMessage', 'mido.MetaMessage', (['"""end_of_track"""'], {'time': 'accum'}), "('end_of_track', time=accum)\n", (1131, 1159), False, 'import mido\n'), ((1903, 1957), 'mido.tick2second', 'mido.tick2second', (['msg.time', 'self.ticks_per_beat', 'tempo'], {}), '(msg.time, self.ticks_per_beat, tempo)... |
"""
Copyright (c) 2022 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W... | [
"testcase.utils.Constant.Constant",
"yat.test.Node",
"testcase.utils.Logger.Logger"
] | [((796, 804), 'testcase.utils.Logger.Logger', 'Logger', ([], {}), '()\n', (802, 804), False, 'from testcase.utils.Logger import Logger\n'), ((989, 1004), 'yat.test.Node', 'Node', (['"""default"""'], {}), "('default')\n", (993, 1004), False, 'from yat.test import Node\n'), ((1029, 1039), 'testcase.utils.Constant.Constan... |
# -*- coding: utf-8 -*-
#
# miditk/smf/parser.py
#
"""MIDI file low-level binary parsing."""
from __future__ import absolute_import, unicode_literals
# standard library imports
import logging
# package-specific imports
from ..common.constants import (CHANNEL_PRESSURE, CONTROLLER_CHANGE, END_OF_EXCLUSIVE,
... | [
"logging.getLogger",
"miditk.smf.api.PrintingMidiEventHandler"
] | [((703, 730), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (720, 730), False, 'import logging\n'), ((11301, 11327), 'miditk.smf.api.PrintingMidiEventHandler', 'PrintingMidiEventHandler', ([], {}), '()\n', (11325, 11327), False, 'from miditk.smf.api import PrintingMidiEventHandler\n')] |
from cas.common.assets.models import (
Asset,
AssetBuildContext,
SerialDriver,
PrecompileResult,
)
from typing import List
class CaptionDriver(SerialDriver):
"""
Driver that handles compiling closed captions
"""
def _tool_name(self):
return "captioncompiler"
def precompi... | [
"cas.common.assets.models.PrecompileResult"
] | [((455, 502), 'cas.common.assets.models.PrecompileResult', 'PrecompileResult', (['[asset.path]', '[asset.outpath]'], {}), '([asset.path], [asset.outpath])\n', (471, 502), False, 'from cas.common.assets.models import Asset, AssetBuildContext, SerialDriver, PrecompileResult\n')] |
"""create insufficient fund bcol error
Revision ID: 872760122cc9
Revises: <PASSWORD>
Create Date: 2020-09-29 17:15:54.848026
"""
from alembic import op
from sqlalchemy import String
from sqlalchemy.sql import column, table
# revision identifiers, used by Alembic.
revision = '872760122cc9'
down_revision = '<PASSWORD... | [
"sqlalchemy.sql.column",
"alembic.op.bulk_insert",
"alembic.op.execute"
] | [((619, 968), 'alembic.op.bulk_insert', 'op.bulk_insert', (['error_code_table', "[{'code': 'BCOL_ACCOUNT_INSUFFICIENT_FUNDS', 'title': 'Insufficient Funds',\n 'detail':\n 'This BC Online account has insufficient funds. <br/>Please add funds to the account. <br/>SERVICE BC HELP DESK: <br/>Toll-free: 1-800-663-6102... |
import os
import sys
import urllib.parse
import aiohttp
import aioredis
import aiowiki
import ujson
from typing import Any, List, Dict
from aiohttp import web
from aioredis import Redis
class BaseConnector:
def __init__(self, url: str, read_timeout: int, conn_timeout: int):
self._url = url
self.... | [
"aioredis.create_sentinel",
"aiohttp.ClientSession",
"ujson.dumps",
"aiowiki.Wiki.wikipedia",
"aiohttp.TCPConnector"
] | [((417, 492), 'aiohttp.TCPConnector', 'aiohttp.TCPConnector', ([], {'use_dns_cache': '(True)', 'ttl_dns_cache': '(60 * 60)', 'limit': '(1024)'}), '(use_dns_cache=True, ttl_dns_cache=60 * 60, limit=1024)\n', (437, 492), False, 'import aiohttp\n'), ((537, 684), 'aiohttp.ClientSession', 'aiohttp.ClientSession', ([], {'con... |
"""
These are utilities for checking for free GPUs
"""
import os
import csv
import time
import torch
from gpuinfo import GPUInfo
def get_pids():
# Gets all PIDs on all GPUs as a dictionary
# Each key is a GPU ID
info = GPUInfo.get_info()
pids = info[0]
pids = {value[0]: key for key, value in pi... | [
"csv.writer",
"csv.reader",
"gpuinfo.GPUInfo.get_info",
"time.sleep"
] | [((235, 253), 'gpuinfo.GPUInfo.get_info', 'GPUInfo.get_info', ([], {}), '()\n', (251, 253), False, 'from gpuinfo import GPUInfo\n'), ((503, 517), 'time.sleep', 'time.sleep', (['(15)'], {}), '(15)\n', (513, 517), False, 'import time\n'), ((913, 947), 'csv.reader', 'csv.reader', (['csvfile'], {'delimiter': '""" """'}), "... |
"""
Train a new model on one or across multiple GPUs.
"""
from comet_ml import ExistingExperiment, Experiment
import collections
import math
import random
from getpass import getpass
import keyring
import numpy as np
import torch
from fairseq import (
checkpoint_utils,
distributed_utils,
options,
pr... | [
"comet_ml.Experiment",
"fairseq.options.parse_args_and_arch",
"torch.cuda.device_count",
"comet_ml.ExistingExperiment",
"torch.cuda.is_available",
"fairseq.options.get_training_parser",
"fairseq.distributed_utils.infer_init_method",
"fairseq.checkpoint_utils.load_checkpoint",
"keyring.set_password",... | [((550, 580), 'fairseq.utils.import_user_module', 'utils.import_user_module', (['args'], {}), '(args)\n', (574, 580), False, 'from fairseq import checkpoint_utils, distributed_utils, options, progress_bar, tasks, utils\n'), ((1119, 1144), 'numpy.random.seed', 'np.random.seed', (['args.seed'], {}), '(args.seed)\n', (113... |
# -*- coding: utf-8 -*-
"""
readability.utils
~~~~~~~~~~~~~~~~~
This module provides various utils to the rest of the package.
"""
import logging
from datetime import datetime
from dateutil.parser import parse as parse_datetime
logger = logging.getLogger(__name__)
# map of filter names to a data type. This is... | [
"logging.getLogger",
"dateutil.parser.parse"
] | [((245, 272), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (262, 272), False, 'import logging\n'), ((1192, 1213), 'dateutil.parser.parse', 'parse_datetime', (['value'], {}), '(value)\n', (1206, 1213), True, 'from dateutil.parser import parse as parse_datetime\n')] |
from flask import Flask, session
app = Flask(__name__)
app.secret_key = " "
| [
"flask.Flask"
] | [((40, 55), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (45, 55), False, 'from flask import Flask, session\n')] |
import inspect
import re
import sys
import unicodedata
import yaml
# from reversion import revisions as reversion
import reversion
from django.conf import settings
from django.contrib.auth.models import Group
from django.db import models
from django.db.models import Q
from django.db.models.signals import m2m_changed, ... | [
"django.db.models.FloatField",
"reversion.register",
"inspect.getmembers",
"apis_core.apis_vocabularies.models.AbstractRelationType.get_all_relationtype_classes",
"django.db.models.ForeignKey",
"apis_core.apis_relations.models.AbstractRelation.get_relation_field_names_of_entity_class",
"django.contrib.a... | [((20203, 20253), 'reversion.register', 'reversion.register', ([], {'follow': "['tempentityclass_ptr']"}), "(follow=['tempentityclass_ptr'])\n", (20221, 20253), False, 'import reversion\n'), ((21168, 21218), 'reversion.register', 'reversion.register', ([], {'follow': "['tempentityclass_ptr']"}), "(follow=['tempentitycl... |
from typing import List
import numpy as np
import segmentation_models_pytorch as smp
from segmentation_models_pytorch.base.modules import Activation
import torch
from torch import nn
from torch.nn import functional as F
from torchvision import datasets
from torchvision.transforms import transforms
from baal import Ac... | [
"segmentation_models_pytorch.base.modules.Activation",
"torch.nn.Dropout2d",
"torch.Tensor",
"torch.nn.Conv2d",
"torch.nn.UpsamplingBilinear2d",
"numpy.array",
"torchvision.transforms.transforms.ToTensor",
"torch.nn.functional.log_softmax",
"torch.nn.Identity",
"torchvision.datasets.VOCSegmentatio... | [((358, 682), 'numpy.array', 'np.array', (['[[0, 0, 0], [128, 0, 0], [0, 128, 0], [128, 128, 0], [0, 0, 128], [128, 0, \n 128], [0, 128, 128], [128, 128, 128], [64, 0, 0], [192, 0, 0], [64, 128,\n 0], [192, 128, 0], [64, 0, 128], [192, 0, 128], [64, 128, 128], [192, \n 128, 128], [0, 64, 0], [128, 64, 0], [0, ... |
# -*- coding: utf-8 -*-
"""
Created on 11.2016
@author: <NAME>
Based on the suggestions made by <NAME>
(https://github.com/piero-ranalli)
----------------------------------
Reproject XMM event files and attitude files
onto a shifted RA/DEC
For event files,
the following values will be updated
using the new RA/DEC input... | [
"yaml.load"
] | [((874, 894), 'yaml.load', 'yaml.load', (['documents'], {}), '(documents)\n', (883, 894), False, 'import yaml\n')] |
# -*- coding: utf-8 -*-
"""
TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-用户管理(Bk-User) available.
Copyright (C) 2017-2021 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 Lic... | [
"django.template.loader.get_template",
"bkuser_global.drf_crown.inject_serializer"
] | [((1126, 1161), 'bkuser_global.drf_crown.inject_serializer', 'inject_serializer', ([], {'tags': "['account']"}), "(tags=['account'])\n", (1143, 1161), False, 'from bkuser_global.drf_crown import inject_serializer\n'), ((1275, 1309), 'django.template.loader.get_template', 'get_template', (['"""login_success.html"""'], {... |
import torch
import torch.nn as nn
from torchvision import models
from torch.nn.functional import sigmoid as sigmoid
from torch.autograd import Variable
#This file contains all of the Residual-U-Net variants, including Gaussian Dropout
#Gaussian Dropout is taken from https://github.com/j-min/Dropouts/blob/maste... | [
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.Dropout2d",
"torch.Tensor",
"torchvision.models.resnet18",
"torch.nn.Conv2d",
"torch.nn.MaxPool2d",
"torch.autograd.Variable",
"torch.nn.ConvTranspose2d"
] | [((549, 570), 'torch.Tensor', 'torch.Tensor', (['[alpha]'], {}), '([alpha])\n', (561, 570), False, 'import torch\n'), ((1236, 1303), 'torch.nn.Conv2d', 'nn.Conv2d', (['in_channels', 'out_channels'], {'kernel_size': '(3, 3)', 'padding': '(1)'}), '(in_channels, out_channels, kernel_size=(3, 3), padding=1)\n', (1245, 1303... |
"""API Handler for hacs_repository_data"""
import sys
import homeassistant.helpers.config_validation as cv
import voluptuous as vol
from aiogithubapi import AIOGitHubAPIException
from homeassistant.components import websocket_api
from custom_components.hacs.helpers.classes.exceptions import HacsException
from custom_... | [
"voluptuous.Required",
"custom_components.hacs.helpers.classes.exceptions.HacsException",
"sys.exc_info",
"custom_components.hacs.utils.logger.getLogger",
"homeassistant.components.websocket_api.result_message",
"custom_components.hacs.helpers.functions.misc.extract_repository_from_url",
"voluptuous.Opt... | [((615, 626), 'custom_components.hacs.utils.logger.getLogger', 'getLogger', ([], {}), '()\n', (624, 626), False, 'from custom_components.hacs.utils.logger import getLogger\n'), ((1007, 1017), 'custom_components.hacs.share.get_hacs', 'get_hacs', ([], {}), '()\n', (1015, 1017), False, 'from custom_components.hacs.share i... |
import pandas as pd
import numpy as np
import json
import csv
import argparse
import re
from collections import OrderedDict
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Converts Covid-19 Data \
Tabels provided by the RKI to a simpler format \
... | [
"collections.OrderedDict",
"argparse.ArgumentParser",
"re.compile",
"pandas.read_csv",
"json.load",
"numpy.sum",
"pandas.DataFrame",
"pandas.date_range"
] | [((168, 355), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Converts Covid-19 Data Tabels provided by the RKI to a simpler format to fit the model"""'}), "(description=\n 'Converts Covid-19 Data Tabels prov... |
# encoding: utf-8
from __future__ import print_function
__docformat__ = "restructuredtext en"
#-------------------------------------------------------------------------------
# Copyright (C) 2008 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file CO... | [
"distutils.version.LooseVersion",
"zmq.pyzmq_version_info"
] | [((3573, 3597), 'zmq.pyzmq_version_info', 'zmq.pyzmq_version_info', ([], {}), '()\n', (3595, 3597), False, 'import zmq\n'), ((4910, 4926), 'distutils.version.LooseVersion', 'LooseVersion', (['vs'], {}), '(vs)\n', (4922, 4926), False, 'from distutils.version import LooseVersion\n')] |
#!/usr/bin/env python
# encoding: utf-8
"""Usage:
convert.py serial_speakers <input_path> <serie_uri> <annotation_path> <annotated_path> [--map]
"""
from pyannote.core import Annotation, Segment, Timeline
import pyannote.database
from Plumcot import Plumcot
import json
from termcolor import colored
import numpy as n... | [
"Plumcot.Plumcot",
"json.loads",
"pyannote.core.Segment",
"re.split",
"numpy.unique",
"termcolor.colored",
"json.dump",
"pyannote.core.Timeline",
"json.load",
"pyannote.core.Annotation",
"docopt.docopt"
] | [((1716, 1725), 'Plumcot.Plumcot', 'Plumcot', ([], {}), '()\n', (1723, 1725), False, 'from Plumcot import Plumcot\n'), ((3381, 3432), 'numpy.unique', 'np.unique', (['serial_speaker_names'], {'return_counts': '(True)'}), '(serial_speaker_names, return_counts=True)\n', (3390, 3432), True, 'import numpy as np\n'), ((5899,... |
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from conf.settings import ConfigMap
# 创建数据库db
db = SQLAlchemy()
def create_app(config):
'''
工厂模式创建app
@config: 'develop': 开发环境, 'product': 生产环境, 'test': 测试环境
'''
app = Flask(__name__)
# 加载配置文件
app.config.from_object(Confi... | [
"flask_sqlalchemy.SQLAlchemy",
"flask.Flask"
] | [((117, 129), 'flask_sqlalchemy.SQLAlchemy', 'SQLAlchemy', ([], {}), '()\n', (127, 129), False, 'from flask_sqlalchemy import SQLAlchemy\n'), ((258, 273), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (263, 273), False, 'from flask import Flask\n')] |
#!/usr/bin/env python
# -*- mode:python; coding:utf-8 -*-
"""schema_registry.manager wraps a Confluent Schema Registry.
The module provides a class, SchemaRegistryManager, with a number of methods
to register, query and delete Avro schemas in Confluent Schema Registry.
"""
__author__ = "<NAME>"
__copyright__ = ... | [
"json.loads",
"requests.post",
"json.dumps",
"requests.get",
"requests.delete"
] | [((2191, 2240), 'requests.get', 'requests.get', (['f"""http://{self._manager_ip}/config"""'], {}), "(f'http://{self._manager_ip}/config')\n", (2203, 2240), False, 'import requests\n'), ((2962, 3013), 'requests.get', 'requests.get', (['f"""http://{self._manager_ip}/subjects"""'], {}), "(f'http://{self._manager_ip}/subje... |
# -*- coding: utf-8 -*-
"""
Simple ANALYSIS driver for GrainHill model
"""
from landlab.io import load_params
import numpy as np
grain_hill_as_class = reload(grain_hill_as_class)
def two_node_diff(a):
"""Calculate and return diffs over two nodes instead of one."""
N = len(a)
return a[2:] - a[:(N-2)]
dx ... | [
"landlab.io.load_params",
"numpy.amax",
"numpy.round"
] | [((499, 522), 'landlab.io.load_params', 'load_params', (['input_file'], {}), '(input_file)\n', (510, 522), False, 'from landlab.io import load_params\n'), ((2131, 2152), 'numpy.amax', 'np.amax', (['elev_profile'], {}), '(elev_profile)\n', (2138, 2152), True, 'import numpy as np\n'), ((596, 638), 'numpy.round', 'np.roun... |
from sacred import Experiment
import os.path as osp
import os
import numpy as np
import yaml
import cv2
import torch
from torch.utils.data import DataLoader
from tracktor.config import get_output_dir, get_tb_dir
from tracktor.solver import Solver
from tracktor.datasets.factory import Datasets
from tracktor.resnet imp... | [
"torch.manual_seed",
"tracktor.datasets.factory.Datasets",
"os.path.exists",
"tracktor.resnet.resnet50",
"os.makedirs",
"yaml.dump",
"tracktor.config.get_tb_dir",
"os.path.join",
"sacred.Experiment",
"tracktor.solver.Solver",
"numpy.random.seed",
"tracktor.config.get_output_dir",
"torch.util... | [((339, 351), 'sacred.Experiment', 'Experiment', ([], {}), '()\n', (349, 351), False, 'from sacred import Experiment\n'), ((522, 556), 'torch.manual_seed', 'torch.manual_seed', (["siamese['seed']"], {}), "(siamese['seed'])\n", (539, 556), False, 'import torch\n'), ((561, 600), 'torch.cuda.manual_seed', 'torch.cuda.manu... |
import os
import discord
from dotenv import load_dotenv
import random
from datetime import datetime
load_dotenv()
TOKEN = os.getenv('DISCORD_TOKEN')
GUILD = os.getenv('DISCORD_GUILD')
ERRORPATH = os.getenv('ERROR_PATH')
client = discord.Client()
@client.event
async def on_ready():
guild = discord.utils.find(lam... | [
"random.choice",
"discord.utils.find",
"os.getenv",
"dotenv.load_dotenv",
"datetime.datetime.today",
"discord.Client"
] | [((102, 115), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (113, 115), False, 'from dotenv import load_dotenv\n'), ((124, 150), 'os.getenv', 'os.getenv', (['"""DISCORD_TOKEN"""'], {}), "('DISCORD_TOKEN')\n", (133, 150), False, 'import os\n'), ((159, 185), 'os.getenv', 'os.getenv', (['"""DISCORD_GUILD"""'], {}... |
from sqlalchemy import Column, Integer, String, Float, ForeignKey, func, select
from sqlalchemy.orm import relationship
from flask_login import UserMixin
from receipts_storage.app import db, login
from .role import Role
user_roles = db.Table("user_roles",
db.Column("user_id", db.Integer(), db.ForeignKey("person.id... | [
"receipts_storage.app.db.ForeignKey",
"receipts_storage.app.db.Integer",
"receipts_storage.app.db.session.commit",
"receipts_storage.app.db.relationship",
"sqlalchemy.Column"
] | [((589, 622), 'sqlalchemy.Column', 'Column', (['Integer'], {'primary_key': '(True)'}), '(Integer, primary_key=True)\n', (595, 622), False, 'from sqlalchemy import Column, Integer, String, Float, ForeignKey, func, select\n'), ((638, 681), 'sqlalchemy.Column', 'Column', (['String'], {'unique': '(True)', 'nullable': '(Fal... |
######################################################################
# #
# Copyright 2009-2020 <NAME>. #
# This file is part of gdspy, distributed under the terms of the #
# Boost Software License - Version 1.0. See the accom... | [
"itertools.chain",
"gdspy.path.FlexPath",
"colorsys.hsv_to_rgb",
"numpy.array",
"builtins.range",
"copy.deepcopy",
"numpy.sin",
"datetime.datetime.today",
"copy.copy",
"gdspy.label.Label",
"gdspy.gdsiiformat._eight_byte_real",
"gdspy.gdsiiformat._raw_record_reader",
"numpy.concatenate",
"w... | [((1723, 1747), 'numpy.array', 'numpy.array', (['(-1.0, 1.0)'], {}), '((-1.0, 1.0))\n', (1734, 1747), False, 'import numpy\n'), ((970, 1004), 'future.standard_library.install_aliases', 'standard_library.install_aliases', ([], {}), '()\n', (1002, 1004), False, 'from future import standard_library\n'), ((103314, 103340),... |
# Reference: https://www.kaggle.com/CVxTz/audio-data-augmentation
import numpy as np
from nlpaug.model.audio import Audio
class Shift(Audio):
def __init__(self, sampling_rate, shift_max=2, shift_direction='both'):
"""
:param sampling_rate: SR of audio
:param shift_max: Max shifting in s... | [
"numpy.random.randint",
"numpy.roll"
] | [((855, 909), 'numpy.random.randint', 'np.random.randint', (['(self.sampling_rate * self.shift_max)'], {}), '(self.sampling_rate * self.shift_max)\n', (872, 909), True, 'import numpy as np\n'), ((1162, 1182), 'numpy.roll', 'np.roll', (['data', 'shift'], {}), '(data, shift)\n', (1169, 1182), True, 'import numpy as np\n'... |
"""
Split test files for language that only have a test set, such as Swedish, Faroese and Breton.
"""
import argparse
import os
import random
from typing import Dict, Tuple, List, Any, Callable
def lazy_nonparse(text: str):
for sentence in text.split("\n\n"):
if sentence:
yield [line for line ... | [
"random.shuffle",
"argparse.ArgumentParser"
] | [((356, 381), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (379, 381), False, 'import argparse\n'), ((1101, 1128), 'random.shuffle', 'random.shuffle', (['annotations'], {}), '(annotations)\n', (1115, 1128), False, 'import random\n')] |
from libqtile import widget, qtile
from my_modules.colours import COLOURS
from my_modules.programs import PROGRAMS
WIDGET_PADDING = 3
FONT_SIZE = 20
FONT_SIZE_WORKSPACE_ICONS = 15
FONT_AWESOME_FONTSIZE = FONT_SIZE - 2
DEFAULT_FONT = "SF Pro Display"
FONT_AWESOME_FONT = "Font Awesome 5 Free"
FOREGROUND_COLOUR = COLO... | [
"libqtile.widget.Spacer",
"libqtile.widget.TextBox",
"libqtile.widget.Prompt",
"libqtile.widget.CurrentLayoutIcon",
"libqtile.widget.Clock",
"libqtile.widget.CPUGraph",
"libqtile.widget.OpenWeather",
"libqtile.widget.MemoryGraph",
"libqtile.widget.GroupBox",
"libqtile.qtile.cmd_spawn",
"libqtile... | [((385, 409), 'libqtile.widget.Spacer', 'widget.Spacer', ([], {'length': '(10)'}), '(length=10)\n', (398, 409), False, 'from libqtile import widget, qtile\n'), ((945, 980), 'libqtile.widget.CurrentLayoutIcon', 'widget.CurrentLayoutIcon', ([], {'scale': '(0.6)'}), '(scale=0.6)\n', (969, 980), False, 'from libqtile impor... |
from itertools import product
from random import choice
from sys import stdout
from typing import Tuple
from numpy import all, full, zeros, uint8
symbol_dict = {
'hunt': ('S', 'P'),
'harvest': ('p', 'P'),
'escalation': 'M'
}
A_AGENT = 0 # base
B_AGENT = 1
STAG = 2 # hunt
PLANT = 3
Y_PLANT = 2 # harv... | [
"numpy.all",
"random.choice",
"numpy.zeros",
"numpy.full",
"sys.stdout.flush",
"sys.stdout.write"
] | [((1549, 1597), 'sys.stdout.write', 'stdout.write', (['"""╔════════════════════════════╗\n"""'], {}), "('╔════════════════════════════╗\\n')\n", (1561, 1597), False, 'from sys import stdout\n'), ((2169, 2219), 'sys.stdout.write', 'stdout.write', (["'╚════════════════════════════╝\\n\\r'"], {}), "('╚════════════════════... |
__author__='lhq'
import os
import numpy as np
from PIL import Image
from torch.utils.data import Dataset
def get_train_img():
"""
获取输入数据
:return:
"""
cwd=os.getcwd()
mi_dir=cwd+'/dataset/train/mi/'
shu_dir=cwd+'/dataset/train/shu/'
file1=os.listdir(mi_dir)
file0=os.listdir(shu_dir)... | [
"os.listdir",
"PIL.Image.open",
"numpy.delete",
"os.getcwd",
"numpy.array",
"numpy.empty",
"numpy.concatenate"
] | [((176, 187), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (185, 187), False, 'import os\n'), ((272, 290), 'os.listdir', 'os.listdir', (['mi_dir'], {}), '(mi_dir)\n', (282, 290), False, 'import os\n'), ((301, 320), 'os.listdir', 'os.listdir', (['shu_dir'], {}), '(shu_dir)\n', (311, 320), False, 'import os\n'), ((425, 44... |
# Generated by Django 3.2.6 on 2021-11-23 17:42
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('django_dicom', '0009_alter_series_sequence_type'),
]
operations = [
migrations.AlterField(
model_name='series',
name... | [
"django.db.models.CharField"
] | [((356, 886), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'choices': "[('Anatomical', (('localizer', 'Localizer'), ('flair', 'FLAIR'), ('ir_epi',\n 'IR-EPI'), ('mprage', 'MPRAGE'), ('t2w', 'T2-weighted'))), ('Diffusion',\n (('dwi', 'DWI'), ('dwi_derived', 'DWI (derived)'), ('dwi_fie... |
from pathlib import Path
from typing import Any, Iterable, List, Tuple, Type
from black import FileMode, format_str
from click import secho
from jinja2 import Environment, PackageLoader
from reactant.exceptions import RenderFailed
from reactant.main import PeeweeORM
from reactant.orm.peewee import PeeweeCombustor, Pe... | [
"pathlib.Path",
"click.secho",
"black.FileMode",
"reactant.orm.peewee.PeeweeCombustor.generate_peewee_orm_model",
"reactant.exceptions.RenderFailed",
"jinja2.PackageLoader"
] | [((361, 386), 'jinja2.PackageLoader', 'PackageLoader', (['"""reactant"""'], {}), "('reactant')\n", (374, 386), False, 'from jinja2 import Environment, PackageLoader\n'), ((2379, 2442), 'click.secho', 'secho', (['f"""Peewee {item_name}.py finished rendering."""'], {'fg': '"""green"""'}), "(f'Peewee {item_name}.py finish... |
# Copyright (c) 2020, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for details.
"""This m... | [
"ansible_collections.oracle.oci.plugins.module_utils.oci_common_utils.get_logger",
"ansible_collections.oracle.oci.plugins.module_utils.oci_common_utils.list_all_resources",
"ansible_collections.oracle.oci.plugins.module_utils.oci_common_utils.call_with_backoff",
"ansible_collections.oracle.oci.plugins.module... | [((712, 770), 'ansible_collections.oracle.oci.plugins.module_utils.oci_common_utils.get_logger', 'oci_common_utils.get_logger', (['"""oci_identity_custom_helpers"""'], {}), "('oci_identity_custom_helpers')\n", (739, 770), False, 'from ansible_collections.oracle.oci.plugins.module_utils import oci_common_utils\n'), ((41... |
"""Conjugate Gradient Optimizer.
Computes the decent direction using the conjugate gradient method, and then
computes the optimal step size that will satisfy the KL divergence constraint.
Finally, it performs a backtracking line search to optimize the objective.
"""
import warnings
from dowel import logger
import nu... | [
"torch.isnan",
"numpy.arange",
"metarl.misc.tensor_utils.unflatten_tensors",
"dowel.logger.log",
"torch.autograd.grad",
"numpy.isnan",
"torch.sum",
"warnings.warn",
"torch.zeros_like",
"torch.Size",
"torch.cat",
"torch.dot"
] | [((1129, 1178), 'torch.autograd.grad', 'torch.autograd.grad', (['f', 'params'], {'create_graph': '(True)'}), '(f, params, create_graph=True)\n', (1148, 1178), False, 'import torch\n'), ((2665, 2684), 'torch.zeros_like', 'torch.zeros_like', (['b'], {}), '(b)\n', (2681, 2684), False, 'import torch\n'), ((2697, 2712), 'to... |
# Copyright (c) 2019, <NAME>. All rights reserved.
#
# This work is licensed under the Creative Commons Attribution-NonCommercial
# 4.0 International License. To view a copy of this license, visit
# http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to
# Creative Commons, PO Box 1866, Mountain View, CA 940... | [
"dnnlib.EasyDict",
"training.misc.locate_network_pkl",
"dnnlib.SubmitConfig",
"dnnlib.util.call_func_by_name",
"dnnlib.submit_run",
"dnnlib.tflib.init_tf",
"training.misc.locate_run_dir",
"dnnlib.submission.submit.get_template_from_path",
"training.misc.list_network_pkls",
"dnnlib.RunContext"
] | [((718, 750), 'dnnlib.RunContext', 'dnnlib.RunContext', (['submit_config'], {}), '(submit_config)\n', (735, 750), False, 'import dnnlib\n'), ((755, 770), 'dnnlib.tflib.init_tf', 'tflib.init_tf', ([], {}), '()\n', (768, 770), True, 'import dnnlib.tflib as tflib\n'), ((875, 919), 'dnnlib.util.call_func_by_name', 'dnnlib.... |
"""
Contributors can be viewed at:
http://svn.secondlife.com/svn/linden/projects/2008/pyogp/lib/base/trunk/CONTRIBUTORS.txt
$LicenseInfo:firstyear=2008&license=apachev2$
Copyright 2009, Linden Research, Inc.
Licensed under the Apache License, Version 2.0.
You may obtain a copy of the License at:
htt... | [
"pyogp.lib.base.message.circuit.Host",
"random.randint"
] | [((981, 1004), 'pyogp.lib.base.message.circuit.Host', 'Host', (['(self, self.port)'], {}), '((self, self.port))\n', (985, 1004), False, 'from pyogp.lib.base.message.circuit import Host\n'), ((1852, 1873), 'random.randint', 'random.randint', (['(0)', '(80)'], {}), '(0, 80)\n', (1866, 1873), False, 'import random\n')] |
from unittest import mock
from django.test import TestCase
from django.test.utils import override_settings
from cid.cursor import CidCursorWrapper
class TestCidCursor(TestCase):
def setUp(self):
self.cursor = mock.Mock()
self.cursor.execute = mock.Mock(return_value=None)
self.cursor.exe... | [
"cid.cursor.CidCursorWrapper",
"django.test.utils.override_settings",
"unittest.mock.patch",
"unittest.mock.Mock"
] | [((426, 458), 'unittest.mock.patch', 'mock.patch', (['"""cid.cursor.get_cid"""'], {}), "('cid.cursor.get_cid')\n", (436, 458), False, 'from unittest import mock\n'), ((728, 794), 'django.test.utils.override_settings', 'override_settings', ([], {'CID_SQL_COMMENT_TEMPLATE': '"""correlation_id={cid}"""'}), "(CID_SQL_COMME... |
from niveristand import _errormessages, errors
from niveristand.clientapi._dotnetclasswrapperbase import _DotNetClassWrapperBase
from NationalInstruments.VeriStand import Error as ErrorDotNet # noqa: I100 We need these C# imports to be out of order
class _Error(_DotNetClassWrapperBase):
"""
Represents NI Ve... | [
"niveristand.errors.VeristandError"
] | [((712, 822), 'niveristand.errors.VeristandError', 'errors.VeristandError', (["(_errormessages.unexpected_dot_net_data_type %\n 'NationalInstruments.VeriStand.Error')"], {}), "(_errormessages.unexpected_dot_net_data_type %\n 'NationalInstruments.VeriStand.Error')\n", (733, 822), False, 'from niveristand import _e... |
# -*- coding: utf-8 -*-
"""PAiP Web Build System
Author: <NAME> <<EMAIL>>
License: MIT
"""
# Imports
from pwbs import main
# Underscore Variables
"""Author of the module"""
__author__ = '<NAME>'
"""Module License"""
__license__ = 'MIT'
"""Documentation format"""
__docformat__ = 'restructuredtext en'
# Main Scrip... | [
"pwbs.main"
] | [((322, 328), 'pwbs.main', 'main', ([], {}), '()\n', (326, 328), False, 'from pwbs import main\n')] |
# Copyright (c) 2018 Cloudify Platform Ltd. 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 ap... | [
"cloudify_aws.common._compat.text_type",
"cloudify_aws.common.utils.find_rel_by_node_type",
"cloudify_aws.common.utils.JsonCleanuper",
"cloudify_aws.common.decorators.aws_resource",
"cloudify.exceptions.OperationRetry",
"cloudify_aws.common.utils.update_resource_id",
"cloudify_aws.ec2.EC2Base.__init__"
... | [((4523, 4589), 'cloudify_aws.common.decorators.aws_resource', 'decorators.aws_resource', (['EC2ElasticIP'], {'resource_type': 'RESOURCE_TYPE'}), '(EC2ElasticIP, resource_type=RESOURCE_TYPE)\n', (4546, 4589), False, 'from cloudify_aws.common import decorators, utils\n'), ((4772, 4824), 'cloudify_aws.common.decorators.a... |
from django.core.management import BaseCommand, CommandError
from erp.export.generate_schema import generate_schema
class Command(BaseCommand):
help = "Génère un TableSchema à partir du schema de données"
default_dir = "erp/export/static"
def add_arguments(self, parser):
parser.add_argument(
... | [
"erp.export.generate_schema.generate_schema",
"django.core.management.CommandError"
] | [((974, 1040), 'erp.export.generate_schema.generate_schema', 'generate_schema', ([], {'base': 'base', 'outfile': 'outfile', 'repository': 'repository'}), '(base=base, outfile=outfile, repository=repository)\n', (989, 1040), False, 'from erp.export.generate_schema import generate_schema\n'), ((1146, 1173), 'django.core.... |
import cv2
import numpy as np
from cv_viewer.utils import *
import pyzed.sl as sl
#----------------------------------------------------------------------
# 2D VIEW
#----------------------------------------------------------------------
def cvt(pt, scale):
'''
Function that scales point coordinates
'... | [
"cv2.addWeighted"
] | [((3172, 3239), 'cv2.addWeighted', 'cv2.addWeighted', (['left_display', '(0.9)', 'overlay', '(0.1)', '(0.0)', 'left_display'], {}), '(left_display, 0.9, overlay, 0.1, 0.0, left_display)\n', (3187, 3239), False, 'import cv2\n')] |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from .scale import scale
from copy import deepcopy
class scale_x_continuous(scale):
"""
Scale x axis as continuous values
Parameters
----------
breaks: list
maps to xbreaks
labe... | [
"copy.deepcopy"
] | [((687, 699), 'copy.deepcopy', 'deepcopy', (['gg'], {}), '(gg)\n', (695, 699), False, 'from copy import deepcopy\n')] |
import os
import pygame
from pkg_resources import resource_stream, resource_filename
def get_resource_filename(path):
"""
Return the filename of a resource.
:param path: the path to the resource
:returns: the real filename of the resource
"""
return resource_filename('arctia', path)
def get_r... | [
"pygame.image.load",
"pkg_resources.resource_filename",
"pkg_resources.resource_stream"
] | [((276, 309), 'pkg_resources.resource_filename', 'resource_filename', (['"""arctia"""', 'path'], {}), "('arctia', path)\n", (293, 309), False, 'from pkg_resources import resource_stream, resource_filename\n'), ((522, 553), 'pkg_resources.resource_stream', 'resource_stream', (['"""arctia"""', 'path'], {}), "('arctia', p... |
import os
import pygame
class Heart(pygame.sprite.Sprite):
def __init__(self, x, y):
super().__init__()
image_location = os.path.join("assets", "heart.png")
self.image = pygame.image.load(image_location).convert_alpha()
self.rect = self.image.get_rect()
self.image = pygame.... | [
"pygame.image.load",
"os.path.join",
"pygame.transform.scale"
] | [((143, 178), 'os.path.join', 'os.path.join', (['"""assets"""', '"""heart.png"""'], {}), "('assets', 'heart.png')\n", (155, 178), False, 'import os\n'), ((313, 359), 'pygame.transform.scale', 'pygame.transform.scale', (['self.image', '(100, 100)'], {}), '(self.image, (100, 100))\n', (335, 359), False, 'import pygame\n'... |
"""
Simply display the contents of the webcam with optional mirroring using OpenCV
via the new Pythonic cv2 interface. Press <esc> to quit.
"""
import cv2
def show_webcam(mirror=False):
cam = cv2.VideoCapture(0)
while True:
ret_val, img = cam.read()
if mirror:
img = cv2.flip(im... | [
"cv2.flip",
"cv2.imshow",
"cv2.destroyAllWindows",
"cv2.VideoCapture",
"cv2.waitKey"
] | [((201, 220), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (217, 220), False, 'import cv2\n'), ((434, 457), 'cv2.destroyAllWindows', 'cv2.destroyAllWindows', ([], {}), '()\n', (455, 457), False, 'import cv2\n'), ((334, 362), 'cv2.imshow', 'cv2.imshow', (['"""my webcam"""', 'img'], {}), "('my webcam',... |
from Crypto.Util.number import inverse
import binascii
e = 1
c = 9327565722767258308650643213344542404592011161659991421
n = 245841236512478852752909734912575581815967630033049838269083
# From factordb
p = 416064700201658306196320137931
q = 590872612825179551336102196593
phi = (p-1) * (q-1)
d = inver... | [
"binascii.unhexlify",
"Crypto.Util.number.inverse"
] | [((315, 330), 'Crypto.Util.number.inverse', 'inverse', (['e', 'phi'], {}), '(e, phi)\n', (322, 330), False, 'from Crypto.Util.number import inverse\n'), ((393, 420), 'binascii.unhexlify', 'binascii.unhexlify', (['hex_str'], {}), '(hex_str)\n', (411, 420), False, 'import binascii\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#import tensorflow as tf
import numpy as np
import math
try:
import cPickle as pickle
except:
import pickle
import os
class BlockScramble:
def __init__( self, blockSize_filename ):
if( isinstance( blockSize_filename, str ) ):
self.load( block... | [
"os.path.exists",
"PIL.Image.fromarray",
"PIL.Image.open",
"numpy.reshape",
"pickle.dump",
"numpy.tile",
"math.floor",
"numpy.int32",
"numpy.asarray",
"pickle.load",
"matplotlib.cm.gist_earth",
"numpy.argsort",
"numpy.concatenate",
"numpy.transpose",
"numpy.arange",
"numpy.random.shuff... | [((4260, 4282), 'PIL.Image.open', 'Image.open', (['"""lena.png"""'], {}), "('lena.png')\n", (4270, 4282), False, 'from PIL import Image\n'), ((4294, 4324), 'numpy.asarray', 'np.asarray', (['im'], {'dtype': 'np.uint8'}), '(im, dtype=np.uint8)\n', (4304, 4324), True, 'import numpy as np\n'), ((4336, 4371), 'numpy.reshape... |
import sqlalchemy as sa
metadata = sa.MetaData()
commission_metas = sa.Table(
'commission_metas',
metadata,
sa.Column(
'broker',
sa.String,
nullable=False),
sa.Column(
'model',
sa.String,
nullable=False
),
sa.Column(
'exchange',
s... | [
"sqlalchemy.MetaData",
"sqlalchemy.Column"
] | [((36, 49), 'sqlalchemy.MetaData', 'sa.MetaData', ([], {}), '()\n', (47, 49), True, 'import sqlalchemy as sa\n'), ((122, 168), 'sqlalchemy.Column', 'sa.Column', (['"""broker"""', 'sa.String'], {'nullable': '(False)'}), "('broker', sa.String, nullable=False)\n", (131, 168), True, 'import sqlalchemy as sa\n'), ((199, 244... |
from sqlalchemy.orm import relationship
from sqlalchemy.sql.functions import now
from sqlalchemy.sql.schema import ForeignKey
from sqlalchemy.sql.sqltypes import TIMESTAMP
from database import Base
from sqlalchemy import Column, Integer, String
class Note(Base):
__tablename__ = "notes"
id = Column(Integer, p... | [
"sqlalchemy.orm.relationship",
"sqlalchemy.sql.schema.ForeignKey",
"sqlalchemy.sql.functions.now",
"sqlalchemy.Column",
"sqlalchemy.sql.sqltypes.TIMESTAMP"
] | [((303, 352), 'sqlalchemy.Column', 'Column', (['Integer'], {'primary_key': '(True)', 'nullable': '(False)'}), '(Integer, primary_key=True, nullable=False)\n', (309, 352), False, 'from sqlalchemy import Column, Integer, String\n'), ((365, 395), 'sqlalchemy.Column', 'Column', (['String'], {'nullable': '(False)'}), '(Stri... |
from acceptability.modules import LMGenerator
if __name__ == '__main__':
trainer = LMGenerator()
trainer.load()
trainer.generate()
| [
"acceptability.modules.LMGenerator"
] | [((88, 101), 'acceptability.modules.LMGenerator', 'LMGenerator', ([], {}), '()\n', (99, 101), False, 'from acceptability.modules import LMGenerator\n')] |
from __future__ import print_function
import sys, os
sys.path.insert(1, os.path.join("..","..",".."))
import h2o
from tests import pyunit_utils
from h2o.estimators.word2vec import H2OWord2vecEstimator
def word2vec_to_frame():
print("Test converting a word2vec model to a Frame")
words = h2o.create_frame(rows=... | [
"h2o.estimators.word2vec.H2OWord2vecEstimator",
"os.path.join",
"h2o.create_frame",
"tests.pyunit_utils.standalone_test"
] | [((72, 102), 'os.path.join', 'os.path.join', (['""".."""', '""".."""', '""".."""'], {}), "('..', '..', '..')\n", (84, 102), False, 'import sys, os\n'), ((298, 376), 'h2o.create_frame', 'h2o.create_frame', ([], {'rows': '(1000)', 'cols': '(1)', 'string_fraction': '(1.0)', 'missing_fraction': '(0.0)'}), '(rows=1000, cols... |
import logging
from datetime import datetime, timedelta
from .fplapi import FplApi
import aiohttp
import asyncio
from homeassistant.helpers.entity import Entity
from homeassistant import util
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.helpers.event import async_call_later
from homeassi... | [
"logging.getLogger",
"datetime.timedelta",
"homeassistant.util.Throttle"
] | [((711, 738), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (728, 738), False, 'import logging\n'), ((765, 786), 'datetime.timedelta', 'timedelta', ([], {'minutes': '(30)'}), '(minutes=30)\n', (774, 786), False, 'from datetime import datetime, timedelta\n'), ((814, 835), 'datetime.timede... |
import json
import re
from http.client import HTTPException
from django.db import connection
from django.http import JsonResponse
from django.shortcuts import render
import requests
from configuration.models import Restart_after_configuration
from administer.models import Nodes, Services
from django.contrib import me... | [
"django.shortcuts.render",
"administer.helper.helper.get_api_key",
"django.http.JsonResponse",
"django.contrib.messages.error",
"configuration.models.Restart_after_configuration.objects.filter",
"json.dumps",
"administer.helper.helper",
"administer.context_processors.base_variables_all",
"django.db.... | [((467, 488), 'administer.helper.helper', 'helper', (['request', 'Yarn'], {}), '(request, Yarn)\n', (473, 488), False, 'from administer.helper import helper\n'), ((578, 624), 'administer.context_processors.base_variables_all', 'context_processors.base_variables_all', (['request'], {}), '(request)\n', (615, 624), False,... |
import sys
from collections import Counter
def adapter_diffs(adapters):
adapt = [0] + adapters + [adapters[-1] + 3]
diffs = [z[1] - z[0] for z in zip(adapt[:-1], adapt[1:])]
return diffs
def find_paths(diffs):
"""
When chargers are 3 units apart, there's only one path
between them.
When... | [
"collections.Counter"
] | [((1536, 1550), 'collections.Counter', 'Counter', (['diffs'], {}), '(diffs)\n', (1543, 1550), False, 'from collections import Counter\n')] |
#!/usr/bin/env python
from distutils.core import setup, Extension
from os import system, environ
from os.path import abspath, dirname, exists
from sys import platform
# set path variables
v8eval_root = abspath(dirname(__file__))
v8_dir = v8eval_root + "/v8"
uv_dir = v8eval_root + "/uv"
py_dir = v8eval_root + "/pytho... | [
"pypandoc.convert",
"distutils.core.setup",
"os.path.dirname",
"distutils.core.Extension",
"os.system"
] | [((395, 428), 'os.system', 'system', (["(v8eval_root + '/build.sh')"], {}), "(v8eval_root + '/build.sh')\n", (401, 428), False, 'from os import system, environ\n'), ((472, 534), 'os.system', 'system', (["('cp ' + v8eval_root + '/src/v8eval.h ' + py_v8eval_dir)"], {}), "('cp ' + v8eval_root + '/src/v8eval.h ' + py_v8eva... |
"""Abstract baseclass for all distributions."""
import logging
import numpy
import chaospy
from .utils import check_dependencies
class Distribution(object):
"""Baseclass for all probability distributions."""
__array_priority__ = 9000
"""Numpy override variable."""
interpret_as_integer = False
... | [
"logging.getLogger",
"numpy.prod",
"numpy.clip",
"chaospy.StochasticallyDependentError",
"numpy.asfarray",
"numpy.array",
"chaospy.approximate_moment",
"chaospy.Negative",
"chaospy.Power",
"chaospy.UnsupportedFeature",
"chaospy.approximate_inverse",
"numpy.where",
"numpy.asarray",
"numpy.r... | [((5076, 5097), 'numpy.atleast_1d', 'numpy.atleast_1d', (['out'], {}), '(out)\n', (5092, 5097), False, 'import numpy\n'), ((5307, 5356), 'chaospy.UnsupportedFeature', 'chaospy.UnsupportedFeature', (['"""lower not supported"""'], {}), "('lower not supported')\n", (5333, 5356), False, 'import chaospy\n'), ((6105, 6126), ... |
from subprocess import Popen
from threading import Thread
class AddSiteFunctionTestCase(Thread):
def __init__(self, process: Popen):
Thread.__init__(self)
self.daemon = True
self.the_data = "/add"
self.the_data_bytes = b"/add"
self.process = process
self.this_log = ... | [
"threading.Thread.__init__",
"sys.path.append"
] | [((147, 168), 'threading.Thread.__init__', 'Thread.__init__', (['self'], {}), '(self)\n', (162, 168), False, 'from threading import Thread\n'), ((1047, 1068), 'threading.Thread.__init__', 'Thread.__init__', (['self'], {}), '(self)\n', (1062, 1068), False, 'from threading import Thread\n'), ((1123, 1145), 'sys.path.appe... |
# -*- coding: utf-8 -*-
# mui ui text view class
import time
from enum import Enum
try:
from parts import AbsParts
from matrix import Matrix
from muifont import MuiFont
except ImportError:
from . import AbsParts
from . import Matrix
from . import MuiFont
LINE_OFFSET = (8+3)
class Border(Enu... | [
"muifont.MuiFont.get_instance",
"matrix.Matrix"
] | [((3791, 3813), 'muifont.MuiFont.get_instance', 'MuiFont.get_instance', ([], {}), '()\n', (3811, 3813), False, 'from muifont import MuiFont\n'), ((5851, 5873), 'muifont.MuiFont.get_instance', 'MuiFont.get_instance', ([], {}), '()\n', (5871, 5873), False, 'from muifont import MuiFont\n'), ((6613, 6675), 'matrix.Matrix',... |