code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import asyncio
import logging
import struct
from dataclasses import dataclass
from typing import AsyncIterable, Optional
from tickit.adapters.composed import ComposedAdapter
from tickit.adapters.interpreters.command import CommandInterpreter, RegexCommand
from tickit.adapters.servers.tcp import TcpServer
from tickit.c... | [
"tickit.adapters.interpreters.command.CommandInterpreter",
"asyncio.sleep",
"tickit.utils.byte_format.ByteFormat",
"tickit.adapters.interpreters.command.RegexCommand",
"struct.unpack",
"struct.pack",
"tickit.adapters.servers.tcp.TcpServer",
"tickit.utils.compat.typing_compat.TypedDict",
"logging.get... | [((695, 722), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (712, 722), False, 'import logging\n'), ((901, 924), 'tickit.utils.compat.typing_compat.TypedDict', 'TypedDict', (['"""Inputs"""', '{}'], {}), "('Inputs', {})\n", (910, 924), False, 'from tickit.utils.compat.typing_compat import... |
from pathlib import Path
import time
import superannotate as sa
sa.init(Path.home() / ".superannotate" / "config.json")
TEMP_PROJECT_NAME = "test_recursive"
def test_nonrecursive_annotations_folder(tmpdir):
tmpdir = Path(tmpdir)
projects_found = sa.search_projects(
TEMP_PROJECT_NAME + "0", return_m... | [
"pathlib.Path.home",
"superannotate.create_project",
"superannotate.prepare_export",
"superannotate.search_projects",
"superannotate.download_export",
"superannotate.create_annotation_classes_from_classes_json",
"superannotate.download_image_preannotations",
"time.sleep",
"pathlib.Path",
"superann... | [((225, 237), 'pathlib.Path', 'Path', (['tmpdir'], {}), '(tmpdir)\n', (229, 237), False, 'from pathlib import Path\n'), ((259, 324), 'superannotate.search_projects', 'sa.search_projects', (["(TEMP_PROJECT_NAME + '0')"], {'return_metadata': '(True)'}), "(TEMP_PROJECT_NAME + '0', return_metadata=True)\n", (277, 324), Tru... |
import os
from typing import Tuple
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy.exc import IntegrityError
from fileshare import app
from fileshare.shared.database.common_query import CommonQuery
from fileshare.shared.database.database import db
from fileshare.shared.database.Directory import Directory
from... | [
"fileshare.shared.database.Directory.Directory",
"fileshare.shared.libs.file_index.index_file",
"fileshare.app.logger.debug",
"fileshare.shared.database.common_query.CommonQuery.query_all_by_absolute_path",
"fileshare.shared.database.database.db.get_engine",
"os.path.exists",
"fileshare.shared.database.... | [((759, 770), 'fileshare.shared.database.Directory.Directory', 'Directory', ([], {}), '()\n', (768, 770), False, 'from fileshare.shared.database.Directory import Directory\n'), ((1777, 1783), 'fileshare.shared.database.File.File', 'File', ([], {}), '()\n', (1781, 1783), False, 'from fileshare.shared.database.File impor... |
import cv2
# multiplying the image by a scalar will increase the intensity - > scalling
# reading the image
image1 = cv2.imread(r'.\img\eyes.jpg',0)
image1 = cv2.resize(image1,dsize=(image1.shape[1]+200,image1.shape[0]+200))
image2 = cv2.imread(r'.\img\win.jpg',0)
image2 = cv2.resize(image2,dsize=(image1.shape[1],... | [
"cv2.waitKey",
"cv2.destroyAllWindows",
"cv2.addWeighted",
"cv2.imread",
"cv2.imshow",
"cv2.resize"
] | [((122, 155), 'cv2.imread', 'cv2.imread', (['""".\\\\img\\\\eyes.jpg"""', '(0)'], {}), "('.\\\\img\\\\eyes.jpg', 0)\n", (132, 155), False, 'import cv2\n'), ((163, 235), 'cv2.resize', 'cv2.resize', (['image1'], {'dsize': '(image1.shape[1] + 200, image1.shape[0] + 200)'}), '(image1, dsize=(image1.shape[1] + 200, image1.s... |
from rhum.rhumlogging import get_logger
from rhum.drivers.enocean.messages.message import EnOceanMessage
from rhum.drivers.enocean.constants import PacketType, RadioERP1Type
class RadioERP1Message(EnOceanMessage):
_logger = get_logger('rhum.drivers.enocean.messages.RadioERP1Message')
de... | [
"rhum.rhumlogging.get_logger",
"rhum.drivers.enocean.constants.RadioERP1Type"
] | [((240, 300), 'rhum.rhumlogging.get_logger', 'get_logger', (['"""rhum.drivers.enocean.messages.RadioERP1Message"""'], {}), "('rhum.drivers.enocean.messages.RadioERP1Message')\n", (250, 300), False, 'from rhum.rhumlogging import get_logger\n'), ((1108, 1134), 'rhum.drivers.enocean.constants.RadioERP1Type', 'RadioERP1Typ... |
import os
def get_filename_ext(filepath):
"""Return a basename from a filepath"""
basename = os.path.basename(filepath)
return os.path.splitext(basename)
def upload_file_path(instance, filename):
"""Return upload path"""
name, ext = get_filename_ext(filename)
new_filename = hash(name)
ti... | [
"os.path.splitext",
"os.path.basename"
] | [((103, 129), 'os.path.basename', 'os.path.basename', (['filepath'], {}), '(filepath)\n', (119, 129), False, 'import os\n'), ((141, 167), 'os.path.splitext', 'os.path.splitext', (['basename'], {}), '(basename)\n', (157, 167), False, 'import os\n')] |
from django.shortcuts import render, get_object_or_404
from django.http import HttpResponseRedirect
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
#from django.contrib import messages
from apps.apies.models import Api
from apps.apies.forms import ApiForm
def cl... | [
"django.core.urlresolvers.reverse",
"apps.apies.models.Api.objects.filter",
"django.shortcuts.get_object_or_404",
"apps.apies.forms.ApiForm",
"django.shortcuts.render"
] | [((510, 558), 'apps.apies.forms.ApiForm', 'ApiForm', (['(request.POST or None)'], {'user': 'request.user'}), '(request.POST or None, user=request.user)\n', (517, 558), False, 'from apps.apies.forms import ApiForm\n'), ((705, 793), 'apps.apies.models.Api.objects.filter', 'Api.objects.filter', ([], {'user': 'request.user... |
import mysql.connector
import mycursor
from test import myfunc
mydb = mysql.connector.connect(
host = "localhost",
user = "root",
passwd = "<PASSWORD>",
database = "testdb"
)
if __name__ == '__main__':
x = myfunc()
mycursor.execute("SELECT email_id FROM license WHERE vehicle_number =... | [
"test.myfunc",
"mycursor.execute"
] | [((237, 245), 'test.myfunc', 'myfunc', ([], {}), '()\n', (243, 245), False, 'from test import myfunc\n'), ((251, 326), 'mycursor.execute', 'mycursor.execute', (['"""SELECT email_id FROM license WHERE vehicle_number = {x}"""'], {}), "('SELECT email_id FROM license WHERE vehicle_number = {x}')\n", (267, 326), False, 'imp... |
import os
import getopt
import sys
import time
import unittest
import argparse
import urllib3
import shutil
import pystache
import logging
from waiting import wait
import swagger_client
from swagger_client.rest import ApiException
from swagger_client.api.external_api import ExternalApi
from swagger_client.api_client i... | [
"argparse.ArgumentParser",
"os.path.isfile",
"os.path.join",
"os.chdir",
"argparse.ArgumentTypeError",
"os.path.abspath",
"os.access",
"os.system",
"time.sleep",
"swagger_client.api_client.ApiClient",
"os.listdir",
"sys.exit",
"os.makedirs",
"os.getcwd",
"os.path.isdir",
"swagger_clien... | [((3217, 3255), 'os.path.join', 'os.path.join', (['temp_dir', '"""bin"""', '"""epoch"""'], {}), "(temp_dir, 'bin', 'epoch')\n", (3229, 3255), False, 'import os\n'), ((3349, 3404), 'os.system', 'os.system', (["('tar xC ' + temp_dir + ' -f ' + tarball_name)"], {}), "('tar xC ' + temp_dir + ' -f ' + tarball_name)\n", (335... |
from functools import wraps
def inject_organization():
def decorator(f):
@wraps(f)
async def decorated_function(request, *args, **kwargs):
orga_uuid = request.headers.get("x-orga")
response = await f(request, orga=orga_uuid, *args, **kwargs)
return response
... | [
"functools.wraps"
] | [((88, 96), 'functools.wraps', 'wraps', (['f'], {}), '(f)\n', (93, 96), False, 'from functools import wraps\n')] |
from Create_Triangle import create_triangle
create_triangle(5) | [
"Create_Triangle.create_triangle"
] | [((47, 65), 'Create_Triangle.create_triangle', 'create_triangle', (['(5)'], {}), '(5)\n', (62, 65), False, 'from Create_Triangle import create_triangle\n')] |
"""
Bonfire Core Cache tag RAM
(c) 2019,2020 The Bonfire Project
License: See LICENSE
"""
from __future__ import print_function
from myhdl import Signal,modbv,block,always, instances, now
#from rtl.cache.cache_way import TagDataBundle
@block
def tag_ram_instance(data_in,data_out,we,adr,clock,reset,config):
"... | [
"myhdl.instances",
"myhdl.always",
"myhdl.modbv"
] | [((820, 841), 'myhdl.always', 'always', (['clock.posedge'], {}), '(clock.posedge)\n', (826, 841), False, 'from myhdl import Signal, modbv, block, always, instances, now\n'), ((1143, 1154), 'myhdl.instances', 'instances', ([], {}), '()\n', (1152, 1154), False, 'from myhdl import Signal, modbv, block, always, instances, ... |
import torch
import langpractice as lp
from langpractice.utils.training import run_training
import torch.multiprocessing as mp
import sys
"""
Just argue the path to a model folder that you would like to resume
the training of
$ python3 resume.py /path/to/model/folder/
"""
torch.autograd.set_detect_anomaly(True)
if ... | [
"torch.multiprocessing.set_start_method",
"langpractice.utils.save_io.get_hyps",
"torch.autograd.set_detect_anomaly",
"langpractice.training.train"
] | [((276, 315), 'torch.autograd.set_detect_anomaly', 'torch.autograd.set_detect_anomaly', (['(True)'], {}), '(True)\n', (309, 315), False, 'import torch\n'), ((348, 381), 'torch.multiprocessing.set_start_method', 'mp.set_start_method', (['"""forkserver"""'], {}), "('forkserver')\n", (367, 381), True, 'import torch.multip... |
from os import path
import setuptools
from setuptools.config import read_configuration
BASE_PATH = path.dirname(__file__)
CFG_PATH = path.join(BASE_PATH, "setup.cfg")
config = read_configuration(CFG_PATH)
version = config["metadata"]["version"]
setuptools.setup(
name="dbnd-docker",
package_dir={"": "src"}... | [
"os.path.dirname",
"os.path.join",
"setuptools.setup",
"setuptools.config.read_configuration"
] | [((103, 125), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file__)\n', (115, 125), False, 'from os import path\n'), ((137, 170), 'os.path.join', 'path.join', (['BASE_PATH', '"""setup.cfg"""'], {}), "(BASE_PATH, 'setup.cfg')\n", (146, 170), False, 'from os import path\n'), ((181, 209), 'setuptools.config.r... |
import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="local-geocode", # Replace with your own username
version="0.0.1",
author="<NAME>",
author_email="<EMAIL>",
description="Simple library for efficient geocoding without mak... | [
"setuptools.find_packages"
] | [((492, 518), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (516, 518), False, 'import setuptools\n')] |
# Generated by Django 3.1.2 on 2020-10-27 06:00
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('hood', '0003_remove_business_description'),
]
operations = [
migrations.AddField(
model_name='business',
name='descr... | [
"django.db.models.TextField"
] | [((347, 375), 'django.db.models.TextField', 'models.TextField', ([], {'blank': '(True)'}), '(blank=True)\n', (363, 375), False, 'from django.db import migrations, models\n')] |
# And / Or
import sqlite3
conn = sqlite3.connect('customer.db')
c = conn.cursor()
c.execute("SELECT rowid, * FROM customers WHERE last LIKE 'B%' AND rowid=1")
c.execute("SELECT rowid, * FROM customers WHERE last LIKE 'B%' OR rowid=1")
items = c.fetchall()
for item in items:
print(item)
conn.commit()
conn.clo... | [
"sqlite3.connect"
] | [((34, 64), 'sqlite3.connect', 'sqlite3.connect', (['"""customer.db"""'], {}), "('customer.db')\n", (49, 64), False, 'import sqlite3\n')] |
#!/usr/bin/env python3.4
import io
from tests.lawful import test
import judged
from judged import tokenizer
from judged import parser
from judged import worlds
class TestKB():
""" class stores a temporary Knowledge Base just for testing """
def __init__(self, labels):
self.labels = labels
def ... | [
"io.StringIO",
"judged.tokenizer.tokenize",
"judged.worlds.disjunct",
"judged.parser.parse_sentence",
"judged.parser.parse_descriptive_label",
"judged.worlds.conjunct"
] | [((744, 763), 'io.StringIO', 'io.StringIO', (['string'], {}), '(string)\n', (755, 763), False, 'import io\n'), ((826, 851), 'judged.parser.parse_sentence', 'parser.parse_sentence', (['ts'], {}), '(ts)\n', (847, 851), False, 'from judged import parser\n'), ((885, 904), 'io.StringIO', 'io.StringIO', (['string'], {}), '(s... |
import sys
import os
import pprint
import math
import numpy as np
import PIL
import torch
from torch import nn
import torchvision
import torchvision.transforms as transforms
import torchvision.utils as vutils
sys.path.append('..')
import data_utils
from data_utils import KITTIDerot
import fl... | [
"sys.path.append",
"os.mkdir",
"os.path.isdir",
"os.getcwd",
"torchvision.transforms.ToPILImage",
"flow_utils.ToRGBImage",
"torchvision.transforms.ToTensor",
"flow_utils.ToFlow",
"data_utils.KITTIDerot",
"os.path.join",
"torchvision.transforms.Resize"
] | [((230, 251), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (245, 251), False, 'import sys\n'), ((792, 803), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (801, 803), False, 'import os\n'), ((825, 849), 'os.path.isdir', 'os.path.isdir', (['image_dir'], {}), '(image_dir)\n', (838, 849), False, 'imp... |
# -*- coding: utf-8 -*-
"""
seasonedParser.__main__
Starting seasonedParser as a module.
"""
if __name__ == "__main__":
from cli import main
main()
| [
"cli.main"
] | [((160, 166), 'cli.main', 'main', ([], {}), '()\n', (164, 166), False, 'from cli import main\n')] |
import numba.unittest_support as unittest
from numba import types, typing, compiler, utils
from numba.targets.cpu import CPUContext
class Car(object):
def __init__(self, value):
self.value = value
def move(self, x):
self.value += x
def use_car_value(car):
return car.value
def use_car_... | [
"numba.utils.benchmark",
"numba.unittest_support.main",
"numba.compiler.compile_extra",
"numba.typing.new_method",
"numba.compiler.Flags",
"numba.typing.Context",
"numba.types.Object",
"numba.targets.cpu.CPUContext"
] | [((2619, 2634), 'numba.unittest_support.main', 'unittest.main', ([], {}), '()\n', (2632, 2634), True, 'import numba.unittest_support as unittest\n'), ((786, 802), 'numba.typing.Context', 'typing.Context', ([], {}), '()\n', (800, 802), False, 'from numba import types, typing, compiler, utils\n'), ((867, 884), 'numba.tar... |
from datetime import datetime
from rest_framework import viewsets, status
from rest_framework.response import Response
from rest_framework.permissions import IsAuthenticated
from album.models import Album, Picture
from album.serializers import AlbumSerializer, PictureSerializer
from album.pagination import LimitOffse... | [
"album.models.Picture.objects.all",
"rest_framework.response.Response",
"album.models.Album.objects.all"
] | [((963, 982), 'album.models.Album.objects.all', 'Album.objects.all', ([], {}), '()\n', (980, 982), False, 'from album.models import Album, Picture\n'), ((1197, 1218), 'album.models.Picture.objects.all', 'Picture.objects.all', ([], {}), '()\n', (1216, 1218), False, 'from album.models import Album, Picture\n'), ((776, 85... |
from application import db
from sqlalchemy.sql import text
import datetime
class Sample(db.Model):
id = db.Column(db.Integer, primary_key=True)
original_id = db.Column(
db.Integer, db.ForeignKey('song.id'), nullable=False)
used_id = db.Column(db.Integer, db.ForeignKey('song.id'), nullable=False)
... | [
"sqlalchemy.sql.text",
"application.db.func.current_timestamp",
"application.db.ForeignKey",
"application.db.Column",
"application.db.DateTime",
"datetime.datetime.strptime",
"application.db.engine.execute"
] | [((110, 149), 'application.db.Column', 'db.Column', (['db.Integer'], {'primary_key': '(True)'}), '(db.Integer, primary_key=True)\n', (119, 149), False, 'from application import db\n'), ((342, 376), 'application.db.Column', 'db.Column', (['db.Time'], {'nullable': '(False)'}), '(db.Time, nullable=False)\n', (351, 376), F... |
# -*- coding: utf-8 -*-
"""
视频评论爬取脚本
参数为某视频的BV号
"""
__author__ = 'OtakuNio'
import time
import pandas as pd
from sqlalchemy import create_engine
from get_response_with_proxy_ip import get_response, get_proxy_ip
def video_reply_main(bid):
print("video_reply")
my_url1 = 'http://api.bilibili.com/... | [
"get_response_with_proxy_ip.get_proxy_ip",
"time.localtime",
"get_response_with_proxy_ip.get_response",
"time.sleep"
] | [((999, 1014), 'get_response_with_proxy_ip.get_proxy_ip', 'get_proxy_ip', (['(2)'], {}), '(2)\n', (1011, 1014), False, 'from get_response_with_proxy_ip import get_response, get_proxy_ip\n'), ((3262, 3285), 'get_response_with_proxy_ip.get_response', 'get_response', (['reply_url'], {}), '(reply_url)\n', (3274, 3285), Fal... |
from tensorflow.keras import layers
import tensorflow as tf
class DCNN(tf.keras.Model):
def __init__(self,
vocab_size,
emb_dim=128,
nb_filters=50,
FFN_units=512,
nb_classes=2,
dropout_rate=0.1,
t... | [
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Conv1D",
"tensorflow.concat",
"tensorflow.keras.layers.GlobalMaxPool1D",
"tensorflow.keras.layers.Embedding"
] | [((438, 475), 'tensorflow.keras.layers.Embedding', 'layers.Embedding', (['vocab_size', 'emb_dim'], {}), '(vocab_size, emb_dim)\n', (454, 475), False, 'from tensorflow.keras import layers\n'), ((540, 628), 'tensorflow.keras.layers.Conv1D', 'layers.Conv1D', ([], {'filters': 'nb_filters', 'kernel_size': '(2)', 'padding': ... |
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('cls/', include('cls.urls')),
]
| [
"django.urls.path",
"django.urls.include"
] | [((93, 124), 'django.urls.path', 'path', (['"""admin/"""', 'admin.site.urls'], {}), "('admin/', admin.site.urls)\n", (97, 124), False, 'from django.urls import path, include\n'), ((143, 162), 'django.urls.include', 'include', (['"""cls.urls"""'], {}), "('cls.urls')\n", (150, 162), False, 'from django.urls import path, ... |
# Copyright 2019 AUI, Inc. Washington DC, USA
#
# 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 ... | [
"xarray.merge",
"numpy.unique",
"xarray.Dataset",
"xarray.concat"
] | [((4658, 4703), 'xarray.concat', 'xarray.concat', (['ndss'], {'dim': '"""time"""', 'coords': '"""all"""'}), "(ndss, dim='time', coords='all')\n", (4671, 4703), False, 'import xarray\n'), ((4718, 4757), 'xarray.merge', 'xarray.merge', (['[new_xds, xds[remaining]]'], {}), '([new_xds, xds[remaining]])\n', (4730, 4757), Fa... |
from numbers import Number
import math
import knapsack
# ----------------------------------------------------------------------------------------------------------------------
# ----------------------------------------------------------------------------------------------------------------------
# --------------------... | [
"knapsack.optimal_knapsack"
] | [((33982, 34030), 'knapsack.optimal_knapsack', 'knapsack.optimal_knapsack', (['budget', 'values', 'costs'], {}), '(budget, values, costs)\n', (34007, 34030), False, 'import knapsack\n'), ((35958, 36032), 'knapsack.optimal_knapsack', 'knapsack.optimal_knapsack', (['budget', 'room_surface_area_list', 'room_price_list'], ... |
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import sqlalchemy as db
from common import helpers as util
from .base import Base, BaseModel
from .round import RoundModel
from .user import U... | [
"sqlalchemy.and_",
"sqlalchemy.ForeignKey",
"sqlalchemy.sql.func.sum",
"sqlalchemy.Column",
"common.helpers.get_query_count"
] | [((505, 544), 'sqlalchemy.Column', 'db.Column', (['db.Integer'], {'primary_key': '(True)'}), '(db.Integer, primary_key=True)\n', (514, 544), True, 'import sqlalchemy as db\n'), ((709, 741), 'sqlalchemy.Column', 'db.Column', (['db.Integer'], {'default': '(0)'}), '(db.Integer, default=0)\n', (718, 741), True, 'import sql... |
import numpy as np
from uq360.utils.batch_features.histogram_feature import SingleHistogramFeature
from uq360.utils.transformers.confidence_delta import ConfidenceDeltaTransformer
from uq360.utils.transformers.confidence_top import ConfidenceTopTransformer
from uq360.utils.transformers.confidence_entropy import Confi... | [
"uq360.utils.transformers.confidence_delta.ConfidenceDeltaTransformer",
"numpy.histogram",
"numpy.linspace",
"uq360.utils.transformers.class_frequency.ClassFrequencyTransformer",
"uq360.utils.transformers.confidence_top.ConfidenceTopTransformer",
"uq360.utils.transformers.confidence_entropy.ConfidenceEntr... | [((1175, 1203), 'numpy.histogram', 'np.histogram', (['vec'], {'bins': 'bins'}), '(vec, bins=bins)\n', (1187, 1203), True, 'import numpy as np\n'), ((2672, 2700), 'numpy.histogram', 'np.histogram', (['vec'], {'bins': 'bins'}), '(vec, bins=bins)\n', (2684, 2700), True, 'import numpy as np\n'), ((3775, 3818), 'numpy.histo... |
__copyright__ = 'Copyright(c) <NAME> 2017'
"""
"""
from sqlalchemy import Enum
from unittest.mock import Mock
from a_tuin.db import TableMap, PagedQuery, RelationMap
from a_tuin.db import DB_COLUMN_TYPE_MAP
from a_tuin.unittests.api.fixtures.models import (
AClassStatus,
AClassStatusField,
AClass,
... | [
"a_tuin.db.TableMap",
"unittest.mock.Mock",
"sqlalchemy.Enum",
"a_tuin.db.RelationMap"
] | [((462, 480), 'sqlalchemy.Enum', 'Enum', (['AClassStatus'], {}), '(AClassStatus)\n', (466, 480), False, 'from sqlalchemy import Enum\n'), ((522, 528), 'unittest.mock.Mock', 'Mock', ([], {}), '()\n', (526, 528), False, 'from unittest.mock import Mock\n'), ((732, 791), 'a_tuin.db.TableMap', 'TableMap', (['AClass', 'SCHEM... |
"""Utils for the command line tool."""
# Standard library
import datetime as dt
import logging
import os
import pickle
import sys
from pathlib import Path
# Third-party
import matplotlib.path as mpath
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import xarray as xr
# from ipdb import set_tra... | [
"pandas.DataFrame",
"logging.debug",
"pandas.date_range",
"numpy.sum",
"logging.warning",
"xarray.open_dataset",
"os.system",
"numpy.isnan",
"logging.info",
"pathlib.Path",
"matplotlib.path.Path",
"datetime.timedelta",
"numpy.arange",
"sys.exit"
] | [((895, 944), 'logging.debug', 'logging.debug', (['f"""Apply fxfilter to: {grib_file}."""'], {}), "(f'Apply fxfilter to: {grib_file}.')\n", (908, 944), False, 'import logging\n'), ((980, 1025), 'pathlib.Path', 'Path', (['out_dir', 'f"""tqc_{date_str}_{lt:03}.grb2"""'], {}), "(out_dir, f'tqc_{date_str}_{lt:03}.grb2')\n"... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "<NAME>"
def launch_environment(
environment_name,
*,
path_to_executables_directory,
ip="127.0.0.1",
port=5252,
headless=False,
):
"""
:param environment_name:
:param path_to_executables_directory:
:param ip:
:param port:
:par... | [
"pathlib.Path.exists",
"neodroid.utilities.launcher.download_utilities.download_environment.download_environment",
"subprocess.Popen",
"shlex.split",
"struct.calcsize",
"os.umask",
"logging.info",
"pathlib.Path"
] | [((633, 663), 'pathlib.Path', 'pathlib.Path', (['environment_name'], {}), '(environment_name)\n', (645, 663), False, 'import pathlib\n'), ((672, 709), 'pathlib.Path.exists', 'pathlib.Path.exists', (['environment_name'], {}), '(environment_name)\n', (691, 709), False, 'import pathlib\n'), ((3699, 3737), 'shlex.split', '... |
from pysoundcard import Stream, continue_flag
import time
"""Loop back five seconds of audio data."""
def callback(in_data, out_data, time_info, status):
out_data[:] = in_data
return continue_flag
with Stream(samplerate=44100, blocksize=16, callback=callback):
time.sleep(5)
| [
"pysoundcard.Stream",
"time.sleep"
] | [((213, 270), 'pysoundcard.Stream', 'Stream', ([], {'samplerate': '(44100)', 'blocksize': '(16)', 'callback': 'callback'}), '(samplerate=44100, blocksize=16, callback=callback)\n', (219, 270), False, 'from pysoundcard import Stream, continue_flag\n'), ((276, 289), 'time.sleep', 'time.sleep', (['(5)'], {}), '(5)\n', (28... |
"""Representation of Occurrences."""
import logging
from collections import namedtuple
import aiohttp
from .api import UnderLX
from .consts import METRO_LINES
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
class Occurrences:
"""Represents occurences."""
def __init__(self, websession):
... | [
"collections.namedtuple",
"logging.getLogger"
] | [((170, 197), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (187, 197), False, 'import logging\n'), ((1278, 1342), 'collections.namedtuple', 'namedtuple', (['"""MetroLine"""', "['line', 'friendlyName', 'occurrences']"], {}), "('MetroLine', ['line', 'friendlyName', 'occurrences'])\n", (12... |
"""
CSB build related tools and programs.
When executed as a program, this module will run the CSB Build Console and
build the source tree it belongs to. The source tree is added at the
B{beginning} of sys.path to make sure that all subsequent imports from the
Test and Doc consoles will import the right thing (think o... | [
"sys.stdout.write",
"os.mkdir",
"os.remove",
"sys.path.remove",
"getopt.getopt",
"os.walk",
"os.path.isfile",
"sys.stdout.flush",
"shutil.rmtree",
"os.path.join",
"os.chdir",
"csb.test.AnyTestBuilder",
"os.path.abspath",
"os.path.dirname",
"os.path.exists",
"traceback.format_exc",
"c... | [((1131, 1157), 'os.path.basename', 'os.path.basename', (['__file__'], {}), '(__file__)\n', (1147, 1157), False, 'import os\n'), ((1357, 1383), 'os.path.join', 'os.path.join', (['PARENT', '""".."""'], {}), "(PARENT, '..')\n", (1369, 1383), False, 'import os\n'), ((1287, 1312), 'os.path.dirname', 'os.path.dirname', (['_... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import absolute_import
from django.conf import settings
from django.db import models
from django.utils.datastructures import DictWrapper
from django_extensions.db.fields.json import JSONField
from macaddress.fields import MACAddressField a... | [
"django.utils.datastructures.DictWrapper",
"six.text_type",
"ipaddress.ip_address",
"logging.getLogger"
] | [((481, 508), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (498, 508), False, 'import logging\n'), ((1011, 1071), 'django.utils.datastructures.DictWrapper', 'DictWrapper', (['self.__dict__', 'connection.ops.quote_name', '"""qn_"""'], {}), "(self.__dict__, connection.ops.quote_name, 'qn_... |
#! /usr/bin/env python3
"""Test collapse."""
# --- import -------------------------------------------------------------------------------------
import WrightTools as wt
import numpy as np
# --- tests --------------------------------------------------------------------------------------
def test_gradient():
... | [
"WrightTools.Data",
"numpy.arange",
"numpy.array"
] | [((327, 336), 'WrightTools.Data', 'wt.Data', ([], {}), '()\n', (334, 336), True, 'import WrightTools as wt\n'), ((368, 383), 'numpy.arange', 'np.arange', (['(0)', '(6)'], {}), '(0, 6)\n', (377, 383), True, 'import numpy as np\n'), ((467, 497), 'numpy.array', 'np.array', (['[1, 2, 4, 7, 11, 16]'], {}), '([1, 2, 4, 7, 11... |
# Copyright (c) Facebook, Inc. and its affiliates.
import unittest
import torch
from mmf.common.meter import Meter
from mmf.common.report import Report
from mmf.common.sample import SampleList
class TestMeter(unittest.TestCase):
def test_meter_update_from_report(self):
meter = Meter()
prepared_ba... | [
"mmf.common.meter.Meter",
"torch.tensor",
"mmf.common.report.Report"
] | [((293, 300), 'mmf.common.meter.Meter', 'Meter', ([], {}), '()\n', (298, 300), False, 'from mmf.common.meter import Meter\n'), ((618, 654), 'mmf.common.report.Report', 'Report', (['prepared_batch', 'model_output'], {}), '(prepared_batch, model_output)\n', (624, 654), False, 'from mmf.common.report import Report\n'), ((... |
import random
from typing import Tuple
import numpy as np
from maenv.core import World, Agent, Team
from maenv.exceptions.scenario_exceptions import ScenarioNotSymmetricError
from maenv.interfaces.scenario import BaseTeamScenario
from maenv.utils.colors import generate_colors
class TeamsScenario(BaseTeamScenario):
... | [
"maenv.utils.colors.generate_colors",
"maenv.core.Agent",
"maenv.core.Team",
"numpy.all",
"random.random",
"maenv.core.World",
"numpy.array",
"maenv.exceptions.scenario_exceptions.ScenarioNotSymmetricError",
"numpy.concatenate"
] | [((1140, 1156), 'numpy.array', 'np.array', (['bounds'], {}), '(bounds)\n', (1148, 1156), True, 'import numpy as np\n'), ((2382, 2570), 'maenv.core.World', 'World', ([], {'n_agents': 'total_n_agents', 'n_teams': 'self.teams_n', 'grid_size': 'self.grid_size', 'ai': 'self.ai', 'ai_config': 'self.ai_config', 'attack_range_... |
from cell import Cell
GRID_W = 51
GRID_H = 51
def setup():
global cellList
size(600, 600)
this.surface.setTitle("CA 1")
cellList = createCellList()
def draw():
for row in cellList:
for cell in row:
cell.display()
def createCellList():
sz = width//GRID_W + 1
newLis... | [
"cell.Cell"
] | [((444, 458), 'cell.Cell', 'Cell', (['i', 'j', 'sz'], {}), '(i, j, sz)\n', (448, 458), False, 'from cell import Cell\n')] |
from __future__ import annotations
from copy import deepcopy
from typing import List, Optional, Set, Union
from pycardano.address import Address
from pycardano.backend.base import ChainContext
from pycardano.coinselection import (
LargestFirstSelector,
RandomImproveMultiAsset,
UTxOSelector,
)
from pycarda... | [
"pycardano.transaction.MultiAsset",
"pycardano.utils.script_data_hash",
"pycardano.utils.min_lovelace",
"pycardano.plutus.ExecutionUnits",
"pycardano.exception.InsufficientUTxOBalanceException",
"pycardano.utils.max_tx_fee",
"pycardano.logging.logger.info",
"pycardano.coinselection.LargestFirstSelecto... | [((8499, 8510), 'pycardano.transaction.Value', 'Value', (['fees'], {}), '(fees)\n', (8504, 8510), False, 'from pycardano.transaction import Asset, AssetName, MultiAsset, Transaction, TransactionBody, TransactionOutput, UTxO, Value\n'), ((8591, 8598), 'pycardano.transaction.Value', 'Value', ([], {}), '()\n', (8596, 8598... |
import common_functions
import zlib
import stream_decompressor
def decompress(event, context):
return common_functions.decompress(event, lambda data: stream_decompressor.StreamDecompressor(data, zlib.decompressobj()))
| [
"zlib.decompressobj"
] | [((202, 222), 'zlib.decompressobj', 'zlib.decompressobj', ([], {}), '()\n', (220, 222), False, 'import zlib\n')] |
import subprocess
import time
from pathlib import Path
import pyautogui
from lib.logger import get_logger
class Timeline:
def __init__(self, timeline_manager, name, program_path: Path = None, program_name=None, logger=None):
self.manager = timeline_manager
self.name = name
self.resource_... | [
"pyautogui.getWindowsWithTitle",
"pyautogui.getActiveWindow",
"lib.logger.get_logger",
"time.sleep"
] | [((2255, 2274), 'time.sleep', 'time.sleep', (['startup'], {}), '(startup)\n', (2265, 2274), False, 'import time\n'), ((779, 800), 'lib.logger.get_logger', 'get_logger', (['self.name'], {}), '(self.name)\n', (789, 800), False, 'from lib.logger import get_logger\n'), ((1830, 1847), 'time.sleep', 'time.sleep', (['delay'],... |
import random
import numbers
import torchvision.transforms.functional as F
from PIL import Image
import torch
import scipy.ndimage as ndimage
import numpy as np
#import cv2
from skimage.transform import rescale
class Resize(object):
""" Rescales the inputs and target arrays to the given 'size'.
'size' will be ... | [
"torch.stack",
"random.randint",
"skimage.transform.rescale",
"torchvision.transforms.functional.to_tensor",
"numpy.transpose",
"random.random",
"numpy.fliplr",
"torchvision.transforms.functional.normalize",
"torch.from_numpy"
] | [((3069, 3094), 'random.randint', 'random.randint', (['(0)', '(w - tw)'], {}), '(0, w - tw)\n', (3083, 3094), False, 'import random\n'), ((3107, 3132), 'random.randint', 'random.randint', (['(0)', '(h - th)'], {}), '(0, h - th)\n', (3121, 3132), False, 'import random\n'), ((1322, 1376), 'skimage.transform.rescale', 're... |
from glob import glob
from yaml import load, FullLoader
import re
failUnicode = u'\u2716'
fail = False
pattern = re.compile("^[a-z0-9-]+$")
steps_pattern = re.compile("^[a-zA-Z0-9-_]+$")
# validates workflow id against pattern ^[a-z0-9-]
def validate_workflow_id(id, path):
global fail
if pattern.match(id):... | [
"glob.glob",
"yaml.load",
"re.compile"
] | [((117, 143), 're.compile', 're.compile', (['"""^[a-z0-9-]+$"""'], {}), "('^[a-z0-9-]+$')\n", (127, 143), False, 'import re\n'), ((160, 190), 're.compile', 're.compile', (['"""^[a-zA-Z0-9-_]+$"""'], {}), "('^[a-zA-Z0-9-_]+$')\n", (170, 190), False, 'import re\n'), ((1652, 1703), 'glob.glob', 'glob', (['"""content/workf... |
# coding=utf-8
# The ECL-2.0 License (ECL-2.0)
#
# Copyright (c) 2019 <NAME> Licensed under the
# Educational Community 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.osedu.org/licenses/ECL-2.0
#
# Unless... | [
"openlrw.oneroster.OneRoster.http_delete",
"argparse.ArgumentParser",
"openlrw.oneroster.OneRoster.http_post",
"openlrw.oneroster.OneRoster.http_patch",
"openlrw.oneroster.OneRoster.http_get",
"requests.post",
"sys.exit"
] | [((1111, 1136), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1134, 1136), False, 'import argparse\n'), ((3489, 3519), 'openlrw.oneroster.OneRoster.http_get', 'OneRoster.http_get', (['route', 'jwt'], {}), '(route, jwt)\n', (3507, 3519), False, 'from openlrw.oneroster import OneRoster\n'), ((3... |
import sys
try:
import urllib2
except ImportError:
import urllib.request as urllib2
from restler import Restler
JSON_TYPE = {"Content-Type": "application.json"}
FORM_ACCEPTS = {"Accepts": "application/x-www-form-urlencoded"}
app = Restler("http://127.0.0.1:9000")
# Basic call
try:
response = app()
except ... | [
"sys.exit",
"restler.Restler"
] | [((241, 273), 'restler.Restler', 'Restler', (['"""http://127.0.0.1:9000"""'], {}), "('http://127.0.0.1:9000')\n", (248, 273), False, 'from restler import Restler\n'), ((436, 447), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (444, 447), False, 'import sys\n')] |
# Python TCP Client
import socket
def connect():
host = "192.168.1.2"
port = 6789
BUFFER_SIZE = 4096
Client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
Client.connect((host, port))
while True:
try:
message1 = '30,91'
message2 = '30,92'
mess... | [
"socket.socket"
] | [((129, 178), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (142, 178), False, 'import socket\n')] |
# Copyright (C) 2020 University of Oxford
#
# 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 t... | [
"netCDF4.Dataset",
"pandas.DataFrame",
"os.remove",
"json.load",
"numpy.std",
"os.path.dirname",
"pickle.load",
"numpy.mean",
"requests.get"
] | [((1061, 1069), 'requests.get', 'get', (['url'], {}), '(url)\n', (1064, 1069), False, 'from requests import get\n'), ((2547, 2573), 'netCDF4.Dataset', 'netCDF4.Dataset', (['temp_file'], {}), '(temp_file)\n', (2562, 2573), False, 'import netCDF4\n'), ((3400, 3420), 'pandas.DataFrame', 'pd.DataFrame', ([], {'data': 'd'})... |
# fasta_taxnomy
# generates a table with the taxon names and taxon ids associated with the protein seq IDs of a fasta
# by default, it outputs the table in the raw directory since this is 'queried' data
# IMPORTANT!
# Change the Entrez email and key to your own.
import argparse
import pandas as pd
from src import con... | [
"Bio.SeqIO.parse",
"argparse.ArgumentParser",
"pandas.DataFrame.from_dict",
"ete3.NCBITaxa",
"Bio.Entrez.read",
"Bio.Entrez.efetch",
"os.path.isfile",
"os.chdir"
] | [((1128, 1143), 'ete3.NCBITaxa', 'ete3.NCBITaxa', ([], {}), '()\n', (1141, 1143), False, 'import ete3\n'), ((2502, 2597), 'pandas.DataFrame.from_dict', 'pd.DataFrame.from_dict', (["{'acc': success_accessions, 'organism': organisms, 'taxid': taxids}"], {}), "({'acc': success_accessions, 'organism': organisms,\n 'taxi... |
import wave
import os,sys
import ctypes
import contextlib
import numpy as np
from ctypes import util
from scipy.io import wavfile
from pydub import AudioSegment
import pandas as pd
#loading libraries and setting up the environment
lib_path = util.find_library("rnnoise")
if (not("/" in lib_path)):
lib_path = (os.po... | [
"wave.open",
"numpy.ndarray",
"numpy.frombuffer",
"os.popen",
"ctypes.cdll.LoadLibrary",
"pydub.AudioSegment.from_wav",
"ctypes.util.find_library",
"ctypes.POINTER"
] | [((243, 271), 'ctypes.util.find_library', 'util.find_library', (['"""rnnoise"""'], {}), "('rnnoise')\n", (260, 271), False, 'from ctypes import util\n'), ((441, 474), 'ctypes.cdll.LoadLibrary', 'ctypes.cdll.LoadLibrary', (['lib_path'], {}), '(lib_path)\n', (464, 474), False, 'import ctypes\n'), ((2508, 2539), 'pydub.Au... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import absolute_import, division, print_function, unicode_literals
from astropy.units import Quantity
__all__ = ['SkyImageList']
class SkyImageList(object):
"""
Class to represent connection between `~gammapy.image.SkyImage` and ... | [
"astropy.units.Quantity"
] | [((1295, 1348), 'astropy.units.Quantity', 'Quantity', (['[image.data for image in self.images]', 'unit'], {}), '([image.data for image in self.images], unit)\n', (1303, 1348), False, 'from astropy.units import Quantity\n')] |
from __future__ import annotations
from typing import Final, Protocol
from attr import attrib, dataclass
from . import re
from .compat import Iterable, Iterator, list
@dataclass(slots=True)
class Paginator(Iterable[str]):
prefix: str | None = '```'
suffix: str | None = '```'
max_size: int = 2000
_r... | [
"attr.attrib",
"attr.dataclass"
] | [((173, 194), 'attr.dataclass', 'dataclass', ([], {'slots': '(True)'}), '(slots=True)\n', (182, 194), False, 'from attr import attrib, dataclass\n'), ((3011, 3032), 'attr.dataclass', 'dataclass', ([], {'slots': '(True)'}), '(slots=True)\n', (3020, 3032), False, 'from attr import attrib, dataclass\n'), ((340, 358), 'att... |
import boto3
import logging
from botocore.exceptions import ClientError
import os
import glob
def create_bucket(bucket_name: str, region=None) -> bool:
"""Create s3 bucket in a specified region
Args:
bucket_name (str)
region (str, optinal)
Return:
bool: True-> created, False-> ... | [
"logging.error",
"os.walk",
"os.path.join",
"boto3.client"
] | [((1032, 1050), 'boto3.client', 'boto3.client', (['"""s3"""'], {}), "('s3')\n", (1044, 1050), False, 'import boto3\n'), ((1826, 1844), 'boto3.client', 'boto3.client', (['"""s3"""'], {}), "('s3')\n", (1838, 1844), False, 'import boto3\n'), ((2281, 2298), 'os.walk', 'os.walk', (['filepath'], {}), '(filepath)\n', (2288, 2... |
#!/usr/bin/env python
# coding=UTF-8
#
# E-ARK Validation
# Copyright (C) 2019
# All rights reserved.
#
# Licensed to the E-ARK project under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The E-ARK project licen... | [
"zipfile.is_zipfile",
"zipfile.ZipFile",
"hashlib.sha1",
"os.path.basename",
"os.path.isdir",
"tarfile.is_tarfile",
"tempfile.gettempdir",
"ip_validation.infopacks.struct_errors.StructError.from_values",
"os.path.isfile",
"os.path.normpath",
"tarfile.open",
"os.path.join",
"os.listdir"
] | [((9263, 9283), 'os.listdir', 'os.listdir', (['reps_dir'], {}), '(reps_dir)\n', (9273, 9283), False, 'import os\n'), ((10517, 10541), 'os.listdir', 'os.listdir', (['package_root'], {}), '(package_root)\n', (10527, 10541), False, 'import os\n'), ((4446, 4467), 'tempfile.gettempdir', 'tempfile.gettempdir', ([], {}), '()\... |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^registration/complete/', views.registration_complete, name='user_registration_complete'),
url(r'^registration/closed/', views.registration_closed, name='user_registration_closed'),
url(r'^registration/', views.registration, name='... | [
"django.conf.urls.url"
] | [((75, 174), 'django.conf.urls.url', 'url', (['"""^registration/complete/"""', 'views.registration_complete'], {'name': '"""user_registration_complete"""'}), "('^registration/complete/', views.registration_complete, name=\n 'user_registration_complete')\n", (78, 174), False, 'from django.conf.urls import url\n'), ((... |
__all__ = [
"OasisBaseCommand",
"OasisComputationCommand",
]
import logging
import os
import sys
from argparsetree import BaseCommand
from ..utils.path import PathCleaner
from ..utils.inputs import InputValues
from ..manager import OasisManager as om
class OasisBaseCommand(BaseCommand):
"""
The ba... | [
"logging.basicConfig",
"os.path.isfile",
"logging.getLogger"
] | [((2550, 2569), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (2567, 2569), False, 'import logging\n'), ((2318, 2392), 'logging.basicConfig', 'logging.basicConfig', ([], {'stream': 'sys.stdout', 'level': 'log_level', 'format': 'log_format'}), '(stream=sys.stdout, level=log_level, format=log_format)\n', (2... |
# Generated by Django 3.2.5 on 2021-08-03 03:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dashboard', '0024_achievementcode_level'),
]
operations = [
migrations.AddField(
model_name='achievementcode',
name=... | [
"django.db.models.BooleanField",
"django.db.models.PositiveSmallIntegerField"
] | [((350, 451), 'django.db.models.PositiveSmallIntegerField', 'models.PositiveSmallIntegerField', ([], {'default': '(1)', 'help_text': '"""Amount of diamonds for this achievement"""'}), "(default=1, help_text=\n 'Amount of diamonds for this achievement')\n", (382, 451), False, 'from django.db import migrations, models... |
from parsers import UserIdentityParser
# User identity properties
USER_IDENTITY_TYPE = "type"
USER_IDENTITY_PRINCIPAL_ID = "principalid"
USER_IDENTITY_ARN = "arn"
USER_IDENTITY_ACCOUNT_ID = "accountid"
USER_IDENTITY_INVOKED_BY = "invokedby"
USER_IDENTITY_ACCESS_KEY_ID = "accesskeyid"
USER_IDENTITY_USERNAME = "username... | [
"parsers.UserIdentityParser.parse_user_identity_filed"
] | [((836, 905), 'parsers.UserIdentityParser.parse_user_identity_filed', 'UserIdentityParser.parse_user_identity_filed', (['self.user_identity_data'], {}), '(self.user_identity_data)\n', (880, 905), False, 'from parsers import UserIdentityParser\n')] |
import pytest
from galaxy_test.base.populators import flakey
from .framework import (
selenium_test,
SeleniumTestCase
)
class HistoryPanelPaginationTestCase(SeleniumTestCase):
ensure_registered = True
@selenium_test
@flakey # The next button doesn't always work - maybe a delay in JS callback r... | [
"pytest.skip"
] | [((425, 488), 'pytest.skip', 'pytest.skip', (['"""There is no pagination on the beta history panel"""'], {}), "('There is no pagination on the beta history panel')\n", (436, 488), False, 'import pytest\n')] |
import unittest
from unittest.mock import patch
from tmc import points, reflect
from tmc.utils import load, load_module, reload_module, get_stdout, check_source
from functools import reduce
import os
import os.path
import textwrap
from random import choice, randint
from datetime import date, datetime, timedelta
exerc... | [
"unittest.main",
"tmc.utils.get_stdout",
"unittest.mock.patch",
"tmc.utils.reload_module",
"tmc.points",
"tmc.utils.load_module"
] | [((636, 669), 'tmc.points', 'points', (['"""10.course_records_part1"""'], {}), "('10.course_records_part1')\n", (642, 669), False, 'from tmc import points, reflect\n'), ((1017, 1050), 'tmc.points', 'points', (['"""10.course_records_part1"""'], {}), "('10.course_records_part1')\n", (1023, 1050), False, 'from tmc import ... |
import urllib.parse
from django.contrib.auth.models import User
from django.test import TestCase
from dfirtrack_artifacts.models import Artifactstatus
class ArtifactstatusAPIViewTestCase(TestCase):
"""artifactstatus API view tests"""
@classmethod
def setUpTestData(cls):
# create object
... | [
"dfirtrack_artifacts.models.Artifactstatus.objects.get",
"dfirtrack_artifacts.models.Artifactstatus.objects.create",
"django.contrib.auth.models.User.objects.create_user"
] | [((321, 394), 'dfirtrack_artifacts.models.Artifactstatus.objects.create', 'Artifactstatus.objects.create', ([], {'artifactstatus_name': '"""artifactstatus_api_1"""'}), "(artifactstatus_name='artifactstatus_api_1')\n", (350, 394), False, 'from dfirtrack_artifacts.models import Artifactstatus\n'), ((425, 517), 'django.co... |
############################################################
# -*- coding: utf-8 -*-
#
# # # # # # #
# ## ## # ## # #
# # # # # # # # # # #
# # ## # ## ## ######
# # # # # # #
#
# Python-based Tool for interaction with the 10micron mounts
# GUI with PyQT5 fo... | [
"PyQt5.QtCore.pyqtSignal",
"sys.exc_info",
"logging.getLogger",
"PyQt5.QtCore.pyqtSlot"
] | [((901, 926), 'PyQt5.QtCore.pyqtSignal', 'PyQt5.QtCore.pyqtSignal', ([], {}), '()\n', (924, 926), False, 'import PyQt5\n'), ((939, 970), 'PyQt5.QtCore.pyqtSignal', 'PyQt5.QtCore.pyqtSignal', (['object'], {}), '(object)\n', (962, 970), False, 'import PyQt5\n'), ((984, 1015), 'PyQt5.QtCore.pyqtSignal', 'PyQt5.QtCore.pyqt... |
import komand
from .schema import SubmitSampleInput, SubmitSampleOutput, Input, Output
# Custom imports below
from base64 import b64decode
import binascii
class SubmitSample(komand.Action):
def __init__(self):
super(self.__class__, self).__init__(
name="submit_sample",
description... | [
"base64.b64decode"
] | [((1124, 1141), 'base64.b64decode', 'b64decode', (['sample'], {}), '(sample)\n', (1133, 1141), False, 'from base64 import b64decode\n'), ((1374, 1393), 'base64.b64decode', 'b64decode', (['cookbook'], {}), '(cookbook)\n', (1383, 1393), False, 'from base64 import b64decode\n')] |
import cv2
import numpy as np
def is_cv2():
# if we are using OpenCV 2, then our cv2.__version__ will start
# with '2.'
return check_opencv_version("2.")
def is_cv3():
# if we are using OpenCV 3.X, then our cv2.__version__ will start
# with '3.'
return check_opencv_version("3.")
def check_ope... | [
"cv2.boundingRect",
"numpy.array",
"cv2.findContours",
"cv2.__version__.startswith"
] | [((555, 588), 'cv2.__version__.startswith', 'lib.__version__.startswith', (['major'], {}), '(major)\n', (581, 588), True, 'import cv2 as lib\n'), ((664, 732), 'cv2.findContours', 'cv2.findContours', (['thresh', 'cv2.RETR_EXTERNAL', 'cv2.CHAIN_APPROX_SIMPLE'], {}), '(thresh, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)\n... |
from setuptools import setup, find_packages
setup(
packages=find_packages(exclude=('*.tests', '*.tests.*', 'tests.*', 'tests')),
)
| [
"setuptools.find_packages"
] | [((65, 132), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "('*.tests', '*.tests.*', 'tests.*', 'tests')"}), "(exclude=('*.tests', '*.tests.*', 'tests.*', 'tests'))\n", (78, 132), False, 'from setuptools import setup, find_packages\n')] |
# ============================================================================
#
# Copyright (C) 2007-2016 Conceptive Engineering bvba.
# www.conceptive.be / <EMAIL>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
... | [
"six.text_type"
] | [((3325, 3345), 'six.text_type', 'six.text_type', (['value'], {}), '(value)\n', (3338, 3345), False, 'import six\n')] |
"""CPU object for combat purpose
--
@author DrLarck
@update 03/08/20 by DrLarck"""
import random
import asyncio
from utility.entity.player import Player
from utility.entity.character import CharacterGetter
class CPU(Player):
def __init__(self, context, client, user):
Player.__init__(self, context, c... | [
"utility.entity.character.CharacterGetter",
"random.randint",
"asyncio.sleep",
"random.choice",
"utility.entity.player.Player.__init__"
] | [((288, 332), 'utility.entity.player.Player.__init__', 'Player.__init__', (['self', 'context', 'client', 'user'], {}), '(self, context, client, user)\n', (303, 332), False, 'from utility.entity.player import Player\n'), ((765, 782), 'utility.entity.character.CharacterGetter', 'CharacterGetter', ([], {}), '()\n', (780, ... |
from api import Linter
matches = Linter.main(["-v", "-r", "../ansiblelints/rules", "-R", "../testResources/ansible-smell/create.yml"])
for match in matches:
print(match.__dict__)
| [
"api.Linter.main"
] | [((34, 139), 'api.Linter.main', 'Linter.main', (["['-v', '-r', '../ansiblelints/rules', '-R',\n '../testResources/ansible-smell/create.yml']"], {}), "(['-v', '-r', '../ansiblelints/rules', '-R',\n '../testResources/ansible-smell/create.yml'])\n", (45, 139), False, 'from api import Linter\n')] |
import os
import sys
import tempfile
import unittest
from threading import Thread, Event
from dukpy import Context, undefined, JSError
class ContextTests(unittest.TestCase):
def setUp(self):
self.ctx = Context()
self.g = self.ctx.g
def test_create_context(self):
pass
def test_cr... | [
"threading.Thread",
"os.remove",
"tempfile.NamedTemporaryFile",
"sys.getrefcount",
"threading.Event",
"dukpy.Context"
] | [((217, 226), 'dukpy.Context', 'Context', ([], {}), '()\n', (224, 226), False, 'from dukpy import Context, undefined, JSError\n'), ((1502, 1511), 'dukpy.Context', 'Context', ([], {}), '()\n', (1509, 1511), False, 'from dukpy import Context, undefined, JSError\n'), ((2964, 2982), 'sys.getrefcount', 'sys.getrefcount', ([... |
"""
A wrapper for pymongo. Using a shared connection instead of a singleton pattern.
"""
from pymongo import MongoClient
class Connection(object):
"""
Create pymongo connection.
The @classmethod requires a reference to a class object as the first parameter.
"""
instance = None
connection = N... | [
"pymongo.MongoClient"
] | [((643, 659), 'pymongo.MongoClient', 'MongoClient', (['uri'], {}), '(uri)\n', (654, 659), False, 'from pymongo import MongoClient\n')] |
"""Server shutdown."""
from dzdsu.server import Server
from dzdsu.utility.logger import LOGGER
__all__ = ['shutdown']
def shutdown(server: Server, message: str, countdown: int) -> bool:
"""Shut down the server iff it needs a restart."""
if not server.is_running:
return True
try:
serve... | [
"dzdsu.utility.logger.LOGGER.warning",
"dzdsu.utility.logger.LOGGER.info",
"dzdsu.utility.logger.LOGGER.error"
] | [((524, 565), 'dzdsu.utility.logger.LOGGER.info', 'LOGGER.info', (['"""Kicking remaining players."""'], {}), "('Kicking remaining players.')\n", (535, 565), False, 'from dzdsu.utility.logger import LOGGER\n'), ((761, 792), 'dzdsu.utility.logger.LOGGER.info', 'LOGGER.info', (['"""Stopping server."""'], {}), "('Stopping ... |
#!/usr/bin/python3
from brownie import ArtBot, accounts, network, config
from scripts.helpful_scripts import OPENSEA_FORMAT
def main():
dev = accounts.add(config["wallets"]["from_key"])
print(network.show_active())
simple_collectible = ArtBot[len(ArtBot) - 1]
token_id = simple_collectible.tokenIdCount... | [
"scripts.helpful_scripts.OPENSEA_FORMAT.format",
"brownie.network.show_active",
"brownie.accounts.add"
] | [((148, 191), 'brownie.accounts.add', 'accounts.add', (["config['wallets']['from_key']"], {}), "(config['wallets']['from_key'])\n", (160, 191), False, 'from brownie import ArtBot, accounts, network, config\n'), ((202, 223), 'brownie.network.show_active', 'network.show_active', ([], {}), '()\n', (221, 223), False, 'from... |
from flask import Flask, request, jsonify, abort
import base64
import requests
from datetime import datetime
import subprocess
import os
import sys
import argparse
__dir__ = os.path.dirname(os.path.abspath(__file__))
sys.path.append(__dir__)
sys.path.append(os.path.abspath(os.path.join(__dir__, '../..')))
import cv2
... | [
"os.mkdir",
"tools.infer.utility.draw_ocr_box_txt",
"cv2.getPerspectiveTransform",
"base64.b64decode",
"flask.jsonify",
"numpy.rot90",
"numpy.linalg.norm",
"os.path.join",
"flask.request.get_json",
"sys.path.append",
"os.path.abspath",
"cv2.warpPerspective",
"ppocr.utils.utility.get_image_fi... | [((218, 242), 'sys.path.append', 'sys.path.append', (['__dir__'], {}), '(__dir__)\n', (233, 242), False, 'import sys\n'), ((785, 800), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (790, 800), False, 'from flask import Flask, request, jsonify, abort\n'), ((811, 823), 'ppocr.utils.logging.get_logger', 'get... |
import json
import unittest
import instance
from app import create_app
from db.createdb import connect_to_db
from db.user.mock_signup import main
class BaseTest(unittest.TestCase):
def setUp(self):
""" Defining test variables """
self.app = create_app('testing')
self.app.app_context().pus... | [
"unittest.main",
"app.create_app",
"db.createdb.connect_to_db",
"db.user.mock_signup.main"
] | [((670, 685), 'unittest.main', 'unittest.main', ([], {}), '()\n', (683, 685), False, 'import unittest\n'), ((264, 285), 'app.create_app', 'create_app', (['"""testing"""'], {}), "('testing')\n", (274, 285), False, 'from app import create_app\n'), ((377, 383), 'db.user.mock_signup.main', 'main', ([], {}), '()\n', (381, 3... |
#!/usr/bin/env python3
# Project: python-meatball
# Copyright: (c) 2021, <NAME>
import json
with open('../../data/fortune.json') as f:
data = json.load(f)
print(json.dumps(data, indent=4, sort_keys=True))
| [
"json.load",
"json.dumps"
] | [((151, 163), 'json.load', 'json.load', (['f'], {}), '(f)\n', (160, 163), False, 'import json\n'), ((171, 213), 'json.dumps', 'json.dumps', (['data'], {'indent': '(4)', 'sort_keys': '(True)'}), '(data, indent=4, sort_keys=True)\n', (181, 213), False, 'import json\n')] |
import pytest
from awsutils.services import Validate
def test_str_not_null_success():
Validate.not_null(object='test', err_msg='the value is null')
def test_str_not_null_failure():
with pytest.raises(ValueError):
Validate.not_null(object=None, err_msg='the value is null')
def test_str_not_null_err_msg():
... | [
"pytest.raises",
"awsutils.services.Validate.not_empty",
"pytest.fail",
"awsutils.services.Validate.not_null"
] | [((89, 150), 'awsutils.services.Validate.not_null', 'Validate.not_null', ([], {'object': '"""test"""', 'err_msg': '"""the value is null"""'}), "(object='test', err_msg='the value is null')\n", (106, 150), False, 'from awsutils.services import Validate\n'), ((543, 601), 'awsutils.services.Validate.not_null', 'Validate.n... |
import os
import sys
from kivy.utils import platform
def resource_path(relative_path):
"""
It is used to find the temp path if exists
else return the absolute path of a relative_path."""
abs_path = os.path.join(os.path.abspath("."), relative_path)
if platform == "android":
if has... | [
"os.path.abspath",
"os.path.exists",
"os.path.join"
] | [((238, 258), 'os.path.abspath', 'os.path.abspath', (['"""."""'], {}), "('.')\n", (253, 258), False, 'import os\n'), ((449, 473), 'os.path.exists', 'os.path.exists', (['abs_path'], {}), '(abs_path)\n', (463, 473), False, 'import os\n'), ((362, 403), 'os.path.join', 'os.path.join', (['sys._MEIPASS', 'relative_path'], {}... |
import pygame
from bit_text import Bit_text
from timer import Timer
import sys
clock = pygame.time.Clock()
s = input()
screen = pygame.display.set_mode((600,600))
run = True
text = Bit_text(s, 600, 250, 4, 4, pattern_interval=40)
text2 = Bit_text(s, 130, 250, 4, 4, pattern_interval=15, colour=(0,0,0))
... | [
"bit_text.Bit_text",
"pygame.display.set_mode",
"pygame.event.get",
"pygame.display.update",
"pygame.time.Clock",
"pygame.key.get_pressed",
"timer.Timer"
] | [((91, 110), 'pygame.time.Clock', 'pygame.time.Clock', ([], {}), '()\n', (108, 110), False, 'import pygame\n'), ((138, 173), 'pygame.display.set_mode', 'pygame.display.set_mode', (['(600, 600)'], {}), '((600, 600))\n', (161, 173), False, 'import pygame\n'), ((197, 245), 'bit_text.Bit_text', 'Bit_text', (['s', '(600)', ... |
import re
from utiltest.util import find_char_after
from utiltest.util import find_char_after_no_error
from utiltest.latexparser import LatexParser
class BibtexEntry:
def __init__(self, entrytype, bibid, fields_data, string=lambda: raise_(Exception("not defined"))):
self.entrytype = entrytype
self... | [
"utiltest.latexparser.LatexParser",
"utiltest.util.find_char_after",
"re.sub"
] | [((1913, 1943), 'utiltest.util.find_char_after', 'find_char_after', (['input', '"""{"""', '(1)'], {}), "(input, '{', 1)\n", (1928, 1943), False, 'from utiltest.util import find_char_after\n'), ((1972, 2006), 'utiltest.util.find_char_after', 'find_char_after', (['input', '""","""', 'start'], {}), "(input, ',', start)\n"... |
import re
from datetime import datetime
from django.conf import settings
from django.contrib.auth import authenticate
from django.contrib.auth import login, logout
from django.contrib.auth.mixins import LoginRequiredMixin
from django.core.paginator import Paginator
from django.shortcuts import render, redirect
from dj... | [
"courses.models.Course.objects.get",
"users.forms.UserInfoForm",
"django.contrib.auth.login",
"users.utils.SecretOauth",
"operation.models.UserMessage.objects.filter",
"users.forms.RegisterForm",
"operation.models.UserCourse.objects.filter",
"django.contrib.auth.logout",
"django.shortcuts.render",
... | [((1018, 1032), 'users.forms.RegisterForm', 'RegisterForm', ([], {}), '()\n', (1030, 1032), False, 'from users.forms import RegisterForm, LoginForm, ForgetForm, ModifyPwdForm, UserInfoForm, UploadImageForm\n'), ((1069, 1135), 'django.shortcuts.render', 'render', (['request', '"""register.html"""', "{'register_form': re... |
# This is called by regression_run.sh / scrape.sh / regression_functions.sh / receive.sh / synth_launcher.sh / synth_regression.sh
import re
import gspread
import getpass
import pygsheets
import sys
import os
from oauth2client.service_account import ServiceAccountCredentials
import datetime
from datetime import dateti... | [
"sys.stdout.write",
"getpass.getuser",
"os.uname",
"re.match",
"pygsheets.authorize",
"socket.gethostname",
"datetime.datetime.strptime",
"re.sub",
"datetime.datetime.now",
"time.localtime"
] | [((2678, 2717), 'pygsheets.authorize', 'pygsheets.authorize', ([], {'outh_file': 'json_key'}), '(outh_file=json_key)\n', (2697, 2717), False, 'import pygsheets\n'), ((9715, 9731), 'time.localtime', 'time.localtime', ([], {}), '()\n', (9729, 9731), False, 'import time\n'), ((10542, 10558), 'time.localtime', 'time.localt... |
import socket
import getpass
import psycopg2
def get_ip_address():
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(("8.8.8.8", 80))
return s.getsockname()[0]
hostname = socket.gethostname()
user = getpass.getuser()
model = input("Raspberry Pi model: ")
location = input("Raspberry Pi locatio... | [
"socket.gethostname",
"socket.socket",
"getpass.getuser",
"psycopg2.connect"
] | [((198, 218), 'socket.gethostname', 'socket.gethostname', ([], {}), '()\n', (216, 218), False, 'import socket\n'), ((226, 243), 'getpass.getuser', 'getpass.getuser', ([], {}), '()\n', (241, 243), False, 'import getpass\n'), ((76, 124), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_DGRAM'], {}), '(s... |
import random
import time as t
from discord import Embed, Colour
from discord.ext import commands
from src.session import Session
from src.session import session_manager, session_controller, session_messenger
from src.utils import msg_builder
from configs import user_messages as u_msg
from asyncio import sleep
... | [
"discord.Colour.green"
] | [((513, 527), 'discord.Colour.green', 'Colour.green', ([], {}), '()\n', (525, 527), False, 'from discord import Embed, Colour\n'), ((775, 789), 'discord.Colour.green', 'Colour.green', ([], {}), '()\n', (787, 789), False, 'from discord import Embed, Colour\n')] |
from django.contrib.auth import mixins as auth_mixins
from django.http import HttpResponse
from django.urls import reverse_lazy
from django.views import generic as views
from django.views.decorators.cache import cache_page
from final_project.accounts.models import Profile
from final_project.main.models import Courses
... | [
"django.urls.reverse_lazy",
"django.http.HttpResponse",
"final_project.accounts.models.Profile.objects.get"
] | [((697, 725), 'django.urls.reverse_lazy', 'reverse_lazy', (['"""courses shop"""'], {}), "('courses shop')\n", (709, 725), False, 'from django.urls import reverse_lazy\n'), ((1402, 1433), 'django.urls.reverse_lazy', 'reverse_lazy', (['"""user\'s listings"""'], {}), '("user\'s listings")\n', (1414, 1433), False, 'from dj... |
import argparse
import torch
from s2s.model._rnn_attention import AttnRNNDecModel, AttnRNNEncModel, AttnRNNModel, AttnRNNBlock
class AttnGRUBlock(AttnRNNBlock):
def __init__(self, input_size, hidden_size, num_layers):
super().__init__(input_size, hidden_size, num_layers)
self.hid = torch.nn.Modul... | [
"torch.nn.GRU"
] | [((357, 453), 'torch.nn.GRU', 'torch.nn.GRU', ([], {'input_size': 'input_size', 'hidden_size': 'hidden_size', 'num_layers': '(1)', 'batch_first': '(True)'}), '(input_size=input_size, hidden_size=hidden_size, num_layers=1,\n batch_first=True)\n', (369, 453), False, 'import torch\n')] |
import graphene
from graphql import ResolveInfo
from aiopg.sa.result import RowProxy
from info.api.models.review import Review
from info.reviews.db_utils import select_review_by_id
class ReviewsQuery(graphene.ObjectType):
review = graphene.Field(
Review,
pk=graphene.Argument(graphene.Int),
... | [
"graphene.Argument",
"info.reviews.db_utils.select_review_by_id"
] | [((281, 312), 'graphene.Argument', 'graphene.Argument', (['graphene.Int'], {}), '(graphene.Int)\n', (298, 312), False, 'import graphene\n'), ((553, 582), 'info.reviews.db_utils.select_review_by_id', 'select_review_by_id', (['conn', 'pk'], {}), '(conn, pk)\n', (572, 582), False, 'from info.reviews.db_utils import select... |
from dataclasses import dataclass, asdict
from typing import List, Dict, Tuple
from .util import int_to_bytes, sha256d
import binascii
import json
@dataclass
class OutPoint:
tx_hash: bytes
index: int
@classmethod
def from_dict(cls, op_data: Dict) -> "OutPoint":
shaped_data = {}
dat... | [
"dataclasses.asdict",
"binascii.a2b_hex",
"json.dumps"
] | [((784, 796), 'dataclasses.asdict', 'asdict', (['self'], {}), '(self)\n', (790, 796), False, 'from dataclasses import dataclass, asdict\n'), ((2040, 2052), 'dataclasses.asdict', 'asdict', (['self'], {}), '(self)\n', (2046, 2052), False, 'from dataclasses import dataclass, asdict\n'), ((3405, 3417), 'dataclasses.asdict'... |
import torch
from torch import nn
import omnifig as fig
import omnilearn as fd
from omnilearn import models
from omnilearn import util
def _find_dims(A, din=None, dout=None):
if din is None and dout is None:
din = A.pull('din', None)
if din is None:
dout = A.pull('dout')
din = dout
else:
dout = di... | [
"omnilearn.models.make_MLP",
"omnilearn.util.get_normalization",
"omnifig.Component"
] | [((474, 496), 'omnifig.Component', 'fig.Component', (['"""adain"""'], {}), "('adain')\n", (487, 496), True, 'import omnifig as fig\n'), ((1944, 1973), 'omnifig.Component', 'fig.Component', (['"""affine-adain"""'], {}), "('affine-adain')\n", (1957, 1973), True, 'import omnifig as fig\n'), ((1150, 1189), 'omnilearn.model... |
import sys
from typing import Callable, Optional, Union
from tonberry.exceptions import FigureItOutLaterException
from tonberry.models import Methods, RouteMapping
class _Expose:
_registrar = Methods()
@classmethod
def _new_registrar(cls) -> None:
cls._registrar = Methods()
@classmethod
... | [
"tonberry.models.Methods",
"sys._getframe",
"tonberry.models.RouteMapping"
] | [((199, 208), 'tonberry.models.Methods', 'Methods', ([], {}), '()\n', (206, 208), False, 'from tonberry.models import Methods, RouteMapping\n'), ((289, 298), 'tonberry.models.Methods', 'Methods', ([], {}), '()\n', (296, 298), False, 'from tonberry.models import Methods, RouteMapping\n'), ((647, 673), 'sys._getframe', '... |
# -*- encoding:utf8 -*-
import json
import random
import traceback
import redis
import XX.Date.DatetimeHelper as Dt
import XX.HTTP.RequestsHelper as Rh
from XX.Debug import *
# 阿布云
def get_proxy(un="H76Z3LKO67NRN5QD", pwd="<PASSWORD>", profession=False) -> dict:
# 代理隧道验证信息
proxyMeta = "http://%(user)s:%(pas... | [
"redis.Redis",
"traceback.print_exc",
"json.loads",
"XX.HTTP.RequestsHelper.RequestHelper.send_cache_request",
"random.choice",
"XX.Date.DatetimeHelper.str_to_ts",
"requests.get"
] | [((925, 955), 'redis.Redis', 'redis.Redis', (['redis_host'], {'db': 'db'}), '(redis_host, db=db)\n', (936, 955), False, 'import redis\n'), ((5707, 5757), 'requests.get', 'requests.get', (['"""https://www.jd.com/"""'], {'proxies': 'proxy'}), "('https://www.jd.com/', proxies=proxy)\n", (5719, 5757), False, 'import reques... |
import pytest
import aiorethink
from aiorethink.registry import registry
class Dummy:
pass
class Dummy2:
pass
def test_register(aiorethink_session):
registry.register("Dummy", Dummy)
assert "Dummy" in registry
assert registry["Dummy"] == Dummy
assert len(registry) == 1
for name in regis... | [
"aiorethink.registry.registry.register",
"aiorethink.registry.registry.resolve",
"pytest.raises",
"aiorethink.registry.registry.unregister"
] | [((166, 199), 'aiorethink.registry.registry.register', 'registry.register', (['"""Dummy"""', 'Dummy'], {}), "('Dummy', Dummy)\n", (183, 199), False, 'from aiorethink.registry import registry\n'), ((403, 436), 'aiorethink.registry.registry.register', 'registry.register', (['"""Dummy"""', 'Dummy'], {}), "('Dummy', Dummy)... |
from vocab import build
if __name__=='__main__':
build()
| [
"vocab.build"
] | [((54, 61), 'vocab.build', 'build', ([], {}), '()\n', (59, 61), False, 'from vocab import build\n')] |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-05-03 14:32
from __future__ import unicode_literals
from django.db import migrations
def convert_to_credit_logs(apps, schema_editor):
TransactionLog = apps.get_model('transaction', 'Log')
CreditLog = apps.get_model('credit', 'Log')
for transacti... | [
"django.db.migrations.RunPython"
] | [((891, 935), 'django.db.migrations.RunPython', 'migrations.RunPython', (['convert_to_credit_logs'], {}), '(convert_to_credit_logs)\n', (911, 935), False, 'from django.db import migrations\n')] |
import os
import dnacauldron as dc
this_directory = os.path.dirname(os.path.realpath(__file__))
parts_and_oligos_folder = os.path.join(this_directory, "parts_and_oligos")
assembly_plan_path = os.path.join(this_directory, "assembly_plan.csv")
flawed_plan_path = os.path.join(this_directory, "assembly_plan_flawed.csv")
... | [
"dnacauldron.AssemblyPlan.from_spreadsheet",
"os.path.realpath",
"os.path.join",
"dnacauldron.SequenceRepository"
] | [((123, 171), 'os.path.join', 'os.path.join', (['this_directory', '"""parts_and_oligos"""'], {}), "(this_directory, 'parts_and_oligos')\n", (135, 171), False, 'import os\n'), ((193, 242), 'os.path.join', 'os.path.join', (['this_directory', '"""assembly_plan.csv"""'], {}), "(this_directory, 'assembly_plan.csv')\n", (205... |
from model.contact import Contact
import random
import allure
def test_delete_contact(app, db):
with allure.step("Сheck for not empty list of contacts"):
if len(db.get_contact_list()) == 0:
app.contact.contact(Contact(firstname="Test", middlename="qqqqq", lastname="Test"))
with allure.step... | [
"allure.step",
"model.contact.Contact",
"random.choice"
] | [((107, 158), 'allure.step', 'allure.step', (['"""Сheck for not empty list of contacts"""'], {}), "('Сheck for not empty list of contacts')\n", (118, 158), False, 'import allure\n'), ((309, 344), 'allure.step', 'allure.step', (['"""Given a contact list"""'], {}), "('Given a contact list')\n", (320, 344), False, 'import... |
#!/usr/bin/env python3
import RPi.GPIO as GPIO
import socket
import signal
import sys
import time
import json
import Adafruit_DHT
import time
import board
import busio
import adafruit_veml6075
import threading
import queue
import traceback
import socketserver
import datetime
import os
PORT = 23456
DHTPIN = 24 # GPIO... | [
"json.dumps",
"os.path.isfile",
"RPi.GPIO.output",
"adafruit_veml6075.VEML6075",
"traceback.print_exc",
"RPi.GPIO.setup",
"threading.Event",
"datetime.datetime.now",
"RPi.GPIO.setmode",
"time.sleep",
"socketserver.TCPServer.__init__",
"signal.signal",
"queue.Queue",
"sys.exit",
"busio.I2... | [((2544, 2567), 'json.dumps', 'json.dumps', (["{(0): 'OK'}"], {}), "({(0): 'OK'})\n", (2554, 2567), False, 'import json\n'), ((2898, 2927), 'json.dumps', 'json.dumps', (['{(0): (uva, uvb)}'], {}), '({(0): (uva, uvb)})\n', (2908, 2927), False, 'import json\n'), ((2991, 3047), 'json.dumps', 'json.dumps', (['{(0): PRINTER... |
from rest_framework import serializers
from dataprocessing.serializers import userProfileSerializer
from workprogramsapp.folders_ans_statistic.models import Folder, WorkProgramInFolder, AcademicPlanInFolder, \
DisciplineBlockModuleInFolder, IndividualImplementationAcademicPlanInFolder
from workprogramsapp.individu... | [
"workprogramsapp.serializers.DisciplineBlockModuleSerializer",
"workprogramsapp.serializers.WorkProgramShortForExperiseSerializer",
"workprogramsapp.individualization.serializers.ShortIndividualImplementationAcademicPlanSerializer",
"workprogramsapp.serializers.AcademicPlanShortSerializer",
"dataprocessing.... | [((874, 923), 'workprogramsapp.serializers.WorkProgramShortForExperiseSerializer', 'WorkProgramShortForExperiseSerializer', ([], {'many': '(False)'}), '(many=False)\n', (911, 923), False, 'from workprogramsapp.serializers import WorkProgramShortForExperiseSerializer, AcademicPlanShortSerializer, DisciplineBlockModuleSe... |
import os
import io
import glob
import errno
import json
import numpy as np
import scipy.interpolate as spi
import scipy.optimize as spo
import matplotlib.pyplot as plt
import scipy.ndimage as ndimage
np.set_printoptions(linewidth=500)
def fvb_crr(raw_array, offset=0, medianRatio=1, noiseCoeff=5, debugging=False):
... | [
"os.mkdir",
"numpy.sum",
"json.dumps",
"numpy.isnan",
"matplotlib.pyplot.figure",
"numpy.mean",
"numpy.arange",
"scipy.interpolate.interp1d",
"os.path.join",
"pyqtgraph.GraphicsLayoutWidget",
"pyqtgraph.QtGui.QApplication",
"numpy.atleast_2d",
"numpy.set_printoptions",
"json.loads",
"num... | [((202, 236), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'linewidth': '(500)'}), '(linewidth=500)\n', (221, 236), True, 'import numpy as np\n'), ((879, 898), 'numpy.array', 'np.array', (['raw_array'], {}), '(raw_array)\n', (887, 898), True, 'import numpy as np\n'), ((910, 977), 'scipy.ndimage.filters.median... |