code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import os
import sys
import json
import boto3
import logging
import hashlib
from botocore.config import Config
from samtranslator.feature_toggle.dialup import (
DisabledDialup,
ToggleDialup,
SimpleAccountPercentileDialup,
)
my_path = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, my_path + ... | [
"logging.getLogger",
"json.loads",
"sys.path.insert",
"boto3.client",
"botocore.config.Config",
"samtranslator.feature_toggle.dialup.DisabledDialup",
"os.path.abspath"
] | [((291, 326), 'sys.path.insert', 'sys.path.insert', (['(0)', "(my_path + '/..')"], {}), "(0, my_path + '/..')\n", (306, 326), False, 'import sys\n'), ((334, 361), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (351, 361), False, 'import logging\n'), ((264, 289), 'os.path.abspath', 'os.pat... |
from setuptools import setup
setup(
name = 'bigfiles',
version = '1.0.0',
description = 'Create files of random data',
author = 'FNNDSC',
author_email = '<EMAIL>',
url = 'https://github.com/FNNDSC/dbg-bigfiles',
py_modules = ['bigfi... | [
"setuptools.setup"
] | [((30, 664), 'setuptools.setup', 'setup', ([], {'name': '"""bigfiles"""', 'version': '"""1.0.0"""', 'description': '"""Create files of random data"""', 'author': '"""FNNDSC"""', 'author_email': '"""<EMAIL>"""', 'url': '"""https://github.com/FNNDSC/dbg-bigfiles"""', 'py_modules': "['bigfiles']", 'install_requires': "['c... |
from __future__ import unicode_literals
from django.db import models
import hashlib
class OptOutManager(models.Manager):
def _hash_email(self, email):
email_bytes = email.encode('utf-8')
return hashlib.sha1(email_bytes).hexdigest()
def is_blocked(self, email=None):
""" Check if a giv... | [
"hashlib.sha1",
"django.db.models.CharField"
] | [((845, 877), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(255)'}), '(max_length=255)\n', (861, 877), False, 'from django.db import models\n'), ((217, 242), 'hashlib.sha1', 'hashlib.sha1', (['email_bytes'], {}), '(email_bytes)\n', (229, 242), False, 'import hashlib\n')] |
import torch
import pytest
import kornia.augmentation as K
class TestVideoSequential:
@pytest.mark.parametrize('shape', [(3, 4), (2, 3, 4), (2, 3, 5, 6), (2, 3, 4, 5, 6, 7)])
@pytest.mark.parametrize('data_format', ["BCTHW", "BTCHW"])
def test_exception(self, shape, data_format, device, dtype):
... | [
"kornia.augmentation.RandomPosterize",
"torch.nn.Sequential",
"kornia.augmentation.RandomEqualize",
"kornia.augmentation.RandomAffine",
"kornia.augmentation.RandomMotionBlur",
"kornia.augmentation.RandomResizedCrop",
"kornia.augmentation.VideoSequential",
"torch.jit.script",
"kornia.augmentation.Ran... | [((95, 186), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""shape"""', '[(3, 4), (2, 3, 4), (2, 3, 5, 6), (2, 3, 4, 5, 6, 7)]'], {}), "('shape', [(3, 4), (2, 3, 4), (2, 3, 5, 6), (2, 3, 4,\n 5, 6, 7)])\n", (118, 186), False, 'import pytest\n'), ((188, 246), 'pytest.mark.parametrize', 'pytest.mark.parame... |
import json
import hashlib
import os
from django.conf import settings
from bims.models.search_process import SearchProcess
def get_or_create_search_process(search_type, query, process_id=None):
"""
Get or create search process
:param search_type: Search process type
:param query: Search query (optiona... | [
"hashlib.md5",
"bims.models.search_process.SearchProcess.objects.filter",
"json.dumps",
"os.path.join",
"bims.models.search_process.SearchProcess.objects.create"
] | [((484, 534), 'bims.models.search_process.SearchProcess.objects.filter', 'SearchProcess.objects.filter', ([], {'category': 'search_type'}), '(category=search_type)\n', (512, 534), False, 'from bims.models.search_process import SearchProcess\n'), ((2354, 2395), 'os.path.join', 'os.path.join', (['settings.MEDIA_ROOT', 'f... |
from argparse import ArgumentParser
import optuna
from double_dqn import get_args, train_double_dqn
from optuna_dqn import dqn_parser_hook, dump_best_study
def double_dqn_parser_hook(parser: ArgumentParser, trail: optuna.Trial):
dqn_parser_hook("double_dqn", parser, trail)
parser.set_defaults(
target... | [
"optuna_dqn.dump_best_study",
"optuna_dqn.dqn_parser_hook",
"double_dqn.train_double_dqn",
"optuna.create_study"
] | [((236, 280), 'optuna_dqn.dqn_parser_hook', 'dqn_parser_hook', (['"""double_dqn"""', 'parser', 'trail'], {}), "('double_dqn', parser, trail)\n", (251, 280), False, 'from optuna_dqn import dqn_parser_hook, dump_best_study\n'), ((627, 649), 'double_dqn.train_double_dqn', 'train_double_dqn', (['args'], {}), '(args)\n', (6... |
# Copyright 2018 ICON Foundation
#
# 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 writi... | [
"sanic.response.json",
"loopchain.utils.icon_service.convert_params",
"loopchain.utils.message_queue.StubCollection",
"jsonrpcserver.aio.AsyncMethods",
"loopchain.utils.logger.spam",
"loopchain.utils.json_rpc.get_block_by_params",
"loopchain.protos.message_code.get_response_msg",
"sanic.response.text"... | [((932, 946), 'jsonrpcserver.aio.AsyncMethods', 'AsyncMethods', ([], {}), '()\n', (944, 946), False, 'from jsonrpcserver.aio import AsyncMethods\n'), ((1446, 1516), 'sanic.response.json', 'response.json', (['dispatch_response'], {'status': 'dispatch_response.http_status'}), '(dispatch_response, status=dispatch_response... |
from unittest import TestCase
from starkbank.iso8583.utils.binary import Binary
from tests.iso8583.utils.randomData import randomBits, randomHex
class TestBinaryUtils(TestCase):
def test_everything(self):
for _ in range(1000):
randomsequence = randomHex(max(randomBits(4), 1))
whil... | [
"tests.iso8583.utils.randomData.randomBits",
"starkbank.iso8583.utils.binary.Binary.fromIndexes",
"starkbank.iso8583.utils.binary.Binary.fromHex"
] | [((464, 494), 'starkbank.iso8583.utils.binary.Binary.fromHex', 'Binary.fromHex', (['randomsequence'], {}), '(randomsequence)\n', (478, 494), False, 'from starkbank.iso8583.utils.binary import Binary\n'), ((530, 557), 'starkbank.iso8583.utils.binary.Binary.fromIndexes', 'Binary.fromIndexes', (['indexes'], {}), '(indexes... |
"""
defines:
- model = Boundary(log=None, debug=False)
- model = BoundaryFile(log=None, debug=False)
"""
from __future__ import print_function
import os
from codecs import open
from collections import OrderedDict
import numpy as np
from pyNastran.converters.openfoam.points_file import PointFile
from pyNastran.conve... | [
"collections.OrderedDict",
"pyNastran.converters.openfoam.points_file.PointFile",
"pyNastran.converters.openfoam.face_file.FaceFile",
"numpy.zeros",
"pyNastran.utils.check_path",
"numpy.ravel",
"codecs.open",
"pyNastran.utils.log.get_logger2",
"numpy.arange"
] | [((540, 569), 'pyNastran.utils.log.get_logger2', 'get_logger2', (['log'], {'debug': 'debug'}), '(log, debug=debug)\n', (551, 569), False, 'from pyNastran.utils.log import get_logger2\n'), ((5151, 5180), 'pyNastran.utils.log.get_logger2', 'get_logger2', (['log'], {'debug': 'debug'}), '(log, debug=debug)\n', (5162, 5180)... |
from distutils.core import setup
from Cython.Build import cythonize
setup(
name = 'Python 3 bindings for libtcod',
ext_modules = cythonize("libtcodpy.pyx"),
) | [
"Cython.Build.cythonize"
] | [((132, 158), 'Cython.Build.cythonize', 'cythonize', (['"""libtcodpy.pyx"""'], {}), "('libtcodpy.pyx')\n", (141, 158), False, 'from Cython.Build import cythonize\n')] |
import logging
import urllib2
import time
import lighter.util as util
class Datadog(object):
def __init__(self, token, tags=[]):
self._token = token
self._url = 'https://app.datadoghq.com'
self._tags = tags + ['source:lighter', 'type:change']
def notify(self, title, message, aggregatio... | [
"lighter.util.jsonRequest",
"logging.warn",
"logging.debug",
"time.time"
] | [((624, 686), 'logging.debug', 'logging.debug', (['"""Sending Datadog deployment event: %s"""', 'message'], {}), "('Sending Datadog deployment event: %s', message)\n", (637, 686), False, 'import logging\n'), ((450, 517), 'logging.warn', 'logging.warn', (['"""Datadog title, message and aggregation_key required"""'], {})... |
import torch
from torch.autograd import Variable
def to_cuda_variable(tensor):
"""
Converts tensor to cuda variable
:param tensor: torch tensor, of any size
:return: torch Variable, of same size as tensor
"""
if torch.cuda.is_available():
return Variable(tensor).cuda()
else:
... | [
"torch.zeros",
"torch.cuda.is_available",
"torch.autograd.Variable"
] | [((238, 263), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (261, 263), False, 'import torch\n'), ((540, 565), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (563, 565), False, 'import torch\n'), ((870, 895), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {... |
from setuptools import setup, find_packages
import os
import codecs
VERSION = '1.0.2'
DESCRIPTION = "It's just a simple translation that will be beautiful in the coming days"
here = os.path.abspath(os.path.dirname(__file__))
with codecs.open(os. path.join(here, "README.md"), encoding="utf-8") as file:
long_descr... | [
"os.path.dirname",
"setuptools.find_packages",
"os.path.join"
] | [((200, 225), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (215, 225), False, 'import os\n'), ((245, 276), 'os.path.join', 'os.path.join', (['here', '"""README.md"""'], {}), "(here, 'README.md')\n", (257, 276), False, 'import os\n'), ((554, 569), 'setuptools.find_packages', 'find_packages',... |
import tnetwork as tn
import sklearn
import sklearn.metrics
import scipy
import statistics
import networkx as nx
from tnetwork.DCD.analytics.onmi import onmi
import numpy as np
__all__ = ["longitudinal_similarity", "consecutive_sn_similarity", "similarity_at_each_step", "entropy_by_node","nb_node_change","quality_at_e... | [
"statistics.mean",
"scipy.stats.entropy",
"sklearn.metrics.adjusted_mutual_info_score",
"numpy.average"
] | [((9391, 9421), 'statistics.mean', 'statistics.mean', (['all_entropies'], {}), '(all_entropies)\n', (9406, 9421), False, 'import statistics\n'), ((9874, 9934), 'numpy.average', 'np.average', (['consecutive_NMIs[0]'], {'weights': 'consecutive_NMIs[1]'}), '(consecutive_NMIs[0], weights=consecutive_NMIs[1])\n', (9884, 993... |
import os
import xml.etree.ElementTree as ET
import requests
path = "data/images/train"
list = os.listdir(path)
m_list = [file for file in list if file.endswith(".xml")]
print("file:{}".format(m_list))
for i in m_list:
tree = ET.parse("C:/Users/pipir/Desktop/object_detection_demo-master/data/images/train/" + i)
... | [
"os.listdir",
"xml.etree.ElementTree.parse"
] | [((97, 113), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n', (107, 113), False, 'import os\n'), ((232, 327), 'xml.etree.ElementTree.parse', 'ET.parse', (["('C:/Users/pipir/Desktop/object_detection_demo-master/data/images/train/' + i)"], {}), "(\n 'C:/Users/pipir/Desktop/object_detection_demo-master/data/imag... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jul 13 12:00:40 2020
@author: medrclaa
This file contains the functions for constructing an exit gfates probablity
distribution for an agent given its current heading. Currently, this heading is
determined by the slope of the line through an agents st... | [
"numpy.hstack",
"matplotlib.pyplot.plot",
"shapely.geometry.Point",
"numpy.array",
"matplotlib.pyplot.figure",
"shapely.geometry.LineString",
"numpy.arctan2",
"stationsim.stationsim_model.Model",
"numpy.cos",
"numpy.sin",
"sys.path.append",
"matplotlib.pyplot.show"
] | [((885, 906), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (900, 906), False, 'import sys\n'), ((907, 931), 'sys.path.append', 'sys.path.append', (['"""../.."""'], {}), "('../..')\n", (922, 931), False, 'import sys\n'), ((1028, 1055), 'sys.path.append', 'sys.path.append', (['"""../../.."""'], {... |
import filecmp
import tempfile
from datetime import datetime as dt
from sitelog import (
SiteLog,
GnssReceiver,
MetInstrument,
SensorType,
AntennaType,
Form,
SiteIdentification,
LocalTies,
Tie,
FrequencyStandard,
Frequency,
Collocation,
CollocationInstrument,
Hea... | [
"sitelog.AntennaType",
"sitelog.MetInstrument",
"sitelog.Form",
"sitelog.Tie",
"sitelog.SiteIdentification",
"sitelog.more_info.MoreInfo",
"sitelog.responsible_agency.ResponsibleAgencies",
"datetime.datetime.now",
"sitelog.Frequency",
"sitelog.CollocationInstrument",
"tempfile.gettempdir",
"si... | [((747, 785), 'sitelog.SiteLog', 'SiteLog', (['"""test/data/fyha_20161220.log"""'], {}), "('test/data/fyha_20161220.log')\n", (754, 785), False, 'from sitelog import SiteLog, GnssReceiver, MetInstrument, SensorType, AntennaType, Form, SiteIdentification, LocalTies, Tie, FrequencyStandard, Frequency, Collocation, Colloc... |
#!/usr/bin/env python
# import tensorflow as tf
# zero_out_module = tf.load_op_library('../lib/zero_out.so')
# with tf.Session(''):
# print(zero_out_module.zero_out([[1, 2], [3, 4]]).eval())
import numpy as np
import tensorflow as tf
class ExampleOpsTest(tf.test.TestCase):
def setUp(self):
se... | [
"tensorflow.load_op_library",
"tensorflow.test.main",
"numpy.random.randint",
"tensorflow.constant",
"numpy.random.randn"
] | [((1534, 1548), 'tensorflow.test.main', 'tf.test.main', ([], {}), '()\n', (1546, 1548), True, 'import tensorflow as tf\n'), ((335, 375), 'tensorflow.load_op_library', 'tf.load_op_library', (['"""lib/example_ops.so"""'], {}), "('lib/example_ops.so')\n", (353, 375), True, 'import tensorflow as tf\n'), ((969, 1009), 'tens... |
from math import pi, sin, cos
from numpy import sign
import tf.transformations
from geometry_msgs.msg import Quaternion
from nav_msgs.msg import Odometry
def yaw_from_odom_message(odom):
"""Converts an Odometry message into an Euler yaw value
Parameters:
:param Odometry odom:
:rtype: float
"... | [
"nav_msgs.msg.Odometry",
"math.cos",
"geometry_msgs.msg.Quaternion",
"numpy.sign",
"math.sin"
] | [((1128, 1144), 'numpy.sign', 'sign', (['diff_angle'], {}), '(diff_angle)\n', (1132, 1144), False, 'from numpy import sign\n'), ((2928, 2940), 'geometry_msgs.msg.Quaternion', 'Quaternion', ([], {}), '()\n', (2938, 2940), False, 'from geometry_msgs.msg import Quaternion\n'), ((3057, 3067), 'nav_msgs.msg.Odometry', 'Odom... |
import cv2
from pygame import mixer
import pandas as pd
from config import GameConfig
import time
config = GameConfig()
def play_music(music_file, time=0.0): # music 함수
mixer.init()
mixer.music.load(music_file)
mixer.music.play(1, time)
# clock = pygame.time.Clock()
# clock.tick(10)
def play_s... | [
"config.GameConfig",
"pygame.mixer.init",
"cv2.threshold",
"cv2.bitwise_and",
"cv2.add",
"pygame.mixer.Sound",
"cv2.imshow",
"cv2.waitKey",
"cv2.destroyAllWindows",
"pandas.read_excel",
"pygame.mixer.music.load",
"pygame.mixer.Sound.play",
"cv2.cvtColor",
"cv2.bitwise_not",
"cv2.resize",... | [((108, 120), 'config.GameConfig', 'GameConfig', ([], {}), '()\n', (118, 120), False, 'from config import GameConfig\n'), ((177, 189), 'pygame.mixer.init', 'mixer.init', ([], {}), '()\n', (187, 189), False, 'from pygame import mixer\n'), ((194, 222), 'pygame.mixer.music.load', 'mixer.music.load', (['music_file'], {}), ... |
"""
Get channel file document id, save in file
"""
import json
from telethon import TelegramClient
from telethon.tl.types import PeerUser, PeerChannel
from config import SESSION_NAME, API_ID, API_HASH
from config import MONITORED_CHANNEL_IDS
from utils import id_to_filename
async def get_file_info(client, channel_i... | [
"telethon.TelegramClient",
"utils.id_to_filename",
"json.dump",
"telethon.tl.types.PeerChannel"
] | [((357, 380), 'telethon.tl.types.PeerChannel', 'PeerChannel', (['channel_id'], {}), '(channel_id)\n', (368, 380), False, 'from telethon.tl.types import PeerUser, PeerChannel\n'), ((794, 840), 'telethon.TelegramClient', 'TelegramClient', (['SESSION_NAME', 'API_ID', 'API_HASH'], {}), '(SESSION_NAME, API_ID, API_HASH)\n',... |
# MIT License
# Copyright (c) 2017 <NAME>
# Copyright (c) 2018 <NAME>
# A PyTorch implementation of Neural 3D Mesh Renderer (https://github.com/hiroharu-kato/neural_renderer)
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Soft... | [
"torch.from_numpy",
"torch.tensor",
"torch.sum",
"torch.zeros",
"torch.cross"
] | [((1693, 1756), 'torch.tensor', 'torch.tensor', (['color_ambient'], {'dtype': 'torch.float32', 'device': 'device'}), '(color_ambient, dtype=torch.float32, device=device)\n', (1705, 1756), False, 'import torch\n'), ((1992, 2059), 'torch.tensor', 'torch.tensor', (['color_directional'], {'dtype': 'torch.float32', 'device'... |
import logging
from solder_joint import SolderJoint
class BoardView:
def __init__(self, view_identifier):
self.view_identifier = view_identifier
self.solder_joint_dict = {}
self.slice_dict = {}
self.is_incorrect_view = False
logging.info('BoardView obj created for view id... | [
"logging.info",
"solder_joint.SolderJoint"
] | [((273, 348), 'logging.info', 'logging.info', (['"""BoardView obj created for view id: %s"""', 'self.view_identifier'], {}), "('BoardView obj created for view id: %s', self.view_identifier)\n", (285, 348), False, 'import logging\n'), ((560, 649), 'logging.info', 'logging.info', (['"""ROI+Defect found inside the solder_... |
from distutils.core import setup
from Cython.Build import cythonize
src = [
'sic/core.py',
'sic/implicit.py'
]
setup(ext_modules=cythonize(src, compiler_directives={'language_level': '3'}, build_dir='cythonized'))
| [
"Cython.Build.cythonize"
] | [((139, 227), 'Cython.Build.cythonize', 'cythonize', (['src'], {'compiler_directives': "{'language_level': '3'}", 'build_dir': '"""cythonized"""'}), "(src, compiler_directives={'language_level': '3'}, build_dir=\n 'cythonized')\n", (148, 227), False, 'from Cython.Build import cythonize\n')] |
import subprocess
for seed in [1,2,3,4,5]:
train_data = 'data/codesearchnet/java_train_bpe_10000_0.5.jsonl'
valid_data = 'data/codesearchnet/java_valid_bpe_10000_0.5.jsonl'
test_data = 'data/codesearchnet/java_test_bpe_10000_0.5.jsonl'
code_vocab = 'data/codesearchnet/java-bpe-10000-0.5_code_vocab.jso... | [
"subprocess.Popen"
] | [((670, 707), 'subprocess.Popen', 'subprocess.Popen', (['command'], {'shell': '(True)'}), '(command, shell=True)\n', (686, 707), False, 'import subprocess\n'), ((1277, 1314), 'subprocess.Popen', 'subprocess.Popen', (['command'], {'shell': '(True)'}), '(command, shell=True)\n', (1293, 1314), False, 'import subprocess\n'... |
import os
import pytest
from ..conftest import read_json
from ..conftest import TESTING_CONFIG_DIR
test_config = read_json(
os.path.join(TESTING_CONFIG_DIR, "default/unit/test-config_api.json")
)
class TestDataverse:
@pytest.mark.v4_20
@pytest.mark.parametrize(
"test_input,expected", test_confi... | [
"pytest.mark.parametrize",
"os.path.join"
] | [((131, 200), 'os.path.join', 'os.path.join', (['TESTING_CONFIG_DIR', '"""default/unit/test-config_api.json"""'], {}), "(TESTING_CONFIG_DIR, 'default/unit/test-config_api.json')\n", (143, 200), False, 'import os\n'), ((254, 358), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""test_input,expected"""', "test... |
from collections import Counter, defaultdict
import os
import pytest
"""
https://www.reddit.com/r/dailyprogrammer/comments/cmd1hb/20190805_challenge_380_easy_smooshed_morse_code_1/
Cool things learned from the python3 solutions:
- the string module has lists for ascii characters (upper and lower). Using this instead... | [
"os.path.abspath",
"pytest.mark.parametrize"
] | [((3156, 3212), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""test_input,output"""', 'test_cases'], {}), "('test_input,output', test_cases)\n", (3179, 3212), False, 'import pytest\n'), ((1317, 1342), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (1332, 1342), False, 'import os\... |
# Copyright 2022 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | [
"tensorflow.python.saved_model.loader_impl.SavedModelLoader",
"tensorflow.python.framework.importer.import_graph_def",
"tensorflow.python.framework.ops.get_default_graph",
"tensorflow.core.framework.graph_pb2.GraphDef",
"tensorflow.compiler.mlir.quantization.tensorflow.python.pywrap_quantize_model.clear_dat... | [((2699, 2753), 'tensorflow.python.saved_model.loader_impl.parse_saved_model', 'saved_model_loader.parse_saved_model', (['saved_model_path'], {}), '(saved_model_path)\n', (2735, 2753), True, 'from tensorflow.python.saved_model import loader_impl as saved_model_loader\n'), ((3407, 3460), 'tensorflow.python.saved_model.l... |
#!/usr/bin/env python3
import fnmatch
import os
import sys
import yaml
import json
import re
import glob
import argparse
import csv
from jinja2 import Template
import yamlordereddictloader
import fs
from shutil import copyfile
from jsonpath_rw import jsonpath, parse
from box import Box
from deepmerge import always_merg... | [
"re.compile",
"yaml.load",
"jinja2.Template",
"jsonpath_rw.parse",
"sys.argv.extend",
"os.walk",
"os.path.exists",
"argparse.ArgumentParser",
"box.Box",
"yaml.load_all",
"re.finditer",
"json.loads",
"yaml.safe_dump",
"deepmerge.always_merger.merge",
"yaml.dump",
"re.match",
"shutil.c... | [((29723, 29765), 're.compile', 're.compile', (['"""([^\\\\[]*)(?:\\\\[([0-9]+)\\\\])?"""'], {}), "('([^\\\\[]*)(?:\\\\[([0-9]+)\\\\])?')\n", (29733, 29765), False, 'import re\n'), ((2604, 2615), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (2613, 2615), False, 'import os\n'), ((2633, 2660), 'os.path.abspath', 'os.path.... |
import base64
import binascii
import struct
from typing import Union
from crc16 import crc16xmodem
from .exceptions import (
Ed25519SecretSeedInvalidError,
Ed25519PublicKeyInvalidError,
ValueError,
TypeError,
)
__all__ = ["StrKey"]
_version_bytes = {
"ed25519_public_key": binascii.a2b_hex("30"),... | [
"base64.b32decode",
"binascii.a2b_hex",
"struct.pack",
"crc16.crc16xmodem",
"base64.b32encode"
] | [((297, 319), 'binascii.a2b_hex', 'binascii.a2b_hex', (['"""30"""'], {}), "('30')\n", (313, 319), False, 'import binascii\n'), ((363, 385), 'binascii.a2b_hex', 'binascii.a2b_hex', (['"""90"""'], {}), "('90')\n", (379, 385), False, 'import binascii\n'), ((423, 445), 'binascii.a2b_hex', 'binascii.a2b_hex', (['"""98"""'],... |
import os, sys, boto3
def validate_bucket(argv):
found = False
if argv[0] != '':
found = True
return found
def test_s3(argv):
s3 = boto3.client('s3')
response = s3.upload_file('s3_upload.txt', argv[0], 's3_upload.txt')
if response is not None and 'error'.lower in response:
os.system('echo "Erro... | [
"os.system",
"boto3.client",
"sys.exit"
] | [((146, 164), 'boto3.client', 'boto3.client', (['"""s3"""'], {}), "('s3')\n", (158, 164), False, 'import os, sys, boto3\n'), ((299, 345), 'os.system', 'os.system', (['"""echo "Error uploading file to S3\\""""'], {}), '(\'echo "Error uploading file to S3"\')\n', (308, 345), False, 'import os, sys, boto3\n'), ((358, 448)... |
# -*- coding: utf-8 -*-
"""
Created on Tue May 26 11:19:22 2020
@author: Nauman
"""
import requests
from bs4 import BeautifulSoup
import pandas as pd
import time
startTime = time.time()
# use this manager Queue instead of multiprocessing Queue as that causes error
p = {}
pageNo = 1
qcount = 0
products=[] #List to s... | [
"bs4.BeautifulSoup",
"time.time",
"pandas.DataFrame"
] | [((178, 189), 'time.time', 'time.time', ([], {}), '()\n', (187, 189), False, 'import time\n'), ((877, 899), 'bs4.BeautifulSoup', 'BeautifulSoup', (['content'], {}), '(content)\n', (890, 899), False, 'from bs4 import BeautifulSoup\n'), ((1749, 1826), 'pandas.DataFrame', 'pd.DataFrame', (["{'Product Name': products, 'Pri... |
"""
Generate new statistics for concepticondata/README.md.
"""
import operator
import collections
from clldutils.markup import Table
from pyconcepticon.cli_util import readme
def run(args):
cls = args.repos.conceptlists.values()
readme_conceptlists(args.repos, cls, args)
readme_concept_list_meta(args.re... | [
"collections.Counter",
"operator.itemgetter",
"collections.defaultdict",
"clldutils.markup.Table"
] | [((424, 472), 'clldutils.markup.Table', 'Table', (['"""name"""', '"""# mapped"""', '"""% mapped"""', '"""mergers"""'], {}), "('name', '# mapped', '% mapped', 'mergers')\n", (429, 472), False, 'from clldutils.markup import Table\n'), ((1042, 1097), 'clldutils.markup.Table', 'Table', (['"""provider"""', '"""ID"""', '"""#... |
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.4
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import ... | [
"_cqpid.new_Connection",
"_cqpid.__ne__",
"_cqpid.Address_getName",
"_cqpid.Address_setType",
"_cqpid.Receiver_close",
"_cqpid.Connection_open",
"_cqpid.Address_setName",
"_cqpid.Session_acknowledgeUpTo",
"_cqpid.new_Session",
"_cqpid.Session_sender",
"_cqpid.Message_setDurable",
"_cqpid.decod... | [((5025, 5045), '_cqpid.__eq__', '_cqpid.__eq__', (['*args'], {}), '(*args)\n', (5038, 5045), False, 'import _cqpid\n'), ((5098, 5118), '_cqpid.__ne__', '_cqpid.__ne__', (['*args'], {}), '(*args)\n', (5111, 5118), False, 'import _cqpid\n'), ((12708, 12729), '_cqpid.__mul__', '_cqpid.__mul__', (['*args'], {}), '(*args)\... |
import sys
import pandas as pd
import numpy as np
import pickle
import os
# from xgboost import XGBClassifier
from sklearn.ensemble import RandomForestClassifier, GradientBoostingClassifier, AdaBoostClassifier
from feature_engineering import refuting_features, polarity_features, hand_features, gen_or_load_feats, word_... | [
"utils.generate_test_splits.kfold_split",
"os.path.exists",
"test_dl_model.get_predictions_from_FNC_1_Test",
"utils.dataset.DataSet",
"utils.score.report_score",
"utils.score.score_submission",
"utils.generate_test_splits.get_stances_for_folds",
"utils.score.score_cal",
"utils.system.check_version",... | [((940, 954), 'utils.system.parse_params', 'parse_params', ([], {}), '()\n', (952, 954), False, 'from utils.system import parse_params, check_version\n'), ((1407, 1494), 'feature_engineering.gen_or_load_feats', 'gen_or_load_feats', (['word_overlap_features', 'h', 'b', "('features/overlap.' + name + '.npy')"], {}), "(wo... |
import os
from django.conf import settings
from calaccess_raw import get_model_list
from django.template.loader import render_to_string
from calaccess_raw.management.commands import CalAccessCommand
class Command(CalAccessCommand):
help = 'Generate documentation for raw CAL-ACCESS database models'
def handle... | [
"os.path.join",
"calaccess_raw.get_model_list",
"django.template.loader.render_to_string"
] | [((369, 408), 'os.path.join', 'os.path.join', (['settings.REPO_DIR', '"""docs"""'], {}), "(settings.REPO_DIR, 'docs')\n", (381, 408), False, 'import os\n'), ((470, 511), 'os.path.join', 'os.path.join', (['self.docs_dir', '"""models.rst"""'], {}), "(self.docs_dir, 'models.rst')\n", (482, 511), False, 'import os\n'), ((2... |
import hashlib
import requests
from haversine import haversine
from requests.exceptions import SSLError, ConnectTimeout, ConnectionError
from django.conf import settings
from django.core.cache import cache
from django.core.files.base import ContentFile
class TencentLBS(object):
key = settings.TENCENT_LBS_KEY
... | [
"django.core.files.base.ContentFile",
"haversine.haversine",
"requests.get",
"django.core.cache.cache.set",
"django.core.cache.cache.get"
] | [((2579, 2627), 'django.core.files.base.ContentFile', 'ContentFile', ([], {'content': 'img_content', 'name': 'file_name'}), '(content=img_content, name=file_name)\n', (2590, 2627), False, 'from django.core.files.base import ContentFile\n'), ((4495, 4509), 'django.core.cache.cache.get', 'cache.get', (['key'], {}), '(key... |
"""
library containing differential equation solver for d=1 kernel elements
"""
__author__ = " <NAME>"
__email__ = "<EMAIL>"
import os
import numpy as np
from scipy.special import factorial
import pdb
np.seterr(divide='ignore', invalid='ignore')
from scipy import special
from scipy.integrate import odeint, solve_ivp... | [
"logging.getLogger",
"cosmoboost.lib.FileHandler.get_matrices_filename",
"numpy.arange",
"cosmoboost.lib.MatrixHandler.get_ML_matrix",
"cosmoboost.lib.MatrixHandler.shift_left",
"cosmoboost.lib.FileHandler.get_kernel_filename",
"os.path.exists",
"cosmoboost.lib.FileHandler.file_exists",
"numpy.delet... | [((203, 247), 'numpy.seterr', 'np.seterr', ([], {'divide': '"""ignore"""', 'invalid': '"""ignore"""'}), "(divide='ignore', invalid='ignore')\n", (212, 247), True, 'import numpy as np\n'), ((481, 508), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (498, 508), False, 'import logging\n'), (... |
#coding:utf-8
"""
author : <NAME>
date of creation : 02/10/2021
"""
import tkinter as tk
from PIL import Image, ImageTk
class Window:
def __init__(self, size: str, name: str, bg: str=None):
self.WINDOW_NAME = name
#get window height and width
a = size.index("x")
sel... | [
"tkinter.Canvas",
"PIL.Image.open",
"PIL.ImageTk.PhotoImage",
"tkinter.Tk"
] | [((2395, 2415), 'PIL.Image.open', 'Image.open', (['img_link'], {}), '(img_link)\n', (2405, 2415), False, 'from PIL import Image, ImageTk\n'), ((2486, 2509), 'PIL.ImageTk.PhotoImage', 'ImageTk.PhotoImage', (['img'], {}), '(img)\n', (2504, 2509), False, 'from PIL import Image, ImageTk\n'), ((422, 429), 'tkinter.Tk', 'tk.... |
from argparse import ArgumentParser
import asyncio
import enum
import glob
import logging
import os
import random
import ssl
import time
from functools import partial
from traceback import StackSummary
from statistics import median
from tempfile import NamedTemporaryFile
from typing import Tuple, List, IO, Set, Dict, O... | [
"logging.getLogger",
"enum.auto",
"ssl.SSLContext",
"os.path.join",
"os.path.isfile",
"statistics.median",
"traceback.StackSummary.from_list",
"os.path.isdir",
"functools.partial",
"tempfile.NamedTemporaryFile",
"asyncio.get_event_loop",
"time.time",
"random.randint"
] | [((35101, 35128), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (35118, 35128), False, 'import logging\n'), ((35136, 35160), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (35158, 35160), False, 'import asyncio\n'), ((848, 878), 'random.randint', 'random.randint', ... |
import sys
try:
import graphviz as gv
except ImportError:
print("Module graphviz needs to be installed")
print("pip install graphviz")
sys.exit()
styles = {
"graph": {
"label": "Network Map",
"fontsize": "16",
"fontcolor": "white",
"bgcolor": "#3F3F3F",
"ra... | [
"graphviz.Graph",
"sys.exit"
] | [((1653, 1675), 'graphviz.Graph', 'gv.Graph', ([], {'format': '"""svg"""'}), "(format='svg')\n", (1661, 1675), True, 'import graphviz as gv\n'), ((153, 163), 'sys.exit', 'sys.exit', ([], {}), '()\n', (161, 163), False, 'import sys\n')] |
from django.conf.urls import patterns, include
from django.contrib import admin
admin.autodiscover()
from django.contrib.auth.decorators import login_required
from website import views
urlpatterns = patterns('',
# Examples:
#(r'^static/(?P<path>.*)$','django.views.static.serve',),
# url(r'^$', 'mts.views.... | [
"django.conf.urls.include",
"website.views.PlaceListView.as_view",
"django.contrib.admin.autodiscover"
] | [((80, 100), 'django.contrib.admin.autodiscover', 'admin.autodiscover', ([], {}), '()\n', (98, 100), False, 'from django.contrib import admin\n'), ((461, 480), 'django.conf.urls.include', 'include', (['"""api.urls"""'], {}), "('api.urls')\n", (468, 480), False, 'from django.conf.urls import patterns, include\n'), ((502... |
#------------------------------------------------------delete this section and add your own mapbox token below
# import yaml #(pip install pyyaml)
# with open("config.yml", 'r') as ymlfile:
# cfg = yaml.load(ymlfile, Loader=yaml.FullLoader)
# mapbox_access_token = cfg['mysql']['key']
#-----------------------------... | [
"dash.html.Pre",
"pathlib.Path",
"dash.html.Label",
"dash.html.Li",
"dash.Input",
"dash.Output",
"dash.dcc.Graph",
"plotly.graph_objs.Scattermapbox",
"dash.html.Br",
"dash.html.A"
] | [((643, 665), 'pathlib.Path', 'pathlib.Path', (['__file__'], {}), '(__file__)\n', (655, 665), False, 'import pathlib\n'), ((3666, 3691), 'dash.Output', 'Output', (['"""graph"""', '"""figure"""'], {}), "('graph', 'figure')\n", (3672, 3691), False, 'from dash import Input, Output, html, dcc\n'), ((5261, 5291), 'dash.Outp... |
import os
import sys
extension = '.jpg'
for arg in sys.argv[1:]:
os.rename(arg, arg + extension)
| [
"os.rename"
] | [((71, 102), 'os.rename', 'os.rename', (['arg', '(arg + extension)'], {}), '(arg, arg + extension)\n', (80, 102), False, 'import os\n')] |
#!/usr/bin/env python3
# Copyright 2021 Clearpath Robotics, 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 appl... | [
"launch.substitutions.LaunchConfiguration",
"ament_index_python.packages.get_package_share_directory",
"launch.LaunchDescription",
"launch.actions.DeclareLaunchArgument",
"launch.launch_description_sources.PythonLaunchDescriptionSource",
"launch.substitutions.PathJoinSubstitution"
] | [((994, 1221), 'launch.actions.DeclareLaunchArgument', 'DeclareLaunchArgument', (['"""tf_prefix"""'], {'default_value': '"""oakd_pro"""', 'description': '"""The name of the camera. It can be different from the camera model and it will be used in naming TF."""'}), "('tf_prefix',... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# pylint: disable=R,W,E,C
"""
Author : <NAME> (r0ot h3x49)
Github : https://github.com/r0oth3x49
License : MIT
Copyright (c) 2016-2025 <NAME> (r0ot h3x49)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated docume... | [
"xpath.logger.colored_logger.logger.success",
"xpath.common.session.session.fetch_from_table",
"xpath.logger.colored_logger.logger.critical",
"xpath.common.lib.TBLS_STATEMENT.format",
"xpath.common.utils.prepare_payload_request",
"xpath.common.utils.clean_up_offset_payload",
"xpath.common.lib.collection... | [((1859, 1891), 'xpath.common.utils.clean_up_offset_payload', 'clean_up_offset_payload', (['payload'], {}), '(payload)\n', (1882, 1891), False, 'from xpath.common.utils import to_hex, prettifier, prepare_payload_request, clean_up_offset_payload\n'), ((2933, 3021), 'xpath.common.lib.collections.namedtuple', 'collections... |
#coding=utf-8
'''
Created on 2015-9-24
@author: Devuser
'''
from doraemon.ci.pagefactory.ci_task_pageworker import CITaskPageWorker
from doraemon.ci.viewmodels.ci_left_nav_bar import CITestingLeftNavBar
from doraemon.ci.viewmodels.ci_sub_nav_bar import CITestingTaskSubNavBar
from doraemon.ci.viewmodels.ci_task_propert... | [
"doraemon.ci.models.AutoCaseResult.objects.get_by_resultid",
"doraemon.ci.viewmodels.vm_ci_task_history.VM_CITaskHistory",
"doraemon.ci.viewmodels.vm_ci_task.VM_CITask",
"business.ci.ci_task_service.CITaskService.get_products_include_me",
"business.ci.ci_task_history_service.CITaskHistoryService.get_finishe... | [((1116, 1156), 'doraemon.ci.pagefactory.ci_task_pageworker.CITaskPageWorker.__init__', 'CITaskPageWorker.__init__', (['self', 'request'], {}), '(self, request)\n', (1141, 1156), False, 'from doraemon.ci.pagefactory.ci_task_pageworker import CITaskPageWorker\n'), ((1708, 1754), 'business.ci.ci_task_service.CITaskServic... |
"""
Testing what the fastest way is to create a 1D Array with 2 values
"""
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import random
import numpy as np
x, y = random.uniform(0, 300), random.uniform(0, 300)
def numpy_array(x, y):
# Calculate distances between each of the... | [
"random.uniform",
"numpy.fromiter",
"numpy.ones",
"numpy.asarray",
"numpy.asanyarray",
"numpy.array",
"numpy.zeros",
"os.path.dirname",
"numpy.array_equal"
] | [((1970, 1986), 'numpy.array', 'np.array', (['[x, y]'], {}), '([x, y])\n', (1978, 1986), True, 'import numpy as np\n'), ((203, 225), 'random.uniform', 'random.uniform', (['(0)', '(300)'], {}), '(0, 300)\n', (217, 225), False, 'import random\n'), ((227, 249), 'random.uniform', 'random.uniform', (['(0)', '(300)'], {}), '... |
import asyncio
from reactivestreams.subscriber import Subscriber
from reactivestreams.subscription import DefaultSubscription
class CollectorSubscriber(Subscriber):
def __init__(self) -> None:
self.is_done = asyncio.Event()
self.error = None
self.values = []
self.subscription = N... | [
"asyncio.Event"
] | [((224, 239), 'asyncio.Event', 'asyncio.Event', ([], {}), '()\n', (237, 239), False, 'import asyncio\n')] |
import numpy as np
class GPInterface(object):
def __init__(self):
self.kernel = None
self.ndim = None
self.model = None
self.outdim = 1
def create_kernel(self, ndim, kernel_name, var_f=1.0, lengthscale=1.0):
pass
def create_model(self, x, y, noise_var, noise_prior)... | [
"numpy.ones",
"numpy.isscalar"
] | [((540, 564), 'numpy.isscalar', 'np.isscalar', (['lengthscale'], {}), '(lengthscale)\n', (551, 564), True, 'import numpy as np\n'), ((592, 605), 'numpy.ones', 'np.ones', (['ndim'], {}), '(ndim)\n', (599, 605), True, 'import numpy as np\n')] |
import logging
from urllib.parse import urlsplit
import requests
import xmltodict
from .cmd_input import GetInputsListCommand, GetCurrentInputCommand, ChangeInputCommand
from .cmd_pair import BeginPairCommand, CancelPairCommand, PairChallengeCommand
from .cmd_power import GetPowerStateCommand
from .cmd_remote import ... | [
"logging.getLogger",
"requests.get",
"urllib.parse.urlsplit"
] | [((493, 520), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (510, 520), False, 'import logging\n'), ((2172, 2194), 'urllib.parse.urlsplit', 'urlsplit', (['dev.location'], {}), '(dev.location)\n', (2180, 2194), False, 'from urllib.parse import urlsplit\n'), ((1828, 1868), 'requests.get', ... |
from wtforms_components import SelectMultipleField
from wtforms_test import FormTestCase
from wtforms import Form
from tests import MultiDict
class Dummy(object):
fruits = []
class TestSelectMultipleField(FormTestCase):
choices = (
('Fruits', (
('apple', 'Apple'),
('peach', '... | [
"tests.MultiDict",
"wtforms_components.SelectMultipleField"
] | [((605, 634), 'wtforms_components.SelectMultipleField', 'SelectMultipleField', ([], {}), '(**kwargs)\n', (624, 634), False, 'from wtforms_components import SelectMultipleField\n'), ((847, 902), 'tests.MultiDict', 'MultiDict', (["[('fruits', 'apple'), ('fruits', 'invalid')]"], {}), "([('fruits', 'apple'), ('fruits', 'in... |
from django.shortcuts import render
import requests
from bs4 import BeautifulSoup
def art(req):
event_r = requests.get("https://www.eventbrite.com/d/dc--washington/free--arts--events--this-week/?page=1")
event_soup = BeautifulSoup(event_r.content, 'html.parser')
eventbrite = getEvent(event_soup)
retur... | [
"bs4.BeautifulSoup",
"django.shortcuts.render",
"requests.get"
] | [((111, 218), 'requests.get', 'requests.get', (['"""https://www.eventbrite.com/d/dc--washington/free--arts--events--this-week/?page=1"""'], {}), "(\n 'https://www.eventbrite.com/d/dc--washington/free--arts--events--this-week/?page=1'\n )\n", (123, 218), False, 'import requests\n'), ((226, 271), 'bs4.BeautifulSoup... |
import datetime
from database.database_schemas import Schemas
from sqlalchemy import Column, ForeignKey, Integer, String, DateTime
from sqlalchemy.dialects.mysql import BIGINT, SMALLINT, DOUBLE, TIMESTAMP, TINYINT
from database.base import Base
class Tablespaces(Base):
"""Maps to TABLESPACES table in informatio... | [
"sqlalchemy.Column"
] | [((454, 484), 'sqlalchemy.Column', 'Column', (['String'], {'nullable': '(False)'}), '(String, nullable=False)\n', (460, 484), False, 'from sqlalchemy import Column, ForeignKey, Integer, String, DateTime\n'), ((498, 528), 'sqlalchemy.Column', 'Column', (['String'], {'nullable': '(False)'}), '(String, nullable=False)\n',... |
#!/usr/bin/env python3
# <NAME>
# <EMAIL>
import logging
import numpy as np
import pandas as pd
from bioidtracker.database_manager import DatabaseManager
from bioidtracker.db import DB
class Dataset:
"""Todo."""
def __init__(self, db_manager: DatabaseManager, narrow_search=True):
"""Todo.
... | [
"logging.getLogger",
"pandas.Series",
"numpy.unique",
"numpy.any",
"pandas.DataFrame",
"numpy.all",
"pandas.concat"
] | [((422, 450), 'logging.getLogger', 'logging.getLogger', (['"""dataset"""'], {}), "('dataset')\n", (439, 450), False, 'import logging\n'), ((1487, 1502), 'numpy.all', 'np.all', (['id_vers'], {}), '(id_vers)\n', (1493, 1502), True, 'import numpy as np\n'), ((2572, 2586), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\... |
# -*- coding:utf-8 -*-
from src.Client.Conf.config import *
from src.Client.MissionSystem import missionSystem
from src.Client.SystemTools.ConfFileRead import configFileRead
from src.Client.View.MainFrame.TabFrame.FirstTabFrame import messageFrame
class EditWindow():
"""
编辑任务的GUI界面。负责显示编辑任务的GUI以及非法输入拦截。
... | [
"src.Client.MissionSystem.missionSystem.MissionSystem",
"src.Client.SystemTools.ConfFileRead.configFileRead.ConfigFileRead"
] | [((2220, 2249), 'src.Client.MissionSystem.missionSystem.MissionSystem', 'missionSystem.MissionSystem', ([], {}), '()\n', (2247, 2249), False, 'from src.Client.MissionSystem import missionSystem\n'), ((2370, 2427), 'src.Client.SystemTools.ConfFileRead.configFileRead.ConfigFileRead', 'configFileRead.ConfigFileRead', ([],... |
#!/usr/bin/env python2
'''
description: Convert directory with downloaded zipped KNMI ascii files to
netCDF format. Station information is obtained from a csv file.
Creation of the csv file and downloading of the KNMI data is
performed in another script (knmi_getdata.py).
aut... | [
"netcdftime.date2num",
"csv.DictReader",
"load_knmi_data.load_knmi_data",
"collections.defaultdict",
"numpy.dtype",
"time.time"
] | [((1095, 1124), 'collections.defaultdict', 'collections.defaultdict', (['list'], {}), '(list)\n', (1118, 1124), False, 'import collections\n'), ((5595, 5631), 'csv.DictReader', 'csv.DictReader', (['csvin'], {'delimiter': '""","""'}), "(csvin, delimiter=',')\n", (5609, 5631), False, 'import csv\n'), ((968, 992), 'load_k... |
import argparse
from converter.extractor import Extractor
from config.config import Config
config = Config(True)
extractor = Extractor(config)
def parseArgs():
parser = argparse.ArgumentParser()
parser.add_argument("--type", "-t", type=str, default='txt',
help="Output file type: txt or fgdc or iso19115v2")
pa... | [
"config.config.Config",
"argparse.ArgumentParser",
"converter.extractor.Extractor"
] | [((102, 114), 'config.config.Config', 'Config', (['(True)'], {}), '(True)\n', (108, 114), False, 'from config.config import Config\n'), ((127, 144), 'converter.extractor.Extractor', 'Extractor', (['config'], {}), '(config)\n', (136, 144), False, 'from converter.extractor import Extractor\n'), ((172, 197), 'argparse.Arg... |
# coding=utf8
import threading
import zmq
import sys
import datetime
import json
import os
import time
from .import sensor_list_pb2
from .import event_list_pb2
# import sensor_list_pb2
# import event_list_pb2
# 监听的ip和端口
tcp_sensor='tcp://192.168.20.213:40210'
# 传感类数据对象
class Data:
def __init__(self, tag, data_t... | [
"threading.Thread",
"datetime.datetime.fromtimestamp",
"zmq.Context",
"time.sleep"
] | [((1228, 1263), 'datetime.datetime.fromtimestamp', 'datetime.datetime.fromtimestamp', (['ts'], {}), '(ts)\n', (1259, 1263), False, 'import datetime\n'), ((1849, 1862), 'zmq.Context', 'zmq.Context', ([], {}), '()\n', (1860, 1862), False, 'import zmq\n'), ((2130, 2171), 'threading.Thread', 'threading.Thread', ([], {'targ... |
#! /usr/local/bin/python
# ! -*- encoding:utf-8 -*-
from pathlib import Path
import pandas as pd
import numpy as np
import random
import os
import argparse
proj_path = Path(__file__).parent.resolve().parent.resolve().parent.resolve()
data_path = proj_path / 'data' / 'PPP'
def read_csv(data_file, dataset):
cci_la... | [
"random.choice",
"argparse.ArgumentParser",
"pandas.read_csv",
"pathlib.Path",
"random.seed",
"numpy.random.seed",
"pandas.DataFrame",
"random.randint"
] | [((487, 527), 'pandas.read_csv', 'pd.read_csv', (['edge_list_path'], {'header': 'None'}), '(edge_list_path, header=None)\n', (498, 527), True, 'import pandas as pd\n'), ((2419, 2439), 'random.choice', 'random.choice', (['nodes'], {}), '(nodes)\n', (2432, 2439), False, 'import random\n'), ((2585, 2599), 'pandas.DataFram... |
"""utils.py
helper functions
"""
import utime
from machine import reset
def timed_function(f, *args, **kwargs):
"""Time function
Time a function using @timed_function decorator
"""
myname = str(f).split(' ')[1]
def new_func(*args, **kwargs):
t = utime.ticks_us()
result = f(*args... | [
"utime.ticks_us"
] | [((279, 295), 'utime.ticks_us', 'utime.ticks_us', ([], {}), '()\n', (293, 295), False, 'import utime\n'), ((365, 381), 'utime.ticks_us', 'utime.ticks_us', ([], {}), '()\n', (379, 381), False, 'import utime\n')] |
from django.shortcuts import render, redirect, get_object_or_404
from .models import Post, Comment
from django.views.generic import DetailView, DeleteView, CreateView
from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin
from django.contrib import messages
from django.urls import reverse
from d... | [
"django.shortcuts.render",
"django.http.HttpResponseRedirect",
"django.contrib.messages.warning",
"django.shortcuts.get_object_or_404",
"django.contrib.messages.success",
"django.shortcuts.redirect",
"django.urls.reverse"
] | [((984, 1026), 'django.shortcuts.render', 'render', (['request', '"""feed/feed.html"""', 'context'], {}), "(request, 'feed/feed.html', context)\n", (990, 1026), False, 'from django.shortcuts import render, redirect, get_object_or_404\n'), ((2266, 2296), 'django.shortcuts.get_object_or_404', 'get_object_or_404', (['Post... |
from hydroDL import kPath, utils
from hydroDL.app import waterQuality
from hydroDL.master import basins
from hydroDL.data import usgs, gageII, gridMET, ntn, transform
from hydroDL.master import slurm
from hydroDL.post import axplot, figplot
import numpy as np
import matplotlib.pyplot as plt
codeLst = sorted(usgs.newC)... | [
"numpy.array",
"hydroDL.data.transform.transInAll",
"hydroDL.utils.sortData",
"hydroDL.app.waterQuality.DataModelWQ",
"hydroDL.app.waterQuality.extractVarMtd",
"matplotlib.pyplot.subplots"
] | [((367, 401), 'hydroDL.app.waterQuality.DataModelWQ', 'waterQuality.DataModelWQ', (['dataName'], {}), '(dataName)\n', (391, 401), False, 'from hydroDL.app import waterQuality\n'), ((562, 597), 'hydroDL.app.waterQuality.extractVarMtd', 'waterQuality.extractVarMtd', (['codeLst'], {}), '(codeLst)\n', (588, 597), False, 'f... |
""" Affine image registration module consisting of the following classes:
AffineMap: encapsulates the necessary information to perform affine
transforms between two domains, defined by a `static` and a `moving`
image. The `domain` of the transform is the set of points in the
`static` image'... | [
"numpy.eye",
"numpy.ceil",
"numpy.ones",
"numpy.array",
"numpy.linalg.inv",
"numpy.isnan",
"numpy.empty"
] | [((48493, 48508), 'numpy.eye', 'np.eye', (['(dim + 1)'], {}), '(dim + 1)\n', (48499, 48508), True, 'import numpy as np\n'), ((50090, 50105), 'numpy.eye', 'np.eye', (['(dim + 1)'], {}), '(dim + 1)\n', (50096, 50105), True, 'import numpy as np\n'), ((51476, 51491), 'numpy.eye', 'np.eye', (['(dim + 1)'], {}), '(dim + 1)\n... |
from src.tools.botfunction import BotFunction
import discord
from discord.utils import get
import psycopg2
import random
import string
import smtplib
from src.modules.db_helper import member_exists, connection_error, refresh_member_in_db
class direct_message(BotFunction):
def __init__(self, *args, **kwargs):
... | [
"smtplib.SMTP_SSL",
"src.modules.db_helper.refresh_member_in_db",
"discord.utils.get",
"src.modules.db_helper.member_exists",
"random.choices",
"src.modules.db_helper.connection_error"
] | [((1500, 1559), 'random.choices', 'random.choices', (['(string.ascii_uppercase + string.digits)'], {'k': '(8)'}), '(string.ascii_uppercase + string.digits, k=8)\n', (1514, 1559), False, 'import random\n'), ((1584, 1628), 'src.modules.db_helper.member_exists', 'member_exists', (['conn', 'message.author.id', '(True)'], {... |
from requests_futures.sessions import FuturesSession
import os
session = FuturesSession(max_workers = 10)
def make_logs_query(log):
log_id = log['code']
query = """
{
reportData{
report(code: "%s"){
fights(difficulty: 5){
name
id
averageItemLevel
... | [
"requests_futures.sessions.FuturesSession"
] | [((75, 105), 'requests_futures.sessions.FuturesSession', 'FuturesSession', ([], {'max_workers': '(10)'}), '(max_workers=10)\n', (89, 105), False, 'from requests_futures.sessions import FuturesSession\n')] |
# '##::::'##::::'###::::'##::: ##:'####:'########:'##:::'##:'##::::'##:'##::: ##:'########:'##::::'##:
# ##:::: ##:::'## ##::: ###:: ##:. ##::... ##..::. ##:'##:: ###::'###: ###:: ##: ##.....:: ###::'###:
# ##:::: ##::'##:. ##:: ####: ##:: ##::::: ##:::::. ####::: ####'####: ####: ##: ##::::::: ####'####:
# ##:::: #... | [
"wallycore.bip39_mnemonic_from_bytes",
"wallycore.bip32_key_from_seed",
"argparse.ArgumentParser",
"re.compile",
"wallycore.bip39_mnemonic_to_seed",
"os.urandom",
"wallycore.bip32_key_to_base58",
"wallycore.bip32_key_to_address",
"wallycore.bip32_key_from_parent_path",
"argparse.ArgumentTypeError"... | [((2315, 2493), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Create a valid Bitcoin mnemonic with a vanity address in a specific derivation."""', 'epilog': '"""MIT License - Copyright (c) 2020 <NAME>"""'}), "(description=\n 'Create a valid Bitcoin mnemonic with a vanity address in a... |
import sys
import boto3, os
import requests
from pyspark.sql import SparkSession
from pyspark.sql import Row
from awsglue.transforms import *
from awsglue.utils import getResolvedOptions
from pyspark.context import SparkContext
from awsglue.context import GlueContext
from awsglue.dynamicframe import DynamicFrame
from a... | [
"pyspark.sql.Row",
"awsglue.dynamicframe.DynamicFrame.fromDF",
"awsglue.job.Job",
"boto3.Session",
"os.path.join",
"requests.get",
"boto3.resource",
"awsglue.utils.getResolvedOptions",
"pyspark.sql.SparkSession.builder.appName",
"awsglue.context.GlueContext"
] | [((1070, 1090), 'boto3.resource', 'boto3.resource', (['"""s3"""'], {}), "('s3')\n", (1084, 1090), False, 'import boto3, os\n'), ((1257, 1299), 'awsglue.utils.getResolvedOptions', 'getResolvedOptions', (['sys.argv', "['JOB_NAME']"], {}), "(sys.argv, ['JOB_NAME'])\n", (1275, 1299), False, 'from awsglue.utils import getRe... |
#
# This script will reboot the AWS instance based on the instance-id
#
# Pre requisite: need to have aws cli installed first!
#
import os
import time
print(time.ctime())
#time.sleep(600)
aws_cmd1 = 'aws ec2 describe-instances --query "Reservations[].Instances[].InstanceId" --filter "Name=instance-state-name,Values... | [
"os.system",
"time.ctime"
] | [((419, 438), 'os.system', 'os.system', (['aws_cmd1'], {}), '(aws_cmd1)\n', (428, 438), False, 'import os\n'), ((159, 171), 'time.ctime', 'time.ctime', ([], {}), '()\n', (169, 171), False, 'import time\n'), ((445, 457), 'time.ctime', 'time.ctime', ([], {}), '()\n', (455, 457), False, 'import time\n'), ((871, 890), 'os.... |
# Generated by Django 3.2.8 on 2021-10-09 19:26
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='HourlyData',
fields=[
('id', models.BigAuto... | [
"django.db.models.TimeField",
"django.db.models.IntegerField",
"django.db.models.BigAutoField",
"django.db.models.DateTimeField",
"django.db.models.CharField"
] | [((306, 402), 'django.db.models.BigAutoField', 'models.BigAutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (325, 402), False, 'from django.db import migrations, m... |
from JumpScale import j
from JumpScale.grid.osis.OSISStoreMongo import OSISStoreMongo
# from JumpScale.grid.osis.OSISStore import OSISStore
ujson = j.db.serializers.getSerializerType('j')
class mainclass(OSISStoreMongo):
"""
"""
| [
"JumpScale.j.db.serializers.getSerializerType"
] | [((149, 188), 'JumpScale.j.db.serializers.getSerializerType', 'j.db.serializers.getSerializerType', (['"""j"""'], {}), "('j')\n", (183, 188), False, 'from JumpScale import j\n')] |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | [
"yaml.safe_dump"
] | [((673, 725), 'yaml.safe_dump', 'yaml.safe_dump', (['obj.result'], {'default_flow_style': '(False)'}), '(obj.result, default_flow_style=False)\n', (687, 725), False, 'import yaml\n')] |
# Created by DraX on 2005.08.12
# minor fixes by DrLecter 2005.09.10
import sys
from ru.catssoftware.gameserver.model.quest import State
from ru.catssoftware.gameserver.model.quest import QuestState
from ru.catssoftware.gameserver.model.quest.jython import QuestJython as JQuest
qn = "9001_alliance"
NPC=... | [
"ru.catssoftware.gameserver.model.quest.jython.QuestJython.__init__"
] | [((1513, 1551), 'ru.catssoftware.gameserver.model.quest.jython.QuestJython.__init__', 'JQuest.__init__', (['self', 'id', 'name', 'descr'], {}), '(self, id, name, descr)\n', (1528, 1551), True, 'from ru.catssoftware.gameserver.model.quest.jython import QuestJython as JQuest\n')] |
# coding=UTF-8
from django.db.models import Q
from ladder.models import Challenge, Rank
from math import ceil
def _open_challenges_exist(user, ladder):
"""Returns True if there are challenges open in the provided ladder for the user."""
open_challenges = Challenge.objects.filter( (Q(challenger=user)|Q(challen... | [
"django.db.models.Q",
"ladder.models.Rank.objects.filter"
] | [((1832, 1887), 'ladder.models.Rank.objects.filter', 'Rank.objects.filter', ([], {'ladder': 'ladder', 'rank__range': 'r_range'}), '(ladder=ladder, rank__range=r_range)\n', (1851, 1887), False, 'from ladder.models import Challenge, Rank\n'), ((423, 439), 'django.db.models.Q', 'Q', ([], {'ladder': 'ladder'}), '(ladder=la... |
import matplotlib
from matplotlib.pyplot import subplot, plot, show
from numpy import linspace, sin, pi
import seismo
matplotlib.style.use('ggplot')
x = linspace(0, 0.05, 500)
y = 0.6*sin(2*pi*240*x)\
+ 0.15*sin(2*pi*1303*x + 0.4)\
+ 0.1*sin(2*pi*3000*x)
f, a = seismo.deeming(x, y)
subplot(211)
plot(x, y, '... | [
"numpy.sin",
"matplotlib.pyplot.plot",
"numpy.linspace",
"matplotlib.style.use",
"seismo.deeming",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show"
] | [((119, 149), 'matplotlib.style.use', 'matplotlib.style.use', (['"""ggplot"""'], {}), "('ggplot')\n", (139, 149), False, 'import matplotlib\n'), ((155, 177), 'numpy.linspace', 'linspace', (['(0)', '(0.05)', '(500)'], {}), '(0, 0.05, 500)\n', (163, 177), False, 'from numpy import linspace, sin, pi\n'), ((273, 293), 'sei... |
"""
Copyright (c) 2019 razaqq
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublice... | [
"PyQt5.QtGui.QDesktopServices.openUrl",
"PyQt5.QtGui.QFont",
"PyQt5.QtCore.QUrl",
"PyQt5.QtWidgets.QHeaderView",
"PyQt5.QtWidgets.QTableWidgetItem"
] | [((2222, 2254), 'PyQt5.QtWidgets.QHeaderView', 'QHeaderView', (['Qt.Horizontal', 'self'], {}), '(Qt.Horizontal, self)\n', (2233, 2254), False, 'from PyQt5.QtWidgets import QTableWidget, QHeaderView, QTableWidgetItem, QAbstractItemView\n'), ((2050, 2068), 'PyQt5.QtWidgets.QTableWidgetItem', 'QTableWidgetItem', ([], {}),... |
def run(event, context):
url = event.get('url')
if url:
from osbot_browser.browser.Browser_Lamdba_Helper import Browser_Lamdba_Helper
browser = Browser_Lamdba_Helper().setup()
return browser.get_screenshot_png(url)
| [
"osbot_browser.browser.Browser_Lamdba_Helper.Browser_Lamdba_Helper"
] | [((168, 191), 'osbot_browser.browser.Browser_Lamdba_Helper.Browser_Lamdba_Helper', 'Browser_Lamdba_Helper', ([], {}), '()\n', (189, 191), False, 'from osbot_browser.browser.Browser_Lamdba_Helper import Browser_Lamdba_Helper\n')] |
# python3
"""Example: Quantum Teleportation."""
import math
from absl import app
import numpy as np
from src.lib import bell
from src.lib import ops
from src.lib import state
def alice_measures(alice: state.State,
expect0: np.complexfloating, expect1: np.complexfloating,
qubit... | [
"absl.app.UsageError",
"math.isclose",
"math.sqrt",
"absl.app.run",
"src.lib.ops.Cnot",
"src.lib.bell.bell_state",
"src.lib.ops.Hadamard",
"src.lib.ops.PauliZ",
"src.lib.ops.Measure",
"src.lib.ops.PauliX",
"src.lib.state.qubit"
] | [((702, 739), 'src.lib.ops.Measure', 'ops.Measure', (['alice', '(0)'], {'tostate': 'qubit0'}), '(alice, 0, tostate=qubit0)\n', (713, 739), False, 'from src.lib import ops\n'), ((754, 792), 'src.lib.ops.Measure', 'ops.Measure', (['alice0', '(1)'], {'tostate': 'qubit1'}), '(alice0, 1, tostate=qubit1)\n', (765, 792), Fals... |
#!/usr/bin/python
"""
roadGrid.py: version 0.1.0
A quick 2D Voxel implemenation.
History:
2017/01/29: coding style phase1:
reformat to python-guide.org code style
http://docs.python-guide.org/en/latest/writing/style/
which uses PEP 8 as a base: http://pep8.org/.
2017/01/23: Initial version converted to a c... | [
"numpy.polyfit",
"numpy.array",
"re.compile"
] | [((4602, 4620), 'numpy.array', 'np.array', (['[y0, y1]'], {}), '([y0, y1])\n', (4610, 4620), True, 'import numpy as np\n'), ((4636, 4654), 'numpy.array', 'np.array', (['[x0, x1]'], {}), '([x0, x1])\n', (4644, 4654), True, 'import numpy as np\n'), ((15339, 15382), 're.compile', 're.compile', (["('^%s[0123456789]+$' % la... |
#!/usr/bin/env python
#
# Copyright (c) 2011 <NAME> (zuo). All rights reserved.
# Licensed under the MIT License.
#
# Python 2.5+/3.x-compatibile.
#
# The newest version of this module should be downloadable from:
# https://github.com/zuo/Zuo-s-Recipes-and-Drafts/blob/master/auxmethods.py
from __future__ import with_s... | [
"functools.wraps",
"sys.exc_info",
"inspect.isfunction",
"time.time",
"inspect.getmro"
] | [((2308, 2319), 'functools.wraps', 'wraps', (['func'], {}), '(func)\n', (2313, 2319), False, 'from functools import wraps\n'), ((3265, 3276), 'inspect.getmro', 'getmro', (['cls'], {}), '(cls)\n', (3271, 3276), False, 'from inspect import getmro, isfunction\n'), ((4979, 4995), 'inspect.isfunction', 'isfunction', (['func... |
from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin
from django.views.generic import ListView, DetailView
from django.views.generic.edit import UpdateView, DeleteView, CreateView
from django.urls import reverse_lazy
from django.template.loader import render_to_string
from .forms import Articl... | [
"django.shortcuts.render",
"django.contrib.auth.update_session_auth_hash",
"django.http.JsonResponse",
"django.http.HttpResponse",
"django.contrib.messages.error",
"django.contrib.messages.success",
"django.shortcuts.redirect",
"django.urls.reverse_lazy",
"django.template.loader.render_to_string"
] | [((1091, 1151), 'django.http.HttpResponse', 'HttpResponse', (['articles.json'], {'content_type': '"""application/json"""'}), "(articles.json, content_type='application/json')\n", (1103, 1151), False, 'from django.http import HttpResponse\n'), ((1373, 1440), 'django.http.HttpResponse', 'HttpResponse', (['articles.xls'],... |
from pydrive.drive import GoogleDrive
from pydrive.auth import GoogleAuth
from oauth2client.client import OAuth2Credentials
import json
import sys
import os
FOLDER_NAME='TrialFolder'
PARENT_FOLDER='root'
DOWNLOAD_FOLDER='folderdownloads'
def load_saved_credentials():
with open('token.json','r') as cred_file:
... | [
"json.dumps",
"pydrive.drive.GoogleDrive",
"pydrive.auth.GoogleAuth",
"os.path.isdir",
"os.mkdir",
"json.load"
] | [((512, 529), 'json.dumps', 'json.dumps', (['creds'], {}), '(creds)\n', (522, 529), False, 'import json\n'), ((576, 588), 'pydrive.auth.GoogleAuth', 'GoogleAuth', ([], {}), '()\n', (586, 588), False, 'from pydrive.auth import GoogleAuth\n'), ((679, 697), 'pydrive.drive.GoogleDrive', 'GoogleDrive', (['gauth'], {}), '(ga... |
__version__ = '0.0.1'
# Set default logging handler to avoid "No handler found" warnings.
import logging
logging.getLogger('atlas_s3_hook').addHandler(logging.NullHandler())
| [
"logging.NullHandler",
"logging.getLogger"
] | [((153, 174), 'logging.NullHandler', 'logging.NullHandler', ([], {}), '()\n', (172, 174), False, 'import logging\n'), ((107, 141), 'logging.getLogger', 'logging.getLogger', (['"""atlas_s3_hook"""'], {}), "('atlas_s3_hook')\n", (124, 141), False, 'import logging\n')] |
import time
from api.utils.tool import md5
from api.core.anime import *
from api.core.proxy import AnimeProxy
class ZZZFun(AnimeSearcher):
async def search(self, keyword: str):
api = "http://service-agbhuggw-1259251677.gz.apigw.tencentcs.com/android/search"
resp = await self.post(api, data={"use... | [
"time.time"
] | [((2256, 2267), 'time.time', 'time.time', ([], {}), '()\n', (2265, 2267), False, 'import time\n')] |
import os
import requests
RECIPE_ID = int(os.getenv('RECIPE_ID'))
DATAPREP_TOKEN = os.getenv('DATAPREP_TOKEN')
JOB_URL = 'https://api.clouddataprep.com/v4/jobGroups'
def trigger(event, context):
"""Triggered by a change to a Cloud Storage bucket. This will start a
Dataprep job based on the configured recipe... | [
"requests.post",
"os.getenv"
] | [((85, 112), 'os.getenv', 'os.getenv', (['"""DATAPREP_TOKEN"""'], {}), "('DATAPREP_TOKEN')\n", (94, 112), False, 'import os\n'), ((44, 66), 'os.getenv', 'os.getenv', (['"""RECIPE_ID"""'], {}), "('RECIPE_ID')\n", (53, 66), False, 'import os\n'), ((1255, 1308), 'requests.post', 'requests.post', (['JOB_URL'], {'json': 'pa... |
# Generated by Django 3.2 on 2021-09-12 02:34
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='... | [
"datetime.datetime",
"django.db.models.BooleanField"
] | [((393, 427), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'default': '(False)'}), '(default=False)\n', (412, 427), False, 'from django.db import migrations, models\n'), ((579, 640), 'datetime.datetime', 'datetime.datetime', (['(2021)', '(9)', '(12)', '(2)', '(34)', '(57)', '(839627)'], {'tzinfo': 'utc... |
"""
Example of using glinda to test a service.
This file is an example of using the ``glinda.testing`` package to
test a very simple Tornado application.
"""
import os
from tornado import gen, httpclient, web
import tornado.testing
from glinda.testing import services
class MyHandler(web.RequestHandler):
"""
... | [
"tornado.web.url",
"tornado.web.HTTPError",
"glinda.testing.services.Response",
"glinda.testing.services.ServiceLayer",
"tornado.httpclient.AsyncHTTPClient",
"glinda.testing.services.Request"
] | [((757, 785), 'tornado.httpclient.AsyncHTTPClient', 'httpclient.AsyncHTTPClient', ([], {}), '()\n', (783, 785), False, 'from tornado import gen, httpclient, web\n'), ((1723, 1746), 'glinda.testing.services.ServiceLayer', 'services.ServiceLayer', ([], {}), '()\n', (1744, 1746), False, 'from glinda.testing import service... |
# Nome do arquivo: views.py
# Autor: <NAME> <NAME>
# Creado em: Janeiro de 2022
# Última modificação: 09 de Janeiro de 2022 às 19h54
# Licença: MIT
from rest_framework import viewsets, generics
from escola.models import Aluno, Curso, Matricula
from escola.serializer import AlunoSerializer, CursoSerializer, MatriculaSe... | [
"escola.models.Curso.objects.all",
"escola.models.Aluno.objects.all",
"escola.models.Matricula.objects.all",
"escola.models.Matricula.objects.filter"
] | [((595, 614), 'escola.models.Aluno.objects.all', 'Aluno.objects.all', ([], {}), '()\n', (612, 614), False, 'from escola.models import Aluno, Curso, Matricula\n'), ((843, 862), 'escola.models.Curso.objects.all', 'Curso.objects.all', ([], {}), '()\n', (860, 862), False, 'from escola.models import Aluno, Curso, Matricula\... |
from button_logic import ButtonLogic
from fake_hw import FakeHardware
from hardware import Hardware, is_pi
from internet_checker import InternetChecker
from paper_status import PaperStatus
from recording import Recording
from tg import Telegram
import os
def main():
print("CWD:", os)
hardware = Hardware()
... | [
"internet_checker.InternetChecker",
"fake_hw.FakeHardware",
"paper_status.PaperStatus",
"hardware.Hardware",
"recording.Recording",
"tg.Telegram",
"button_logic.ButtonLogic"
] | [((306, 316), 'hardware.Hardware', 'Hardware', ([], {}), '()\n', (314, 316), False, 'from hardware import Hardware, is_pi\n'), ((333, 352), 'recording.Recording', 'Recording', (['hardware'], {}), '(hardware)\n', (342, 352), False, 'from recording import Recording\n'), ((414, 439), 'internet_checker.InternetChecker', 'I... |
import os
from logging import getLogger
from simpleworker import WorkerManager
from ..commands import download_media, update_items
from ..settings import DATA_PATH, WORKERS_DOWNLOAD_MEDIA, WORKERS_UPDATE_ITEMS
__all__ = ('job_manager',)
def make_worker(cmd):
def worker(name, queue):
log = getLogger('m... | [
"logging.getLogger",
"os.path.join"
] | [((308, 345), 'logging.getLogger', 'getLogger', (["('mediafeed.jobs.%s' % name)"], {}), "('mediafeed.jobs.%s' % name)\n", (317, 345), False, 'from logging import getLogger\n'), ((764, 796), 'os.path.join', 'os.path.join', (['DATA_PATH', '"""tasks"""'], {}), "(DATA_PATH, 'tasks')\n", (776, 796), False, 'import os\n')] |
from math import floor, sqrt
from _cont_frac_tools import CF
def find_odd_period(ceiling):
"""
Returns the number of continued fractions of sqrt(n) for n <= ceiling
which have an odd period.
"""
# len(CF(a)) is one larger than the period of sqrt(a)
return len([
a for a in range(2, cei... | [
"_cont_frac_tools.CF"
] | [((337, 342), '_cont_frac_tools.CF', 'CF', (['a'], {}), '(a)\n', (339, 342), False, 'from _cont_frac_tools import CF\n')] |
import requests
from flask import current_app as app
from model.Survey import Survey
from model.SurveyResult import SurveyResult
from service import eids_service
class SurveyGizmo:
"""
A class that retrieves survey data from a Survey Gizmo survey
"""
@property
def survey(self):
"""
... | [
"model.Survey.Survey",
"model.SurveyResult.SurveyResult",
"flask.current_app.app_context",
"flask.current_app.config.get"
] | [((553, 570), 'flask.current_app.app_context', 'app.app_context', ([], {}), '()\n', (568, 570), True, 'from flask import current_app as app\n'), ((596, 634), 'flask.current_app.config.get', 'app.config.get', (['"""SURVEY_GIZMO_API_KEY"""'], {}), "('SURVEY_GIZMO_API_KEY')\n", (610, 634), True, 'from flask import current... |
# Copyright 2020 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this
# software and associated documentation files (the "Software"), to deal in the Software
# without restriction, including without limitation the rights to use, copy, modify, merge,
# publish, distribute, subl... | [
"collections.deque",
"matplotlib.pyplot.plot",
"numpy.append",
"numpy.array",
"numpy.empty",
"matplotlib.pyplot.scatter"
] | [((1736, 1743), 'collections.deque', 'deque', ([], {}), '()\n', (1741, 1743), False, 'from collections import deque\n'), ((2555, 2581), 'numpy.empty', 'np.empty', (['(total_nodes, 2)'], {}), '((total_nodes, 2))\n', (2563, 2581), True, 'import numpy as np\n'), ((2594, 2610), 'numpy.empty', 'np.empty', (['(0, 2)'], {}), ... |
# Copyright (c) OpenMMLab. All rights reserved.
from collections import defaultdict
from contextlib import contextmanager
from functools import partial
import numpy as np
from mmcv import Timer
class RunningAverage():
r"""A helper class to calculate running average in a sliding window.
Args:
window ... | [
"functools.partial",
"numpy.mean",
"collections.defaultdict",
"mmcv.Timer"
] | [((706, 725), 'numpy.mean', 'np.mean', (['self._data'], {}), '(self._data)\n', (713, 725), True, 'import numpy as np\n'), ((3683, 3700), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (3694, 3700), False, 'from collections import defaultdict\n'), ((1609, 1652), 'functools.partial', 'partial', (['... |
# -*- encoding: utf-8 -*-
# @Author: <NAME>
# @Time: 2021/08/21 04:37:56
# @File: saligned.py
import math
import torch
import numpy as np
from torch import nn
from mwptoolkit.module.Embedder.basic_embedder import BaiscEmbedder
from mwptoolkit.module.Encoder.rnn_encoder import SalignedEncoder
from mwptoolkit.module.D... | [
"torch.nn.functional.softmax",
"mwptoolkit.module.Decoder.rnn_decoder.SalignedDecoder",
"mwptoolkit.module.Environment.stack_machine.OPERATIONS",
"mwptoolkit.module.Embedder.basic_embedder.BaiscEmbedder",
"torch.nn.CrossEntropyLoss",
"torch.LongTensor",
"torch.stack",
"torch.argmax",
"mwptoolkit.mod... | [((808, 842), 'mwptoolkit.module.Environment.stack_machine.OPERATIONS', 'OPERATIONS', (['dataset.out_symbol2idx'], {}), '(dataset.out_symbol2idx)\n', (818, 842), False, 'from mwptoolkit.module.Environment.stack_machine import OPERATIONS, StackMachine\n'), ((3000, 3050), 'mwptoolkit.module.Embedder.basic_embedder.BaiscE... |
from django.utils.translation import ugettext_lazy as _
from google.appengine.ext import db
from ragendja.auth.google_models import GoogleUserTraits
class User(GoogleUserTraits):
"""User class that provides support for Django and Google Accounts."""
user = db.UserProperty()
username = db.StringProperty(req... | [
"django.utils.translation.ugettext_lazy",
"google.appengine.ext.db.UserProperty"
] | [((266, 283), 'google.appengine.ext.db.UserProperty', 'db.UserProperty', ([], {}), '()\n', (281, 283), False, 'from google.appengine.ext import db\n'), ((591, 600), 'django.utils.translation.ugettext_lazy', '_', (['"""user"""'], {}), "('user')\n", (592, 600), True, 'from django.utils.translation import ugettext_lazy as... |
from __future__ import unicode_literals
from django.db import models
class Person(models.Model):
name = models.CharField(max_length=20)
age = models.CharField(max_length=2)
| [
"django.db.models.CharField"
] | [((110, 141), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(20)'}), '(max_length=20)\n', (126, 141), False, 'from django.db import models\n'), ((153, 183), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(2)'}), '(max_length=2)\n', (169, 183), False, 'from django.db impo... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import json
import warnings
import pulumi
import pulumi.runtime
from . import utilities, tables
class GetCallerIdentityResult:
"""... | [
"pulumi.runtime.invoke"
] | [((1669, 1764), 'pulumi.runtime.invoke', 'pulumi.runtime.invoke', (['"""aws:index/getCallerIdentity:getCallerIdentity"""', '__args__'], {'opts': 'opts'}), "('aws:index/getCallerIdentity:getCallerIdentity',\n __args__, opts=opts)\n", (1690, 1764), False, 'import pulumi\n')] |
from __future__ import print_function
from numpy import *
from scipy.integrate import fixed_quad
from scipy.special import gammaln, betaln, digamma, polygamma
from scipy.optimize import fmin
import sys
def lnchoose(n, m):
nf = gammaln(n + 1)
mf = gammaln(m + 1)
nmmnf = gammaln(n - m + 1)
return nf - (m... | [
"scipy.special.polygamma",
"scipy.special.digamma",
"scipy.special.gammaln"
] | [((232, 246), 'scipy.special.gammaln', 'gammaln', (['(n + 1)'], {}), '(n + 1)\n', (239, 246), False, 'from scipy.special import gammaln, betaln, digamma, polygamma\n'), ((256, 270), 'scipy.special.gammaln', 'gammaln', (['(m + 1)'], {}), '(m + 1)\n', (263, 270), False, 'from scipy.special import gammaln, betaln, digamma... |
# Generated by Django 2.0.5 on 2018-09-03 09:59
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0004_auto_20180828_2007'),
]
operations = [
migrations.AddField(
model_name='blogentry',
name='is_active',
... | [
"django.db.models.BooleanField"
] | [((337, 396), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'default': '(True)', 'verbose_name': '"""Is active"""'}), "(default=True, verbose_name='Is active')\n", (356, 396), False, 'from django.db import migrations, models\n')] |