code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from flask_script import Manager
from app import application
manager = Manager(application)
# Not sure if I need a database yet
# db = SQLAlchemy(application)
# migrate = Migrate(application, db)
# manager.add_command('db', MigrateCommand)
if __name__ == '__main__':
manager.run()
| [
"flask_script.Manager"
] | [((73, 93), 'flask_script.Manager', 'Manager', (['application'], {}), '(application)\n', (80, 93), False, 'from flask_script import Manager\n')] |
import os
import re
from external.ifeature.codes import readFasta
import argparse
dbName = '~/work/iFeature/myData/uniref50/uniref50db'
ncbidir = '/opt/aci/sw/ncbi-rmblastn/2.9.0_gcc-8.3.1-bxy/bin/'
outputdir = 'out/'
def generatePSSMProfile(fastas, outDir, blastpgp, db):
"""
Generate PSSM file by using the psi-bl... | [
"os.path.exists",
"argparse.ArgumentParser",
"os.mkdir",
"re.sub",
"external.ifeature.codes.readFasta.readFasta",
"os.system",
"os.remove"
] | [((800, 827), 'external.ifeature.codes.readFasta.readFasta', 'readFasta.readFasta', (['fastas'], {}), '(fastas)\n', (819, 827), False, 'from external.ifeature.codes import readFasta\n'), ((1274, 1364), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'usage': '"""it\'s usage tip."""', 'description': '"""gene... |
import numpy as np
import nltk
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
import re
import unicodedata
from word2vec_api import get_word_vector
# ****** Define functions to create average word vectors of paragraphs
def makeFeatureVec(words, index2word_set, num_features=300):
# Fu... | [
"nltk.wordnet.WordNetLemmatizer",
"numpy.add",
"word2vec_api.get_word_vector",
"nltk.tokenize.word_tokenize",
"numpy.zeros",
"numpy.divide"
] | [((454, 496), 'numpy.zeros', 'np.zeros', (['(num_features,)'], {'dtype': '"""float32"""'}), "((num_features,), dtype='float32')\n", (462, 496), True, 'import numpy as np\n'), ((678, 698), 'nltk.tokenize.word_tokenize', 'word_tokenize', (['words'], {}), '(words)\n', (691, 698), False, 'from nltk.tokenize import word_tok... |
"""
File description.
Background management page for regular users and editors to view their articles, comments, favorites and other functions
encoding: utf-8
@author: <NAME>
@contact: <EMAIL>
@software: Pycharm
@time: 2022/1/12
@gituhb: sanxiadaba/pythonBlog
"""
import base64
import os
import time
import traceback
f... | [
"flask.render_template",
"database.comment.Comment",
"common.myLog.listLogger",
"database.users.Users",
"os.remove",
"flask.jsonify",
"database.credit.Credit",
"os.listdir",
"flask.request.form.get",
"common.myLog.dirInDir",
"database.article.Article",
"database.logs.Log",
"common.myLog.allL... | [((817, 826), 'database.article.Article', 'Article', ([], {}), '()\n', (824, 826), False, 'from database.article import Article\n'), ((845, 854), 'database.comment.Comment', 'Comment', ([], {}), '()\n', (852, 854), False, 'from database.comment import Comment\n'), ((872, 880), 'database.credit.Credit', 'Credit', ([], {... |
__author__ = 'tomarovsky'
from Biocrutch.Routines.routine_functions import metaopen
from collections import OrderedDict
import pandas as pd
class Fasta_opener:
def __init__(self, path):
self.path = path
self.lengths = {}
def parse_sequences(self, buffering=None) -> dict:
"""
P... | [
"collections.OrderedDict",
"Biocrutch.Routines.routine_functions.metaopen",
"pandas.DataFrame.from_dict"
] | [((503, 516), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (514, 516), False, 'from collections import OrderedDict\n'), ((577, 613), 'Biocrutch.Routines.routine_functions.metaopen', 'metaopen', (['self.path', '"""rt"""', 'buffering'], {}), "(self.path, 'rt', buffering)\n", (585, 613), False, 'from Biocru... |
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | [
"paddle.fluid.contrib.reader.distributed_batch_reader",
"sys.setdefaultencoding",
"utils.init.init_checkpoint",
"multiprocessing.cpu_count",
"numpy.array",
"paddle.fluid.Executor",
"scipy.stats.pearsonr",
"paddle.fluid.ExecutionStrategy",
"os.path.exists",
"utils.args.print_arguments",
"argparse... | [((1447, 1479), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['__doc__'], {}), '(__doc__)\n', (1470, 1479), False, 'import argparse\n'), ((1490, 1554), 'utils.args.ArgumentGroup', 'ArgumentGroup', (['parser', '"""model"""', '"""model configuration and paths."""'], {}), "(parser, 'model', 'model configuration ... |
import re
import select
import socket as lib_socket
REQUEST_LINE_FORMAT = re.compile(
r"""
(?P<verb>GET|HEAD|POST|PUT|DELETE|DELETE|CONNECT|OPTIONS|TRACE)
[ ]
(?P<url>\S+)
[ ]
HTTP/(?P<version>1\.[01])
\r\n
(?P<headers>
(?:
[-a-zA-Z]+:.+\r\n
)*?
)
\r\n
""",
flags=re.VERBOSE,
)
H... | [
"select.select",
"socket.socket",
"re.compile"
] | [((76, 327), 're.compile', 're.compile', (['"""\n (?P<verb>GET|HEAD|POST|PUT|DELETE|DELETE|CONNECT|OPTIONS|TRACE)\n [ ]\n (?P<url>\\\\S+)\n [ ]\n HTTP/(?P<version>1\\\\.[01])\n \\\\r\\\\n\n (?P<headers>\n (?:\n [-a-zA-Z]+:.+\\\\r\\\\n\n )*?\n )\n \\\\r\\\\n\n """'], {'flags': 're.VERBOSE'}), '(\n ... |
'''
Author: <NAME> and <NAME>
Purpose: To predict aesthetic quality of image on a scale of 1 to 5.
How to use: There is a folder named test_images in parent directory of scripts
Put all your image to test in that folder
Run this code ie.. python3 main.py
Sample Output:
farm1_262_20009074919_cdd... | [
"os.listdir",
"keras.models.load_model",
"PIL.Image.open",
"os.path.join",
"numpy.max",
"numpy.array",
"os.remove"
] | [((1862, 1880), 'os.listdir', 'os.listdir', (['folder'], {}), '(folder)\n', (1872, 1880), False, 'import os\n'), ((2306, 2336), 'numpy.array', 'np.array', (['ims'], {'dtype': '"""float32"""'}), "(ims, dtype='float32')\n", (2314, 2336), True, 'import numpy as np\n'), ((2348, 2362), 'numpy.max', 'np.max', (['X_test'], {}... |
import numpy as np
import warnings
from ConfigSpace.configuration_space import ConfigurationSpace
from ConfigSpace.hyperparameters import UniformFloatHyperparameter, CategoricalHyperparameter
from ConfigSpace.conditions import EqualsCondition
from solnml.components.feature_engineering.transformations.base_transformer i... | [
"solnml.components.utils.text_util.build_embeddings_index",
"ConfigSpace.hyperparameters.UniformFloatHyperparameter",
"numpy.hstack",
"solnml.components.utils.text_util.load_text_embeddings",
"ConfigSpace.conditions.EqualsCondition",
"ConfigSpace.hyperparameters.CategoricalHyperparameter",
"ConfigSpace.... | [((1472, 1563), 'ConfigSpace.hyperparameters.CategoricalHyperparameter', 'CategoricalHyperparameter', (['"""method"""', "['average', 'weighted']"], {'default_value': '"""weighted"""'}), "('method', ['average', 'weighted'], default_value=\n 'weighted')\n", (1497, 1563), False, 'from ConfigSpace.hyperparameters import... |
from bratdb.reader import build_brat_dump
from bratdb.logger import initialize_logging
def main():
import argparse
parser = argparse.ArgumentParser(fromfile_prefix_chars='@!')
parser.add_argument('anndir',
help='Path to directory containing brat annotation files')
parser.add_a... | [
"bratdb.reader.build_brat_dump",
"bratdb.logger.initialize_logging",
"argparse.ArgumentParser"
] | [((135, 186), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'fromfile_prefix_chars': '"""@!"""'}), "(fromfile_prefix_chars='@!')\n", (158, 186), False, 'import argparse\n'), ((723, 761), 'bratdb.logger.initialize_logging', 'initialize_logging', ([], {'logdir': 'args.logdir'}), '(logdir=args.logdir)\n', (7... |
import tempfile
import os
import atexit
import shutil
from .utils import run_command
class CollectionManager:
def __init__(self, dir, requirements_file=None, installed=True):
self.dir = dir
self.requirements_file = requirements_file
self.installed = installed
@classmethod
def fro... | [
"os.path.exists",
"os.listdir",
"os.path.join",
"tempfile.mkdtemp",
"atexit.register"
] | [((482, 525), 'tempfile.mkdtemp', 'tempfile.mkdtemp', ([], {'prefix': '"""ansible_builder_"""'}), "(prefix='ansible_builder_')\n", (498, 525), False, 'import tempfile\n'), ((645, 680), 'atexit.register', 'atexit.register', (['shutil.rmtree', 'dir'], {}), '(shutil.rmtree, dir)\n', (660, 680), False, 'import atexit\n'), ... |
import os
from billy.utils.generic import get_git_rev
here = os.path.abspath(os.path.dirname(__file__))
VERSION = '0.0.0'
version_path = os.path.join(here, 'version.txt')
if os.path.exists(version_path):
with open(version_path, 'rt') as verfile:
VERSION = verfile.read().strip()
REVISION = None
revision_... | [
"os.path.dirname",
"os.path.exists",
"os.path.join",
"billy.utils.generic.get_git_rev"
] | [((140, 173), 'os.path.join', 'os.path.join', (['here', '"""version.txt"""'], {}), "(here, 'version.txt')\n", (152, 173), False, 'import os\n'), ((177, 205), 'os.path.exists', 'os.path.exists', (['version_path'], {}), '(version_path)\n', (191, 205), False, 'import os\n'), ((327, 361), 'os.path.join', 'os.path.join', ([... |
# Load from emBrick ethernet Module the connect class
# Here you can change with:
# connect.ipList = ['192.168.3.10','192.168.3.12'] | Add the LWCS IP Address here
# connect.emBrickPort = 7086 || Is preconfigured on 7086 you can change it if you want connected over a another Port
# connect.updateRate = 0.0 | Preconfig... | [
"emBRICK.ethernet.connect.ipList.append",
"threading.Timer",
"time.sleep",
"emBRICK.ethernet.connect.start_ethernet",
"emBRICK.ethernet.bB.putBit",
"emBRICK.ethernet.bB.getShort",
"emBRICK.ethernet.bB.getBit"
] | [((833, 870), 'emBRICK.ethernet.connect.ipList.append', 'connect.ipList.append', (['"""192.168.3.10"""'], {}), "('192.168.3.10')\n", (854, 870), False, 'from emBRICK.ethernet import connect\n'), ((929, 966), 'emBRICK.ethernet.connect.ipList.append', 'connect.ipList.append', (['"""192.168.3.12"""'], {}), "('192.168.3.12... |
# coding: utf-8
"""
SIGNATE API
API for Public # noqa: E501
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility library
import six
from swagger_... | [
"swagger_client.api_client.ApiClient",
"six.iteritems"
] | [((2573, 2604), 'six.iteritems', 'six.iteritems', (["params['kwargs']"], {}), "(params['kwargs'])\n", (2586, 2604), False, 'import six\n'), ((6299, 6330), 'six.iteritems', 'six.iteritems', (["params['kwargs']"], {}), "(params['kwargs'])\n", (6312, 6330), False, 'import six\n'), ((9715, 9746), 'six.iteritems', 'six.iter... |
import json
import os
from njupt import Zhengfang
root = os.path.dirname(os.path.abspath(__file__))
def email_remind(to_addr, subject, message):
from email.header import Header
from email.mime.text import MIMEText
from email.utils import parseaddr, formataddr
import smtplib
def _format_addr(s)... | [
"os.path.exists",
"smtplib.SMTP",
"email.utils.parseaddr",
"os.path.join",
"json.load",
"njupt.Zhengfang",
"os.path.abspath",
"email.header.Header",
"json.dump",
"email.mime.text.MIMEText"
] | [((75, 100), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (90, 100), False, 'import os\n'), ((530, 564), 'email.mime.text.MIMEText', 'MIMEText', (['message', '"""html"""', '"""utf-8"""'], {}), "(message, 'html', 'utf-8')\n", (538, 564), False, 'from email.mime.text import MIMEText\n'), ((73... |
"""
Cloudless is a python library to provide a basic set of easy to use primitive operations that can
work with many different cloud providers.
These primitives are:
- Create a "Network" (also known as VPC, Network, Environment). e.g. "dev".
- Create a "Service" within that network. e.g. "apache-public".
- Easily c... | [
"logging.basicConfig",
"logging.getLogger",
"cloudless.providers.get_provider",
"cloudless.util.exceptions.DisallowedOperationException",
"lazy_import.lazy_module",
"cloudless.util.exceptions.ProfileNotFoundException"
] | [((1080, 1124), 'lazy_import.lazy_module', 'lazy_import.lazy_module', (['"""cloudless.network"""'], {}), "('cloudless.network')\n", (1103, 1124), False, 'import lazy_import\n'), ((1135, 1179), 'lazy_import.lazy_module', 'lazy_import.lazy_module', (['"""cloudless.service"""'], {}), "('cloudless.service')\n", (1158, 1179... |
#!/usr/bin/env python3
# --------------------( LICENSE )--------------------
# Copyright (c) 2014-2021 Beartype authors.
# See "LICENSE" for further details.
'''
**Beartype core validation classes.**
This private submodule defines the core low-level class hierarchy driving the
entire :mod:`b... | [
"beartype._util.func.utilfunctest.is_func_python",
"beartype._util.func.utilfuncarg.get_func_args_len_standard",
"beartype._util.data.utildatadict.merge_mappings_two",
"beartype.roar.BeartypeValeSubscriptionException",
"beartype._util.text.utiltextrepr.represent_object"
] | [((16792, 16867), 'beartype._util.data.utildatadict.merge_mappings_two', 'merge_mappings_two', (['self._is_valid_code_locals', 'other._is_valid_code_locals'], {}), '(self._is_valid_code_locals, other._is_valid_code_locals)\n', (16810, 16867), False, 'from beartype._util.data.utildatadict import merge_mappings_two\n'), ... |
"""Fase Version Update."""
import os
from fase_lib.tools import version_util
FASE_VERSION_FILENAME = 'fase_version.txt'
def main(argv):
assert len(argv) <= 2
update_position = int(argv[1]) if len(argv) == 2 else None
version_util.ReadAndUpdateVersion(FASE_VERSION_FILENAME, update_position)
if __name__ ==... | [
"fase_lib.tools.version_util.ReadAndUpdateVersion"
] | [((230, 303), 'fase_lib.tools.version_util.ReadAndUpdateVersion', 'version_util.ReadAndUpdateVersion', (['FASE_VERSION_FILENAME', 'update_position'], {}), '(FASE_VERSION_FILENAME, update_position)\n', (263, 303), False, 'from fase_lib.tools import version_util\n')] |
import onnx
from onnx import helper as h
from onnx import checker as ch
from onnx import TensorProto, GraphProto, AttributeProto
from onnx import numpy_helper as nph
import numpy as np
from collections import OrderedDict
from logger import log
import typer
def make_param_dictionary(initializer):
params = Order... | [
"onnx.helper.make_graph",
"collections.OrderedDict",
"onnx.helper.make_node",
"onnx.load_model",
"onnx.numpy_helper.from_array",
"onnx.numpy_helper.to_array",
"logger.log.info",
"onnx.helper.make_model",
"onnx.save_model",
"typer.run",
"onnx.checker.check_model"
] | [((315, 328), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (326, 328), False, 'from collections import OrderedDict\n'), ((2023, 2067), 'logger.log.info', 'log.info', (['"""ONNX FLOAT16 --> FLOAT Converter"""'], {}), "('ONNX FLOAT16 --> FLOAT Converter')\n", (2031, 2067), False, 'from logger import log\n'... |
import glob,sys
import numpy as np
sys.path.append('../../flu/src')
import test_flu_prediction as test_flu
import matplotlib.pyplot as plt
import analysis_utils_toy_data as AU
file_formats = ['.svg', '.pdf']
plt.rcParams.update(test_flu.mpl_params)
line_styles = ['-', '--', '-.']
cols = ['b', 'r', 'g', 'c', 'm', 'k'... | [
"numpy.mean",
"matplotlib.pyplot.xscale",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.rcParams.update",
"matplotlib.pyplot.figure",
"analysis_utils_toy_data.load_prediction_data",
"sys.path.append",
"matplotlib.pyplot.xlim",
"matplotlib.pyp... | [((35, 67), 'sys.path.append', 'sys.path.append', (['"""../../flu/src"""'], {}), "('../../flu/src')\n", (50, 67), False, 'import glob, sys\n'), ((209, 249), 'matplotlib.pyplot.rcParams.update', 'plt.rcParams.update', (['test_flu.mpl_params'], {}), '(test_flu.mpl_params)\n', (228, 249), True, 'import matplotlib.pyplot a... |
import discord
from discord.ext import commands
from random import choice as rndchoice
from .utils import checks
import os
class Succ:
"""Succ command."""
def __init__(self, bot):
self.bot = bot
@commands.group(pass_context=True, invoke_without_command=True)
async def givemethesucc(self, ctx... | [
"discord.ext.commands.group"
] | [((220, 282), 'discord.ext.commands.group', 'commands.group', ([], {'pass_context': '(True)', 'invoke_without_command': '(True)'}), '(pass_context=True, invoke_without_command=True)\n', (234, 282), False, 'from discord.ext import commands\n')] |
import copy
import json
import itertools
from types import GeneratorType
from pathlib import PurePath
from datetime import datetime, date, time
from functools import wraps
from collections import deque, defaultdict
import idlib
import rdflib
import ontquery as oq
from idlib.formats import rdf as _bind_rdf # imported f... | [
"sparcur.exceptions.UnhandledTypeError",
"sparcur.utils.is_list_or_tuple",
"inspect.getsourcelines",
"json.JSONEncoder.default",
"sparcur.utils.logd.debug",
"sparcur.exceptions.LengthMismatchError",
"sparcur.exceptions.TargetPathExistsError",
"sparcur.utils.logd.critical",
"copy.deepcopy",
"sparcu... | [((60180, 60238), 'sparcur.utils.register_type', 'register_type', (['IdentityJsonType', '"""BlackfynnRemoteMetadata"""'], {}), "(IdentityJsonType, 'BlackfynnRemoteMetadata')\n", (60193, 60238), False, 'from sparcur.utils import is_list_or_tuple, register_type, IdentityJsonType\n'), ((60261, 60316), 'sparcur.utils.regis... |
import generate_cnn_data as gcd
max_room_count = gcd.max_room_count
cnns = ['classificator', 'discriminator']
data_types = ['train', 'test']
# 15000 test and 3000 train for classificator
gcd.generate_data(cnns[0], data_types[0], num_classes=3, amount=5000, mode='no_default_random')
gcd.generate_data(cnns[0], data_typ... | [
"generate_cnn_data.generate_data"
] | [((189, 289), 'generate_cnn_data.generate_data', 'gcd.generate_data', (['cnns[0]', 'data_types[0]'], {'num_classes': '(3)', 'amount': '(5000)', 'mode': '"""no_default_random"""'}), "(cnns[0], data_types[0], num_classes=3, amount=5000, mode=\n 'no_default_random')\n", (206, 289), True, 'import generate_cnn_data as gc... |
import os
import dotenv
dotenv.load_dotenv(os.path.join(os.path.dirname(__file__), '.env'))
import logging
import tornado.web
import tornado.ioloop
import tornado.autoreload
from tornado.options import define, options, parse_command_line
import routes
import groupme
import settings
logger = logging.getLogger(__name... | [
"logging.getLogger",
"groupme.get_bot_group",
"tornado.options.parse_command_line",
"os.path.dirname",
"tornado.options.define"
] | [((296, 323), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (313, 323), False, 'import logging\n'), ((401, 518), 'tornado.options.define', 'define', (['"""port"""'], {'help': '"""The port that this instance of the server should listen on"""', 'default': '"""8080"""', 'type': 'int'}), "('... |
import argparse
import os
import sys
class Opts(object):
def __init__(self):
#self.parser = argparse.ArgumentParser()
#task
self.task = 'ddd' #'ddd, lane'
self.task = self.task.split(',')
self.dataset = 'kitti' #'coco'
self.test_dataset = 'kitti' #'coco'
self.debug_mode = 0
sel... | [
"os.path.dirname",
"os.path.join"
] | [((804, 846), 'os.path.join', 'os.path.join', (['self.root_dir', '"""checkpoints"""'], {}), "(self.root_dir, 'checkpoints')\n", (816, 846), False, 'import os\n'), ((873, 918), 'os.path.join', 'os.path.join', (['self.save_dir', '"""model_last.pth"""'], {}), "(self.save_dir, 'model_last.pth')\n", (885, 918), False, 'impo... |
# Copyright (C) 2015 Nippon Telegraph and Telephone Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | [
"logging.getLogger",
"ryu.ofproto.ofproto_protocol.ProtocolDesc",
"ryu.lib.ofctl_v1_0.match_to_str",
"ryu.lib.ofctl_v1_0.to_match"
] | [((852, 888), 'logging.getLogger', 'logging.getLogger', (['"""test_ofctl_v1_0"""'], {}), "('test_ofctl_v1_0')\n", (869, 888), False, 'import logging\n'), ((1015, 1078), 'ryu.ofproto.ofproto_protocol.ProtocolDesc', 'ofproto_protocol.ProtocolDesc', ([], {'version': 'ofproto_v1_0.OFP_VERSION'}), '(version=ofproto_v1_0.OFP... |
#!/usr/bin/env python3
# wykys 2019
import numpy as np
def awgn(s: np.ndarray, snr_db: float = 20) -> np.ndarray:
sig_avg_watts = np.mean(s**2)
sig_avg_db = 10 * np.log10(sig_avg_watts)
noise_avg_db = sig_avg_db - snr_db
noise_avg_watts = 10 ** (noise_avg_db / 10)
mean_noise = 0
noise_volts... | [
"numpy.mean",
"numpy.log10",
"sig_plot.show",
"numpy.sqrt",
"sig_plot.splitplot",
"numpy.sin",
"numpy.arange"
] | [((137, 152), 'numpy.mean', 'np.mean', (['(s ** 2)'], {}), '(s ** 2)\n', (144, 152), True, 'import numpy as np\n'), ((527, 554), 'numpy.arange', 'np.arange', (['(0)', '(1 / f)', '(1 / fs)'], {}), '(0, 1 / f, 1 / fs)\n', (536, 554), True, 'import numpy as np\n'), ((560, 585), 'numpy.sin', 'np.sin', (['(2 * np.pi * f * t... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
async def main(args):
from vexmpp.utils import resolveHostPort
for client, port in ((True, 5222), (False, 5269)):
print()
srv_records = []
result = await resolveHostPort(args.hostname, port,
args.app... | [
"vexmpp.utils.resolveHostPort",
"nicfit.aio.Application"
] | [((875, 892), 'nicfit.aio.Application', 'Application', (['main'], {}), '(main)\n', (886, 892), False, 'from nicfit.aio import Application\n'), ((236, 358), 'vexmpp.utils.resolveHostPort', 'resolveHostPort', (['args.hostname', 'port', 'args.app.event_loop'], {'use_cache': '(False)', 'client_srv': 'client', 'srv_records'... |
#!/usr/bin/env python3
"sa_harness.py -- create sqlalchemy definitions from create table & index stmts"
import glob, collections, argparse
import sqlparse
from . import wrappers, diffing
PREAMBLE = """# autogenerated by sa_harness.py
import enum, sqlalchemy as sa
from sqlalchemy.dialects.postgresql import UUID, JSONB... | [
"collections.OrderedDict",
"glob.glob",
"argparse.ArgumentParser"
] | [((3913, 4007), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""generate sqlalchemy models from create table stmts"""'}), "(description=\n 'generate sqlalchemy models from create table stmts')\n", (3936, 4007), False, 'import glob, collections, argparse\n'), ((438, 461), 'glob.glob', '... |
# import scipy.signal as sig
import scipy as sp
import numpy as np
# tc = 30e-9
# caviy_tc = 10e-9
# n=1
# wc = 1/tc
fac = sp.math.factorial
# def filter_func(tc, order, t):
# wc=1/float(tc)
# return (wc*t)**(order-1)/fac(order-1)*wc*np.exp(-wc*t)
# filt = filter_func(tc, 7, np.arange(tc,20*tc, 0.1*t... | [
"numpy.exp",
"scipy.signal.deconvolve",
"numpy.arange"
] | [((1305, 1320), 'numpy.exp', 'np.exp', (['(-wc * t)'], {}), '(-wc * t)\n', (1311, 1320), True, 'import numpy as np\n'), ((1868, 1887), 'scipy.signal.deconvolve', 'deconvolve', (['y', 'filt'], {}), '(y, filt)\n', (1878, 1887), False, 'from scipy.signal import deconvolve\n'), ((1719, 1752), 'numpy.arange', 'np.arange', (... |
import collections
import datetime
import itertools
import os
import subprocess
from hyperparameters_config import (paraphrase, inverse_paraphrase)
class SafeDict(dict):
def __missing__(self, key):
return '{' + key + '}'
def get_run_id():
filename = "style_paraphrase/logs/expts.txt"
if os.path.... | [
"subprocess.check_output",
"datetime.datetime.now",
"itertools.product",
"os.path.isfile"
] | [((973, 1014), 'itertools.product', 'itertools.product', (['*value_hyperparameters'], {}), '(*value_hyperparameters)\n', (990, 1014), False, 'import itertools\n'), ((3144, 3208), 'subprocess.check_output', 'subprocess.check_output', (["('chmod +x %s' % script_name)"], {'shell': '(True)'}), "('chmod +x %s' % script_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
# distributed under the Li... | [
"google.cloud.bigquery.SchemaField",
"wtforms.Form",
"warehouse.packaging.tasks.update_description_html",
"warehouse.packaging.tasks.compute_trending",
"itertools.product",
"wtforms.StringField",
"warehouse.packaging.tasks.update_bigquery_release_files",
"pytest.mark.parametrize",
"warehouse.utils.r... | [((1236, 1289), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""with_purges"""', '[True, False]'], {}), "('with_purges', [True, False])\n", (1259, 1289), False, 'import pytest\n'), ((4859, 4894), 'warehouse.packaging.tasks.update_description_html', 'update_description_html', (['db_request'], {}), '(db_reque... |
# This is an auto-generated Django model module.
# You'll have to do the following manually to clean this up:
# * Rearrange models' order
# * Make sure each model has one field with primary_key=True
# * Make sure each ForeignKey has `on_delete` set to the desired behavior.
# * Remove `managed = False` lines if ... | [
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.IntegerField",
"django.db.models.DateTimeField",
"django.db.models.CharField"
] | [((816, 917), 'django.db.models.CharField', 'models.CharField', ([], {'db_column': '"""taskId"""', 'unique': '(True)', 'default': '""""""', 'max_length': '(25)', 'verbose_name': '"""任务ID"""'}), "(db_column='taskId', unique=True, default='', max_length=25,\n verbose_name='任务ID')\n", (832, 917), False, 'from django.db... |
'''
@author: <NAME>
@version: 1.0
=======================
This script generates clean "text" files from the cleaned tagged files of the COHA corpus.
Example:
---------
the file "fic_1936_10080.txt" can be found under the directory COHA/clean/tagged/ in the wlp_1930s_ney.zip file.
The script reads this file, joins a... | [
"logging.basicConfig",
"logging.getLogger",
"os.listdir",
"zipfile.ZipFile",
"os.path.join",
"multiprocessing_logging.install_mp_handler",
"os.path.isdir",
"multiprocessing.Pool",
"os.mkdir",
"codecs.open",
"sys.path.append",
"docopt.docopt"
] | [((577, 607), 'sys.path.append', 'sys.path.append', (['"""../modules/"""'], {}), "('../modules/')\n", (592, 607), False, 'import sys\n'), ((1008, 1193), 'docopt.docopt', 'docopt', (['"""Extract contexts from COHA.\n\nUsage:\n generate_text_files.py <coha_dir> \n \nArguments: \n <coha_dir> ... |
# Copyright 2016, 2018-2020, Optimizely
# 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... | [
"json.JSONDecoder",
"json.dumps"
] | [((29535, 29584), 'json.JSONDecoder', 'json.JSONDecoder', ([], {'object_hook': 'decoder.object_hook'}), '(object_hook=decoder.object_hook)\n', (29551, 29584), False, 'import json\n'), ((2060, 2085), 'json.dumps', 'json.dumps', (['condition_log'], {}), '(condition_log)\n', (2070, 2085), False, 'import json\n')] |
from setuptools import setup, find_packages
setup (
name='ccllexer',
packages=find_packages(),
entry_points =
"""
[pygments.lexers]
ccllexer = ccllexer.lexer:CCLLexer
""",
) | [
"setuptools.find_packages"
] | [((83, 98), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (96, 98), False, 'from setuptools import setup, find_packages\n')] |
"""Implementation of a subset of the NumPy API using SymPy primitives."""
from collections import Iterable as _Iterable
import sympy as _sym
import numpy as _np
from symnum.array import (
SymbolicArray as _SymbolicArray, is_sympy_array as _is_sympy_array,
unary_elementwise_func as _unary_elementwise_func,
... | [
"numpy.prod",
"symnum.array.slice_iterator",
"symnum.array.is_sympy_array",
"numpy.array",
"sympy.log",
"symnum.array.unary_elementwise_func",
"sympy.exp",
"sympy.arg",
"symnum.array.binary_broadcasting_func",
"symnum.array.SymbolicArray"
] | [((3206, 3257), 'symnum.array.unary_elementwise_func', '_unary_elementwise_func', (['sympy_func', 'numpy_name', '""""""'], {}), "(sympy_func, numpy_name, '')\n", (3229, 3257), True, 'from symnum.array import SymbolicArray as _SymbolicArray, is_sympy_array as _is_sympy_array, unary_elementwise_func as _unary_elementwise... |
from __future__ import division
from libtbx import easy_pickle
import logging
class SingleFrame:
""" Class that creates single-image agregate metrics/scoring that can then be
used in downstream clustering or filtering procedures.
"""
def __init__(self, path, filename, crystal_num=0):
try:
# Warn on e... | [
"libtbx.easy_pickle.load",
"logging.warning"
] | [((370, 392), 'libtbx.easy_pickle.load', 'easy_pickle.load', (['path'], {}), '(path)\n', (386, 392), False, 'from libtbx import easy_pickle\n'), ((881, 960), 'logging.warning', 'logging.warning', (["('Could not extract point group and unit cell from %s\\n' % path)"], {}), "('Could not extract point group and unit cell ... |
"""
this is a simple demo of data-retrieving by ipython
all codes including %matplotlib should be coded in ipython interface
please first uncomment the code on line 13 and then run the following code in ipython
"""
import numpy as np
import pandas as pd
import pandas.io.data as web
goog = web.DataReader('GOOG', data_so... | [
"pandas.rolling_std",
"numpy.sqrt",
"pandas.io.data.DataReader"
] | [((290, 369), 'pandas.io.data.DataReader', 'web.DataReader', (['"""GOOG"""'], {'data_source': '"""yahoo"""', 'start': '"""3/14/2009"""', 'end': '"""4/14/2009"""'}), "('GOOG', data_source='yahoo', start='3/14/2009', end='4/14/2009')\n", (304, 369), True, 'import pandas.io.data as web\n'), ((468, 511), 'pandas.rolling_st... |
# This demonstrates the trade queue. Trades will be validated & executed while concurrently fetching quotes and option chain lookups
from investopedia_api import InvestopediaApi, TradeExceedsMaxSharesException
import json
import datetime
def choose_option_contract(option_lookup,put=True):
now = datetime.datet... | [
"datetime.datetime",
"datetime.datetime.now",
"investopedia_api.InvestopediaApi",
"json.load",
"datetime.timedelta"
] | [((3379, 3407), 'investopedia_api.InvestopediaApi', 'InvestopediaApi', (['auth_cookie'], {}), '(auth_cookie)\n', (3394, 3407), False, 'from investopedia_api import InvestopediaApi, TradeExceedsMaxSharesException\n'), ((306, 329), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (327, 329), False, 'im... |
from builtins import str
import click
import json
import logging
from vegadns_client.exceptions import ClientException
from vegadns_cli.common import accounts
logger = logging.getLogger(__name__)
@accounts.command()
@click.option(
"--account-id",
type=int,
prompt=True,
help="ID of the account, requ... | [
"logging.getLogger",
"click.option",
"json.dumps",
"builtins.str",
"vegadns_cli.common.accounts.append",
"vegadns_cli.common.accounts.command"
] | [((171, 198), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (188, 198), False, 'import logging\n'), ((202, 220), 'vegadns_cli.common.accounts.command', 'accounts.command', ([], {}), '()\n', (218, 220), False, 'from vegadns_cli.common import accounts\n'), ((222, 314), 'click.option', 'cli... |
# -*- coding: utf-8 -*-
"""
Author
------
<NAME>
Email
-----
<EMAIL>
Created on
----------
- Sun Jun 25 13:00:00 2017
Modifications
-------------
- Sun Jun 25 13:00:00 2017
Aims
----
- utils for computing in parallel
"""
from copy import deepcopy
import numpy as np
from ipyparallel import Client
def launch_ipc... | [
"numpy.random.shuffle",
"copy.deepcopy",
"numpy.unique",
"ipyparallel.Client"
] | [((429, 452), 'ipyparallel.Client', 'Client', ([], {'profile': 'profile'}), '(profile=profile)\n', (435, 452), False, 'from ipyparallel import Client\n'), ((1504, 1551), 'numpy.unique', 'np.unique', (["dv['host_names']"], {'return_counts': '(True)'}), "(dv['host_names'], return_counts=True)\n", (1513, 1551), True, 'imp... |
#! /usr/bin/env python3
import altium
from sys import argv
def main(file):
with open(file, "rb") as file:
file = altium.OleFileIO(file)
stream = file.openstream("FileHeader")
objects = altium.iter_records(stream)
for [i, o] in enumerate(objects):
o = altium.parse_proper... | [
"altium.OleFileIO",
"altium.iter_records",
"altium.parse_properties"
] | [((127, 149), 'altium.OleFileIO', 'altium.OleFileIO', (['file'], {}), '(file)\n', (143, 149), False, 'import altium\n'), ((215, 242), 'altium.iter_records', 'altium.iter_records', (['stream'], {}), '(stream)\n', (234, 242), False, 'import altium\n'), ((301, 335), 'altium.parse_properties', 'altium.parse_properties', ([... |
#
# Shared methods for tests
#
from __future__ import absolute_import, division
from __future__ import print_function, unicode_literals
import os
import pytest
import re
from lxml import etree
import check
# Regex to find the CellML 1.0 namespace
r1_0 = re.compile(re.escape('{' + check.CELLML_1_0_NS + '}'))
def l... | [
"re.escape",
"os.listdir",
"pytest.xpass",
"lxml.etree.parse",
"os.path.splitext",
"os.path.join",
"pytest.fail",
"check.model_1_0",
"pytest.xfail"
] | [((269, 311), 're.escape', 're.escape', (["('{' + check.CELLML_1_0_NS + '}')"], {}), "('{' + check.CELLML_1_0_NS + '}')\n", (278, 311), False, 'import re\n'), ((519, 542), 'check.model_1_0', 'check.model_1_0', (['subdir'], {}), '(subdir)\n', (534, 542), False, 'import check\n'), ((563, 581), 'os.listdir', 'os.listdir',... |
#!/usr/bin/python
from __future__ import absolute_import
from flask import Flask, request, json, Response
from .link import lnk, Wrapper
from subprocess import Popen, signal
app = Flask(__name__)
class LnkServer(Wrapper):
"""
The lnk server connects to the underlying configuration database and can
get, al... | [
"subprocess.Popen",
"flask.Flask"
] | [((181, 196), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (186, 196), False, 'from flask import Flask, request, json, Response\n'), ((1228, 1238), 'subprocess.Popen', 'Popen', (['cmd'], {}), '(cmd)\n', (1233, 1238), False, 'from subprocess import Popen, signal\n')] |
from random import choice, shuffle
class Question:
def __init__(self,question,truanswer,alternatives:list):
self.question=question
self.truanswer=truanswer
self.alternatives=alternatives
def control_answer(self,answer):
if answer == self.truanswer :
return ... | [
"random.shuffle"
] | [((3027, 3050), 'random.shuffle', 'shuffle', (['quiz.questions'], {}), '(quiz.questions)\n', (3034, 3050), False, 'from random import choice, shuffle\n')] |
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import pytest
from cycler import cycler
def test_colorcycle_basic():
fig, ax = plt.subplots()
ax.set_prop_cycle(cycler('color', ['r', 'g', 'y']))
for _ in range(4):
ax.plot(range(10), range(10))
assert [l.get_color() ... | [
"matplotlib.colors.to_rgba",
"numpy.array",
"pytest.raises",
"cycler.cycler",
"matplotlib.pyplot.subplots"
] | [((162, 176), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (174, 176), True, 'import matplotlib.pyplot as plt\n'), ((404, 418), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (416, 418), True, 'import matplotlib.pyplot as plt\n'), ((794, 808), 'matplotlib.pyplot.subplots', 'plt.subpl... |
# !usr/bin/env python2
# -*- coding: utf-8 -*-
#
# Licensed under a 3-clause BSD license.
#
# @Author: <NAME>
# @Date: 2017-05-07 13:54:18
# @Last modified by: <NAME>
# @Last Modified time: 2017-06-27 11:19:28
from __future__ import print_function, division, absolute_import
from marvin.tests.api.conftest import Ap... | [
"pytest.mark.parametrize"
] | [((343, 437), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""page"""', "[('api', 'CubeView:index')]"], {'ids': "['cubes']", 'indirect': '(True)'}), "('page', [('api', 'CubeView:index')], ids=['cubes'],\n indirect=True)\n", (366, 437), False, 'import pytest\n'), ((638, 728), 'pytest.mark.parametrize', 'p... |
"""
Console script used to start Labtronyx in Server mode
"""
import os
import argparse
import appdirs
import labtronyx
import labtronyx.gui
labtronyx.logConsole()
def main(search_dirs=None):
parse = argparse.ArgumentParser(description="Labtronyx Automation Framework")
parse.add_argument('-g', dest='gui', ac... | [
"os.path.exists",
"labtronyx.gui.controllers.MainApplicationController",
"labtronyx.gui.wx_views.wx_main.main",
"argparse.ArgumentParser",
"os.makedirs",
"labtronyx.InstrumentManager",
"labtronyx.logConsole",
"appdirs.AppDirs"
] | [((142, 164), 'labtronyx.logConsole', 'labtronyx.logConsole', ([], {}), '()\n', (162, 164), False, 'import labtronyx\n'), ((207, 276), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Labtronyx Automation Framework"""'}), "(description='Labtronyx Automation Framework')\n", (230, 276), Fals... |
from typing import Sequence, Optional, Union, Callable, Collection, Tuple, Dict
import torch
from torch import Tensor
from torch_kalman.process import Process
from torch_kalman.internals.utils import split_flat
from torch_kalman.process.utils.bounded import Bounded
class LinearModel(Process):
"""
A process... | [
"torch_kalman.process.utils.bounded.Bounded",
"torch_kalman.internals.utils.split_flat",
"torch.isnan"
] | [((3119, 3137), 'torch_kalman.process.utils.bounded.Bounded', 'Bounded', (['(0.95)', '(1.0)'], {}), '(0.95, 1.0)\n', (3126, 3137), False, 'from torch_kalman.process.utils.bounded import Bounded\n'), ((3437, 3452), 'torch_kalman.process.utils.bounded.Bounded', 'Bounded', (['*decay'], {}), '(*decay)\n', (3444, 3452), Fal... |
import numpy as np
from pingle.core.policy import Policy
class RandomPolicy:
actions = []
def get_action(self, *,
observation,
previous_reward,
public_speech):
"""
Parameters
----------
observation: Observation
... | [
"numpy.random.choice"
] | [((681, 711), 'numpy.random.choice', 'np.random.choice', (['self.actions'], {}), '(self.actions)\n', (697, 711), True, 'import numpy as np\n')] |
import pathlib
import sys
import unittest
from OpenApiLibCore import (
Dto,
IdDependency,
IdReference,
PathPropertiesConstraint,
PropertyValueConstraint,
UniquePropertyValueConstraint,
dto_utils,
)
unittest_folder = pathlib.Path(__file__).parent.resolve()
mappings_path = unittest_folder.pa... | [
"pathlib.Path",
"OpenApiLibCore.dto_utils.get_dto_class",
"OpenApiLibCore.dto_utils.DefaultDto",
"sys.path.pop",
"unittest.main",
"sys.path.append"
] | [((2412, 2427), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2425, 2427), False, 'import unittest\n'), ((468, 490), 'OpenApiLibCore.dto_utils.DefaultDto', 'dto_utils.DefaultDto', ([], {}), '()\n', (488, 490), False, 'from OpenApiLibCore import Dto, IdDependency, IdReference, PathPropertiesConstraint, PropertyVa... |
import pytest
from server.organizations.models import (
Activity,
Organization,
OrganizationMember,
SchoolActivityGroup,
SchoolActivityOrder,
)
from server.organizations.tests.factories import (
ActivityFactory,
OrganizationFactory,
SchoolActivityGroupFactory,
SchoolActivityOrderFac... | [
"server.users.tests.factories.ConsumerFactory",
"server.organizations.tests.factories.OrganizationFactory",
"server.organizations.models.OrganizationMember.objects.create",
"server.organizations.tests.factories.SchoolActivityGroupFactory",
"server.users.tests.factories.UserFactory",
"server.schools.models... | [((672, 700), 'pytest.fixture', 'pytest.fixture', ([], {'autouse': '(True)'}), '(autouse=True)\n', (686, 700), False, 'import pytest\n'), ((828, 841), 'server.users.tests.factories.UserFactory', 'UserFactory', ([], {}), '()\n', (839, 841), False, 'from server.users.tests.factories import ConsumerFactory, CoordinatorFac... |
import tensorflow as tf
def minibatch_std(input_tensor, epsilon=1e-8):
n, h, w, c = tf.shape(input_tensor)
group_size = tf.minimum(4, n)
x = tf.reshape(input_tensor, [group_size, -1, h, w, c])
group_mean, group_var = tf.nn.moments(x, axes=(0), keepdims=False)
group_std = tf.sqrt(group_var + epsilon... | [
"tensorflow.tile",
"tensorflow.shape",
"tensorflow.nn.moments",
"tensorflow.concat",
"tensorflow.sqrt",
"tensorflow.reshape",
"tensorflow.reduce_mean",
"tensorflow.minimum"
] | [((89, 111), 'tensorflow.shape', 'tf.shape', (['input_tensor'], {}), '(input_tensor)\n', (97, 111), True, 'import tensorflow as tf\n'), ((129, 145), 'tensorflow.minimum', 'tf.minimum', (['(4)', 'n'], {}), '(4, n)\n', (139, 145), True, 'import tensorflow as tf\n'), ((154, 205), 'tensorflow.reshape', 'tf.reshape', (['inp... |
from src.homework.homework10.player import Player
from src.homework.homework10.game_log import GameLog
#write import statement for GameLog class
#from player import Player
#from game_log import GameLog
#Create a game log instance
gamelog1 = GameLog()
#SEnd the game_log instance to Player class as an argu... | [
"src.homework.homework10.game_log.GameLog.display_log",
"src.homework.homework10.player.Player",
"src.homework.homework10.game_log.GameLog"
] | [((253, 262), 'src.homework.homework10.game_log.GameLog', 'GameLog', ([], {}), '()\n', (260, 262), False, 'from src.homework.homework10.game_log import GameLog\n'), ((406, 435), 'src.homework.homework10.game_log.GameLog.display_log', 'GameLog.display_log', (['gamelog1'], {}), '(gamelog1)\n', (425, 435), False, 'from sr... |
# -*- coding: utf-8 -*-
# Copyright 2014, Digital Reasoning
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | [
"logging.getLogger",
"rest_framework.serializers.Field",
"rest_framework.serializers.HyperlinkedIdentityField"
] | [((699, 726), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (716, 726), False, 'import logging\n'), ((805, 836), 'rest_framework.serializers.Field', 'serializers.Field', (['"""properties"""'], {}), "('properties')\n", (822, 836), False, 'from rest_framework import serializers\n'), ((1273... |
from genanki import Model
def input_model(id, name, css):
return Model(id, name,
fields=[
{"name": "Front"},
{"name": "Back"},
{"name": "Input"},
{"name": "MyMedia"},
],
templates=[
... | [
"genanki.Model"
] | [((75, 333), 'genanki.Model', 'Model', (['id', 'name'], {'fields': "[{'name': 'Front'}, {'name': 'Back'}, {'name': 'Input'}, {'name': 'MyMedia'}]", 'templates': '[{\'name\': \'notion2anki-input-card\', \'qfmt\': \'{{Front}}<br>{{type:Input}}\',\n \'afmt\': \'{{FrontSide}}<hr id="answer">{{Back}}\'}]', 'css': 'css'})... |
import unittest
import sys
import os
sys.path.append(os.environ.get("PROJECT_ROOT_DIRECTORY", "."))
from fileprocessor.abstracts import *
class TestAbstractClasses(unittest.TestCase):
def test_searcher(self):
searcher = Searcher()
with self.assertRaises(NotImplementedError):
searcher.search("dir"... | [
"os.environ.get"
] | [((56, 101), 'os.environ.get', 'os.environ.get', (['"""PROJECT_ROOT_DIRECTORY"""', '"""."""'], {}), "('PROJECT_ROOT_DIRECTORY', '.')\n", (70, 101), False, 'import os\n')] |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-08-03 06:08
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_depend... | [
"django.db.migrations.swappable_dependency",
"django.db.models.ForeignKey",
"django.db.models.AutoField",
"django.db.models.DateTimeField",
"django.db.models.PositiveSmallIntegerField",
"django.db.models.CharField"
] | [((293, 350), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (324, 350), False, 'from django.db import migrations, models\n'), ((1093, 1212), 'django.db.models.CharField', 'models.CharField', ([], {'choices': "[('none',... |
from invoke import task
@task()
def precommit(c):
format(c)
test(c)
@task()
def format(c):
c.run("black src tests setup.py tasks.py")
@task()
def test(c):
c.run("pytest tests")
c.run("pytest --nbval-lax notebooks/*.ipynb")
| [
"invoke.task"
] | [((27, 33), 'invoke.task', 'task', ([], {}), '()\n', (31, 33), False, 'from invoke import task\n'), ((81, 87), 'invoke.task', 'task', ([], {}), '()\n', (85, 87), False, 'from invoke import task\n'), ((153, 159), 'invoke.task', 'task', ([], {}), '()\n', (157, 159), False, 'from invoke import task\n')] |
import pandas as pd
import numpy as np
import sys
from sqlalchemy import create_engine
from sqlalchemy_utils import database_exists, create_database
df = pd.DataFrame([
['jurassic', 'speil', 'english', '1992'],
['jaws', 'speil', 'english', '1985'],
['godfather', 'coppolla', 'english', '1973'],
['sholey... | [
"pandas.DataFrame",
"sqlalchemy.orm.sessionmaker",
"sqlalchemy.create_engine",
"sqlalchemy.ext.declarative.declarative_base"
] | [((155, 437), 'pandas.DataFrame', 'pd.DataFrame', (["[['jurassic', 'speil', 'english', '1992'], ['jaws', 'speil', 'english',\n '1985'], ['godfather', 'coppolla', 'english', '1973'], ['sholey',\n 'sippy', 'hindi', '1975'], ['golmaal', 'mukher', 'hindi', '1978']]"], {'columns': "['title', 'director', 'language', 'y... |
# System modules
# 3rd party modules
from models import Activator
def read_one():
"""
Responds to a request for /api/activator_meta/.
:param activator:
:return: count of activators
"""
count = Activator.query.count()
data = { 'count': count }
return data, 200
| [
"models.Activator.query.count"
] | [((235, 258), 'models.Activator.query.count', 'Activator.query.count', ([], {}), '()\n', (256, 258), False, 'from models import Activator\n')] |
from fixture import DataSet, DjangoFixture
from fixture.django_testcase import FixtureTestCase
from fixture.style import NamedDataStyle
from fixturapp.tests.dummyapp.models import Dummy
from fixturapp.tests.dummyapp.datasets import DummyData
class TestDummyapp(FixtureTestCase):
"""
Sample TestCase
"""
... | [
"fixture.style.NamedDataStyle",
"fixturapp.tests.dummyapp.models.Dummy.objects.get"
] | [((541, 593), 'fixturapp.tests.dummyapp.models.Dummy.objects.get', 'Dummy.objects.get', ([], {'id': 'self.data.DummyData.ragdoll.id'}), '(id=self.data.DummyData.ragdoll.id)\n', (558, 593), False, 'from fixturapp.tests.dummyapp.models import Dummy\n'), ((744, 795), 'fixturapp.tests.dummyapp.models.Dummy.objects.get', 'D... |
from sympy.solvers import solve
from sympy.simplify import simplify
def singularities(expr, sym):
"""
Finds singularities for a function.
Currently supported functions are:
- univariate real rational functions
Examples
========
>>> from sympy.calculus.singularities import singularities
... | [
"sympy.simplify.simplify"
] | [((867, 885), 'sympy.simplify.simplify', 'simplify', (['(1 / expr)'], {}), '(1 / expr)\n', (875, 885), False, 'from sympy.simplify import simplify\n')] |
import torch
from cogdl import oagbert
tokenizer, bert_model = oagbert()
bert_model.eval()
sequence = ["CogDL is developed by KEG, Tsinghua.", "OAGBert is developed by KEG, Tsinghua."]
tokens = tokenizer(sequence, return_tensors="pt", padding=True)
with torch.no_grad():
outputs = bert_model(**tokens)
print(outp... | [
"torch.no_grad",
"cogdl.oagbert"
] | [((64, 73), 'cogdl.oagbert', 'oagbert', ([], {}), '()\n', (71, 73), False, 'from cogdl import oagbert\n'), ((257, 272), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (270, 272), False, 'import torch\n')] |
##### file path
# input
path_df_D = "../../data/raw/tianchi_fresh_comp_train_user.csv"
# output
path_df_part_1 = "raw/df_part_1.csv"
path_df_part_2 = "raw/df_part_2.csv"
path_df_part_3 = "raw/df_part_3.csv"
path_df_part_1_tar = "raw/df_part_1_tar.csv"
path_df_part_2_tar = "raw/df_part_2_tar.csv"
path_df_... | [
"pandas.merge",
"pandas.read_csv"
] | [((2891, 2930), 'pandas.read_csv', 'pd.read_csv', (['data_file'], {'index_col': '(False)'}), '(data_file, index_col=False)\n', (2902, 2930), True, 'import pandas as pd\n'), ((3247, 3303), 'pandas.read_csv', 'pd.read_csv', (['data_file'], {'index_col': '(False)', 'parse_dates': '[0]'}), '(data_file, index_col=False, par... |
import os
import re
from django.template.base import Template
from django.template.context import Context
from dbgate import DBA
from parser import PlSqlParser
import settings
"""
Oracle user_objects column identifiers
"""
PACKAGE_NAME = 0
"""
Ditionary with dependences between Oracle types and cx_Oracle types
"""
OR... | [
"os.path.exists",
"parser.PlSqlParser",
"os.makedirs",
"django.template.base.Template",
"dbgate.DBA",
"re.match"
] | [((1709, 1751), 'django.template.base.Template', 'Template', (['template_string', 'template_string'], {}), '(template_string, template_string)\n', (1717, 1751), False, 'from django.template.base import Template\n'), ((7713, 7728), 'dbgate.DBA', 'DBA', (['connection'], {}), '(connection)\n', (7716, 7728), False, 'from d... |
# description: scan for grammar scores
import os
import h5py
import glob
import json
import logging
import numpy as np
from tronn.datalayer import H5DataLoader
from tronn.interpretation.inference import run_inference
from tronn.interpretation.motifs import get_sig_pwm_vector
from tronn.nets.preprocess_nets import mu... | [
"logging.getLogger",
"tronn.interpretation.motifs.get_sig_pwm_vector",
"tronn.interpretation.inference.run_inference",
"tronn.util.scripts.parse_multi_target_selection_strings",
"tronn.datalayer.H5DataLoader",
"json.load",
"numpy.sum",
"tronn.util.formats.write_to_json",
"tronn.util.pwms.MotifSetMan... | [((699, 726), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (716, 726), False, 'import logging\n'), ((1340, 1446), 'tronn.interpretation.motifs.get_sig_pwm_vector', 'get_sig_pwm_vector', (['args.sig_pwms_file', 'args.sig_pwms_key', 'args.foreground_targets'], {'reduce_type': '"""any"""'}... |
"""
This is an extract configuration for a Sequencing Manifest
Operations are inherited from the standard Study Creator extract configs in
creator/extract_configs/templates
The Dataservice entities that will be built from this are:
- sequencing_experiment
"""
from kf_lib_data_ingest.common import constants # noq... | [
"kf_lib_data_ingest.etl.extract.operations.keep_map",
"kf_lib_data_ingest.etl.extract.operations.constant_map"
] | [((664, 777), 'kf_lib_data_ingest.etl.extract.operations.constant_map', 'constant_map', ([], {'m': 'constants.SEQUENCING.CENTER.BROAD.KF_ID', 'out_col': 'CONCEPT.SEQUENCING.CENTER.TARGET_SERVICE_ID'}), '(m=constants.SEQUENCING.CENTER.BROAD.KF_ID, out_col=CONCEPT.\n SEQUENCING.CENTER.TARGET_SERVICE_ID)\n', (676, 777)... |
# Copyright 2020 <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, softw... | [
"tensorflow.app.run",
"os.path.exists",
"argparse.ArgumentParser",
"tensorflow.placeholder",
"tensorflow.Session",
"tensorflow.compat.v1.logging.set_verbosity",
"os.path.isdir",
"network.Pydnet",
"numpy.squeeze",
"os.path.isfile",
"cv2.cvtColor",
"tensorflow.expand_dims",
"cv2.resize",
"cv... | [((880, 942), 'tensorflow.compat.v1.logging.set_verbosity', 'tf.compat.v1.logging.set_verbosity', (['tf.compat.v1.logging.ERROR'], {}), '(tf.compat.v1.logging.ERROR)\n', (914, 942), True, 'import tensorflow as tf\n'), ((953, 1019), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Single sh... |
import calendar
year=int(input("Enter Year: "))
display=calendar.calendar(year)
print(display)
| [
"calendar.calendar"
] | [((58, 81), 'calendar.calendar', 'calendar.calendar', (['year'], {}), '(year)\n', (75, 81), False, 'import calendar\n')] |
# -*- coding: utf-8 -*-
"""Import View Templates.
NOTE: No schedule view template will be transferred. Same name view templates will be overriden and views will be updated.
"""
__title__ = 'Import View\nTemplates'
__author__ = "nWn"
# Import commom language runtime
import clr
# Import C# List
from System.Collections... | [
"pyrevit.DB.ElementCategoryFilter",
"pyrevit.DB.Transaction",
"pyrevit.DB.ElementTransformUtils.CopyElements",
"pyrevit.DB.CopyPasteOptions",
"pyrevit.DB.FilteredElementCollector",
"pyrevit.forms.select_open_docs"
] | [((619, 759), 'pyrevit.forms.select_open_docs', 'forms.select_open_docs', ([], {'title': '"""Select project/s to transfer View Templates"""', 'button_name': '"""OK"""', 'width': '(500)', 'multiple': '(True)', 'filterfunc': 'None'}), "(title='Select project/s to transfer View Templates',\n button_name='OK', width=500... |
from datadog import initialize, api
options = {
'api_key': '<YOUR_API_KEY>',
'app_key': '<YOUR_APP_KEY>'
}
initialize(**options)
list_id = 4741
name = 'My Updated Dashboard List'
api.DashboardList.update(list_id, name=name)
| [
"datadog.api.DashboardList.update",
"datadog.initialize"
] | [((117, 138), 'datadog.initialize', 'initialize', ([], {}), '(**options)\n', (127, 138), False, 'from datadog import initialize, api\n'), ((191, 235), 'datadog.api.DashboardList.update', 'api.DashboardList.update', (['list_id'], {'name': 'name'}), '(list_id, name=name)\n', (215, 235), False, 'from datadog import initia... |
import random
import os
import sys
import tempfile
import wandb
def artifact_with_various_paths():
art = wandb.Artifact(type='artsy', name='my-artys')
# internal file
with open('random.txt', 'w') as f:
f.write('file1 %s' % random.random())
f.close()
art.add_file(f.name)
# inte... | [
"tempfile.TemporaryDirectory",
"os.listdir",
"os.makedirs",
"wandb.Artifact",
"wandb.apis.InternalApi",
"wandb.init",
"os.chdir",
"random.random"
] | [((111, 156), 'wandb.Artifact', 'wandb.Artifact', ([], {'type': '"""artsy"""', 'name': '"""my-artys"""'}), "(type='artsy', name='my-artys')\n", (125, 156), False, 'import wandb\n'), ((434, 469), 'os.makedirs', 'os.makedirs', (['"""./dir"""'], {'exist_ok': '(True)'}), "('./dir', exist_ok=True)\n", (445, 469), False, 'im... |
import csv
import requests
from bs4 import BeautifulSoup
i=1
movieschoose=['thisweek','intheaters','comingsoon']
class reptile_movie:
def i_want_to_watch_movie():
print("你想看什麼時期?")
print("[1]本周新片")
print("[2]上映中")
class1 =int(input("[3]即將上映\n"))
for page in range(1,20):
... | [
"bs4.BeautifulSoup",
"csv.writer",
"requests.get"
] | [((443, 464), 'requests.get', 'requests.get', ([], {'url': 'url'}), '(url=url)\n', (455, 464), False, 'import requests\n'), ((497, 533), 'bs4.BeautifulSoup', 'BeautifulSoup', (['response.text', '"""lxml"""'], {}), "(response.text, 'lxml')\n", (510, 533), False, 'from bs4 import BeautifulSoup\n'), ((738, 758), 'csv.writ... |
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(0,2*np.pi)
y = np.sin(x)
plt.plot(x,y)
plt.show()
| [
"numpy.sin",
"numpy.linspace",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.show"
] | [((55, 80), 'numpy.linspace', 'np.linspace', (['(0)', '(2 * np.pi)'], {}), '(0, 2 * np.pi)\n', (66, 80), True, 'import numpy as np\n'), ((82, 91), 'numpy.sin', 'np.sin', (['x'], {}), '(x)\n', (88, 91), True, 'import numpy as np\n'), ((92, 106), 'matplotlib.pyplot.plot', 'plt.plot', (['x', 'y'], {}), '(x, y)\n', (100, 1... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2021 CERN.
# Copyright (C) 2021 Northwestern University.
#
# Invenio-Vocabularies is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see LICENSE file for more
# details.
"""Subject API tests."""
from functools import partial
impo... | [
"invenio_vocabularies.contrib.subjects.api.Subject.loads",
"invenio_indexer.api.RecordIndexer",
"invenio_vocabularies.contrib.subjects.api.Subject.create",
"invenio_vocabularies.contrib.subjects.api.Subject.pid.resolve",
"functools.partial",
"pytest.fixture",
"invenio_vocabularies.contrib.subjects.api.S... | [((491, 507), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (505, 507), False, 'import pytest\n'), ((667, 683), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (681, 683), False, 'import pytest\n'), ((885, 901), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (899, 901), False, 'import pytest\n'), (... |
import tkinter as tk
from tkinter import messagebox
def askquit():
if messagebox.askokcancel("Quit", "J'adore les popups"):
fen1.destroy()
fen1 = tk.Tk()
fen1.title("pranked")
fen1.config(bg="Red")
fen1.geometry("400x100")
Ok = tk.Button(fen1, text='Ok !', command=askquit())
text = tk.Label(fen1, fg='Re... | [
"tkinter.Tk",
"tkinter.messagebox.askokcancel",
"tkinter.Label"
] | [((162, 169), 'tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (167, 169), True, 'import tkinter as tk\n'), ((299, 536), 'tkinter.Label', 'tk.Label', (['fen1'], {'fg': '"""Red"""', 'text': '"""Bonjour tout le monde\nLorem ipsum dolor sit amet, consectetur adipiscing elit.\nMauris vel aliquet augue, ac accumsan augue. Nam eleif... |
import os
import random
import argparse
import json
import torch
import torch.utils.data
from utils.audio_processor import WrapperAudioProcessor as AudioProcessor
from utils.generic_utils import load_config
if __name__ == "__main__":
# Get defaults so it can work with no Sacred
parser = argparse.ArgumentParse... | [
"argparse.ArgumentParser",
"os.makedirs",
"utils.generic_utils.load_config",
"os.path.join",
"os.chmod",
"os.path.isdir",
"os.path.basename",
"torch.save",
"utils.audio_processor.WrapperAudioProcessor"
] | [((298, 323), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (321, 323), False, 'import argparse\n'), ((679, 703), 'utils.generic_utils.load_config', 'load_config', (['args.config'], {}), '(args.config)\n', (690, 703), False, 'from utils.generic_utils import load_config\n'), ((713, 741), 'utils... |
#!/usr/bin/env python
import tail
import os
import sys
# Path to instance folder
authorpath = os.getenv('AUTHOR_PATH')
publishpath = os.getenv('PUBLISH_PATH')
def print_line(txt):
''' Prints received text '''
print(txt),
if (sys.argv[1] and sys.argv[1] == 'author' and authorpath is not None):
print("Opened... | [
"os.path.expanduser",
"os.getenv"
] | [((96, 120), 'os.getenv', 'os.getenv', (['"""AUTHOR_PATH"""'], {}), "('AUTHOR_PATH')\n", (105, 120), False, 'import os\n'), ((135, 160), 'os.getenv', 'os.getenv', (['"""PUBLISH_PATH"""'], {}), "('PUBLISH_PATH')\n", (144, 160), False, 'import os\n'), ((443, 477), 'os.path.expanduser', 'os.path.expanduser', (['concatted_... |
"""Set up file for cpias package."""
from pathlib import Path
from setuptools import find_packages, setup
PROJECT_DIR = Path(__file__).parent.resolve()
README_FILE = PROJECT_DIR / "README.md"
LONG_DESCR = README_FILE.read_text(encoding="utf-8")
VERSION = (PROJECT_DIR / "cpias" / "VERSION").read_text().strip()
GITHUB_... | [
"setuptools.find_packages",
"pathlib.Path"
] | [((717, 769), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "['contrib', 'docs', 'tests*']"}), "(exclude=['contrib', 'docs', 'tests*'])\n", (730, 769), False, 'from setuptools import find_packages, setup\n'), ((122, 136), 'pathlib.Path', 'Path', (['__file__'], {}), '(__file__)\n', (126, 136), False, 'fr... |
import multiprocessing
from collections import deque
import threading
def execute_block(session, args):
try: env = session.env
except:
session.env = Environment(session)
env = session.env
env.deque.append(args)
print(threading.enumerate())
print(threading.current_thre... | [
"threading.enumerate",
"collections.deque",
"threading.current_thread",
"threading.Thread"
] | [((264, 285), 'threading.enumerate', 'threading.enumerate', ([], {}), '()\n', (283, 285), False, 'import threading\n'), ((298, 324), 'threading.current_thread', 'threading.current_thread', ([], {}), '()\n', (322, 324), False, 'import threading\n'), ((418, 452), 'threading.Thread', 'threading.Thread', ([], {'target': 's... |
"""
<NAME>
CEA Saclay - DM2S/STMF/LGLS
Mars 2021 - Stage 6 mois
We provide here a python package that can be used to graph and plot TRUSt data within jupyterlab.
This work is based on the files package (a TRUST package that reads the son files).
"""
from trustutils import files as tf
import matplotlib.pyplot as plt
... | [
"trustutils.jupyter.filelist.FileAccumulator.Append",
"matplotlib.pyplot.gca",
"os.getcwd",
"os.chdir",
"trustutils.files.SonSEGFile",
"numpy.loadtxt",
"re.findall",
"numpy.array",
"numpy.zeros",
"pandas.DataFrame",
"trustutils.files.SonPOINTFile",
"matplotlib.pyplot.subplots",
"matplotlib.p... | [((730, 741), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (739, 741), False, 'import os\n'), ((774, 788), 'os.chdir', 'os.chdir', (['path'], {}), '(path)\n', (782, 788), False, 'import os\n'), ((837, 865), 'trustutils.jupyter.filelist.FileAccumulator.Append', 'FileAccumulator.Append', (['data'], {}), '(data)\n', (859, ... |
#In 1
from __future__ import print_function
from __future__ import division
import pandas as pd
import numpy as np
# from matplotlib import pyplot as plt
# import seaborn as sns
# from sklearn.model_selection import train_test_split
import statsmodels.api as sm
# just for the sake of this blog post!
from warnings... | [
"pandas.isnull",
"pandas.read_csv",
"statsmodels.tools.eval_measures.meanabs",
"statsmodels.api.families.NegativeBinomial",
"numpy.concatenate",
"pandas.concat",
"warnings.filterwarnings",
"numpy.arange"
] | [((343, 367), 'warnings.filterwarnings', 'filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (357, 367), False, 'from warnings import filterwarnings\n'), ((417, 483), 'pandas.read_csv', 'pd.read_csv', (['"""data/dengue_features_train.csv"""'], {'index_col': '[0, 1, 2]'}), "('data/dengue_features_train.csv', index... |
import boto3
import json
import logging
import os
SUCCESS = "SUCCESS"
FAILED = "FAILED"
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
if 'LOG_LEVEL' in os.environ:
if os.environ['LOG_LEVEL'] == 'DEBUG':
logger.setLevel(logging.DEBUG)
if os.environ['LOG_LEVEL'] == 'INFO':... | [
"logging.getLogger",
"json.dumps",
"boto3.client"
] | [((109, 128), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (126, 128), False, 'import logging\n'), ((464, 490), 'boto3.client', 'boto3.client', (['"""lex-models"""'], {}), "('lex-models')\n", (476, 490), False, 'import boto3\n'), ((504, 522), 'boto3.client', 'boto3.client', (['"""s3"""'], {}), "('s3')\n"... |
from knmy import knmy
import pandas as pd
import numpy as np
def knmi_get(start, end, stations=[240]):
# knmy.get_hourly_data returns a tuple with 4 items. Immediately index to [3] to get the df with weather variables.
knmi_data = knmy.get_hourly_data(stations=[240], start=start, end=end,
... | [
"numpy.where",
"pandas.to_datetime",
"knmy.knmy.get_hourly_data"
] | [((1676, 1747), 'numpy.where', 'np.where', (["(knmi_data['precipitation'] < 0)", '(0)', "knmi_data['precipitation']"], {}), "(knmi_data['precipitation'] < 0, 0, knmi_data['precipitation'])\n", (1684, 1747), True, 'import numpy as np\n'), ((246, 355), 'knmy.knmy.get_hourly_data', 'knmy.get_hourly_data', ([], {'stations'... |
#!/usr/bin/python3
# coding=utf-8
# Copyright 2019 getcarrier.io
#
# 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 req... | [
"re.sub",
"dusty.tools.log.info"
] | [((1331, 1365), 'dusty.tools.log.info', 'log.info', (['"""Injecting issue hashes"""'], {}), "('Injecting issue hashes')\n", (1339, 1365), False, 'from dusty.tools import log\n'), ((1555, 1612), 're.sub', 're.sub', (['"""[^A-Za-zА-Яа-я0-9//\\\\\\\\.\\\\- _]+"""', '""""""', 'item.title'], {}), "('[^A-Za-zА-Яа-я0-9//\\\\\... |
# -*- coding: utf-8 -*-
# @File : apsmodule.py
# @Date : 2021/2/26
# @Desc :
import threading
import time
import uuid
from apscheduler.events import EVENT_JOB_ADDED, EVENT_JOB_REMOVED, EVENT_JOB_MODIFIED, EVENT_JOB_EXECUTED, \
EVENT_JOB_ERROR, EVENT_JOB_MISSED, EVENT_JOB_SUBMITTED, EVENT_JOB_MAX_INSTANCES
from ... | [
"Lib.xcache.Xcache.del_module_task_by_uuid",
"Lib.log.logger.error",
"threading.Lock",
"Lib.xcache.Xcache.get_module_task_by_uuid",
"Lib.log.logger.warning",
"uuid.uuid1",
"Lib.xcache.Xcache.create_module_task",
"time.time",
"apscheduler.schedulers.background.BackgroundScheduler"
] | [((726, 742), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (740, 742), False, 'import threading\n'), ((803, 824), 'apscheduler.schedulers.background.BackgroundScheduler', 'BackgroundScheduler', ([], {}), '()\n', (822, 824), False, 'from apscheduler.schedulers.background import BackgroundScheduler\n'), ((3392, ... |
import argparse
import asyncio
import html
import json
import xml.etree.ElementTree as ET
from pathlib import Path
import aiohttp
import export
data_dir = Path('data')
data_dir.mkdir(parents=True, exist_ok=True)
def param_to_request_body(action, param):
res = '''<v:Envelope xmlns:v="http://schemas.xmlsoap.org/... | [
"aiohttp.ClientSession",
"argparse.ArgumentParser",
"pathlib.Path",
"asyncio.wait",
"html.unescape",
"export.generate_user_class_html",
"json.load",
"xml.etree.ElementTree.fromstring",
"json.dump"
] | [((158, 170), 'pathlib.Path', 'Path', (['"""data"""'], {}), "('data')\n", (162, 170), False, 'from pathlib import Path\n'), ((7219, 7244), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (7242, 7244), False, 'import argparse\n'), ((1108, 1151), 'pathlib.Path', 'Path', (['data_dir', "('user_' + s... |
from django.contrib import admin
from .models import WeatherForecastDay
# Register your models here.
admin.site.register(WeatherForecastDay) | [
"django.contrib.admin.site.register"
] | [((102, 141), 'django.contrib.admin.site.register', 'admin.site.register', (['WeatherForecastDay'], {}), '(WeatherForecastDay)\n', (121, 141), False, 'from django.contrib import admin\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read().replace('.. :changelog:', ... | [
"distutils.core.setup"
] | [((415, 1370), 'distutils.core.setup', 'setup', ([], {'name': '"""lifx-cmd"""', 'version': '"""0.2.3"""', 'description': '"""LifX command line utility to change the state of your lifx bulb. Supports powering on/off, changing RGB/HSB color and temperature."""', 'long_description': "(readme + '\\n\\n' + history)", 'autho... |
import hmac
from urllib.parse import quote
import httpx
from fastapi import HTTPException, Query
from fastapi.responses import RedirectResponse
from idunn import settings
client = httpx.AsyncClient()
base_url = settings.get("BASE_URL")
secret = settings.get("SECRET").encode()
def resolve_url(url: str) -> str:
... | [
"fastapi.HTTPException",
"urllib.parse.quote",
"fastapi.responses.RedirectResponse",
"idunn.settings.get",
"httpx.AsyncClient",
"fastapi.Query"
] | [((183, 202), 'httpx.AsyncClient', 'httpx.AsyncClient', ([], {}), '()\n', (200, 202), False, 'import httpx\n'), ((214, 238), 'idunn.settings.get', 'settings.get', (['"""BASE_URL"""'], {}), "('BASE_URL')\n", (226, 238), False, 'from idunn import settings\n'), ((789, 860), 'fastapi.Query', 'Query', (['...'], {'descriptio... |
from django.urls import path
from base.views import order_views as views
urlpatterns = [
path("", views.get_orders, name="orders"),
path("add/", views.add_order_items, name="orders-add"),
path("myorders/", views.get_my_orders, name="myorders"),
path("<str:pk>/", views.get_order_by_id, name="user-order... | [
"django.urls.path"
] | [((95, 136), 'django.urls.path', 'path', (['""""""', 'views.get_orders'], {'name': '"""orders"""'}), "('', views.get_orders, name='orders')\n", (99, 136), False, 'from django.urls import path\n'), ((142, 196), 'django.urls.path', 'path', (['"""add/"""', 'views.add_order_items'], {'name': '"""orders-add"""'}), "('add/',... |
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
z1 = []
z2 = []
for i in range(m.num_stages):
for j in range(101):
z1.append(m.policy[i,j][0])
z2.append(m.policy[i,j][1])
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
x ... | [
"matplotlib.pyplot.figure"
] | [((262, 274), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (272, 274), True, 'import matplotlib.pyplot as plt\n')] |
""" This module will handle the text generation with beam search. """
import torch
import copy
import torch.nn.functional as F
from src.rtransformer.recursive_caption_dataset import RecursiveCaptionDataset as RCDataset
import logging
logger = logging.getLogger(__name__)
def mask_tokens_after_eos(input_ids, input_m... | [
"logging.getLogger",
"torch.ones",
"torch.LongTensor",
"torch.stack",
"torch.sum",
"torch.no_grad",
"torch.cat",
"torch.device"
] | [((246, 273), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (263, 273), False, 'import logging\n'), ((1094, 1137), 'torch.device', 'torch.device', (["('cuda' if opt.cuda else 'cpu')"], {}), "('cuda' if opt.cuda else 'cpu')\n", (1106, 1137), False, 'import torch\n'), ((2278, 2318), 'torch... |
from __future__ import absolute_import
from sentry.data_export.models import ExportedData
from sentry.data_export.tasks import assemble_download
from sentry.models import File
from sentry.testutils import TestCase, SnubaTestCase
from sentry.utils.compat.mock import patch
class AssembleDownloadTest(TestCase, SnubaTes... | [
"sentry.utils.compat.mock.patch",
"sentry.data_export.models.ExportedData.objects.get",
"sentry.data_export.models.ExportedData.objects.create",
"sentry.data_export.tasks.assemble_download"
] | [((2009, 2070), 'sentry.utils.compat.mock.patch', 'patch', (['"""sentry.data_export.models.ExportedData.email_failure"""'], {}), "('sentry.data_export.models.ExportedData.email_failure')\n", (2014, 2070), False, 'from sentry.utils.compat.mock import patch\n'), ((1121, 1297), 'sentry.data_export.models.ExportedData.obje... |
import os, sys, signal, subprocess
from sense_hat import SenseHat
from time import sleep
from libs.clear import *
from modules.joystick import *
from modules.check import *
import variables.vars as v
sense = SenseHat()
sense.clear()
# Function -----------------
def exit(signal, frame):
clear()
print(c.bco... | [
"sense_hat.SenseHat",
"time.sleep",
"signal.signal",
"sys.exit"
] | [((213, 223), 'sense_hat.SenseHat', 'SenseHat', ([], {}), '()\n', (221, 223), False, 'from sense_hat import SenseHat\n'), ((360, 371), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (368, 371), False, 'import os, sys, signal, subprocess\n'), ((489, 523), 'signal.signal', 'signal.signal', (['signal.SIGINT', 'exit'], {}... |
#!/usr/bin/env python3
import logging
import jsonloggeriso8601datetime as jlidt
jlidt.setConfig()
if __name__ == '__main__':
parentLogger = logging.getLogger('parentLogger')
childLogger = logging.getLogger('parentLogger.childLogger')
parentLogger.warning("using dict config now")
childLogger.warn... | [
"jsonloggeriso8601datetime.setConfig",
"logging.getLogger"
] | [((84, 101), 'jsonloggeriso8601datetime.setConfig', 'jlidt.setConfig', ([], {}), '()\n', (99, 101), True, 'import jsonloggeriso8601datetime as jlidt\n'), ((150, 183), 'logging.getLogger', 'logging.getLogger', (['"""parentLogger"""'], {}), "('parentLogger')\n", (167, 183), False, 'import logging\n'), ((202, 247), 'loggi... |
from bs4 import BeautifulSoup
import requests
def get_html(username):
url = f"https://r6.tracker.network/profile/pc/{username}"
response = requests.get(url)
soup = BeautifulSoup(response.content, 'html.parser')
return soup
def get_pic_and_level(soup):
try:
picture = soup.find('div', class_='trn-profile-hea... | [
"bs4.BeautifulSoup",
"requests.get"
] | [((143, 160), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (155, 160), False, 'import requests\n'), ((169, 215), 'bs4.BeautifulSoup', 'BeautifulSoup', (['response.content', '"""html.parser"""'], {}), "(response.content, 'html.parser')\n", (182, 215), False, 'from bs4 import BeautifulSoup\n')] |
import numpy as np
def PCA_numpy(data, n_components=2):
#1nd step is to find covarience matrix
data_vector = []
for i in range(data.shape[1]):
data_vector.append(data[:, i])
cov_matrix = np.cov(data_vector)
#2rd step is to compute eigen vectors and eigne values
eig_values... | [
"numpy.abs",
"numpy.cov",
"numpy.linalg.eig"
] | [((222, 241), 'numpy.cov', 'np.cov', (['data_vector'], {}), '(data_vector)\n', (228, 241), True, 'import numpy as np\n'), ((336, 361), 'numpy.linalg.eig', 'np.linalg.eig', (['cov_matrix'], {}), '(cov_matrix)\n', (349, 361), True, 'import numpy as np\n'), ((528, 549), 'numpy.abs', 'np.abs', (['eig_values[i]'], {}), '(ei... |