code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from cloudshell.workflow.orchestration.sandbox import Sandbox, Components
import requests
from time import sleep
def wait_for_webservers(sandbox, components):
"""
:param Sandbox sandbox:
:param Components components:
:return:
"""
build_number = sandbox.global_inputs["Build Number"]
api = sandbox.automation_... | [
"requests.get",
"time.sleep"
] | [((1029, 1099), 'requests.get', 'requests.get', (["('http://' + web_server_public_ip + ':' + web_server_port)"], {}), "('http://' + web_server_public_ip + ':' + web_server_port)\n", (1041, 1099), False, 'import requests\n'), ((1201, 1209), 'time.sleep', 'sleep', (['(5)'], {}), '(5)\n', (1206, 1209), False, 'from time i... |
import setuptools
from distutils.core import setup
try:
with open('requirements.txt') as f:
requirements = f.read().splitlines()
except Exception:
requirements = []
setup(
name='automl_infrastructure',
packages=['automl_infrastructure', 'automl_infrastructure.classifiers', 'automl_infrastructu... | [
"distutils.core.setup"
] | [((183, 842), 'distutils.core.setup', 'setup', ([], {'name': '"""automl_infrastructure"""', 'packages': "['automl_infrastructure', 'automl_infrastructure.classifiers',\n 'automl_infrastructure.classifiers.adapters',\n 'automl_infrastructure.interpretation',\n 'automl_infrastructure.interpretation.lime',\n '... |
#!python
# -*- coding: utf-8 -*-
"""
VRT Widesky low-level multi-hisRead/hisWrite operation mix-in. This is a
mix-in for HaystackSession that implements CRUD operations as used in VRT
Widesky's implementation of Project Haystack.
At present, this has not been adopted by other implementations.
"""
import hszinc
from ... | [
"hszinc.Grid",
"hszinc.dump_scalar"
] | [((1884, 1897), 'hszinc.Grid', 'hszinc.Grid', ([], {}), '()\n', (1895, 1897), False, 'import hszinc\n'), ((1012, 1035), 'hszinc.dump_scalar', 'hszinc.dump_scalar', (['rng'], {}), '(rng)\n', (1030, 1035), False, 'import hszinc\n'), ((887, 908), 'hszinc.dump_scalar', 'hszinc.dump_scalar', (['p'], {}), '(p)\n', (905, 908)... |
#! /usr/env/python
import sys
import os
sys.path.insert(1, os.path.join("../../../h2o-py"))
from tests import pyunit_utils
import h2o
def gcs_import():
# Just test the import works - no class clashes, no exception
keys = h2o.import_file(
"gs://gcp-public-data-nexrad-l2/2018/01/01/KABR/NWS_NEXRAD_NXL... | [
"tests.pyunit_utils.standalone_test",
"os.path.join",
"h2o.import_file"
] | [((61, 92), 'os.path.join', 'os.path.join', (['"""../../../h2o-py"""'], {}), "('../../../h2o-py')\n", (73, 92), False, 'import os\n'), ((233, 380), 'h2o.import_file', 'h2o.import_file', (['"""gs://gcp-public-data-nexrad-l2/2018/01/01/KABR/NWS_NEXRAD_NXL2DPBL_KABR_20180101050000_20180101055959.tar"""'], {'parse': '(Fals... |
"""
Utility things
"""
from __future__ import absolute_import
import os
import shlex
import tarfile
import zipfile
from os import pardir
from os.path import (
abspath,
dirname,
expanduser,
isabs,
join,
normpath
)
from subprocess import check_call
try:
import lzma
except ImportError:
tr... | [
"zipfile.is_zipfile",
"os.path.isabs",
"zipfile.ZipFile",
"os.path.dirname",
"tarfile.is_tarfile",
"shlex.split",
"os.environ.get",
"backports.lzma.open",
"os.path.normpath",
"tarfile.open",
"ConfigParser.ConfigParser",
"six.iteritems",
"os.path.join"
] | [((969, 983), 'six.iteritems', 'iteritems', (['new'], {}), '(new)\n', (978, 983), False, 'from six import iteritems, string_types\n'), ((1812, 1823), 'os.path.dirname', 'dirname', (['py'], {}), '(py)\n', (1819, 1823), False, 'from os.path import abspath, dirname, expanduser, isabs, join, normpath\n'), ((1360, 1406), 'o... |
from nonebot import on_notice
from nonebot.adapters.onebot.v11 import GroupIncreaseNoticeEvent, HonorNotifyEvent, \
MessageSegment
from utils.config_util import SubManager, SubList
member_increase = on_notice(priority=1, block=True)
# member_decrease = on_notice(priority=1)
honor = on_notice(priority=1, block=True... | [
"utils.config_util.SubManager",
"nonebot.on_notice",
"nonebot.adapters.onebot.v11.MessageSegment.at"
] | [((204, 237), 'nonebot.on_notice', 'on_notice', ([], {'priority': '(1)', 'block': '(True)'}), '(priority=1, block=True)\n', (213, 237), False, 'from nonebot import on_notice\n'), ((288, 321), 'nonebot.on_notice', 'on_notice', ([], {'priority': '(1)', 'block': '(True)'}), '(priority=1, block=True)\n', (297, 321), False,... |
from deploy.clients import localtestclient
udp = localtestclient.LocalTestUdpClient('test01', remote_port=9190)
tcp = localtestclient.LocalTestTcpClient('test01', remote_port=9191)
print('udp: %s' % udp.version())
print('tcp: %s' % tcp.version())
| [
"deploy.clients.localtestclient.LocalTestUdpClient",
"deploy.clients.localtestclient.LocalTestTcpClient"
] | [((50, 112), 'deploy.clients.localtestclient.LocalTestUdpClient', 'localtestclient.LocalTestUdpClient', (['"""test01"""'], {'remote_port': '(9190)'}), "('test01', remote_port=9190)\n", (84, 112), False, 'from deploy.clients import localtestclient\n'), ((119, 181), 'deploy.clients.localtestclient.LocalTestTcpClient', 'l... |
# coding: utf-8 -*-
# pip install --user -e .
# pip uninstall pyarsenal
from setuptools import setup, find_packages
setup()
| [
"setuptools.setup"
] | [((118, 125), 'setuptools.setup', 'setup', ([], {}), '()\n', (123, 125), False, 'from setuptools import setup, find_packages\n')] |
from database import Base
from sqlalchemy.orm import relationship, backref
from sqlalchemy import Column, String, Integer, Date, ForeignKey, Numeric, DateTime
class KitProduto(Base):
'''
CLASSE KitProduto - MAPEIA TABELA TKit_Produto NO BANCO DE DADOS
QUE FAZ A ASSOCIAÇÃO ENTRE Kit E Produto
@auto... | [
"sqlalchemy.ForeignKey",
"sqlalchemy.Column"
] | [((427, 480), 'sqlalchemy.Column', 'Column', (['Integer'], {'primary_key': '(True)', 'autoincrement': '(True)'}), '(Integer, primary_key=True, autoincrement=True)\n', (433, 480), False, 'from sqlalchemy import Column, String, Integer, Date, ForeignKey, Numeric, DateTime\n'), ((513, 538), 'sqlalchemy.ForeignKey', 'Forei... |
import pandas as pd
import matplotlib.pyplot as plt
def display_prompt(data):
i = -1
for key in data.keys():
i += 1
if i==0:
print('key','\t', 'Attribute')
continue
print(i,'\t', key)
def gui_plot(data):
fig = plt.figure(figsize =(10, 7))
# Creating plo... | [
"matplotlib.pyplot.boxplot",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show"
] | [((272, 299), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(10, 7)'}), '(figsize=(10, 7))\n', (282, 299), True, 'import matplotlib.pyplot as plt\n'), ((327, 344), 'matplotlib.pyplot.boxplot', 'plt.boxplot', (['data'], {}), '(data)\n', (338, 344), True, 'import matplotlib.pyplot as plt\n'), ((367, 377), '... |
"""
A service for aggregating segment data from Strava
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with ... | [
"os.path.dirname",
"os.path.join",
"setuptools.setup"
] | [((412, 685), 'setuptools.setup', 'setup', ([], {'name': '"""segmund-toolchain"""', 'version': '"""1.0.0"""', 'description': '"""A service for aggregating segment data from Strava"""', 'long_description': '"""A service for aggregating segment data from Strava"""', 'url': '"""https://github.com/jglynn/segmund-toolchain"... |
# Original (linear) perceptron with two hidden layers.
#
# Written in Python with Numeric python
#
# <NAME> <jamartin AT dia fi upm es>
from Numeric import *
from RandomArray import *
import pickle
#from numpy import * # use this if you use numpy instead of Numeric
import time
seed(3,3)
def GetBin... | [
"time.clock"
] | [((5399, 5411), 'time.clock', 'time.clock', ([], {}), '()\n', (5409, 5411), False, 'import time\n'), ((6561, 6573), 'time.clock', 'time.clock', ([], {}), '()\n', (6571, 6573), False, 'import time\n')] |
import os
import sys
from influxdb import InfluxDBClient
from influxdb import DataFrameClient
from pandas import DataFrame
class influx_handler:
def __init__(self, influxDBHost=None):
if influxDBHost is None:
self.influxDBHost = os.getenv("INFLUXDB_SERVICE_HOST") or "localhost"
else:
... | [
"pandas.DataFrame",
"os.getenv",
"influxdb.DataFrameClient"
] | [((392, 462), 'influxdb.DataFrameClient', 'DataFrameClient', (['self.influxDBHost', '(8086)', '"""root"""', '"""root"""', '"""thingsIODB"""'], {}), "(self.influxDBHost, 8086, 'root', 'root', 'thingsIODB')\n", (407, 462), False, 'from influxdb import DataFrameClient\n'), ((256, 290), 'os.getenv', 'os.getenv', (['"""INFL... |
#!/usr/bin/env python
import batchmetrics
import boto3
import click
import sys
# Path and size of scratch directory in the tiledbvcf container.
scratch_path = '/data'
scratch_size_mb = 1000 * 1024 # 1TB
class JobInfo(object):
"""Simple struct to contain batch job information."""
def __init__(self, client=... | [
"batchmetrics.print_stats_report",
"boto3.client",
"click.option",
"click.command",
"batchmetrics.wait_all",
"sys.exit"
] | [((2591, 2606), 'click.command', 'click.command', ([], {}), '()\n', (2604, 2606), False, 'import click\n'), ((2608, 2723), 'click.option', 'click.option', (['"""--dataset-uri"""'], {'required': '(True)', 'help': '"""S3 URI of TileDB-VCF dataset to read from."""', 'metavar': '"""URI"""'}), "('--dataset-uri', required=Tr... |
# Copyright (c) ZenML GmbH 2022. 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 applica... | [
"os.environ.get",
"zenml.io.fileio.open",
"os.path.join",
"whylogs.whylabs_client.wrapper.upload_profile"
] | [((1418, 1467), 'os.path.join', 'os.path.join', (['self.artifact.uri', 'PROFILE_FILENAME'], {}), '(self.artifact.uri, PROFILE_FILENAME)\n', (1430, 1467), False, 'import os\n'), ((1857, 1906), 'os.path.join', 'os.path.join', (['self.artifact.uri', 'PROFILE_FILENAME'], {}), '(self.artifact.uri, PROFILE_FILENAME)\n', (186... |
import glob
import json
import os
import pkgutil
import pytest
from herbie_core.services.schema_mock_data.schema_mock_data_generator import SchemaMockDataGenerator
from jsonschema import validate, Draft7Validator, SchemaError
class TestSchemaMockDataGenerator:
os.chdir("tests/test_schema/mock_data_generation")
... | [
"jsonschema.validate",
"pkgutil.get_data",
"jsonschema.Draft7Validator.check_schema",
"glob.glob",
"pytest.mark.parametrize",
"os.chdir",
"herbie_core.services.schema_mock_data.schema_mock_data_generator.SchemaMockDataGenerator"
] | [((268, 318), 'os.chdir', 'os.chdir', (['"""tests/test_schema/mock_data_generation"""'], {}), "('tests/test_schema/mock_data_generation')\n", (276, 318), False, 'import os\n'), ((348, 367), 'glob.glob', 'glob.glob', (['"""*.json"""'], {}), "('*.json')\n", (357, 367), False, 'import glob\n'), ((374, 433), 'pytest.mark.p... |
# Generated by Django 2.0.9 on 2018-11-28 16:18
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='ParentInfo',
fields=[
('id', models.AutoFie... | [
"django.db.models.TextField",
"django.db.models.CharField",
"django.db.models.EmailField",
"django.db.models.AutoField",
"django.db.models.ImageField",
"django.db.models.DateField",
"django.db.models.DateTimeField"
] | [((306, 399), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (322, 399), False, 'from django.db import migrations, models\... |
from django.conf import settings
from django.utils.cache import patch_vary_headers
from django.utils import translation
class LocaleMiddleware(object):
"""
Locale selecting middleware that will look at the languagecode in the
DevilryUserProfile of the authenticated user.
Must be added to ``settings.M... | [
"django.utils.cache.patch_vary_headers",
"django.utils.translation.get_language",
"django.utils.translation.activate",
"django.utils.translation.deactivate"
] | [((867, 897), 'django.utils.translation.activate', 'translation.activate', (['language'], {}), '(language)\n', (887, 897), False, 'from django.utils import translation\n'), ((930, 956), 'django.utils.translation.get_language', 'translation.get_language', ([], {}), '()\n', (954, 956), False, 'from django.utils import tr... |
import io
import os
import abc
import mimetypes
from json import dumps as jsondumps
from typing import Any, Dict, Iterable, List, Optional, Union
from hyperad.constants import (
CONTENT_TYPE, CONTENT_DISPOSITION,
APPLICATION_JSON, MULTIPART_FORM_DATA, TEXT_PLAIN,
APPLICATION_X_WWW_FORM_URLENCODED, APPLICAT... | [
"os.path.split",
"json.dumps",
"mimetypes.guess_type"
] | [((4453, 4476), 'os.path.split', 'os.path.split', (['filename'], {}), '(filename)\n', (4466, 4476), False, 'import os\n'), ((4626, 4656), 'mimetypes.guess_type', 'mimetypes.guess_type', (['filename'], {}), '(filename)\n', (4646, 4656), False, 'import mimetypes\n'), ((5807, 5839), 'json.dumps', 'jsondumps', (['json'], {... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import pytest
import os
import subprocess
from worker.task_status import TaskStatus
from worker.copytool.copytool import Copytool
from exceptions.source_path_not_valid_exception import SourcePathNotValidException
base_dir = '/mount/'
@pytest.fixture
def build_test_environme... | [
"subprocess.check_output"
] | [((1805, 1884), 'subprocess.check_output', 'subprocess.check_output', (['cmd'], {'stderr': 'subprocess.STDOUT', 'universal_newlines': '(True)'}), '(cmd, stderr=subprocess.STDOUT, universal_newlines=True)\n', (1828, 1884), False, 'import subprocess\n'), ((1959, 2038), 'subprocess.check_output', 'subprocess.check_output'... |
from aeropy.geometry.parametric import CoordinateSystem
from aeropy.structural.beam import euler_bernoulle_curvilinear
from aeropy.structural.stable_solution import (mesh_1D, properties,
boundary_conditions,
euler_bernoulle)
f... | [
"aeropy.structural.beam.euler_bernoulle_curvilinear",
"matplotlib.pyplot.show",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.legend",
"aeropy.structural.stable_solution.properties",
"aeropy.geometry.parametric.CoordinateSystem.polynomial"
] | [((1058, 1136), 'matplotlib.pyplot.scatter', 'plt.scatter', (['abaqus_x', 'abaqus_y'], {'c': '"""g"""', 'label': '"""FEA"""', 'edgecolors': '"""k"""', 'zorder': '(10)'}), "(abaqus_x, abaqus_y, c='g', label='FEA', edgecolors='k', zorder=10)\n", (1069, 1136), True, 'import matplotlib.pyplot as plt\n'), ((1167, 1179), 'ae... |
# 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.
import json
import argparse
import numpy as np
import itertools
import torch.utils.data
import torch.nn.functional as F
from torch.optim.lr_sch... | [
"argparse.ArgumentParser",
"numpy.ones",
"json.dumps",
"numpy.arange",
"egg.zoo.channel.features.OneHotLoaderCompositionality",
"egg.core.reinforce_wrappers.RnnReceiverCompositionality",
"egg.core.reinforce_wrappers.CompositionalitySenderImpatientReceiverRnnReinforce",
"egg.core.util.dump_sender_recei... | [((1154, 1179), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1177, 1179), False, 'import argparse\n'), ((6035, 6060), 'egg.core.init', 'core.init', (['parser', 'params'], {}), '(parser, params)\n', (6044, 6060), True, 'import egg.core as core\n'), ((10483, 10576), 'egg.core.dump_sender_recei... |
#!/usr/bin/env python
"""
determine whether bitboard, piece-list coordinate or mailbox is best
bitboard (12, 8, 8): third order tensor
bitboard_vector (768): flattened third order tensor
small_bitboard_vector (384): with -1.0 values for black
piece_list (384): normalised rank, file, 8-rank and file for pieces in lis... | [
"chess.Board",
"numpy.zeros"
] | [((587, 603), 'chess.Board', 'chess.Board', (['fen'], {}), '(fen)\n', (598, 603), False, 'import chess\n'), ((619, 639), 'numpy.zeros', 'np.zeros', (['(12, 8, 8)'], {}), '((12, 8, 8))\n', (627, 639), True, 'import numpy as np\n'), ((1201, 1217), 'chess.Board', 'chess.Board', (['fen'], {}), '(fen)\n', (1212, 1217), Fals... |
'''
导入文法, 预计以后不再修改文法后,可以将结果保存, 以便以后分析程序更快
为新数据结构做出修改
因为不支持头文件引入, 所以没有加入include的判断, 如果要求可以判断# include开头就跳过这一行
11.13.2017
@acytoo
'''
import Lexer
from GrammarScanExtLib import Formula, Symbol
TERMINAL_SET = set()
NON_TERMINAL_SET = set()
SYMBOL_DICT = {}
FORMULA_LIST = []
Analysis_Table = {}
def symbol_for_str... | [
"GrammarScanExtLib.Symbol",
"GrammarScanExtLib.Formula"
] | [((1653, 1676), 'GrammarScanExtLib.Symbol', 'Symbol', (['s'], {'sym_type': '"""T"""'}), "(s, sym_type='T')\n", (1659, 1676), False, 'from GrammarScanExtLib import Formula, Symbol\n'), ((1752, 1775), 'GrammarScanExtLib.Symbol', 'Symbol', (['s'], {'sym_type': '"""N"""'}), "(s, sym_type='N')\n", (1758, 1775), False, 'from... |
# Generated by Django 2.0.2 on 2018-10-31 10:54
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('peeldb', '0044_jobpost_pincode'),
]
operations = [
migrations.AlterField(
model_name='jobpost',
name='company_emails... | [
"django.db.models.EmailField"
] | [((341, 397), 'django.db.models.EmailField', 'models.EmailField', ([], {'blank': '(True)', 'max_length': '(254)', 'null': '(True)'}), '(blank=True, max_length=254, null=True)\n', (358, 397), False, 'from django.db import migrations, models\n')] |
from PyQt5.QtWidgets import *
import pyqtgraph as pg
from scipy.interpolate import interpolate
from GUI.tabs.geometry_tabs_.unconventional_geometry.lifiting_surface_tabs.lifting_surface_tab import \
lifting_surface_tab
from Utils.data_objects.lifting_surface_placeholder import *
from Utils.data_objects.placeholder... | [
"scipy.interpolate.interpolate.interp1d",
"GUI.tabs.geometry_tabs_.unconventional_geometry.lifiting_surface_tabs.lifting_surface_tab.lifting_surface_tab",
"pyqtgraph.mkPen",
"pyqtgraph.PlotWidget"
] | [((507, 522), 'pyqtgraph.PlotWidget', 'pg.PlotWidget', ([], {}), '()\n', (520, 522), True, 'import pyqtgraph as pg\n'), ((822, 940), 'GUI.tabs.geometry_tabs_.unconventional_geometry.lifiting_surface_tabs.lifting_surface_tab.lifting_surface_tab', 'lifting_surface_tab', ([], {'name': 'name', 'surface_type_': 'surface_typ... |
import os
from setuptools import setup
# When pip installs anything from packages, py_modules, or ext_modules that
# includes a twistd plugin (which are installed to twisted/plugins/),
# setuptools/distribute writes a Package.egg-info/top_level.txt that includes
# "twisted". If you later uninstall Package with `pip u... | [
"twisted.plugin.getPlugins",
"os.path.walk"
] | [((1757, 1788), 'os.path.walk', 'os.path.walk', (['base', 'visit', 'None'], {}), '(base, visit, None)\n', (1769, 1788), False, 'import os\n'), ((2687, 2706), 'twisted.plugin.getPlugins', 'getPlugins', (['IPlugin'], {}), '(IPlugin)\n', (2697, 2706), False, 'from twisted.plugin import IPlugin, getPlugins\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This software is under a BSD license. See LICENSE.txt for details.
import numpy as np
def _times_considered_same(t1, t2):
"""docstring for _times_considered_same"""
return abs(t1 - t2) <= 0.000001 * (t1 + t2)
class DTSeries(object):
"""Base class for seri... | [
"numpy.array"
] | [((5816, 5846), 'numpy.array', 'np.array', (['[]'], {'dtype': 'np.float64'}), '([], dtype=np.float64)\n', (5824, 5846), True, 'import numpy as np\n')] |
# generic imports
import logging
from datetime import datetime
# crypto module headers and helpers imports
import mflod.crypto.exceptions as exc
import mflod.crypto.asn1_structures as asn1_dec
from mflod.crypto.constants import Constants as const
from mflod.crypto.log_strings import LogStrings as logstr
# ASN.1 tools... | [
"mflod.crypto.asn1_structures.MPHMACContainer",
"datetime.datetime.utcnow",
"mflod.crypto.asn1_structures.MPHeader",
"cryptography.hazmat.primitives.ciphers.algorithms.AES",
"mflod.crypto.asn1_structures.MPContent",
"cryptography.hazmat.primitives.hashes.SHA1",
"mflod.crypto.exceptions.NoMatchingRSAKeyF... | [((1695, 1722), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1712, 1722), False, 'import logging\n'), ((4122, 4152), 'mflod.crypto.asn1_structures.AlgorithmIdentifier', 'asn1_dec.AlgorithmIdentifier', ([], {}), '()\n', (4150, 4152), True, 'import mflod.crypto.asn1_structures as asn1_de... |
# pylint: disable=missing-function-docstring, missing-module-docstring/
from project.folder2.mod3 import one_hundred_plus_sum_to_n_squared
if __name__ == '__main__':
print(one_hundred_plus_sum_to_n_squared(4))
| [
"project.folder2.mod3.one_hundred_plus_sum_to_n_squared"
] | [((177, 213), 'project.folder2.mod3.one_hundred_plus_sum_to_n_squared', 'one_hundred_plus_sum_to_n_squared', (['(4)'], {}), '(4)\n', (210, 213), False, 'from project.folder2.mod3 import one_hundred_plus_sum_to_n_squared\n')] |
#!/usr/bin/env python2
##############
## Imports ##
##############
import os
import inspect
import sys
from array import array
from gimpfu import *
############
## IO ##
############
def get_file_size(file):
original_pos = file.tell()
file.seek(0, os.SEEK_END)
end_pos = file.tell()
file.seek(... | [
"os.path.splitext",
"collections.deque",
"array.array"
] | [((952, 979), 'os.path.splitext', 'os.path.splitext', (['file_name'], {}), '(file_name)\n', (968, 979), False, 'import os\n'), ((2735, 2778), 'array.array', 'array', (['"""B"""', 'pixel_region[0:width, 0:height]'], {}), "('B', pixel_region[0:width, 0:height])\n", (2740, 2778), False, 'from array import array\n'), ((885... |
#!/usr/bin/python
from macaroon.playback import *
import utils
sequence = MacroSequence()
sequence.append(utils.StartRecordingAction())
sequence.append(WaitForWindowActivate("HScrollBar control",None))
sequence.append(utils.AssertPresentationAction(
"hscrollbar frame active",
["BRAILLE LINE: 'HScrollBar con... | [
"utils.AssertPresentationAction",
"utils.AssertionSummaryAction",
"utils.StartRecordingAction"
] | [((109, 137), 'utils.StartRecordingAction', 'utils.StartRecordingAction', ([], {}), '()\n', (135, 137), False, 'import utils\n'), ((221, 438), 'utils.AssertPresentationAction', 'utils.AssertPresentationAction', (['"""hscrollbar frame active"""', '["BRAILLE LINE: \'HScrollBar control Frame\'",\n " VISIBLE: \'HS... |
from selenium import webdriver
import unittest
class NewVisitorTest(unittest.TestCase):
HOST_URL = 'http://localhost:8000'
def setUp(self) -> None:
self.browser = webdriver.Chrome(executable_path="./chromedriver")
self.browser.implicitly_wait(3)
def tearDown(self) -> None:
self.b... | [
"unittest.main",
"selenium.webdriver.Chrome"
] | [((1200, 1232), 'unittest.main', 'unittest.main', ([], {'warnings': '"""ignore"""'}), "(warnings='ignore')\n", (1213, 1232), False, 'import unittest\n'), ((182, 232), 'selenium.webdriver.Chrome', 'webdriver.Chrome', ([], {'executable_path': '"""./chromedriver"""'}), "(executable_path='./chromedriver')\n", (198, 232), F... |
import numpy as np
import signal_tl as stl
a = stl.Predicate("a") > 0
b = stl.Predicate("b") <= 0.5
phi = stl.Until(a, b)
t = np.linspace(0, 50, 201)
x = np.cos(t)
y = np.sin(t)
trace = {
"a": stl.Signal(x, t),
"b": stl.Signal(x, t),
}
rob = stl.compute_robustness(phi, trace)
print(rob.at(0))
| [
"signal_tl.Predicate",
"signal_tl.Signal",
"numpy.sin",
"signal_tl.Until",
"numpy.cos",
"numpy.linspace",
"signal_tl.compute_robustness"
] | [((109, 124), 'signal_tl.Until', 'stl.Until', (['a', 'b'], {}), '(a, b)\n', (118, 124), True, 'import signal_tl as stl\n'), ((130, 153), 'numpy.linspace', 'np.linspace', (['(0)', '(50)', '(201)'], {}), '(0, 50, 201)\n', (141, 153), True, 'import numpy as np\n'), ((158, 167), 'numpy.cos', 'np.cos', (['t'], {}), '(t)\n',... |
import re
import time
import subprocess
from botDB import *
from urllib import parse
from random import choice
from mdScreen import get_screenshot
from telegram import InputMediaPhoto
from botTools import mention_other_bot
from botSession import dra, nga, get_driver
from datetime import datetime, timezone, timedelta
... | [
"mdScreen.get_screenshot",
"subprocess.run",
"botSession.dra.delete_message",
"telegram.InputMediaPhoto",
"botSession.dra.send_chat_action",
"botSession.get_driver",
"botTools.mention_other_bot",
"random.choice",
"botSession.dra.edit_message_caption",
"time.sleep",
"botSession.nga.get",
"re.fi... | [((1762, 1805), 'botTools.mention_other_bot', 'mention_other_bot', (['text', 'url_for_screenshot'], {}), '(text, url_for_screenshot)\n', (1779, 1805), False, 'from botTools import mention_other_bot\n'), ((2051, 2063), 'botSession.nga.get', 'nga.get', (['url'], {}), '(url)\n', (2058, 2063), False, 'from botSession impor... |
"""
File: cartpole.py
Created: 2017-03-06
By <NAME>, <EMAIL>
Description:
-- Python 3.6 --
Solve the CartPole-v0 problem:
- observed features are expanded with a random transform to ensure linear separability.
- action selection is by dot product of an expanded observation with a weight vector.
- a queued history of ... | [
"numpy.random.uniform",
"gym.make",
"random.shuffle",
"numpy.linalg.norm",
"statistics.mean",
"numpy.random.normal",
"collections.deque"
] | [((862, 885), 'gym.make', 'gym.make', (['"""CartPole-v0"""'], {}), "('CartPole-v0')\n", (870, 885), False, 'import gym\n'), ((1855, 1908), 'numpy.random.normal', 'normal', ([], {'scale': '(1.0)', 'size': '(expandedLength, inputLength)'}), '(scale=1.0, size=(expandedLength, inputLength))\n', (1861, 1908), False, 'from n... |
from calcuration import AddMinusCal
addminuscal = AddMinusCal()
addminuscal = AddMinusCal(3, 2)
addminuscal.setdata(3,2)
addminuscal.add()
from calcuration import MultipleDivideCal
multipledividecal = MultipleDivideCal()
| [
"calcuration.AddMinusCal",
"calcuration.MultipleDivideCal"
] | [((51, 64), 'calcuration.AddMinusCal', 'AddMinusCal', ([], {}), '()\n', (62, 64), False, 'from calcuration import AddMinusCal\n'), ((79, 96), 'calcuration.AddMinusCal', 'AddMinusCal', (['(3)', '(2)'], {}), '(3, 2)\n', (90, 96), False, 'from calcuration import AddMinusCal\n'), ((204, 223), 'calcuration.MultipleDivideCal... |
import random
from RatInterface import Rat, MazeInfo
from MultiRatMaze import MultiRatMaze
from SimpleMaze import random_maze, render_graph
from Localizer import OneDimensionalLocalizer
# The only thing that paired rats know about is that they see another rat
# at the same location as themselves
class PairedRa... | [
"MultiRatMaze.MultiRatMaze",
"Localizer.OneDimensionalLocalizer"
] | [((2939, 3028), 'MultiRatMaze.MultiRatMaze', 'MultiRatMaze', (['[[3, 2], [2, 3], [5, 0, 1, 3, 4], [0, 2, 1, 6], [5, 2], [2, 4]]', '(False)'], {}), '([[3, 2], [2, 3], [5, 0, 1, 3, 4], [0, 2, 1, 6], [5, 2], [2, 4]\n ], False)\n', (2951, 3028), False, 'from MultiRatMaze import MultiRatMaze\n'), ((3559, 3653), 'MultiRat... |
#!/usr/bin/env python3
import sys
import os
import argparse
HERE = os.path.abspath(os.path.dirname(__file__))
ROOT = HERE
READIES = os.path.join(ROOT, "deps/readies")
sys.path.insert(0, READIES)
import paella
#----------------------------------------------------------------------------------------------
class Redis... | [
"paella.Setup.__init__",
"argparse.ArgumentParser",
"os.path.dirname",
"sys.path.insert",
"os.path.join"
] | [((134, 168), 'os.path.join', 'os.path.join', (['ROOT', '"""deps/readies"""'], {}), "(ROOT, 'deps/readies')\n", (146, 168), False, 'import os\n'), ((169, 196), 'sys.path.insert', 'sys.path.insert', (['(0)', 'READIES'], {}), '(0, READIES)\n', (184, 196), False, 'import sys\n'), ((907, 970), 'argparse.ArgumentParser', 'a... |
import numpy as np
from lumi_language_id import LanguageIdentifier, data_file
class MultiLayerPerceptron:
"""
A simple implementation of an MLP classifier. This implementation has no training code, but
can be used to run a 'frozen' classifier that was trained by scikit-learn.
"""
def __init__(sel... | [
"lumi_language_id.data_file",
"numpy.load",
"lumi_language_id.LanguageIdentifier",
"numpy.maximum",
"numpy.array",
"numpy.exp",
"numpy.savez"
] | [((2035, 2063), 'numpy.savez', 'np.savez', (['filename'], {}), '(filename, **arrays)\n', (2043, 2063), True, 'import numpy as np\n'), ((2217, 2234), 'numpy.load', 'np.load', (['filename'], {}), '(filename)\n', (2224, 2234), True, 'import numpy as np\n'), ((3785, 3822), 'lumi_language_id.LanguageIdentifier', 'LanguageId... |
from selenium import webdriver
import time
import datetime
import pyodbc
import pandas as pd
print("PROGRAM START TIME ", datetime.datetime.now())
# store hour for next hour to run if condition
h = 0
# same above
m = 0
# read data from database
def read(conn):
# open file present in dir name log.txt
f = open... | [
"pyodbc.connect",
"time.sleep",
"selenium.webdriver.ChromeOptions",
"selenium.webdriver.Chrome",
"pandas.read_sql_query",
"datetime.datetime.now"
] | [((2686, 2824), 'pyodbc.connect', 'pyodbc.connect', (['"""Driver=SQL Server Native Client 11.0;Server= name;Database=name;UID=userid;PWD=password;Trusted_Connection=yes"""'], {}), "(\n 'Driver=SQL Server Native Client 11.0;Server= name;Database=name;UID=userid;PWD=password;Trusted_Connection=yes'\n )\n", (2700, 2... |
#!/usr/bin/env python
"""Tests for `notificationapi_python_server_sdk` package."""
import pytest
from notificationapi_python_server_sdk import (
notificationapi,
)
client_id = "client_id"
client_secret = "client_secret"
userPreferences = [
{"notificationId": "notificationId", "channel": "EMAIL", "state": Tru... | [
"notificationapi_python_server_sdk.notificationapi.init",
"pytest.mark.parametrize"
] | [((464, 590), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""func,params"""', "[('set_user_preferences', {'userId': userId, 'userPreferences':\n userPreferences})]"], {}), "('func,params', [('set_user_preferences', {'userId':\n userId, 'userPreferences': userPreferences})])\n", (487, 590), False, 'im... |
"""
Finds smallest prime of a family of primes obtained by replacing a set of digits for numbers from 0 to 9
Author: <NAME>
"""
import math
from utils import prime_factors
"""
Returns smallest prime from the family of primes
"""
def prime_digit_replacements():
primes_check = prime_factors(10**6, False)
visite... | [
"utils.prime_factors"
] | [((282, 311), 'utils.prime_factors', 'prime_factors', (['(10 ** 6)', '(False)'], {}), '(10 ** 6, False)\n', (295, 311), False, 'from utils import prime_factors\n')] |
# -*- coding: utf-8 -*-
import logging
Logger = logging.getLogger('prkng')
BLACK, RED, GREEN, YELLOW, BLUE, CYAN, WHITE = list(range(7))
COLORS = {
'CRITICAL': RED,
'ERROR': RED,
'WARNING': YELLOW,
'INFO': GREEN,
'DEBUG': CYAN,
}
LOG_LEVELS = {
'debug': logging.DEBUG,
'info': logging.INF... | [
"logging.Formatter.format",
"logging.StreamHandler",
"logging.Formatter.__init__",
"logging.getLogger"
] | [((49, 75), 'logging.getLogger', 'logging.getLogger', (['"""prkng"""'], {}), "('prkng')\n", (66, 75), False, 'import logging\n'), ((1453, 1476), 'logging.StreamHandler', 'logging.StreamHandler', ([], {}), '()\n', (1474, 1476), False, 'import logging\n'), ((859, 896), 'logging.Formatter.__init__', 'logging.Formatter.__i... |
"""
Description: This test is to run onos Teston VTN scripts
List of test cases:
CASE1 - Northbound NBI test network/subnet/ports
CASE2 - Ovsdb test&Default configuration&Vm go online
<EMAIL>
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache Licens... | [
"functest.utils.functest_logger.Logger",
"argparse.ArgumentParser",
"os.popen",
"os.path.exists",
"os.system",
"time.sleep",
"time.time",
"yaml.safe_load",
"re.search",
"functest.utils.functest_utils.push_results_to_db",
"datetime.datetime.now",
"re.compile"
] | [((639, 664), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (662, 664), False, 'import argparse\n'), ((1405, 1428), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (1426, 1428), False, 'import datetime\n'), ((905, 922), 'yaml.safe_load', 'yaml.safe_load', (['f'], {}), '(f)\... |
import numpy as np
from metod_alg import metod_analysis as mt_ays
def evaluate_quantities_with_points(beta, x_tr, y_tr, d,
g, func_args):
"""
For trajectories x^(k_x) and y^(k_y), where k_x = (0,...,K_x) and k_y =
(0,...,K_y), evaluate quantites.
Parameters
--... | [
"numpy.round",
"numpy.zeros",
"numpy.sum",
"metod_alg.metod_analysis.check_quantities"
] | [((1627, 1643), 'numpy.zeros', 'np.zeros', (['(4, 2)'], {}), '((4, 2))\n', (1635, 1643), True, 'import numpy as np\n'), ((1659, 1670), 'numpy.zeros', 'np.zeros', (['(4)'], {}), '(4)\n', (1667, 1670), True, 'import numpy as np\n'), ((2169, 2218), 'metod_alg.metod_analysis.check_quantities', 'mt_ays.check_quantities', ([... |
import asyncio
import logging
from typing import Optional
import statistics
from collections import defaultdict
from ..messages.append_entries import AppendEntriesMessage, Command
from ..messages.base import Peer, Term
from ..messages.response import ResponseMessage
from ..servers.server import Server
from .config imp... | [
"collections.defaultdict",
"asyncio.sleep",
"asyncio.get_event_loop",
"logging.getLogger"
] | [((402, 427), 'logging.getLogger', 'logging.getLogger', (['"""raft"""'], {}), "('raft')\n", (419, 427), False, 'import logging\n'), ((670, 701), 'collections.defaultdict', 'defaultdict', (['default_next_index'], {}), '(default_next_index)\n', (681, 701), False, 'from collections import defaultdict\n'), ((729, 745), 'co... |
# pylint: skip-file
import numpy as np
from nasbench_asr.quiet_tensorflow import tensorflow as tf
def preprocess(
*,
ds,
encoder,
featurizer,
norm_stats=None,
epsilon=0.001,
num_parallel_calls=tf.data.experimental.AUTOTUNE,
deterministic=True,
max_feature_size=0
):
"""
Args... | [
"numpy.load",
"nasbench_asr.quiet_tensorflow.tensorflow.shape",
"nasbench_asr.quiet_tensorflow.tensorflow.saturate_cast",
"nasbench_asr.quiet_tensorflow.tensorflow.math.sqrt"
] | [((1223, 1242), 'numpy.load', 'np.load', (['norm_stats'], {}), '(norm_stats)\n', (1230, 1242), True, 'import numpy as np\n'), ((1467, 1484), 'nasbench_asr.quiet_tensorflow.tensorflow.shape', 'tf.shape', (['feature'], {}), '(feature)\n', (1475, 1484), True, 'from nasbench_asr.quiet_tensorflow import tensorflow as tf\n')... |
import nanome
from nanome.util import Logs
from nanome.util import Color
from nanome.api.ui import Dropdown, DropdownItem
from functools import partial
import pathlib
import os
BASE_PATH = os.path.dirname(os.path.realpath(__file__))
IMG_REFRESH_PATH = os.path.join(BASE_PATH, 'icons', 'refresh.png')
class K... | [
"functools.partial",
"os.path.realpath",
"os.path.dirname",
"nanome.api.ui.DropdownItem",
"nanome.util.Logs.debug",
"os.path.splitext",
"os.path.join",
"os.listdir"
] | [((262, 309), 'os.path.join', 'os.path.join', (['BASE_PATH', '"""icons"""', '"""refresh.png"""'], {}), "(BASE_PATH, 'icons', 'refresh.png')\n", (274, 309), False, 'import os\n'), ((214, 240), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (230, 240), False, 'import os\n'), ((1119, 1171), 'n... |
from Generic.time import get_cur_time
from Timer.timestamp import Timestamp
def equal(test, answer):
print(test, answer)
return abs(test - answer) < 100
H_test = Timestamp(2, 'H')
H_answer = get_cur_time() + 2 * 1000 * 60 * 60
assert equal(H_test.get_time(), H_answer)
M_test = Timestamp(3, 'M')
M_answer =... | [
"Timer.timestamp.Timestamp",
"Generic.time.get_cur_time"
] | [((174, 191), 'Timer.timestamp.Timestamp', 'Timestamp', (['(2)', '"""H"""'], {}), "(2, 'H')\n", (183, 191), False, 'from Timer.timestamp import Timestamp\n'), ((292, 309), 'Timer.timestamp.Timestamp', 'Timestamp', (['(3)', '"""M"""'], {}), "(3, 'M')\n", (301, 309), False, 'from Timer.timestamp import Timestamp\n'), ((4... |
#!/usr/bin/python
import networkx as nx
from networkx.algorithms import clique, bipartite
def planar(input_struct):
G = nx.Graph()
G.add_nodes_from(input_struct.get("nodes"))
G.add_weighted_edges_from(input_struct.get("edges"))
G_first_set = nx.Graph()
G.add_nodes_from(input_struct.get("first_se... | [
"networkx.check_planarity",
"networkx.Graph",
"networkx.algorithms.bipartite.is_bipartite",
"networkx.find_cliques"
] | [((127, 137), 'networkx.Graph', 'nx.Graph', ([], {}), '()\n', (135, 137), True, 'import networkx as nx\n'), ((262, 272), 'networkx.Graph', 'nx.Graph', ([], {}), '()\n', (270, 272), True, 'import networkx as nx\n'), ((489, 510), 'networkx.check_planarity', 'nx.check_planarity', (['G'], {}), '(G)\n', (507, 510), True, 'i... |
"""
Django settings for salonproject project.
Generated by 'django-admin startproject' using Django 3.2.5.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
import os
... | [
"os.path.abspath",
"os.path.dirname",
"os.environ.get",
"os.path.join",
"dj_database_url.config"
] | [((2719, 2759), 'dj_database_url.config', 'dj_database_url.config', ([], {'conn_max_age': '(600)'}), '(conn_max_age=600)\n', (2741, 2759), False, 'import dj_database_url\n'), ((4327, 4358), 'os.path.join', 'os.path.join', (['BASE_DIR', '"""media"""'], {}), "(BASE_DIR, 'media')\n", (4339, 4358), False, 'import os\n'), (... |
#!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
import MITgcmutils as mit
plt.ion()
dir0 = '/tank/groups/climode/bderembl/MITgcm/myrun/test_pg/run/'
dir1 = dir0 + 'mnc_test_0001/'
dir2 = dir0 + 'mnc_test*/'
file1 = 'state.0000000000.t*'
f1 = mit.mnc_files(dir2 + file1)
T = f1.variable... | [
"matplotlib.pyplot.ion",
"MITgcmutils.mnc_files"
] | [((101, 110), 'matplotlib.pyplot.ion', 'plt.ion', ([], {}), '()\n', (108, 110), True, 'import matplotlib.pyplot as plt\n'), ((274, 301), 'MITgcmutils.mnc_files', 'mit.mnc_files', (['(dir2 + file1)'], {}), '(dir2 + file1)\n', (287, 301), True, 'import MITgcmutils as mit\n')] |
from invoke import task, run
from os.path import dirname, abspath
# Create scripted tasks to run in command-line here
# http://docs.pyinvoke.org/en/latest/
PROJECT_ROOT = '%s/{{ project_name }}' % dirname(abspath(__file__))
@task
def clean():
"""Clean up static, compiled, test, and log files"""
print("De... | [
"os.path.abspath",
"invoke.run"
] | [((348, 381), 'invoke.run', 'run', (['"""find . -name *.pyc -delete"""'], {}), "('find . -name *.pyc -delete')\n", (351, 381), False, 'from invoke import task, run\n'), ((435, 473), 'invoke.run', 'run', (["('rm -rf %s/public' % PROJECT_ROOT)"], {}), "('rm -rf %s/public' % PROJECT_ROOT)\n", (438, 473), False, 'from invo... |
import turtle
t = turtle.Turtle()
s = turtle.Screen()
s.bgcolor("black")
t.pencolor("green")
t.speed(300)
a = 0
b = 0
while True:
t.forward(a)
t.right(b)
a+=3
b+=1
if b==205:
break
t.hideturtle()
turtle.done() | [
"turtle.Screen",
"turtle.done",
"turtle.Turtle"
] | [((21, 36), 'turtle.Turtle', 'turtle.Turtle', ([], {}), '()\n', (34, 36), False, 'import turtle\n'), ((42, 57), 'turtle.Screen', 'turtle.Screen', ([], {}), '()\n', (55, 57), False, 'import turtle\n'), ((250, 263), 'turtle.done', 'turtle.done', ([], {}), '()\n', (261, 263), False, 'import turtle\n')] |
#! python3
# -*- encoding: utf-8 -*-
'''
@Time : 2021/07/13
@Author : jincheng.lyu
1. Get all categories
2. Generate label for each image
3. All images by using multithreading
'''
import cv2
import datetime
import glob
import imagesize
import json
import mmcv
import numpy as np
import os
import os.path as osp... | [
"json.dump",
"tqdm.tqdm",
"imagesize.get",
"argparse.ArgumentParser",
"os.path.basename",
"cv2.imread",
"datetime.datetime.utcnow",
"numpy.where",
"glob.glob",
"os.path.join",
"os.listdir",
"mmdet.core.get_classes"
] | [((917, 939), 'imagesize.get', 'imagesize.get', (['imgpath'], {}), '(imgpath)\n', (930, 939), False, 'import imagesize\n'), ((1055, 1075), 'os.listdir', 'os.listdir', (['dataroot'], {}), '(dataroot)\n', (1065, 1075), False, 'import os\n'), ((1863, 1893), 'glob.glob', 'glob.glob', (["(dataroot + '/*.png')"], {}), "(data... |
# Generated by Django 2.0 on 2018-01-26 16:12
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('candidats', '0003_add_interview_model'),
]
operations = [
migrations.RemoveField(
model_name='candidate',
name='certif... | [
"django.db.migrations.RemoveField",
"django.db.models.CharField",
"django.db.models.BooleanField",
"django.db.models.PositiveSmallIntegerField",
"django.db.models.DateTimeField"
] | [((236, 305), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""candidate"""', 'name': '"""certif_of_800h"""'}), "(model_name='candidate', name='certif_of_800h')\n", (258, 305), False, 'from django.db import migrations, models\n'), ((350, 418), 'django.db.migrations.RemoveField', 'mi... |
from os import remove
from unittest import TestCase
from PIL import Image
import numpy as np
from requests import get, post
from screamshot import bytes_to_file
def _rmsd(img1, img2):
img1 = (img1 - np.mean(img1)) / (np.std(img1))
img2 = (img2 - np.mean(img2)) / (np.std(img2))
return np.sqrt(np.mean((... | [
"os.remove",
"numpy.std",
"PIL.Image.open",
"numpy.mean",
"screamshot.bytes_to_file",
"requests.get",
"requests.post"
] | [((227, 239), 'numpy.std', 'np.std', (['img1'], {}), '(img1)\n', (233, 239), True, 'import numpy as np\n'), ((278, 290), 'numpy.std', 'np.std', (['img2'], {}), '(img2)\n', (284, 290), True, 'import numpy as np\n'), ((311, 338), 'numpy.mean', 'np.mean', (['((img1 - img2) ** 2)'], {}), '((img1 - img2) ** 2)\n', (318, 338... |
from tkinter import *
import tkinter.font as font
import os
from gui.resizer import ImageResizer
from algorithm.ai_sailog import Sailog
from dawg_fsm_dictionary.dawg_fsm import DawgFsm
from game_logic.board_rules import BoardRules
from dawg_fsm_dictionary.txt_dictionarys.load_modify_txt import LoadModifyTxt
from game_l... | [
"dawg_fsm_dictionary.txt_dictionarys.load_modify_txt.LoadModifyTxt",
"algorithm.ai_sailog.Sailog",
"random.randint",
"game_logic.tile_bag.TileBag",
"tkinter.font.Font",
"dawg_fsm_dictionary.dawg_fsm.DawgFsm",
"gui.resizer.ImageResizer",
"game_logic.board_rules.BoardRules"
] | [((851, 887), 'tkinter.font.Font', 'font.Font', ([], {'family': '"""Verdana"""', 'size': '(12)'}), "(family='Verdana', size=12)\n", (860, 887), True, 'import tkinter.font as font\n'), ((1194, 1231), 'gui.resizer.ImageResizer', 'ImageResizer', (['self.width', 'self.height'], {}), '(self.width, self.height)\n', (1206, 12... |
import pandas as pd
tsv_file='../data/GSM3405534_PDAC-B-ST1.tsv'
csv_table=pd.read_csv(tsv_file,sep='\t')
csv_table.to_csv('GSM3405534_PDAC-B-ST1.csv',index=False)
| [
"pandas.read_csv"
] | [((77, 108), 'pandas.read_csv', 'pd.read_csv', (['tsv_file'], {'sep': '"""\t"""'}), "(tsv_file, sep='\\t')\n", (88, 108), True, 'import pandas as pd\n')] |
# Generated by Django 2.0.1 on 2018-02-04 20:57
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('test_app', '0028_add_float_with_default'),
]
operations = [
migrations.AlterUniqueTogether(
name='secondobject',
unique_toge... | [
"django.db.migrations.AlterUniqueTogether"
] | [((232, 331), 'django.db.migrations.AlterUniqueTogether', 'migrations.AlterUniqueTogether', ([], {'name': '"""secondobject"""', 'unique_together': "{('big_int', 'floating')}"}), "(name='secondobject', unique_together={(\n 'big_int', 'floating')})\n", (262, 331), False, 'from django.db import migrations\n')] |
import threading
import anki_vector
from anki_vector import events
import numpy as np
import argparse
import cv2
import torch
import anki_vector
from anki_vector.events import Events
from anki_vector.util import degrees
import threading
from models.with_mobilenet import PoseEstimationWithMobileNet
from modules.keypo... | [
"numpy.ones",
"utils.detect_touch",
"cv2.rectangle",
"cv2.imshow",
"utils.detect_hand",
"torch.load",
"modules.pose.Pose",
"threading.Event",
"models.with_mobilenet.PoseEstimationWithMobileNet",
"cv2.circle",
"cv2.waitKey",
"utils.detect_face",
"cv2.addWeighted",
"modules.keypoints.group_k... | [((838, 900), 'demo.infer_fast', 'infer_fast', (['net', 'img', 'height_size', 'stride', 'upsample_ratio', 'cpu'], {}), '(net, img, height_size, stride, upsample_ratio, cpu)\n', (848, 900), False, 'from demo import infer_fast\n'), ((1260, 1315), 'modules.keypoints.group_keypoints', 'group_keypoints', (['all_keypoints_by... |
import re
class FormatStrings:
def __init__(self):
pass
@staticmethod
def merge_phones_like_home_page(contact):
return "\n".join(filter(lambda x: x != "",
map(lambda x: FormatStrings.clear(x),
filter(lambda x: x is not N... | [
"re.sub"
] | [((1755, 1778), 're.sub', 're.sub', (['"""[- )(]"""', '""""""', 's'], {}), "('[- )(]', '', s)\n", (1761, 1778), False, 'import re\n'), ((2171, 2194), 're.sub', 're.sub', (["'\\r\\n'", '"""\n"""', 's'], {}), "('\\r\\n', '\\n', s)\n", (2177, 2194), False, 'import re\n'), ((1965, 1985), 're.sub', 're.sub', (['""" +"""', '... |
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import pytest
from mipqctool.model.qcfrictionless.qctodc import QctoDCVariable
NUMERICAL_DESC = {
'name': 'testvar',
'format': 'default',
'type': 'number',
... | [
"pytest.mark.parametrize",
"mipqctool.model.qcfrictionless.qctodc.QctoDCVariable"
] | [((1192, 1299), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""qcdesc, result"""', '[(NUMERICAL_DESC, NUMERICAL_DC), (NOMINAL_DESC, NOMINAL_DC)]'], {}), "('qcdesc, result', [(NUMERICAL_DESC, NUMERICAL_DC),\n (NOMINAL_DESC, NOMINAL_DC)])\n", (1215, 1299), False, 'import pytest\n'), ((1348, 1391), 'mipqct... |
# Qt5窗口界面
# author:fanzhe date:8.22
import sys
import os
from PyQt5 import QtWidgets
from PyQt5.QtCore import QThread, pyqtSignal
from windows import Ui_Form
from Local_tools import get_link
from Locate import get_locate
class main_windows(QtWidgets.QWidget, Ui_Form):
def __init__(self):
super(main_window... | [
"PyQt5.QtCore.pyqtSignal",
"PyQt5.QtWidgets.QApplication",
"Local_tools.get_link",
"Locate.get_locate"
] | [((2123, 2139), 'PyQt5.QtCore.pyqtSignal', 'pyqtSignal', (['list'], {}), '(list)\n', (2133, 2139), False, 'from PyQt5.QtCore import QThread, pyqtSignal\n'), ((2482, 2498), 'PyQt5.QtCore.pyqtSignal', 'pyqtSignal', (['list'], {}), '(list)\n', (2492, 2498), False, 'from PyQt5.QtCore import QThread, pyqtSignal\n'), ((2804,... |
import ionoscloud
from coreadaptor.IonosCoreProxy import IonosCoreProxy
class snapshot:
@IonosCoreProxy.process_response
def get_snapshot(self, snapshot_id):
"""
Retrieves a single snapshot by ID.
:param snapshot_id: The unique ID of the snapshot.
:type snapshot_id... | [
"ionoscloud.models.SnapshotProperties"
] | [((1612, 1658), 'ionoscloud.models.SnapshotProperties', 'ionoscloud.models.SnapshotProperties', ([], {}), '(**kwargs)\n', (1648, 1658), False, 'import ionoscloud\n')] |
#!/usr/bin/python3
import sys
import re
import copy
def intersects(a, b):
for coord in (0, 1, 2):
if a['min'][coord] > b['max'][coord]:
return False
if b['min'][coord] > a['max'][coord]:
return False
return True
def splitcube(s, r):
splits = [s]
for coord in (0... | [
"copy.deepcopy",
"re.search"
] | [((1672, 1770), 're.search', 're.search', (['"""^(\\\\w+) x=(-?\\\\d+)..(-?\\\\d+),y=(-?\\\\d+)..(-?\\\\d+),z=(-?\\\\d+)..(-?\\\\d+)"""', 'line'], {}), "(\n '^(\\\\w+) x=(-?\\\\d+)..(-?\\\\d+),y=(-?\\\\d+)..(-?\\\\d+),z=(-?\\\\d+)..(-?\\\\d+)',\n line)\n", (1681, 1770), False, 'import re\n'), ((507, 523), 'copy.d... |
import math
import numbers
import numpy as np
from skimage.filters import gaussian
from skimage import img_as_float
from scipy import ndimage
from skimage import exposure
import torch
from torch import nn
from torch.nn import functional as F
import kornia
from loguru import logger
def simple_invert(data):
"""I... | [
"numpy.nan_to_num",
"skimage.exposure.adjust_gamma",
"numpy.min",
"scipy.ndimage.label",
"numpy.max"
] | [((553, 572), 'scipy.ndimage.label', 'ndimage.label', (['data'], {}), '(data)\n', (566, 572), False, 'from scipy import ndimage\n'), ((665, 683), 'numpy.nan_to_num', 'np.nan_to_num', (['img'], {}), '(img)\n', (678, 683), True, 'import numpy as np\n'), ((615, 626), 'numpy.min', 'np.min', (['img'], {}), '(img)\n', (621, ... |
"""Actions."""
from construct import (Array, Byte, Const, CString, Flag, Float32l, If,
Int16ul, Int32sl, Int32ul, Padding, Peek, String,
Struct, this, Bytes, Embedded, IfThenElse)
from mgz.body.achievements import achievements
from mgz.enums import (DiplomacyStanceEnum, F... | [
"construct.String",
"mgz.enums.ResourceLevelEnum",
"mgz.util.TimeSecAdapter",
"construct.Peek",
"construct.Const",
"mgz.enums.ResourceEnum",
"construct.Struct",
"mgz.enums.FormationEnum",
"construct.Bytes",
"mgz.enums.VictoryEnum",
"mgz.enums.RevealMapEnum",
"mgz.enums.OrderTypeEnum",
"const... | [((1104, 1195), 'construct.Struct', 'Struct', (["('player_id' / Byte)", "('target_id' / Byte)", "('attribute' / Byte)", "('amount' / Float32l)"], {}), "('player_id' / Byte, 'target_id' / Byte, 'attribute' / Byte, 'amount' /\n Float32l)\n", (1110, 1195), False, 'from construct import Array, Byte, Const, CString, Flag... |
#!/usr/bin/env python
# Copyright (c) 2021, <NAME>
# See LICENSE file for details: <https://github.com/moble/spherical/blob/master/LICENSE>
import math
import cmath
import numpy as np
import quaternionic
import spherical as sf
import pytest
from .conftest import requires_sympy
slow = pytest.mark.slow
precision_Wig... | [
"numpy.abs",
"numpy.sum",
"numpy.allclose",
"spherical.WignerDsize",
"numpy.sin",
"numpy.identity",
"math.cos",
"numpy.linspace",
"spherical.WignerDrange",
"time.perf_counter",
"math.sin",
"numpy.cos",
"cmath.exp",
"numpy.all",
"spherical.WignerDindex",
"spherical.Wigner",
"quaternio... | [((706, 724), 'spherical.Wigner', 'sf.Wigner', (['ell_max'], {}), '(ell_max)\n', (715, 724), True, 'import spherical as sf\n'), ((1295, 1314), 'time.perf_counter', 'time.perf_counter', ([], {}), '()\n', (1312, 1314), False, 'import time\n'), ((1527, 1550), 'spherical.Wigner', 'sf.Wigner', (['ell_max_slow'], {}), '(ell_... |
from nose import tools
from time import sleep
from ..models import Team
def test_cached_property():
team1 = Team.objects.create(name="Team1")
team2 = Team.objects.create(name="Team2")
# Make sure the counter is incrementing
tools.assert_equal(team1.get_counter(), 1)
tools.assert_equal(team1.get_c... | [
"nose.tools.assert_equal",
"time.sleep"
] | [((403, 446), 'nose.tools.assert_equal', 'tools.assert_equal', (['team1.cached_counter', '(4)'], {}), '(team1.cached_counter, 4)\n', (421, 446), False, 'from nose import tools\n'), ((451, 494), 'nose.tools.assert_equal', 'tools.assert_equal', (['team1.cached_counter', '(4)'], {}), '(team1.cached_counter, 4)\n', (469, 4... |
from django.db import models
class Template(models.Model):
name = models.CharField(max_length=255)
json = models.TextField(blank=True, null=True)
javascript = models.TextField(blank=True, null=True) | [
"django.db.models.CharField",
"django.db.models.TextField"
] | [((71, 103), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(255)'}), '(max_length=255)\n', (87, 103), False, 'from django.db import models\n'), ((115, 154), 'django.db.models.TextField', 'models.TextField', ([], {'blank': '(True)', 'null': '(True)'}), '(blank=True, null=True)\n', (131, 154), Fa... |
import os
import glob
import psycopg2
import pandas as pd
from sql_queries import *
def process_song_file(cur, filepath):
"""Process song files and index them in the artists and songs tables.
Args:
cur (Cursor.object): Cursor to the database.
filepath (str): Path to .json file.
... | [
"pandas.DataFrame",
"os.path.abspath",
"os.walk",
"pandas.read_json",
"pandas.to_datetime",
"os.path.join",
"psycopg2.connect"
] | [((664, 698), 'pandas.read_json', 'pd.read_json', (['filepath'], {'lines': '(True)'}), '(filepath, lines=True)\n', (676, 698), True, 'import pandas as pd\n'), ((1666, 1700), 'pandas.read_json', 'pd.read_json', (['filepath'], {'lines': '(True)'}), '(filepath, lines=True)\n', (1678, 1700), True, 'import pandas as pd\n'),... |
import torch
from .base import BASE
class NN(BASE):
'''
Nearest neighbour classifier
'''
def __init__(self, ebd_dim, args):
super(NN, self).__init__(args)
self.ebd_dim = ebd_dim
def forward(self, XS, YS, XQ, YQ):
'''
@param XS (support x): support_size x e... | [
"torch.argmin"
] | [((868, 893), 'torch.argmin', 'torch.argmin', (['dist'], {'dim': '(1)'}), '(dist, dim=1)\n', (880, 893), False, 'import torch\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Created by <NAME> | 27/09/2018 | https://y-research.github.io
"""Description
"""
import numpy as np
import torch
from org.archive.l2r_global import L2R_GLOBAL
from org.archive.ranking.run.l2r import point_run, grid_run
""" GPU acceleration if expected """
L2R_GLOBAL.... | [
"torch.manual_seed",
"org.archive.ranking.run.l2r.point_run",
"numpy.random.seed",
"org.archive.ranking.run.l2r.grid_run"
] | [((406, 446), 'numpy.random.seed', 'np.random.seed', ([], {'seed': 'L2R_GLOBAL.l2r_seed'}), '(seed=L2R_GLOBAL.l2r_seed)\n', (420, 446), True, 'import numpy as np\n'), ((447, 490), 'torch.manual_seed', 'torch.manual_seed', ([], {'seed': 'L2R_GLOBAL.l2r_seed'}), '(seed=L2R_GLOBAL.l2r_seed)\n', (464, 490), False, 'import ... |
from glob import glob
from os.path import basename, splitext
from setuptools import setup, find_packages
setup(
name="othello",
version="1.0",
license="Apache License 2.0",
description="You can play othello",
author="upnt",
url="https://github.com/upnt/othello-python",
packages=find_packag... | [
"os.path.basename",
"setuptools.find_packages",
"glob.glob"
] | [((309, 329), 'setuptools.find_packages', 'find_packages', (['"""src"""'], {}), "('src')\n", (322, 329), False, 'from setuptools import setup, find_packages\n'), ((416, 432), 'glob.glob', 'glob', (['"""src/*.py"""'], {}), "('src/*.py')\n", (420, 432), False, 'from glob import glob\n'), ((385, 399), 'os.path.basename', ... |
"""
This module implements several Raman response functions. Numerical models of
the Raman response are important for the accurate theoretical description of
the propagation of optical pulses with short duration and high peak power
[MM1986]_ [G1986]_.
The following Raman response models are currently supported:
.. a... | [
"numpy.sum",
"numpy.asarray",
"numpy.zeros",
"numpy.min",
"numpy.where",
"numpy.sin",
"numpy.exp"
] | [((2694, 2704), 'numpy.sum', 'np.sum', (['hR'], {}), '(hR)\n', (2700, 2704), True, 'import numpy as np\n'), ((3698, 3743), 'numpy.where', 'np.where', (['(t > 0)', '((1.0 - fb) * ha + fb * hb)', '(0)'], {}), '(t > 0, (1.0 - fb) * ha + fb * hb, 0)\n', (3706, 3743), True, 'import numpy as np\n'), ((3754, 3764), 'numpy.sum... |
# -*- coding: utf-8 -*-
from os import path
from setuptools import find_packages, setup
# read the contents of the README file
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, "README.md"), encoding="utf-8") as f:
long_description = f.read()
setup(
name="django-urlcon... | [
"os.path.dirname",
"os.path.join",
"setuptools.find_packages"
] | [((159, 181), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file__)\n', (171, 181), False, 'from os import path\n'), ((193, 231), 'os.path.join', 'path.join', (['this_directory', '"""README.md"""'], {}), "(this_directory, 'README.md')\n", (202, 231), False, 'from os import path\n'), ((597, 683), 'setuptool... |
import hashlib
class SHAHash:
__hash = None
def __init__(self, msg:str):
self.__hash = hashlib.sha512()
self.__hash.update(msg.encode("UTF-8"))
def getHash(self):
return self.__hash.hexdigest()
def getDigestSize(self):
return self.__hash.digest_size
def getB... | [
"hashlib.sha512"
] | [((110, 126), 'hashlib.sha512', 'hashlib.sha512', ([], {}), '()\n', (124, 126), False, 'import hashlib\n')] |
import numpy as np
import tensorflow as tf
from tensorflow import keras
import os
import dataprocess
import fluidmodels
import losses
#python version of jupyter notebook file, just for testing the packages.
# ### Manufacturing data for trainig
# In[2]:
np.random.seed(123)
pde_data_size = 2000
bc_data_size = 400
... | [
"fluidmodels.ForwardModel",
"numpy.random.seed",
"tensorflow.sin",
"dataprocess.DataPreprocess",
"dataprocess.imp_from_csv"
] | [((260, 279), 'numpy.random.seed', 'np.random.seed', (['(123)'], {}), '(123)\n', (274, 279), True, 'import numpy as np\n'), ((4353, 4426), 'dataprocess.imp_from_csv', 'dataprocess.imp_from_csv', (['"""data_manufactured/t_sin_x_plus_y.csv"""', '(True)', '(1)'], {}), "('data_manufactured/t_sin_x_plus_y.csv', True, 1)\n",... |
from pyflink.datastream import StreamExecutionEnvironment, TimeCharacteristic
from pyflink.table import StreamTableEnvironment, DataTypes, EnvironmentSettings
from pyflink.table.descriptors import Schema, Kafka, Json, Rowtime, Elasticsearch
def area_cnts():
s_env = StreamExecutionEnvironment.get_execution_enviro... | [
"pyflink.table.EnvironmentSettings.new_instance",
"pyflink.table.DataTypes.INT",
"pyflink.table.DataTypes.FLOAT",
"pyflink.table.DataTypes.BOOLEAN",
"pyflink.table.DataTypes.TIMESTAMP",
"pyflink.table.descriptors.Kafka",
"pyflink.table.DataTypes.BIGINT",
"pyflink.table.descriptors.Schema",
"pyflink.... | [((273, 327), 'pyflink.datastream.StreamExecutionEnvironment.get_execution_environment', 'StreamExecutionEnvironment.get_execution_environment', ([], {}), '()\n', (325, 327), False, 'from pyflink.datastream import StreamExecutionEnvironment, TimeCharacteristic\n'), ((2972, 2978), 'pyflink.table.descriptors.Json', 'Json... |
# ----------------------------------------------------------------------------
# cocos2d
# Copyright (c) 2008-2012 <NAME>, <NAME>, <NAME>,
# <NAME>
# Copyright (c) 2009-2019 <NAME>, <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provid... | [
"cocos.sprite.Sprite",
"cocos.layer.ColorLayer",
"cocos.director.director.replace",
"cocos.scene.Scene",
"cocos.director.director.get_window_size",
"pyglet.image.BufferManager"
] | [((4255, 4268), 'cocos.scene.Scene', 'scene.Scene', ([], {}), '()\n', (4266, 4268), True, 'import cocos.scene as scene\n'), ((4415, 4428), 'cocos.scene.Scene', 'scene.Scene', ([], {}), '()\n', (4426, 4428), True, 'import cocos.scene as scene\n'), ((5488, 5509), 'cocos.director.director.replace', 'director.replace', (['... |
import pandas as pd
from itertools import combinations
import numpy as np
import datetime
import os
dataFrame = ""
columnsWithSameValue = []
fullEmptyColumns = []
def startAnalyze(csv_path):
global dataFrame, fullEmptyColumns
# print("Importing CSV File\n")
csv = pd.read_csv(csv_path, low_memory=False)
csv_no_he... | [
"pandas.DataFrame",
"os.mkdir",
"pandas.read_csv",
"os.path.exists",
"numpy.zeros",
"itertools.combinations",
"datetime.datetime.now"
] | [((270, 309), 'pandas.read_csv', 'pd.read_csv', (['csv_path'], {'low_memory': '(False)'}), '(csv_path, low_memory=False)\n', (281, 309), True, 'import pandas as pd\n'), ((325, 377), 'pandas.read_csv', 'pd.read_csv', (['csv_path'], {'header': 'None', 'low_memory': '(False)'}), '(csv_path, header=None, low_memory=False)\... |
import pickle
import os
import time
from fragresp.utils import logger
from rdkit import Chem
from rdkit.Chem import rdMolDescriptors
from rdkit.Chem import rdmolops
from rdkit.Chem import AllChem
from rdkit.Chem import Draw
from rdkit.Chem.Draw.MolDrawing import MolDrawing, DrawingOptions
DrawingOptions.bondLineWidt... | [
"os.mkdir",
"fragresp.utils.logger",
"rdkit.Chem.rdMolDescriptors.CalcNumHBD",
"rdkit.Chem.rdMolDescriptors.CalcNumHBA",
"rdkit.Chem.rdMolDescriptors.CalcNumRotatableBonds",
"rdkit.Chem.rdMolDescriptors.CalcNumRings",
"rdkit.Chem.Kekulize",
"rdkit.Chem.Draw.MolToFile",
"os.path.exists",
"time.time... | [((451, 474), 'os.path.exists', 'os.path.exists', (['dumpdir'], {}), '(dumpdir)\n', (465, 474), False, 'import os\n'), ((842, 871), 'fragresp.utils.logger', 'logger', (["(dumpdir + '/frag.dat')"], {}), "(dumpdir + '/frag.dat')\n", (848, 871), False, 'from fragresp.utils import logger\n'), ((3883, 3911), 'fragresp.utils... |
import theano.tensor as T
def binary_cross_entropy(output, target):
return T.nnet.binary_crossentropy(output=output, target=target)
def negative_log_likelihood(y_proba, y_true=None):
"""
:param y_proba: 1D: batch_size, 2D: n_words, 3D: n_words; elem=word id
:param y_true: 1D: batch_size, 2D: n_words... | [
"theano.tensor.arange",
"theano.tensor.nnet.binary_crossentropy"
] | [((81, 137), 'theano.tensor.nnet.binary_crossentropy', 'T.nnet.binary_crossentropy', ([], {'output': 'output', 'target': 'target'}), '(output=output, target=target)\n', (107, 137), True, 'import theano.tensor as T\n'), ((527, 560), 'theano.tensor.arange', 'T.arange', (['y_true_flatten.shape[0]'], {}), '(y_true_flatten.... |
from django.db import models
from django.conf import settings
class Todos(models.Model):
name = models.CharField(max_length=100)
complete = models.BooleanField(default=False)
def __str__(self) -> str:
return self.name
class ForTestOnly(models.Model):
name = models.CharField(max_length=20)
... | [
"django.db.models.CharField",
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.BooleanField"
] | [((102, 134), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)'}), '(max_length=100)\n', (118, 134), False, 'from django.db import models\n'), ((150, 184), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'default': '(False)'}), '(default=False)\n', (169, 184), False, 'from djan... |
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
"pytest.raises",
"data_validation.state_manager.StateManager"
] | [((839, 881), 'data_validation.state_manager.StateManager', 'state_manager.StateManager', (['GCS_STATE_PATH'], {}), '(GCS_STATE_PATH)\n', (865, 881), False, 'from data_validation import state_manager\n'), ((1087, 1129), 'data_validation.state_manager.StateManager', 'state_manager.StateManager', (['GCS_STATE_PATH'], {})... |
import socket
from threading import Timer
from sciibo.core.helpers import valid_string
from .thread import SocketThread
class SearchThread(SocketThread):
def before_actions(self):
self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
self.sock.setsockopt(socket.SOL_SOC... | [
"sciibo.core.helpers.valid_string",
"threading.Timer",
"socket.socket"
] | [((208, 276), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_DGRAM', 'socket.IPPROTO_UDP'], {}), '(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)\n', (221, 276), False, 'import socket\n'), ((373, 394), 'threading.Timer', 'Timer', (['(3.0)', 'self.stop'], {}), '(3.0, self.stop)\n', (378, 394)... |
#!/usr/bin/env python3
from threading import Thread
import numpy as np
import cv2
from evdev import ecodes, InputDevice, list_devices
from annotated import annotated
from smbus2 import SMBus
from picamera.array import PiRGBAnalysis
from controller import Controller, Stick
from motor_group import MotorGroup
from driv... | [
"controller.Stick",
"evdev.list_devices",
"controller.Controller",
"smbus2.SMBus",
"drive_from_vector.drive_from_vector",
"motor_group.MotorGroup"
] | [((630, 663), 'controller.Stick', 'Stick', (['ecodes.ABS_X', 'ecodes.ABS_Y'], {}), '(ecodes.ABS_X, ecodes.ABS_Y)\n', (635, 663), False, 'from controller import Controller, Stick\n'), ((1120, 1154), 'controller.Controller', 'Controller', (['dev', '[self.left_stick]'], {}), '(dev, [self.left_stick])\n', (1130, 1154), Fal... |
#!/usr/bin/env python
import os
import sys
import shutil
lib_dir = sys.argv[1]
shutil.copyfile(os.path.join(lib_dir, "scripts", "pnglibconf.h.prebuilt"), os.path.join(lib_dir, "pnglibconf.h"))
| [
"os.path.join"
] | [((97, 154), 'os.path.join', 'os.path.join', (['lib_dir', '"""scripts"""', '"""pnglibconf.h.prebuilt"""'], {}), "(lib_dir, 'scripts', 'pnglibconf.h.prebuilt')\n", (109, 154), False, 'import os\n'), ((156, 193), 'os.path.join', 'os.path.join', (['lib_dir', '"""pnglibconf.h"""'], {}), "(lib_dir, 'pnglibconf.h')\n", (168,... |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^create/', views.create, name='create'),
url(r'^$', views.GameView.as_view(), name='game'),
]
| [
"django.conf.urls.url"
] | [((75, 119), 'django.conf.urls.url', 'url', (['"""^create/"""', 'views.create'], {'name': '"""create"""'}), "('^create/', views.create, name='create')\n", (78, 119), False, 'from django.conf.urls import url\n')] |
from entry.settings import SITE
site_root = SITE.get('root', 'http://pyrenees.cycling-cap.cn/')
REGISTER_VERIFY_CODE = {
"title": "Welcome to register Flex Travels",
"content": "<p><strong>Dear Ms./Mr.,</strong></p>"
"<p>Thanks for register Pyrenees!</p>"
"<p>Please click</p>"
... | [
"entry.settings.SITE.get"
] | [((45, 96), 'entry.settings.SITE.get', 'SITE.get', (['"""root"""', '"""http://pyrenees.cycling-cap.cn/"""'], {}), "('root', 'http://pyrenees.cycling-cap.cn/')\n", (53, 96), False, 'from entry.settings import SITE\n')] |
"""
Various data import functions for training and validation of neural networks.
"""
import numpy as np
import random as rnd
from oap.__conf__ import OAP_FILE_EXTENSION, SLICE_SIZE
from oap.lib import normalize
from oap.utils import (
barycenter,
features,
adjust_y,
center_particle,
flip_x,
f... | [
"oap.utils.move_to_y",
"oap.lib.normalize",
"oap.utils.files.filepaths",
"oap.utils.barycenter",
"oap.utils.monochromatic",
"random.uniform",
"random.shuffle",
"oap.utils.move_to_x",
"oap.utils.flip_x",
"oap.utils.adjust_y",
"oap.utils.files.read_oap_file",
"numpy.array",
"random.getrandbits... | [((3363, 3381), 'random.shuffle', 'rnd.shuffle', (['files'], {}), '(files)\n', (3374, 3381), True, 'import random as rnd\n'), ((2779, 2887), 'oap.utils.files.filepaths', 'filepaths', (['directory'], {'exclude': 'exclude', 'include': 'include', 'file_extension': 'file_extension', 'p_types': 'positive'}), '(directory, ex... |
from transformers import BertModel, BertConfig
model_path = './models'
bert = BertModel.from_pretrained(model_path)
config = BertConfig.from_pretrained(model_path) | [
"transformers.BertConfig.from_pretrained",
"transformers.BertModel.from_pretrained"
] | [((79, 116), 'transformers.BertModel.from_pretrained', 'BertModel.from_pretrained', (['model_path'], {}), '(model_path)\n', (104, 116), False, 'from transformers import BertModel, BertConfig\n'), ((126, 164), 'transformers.BertConfig.from_pretrained', 'BertConfig.from_pretrained', (['model_path'], {}), '(model_path)\n'... |
# -*- coding: utf-8 -*-
""" Simulating what echolocating bats as they fly in groups - AKA the
'cocktail party nightmare'
Created on Tue Dec 12 21:55:48 2017
Copyright <NAME>, 2019
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "... | [
"numpy.abs",
"numpy.sum",
"numpy.argmin",
"scipy.spatial.distance_matrix",
"numpy.around",
"numpy.sin",
"numpy.arange",
"numpy.tile",
"numpy.float64",
"numpy.random.random_integers",
"sys.path.append",
"pandas.DataFrame",
"scipy.spatial.distance.euclidean",
"numpy.cumsum",
"numpy.apply_a... | [((1366, 1396), 'sys.path.append', 'sys.path.append', (['"""../bridson/"""'], {}), "('../bridson/')\n", (1381, 1396), False, 'import sys\n'), ((1397, 1429), 'sys.path.append', 'sys.path.append', (['"""../acoustics/"""'], {}), "('../acoustics/')\n", (1412, 1429), False, 'import sys\n'), ((4165, 4222), 'scipy.spatial.dis... |
from app import mongo_db
class BaseMongoModel(object):
sql_id = mongo_db.IntField(required=True)
class SysUserMongo(BaseMongoModel, mongo_db.Document):
meta = {'collection': 'sys_users', 'strict': False}
class MachineMongo(BaseMongoModel, mongo_db.Document):
meta = {'collection': 'machine', 'strict'... | [
"app.mongo_db.IntField"
] | [((70, 102), 'app.mongo_db.IntField', 'mongo_db.IntField', ([], {'required': '(True)'}), '(required=True)\n', (87, 102), False, 'from app import mongo_db\n')] |
# Python
from typing import Any
# Django
from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth import get_user_model
from django.db.models import Q
from django.contrib.auth.models import Group
# APPs
from systemtest.users.models import Job
User = get_user_model()
... | [
"django.contrib.auth.models.Group.objects.filter",
"django.forms.ModelChoiceField",
"django.contrib.auth.get_user_model",
"django.db.models.Q",
"systemtest.users.models.Job.objects.filter"
] | [((303, 319), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (317, 319), False, 'from django.contrib.auth import get_user_model\n'), ((1709, 1734), 'django.db.models.Q', 'Q', ([], {'name__icontains': '"""IPIC"""'}), "(name__icontains='IPIC')\n", (1710, 1734), False, 'from django.db.models imp... |
import os
import sqlite3
from anki.hooks import addHook
CURR_DIR = os.path.dirname(os.path.realpath(__file__))
CONN = sqlite3.connect(os.path.join(CURR_DIR, "cedict.db"))
def multiple_hanzi(note, flag):
""" Helper function for the main matcher when multiple hanzi are used """
for char in note["Hanzi"]:
... | [
"os.path.realpath",
"anki.hooks.addHook",
"os.path.join"
] | [((1405, 1444), 'anki.hooks.addHook', 'addHook', (['"""editFocusLost"""', 'on_focus_lost'], {}), "('editFocusLost', on_focus_lost)\n", (1412, 1444), False, 'from anki.hooks import addHook\n'), ((84, 110), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (100, 110), False, 'import os\n'), ((13... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import Flask, render_template, request
from flask.ext.babelex import Babel
import scraper
app = Flask(__name__)
app.config.from_pyfile('config.py')
babel = Babel(app)
# choose best matching locale for babel translation
# available translations list in config
... | [
"flask.ext.babelex.Babel",
"flask.Flask",
"flask.render_template",
"scraper.getData"
] | [((155, 170), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (160, 170), False, 'from flask import Flask, render_template, request\n'), ((215, 225), 'flask.ext.babelex.Babel', 'Babel', (['app'], {}), '(app)\n', (220, 225), False, 'from flask.ext.babelex import Babel\n'), ((481, 510), 'flask.render_template... |
import json
from typing import Dict, Any, Union
import requests
from . import HetznerHandler
from .exceptions import ExMessageHandler
class ServerHandler(HetznerHandler):
"""
Hetzner Handler class for actions with servers
"""
def __init__(self):
self.api_link = f"{self.get_prefix()}/servers... | [
"requests.post",
"requests.delete",
"requests.get",
"json.dumps"
] | [((547, 600), 'requests.get', 'requests.get', ([], {'url': 'self.api_link', 'headers': 'self.headers'}), '(url=self.api_link, headers=self.headers)\n', (559, 600), False, 'import requests\n'), ((1100, 1170), 'requests.get', 'requests.get', ([], {'url': 'f"""{self.api_link}/{id_server}"""', 'headers': 'self.headers'}), ... |