code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 19 13:33:32 2017
@author: saintlyvi
"""
import pandas as pd
import numpy as np
import os
from math import ceil
import colorlover as cl
import plotly.offline as offline
import plotly.graph_objs as go
import plotly as py
offline.init_notebook_mo... | [
"os.listdir",
"math.ceil",
"plotly.offline.iplot",
"plotly.offline.plot",
"plotly.offline.init_notebook_mode",
"os.path.join",
"colorlover.flipper",
"plotly.graph_objs.Bar",
"pandas.DataFrame",
"numpy.arange"
] | [((296, 338), 'plotly.offline.init_notebook_mode', 'offline.init_notebook_mode', ([], {'connected': '(True)'}), '(connected=True)\n', (322, 338), True, 'import plotly.offline as offline\n'), ((9800, 9840), 'plotly.offline.iplot', 'offline.iplot', (['fig'], {'filename': '"""testagain"""'}), "(fig, filename='testagain')\... |
import math
cat1=float(input("comprimento do cateto oposto: "))
cat2=float(input("comprimento do cateteo adjacente:"))
hip= math.pow(cat1,2)+math.pow(cat2,2)
print("hipotenusa: {:.2f}".format(math.sqrt(hip))) | [
"math.pow",
"math.sqrt"
] | [((125, 142), 'math.pow', 'math.pow', (['cat1', '(2)'], {}), '(cat1, 2)\n', (133, 142), False, 'import math\n'), ((142, 159), 'math.pow', 'math.pow', (['cat2', '(2)'], {}), '(cat2, 2)\n', (150, 159), False, 'import math\n'), ((194, 208), 'math.sqrt', 'math.sqrt', (['hip'], {}), '(hip)\n', (203, 208), False, 'import mat... |
import unittest
import sys
if __name__ == "__main__":
suite = unittest.TestLoader().discover("test")
result = unittest.TextTestRunner(verbosity=2).run(suite)
sys.exit(not result.wasSuccessful())
| [
"unittest.TextTestRunner",
"unittest.TestLoader"
] | [((71, 92), 'unittest.TestLoader', 'unittest.TestLoader', ([], {}), '()\n', (90, 92), False, 'import unittest\n'), ((124, 160), 'unittest.TextTestRunner', 'unittest.TextTestRunner', ([], {'verbosity': '(2)'}), '(verbosity=2)\n', (147, 160), False, 'import unittest\n')] |
import os
import vlc
import time
from view import View
from helper import load_json, save_json
from web_scraper import WebScraper
class LiveStream:
def __init__(self, database=None):
self.view = View()
self.state = 0 # 0: Radio off, 1: Radio on
# Set defaults
self.settings = {... | [
"view.View",
"helper.save_json",
"helper.load_json",
"os.path.realpath",
"vlc.Instance",
"os.path.sep.join",
"web_scraper.WebScraper"
] | [((212, 218), 'view.View', 'View', ([], {}), '()\n', (216, 218), False, 'from view import View\n'), ((715, 738), 'vlc.Instance', 'vlc.Instance', (['"""--quiet"""'], {}), "('--quiet')\n", (727, 738), False, 'import vlc\n'), ((1256, 1290), 'helper.load_json', 'load_json', (['self.database_loc', 'self'], {}), '(self.datab... |
from flask_marshmallow import Schema
from marshmallow import ValidationError
from .models import EnumUploadFileType
from .models import FileField
from app.models.enum_field import EnumField
def file_validate(file):
if file.mimetype not in ['image/jpeg', 'image/png']:
raise ValidationError('File format no... | [
"app.models.enum_field.EnumField",
"marshmallow.ValidationError"
] | [((393, 522), 'app.models.enum_field.EnumField', 'EnumField', (['EnumUploadFileType'], {'by_value': '(True)', 'required': '(True)', 'description': '"""upload type(invoice/id/evidence)"""', 'location': '"""form"""'}), "(EnumUploadFileType, by_value=True, required=True, description=\n 'upload type(invoice/id/evidence)... |
import argparse
from gen_tsne.gen_tsne import calculate
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Apply Gen t-SNE metric.')
parser.add_argument('-b', '--baseline', help='Path to images from the dataset (baseline)', required=True)
parser.add_argument('-p', '--paths', action='... | [
"argparse.ArgumentParser",
"gen_tsne.gen_tsne.calculate"
] | [((98, 160), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Apply Gen t-SNE metric."""'}), "(description='Apply Gen t-SNE metric.')\n", (121, 160), False, 'import argparse\n'), ((1013, 1185), 'gen_tsne.gen_tsne.calculate', 'calculate', (['([args.baseline] + args.paths)', 'args.output'], ... |
# Original file: se.py:
#
# Copyright (c) 2012-2013 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware imple... | [
"ruby.Ruby.create_system",
"m5.simulate",
"common.CacheConfig.config_cache",
"common.CpuConfig.config_etrace",
"m5.curTick",
"m5.util.fatal",
"optparse.OptionParser",
"common.Options.addSEOptions",
"m5.util.addToPath",
"common.Simulation.setMemClass",
"m5.disableAllListeners",
"sys.exit",
"c... | [((2464, 2480), 'm5.util.addToPath', 'addToPath', (['"""../"""'], {}), "('../')\n", (2473, 2480), False, 'from m5.util import addToPath, fatal, warn\n'), ((2989, 3012), 'optparse.OptionParser', 'optparse.OptionParser', ([], {}), '()\n', (3010, 3012), False, 'import optparse\n'), ((3013, 3045), 'common.Options.addCommon... |
#!/usr/bin/env python3
from collections import OrderedDict
from cimodel.data.pytorch_build_data import TopLevelNode, CONFIG_TREE_DATA
import cimodel.data.dimensions as dimensions
import cimodel.lib.conf_tree as conf_tree
import cimodel.lib.miniutils as miniutils
import cimodel.lib.visualization as visualization
from... | [
"cimodel.lib.miniutils.quote",
"collections.OrderedDict",
"cimodel.data.pytorch_build_data.TopLevelNode",
"cimodel.lib.conf_tree.dfs",
"dataclasses.field"
] | [((995, 1022), 'dataclasses.field', 'field', ([], {'default_factory': 'list'}), '(default_factory=list)\n', (1000, 1022), False, 'from dataclasses import dataclass, field\n'), ((6055, 6103), 'cimodel.data.pytorch_build_data.TopLevelNode', 'TopLevelNode', (['"""PyTorch Builds"""', 'CONFIG_TREE_DATA'], {}), "('PyTorch Bu... |
# Copyright (c) 2017 by <NAME>
"""
Python PyPy 3.2 decompiler scanner.
Does some additional massaging of xdis-disassembled instructions to
make things easier for decompilation.
"""
import uncompyle6.scanners.scanner32 as scan
# bytecode verification, verify(), uses JUMP_OPs from here
from xdis.opcodes import opcode... | [
"uncompyle6.scanners.scanner32.Scanner32.__init__"
] | [((553, 606), 'uncompyle6.scanners.scanner32.Scanner32.__init__', 'scan.Scanner32.__init__', (['self', 'show_asm'], {'is_pypy': '(True)'}), '(self, show_asm, is_pypy=True)\n', (576, 606), True, 'import uncompyle6.scanners.scanner32 as scan\n')] |
"""
Utility classes for easy conversions.
"""
from dataclasses import dataclass
# The use of dataclasses here
# ---------------------------
# The dataclasses module provides a decorator and
# functions for automatically generating special methods
# such as __repr__() for user-defined classes
# [docs](https://docs.pyt... | [
"dataclasses.dataclass"
] | [((414, 425), 'dataclasses.dataclass', 'dataclass', ([], {}), '()\n', (423, 425), False, 'from dataclasses import dataclass\n'), ((619, 630), 'dataclasses.dataclass', 'dataclass', ([], {}), '()\n', (628, 630), False, 'from dataclasses import dataclass\n'), ((827, 838), 'dataclasses.dataclass', 'dataclass', ([], {}), '(... |
import azure.cognitiveservices.speech as speechsdk
class SpeechTranslator:
def __init__(self, subscription_key: str, region: str):
self.config = speechsdk.translation.SpeechTranslationConfig(
subscription=subscription_key,
region=region,
)
def translate_audio(self, fil... | [
"azure.cognitiveservices.speech.AudioConfig",
"azure.cognitiveservices.speech.translation.TranslationRecognizer",
"azure.cognitiveservices.speech.translation.SpeechTranslationConfig"
] | [((159, 254), 'azure.cognitiveservices.speech.translation.SpeechTranslationConfig', 'speechsdk.translation.SpeechTranslationConfig', ([], {'subscription': 'subscription_key', 'region': 'region'}), '(subscription=subscription_key,\n region=region)\n', (204, 254), True, 'import azure.cognitiveservices.speech as speech... |
"""
This code conduct:
1. exclude a subset of data related to a certain illumination condition from an existing training set
2. keep a subset of data related to the same illumination condition from an existing test set
ATTENTION: this code require to run prepare_data_split.py first
Author: <NAME> (<EMAIL>)
Date: Marc... | [
"os.path.exists",
"os.makedirs"
] | [((764, 790), 'os.path.exists', 'ops.exists', (['json_file_path'], {}), '(json_file_path)\n', (774, 790), True, 'import os.path as ops\n'), ((1649, 1675), 'os.path.exists', 'ops.exists', (['json_file_path'], {}), '(json_file_path)\n', (1659, 1675), True, 'import os.path as ops\n'), ((611, 636), 'os.path.exists', 'ops.e... |
from baseapp_for_restapi_backend_with_swagger import FlaskRestSubclass
from TestHelperSuperClass import testHelperAPIClient, env
from baseapp_for_restapi_backend_with_swagger.AppObj import AppObjBaseClass
from flask_restx import fields
from flask import Flask, Blueprint, request
nonstandardEnv = {
'APIAPP_MODE': '... | [
"flask.Blueprint",
"baseapp_for_restapi_backend_with_swagger.FlaskRestSubclass",
"flask.Flask"
] | [((925, 940), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (930, 940), False, 'from flask import Flask, Blueprint, request\n'), ((1203, 1229), 'flask.Blueprint', 'Blueprint', (['"""api"""', '__name__'], {}), "('api', __name__)\n", (1212, 1229), False, 'from flask import Flask, Blueprint, request\n'), ((1... |
#!/usr/bin/python3
"""
tango colors
"""
import matplotlib.pyplot as plt
import numpy as np
import pdb
def colormap(rgb: bool=False):
"""
Create an array of visually distinctive RGB values.
Args:
- rgb: boolean, whether to return in RGB or BGR order. BGR corresponds to OpenCV default.
Retur... | [
"matplotlib.pyplot.imshow",
"numpy.tile",
"numpy.array",
"pdb.set_trace",
"numpy.arange",
"matplotlib.pyplot.show"
] | [((1532, 1547), 'pdb.set_trace', 'pdb.set_trace', ([], {}), '()\n', (1545, 1547), False, 'import pdb\n'), ((1567, 1588), 'numpy.arange', 'np.arange', (['num_colors'], {}), '(num_colors)\n', (1576, 1588), True, 'import numpy as np\n'), ((1608, 1638), 'numpy.tile', 'np.tile', (['semantic_img', '(10, 1)'], {}), '(semantic... |
from kafka import KafkaProducer
producer = KafkaProducer(bootstrap_servers="127.0.0.1:9092")
for _ in range(10000):
producer.send("my_topic", b"message")
# producer.flush()
| [
"kafka.KafkaProducer"
] | [((44, 93), 'kafka.KafkaProducer', 'KafkaProducer', ([], {'bootstrap_servers': '"""127.0.0.1:9092"""'}), "(bootstrap_servers='127.0.0.1:9092')\n", (57, 93), False, 'from kafka import KafkaProducer\n')] |
# Copyright 2020 Pax Syriana Foundation. Licensed under the Apache License, Version 2.0
#
#
import datetime as dt
import os
import traceback
from flask import Blueprint
from flask import current_app
from flask import flash
from flask_babel import lazy_gettext as _l
from flask_login import current_user
from flask_lo... | [
"via_cms.util.helper.role_required",
"via_cms.view.private.form.create_form_notice.CreateFormNotice",
"via_common.multiprocess.logger_manager.LoggerManager.get_logger",
"via_cms.model.static.geoloc_dao.Geoloc.query.get",
"werkzeug.utils.secure_filename",
"via_cms.model.feed.feed_dao.Feed.query.filter_by",... | [((1522, 1636), 'flask.Blueprint', 'Blueprint', (['"""private.edition.editor_news"""', '__name__'], {'url_prefix': '"""/private/edition/"""', 'static_folder': '"""../static"""'}), "('private.edition.editor_news', __name__, url_prefix=\n '/private/edition/', static_folder='../static')\n", (1531, 1636), False, 'from f... |
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
from fairseq.models.lstm import LSTMModel
import jieba
import pickle as pkl
checkpoint_path = "/local/ssd_1/stc/stc_clm/"
stc = LSTMModel.from_pretrained(checkpoint_path, checkpoint_file='checkpoint_best.pt',
data_name_or_path=checkpoin... | [
"fairseq.models.lstm.LSTMModel.from_pretrained",
"pickle.dump"
] | [((180, 325), 'fairseq.models.lstm.LSTMModel.from_pretrained', 'LSTMModel.from_pretrained', (['checkpoint_path'], {'checkpoint_file': '"""checkpoint_best.pt"""', 'data_name_or_path': "(checkpoint_path + 'stc_ori')", 'beam': '(5)'}), "(checkpoint_path, checkpoint_file=\n 'checkpoint_best.pt', data_name_or_path=checkp... |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Test example app."""
import os
import signal
import subprocess
import time
from c... | [
"subprocess.check_output",
"subprocess.Popen",
"os.path.join",
"time.sleep",
"os.getcwd",
"os.chdir",
"pytest.mark.parametrize",
"subprocess.call",
"os.killpg",
"os.path.abspath"
] | [((1385, 1458), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""service"""', "['orcid', 'github', 'cern', 'globus']"], {}), "('service', ['orcid', 'github', 'cern', 'globus'])\n", (1408, 1458), False, 'import pytest\n'), ((1764, 1837), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""service"""',... |
# -*- coding: utf-8 -*-
from pyfr.backends.base import NullKernel
from pyfr.backends.hip.provider import (HIPKernel, HIPKernelProvider,
get_grid_for_block)
class HIPPackingKernels(HIPKernelProvider):
def pack(self, mv):
hip = self.backend.hip
# An exchange... | [
"pyfr.backends.base.NullKernel",
"pyfr.backends.hip.provider.get_grid_for_block"
] | [((503, 533), 'pyfr.backends.hip.provider.get_grid_for_block', 'get_grid_for_block', (['block', 'v.n'], {}), '(block, v.n)\n', (521, 533), False, 'from pyfr.backends.hip.provider import HIPKernel, HIPKernelProvider, get_grid_for_block\n'), ((1798, 1810), 'pyfr.backends.base.NullKernel', 'NullKernel', ([], {}), '()\n', ... |
from django.db import models
from core.models import NanoIdModel, TimeStampModel
from .managers import PublishedManager
class Tag(NanoIdModel):
name = models.CharField(max_length=100)
def __str__(self):
return self.name
class Link(NanoIdModel, TimeStampModel):
title = models.CharField(max_leng... | [
"django.db.models.ManyToManyField",
"django.db.models.CharField",
"django.db.models.BooleanField"
] | [((158, 190), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)'}), '(max_length=100)\n', (174, 190), False, 'from django.db import models\n'), ((295, 327), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(200)'}), '(max_length=200)\n', (311, 327), False, 'from django.d... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
DEPRICATED:
code is now in abstract_model under fitting
constructs the Theano optimization and trains a learning model,
optionally by initializing the network with pre-trained weights.
http://cs231n.github.io/neural-networks-3/#distr
Pretrained Models:
https:... | [
"logging.getLogger",
"utool.inject2",
"random.uniform",
"wbia_cnn.batch_processing.process_batch",
"six.moves.zip"
] | [((472, 492), 'utool.inject2', 'ut.inject2', (['__name__'], {}), '(__name__)\n', (482, 492), True, 'import utool as ut\n'), ((502, 521), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (519, 521), False, 'import logging\n'), ((702, 811), 'wbia_cnn.batch_processing.process_batch', 'batch.process_batch', (['m... |
#!/usr/bin/env python3
import os
import sys
from urllib.parse import quote_plus
from cryptojwt.key_jar import init_key_jar
from fedservice.configure import DEFAULT_FED_FILE_ATTRIBUTE_NAMES
from oidcmsg.configure import Configuration
from oidcmsg.configure import create_from_config_file
from fedservice.configure impor... | [
"cryptojwt.key_jar.init_key_jar",
"os.makedirs",
"os.path.join",
"os.path.split",
"os.path.realpath",
"os.path.isdir",
"urllib.parse.quote_plus"
] | [((477, 503), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (493, 503), False, 'import os\n'), ((866, 889), 'os.path.split', 'os.path.split', (['dir_path'], {}), '(dir_path)\n', (879, 889), False, 'import os\n'), ((906, 941), 'os.path.join', 'os.path.join', (['head', 'entity_type', 'id'], ... |
from handy import read
import numpy as np
from numpy.lib.stride_tricks import sliding_window_view
from itertools import combinations
lines = [int(x) for x in read(9)]
def validate(n, last):
last = set((x for x in last if x <= n))
for combo in combinations(last, 2):
if sum(combo) == n:
retu... | [
"itertools.combinations",
"handy.read",
"numpy.lib.stride_tricks.sliding_window_view",
"numpy.where"
] | [((253, 274), 'itertools.combinations', 'combinations', (['last', '(2)'], {}), '(last, 2)\n', (265, 274), False, 'from itertools import combinations\n'), ((159, 166), 'handy.read', 'read', (['(9)'], {}), '(9)\n', (163, 166), False, 'from handy import read\n'), ((558, 611), 'numpy.lib.stride_tricks.sliding_window_view',... |
# -*- coding: utf-8 -*-
# Reference site
# https://qiita.com/komiya-m/items/c37c9bc308d5294d3260
import os
import sys
import shutil
import random
def image_dir_train_val_split(original_dir, base_dir, train_size=0.8):
'''
Image data split to train data and validation data
parameter
------------
o... | [
"os.listdir",
"random.shuffle",
"os.path.join",
"shutil.copyfile",
"os.mkdir"
] | [((637, 661), 'os.listdir', 'os.listdir', (['original_dir'], {}), '(original_dir)\n', (647, 661), False, 'import os\n'), ((484, 502), 'os.mkdir', 'os.mkdir', (['base_dir'], {}), '(base_dir)\n', (492, 502), False, 'import os\n'), ((774, 803), 'os.path.join', 'os.path.join', (['original_dir', 'p'], {}), '(original_dir, p... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | [
"django.utils.translation.ugettext_lazy",
"os.environ.get",
"django.conf.urls.patterns"
] | [((1588, 1627), 'os.environ.get', 'os.environ.get', (['"""BK_ENV"""', '"""development"""'], {}), "('BK_ENV', 'development')\n", (1602, 1627), False, 'import os\n'), ((1687, 1719), 'os.environ.get', 'os.environ.get', (['"""APP_ID"""', 'APP_ID'], {}), "('APP_ID', APP_ID)\n", (1701, 1719), False, 'import os\n'), ((1732, 1... |
import matplotlib.pyplot as plt
import time
from datetime import datetime
plt.style.use('ggplot')
def get_datetime(str_, format="%d.%m.%Y"):
result = datetime.strptime(str_, format)
return result
def plot_data(data, limit=3000, name="output"):
classic_dashes = {
"lines.markersize": 3
}
wit... | [
"matplotlib.pyplot.rc_context",
"matplotlib.pyplot.savefig",
"datetime.datetime.strptime",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.style.use",
"datetime.datetime.now"
] | [((74, 97), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""ggplot"""'], {}), "('ggplot')\n", (87, 97), True, 'import matplotlib.pyplot as plt\n'), ((155, 186), 'datetime.datetime.strptime', 'datetime.strptime', (['str_', 'format'], {}), '(str_, format)\n', (172, 186), False, 'from datetime import datetime\n'), (... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import codecs
from setuptools import setup, find_packages
import os
setup(name='batchprocessing',
version='0.1.0',
description=u"Micasense Image Processing",
author=u"<NAME>.",
author_email='<EMAIL>',
url='https://github.com/micasense/imageprocessing/... | [
"setuptools.find_packages"
] | [((382, 397), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (395, 397), False, 'from setuptools import setup, find_packages\n')] |
import random
notes = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
# Notes are: C, C#/D♭, D, D#/E♭, E, F, F#/G♭, G, G#/A♭, A, A#/B♭, B
def randomSong(size):
song = []
for i in range(size):
index = random.randint(0, len(notes) - 1)
song.append(notes[index])
return song
def generateMany(numberOfSongs, min, max):
son... | [
"random.randint"
] | [((369, 393), 'random.randint', 'random.randint', (['min', 'max'], {}), '(min, max)\n', (383, 393), False, 'import random\n')] |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import
from timeit import default_timer as timer
#from matplotlib.pylab import imshow, jet, show, ion
import numpy as np
from numba import jit, int32, float64, njit, prange
import cv2
from numba import jit
# colo... | [
"cv2.imencode",
"timeit.default_timer",
"numba.njit",
"numpy.zeros",
"numba.prange"
] | [((1053, 1072), 'numba.njit', 'njit', ([], {'parallel': '(True)'}), '(parallel=True)\n', (1057, 1072), False, 'from numba import jit, int32, float64, njit, prange\n'), ((1753, 1794), 'numpy.zeros', 'np.zeros', (['(2048, 4096, 3)'], {'dtype': 'np.uint8'}), '((2048, 4096, 3), dtype=np.uint8)\n', (1761, 1794), True, 'impo... |
#
# Copyright 2022 Autodesk
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | [
"maya.cmds.columnLayout",
"maya.cmds.uiTemplate",
"maya.cmds.setParent",
"maya.cmds.setUITemplate",
"maya.cmds.frameLayout"
] | [((2020, 2076), 'maya.cmds.setUITemplate', 'cmds.setUITemplate', (['"""optionsTemplate"""'], {'pushTemplate': '(True)'}), "('optionsTemplate', pushTemplate=True)\n", (2038, 2076), True, 'import maya.cmds as cmds\n'), ((1160, 1182), 'maya.cmds.setParent', 'cmds.setParent', (['parent'], {}), '(parent)\n', (1174, 1182), T... |
import clusto
from clusto.schema import Attribute
from clusto.drivers.base import ResourceManager, ResourceTypeException, Driver
from clusto.exceptions import ResourceNotAvailableException, ResourceException
import IPy
class IPManager(ResourceManager):
"""Resource Manager for IP spaces
roughly follows t... | [
"clusto.drivers.base.ResourceTypeException",
"clusto.exceptions.ResourceNotAvailableException",
"clusto.drivers.base.Driver",
"IPy.IP",
"clusto.get_entities"
] | [((3194, 3248), 'clusto.exceptions.ResourceNotAvailableException', 'ResourceNotAvailableException', (['"""out of available ips."""'], {}), "('out of available ips.')\n", (3223, 3248), False, 'from clusto.exceptions import ResourceNotAvailableException, ResourceException\n'), ((3662, 3703), 'clusto.get_entities', 'clust... |
import json
import sys
from application import produce_multiple
from mental_lexicon import MentalLexicon
from words import *
if __name__ == "__main__":
lexicon = MentalLexicon()
hund = Subject("m", "hund", True)
nehmen = Action("nehmen", "genommen", True)
lexicon.add_item(hund)
lexicon.add_item(n... | [
"application.produce_multiple",
"json.dumps",
"mental_lexicon.MentalLexicon"
] | [((169, 184), 'mental_lexicon.MentalLexicon', 'MentalLexicon', ([], {}), '()\n', (182, 184), False, 'from mental_lexicon import MentalLexicon\n'), ((2273, 2305), 'application.produce_multiple', 'produce_multiple', (['input', 'lexicon'], {}), '(input, lexicon)\n', (2289, 2305), False, 'from application import produce_mu... |
from poethepoet.envfile import parse_env_file
import pytest
valid_examples = [
(
"""
# empty
""",
{},
),
(
"""
# single word values
WORD=something
WORD_WITH_HASH=some#thing
NUMBER=0
EMOJI=😃😃
DOUBLE_QUOTED_WORD="something"
... | [
"pytest.mark.parametrize",
"pytest.raises",
"poethepoet.envfile.parse_env_file"
] | [((2661, 2711), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""example"""', 'valid_examples'], {}), "('example', valid_examples)\n", (2684, 2711), False, 'import pytest\n'), ((2808, 2860), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""example"""', 'invalid_examples'], {}), "('example', invali... |
from hashlib import md5
from interactions.ext import Base, Version, VersionAuthor
class VersionAuthor(VersionAuthor):
def __init__(
self,
name,
*,
shared=False,
active=True,
email=None,
) -> None:
"""
:param name: The name of the author.
... | [
"interactions.ext.VersionAuthor",
"interactions.ext.Base"
] | [((1127, 1397), 'interactions.ext.Base', 'Base', ([], {'name': '"""interactions-repl"""', 'version': 'version', 'link': '"""https://github.com/Catalyst4222/interactions-repl"""', 'description': '"""A repl implementation for discord-py-interactions"""', 'packages': "['interactions.ext.repl']", 'requirements': "['discord... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 12 15:40:08 2020
plot composite plots sea level & barotropic currents for ROMS sensitivity experiments with uniform wind speed change and closed english channel,
and difference in responses w.r.t. same experiments with an open english channel
@auth... | [
"os.listdir",
"matplotlib.ticker.FixedLocator",
"cartopy.crs.Orthographic",
"os.path.join",
"cartopy.crs.PlateCarree",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"numpy.empty",
"xarray.open_dataset",
"numpy.mod"
] | [((511, 527), 'matplotlib.pyplot.close', 'plt.close', (['"""all"""'], {}), "('all')\n", (520, 527), True, 'import matplotlib.pyplot as plt\n'), ((699, 727), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(6, 7.5)'}), '(figsize=(6, 7.5))\n', (709, 727), True, 'import matplotlib.pyplot as plt\n'), ((1455, 15... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('premises', '0006_contention_is_published'),
]
operations = [
migrations.AddField(
model_name='premise',
... | [
"django.db.models.CharField",
"django.db.models.TextField",
"django.db.models.IntegerField"
] | [((364, 394), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'default': '(1)'}), '(default=1)\n', (383, 394), False, 'from django.db import models, migrations\n'), ((560, 628), 'django.db.models.TextField', 'models.TextField', ([], {'null': '(True)', 'verbose_name': "b'Ek bilgiler'", 'blank': '(True)'}),... |
#! /usr/bin/env python3
import rospy
from competition2.srv import PathPlanning, PathPlanningRequest
import sys
class PathPlanningClient():
def __init__(self, location):
self.hitService = rospy.ServiceProxy('/path_palnning_server', PathPlanning)
self.location = location
def send_request(self)... | [
"rospy.init_node",
"rospy.ServiceProxy",
"competition2.srv.PathPlanningRequest",
"rospy.wait_for_service"
] | [((483, 522), 'rospy.init_node', 'rospy.init_node', (['"""path_palnning_client"""'], {}), "('path_palnning_client')\n", (498, 522), False, 'import rospy\n'), ((527, 574), 'rospy.wait_for_service', 'rospy.wait_for_service', (['"""/path_palnning_server"""'], {}), "('/path_palnning_server')\n", (549, 574), False, 'import ... |
import logging
from typing import List
from fastapi import APIRouter, Depends, HTTPException
from pydantic import BaseModel
from sqlalchemy.ext.asyncio import AsyncSession
from starlette import status
from api.api_client_utils import get_api_client
from api.db.errors import DoesNotExist
from api.db.models.issue_crede... | [
"logging.getLogger",
"api.endpoints.dependencies.tenant_security.get_from_context",
"api.db.repositories.issue_credentials.IssueCredentialsRepository",
"api.services.connections.get_connection_with_alias",
"api.services.base.BaseWorkflow.next_workflow_step",
"fastapi.HTTPException",
"api.db.repositories... | [((1845, 1856), 'fastapi.APIRouter', 'APIRouter', ([], {}), '()\n', (1854, 1856), False, 'from fastapi import APIRouter, Depends, HTTPException\n'), ((1866, 1893), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1883, 1893), False, 'import logging\n'), ((2614, 2629), 'fastapi.Depends', 'D... |
import os
import torch
import torch.nn as nn
import torch.distributed as dist
from torch.nn.parallel import DistributedDataParallel
import torch.multiprocessing as mp
def save_distributed_model(path, distributed_model, ext='.checkpoint'):
path += ext
torch.save(distributed_model.state_dict(), path)
class Simp... | [
"torch.nn.ReLU",
"torch.distributed.destroy_process_group",
"torch.multiprocessing.spawn",
"torch.cuda.device_count",
"torch.nn.Linear",
"torch.distributed.init_process_group",
"torch.randn",
"torch.nn.parallel.DistributedDataParallel"
] | [((744, 809), 'torch.distributed.init_process_group', 'dist.init_process_group', (['"""gloo"""'], {'rank': 'rank', 'world_size': 'world_size'}), "('gloo', rank=rank, world_size=world_size)\n", (767, 809), True, 'import torch.distributed as dist\n'), ((830, 858), 'torch.distributed.destroy_process_group', 'dist.destroy_... |
# This Python file uses the following encoding: utf-8
"""autogenerated by genpy from sensor/Led.msg. Do not edit."""
import codecs
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
import sensor.msg
class Led(genpy.Message):
_md5sum = "30e1b14f90ea917fa794eb562e3a6723"
... | [
"codecs.lookup_error",
"struct.Struct",
"genpy.DeserializationError"
] | [((4132, 4152), 'struct.Struct', 'struct.Struct', (['"""<4B"""'], {}), "('<4B')\n", (4145, 4152), False, 'import struct\n'), ((2296, 2325), 'codecs.lookup_error', 'codecs.lookup_error', (['"""rosmsg"""'], {}), "('rosmsg')\n", (2315, 2325), False, 'import codecs\n'), ((3532, 3561), 'codecs.lookup_error', 'codecs.lookup_... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.21 on 2019-06-18 12:25
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):
initial = True
dependencies = [
migrati... | [
"django.db.models.GenericIPAddressField",
"django.db.models.TextField",
"django.db.models.IntegerField",
"django.db.models.ForeignKey",
"django.db.models.ManyToManyField",
"django.db.models.BooleanField",
"django.db.models.AutoField",
"django.db.models.DateTimeField",
"django.db.migrations.swappable... | [((313, 370), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (344, 370), False, 'from django.db import migrations, models\n'), ((6994, 7107), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'blank': '(True)', ... |
import matplotlib
matplotlib.use('tkagg')
import os
import subprocess
import sys
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
import logging
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
import tensorflow as tf
from ampligraph.common.aux import rel_rank_stat, load_data, eige... | [
"logging.getLogger",
"numpy.hstack",
"tensorflow.logging.set_verbosity",
"numpy.array",
"sys.exit",
"sacred.observers.MongoObserver.create",
"pymongo.MongoClient",
"argparse.ArgumentParser",
"ampligraph.evaluation.hits_at_n_score",
"networkx.spring_layout",
"numpy.concatenate",
"ampligraph.eva... | [((18, 41), 'matplotlib.use', 'matplotlib.use', (['"""tkagg"""'], {}), "('tkagg')\n", (32, 41), False, 'import matplotlib\n'), ((172, 199), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (189, 199), False, 'import logging\n'), ((725, 767), 'tensorflow.logging.set_verbosity', 'tf.logging.s... |
import cv2
import os
from os.path import join, exists
from tqdm import tqdm
import numpy as np
hc = []
def convert(gesture_folder, target_folder):
rootPath = os.getcwd()
majorData = os.path.abspath(target_folder)
print(majorData)
if not exists(majorData):
os.makedirs(majorData)
gesture_... | [
"os.path.exists",
"cv2.imwrite",
"os.makedirs",
"tqdm.tqdm",
"os.path.join",
"os.path.splitext",
"os.getcwd",
"os.chdir",
"os.path.isfile",
"cv2.destroyAllWindows",
"cv2.VideoCapture",
"os.path.abspath"
] | [((165, 176), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (174, 176), False, 'import os\n'), ((193, 223), 'os.path.abspath', 'os.path.abspath', (['target_folder'], {}), '(target_folder)\n', (208, 223), False, 'import os\n'), ((329, 360), 'os.path.abspath', 'os.path.abspath', (['gesture_folder'], {}), '(gesture_folder)\... |
import unittest
import logging
from bsn_sdk_py.until.bsn_logger import log_info
class TestLogger(unittest.TestCase):
def setUp(self):
FORMAT = "%(asctime)s %(thread)d %(message)s"
logging.basicConfig(level=logging.INFO, format=FORMAT, datefmt="[%Y-%m-%d %H:%M:%S]")
def test_log_info(self):
... | [
"unittest.main",
"logging.basicConfig",
"bsn_sdk_py.until.bsn_logger.log_info"
] | [((383, 398), 'unittest.main', 'unittest.main', ([], {}), '()\n', (396, 398), False, 'import unittest\n'), ((203, 293), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO', 'format': 'FORMAT', 'datefmt': '"""[%Y-%m-%d %H:%M:%S]"""'}), "(level=logging.INFO, format=FORMAT, datefmt=\n '[%Y-%m-%d... |
#!/usr/bin/env python3
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | [
"argparse.ArgumentParser",
"common.chronicle_auth.add_argument_credentials_file",
"common.chronicle_auth.initialize_http_session",
"sys.exit",
"common.regions.add_argument_region",
"common.regions.url"
] | [((1219, 1244), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1242, 1244), False, 'import argparse\n'), ((1247, 1299), 'common.chronicle_auth.add_argument_credentials_file', 'chronicle_auth.add_argument_credentials_file', (['parser'], {}), '(parser)\n', (1291, 1299), False, 'from common impor... |
import asyncio
import datetime
from io import BytesIO
import logging
import os
import re
import sys
import grpc
from . import service_pb2
from . import service_pb2_grpc
from .grpc_asyncio import AsyncioExecutor
from ..nodes import NodeManager, NodeExpired, AnonymousNodeDisabled
from .. import nodes
fro... | [
"logging.getLogger",
"grpc.ssl_server_credentials",
"asyncio.WindowsSelectorEventLoopPolicy",
"asyncio.new_event_loop",
"io.BytesIO",
"grpc.unary_unary_rpc_method_handler",
"datetime.datetime.now",
"re.search"
] | [((584, 611), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (601, 611), False, 'import logging\n'), ((11905, 11969), 'grpc.ssl_server_credentials', 'grpc.ssl_server_credentials', (['((private_key, certificate_chain),)'], {}), '(((private_key, certificate_chain),))\n', (11932, 11969), Fal... |
#%% Preparación del punto 2 y 3:
import utils.problema_jarras as pj
estado0 = (pj.Jarra(12), pj.Jarra(8), pj.Jarra(3))
test_objetivo = pj.crear_test_objetivo(objetivo=1)
#%% Punto 2
from anchura import buscar_en_anchura
ruta = buscar_en_anchura(estado0, pj.gen_sucesores, test_objetivo)
#%% Punto 3
from profundidad ... | [
"anchura.buscar_en_anchura",
"profundidad.buscar_en_profundidad_limitada",
"utils.problema_jarras.crear_test_objetivo",
"utils.problema_jarras.Jarra",
"profundidad.buscar_en_profundidad_iterativa",
"a_estrella.buscar_con_a_estrella"
] | [((135, 169), 'utils.problema_jarras.crear_test_objetivo', 'pj.crear_test_objetivo', ([], {'objetivo': '(1)'}), '(objetivo=1)\n', (157, 169), True, 'import utils.problema_jarras as pj\n'), ((229, 288), 'anchura.buscar_en_anchura', 'buscar_en_anchura', (['estado0', 'pj.gen_sucesores', 'test_objetivo'], {}), '(estado0, p... |
# -*- coding: utf-8 -*-
"""This module provides the base classes for pyflamestk."""
__author__ = "<NAME>"
__copyright__ = "Copyright (C) 2016,2017"
__license__ = "Simplified BSD License"
__version__ = "1.0"
import copy, subprocess
import numpy as np
class Atom(object):
"""description of an atom"""
def __init_... | [
"numpy.cross",
"subprocess.Popen",
"numpy.array",
"numpy.zeros",
"copy.deepcopy",
"numpy.aray"
] | [((11638, 11660), 'numpy.zeros', 'np.zeros', ([], {'shape': '[3, 3]'}), '(shape=[3, 3])\n', (11646, 11660), True, 'import numpy as np\n'), ((12282, 12306), 'copy.deepcopy', 'copy.deepcopy', (['supercell'], {}), '(supercell)\n', (12295, 12306), False, 'import copy, subprocess\n'), ((12961, 13051), 'subprocess.Popen', 's... |
import time
from garage.misc import logger
from garage.misc import ext
from garage.misc.overrides import overrides
from garage.tf.algos import BatchPolopt
from garage.tf.optimizers.cg_optimizer import CGOptimizer
from garage.tf.misc import tensor_utils
from garage.core.serializable import Serializable
import tensorflow... | [
"garage.misc.logger.dump_tabular",
"tensorflow.gradients",
"garage.tf.misc.tensor_utils.new_tensor",
"numpy.array",
"garage.tf.optimizers.cg_optimizer.CGOptimizer",
"copy.deepcopy",
"numpy.linalg.norm",
"tensorflow.reduce_mean",
"garage.misc.logger.record_tabular",
"numpy.mean",
"tensorflow.Sess... | [((1545, 1572), 'numpy.random.uniform', 'np.random.uniform', (['(0.0)', '(1.0)'], {}), '(0.0, 1.0)\n', (1562, 1572), True, 'import numpy as np\n'), ((4591, 4610), 'numpy.linalg.norm', 'np.linalg.norm', (['res'], {}), '(res)\n', (4605, 4610), True, 'import numpy as np\n'), ((4829, 4848), 'numpy.linalg.norm', 'np.linalg.... |
import numpy as np
import csv
from sklearn import tree
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
from sklearn.svm import OneClassSVM
import matplotlib.pyplot as plt
import os
###### Read in the data
raw=[]
with open('../data/spambase.data') as cf:
re... | [
"matplotlib.pyplot.ylabel",
"numpy.array",
"os.path.exists",
"numpy.where",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"sklearn.tree.DecisionTreeClassifier",
"sklearn.svm.OneClassSVM",
"csv.reader",
"matplotlib.pyplot.savefig",
"sklearn.model_selection.train_test_split",
"sklearn.en... | [((555, 567), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (565, 567), True, 'import matplotlib.pyplot as plt\n'), ((569, 616), 'sklearn.tree.plot_tree', 'tree.plot_tree', (['ctree'], {'max_depth': '(3)', 'filled': '(True)'}), '(ctree, max_depth=3, filled=True)\n', (583, 616), False, 'from sklearn import... |
"""This is a somewhat delicate package. It contains all registered components
and preconfigured templates.
Hence, it imports all of the components. To avoid cycles, no component should
import this in module scope."""
import logging
import typing
from typing import Any, Dict, List, Optional, Text, Type
from rasa.nlu ... | [
"logging.getLogger",
"rasa.nlu.utils.class_from_module_path"
] | [((1927, 1954), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1944, 1954), False, 'import logging\n'), ((5186, 5230), 'rasa.nlu.utils.class_from_module_path', 'utils.class_from_module_path', (['component_name'], {}), '(component_name)\n', (5214, 5230), False, 'from rasa.nlu import utils... |
import pymysql
import pytz
import sys
from contextlib import contextmanager
from . import time_helper
def mysql_to_cw_log_event(row):
event_time = row[0]
cmd = row[1]
query = row[2]
# normalize data - seems to be inconsistent coming from MySQL
if hasattr(query, 'decode'):
# convert from b... | [
"pytz.utc.localize"
] | [((436, 465), 'pytz.utc.localize', 'pytz.utc.localize', (['event_time'], {}), '(event_time)\n', (453, 465), False, 'import pytz\n')] |
# -*- coding: utf-8 -*-
import sys
import os
from decimal import Decimal
import unittest
import magento
from mock import patch, MagicMock
import trytond.tests.test_tryton
from trytond.tests.test_tryton import POOL, USER, DB_NAME, CONTEXT
from test_base import TestBase, load_json
from trytond.transaction import Transa... | [
"decimal.Decimal",
"unittest.TextTestRunner",
"os.path.join",
"trytond.transaction.Transaction",
"trytond.tests.test_tryton.POOL.get",
"os.path.dirname",
"test_base.load_json",
"os.path.isdir",
"unittest.skip",
"mock.MagicMock",
"unittest.TestLoader"
] | [((463, 481), 'os.path.isdir', 'os.path.isdir', (['DIR'], {}), '(DIR)\n', (476, 481), False, 'import os\n'), ((660, 693), 'mock.MagicMock', 'MagicMock', ([], {'spec': 'magento.Inventory'}), '(spec=magento.Inventory)\n', (669, 693), False, 'from mock import patch, MagicMock\n'), ((1046, 1077), 'mock.MagicMock', 'MagicMo... |
# //div[@class="thumb"]//img/@src
import urllib.request
from lxml import etree
def create_request(page):
get_url = 'https://www.qiushibaike.com/8hr/page/'
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36',
... | [
"lxml.etree.HTML"
] | [((620, 639), 'lxml.etree.HTML', 'etree.HTML', (['content'], {}), '(content)\n', (630, 639), False, 'from lxml import etree\n')] |
# **********************************************************************
# Copyright (C) 2020 Johns Hopkins University Applied Physics Laboratory
#
# All Rights Reserved.
# For any other permission, please contact the Legal Office at JHU/APL.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# y... | [
"system.utils.biology.TaxonomicHierarchy",
"pandas.read_csv",
"re.compile",
"system.utils.zip.send_to_zip",
"pydash.get",
"shared.log.logger.warning",
"os.path.exists",
"flask.send_from_directory",
"json.dumps",
"bson.ObjectId",
"glob.glob",
"system.models.metrics.ClassificationMetrics",
"re... | [((1387, 1454), 'flask.Blueprint', 'Blueprint', (['"""results"""', '__name__'], {'url_prefix': 'config.SERVER_API_CHROOT'}), "('results', __name__, url_prefix=config.SERVER_API_CHROOT)\n", (1396, 1454), False, 'from flask import Blueprint, send_from_directory\n'), ((1848, 1886), 'pydash.get', 'pydash.get', (['job', '""... |
#!/usr/bin/env python
# For python 2.6-2.7
from __future__ import print_function
from os.path import *
import re
# from parseBrackets import parseBrackets
from parseDirectiveArgs import parseDirectiveArguments
class MyError(Exception):
def __init__(self, value):
self.value = value
def __str__(self)... | [
"parseDirectiveArgs.parseDirectiveArguments",
"os.path.splitext",
"re.match",
"os.path.basename",
"re.sub"
] | [((1356, 1387), 'parseDirectiveArgs.parseDirectiveArguments', 'parseDirectiveArguments', (['argStr'], {}), '(argStr)\n', (1379, 1387), False, 'from parseDirectiveArgs import parseDirectiveArguments\n'), ((2240, 2344), 're.match', 're.match', (['"""\\\\s*subroutine\\\\s+\\\\w*\\\\s*\\\\(\\\\s*(\\\\w+)\\\\s*(,\\\\s*\\\\w... |
'''
Description:
Author: HCQ
Company(School): UCAS
Email: <EMAIL>
Date: 2021-08-25 09:32:09
LastEditTime: 2021-08-25 11:28:26
FilePath: /ssd-pytorch/nets/vgg.py
'''
import torch.nn as nn
base = [64, 64, 'M', 128, 128, 'M', 256, 256, 256, 'C', 512, 512, 512, 'M',
512, 512, 512]
'''
该代码用于获得V... | [
"torch.nn.ReLU",
"torch.nn.MaxPool2d",
"torch.nn.Conv2d"
] | [((1595, 1643), 'torch.nn.MaxPool2d', 'nn.MaxPool2d', ([], {'kernel_size': '(3)', 'stride': '(1)', 'padding': '(1)'}), '(kernel_size=3, stride=1, padding=1)\n', (1607, 1643), True, 'import torch.nn as nn\n'), ((1664, 1722), 'torch.nn.Conv2d', 'nn.Conv2d', (['(512)', '(1024)'], {'kernel_size': '(3)', 'padding': '(6)', '... |
import tabulator
import json
import re
from pathlib import Path
from fuzzywuzzy import process, fuzz
import os
import dataflows as DF
from .helpers import data_file, all_data
DATA_FILE = data_file('cities_i18n.json')
def prepare():
fp = re.compile('\w+', re.UNICODE)
def fingerprint(x):
return ''.joi... | [
"os.path.exists",
"json.loads",
"re.compile"
] | [((244, 274), 're.compile', 're.compile', (['"""\\\\w+"""', 're.UNICODE'], {}), "('\\\\w+', re.UNICODE)\n", (254, 274), False, 'import re\n'), ((2873, 2898), 'os.path.exists', 'os.path.exists', (['DATA_FILE'], {}), '(DATA_FILE)\n', (2887, 2898), False, 'import os\n'), ((717, 736), 'json.loads', 'json.loads', (['item[0]... |
import os
import os.path as osp
import math
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch_geometric.transforms as T
from torch_geometric.data import DataLoader
from torch_geometric.utils import normalized_cut
from torch_geometric.nn import (NNConv, graclus, max_pool... | [
"logging.StreamHandler",
"math.ceil",
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"argparse.ArgumentParser",
"torch_geometric.data.DataLoader",
"logging.Formatter",
"os.path.join",
"numpy.array",
"training.gnn.GNNTrainer",
"torch.cuda.is_available",
"numpy.cumsum",
"datasets.hitgraphs.HitGra... | [((865, 925), 'os.path.join', 'osp.join', (["os.environ['GNN_TRAINING_DATA_ROOT']", 'args.dataset'], {}), "(os.environ['GNN_TRAINING_DATA_ROOT'], args.dataset)\n", (873, 925), True, 'import os.path as osp\n'), ((961, 1031), 'datasets.hitgraphs.HitGraphDataset', 'HitGraphDataset', (['path'], {'directed': 'directed', 'ca... |
import pandas as pd
import numpy as np
from .basecomparison import BaseTwoSorterComparison
from .comparisontools import (do_score_labels, make_possible_match,
make_best_match, make_hungarian_match, do_confusion_matrix, do_count_score,
compute_performance)
cl... | [
"numpy.where"
] | [((15093, 15133), 'numpy.where', 'np.where', (['(scores > self.overmerged_score)'], {}), '(scores > self.overmerged_score)\n', (15101, 15133), True, 'import numpy as np\n')] |
import os
import subprocess as sp
import time
from pathlib import Path
import discord
from discord import embeds
from discord.ext import commands
async def create_paginator(bot, ctx, pages):
msg = await ctx.send(embed=pages[0])
for reaction in ["⏮️", "◀️", "⏹️", "▶️", "⏭️"]:
await msg.add_reaction(r... | [
"subprocess.getoutput",
"os.listdir",
"discord.Color.random",
"discord.Game",
"pathlib.Path",
"discord.ext.commands.guild_only",
"discord.ext.commands.group",
"discord.ext.commands.check",
"os.path.isdir",
"discord.Activity",
"time.time",
"discord.Streaming",
"discord.Embed",
"discord.Colo... | [((1339, 1382), 'discord.ext.commands.group', 'commands.group', ([], {'invoke_without_command': '(True)'}), '(invoke_without_command=True)\n', (1353, 1382), False, 'from discord.ext import commands\n'), ((1388, 1409), 'discord.ext.commands.guild_only', 'commands.guild_only', ([], {}), '()\n', (1407, 1409), False, 'from... |
"""
Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: MIT-0
"""
from test.testlib.testcase import BaseTestCase
from cfnlint import conditions
class TestEquals(BaseTestCase):
""" Test Equals Logic """
def test_equal_value_string(self):
""" Test equals set... | [
"cfnlint.conditions.EqualsValue"
] | [((375, 407), 'cfnlint.conditions.EqualsValue', 'conditions.EqualsValue', (['template'], {}), '(template)\n', (397, 407), False, 'from cfnlint import conditions\n')] |
import argparse
import concurrent.futures
import contextlib
import platform
import shlex
import subprocess
from pathlib import Path
from typing import Any
from typing import Callable
from typing import List
from typing import TYPE_CHECKING
from typing import TypeVar
if TYPE_CHECKING:
from typing import NoReturn
im... | [
"pathlib.Path",
"shlex.split",
"pre_commit.output.paused_stdout",
"subprocess.run",
"psutil.Process",
"pre_commit.metrics.monitor.trace",
"contextlib.ExitStack",
"pre_commit.output.write_line",
"pre_commit.git.get_editor_script_path",
"typing.TypeVar"
] | [((434, 446), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (441, 446), False, 'from typing import TypeVar\n'), ((604, 642), 'pathlib.Path', 'Path', (['""".git/pre-commit/COMMIT_EDITMSG"""'], {}), "('.git/pre-commit/COMMIT_EDITMSG')\n", (608, 642), False, 'from pathlib import Path\n'), ((679, 721), 'pathli... |
"""
Adapter finding and trimming classes
The ...Adapter classes are responsible for finding adapters.
The ...Match classes trim the reads.
"""
import logging
from enum import IntFlag
from collections import defaultdict
from typing import Optional, Tuple, Sequence, Dict, Any, List, Union
from abc import ABC, abstractme... | [
"logging.getLogger",
"collections.defaultdict"
] | [((443, 462), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (460, 462), False, 'import logging\n'), ((1405, 1421), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (1416, 1421), False, 'from collections import defaultdict\n'), ((2103, 2139), 'collections.defaultdict', 'defaultdict', (['... |
# EIA_CBECS_Land.py (flowsa)
# !/usr/bin/env python3
# coding=utf-8
import pandas as pd
import numpy as np
import io
from flowsa.common import *
from flowsa.flowbyfunctions import assign_fips_location_system
"""
2012 Commercial Buildings Energy Consumption Survey (CBECS)
https://www.eia.gov/consumption/commercial/rep... | [
"pandas.DataFrame",
"pandas.merge",
"pandas.concat",
"io.BytesIO"
] | [((4364, 4389), 'pandas.merge', 'pd.merge', (['df_rse', 'df_data'], {}), '(df_rse, df_data)\n', (4372, 4389), True, 'import pandas as pd\n'), ((5509, 5540), 'pandas.concat', 'pd.concat', (['df_array'], {'sort': '(False)'}), '(df_array, sort=False)\n', (5518, 5540), True, 'import pandas as pd\n'), ((1182, 1216), 'io.Byt... |
import requests
def test_1_ssrf():
params = {'username':'new', 'password':'<PASSWORD>', 'recap':'<PASSWORD>'}
page = requests.get('https://localhost/python/signin.py', params=params, verify=False)
page.encoding = 'utf-8'
cookiename = page.text.strip().split(';')[0].split('=')[0]
cookievalue = page.... | [
"requests.get"
] | [((126, 205), 'requests.get', 'requests.get', (['"""https://localhost/python/signin.py"""'], {'params': 'params', 'verify': '(False)'}), "('https://localhost/python/signin.py', params=params, verify=False)\n", (138, 205), False, 'import requests\n'), ((500, 601), 'requests.get', 'requests.get', (['"""https://localhost/... |
#
# Interpolating class
#
import pybamm
import numpy as np
from scipy import interpolate
class Interpolant(pybamm.Function):
"""
Interpolate data in 1D.
Parameters
----------
x : iterable of :class:`numpy.ndarray`
1-D array(s) of real values defining the data point coordinates.
y : :c... | [
"scipy.interpolate.CubicSpline",
"scipy.interpolate.PchipInterpolator",
"pybamm.Interpolant",
"scipy.interpolate.interp1d",
"scipy.interpolate.interp2d"
] | [((5388, 5556), 'pybamm.Interpolant', 'pybamm.Interpolant', (['self.x', 'self.y', 'children'], {'name': 'self.name', 'interpolator': 'self.interpolator', 'extrapolate': 'self.extrapolate', 'entries_string': 'self.entries_string'}), '(self.x, self.y, children, name=self.name, interpolator=\n self.interpolator, extrap... |
import os
def get_3rd_path(name1, name2) -> str:
pwd = os.getcwd()
path_2rd = os.path.join(pwd, name1)
path_3rd = os.path.join(path_2rd, name2)
return path_3rd
def get_2rd_path(name) -> str:
pwd = os.getcwd()
path_2rd = os.path.join(pwd, name)
return path_2rd
| [
"os.path.join",
"os.getcwd"
] | [((65, 76), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (74, 76), False, 'import os\n'), ((93, 117), 'os.path.join', 'os.path.join', (['pwd', 'name1'], {}), '(pwd, name1)\n', (105, 117), False, 'import os\n'), ((134, 163), 'os.path.join', 'os.path.join', (['path_2rd', 'name2'], {}), '(path_2rd, name2)\n', (146, 163), F... |
import cv2, os
import datetime
import time
import predict
import matplotlib as plt
from Module import crop
while(True):
try:
print('\n▶▶▶▶▶▶삼보산업 PH 예측기입니다.◀◀◀◀◀◀\n')
print('▶ 1 : PH 예측시작(종료시 q버튼)')
print('▶ 2 : 기타 ~')
print('▶ 0 : 프로그램 종료\n')
choice = int(input('번호를 선택하십시오 :... | [
"cv2.imwrite",
"time.sleep",
"cv2.imshow",
"predict.PH_predict",
"Module.crop.readPath",
"cv2.waitKey",
"cv2.destroyAllWindows",
"cv2.VideoCapture",
"os.system",
"time.time"
] | [((501, 514), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (511, 514), False, 'import time\n'), ((657, 670), 'time.sleep', 'time.sleep', (['(3)'], {}), '(3)\n', (667, 670), False, 'import time\n'), ((869, 898), 'predict.PH_predict', 'predict.PH_predict', (['pred_path'], {}), '(pred_path)\n', (887, 898), False, '... |
# hace follow a la gente a la que mi whitelist hace follow
import random
import os
import sys
sys.path.append(os.path.join(sys.path[0], "../"))
from instabot import Bot # noqa: E402
bot = Bot()
bot.login()
lista = []
mis_seguidos = bot.read_list_from_file("whitelist.txt")
# print (Seguidos)
skipped = bot.skipped_... | [
"instabot.Bot",
"os.path.join",
"random.shuffle"
] | [((192, 197), 'instabot.Bot', 'Bot', ([], {}), '()\n', (195, 197), False, 'from instabot import Bot\n'), ((713, 735), 'random.shuffle', 'random.shuffle', (['lista1'], {}), '(lista1)\n', (727, 735), False, 'import random\n'), ((112, 144), 'os.path.join', 'os.path.join', (['sys.path[0]', '"""../"""'], {}), "(sys.path[0],... |
import pytest
from auto_labeling_pipeline.menu import Options
from auto_labeling_pipeline.task import DocumentClassification, GenericTask
@pytest.mark.parametrize(
'task, expected',
[
('DocumentClassification', {GenericTask, DocumentClassification}),
('XXX', {GenericTask})
]
)
def test_fi... | [
"auto_labeling_pipeline.menu.Options.find",
"pytest.mark.parametrize",
"auto_labeling_pipeline.menu.Options.filter_by_task",
"pytest.raises"
] | [((142, 281), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""task, expected"""', "[('DocumentClassification', {GenericTask, DocumentClassification}), ('XXX',\n {GenericTask})]"], {}), "('task, expected', [('DocumentClassification', {\n GenericTask, DocumentClassification}), ('XXX', {GenericTask})])\n... |
# -*- coding: utf-8 -*-
"""
Azure Resource Manager (ARM) Graph RBAC Client Utility
.. versionadded:: 2.4.0
:maintainer: <<EMAIL>>
:configuration: This module requires Azure Resource Manager credentials to be passed as keyword arguments
to every function or via acct in order to work properly.
Required provide... | [
"logging.getLogger",
"azure.graphrbac.GraphRbacManagementClient"
] | [((1046, 1073), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1063, 1073), False, 'import logging\n'), ((1515, 1601), 'azure.graphrbac.GraphRbacManagementClient', 'GraphRbacManagementClient', ([], {'credentials': 'credentials', 'tenant_id': 'credentials._tenant'}), '(credentials=credent... |
# -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import, unicode_literals
from swid_generator.package_info import PackageInfo
from swid_generator.generators import utils
import os
import unittest
from glob import glob
from shutil import rmtree
class GeneratorUtilsTest(unittest.TestC... | [
"os.path.exists",
"swid_generator.generators.utils.create_sha512_hash",
"os.getcwd",
"shutil.rmtree",
"swid_generator.generators.utils.create_software_id",
"swid_generator.package_info.PackageInfo",
"swid_generator.generators.utils.create_sha256_hash",
"swid_generator.generators.utils.create_sha384_ha... | [((390, 444), 'swid_generator.package_info.PackageInfo', 'PackageInfo', ([], {'package': '"""swid_generator"""', 'version': '"""0.1.2"""'}), "(package='swid_generator', version='0.1.2')\n", (401, 444), False, 'from swid_generator.package_info import PackageInfo\n'), ((530, 587), 'swid_generator.generators.utils.create_... |
from Interprete.NodoAST import NodoArbol
from Interprete.Tabla_de_simbolos import Tabla_de_simbolos
from Interprete.Arbol import Arbol
from Interprete.Valor.Valor import Valor
from Interprete.Primitivos.TIPO import TIPO
class BOOLEANO(NodoArbol):
def __init__(self, data, line, column):
super().__init__(li... | [
"Interprete.Valor.Valor.Valor"
] | [((443, 473), 'Interprete.Valor.Valor.Valor', 'Valor', (['TIPO.BOOLEAN', 'self.data'], {}), '(TIPO.BOOLEAN, self.data)\n', (448, 473), False, 'from Interprete.Valor.Valor import Valor\n')] |
# Generated by Django 3.2.5 on 2021-07-15 09:30
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | [
"django.db.models.OneToOneField",
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.ManyToManyField",
"django.db.models.DateTimeField",
"django.db.models.BooleanField",
"django.db.models.SlugField",
"django.db.models.BigAutoField",
"django.db.models.URLField",
"django.... | [((247, 304), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (278, 304), False, 'from django.db import migrations, models\n'), ((432, 528), 'django.db.models.BigAutoField', 'models.BigAutoField', ([], {'auto_created': '... |
# Generated by Django 3.0.3 on 2020-12-14 20:35
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Opportunities',
fields=[
('id', models.Auto... | [
"django.db.models.DateTimeField",
"django.db.models.AutoField",
"django.db.models.CharField"
] | [((309, 402), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (325, 402), False, 'from django.db import migrations, models\... |
import os
from flask import Flask
from flask import jsonify
from flask import request
from functools import wraps
from utils import logger
# Create Flask app
app = Flask(__name__)
# import config vars
app.config.from_object(os.environ['APP_SETTINGS'])
# Create logger: (Ex: logger.info, logger.warning, logger.error)
... | [
"flask.jsonify",
"utils.logger.get_logger",
"functools.wraps",
"flask.Flask"
] | [((165, 180), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (170, 180), False, 'from flask import Flask\n'), ((329, 351), 'utils.logger.get_logger', 'logger.get_logger', (['app'], {}), '(app)\n', (346, 351), False, 'from utils import logger\n'), ((575, 598), 'flask.jsonify', 'jsonify', (["{'key': 'val'}"]... |
import os
import traceback
import networkx as nx
from nasbench import api
from nord.utils import pdownload
NASBENCH_TFRECORD = './data/nasbench_only108.tfrecord'
file_url = 'https://storage.googleapis.com/nasbench/nasbench_only108.tfrecord'
INPUT = 'input'
OUTPUT = 'output'
CONV1X1 = 'conv1x1-bn-relu'
C... | [
"nasbench.api.ModelSpec",
"networkx.linalg.adjacency_matrix",
"networkx.DiGraph",
"networkx.all_simple_paths",
"nord.utils.pdownload",
"os.path.isfile",
"nasbench.api.NASBench",
"traceback.print_exc"
] | [((823, 854), 'nasbench.api.NASBench', 'api.NASBench', (['NASBENCH_TFRECORD'], {}), '(NASBENCH_TFRECORD)\n', (835, 854), False, 'from nasbench import api\n'), ((2339, 2351), 'networkx.DiGraph', 'nx.DiGraph', ([], {}), '()\n', (2349, 2351), True, 'import networkx as nx\n'), ((624, 657), 'os.path.isfile', 'os.path.isfile... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | [
"ansible_collections.cisco.aci.plugins.module_utils.aci.aci_argument_spec",
"ansible.module_utils.basic.AnsibleModule",
"ansible_collections.cisco.aci.plugins.module_utils.aci.ACIModule"
] | [((9621, 9640), 'ansible_collections.cisco.aci.plugins.module_utils.aci.aci_argument_spec', 'aci_argument_spec', ([], {}), '()\n', (9638, 9640), False, 'from ansible_collections.cisco.aci.plugins.module_utils.aci import ACIModule, aci_argument_spec\n'), ((11000, 11169), 'ansible.module_utils.basic.AnsibleModule', 'Ansi... |
from easymunk import Space
class TestCollections:
def test_initialize_base_collections(self):
sp = Space()
b1 = sp.create_circle(1)
b2 = sp.create_circle(1, position=(1, 0))
conn = b1.junction(b2)
j1 = conn.fix_distance(2)
sp.step(1.0)
assert sp.bodies == {... | [
"easymunk.Space"
] | [((113, 120), 'easymunk.Space', 'Space', ([], {}), '()\n', (118, 120), False, 'from easymunk import Space\n')] |
import numpy as np
from scipy.integrate import quad
import random
import matplotlib.pyplot as plt
from matplotlib.patches import Circle
# Example for Monte Carlo method.
point_in=0
point_out=0
for i in range(10000):
x=random.uniform(0,1)
y=random.uniform(0,1)
if y<=np.sqrt(1-x**2):
point_in=point_i... | [
"random.uniform",
"numpy.sqrt"
] | [((223, 243), 'random.uniform', 'random.uniform', (['(0)', '(1)'], {}), '(0, 1)\n', (237, 243), False, 'import random\n'), ((249, 269), 'random.uniform', 'random.uniform', (['(0)', '(1)'], {}), '(0, 1)\n', (263, 269), False, 'import random\n'), ((279, 298), 'numpy.sqrt', 'np.sqrt', (['(1 - x ** 2)'], {}), '(1 - x ** 2)... |
import simulation.quadrotor3 as quad
import simulation.config as cfg
import simulation.animation as ani
import matplotlib.pyplot as pl
import numpy as np
import random
from math import pi, sin, cos
import gym
from gym import error, spaces, utils
from gym.utils import seeding
"""
Environment wrapper for a climb & ... | [
"simulation.animation.Visualization",
"matplotlib.pyplot.ion",
"numpy.arcsin",
"matplotlib.pyplot.close",
"numpy.array",
"numpy.zeros",
"matplotlib.pyplot.figure",
"numpy.sum",
"numpy.cos",
"numpy.linalg.norm",
"numpy.sin",
"matplotlib.pyplot.draw",
"matplotlib.pyplot.pause",
"simulation.q... | [((669, 700), 'numpy.array', 'np.array', (['[[1.5], [0.0], [0.0]]'], {}), '([[1.5], [0.0], [0.0]])\n', (677, 700), True, 'import numpy as np\n'), ((1095, 1126), 'numpy.array', 'np.array', (['[[0.0], [0.0], [0.0]]'], {}), '([[0.0], [0.0], [0.0]])\n', (1103, 1126), True, 'import numpy as np\n'), ((1286, 1300), 'numpy.zer... |
#test_views.py
import pytest
import unittest
from flask import render_template, Flask, request, jsonify, session, redirect, url_for, flash
#from routes import index, scheduleMaker, load_ajax
from routes import app
#this test class will test the function that flask set up all pages successfully and correctly... | [
"unittest.main",
"routes.app.test_client"
] | [((1640, 1655), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1653, 1655), False, 'import unittest\n'), ((478, 499), 'routes.app.test_client', 'app.test_client', (['self'], {}), '(self)\n', (493, 499), False, 'from routes import app\n'), ((700, 721), 'routes.app.test_client', 'app.test_client', (['self'], {}), '... |
from urllib.parse import urlparse
from arekit.processing.text.token import Token
# TODO. Leave it here but provide the base (BaseTokens) type.
# TODO. With the related API at BaseTokens.
class Tokens:
"""
Tokens used to describe a non-word text units, such as punctuation,
uknown words/chars, smiles, etc.
... | [
"urllib.parse.urlparse",
"arekit.processing.text.token.Token"
] | [((2207, 2271), 'arekit.processing.text.token.Token', 'Token', ([], {'term': 'subterm', 'token_value': 'Tokens.__token_mapping[subterm]'}), '(term=subterm, token_value=Tokens.__token_mapping[subterm])\n', (2212, 2271), False, 'from arekit.processing.text.token import Token\n'), ((2432, 2475), 'arekit.processing.text.to... |
import threading
# TODO: replace this terrible code with something reasonable
class Parallel():
max = 20
stack = []
threads = []
def start(self, func):
def wrapper():
func()
try:
self.threads.remove(threading.current_thread())
except ValueEr... | [
"threading.Thread",
"threading.current_thread"
] | [((389, 421), 'threading.Thread', 'threading.Thread', ([], {'target': 'wrapper'}), '(target=wrapper)\n', (405, 421), False, 'import threading\n'), ((266, 292), 'threading.current_thread', 'threading.current_thread', ([], {}), '()\n', (290, 292), False, 'import threading\n')] |
import glob
import os
import time
import cv2
import numpy as np
class GetLoadouts():
def __init__(self):
self.weapon_templates = self.generate_weapon_templates()
def generate_weapon_templates(self):
generated_weapon_templates = []
template_directory = os.path.abspath(os.path.join(
... | [
"os.path.join",
"cv2.minMaxLoc",
"cv2.cvtColor",
"cv2.matchTemplate",
"time.time",
"glob.glob",
"cv2.imread"
] | [((1976, 2015), 'cv2.cvtColor', 'cv2.cvtColor', (['frame', 'cv2.COLOR_BGR2GRAY'], {}), '(frame, cv2.COLOR_BGR2GRAY)\n', (1988, 2015), False, 'import cv2\n'), ((2271, 2326), 'os.path.join', 'os.path.join', (['__file__', '"""../../test_images/Tab Images/"""'], {}), "(__file__, '../../test_images/Tab Images/')\n", (2283, ... |
from django.views.generic.base import RedirectView
from django.contrib.auth.mixins import PermissionRequiredMixin
from django_addanother.views import UpdatePopupMixin
from gbe.models import Performer
from django.urls import reverse
from django.http import Http404
class PerformerUpdate(UpdatePopupMixin, PermissionRequ... | [
"gbe.models.Performer.objects.get_subclass",
"django.urls.reverse"
] | [((498, 567), 'django.urls.reverse', 'reverse', (['"""persona-update"""'], {'urlconf': '"""gbe.urls"""', 'args': "[kwargs['pk'], 1]"}), "('persona-update', urlconf='gbe.urls', args=[kwargs['pk'], 1])\n", (505, 567), False, 'from django.urls import reverse\n'), ((659, 751), 'gbe.models.Performer.objects.get_subclass', '... |
import sqlite3
connect = sqlite3.connect('../db.sqlite3')
import pandas as pd
df = pd.read_sql_query('select * from members where age >= 25', connect )
df1 = pd.read_sql_query('select * from polls_economics where title like "%마스크%"', connect)
df2 = pd.read_sql_query('select * from polls_economics where title like "%노... | [
"pandas.read_sql_query",
"sqlite3.connect"
] | [((25, 57), 'sqlite3.connect', 'sqlite3.connect', (['"""../db.sqlite3"""'], {}), "('../db.sqlite3')\n", (40, 57), False, 'import sqlite3\n'), ((84, 151), 'pandas.read_sql_query', 'pd.read_sql_query', (['"""select * from members where age >= 25"""', 'connect'], {}), "('select * from members where age >= 25', connect)\n"... |
import asyncpraw
from src.DB import DB
class Reddit:
def __init__(self, config):
self.reddit = asyncpraw.Reddit(
client_id=config["Reddit"]["ClientID"],
client_secret=config["Reddit"]["ClientSecret"],
password=config["Reddit"]["Password"],
user_agent="KoKoBo... | [
"src.DB.DB.get",
"asyncpraw.Reddit"
] | [((109, 345), 'asyncpraw.Reddit', 'asyncpraw.Reddit', ([], {'client_id': "config['Reddit']['ClientID']", 'client_secret': "config['Reddit']['ClientSecret']", 'password': "config['Reddit']['Password']", 'user_agent': '"""KoKoBot/0.1 by Kilenaitor"""', 'username': "config['Reddit']['Username']"}), "(client_id=config['Red... |
import setuptools
setuptools.setup(
name="itanium_demangler",
version="1.0",
author="whitequark",
author_email="<EMAIL>",
description="Pure Python parser for mangled itanium symbols",
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
url="https:/... | [
"setuptools.find_packages"
] | [((383, 409), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (407, 409), False, 'import setuptools\n')] |
from urllib.request import urlopen
from urllib.request import FancyURLopener
from bs4 import BeautifulSoup
import pandas as pd
import os
import _proj_functions as proj
import _lookups as lookups
import re
outdir = '../output'
##### duke ###########################
school = 'duke'
sports_dict = lookups.get_sports_dic... | [
"_proj_functions.gather_rosters_grid",
"os.path.join",
"_lookups.get_sports_dict"
] | [((298, 323), '_lookups.get_sports_dict', 'lookups.get_sports_dict', ([], {}), '()\n', (321, 323), True, 'import _lookups as lookups\n'), ((2848, 2885), '_proj_functions.gather_rosters_grid', 'proj.gather_rosters_grid', (['sports_dict'], {}), '(sports_dict)\n', (2872, 2885), True, 'import _proj_functions as proj\n'), (... |
import datetime
import time
from google.appengine.api import urlfetch
from google.appengine.api.labs import taskqueue
from google.appengine.ext import db
from google.appengine.ext.db import polymodel
from tweetengine import oauth
from tweetengine.i18n import _
class UserAccount(polymodel.PolyModel):
def get_usern... | [
"google.appengine.ext.db.BooleanProperty",
"google.appengine.api.labs.taskqueue.Task",
"google.appengine.ext.db.TextProperty",
"google.appengine.ext.db.IntegerProperty",
"google.appengine.ext.db.ReferenceProperty",
"tweetengine.i18n._",
"google.appengine.ext.db.DateTimeProperty",
"google.appengine.ext... | [((418, 448), 'google.appengine.ext.db.UserProperty', 'db.UserProperty', ([], {'required': '(True)'}), '(required=True)\n', (433, 448), False, 'from google.appengine.ext import db\n'), ((773, 803), 'google.appengine.ext.db.TextProperty', 'db.TextProperty', ([], {'required': '(True)'}), '(required=True)\n', (788, 803), ... |
import os
import time
import random
import torch
import logging
import numpy as np
import torch.nn as nn
from pathlib import Path
from args import get_parser
from models.model import MLMBaseline
from data.data_loader import MLMLoader
from utils import IRLoss, LELoss, MTLLoss, AverageMeter, rank, classify
# define crit... | [
"logging.getLogger",
"logging.StreamHandler",
"models.model.MLMBaseline",
"torch.cuda.is_available",
"pathlib.Path",
"logging.FileHandler",
"numpy.random.seed",
"torch.topk",
"os.path.dirname",
"torch.cuda.manual_seed_all",
"torch.manual_seed",
"torch.load",
"random.seed",
"args.get_parser... | [((464, 476), 'args.get_parser', 'get_parser', ([], {}), '()\n', (474, 476), False, 'from args import get_parser\n'), ((1061, 1088), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1078, 1088), False, 'import logging\n'), ((1109, 1131), 'random.seed', 'random.seed', (['args.seed'], {}), '... |
import asyncio
from datetime import timedelta
import discord
from discord.ext import commands
import aoi
from libs.conversions import hms_notation
from libs.converters import t_delta
class Channels(commands.Cog):
def __init__(self, bot: aoi.AoiBot):
self.bot = bot
@property
def description(self... | [
"discord.ext.commands.has_permissions",
"libs.converters.t_delta",
"discord.ext.commands.DisabledCommand",
"libs.conversions.hms_notation",
"asyncio.sleep",
"discord.ext.commands.max_concurrency",
"discord.ext.commands.cooldown",
"discord.ext.commands.command"
] | [((377, 443), 'discord.ext.commands.cooldown', 'commands.cooldown', ([], {'rate': '(1)', 'per': '(300)', 'type': 'commands.BucketType.guild'}), '(rate=1, per=300, type=commands.BucketType.guild)\n', (394, 443), False, 'from discord.ext import commands\n'), ((449, 514), 'discord.ext.commands.has_permissions', 'commands.... |
import os
import tarfile
import numpy as np
import pandas as pd
from catalyst.data.bundles.core import download_without_progress
from catalyst.exchange.utils.exchange_utils import get_exchange_bundles_folder
EXCHANGE_NAMES = ['bitfinex', 'bittrex', 'poloniex', 'binance']
API_URL = 'http://data.enigma.co/... | [
"tarfile.open",
"catalyst.data.bundles.core.download_without_progress",
"os.path.join",
"catalyst.exchange.utils.exchange_utils.get_exchange_bundles_folder",
"os.path.isdir",
"numpy.isnan",
"pandas.DataFrame"
] | [((686, 728), 'catalyst.exchange.utils.exchange_utils.get_exchange_bundles_folder', 'get_exchange_bundles_folder', (['exchange_name'], {}), '(exchange_name)\n', (713, 728), False, 'from catalyst.exchange.utils.exchange_utils import get_exchange_bundles_folder\n'), ((926, 950), 'os.path.join', 'os.path.join', (['root', ... |
import json
import os
from . import jsonencoder
class Objects:
def __init__(self, path: str):
self.path = os.path.abspath(path)
os.makedirs(os.path.join(self.path, "objects"), exist_ok=True)
self.encoder = jsonencoder.Encoder()
def save_object(self, object_name, object_instance):
... | [
"os.path.abspath",
"json.load",
"os.path.join",
"json.dump"
] | [((121, 142), 'os.path.abspath', 'os.path.abspath', (['path'], {}), '(path)\n', (136, 142), False, 'import os\n'), ((163, 197), 'os.path.join', 'os.path.join', (['self.path', '"""objects"""'], {}), "(self.path, 'objects')\n", (175, 197), False, 'import os\n'), ((461, 523), 'json.dump', 'json.dump', (['object_instance',... |
# -*- coding: utf-8 -*-
"""BayesianConv2Pool2 definition. Softplus for positive output."""
import torch.nn as nn
from utils.layers import BayesianConv2d, BayesianLinear, Flatten
from models.abstract_model import AbstractModel
class BayesianConv2Pool2(AbstractModel):
def __init__(self, input_size):
"""
... | [
"torch.nn.AvgPool2d",
"utils.layers.BayesianConv2d",
"torch.nn.Sigmoid",
"torch.nn.Softplus"
] | [((550, 603), 'utils.layers.BayesianConv2d', 'BayesianConv2d', (['input_size[0]', '(8)'], {'kernel_size': '(5, 14)'}), '(input_size[0], 8, kernel_size=(5, 14))\n', (564, 603), False, 'from utils.layers import BayesianConv2d, BayesianLinear, Flatten\n'), ((617, 629), 'torch.nn.Sigmoid', 'nn.Sigmoid', ([], {}), '()\n', (... |
import numpy as np
def Ent_MS_Plus20201001(x, tau, m, r):
"""
(RCMSE, CMSE, MSE, MSFE) = RCMS_Ent( x, tau, m, r )
inputs - x, single column time seres
- tau, greatest scale factor
- m, length of vectors to be compared
- R, radius for accepting matches (as a proportion of th... | [
"numpy.abs",
"numpy.mean",
"numpy.tile",
"numpy.where",
"numpy.log",
"numpy.max",
"numpy.exp",
"numpy.array",
"numpy.zeros",
"numpy.sum",
"numpy.isnan",
"numpy.std",
"numpy.var"
] | [((1622, 1649), 'numpy.zeros', 'np.zeros', (['tau'], {'dtype': 'object'}), '(tau, dtype=object)\n', (1630, 1649), True, 'import numpy as np\n'), ((1660, 1687), 'numpy.zeros', 'np.zeros', (['tau'], {'dtype': 'object'}), '(tau, dtype=object)\n', (1668, 1687), True, 'import numpy as np\n'), ((1699, 1726), 'numpy.zeros', '... |
# -*- coding:utf-8 -*-
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the MIT License.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the ... | [
"vega.set_backend",
"vega.dataset",
"vega.trainer",
"vega.network"
] | [((607, 641), 'vega.set_backend', 'vega.set_backend', (['"""pytorch"""', '"""GPU"""'], {}), "('pytorch', 'GPU')\n", (623, 641), False, 'import vega\n'), ((2216, 2241), 'vega.trainer', 'vega.trainer', ([], {'model': 'model'}), '(model=model)\n', (2228, 2241), False, 'import vega\n'), ((1365, 1459), 'vega.dataset', 'vega... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import argparse
import multiprocessing as mp
import neblio_ci_libs as nci
working_dir = os.getcwd()
build_dir = "build"
deploy_dir = os.path.join(os.environ['TRAVIS_BUILD_DIR'],'deploy', '')
parser = argparse.ArgumentParser()
parser.add_argument('--test', '-t',... | [
"neblio_ci_libs.mkdir_p",
"argparse.ArgumentParser",
"neblio_ci_libs.call_with_err_code",
"os.path.join",
"multiprocessing.cpu_count",
"os.getcwd",
"os.chdir"
] | [((146, 157), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (155, 157), False, 'import os\n'), ((191, 249), 'os.path.join', 'os.path.join', (["os.environ['TRAVIS_BUILD_DIR']", '"""deploy"""', '""""""'], {}), "(os.environ['TRAVIS_BUILD_DIR'], 'deploy', '')\n", (203, 249), False, 'import os\n'), ((259, 284), 'argparse.Argu... |