code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
# -*- coding: utf-8 -*-
# Copyright (c) 2016, French National Center for Scientific Research (CNRS)
# Distributed under the (new) BSD License. See LICENSE for more info.
import time
import sys
from pyacq import create_manager
from pyqtgraph.Qt import QtCore, QtGui
import pyqtgraph as pg
from pyacq.core.tests.fakenode... | [
"pyacq.core.tests.fakenodes.FakeSender",
"time.sleep",
"pyacq.core.tests.fakenodes.ReceiverWidget",
"pyqtgraph.mkQApp",
"pyacq.create_manager",
"pyacq.core.tests.fakenodes.FakeReceiver",
"pyqtgraph.Qt.QtCore.QTimer"
] | [((520, 531), 'pyqtgraph.mkQApp', 'pg.mkQApp', ([], {}), '()\n', (529, 531), True, 'import pyqtgraph as pg\n'), ((546, 558), 'pyacq.core.tests.fakenodes.FakeSender', 'FakeSender', ([], {}), '()\n', (556, 558), False, 'from pyacq.core.tests.fakenodes import FakeSender, FakeReceiver, ReceiverWidget\n'), ((1035, 1049), 'p... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
import numpy as np
import os
import sys
from observations.util import maybe_download_and_extract
def sparrows(path):
"""Sparrows
Weight and wing length for a sample of... | [
"observations.util.maybe_download_and_extract",
"os.path.join",
"os.path.expanduser"
] | [((1016, 1040), 'os.path.expanduser', 'os.path.expanduser', (['path'], {}), '(path)\n', (1034, 1040), False, 'import os\n'), ((1192, 1279), 'observations.util.maybe_download_and_extract', 'maybe_download_and_extract', (['path', 'url'], {'save_file_name': '"""sparrows.csv"""', 'resume': '(False)'}), "(path, url, save_fi... |
# -*- coding:utf-8 -*-
'''
For User collection
'''
import json
import tornado.web
from config import CMS_CFG
from torcms.core import tools
from torcms.core.base_handler import BaseHandler
from torcms.core.tools import logger
from torcms.model.collect_model import MCollect
class CollectHandler(BaseHandler):
'''... | [
"torcms.model.collect_model.MCollect.remove_collect",
"torcms.model.collect_model.MCollect.query_pager_by_all",
"torcms.model.collect_model.MCollect.add_or_update",
"torcms.model.collect_model.MCollect.count_of_user",
"json.dump"
] | [((1328, 1377), 'torcms.model.collect_model.MCollect.add_or_update', 'MCollect.add_or_update', (['self.userinfo.uid', 'app_id'], {}), '(self.userinfo.uid, app_id)\n', (1350, 1377), False, 'from torcms.model.collect_model import MCollect\n'), ((1429, 1453), 'json.dump', 'json.dump', (['out_dic', 'self'], {}), '(out_dic,... |
from keras.models import Input, Model
from keras.layers import BatchNormalization, Activation
from keras.layers.advanced_activations import LeakyReLU
from keras.layers import Conv2D, MaxPooling2D, Flatten, Dense, Dropout
alpha = 0.1
def conv_with_batch_norm(x, kernel, size, padding, activation):
x = Conv2D(kerne... | [
"keras.layers.Conv2D",
"keras.layers.Flatten",
"keras.layers.MaxPooling2D",
"keras.layers.advanced_activations.LeakyReLU",
"keras.models.Model",
"keras.models.Input",
"keras.layers.Activation",
"keras.layers.Dense",
"keras.layers.BatchNormalization",
"keras.layers.Dropout"
] | [((527, 551), 'keras.models.Input', 'Input', ([], {'shape': '(32, 32, 3)'}), '(shape=(32, 32, 3))\n', (532, 551), False, 'from keras.models import Input, Model\n'), ((1816, 1846), 'keras.models.Model', 'Model', ([], {'inputs': 'input', 'outputs': 'x'}), '(inputs=input, outputs=x)\n', (1821, 1846), False, 'from keras.mo... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import common_fn as cf
plt.rcParams["svg.hashsalt"]=0
#Input parms
test_lim_arr=np.empty([0,2])
for llim in np.arange(0,1,0.2):
for ulim in np.arange(llim+0.1,1,0.2):
test_lim_arr=np.append(test_lim_arr,[[llim,ulim]],axis=0)
parm_format... | [
"common_fn.mkdirs",
"common_fn.eq_values",
"common_fn.timeseries",
"numpy.array",
"numpy.append",
"numpy.empty",
"common_fn.heatmap_eqvparm",
"numpy.arange"
] | [((152, 168), 'numpy.empty', 'np.empty', (['[0, 2]'], {}), '([0, 2])\n', (160, 168), True, 'import numpy as np\n'), ((180, 200), 'numpy.arange', 'np.arange', (['(0)', '(1)', '(0.2)'], {}), '(0, 1, 0.2)\n', (189, 200), True, 'import numpy as np\n'), ((409, 455), 'numpy.array', 'np.array', (["['l_lim_testTpro', 'u_lim_te... |
import pprint
from tkinter import messagebox
from edit.editRF2files import readCar, readTrack, readOpponents
def dummyRF2(online, settings, _password=None):
"""
Function that accesses the same data files and dumps what rF2 would do with it
"""
pp = "This is the result of the 'Dummy_rF2' checkbox on t... | [
"tkinter.messagebox.askokcancel",
"edit.editRF2files.readTrack",
"pprint.pformat",
"edit.editRF2files.readCar",
"edit.editRF2files.readOpponents"
] | [((879, 917), 'tkinter.messagebox.askokcancel', 'messagebox.askokcancel', (['"""Settings"""', 'pp'], {}), "('Settings', pp)\n", (901, 917), False, 'from tkinter import messagebox\n'), ((763, 797), 'pprint.pformat', 'pprint.pformat', (['settings'], {'indent': '(2)'}), '(settings, indent=2)\n', (777, 797), False, 'import... |
from django.contrib.auth import get_user_model
from django.contrib.auth.decorators import login_required, user_passes_test
from django.shortcuts import render, get_object_or_404
from home_logs.property.models import House, Space
from home_logs.custom_auth.models import Token
def allowed(user):
CustomUser = get_u... | [
"django.shortcuts.render",
"django.contrib.auth.get_user_model",
"home_logs.property.models.House.objects.filter",
"django.shortcuts.get_object_or_404",
"home_logs.property.models.House.objects.get",
"django.contrib.auth.decorators.user_passes_test",
"home_logs.custom_auth.models.Token.objects.filter",
... | [((402, 456), 'django.contrib.auth.decorators.user_passes_test', 'user_passes_test', (['allowed'], {'login_url': '"""user:auth_login"""'}), "(allowed, login_url='user:auth_login')\n", (418, 456), False, 'from django.contrib.auth.decorators import login_required, user_passes_test\n'), ((648, 702), 'django.contrib.auth.d... |
import sys
import os
from to_led import to_led
PATH = "imagenes"
n_leds = {
"tierra": 25,
"marte": 25,
"jupiter": 25,
"saturno": 50,
"menatwork": 40,
}
allfiles = os.listdir(PATH)
for fn in allfiles:
if "flat" in fn:
continue
outfilename = fn.rsplit(".", 1)[0] + "_flat.png"
... | [
"os.listdir",
"os.path.join"
] | [((186, 202), 'os.listdir', 'os.listdir', (['PATH'], {}), '(PATH)\n', (196, 202), False, 'import os\n'), ((496, 518), 'os.path.join', 'os.path.join', (['PATH', 'fn'], {}), '(PATH, fn)\n', (508, 518), False, 'import os\n')] |
import laurelin
def test_1_brackets():
output = laurelin.balanced_brackets("[[]]({}[])")
assert output == True
def test_2_brackets():
output = laurelin.balanced_brackets("[[({}[])")
assert output == False
def test_3_brackets():
output = laurelin.balanced_brackets("")
assert output == True
... | [
"laurelin.balanced_brackets"
] | [((54, 94), 'laurelin.balanced_brackets', 'laurelin.balanced_brackets', (['"""[[]]({}[])"""'], {}), "('[[]]({}[])')\n", (80, 94), False, 'import laurelin\n'), ((159, 197), 'laurelin.balanced_brackets', 'laurelin.balanced_brackets', (['"""[[({}[])"""'], {}), "('[[({}[])')\n", (185, 197), False, 'import laurelin\n'), ((2... |
from flask import *
from flask_autoindex import AutoIndex
from werkzeug.utils import secure_filename
import os
UPLOAD_FOLDER = "/home/<hmmm>"
# pls change this, thanks!
ALLOWED_EXTENSIONS = {'txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif'}
app = Flask(__name__)
AutoIndex(app, browse_root=UPLOAD_FOLDER)
app.config['UPLOAD... | [
"flask_autoindex.AutoIndex",
"os.path.join",
"werkzeug.utils.secure_filename"
] | [((260, 301), 'flask_autoindex.AutoIndex', 'AutoIndex', (['app'], {'browse_root': 'UPLOAD_FOLDER'}), '(app, browse_root=UPLOAD_FOLDER)\n', (269, 301), False, 'from flask_autoindex import AutoIndex\n'), ((1075, 1105), 'werkzeug.utils.secure_filename', 'secure_filename', (['file.filename'], {}), '(file.filename)\n', (109... |
from django.contrib.auth import get_permission_codename
from rest_framework.permissions import BasePermission
class ModelHasPermission(BasePermission):
def has_permission(self, request, view):
permissions = {
'list': 'view',
'create': 'add',
'retrieve': 'view',
... | [
"django.contrib.auth.get_permission_codename"
] | [((705, 746), 'django.contrib.auth.get_permission_codename', 'get_permission_codename', (['permission', 'opts'], {}), '(permission, opts)\n', (728, 746), False, 'from django.contrib.auth import get_permission_codename\n')] |
"""
输入M和N计算C(M,N)
"""
import math
def factorial(num):
result = 1
for num in range(1, num + 1):
result *= num
return result
# __name__是Python中一个隐含的变量它代表了模块的名字
# 只有被Python解释器直接执行的模块的名字才是__main__
if __name__ == '__main__':
m = int(input('m = '))
n = int(input('n = '))
print(factorial(m... | [
"math.factorial"
] | [((411, 432), 'math.factorial', 'math.factorial', (['(m - n)'], {}), '(m - n)\n', (425, 432), False, 'import math\n'), ((369, 386), 'math.factorial', 'math.factorial', (['m'], {}), '(m)\n', (383, 386), False, 'import math\n'), ((390, 407), 'math.factorial', 'math.factorial', (['n'], {}), '(n)\n', (404, 407), False, 'im... |
from thop import profile
import torch
from .network_factory.resnet_feature import BackBone_ResNet
from .network_factory.mobilenet_v2_feature import BackBone_MobileNet
from .network_factory.part_group_network import Part_Group_Network
from .network_factory.pose_hrnet import BackBone_HRNet
from myutils import get_mod... | [
"logging.getLogger",
"torch.randn",
"thop.profile"
] | [((356, 383), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (373, 383), False, 'import logging\n'), ((1514, 1585), 'torch.randn', 'torch.randn', (['(1)', '(3)', 'config.model.input_size.h', 'config.model.input_size.w'], {}), '(1, 3, config.model.input_size.h, config.model.input_size.w)\n... |
import torch
import numpy as np
from bc.dataset.dataset_lmdb import DatasetReader
from sim2real.augmentation import Augmentation
from sim2real.transformations import ImageTransform
CHANNEL2SPAN = {'depth': 1, 'rgb': 3, 'mask': 1}
class Frames:
def __init__(self,
path,
channels=... | [
"numpy.swapaxes",
"torch.tensor",
"sim2real.augmentation.Augmentation.crop",
"bc.dataset.dataset_lmdb.DatasetReader",
"sim2real.augmentation.Augmentation",
"sim2real.transformations.ImageTransform.sample_params",
"torch.cat"
] | [((1069, 1103), 'bc.dataset.dataset_lmdb.DatasetReader', 'DatasetReader', (['path', 'self.channels'], {}), '(path, self.channels)\n', (1082, 1103), False, 'from bc.dataset.dataset_lmdb import DatasetReader\n'), ((1327, 1353), 'sim2real.augmentation.Augmentation', 'Augmentation', (['augmentation'], {}), '(augmentation)\... |
import json
import math
import string
import yaml
import resttest
import unittest
from resttest import *
class TestRestTest(unittest.TestCase):
""" Tests to test overall REST testing framework, how meta is that? """
def test_analyze_benchmark(self):
""" Test analyzing benchmarks to compute aggregates... | [
"unittest.main",
"resttest.parse_headers"
] | [((3336, 3351), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3349, 3351), False, 'import unittest\n'), ((2605, 2641), 'resttest.parse_headers', 'resttest.parse_headers', (['headerstring'], {}), '(headerstring)\n', (2627, 2641), False, 'import resttest\n'), ((2937, 2963), 'resttest.parse_headers', 'resttest.pars... |
"""
train_model.py
Description: code used to train neural network over UrbanSound8k processed data.
Takes three arguments: --epochs (int > 0)
Ex: python train_model.py --epochs 5
"""
#######################################
# Import modules
from data_utils import *
import copy
import argparse
import os
from glob im... | [
"tensorflow.keras.callbacks.LearningRateScheduler",
"tensorflow.io.FixedLenFeature",
"tensorflow.io.decode_raw",
"copy.deepcopy",
"tensorflow.keras.losses.CategoricalCrossentropy",
"tensorflow.keras.layers.GlobalAveragePooling2D",
"os.remove",
"os.path.exists",
"argparse.ArgumentParser",
"pandas.D... | [((631, 656), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (654, 656), False, 'import argparse\n'), ((1508, 1564), 'tensorflow.io.parse_single_example', 'tf.io.parse_single_example', (['example', 'feature_description'], {}), '(example, feature_description)\n', (1534, 1564), True, 'import tens... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File : 0_hello_world.py
@Time : 2020/07/28 17:57:16
@Author : <NAME>
@Version : 1.0
@Contact : <EMAIL>
@Desc : tesserocr路径下不能有中文,否则会报错
'''
# here put the import lib
import tesserocr
from PIL import Image
img = Image.open(r'example/0_Basic_us... | [
"PIL.Image.open",
"tesserocr.image_to_text"
] | [((289, 376), 'PIL.Image.open', 'Image.open', (['"""example/0_Basic_usage_of_the_library/tesserocr/pic/0_hello_world.png"""'], {}), "(\n 'example/0_Basic_usage_of_the_library/tesserocr/pic/0_hello_world.png')\n", (299, 376), False, 'from PIL import Image\n'), ((381, 409), 'tesserocr.image_to_text', 'tesserocr.image_... |
"""
Copyright 2016 <NAME>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distrib... | [
"configparser.ConfigParser"
] | [((598, 644), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {'allow_no_value': '(True)'}), '(allow_no_value=True)\n', (623, 644), False, 'import configparser\n')] |
"""
This code is modified by <NAME> from <NAME>'s repository.
https://github.com/linjieli222/VQA_ReGAT
"""
from __future__ import print_function
import os
import sys
import json
import numpy as np
from utils import find_unicode
import argparse
def create_w2v_embedding_init(idx2word, w2v_file):
word2emb = {}
wi... | [
"utils.find_unicode",
"argparse.ArgumentParser",
"os.path.join",
"numpy.array",
"numpy.random.uniform",
"json.load",
"numpy.save"
] | [((2105, 2130), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2128, 2130), False, 'import argparse\n'), ((2303, 2361), 'os.path.join', 'os.path.join', (['opt.data_path', "(opt.data_name + '_vocab.json')"], {}), "(opt.data_path, opt.data_name + '_vocab.json')\n", (2315, 2361), False, 'import o... |
# Copyright (c) 2021 by Cisco Systems, Inc.
# All rights reserved.
"""
This script executes show version on the router and prints the result.
Verify:
check for syslog: 'Show version successful'
"""
import re
from iosxr.xrcli.xrcli_helper import *
from cisco.script_mgmt import xrlog
syslog = xrlog.getSysLogger('tes... | [
"cisco.script_mgmt.xrlog.getSysLogger",
"re.search"
] | [((297, 340), 'cisco.script_mgmt.xrlog.getSysLogger', 'xrlog.getSysLogger', (['"""test_cli_show_version"""'], {}), "('test_cli_show_version')\n", (315, 340), False, 'from cisco.script_mgmt import xrlog\n'), ((607, 651), 're.search', 're.search', (['"""[^Version ]*$"""', "result['output']"], {}), "('[^Version ]*$', resu... |
# fileio_backends.py
#
# This file is part of scqubits.
#
# Copyright (c) 2019, <NAME> and <NAME>
# 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.
#######################################################... | [
"scqubits.utils.misc.Required",
"scqubits.io_utils.fileio.read",
"scqubits.utils.misc.to_expression_or_string",
"csv.writer",
"os.path.splitext",
"re.match",
"h5py.File",
"scqubits.io_utils.fileio.IOData",
"ast.literal_eval",
"scqubits.io_utils.fileio.write",
"numpy.savetxt",
"numpy.loadtxt",
... | [((3709, 3739), 'scqubits.utils.misc.Required', 'utils.Required', ([], {'h5py': '_HAS_H5PY'}), '(h5py=_HAS_H5PY)\n', (3723, 3739), True, 'import scqubits.utils.misc as utils\n'), ((6936, 6966), 'scqubits.utils.misc.Required', 'utils.Required', ([], {'h5py': '_HAS_H5PY'}), '(h5py=_HAS_H5PY)\n', (6950, 6966), True, 'impo... |
from proxylists import get_proxies
proxies = get_proxies()
print(proxies)
| [
"proxylists.get_proxies"
] | [((47, 60), 'proxylists.get_proxies', 'get_proxies', ([], {}), '()\n', (58, 60), False, 'from proxylists import get_proxies\n')] |
import requests
x = requests.post('REPLACE_WITH_HelloWorldApi_URL')
result = x.json()
url = result['url']
fields = result['fields']
with open('/home/ec2-user/environment/REPLACE_WITH_YOUR_PHOTO.jpg', 'rb') as f:
files = {'file':('file',f)}
http_response = requests.post(url,data=fields,files=files)
print (u... | [
"requests.post"
] | [((21, 68), 'requests.post', 'requests.post', (['"""REPLACE_WITH_HelloWorldApi_URL"""'], {}), "('REPLACE_WITH_HelloWorldApi_URL')\n", (34, 68), False, 'import requests\n'), ((268, 312), 'requests.post', 'requests.post', (['url'], {'data': 'fields', 'files': 'files'}), '(url, data=fields, files=files)\n', (281, 312), Fa... |
"""
Quantization module tests
"""
import platform
import unittest
from transformers import AutoModel
from txtai.pipeline import HFModel, HFPipeline
class TestQuantization(unittest.TestCase):
"""
Quantization tests.
"""
@unittest.skipIf(platform.system() == "Darwin", "Quantized models not supported... | [
"transformers.AutoModel.from_pretrained",
"platform.system",
"txtai.pipeline.HFPipeline",
"txtai.pipeline.HFModel"
] | [((448, 481), 'txtai.pipeline.HFModel', 'HFModel', ([], {'quantize': '(True)', 'gpu': '(False)'}), '(quantize=True, gpu=False)\n', (455, 481), False, 'from txtai.pipeline import HFModel, HFPipeline\n'), ((833, 920), 'txtai.pipeline.HFPipeline', 'HFPipeline', (['"""text-classification"""', '"""google/bert_uncased_L-2_H-... |
from blesuite.pybt.gap import GAP
import blesuite.pybt.att as att
import logging
log = logging.getLogger(__name__)
# log.addHandler(logging.NullHandler())
class BTEventHandler(object):
"""
BTEventHandler is a event handling class passed to the BLEConnectionManager in order to
have user-controlled callbac... | [
"logging.getLogger",
"blesuite.pybt.gap.GAP"
] | [((88, 115), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (105, 115), False, 'import logging\n'), ((1739, 1744), 'blesuite.pybt.gap.GAP', 'GAP', ([], {}), '()\n', (1742, 1744), False, 'from blesuite.pybt.gap import GAP\n')] |
import zmq
from datetime import datetime
from time import sleep
host = '127.0.0.1'
port = 6789
context = zmq.Context()
client = context.socket(zmq.REQ)
client.connect("tcp://%s:%s" % (host, port))
print('Czas uruchomienia klienta:', datetime.utcnow())
while True:
sleep(5)
request = b'time'
client.send(requ... | [
"zmq.Context",
"time.sleep",
"datetime.datetime.utcnow"
] | [((106, 119), 'zmq.Context', 'zmq.Context', ([], {}), '()\n', (117, 119), False, 'import zmq\n'), ((234, 251), 'datetime.datetime.utcnow', 'datetime.utcnow', ([], {}), '()\n', (249, 251), False, 'from datetime import datetime\n'), ((269, 277), 'time.sleep', 'sleep', (['(5)'], {}), '(5)\n', (274, 277), False, 'from time... |
# =============================================================================
# Covid-19 : graph of Covid-19 spreading in The Netherlands
# =============================================================================
# version 1: March 25th, 2020 <NAME>
# data input: www.rivm.nl (already processed by Dashboard_NL_t... | [
"pickle.load",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
] | [((966, 988), 'pickle.load', 'pickle.load', (['pickle_in'], {}), '(pickle_in)\n', (977, 988), False, 'import pickle\n'), ((2126, 2140), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (2138, 2140), True, 'import matplotlib.pyplot as plt\n'), ((2877, 2887), 'matplotlib.pyplot.show', 'plt.show', ([], {}),... |
import torch
import torch.nn as nn
import sys
import json2
import numpy as np
def get_flops(model, input_shape=(3, 224, 224)):
list_conv = []
def conv_hook(self, input, output):
batch_size, input_channels, input_height, input_width = input[0].size()
output_channels, output_height, output_width... | [
"torch.rand",
"numpy.random.randint",
"pdb.set_trace"
] | [((2432, 2447), 'pdb.set_trace', 'pdb.set_trace', ([], {}), '()\n', (2445, 2447), False, 'import pdb\n'), ((1323, 1347), 'torch.rand', 'torch.rand', (['*input_shape'], {}), '(*input_shape)\n', (1333, 1347), False, 'import torch\n'), ((2818, 2838), 'numpy.random.randint', 'np.random.randint', (['(4)'], {}), '(4)\n', (28... |
#!/usr/bin/env python3
#
# Short description of the program/script's operation/function.
#
import sys
import argparse
import os
import re
import subprocess
import time
import shutil
import filecmp
FILENAME = os.path.basename(sys.argv[0])
class ArgumentParserUsage(argparse.ArgumentParser):
"""Argparse override to... | [
"os.path.exists",
"shutil.move",
"subprocess.Popen",
"time.strftime",
"os.path.splitext",
"os.getcwd",
"os.path.isfile",
"sys.stderr.write",
"subprocess.call",
"os.path.basename",
"sys.exit",
"filecmp.cmp"
] | [((210, 239), 'os.path.basename', 'os.path.basename', (['sys.argv[0]'], {}), '(sys.argv[0])\n', (226, 239), False, 'import os\n'), ((403, 444), 'sys.stderr.write', 'sys.stderr.write', (["('error: %s\\n' % message)"], {}), "('error: %s\\n' % message)\n", (419, 444), False, 'import sys\n'), ((489, 500), 'sys.exit', 'sys.... |
from pyvista import examples
dataset = examples.download_honolulu() # doctest:+SKIP
| [
"pyvista.examples.download_honolulu"
] | [((39, 67), 'pyvista.examples.download_honolulu', 'examples.download_honolulu', ([], {}), '()\n', (65, 67), False, 'from pyvista import examples\n')] |
from machine.utils.collections import CaseInsensitiveDict
from machine.utils import sizeof_fmt
from tests.singletons import FakeSingleton
def test_Singleton():
c = FakeSingleton()
c2 = FakeSingleton()
assert c == c2
def test_CaseInsensitiveDict():
d = CaseInsensitiveDict({'foo': 'bar'})
assert '... | [
"tests.singletons.FakeSingleton",
"machine.utils.collections.CaseInsensitiveDict",
"machine.utils.sizeof_fmt"
] | [((170, 185), 'tests.singletons.FakeSingleton', 'FakeSingleton', ([], {}), '()\n', (183, 185), False, 'from tests.singletons import FakeSingleton\n'), ((195, 210), 'tests.singletons.FakeSingleton', 'FakeSingleton', ([], {}), '()\n', (208, 210), False, 'from tests.singletons import FakeSingleton\n'), ((272, 307), 'machi... |
'''
This File Provides the Funktions for the Montecarlo simulation
To start use MLG.Start
'''
from MLG import path,default_table, message_folder, Version,Subversion
from MLG.Simulation import RawData
from MLG.Simulation import RealData
from MLG.Modeling import fitting_micro , fitting_motion
from MLG.Math import... | [
"MLG.Simulation.RealData.loadRealData",
"MLG.Math.percentile",
"datetime.datetime.today",
"os.remove",
"time.ctime",
"numpy.where",
"numpy.stack",
"numpy.random.seed",
"os.system",
"glob.glob",
"pickle.load",
"time.time",
"MLG.Simulation.RawData.Data",
"MLG.Modeling.fitting_micro.Fit_Micro... | [((9901, 9927), 'pickle.dump', 'pickle.dump', (['MC_Results', 'f'], {}), '(MC_Results, f)\n', (9912, 9927), False, 'import pickle\n'), ((11251, 11265), 'pickle.load', 'pickle.load', (['f'], {}), '(f)\n', (11262, 11265), False, 'import pickle\n'), ((14880, 14891), 'time.time', 'time.time', ([], {}), '()\n', (14889, 1489... |
import retrosheetgl as gl
import glutils
# Find instances of pitchers saving both games in a doubleheader
# -- finds doubles by putting all saves in a huge list; this is very
# inefficient and doesn't take advantage of the sorted nature of
# gamelogs (could reset the list at the start of each day). But
# we f... | [
"retrosheetgl.gamelogs",
"glutils.getplayername",
"glutils.getentity"
] | [((395, 418), 'retrosheetgl.gamelogs', 'gl.gamelogs', (['(1950)', '(2019)'], {}), '(1950, 2019)\n', (406, 418), True, 'import retrosheetgl as gl\n'), ((734, 784), 'glutils.getentity', 'glutils.getentity', (['pitcher', 'doubles_by_pitcher', '[]'], {}), '(pitcher, doubles_by_pitcher, [])\n', (751, 784), False, 'import gl... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.11 on 2018-05-31 13:17
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import rdf_io.models
class Migration(migrations.Migration):
dependencies = [
('rdf_io', '0002_auto_20170810_2351'),
... | [
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.ManyToManyField",
"django.db.models.FileField",
"django.db.models.DateTimeField",
"django.db.models.AutoField",
"django.db.models.URLField",
"django.db.models.CharField"
] | [((5949, 6088), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'blank': '(True)', 'null': '(True)', 'on_delete': 'django.db.models.deletion.CASCADE', 'to': '"""rdf_io.Namespace"""', 'verbose_name': '"""namespace"""'}), "(blank=True, null=True, on_delete=django.db.models.\n deletion.CASCADE, to='rdf_io.Nam... |
import tensorflow as tf
import random
def parse_function (fname_in, fname_label, nchans = 672, nviews = 1160, header = 8369) :
imagestring = tf.strings.substr(tf.io.read_file (fname_in), pos=header, len=nchans*nviews*4)
image = tf.reshape(tf.io.decode_raw (imagestring, tf.float32 ), [nviews, nchans, 1])
label... | [
"tensorflow.device",
"random.sample",
"tensorflow.data.Dataset.from_tensor_slices",
"tensorflow.io.read_file",
"tensorflow.math.reduce_max",
"tensorflow.io.decode_raw",
"tensorflow.squeeze",
"tensorflow.math.reduce_min"
] | [((1110, 1135), 'tensorflow.math.reduce_max', 'tf.math.reduce_max', (['image'], {}), '(image)\n', (1128, 1135), True, 'import tensorflow as tf\n'), ((1148, 1173), 'tensorflow.math.reduce_min', 'tf.math.reduce_min', (['image'], {}), '(image)\n', (1166, 1173), True, 'import tensorflow as tf\n'), ((1471, 1512), 'random.sa... |
# -*- coding: utf-8 -*-
import sys
def printf(*objects, sep=' ', end='\n', file=sys.stdout):
enc = file.encoding
if enc == 'UTF-8':
print(*objects, sep=sep, end=end, file=file)
else:
f = lambda obj: str(obj).encode(enc, errors='backslashreplace').decode(enc)
print(*map(f, objects),... | [
"requests.post",
"robobrowser.RoboBrowser",
"requests.Session",
"io.BytesIO",
"os.remove",
"os.path.exists",
"subprocess.Popen",
"collections.OrderedDict",
"hashlib.md5",
"os.path.splitext",
"PIL.Image.open",
"urllib.parse.urlparse",
"os.makedirs",
"os.path.join",
"os.path.realpath",
"... | [((5699, 5757), 'subprocess.Popen', 'subprocess.Popen', (['command'], {'stdout': 'DEVNULL', 'bufsize': '(10 ** 8)'}), '(command, stdout=DEVNULL, bufsize=10 ** 8)\n', (5715, 5757), False, 'import subprocess\n'), ((6302, 6311), 'requests.Session', 'Session', ([], {}), '()\n', (6309, 6311), False, 'from requests import Se... |
# -*- coding: utf-8 -*
import asyncio
import gzip
import io
import tornado
import tornado.ioloop
from tornado.web import RequestHandler as TornadoRequestHandler
from tornado.web import asynchronous
from kwikapi import BaseRequest, BaseResponse, BaseRequestHandler
from requests.structures import CaseInsensitiveDict
... | [
"requests.structures.CaseInsensitiveDict",
"deeputil.Dummy",
"io.BytesIO",
"tornado.ioloop.IOLoop.current",
"kwikapi.BaseRequestHandler",
"gzip.GzipFile"
] | [((360, 367), 'deeputil.Dummy', 'Dummy', ([], {}), '()\n', (365, 367), False, 'from deeputil import Dummy\n'), ((999, 1020), 'requests.structures.CaseInsensitiveDict', 'CaseInsensitiveDict', ([], {}), '()\n', (1018, 1020), False, 'from requests.structures import CaseInsensitiveDict\n'), ((2540, 2718), 'kwikapi.BaseRequ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2014 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the L... | [
"plaso.preprocessors.windows.WindowsSystemRootPath",
"plaso.preprocessors.windows.WindowsSystemRegistryPath",
"dfvfs.helpers.file_system_searcher.FileSystemSearcher",
"plaso.preprocessors.windows.WindowsVersion",
"os.path.join",
"plaso.artifacts.knowledge_base.KnowledgeBase",
"plaso.preprocessors.window... | [((9353, 9368), 'unittest.main', 'unittest.main', ([], {}), '()\n', (9366, 9368), False, 'import unittest\n'), ((1743, 1785), 'dfvfs.path.fake_path_spec.FakePathSpec', 'fake_path_spec.FakePathSpec', ([], {'location': 'u"""/"""'}), "(location=u'/')\n", (1770, 1785), False, 'from dfvfs.path import fake_path_spec\n'), ((1... |
#!/usr/bin/env python
import scrapy
from scrapy.http import Request
import csv
import os
from selectorlib import Extractor
import re
class AlibabaCrawlerSpider(scrapy.Spider):
name = 'alibaba_crawler'
allowed_domains = ['alibaba.com']
start_urls = ['http://alibaba.com/']
extractor = Extractor.from_ya... | [
"csv.DictReader",
"scrapy.http.Request",
"os.path.dirname",
"scrapy.Request",
"re.sub",
"re.findall"
] | [((350, 375), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (365, 375), False, 'import os\n'), ((599, 630), 'csv.DictReader', 'csv.DictReader', (['search_keywords'], {}), '(search_keywords)\n', (613, 630), False, 'import csv\n'), ((1527, 1598), 're.sub', 're.sub', (['"""(^.*?&page\\\\=)(\\\\... |
"""
API function for retrieving course blocks data
"""
import lms.djangoapps.course_blocks.api as course_blocks_api
from lms.djangoapps.course_blocks.transformers.access_denied_filter import AccessDeniedMessageFilterTransformer
from lms.djangoapps.course_blocks.transformers.hidden_content import HiddenContentTransfor... | [
"lms.djangoapps.course_blocks.transformers.hidden_content.HiddenContentTransformer",
"openedx.core.djangoapps.content.block_structure.transformers.BlockStructureTransformers",
"lms.djangoapps.course_blocks.transformers.access_denied_filter.AccessDeniedMessageFilterTransformer",
"lms.djangoapps.course_blocks.a... | [((3139, 3167), 'openedx.core.djangoapps.content.block_structure.transformers.BlockStructureTransformers', 'BlockStructureTransformers', ([], {}), '()\n', (3165, 3167), False, 'from openedx.core.djangoapps.content.block_structure.transformers import BlockStructureTransformers\n'), ((5126, 5362), 'lms.djangoapps.course_... |
import sys
import datetime as pydatetime
import pytz
import collections
import time
#sys.path.append('/usr/local/datacollect2/lib')
from limatix.dc_value import stringvalue
from limatix.dc_value import hrefvalue
from limatix import xmldoc
gpxcache=None
gpxtimescache=None
def argmin(iterable):
return min(enume... | [
"pytz.timezone",
"collections.OrderedDict",
"time.strptime",
"limatix.xmldoc.xmldoc.loadfile",
"datetime.timedelta",
"limatix.dc_value.hrefvalue.fromxml"
] | [((1676, 1703), 'pytz.timezone', 'pytz.timezone', (['timezone_str'], {}), '(timezone_str)\n', (1689, 1703), False, 'import pytz\n'), ((570, 595), 'collections.OrderedDict', 'collections.OrderedDict', ([], {}), '()\n', (593, 595), False, 'import collections\n'), ((2088, 2121), 'datetime.timedelta', 'pydatetime.timedelta... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
from fantersy import Fantersy
from color import Color
import tkinter
import tkinter.filedialog
class Client:
"""
Fantersy Client.
"""
@classmethod
def execute(cls):
"""
Execute client.
"""
config_path = cls.__select_... | [
"fantersy.Fantersy",
"tkinter.filedialog.askopenfilename",
"tkinter.Tk"
] | [((339, 360), 'fantersy.Fantersy', 'Fantersy', (['config_path'], {}), '(config_path)\n', (347, 360), False, 'from fantersy import Fantersy\n'), ((1113, 1125), 'tkinter.Tk', 'tkinter.Tk', ([], {}), '()\n', (1123, 1125), False, 'import tkinter\n'), ((1165, 1201), 'tkinter.filedialog.askopenfilename', 'tkinter.filedialog.... |
import cv2
from albumentations import Compose, PadIfNeeded, ShiftScaleRotate, ImageCompression, KeypointParams, \
LongestMaxSize
from albumentations.imgaug.transforms import IAAAffine
class COCOTransformation:
def __init__(self, width, height):
self.aug = Compose([
ShiftScaleRotate(p=0.5, ... | [
"albumentations.ShiftScaleRotate",
"albumentations.ImageCompression",
"albumentations.PadIfNeeded",
"albumentations.KeypointParams",
"albumentations.imgaug.transforms.IAAAffine",
"albumentations.LongestMaxSize"
] | [((296, 391), 'albumentations.ShiftScaleRotate', 'ShiftScaleRotate', ([], {'p': '(0.5)', 'rotate_limit': '(5)', 'scale_limit': '(0.05)', 'border_mode': 'cv2.BORDER_CONSTANT'}), '(p=0.5, rotate_limit=5, scale_limit=0.05, border_mode=cv2.\n BORDER_CONSTANT)\n', (312, 391), False, 'from albumentations import Compose, P... |
import sqlite3
from bottle import route, run, debug, template, request, static_file, error
# only needed when you run Bottle on mod_wsgi
from bottle import default_app
@route('/todo')
def todo_list():
conn = sqlite3.connect('allergytest.db')
c = conn.cursor()
c.execute("SELECT id, task FROM Applebee_Food... | [
"bottle.static_file",
"bottle.template",
"sqlite3.connect",
"bottle.route",
"bottle.request.GET.get",
"bottle.debug",
"bottle.run",
"bottle.error"
] | [((171, 185), 'bottle.route', 'route', (['"""/todo"""'], {}), "('/todo')\n", (176, 185), False, 'from bottle import route, run, debug, template, request, static_file, error\n'), ((456, 483), 'bottle.route', 'route', (['"""/new"""'], {'method': '"""GET"""'}), "('/new', method='GET')\n", (461, 483), False, 'from bottle i... |
import os
import sys
from openslide_reader import OpenslideReader
import subprocess
__all__ = ("PreprocessReader", )
import logging
logger = logging.getLogger('slideatlas')
from lockfile import LockFile
class PreprocessReader(OpenslideReader):
def __init__(self):
logger.info('PreprocessReader init')
... | [
"logging.getLogger",
"os.path.exists",
"os.path.splitext",
"os.path.join",
"os.environ.copy",
"os.path.split",
"openslide_reader.OpenslideReader",
"lockfile.LockFile",
"subprocess.call",
"os.remove"
] | [((145, 176), 'logging.getLogger', 'logging.getLogger', (['"""slideatlas"""'], {}), "('slideatlas')\n", (162, 176), False, 'import logging\n'), ((1661, 1691), 'os.path.split', 'os.path.split', (["params['fname']"], {}), "(params['fname'])\n", (1674, 1691), False, 'import os\n'), ((1709, 1735), 'os.path.splitext', 'os.p... |
'''
SPIN COATER PROJECT RPM CONTROL SOFTWARE
by <NAME>
Website: https://yetkinakyuz.com
Email: <EMAIL>
'''
##### LIBRARIES #####
import RPi.GPIO as GPIO #RASPBERRY PI GPIO LIBRARY WIKI: https://sourceforge.net/p/raspberry-gpio-python/wiki/Home/
import lcddriver #LCD I2C LIBRARY
impor... | [
"RPi.GPIO.add_event_detect",
"RPi.GPIO.setup",
"RPi.GPIO.output",
"RPi.GPIO.setwarnings",
"time.sleep",
"RPi.GPIO.PWM",
"time.time",
"RPi.GPIO.setmode",
"lcddriver.lcd"
] | [((369, 384), 'lcddriver.lcd', 'lcddriver.lcd', ([], {}), '()\n', (382, 384), False, 'import lcddriver\n'), ((394, 417), 'RPi.GPIO.setwarnings', 'GPIO.setwarnings', (['(False)'], {}), '(False)\n', (410, 417), True, 'import RPi.GPIO as GPIO\n'), ((436, 458), 'RPi.GPIO.setmode', 'GPIO.setmode', (['GPIO.BCM'], {}), '(GPIO... |
#
# Work in progress: Backend interface for salami
#
from __future__ import print_function
# Prefix for screen output
prefix = "salami_gambit:"
# # This will run when this backend is first loaded, i.e. during GAMBIT startup
# print(prefix, "Starting up...")
import salami
KPREDS = {}
SLHA = None
#
# Import SLHA con... | [
"pyslha.readSLHA",
"salami.KPred"
] | [((520, 548), 'pyslha.readSLHA', 'pyslha.readSLHA', (['slha_string'], {}), '(slha_string)\n', (535, 548), False, 'import pyslha\n'), ((2583, 2612), 'salami.KPred', 'salami.KPred', (['energy', 'proskey'], {}), '(energy, proskey)\n', (2595, 2612), False, 'import salami\n')] |
from math import sqrt
def f(a, b):
print(f"{'a':<10}{'b':<10}{'b-a':<10}{'m':<10}{'m²':<15}{'Test m² > a'}")
while b - a > 0.1:
m = (a + b) / 2
print(f"{a:<10}{b:<10}{b-a:<10}{m:<10}{m ** 2:<15}{m ** 2 > a!s}")
if m ** 2 > sqrt(3):
b = m
else:
a = m
... | [
"math.sqrt"
] | [((259, 266), 'math.sqrt', 'sqrt', (['(3)'], {}), '(3)\n', (263, 266), False, 'from math import sqrt\n')] |
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
import numpy as np
setup(
cmdclass = {'build_ext': build_ext},
ext_modules = [Extension("rf_classify_parallel", ["rf_classify_parallel.pyx"])],
extra_compile_args=['/openmp'],
include_dirs ... | [
"distutils.extension.Extension",
"numpy.get_include"
] | [((201, 264), 'distutils.extension.Extension', 'Extension', (['"""rf_classify_parallel"""', "['rf_classify_parallel.pyx']"], {}), "('rf_classify_parallel', ['rf_classify_parallel.pyx'])\n", (210, 264), False, 'from distutils.extension import Extension\n'), ((323, 339), 'numpy.get_include', 'np.get_include', ([], {}), '... |
import unittest
from mygrations.formats.mysql.file_reader.database import database as database_reader
class test_table_1215_regressions(unittest.TestCase):
def test_foreign_key_without_index(self):
""" Discovered that the system was not raising an error for a foreign key that didn't have an index for the t... | [
"mygrations.formats.mysql.file_reader.database.database"
] | [((362, 2070), 'mygrations.formats.mysql.file_reader.database.database', 'database_reader', (['[\'CREATE TABLE `vendors` (`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`));\'\n ,\n """CREATE TABLE `payment_requests_external` (\n `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,\n `account_id` int(... |
#!/usr/bin/env python
from __future__ import division, absolute_import, print_function
from future.builtins import super
from iris_sdk.models.base_resource import BaseResource
from iris_sdk.models.data.covered_rate_centers import CoveredRateCentersData
from iris_sdk.models.rate_center import RateCenter
XPATH_COVERED... | [
"iris_sdk.models.rate_center.RateCenter",
"iris_sdk.models.data.covered_rate_centers.CoveredRateCentersData.__init__",
"future.builtins.super"
] | [((596, 639), 'iris_sdk.models.data.covered_rate_centers.CoveredRateCentersData.__init__', 'CoveredRateCentersData.__init__', (['self', 'self'], {}), '(self, self)\n', (627, 639), False, 'from iris_sdk.models.data.covered_rate_centers import CoveredRateCentersData\n'), ((555, 562), 'future.builtins.super', 'super', ([]... |
import os
from flask import Flask
from dotenv import load_dotenv
load_dotenv()
def create_app():
app = Flask(__name__)
app.config['DEBUG'] = True
app.config['TESTING'] = True
app.config['SQLALCHEMY_DATABASE_URI'] = os.environ['DATABASE_URL']
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
... | [
"flask.Flask",
"dotenv.load_dotenv"
] | [((67, 80), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (78, 80), False, 'from dotenv import load_dotenv\n'), ((111, 126), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (116, 126), False, 'from flask import Flask\n')] |
from remote.remote_util import RemoteMachineShellConnection
from .tuq import QueryTests
import time
from deepdiff import DeepDiff
from membase.api.exception import CBQError
class QueryWindowClauseTests(QueryTests):
def setUp(self):
super(QueryWindowClauseTests, self).setUp()
self.log.info("=======... | [
"time.time",
"time.sleep"
] | [((568, 579), 'time.time', 'time.time', ([], {}), '()\n', (577, 579), False, 'import time\n'), ((632, 643), 'time.time', 'time.time', ([], {}), '()\n', (641, 643), False, 'import time\n'), ((1025, 1038), 'time.sleep', 'time.sleep', (['(2)'], {}), '(2)\n', (1035, 1038), False, 'import time\n')] |
#program to find files and skip directories of a given directory.
import os
print([f for f in os.listdir('/home/students') if os.path.isfile(os.path.join('/home/students', f))])
| [
"os.listdir",
"os.path.join"
] | [((94, 122), 'os.listdir', 'os.listdir', (['"""/home/students"""'], {}), "('/home/students')\n", (104, 122), False, 'import os\n'), ((141, 174), 'os.path.join', 'os.path.join', (['"""/home/students"""', 'f'], {}), "('/home/students', f)\n", (153, 174), False, 'import os\n')] |
'''
@author: FangSun
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.operations.resource_operations as res_ops
def create_onlinechange_vm(test_stub=None, test_obj_dict=None):
cond = res_ops.gen_query_conditions('state', '=', 'Enabled')
co... | [
"zstackwoodpecker.operations.resource_operations.query_resource_with_num",
"zstackwoodpecker.test_lib.lib_ssh_vm_cmd_by_agent",
"zstackwoodpecker.test_lib.lib_create_instance_offering",
"zstackwoodpecker.test_lib.lib_get_cpu_memory_capacity",
"zstackwoodpecker.test_util.test_skip",
"zstackwoodpecker.opera... | [((260, 313), 'zstackwoodpecker.operations.resource_operations.gen_query_conditions', 'res_ops.gen_query_conditions', (['"""state"""', '"""="""', '"""Enabled"""'], {}), "('state', '=', 'Enabled')\n", (288, 313), True, 'import zstackwoodpecker.operations.resource_operations as res_ops\n'), ((325, 387), 'zstackwoodpecker... |
import numpy as np
import os
import cv2
class VideoStartOrEndOutOfBoundsException(RuntimeError):
'''Invalid start or end location in VideoFile'''
class VideoNotFoundException(RuntimeError):
'''Raise when local video file could not be found'''
class VideoCouldNotBeOpenedException(RuntimeError):
'''Raise wh... | [
"os.path.isfile",
"numpy.array",
"cv2.VideoCapture"
] | [((1127, 1153), 'cv2.VideoCapture', 'cv2.VideoCapture', (['file_loc'], {}), '(file_loc)\n', (1143, 1153), False, 'import cv2\n'), ((2552, 2583), 'cv2.VideoCapture', 'cv2.VideoCapture', (['self.file_loc'], {}), '(self.file_loc)\n', (2568, 2583), False, 'import cv2\n'), ((4764, 4777), 'numpy.array', 'np.array', (['ret'],... |
import random
while True:
com = random.choice(["가위", "바위", "보"])
user = input("입력: ")
# 결과 판단
winner = None
if com == "가위":
if user == "가위":
winner = None
elif user == "바위":
winner = "user"
else:
winner = "computer"
elif com == "바위"... | [
"random.choice"
] | [((38, 70), 'random.choice', 'random.choice', (["['가위', '바위', '보']"], {}), "(['가위', '바위', '보'])\n", (51, 70), False, 'import random\n')] |
# Copyright 2020 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Implements the gen subcommand for generating tests. """
from collections import deque
from pathlib import Path
from typing import List, Dict, Set
import ... | [
"steps.initialize_src",
"steps.add_fidl",
"util.white",
"steps.add_src",
"steps.initialize_fidl",
"errors.InvalidTransitionSet"
] | [((1017, 1053), 'util.white', 'white', (['f"""Generating test to: {root}"""'], {}), "(f'Generating test to: {root}')\n", (1022, 1053), False, 'from util import white\n'), ((2238, 2293), 'steps.initialize_fidl', 'initialize_fidl', (['library_name', 'transition.starting_fidl'], {}), '(library_name, transition.starting_fi... |
import chatstats
from plotly import plotly as pyplot
from plotly.graph_objs import Bar, Data, Scatter, Heatmap, Layout, Figure
import punchcard
# for wordcloud
from wordcloud import WordCloud
import numpy as np
from PIL import Image, ImageOps
import random
import os
# TODO: make a Plotter class or something, and ma... | [
"chatstats.corpus",
"chatstats.word_count_by_day",
"chatstats.datetimes",
"chatstats.avg_word_count_by_user",
"chatstats.daily_activity_by_user",
"plotly.graph_objs.Heatmap",
"chatstats.percent_empty_comments_by_user",
"os.path.join",
"chatstats.num_comments_by_day",
"plotly.plotly.plot",
"wordc... | [((513, 553), 'chatstats.num_comments_by_user', 'chatstats.num_comments_by_user', (['comments'], {}), '(comments)\n', (543, 553), False, 'import chatstats\n'), ((711, 773), 'plotly.plotly.plot', 'pyplot.plot', (['data'], {'share': '"""secret"""', 'filename': 'filename'}), "(data, share='secret', filename=filename, **kw... |
import torch
import math
from torch import nn
import torch.nn.functional as F
import os
import sys
sys.path.append(os.path.join(os.getcwd(), '..'))
from config import data_generation_config
# Predicts a 3-length vector [0:2] are x,y translation
# [2] is theta
class TransformPredictionNetwork(nn.Module):
def __ini... | [
"torch.nn.Conv1d",
"torch.nn.ReLU",
"torch.nn.Dropout",
"torch.max",
"torch.sin",
"torch.nn.BatchNorm1d",
"torch.cos",
"torch.bmm",
"torch.arange",
"torch.nn.MaxPool1d",
"torch.nn.init.xavier_uniform_",
"torch.distributions.Normal",
"torch.Tensor",
"torch.clamp",
"torch.cat",
"torch.nn... | [((129, 140), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (138, 140), False, 'import os\n'), ((411, 436), 'torch.nn.Conv1d', 'torch.nn.Conv1d', (['(2)', '(16)', '(1)'], {}), '(2, 16, 1)\n', (426, 436), False, 'import torch\n'), ((458, 484), 'torch.nn.Conv1d', 'torch.nn.Conv1d', (['(16)', '(32)', '(1)'], {}), '(16, 32, ... |
#!/usr/bin/env python3
""" simos_tricore.py
Define OS simulator for tricore architecture.
"""
from angr.calling_conventions import SimCC, register_default_cc, SimRegArg
from .arch_tricore import ArchTRICORE
class SimCCTricore(SimCC):
""" Calling convertion simulator for tricore architecture. """
ARG_REGS = ['d... | [
"angr.calling_conventions.register_default_cc",
"angr.calling_conventions.SimRegArg"
] | [((705, 749), 'angr.calling_conventions.register_default_cc', 'register_default_cc', (['"""TRICORE"""', 'SimCCTricore'], {}), "('TRICORE', SimCCTricore)\n", (724, 749), False, 'from angr.calling_conventions import SimCC, register_default_cc, SimRegArg\n'), ((551, 569), 'angr.calling_conventions.SimRegArg', 'SimRegArg',... |
import numpy
import pandas
from nltk.tag import StanfordNERTagger
# from nltk.tag.corenlp import CoreNLPNERTagger
import os
java_path = "C:/Program Files/Java/jdk-13.0.1/bin/java.exe"
os.environ['JAVAHOME'] = java_path
# TODO: configure these paths!
a1 = 'C:\\Users\\MainUser\\OneDrive\\RAMP-EXTERNAL\\IP-02\\OSTRTA\\m... | [
"pandas.DataFrame",
"nltk.tag.StanfordNERTagger",
"numpy.concatenate",
"pandas.read_excel"
] | [((679, 718), 'pandas.read_excel', 'pandas.read_excel', (['"""./data/source.xlsx"""'], {}), "('./data/source.xlsx')\n", (696, 718), False, 'import pandas\n'), ((756, 780), 'nltk.tag.StanfordNERTagger', 'StanfordNERTagger', (['a1', 'b'], {}), '(a1, b)\n', (773, 780), False, 'from nltk.tag import StanfordNERTagger\n'), (... |
# Copyright (C) 2019 DLR
#
# All rights reserved. This program and the accompanying materials are made
# available under the terms of the 3-Clause BSD License which accompanies this
# distribution, and is available at
# https://opensource.org/licenses/BSD-3-Clause
#
# Contributors:
# <NAME> <<EMAIL>>
# Don't connect w... | [
"rafcon.utils.log.get_logger",
"rafcontpp.model.type_tree.TypeTree"
] | [((474, 498), 'rafcon.utils.log.get_logger', 'log.get_logger', (['__name__'], {}), '(__name__)\n', (488, 498), False, 'from rafcon.utils import log\n'), ((1825, 1841), 'rafcontpp.model.type_tree.TypeTree', 'TypeTree', (['c_type'], {}), '(c_type)\n', (1833, 1841), False, 'from rafcontpp.model.type_tree import TypeTree\n... |
"""Check dependencies in setup.cfg and requirements file are the same."""
import configparser
from pathlib import Path
import yaml
def string_to_dependencies(text: str) -> set:
"""Return the set of pip dependencies from a multi-line string.
Whitespace and empty lines are not significant.
Comment lines a... | [
"yaml.safe_load",
"configparser.ConfigParser",
"pathlib.Path"
] | [((767, 794), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (792, 794), False, 'import configparser\n'), ((2634, 2654), 'yaml.safe_load', 'yaml.safe_load', (['frtd'], {}), '(frtd)\n', (2648, 2654), False, 'import yaml\n'), ((2748, 2768), 'yaml.safe_load', 'yaml.safe_load', (['fwrk'], {}), ... |
from django.shortcuts import render, get_object_or_404, redirect
from .models import Artist,Genre,Categorie,Album,Song
from django.views.generic import ListView, DetailView
def HomePage(request):
return render(request, 'base/base.html')
def LatestSongs(request):
latest_songs = Song.latest_songs.all()
#lat... | [
"django.shortcuts.render",
"django.shortcuts.get_object_or_404"
] | [((208, 241), 'django.shortcuts.render', 'render', (['request', '"""base/base.html"""'], {}), "(request, 'base/base.html')\n", (214, 241), False, 'from django.shortcuts import render, get_object_or_404, redirect\n'), ((406, 494), 'django.shortcuts.render', 'render', (['request', '"""base/list_pages/latest_songs.html"""... |
def shap_Xboost(filename_shap, path, model, X, y):
import shap
import os
import xgboost
from saveloadmodel import save_obj, load_obj
filename_shap = os.path.join(path, filename_shap)
shap_data = load_obj(filename_shap)
if shap_data == None:
f = lambd... | [
"shap.utils.sample",
"shap.explainers.Permutation",
"shap.explainers.Partition",
"saveloadmodel.save_obj",
"os.path.join",
"shap.TreeExplainer",
"shap.utils.hclust",
"shap.maskers.Partition",
"xgboost.DMatrix",
"saveloadmodel.load_obj"
] | [((184, 217), 'os.path.join', 'os.path.join', (['path', 'filename_shap'], {}), '(path, filename_shap)\n', (196, 217), False, 'import os\n'), ((241, 264), 'saveloadmodel.load_obj', 'load_obj', (['filename_shap'], {}), '(filename_shap)\n', (249, 264), False, 'from saveloadmodel import save_obj, load_obj\n'), ((431, 456),... |
import logging
from django import forms
from django.utils.translation import ugettext_lazy as _
from mayan.apps.documents.models import DocumentType
from mayan.apps.metadata.models import MetadataType, DocumentMetadata, DocumentTypeMetadataType
from mayan.apps.acls.models import AccessControlList
logger = logging.get... | [
"logging.getLogger",
"django.utils.translation.ugettext_lazy",
"mayan.apps.metadata.models.DocumentMetadata.objects.all",
"django.forms.CharField",
"mayan.apps.acls.models.AccessControlList.objects.restrict_queryset",
"mayan.apps.documents.models.DocumentType.objects.all",
"mayan.apps.metadata.models.Me... | [((309, 336), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (326, 336), False, 'import logging\n'), ((427, 441), 'django.utils.translation.ugettext_lazy', '_', (['"""Match all"""'], {}), "('Match all')\n", (428, 441), True, 'from django.utils.translation import ugettext_lazy as _\n'), ((... |
from django.shortcuts import render,redirect
from .models import Project,Profile,User
from .forms import newPostForm,ProfileForm,newReviewForm
from django.contrib.auth.decorators import login_required
from rest_framework.response import Response
from rest_framework.views import APIView
from .serializer import ProjectSe... | [
"django.shortcuts.render",
"rest_framework.response.Response",
"django.shortcuts.redirect",
"django.contrib.auth.decorators.login_required"
] | [((409, 453), 'django.contrib.auth.decorators.login_required', 'login_required', ([], {'login_url': '"""/accounts/login/"""'}), "(login_url='/accounts/login/')\n", (423, 453), False, 'from django.contrib.auth.decorators import login_required\n'), ((1059, 1103), 'django.contrib.auth.decorators.login_required', 'login_re... |
from typing import Any, Iterable, Optional
import sqlalchemy as sa
from sqlalchemy import Table, orm
@orm.declarative_mixin
class DeclarativeMixin:
__table__: 'Table'
@orm.declarative_mixin
class InheritedDeclarativeMixin(DeclarativeMixin):
__bases__: Iterable[Any]
@orm.declarative_mixin
class Polymorphi... | [
"sqlalchemy.String"
] | [((527, 540), 'sqlalchemy.String', 'sa.String', (['(40)'], {}), '(40)\n', (536, 540), True, 'import sqlalchemy as sa\n')] |
"""
列车信息模块
时间统一使用:datetime.datetime实例
2019.04.27修改计划:
1. 在列车数据中新增“旅客列车”参数,严格判定是否为旅客列车。增加到currentWidget中。注意,使用checkBox时允许中间状态,即由系统自动判定。默认是这种状态。ok
2. 在列车时刻表数据每一行新增“营业”字段,标记是否办理业务。在currentWidget中新增按钮自动设置所有站是否办理业务。默认全为True。同时修改ctrl+2功能中的筛选条件。
3. 取消Train中所有依据Timetable_new.utility判定类型、判定是否为客车的逻辑,此操作改为需要graph介入。ok
4. 新增类型映射表。... | [
"re.match",
"datetime.timedelta",
"Timetable_new.utility.strToTime",
"Timetable_new.checi3.Checi",
"Timetable_new.utility.stationEqual",
"copy.deepcopy",
"copy.copy",
"bisect.insort",
"cgitb.enable"
] | [((883, 910), 'cgitb.enable', 'cgitb.enable', ([], {'format': '"""text"""'}), "(format='text')\n", (895, 910), False, 'import cgitb\n'), ((27571, 27604), 'datetime.timedelta', 'timedelta', ([], {'days': '(0)', 'seconds': 'ds_int'}), '(days=0, seconds=ds_int)\n', (27580, 27604), False, 'from datetime import datetime, ti... |
import logging
from random import randint
from matplotlib import pyplot as plt
from torch.utils.data import DataLoader
from torchvision.datasets import MNIST
from torchvision.transforms import Compose, ToTensor
from utils import AddGaussianNoise, AddSpeckleNoise
class NoisedMNIST(MNIST):
def __init__(self, root... | [
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.show",
"utils.AddSpeckleNoise",
"torch.utils.data.DataLoader",
"torchvision.transforms.ToTensor",
"logging.info",
"matplotlib.pyplot.subplots",
"utils.AddGaussianNoise"
] | [((1514, 1554), 'logging.info', 'logging.info', (['"""Data set `MNIST` loaded."""'], {}), "('Data set `MNIST` loaded.')\n", (1526, 1554), False, 'import logging\n'), ((1600, 1699), 'torch.utils.data.DataLoader', 'DataLoader', (['self.train_data'], {'batch_size': "self.config['batch_size']", 'shuffle': '(True)', 'num_wo... |
import tensorflow as tf
def PairwiseLog(
user_vec,
subgraph,
item_vec=None,
item_bias=None,
p_item_vec=None,
p_item_bias=None,
n_item_vec=None,
n_item_bias=None,
train=True,
scope="PointwiseMSE",
):
if train:
dot_user_pos = tf.reduce_sum(
tf.multiply(us... | [
"tensorflow.maximum",
"tensorflow.multiply",
"tensorflow.reshape"
] | [((306, 339), 'tensorflow.multiply', 'tf.multiply', (['user_vec', 'p_item_vec'], {}), '(user_vec, p_item_vec)\n', (317, 339), True, 'import tensorflow as tf\n'), ((494, 527), 'tensorflow.multiply', 'tf.multiply', (['user_vec', 'n_item_vec'], {}), '(user_vec, n_item_vec)\n', (505, 527), True, 'import tensorflow as tf\n'... |
from subprocess import check_output
from collections import Iterable
from pprint import pprint
import itertools
import platform
import inspect
GPU_QUERIES = [
'gpu_name',
'driver_version',
# 'vbios_version',
# 'pstate',
'memory.total',
'temperature.gpu',
# 'temperature.memory',
# 'power... | [
"subprocess.check_output",
"inspect.ismodule",
"pprint.pprint"
] | [((2649, 2684), 'inspect.ismodule', 'inspect.ismodule', (['module_or_command'], {}), '(module_or_command)\n', (2665, 2684), False, 'import inspect\n'), ((4573, 4585), 'pprint.pprint', 'pprint', (['info'], {}), '(info)\n', (4579, 4585), False, 'from pprint import pprint\n'), ((1127, 1198), 'subprocess.check_output', 'ch... |
from os import path as osp
import cv2
import numpy as np
import matplotlib.pyplot as plt
from scipy.linalg import lstsq
from scipy.ndimage import gaussian_filter
from scipy import interpolate
import argparse
import sys
sys.path.append("..")
import Basics.params as pr
import Basics.sensorParams as psp
from Basics.Geome... | [
"numpy.sqrt",
"numpy.array",
"numpy.arctan2",
"scipy.ndimage.gaussian_filter",
"sys.path.append",
"numpy.arange",
"numpy.mean",
"numpy.savez",
"scipy.linalg.lstsq",
"argparse.ArgumentParser",
"numpy.ma.masked_where",
"numpy.meshgrid",
"numpy.ones",
"numpy.floor",
"numpy.nonzero",
"nump... | [((220, 241), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (235, 241), False, 'import sys\n'), ((348, 373), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (371, 373), False, 'import argparse\n'), ((988, 1016), 'os.path.join', 'osp.join', (['fn', '"""dataPack.npz"""'], {... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "<EMAIL>"
from proc.arp import ARP
from proc.ip import IP
from proc.ipv6 import IPV6
from proc.util import ProcData
class MAC(ProcData):
"""mac协议 14B+"""
_dst = None
_src = None
_type = None
_data = None
def __init__(... | [
"proc.arp.ARP",
"proc.ip.IP",
"proc.ipv6.IPV6"
] | [((1419, 1439), 'proc.ip.IP', 'IP', (['self._data', 'self'], {}), '(self._data, self)\n', (1421, 1439), False, 'from proc.ip import IP\n'), ((1534, 1555), 'proc.arp.ARP', 'ARP', (['self._data', 'self'], {}), '(self._data, self)\n', (1537, 1555), False, 'from proc.arp import ARP\n'), ((1686, 1708), 'proc.ipv6.IPV6', 'IP... |
from sklearn.metrics import classification_report
from metrics import conlleval
# label_test_file = 'output/MSRA/crf/result.txt'
# eval_file = 'output/MSRA/crf/eval_crf.txt'
# label_test_file = 'output/ywevents/crf/result.txt'
# eval_file = 'output/ywevents/crf/eval_crf.txt'
label_test_file = 'output/ywevents/char... | [
"sklearn.metrics.classification_report",
"metrics.conlleval.return_report"
] | [((969, 1038), 'sklearn.metrics.classification_report', 'classification_report', (['y_test', 'y_pred'], {'digits': '(4)', 'target_names': 'targets'}), '(y_test, y_pred, digits=4, target_names=targets)\n', (990, 1038), False, 'from sklearn.metrics import classification_report\n'), ((1187, 1227), 'metrics.conlleval.retur... |
import hashlib
import sqlite3
def register(user, password):
f = "data/users.db"
db = sqlite3.connect(f)
c = db.cursor()
check_user = "SELECT * FROM user_credentials WHERE username=?"
entry = c.execute(check_user, (user,)).fetchone()
if entry is None:
register_user = "INSERT INTO user_c... | [
"sqlite3.connect",
"hashlib.sha512"
] | [((94, 112), 'sqlite3.connect', 'sqlite3.connect', (['f'], {}), '(f)\n', (109, 112), False, 'import sqlite3\n'), ((630, 648), 'sqlite3.connect', 'sqlite3.connect', (['f'], {}), '(f)\n', (645, 648), False, 'import sqlite3\n'), ((890, 914), 'hashlib.sha512', 'hashlib.sha512', (['password'], {}), '(password)\n', (904, 914... |
import pygame, math, sys
from pygame.locals import *
import time
pygame.font.init()
pygame.display.set_caption("car driving")
TURN_SPEED = 7
ACCELERATION = 10
MAX_FORWARD_SPEED = 3
MAX_REVERSE_SPEED = 2
BG = (0, 75, 100)
disp_x=1200
disp_y=600
screen = pygame.display.set_mode((disp_x,disp_y))
... | [
"random.randint",
"sys.exit",
"pygame.event.get",
"pygame.display.set_mode",
"pygame.display.flip",
"math.sqrt",
"pygame.mixer.Sound",
"pygame.time.Clock",
"pygame.transform.rotate",
"math.cos",
"pygame.font.init",
"pygame.display.set_caption",
"pygame.image.load",
"math.sin",
"pygame.mi... | [((68, 86), 'pygame.font.init', 'pygame.font.init', ([], {}), '()\n', (84, 86), False, 'import pygame, math, sys\n'), ((90, 131), 'pygame.display.set_caption', 'pygame.display.set_caption', (['"""car driving"""'], {}), "('car driving')\n", (116, 131), False, 'import pygame, math, sys\n'), ((275, 316), 'pygame.display.s... |
#!/usr/bin/env python2
# coding: utf-8
import os
import sys
import re
from PIL import Image
ELEMENTS = (
('#', (255, 255, 255)),
('.', (0, 0, 0)),
('~', (255, 255, 0)),
('=', (0, 255, 0)),
('1', (0, 0, 255)),
('2', (0, 255, 255)),
('3', (255, 0, 255)),
)
def convert(srcfile, dstfile, fue... | [
"PIL.Image.open",
"re.compile",
"PIL.Image.new",
"sys.exit",
"re.findall",
"os.remove"
] | [((334, 353), 'PIL.Image.open', 'Image.open', (['srcfile'], {}), '(srcfile)\n', (344, 353), False, 'from PIL import Image\n'), ((994, 1012), 're.compile', 're.compile', (['"""\\\\d+"""'], {}), "('\\\\d+')\n", (1004, 1012), False, 'import re\n'), ((1192, 1225), 'PIL.Image.new', 'Image.new', (['"""RGB"""', '(width, heigh... |
#!usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Application that actually uses Factory Method Pattern and Abstract Factory
Pattern.
"""
__author__ = '<NAME>'
from factory_creator import FancyDocumentCreator, ModernDocumentCreator
def main():
# Get instances from a fancy creator
fancy_creator = FancyDocu... | [
"factory_creator.ModernDocumentCreator.get_instance",
"factory_creator.FancyDocumentCreator.get_instance"
] | [((311, 346), 'factory_creator.FancyDocumentCreator.get_instance', 'FancyDocumentCreator.get_instance', ([], {}), '()\n', (344, 346), False, 'from factory_creator import FancyDocumentCreator, ModernDocumentCreator\n'), ((614, 650), 'factory_creator.ModernDocumentCreator.get_instance', 'ModernDocumentCreator.get_instanc... |
"""
Implements the Perception & Adaline Learning Algorithm
Author: <NAME>
Created: May 18, 2010
"""
import numpy as np
import matplotlib.pyplot as plt
class Perception:
"""first artifical neural classifier
Args:
eta: Learning rate (between 0.0 and 1.0)
n_iter: pas... | [
"numpy.dot",
"matplotlib.pyplot.xlabel",
"numpy.random.RandomState",
"matplotlib.pyplot.ylabel"
] | [((1270, 1310), 'numpy.random.RandomState', 'np.random.RandomState', (['self.random_state'], {}), '(self.random_state)\n', (1291, 1310), True, 'import numpy as np\n'), ((4578, 4618), 'numpy.random.RandomState', 'np.random.RandomState', (['self.random_state'], {}), '(self.random_state)\n', (4599, 4618), True, 'import nu... |
# -*- coding: utf-8 -*-
"""
unittest for GoolabsAPI
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:author: tell-k <<EMAIL>>
:copyright: tell-k. All Rights Reserved.
"""
from __future__ import division, print_function, absolute_import # NOQA
import json
import pytest
import responses
class TestGoo... | [
"json.dumps",
"pytest.raises",
"requests.exceptions.HTTPError"
] | [((7102, 7126), 'pytest.raises', 'pytest.raises', (['HTTPError'], {}), '(HTTPError)\n', (7115, 7126), False, 'import pytest\n'), ((7337, 7366), 'pytest.raises', 'pytest.raises', (['AttributeError'], {}), '(AttributeError)\n', (7350, 7366), False, 'import pytest\n'), ((1761, 1801), 'json.dumps', 'json.dumps', (['expecte... |
# Copyright (c) 2014 Rackspace, 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 wr... | [
"zaqarclient.queues.v1.core.claim_create",
"zaqarclient.queues.v1.message.create_object",
"zaqarclient.queues.v1.core.claim_update",
"zaqarclient.queues.v1.core.claim_delete",
"zaqarclient.queues.v1.core.claim_get"
] | [((1424, 1478), 'zaqarclient.queues.v1.core.claim_get', 'core.claim_get', (['trans', 'req', 'self._queue._name', 'self.id'], {}), '(trans, req, self._queue._name, self.id)\n', (1438, 1478), False, 'from zaqarclient.queues.v1 import core\n'), ((2144, 2250), 'zaqarclient.queues.v1.core.claim_create', 'core.claim_create',... |
from uuid import UUID
from Qt.QtWidgets import QUndoCommand
class RemoveNodes(QUndoCommand):
'''
Removes nodes
'''
def __init__(self, selectedNodes, graph):
super(RemoveNodes, self).__init__()
self.setText("Remove nodes")
self.graph = graph
self.connectionInfo = []
... | [
"uuid.UUID"
] | [((724, 746), 'uuid.UUID', 'UUID', (["nodeJson['uuid']"], {}), "(nodeJson['uuid'])\n", (728, 746), False, 'from uuid import UUID\n'), ((1199, 1221), 'uuid.UUID', 'UUID', (["nodeData['uuid']"], {}), "(nodeData['uuid'])\n", (1203, 1221), False, 'from uuid import UUID\n'), ((863, 891), 'uuid.UUID', 'UUID', (["edgeJson['so... |
from __future__ import division
import numpy as np
from random import shuffle
class Model(object):
def fit(self, data):
raise NotImplementedError
def distance(self, samples):
raise NotImplementedError
class LineModel(Model):
"""
A 2D line model.
"""
def fit(self, data):
... | [
"numpy.where",
"numpy.asarray",
"random.shuffle",
"numpy.concatenate"
] | [((2860, 2876), 'random.shuffle', 'shuffle', (['indices'], {}), '(indices)\n', (2867, 2876), False, 'from random import shuffle\n'), ((2907, 2959), 'numpy.asarray', 'np.asarray', (['[data[i] for i in indices[:min_samples]]'], {}), '([data[i] for i in indices[:min_samples]])\n', (2917, 2959), True, 'import numpy as np\n... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Oct 1 11:37:46 2021
@author: <NAME>
Example for how to read in Nielsen Retail Scanner and Panel data
Input dir_retail and dir_scanner on your own, using your own machine!
"""
# %% Import Libraries
# for the locations and names of file types
import p... | [
"kiltsreader.RetailReader",
"pandas.read_parquet",
"pathlib.Path",
"pathlib.Path.cwd",
"kiltsreader.PanelReader",
"pyarrow.parquet.ParquetFile"
] | [((717, 784), 'pathlib.Path', 'path.Path', (['"""/Volumes/Backup Plus/Scanner_Extracts/SoftDrinkNoCarb/"""'], {}), "('/Volumes/Backup Plus/Scanner_Extracts/SoftDrinkNoCarb/')\n", (726, 784), True, 'import pathlib as path\n'), ((797, 837), 'pathlib.Path', 'path.Path', (['"""/Volumes/Backup Plus/Panel/"""'], {}), "('/Vol... |
#encoding=utf-8
#
import os,cv2,sys
from basicFun import XML,FILES,COCO
from tqdm import tqdm
import numpy as np
class info_count():
def init(self, txt=None):
self.info={}
self.num=0
print('init')
if txt:
with open(txt, 'r') as f:
... | [
"basicFun.FILES.get_sorted_files",
"numpy.sqrt",
"matplotlib.pyplot.xlim",
"tqdm.tqdm",
"os.path.join",
"basicFun.XML.read_objects",
"matplotlib.pyplot.figure",
"pandas.DataFrame",
"seaborn.barplot",
"matplotlib.pyplot.show"
] | [((1232, 1254), 'basicFun.XML.read_objects', 'XML.read_objects', (['path'], {}), '(path)\n', (1248, 1254), False, 'from basicFun import XML, FILES, COCO\n'), ((2717, 2730), 'tqdm.tqdm', 'tqdm', (['allXmls'], {}), '(allXmls)\n', (2721, 2730), False, 'from tqdm import tqdm\n'), ((3517, 3567), 'pandas.DataFrame', 'pd.Data... |
from setuptools import setup
setup(name='featurewiz',
version='0.1a',
description='Data science features toolbox',
url='https://github.com/alexveden/featurewiz',
author='<NAME>',
author_email='<EMAIL>',
license='MIT',
packages=['featurewiz'],
install_requires=[
... | [
"setuptools.setup"
] | [((30, 324), 'setuptools.setup', 'setup', ([], {'name': '"""featurewiz"""', 'version': '"""0.1a"""', 'description': '"""Data science features toolbox"""', 'url': '"""https://github.com/alexveden/featurewiz"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'license': '"""MIT"""', 'packages': "['featurewiz'... |
from flask import request, escape, render_template, redirect, flash, url_for, jsonify, current_app, g
from app.contact import bp
from flask_login import current_user, login_required
from app.contact.forms import ContactForm
from app.contact.email import send_contact_email
from app.auth.forms import LoginForm, Register... | [
"flask.render_template",
"app.contact.bp.route",
"app.auth.forms.RequestPasswordForm",
"flask.flash",
"app.auth.forms.LoginForm",
"flask.url_for",
"app.contact.email.send_contact_email",
"app.auth.forms.RegisterForm",
"app.contact.forms.ContactForm"
] | [((503, 541), 'app.contact.bp.route', 'bp.route', (['"""/"""'], {'methods': "['GET', 'POST']"}), "('/', methods=['GET', 'POST'])\n", (511, 541), False, 'from app.contact import bp\n'), ((410, 421), 'app.auth.forms.LoginForm', 'LoginForm', ([], {}), '()\n', (419, 421), False, 'from app.auth.forms import LoginForm, Regis... |
import unittest
import spark_emr
import spark_emr.util
class TestS3Path(unittest.TestCase):
def test_main(self):
parse = spark_emr.util.S3Path(
"s3://bucket/folder/file.txt")
self.assertEqual(parse.key, "folder/file.txt")
self.assertEqual(parse.file, "file.txt")
self.... | [
"spark_emr.util.S3Path"
] | [((137, 189), 'spark_emr.util.S3Path', 'spark_emr.util.S3Path', (['"""s3://bucket/folder/file.txt"""'], {}), "('s3://bucket/folder/file.txt')\n", (158, 189), False, 'import spark_emr\n'), ((519, 563), 'spark_emr.util.S3Path', 'spark_emr.util.S3Path', (['"""s3://bucket/folder/"""'], {}), "('s3://bucket/folder/')\n", (54... |
import random
def retorno():
resp=input('Deseja executar o programa novamente?[s/n] ')
if(resp=='S' or resp=='s'):
verificar()
else:
print('Processo finalizado com sucesso!')
pass
def cabecalho(titulo):
print('-'*30)
print(' '*9+titulo+' '*15)
print('-'*30)
pa... | [
"random.randint"
] | [((429, 450), 'random.randint', 'random.randint', (['(1)', '(10)'], {}), '(1, 10)\n', (443, 450), False, 'import random\n'), ((450, 471), 'random.randint', 'random.randint', (['(1)', '(10)'], {}), '(1, 10)\n', (464, 471), False, 'import random\n'), ((471, 492), 'random.randint', 'random.randint', (['(1)', '(10)'], {}),... |
# Copyright 2019-2020 <NAME> (Falcons)
# SPDX-License-Identifier: Apache-2.0
#!/usr/bin/env python3
import sys, os
from shutil import copyfile
import subprocess
import unittest
import falconspy
TEST_RDL_FILE = falconspy.FALCONS_DATA_PATH + '/internal/logfiles/20190618_rdltest.rdl'
TEST_RDL_FILE_TMP = '/var/tmp/rdltes... | [
"unittest.main",
"os.remove",
"subprocess.check_output",
"os.path.isfile"
] | [((5084, 5099), 'unittest.main', 'unittest.main', ([], {}), '()\n', (5097, 5099), False, 'import unittest\n'), ((647, 680), 'os.path.isfile', 'os.path.isfile', (['TEST_RDL_FILE_TMP'], {}), '(TEST_RDL_FILE_TMP)\n', (661, 680), False, 'import sys, os\n'), ((881, 925), 'subprocess.check_output', 'subprocess.check_output',... |
#!/usr/bin/env python3
"""Generate a random GURPS Dungeon Fantasy character."""
import argparse
from collections import Counter
import copy
from enum import Enum, auto
import os
import random
import re
from typing import Dict, List, Set, Tuple
import typing
import xml.etree.ElementTree as et
class TraitType(Enum)... | [
"random.choice",
"enum.auto",
"xml.etree.ElementTree.parse",
"argparse.ArgumentParser",
"random.randrange",
"xml.etree.ElementTree.tostring",
"os.path.join",
"collections.Counter",
"os.path.dirname",
"copy.deepcopy",
"re.search"
] | [((346, 352), 'enum.auto', 'auto', ([], {}), '()\n', (350, 352), False, 'from enum import Enum, auto\n'), ((379, 385), 'enum.auto', 'auto', ([], {}), '()\n', (383, 385), False, 'from enum import Enum, auto\n'), ((402, 408), 'enum.auto', 'auto', ([], {}), '()\n', (406, 408), False, 'from enum import Enum, auto\n'), ((42... |
# Author: Copyright (c) 2021 <NAME>
# License: MIT License
"""
Test normla_factor against standard tables of tolerance factors
as published in ISO 16269-6:2014 Annex F.
A sampling of values from the tables is included here for brevity.
"""
import numpy as np
import toleranceinterval.twoside as ts
import unittest
... | [
"numpy.array",
"numpy.ceil",
"toleranceinterval.twoside.normal_factor",
"numpy.arange"
] | [((691, 701), 'numpy.ceil', 'np.ceil', (['x'], {}), '(x)\n', (698, 701), True, 'import numpy as np\n'), ((1478, 1526), 'numpy.array', 'np.array', (['[2, 8, 16, 35, 100, 300, 1000, np.inf]'], {}), '([2, 8, 16, 35, 100, 300, 1000, np.inf])\n', (1486, 1526), True, 'import numpy as np\n'), ((1599, 1615), 'numpy.arange', 'n... |
import logging
from pwdtk.settings import * # noqa: F401,F403
logger = logging.getLogger()
logger.warning("This module is obosolete. Please use pwdtk.settings instead")
| [
"logging.getLogger"
] | [((75, 94), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (92, 94), False, 'import logging\n')] |
#!/usr/bin/env python
# coding: utf-8
import matplotlib.pyplot as plt
import matplotlib.pylab as pylab
import requests
from io import BytesIO
from PIL import Image
import numpy as np
from maskrcnn_benchmark.config import cfg
from predictor import COCODemo
config_file = "../configs/e2e_mask_rcnn_R_50_FPN_1x_synthia.... | [
"matplotlib.pyplot.imshow",
"maskrcnn_benchmark.config.cfg.merge_from_file",
"io.BytesIO",
"maskrcnn_benchmark.config.cfg.merge_from_list",
"requests.get",
"numpy.array",
"predictor.COCODemo",
"matplotlib.pyplot.axis",
"cv2.imread",
"matplotlib.pyplot.show"
] | [((376, 408), 'maskrcnn_benchmark.config.cfg.merge_from_file', 'cfg.merge_from_file', (['config_file'], {}), '(config_file)\n', (395, 408), False, 'from maskrcnn_benchmark.config import cfg\n'), ((440, 485), 'maskrcnn_benchmark.config.cfg.merge_from_list', 'cfg.merge_from_list', (["['MODEL.DEVICE', 'cuda']"], {}), "(['... |
import datetime
import json
import hashlib
import urllib.parse as url
import requests
import pow
class Blockchain(object):
def __init__(self):
self.chain = []
self.pending_transactions = []
self.nodes = set()
self.new_block(100, 1)
def new_block(self, proof, previous_hash=... | [
"hashlib.sha256",
"urllib.parse.urlparse",
"json.dumps",
"requests.get",
"datetime.datetime.now",
"pow.validate_proof"
] | [((1804, 1825), 'urllib.parse.urlparse', 'url.urlparse', (['address'], {}), '(address)\n', (1816, 1825), True, 'import urllib.parse as url\n'), ((2787, 2824), 'requests.get', 'requests.get', (['f"""http://{node}/blocks"""'], {}), "(f'http://{node}/blocks')\n", (2799, 2824), False, 'import requests\n'), ((684, 707), 'da... |
from setuptools import setup
setup(name='pymlpg',
version='0.0.1',
description='Python package for the Meshless Local Petrov Galerkin method',
url='https://github.com/IgorBaratta/pyMLPG',
author='<NAME>',
author_email='<EMAIL>',
license='MIT',
packages=['pymlpg'],
instal... | [
"setuptools.setup"
] | [((30, 352), 'setuptools.setup', 'setup', ([], {'name': '"""pymlpg"""', 'version': '"""0.0.1"""', 'description': '"""Python package for the Meshless Local Petrov Galerkin method"""', 'url': '"""https://github.com/IgorBaratta/pyMLPG"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'license': '"""MIT"""', ... |
from django.core import serializers
from django.contrib.auth.models import User
from janitriapp.models import UserInterest, NewsWebsite
json_serializer = serializers.get_serializer("json")() | [
"django.core.serializers.get_serializer"
] | [((156, 190), 'django.core.serializers.get_serializer', 'serializers.get_serializer', (['"""json"""'], {}), "('json')\n", (182, 190), False, 'from django.core import serializers\n')] |
from tgt_grease.core.Types import Command
from tgt_grease.core import ImportTool
import importlib
class Help(Command):
"""The Help Command for GREASE
Meant to provide a rich CLI Experience to users to enable quick help
"""
purpose = "Provide Help Information"
help = """
Provide help informa... | [
"importlib.import_module"
] | [((847, 877), 'importlib.import_module', 'importlib.import_module', (['route'], {}), '(route)\n', (870, 877), False, 'import importlib\n')] |