code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
"""Treadmill commaand line helpers.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
# Disable too many lines in module warning.
#
# pylint: disable=C0302
import codecs
import copy
import functools
import io
impor... | [
"treadmill.context.GLOBAL.get_profile_name",
"io.open",
"click.echo",
"sys.exit",
"copy.copy",
"click.BadParameter",
"re.search",
"click.UsageError",
"os.path.exists",
"re.split",
"treadmill.logging.load_logging_conf",
"functools.wraps",
"tempfile.NamedTemporaryFile",
"treadmill.context.GL... | [((2990, 3011), 'os.path.exists', 'os.path.exists', (['value'], {}), '(value)\n', (3004, 3011), False, 'import os\n'), ((8678, 8696), 'click.echo', 'click.echo', (['string'], {}), '(string)\n', (8688, 8696), False, 'import click\n'), ((11163, 11191), 'click.echo', 'click.echo', (['string'], {'err': '(True)'}), '(string... |
'''
`dtApp/dtCode/unquant.py`
:Author:
<NAME>
:Organisation:
University of Liverpool
:Copyright:
BSD Licence
This single python file ``unquant.py`` is the backend code for the uncertainty page.
A single function ``unquant()`` wrangles all the data requests from the html template.
The function tak... | [
"flask.render_template",
"numpy.log10",
"plotly.subplots.make_subplots",
"json.dumps",
"flask.request.form.items",
"dtApp.app.route",
"dtLib.unquant.msd3.displacement_msd_numpy_abs_ww",
"dtLib.unquant.msd3.displacement_bounds_cartesian_MK",
"dtLib.unquant.msd3.displacement_bounds_montecarlo"
] | [((2263, 2309), 'dtApp.app.route', 'app.route', (['"""/unquant"""'], {'methods': "['GET', 'POST']"}), "('/unquant', methods=['GET', 'POST'])\n", (2272, 2309), False, 'from dtApp import app\n'), ((3252, 3355), 'plotly.subplots.make_subplots', 'make_subplots', ([], {'rows': '(3)', 'cols': '(1)', 'subplot_titles': "('Floo... |
import smart_imports
smart_imports.all()
class GROUP(rels_django.DjangoEnum):
static_relation = rels.Column(unique=False, single_type=False, no_index=False)
sort = rels.Column(unique=False)
records = (('GENDER', 0, 'пол', game_relations.GENDER, True),
('RACE', 1, 'раса', game_relations.R... | [
"smart_imports.all"
] | [((23, 42), 'smart_imports.all', 'smart_imports.all', ([], {}), '()\n', (40, 42), False, 'import smart_imports\n')] |
from setuptools import find_packages
from setuptools import setup
try:
README = open("README.md").read()
except IOError:
README = None
setup(
name="pgjobs",
version="0.2.1",
description="Postgresql job scheduling",
long_description=README,
long_description_content_type="text/markdown",
... | [
"setuptools.find_packages"
] | [((466, 481), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (479, 481), False, 'from setuptools import find_packages\n')] |
# -*- coding: utf-8 -*-
"""
Python Httpclient for Sending http requests
"""
import json
import requests
import requests.exceptions
from oslo_log import log
from oslo_config import cfg
from oslo_utils import netutils
admin_opts = [
cfg.StrOpt('username',
help='username'),
cfg.StrOpt('password'... | [
"requests.Session",
"json.dumps",
"oslo_config.cfg.StrOpt",
"oslo_utils.netutils.urlsplit",
"oslo_log.log.getLogger"
] | [((1105, 1128), 'oslo_log.log.getLogger', 'log.getLogger', (['__name__'], {}), '(__name__)\n', (1118, 1128), False, 'from oslo_log import log\n'), ((239, 278), 'oslo_config.cfg.StrOpt', 'cfg.StrOpt', (['"""username"""'], {'help': '"""username"""'}), "('username', help='username')\n", (249, 278), False, 'from oslo_confi... |
if __name__ == "__main__":
import cv2
import numpy as np
import face_recognition as fr
import os
from datetime import datetime
import time
import json
path = 'face_recognition/basic_api/images/known'
images = []
classNames = []
tolerance = 0.6
fpsReport = 0
... | [
"cv2.rectangle",
"cv2.imshow",
"cv2.destroyAllWindows",
"os.listdir",
"face_recognition.face_distance",
"numpy.argmin",
"cv2.waitKey",
"cv2.getTickFrequency",
"face_recognition.face_locations",
"os.path.splitext",
"cv2.putText",
"cv2.cvtColor",
"cv2.resize",
"cv2.imread",
"cv2.getTickCou... | [((373, 389), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n', (383, 389), False, 'import os\n'), ((740, 759), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (756, 759), False, 'import cv2\n'), ((3611, 3634), 'cv2.destroyAllWindows', 'cv2.destroyAllWindows', ([], {}), '()\n', (3632, 3634), False... |
#!/usr/bin/env python3
# encoding: utf-8
"""
userdata_script.py - control an aws instance from a sqs queue
Run this guy on startup as a userdata script and he will connect to
s3 to download code to a directory, and run commands in it that are
provided by an SQS queue, one job at a time per core
Processing as a string... | [
"traceback.format_exception",
"time.sleep",
"os.getcwd",
"os.chdir",
"sys.exc_info",
"boto.connect_s3",
"subprocess.call",
"os.system",
"boto.connect_sqs"
] | [((1561, 1578), 'os.chdir', 'os.chdir', (['"""/root"""'], {}), "('/root')\n", (1569, 1578), False, 'import os\n'), ((1076, 1106), 'subprocess.call', 'subp.call', (['command'], {'shell': '(True)'}), '(command, shell=True)\n', (1085, 1106), True, 'import subprocess as subp\n'), ((1589, 1600), 'os.getcwd', 'os.getcwd', ([... |
import cv2
import numpy as np
'''def read_file(filename):
img = cv2.imread(filename)
cv2_imshow(img)
return img'''
def color_quantization(img, k):
# Transform the image
data = np.float32(img).reshape((-1, 3))
# Determine criteria
criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 20, 0.001)
# ... | [
"numpy.uint8",
"cv2.imwrite",
"cv2.bilateralFilter",
"cv2.kmeans",
"cv2.medianBlur",
"cv2.bitwise_and",
"cv2.adaptiveThreshold",
"cv2.cvtColor",
"cv2.imread",
"numpy.float32"
] | [((364, 430), 'cv2.kmeans', 'cv2.kmeans', (['data', 'k', 'None', 'criteria', '(10)', 'cv2.KMEANS_RANDOM_CENTERS'], {}), '(data, k, None, criteria, 10, cv2.KMEANS_RANDOM_CENTERS)\n', (374, 430), False, 'import cv2\n'), ((442, 458), 'numpy.uint8', 'np.uint8', (['center'], {}), '(center)\n', (450, 458), True, 'import nump... |
import unittest
from models.readingtip import ReadingTip
from models.tag import Tag
from models.user import User
class TestReadingTip(unittest.TestCase):
def setUp(self):
self.user = User("maija", "jahph5Ie")
def test_constructor_sets_fields_correctly(self):
tags = [Tag("kirjat"), Tag("maksull... | [
"models.readingtip.ReadingTip",
"models.tag.Tag",
"models.user.User"
] | [((196, 221), 'models.user.User', 'User', (['"""maija"""', '"""jahph5Ie"""'], {}), "('maija', 'jahph5Ie')\n", (200, 221), False, 'from models.user import User\n'), ((349, 420), 'models.readingtip.ReadingTip', 'ReadingTip', (['"""Hyvä kirja"""', '"""https://kirjakauppa.fi/123"""', 'self.user', 'tags'], {}), "('Hyvä kirj... |
import copy
import itertools
from functools import lru_cache
from typing import List, Dict
import numpy as np
import numpy
from summer.constants import (
Compartment,
Flow,
BirthApproach,
Stratification,
IntegrationType,
)
from .epi_model import EpiModel
from .utils import (
convert_boolean_li... | [
"itertools.product",
"numpy.log",
"numpy.kron",
"numpy.array",
"numba.jit",
"functools.lru_cache",
"copy.copy",
"numpy.arange"
] | [((90506, 90524), 'numba.jit', 'jit', ([], {'nopython': '(True)'}), '(nopython=True)\n', (90509, 90524), False, 'from numba import jit\n'), ((77487, 77513), 'functools.lru_cache', 'lru_cache', ([], {'maxsize': '(2 ** 17)'}), '(maxsize=2 ** 17)\n', (77496, 77513), False, 'from functools import lru_cache\n'), ((12654, 12... |
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | [
"paddle.fluid.layers.fill_constant",
"paddle.fluid.Program",
"paddle.fluid.dygraph.jit.dygraph_to_static_output",
"paddle.fluid.dygraph.guard",
"paddle.fluid.layers.tanh",
"paddle.fluid.dygraph.to_variable",
"numpy.random.random",
"paddle.fluid.layers.reduce_mean",
"paddle.fluid.CPUPlace",
"paddle... | [((780, 797), 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), '(1)\n', (794, 797), True, 'import numpy as np\n'), ((1287, 1352), 'paddle.fluid.layers.fill_constant', 'fluid.layers.fill_constant', (['[feat_size]'], {'dtype': '"""float32"""', 'value': '(1)'}), "([feat_size], dtype='float32', value=1)\n", (1313, 135... |
import cPickle
from pylab import *
import glob
import matplotlib as mpl
import cPickle
import os
SAVE_DIR = os.environ['SAVE_DIR']
label_size = 13
mpl.rcParams['xtick.labelsize'] = label_size+10
mpl.rcParams['ytick.labelsize'] = label_size
fs=15
def plotclasses(classes,samplesclass1):
for i,k in zip(range(... | [
"cPickle.load"
] | [((711, 726), 'cPickle.load', 'cPickle.load', (['f'], {}), '(f)\n', (723, 726), False, 'import cPickle\n')] |
import pytest
from pydantic import ValidationError
from cfripper.config.config import Config
from cfripper.model.enums import RuleGranularity, RuleMode, RuleRisk
from cfripper.model.result import Failure
from cfripper.rule_processor import RuleProcessor
from cfripper.rules import DEFAULT_RULES
from tests.utils import ... | [
"cfripper.config.config.Config",
"cfripper.model.result.Failure",
"cfripper.rules.DEFAULT_RULES.get",
"cfripper.rule_processor.RuleProcessor",
"pytest.raises",
"tests.utils.get_cfmodel_from",
"pytest.fixture"
] | [((367, 383), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (381, 383), False, 'import pytest\n'), ((574, 582), 'cfripper.config.config.Config', 'Config', ([], {}), '()\n', (580, 582), False, 'from cfripper.config.config import Config\n'), ((754, 855), 'cfripper.config.config.Config', 'Config', ([], {'project_n... |
# -*- coding: utf-8 -*-
"""Base class for general models.
"""
import os
import tensorflow as tf
from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score
# clear session
tf.keras.backend.clear_session()
class BaseModel(object):
def __init__(self, config):
self.config = config
... | [
"sklearn.metrics.precision_score",
"sklearn.metrics.recall_score",
"tensorflow.clip_by_global_norm",
"os.path.exists",
"tensorflow.Session",
"tensorflow.ConfigProto",
"tensorflow.train.AdamOptimizer",
"tensorflow.summary.merge_all",
"tensorflow.variable_scope",
"tensorflow.train.GradientDescentOpt... | [((199, 231), 'tensorflow.keras.backend.clear_session', 'tf.keras.backend.clear_session', ([], {}), '()\n', (229, 231), True, 'import tensorflow as tf\n'), ((3592, 3608), 'tensorflow.ConfigProto', 'tf.ConfigProto', ([], {}), '()\n', (3606, 3608), True, 'import tensorflow as tf\n'), ((3681, 3711), 'tensorflow.Session', ... |
"""
Purpose
----
To handle the conversion of a full session's worth of
CMRR's '.log' files into BIDS physiological files.
It uses the "session2bids.py" module of bidsphysio.session to
estimate the potential delay between the scanner and physio
files and find which BIDS image corresponds to which
physiological recordin... | [
"bidsphysio.session.session2bids.convert_session",
"os.path.exists",
"os.path.join",
"argparse.ArgumentParser"
] | [((851, 995), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Extract CMRR *.log physiological files for a fullsession to BIDS-compliant physiology recording"""'}), "(description=\n 'Extract CMRR *.log physiological files for a fullsession to BIDS-compliant physiology recording'\n )... |
import requests
from uuid import UUID
# Version: 0.0.1
class AuthorityCredentialsGetter():
"""
All calls to your Aerobridge instance requires credentials from a oauth server, in this case this is Flight Passport OAUTH server, this class gets the token and the associated public key.
...
Attributes
----------
cli... | [
"requests.post",
"requests.Session",
"requests.get"
] | [((2509, 2541), 'requests.post', 'requests.post', (['url'], {'data': 'payload'}), '(url, data=payload)\n', (2522, 2541), False, 'import requests\n'), ((2805, 2822), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (2817, 2822), False, 'import requests\n'), ((3727, 3745), 'requests.Session', 'requests.Session',... |
from kivy_ios.toolchain import Recipe, shprint
from os.path import join
import sh
class JpegRecipe(Recipe):
version = "v9a"
url = "http://www.ijg.org/files/jpegsrc.{version}.tar.gz"
library = ".libs/libjpeg.a"
include_dir = [
("jpeglib.h", ""),
("jconfig.h", ""),
("jerror.h", "... | [
"kivy_ios.toolchain.shprint",
"os.path.join"
] | [((888, 913), 'kivy_ios.toolchain.shprint', 'shprint', (['sh.make', '"""clean"""'], {}), "(sh.make, 'clean')\n", (895, 913), False, 'from kivy_ios.toolchain import Recipe, shprint\n'), ((922, 964), 'kivy_ios.toolchain.shprint', 'shprint', (['sh.make', 'self.ctx.concurrent_make'], {}), '(sh.make, self.ctx.concurrent_mak... |
from typing import Dict
from .rules import *
from .util import *
import copy
consumes_amount_prefix = "consumes_amount_"
allocates_amount_prefix = "allocates_amount_"
deallocates_amount_prefix = "deallocates_amount_"
def parse(filename: str, include_path, definitions, extra_args):
index = Index.create(True)
... | [
"copy.copy"
] | [((2945, 2981), 'copy.copy', 'copy.copy', (['original_containing_types'], {}), '(original_containing_types)\n', (2954, 2981), False, 'import copy\n')] |
import paddle1to2
from setuptools import setup, find_packages
with open('requirements.txt') as f:
REQUIREMENTS = f.read().splitlines()
with open("README.md", "r")as f:
LONG_DESCRIPTION = f.read()
setup(
name='paddle1to2',
version=paddle1to2.__version__,
install_requires=REQUIREMENTS,
author='... | [
"setuptools.find_packages"
] | [((493, 508), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (506, 508), False, 'from setuptools import setup, find_packages\n')] |
from utl import utility
from re import findall, match
from praw.models.reddit.removal_reasons import RemovalReason, \
SubredditRemovalReasons
from praw.reddit import Comment, Submission
config = utility.get_json("config.json")
flair_tiers: list[str] = config["USER_FLAIRS"]
thread_path = "current-thread.json"
cur... | [
"utl.utility.write_json",
"re.match",
"utl.utility.get_reddit",
"utl.utility.get_json"
] | [((201, 232), 'utl.utility.get_json', 'utility.get_json', (['"""config.json"""'], {}), "('config.json')\n", (217, 232), False, 'from utl import utility\n'), ((334, 363), 'utl.utility.get_json', 'utility.get_json', (['thread_path'], {}), '(thread_path)\n', (350, 363), False, 'from utl import utility\n'), ((404, 431), 'u... |
import sys
import wx
from notes_app import NotesService, ApplicationFrame
app = wx.App()
database = None
if len(sys.argv) > 1:
database = sys.argv[1]
# service layer
notes_service = NotesService(database)
notes_service.load_notes()
# Application main window
frm = ApplicationFrame(notes_service, None, title="N... | [
"notes_app.NotesService",
"wx.App",
"notes_app.ApplicationFrame"
] | [((83, 91), 'wx.App', 'wx.App', ([], {}), '()\n', (89, 91), False, 'import wx\n'), ((191, 213), 'notes_app.NotesService', 'NotesService', (['database'], {}), '(database)\n', (203, 213), False, 'from notes_app import NotesService, ApplicationFrame\n'), ((274, 330), 'notes_app.ApplicationFrame', 'ApplicationFrame', (['no... |
from pathlib import Path
import py.path
from responses import GET
from responses import RequestsMock
from spinta.core.config import RawConfig
from spinta.testing.tabular import create_tabular_manifest
from spinta.testing.manifest import load_manifest
def test_gsheets(rc: RawConfig, tmpdir: py.path.local, responses:... | [
"spinta.testing.manifest.load_manifest",
"spinta.testing.tabular.create_tabular_manifest",
"pathlib.Path"
] | [((1660, 1696), 'spinta.testing.tabular.create_tabular_manifest', 'create_tabular_manifest', (['path', 'table'], {}), '(path, table)\n', (1683, 1696), False, 'from spinta.testing.tabular import create_tabular_manifest\n'), ((2203, 2228), 'spinta.testing.manifest.load_manifest', 'load_manifest', (['rc', 'gsheet'], {}), ... |
from aws_xray_sdk.core import xray_recorder
def mock_subfunc():
pass
@xray_recorder.capture()
def mock_no_doublepatch():
pass
class MockClass(object):
def __init__(self):
pass
def mock_method(self):
pass
@classmethod
def mock_classmethod(cls):
pass
@staticmet... | [
"aws_xray_sdk.core.xray_recorder.capture"
] | [((78, 101), 'aws_xray_sdk.core.xray_recorder.capture', 'xray_recorder.capture', ([], {}), '()\n', (99, 101), False, 'from aws_xray_sdk.core import xray_recorder\n')] |
# PVL_PRES2ALT Determine altitude from site pressure
#
# Syntax
# Alt = pvl_pres2alt(pressure)
#
# Description
# PVL_PRES2ALT determines the altitude (in meters above sea level) of a
# site on Earth's surface given its atmospheric pressure (in Pascals).
# Output "Alt" is given in meters above sea level. Alt ... | [
"pvl_tools.Parse"
] | [((923, 948), 'pvl_tools.Parse', 'pvt.Parse', (['kwargs', 'Expect'], {}), '(kwargs, Expect)\n', (932, 948), True, 'import pvl_tools as pvt\n')] |
"""
Tests for the MWS.OutboundShipments API class.
"""
import unittest
import mws
from .utils import CommonRequestTestTools
class OutboundShipmentsTestCase(unittest.TestCase, CommonRequestTestTools):
"""
Test cases for OutboundShipments.
"""
# TODO: Add remaining methods for OutboundShipments
def... | [
"mws.OutboundShipments"
] | [((353, 486), 'mws.OutboundShipments', 'mws.OutboundShipments', (['self.CREDENTIAL_ACCESS', 'self.CREDENTIAL_SECRET', 'self.CREDENTIAL_ACCOUNT'], {'auth_token': 'self.CREDENTIAL_TOKEN'}), '(self.CREDENTIAL_ACCESS, self.CREDENTIAL_SECRET, self.\n CREDENTIAL_ACCOUNT, auth_token=self.CREDENTIAL_TOKEN)\n', (374, 486), F... |
import copy
import itertools
from collections import deque
from typing import TextIO, Tuple
from aoc2019.intcode import Computer, read_program
def query_position(x: int, y: int, computer: Computer) -> bool:
computer = copy.deepcopy(computer)
computer.send_input(x)
computer.send_input(y)
computer.run... | [
"itertools.count",
"collections.deque",
"aoc2019.intcode.read_program",
"copy.deepcopy"
] | [((225, 248), 'copy.deepcopy', 'copy.deepcopy', (['computer'], {}), '(computer)\n', (238, 248), False, 'import copy\n'), ((1111, 1118), 'collections.deque', 'deque', ([], {}), '()\n', (1116, 1118), False, 'from collections import deque\n'), ((1133, 1150), 'itertools.count', 'itertools.count', ([], {}), '()\n', (1148, 1... |
# -*- coding: utf-8 -*-
import scrapy
import json
from locations.items import GeojsonPointItem
from locations.hours import OpeningHours
class SprintSpider(scrapy.Spider):
name = "sprint"
allowed_domains = ["sprint.com"]
start_urls = (
'https://www.sprint.com/locations/',
)
def parse_hour... | [
"locations.hours.OpeningHours",
"locations.items.GeojsonPointItem"
] | [((366, 380), 'locations.hours.OpeningHours', 'OpeningHours', ([], {}), '()\n', (378, 380), False, 'from locations.hours import OpeningHours\n'), ((2270, 2300), 'locations.items.GeojsonPointItem', 'GeojsonPointItem', ([], {}), '(**properties)\n', (2286, 2300), False, 'from locations.items import GeojsonPointItem\n')] |
import os
import optparse
import tensorflow as tf
from data_utils import *
from utils import get_session
from Model import RNNmodel
if __name__ == '__main__':
sess = get_session()
poemdata = dataLoader(yan=5)
vocab_size = len(poemdata.id2c)
embedding_size = 256
rnn_units = 128
rnn_layers = 2
... | [
"Model.RNNmodel",
"utils.get_session"
] | [((171, 184), 'utils.get_session', 'get_session', ([], {}), '()\n', (182, 184), False, 'from utils import get_session\n'), ((614, 884), 'Model.RNNmodel', 'RNNmodel', ([], {'vocab_size': 'vocab_size', 'embedding_size': 'embedding_size', 'rnn_units': 'rnn_units', 'rnn_layers': 'rnn_layers', 'grad_clip': 'grad_clip', 'sav... |
from collections import OrderedDict
from daops.utils import fixer, is_characterised
from daops.utils.normalise import ResultSet
from pywps.app.exceptions import ProcessError
from roocs_utils.project_utils import get_project_name
from roocs_utils.utils.file_utils import FileMapper
from rook import CONFIG
from roocs_ut... | [
"collections.OrderedDict",
"daops.utils.is_characterised",
"roocs_utils.project_utils.get_project_name",
"roocs_utils.utils.file_utils.FileMapper",
"pywps.app.exceptions.ProcessError",
"daops.utils.normalise.ResultSet",
"rook.catalog.get_catalog",
"roocs_utils.exceptions.InvalidCollection",
"daops.u... | [((943, 968), 'roocs_utils.project_utils.get_project_name', 'get_project_name', (['coll[0]'], {}), '(coll[0])\n', (959, 968), False, 'from roocs_utils.project_utils import get_project_name\n'), ((5212, 5225), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (5223, 5225), False, 'from collections import Order... |
import numpy as np
import joblib
from a2c_ppo_acktr.multi_agent.utils import tsne
def main():
fgs_5, adv_5 = joblib.load("grad-5.obj")
fgs_10, adv_10 = joblib.load("grad-10.obj")
fgs_15, adv_15 = joblib.load("grad-15.obj")
tsne(fgs_5 + fgs_10 + fgs_15, ["g-5"] * len(fgs_5) + ["g-10"] * len(fgs_10) +... | [
"joblib.load"
] | [((116, 141), 'joblib.load', 'joblib.load', (['"""grad-5.obj"""'], {}), "('grad-5.obj')\n", (127, 141), False, 'import joblib\n'), ((163, 189), 'joblib.load', 'joblib.load', (['"""grad-10.obj"""'], {}), "('grad-10.obj')\n", (174, 189), False, 'import joblib\n'), ((211, 237), 'joblib.load', 'joblib.load', (['"""grad-15.... |
import os;
import zipfile;
import arcpy;
pwd = os.path.dirname(os.path.realpath(__file__));
if arcpy.Exists(pwd + os.sep + "ModelInputTables.gdb"):
arcpy.Delete_management(pwd + os.sep + "ModelInputTables.gdb");
with zipfile.ZipFile(pwd + os.sep + "ToolData.zip",'r') as zip_ref:
zip_ref.extractall(pwd);
... | [
"os.path.exists",
"zipfile.ZipFile",
"arcpy.CreateFileGDB_management",
"os.path.realpath",
"arcpy.Exists",
"os.mkdir",
"arcpy.Delete_management"
] | [((97, 148), 'arcpy.Exists', 'arcpy.Exists', (["(pwd + os.sep + 'ModelInputTables.gdb')"], {}), "(pwd + os.sep + 'ModelInputTables.gdb')\n", (109, 148), False, 'import arcpy\n'), ((324, 376), 'arcpy.Exists', 'arcpy.Exists', (["(pwd + os.sep + 'ModelOutputTables.gdb')"], {}), "(pwd + os.sep + 'ModelOutputTables.gdb')\n"... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as pl
import seaborn as sns
import tensorflow as tf
import re
import json
from functools import partial
from itertools import filterfalse
from wordcloud import WordCloud
from tensorflow i... | [
"re.split",
"pandas.to_timedelta",
"tensorflow.keras.layers.Normalization",
"pandas.read_csv",
"tensorflow.keras.Sequential",
"json.dumps",
"numpy.asarray",
"tensorflow.keras.layers.Dropout",
"pandas.value_counts",
"tensorflow.saved_model.save",
"wordcloud.WordCloud",
"tensorflow.keras.layers.... | [((374, 397), 'pandas.read_csv', 'pd.read_csv', (['"""data.csv"""'], {}), "('data.csv')\n", (385, 397), True, 'import pandas as pd\n'), ((632, 668), 'pandas.to_datetime', 'pd.to_datetime', (["df['date_published']"], {}), "(df['date_published'])\n", (646, 668), True, 'import pandas as pd\n'), ((748, 759), 'wordcloud.Wor... |
import os
from collections import defaultdict
from collections.abc import Mapping, MutableMapping, MutableSequence, Sequence
from contextlib import contextmanager
from copy import deepcopy
from dataclasses import dataclass, field, replace
from typing import Any, List, Optional, Union
from funcy import identity
from d... | [
"dvc.parsing.interpolate.is_exact_string",
"os.path.splitext",
"dvc.parsing.interpolate.get_matches",
"dvc.parsing.interpolate.resolve_str",
"collections.defaultdict",
"doctest.testmod",
"dataclasses.replace",
"copy.deepcopy",
"dataclasses.field",
"dvc.parsing.interpolate.is_interpolated_string"
] | [((1031, 1058), 'dataclasses.field', 'field', ([], {'default_factory': 'list'}), '(default_factory=list)\n', (1036, 1058), False, 'from dataclasses import dataclass, field, replace\n'), ((1513, 1576), 'dataclasses.field', 'field', ([], {'compare': '(False)', 'default_factory': '_default_meta', 'repr': '(False)'}), '(co... |
import torch.nn as nn
import torch
class LinearProj(nn.Module):
def __init__(self, standardization, proj, L_kernel_size=3):
super(LinearProj, self).__init__()
self.standardization = standardization
self.proj = proj
self.L_kernel_size = L_kernel_size
def forward(self, x):
... | [
"torch.nn.functional.pad"
] | [((520, 583), 'torch.nn.functional.pad', 'nn.functional.pad', (['output', '(((self.L_kernel_size - 1) // 2,) * 4)'], {}), '(output, ((self.L_kernel_size - 1) // 2,) * 4)\n', (537, 583), True, 'import torch.nn as nn\n')] |
# -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
#
"""Tests for the plugin."""
# Standard library imports
import os
import os.path as osp
# Test library imports
import pytest
try:
from unittest.mock import Mock
except ImportError:
from mock imp... | [
"spyder.plugins.editor.widgets.editor.EditorStack",
"qtpy.QtWidgets.QWidget.__init__",
"spyder_vim.vim_widget.RE_VIM_PREFIX.match",
"qtpy.QtWidgets.QVBoxLayout",
"spyder_vim.vim.Vim.__init__",
"mock.Mock",
"os.path.join",
"os.getcwd",
"os.path.dirname",
"qtpy.QtWidgets.QApplication.clipboard"
] | [((1859, 1865), 'mock.Mock', 'Mock', ([], {}), '()\n', (1863, 1865), False, 'from mock import Mock\n'), ((2107, 2128), 'spyder.plugins.editor.widgets.editor.EditorStack', 'EditorStack', (['None', '[]'], {}), '(None, [])\n', (2118, 2128), False, 'from spyder.plugins.editor.widgets.editor import EditorStack\n'), ((2789, ... |
# Generated by Django 2.1.2 on 2018-11-11 22:11
import datetime
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('usermess', '0001_initial'),
]
operations = [
migrations.AlterField(
... | [
"datetime.datetime",
"django.db.models.ForeignKey"
] | [((620, 706), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'on_delete': 'django.db.models.deletion.PROTECT', 'to': '"""mess.Coupons"""'}), "(on_delete=django.db.models.deletion.PROTECT, to=\n 'mess.Coupons')\n", (637, 706), False, 'from django.db import migrations, models\n'), ((432, 483), 'datetime.dat... |
""" Document Localization using Recursive CNN
Maintainer : <NAME>
Email : <EMAIL> """
import imgaug.augmenters as iaa
import csv
import logging
import os
import xml.etree.ElementTree as ET
import numpy as np
from torchvision import transforms
import utils.utils as utils
# To incdude a new Dataset, inherit from Da... | [
"logging.getLogger",
"imgaug.augmenters.AverageBlur",
"utils.utils.sort_gt",
"imgaug.augmenters.AllChannelsHistogramEqualization",
"imgaug.augmenters.GaussianBlur",
"numpy.array",
"imgaug.augmenters.Resize",
"imgaug.augmenters.Snowflakes",
"imgaug.augmenters.LogContrast",
"imgaug.augmenters.Graysc... | [((457, 483), 'logging.getLogger', 'logging.getLogger', (['"""iCARL"""'], {}), "('iCARL')\n", (474, 483), False, 'import logging\n'), ((5406, 5427), 'numpy.array', 'np.array', (['self.labels'], {}), '(self.labels)\n', (5414, 5427), True, 'import numpy as np\n'), ((5451, 5483), 'numpy.reshape', 'np.reshape', (['self.lab... |
import kivy
kivy.require('2.0.0')
from kivymd.uix.behaviors import TouchBehavior
from kivy.graphics.transformation import Matrix
from kivy.uix.scatterlayout import ScatterLayout
class CustomScatterLayout(TouchBehavior, ScatterLayout):
def on_double_tap(self, *args):
trans = Matrix().scale(1, 1, 1)
... | [
"kivy.require",
"kivy.graphics.transformation.Matrix"
] | [((12, 33), 'kivy.require', 'kivy.require', (['"""2.0.0"""'], {}), "('2.0.0')\n", (24, 33), False, 'import kivy\n'), ((289, 297), 'kivy.graphics.transformation.Matrix', 'Matrix', ([], {}), '()\n', (295, 297), False, 'from kivy.graphics.transformation import Matrix\n')] |
import discord
import asyncio
import logging
import traceback
import time
from dwrapper import DiscordWrapper
client = discord.Client()
logger = logging.getLogger('discord')
logger.setLevel(logging.DEBUG)
handler = logging.FileHandler(filename='discord.log', encoding='utf-8', mode='w')
handler.setFormatter(logging.For... | [
"logging.getLogger",
"traceback.print_stack",
"logging.Formatter",
"dwrapper.DiscordWrapper",
"logging.FileHandler",
"asyncio.sleep",
"discord.Client",
"traceback.print_exc"
] | [((120, 136), 'discord.Client', 'discord.Client', ([], {}), '()\n', (134, 136), False, 'import discord\n'), ((146, 174), 'logging.getLogger', 'logging.getLogger', (['"""discord"""'], {}), "('discord')\n", (163, 174), False, 'import logging\n'), ((216, 287), 'logging.FileHandler', 'logging.FileHandler', ([], {'filename'... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-10-01 01:17
from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
import django_smalluuid.models
import everyvoter_common.utils.models
class Migration(... | [
"django.db.models.DateField",
"django.db.models.ForeignKey",
"django.db.models.ManyToManyField",
"django.db.models.AutoField",
"django.db.models.DateTimeField",
"django.db.models.CharField"
] | [((2794, 2895), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'on_delete': 'django.db.models.deletion.CASCADE', 'to': '"""democracy_consumer.Response"""'}), "(on_delete=django.db.models.deletion.CASCADE, to=\n 'democracy_consumer.Response')\n", (2811, 2895), False, 'from django.db import migrations, mode... |
#!/usr/bin/env python
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "Li... | [
"argparse.ArgumentParser",
"lintutils.get_sources",
"platform.system",
"functools.partial",
"multiprocessing.Pool",
"sys.exit",
"lintutils.chunk",
"lintutils.run_parallel",
"lintutils.stdout_pathcolonline"
] | [((1763, 1812), 'lintutils.stdout_pathcolonline', 'lintutils.stdout_pathcolonline', (['result', 'filenames'], {}), '(result, filenames)\n', (1793, 1812), False, 'import lintutils\n'), ((1855, 1934), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Runs cpplint on all of the source files.""... |
#!/usr/bin/env python3
# file : pcap2raw.py
# repo : https://github.com/fuzzah/fuzzaide
# author : https://github.com/fuzzah
# license : MIT
# check repository for more information
import os
import sys
import glob
import argparse
from hashlib import sha1
try:
from scapy.all import rdpcap
except:
... | [
"os.path.exists",
"os.makedirs",
"os.path.join",
"argparse.ArgumentParser.print_help",
"os.path.isfile",
"os.path.isdir",
"scapy.all.rdpcap",
"sys.exit",
"argparse.ArgumentParser.__init__",
"hashlib.sha1",
"glob.glob"
] | [((320, 392), 'sys.exit', 'sys.exit', (['"""Please install scapy: python3 -m pip install -U scapy --user"""'], {}), "('Please install scapy: python3 -m pip install -U scapy --user')\n", (328, 392), False, 'import sys\n'), ((503, 558), 'argparse.ArgumentParser.__init__', 'argparse.ArgumentParser.__init__', (['self', '*a... |
from random import random, choice
from apiritif import random_string
from bzt.modules.aggregator import ConsolidatingAggregator, DataPoint, KPISet, AggregatorListener
from bzt.utils import to_json
from tests import BZTestCase
from tests.mocks import r, MockReader, EngineEmul
def get_success_reader(offset=0):
moc... | [
"random.choice",
"apiritif.random_string",
"bzt.utils.to_json",
"bzt.modules.aggregator.ConsolidatingAggregator",
"bzt.modules.aggregator.KPISet",
"tests.mocks.EngineEmul",
"bzt.modules.aggregator.DataPoint",
"tests.mocks.MockReader",
"tests.mocks.r",
"random.random"
] | [((324, 336), 'tests.mocks.MockReader', 'MockReader', ([], {}), '()\n', (334, 336), False, 'from tests.mocks import r, MockReader, EngineEmul\n'), ((1299, 1311), 'tests.mocks.MockReader', 'MockReader', ([], {}), '()\n', (1309, 1311), False, 'from tests.mocks import r, MockReader, EngineEmul\n'), ((1557, 1569), 'tests.m... |
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 22 12:07:01 2020
@author: <NAME>
"""
from nltk.cluster.util import cosine_distance
import numpy as np
import networkx as nx
import math
def get_doc(nlp, file_name, encoding_='utf-8'):
return nlp(open(file_name, 'r', encoding=encoding_).read())
def get_sentences(doc... | [
"numpy.mean",
"networkx.Graph",
"networkx.connected_components",
"numpy.sum",
"numpy.zeros",
"numpy.dot",
"nltk.cluster.util.cosine_distance"
] | [((3283, 3293), 'networkx.Graph', 'nx.Graph', ([], {}), '()\n', (3291, 3293), True, 'import networkx as nx\n'), ((3646, 3680), 'networkx.connected_components', 'nx.connected_components', (['adj_graph'], {}), '(adj_graph)\n', (3669, 3680), True, 'import networkx as nx\n'), ((822, 847), 'numpy.zeros', 'np.zeros', (['(300... |
import os
from flask import Flask, current_app as app
from kafka_utils.consumer import get_consumer
import utils.docx_translate_helper as docx_helper
from models.text_nodes import TextNode
from models.translation_process import TranslationProcess
import json
import logging
log = logging.getLogger('file')
app = Flask(_... | [
"logging.getLogger",
"utils.docx_translate_helper.itertext_old",
"utils.docx_translate_helper.save_docx",
"utils.docx_translate_helper.get_document_xml",
"flask.Flask",
"models.text_nodes.TextNode.objects",
"os.path.join",
"utils.docx_translate_helper.get_xml_tree",
"flask.current_app.app_context",
... | [((281, 306), 'logging.getLogger', 'logging.getLogger', (['"""file"""'], {}), "('file')\n", (298, 306), False, 'import logging\n'), ((313, 328), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (318, 328), False, 'from flask import Flask, current_app as app\n'), ((1810, 1840), 'kafka_utils.consumer.get_consu... |
import unittest
import time
from simcem import *
class CoreTest(unittest.TestCase):
def setUp(self):
self.startTime = time.time()
def tearDown(self):
t = time.time() - self.startTime
print("%s: %.3fms" % (self.id(), t*1000))
@classmethod
def setUpClass(cls):
cls.d... | [
"unittest.main",
"time.time"
] | [((14910, 14925), 'unittest.main', 'unittest.main', ([], {}), '()\n', (14923, 14925), False, 'import unittest\n'), ((132, 143), 'time.time', 'time.time', ([], {}), '()\n', (141, 143), False, 'import time\n'), ((181, 192), 'time.time', 'time.time', ([], {}), '()\n', (190, 192), False, 'import time\n')] |
import pytest
import io
import os
import json
import base64
import hashlib
from http import client
import aiohttpretty
from waterbutler.core import streams
from waterbutler.core import exceptions
from waterbutler.core.path import WaterButlerPath
from waterbutler.core.provider import build_url
from waterbutler.provi... | [
"aiohttpretty.register_json_uri",
"waterbutler.core.streams.FileStreamReader",
"aiohttpretty.register_uri",
"waterbutler.providers.github.provider.GitHubPath",
"io.BytesIO",
"os.path.join",
"waterbutler.providers.github.metadata.GitHubFileContentMetadata",
"waterbutler.providers.github.GitHubProvider"... | [((1241, 1265), 'io.BytesIO', 'io.BytesIO', (['file_content'], {}), '(file_content)\n', (1251, 1265), False, 'import io\n'), ((1323, 1358), 'waterbutler.core.streams.FileStreamReader', 'streams.FileStreamReader', (['file_like'], {}), '(file_like)\n', (1347, 1358), False, 'from waterbutler.core import streams\n'), ((216... |
from pycordia import events, models
import pycordia
import dotenv
import os
dotenv.load_dotenv()
dotenv.load_dotenv()
client = pycordia.Client(intents=pycordia.Intents.all())
LOGS_CHANNEL: str = os.getenv("LOG_CHANNEL") # Change this to a suitable channel's ID
@client.event
async def on_ready(event: events.ReadyEve... | [
"pycordia.models.Embed.create",
"os.getenv",
"pycordia.models.Message.create",
"dotenv.load_dotenv",
"pycordia.Intents.all"
] | [((76, 96), 'dotenv.load_dotenv', 'dotenv.load_dotenv', ([], {}), '()\n', (94, 96), False, 'import dotenv\n'), ((98, 118), 'dotenv.load_dotenv', 'dotenv.load_dotenv', ([], {}), '()\n', (116, 118), False, 'import dotenv\n'), ((196, 220), 'os.getenv', 'os.getenv', (['"""LOG_CHANNEL"""'], {}), "('LOG_CHANNEL')\n", (205, 2... |
from collections import OrderedDict
from ctypes import LittleEndianStructure, Structure, Union, c_uint8, c_uint16, c_uint32,\
string_at, byref, sizeof, c_bool, c_int16, Array, c_char
import json
import logging
import struct
from telemetry_unit_conversions import \
temp_sensor_adc_val_to_celsius, adc_to_bat_cur... | [
"logging.debug",
"telemetry_unit_conversions.adc_to_bat_voltage",
"telemetry_unit_conversions.adc_to_bat_current_milli_amper",
"telemetry_unit_conversions.adc_5v_bus_voltage_milli_volt",
"telemetry_unit_conversions.adc_12v_bus_voltage_milli_volt",
"telemetry_unit_conversions.adc_3v3_bus_voltage_milli_volt... | [((769, 911), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO', 'format': '"""%(asctime)s.%(msecs)03dZ - %(levelname)s: %(message)s"""', 'datefmt': '"""%Y-%m-%dT%H:%M:%S"""'}), "(level=logging.INFO, format=\n '%(asctime)s.%(msecs)03dZ - %(levelname)s: %(message)s', datefmt=\n '%Y-%m-%dT... |
# Author: <NAME> <<EMAIL>>
import torch
import torch.nn as nn
from torch.nn import init
import torch.nn.functional as F
import functools
from .networks import get_norm_layer, init_net, ResnetBlock
from . import keypoint_detector as kpd
# TriangleGAN: https://arxiv.org/pdf/1907.05916.pdf
#-----------------------------... | [
"torch.nn.Sigmoid",
"torch.nn.ReLU",
"torch.nn.Tanh",
"torch.nn.LeakyReLU",
"torch.nn.Sequential",
"torch.nn.Conv2d",
"torch.nn.ConvTranspose2d",
"torch.nn.functional.softmax",
"torch.cat"
] | [((2226, 2247), 'torch.nn.Sequential', 'nn.Sequential', (['*model'], {}), '(*model)\n', (2239, 2247), True, 'import torch.nn as nn\n'), ((2422, 2443), 'torch.nn.Sequential', 'nn.Sequential', (['*model'], {}), '(*model)\n', (2435, 2443), True, 'import torch.nn as nn\n'), ((4926, 4970), 'torch.nn.functional.softmax', 'F.... |
#
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# 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 ... | [
"logging.getLogger",
"merlin.models.tf.features.embedding.EmbeddingOptions",
"merlin.models.tf.blocks.core.combinators.ParallelBlock",
"merlin.models.tf.blocks.retrieval.base.TowerBlock",
"tensorflow.keras.utils.register_keras_serializable",
"merlin.models.tf.blocks.core.inputs.InputBlock"
] | [((1040, 1074), 'logging.getLogger', 'logging.getLogger', (['"""merlin_models"""'], {}), "('merlin_models')\n", (1057, 1074), False, 'import logging\n'), ((1078, 1145), 'tensorflow.keras.utils.register_keras_serializable', 'tf.keras.utils.register_keras_serializable', ([], {'package': '"""merlin_models"""'}), "(package... |
#!/usr/bin/env python
import sys,os
import unittest
from matchbox_api_utils import MatchData
from matchbox_api_utils import utils
class FunctionTests(unittest.TestCase):
# proc_mb_file = 'mb_obj_' + utils.get_today('short') + '.json'
sys_default_json = os.path.join(
os.path.dirname(__file__),
'... | [
"matchbox_api_utils.MatchData",
"os.path.dirname"
] | [((436, 489), 'matchbox_api_utils.MatchData', 'MatchData', ([], {'matchbox': '"""adult"""', 'json_db': 'sys_default_json'}), "(matchbox='adult', json_db=sys_default_json)\n", (445, 489), False, 'from matchbox_api_utils import MatchData\n'), ((284, 309), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file... |
import cymysql
from django.db.backends.mysql import schema
class DatabaseSchemaEditor(schema.DatabaseSchemaEditor):
def quote_value(self, value):
return cymysql.converters.escape_item(value, 'utf-8')
| [
"cymysql.converters.escape_item"
] | [((167, 213), 'cymysql.converters.escape_item', 'cymysql.converters.escape_item', (['value', '"""utf-8"""'], {}), "(value, 'utf-8')\n", (197, 213), False, 'import cymysql\n')] |
from setuptools import setup
from os import path
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='rsp',
version='1.0.1',
description='Rapid SSH Proxy',
url='https://github.com/S... | [
"os.path.join",
"os.path.dirname",
"setuptools.setup"
] | [((211, 1203), 'setuptools.setup', 'setup', ([], {'name': '"""rsp"""', 'version': '"""1.0.1"""', 'description': '"""Rapid SSH Proxy"""', 'url': '"""https://github.com/Snawoot/rsp"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'license': '"""MIT"""', 'packages': "['rsp']", 'python_requires': '""">=3.5.3... |
# -*- coding: utf-8 -*-
"""System key (syskey) collector."""
import codecs
from winregrc import interface
class SystemKey(object):
"""System key.
Attributes:
boot_key (bytes): boot key.
"""
def __init__(self):
"""Initializes a system key."""
super(SystemKey, self).__init__()
self.boot_key ... | [
"codecs.decode"
] | [((2082, 2121), 'codecs.decode', 'codecs.decode', (['class_name_string', '"""hex"""'], {}), "(class_name_string, 'hex')\n", (2095, 2121), False, 'import codecs\n')] |
import torch
import torch.nn.functional as F
from ..helpers import move_dim
from . import reduction_str
def label_smoothing(
input,
target,
weight=None,
size_average=None,
reduce=None,
reduction="mean",
ignore_index=-100,
alpha=0.1,
num_classes=None,
):
"""Computes the smoothe... | [
"torch.nn.functional.one_hot",
"torch.nn.functional.log_softmax",
"torch.full_like"
] | [((1330, 1373), 'torch.full_like', 'torch.full_like', (['input', '(alpha / num_classes)'], {}), '(input, alpha / num_classes)\n', (1345, 1373), False, 'import torch\n'), ((1388, 1430), 'torch.nn.functional.one_hot', 'F.one_hot', (['target'], {'num_classes': 'num_classes'}), '(target, num_classes=num_classes)\n', (1397,... |
import numpy as np
import musher
def test_hpcp():
tone = 100.
frequencies = [tone, tone * 2, tone * 3, tone * 4]
magnitudes = [1., 1., 1., 1.]
harmonics = 3
band_preset = False
min_frequency = 50.0
max_frequency = 500.0
actual_hpcp = musher.hpcp(frequencies,
... | [
"musher.hpcp_from_peaks",
"musher.hpcp",
"musher.spectral_peaks",
"numpy.allclose"
] | [((270, 415), 'musher.hpcp', 'musher.hpcp', (['frequencies', 'magnitudes'], {'harmonics': 'harmonics', 'band_preset': 'band_preset', 'min_frequency': 'min_frequency', 'max_frequency': 'max_frequency'}), '(frequencies, magnitudes, harmonics=harmonics, band_preset=\n band_preset, min_frequency=min_frequency, max_frequ... |
import os
import cv2
import numpy as np
from deslant import deslant_image
from util import FrozenDict, is_file, make_directories_for_file
import logging
logger = logging.getLogger(__name__)
def pre_processor(config):
name = config.get("data_set/pre_processor/name", default=None)
parameters = config.get("d... | [
"logging.getLogger",
"cv2.imwrite",
"util.make_directories_for_file",
"deslant.deslant_image",
"util.is_file",
"os.path.dirname",
"os.path.basename",
"util.FrozenDict",
"cv2.cvtColor",
"cv2.imread"
] | [((166, 193), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (183, 193), False, 'import logging\n'), ((567, 579), 'util.FrozenDict', 'FrozenDict', ([], {}), '()\n', (577, 579), False, 'from util import FrozenDict, is_file, make_directories_for_file\n'), ((777, 807), 'os.path.dirname', 'os... |
import sys
import requests
import numpy as np
import pandas as pd
import kauffman.constants as c
pd.set_option('max_columns', 1000)
pd.set_option('max_info_columns', 1000)
pd.set_option('expand_frame_repr', False)
pd.set_option('display.max_rows', 30000)
pd.set_option('max_colwidth', 4000)
pd.set_option('display.float... | [
"requests.get",
"pandas.set_option",
"kauffman.constants.age_size_lst.index",
"pandas.read_excel",
"pandas.DataFrame"
] | [((98, 132), 'pandas.set_option', 'pd.set_option', (['"""max_columns"""', '(1000)'], {}), "('max_columns', 1000)\n", (111, 132), True, 'import pandas as pd\n'), ((133, 172), 'pandas.set_option', 'pd.set_option', (['"""max_info_columns"""', '(1000)'], {}), "('max_info_columns', 1000)\n", (146, 172), True, 'import pandas... |
import pytest
from sqlalchemy import Column, Integer
from dbeditor.database import Database
from dbeditor.table_builder import BuilderGroup
@pytest.fixture
def group(database: Database) -> BuilderGroup:
g = BuilderGroup(database.engine)
g.start_building("example") # FIXME: fixture based on testing code
... | [
"pytest.mark.parametrize",
"pytest.raises",
"sqlalchemy.Column",
"dbeditor.table_builder.BuilderGroup"
] | [((431, 522), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""table_name, expected"""', "[('example', True), ('Lorem', False)]"], {}), "('table_name, expected', [('example', True), (\n 'Lorem', False)])\n", (454, 522), False, 'import pytest\n'), ((214, 243), 'dbeditor.table_builder.BuilderGroup', 'Builde... |
# Libraries
import json
import logging
import _thread
# Relative imports
from src.bot.bot import bot
from res.public.explorer import EXPLORER
from src.ws.ws import send, rcv
# Constants
LOGGER = logging.getLogger(__name__)
# GLOBALS
ADDR_SUBS, BLOCK_SUBS, LOOP = {}, [], False
def recv_loop():
"""
Maintain... | [
"logging.getLogger",
"src.bot.bot.bot.send_message",
"json.loads",
"src.ws.ws.rcv",
"src.ws.ws.send",
"_thread.start_new_thread"
] | [((198, 225), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (215, 225), False, 'import logging\n'), ((4065, 4096), 'src.bot.bot.bot.send_message', 'bot.send_message', (['chat', 'message'], {}), '(chat, message)\n', (4081, 4096), False, 'from src.bot.bot import bot\n'), ((4544, 4575), 'sr... |
from gi.repository import Gio, Gtk, GLib, Gdk
import pkg_resources
from typing import List
from ocrd_browser.util.gtk import ActionRegistry
from ocrd_browser.ui import MainWindow, AboutDialog, OpenDialog
from ocrd_browser.view import ViewRegistry
class OcrdBrowserApplication(Gtk.Application):
def __init__(self)... | [
"ocrd_browser.util.gtk.ActionRegistry",
"gi.repository.Gtk.Application.do_startup",
"gi.repository.Gdk.Screen.get_default",
"pkg_resources.iter_entry_points",
"ocrd_browser.view.ViewRegistry.create_from_entry_points",
"gi.repository.Gtk.CssProvider",
"gi.repository.Gtk.StyleContext",
"ocrd_browser.ui.... | [((338, 461), 'gi.repository.Gtk.Application.__init__', 'Gtk.Application.__init__', (['self'], {'application_id': '"""org.readmachine.ocrd-browser"""', 'flags': 'Gio.ApplicationFlags.HANDLES_OPEN'}), "(self, application_id=\n 'org.readmachine.ocrd-browser', flags=Gio.ApplicationFlags.HANDLES_OPEN)\n", (362, 461), Fa... |
# Generated by Django 3.1.4 on 2020-12-29 18:17
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0005_auto_20201229_1812'),
]
operations = [
migrations.AddField(
model_name='grandparent',
name='GType',
... | [
"django.db.models.CharField"
] | [((334, 442), 'django.db.models.CharField', 'models.CharField', ([], {'choices': "[('Great', 'Great'), ('Regular', 'Regular')]", 'default': '"""Regular"""', 'max_length': '(15)'}), "(choices=[('Great', 'Great'), ('Regular', 'Regular')],\n default='Regular', max_length=15)\n", (350, 442), False, 'from django.db impor... |
from dagster import ModeDefinition, fs_io_manager, pipeline
from dagster.core.storage.file_manager import local_file_manager
from dagster_aws.s3 import s3_file_manager
from hacker_news.ops.comment_stories import build_comment_stories
from hacker_news.ops.recommender_model import (
build_component_top_stories,
b... | [
"hacker_news.resources.fixed_s3_pickle_io_manager.fixed_s3_pickle_io_manager.configured",
"hacker_news.ops.user_top_recommended_stories.build_user_top_recommended_stories",
"hacker_news.ops.recommender_model.build_recommender_model",
"dagster.ModeDefinition",
"hacker_news.ops.recommender_model.model_perf_no... | [((718, 924), 'hacker_news.resources.snowflake_io_manager.snowflake_io_manager.configured', 'snowflake_io_manager.configured', (["{'account': {'env': 'SNOWFLAKE_ACCOUNT'}, 'user': {'env': 'SNOWFLAKE_USER'},\n 'password': {'env': '<PASSWORD>'}, 'database': 'DEMO_DB', 'warehouse':\n 'TINY_WAREHOUSE'}"], {}), "({'ac... |
# The code is based on original repository https://github.com/OctoberChang/klcpd_code
# !/usr/bin/env python
# encoding: utf-8
import math
import numpy as np
import random
import sklearn.metrics
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import torch.backends... | [
"math.sqrt",
"torch.sin",
"torch.cos",
"torch.bmm",
"torch.nn.functional.softmax",
"numpy.arange",
"torch.nn.GRU",
"torch.mean",
"numpy.concatenate",
"torch.autograd.Variable",
"sklearn.metrics.pairwise.euclidean_distances",
"numpy.triu_indices_from",
"torch.transpose",
"numpy.random.randn... | [((605, 649), 'sklearn.metrics.pairwise.euclidean_distances', 'euclidean_distances', (['X[:max_n]'], {'squared': '(True)'}), '(X[:max_n], squared=True)\n', (624, 649), False, 'from sklearn.metrics.pairwise import euclidean_distances\n'), ((9219, 9251), 'numpy.random.randn', 'np.random.randn', (['seq_length', 'dim'], {}... |
# Copyright (c) 2015-present, Facebook, Inc.
# All rights reserved.
# Modified from
# https://github.com/rwightman/pytorch-image-models/blob/master/timm/models/vision_transformer.py
# Copyright 2020 <NAME>, Apache-2.0 License
from timm.models.layers import activations
import torch
import itertools
import ut... | [
"torch.nn.Identity",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.init.constant_",
"torch.nn.Sequential",
"torch.LongTensor",
"utils.replace_batchnorm",
"torch.nn.Conv2d",
"torch.nn.UpsamplingBilinear2d",
"torch.nn.BatchNorm1d",
"timm.models.vision_transformer.trunc_normal_",
"torch.hub.... | [((1803, 1818), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (1816, 1818), False, 'import torch\n'), ((2844, 2859), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (2857, 2859), False, 'import torch\n'), ((3815, 3830), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (3828, 3830), False, 'import torch\n')... |
import re
class Lexer:
def parse(self, line):
words = re.split(r'(\s+)', line)
result = []
for word in words:
if word.startswith("/"):
result.append((word, "command"))
continue
if ":" in word:
ts = word.split(":")
... | [
"re.split"
] | [((68, 92), 're.split', 're.split', (['"""(\\\\s+)"""', 'line'], {}), "('(\\\\s+)', line)\n", (76, 92), False, 'import re\n')] |
import re
from data_extraction.scraper import Scraper
class DKSBScraper(Scraper):
"""Scrapes the website dksb.de."""
base_url = 'https://www.dksb.de'
debug = True
def parse(self, response, url):
"""Handles the soupified response of a detail page in the predefined way and returns it"""
... | [
"re.match"
] | [((1029, 1054), 're.match', 're.match', (['"""\\\\d{5} """', 'elem'], {}), "('\\\\d{5} ', elem)\n", (1037, 1054), False, 'import re\n')] |
from collections import defaultdict
def get_structure_to_unwind(target_zones) -> dict:
result_dict = defaultdict(list)
for zone in target_zones:
anchor_time = zone[0][0]
anchor_freq = zone[0][1]
for point in zone[1]:
result_dict[anchor_time].append((anchor_freq, point[1],... | [
"collections.defaultdict"
] | [((107, 124), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (118, 124), False, 'from collections import defaultdict\n')] |
import requests
from .abstracts import AbstractAuthenticator
class GraylogAuthenticator(AbstractAuthenticator):
def __init__(self, username: str, password: str):
self._auth = None
self.username = username
self.password = password
class GraylogBasicAuthenticator(GraylogAuthenticator):
... | [
"requests.auth.HTTPBasicAuth"
] | [((520, 577), 'requests.auth.HTTPBasicAuth', 'requests.auth.HTTPBasicAuth', (['self.username', 'self.password'], {}), '(self.username, self.password)\n', (547, 577), False, 'import requests\n')] |
"""
Image classifier based in InceptionV3 (keras implementation).
"""
from PIL import Image
from keras.preprocessing import image
import keras.applications.inception_v3 as inception_v3
import keras.backend
import tensorflow as tf
import numpy as np
import pprint
keras.backend.clear_session()
MODEL_INPUT_SIZE_DEFAULT ... | [
"keras.preprocessing.image.img_to_array",
"PIL.Image.open",
"keras.applications.inception_v3.preprocess_input",
"keras.applications.inception_v3.decode_predictions",
"numpy.expand_dims",
"keras.applications.inception_v3.InceptionV3",
"tensorflow.get_default_graph"
] | [((584, 625), 'keras.applications.inception_v3.InceptionV3', 'inception_v3.InceptionV3', ([], {'weights': 'weights'}), '(weights=weights)\n', (608, 625), True, 'import keras.applications.inception_v3 as inception_v3\n'), ((674, 696), 'tensorflow.get_default_graph', 'tf.get_default_graph', ([], {}), '()\n', (694, 696), ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 21 03:15:05 2020
@author: zqwu
"""
import numpy as np
import pandas as pd
import csv
import torch as t
import os
import pickle
import copy
import torch_geometric as tg
import tempfile
class MolDataset(tg.data.Dataset):
def __init__(self,
... | [
"os.path.exists",
"pickle.dump",
"torch.load",
"os.path.join",
"tempfile.mkdtemp",
"torch.save",
"os.path.abspath"
] | [((1156, 1177), 'os.path.abspath', 'os.path.abspath', (['root'], {}), '(root)\n', (1171, 1177), False, 'import os\n'), ((1986, 2035), 'os.path.join', 'os.path.join', (['self.root', "('%d.pt' % self.num_files)"], {}), "(self.root, '%d.pt' % self.num_files)\n", (1998, 2035), False, 'import os\n'), ((2231, 2261), 'os.path... |
from photons_protocol.packets import dictobj
from photons_protocol.messages import T
from delfick_project.norms import sb
from bitarray import bitarray
import binascii
emptybt = bitarray("0000000000000000000000000000000000000000000000000000000000000000")
target_cache = {}
def look_at_target(pkt, value):
if valu... | [
"photons_protocol.messages.T.Uint16.default",
"photons_protocol.packets.dictobj.__getitem__",
"binascii.hexlify",
"photons_protocol.messages.T.Uint16.S",
"photons_protocol.messages.T.Reserved",
"photons_protocol.messages.T.Bytes",
"bitarray.bitarray",
"photons_protocol.messages.T.Bool.default"
] | [((180, 256), 'bitarray.bitarray', 'bitarray', (['"""0000000000000000000000000000000000000000000000000000000000000000"""'], {}), "('0000000000000000000000000000000000000000000000000000000000000000')\n", (188, 256), False, 'from bitarray import bitarray\n'), ((3155, 3192), 'photons_protocol.packets.dictobj.__getitem__',... |
# -*- coding: utf-8 -*-
from django.utils.safestring import mark_safe
from ionyweb.plugin_app.plugin_video.viewers.base import BaseViewer
import re
class DailymotionViewer(BaseViewer):
@staticmethod
def is_competent_for_url(url):
"""
Return true for :
- http://www.dailymotion.com/... | [
"re.match",
"django.utils.safestring.mark_safe"
] | [((456, 558), 're.match', 're.match', (['"""^(http://)?(www\\\\.)?(dailymotion\\\\.com/video/)(?P<id_video>[a-zA-Z0-9]+).*$"""', 'url'], {}), "(\n '^(http://)?(www\\\\.)?(dailymotion\\\\.com/video/)(?P<id_video>[a-zA-Z0-9]+).*$'\n , url)\n", (464, 558), False, 'import re\n'), ((724, 956), 'django.utils.safestring... |
##############################################################################
#
# Copyright (c) 2003 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | [
"unittest.TestSuite",
"doctest.DocTestSuite",
"unittest.makeSuite",
"tempfile.mktemp",
"transaction.commit",
"unittest.main"
] | [((5139, 5159), 'unittest.TestSuite', 'unittest.TestSuite', ([], {}), '()\n', (5157, 5159), False, 'import unittest\n'), ((5426, 5465), 'unittest.main', 'unittest.main', ([], {'defaultTest': '"""test_suite"""'}), "(defaultTest='test_suite')\n", (5439, 5465), False, 'import unittest\n'), ((1837, 1854), 'tempfile.mktemp'... |
import io
import flatbuffers
from meillionen.interface.base import MethodRequestArg
from ..settings import Settings
from . import _MethodRequest as mr
from .resource import deserialize_resource_payload, Resource
from .base import FlatbufferMixin
class _MethodRequest(mr._MethodRequest, FlatbufferMixin):
ARGS_OFF... | [
"meillionen.interface.resource._Resource",
"flatbuffers.number_types.UOffsetTFlags.py_type",
"meillionen.interface.base.MethodRequestArg"
] | [((3771, 3877), 'meillionen.interface.base.MethodRequestArg', 'MethodRequestArg', ([], {'class_name': 'self.class_name', 'method_name': 'self.method_name', 'arg_name': 'self.kwargs[name]'}), '(class_name=self.class_name, method_name=self.method_name,\n arg_name=self.kwargs[name])\n', (3787, 3877), False, 'from meill... |
import imp
import sys, pygame
from pygame.locals import * # Needed for Key Constants
pygame.init() # Initializes Pygame
# Declarations
size = width, height = 640, 480 # Defines Windows Size
speed = [0, 0] # X and Y Speeds
black = 0, 0, 0 # Represents black colour as RGB
# Sets Windows Size
screen = pygame.display.set... | [
"pygame.mixer.music.play",
"pygame.init",
"sys.exit",
"pygame.event.get",
"pygame.display.set_mode",
"pygame.display.flip",
"pygame.mixer.music.set_volume",
"pygame.key.get_pressed",
"pygame.time.Clock",
"pygame.image.load",
"pygame.mixer.music.load",
"pygame.font.SysFont"
] | [((85, 98), 'pygame.init', 'pygame.init', ([], {}), '()\n', (96, 98), False, 'import sys, pygame\n'), ((302, 331), 'pygame.display.set_mode', 'pygame.display.set_mode', (['size'], {}), '(size)\n', (325, 331), False, 'import sys, pygame\n'), ((360, 379), 'pygame.time.Clock', 'pygame.time.Clock', ([], {}), '()\n', (377, ... |
import asyncio
import logging
import aiohttp.web
from aioredis.pubsub import Receiver
from grpc.experimental import aio as aiogrpc
import ray.gcs_utils
import ray.new_dashboard.modules.stats_collector.stats_collector_consts \
as stats_collector_consts
import ray.new_dashboard.utils as dashboard_utils
from ray.new... | [
"logging.getLogger",
"ray.core.generated.gcs_service_pb2_grpc.ActorInfoGcsServiceStub",
"ray.utils.binary_to_hex",
"grpc.experimental.aio.insecure_channel",
"ray.new_dashboard.datacenter.DataOrganizer.get_all_node_summary",
"ray.core.generated.gcs_service_pb2_grpc.JobInfoGcsServiceStub",
"aioredis.pubsu... | [((676, 703), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (693, 703), False, 'import logging\n'), ((797, 942), 'ray.new_dashboard.utils.message_to_dict', 'dashboard_utils.message_to_dict', (['message', "{'actorId', 'jobId', 'taskId', 'parentTaskId', 'sourceActorId', 'callerId',\n 'r... |
#! /usr/bin/env python
# -*- coding: iso-8859-15 -*-
##############################################################################
# Copyright 2003 & onward LASMEA UMR 6602 CNRS/Univ. Clermont II
# Copyright 2009 & onward LRI UMR 8623 CNRS/Univ Paris Sud XI
#
# Distributed under the Boost ... | [
"sys.path.pop",
"os.path.realpath",
"pprint.PrettyPrinter",
"nt2_tb_props.Nt2_tb_props.__init__"
] | [((1463, 1478), 'sys.path.pop', 'sys.path.pop', (['(0)'], {}), '(0)\n', (1475, 1478), False, 'import sys\n'), ((1479, 1494), 'sys.path.pop', 'sys.path.pop', (['(0)'], {}), '(0)\n', (1491, 1494), False, 'import sys\n'), ((1573, 1609), 'nt2_tb_props.Nt2_tb_props.__init__', 'Nt2_tb_props.__init__', (['self', 'tb_name'], {... |
from django.conf.urls import url
from . import views as rider_views
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
url(r'^home/(\d+)', rider_views.home, name='rider_home'),
url(r'^edit-profile/(\d+)', rider_views.edit_profile, name='edit_riderprofile'),
]
# confi... | [
"django.conf.urls.static.static",
"django.conf.urls.url"
] | [((166, 222), 'django.conf.urls.url', 'url', (['"""^home/(\\\\d+)"""', 'rider_views.home'], {'name': '"""rider_home"""'}), "('^home/(\\\\d+)', rider_views.home, name='rider_home')\n", (169, 222), False, 'from django.conf.urls import url\n'), ((228, 307), 'django.conf.urls.url', 'url', (['"""^edit-profile/(\\\\d+)"""', ... |
import json
import six
from girder import events
from girder.api import access
from girder.api.describe import autoDescribeRoute, Description
from girder.api.rest import ensureTokenScopes, filtermodel, Resource
from girder.constants import AccessType, TokenScope, SortDir
from girder.exceptions import ValidationExcepti... | [
"girder.api.access.user",
"six.viewitems",
"girder.plugins.worker.utils.girderInputSpec",
"girder.events.trigger",
"girder.models.token.Token",
"girder.api.describe.Description",
"girder.api.rest.ensureTokenScopes",
"girder.exceptions.ValidationException",
"girder.plugins.jobs.models.job.Job",
"gi... | [((2158, 2181), 'girder.api.rest.filtermodel', 'filtermodel', ([], {'model': 'Item'}), '(model=Item)\n', (2169, 2181), False, 'from girder.api.rest import ensureTokenScopes, filtermodel, Resource\n'), ((9680, 9733), 'girder.api.access.user', 'access.user', ([], {'scope': 'constants.TOKEN_SCOPE_EXECUTE_TASK'}), '(scope=... |
# !/usr/bin/env python
import os
import sys
import tensorflow as tf
import numpy as np
from dataset import Dataset
from tf.train import FLAGS
FLAGS.model_dir = '../model'
FLAGS.max_document_length = 15
def main(input_file, output_file):
print("\nPredicting...\n")
graph = tf.Graph()
with graph.as_default... | [
"tensorflow.Graph",
"dataset.Dataset",
"tensorflow.Session",
"tensorflow.logging.set_verbosity",
"os.path.join",
"tensorflow.train.import_meta_graph"
] | [((284, 294), 'tensorflow.Graph', 'tf.Graph', ([], {}), '()\n', (292, 294), True, 'import tensorflow as tf\n'), ((2711, 2752), 'tensorflow.logging.set_verbosity', 'tf.logging.set_verbosity', (['tf.logging.WARN'], {}), '(tf.logging.WARN)\n', (2735, 2752), True, 'import tensorflow as tf\n'), ((377, 389), 'tensorflow.Sess... |
#!/usr/bin/env python
"""
Repackage a USGS Collection-1 tar for faster read access.
They arrive as a *.tar.gz with inner uncompressed tiffs, which Josh's tests have found to be too slow to read.
We compress the inner tiffs and store them in an uncompressed tar. This allows random reads within the files.
We also appen... | [
"tarfile.open",
"io.BytesIO",
"click.File",
"sys.exit",
"copy.copy",
"click.UsageError",
"stat.S_ISDIR",
"click.IntRange",
"click.option",
"pathlib.Path",
"traceback.print_exception",
"rasterio.Env",
"structlog.processors.StackInfoRenderer",
"contextlib.suppress",
"structlog.processors.T... | [((1230, 1252), 'structlog.get_logger', 'structlog.get_logger', ([], {}), '()\n', (1250, 1252), False, 'import structlog\n'), ((11014, 11041), 'click.command', 'click.command', ([], {'help': '__doc__'}), '(help=__doc__)\n', (11027, 11041), False, 'import click\n'), ((11332, 11434), 'click.option', 'click.option', (['""... |
"""Remote runtime runs on Ostorlab cloud.
The remote runtime provides capabilities identical to local runtime with extra features, like data persistence,
improved data visualization, automated scaling for improved performance, agent improved data warehouse for improved
detection and several other improvements.
"""
fr... | [
"click.confirm",
"ostorlab.apis.vulnz_describe.ScanVulnzDescribeAPIRequest",
"ostorlab.apis.agent_details.AgentDetailsAPIRequest",
"ostorlab.cli.console.Console",
"ostorlab.apis.create_agent_scan.CreateAgentScanAPIRequest",
"ostorlab.configuration_manager.ConfigurationManager",
"markdownify.markdownify"... | [((1196, 1217), 'ostorlab.cli.console.Console', 'cli_console.Console', ([], {}), '()\n', (1215, 1217), True, 'from ostorlab.cli import console as cli_console\n'), ((11444, 11489), 'ostorlab.apis.runners.authenticated_runner.AuthenticatedAPIRunner', 'authenticated_runner.AuthenticatedAPIRunner', ([], {}), '()\n', (11487... |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
# author:jingtongyu
# datetime:2020/6/7 10:14 下午
# software: PyCharm
from sqlalchemy import inspect, orm
from datetime import datetime
from . import db
class BaseModel(db.Model):
"""
data base class
"""
__abstract__ = True
# status = Column(SmallInteger... | [
"sqlalchemy.inspect",
"datetime.datetime.fromtimestamp"
] | [((872, 912), 'datetime.datetime.fromtimestamp', 'datetime.fromtimestamp', (['self.create_time'], {}), '(self.create_time)\n', (894, 912), False, 'from datetime import datetime\n'), ((1759, 1782), 'sqlalchemy.inspect', 'inspect', (['self.__class__'], {}), '(self.__class__)\n', (1766, 1782), False, 'from sqlalchemy impo... |
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 6 19:33:27 2018
@author: yume
"""
import numpy as np
import matplotlib.pyplot as plt
def load_default_trajectory():
ps = np.array(([
[-0.77703479856881415, 1.4993181096841063],
[-0.70776038682731871, 1.4170221119724254],
[-0.6... | [
"numpy.array",
"matplotlib.pyplot.plot"
] | [((177, 2042), 'numpy.array', 'np.array', (['[[-0.7770347985688142, 1.4993181096841064], [-0.7077603868273187, \n 1.4170221119724253], [-0.6826069086588465, 1.4206095214452887], [-\n 0.6196133535044472, 1.396403374501471], [-0.5245297517540862, \n 1.3120215099603865], [-0.4105458100531159, 1.2300884769965503],... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import subprocess
from rpy.functions.encoding import force_bytes
def pbcopy(text):
p = subprocess.Popen(['pbcopy'], stdin=subprocess.PIPE)
p.stdin.write(force_bytes(text))
p.stdin.close()
retcode = p.wa... | [
"subprocess.Popen",
"rpy.functions.encoding.force_bytes"
] | [((193, 244), 'subprocess.Popen', 'subprocess.Popen', (["['pbcopy']"], {'stdin': 'subprocess.PIPE'}), "(['pbcopy'], stdin=subprocess.PIPE)\n", (209, 244), False, 'import subprocess\n'), ((263, 280), 'rpy.functions.encoding.force_bytes', 'force_bytes', (['text'], {}), '(text)\n', (274, 280), False, 'from rpy.functions.e... |
import sys
sys.path.append("..")
from audio.audio import record
record("voice.wav", 5)
| [
"audio.audio.record",
"sys.path.append"
] | [((11, 32), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (26, 32), False, 'import sys\n'), ((65, 87), 'audio.audio.record', 'record', (['"""voice.wav"""', '(5)'], {}), "('voice.wav', 5)\n", (71, 87), False, 'from audio.audio import record\n')] |
# SPDX-License-Identifier: Apache-2.0
#
# The OpenSearch Contributors require contributions made to
# this file be licensed under the Apache-2.0 license or a
# compatible open source license.
import os
import unittest
import yaml
from manifests.input_manifest import InputManifest
class TestInputManifest(unittest.T... | [
"yaml.safe_load",
"os.path.dirname",
"os.path.join",
"manifests.input_manifest.InputManifest.from_path"
] | [((551, 608), 'os.path.join', 'os.path.join', (['self.manifests_path', '"""opensearch-1.0.0.yml"""'], {}), "(self.manifests_path, 'opensearch-1.0.0.yml')\n", (563, 608), False, 'import os\n'), ((628, 657), 'manifests.input_manifest.InputManifest.from_path', 'InputManifest.from_path', (['path'], {}), '(path)\n', (651, 6... |
import pytest
from rlcard3.games.mocsar.card import Ertekek
from rlcard3.games.mocsar.dealer import MocsarDealer as Dealer
from rlcard3.games.mocsar.player import MocsarPlayer as Player
from rlcard3.games.mocsar.utils import str_to_card_list
def test_dealer_default():
"""
Test default constructor
"""
... | [
"pytest.mark.parametrize",
"rlcard3.games.mocsar.player.MocsarPlayer",
"rlcard3.games.mocsar.dealer.MocsarDealer",
"rlcard3.games.mocsar.utils.str_to_card_list"
] | [((614, 1366), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""nr_card, szov"""', "[(1, '[**]'), (2, '[**,**]'), (3, '[**,**,**]'), (4, '[♣A,♡A,♢A,♠A]'), (5,\n '[♣A,♡A,♢A,♠A,**]'), (9, '[♣A,♡A,♢A,♠A,♣2,♡2,♢2,♠2,**]'), (55,\n '[♣3,♡3,♢3,♠3,♣4,♡4,♢4,♠4,♣5,♡5,♢5,♠5,♣6,♡6,♢6,♠6,♣7,♡7,♢7,♠7,♣8,♡8,♢8,♠8,♣9,... |
#!/usr/bin/env python3
# encoding=utf-8
# Copyright: <NAME>(C) 2019
"""
加载配置文件
"""
import configparser
cf = configparser.ConfigParser()
cf.read("config.conf")
section = cf.sections() # a list
# print(section)
# print(cf.options('user'))
def getUserId():
return str(cf.get('user', 'userid'))
def getUserPassword():
... | [
"configparser.ConfigParser"
] | [((110, 137), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (135, 137), False, 'import configparser\n')] |
from typing import List
from collections import Counter
class Solution:
def minSetSize(self, arr: List[int]) -> int:
freq = Counter(arr)
freq = freq.most_common()
numRequired = len(arr) // 2
start = 0
while numRequired > 0:
numRequired -= freq[start][1]
... | [
"collections.Counter"
] | [((138, 150), 'collections.Counter', 'Counter', (['arr'], {}), '(arr)\n', (145, 150), False, 'from collections import Counter\n')] |
# Copyright (c) latataro (jchanxtarov). All rights reserved.
# Licensed under the MIT License.
from typing import List
import torch as th
from torch import nn
from torch.nn import functional as F
from torchvision import models
from torchvision.models.feature_extraction import create_feature_extractor
from utils.loade... | [
"torch.nn.Embedding",
"torch.mean",
"torch.Tensor",
"torchvision.models.alexnet",
"torchvision.models.feature_extraction.create_feature_extractor",
"torch.matmul",
"torch.sum",
"torch.nn.init.calculate_gain",
"torch.nn.functional.logsigmoid",
"torch.rand"
] | [((676, 723), 'torch.nn.Embedding', 'nn.Embedding', (['dataset.n_users', 'dim_embed_latent'], {}), '(dataset.n_users, dim_embed_latent)\n', (688, 723), False, 'from torch import nn\n'), ((869, 916), 'torch.nn.Embedding', 'nn.Embedding', (['dataset.n_items', 'dim_embed_latent'], {}), '(dataset.n_items, dim_embed_latent)... |
# vim: set encoding=utf-8
# Copyright (c) 2016 Intel Corporation
#
# 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 require... | [
"unittest.main"
] | [((7802, 7817), 'unittest.main', 'unittest.main', ([], {}), '()\n', (7815, 7817), False, 'import unittest\n')] |
from src.pytra import pytra
if __name__ == '__main__':
pytra()
| [
"src.pytra.pytra"
] | [((61, 68), 'src.pytra.pytra', 'pytra', ([], {}), '()\n', (66, 68), False, 'from src.pytra import pytra\n')] |
from boto3.dynamodb.conditions import Key, Attr
from api.util import get_today_string
def query():
"""input get upload status from DynamoDB"""
return dict(
IndexName="GSI-1-SK",
KeyConditionExpression=Key("indexKey").eq("Status"),
# FilterExpression=Attr("SK").begins_with("2021-12-16"... | [
"boto3.dynamodb.conditions.Attr",
"api.util.get_today_string",
"boto3.dynamodb.conditions.Key"
] | [((371, 389), 'api.util.get_today_string', 'get_today_string', ([], {}), '()\n', (387, 389), False, 'from api.util import get_today_string\n'), ((228, 243), 'boto3.dynamodb.conditions.Key', 'Key', (['"""indexKey"""'], {}), "('indexKey')\n", (231, 243), False, 'from boto3.dynamodb.conditions import Key, Attr\n'), ((348,... |
import io
import numpy as np
import pandas as pd
import cirq
def assert_json_roundtrip_works(obj, text_should_be=None, resolvers=None):
"""Tests that the given object can serialized and de-serialized
Args:
obj: The object to test round-tripping for.
text_should_be: An optional argument to as... | [
"numpy.testing.assert_equal",
"cirq.protocols.read_json",
"pandas.testing.assert_index_equal",
"pandas.testing.assert_frame_equal",
"io.StringIO",
"cirq.protocols.to_json"
] | [((585, 598), 'io.StringIO', 'io.StringIO', ([], {}), '()\n', (596, 598), False, 'import io\n'), ((603, 638), 'cirq.protocols.to_json', 'cirq.protocols.to_json', (['obj', 'buffer'], {}), '(obj, buffer)\n', (625, 638), False, 'import cirq\n'), ((810, 863), 'cirq.protocols.read_json', 'cirq.protocols.read_json', (['buffe... |
import argparse
import os
import numpy as np
import glob
from sklearn.linear_model import LogisticRegression
from sklearn.externals import joblib
#import joblib
from azureml.core import Run
from utils import load_data
# let user feed in 2 parameters, the dataset to mount or download, and the regularization rate of t... | [
"numpy.float",
"os.makedirs",
"numpy.average",
"argparse.ArgumentParser",
"os.path.join",
"azureml.core.Run.get_context",
"sklearn.linear_model.LogisticRegression",
"sklearn.externals.joblib.dump"
] | [((358, 383), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (381, 383), False, 'import argparse\n'), ((1459, 1476), 'azureml.core.Run.get_context', 'Run.get_context', ([], {}), '()\n', (1474, 1476), False, 'from azureml.core import Run\n'), ((1565, 1662), 'sklearn.linear_model.LogisticRegressi... |
import numpy as np
import random
import os
import sys
from subprocess import call
import nnabla as nn
import nnabla.logger as logger
import nnabla.functions as F
import nnabla.parametric_functions as PF
import nnabla.solver as S
import nnabla.initializer as I
from args import get_args
class LSTMWrapper(PF.LSTMCell, ... | [
"nnabla.monitor.MonitorSeries",
"nnabla.initializer.ConstantInitializer",
"numpy.array",
"os.path.exists",
"nnabla.get_parameters",
"numpy.exp",
"nnabla.functions.sum",
"nnabla.ext_utils.get_extension_context",
"nnabla.functions.dropout",
"subprocess.call",
"args.get_args",
"nnabla.parametric_... | [((1466, 1478), 'numpy.exp', 'np.exp', (['loss'], {}), '(loss)\n', (1472, 1478), True, 'import numpy as np\n'), ((3113, 3131), 'nnabla.functions.split', 'F.split', (['t'], {'axis': '(1)'}), '(t, axis=1)\n', (3120, 3131), True, 'import nnabla.functions as F\n'), ((3781, 3791), 'args.get_args', 'get_args', ([], {}), '()\... |
# Generated by Django 2.1.5 on 2019-02-05 12:50
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("events", "0001_squashed_0007_auto_20190110_1749"),
]
operations = [
migrations.RemoveField(
model_name="event",
name="public... | [
"django.db.migrations.RemoveField"
] | [((240, 307), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""event"""', 'name': '"""publication_date"""'}), "(model_name='event', name='publication_date')\n", (262, 307), False, 'from django.db import migrations\n'), ((352, 412), 'django.db.migrations.RemoveField', 'migrations.Rem... |