code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
# encoding: utf-8
from __future__ import print_function
import os
import json
from collections import OrderedDict
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib.ticker import Formatter
from jaqs.trade.analyze.report import Report
from jaqs.data import ... | [
"numpy.sqrt",
"numpy.logical_not",
"numpy.array",
"jaqs.data.basic.instrument.InstManager",
"pandas.to_datetime",
"numpy.arange",
"jaqs.util.group_df_to_dict",
"jaqs.trade.analyze.report.Report",
"numpy.zeros_like",
"numpy.max",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots",
"jaqs.... | [((462, 510), 'jaqs.util.join_relative_path', 'jutil.join_relative_path', (['"""trade/analyze/static"""'], {}), "('trade/analyze/static')\n", (486, 510), True, 'import jaqs.util as jutil\n'), ((31059, 31071), 'numpy.arange', 'np.arange', (['n'], {}), '(n)\n', (31068, 31071), True, 'import numpy as np\n'), ((31104, 3115... |
import io
import sys
import unittest
import asyncio
import random
from contextlib import redirect_stdout
from .utils import *
from queuebot import QueueBot, QueueConfig, DiscordUser
config = {
"SECRET_TOKEN": "<PASSWORD>",
"TA_ROLES": ["UGTA"],
"LISTEN_CHANNELS": ["join-queue"],
"CHECK_VOICE_WAITING":... | [
"queuebot.QueueBot",
"queuebot.QueueConfig",
"contextlib.redirect_stdout",
"random.seed",
"unittest.main",
"io.StringIO"
] | [((543, 578), 'queuebot.QueueConfig', 'QueueConfig', (['config'], {'test_mode': '(True)'}), '(config, test_mode=True)\n', (554, 578), False, 'from queuebot import QueueBot, QueueConfig, DiscordUser\n'), ((7358, 7373), 'unittest.main', 'unittest.main', ([], {}), '()\n', (7371, 7373), False, 'import unittest\n'), ((676, ... |
# Copyright 2019 Huawei Technologies Co., Ltd
#
# 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... | [
"tests.common.gen_random.random_gaussian",
"akg.utils.kernel_exec.mod_launch",
"numpy.zeros",
"numpy.full",
"akg.utils.kernel_exec.op_build_test",
"tests.common.tensorio.compare_tensor"
] | [((1566, 1602), 'numpy.full', 'np.full', (['output_shape', 'np.nan', 'dtype'], {}), '(output_shape, np.nan, dtype)\n', (1573, 1602), True, 'import numpy as np\n'), ((1616, 1673), 'akg.utils.kernel_exec.mod_launch', 'utils.mod_launch', (['mod', '(input, output)'], {'expect': 'bench_mark'}), '(mod, (input, output), expec... |
from transformer import *
from logger import logger
def find_missing():
from db import paients_source, paients_info
import re
for pi in paients_info.find():
if paients_source.find({'_id': re.compile(pi['住院号'], re.IGNORECASE)}).count()>0:
pass
else:
print(pi['住院号'])
... | [
"datetime.datetime.now",
"db.paients_info.find",
"re.compile",
"logger.logger.error"
] | [((149, 168), 'db.paients_info.find', 'paients_info.find', ([], {}), '()\n', (166, 168), False, 'from db import paients_source, paients_info\n'), ((1670, 1684), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (1682, 1684), False, 'from datetime import datetime\n'), ((649, 698), 'logger.logger.error', 'logger... |
#!/usr/bin/env python
import os
import re
import subprocess
import sys
# version -> classifier
# '' means default classifier
cuda_vers = {
'11.2': ['cuda11', '']
}
def check_classifier(classifier):
'''
Check the mapping from cuda version to jar classifier.
Used by maven build.
'''
cu_ver = detec... | [
"subprocess.check_output"
] | [((1045, 1098), 'subprocess.check_output', 'subprocess.check_output', (['"""nvcc --version"""'], {'shell': '(True)'}), "('nvcc --version', shell=True)\n", (1068, 1098), False, 'import subprocess\n')] |
# Generated by Django 3.0.2 on 2020-03-29 19:11
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('hitchhikeapp', '0010_userdata_userid'),
]
operations = [
migrations.DeleteModel(
name='Dog',
),
]
| [
"django.db.migrations.DeleteModel"
] | [((229, 263), 'django.db.migrations.DeleteModel', 'migrations.DeleteModel', ([], {'name': '"""Dog"""'}), "(name='Dog')\n", (251, 263), False, 'from django.db import migrations\n')] |
#!/usr/bin/env python3
import logging
import torch.nn as nn
from fairseq import checkpoint_utils
from fairseq.models import BaseFairseqModel, register_model
from pytorch_translate import rnn
from pytorch_translate.rnn import (
LSTMSequenceEncoder,
RNNDecoder,
RNNEncoder,
RNNModel,
base_architectur... | [
"logging.getLogger",
"pytorch_translate.tasks.pytorch_translate_task.PytorchTranslateTask",
"pytorch_translate.rnn.RNNModel.add_args",
"pytorch_translate.rnn.RNNModel",
"fairseq.models.register_model",
"fairseq.checkpoint_utils.load_checkpoint_to_cpu",
"pytorch_translate.rnn.base_architecture",
"pytor... | [((416, 443), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (433, 443), False, 'import logging\n'), ((447, 478), 'fairseq.models.register_model', 'register_model', (['"""dual_learning"""'], {}), "('dual_learning')\n", (461, 478), False, 'from fairseq.models import BaseFairseqModel, regis... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2022.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | [
"qiskit_nature.properties.second_quantization.electronic.ElectronicStructureDriverResult.from_legacy_driver_result",
"pathlib.Path",
"qiskit_nature.drivers.second_quantization.HDF5Driver",
"warnings.catch_warnings",
"qiskit_nature.drivers.QMolecule",
"warnings.simplefilter",
"os.unlink",
"shutil.copy"... | [((4436, 4451), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4449, 4451), False, 'import unittest\n'), ((4118, 4138), 'qiskit_nature.drivers.QMolecule', 'QMolecule', (['hdf5_file'], {}), '(hdf5_file)\n', (4127, 4138), False, 'from qiskit_nature.drivers import QMolecule\n'), ((4171, 4233), 'warnings.filterwarnin... |
from openpyxl import Workbook
wb = Workbook()
ws = wb.active
data = [
["Fruit", "Quantity"],
["Kiwi", 3],
["Grape", 15],
["Apple", 3],
["Peach", 3],
["Pomegranate", 3],
["Pear", 3],
["Tangerine", 3],
["Blueberry", 3],
["Mango", 3],
["Watermelon", 3],
["Blackberry", 3],
... | [
"openpyxl.Workbook"
] | [((36, 46), 'openpyxl.Workbook', 'Workbook', ([], {}), '()\n', (44, 46), False, 'from openpyxl import Workbook\n')] |
from bleak import BleakClient
import asyncio
import functools
notify_uuid = "00002a19-0000-1000-8000-00805f9b34fb".format(0x2A19)
def callback(sender, data, mac_address):
#data = bytearray(data)
dataint = int.from_bytes(data, byteorder='little', signed=True)
print(mac_address, dataint)
def run(addresses... | [
"asyncio.get_event_loop",
"functools.partial",
"asyncio.sleep",
"bleak.BleakClient"
] | [((334, 358), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (356, 358), False, 'import asyncio\n'), ((573, 607), 'bleak.BleakClient', 'BleakClient', (['address'], {'timeout': '(10.0)'}), '(address, timeout=10.0)\n', (584, 607), False, 'from bleak import BleakClient\n'), ((855, 876), 'asyncio.sle... |
#!/usr/bin/python
'''*****************************************************************************************************************
Seeed Studio Relay Board Library V2
Test Application #2
By <NAME> (https://www.johnwargo.com)
*******************************************************************************... | [
"sys.exit",
"time.sleep",
"seeed_relay_v1.Relay"
] | [((545, 558), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (555, 558), False, 'import time\n'), ((665, 678), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (675, 678), False, 'import time\n'), ((1480, 1487), 'seeed_relay_v1.Relay', 'Relay', ([], {}), '()\n', (1485, 1487), False, 'from seeed_relay_v1 import ... |
import requests
keyword = "python"
try:
kv = {'q':keyword}
r = requests.get('http://www.so.com/s', params=kv)
print(r.request.url)
r.raise_for_status()
print(len(r.text))
except:
print('爬取失败') | [
"requests.get"
] | [((72, 118), 'requests.get', 'requests.get', (['"""http://www.so.com/s"""'], {'params': 'kv'}), "('http://www.so.com/s', params=kv)\n", (84, 118), False, 'import requests\n')] |
import torch.nn as nn
class RODEncode(nn.Module):
def __init__(self, in_channels=2):
super(RODEncode, self).__init__()
self.conv1a = nn.Conv3d(
in_channels=in_channels,
out_channels=64,
kernel_size=(9, 5, 5),
stride=(1, 1, 1),
padding=(4,... | [
"torch.nn.Sigmoid",
"torch.nn.ReLU",
"torch.nn.Conv3d",
"torch.nn.PReLU",
"torch.nn.BatchNorm3d",
"torch.nn.ConvTranspose3d"
] | [((155, 270), 'torch.nn.Conv3d', 'nn.Conv3d', ([], {'in_channels': 'in_channels', 'out_channels': '(64)', 'kernel_size': '(9, 5, 5)', 'stride': '(1, 1, 1)', 'padding': '(4, 2, 2)'}), '(in_channels=in_channels, out_channels=64, kernel_size=(9, 5, 5),\n stride=(1, 1, 1), padding=(4, 2, 2))\n', (164, 270), True, 'impor... |
from django.contrib import admin
from .models import File
admin.site.register(File)
| [
"django.contrib.admin.site.register"
] | [((59, 84), 'django.contrib.admin.site.register', 'admin.site.register', (['File'], {}), '(File)\n', (78, 84), False, 'from django.contrib import admin\n')] |
# LSTM with Variable Length Input Sequences to One Character Output
import numpy
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM
from keras.utils import np_utils
from keras.preprocessing.sequence import pad_sequences
from theano.tensor.shared_randomstreams import ... | [
"numpy.reshape",
"numpy.argmax",
"keras.models.Sequential",
"keras.layers.LSTM",
"keras.utils.np_utils.to_categorical",
"numpy.random.seed",
"keras.layers.Dense",
"keras.preprocessing.sequence.pad_sequences"
] | [((374, 394), 'numpy.random.seed', 'numpy.random.seed', (['(7)'], {}), '(7)\n', (391, 394), False, 'import numpy\n'), ((1226, 1279), 'keras.preprocessing.sequence.pad_sequences', 'pad_sequences', (['dataX'], {'maxlen': 'max_len', 'dtype': '"""float32"""'}), "(dataX, maxlen=max_len, dtype='float32')\n", (1239, 1279), Fa... |
"""
Direction prediction based on learning dataset from reactome
PPI direction calculated from domain interaction directions
"""
# Imports
import sqlite3, csv, os
import pandas as pd
import logging
import pickle
# # Initiating logger
# logger = logging.getLogger()
# handler = logging.FileHandler('../../workflow/SLK3.l... | [
"logging.basicConfig",
"logging.debug",
"sqlite3.connect",
"os.path.isfile",
"pandas.DataFrame"
] | [((1036, 1076), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG'}), '(level=logging.DEBUG)\n', (1055, 1076), False, 'import logging\n'), ((1412, 1444), 'os.path.isfile', 'os.path.isfile', (['self.PICKLE_FILE'], {}), '(self.PICKLE_FILE)\n', (1426, 1444), False, 'import sqlite3, csv, os\n'), (... |
import json
import os.path
import sys
from exceptions import *
from create_folder_structure import create_folder_structure
def main():
try:
if len(sys.argv) != 3:
raise InvalidArgumentCount
if not os.path.exists(sys.argv[2]):
raise InvalidFilePath
if not os.path.exi... | [
"create_folder_structure.create_folder_structure"
] | [((547, 598), 'create_folder_structure.create_folder_structure', 'create_folder_structure', (['output_folder', 'json_object'], {}), '(output_folder, json_object)\n', (570, 598), False, 'from create_folder_structure import create_folder_structure\n')] |
from flask import request
from google.auth.transport import requests
import google.oauth2.id_token
from server.ApplikationsAdministration import ApplikationsAdministration
#Benutzer.py, BenutzerMapper + BenutzerMethoden in ApplikationsAdministration
def secured(function):
"""Decorator zur Google Firebase-basiert... | [
"flask.request.cookies.get",
"server.ApplikationsAdministration.ApplikationsAdministration",
"google.auth.transport.requests.Request"
] | [((1086, 1104), 'google.auth.transport.requests.Request', 'requests.Request', ([], {}), '()\n', (1102, 1104), False, 'from google.auth.transport import requests\n'), ((1191, 1219), 'flask.request.cookies.get', 'request.cookies.get', (['"""token"""'], {}), "('token')\n", (1210, 1219), False, 'from flask import request\n... |
import FWCore.ParameterSet.Config as cms
from RecoEgamma.ElectronIdentification.Identification.mvaElectronID_tools import *
# Documentation of the MVA
# https://twiki.cern.ch/twiki/bin/viewauth/CMS/MultivariateElectronIdentificationRun2
# https://rembserj.web.cern.ch/rembserj/notes/Electron_MVA_ID_2017_documentation
... | [
"FWCore.ParameterSet.Config.vstring",
"FWCore.ParameterSet.Config.int32",
"FWCore.ParameterSet.Config.untracked.bool",
"FWCore.ParameterSet.Config.string"
] | [((1339, 1964), 'FWCore.ParameterSet.Config.vstring', 'cms.vstring', (['"""RecoEgamma/ElectronIdentification/data/Fall17/EIDmva_EB1_5_2017_puinfo_BDT.weights.xml.gz"""', '"""RecoEgamma/ElectronIdentification/data/Fall17/EIDmva_EB2_5_2017_puinfo_BDT.weights.xml.gz"""', '"""RecoEgamma/ElectronIdentification/data/Fall17/E... |
from typing import Union, List
import pexpect
from figcli.utils.utils import Utils
import sys
class FiggyAction:
"""
Actions prevent cyclic dependencies, and are designed for leveraging FiggyCli for cleanup steps when running inside
of tests.
"""
def __init__(self, command, extra_args=""):
... | [
"pexpect.spawn",
"figcli.utils.utils.Utils.default_colors"
] | [((333, 355), 'figcli.utils.utils.Utils.default_colors', 'Utils.default_colors', ([], {}), '()\n', (353, 355), False, 'from figcli.utils.utils import Utils\n'), ((679, 731), 'pexpect.spawn', 'pexpect.spawn', (['command'], {'timeout': '(10)', 'encoding': '"""utf-8"""'}), "(command, timeout=10, encoding='utf-8')\n", (692... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: <NAME>.
@mail: <EMAIL>
"""
# from qc.__version__ import __version__
import georinex as gr
import numpy as np
from matplotlib.pyplot import figure, show
import matplotlib.pyplot as plt
obs = gr.load(
'tests/test_data/Rinex3/KLSQ00GRL_R_20213070000_01D_1... | [
"numpy.abs",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"georinex.load",
"matplotlib.pyplot.axhline",
"matplotlib.pyplot.figure",
"numpy.std",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show"
] | [((254, 377), 'georinex.load', 'gr.load', (['"""tests/test_data/Rinex3/KLSQ00GRL_R_20213070000_01D_15S_MO.rnx"""'], {'tlim': "['2021-11-03T05:30', '2021-11-03T07:30']"}), "('tests/test_data/Rinex3/KLSQ00GRL_R_20213070000_01D_15S_MO.rnx',\n tlim=['2021-11-03T05:30', '2021-11-03T07:30'])\n", (261, 377), True, 'import ... |
from collections import OrderedDict
from datetime import datetime, timezone
import unittest
from os.path import join
from tinydb import TinyDB, storages
from goldfinchsong import utils
IMAGE_NAMES = ['goldfinch1.jpg', 'goldfinch2.jpg', 'goldfinch3.jpg',
'goldfinch4.jpg', 'goldfinch5.jpg']
TEST_TEXT1 = ... | [
"collections.OrderedDict",
"tinydb.TinyDB",
"goldfinchsong.utils.apply_abbreviations",
"goldfinchsong.utils.is_image_file",
"goldfinchsong.utils.to_compact_text",
"goldfinchsong.utils.load_content",
"goldfinchsong.utils.chop_words",
"goldfinchsong.utils.extract_status_text",
"goldfinchsong.utils.tri... | [((821, 859), 'tinydb.TinyDB', 'TinyDB', ([], {'storage': 'storages.MemoryStorage'}), '(storage=storages.MemoryStorage)\n', (827, 859), False, 'from tinydb import TinyDB, storages\n'), ((878, 917), 'goldfinchsong.utils.load_content', 'utils.load_content', (['db', 'image_directory'], {}), '(db, image_directory)\n', (896... |
# Lint as: python3
# Copyright 2018 The TensorFlow 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 ... | [
"lingvo.compat.random.uniform",
"lingvo.compat.image.per_image_standardization",
"lingvo.compat.cast",
"lingvo.compat.ones",
"os.path.join",
"lingvo.compat.unstack",
"lingvo.compat.Session",
"lingvo.compat.random.set_seed",
"lingvo.compat.Graph"
] | [((1958, 2018), 'lingvo.compat.random.uniform', 'tf.random.uniform', (['(batch_size, 28, 28, 1)', '(0)', '(255)', 'tf.int32'], {}), '((batch_size, 28, 28, 1), 0, 255, tf.int32)\n', (1975, 2018), True, 'import lingvo.compat as tf\n'), ((2028, 2053), 'lingvo.compat.cast', 'tf.cast', (['images', 'tf.uint8'], {}), '(images... |
from src.base.solution import Solution
from src.tests.part1.q389_test_find_diff import FindDiffTestCases
class FindDiff(Solution):
def verify_output(self, test_output, output):
return test_output[0] == output[0]
def run_test(self, input):
return self.findTheDifference(input[0], input[1])
... | [
"src.tests.part1.q389_test_find_diff.FindDiffTestCases"
] | [((361, 380), 'src.tests.part1.q389_test_find_diff.FindDiffTestCases', 'FindDiffTestCases', ([], {}), '()\n', (378, 380), False, 'from src.tests.part1.q389_test_find_diff import FindDiffTestCases\n')] |
import contextlib
import os
import tempfile
import warnings
from enum import Enum
import mip
class IISFinderAlgorithm(Enum):
DELETION_FILTER = 1
ADDITIVE_ALGORITHM = 2
class SubRelaxationInfeasible(Exception):
pass
class NonRelaxableModel(Exception):
pass
class ConflictFinder:
"""This class... | [
"os.dup2",
"os.close",
"os.dup",
"mip.VarList",
"warnings.warn",
"tempfile.TemporaryFile",
"contextlib.nullcontext",
"mip.ConstrList",
"mip.Model"
] | [((3533, 3544), 'mip.Model', 'mip.Model', ([], {}), '()\n', (3542, 3544), False, 'import mip\n'), ((4305, 4344), 'mip.ConstrList', 'mip.ConstrList', ([], {'model': 'aux_model_testing'}), '(model=aux_model_testing)\n', (4319, 4344), False, 'import mip\n'), ((4364, 4399), 'mip.ConstrList', 'mip.ConstrList', ([], {'model'... |
import re
import xlsxwriter
def parse_menu_to_excel(filename,menu_dict,days_dict,results,goal_dict,food_database,reversed_ingredient_dict,grocery_dict):
# making a temporary dict to map dates and columns in excel:
temp_dates_dict = {}
i=0
for key in days_dict.keys():
temp_dates_dict[day... | [
"xlsxwriter.Workbook"
] | [((1222, 1251), 'xlsxwriter.Workbook', 'xlsxwriter.Workbook', (['filename'], {}), '(filename)\n', (1241, 1251), False, 'import xlsxwriter\n')] |
from channels import Group
# websocket.connect
def ws_add(message):
Group("chat").add(message.reply_channel)
# websocket.receive
def ws_message(message):
Group("chat").send({
"text": message.content['text'],
})
# websocket.disconnect
def ws_disconnect(message):
Group("chat").discard(message.r... | [
"channels.Group"
] | [((73, 86), 'channels.Group', 'Group', (['"""chat"""'], {}), "('chat')\n", (78, 86), False, 'from channels import Group\n'), ((164, 177), 'channels.Group', 'Group', (['"""chat"""'], {}), "('chat')\n", (169, 177), False, 'from channels import Group\n'), ((289, 302), 'channels.Group', 'Group', (['"""chat"""'], {}), "('ch... |
from copy import deepcopy
import numpy as np
import pybullet as p
import gym
from gym import spaces
from env.robot import Manipulator
from env.work import Work
class Env():
def __init__(self, reward,
step_max_pos = 0.002,
step_max_orn = 0.02,
initial_pos_noise = 0.0... | [
"env.work.Work",
"pybullet.resetSimulation",
"copy.deepcopy",
"pybullet.connect",
"numpy.linalg.norm",
"pybullet.setGravity",
"gym.spaces.Box",
"numpy.array",
"pybullet.setPhysicsEngineParameter",
"pybullet.configureDebugVisualizer",
"numpy.zeros",
"pybullet.disconnect",
"numpy.concatenate",... | [((458, 474), 'pybullet.connect', 'p.connect', (['p.GUI'], {}), '(p.GUI)\n', (467, 474), True, 'import pybullet as p\n'), ((483, 531), 'pybullet.setPhysicsEngineParameter', 'p.setPhysicsEngineParameter', ([], {'enableFileCaching': '(0)'}), '(enableFileCaching=0)\n', (510, 531), True, 'import pybullet as p\n'), ((540, 5... |
import _thread
import time
import threading
#
# def print_time(threadName,delay):
# count = 0;
# while count < 5:
# time.sleep(delay)
# count += 1;
# print("%s: %s" % (threadName, time.ctime(time.time())))
#
# try:
# _thread.start_new(print_time,("Thread-1",2,))
# _thread.start_n... | [
"threading.Thread.__init__",
"time.time",
"time.sleep"
] | [((1161, 1192), 'threading.Thread.__init__', 'threading.Thread.__init__', (['self'], {}), '(self)\n', (1186, 1192), False, 'import threading\n'), ((1547, 1564), 'time.sleep', 'time.sleep', (['delay'], {}), '(delay)\n', (1557, 1564), False, 'import time\n'), ((1614, 1625), 'time.time', 'time.time', ([], {}), '()\n', (16... |
import requests
from bbdata.config import output_api_url
from bbdata.util import handle_response
class Objects:
base_path = "/objects"
auth = None
def __init__(self, auth):
self.auth = auth
def get_all(self, tags=None, search=None, page=None, per_page=None,
writable=False):
... | [
"requests.post",
"bbdata.util.handle_response",
"requests.get",
"requests.delete",
"requests.put"
] | [((696, 748), 'requests.get', 'requests.get', (['url', 'params'], {'headers': 'self.auth.headers'}), '(url, params, headers=self.auth.headers)\n', (708, 748), False, 'import requests\n'), ((1211, 1266), 'requests.put', 'requests.put', (['url'], {'json': 'json', 'headers': 'self.auth.headers'}), '(url, json=json, header... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.11 on 2016-11-15 07:06
from __future__ import unicode_literals
import django.contrib.postgres.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('resolwe_bio_kb', '0001_initial'),
]
operation... | [
"django.db.models.CharField"
] | [((679, 712), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(1024)'}), '(max_length=1024)\n', (695, 712), False, 'from django.db import migrations, models\n'), ((837, 1139), 'django.db.models.CharField', 'models.CharField', ([], {'choices': "[(b'protein-coding', b'Protein-coding'), (b'pseudo', ... |
import pytest
from click.testing import CliRunner
from secedgar.cli import daily, filing
from secedgar.utils.exceptions import FilingTypeError
def run_cli_command(cli, user_input, directory, catch_exceptions=False):
runner = CliRunner()
user_input = user_input + " --directory {}".format(directory)
return ... | [
"pytest.mark.parametrize",
"pytest.raises",
"click.testing.CliRunner"
] | [((231, 242), 'click.testing.CliRunner', 'CliRunner', ([], {}), '()\n', (240, 242), False, 'from click.testing import CliRunner\n'), ((792, 1031), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""user_input,expected_exception"""', "[('-l aapl msft Facebook', SystemExit), ('-l aapl -t null', FilingTypeError\n... |
import os
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import gridspec
nstep=200
nx=400
nv=3
u=np.zeros((nx,nv))
prim=np.zeros((nx,nv))
gam=5./3.
dx=1./nx
dt=1e-3
time=0
x=np.linspace(0,1,num=nx)
def ptou(pri):
u=np.zeros((nx,nv))
rho=pri[:,0]
v=pri[:,1]
prs=pri[:,2]
mom=rho*v
... | [
"numpy.sqrt",
"numpy.roll",
"matplotlib.pyplot.close",
"numpy.zeros",
"numpy.linspace",
"matplotlib.pyplot.figure",
"matplotlib.gridspec.GridSpec"
] | [((118, 136), 'numpy.zeros', 'np.zeros', (['(nx, nv)'], {}), '((nx, nv))\n', (126, 136), True, 'import numpy as np\n'), ((141, 159), 'numpy.zeros', 'np.zeros', (['(nx, nv)'], {}), '((nx, nv))\n', (149, 159), True, 'import numpy as np\n'), ((195, 220), 'numpy.linspace', 'np.linspace', (['(0)', '(1)'], {'num': 'nx'}), '(... |
import unittest
from pluralizer import Pluralizer
import re
# Standard singular/plural matches.
#
# @type {Array}
BASIC_TESTS = [
# Uncountables.
['firmware', 'firmware'],
['fish', 'fish'],
['media', 'media'],
['moose', 'moose'],
['police', 'police'],
['sheep', 'sheep'],
['series', 's... | [
"unittest.main",
"re.compile",
"pluralizer.Pluralizer"
] | [((22163, 22178), 'unittest.main', 'unittest.main', ([], {}), '()\n', (22176, 22178), False, 'import unittest\n'), ((18576, 18588), 'pluralizer.Pluralizer', 'Pluralizer', ([], {}), '()\n', (18586, 18588), False, 'from pluralizer import Pluralizer\n'), ((18766, 18778), 'pluralizer.Pluralizer', 'Pluralizer', ([], {}), '(... |
# Copyright (c) 2017 LINE Corporation
# These sources are released under the terms of the MIT license: see LICENSE
import requests.sessions
from django.db.models import F
from promgen.version import __version__
from django.conf import settings
# Wrappers around request api to ensure we always attach our user agent
#... | [
"django.db.models.F"
] | [((1947, 1953), 'django.db.models.F', 'F', (['key'], {}), '(key)\n', (1948, 1953), False, 'from django.db.models import F\n')] |
import time
import kubernetes
import pytest
from dagster_k8s.client import DagsterK8sError, WaitForPodState
from dagster_k8s.utils import retrieve_pod_logs, wait_for_job_success, wait_for_pod
from dagster_k8s_test_infra.helm import get_helm_test_namespace
def construct_pod_spec(name, cmd):
return kubernetes.clie... | [
"kubernetes.client.BatchV1Api",
"kubernetes.client.V1ObjectMeta",
"kubernetes.client.CoreV1Api",
"time.sleep",
"dagster_k8s_test_infra.helm.get_helm_test_namespace",
"pytest.raises",
"dagster_k8s.utils.wait_for_job_success",
"dagster_k8s.utils.wait_for_pod",
"kubernetes.client.V1Container",
"dagst... | [((1112, 1141), 'kubernetes.client.CoreV1Api', 'kubernetes.client.CoreV1Api', ([], {}), '()\n', (1139, 1141), False, 'import kubernetes\n'), ((1152, 1177), 'dagster_k8s_test_infra.helm.get_helm_test_namespace', 'get_helm_test_namespace', ([], {}), '()\n', (1175, 1177), False, 'from dagster_k8s_test_infra.helm import ge... |
# Generated by Django 3.1.6 on 2021-02-15 08:52
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Service',
fields=[
... | [
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.IntegerField",
"django.db.models.AutoField",
"django.db.models.CharField"
] | [((336, 429), '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", (352, 429), False, 'from django.db import migrations, models\... |
from celery import Celery
from clients.dobie_client import send_data_to_dobie
app = Celery('qualichain_mediator')
app.config_from_object('settings', namespace='CELERY_')
@app.task()
def consume_messages_async(message):
"""
This task is used to received job posting text and feed DOBIE component
"""
e... | [
"clients.dobie_client.send_data_to_dobie",
"celery.Celery"
] | [((86, 115), 'celery.Celery', 'Celery', (['"""qualichain_mediator"""'], {}), "('qualichain_mediator')\n", (92, 115), False, 'from celery import Celery\n'), ((338, 365), 'clients.dobie_client.send_data_to_dobie', 'send_data_to_dobie', (['message'], {}), '(message)\n', (356, 365), False, 'from clients.dobie_client import... |
import json, math
from ingest import ingest_json_body
from housepy import config, log, strings, util
def parse(request):
log.info("ambit_geo.parse")
sample = ingest_json_body(request)
if sample is None:
return sample, "Could not parse"
data = {}
for key, value in sample.items():
if... | [
"housepy.log.info",
"housepy.util.timestamp",
"housepy.util.parse_date",
"housepy.log.debug",
"housepy.log.error",
"housepy.strings.as_numeric",
"ingest.ingest_json_body"
] | [((126, 153), 'housepy.log.info', 'log.info', (['"""ambit_geo.parse"""'], {}), "('ambit_geo.parse')\n", (134, 153), False, 'from housepy import config, log, strings, util\n'), ((167, 192), 'ingest.ingest_json_body', 'ingest_json_body', (['request'], {}), '(request)\n', (183, 192), False, 'from ingest import ingest_json... |
#!/usr/bin/env python
'''update gandi DNS domain entry, with LiveDNS v5
Cf. https://doc.livedns.gandi.net/#work-with-domains
'''
import argparse
import ipaddress
import json
import os
from subprocess import check_output
import requests
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('-v', '... | [
"subprocess.check_output",
"argparse.ArgumentParser",
"json.dumps",
"requests.get",
"ipaddress.ip_address"
] | [((248, 292), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '__doc__'}), '(description=__doc__)\n', (271, 292), False, 'import argparse\n'), ((758, 787), 'ipaddress.ip_address', 'ipaddress.ip_address', (['args.ip'], {}), '(args.ip)\n', (778, 787), False, 'import ipaddress\n'), ((961, 1075),... |
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
from collections import deque
from collections import defaultdict
class Solution(object):
def verticalOrder(self, ... | [
"collections.deque",
"collections.defaultdict"
] | [((471, 489), 'collections.deque', 'deque', (['[(root, 0)]'], {}), '([(root, 0)])\n', (476, 489), False, 'from collections import deque\n'), ((516, 533), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (527, 533), False, 'from collections import defaultdict\n'), ((1434, 1451), 'collections.default... |
import colorsys
import cv2
from PIL import Image
import pkg_resources
from .LivescoreBase import LivescoreBase
from .details import Alliance, OngoingMatchDetails
class LivescoreCommon(LivescoreBase):
def __init__(self, game_year, **kwargs):
super(LivescoreCommon, self).__init__(game_year, **kwargs)
... | [
"cv2.circle",
"cv2.waitKey",
"cv2.imshow"
] | [((3319, 3375), 'cv2.circle', 'cv2.circle', (['debug_img', 'review_point1', '(2)', '(0, 255, 0)', '(-1)'], {}), '(debug_img, review_point1, 2, (0, 255, 0), -1)\n', (3329, 3375), False, 'import cv2\n'), ((3388, 3444), 'cv2.circle', 'cv2.circle', (['debug_img', 'review_point2', '(2)', '(0, 255, 0)', '(-1)'], {}), '(debug... |
"""Test API utilities."""
import json
from pytradfri.api.libcoap_api import APIFactory
from pytradfri.gateway import Gateway
def test_constructor_timeout_passed_to_subprocess(monkeypatch):
"""Test that original timeout is passed to subprocess."""
capture = {}
def capture_args(*args, **kwargs):
c... | [
"json.dumps",
"pytradfri.api.libcoap_api.APIFactory",
"pytradfri.gateway.Gateway"
] | [((449, 494), 'pytradfri.api.libcoap_api.APIFactory', 'APIFactory', (['"""anything"""'], {'timeout': '(20)', 'psk': '"""abc"""'}), "('anything', timeout=20, psk='abc')\n", (459, 494), False, 'from pytradfri.api.libcoap_api import APIFactory\n'), ((888, 921), 'pytradfri.api.libcoap_api.APIFactory', 'APIFactory', (['"""a... |
# scrapes Townes van Zandt lyrics
# sample code so I don't have to remember all of this stuff
# the next time I want to source some verses
from bs4 import BeautifulSoup as soup
import requests
import string
punctuation_trans_table = str.maketrans("", "", string.punctuation)
def strip_punctuation(s):
return s.tr... | [
"bs4.BeautifulSoup",
"requests.get"
] | [((413, 451), 'requests.get', 'requests.get', (["(base_url + 'albums.html')"], {}), "(base_url + 'albums.html')\n", (425, 451), False, 'import requests\n'), ((467, 483), 'bs4.BeautifulSoup', 'soup', (['index.text'], {}), '(index.text)\n', (471, 483), True, 'from bs4 import BeautifulSoup as soup\n'), ((1025, 1061), 'req... |
# Copyright 2017 The Forseti Security 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 ap... | [
"mock.patch",
"tests.unittest_utils.get_datafile_path",
"google.cloud.security.common.gcp_type.organization.Organization",
"google.cloud.security.common.gcp_type.project.Project",
"mock.patch.object",
"google.cloud.security.common.gcp_type.ke_cluster.KeCluster.from_dict",
"unittest.main"
] | [((5310, 5408), 'mock.patch.object', 'mock.patch.object', (['ke_version_scanner.KeVersionScanner', '"""_output_results_to_db"""'], {'autospec': '(True)'}), "(ke_version_scanner.KeVersionScanner,\n '_output_results_to_db', autospec=True)\n", (5327, 5408), False, 'import mock\n'), ((7879, 7894), 'unittest.main', 'unit... |
import math
def lognormal_mean(m, stddev):
""" compute mean of log x with mean and std. of x
Args:
m: mean of x
stddev: standard deviation of x
Returns: mean of log x
"""
return math.log(m) - (0.5 * math.log(1.0 + (stddev * stddev) / (m * m)))
def lognormal_stdde... | [
"math.exp",
"math.log"
] | [((873, 908), 'math.exp', 'math.exp', (['(m + 0.5 * stddev * stddev)'], {}), '(m + 0.5 * stddev * stddev)\n', (881, 908), False, 'import math\n'), ((230, 241), 'math.log', 'math.log', (['m'], {}), '(m)\n', (238, 241), False, 'import math\n'), ((528, 567), 'math.log', 'math.log', (['(stddev * stddev / (m * m) + 1)'], {}... |
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' #To suppress warnings thrown by tensorflow
from time import sleep
import numpy as np
from cv2 import cv2
import pyautogui as pg
import Sudoku_Core as SC
import OCR
s = 513//9 #Size of board//9
fs = 25 #Size of the final image
def getBoard():
pg.click(266, 740)
sl... | [
"cv2.cv2.threshold",
"pyautogui.moveTo",
"pyautogui.screenshot",
"cv2.cv2.findContours",
"numpy.asarray",
"time.sleep",
"pyautogui.click",
"Sudoku_Core.solve",
"cv2.cv2.resize",
"numpy.zeros",
"Sudoku_Core.moves.items",
"cv2.cv2.boundingRect"
] | [((298, 316), 'pyautogui.click', 'pg.click', (['(266)', '(740)'], {}), '(266, 740)\n', (306, 316), True, 'import pyautogui as pg\n'), ((318, 326), 'time.sleep', 'sleep', (['(1)'], {}), '(1)\n', (323, 326), False, 'from time import sleep\n'), ((328, 346), 'pyautogui.click', 'pg.click', (['(266)', '(930)'], {}), '(266, 9... |
from app import db, login
from flask_login import UserMixin
from datetime import datetime
from flask import url_for, redirect
from werkzeug.security import generate_password_hash, check_password_hash
class users(UserMixin, db.Model):
__tablename__ = 'users'
id = db.Column(db.Integer, primary_key=True, autoinc... | [
"datetime.datetime.utcnow",
"app.db.String",
"flask.url_for",
"werkzeug.security.generate_password_hash",
"app.db.Column",
"app.db.ForeignKey",
"app.db.relationship",
"werkzeug.security.check_password_hash"
] | [((273, 332), 'app.db.Column', 'db.Column', (['db.Integer'], {'primary_key': '(True)', 'autoincrement': '(True)'}), '(db.Integer, primary_key=True, autoincrement=True)\n', (282, 332), False, 'from app import db, login\n'), ((657, 679), 'app.db.Column', 'db.Column', (['db.DateTime'], {}), '(db.DateTime)\n', (666, 679), ... |
# AUTOGENERATED! DO NOT EDIT! File to edit: source_nbs/12_top.ipynb (unless otherwise specified).
__all__ = ['empty_tensor_handling_loss', 'nan_loss_handling', 'create_dummy_if_empty', 'BaseTop', 'SequenceLabel',
'Classification', 'PreTrain', 'Seq2Seq', 'MultiLabelClassification', 'MaskLM']
# Cell
import l... | [
"tensorflow.equal",
"tensorflow.shape",
"tensorflow.pad",
"tensorflow.keras.layers.Dense",
"tensorflow.nn.softmax",
"tensorflow.reduce_mean",
"tensorflow.cast",
"tensorflow_addons.layers.crf.CRF",
"tensorflow.concat",
"tensorflow.nn.sigmoid",
"transformers.modeling_tf_utils.TFMaskedLanguageModel... | [((1106, 1126), 'tensorflow.math.is_nan', 'tf.math.is_nan', (['loss'], {}), '(loss)\n', (1120, 1126), True, 'import tensorflow as tf\n'), ((1274, 1294), 'tensorflow.shape', 'tf.shape', (['inp_tensor'], {}), '(inp_tensor)\n', (1282, 1294), True, 'import tensorflow as tf\n'), ((1302, 1330), 'tensorflow.equal', 'tf.equal'... |
import re
regex = re.compile('[^a-zA-Z]')
def score_word(word, corpus=None):
word = regex.sub('', word) # leave only alpha
score = 0
consec_bonus = 2
for i, letter in enumerate(word):
if letter.islower():
continue
if i > 0 and word[i-1].upper():
score += conse... | [
"re.compile"
] | [((19, 42), 're.compile', 're.compile', (['"""[^a-zA-Z]"""'], {}), "('[^a-zA-Z]')\n", (29, 42), False, 'import re\n')] |
"""Extension for built-in Sass functionality."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from itertools import product
import math
import os.path
from pathlib import PurePosixPath
from six.moves import xrange
... | [
"scss.types.Color.from_rgb",
"scss.source.SourceFile.read",
"scss.types.List.from_maybe_starargs",
"scss.types.expect_type",
"scss.namespace.Namespace",
"scss.types.Number",
"itertools.product",
"scss.types.Color",
"scss.types.Number.wrap_python_function",
"scss.types.String.unquoted",
"scss.typ... | [((598, 609), 'scss.namespace.Namespace', 'Namespace', ([], {}), '()\n', (607, 609), False, 'from scss.namespace import Namespace\n'), ((3545, 3577), 'scss.types.expect_type', 'expect_type', (['n', 'Number'], {'unit': '"""%"""'}), "(n, Number, unit='%')\n", (3556, 3577), False, 'from scss.types import Arglist, Boolean,... |
# Copyright 2021 Internet Corporation for Assigned Names and Numbers.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# Developed by Sinodun IT (sinodun.com)
#
# Ag... | [
"grafanacommon.BarChartTrace",
"grafanacommon.BarChartAxis",
"grafanacommon.HTMLPanel",
"grafanalib.core.Pixels"
] | [((1152, 1229), 'grafanacommon.BarChartTrace', 'GCommon.BarChartTrace', ([], {'name': '"""AForA"""', 'x': '"""AForA"""', 'y': '"""AForAPrefix"""', 'text': '"""AForA"""'}), "(name='AForA', x='AForA', y='AForAPrefix', text='AForA')\n", (1173, 1229), True, 'import grafanacommon as GCommon\n'), ((1330, 1423), 'grafanacommo... |
import re
class lexical(object):
'''Lexical Features:
Top Level domain (str)
Number of dots in hostname (int)
Average token length of hostname (float)
Max token length of hostname (int)
Average token length of path (float)
Max token length of path (int)
'''
def __init__(self):
pass
de... | [
"re.split"
] | [((876, 911), 're.split', 're.split', (['"""/|\\\\?|\\\\.|=|-|_"""', 'string'], {}), "('/|\\\\?|\\\\.|=|-|_', string)\n", (884, 911), False, 'import re\n')] |
from setuptools import setup, find_packages
def readme():
with open('README.rst') as f:
return f.read()
setup(
name='digicert-express',
version='1.1dev2',
description='Express Install for DigiCert, Inc.',
long_description=readme(),
classifiers=[
'Development Status :: 3 - Alpha... | [
"setuptools.find_packages"
] | [((727, 805), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "['tests.*', '*.tests.*', '*.tests', 'tests', 'scripts']"}), "(exclude=['tests.*', '*.tests.*', '*.tests', 'tests', 'scripts'])\n", (740, 805), False, 'from setuptools import setup, find_packages\n')] |
import argparse
import json
import numpy as np
import os
import torch
import data_
import models
import utils
from matplotlib import cm, pyplot as plt
from tensorboardX import SummaryWriter
from torch import optim
from torch.utils import data
from tqdm import tqdm
from utils import io
parser = argparse.ArgumentPars... | [
"numpy.array",
"utils.io.get_checkpoint_root",
"torch.cuda.is_available",
"data_.TestGridDataset",
"os.path.exists",
"tensorboardX.SummaryWriter",
"argparse.ArgumentParser",
"torch.mean",
"torch.set_default_tensor_type",
"matplotlib.pyplot.close",
"numpy.exp",
"utils.parse_activation",
"nump... | [((299, 324), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (322, 324), False, 'import argparse\n'), ((4721, 4749), 'torch.manual_seed', 'torch.manual_seed', (['args.seed'], {}), '(args.seed)\n', (4738, 4749), False, 'import torch\n'), ((4750, 4775), 'numpy.random.seed', 'np.random.seed', (['a... |
import argparse
PROJROOTDIR = {'mac': '/Users/taehapark/SLAB/speedplusbaseline',
'linux': '/home/somrita/Documents/Satellite_Pose_Estimation/speedplusbaseline'}
DATAROOTDIR = {'mac': '/Users/taehapark/SLAB/speedplus/data/datasets',
'linux': '/home/somrita/Documents/Satellite_Pose_Estim... | [
"argparse.ArgumentParser"
] | [((346, 413), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['"""Configurations for SPEED+ Baseline Study"""'], {}), "('Configurations for SPEED+ Baseline Study')\n", (369, 413), False, 'import argparse\n')] |
"""
HyperOne
HyperOne API # noqa: E501
The version of the OpenAPI document: 0.1.0
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from h1.api_client import ApiClient, Endpoint as _Endpoint
from h1.model_utils import ( # noqa: F401
check_allowe... | [
"h1.api_client.Endpoint",
"h1.api_client.ApiClient"
] | [((4796, 6054), 'h1.api_client.Endpoint', '_Endpoint', ([], {'settings': "{'response_type': (Journal,), 'auth': ['BearerAuth'], 'endpoint_path':\n '/insight/{locationId}/project/{projectId}/journal', 'operation_id':\n 'insight_project_journal_create', 'http_method': 'POST', 'servers': None}", 'params_map': "{'all... |
from machine import Pin, ADC
from network import LoRa
import socket
from utime import sleep
# Use a pin for a 'config' mode
configPin = Pin('P21', Pin.IN, Pin.PULL_UP)
# Create an ADC object
adc = ADC()
# vbatt pin:
vbatt = adc.channel(attn=1, pin='P16')
def battConversion():
adcVoltage = vbatt()
voltage = ... | [
"utime.sleep",
"socket.socket",
"machine.Pin",
"network.LoRa",
"machine.ADC"
] | [((137, 168), 'machine.Pin', 'Pin', (['"""P21"""', 'Pin.IN', 'Pin.PULL_UP'], {}), "('P21', Pin.IN, Pin.PULL_UP)\n", (140, 168), False, 'from machine import Pin, ADC\n'), ((199, 204), 'machine.ADC', 'ADC', ([], {}), '()\n', (202, 204), False, 'from machine import Pin, ADC\n'), ((433, 472), 'network.LoRa', 'LoRa', ([], {... |
"""
A Lake Winnipeg Basin Information Network (BIN) harvester for the SHARE project
Example API request: http://130.179.67.140/api/3/action/package_search?q= (problematic)
http://130.179.67.140/api/3/action/current_package_list_with_resources (currently using)
It oddly returns 5 more datasets than all searchable ones ... | [
"logging.getLogger",
"dateutil.parser.parse",
"scrapi.base.helpers.parse_name",
"json.dumps",
"scrapi.base.helpers.build_properties",
"scrapi.requests.get"
] | [((1347, 1374), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1364, 1374), False, 'import logging\n'), ((3013, 3031), 'scrapi.base.helpers.parse_name', 'parse_name', (['author'], {}), '(author)\n', (3023, 3031), False, 'from scrapi.base.helpers import build_properties, datetime_formatte... |
# Copyright 2018 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, s... | [
"absl.gfile.Open",
"numpy.random.rand",
"scipy.io.loadmat",
"numpy.array",
"numpy.arange",
"re.search",
"numpy.reshape",
"tensorflow.Session",
"tensorflow.placeholder",
"absl.gfile.IsDirectory",
"absl.app.run",
"numpy.max",
"numpy.random.seed",
"numpy.min",
"matplotlib.pyplot.ylim",
"t... | [((836, 859), 'matplotlib.use', 'matplotlib.use', (['"""TkAgg"""'], {}), "('TkAgg')\n", (850, 859), False, 'import matplotlib\n'), ((1072, 1163), 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""folder_name"""', '"""experiment4"""', '"""folder where to store all the data"""'], {}), "('folder_name', 'experiment4... |
import logging
import os.path as path
from typing import List, Optional, Tuple
from psychopy import core, visual
from bcipy.acquisition.marker_writer import NullMarkerWriter, MarkerWriter
from bcipy.helpers.task import SPACE_CHAR
from bcipy.helpers.stimuli import resize_image
from bcipy.helpers.system_utils import ge... | [
"logging.getLogger",
"bcipy.helpers.triggers.TriggerCallback",
"psychopy.core.Clock",
"psychopy.core.wait",
"psychopy.visual.TextStim",
"os.path.basename",
"bcipy.helpers.system_utils.get_screen_resolution",
"bcipy.helpers.stimuli.resize_image",
"bcipy.acquisition.marker_writer.NullMarkerWriter",
... | [((3211, 3238), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (3228, 3238), False, 'import logging\n'), ((3565, 3577), 'psychopy.core.Clock', 'core.Clock', ([], {}), '()\n', (3575, 3577), False, 'from psychopy import core, visual\n'), ((4137, 4154), 'bcipy.helpers.triggers.TriggerCallbac... |
# Copyright 2018 MassOpenCloud.
#
# 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 agr... | [
"oslo_utils.importutils.try_import",
"oslo_log.log.getLogger"
] | [((1216, 1261), 'oslo_utils.importutils.try_import', 'importutils.try_import', (['"""osprofiler.profiler"""'], {}), "('osprofiler.profiler')\n", (1238, 1261), False, 'from oslo_utils import importutils\n'), ((1293, 1320), 'oslo_log.log.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1310, 1320), T... |
# Copyright 2020 DeepMind Technologies Limited. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | [
"numpy.ones",
"jax.nn.gelu",
"haiku.initializers.VarianceScaling",
"haiku.next_rng_key",
"haiku.LayerNorm",
"haiku.Linear"
] | [((1964, 2013), 'haiku.initializers.VarianceScaling', 'hk.initializers.VarianceScaling', (['self._init_scale'], {}), '(self._init_scale)\n', (1995, 2013), True, 'import haiku as hk\n'), ((2096, 2110), 'jax.nn.gelu', 'jax.nn.gelu', (['x'], {}), '(x)\n', (2107, 2110), False, 'import jax\n'), ((3945, 4016), 'haiku.LayerNo... |
#!/usr/bin/env python
import boto3
import cv2
import numpy
import os
import base64
import gspread
from email.mime.base import MIMEBase
from email.mime.image import MIMEImage
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from httplib2 import Http
from time import localtime, strftim... | [
"boto3.client",
"gspread.authorize",
"oauth2client.client.flow_from_clientsecrets",
"time.sleep",
"os.path.isfile",
"oauth2client.service_account.ServiceAccountCredentials.from_json_keyfile_name",
"os.remove",
"email.mime.multipart.MIMEMultipart",
"boto3.resource",
"os.path.basename",
"oauth2cli... | [((784, 819), 'boto3.client', 'boto3.client', (['"""rekognition"""', 'region'], {}), "('rekognition', region)\n", (796, 819), False, 'import boto3\n'), ((1421, 1513), 'oauth2client.service_account.ServiceAccountCredentials.from_json_keyfile_name', 'ServiceAccountCredentials.from_json_keyfile_name', (['"""ProjectLog-41c... |
# -*- coding: utf-8 -*-
"""Implicitly reference attributes of an object."""
from ast import Name, Assign, Load, Call, Lambda, With, Str, arg, \
Attribute, Subscript, Store, Del
from macropy.core.quotes import macros, q, u, name, ast_literal
from macropy.core.hquotes import macros, hq
from macropy.core... | [
"ast.Assign"
] | [((8203, 8246), 'ast.Assign', 'Assign', ([], {'targets': '[q[name[o]]]', 'value': 'args[0]'}), '(targets=[q[name[o]]], value=args[0])\n', (8209, 8246), False, 'from ast import Name, Assign, Load, Call, Lambda, With, Str, arg, Attribute, Subscript, Store, Del\n')] |
# -*- coding: utf-8 -*-
"""
This is part of HashBruteStation software
Docs EN: http://hack4sec.pro/wiki/index.php/Hash_Brute_Station_en
Docs RU: http://hack4sec.pro/wiki/index.php/Hash_Brute_Station
License: MIT
Copyright (c) <NAME> <http://anton-kuzmin.ru> (ru) <http://anton-kuzmin.pro> (en)
Integration tests for Has... | [
"os.path.exists",
"libs.common.md5",
"libs.common.file_get_contents",
"time.sleep",
"pytest.mark.parametrize",
"classes.HashlistsByAlgLoaderThread.HashlistsByAlgLoaderThread",
"sys.path.append"
] | [((398, 423), 'sys.path.append', 'sys.path.append', (['"""../../"""'], {}), "('../../')\n", (413, 423), False, 'import sys\n'), ((1570, 1623), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""have_salt,_hash"""', 'test_data'], {}), "('have_salt,_hash', test_data)\n", (1593, 1623), False, 'import pytest\n'), ... |
from __future__ import absolute_import, division, print_function
import json
import logging
import os
import time
import importlib
import multiprocessing
import cv2
import fire
import logzero
from logzero import logger
import numpy as np
from rmexp import config, cvutils, dbutils, gabriel_pb2, client
from rmexp.sche... | [
"time.clock",
"fire.Fire",
"cv2.imdecode",
"logzero.logger.debug",
"rmexp.gabriel_pb2.Message",
"rmexp.dbutils.insert",
"rmexp.dbutils.get_or_create",
"os.getpid",
"numpy.frombuffer",
"importlib.import_module",
"os.path.dirname",
"time.time",
"rmexp.client.VideoClient",
"os.makedirs",
"l... | [((460, 491), 'logzero.loglevel', 'logzero.loglevel', (['logging.DEBUG'], {}), '(logging.DEBUG)\n', (476, 491), False, 'import logzero\n'), ((356, 458), 'logging.Formatter', 'logging.Formatter', ([], {'fmt': '"""%(asctime)s.%(msecs)03d - %(levelname)s: %(message)s"""', 'datefmt': '"""%H:%M:%S"""'}), "(fmt=\n '%(asct... |
import random
import sys
# usage: python3 words_gen.py > list.txt
N = int(sys.argv[1]) # how many words should be in the resulting list
with open("scripts/words.txt", "r") as f:
words = f.readlines()
for i in range(N):
print(words[random.randint(0, 466550 - 1)].rstrip())
| [
"random.randint"
] | [((251, 280), 'random.randint', 'random.randint', (['(0)', '(466550 - 1)'], {}), '(0, 466550 - 1)\n', (265, 280), False, 'import random\n')] |
import unittest
from modules.Input import *
class CommandInputTest(unittest.TestCase):
def setUp(self):
self.field_a_locations = ["gOtOFieldAroW8",
" go to fieLDA RoW 18 ",
"gOTOfield A rOW88"]
self.field_b_locations = ["gOtOFie... | [
"unittest.main"
] | [((3021, 3036), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3034, 3036), False, 'import unittest\n')] |
"""
-----------------------------------------------------------------------------
This source file is part of VPET - Virtual Production Editing Tools
http://vpet.research.animationsinstitut.de/
http://github.com/FilmakademieRnd/VPET
Copyright (c) 2021 <NAME>, Animationsinstitut R&D Lab
This project has been initiated... | [
"bpy.props.PointerProperty",
"bpy.utils.register_class",
"bpy.utils.unregister_class"
] | [((2745, 2791), 'bpy.props.PointerProperty', 'bpy.props.PointerProperty', ([], {'type': 'VpetProperties'}), '(type=VpetProperties)\n', (2770, 2791), False, 'import bpy\n'), ((2556, 2575), 'bpy.utils.register_class', 'register_class', (['cls'], {}), '(cls)\n', (2570, 2575), False, 'from bpy.utils import register_class\n... |
# Unlike the other datasets, CIFAR-10 uses ResNet and suffers from
# a variety of problems, including exploding gradients
import torch
import torch.nn as nn
from tqdm.notebook import tnrange, tqdm
# For loading model sanely
import os.path
import sys
# This here actually adds the path
sys.path.append("../../")
import ... | [
"torch.nn.CrossEntropyLoss",
"torch.load",
"models.resnet.ResNet18",
"tqdm.notebook.tnrange",
"torch.nn.DataParallel",
"torch.cuda.is_available",
"tqdm.notebook.tqdm",
"sys.path.append"
] | [((287, 312), 'sys.path.append', 'sys.path.append', (['"""../../"""'], {}), "('../../')\n", (302, 312), False, 'import sys\n'), ((437, 462), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (460, 462), False, 'import torch\n'), ((1530, 1551), 'torch.nn.CrossEntropyLoss', 'nn.CrossEntropyLoss', ([... |
import os
import numpy as np
from montepython.likelihood_class import Likelihood
import montepython.io_mp as io_mp
import warnings
import ccl_tools as tools
import pyccl as ccl
class covfefe(Likelihood):
# initialization routine
def __init__(self, path, data, command_line):
Likelihood.__init__(sel... | [
"montepython.likelihood_class.Likelihood.__init__",
"ccl_tools.get_cls_ccl",
"os.path.join",
"ccl_tools.get_cosmo_ccl",
"numpy.linalg.inv",
"ccl_tools.get_tracers_ccl"
] | [((297, 348), 'montepython.likelihood_class.Likelihood.__init__', 'Likelihood.__init__', (['self', 'path', 'data', 'command_line'], {}), '(self, path, data, command_line)\n', (316, 348), False, 'from montepython.likelihood_class import Likelihood\n'), ((1625, 1656), 'ccl_tools.get_cosmo_ccl', 'tools.get_cosmo_ccl', (['... |
from __future__ import division
import itertools
import json
import math
import os
import random
import shutil
import subprocess
import sys
durationA = str(5)
durationB = str(4)
durationC = str(1)
def main():
if len(sys.argv) > 1:
nbDepth = int(sys.argv[1])
if nbDepth < 2 :
nbDept... | [
"os.path.exists",
"subprocess.call"
] | [((394, 420), 'os.path.exists', 'os.path.exists', (['mainFolder'], {}), '(mainFolder)\n', (408, 420), False, 'import os\n'), ((430, 468), 'subprocess.call', 'subprocess.call', (["['mkdir', mainFolder]"], {}), "(['mkdir', mainFolder])\n", (445, 468), False, 'import subprocess\n')] |
import decimal
from django import template
register = template.Library()
@register.simple_tag
def can_change_status(payment_request, user):
return payment_request.can_user_change_status(user)
@register.simple_tag
def can_delete(payment_request, user):
return payment_request.can_user_delete(user)
@regist... | [
"decimal.Decimal",
"django.template.Library"
] | [((56, 74), 'django.template.Library', 'template.Library', ([], {}), '()\n', (72, 74), False, 'from django import template\n'), ((504, 522), 'decimal.Decimal', 'decimal.Decimal', (['(0)'], {}), '(0)\n', (519, 522), False, 'import decimal\n'), ((683, 705), 'decimal.Decimal', 'decimal.Decimal', (['"""0.0"""'], {}), "('0.... |
""" pylabnet measurement and service classes for Swabian Instruments TimeTagger
which implements qudi's SlowCounter interface.
This file contains pylabnet wrapper and service classes to allow qudi to
access Swabian Instruments TT through pylabnet network as SlowCounter.
Steps:
- instantiate TimeTagger
- instantiate p... | [
"pickle.dumps",
"TimeTagger.Counter",
"time.sleep",
"copy.deepcopy"
] | [((9264, 9305), 'time.sleep', 'time.sleep', (['(samples * self._bin_width_sec)'], {}), '(samples * self._bin_width_sec)\n', (9274, 9305), False, 'import time\n'), ((10017, 10050), 'copy.deepcopy', 'copy.deepcopy', (['self._channel_list'], {}), '(self._channel_list)\n', (10030, 10050), False, 'import copy\n'), ((15586, ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Must still be recoded with some cleaner code.
"""
# imports.
from dev0s.classes.config import *
from dev0s.classes import utils
from dev0s.classes.defaults.color import color, symbol
from dev0s.classes import console
from dev0s.classes.defaults.exceptions import Excep... | [
"dev0s.classes.defaults.exceptions.Exceptions.InvalidUsage",
"dev0s.classes.defaults.exceptions.Exceptions.FormatError",
"math.floor",
"dev0s.classes.defaults.exceptions.Exceptions.ParseError",
"datetime.datetime.today",
"dev0s.classes.defaults.exceptions.Exceptions.InstanceError",
"dev0s.classes.utils.... | [((14111, 14134), 'shutil.disk_usage', 'shutil.disk_usage', (['path'], {}), '(path)\n', (14128, 14134), False, 'import shutil, math\n'), ((34670, 34703), 'dev0s.classes.utils.__check_memory_only__', 'utils.__check_memory_only__', (['path'], {}), '(path)\n', (34697, 34703), False, 'from dev0s.classes import utils\n'), (... |
import pygame
from pygame.locals import *
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *
def main():
pygame.init()
glutInit()
display = (800,600)
pygame.display.set_mode(display, DOUBLEBUF|OPENGL)
gluPerspective(45, (display[0]/display[1]), 0.1, 50.0)
glTranslatef(0.0, 0.0, -5)
w... | [
"pygame.init",
"pygame.quit",
"pygame.event.get",
"pygame.time.wait",
"pygame.display.set_mode",
"pygame.display.flip"
] | [((132, 145), 'pygame.init', 'pygame.init', ([], {}), '()\n', (143, 145), False, 'import pygame\n'), ((180, 232), 'pygame.display.set_mode', 'pygame.display.set_mode', (['display', '(DOUBLEBUF | OPENGL)'], {}), '(display, DOUBLEBUF | OPENGL)\n', (203, 232), False, 'import pygame\n'), ((346, 364), 'pygame.event.get', 'p... |
from django.db import models
# Create your models here.
##########################################################################
#投票
class Vote(models.Model):
data=models.CharField(max_length=255)
########################################################################## | [
"django.db.models.CharField"
] | [((171, 203), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(255)'}), '(max_length=255)\n', (187, 203), False, 'from django.db import models\n')] |
import argparse
import torch
def get_args():
parser = argparse.ArgumentParser(description='RL')
parser.add_argument('--algo', default='a2c',
help='algorithm to use: a2c | ppo ')
parser.add_argument('--lr', type=float, default=7e-5,
help='learning rate (defau... | [
"torch.cuda.is_available",
"argparse.ArgumentParser"
] | [((60, 101), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""RL"""'}), "(description='RL')\n", (83, 101), False, 'import argparse\n'), ((2889, 2914), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (2912, 2914), False, 'import torch\n')] |
# course: ICS3U1 2019
# exercise: Culminating Activity
# date: 2019-12-06
# student number: 340926187
# name: <NAME>
# description: Two players (Mr Chun & Mr Pileggi) running around the school
# collecting food for the food drive.
# sprite classes
import pygame
imp... | [
"pygame.joystick.get_count",
"random.choice",
"pygame.sprite.spritecollide",
"pygame.sprite.Sprite.__init__",
"pygame.joystick.Joystick",
"pygame.transform.rotate",
"pygame.key.get_pressed"
] | [((821, 869), 'pygame.sprite.Sprite.__init__', 'pygame.sprite.Sprite.__init__', (['self', 'self.groups'], {}), '(self, self.groups)\n', (850, 869), False, 'import pygame\n'), ((1572, 1599), 'pygame.joystick.get_count', 'pygame.joystick.get_count', ([], {}), '()\n', (1597, 1599), False, 'import pygame\n'), ((1953, 1977)... |
from abc import ABCMeta, abstractmethod
from collections import OrderedDict
from math import inf
from typing import Iterator, Any, List, Dict, Type, Optional
EPSILON = 1e-4
class Error(Exception):
pass
class ConstraintError(Error):
pass
class Constraint(metaclass=ABCMeta):
@abstractmethod
def isv... | [
"collections.OrderedDict"
] | [((872, 885), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (883, 885), False, 'from collections import OrderedDict\n')] |
input = """154, 159
172, 84
235, 204
181, 122
161, 337
305, 104
128, 298
176, 328
146, 71
210, 87
341, 195
50, 96
225, 151
86, 171
239, 68
79, 50
191, 284
200, 122
282, 240
224, 282
327, 74
158, 289
331, 244
154, 327
317, 110
272, 179
173, 175
187, 104
44, 194
202, 332
249, 197
244, 225
52, 127
299, 198
123, 198
349, 7... | [
"collections.namedtuple"
] | [((493, 530), 'collections.namedtuple', 'namedtuple', (['"""Point"""', "['id', 'x', 'y']"], {}), "('Point', ['id', 'x', 'y'])\n", (503, 530), False, 'from collections import namedtuple\n')] |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
import logging
logger = logging.getLogger(__name__)
import multiprocessing as mp
import tweetf0rm.handler
from tweetf0rm.redis_helper import CrawlerQueue
#MAX_QUEUE_SIZE = 32767
class CrawlerProcess(mp.Process):
def __init__(self, node_id, crawler_id, redis_config, ha... | [
"logging.getLogger",
"tweetf0rm.redis_helper.CrawlerQueue"
] | [((69, 96), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (86, 96), False, 'import logging\n'), ((534, 594), 'tweetf0rm.redis_helper.CrawlerQueue', 'CrawlerQueue', (['node_id', 'crawler_id'], {'redis_config': 'redis_config'}), '(node_id, crawler_id, redis_config=redis_config)\n', (546, 5... |
# Copyright (c) 2018 Cloudify Platform Ltd. All rights reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | [
"cloudify_aws.common.utils.find_rel_by_node_type",
"cloudify_aws.common.utils.JsonCleanuper",
"cloudify_aws.common.decorators.aws_resource",
"cloudify_aws.common.utils.update_resource_id",
"cloudify_aws.ec2.EC2Base.__init__"
] | [((3126, 3194), 'cloudify_aws.common.decorators.aws_resource', 'decorators.aws_resource', (['EC2DHCPOptions'], {'resource_type': 'RESOURCE_TYPE'}), '(EC2DHCPOptions, resource_type=RESOURCE_TYPE)\n', (3149, 3194), False, 'from cloudify_aws.common import decorators, utils\n'), ((3379, 3433), 'cloudify_aws.common.decorato... |
# Copyright 2010 New Relic, Inc.
#
# 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 writ... | [
"newrelic.api.transaction.get_browser_timing_footer",
"sqlite3.connect",
"newrelic.api.time_trace.record_exception",
"newrelic.api.transaction.record_custom_event",
"newrelic.api.wsgi_application.wsgi_application",
"newrelic.api.transaction.add_custom_parameter",
"newrelic.api.transaction.get_browser_ti... | [((1894, 1912), 'newrelic.api.wsgi_application.wsgi_application', 'wsgi_application', ([], {}), '()\n', (1910, 1912), False, 'from newrelic.api.wsgi_application import wsgi_application\n'), ((3486, 3504), 'newrelic.api.wsgi_application.wsgi_application', 'wsgi_application', ([], {}), '()\n', (3502, 3504), False, 'from ... |
from spydrnet.ir import Port, Instance, InnerPin
from spydrnet_tmr.transformation.util import add_suffix_to_name
IN = Port.Direction.IN
OUT = Port.Direction.OUT
INOUT = Port.Direction.INOUT
def apply_nmr(ports_and_instances_to_replicate, degree, name_suffix='NMR', rename_original=True):
"""
Replicate the sele... | [
"spydrnet_tmr.transformation.util.add_suffix_to_name"
] | [((6451, 6505), 'spydrnet_tmr.transformation.util.add_suffix_to_name', 'add_suffix_to_name', (['port', "(self.name_suffix + '_' + '0')"], {}), "(port, self.name_suffix + '_' + '0')\n", (6469, 6505), False, 'from spydrnet_tmr.transformation.util import add_suffix_to_name\n'), ((6913, 6967), 'spydrnet_tmr.transformation.... |
# Copyright 2016-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
from __future__ import absol... | [
"shlex.split"
] | [((1176, 1190), 'shlex.split', 'shlex.split', (['s'], {}), '(s)\n', (1187, 1190), False, 'import shlex\n')] |
import openpnm as op
import scipy as sp
import pytest
class SubdomainTest:
def setup_class(self):
ws = op.Workspace()
ws.settings['local_data'] = True
self.net = op.network.Cubic(shape=[3, 3, 3])
self.geo = op.geometry.GenericGeometry(network=self.net,
... | [
"openpnm.Workspace",
"openpnm.geometry.GenericGeometry",
"openpnm.network.Cubic",
"openpnm.geometry.StickAndBall",
"pytest.raises",
"openpnm.phases.GenericPhase",
"openpnm.physics.GenericPhysics",
"scipy.rand"
] | [((118, 132), 'openpnm.Workspace', 'op.Workspace', ([], {}), '()\n', (130, 132), True, 'import openpnm as op\n'), ((193, 226), 'openpnm.network.Cubic', 'op.network.Cubic', ([], {'shape': '[3, 3, 3]'}), '(shape=[3, 3, 3])\n', (209, 226), True, 'import openpnm as op\n'), ((246, 336), 'openpnm.geometry.GenericGeometry', '... |
import pandas as pd
from shapely.geometry import Point
import geopandas as gpd
import math
import osmnx
import requests
from io import BytesIO
from zipfile import ZipFile
def read_poi_csv(input_file, col_id='id', col_name='name', col_lon='lon', col_lat='lat', col_kwds='kwds', col_sep=';',
kwds_sep=',... | [
"osmnx.pois.pois_from_polygon",
"pandas.read_csv",
"io.BytesIO",
"requests.get",
"shapely.geometry.Point",
"osmnx.core.gdf_from_place",
"geopandas.GeoDataFrame",
"math.isnan"
] | [((1861, 1926), 'pandas.read_csv', 'pd.read_csv', (['input_file'], {'delimiter': 'col_sep', 'error_bad_lines': '(False)'}), '(input_file, delimiter=col_sep, error_bad_lines=False)\n', (1872, 1926), True, 'import pandas as pd\n'), ((3769, 3804), 'osmnx.pois.pois_from_polygon', 'osmnx.pois.pois_from_polygon', (['bound'],... |
import re
import random
from collections import defaultdict
import src.settings as var
from src.utilities import *
from src import debuglog, errlog, plog
from src.decorators import cmd, event_listener
from src.messages import messages
from src.events import Event
KILLS = {} # type: Dict[str, List[str]]
@cmd("kill", ... | [
"re.split",
"random.choice",
"random.shuffle",
"src.events.Event",
"src.decorators.event_listener",
"src.settings.OBSERVED.get",
"collections.defaultdict",
"src.decorators.cmd"
] | [((308, 373), 'src.decorators.cmd', 'cmd', (['"""kill"""'], {'chan': '(False)', 'pm': '(True)', 'playing': '(True)', 'phases': "('night',)"}), "('kill', chan=False, pm=True, playing=True, phases=('night',))\n", (311, 373), False, 'from src.decorators import cmd, event_listener\n'), ((3121, 3194), 'src.decorators.cmd', ... |
import shutil
from pathlib import Path
from tempfile import mkdtemp
import pytest
from click.testing import CliRunner
import ape
# NOTE: Ensure that we don't use local paths for these
ape.config.DATA_FOLDER = Path(mkdtemp()).resolve()
ape.config.PROJECT_FOLDER = Path(mkdtemp()).resolve()
@pytest.fixture(scope="ses... | [
"pathlib.Path",
"ape.Project",
"click.testing.CliRunner",
"tempfile.mkdtemp",
"shutil.rmtree",
"pytest.fixture"
] | [((295, 326), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (309, 326), False, 'import pytest\n'), ((365, 396), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (379, 396), False, 'import pytest\n'), ((454, 485), 'pytest.fixture'... |
#pylint: disable=logging-fstring-interpolation
#Standart library imports
import shutil
import os
import time
from typing import Tuple
from pathlib import Path
import re
from shutil import copyfile
import wget
# Local imports
from selenium_driver_updater.util.logger import logger
from selenium_driver_updater.util.excep... | [
"selenium_driver_updater.util.logger.logger.info",
"wget.download",
"pathlib.Path",
"selenium_driver_updater.util.exceptions.DriverVersionInvalidException",
"os.rename",
"time.sleep",
"shutil.rmtree",
"shutil.copyfile",
"selenium_driver_updater.util.logger.logger.error",
"selenium_driver_updater.d... | [((672, 707), 'selenium_driver_updater.driver_base.DriverBase.__init__', 'DriverBase.__init__', (['self'], {}), '(self, **kwargs)\n', (691, 707), False, 'from selenium_driver_updater.driver_base import DriverBase\n'), ((1842, 1903), 'selenium_driver_updater.util.logger.logger.info', 'logger.info', (['f"""Latest version... |
from django.contrib import admin
from .models import Distribution
admin.site.register(Distribution)
# Register your models here.
| [
"django.contrib.admin.site.register"
] | [((67, 100), 'django.contrib.admin.site.register', 'admin.site.register', (['Distribution'], {}), '(Distribution)\n', (86, 100), False, 'from django.contrib import admin\n')] |
from django.contrib.auth import authenticate, login
from django.shortcuts import render, redirect
from cart.models import Cart
from django.views import View
from .forms import LoginForm, RegistrationForm, CreateCompanyForm
from customer.models import Customer, ShippingAddress
from src.utils.mixins import CustomerMixin
... | [
"django.shortcuts.render",
"django.contrib.auth.authenticate",
"django.contrib.auth.login",
"django.shortcuts.redirect",
"cart.models.Cart.objects.create",
"customer.models.Customer.objects.create",
"customer.models.ShippingAddress.objects.create"
] | [((574, 628), 'django.shortcuts.render', 'render', (['request', '"""customer/login.html"""', "{'form': form}"], {}), "(request, 'customer/login.html', {'form': form})\n", (580, 628), False, 'from django.shortcuts import render, redirect\n'), ((1040, 1094), 'django.shortcuts.render', 'render', (['request', '"""customer/... |
from flask import Flask, render_template, request
# from .recommendation import *
# import pickle
import pandas as pd
import numpy as np
# import keras
# from keras.models import load_model
import pickle
def create_app():
# initializes our app
APP = Flask(__name__)
@APP.route('/')
def form():
... | [
"flask.render_template",
"flask.Flask",
"flask.request.form.get",
"numpy.array",
"pandas.DataFrame"
] | [((259, 274), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (264, 274), False, 'from flask import Flask, render_template, request\n'), ((327, 355), 'flask.render_template', 'render_template', (['"""base.html"""'], {}), "('base.html')\n", (342, 355), False, 'from flask import Flask, render_template, reques... |
# Copyright 2018, <NAME> LLC
# License: Apache License Version 2.0
# -------------------------------------------------------------------------
# registration.py - updates the database to say who is building something
# and what the current settings are, which is used by the file serving
# code to see if it is ok ... | [
"subprocess.check_output",
"os.path.exists",
"fcntl.flock",
"vespene.models.worker.Worker.objects.filter",
"datetime.datetime.now",
"vespene.common.logger.Logger",
"random.SystemRandom"
] | [((712, 720), 'vespene.common.logger.Logger', 'Logger', ([], {}), '()\n', (718, 720), False, 'from vespene.common.logger import Logger\n'), ((1420, 1463), 'vespene.models.worker.Worker.objects.filter', 'Worker.objects.filter', ([], {'worker_uid': 'worker_id'}), '(worker_uid=worker_id)\n', (1441, 1463), False, 'from ves... |
import os
import json
import logging
from collections import defaultdict
import numpy as np
import networkx as nx
import torch
from torch.utils.data import DataLoader
from torch.optim import Adam
from tqdm import tqdm
from milieu.util.util import place_on_cpu, place_on_gpu
from milieu.paper.methods.method import D... | [
"torch.load",
"os.path.join",
"collections.defaultdict",
"torch.utils.data.DataLoader",
"json.load",
"logging.info",
"torch.zeros"
] | [((901, 934), 'logging.info', 'logging.info', (['"""Loading Params..."""'], {}), "('Loading Params...')\n", (913, 934), False, 'import logging\n'), ((1148, 1181), 'logging.info', 'logging.info', (['"""Loading Models..."""'], {}), "('Loading Models...')\n", (1160, 1181), False, 'import logging\n'), ((1622, 1656), 'loggi... |
import os
import uuid
from django.conf import settings
from django.db import models
from django.utils.translation import ugettext_lazy as _
def upload_avatar_to(instance, filename):
filename, ext = os.path.splitext(filename)
return os.path.join(
'avatar_images',
'avatar_{uuid}_{filename}{ext}... | [
"django.db.models.OneToOneField",
"django.utils.translation.ugettext_lazy",
"os.path.splitext",
"uuid.uuid4"
] | [((205, 231), 'os.path.splitext', 'os.path.splitext', (['filename'], {}), '(filename)\n', (221, 231), False, 'import os\n'), ((441, 553), 'django.db.models.OneToOneField', 'models.OneToOneField', (['settings.AUTH_USER_MODEL'], {'on_delete': 'models.CASCADE', 'related_name': '"""wagtail_userprofile"""'}), "(settings.AUT... |
__author__ = '<NAME>, <EMAIL>'
import uinput
def Simulator():
def __init__(self):
pass
def test1(self):
device = uinput.Device([uinput.KEY_E, uinput.KEY_H, uinput.KEY_L, uinput.KEY_O])
device.emit_click(uinput.KEY_H)
| [
"uinput.Device"
] | [((122, 193), 'uinput.Device', 'uinput.Device', (['[uinput.KEY_E, uinput.KEY_H, uinput.KEY_L, uinput.KEY_O]'], {}), '([uinput.KEY_E, uinput.KEY_H, uinput.KEY_L, uinput.KEY_O])\n', (135, 193), False, 'import uinput\n')] |
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Top-level presubmit script for catapult.
See https://www.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmi... | [
"re.compile",
"catapult_build.bin_checks.RunChecks",
"catapult_build.repo_checks.RunChecks",
"catapult_build.js_checks.RunChecks",
"catapult_build.html_checks.RunChecks"
] | [((1468, 1492), 're.compile', 're.compile', (['"""#[1-9]\\\\d*"""'], {}), "('#[1-9]\\\\d*')\n", (1478, 1492), False, 'import re\n'), ((1515, 1538), 're.compile', 're.compile', (['"""[1-9]\\\\d*"""'], {}), "('[1-9]\\\\d*')\n", (1525, 1538), False, 'import re\n'), ((4285, 4359), 'catapult_build.js_checks.RunChecks', 'js_... |