code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import logging
from fab_deploy import cli
_LOGGER = logging.getLogger(__name__)
cli.main()
| [
"logging.getLogger",
"fab_deploy.cli.main"
] | [((54, 81), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (71, 81), False, 'import logging\n'), ((83, 93), 'fab_deploy.cli.main', 'cli.main', ([], {}), '()\n', (91, 93), False, 'from fab_deploy import cli\n')] |
import datetime
import fnmatch
import regex
from merc import errors
from merc import util
class ChannelUser(object):
def __init__(self, channel, user):
self.channel = channel
self.user = user
self.is_voiced = False
self.is_halfop = False
self.is_operator = False
self.is_admin = False
s... | [
"merc.errors.NoSuchNick",
"merc.errors.CannotSendToChan",
"datetime.datetime.now",
"merc.errors.ChanOpPrivsNeeded",
"merc.util.to_irc_lower",
"merc.errors.NotOnChannel"
] | [((1513, 1536), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (1534, 1536), False, 'import datetime\n'), ((2152, 2180), 'merc.util.to_irc_lower', 'util.to_irc_lower', (['self.name'], {}), '(self.name)\n', (2169, 2180), False, 'from merc import util\n'), ((3273, 3308), 'merc.errors.ChanOpPrivsNeede... |
import pylzma
from SerializerBase import *
class SerializerLZMA(SerializerBase):
def __init__(self):
self.__jslocation__ = "j.data.serializer.lzma"
def dumps(self, obj):
return pylzma.compress(obj)
def loads(self, s):
return pylzma.decompress(s)
| [
"pylzma.compress",
"pylzma.decompress"
] | [((206, 226), 'pylzma.compress', 'pylzma.compress', (['obj'], {}), '(obj)\n', (221, 226), False, 'import pylzma\n'), ((267, 287), 'pylzma.decompress', 'pylzma.decompress', (['s'], {}), '(s)\n', (284, 287), False, 'import pylzma\n')] |
# coding:utf-8
# --author-- lanhua.zhou
import os
import json
import logging
__all__ = ["get_menu_data", "MENU_KEY", "MENU_FILE"]
DIRNAME = os.path.dirname(__file__)
MENU_DIRNAME = os.path.dirname(os.path.dirname(DIRNAME))
MENU_FILE = "{}/conf/menu.json".format(MENU_DIRNAME)
MENU_KEY = ["utility", "modeling", "shadi... | [
"logging.getLogger",
"os.path.dirname",
"json.loads"
] | [((142, 167), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (157, 167), False, 'import os\n'), ((409, 436), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (426, 436), False, 'import logging\n'), ((199, 223), 'os.path.dirname', 'os.path.dirname', (['DIRNAME'], {... |
"""
Copyright (c) 2017, <NAME>.
Distributed under the terms of the MIT License.
The full license is in the file COPYING.txt, distributed with this software.
Created on Oct 29, 2017
@author: jrm
"""
def bar_chart_factory():
from .android_chart_view import AndroidBarChart
return AndroidBarChart
def data_se... | [
"enamlnative.android.factories.ANDROID_FACTORIES.update"
] | [((1047, 1100), 'enamlnative.android.factories.ANDROID_FACTORIES.update', 'factories.ANDROID_FACTORIES.update', (['ANDROID_FACTORIES'], {}), '(ANDROID_FACTORIES)\n', (1081, 1100), False, 'from enamlnative.android import factories\n')] |
# -*- coding: utf-8 -*-
from core import config
from PyQt4.QtGui import QColor
COLOR_BRUSH = 0
COLOR_PEN = 1
def getColorFromConfig(section, paint_type):
if section not in config.colors.keys():
raise BaseException("Unknown color section")
if paint_type != COLOR_BRUSH and paint_type != COLOR_PEN:
raise BaseExc... | [
"PyQt4.QtGui.QColor",
"core.config.colors.keys"
] | [((435, 563), 'PyQt4.QtGui.QColor', 'QColor', (['config.colors[section][paint_type][0]', 'config.colors[section][paint_type][1]', 'config.colors[section][paint_type][2]'], {}), '(config.colors[section][paint_type][0], config.colors[section][\n paint_type][1], config.colors[section][paint_type][2])\n', (441, 563), Fa... |
import os
import mmap
import binascii
import os
import glob
import binascii
import datetime
import shutil
import mmap
import hashlib
import json
from py2neo import Graph, authenticate, Cursor, cypher
import logging
import csv
import pandas as pd
import numpy as np
#from bitcoinrpc.authproxy import AuthServiceProxy, JS... | [
"csv.DictWriter",
"hashlib.sha256",
"logging.debug",
"os.getenv",
"binascii.hexlify",
"json.dumps",
"os.path.join",
"datetime.datetime.now",
"py2neo.Graph"
] | [((435, 557), 'py2neo.Graph', 'Graph', ([], {'host': '"""localhost"""', 'bolt': '(True)', 'bolt_port': '(7687)', 'http_port': '(7474)', 'secure': '(False)', 'user': '"""neo4j"""', 'password': '"""<PASSWORD>"""'}), "(host='localhost', bolt=True, bolt_port=7687, http_port=7474, secure=\n False, user='neo4j', password=... |
import json
from server import Game, MapCellState, IGameSession, handle_do
from twisted.web.test.requesthelper import DummyRequest
class MockRequest(DummyRequest):
def getSession(self, component=None):
session = DummyRequest.getSession(self)
if component is not None:
return session.ge... | [
"server.handle_do",
"json.loads",
"server.Game",
"twisted.web.test.requesthelper.DummyRequest.getSession"
] | [((474, 480), 'server.Game', 'Game', ([], {}), '()\n', (478, 480), False, 'from server import Game, MapCellState, IGameSession, handle_do\n'), ((571, 577), 'server.Game', 'Game', ([], {}), '()\n', (575, 577), False, 'from server import Game, MapCellState, IGameSession, handle_do\n'), ((772, 778), 'server.Game', 'Game',... |
# Generated by Django 3.1.3 on 2020-12-23 15:09
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("contenttypes", "0002_remove_content_type_name"),
("pinboard", "0024_bookmark_post_year"),
]
operations = [
... | [
"django.db.models.SlugField",
"django.db.models.IntegerField",
"django.db.models.CharField",
"django.db.models.ForeignKey"
] | [((432, 498), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)', 'unique': '(True)', 'verbose_name': '"""name"""'}), "(max_length=100, unique=True, verbose_name='name')\n", (448, 498), False, 'from django.db import migrations, models\n'), ((623, 689), 'django.db.models.SlugField', 'models.Sl... |
from colorist import black, blue, cyan, green, magenta, red, white, yellow
if __name__ == "__main__":
print("")
green("This is GREEN!")
print("")
yellow("This is YELLOW!")
print("")
red("This is RED!")
print("")
magenta("This is MAGENTA!")
print("")
blue("This is BLUE!")
pri... | [
"colorist.magenta",
"colorist.green",
"colorist.white",
"colorist.red",
"colorist.cyan",
"colorist.black",
"colorist.blue",
"colorist.yellow"
] | [((121, 144), 'colorist.green', 'green', (['"""This is GREEN!"""'], {}), "('This is GREEN!')\n", (126, 144), False, 'from colorist import black, blue, cyan, green, magenta, red, white, yellow\n'), ((163, 188), 'colorist.yellow', 'yellow', (['"""This is YELLOW!"""'], {}), "('This is YELLOW!')\n", (169, 188), False, 'fro... |
import endpointGenerator
import freshdeskService
import processData
import slackService
from collections import defaultdict
fd = defaultdict(list)
def integrator_func(team):
tag = endpointGenerator.url_generator_multiple(team)
global fd
for k,v in tag.items():
fd.clear()
print('\n' + '\n' +'\n' +k)
if k == ... | [
"endpointGenerator.url_generator_multiple",
"processData.dataMapper",
"freshdeskService.trigger",
"freshdeskService.trigger_filter",
"collections.defaultdict"
] | [((131, 148), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (142, 148), False, 'from collections import defaultdict\n'), ((184, 230), 'endpointGenerator.url_generator_multiple', 'endpointGenerator.url_generator_multiple', (['team'], {}), '(team)\n', (224, 230), False, 'import endpointGenerator\n... |
from flask import Response, request, json, jsonify
from flask_restx import Resource, Namespace, fields
import datetime
from mongoengine.errors import FieldDoesNotExist, NotUniqueError, DoesNotExist, InvalidQueryError
from mongoengine import connect
from database.models import User, Categories, Contents
import json
Set... | [
"database.models.Contents",
"database.models.Categories",
"flask_restx.Namespace",
"database.models.User.objects",
"database.models.Categories.objects",
"database.models.User"
] | [((330, 404), 'flask_restx.Namespace', 'Namespace', ([], {'name': '"""Database Set up"""', 'description': '"""웹 어플리케이션을 위한 초기 데이터베이스 설정"""'}), "(name='Database Set up', description='웹 어플리케이션을 위한 초기 데이터베이스 설정')\n", (339, 404), False, 'from flask_restx import Resource, Namespace, fields\n'), ((968, 1098), 'database.model... |
import datetime
import glob
import os
import operator
import pytest
import numpy as np
from functools import reduce
from numpy import nan
from osgeo import gdal
from test import DATA_DIR, TEST_DIR, pushd
from RAiDER.constants import Zenith, _ZMIN, _ZREF
from RAiDER.processWM import prepareWeatherModel
from RAiDER.mo... | [
"RAiDER.models.erai.ERAI",
"RAiDER.models.hres.HRES",
"numpy.array",
"numpy.nanmean",
"datetime.timedelta",
"RAiDER.models.weatherModel.make_weather_model_filename",
"numpy.arange",
"datetime.datetime",
"RAiDER.models.ncmr.NCMR",
"RAiDER.models.gmao.GMAO",
"numpy.empty",
"numpy.random.normal",... | [((761, 833), 'os.path.join', 'os.path.join', (['DATA_DIR', '"""weather_files"""', '"""ERA-5_2018_07_01_T00_00_00.nc"""'], {}), "(DATA_DIR, 'weather_files', 'ERA-5_2018_07_01_T00_00_00.nc')\n", (773, 833), False, 'import os\n'), ((887, 893), 'RAiDER.models.erai.ERAI', 'ERAI', ([], {}), '()\n', (891, 893), False, 'from ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
# Package metadata.
NAME = 'inventory'
DESCRIPTION = 'An inventory management CLI'
URL = 'https://github.com/mirrorkeydev/inventory'
EMAIL = '<EMAIL>'
AUTHOR = '<NAME>'
REQUIRES_PYTHON = '>=3.9.0'
VERSION = None
LICENSE = 'Apache-2.0'
# What p... | [
"setuptools.setup"
] | [((470, 878), 'setuptools.setup', 'setup', ([], {'name': 'NAME', 'description': 'DESCRIPTION', 'author': 'AUTHOR', 'author_email': 'EMAIL', 'python_requires': 'REQUIRES_PYTHON', 'url': 'URL', 'entry_points': "{'console_scripts': ['inventory=inventory.cli:main']}", 'install_requires': 'REQUIRED', 'include_package_data':... |
#!/usr/bin/env python
# coding: utf-8
import os
import numpy as np
import pandas as pd
import matplotlib.pylab as pylab
from matplotlib import pyplot as plt
import seaborn as sb
os.chdir('/Users/pauline/Documents/Python')
sb.set(style='white')
sb.set_context('paper')
params = {'figure.figsize': (10, 10),
'leg... | [
"seaborn.set",
"matplotlib.pyplot.savefig",
"pandas.read_csv",
"matplotlib.pyplot.xticks",
"seaborn.set_context",
"seaborn.heatmap",
"os.chdir",
"matplotlib.pyplot.yticks",
"matplotlib.pylab.rcParams.update",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.title",
"matplotlib.pyplot.subpl... | [((179, 222), 'os.chdir', 'os.chdir', (['"""/Users/pauline/Documents/Python"""'], {}), "('/Users/pauline/Documents/Python')\n", (187, 222), False, 'import os\n'), ((223, 244), 'seaborn.set', 'sb.set', ([], {'style': '"""white"""'}), "(style='white')\n", (229, 244), True, 'import seaborn as sb\n'), ((245, 268), 'seaborn... |
import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
import unittest
from uprime import Uprime
import pandas as pd
directory = os.path.dirname(os.path.realpath(__file__))
relative_file_path = 'uprime_test_data.csv'
full_path = os.path.join(directory, relative_file_p... | [
"pandas.read_csv",
"uprime.Uprime",
"os.path.join",
"os.path.realpath",
"os.path.dirname",
"unittest.main",
"pandas.testing.assert_series_equal"
] | [((281, 324), 'os.path.join', 'os.path.join', (['directory', 'relative_file_path'], {}), '(directory, relative_file_path)\n', (293, 324), False, 'import os\n'), ((330, 352), 'pandas.read_csv', 'pd.read_csv', (['full_path'], {}), '(full_path)\n', (341, 352), True, 'import pandas as pd\n'), ((197, 223), 'os.path.realpath... |
import json
from asynctest import TestCase as AsyncTestCase
from asynctest import mock as async_mock
import pytest
try:
from indy.libindy import _cdll
_cdll()
except ImportError:
pytest.skip(
"skipping Indy-specific tests: python module not installed",
allow_module_level=True,
)
exce... | [
"json.dumps",
"indy.libindy._cdll",
"asynctest.mock.patch",
"pytest.skip",
"aries_cloudagent.verifier.indy.IndyVerifier"
] | [((163, 170), 'indy.libindy._cdll', '_cdll', ([], {}), '()\n', (168, 170), False, 'from indy.libindy import _cdll\n'), ((836, 892), 'asynctest.mock.patch', 'async_mock.patch', (['"""indy.anoncreds.verifier_verify_proof"""'], {}), "('indy.anoncreds.verifier_verify_proof')\n", (852, 892), True, 'from asynctest import moc... |
import bisect
import collections
import datetime
import json
import os
import newtab
_Date = collections.namedtuple('_Date',
['description', 'is_school', 'timetable_index'])
def _parse_date(string):
return datetime.datetime.strptime(string, '%Y-%m-%d').date()
def _parse_dates(k... | [
"collections.namedtuple",
"datetime.datetime.strptime",
"os.path.join",
"os.path.isfile",
"datetime.date.fromordinal",
"datetime.datetime.now",
"json.load",
"datetime.timedelta",
"datetime.datetime.combine"
] | [((96, 181), 'collections.namedtuple', 'collections.namedtuple', (['"""_Date"""', "['description', 'is_school', 'timetable_index']"], {}), "('_Date', ['description', 'is_school', 'timetable_index']\n )\n", (118, 181), False, 'import collections\n'), ((643, 695), 'os.path.join', 'os.path.join', (['newtab.app.instance... |
def inference(text,model,tokenizer,max=64,mask='[MASK]'):
input = tokenizer(text,max_length=max,padding='max_length',return_tensors='pt')
tokens = tokenizer.convert_ids_to_tokens(input['input_ids'].numpy().squeeze())
idx = tokens.index(mask)
output = model(input['input_ids'],input['token_type_ids']).sq... | [
"transformers.AutoTokenizer.from_pretrained"
] | [((576, 624), 'transformers.AutoTokenizer.from_pretrained', 'AutoTokenizer.from_pretrained', (['"""bert-base-cased"""'], {}), "('bert-base-cased')\n", (605, 624), False, 'from transformers import AutoTokenizer\n')] |
#!/usr/bin/python
"""
BUGS:
1. make cprogramming and cprogs dir into a single dir name.
"""
import os
import sys
import time
LANGUAGE_PATH = '../../languages/'
NOW_FORMAT = '%d-%m-%Y %H:%M'
PROGRAM_NAME_TEMPLATE = 'PROGRAMNAME'
SOURCE_PATH = '../../source/'
TEMPLATE_FORMAT = '../{0}_template.rst'
INVALID_EXIT =... | [
"os.path.exists",
"os.path.join",
"os.path.dirname",
"os.path.basename",
"sys.exit",
"time.time"
] | [((354, 379), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (369, 379), False, 'import os\n'), ((1591, 1631), 'os.path.join', 'os.path.join', (['PROGRAM_DIR', 'template_path'], {}), '(PROGRAM_DIR, template_path)\n', (1603, 1631), False, 'import os\n'), ((2551, 2571), 'os.path.exists', 'os.pa... |
import unittest
from src.main.w3resource_problem_solved.string_exercise import *
class StringTestCase(unittest.TestCase):
def test_solution_1(self):
self.assertEqual(get_length("sample"), 6)
def test_solution_2(self):
self.assertEqual(
get_characters_frequency("samples"),
... | [
"unittest.main"
] | [((2406, 2421), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2419, 2421), False, 'import unittest\n')] |
import unittest
import json
import os,sys
parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0,parentdir)
from QueryBioLinkExtended import QueryBioLinkExtended as QBLEx
def get_from_test_file(key):
f = open('query_test_data.json', 'r')
test_data = f.read()
try:
... | [
"json.loads",
"sys.path.insert",
"QueryBioLinkExtended.QueryBioLinkExtended.get_phenotype_entity",
"QueryBioLinkExtended.QueryBioLinkExtended.get_disease_entity",
"QueryBioLinkExtended.QueryBioLinkExtended.get_anatomy_entity",
"QueryBioLinkExtended.QueryBioLinkExtended.get_bio_process_entity",
"unittest... | [((115, 144), 'sys.path.insert', 'sys.path.insert', (['(0)', 'parentdir'], {}), '(0, parentdir)\n', (130, 144), False, 'import os, sys\n'), ((1815, 1830), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1828, 1830), False, 'import unittest\n'), ((87, 112), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), ... |
import streamlit as st
import pandas as pd
import base64
from PIL import Image
from sklearn.metrics import confusion_matrix
from sklearn.metrics import accuracy_score, balanced_accuracy_score, precision_score, recall_score, matthews_corrcoef, f1_score, cohen_kappa_score
# Calculates performance metrics
def calc_metric... | [
"sklearn.metrics.balanced_accuracy_score",
"pandas.read_csv",
"streamlit.button",
"sklearn.metrics.precision_score",
"sklearn.metrics.recall_score",
"streamlit.info",
"streamlit.header",
"streamlit.title",
"streamlit.sidebar.header",
"streamlit.sidebar.markdown",
"pandas.DataFrame",
"sklearn.m... | [((2211, 2243), 'streamlit.sidebar.header', 'st.sidebar.header', (['"""Input panel"""'], {}), "('Input panel')\n", (2228, 2243), True, 'import streamlit as st\n'), ((2244, 2308), 'streamlit.sidebar.markdown', 'st.sidebar.markdown', (['"""\n[Example CSV file](./Y_example.csv)\n"""'], {}), '("""\n[Example CSV file](./Y_e... |
#! /usr/bin/env python3
'''
Created on 02-Dec-2020
@author: anita-1372
'''
import argparse
import libvirt
import json
if __name__ == '__main__':
conn = None
data = {}
try:
parser = argparse.ArgumentParser()
parser.add_argument('--host', help='kvm host to connect', n... | [
"libvirt.openReadOnly",
"json.dumps",
"argparse.ArgumentParser"
] | [((227, 252), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (250, 252), False, 'import argparse\n'), ((643, 674), 'libvirt.openReadOnly', 'libvirt.openReadOnly', (['args.host'], {}), '(args.host)\n', (663, 674), False, 'import libvirt\n'), ((3187, 3229), 'json.dumps', 'json.dumps', (['data'], ... |
import logging
import sys
from typing import Optional
from roger.Config import get_default_config
logger: Optional[logging.Logger] = None
def get_logger(name: str = 'roger') -> logging.Logger:
"""
Get an instance of logger.
Parameters
----------
name: str
The name of logger
Returns
... | [
"logging.getLogger",
"logging.Formatter",
"logging.StreamHandler",
"roger.Config.get_default_config"
] | [((456, 476), 'roger.Config.get_default_config', 'get_default_config', ([], {}), '()\n', (474, 476), False, 'from roger.Config import get_default_config\n'), ((494, 517), 'logging.getLogger', 'logging.getLogger', (['name'], {}), '(name)\n', (511, 517), False, 'import logging\n'), ((536, 569), 'logging.StreamHandler', '... |
from PIL import Image, ImageChops, ImageOps, ImageEnhance
class ScreenshotOperations:
"""Transform screenshot:
- changes contours
- changes contrast: pass float/int values
- changes brightness: pass float/int values
- invert image: invert image colors
"""
def __init__(self)... | [
"PIL.ImageEnhance.Brightness",
"PIL.ImageEnhance.Contrast",
"PIL.ImageOps.invert",
"PIL.ImageOps.grayscale"
] | [((394, 419), 'PIL.ImageOps.grayscale', 'ImageOps.grayscale', (['image'], {}), '(image)\n', (412, 419), False, 'from PIL import Image, ImageChops, ImageOps, ImageEnhance\n'), ((518, 546), 'PIL.ImageEnhance.Contrast', 'ImageEnhance.Contrast', (['image'], {}), '(image)\n', (539, 546), False, 'from PIL import Image, Image... |
# !/usr/bin/python3.6
# -*- coding: utf-8 -*-
# @author breeze
import threading
import argparse
import multiprocessing
import time
from multiprocessing import Queue, Pool
import face_recognition
import pandas as pd
import win32com.client
import cv2
import encoding_images
from app_utils import *
# This is a demo of ru... | [
"cv2.rectangle",
"numpy.array",
"cv2.destroyAllWindows",
"multiprocessing.log_to_stderr",
"argparse.ArgumentParser",
"threading.Lock",
"face_recognition.face_distance",
"pandas.DataFrame",
"time.localtime",
"cv2.waitKey",
"face_recognition.face_locations",
"cv2.putText",
"cv2.resize",
"mul... | [((1795, 1806), 'time.time', 'time.time', ([], {}), '()\n', (1804, 1806), False, 'import time\n'), ((1896, 1928), 'encoding_images.load_encodings', 'encoding_images.load_encodings', ([], {}), '()\n', (1926, 1928), False, 'import encoding_images\n'), ((2162, 2210), 'pandas.DataFrame', 'pd.DataFrame', (['known_face_names... |
#!/usr/bin/env python3
from temiReceiver import start_pack, working_dir, get_packs
import yaml
for pack in get_packs():
with open(f"{working_dir}/packs/{pack}.yml", "r") as f:
config = yaml.load(f)
if config["autostart"]:
start_pack(pack)
| [
"temiReceiver.get_packs",
"temiReceiver.start_pack",
"yaml.load"
] | [((110, 121), 'temiReceiver.get_packs', 'get_packs', ([], {}), '()\n', (119, 121), False, 'from temiReceiver import start_pack, working_dir, get_packs\n'), ((200, 212), 'yaml.load', 'yaml.load', (['f'], {}), '(f)\n', (209, 212), False, 'import yaml\n'), ((257, 273), 'temiReceiver.start_pack', 'start_pack', (['pack'], {... |
from flourish import Flourish
from flourish.generators.base import SourceGenerator
from flourish.source import SourceFile
import pytest
class TestFlourishPaths:
@classmethod
def setup_class(cls):
with pytest.warns(None) as warnings:
cls.flourish = Flourish('tests/source')
def test_ho... | [
"flourish.Flourish",
"pytest.raises",
"flourish.generators.base.SourceGenerator",
"pytest.warns"
] | [((220, 238), 'pytest.warns', 'pytest.warns', (['None'], {}), '(None)\n', (232, 238), False, 'import pytest\n'), ((279, 303), 'flourish.Flourish', 'Flourish', (['"""tests/source"""'], {}), "('tests/source')\n", (287, 303), False, 'from flourish import Flourish\n'), ((872, 895), 'pytest.raises', 'pytest.raises', (['KeyE... |
import numpy as np
from scipy.io import loadmat
from tqdm import tqdm
from cmfsapy.dimension.fsa import ml_dims
load_path = "../benchmark_data/manifold_data/"
save_path = "./"
datasets = [1, 2, 3, 4, 5, 6, 7, 9, 101, 102, 103, 104, 11, 12, 13]
D = [11, 5, 6, 8, 3, 36, 3, 20, 11, 18, 25, 71, 3, 20, 13]
intdims = [10... | [
"numpy.mean",
"cmfsapy.dimension.fsa.ml_dims",
"scipy.io.loadmat",
"numpy.zeros",
"numpy.save"
] | [((473, 490), 'numpy.zeros', 'np.zeros', (['[15, N]'], {}), '([15, N])\n', (481, 490), True, 'import numpy as np\n'), ((1081, 1131), 'numpy.save', 'np.save', (["(save_path + 'ml_benchmark_res')", 'result_ml'], {}), "(save_path + 'ml_benchmark_res', result_ml)\n", (1088, 1131), True, 'import numpy as np\n'), ((529, 540)... |
import pandas as pd
import sqlite3
from datetime import datetime, timedelta, date
from sklearn import preprocessing
import matplotlib.pyplot as plt
import seaborn as sns
import selectStock_datetime
def scaler(result_df:pd.DataFrame) -> pd.DataFrame:
"""
date를 제외한 나머지 컬럼 0과 1사이로 정규화하는 함수
result_d... | [
"sqlite3.connect",
"selectStock_datetime.list_datetime_to_unixtime",
"pandas.merge",
"pandas.concat",
"pandas.DataFrame",
"datetime.timedelta",
"sklearn.preprocessing.MinMaxScaler"
] | [((466, 494), 'sklearn.preprocessing.MinMaxScaler', 'preprocessing.MinMaxScaler', ([], {}), '()\n', (492, 494), False, 'from sklearn import preprocessing\n'), ((560, 609), 'pandas.DataFrame', 'pd.DataFrame', (['x_scaled'], {'columns': 'result_df.columns'}), '(x_scaled, columns=result_df.columns)\n', (572, 609), True, '... |
import numpy as np
import pymctdh.units as units
class QOperator(object):
"""Generic operator class for user defined potentials.
"""
def __init__(self, nmodes, term, pbfs=None):
"""
"""
self.nmodes = nmodes
self.term = term
self.term_setup()
self.op_setup()
... | [
"pymctdh.units.convert_to"
] | [((1013, 1049), 'pymctdh.units.convert_to', 'units.convert_to', (["self.term['units']"], {}), "(self.term['units'])\n", (1029, 1049), True, 'import pymctdh.units as units\n')] |
from cPickle import load as _load
from cPickle import loads as _loads
from cPickle import *
def load(f, **kwargs): return _load(f)
def loads(s, **kwargs): return _loads(s)
| [
"cPickle.loads",
"cPickle.load"
] | [((123, 131), 'cPickle.load', '_load', (['f'], {}), '(f)\n', (128, 131), True, 'from cPickle import load as _load\n'), ((163, 172), 'cPickle.loads', '_loads', (['s'], {}), '(s)\n', (169, 172), True, 'from cPickle import loads as _loads\n')] |
import pytest
import numpy as np
from ebbef2p.structure import Structure
def test_long_beam():
L = 2
P = 100
E = 1
I = 1
k = 10000
characteristic_coefficient = (k/4/E/I)**0.25
w_max = -P*characteristic_coefficient/2/k #analytical solution for max deflection
tolerance = 1e-6 #set ... | [
"pytest.approx",
"ebbef2p.structure.Structure"
] | [((353, 370), 'ebbef2p.structure.Structure', 'Structure', (['"""test"""'], {}), "('test')\n", (362, 370), False, 'from ebbef2p.structure import Structure\n'), ((785, 820), 'pytest.approx', 'pytest.approx', (['w_max'], {'rel': 'tolerance'}), '(w_max, rel=tolerance)\n', (798, 820), False, 'import pytest\n')] |
# Audio processing tools
#
# <NAME> 2020
#
# Some code modified from original MATLAB rastamat package.
#
import numpy as np
from scipy.signal import hanning, spectrogram, resample, hilbert, butter, filtfilt
from scipy.io import wavfile
# import spectools
# from .fbtools import fft2melmx
from matplotlib import pyplot... | [
"parselmouth.Sound",
"numpy.sqrt",
"scipy.signal.filtfilt",
"numpy.log",
"scipy.signal.hanning",
"numpy.arange",
"numpy.atleast_2d",
"numpy.dot",
"numpy.concatenate",
"numpy.min",
"numpy.round",
"numpy.abs",
"numpy.floor",
"scipy.io.wavfile.read",
"numpy.int",
"scipy.signal.butter",
... | [((969, 987), 'parselmouth.Sound', 'pm.Sound', (['fileName'], {}), '(fileName)\n', (977, 987), True, 'import parselmouth as pm\n'), ((2381, 2405), 'numpy.zeros', 'np.zeros', (['(nfilts, nfft)'], {}), '((nfilts, nfft))\n', (2389, 2405), True, 'import numpy as np\n'), ((2723, 2760), 'numpy.round', 'np.round', (['(binfrqs... |
import argparse
import logging
import sentencepiece as spm
import os
import statistics
"""
Encode corpus using a pretrained SPM model
python ./02b_encode_spm.py \
--corpus-path $LM_MODELS/../datasets/books/therepublic_pretokenized.txt \
--model-path ./spm.model \
--spm-extra-options bos:eos \
... | [
"logging.basicConfig",
"os.path.getsize",
"statistics.stdev",
"argparse.ArgumentParser",
"sentencepiece.SentencePieceProcessor",
"logging.info"
] | [((415, 454), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (434, 454), False, 'import logging\n'), ((476, 536), 'logging.info', 'logging.info', (['f"""Loading SPM model from {args[\'model_path\']}"""'], {}), '(f"Loading SPM model from {args[\'model_path\']}")\... |
import minimax_helpers
from gamestate import *
g = GameState()
print("Calling min_value on an empty board...")
v = minimax_helpers.min_value(g)
if v == -1:
print("min_value() returned the expected score!")
else:
print("Uh oh! min_value() did not return the expected score.")
"""
Output:
Calling min_value o... | [
"minimax_helpers.min_value"
] | [((118, 146), 'minimax_helpers.min_value', 'minimax_helpers.min_value', (['g'], {}), '(g)\n', (143, 146), False, 'import minimax_helpers\n')] |
import os
from shutil import copyfile
exps_dir = '/home/rgunti/data/Thesis/experiments'
target_dir = '/home/rgunti/data/Thesis/les_bkp'
for dir in os.listdir(exps_dir):
if not '6' in dir:
continue
copyfile(os.path.join(exps_dir, dir, 'les.pkl'), os.path.join(target_dir, dir + '.pkl'))
# break | [
"os.listdir",
"os.path.join"
] | [((148, 168), 'os.listdir', 'os.listdir', (['exps_dir'], {}), '(exps_dir)\n', (158, 168), False, 'import os\n'), ((223, 261), 'os.path.join', 'os.path.join', (['exps_dir', 'dir', '"""les.pkl"""'], {}), "(exps_dir, dir, 'les.pkl')\n", (235, 261), False, 'import os\n'), ((263, 301), 'os.path.join', 'os.path.join', (['tar... |
import pandas as pd
import numpy as np
import logging
logging.basicConfig(level=logging.DEBUG, format=' %(asctime)s - %(levelname)s - %(message)s')
def read_csv_chunks_simple(file, passed_df=None, join_how='inner', sep=',', chunksize=10000, dtype=None, index_col=None):
temp_df = pd.DataFrame()
if passed_df i... | [
"logging.basicConfig",
"pandas.Series",
"logging.debug",
"pandas.read_csv",
"pandas.DataFrame"
] | [((55, 153), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG', 'format': '""" %(asctime)s - %(levelname)s - %(message)s"""'}), "(level=logging.DEBUG, format=\n ' %(asctime)s - %(levelname)s - %(message)s')\n", (74, 153), False, 'import logging\n'), ((287, 301), 'pandas.DataFrame', 'pd.Dat... |
#!/usr/bin/env python
# coding: utf-8
###------NYC Events Historic : DATA CLEANING-----###
#Import Packages
import pandas as pd
from data_utility import readCsvFile
## Read CSV
getEvents = readCsvFile('../Data/NYC_Permitted_Event_Information_Historical.csv')
#Drop Columns
getRemEvents = getEvents.drop(['Event Stree... | [
"data_utility.readCsvFile"
] | [((192, 261), 'data_utility.readCsvFile', 'readCsvFile', (['"""../Data/NYC_Permitted_Event_Information_Historical.csv"""'], {}), "('../Data/NYC_Permitted_Event_Information_Historical.csv')\n", (203, 261), False, 'from data_utility import readCsvFile\n')] |
from state import called
def setup():
called.append('test_pak1.setup')
def teardown():
called.append('test_pak1.teardown')
def test_one_one():
called.append('test_pak1.test_one_one')
def test_one_two():
called.append('test_pak1.test_one_two')
| [
"state.called.append"
] | [((43, 75), 'state.called.append', 'called.append', (['"""test_pak1.setup"""'], {}), "('test_pak1.setup')\n", (56, 75), False, 'from state import called\n'), ((97, 132), 'state.called.append', 'called.append', (['"""test_pak1.teardown"""'], {}), "('test_pak1.teardown')\n", (110, 132), False, 'from state import called\n... |
# -*- coding: utf-8 -*-
"""
********************************
Reslib Config (reslib.config)
********************************
This module facilitates reading configurations from file, and provides some
defaults based on 'best practices' a la
`Cookiecutter Data Science <http://drivendata.github.io/cookiecutter-data-scie... | [
"logging.getLogger",
"os.path.exists",
"logging.debug",
"os.path.splitext",
"os.path.join",
"json.load",
"os.path.dirname",
"os.path.abspath"
] | [((4575, 4602), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (4592, 4602), False, 'import logging\n'), ((8124, 8152), 'os.path.abspath', 'os.path.abspath', (['config_name'], {}), '(config_name)\n', (8139, 8152), False, 'import os\n'), ((8161, 8210), 'logging.debug', 'logging.debug', (['... |
from demo import do_something
def test_do_something():
assert do_something("anything") == "Do anything"
| [
"demo.do_something"
] | [((68, 92), 'demo.do_something', 'do_something', (['"""anything"""'], {}), "('anything')\n", (80, 92), False, 'from demo import do_something\n')] |
from django import template
register = template.Library()
@register.filter
def get_responses(responses, pk):
return responses.response.filter(answer_to__pk = pk)
@register.filter
def is_response(responses, pk):
for i in responses:
if int(i.answer) == int(pk):
return True
return False
| [
"django.template.Library"
] | [((39, 57), 'django.template.Library', 'template.Library', ([], {}), '()\n', (55, 57), False, 'from django import template\n')] |
# -*- coding: utf-8 -*-
from django import forms
from django.test.testcases import TestCase
from accounts.mixins import PhoneFormMixin
class PhoneFormMixinTests(TestCase):
"""
Tests for PhoneFormMixin
"""
def test_clean_username(self):
"""
Check username as phone number
"""
... | [
"accounts.mixins.PhoneFormMixin"
] | [((334, 350), 'accounts.mixins.PhoneFormMixin', 'PhoneFormMixin', ([], {}), '()\n', (348, 350), False, 'from accounts.mixins import PhoneFormMixin\n')] |
import argparse
import gym
import numpy as np
import os
import torch
import BCQ
import BEAR
import utils
def train_PQL_BEAR(state_dim, action_dim, max_action, device, args):
print("Training BEARState\n")
log_name = f"{args.dataset}_{args.seed}"
# Initialize policy
policy = BEAR.BEAR(2, state_dim, acti... | [
"torch.manual_seed",
"os.path.exists",
"argparse.ArgumentParser",
"os.makedirs",
"utils.ReplayBuffer",
"numpy.array",
"torch.cuda.is_available",
"BEAR.BEAR",
"numpy.random.seed",
"BCQ.PQL_BCQ",
"numpy.percentile",
"gym.make",
"numpy.save"
] | [((292, 928), 'BEAR.BEAR', 'BEAR.BEAR', (['(2)', 'state_dim', 'action_dim', 'max_action'], {'delta_conf': '(0.1)', 'use_bootstrap': '(False)', 'version': 'args.version', 'lambda_': '(0.0)', 'threshold': '(0.05)', 'mode': 'args.mode', 'num_samples_match': 'args.num_samples_match', 'mmd_sigma': 'args.mmd_sigma', 'lagrang... |
# Copyright (c) 2017 <NAME>, All rights reserved.
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
... | [
"os.path.abspath",
"weakref.ref"
] | [((1191, 1217), 'weakref.ref', 'weakref.ref', (['location.conn'], {}), '(location.conn)\n', (1202, 1217), False, 'import weakref\n'), ((1913, 1938), 'os.path.abspath', 'os.path.abspath', (['proposed'], {}), '(proposed)\n', (1928, 1938), False, 'import os\n'), ((1983, 2003), 'os.path.abspath', 'os.path.abspath', (['cur'... |
# $Id$
import weakref as _weakref
import Queue as _Queue
import thread as _thread
import time as _time
import atexit as _atexit
_log_level = 0
_log_name = "/tmp/dbpool.log"
_log_file = None
_log_lock = _thread.allocate_lock()
apilevel = "2.0"
threadsafety = 2
_dbmod = None
_lock = _thread.allocate_lock()
_refs = {... | [
"time.strftime",
"thread.allocate_lock",
"time.time",
"Queue.Queue",
"atexit.register",
"weakref.ref"
] | [((205, 228), 'thread.allocate_lock', '_thread.allocate_lock', ([], {}), '()\n', (226, 228), True, 'import thread as _thread\n'), ((287, 310), 'thread.allocate_lock', '_thread.allocate_lock', ([], {}), '()\n', (308, 310), True, 'import thread as _thread\n'), ((7376, 7402), 'atexit.register', '_atexit.register', (['_exi... |
from numpy import sin, pi, cos
from objects.CSCG._3d.exact_solutions.status.Stokes.base import Stokes_Base
# noinspection PyAbstractClass
class Stokes_SinCos1(Stokes_Base):
"""
The sin cos test case 1.
"""
def __init__(self, es):
super(Stokes_SinCos1, self).__init__(es)
self._es_.sta... | [
"numpy.sin",
"numpy.cos"
] | [((573, 588), 'numpy.sin', 'sin', (['(2 * pi * z)'], {}), '(2 * pi * z)\n', (576, 588), False, 'from numpy import sin, pi, cos\n'), ((659, 674), 'numpy.sin', 'sin', (['(2 * pi * z)'], {}), '(2 * pi * z)\n', (662, 674), False, 'from numpy import sin, pi, cos\n'), ((743, 758), 'numpy.sin', 'sin', (['(2 * pi * z)'], {}), ... |
import streamlit as st
import pandas as pd
import plotly.express as px
from application_functions import pca_maker
st.set_page_config(layout="wide")
scatter_column, settings_column = st.beta_columns((4, 1))
scatter_column.title("Multi-Dimensional Analysis")
settings_column.title("Settings")
uploaded_file = settings... | [
"plotly.express.scatter",
"application_functions.pca_maker",
"pandas.read_csv",
"streamlit.beta_columns",
"streamlit.set_page_config"
] | [((116, 149), 'streamlit.set_page_config', 'st.set_page_config', ([], {'layout': '"""wide"""'}), "(layout='wide')\n", (134, 149), True, 'import streamlit as st\n'), ((184, 207), 'streamlit.beta_columns', 'st.beta_columns', (['(4, 1)'], {}), '((4, 1))\n', (199, 207), True, 'import streamlit as st\n'), ((406, 432), 'pand... |
from sqlalchemy import Column, Integer, String, Boolean, ForeignKey, JSON, Index
from sqlalchemy.orm import relationship
from . import base
from .column_constraint import ColumnConstraint
class MetaColumn(base):
__tablename__ = 'metacolumn'
id = Column(Integer, primary_key=True)
name = Column(String)
... | [
"sqlalchemy.orm.relationship",
"sqlalchemy.ForeignKey",
"sqlalchemy.Column",
"sqlalchemy.Index"
] | [((256, 289), 'sqlalchemy.Column', 'Column', (['Integer'], {'primary_key': '(True)'}), '(Integer, primary_key=True)\n', (262, 289), False, 'from sqlalchemy import Column, Integer, String, Boolean, ForeignKey, JSON, Index\n'), ((301, 315), 'sqlalchemy.Column', 'Column', (['String'], {}), '(String)\n', (307, 315), False,... |
import fiona as fio
def get_features_list(vector_file, feature_key_name):
"""Function creates feature list in the multipolygon based on the given unique property (feature_key_name)
such as ID.
:param vector_file: multipolygon file,
:param feature_key_name: unique key for features differentiation,
... | [
"fiona.open"
] | [((423, 449), 'fiona.open', 'fio.open', (['vector_file', '"""r"""'], {}), "(vector_file, 'r')\n", (431, 449), True, 'import fiona as fio\n')] |
#!/usr/bin/python
"""
Test that pairwise deletion mask (intersection) returns expected values
"""
from __future__ import print_function
from __future__ import division
from builtins import zip
from builtins import range
from past.utils import old_div
from pybraincompare.mr.datasets import get_pair_images, get_data_dir... | [
"pybraincompare.mr.datasets.get_data_directory",
"numpy.testing.assert_equal",
"numpy.unique",
"nibabel.load",
"numpy.where",
"numpy.floor",
"past.utils.old_div",
"builtins.zip",
"numpy.zeros",
"pybraincompare.compare.mrutils.make_binary_deletion_vector",
"builtins.range",
"numpy.isnan",
"py... | [((864, 884), 'pybraincompare.mr.datasets.get_data_directory', 'get_data_directory', ([], {}), '()\n', (882, 884), False, 'from pybraincompare.mr.datasets import get_data_directory\n'), ((966, 988), 'nibabel.load', 'nibabel.load', (['standard'], {}), '(standard)\n', (978, 988), False, 'import nibabel\n'), ((3557, 3592)... |
import numpy as np
from math import ceil
from scipy.stats import norm
from TaPR import compute_precision_recall
from data_loader import _count_anomaly_segments
n_thresholds = 1000
def _simulate_thresholds(rec_errors, n, verbose):
# maximum value of the anomaly score for all time steps in the test data
thres... | [
"numpy.mean",
"numpy.abs",
"data_loader._count_anomaly_segments",
"math.ceil",
"numpy.max",
"numpy.square",
"scipy.stats.norm.fit",
"numpy.array",
"TaPR.compute_precision_recall",
"numpy.min",
"numpy.ravel"
] | [((401, 419), 'numpy.min', 'np.min', (['rec_errors'], {}), '(rec_errors)\n', (407, 419), True, 'import numpy as np\n'), ((2459, 2498), 'data_loader._count_anomaly_segments', '_count_anomaly_segments', (['pred_anomalies'], {}), '(pred_anomalies)\n', (2482, 2498), False, 'from data_loader import _count_anomaly_segments\n... |
""" Various tests that a triangulation must past to be a valid toroidal 1+1d simplicial manifold."""
from itertools import combinations
from collections import defaultdict
from cdtea import simplicial
from cdtea.util.triangulation_utils import time_sep
# These tests assume 1+1d with toroidal topology
def twice_as_m... | [
"itertools.combinations",
"cdtea.util.triangulation_utils.time_sep",
"collections.defaultdict",
"cdtea.simplicial.simplex_key"
] | [((949, 971), 'itertools.combinations', 'combinations', (['edges', '(3)'], {}), '(edges, 3)\n', (961, 971), False, 'from itertools import combinations\n'), ((3515, 3531), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (3526, 3531), False, 'from collections import defaultdict\n'), ((3533, 3549), 'co... |
#!/usr/bin/env python3
import json
import os
import sys
from cryptojwt import as_unicode
from cryptojwt.jws.jws import factory
from fedservice.entity_statement.collect import verify_self_signed_signature
from fedservice.entity_statement.collect import Collector
from pygments import highlight
from pygments.formatters.... | [
"pygments.lexers.data.JsonLexer",
"argparse.ArgumentParser",
"fedservice.entity_statement.collect.verify_self_signed_signature",
"json.dumps",
"pygments.formatters.terminal.TerminalFormatter",
"fedservice.entity_statement.collect.Collector"
] | [((509, 534), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (532, 534), False, 'import argparse\n'), ((1121, 1140), 'fedservice.entity_statement.collect.Collector', 'Collector', ([], {}), '(**kwargs)\n', (1130, 1140), False, 'from fedservice.entity_statement.collect import Collector\n'), ((127... |
"""
Description for rttm files copied from kaldi chime6 receipt
`steps/segmentation/convert_utt2spk_and_segments_to_rttm.py`:
Each line in an rttm file contains the following values:
<type> <file-id> <channel-id> <begin-time> \
<duration> <ortho> <stype> <name> <conf>
<type> = SPEAKER for each... | [
"pathlib.Path",
"paderbox.array.interval.core.ArrayInterval",
"paderbox.array.interval.core.zeros",
"paderbox.utils.nested.deflatten",
"decimal.Decimal"
] | [((3759, 3784), 'paderbox.utils.nested.deflatten', 'deflatten', (['data'], {'sep': 'None'}), '(data, sep=None)\n', (3768, 3784), False, 'from paderbox.utils.nested import deflatten\n'), ((3363, 3388), 'decimal.Decimal', 'decimal.Decimal', (['parts[3]'], {}), '(parts[3])\n', (3378, 3388), False, 'import decimal\n'), ((3... |
# snake-game.py
from tkinter import *
from PIL import Image, ImageTk
import random
# pip install pillow
MOVE_INCREMENT = 20
MOVE_PER_SECOND = 10
GAME_SPEED = 1000 // MOVE_PER_SECOND
class Snake(Canvas):
def __init__(self):
super().__init__( width=600,height=620,background='black',highlightthickness... | [
"PIL.Image.open",
"random.randint",
"PIL.ImageTk.PhotoImage"
] | [((788, 819), 'PIL.Image.open', 'Image.open', (['"""./assets/body.png"""'], {}), "('./assets/body.png')\n", (798, 819), False, 'from PIL import Image, ImageTk\n'), ((841, 882), 'PIL.ImageTk.PhotoImage', 'ImageTk.PhotoImage', (['self.snake_body_image'], {}), '(self.snake_body_image)\n', (859, 882), False, 'from PIL impo... |
import unittest
from esdlvalidator.validation.tests import get_test_xml_string
from esdlvalidator.validation.validator_xsd import XsdValidator
class TestXsdValidator(unittest.TestCase):
"""Tests for the validator"""
@classmethod
def setUpClass(cls):
super(TestXsdValidator, cls).setUpC... | [
"esdlvalidator.validation.tests.get_test_xml_string",
"esdlvalidator.validation.validator_xsd.XsdValidator"
] | [((352, 373), 'esdlvalidator.validation.tests.get_test_xml_string', 'get_test_xml_string', ([], {}), '()\n', (371, 373), False, 'from esdlvalidator.validation.tests import get_test_xml_string\n'), ((434, 448), 'esdlvalidator.validation.validator_xsd.XsdValidator', 'XsdValidator', ([], {}), '()\n', (446, 448), False, 'f... |
# Generated by Django 4.0.1 on 2022-04-07 01:21
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('model_api', '0005_remove_order_datetimecreated_alter_order__id_and_more'),
]
operations = [
migrations.AddField(
model_name='ord... | [
"django.db.models.DateTimeField"
] | [((379, 429), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'auto_now_add': '(True)', 'null': '(True)'}), '(auto_now_add=True, null=True)\n', (399, 429), False, 'from django.db import migrations, models\n')] |
from django.contrib import admin
from .models import ApiCase, Api, Project, User
from .forms import ApiForm
class ProjectAdmin(admin.ModelAdmin):
list_display = ('projectid', 'name')
fields = ('projectid', 'name')
class ApiCaseAdmin(admin.ModelAdmin):
list_display = ('name', 'desc', 'content')
clas... | [
"django.contrib.admin.site.register"
] | [((740, 782), 'django.contrib.admin.site.register', 'admin.site.register', (['Project', 'ProjectAdmin'], {}), '(Project, ProjectAdmin)\n', (759, 782), False, 'from django.contrib import admin\n'), ((783, 825), 'django.contrib.admin.site.register', 'admin.site.register', (['ApiCase', 'ApiCaseAdmin'], {}), '(ApiCase, Api... |
# Copyright 2012-2017, Intel Corporation, All Rights Reserved.
#
# This software is supplied under the terms of a license
# agreement or nondisclosure agreement with Intel Corp.
# and may not be copied or disclosed except in accordance
# with the terms of that agreement.
#
# Author: <NAME>
"""
Module containing the... | [
"re.compile",
"shlex.split",
"copy.deepcopy",
"getopt.gnu_getopt",
"micp.common.custom_type"
] | [((15009, 15030), 'copy.deepcopy', 'copy.deepcopy', (['params'], {}), '(params)\n', (15022, 15030), False, 'import copy\n'), ((2048, 2073), 're.compile', 're.compile', (['"""^-[a-zA-Z]$"""'], {}), "('^-[a-zA-Z]$')\n", (2058, 2073), False, 'import re\n'), ((9050, 9069), 'shlex.split', 'shlex.split', (['params'], {}), '(... |
import os
import boto.swf
import json
import importlib
import time
import zipfile
import requests
import glob
import shutil
import activity
import boto.s3
from boto.s3.connection import S3Connection
import provider.ejp as ejplib
import provider.simpleDB as dblib
import provider.lax_provider as lax_provider
"""
Pac... | [
"time.strptime",
"activity.activity.__init__",
"provider.simpleDB.SimpleDB",
"zipfile.ZipFile",
"importlib.import_module",
"time.strftime",
"json.dumps",
"boto.s3.connection.S3Connection",
"time.gmtime",
"os.path.realpath",
"os.path.dirname",
"os.mkdir",
"shutil.copy",
"provider.lax_provid... | [((482, 560), 'activity.activity.__init__', 'activity.activity.__init__', (['self', 'settings', 'logger', 'conn', 'token', 'activity_task'], {}), '(self, settings, logger, conn, token, activity_task)\n', (508, 560), False, 'import activity\n'), ((1486, 1510), 'provider.simpleDB.SimpleDB', 'dblib.SimpleDB', (['settings'... |
import sys
import stockanalyzer
from stockanalyzer import crawler
from stockanalyzer import sentiment
from stockanalyzer import tweets
#Main method
def main():
#extract args and opts from cli
args = [a for a in sys.argv[1:] if not a.startswith("-")]
opts = [o for o in sys.argv[1:] if o.startswith("-")]
... | [
"stockanalyzer.tweets.get",
"stockanalyzer.crawler.extractData",
"stockanalyzer.tweets.analyse",
"stockanalyzer.crawler.get_feeds",
"stockanalyzer.sentiment.get_analysis",
"stockanalyzer.sentiment.plot_analysis"
] | [((953, 1005), 'stockanalyzer.crawler.get_feeds', 'crawler.get_feeds', (['ticker', 'stockanalyzer.NewsFeedUrl'], {}), '(ticker, stockanalyzer.NewsFeedUrl)\n', (970, 1005), False, 'from stockanalyzer import crawler\n'), ((1028, 1069), 'stockanalyzer.crawler.extractData', 'crawler.extractData', (['ticker', 'newsFeedhtml'... |
from sudoku import solve
puzzle = [[0,0,0,0,0,3,9,0,0],
[5,0,0,0,0,0,4,1,0],
[0,0,8,7,5,0,0,0,0],
[0,0,7,0,0,0,5,9,1],
[0,4,0,0,2,0,0,6,0],
[6,8,5,0,0,0,7,0,0],
[0,0,0,0,4,2,1,0,0],
[0,7,4,0,0,0,0,0,2],
[0,0,2,6,0,0,0,0,0]]
solution = sol... | [
"sudoku.solve"
] | [((317, 330), 'sudoku.solve', 'solve', (['puzzle'], {}), '(puzzle)\n', (322, 330), False, 'from sudoku import solve\n')] |
"""Bonus DAG that uses a few Keywords to perform ETL using python operators."""
from airflow import DAG
from airflow.operators.python_operator import PythonOperator
import pandas as pd
from datetime import datetime, timedelta
from io import StringIO
import requests
import boto3
"""Enter the API Key and AWS Credential... | [
"datetime.datetime",
"io.StringIO",
"requests.get",
"datetime.datetime.now",
"boto3.resource",
"airflow.DAG",
"pandas.DataFrame",
"datetime.timedelta"
] | [((4742, 4832), 'airflow.DAG', 'DAG', (['"""bonus_dag"""'], {'default_args': 'default_args', 'schedule_interval': '"""@daily"""', 'catchup': '(False)'}), "('bonus_dag', default_args=default_args, schedule_interval='@daily',\n catchup=False)\n", (4745, 4832), False, 'from airflow import DAG\n'), ((538, 556), 'datetim... |
# import gym
# env = gym.make('FrozenLake8x8-v0')
# env.reset()
# for _ in range(10):
# env.render()
# env.step(env.action_space.sample()) # take a random action
# env.close()
# from gym import envs
# import gym
# frozen = gym.make('FrozenLake8x8-v0')
# numEpisodes = 10
# for episode in range(numEpisodes... | [
"numpy.mean",
"matplotlib.pyplot.plot",
"gym.make",
"tqdm.trange",
"matplotlib.pyplot.show"
] | [((898, 926), 'gym.make', 'gym.make', (['"""FrozenLake8x8-v0"""'], {}), "('FrozenLake8x8-v0')\n", (906, 926), False, 'import gym\n'), ((937, 951), 'tqdm.trange', 'trange', (['ngames'], {}), '(ngames)\n', (943, 951), False, 'from tqdm import trange\n'), ((1269, 1289), 'matplotlib.pyplot.plot', 'plt.plot', (['percentage'... |
# --- built in ---
import os
import sys
import time
import math
import logging
import functools
# --- 3rd party ---
import numpy as np
import tensorflow as tf
# --- my module ---
__all__ = [
'ToyMLP',
'Energy',
'Trainer',
]
# --- primitives ---
class ToyMLP(tf.keras.Model):
def __init__(
se... | [
"numpy.sqrt",
"logging.debug",
"tensorflow.GradientTape",
"tensorflow.keras.layers.Dense",
"logging.info",
"tensorflow.math.sign",
"tensorflow.random.normal",
"numpy.mean",
"tensorflow.keras.Sequential",
"tensorflow.math.reduce_mean",
"tensorflow.convert_to_tensor",
"tensorflow.repeat",
"ten... | [((1432, 1459), 'tensorflow.keras.Sequential', 'tf.keras.Sequential', (['layers'], {}), '(layers)\n', (1451, 1459), True, 'import tensorflow as tf\n'), ((1507, 1553), 'tensorflow.keras.Input', 'tf.keras.Input', (['(input_dim,)'], {'dtype': 'tf.float32'}), '((input_dim,), dtype=tf.float32)\n', (1521, 1553), True, 'impor... |
import json,ssl
import urllib.request,urllib.parse, urllib.error
# Ignore SSL certificate errors
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
#Stroring the given parameters
api_key = 42
serviceurl = "http://py4e-data.dr-chuck.net/json?"
# sample_addr... | [
"ssl.create_default_context",
"json.loads"
] | [((112, 140), 'ssl.create_default_context', 'ssl.create_default_context', ([], {}), '()\n', (138, 140), False, 'import json, ssl\n'), ((938, 954), 'json.loads', 'json.loads', (['data'], {}), '(data)\n', (948, 954), False, 'import json, ssl\n')] |
from django.db import models
# Create your models here.
class Customer(models.Model):
name = models.CharField(max_length=200, null=True)
phone = models.CharField(max_length=200, null=True)
email = models.CharField(max_length=200, null=True)
date_created = models.DateTimeField(auto_now_add=True, null=True)
def ... | [
"django.db.models.DateTimeField",
"django.db.models.FloatField",
"django.db.models.CharField"
] | [((96, 139), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(200)', 'null': '(True)'}), '(max_length=200, null=True)\n', (112, 139), False, 'from django.db import models\n'), ((149, 192), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(200)', 'null': '(True)'}), '(max_len... |
import matplotlib.pyplot as plt
from jagrmi_mathplotlib.random_walk import RandomWalk
# Построение случайного блуждания и нанесение точек на диаграмму.
rw = RandomWalk(50000)
rw.fill_walk()
plt.figure(dpi=128,
figsize=(10, 6))
point_numbers = list(range(rw.num_points))
plt.scatter(rw.x_values,
... | [
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.scatter",
"jagrmi_mathplotlib.random_walk.RandomWalk"
] | [((158, 175), 'jagrmi_mathplotlib.random_walk.RandomWalk', 'RandomWalk', (['(50000)'], {}), '(50000)\n', (168, 175), False, 'from jagrmi_mathplotlib.random_walk import RandomWalk\n'), ((192, 228), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'dpi': '(128)', 'figsize': '(10, 6)'}), '(dpi=128, figsize=(10, 6))\n', (20... |
# Copyright (c) 2021 PAL Robotics S.L.
# Modified by <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | [
"launch.substitutions.LaunchConfiguration",
"ament_index_python.packages.get_package_share_directory",
"launch.LaunchDescription",
"yaml.safe_load",
"launch_pal.include_utils.include_launch_py_description",
"launch.actions.DeclareLaunchArgument"
] | [((1731, 1827), 'launch.actions.DeclareLaunchArgument', 'DeclareLaunchArgument', (['"""model_name"""'], {'default_value': '"""tiago"""', 'description': '"""Gazebo model name"""'}), "('model_name', default_value='tiago', description=\n 'Gazebo model name')\n", (1752, 1827), False, 'from launch.actions import DeclareL... |
from preprocessing.classes.base.PipelineComponent import PipelineComponent
from preprocessing.classes.utils.Params import Params
class Preprocessor(PipelineComponent):
def __init__(self, preprocessor_type: str):
super().__init__()
self._params = Params.load_preprocessor_params(preprocessor_type)
| [
"preprocessing.classes.utils.Params.Params.load_preprocessor_params"
] | [((269, 319), 'preprocessing.classes.utils.Params.Params.load_preprocessor_params', 'Params.load_preprocessor_params', (['preprocessor_type'], {}), '(preprocessor_type)\n', (300, 319), False, 'from preprocessing.classes.utils.Params import Params\n')] |
net = dict(
type='Segmentor',
)
backbone = dict(
type='ResNetWrapper',
resnet='resnet18',
pretrained=True,
replace_stride_with_dilation=[False, False, False],
out_conv=False,
)
featuremap_out_channel = 512
aggregator=None
griding_num = 200
num_classes = 4
heads = [
dict(type='LaneCls',
... | [
"math.pow"
] | [((700, 737), 'math.pow', 'math.pow', (['(1 - _iter / total_iter)', '(0.9)'], {}), '(1 - _iter / total_iter, 0.9)\n', (708, 737), False, 'import math\n')] |
import struct
def int8ToBytes(ints, n):
if n == 1:
return struct.pack("B", ints)
else:
return struct.pack("B"*n, *ints)
def bytesToint8(bytes, n):
if n == 1:
return struct.unpack("B", bytes)
else:
return struct.unpack("B"*n, bytes)
def int16ToBytes(ints, n):
if n == 1:
return struct.pack(">h", ints)
... | [
"struct.unpack",
"struct.pack"
] | [((62, 84), 'struct.pack', 'struct.pack', (['"""B"""', 'ints'], {}), "('B', ints)\n", (73, 84), False, 'import struct\n'), ((101, 128), 'struct.pack', 'struct.pack', (["('B' * n)", '*ints'], {}), "('B' * n, *ints)\n", (112, 128), False, 'import struct\n'), ((176, 201), 'struct.unpack', 'struct.unpack', (['"""B"""', 'by... |
"""
Test `sinethesizer.effects.stereo` module.
Author: <NAME>
"""
import numpy as np
import pytest
from sinethesizer.effects.stereo import apply_haas_effect, apply_panning
from sinethesizer.synth.core import Event
@pytest.mark.parametrize(
"sound, event, location, max_channel_delay, expected",
[
(... | [
"numpy.testing.assert_equal",
"sinethesizer.effects.stereo.apply_haas_effect",
"sinethesizer.effects.stereo.apply_panning",
"numpy.testing.assert_almost_equal",
"numpy.array",
"sinethesizer.synth.core.Event"
] | [((1812, 1872), 'sinethesizer.effects.stereo.apply_haas_effect', 'apply_haas_effect', (['sound', 'event', 'location', 'max_channel_delay'], {}), '(sound, event, location, max_channel_delay)\n', (1829, 1872), False, 'from sinethesizer.effects.stereo import apply_haas_effect, apply_panning\n'), ((1877, 1918), 'numpy.test... |
import pandas as pd
import numpy as np
from statsmodels.distributions.empirical_distribution import ECDF
from matplotlib import pyplot as plt
import json
from ai4netmon.Analysis.bias import bias_utils as bu
## data parameters
CDF_features = ['AS_rank_numberAsns', 'AS_rank_numberPrefixes', 'AS_rank_numberAddresses','AS... | [
"pandas.Series",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.gca",
"json.dump",
"matplotlib.pyplot.close",
"ai4netmon.Analysis... | [((1472, 1513), 'ai4netmon.Analysis.bias.bias_utils.get_features_dict_for_visualizations', 'bu.get_features_dict_for_visualizations', ([], {}), '()\n', (1511, 1513), True, 'from ai4netmon.Analysis.bias import bias_utils as bu\n'), ((2699, 2744), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (["data['xlabel']"], {'fontsize'... |
from tensorflow.keras.callbacks import ReduceLROnPlateau, ModelCheckpoint
from tensorflow.keras.mixed_precision import experimental as mixed_precision
from model.model_builder import base_model
from utils.dataset_generator import DatasetGenerator
import argparse
import time
import os
import tensorflow as tf
from model.... | [
"tensorflow.keras.mixed_precision.experimental.Policy",
"tensorflow.keras.callbacks.TensorBoard",
"os.makedirs",
"argparse.ArgumentParser",
"tensorflow.keras.callbacks.ReduceLROnPlateau",
"tensorflow.keras.callbacks.LearningRateScheduler",
"tensorflow.keras.Model",
"tensorflow.keras.optimizers.schedul... | [((431, 463), 'tensorflow.keras.backend.clear_session', 'tf.keras.backend.clear_session', ([], {}), '()\n', (461, 463), True, 'import tensorflow as tf\n'), ((474, 499), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (497, 499), False, 'import argparse\n'), ((2367, 2406), 'os.makedirs', 'os.make... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
This script just show the basic workflow to compute TF-IDF similarity matrix with Gensim
OUTPUT :
clemsos@miner $ python gensim_workflow.py
How to use Gensim to compute TF-IDF similarity step by step
----------
Let's start with a raw corpus :<type 'list'>
STEP 1 : Inde... | [
"gensim.corpora.Dictionary.load",
"gensim.similarities.MatrixSimilarity.load",
"gensim.corpora.Dictionary",
"gensim.corpora.MmCorpus.serialize",
"gensim.similarities.MatrixSimilarity",
"gensim.corpora.MmCorpus",
"time.time",
"gensim.models.TfidfModel"
] | [((1294, 1300), 'time.time', 'time', ([], {}), '()\n', (1298, 1300), False, 'from time import time\n'), ((1962, 1988), 'gensim.corpora.Dictionary', 'corpora.Dictionary', (['tweets'], {}), '(tweets)\n', (1980, 1988), False, 'from gensim import corpora, models, similarities\n'), ((2356, 2412), 'gensim.corpora.MmCorpus.se... |
import unittest
# Name: Euclidean Algorithm
# Runtime Analysis: O(N)
def gcd(num1: 'Integer', num2: 'Integer') -> 'Integer':
"""Returns the greatest common divisor of two integers"""
if(num2 == 0):
return num1
else:
remainder = num1 % num2
return gcd(num2, remainder)
# Function ... | [
"unittest.main"
] | [((1115, 1130), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1128, 1130), False, 'import unittest\n')] |
import enum
from typing import Any, Optional, Union, cast
import numpy as np
import scipy.special
import sklearn.metrics as skm
from . import util
from .util import TaskType
class PredictionType(enum.Enum):
LOGITS = 'logits'
PROBS = 'probs'
def calculate_rmse(
y_true: np.ndarray, y_pred: np.ndarray, s... | [
"sklearn.metrics.classification_report",
"sklearn.metrics.roc_auc_score",
"numpy.round",
"sklearn.metrics.mean_squared_error"
] | [((363, 401), 'sklearn.metrics.mean_squared_error', 'skm.mean_squared_error', (['y_true', 'y_pred'], {}), '(y_true, y_pred)\n', (385, 401), True, 'import sklearn.metrics as skm\n'), ((1165, 1180), 'numpy.round', 'np.round', (['probs'], {}), '(probs)\n', (1173, 1180), True, 'import numpy as np\n'), ((2053, 2112), 'sklea... |
from distutils.core import setup
import setuptools
with open('README.md', 'r', encoding='utf-8') as readme:
long_description = readme.read()
setup(
name='phone_email_verifier',
version='0.0.3',
description='Validation of the email or international or local telephone number',
long_description=long_... | [
"setuptools.find_packages"
] | [((522, 548), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (546, 548), False, 'import setuptools\n')] |
# Copyright 2021 Condenser Author 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 applicable law... | [
"logging.getLogger",
"os.makedirs",
"grad_cache.GradCache",
"os.path.join",
"torch.empty_like",
"torch.distributed.get_world_size",
"torch.cuda.amp.autocast",
"torch.no_grad",
"contextlib.nullcontext",
"torch.distributed.all_gather"
] | [((1023, 1050), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1040, 1050), False, 'import logging\n'), ((1236, 1274), 'os.makedirs', 'os.makedirs', (['output_dir'], {'exist_ok': '(True)'}), '(output_dir, exist_ok=True)\n', (1247, 1274), False, 'import os\n'), ((4440, 4471), 'torch.distr... |
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import cm
from matplotlib import colors
from matplotlib import patches
import os.path as path
from Synthesis.units import *
from tqdm import tqdm
from scipy.integrate import quad
def Power_Law(x, a, b):
return a * np.power(x, b)
def scatter_parame... | [
"numpy.log10",
"numpy.column_stack",
"numpy.array",
"matplotlib.colors.LogNorm",
"matplotlib.pyplot.style.use",
"numpy.max",
"matplotlib.pyplot.close",
"numpy.linspace",
"matplotlib.cm.ScalarMappable",
"numpy.min",
"numpy.abs",
"matplotlib.patches.Patch",
"matplotlib.colors.Normalize",
"ma... | [((758, 806), 'matplotlib.pyplot.rcParams.update', 'plt.rcParams.update', (["{'figure.autolayout': True}"], {}), "({'figure.autolayout': True})\n", (777, 806), True, 'import matplotlib.pyplot as plt\n'), ((811, 841), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""seaborn-paper"""'], {}), "('seaborn-paper')\n", (... |
import subprocess
from io import BytesIO
from tempfile import NamedTemporaryFile
from typing import List, Tuple, BinaryIO
from PyPDF4 import PdfFileReader, PdfFileWriter
from telegram import InlineKeyboardMarkup, InlineKeyboardButton
from .page_selection import PageSelection
def get_inline_keyboard(layout: List[Lis... | [
"PyPDF4.PdfFileWriter",
"telegram.InlineKeyboardButton",
"subprocess.run",
"io.BytesIO",
"PyPDF4.PdfFileReader"
] | [((1210, 1334), 'subprocess.run', 'subprocess.run', (["['unoconv', '--stdout', '-f', 'pdf', file.name]"], {'text': '(False)', 'capture_output': '(True)', 'timeout': '(60)', 'check': '(True)'}), "(['unoconv', '--stdout', '-f', 'pdf', file.name], text=False,\n capture_output=True, timeout=60, check=True)\n", (1224, 13... |
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import sys
import time
from gpu_tests import gpu_integration_test
from gpu_tests import path_util
data_path = os.path.join(
path_util.GetChro... | [
"gpu_tests.path_util.GetChromiumSrcDir",
"time.sleep",
"gpu_tests.gpu_integration_test.LoadAllTestsInModule"
] | [((303, 332), 'gpu_tests.path_util.GetChromiumSrcDir', 'path_util.GetChromiumSrcDir', ([], {}), '()\n', (330, 332), False, 'from gpu_tests import path_util\n'), ((1616, 1680), 'gpu_tests.gpu_integration_test.LoadAllTestsInModule', 'gpu_integration_test.LoadAllTestsInModule', (['sys.modules[__name__]'], {}), '(sys.modul... |
from django.db import models
# Create your models here.
class Plant(models.Model):
plant_name = models.CharField(max_length=256)
created_at = models.DateTimeField(auto_now_add=True)
update_at = models.DateTimeField(auto_now=True)
def __str__(self):
return self.plant_name | [
"django.db.models.DateTimeField",
"django.db.models.CharField"
] | [((103, 135), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(256)'}), '(max_length=256)\n', (119, 135), False, 'from django.db import models\n'), ((153, 192), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'auto_now_add': '(True)'}), '(auto_now_add=True)\n', (173, 192), False, ... |
from werkzeug.security import check_password_hash
from ..models.user_models import USERS
from instance.config import Config
from functools import wraps
from ..models import user_models
from flask import request, json, jsonify, make_response
import re, jwt
users = user_models.UserModels()
SECRET_KEY = Config.JWT_SECRE... | [
"re.match",
"functools.wraps",
"werkzeug.security.check_password_hash",
"flask.request.headers.get",
"flask.jsonify"
] | [((1479, 1490), 'functools.wraps', 'wraps', (['func'], {}), '(func)\n', (1484, 1490), False, 'from functools import wraps\n'), ((2640, 2651), 'functools.wraps', 'wraps', (['func'], {}), '(func)\n', (2645, 2651), False, 'from functools import wraps\n'), ((497, 520), 're.match', 're.match', (['exp', 'password'], {}), '(e... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import logging
import os
import requests
from quant_sdk import Client
import src.util
import src.helpers
from src import util
class CustomClient(Client):
def __init__(self, api_key, logger_wrapper: util.LoggerWrapper = None):
super().__init__(api_key)
... | [
"dotenv.find_dotenv",
"src.util.LoggerWrapper",
"os.getenv",
"requests.request",
"multiprocessing.pool.ThreadPool"
] | [((1336, 1359), 'multiprocessing.pool.ThreadPool', 'ThreadPool', ([], {'processes': '(5)'}), '(processes=5)\n', (1346, 1359), False, 'from multiprocessing.pool import ThreadPool\n'), ((704, 797), 'requests.request', 'requests.request', ([], {'method': 'method', 'url': 'url', 'params': 'params', 'data': 'data', 'headers... |
from golem import actions
description = 'Verify press_key action'
def test(data):
actions.navigate(data.env.url + 'elements/')
actions.press_key(('id', 'input-one'), 'NUMPAD2')
actions.verify_text_in_element(('id', 'input-one-input-result'), 'Welcome 2')
try:
actions.press_key(('id', 'input-on... | [
"golem.actions.navigate",
"golem.actions.verify_text_in_element",
"golem.actions.press_key"
] | [((88, 132), 'golem.actions.navigate', 'actions.navigate', (["(data.env.url + 'elements/')"], {}), "(data.env.url + 'elements/')\n", (104, 132), False, 'from golem import actions\n'), ((137, 186), 'golem.actions.press_key', 'actions.press_key', (["('id', 'input-one')", '"""NUMPAD2"""'], {}), "(('id', 'input-one'), 'NUM... |
from .vec3 import vec3
from .geometry import isnear
import numpy as np
class quat:
def __repr__(self):
return f'quat({self.w:.4f}, {self.x:.4f}, {self.y:.4f}, {self.z:.4f})'
def __init__(self, w, x, y, z):
self.w = w
self.x = x
self.y = y
self.z = z
@classmethod
... | [
"numpy.sin",
"numpy.cos"
] | [((471, 486), 'numpy.cos', 'np.cos', (['(a / 2.0)'], {}), '(a / 2.0)\n', (477, 486), True, 'import numpy as np\n'), ((425, 440), 'numpy.sin', 'np.sin', (['(a / 2.0)'], {}), '(a / 2.0)\n', (431, 440), True, 'import numpy as np\n')] |
import connexion
from flask import Response
from flask_cors import CORS
from src.config import DOCS_HTML_FILE_PATH
from src.db import sqlalchemy
connexion_app = connexion.FlaskApp(__name__, specification_dir='./openapi/')
flask_app = connexion_app.app
flask_app.config['JSON_AS_ASCII'] = False
connexion_app.add_api(... | [
"src.db.sqlalchemy.db_session.remove",
"flask.Response",
"connexion.FlaskApp",
"flask_cors.CORS"
] | [((165, 225), 'connexion.FlaskApp', 'connexion.FlaskApp', (['__name__'], {'specification_dir': '"""./openapi/"""'}), "(__name__, specification_dir='./openapi/')\n", (183, 225), False, 'import connexion\n'), ((371, 386), 'flask_cors.CORS', 'CORS', (['flask_app'], {}), '(flask_app)\n', (375, 386), False, 'from flask_cors... |
import threading
import time
import numpy as np
from brainflow.board_shim import BoardShim, BrainFlowInputParams, BoardIds
import pandas as pd
import tkinter as tk
from tkinter import filedialog
from queue import Queue
from threading import Thread
import streamlit as st
from streamlit.scriptrunner import add_script_run... | [
"brainflow.board_shim.BoardShim",
"pandas.DataFrame",
"brainflow.board_shim.BrainFlowInputParams",
"pandas.read_csv",
"numpy.floor",
"time.sleep",
"streamlit.title",
"numpy.append",
"streamlit.text",
"tkinter.Tk",
"streamlit.container",
"threading.Thread",
"queue.Queue",
"streamlit.empty",... | [((3451, 3465), 'streamlit.container', 'st.container', ([], {}), '()\n', (3463, 3465), True, 'import streamlit as st\n'), ((3480, 3494), 'streamlit.container', 'st.container', ([], {}), '()\n', (3492, 3494), True, 'import streamlit as st\n'), ((3510, 3524), 'streamlit.container', 'st.container', ([], {}), '()\n', (3522... |
from django.contrib import admin
from phylobook.projects.models import Project
from guardian.admin import GuardedModelAdmin
class ProjectAdmin(GuardedModelAdmin):
#prepopulated_fields = {"slug": ("title",)}
list_display = ('name',)
search_fields = ('name',)
ordering = ('name',)
admin.site.register(... | [
"django.contrib.admin.site.register"
] | [((300, 342), 'django.contrib.admin.site.register', 'admin.site.register', (['Project', 'ProjectAdmin'], {}), '(Project, ProjectAdmin)\n', (319, 342), False, 'from django.contrib import admin\n')] |
# coding: utf-8
# In[1]:
# Take in list of elements and obtain Magpie elemental properties from Citrination
# Requires the elements.csv file from this GitHub repository
# Authorship: <NAME> and <NAME>
# Date: 2017-05-24
import numpy as np
import pandas as pd
from citrination_client import *
import time
client = Cit... | [
"pandas.DataFrame",
"pandas.merge",
"pandas.DataFrame.from_dict",
"pandas.read_csv"
] | [((380, 415), 'pandas.read_csv', 'pd.read_csv', (['"""../data/elements.csv"""'], {}), "('../data/elements.csv')\n", (391, 415), True, 'import pandas as pd\n'), ((1038, 1052), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (1050, 1052), True, 'import pandas as pd\n'), ((1264, 1312), 'pandas.merge', 'pd.merge', ([... |
from config.celery_app import app
@app.task
def process_export_database():
from wab.core.export_database.models import ExportData
from wab.utils.constant import MONGO
from wab.utils.db_manager import MongoDBManager
import json
from bson.json_util import dumps
from django.conf import settings
... | [
"wab.core.export_database.models.ExportData.objects.filter",
"wab.core.notifications.services.notifications_service.NotificationsService",
"io.open",
"wab.utils.db_manager.MongoDBManager",
"datetime.datetime.now",
"xlsxwriter.Workbook"
] | [((571, 620), 'wab.core.export_database.models.ExportData.objects.filter', 'ExportData.objects.filter', ([], {'status': 'ExportData.INIT'}), '(status=ExportData.INIT)\n', (596, 620), False, 'from wab.core.export_database.models import ExportData\n'), ((773, 825), 'wab.core.export_database.models.ExportData.objects.filt... |
#!/usr/bin/env python
from __future__ import print_function
from soma import aims
import numpy as np
import glob
import os
import json
def get_scale(img, divisions=21, x_shift=-5):
y = [img.getSize()[1] * ((float(i) + 0.5) / divisions)
for i in range(divisions)]
x = x_shift
if x < 0:
x ... | [
"os.path.exists",
"soma.aims.write",
"numpy.sqrt",
"soma.aims.Converter_Volume_RGB_Volume_HSV",
"numpy.asarray",
"soma.aims.Converter_Volume_FLOAT_Volume_U16",
"numpy.sum",
"os.mkdir",
"soma.aims.read",
"numpy.argmin",
"glob.glob"
] | [((3336, 3367), 'glob.glob', 'glob.glob', (['"""altitude/raw/*.jpg"""'], {}), "('altitude/raw/*.jpg')\n", (3345, 3367), False, 'import glob\n'), ((3376, 3409), 'os.path.exists', 'os.path.exists', (['"""altitude/intens"""'], {}), "('altitude/intens')\n", (3390, 3409), False, 'import os\n'), ((3415, 3442), 'os.mkdir', 'o... |
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework.permissions import IsAuthenticated
from rest_framework.viewsets import ModelViewSet
from budgetme.apps.types.filters import TransactionCategoryFilter
from budgetme.apps.types.models import TransactionCategory, Budget
from budgetme.apps.t... | [
"budgetme.apps.types.models.Budget.objects.select_related",
"budgetme.apps.types.models.TransactionCategory.objects.select_related"
] | [((538, 575), 'budgetme.apps.types.models.Budget.objects.select_related', 'Budget.objects.select_related', (['"""user"""'], {}), "('user')\n", (567, 575), False, 'from budgetme.apps.types.models import TransactionCategory, Budget\n'), ((937, 987), 'budgetme.apps.types.models.TransactionCategory.objects.select_related',... |
def getGrid(data):
return [[int(n) for n in row] for row in data.splitlines()]
def lowPoints(grid):
M, N = len(grid), len(grid[0])
for y, row in enumerate(grid):
for x, n in enumerate(row):
right = grid[y][x + 1] if x != N - 1 else 9
up = grid[y - 1][x] if y != 0 else 9
... | [
"aocd.get_data"
] | [((1475, 1501), 'aocd.get_data', 'get_data', ([], {'year': '(2021)', 'day': '(9)'}), '(year=2021, day=9)\n', (1483, 1501), False, 'from aocd import get_data\n')] |
import vrealizeautomation.vra as vrealize_automation
import appvars
# Create an instance of the vraauthentication class.
my_vra = vrealize_automation.vraauthentication(appvars.vra_prod_fqdn,
appvars.vra_prod_tenant_name,
app... | [
"vrealizeautomation.vra.vraauthentication"
] | [((131, 274), 'vrealizeautomation.vra.vraauthentication', 'vrealize_automation.vraauthentication', (['appvars.vra_prod_fqdn', 'appvars.vra_prod_tenant_name', 'appvars.vra_prod_admin', 'appvars.vra_prod_passw'], {}), '(appvars.vra_prod_fqdn, appvars.\n vra_prod_tenant_name, appvars.vra_prod_admin, appvars.vra_prod_pa... |