code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
# Chapter 2. 문자열과 텍스트
# 2.1 여러 구분자로 문자열 나누기
# ▣ 문제 : 문자열을 필드로 나누고 싶지만 구분자가 문자열에 일관적이지 않다.
# ▣ 해결 : 문자열 객체의 split() 메소드는 아주 간단한 상황에 사용하도록 설계되었고 여러 개의 구분자나 구분자 주변의
# 공백까지 고려하지는 않는다. 좀 더 유연해져야 할 필요가 있다면 re.split() 메소드를 사용한다.
line = 'asdf fjdk; afed, fjek,asdf, foo'
import re
print(re.split(r'[;,\s]\s*'... | [
"re.compile",
"textwrap.fill",
"html.escape",
"re.split",
"os.listdir",
"fnmatch.fnmatchcase",
"os.get_terminal_size",
"sys._getframe",
"fnmatch.fnmatch",
"unicodedata.normalize",
"urllib.request.urlopen",
"ply.yacc.yacc",
"collections.namedtuple",
"unicodedata.combining",
"re.match",
... | [((455, 486), 're.split', 're.split', (['"""(;|,|\\\\s)\\\\s*"""', 'line'], {}), "('(;|,|\\\\s)\\\\s*', line)\n", (463, 486), False, 'import re\n'), ((1245, 1260), 'os.listdir', 'os.listdir', (['"""."""'], {}), "('.')\n", (1255, 1260), False, 'import os\n'), ((4077, 4110), 're.match', 're.match', (['"""\\\\d+/\\\\d+/\\... |
from ipywidgets import widgets
from pandas_profiling.report.presentation.core import Variable
class WidgetVariable(Variable):
def render(self) -> widgets.VBox:
items = [self.content["top"].render()]
if self.content["bottom"] is not None:
items.append(self.content["bottom"].render())
... | [
"ipywidgets.widgets.VBox"
] | [((335, 354), 'ipywidgets.widgets.VBox', 'widgets.VBox', (['items'], {}), '(items)\n', (347, 354), False, 'from ipywidgets import widgets\n')] |
#!/usr/bin/python3
import os
import os.path
import sys
from bottle import abort, redirect, request, route, run, static_file, template
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
STATIC_DIR = '{}/static'.format(SCRIPT_DIR)
NAVIGATION_SIZE = 7
PREFETCH_SIZE = 5
ROW_COUNT = 5
LARGE_GALLERY_SIZE = 100
de... | [
"bottle.static_file",
"bottle.template",
"os.getenv",
"bottle.route",
"os.path.realpath",
"sys.exit",
"bottle.abort",
"bottle.run",
"bottle.redirect"
] | [((404, 432), 'bottle.route', 'route', (['"""/static/<path:path>"""'], {}), "('/static/<path:path>')\n", (409, 432), False, 'from bottle import abort, redirect, request, route, run, static_file, template\n'), ((506, 531), 'bottle.route', 'route', (['"""/img/<path:path>"""'], {}), "('/img/<path:path>')\n", (511, 531), F... |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | [
"tensorflow.shape",
"tensorflow.contrib.framework.create_global_step",
"tensorflow.placeholder",
"tensorflow.contrib.layers.fully_connected",
"tensorflow.Session",
"tensorflow.nn.dynamic_rnn",
"tensorflow.nn.rnn_cell.LSTMCell",
"tensorflow.train.AdamOptimizer",
"tensorflow.initialize_all_variables",... | [((1371, 1425), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32', '[None, None, feature_dims]'], {}), '(tf.float32, [None, None, feature_dims])\n', (1385, 1425), True, 'import tensorflow as tf\n'), ((1440, 1477), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32', '[None, 1]'], {}), '(tf.float32, [Non... |
import numpy as np
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
h = np.array(h)
dift = abs((t - h * 0.006) - a)
ans = np.argmin(dift) + 1
print(ans)
| [
"numpy.argmin",
"numpy.array"
] | [((115, 126), 'numpy.array', 'np.array', (['h'], {}), '(h)\n', (123, 126), True, 'import numpy as np\n'), ((171, 186), 'numpy.argmin', 'np.argmin', (['dift'], {}), '(dift)\n', (180, 186), True, 'import numpy as np\n')] |
# Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | [
"re.sub",
"torch.tensor",
"torchmetrics.utilities.rank_zero_warn",
"collections.Counter"
] | [((6752, 6763), 'torch.tensor', 'tensor', (['(0.0)'], {}), '(0.0)\n', (6758, 6763), False, 'from torch import Tensor, tensor\n'), ((6782, 6793), 'torch.tensor', 'tensor', (['(0.0)'], {}), '(0.0)\n', (6788, 6793), False, 'from torch import Tensor, tensor\n'), ((6806, 6815), 'torch.tensor', 'tensor', (['(0)'], {}), '(0)\... |
import unittest
import random
import cabac
class MainTest(unittest.TestCase):
def test_enc_dec(self):
p1_init = 0.6
shift_idx = 8
bitsToEncode = [random.randint(0, 1) for _ in range(0, 1000)]
enc = cabac.cabacEncoder()
enc.initCtx([(p1_init, shift_idx), (p1_init, shift_idx... | [
"unittest.main",
"cabac.cabacDecoder",
"random.randint",
"cabac.cabacEncoder"
] | [((2957, 2972), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2970, 2972), False, 'import unittest\n'), ((237, 257), 'cabac.cabacEncoder', 'cabac.cabacEncoder', ([], {}), '()\n', (255, 257), False, 'import cabac\n'), ((689, 711), 'cabac.cabacDecoder', 'cabac.cabacDecoder', (['bs'], {}), '(bs)\n', (707, 711), Fal... |
import torch
from timm.models import vision_transformer
from PIL import Image
from torch import nn
import os
import tarfile
import numpy as np
import random
import io
import torch
from torchvision import transforms
STRIDE = 1
EXTRACTION_FPS = 25
NUM_FRAMES = 4
def _sample_video_idx(vlen):
frame_stride = STRIDE * E... | [
"torchvision.transforms.CenterCrop",
"tarfile.open",
"timm.models.vision_transformer.timesformer_base_patch16_224",
"random.choice",
"PIL.Image.new",
"torch.load",
"torch.stack",
"os.path.join",
"io.BytesIO",
"numpy.linspace",
"torchvision.transforms.Normalize",
"pdb.set_trace",
"torchvision... | [((907, 977), 'timm.models.vision_transformer.timesformer_base_patch16_224', 'vision_transformer.timesformer_base_patch16_224', ([], {'num_frames': 'NUM_FRAMES'}), '(num_frames=NUM_FRAMES)\n', (954, 977), False, 'from timm.models import vision_transformer\n'), ((991, 1004), 'torch.nn.Identity', 'nn.Identity', ([], {}),... |
# Generated by Django 2.0.6 on 2018-06-05 09:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='news',
name='sku',
field=mod... | [
"django.db.models.CharField"
] | [((317, 429), 'django.db.models.CharField', 'models.CharField', ([], {'default': '"""vxY6mlScUwA"""', 'help_text': '"""Unique code for refrence to supervisors"""', 'max_length': '(15)'}), "(default='vxY6mlScUwA', help_text=\n 'Unique code for refrence to supervisors', max_length=15)\n", (333, 429), False, 'from djan... |
import logging
from collections import namedtuple
from inspect import ismodule
from sqlalchemy import inspect
Attribute = namedtuple('Attribute', ['name', 'repr'])
Attribute_Group = namedtuple('Attribute_Group', ['attributes', 'name'])
def doc_header(o):
try:
return o.__doc__.split('\n')[0]
except (... | [
"sqlalchemy.inspect",
"logging.getLevelName",
"inspect.ismodule",
"collections.namedtuple"
] | [((124, 165), 'collections.namedtuple', 'namedtuple', (['"""Attribute"""', "['name', 'repr']"], {}), "('Attribute', ['name', 'repr'])\n", (134, 165), False, 'from collections import namedtuple\n'), ((184, 237), 'collections.namedtuple', 'namedtuple', (['"""Attribute_Group"""', "['attributes', 'name']"], {}), "('Attribu... |
from multiprocessing import Process,Pipe
import subprocess
import os
import time
def f(n):
subprocess.call(['/bin/bash', '-c',"python3 server_test.py 1234"])
def g(n):
n.send(subprocess.check_call(['/bin/bash', '-c',"time ./client1 [IP] 1234 chat.jpg | grep real >> res.txt "]))
n.close()
if __name__ == '... | [
"subprocess.check_call",
"multiprocessing.Process",
"time.sleep",
"subprocess.call",
"multiprocessing.Pipe"
] | [((96, 163), 'subprocess.call', 'subprocess.call', (["['/bin/bash', '-c', 'python3 server_test.py 1234']"], {}), "(['/bin/bash', '-c', 'python3 server_test.py 1234'])\n", (111, 163), False, 'import subprocess\n'), ((361, 367), 'multiprocessing.Pipe', 'Pipe', ([], {}), '()\n', (365, 367), False, 'from multiprocessing im... |
import pytest
import numpy as np
from numpy.testing import assert_array_equal, assert_array_almost_equal
from pandas.testing import assert_frame_equal
import pandas as pd
import matplotlib
from pdpbox.pdp import pdp_isolate, pdp_plot
class TestPDPIsolateBinary(object):
def test_pdp_isolate_binary_feature(
... | [
"pdpbox.pdp.pdp_plot",
"pdpbox.pdp.pdp_isolate"
] | [((6613, 6900), 'pdpbox.pdp.pdp_isolate', 'pdp_isolate', ([], {'model': 'otto_model', 'dataset': 'otto_data', 'model_features': 'otto_features', 'feature': '"""feat_67"""', 'num_grid_points': '(10)', 'grid_type': '"""percentile"""', 'percentile_range': 'None', 'grid_range': 'None', 'cust_grid_points': 'None', 'memory_l... |
import ipfsapi
import signal
from R8Storage.storage_handler import StorageHandler
from os import remove
from contextlib import contextmanager
@contextmanager
def time_limit(seconds):
def signal_handler(signum, frame):
raise Exception("Timed out!")
signal.signal(signal.SIGALRM, signal_handler)
sign... | [
"signal.signal",
"ipfsapi.connect",
"signal.alarm",
"os.remove"
] | [((266, 311), 'signal.signal', 'signal.signal', (['signal.SIGALRM', 'signal_handler'], {}), '(signal.SIGALRM, signal_handler)\n', (279, 311), False, 'import signal\n'), ((316, 337), 'signal.alarm', 'signal.alarm', (['seconds'], {}), '(seconds)\n', (328, 337), False, 'import signal\n'), ((382, 397), 'signal.alarm', 'sig... |
from collections import Iterable, OrderedDict, Mapping
from functools import reduce
from devito.tools.utils import filter_sorted, flatten
__all__ = ['toposort']
def build_dependence_lists(elements):
"""
Given an iterable of dependences, return the dependence lists as a
mapper suitable for graph-like alg... | [
"collections.OrderedDict",
"devito.tools.utils.filter_sorted",
"devito.tools.utils.flatten"
] | [((496, 509), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (507, 509), False, 'from collections import Iterable, OrderedDict, Mapping\n'), ((2068, 2090), 'devito.tools.utils.filter_sorted', 'filter_sorted', (['ordered'], {}), '(ordered)\n', (2081, 2090), False, 'from devito.tools.utils import filter_sort... |
import asyncio
import aiohttp
import ssl
import json
from aiohttp import web
from .db import Manager, RemoteManager, LocalManager
import aiohttp_debugtoolbar
from .settings import settings
from aiohttp_debugtoolbar import toolbar_middleware_factory
def get_ssl():
""" prepare ssl context """
key = settings["ss... | [
"json.loads",
"ssl.SSLContext",
"aiohttp.web.Response",
"aiohttp.web.Application",
"json.dumps",
"aiohttp_debugtoolbar.setup",
"aiohttp.web.json_response",
"asyncio.get_event_loop",
"aiohttp.web.WebSocketResponse"
] | [((5187, 5211), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (5209, 5211), False, 'import asyncio\n'), ((373, 389), 'ssl.SSLContext', 'ssl.SSLContext', ([], {}), '()\n', (387, 389), False, 'import ssl\n'), ((1915, 1938), 'aiohttp.web.WebSocketResponse', 'web.WebSocketResponse', ([], {}), '()\n'... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from swine.window import Window, Layer
from src.scripts.scenes.game import SceneGame
window = Window()
snow = Layer(window, "Snow")
logs = Layer(window, "Logs")
player = Layer(window, "Player")
rocks = Layer(window, "Rocks")
leaves = Layer(window, "Leaves")
game = Scene... | [
"swine.window.Window",
"src.scripts.scenes.game.SceneGame",
"swine.window.Layer"
] | [((142, 150), 'swine.window.Window', 'Window', ([], {}), '()\n', (148, 150), False, 'from swine.window import Window, Layer\n'), ((159, 180), 'swine.window.Layer', 'Layer', (['window', '"""Snow"""'], {}), "(window, 'Snow')\n", (164, 180), False, 'from swine.window import Window, Layer\n'), ((188, 209), 'swine.window.La... |
"""Setup script."""
from setuptools import setup, find_packages
setup(
name='distributed_cox',
version='0.1dev',
packages=find_packages(),
entry_points={
'console_scripts': [
'distributed_cmd=distributed_cox.distributed.cmd:main'
],
},
python_requires='>=3.6',
i... | [
"setuptools.find_packages"
] | [((136, 151), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (149, 151), False, 'from setuptools import setup, find_packages\n')] |
import logging
import unittest as ut
from collections import defaultdict, deque, OrderedDict
from ....validators.one import JustCall
from ....exceptions import CallableError
from ....functional import CompositionOf
class TestJustCall(ut.TestCase):
def test_works_with_sane_callable(self):
inp = lambda x: ... | [
"unittest.main",
"collections.OrderedDict",
"collections.deque",
"collections.defaultdict"
] | [((13581, 13590), 'unittest.main', 'ut.main', ([], {}), '()\n', (13588, 13590), True, 'import unittest as ut\n'), ((3358, 3371), 'collections.deque', 'deque', (['[1, 2]'], {}), '([1, 2])\n', (3363, 3371), False, 'from collections import defaultdict, deque, OrderedDict\n'), ((3810, 3823), 'collections.deque', 'deque', (... |
from ..models import order, all_models
from numpy import ndarray
from cvxopt import matrix
import logging
logger = logging.getLogger(__name__)
class DevMan(object):
"""
Device Manager class.
Maintains the loaded model list, groups and categories
"""
def __init__(self, system=None):
"""c... | [
"logging.getLogger"
] | [((116, 143), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (133, 143), False, 'import logging\n')] |
"""empty message
Revision ID: d85a62333272
Revises: 3<PASSWORD>
Create Date: 2017-07-07 16:03:23.842734
"""
from pgadmin.model import db
# revision identifiers, used by Alembic.
revision = 'd85a62333272'
down_revision = '<PASSWORD>'
branch_labels = None
depends_on = None
def upgrade():
db.engine.execute(
... | [
"pgadmin.model.db.engine.execute"
] | [((298, 360), 'pgadmin.model.db.engine.execute', 'db.engine.execute', (['"""ALTER TABLE server ADD COLUMN db_res TEXT"""'], {}), "('ALTER TABLE server ADD COLUMN db_res TEXT')\n", (315, 360), False, 'from pgadmin.model import db\n')] |
#!/usr/bin/env python
from distutils.core import setup
setup(
name='django-tumblog',
version='0.1',
description='Django Tumblr clonse',
author='<NAME>',
author_email='<EMAIL>',
url='http://www.github.com/lygaret/django-tumblog',
packages=[
'tumblog',... | [
"distutils.core.setup"
] | [((57, 361), 'distutils.core.setup', 'setup', ([], {'name': '"""django-tumblog"""', 'version': '"""0.1"""', 'description': '"""Django Tumblr clonse"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'url': '"""http://www.github.com/lygaret/django-tumblog"""', 'packages': "['tumblog', 'tumblog.models', 'tum... |
from django.http import HttpResponseRedirect
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_exempt
from django.views.generic import ListView, DetailView, CreateView, UpdateView, DeleteView
try:
from extra_views import ModelFormSetView
except ImportError:
Mode... | [
"django.utils.decorators.method_decorator"
] | [((9501, 9530), 'django.utils.decorators.method_decorator', 'method_decorator', (['csrf_exempt'], {}), '(csrf_exempt)\n', (9517, 9530), False, 'from django.utils.decorators import method_decorator\n')] |
# -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html
from scrapy.pipelines.files import FilesPipeline
from scrapy.utils.misc import arg_to_iter
from twisted.internet.defe... | [
"twisted.internet.defer.DeferredList"
] | [((970, 1006), 'twisted.internet.defer.DeferredList', 'DeferredList', (['dlist'], {'consumeErrors': '(1)'}), '(dlist, consumeErrors=1)\n', (982, 1006), False, 'from twisted.internet.defer import DeferredList\n')] |
# coding: utf-8
# DMUtils.py
# Dark Matter rate calculator as part of WIMpy_NREFT
#
# Author: <NAME>
# Email: <EMAIL>
# Last updated: 02/03/2018
import numpy as np
from numpy import pi, cos, sin
from scipy.integrate import trapz, cumtrapz, quad
from scipy.interpolate import interp1d
from numpy.random import rand
fro... | [
"numpy.clip",
"numpy.sqrt",
"numpy.minimum",
"scipy.integrate.quad",
"numpy.exp",
"os.path.realpath",
"numpy.zeros",
"scipy.special.erf",
"numpy.cos",
"numpy.sin",
"numpy.vectorize"
] | [((1890, 1921), 'numpy.clip', 'np.clip', (['vel_integral', '(0)', '(1e+30)'], {}), '(vel_integral, 0, 1e+30)\n', (1897, 1921), True, 'import numpy as np\n'), ((3912, 3938), 'numpy.sqrt', 'np.sqrt', (['(2 * m_N * amu * E)'], {}), '(2 * m_N * amu * E)\n', (3919, 3938), True, 'import numpy as np\n'), ((4098, 4152), 'numpy... |
import numpy as np
from cgn import LinearConstraint, Parameter
from cgn.translator.get_sub_matrix import get_sub_matrix
def test_get_sub_matrix():
n1 = 13
n2 = 1
n3 = 3
c = 10
x1 = Parameter(start=np.zeros(n1), name="x1")
x2 = Parameter(start=np.zeros(n2), name="x2")
x3 = Parameter(start... | [
"cgn.LinearConstraint",
"numpy.isclose",
"cgn.translator.get_sub_matrix.get_sub_matrix",
"numpy.zeros",
"numpy.concatenate",
"numpy.random.randn"
] | [((355, 377), 'numpy.random.randn', 'np.random.randn', (['c', 'n1'], {}), '(c, n1)\n', (370, 377), True, 'import numpy as np\n'), ((387, 409), 'numpy.random.randn', 'np.random.randn', (['c', 'n2'], {}), '(c, n2)\n', (402, 409), True, 'import numpy as np\n'), ((419, 441), 'numpy.random.randn', 'np.random.randn', (['c', ... |
from aioalfacrm.entities import Branch
def test_init_branch():
branch = Branch(
id=1,
name='First branch',
is_active=True,
subject_ids=[1, 2, 3],
weight=1,
)
assert branch.id == 1
assert branch.name == 'First branch'
assert branch.is_active is True
asse... | [
"aioalfacrm.entities.Branch"
] | [((78, 164), 'aioalfacrm.entities.Branch', 'Branch', ([], {'id': '(1)', 'name': '"""First branch"""', 'is_active': '(True)', 'subject_ids': '[1, 2, 3]', 'weight': '(1)'}), "(id=1, name='First branch', is_active=True, subject_ids=[1, 2, 3],\n weight=1)\n", (84, 164), False, 'from aioalfacrm.entities import Branch\n')... |
from beverage import CoffeeWithHook, TeaWithHook
def main():
tea = TeaWithHook()
coffee = CoffeeWithHook()
print("Making tea...")
tea.prepareRecipe()
print("\nMaking coffee...")
coffee.prepareRecipe()
if __name__ == "__main__":
main()
| [
"beverage.TeaWithHook",
"beverage.CoffeeWithHook"
] | [((73, 86), 'beverage.TeaWithHook', 'TeaWithHook', ([], {}), '()\n', (84, 86), False, 'from beverage import CoffeeWithHook, TeaWithHook\n'), ((100, 116), 'beverage.CoffeeWithHook', 'CoffeeWithHook', ([], {}), '()\n', (114, 116), False, 'from beverage import CoffeeWithHook, TeaWithHook\n')] |
from threading import current_thread
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from .config import GAME_MODE, ORDER_MODE
from pydantic import BaseModel
from typing import Optional
import queue
class Payload(BaseModel):
mode: int
flavor: str
toppings: Optional[list] = ... | [
"queue.Queue",
"fastapi.FastAPI"
] | [((331, 340), 'fastapi.FastAPI', 'FastAPI', ([], {}), '()\n', (338, 340), False, 'from fastapi import FastAPI\n'), ((687, 700), 'queue.Queue', 'queue.Queue', ([], {}), '()\n', (698, 700), False, 'import queue\n')] |
import os
import sys
import time
from unittest import TextTestResult
from xml.etree import ElementTree as ET
from django.test.runner import DiscoverRunner
from django.utils.encoding import smart_text
class EXMLTestResult(TextTestResult):
def __init__(self, *args, **kwargs):
self.case_start_time = time.t... | [
"os.path.exists",
"os.makedirs",
"sys.stderr.getvalue",
"os.path.join",
"xml.etree.ElementTree.Element",
"xml.etree.ElementTree.ElementTree",
"django.utils.encoding.smart_text",
"sys.stdout.getvalue",
"xml.etree.ElementTree.SubElement",
"time.time"
] | [((314, 325), 'time.time', 'time.time', ([], {}), '()\n', (323, 325), False, 'import time\n'), ((511, 522), 'time.time', 'time.time', ([], {}), '()\n', (520, 522), False, 'import time\n'), ((624, 647), 'xml.etree.ElementTree.Element', 'ET.Element', (['"""testsuite"""'], {}), "('testsuite')\n", (634, 647), True, 'from x... |
import scout_apm.api
from alvinchow_backend.app import config
from alvinchow_backend.lib import get_logger
from alvinchow_backend.db import get_session
from alvinchow.grpc.server.interceptors import DefaultInterceptor as _DefaultInterceptor
grpc_logger = get_logger('grpc_request')
def cleanup_sqlalchemy_session():... | [
"alvinchow_backend.lib.get_logger",
"alvinchow_backend.db.get_session"
] | [((258, 284), 'alvinchow_backend.lib.get_logger', 'get_logger', (['"""grpc_request"""'], {}), "('grpc_request')\n", (268, 284), False, 'from alvinchow_backend.lib import get_logger\n'), ((335, 348), 'alvinchow_backend.db.get_session', 'get_session', ([], {}), '()\n', (346, 348), False, 'from alvinchow_backend.db import... |
from datetime import datetime, date, timedelta, time
from django.contrib.auth.models import User
from django.utils.text import slugify
from api.helper import EMP_GROUP2, EMP_GROUP3
from api.utils import to_int
from restapi.serializers.team import PendingInwardPaymentEntrySerializer, OutWardPaymentSerializer
from rest... | [
"restapi.serializers.team.PendingInwardPaymentEntrySerializer",
"team.models.Invoice.objects.filter",
"team.models.CreditNoteCustomer.objects.filter",
"team.models.DebitNoteSupplierDirectAdvance.objects.filter",
"datetime.timedelta",
"datetime.time",
"team.helper.helper.to_float",
"team.models.OutWard... | [((3679, 3698), 'api.utils.to_int', 'to_int', (['payment.tds'], {}), '(payment.tds)\n', (3685, 3698), False, 'from api.utils import to_int\n'), ((3718, 3740), 'api.utils.to_int', 'to_int', (['payment.amount'], {}), '(payment.amount)\n', (3724, 3740), False, 'from api.utils import to_int\n'), ((11239, 11256), 'datetime.... |
# Code generated by `typeddictgen`. DO NOT EDIT.
"""V1CustomResourceValidationDict generated type."""
from typing import TypedDict
from kubernetes_typed.client import V1JSONSchemaPropsDict
V1CustomResourceValidationDict = TypedDict(
"V1CustomResourceValidationDict",
{
"openAPIV3Schema": V1JSONSchemaPr... | [
"typing.TypedDict"
] | [((224, 328), 'typing.TypedDict', 'TypedDict', (['"""V1CustomResourceValidationDict"""', "{'openAPIV3Schema': V1JSONSchemaPropsDict}"], {'total': '(False)'}), "('V1CustomResourceValidationDict', {'openAPIV3Schema':\n V1JSONSchemaPropsDict}, total=False)\n", (233, 328), False, 'from typing import TypedDict\n')] |
import rlp
from rlp.sedes import (
Boolean,
)
from eth_typing import (
Hash32,
)
from eth2.beacon._utils.hash import (
hash_eth2,
)
from .attestation_data import (
AttestationData,
)
class AttestationDataAndCustodyBit(rlp.Serializable):
"""
Note: using RLP until we have standardized serializ... | [
"rlp.encode"
] | [((815, 836), 'rlp.encode', 'rlp.encode', (['self.data'], {}), '(self.data)\n', (825, 836), False, 'import rlp\n')] |
from __future__ import print_function
import os
import sys
from distutils.core import setup, Extension
# Need an 'open' function that supports the 'encoding' argument:
if sys.version_info[0] < 3:
from codecs import open
## Command-line argument parsing
# --with-zlib: use zlib for compressing and decompressing
# ... | [
"os.path.exists",
"os.listdir",
"distutils.core.setup",
"os.environ.get",
"os.path.join",
"sys.exit",
"distutils.core.Extension",
"codecs.open"
] | [((2308, 2470), 'distutils.core.Extension', 'Extension', (['"""_pylibmc"""', "['src/_pylibmcmodule.c']"], {'libraries': 'libs', 'include_dirs': 'incdirs', 'library_dirs': 'libdirs', 'define_macros': 'defs', 'extra_compile_args': 'cflags'}), "('_pylibmc', ['src/_pylibmcmodule.c'], libraries=libs,\n include_dirs=incdi... |
# Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
from django.test import TestCase
from django.core.management import call_command
class TestFlushMemcache(TestCase):
def test_run(self):
call_command('memcache', '-f')
call_command('memcache', '--flush')
... | [
"django.core.management.call_command"
] | [((239, 269), 'django.core.management.call_command', 'call_command', (['"""memcache"""', '"""-f"""'], {}), "('memcache', '-f')\n", (251, 269), False, 'from django.core.management import call_command\n'), ((278, 313), 'django.core.management.call_command', 'call_command', (['"""memcache"""', '"""--flush"""'], {}), "('me... |
from octosql_py import octosql_py
from octosql_py.core.storage.json import OctoSQLSourceJSON
from octosql_py.core.storage.static import OctoSQLSourceStatic
import octosql_py_native
octo = octosql_py.OctoSQL()
conn = octo.connect([
OctoSQLSourceStatic("lol", [
{ "a": 99 }
]),
OctoSQLSourceJSON("lol... | [
"octosql_py.core.storage.json.OctoSQLSourceJSON",
"octosql_py.core.storage.static.OctoSQLSourceStatic",
"octosql_py.octosql_py.OctoSQL"
] | [((189, 209), 'octosql_py.octosql_py.OctoSQL', 'octosql_py.OctoSQL', ([], {}), '()\n', (207, 209), False, 'from octosql_py import octosql_py\n'), ((237, 276), 'octosql_py.core.storage.static.OctoSQLSourceStatic', 'OctoSQLSourceStatic', (['"""lol"""', "[{'a': 99}]"], {}), "('lol', [{'a': 99}])\n", (256, 276), False, 'fr... |
#!/usr/bin/python
# Copyright 2015 Google Inc. 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 a... | [
"logging.basicConfig",
"httplib.HTTPConnection",
"logging.info",
"sys.exit"
] | [((2732, 2755), 'logging.info', 'logging.info', (['"""failure"""'], {}), "('failure')\n", (2744, 2755), False, 'import logging\n'), ((2760, 2771), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (2768, 2771), False, 'import sys\n'), ((2805, 2844), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.IN... |
# coding:utf-8
from django.contrib.auth.models import User
from .models import WeChatUser, PhoneUser, FeedBack, StarList, BookListComment
from rest_framework.serializers import (
SerializerMethodField,
ModelSerializer,
ValidationError,
DateTimeField,
CharField,
IntegerField,
)
f... | [
"rest_framework.serializers.EmailField",
"rest_framework.serializers.IntegerField",
"rest_framework.serializers.SerializerMethodField",
"rest_framework.serializers.ValidationError",
"rest_framework.serializers.CharField",
"django.contrib.auth.models.User.objects.get"
] | [((907, 930), 'rest_framework.serializers.SerializerMethodField', 'SerializerMethodField', ([], {}), '()\n', (928, 930), False, 'from rest_framework.serializers import SerializerMethodField, ModelSerializer, ValidationError, DateTimeField, CharField, IntegerField\n'), ((951, 974), 'rest_framework.serializers.Serializer... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------
# cssqc/noUnderscores.py
#
# Do not underscores in class, id and mixin names.
# ----------------------------------------------------------------
# copyright (c) 2014 - <NAME>
# Distributed under The MIT Li... | [
"cssqc.qualityWarning.QualityWarning"
] | [((831, 918), 'cssqc.qualityWarning.QualityWarning', 'QualityWarning', (['"""noUnderscores"""', 'i.lineno', '(\'Underscore appears in "%s".\' % i.value)'], {}), '(\'noUnderscores\', i.lineno, \'Underscore appears in "%s".\' % i\n .value)\n', (845, 918), False, 'from cssqc.qualityWarning import QualityWarning\n')] |
from django.conf.urls import url
from polls.views import DetailView, IndexView, results, vote
urlpatterns = [
url(r'^$', IndexView.as_view(), name='polls_list'),
url(r'^(?P<pk>[0-9]+)/$', DetailView.as_view(), name='poll_detail'),
url(r'^(?P<question_id>[0-9]+)/vote/$', vote, name='vote'),
url(r'^(?P<... | [
"django.conf.urls.url",
"polls.views.IndexView.as_view",
"polls.views.DetailView.as_view"
] | [((245, 302), 'django.conf.urls.url', 'url', (['"""^(?P<question_id>[0-9]+)/vote/$"""', 'vote'], {'name': '"""vote"""'}), "('^(?P<question_id>[0-9]+)/vote/$', vote, name='vote')\n", (248, 302), False, 'from django.conf.urls import url\n'), ((309, 375), 'django.conf.urls.url', 'url', (['"""^(?P<question_id>[0-9]+)/resul... |
import pandas as pd
pd.options.display.max_columns = 6
# Data-frame
df = pd.read_csv(r"http://sololearn.com/uploads/files/titanic.csv")
# r"C:\Users\dream\Desktop\Python\machine_learning\machine_learrning\titanic.csv"
# Table
# print(df.describe())
# Panda Series
# col = df["Fare"]
# print(col)
# Small Data-frame
... | [
"pandas.read_csv"
] | [((75, 136), 'pandas.read_csv', 'pd.read_csv', (['"""http://sololearn.com/uploads/files/titanic.csv"""'], {}), "('http://sololearn.com/uploads/files/titanic.csv')\n", (86, 136), True, 'import pandas as pd\n')] |
from mechanism import Vector, get_joints, Mechanism
import numpy as np
import matplotlib.pyplot as plt
O2, O4, O6, A, B, C, D, E, F, G = get_joints('O2 O4 O6 A B C D E F G')
a = Vector((O4, B), r=2.5)
b = Vector((B, A), r=8.4)
c = Vector((O4, O2), r=12.5, theta=0, style='ground')
d = Vector((O2, A), r=5)
e = Vector((C... | [
"numpy.array",
"mechanism.Vector",
"numpy.zeros",
"numpy.deg2rad",
"mechanism.get_joints",
"matplotlib.pyplot.show"
] | [((138, 174), 'mechanism.get_joints', 'get_joints', (['"""O2 O4 O6 A B C D E F G"""'], {}), "('O2 O4 O6 A B C D E F G')\n", (148, 174), False, 'from mechanism import Vector, get_joints, Mechanism\n'), ((179, 201), 'mechanism.Vector', 'Vector', (['(O4, B)'], {'r': '(2.5)'}), '((O4, B), r=2.5)\n', (185, 201), False, 'fro... |
import bcrypt
from django.db import models
import random
import logging
# Get an instance of a logger
logger = logging.getLogger(__name__)
class UserModel(models.Model):
DoesNotExist = None
objects = None
username = models.CharField(max_length=50)
password_hash = models.CharField(max_length=100)
... | [
"logging.getLogger",
"random.getrandbits",
"django.db.models.DateTimeField",
"django.db.models.CharField",
"bcrypt.hashpw"
] | [((112, 139), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (129, 139), False, 'import logging\n'), ((231, 262), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(50)'}), '(max_length=50)\n', (247, 262), False, 'from django.db import models\n'), ((283, 315), 'django... |
# coding=utf-8
from sklearn import preprocessing
import numpy as np
import os
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
# import tensorflow as tf
from helper import linear_regression as lr # my own module
from helper import general as general
data = pd.read_csv('ex1data1.txt', names=['... | [
"seaborn.lmplot",
"pandas.read_csv",
"helper.general.get_y",
"numpy.zeros",
"helper.linear_regression.cost",
"helper.linear_regression.batch_gradient_decent",
"sklearn.preprocessing.MaxAbsScaler",
"helper.general.get_X"
] | [((284, 343), 'pandas.read_csv', 'pd.read_csv', (['"""ex1data1.txt"""'], {'names': "['population', 'profit']"}), "('ex1data1.txt', names=['population', 'profit'])\n", (295, 343), True, 'import pandas as pd\n'), ((385, 449), 'seaborn.lmplot', 'sns.lmplot', (['"""population"""', '"""profit"""', 'data'], {'size': '(10)', ... |
import ex108
n1 = int(input('Digite um valor: R$: '))
print(f'A metade de {ex108.moeda(n1)} é {ex108.moeda(ex108.metade(n1))}')
print(f'O dobro de {ex108.moeda(n1)} é {ex108.moeda(ex108.dobro(n1))}')
print(f'O aumento de 10% é {ex108.moeda(ex108.aumentar(n1,10))}')
print(f'A redução de 10% é {ex108.moeda(ex108.diminuir... | [
"ex108.moeda",
"ex108.dobro",
"ex108.aumentar",
"ex108.diminuir",
"ex108.metade"
] | [((75, 90), 'ex108.moeda', 'ex108.moeda', (['n1'], {}), '(n1)\n', (86, 90), False, 'import ex108\n'), ((148, 163), 'ex108.moeda', 'ex108.moeda', (['n1'], {}), '(n1)\n', (159, 163), False, 'import ex108\n'), ((108, 124), 'ex108.metade', 'ex108.metade', (['n1'], {}), '(n1)\n', (120, 124), False, 'import ex108\n'), ((181,... |
import os
from collections import Counter, defaultdict
from seqcluster.libs.classes import quality, umi
from itertools import product
import gzip
import re
import logging
logger = logging.getLogger('seqbuster')
def collapse(in_file):
"""collapse identical sequences and keep Q"""
keep = Counter()
with ope... | [
"logging.getLogger",
"seqcluster.libs.classes.umi",
"gzip.open",
"itertools.product",
"os.path.splitext",
"seqcluster.libs.classes.quality",
"collections.Counter",
"collections.defaultdict"
] | [((182, 212), 'logging.getLogger', 'logging.getLogger', (['"""seqbuster"""'], {}), "('seqbuster')\n", (199, 212), False, 'import logging\n'), ((298, 307), 'collections.Counter', 'Counter', ([], {}), '()\n', (305, 307), False, 'from collections import Counter, defaultdict\n'), ((997, 1014), 'collections.defaultdict', 'd... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | [
"proto.RepeatedField",
"proto.Field",
"proto.module"
] | [((648, 829), 'proto.module', 'proto.module', ([], {'package': '"""google.cloud.documentai.v1"""', 'manifest': "{'RawDocument', 'GcsDocument', 'GcsDocuments', 'GcsPrefix',\n 'BatchDocumentsInputConfig', 'DocumentOutputConfig'}"}), "(package='google.cloud.documentai.v1', manifest={'RawDocument',\n 'GcsDocument', '... |
import mock
import random
from django import test
from django.utils import six
from ginger import utils
from ginger.paginator import GingerPaginator
def parse_url(url):
parts = six.moves.urllib.parse.urlparse(url)
return six.moves.urllib.parse.parse_qs(parts.query)
class TestGingerPaginator(test.SimpleTest... | [
"django.test.RequestFactory",
"django.utils.six.moves.urllib.parse.urlparse",
"ginger.paginator.GingerPaginator",
"django.utils.six.moves.urllib.parse.parse_qs",
"random.randint"
] | [((184, 220), 'django.utils.six.moves.urllib.parse.urlparse', 'six.moves.urllib.parse.urlparse', (['url'], {}), '(url)\n', (215, 220), False, 'from django.utils import six\n'), ((232, 276), 'django.utils.six.moves.urllib.parse.parse_qs', 'six.moves.urllib.parse.parse_qs', (['parts.query'], {}), '(parts.query)\n', (263,... |
import pygame
from pygame.locals import *
from sys import exit
from random import *
pygame.init()
screen = pygame.display.set_mode((640, 480), 0, 32)
screen.lock()
for count in range(10):
random_color = (randint(0,255), randint(0,255), randint(0,255))
random_pos = (randint(0,639), randint(0,479))
random... | [
"pygame.init",
"pygame.quit",
"pygame.event.get",
"pygame.display.set_mode",
"sys.exit",
"pygame.display.update"
] | [((87, 100), 'pygame.init', 'pygame.init', ([], {}), '()\n', (98, 100), False, 'import pygame\n'), ((110, 152), 'pygame.display.set_mode', 'pygame.display.set_mode', (['(640, 480)', '(0)', '(32)'], {}), '((640, 480), 0, 32)\n', (133, 152), False, 'import pygame\n'), ((485, 508), 'pygame.display.update', 'pygame.display... |
from legal_report_utils import loadConfig, checkGithubOrg
# Prerequisites:
# - Python 2.7+
# - git available on command-line
# - Apache Maven
# - Leiningen
# - npm install -g license-report
config = loadConfig()
checkGithubOrg(config)
| [
"legal_report_utils.loadConfig",
"legal_report_utils.checkGithubOrg"
] | [((201, 213), 'legal_report_utils.loadConfig', 'loadConfig', ([], {}), '()\n', (211, 213), False, 'from legal_report_utils import loadConfig, checkGithubOrg\n'), ((214, 236), 'legal_report_utils.checkGithubOrg', 'checkGithubOrg', (['config'], {}), '(config)\n', (228, 236), False, 'from legal_report_utils import loadCon... |
#Simple script which crawls a folder containing several sequence roots
#and loads all background frames in sequence names containing "empty"
#then reports scatterplot graphs of Hue vs. Value, Hue vs. Saturation,
#and Saturation vs. Value
import sys
import numpy as np
from FrameManager import *
from RGBTrainingTFWriter... | [
"matplotlib.colors.rgb_to_hsv",
"numpy.random.choice",
"numpy.array",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show"
] | [((1637, 1676), 'matplotlib.colors.rgb_to_hsv', 'matplotlib.colors.rgb_to_hsv', (['rgbFrames'], {}), '(rgbFrames)\n', (1665, 1676), False, 'import matplotlib\n'), ((1693, 1744), 'numpy.array', 'np.array', (['[[179.0, 255.0, 255.0]]'], {'dtype': 'np.float32'}), '([[179.0, 255.0, 255.0]], dtype=np.float32)\n', (1701, 174... |
import matplotlib.pyplot as plt
def _set_plot_style():
plt.style.use('ggplot')
plt.rcParams['text.color'] = 'black'
plt.rcParams['figure.max_open_warning'] = 0
return [i['color'] for i in plt.rcParams['axes.prop_cycle']] # type: ignore
| [
"matplotlib.pyplot.style.use"
] | [((61, 84), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""ggplot"""'], {}), "('ggplot')\n", (74, 84), True, 'import matplotlib.pyplot as plt\n')] |
# Generated by Django 3.2.8 on 2021-10-22 14:13
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('roster', '0080_auto_20211020_0923'),
('exams', '0028_mockcompleted'),
]
operations = [
migrations.RenameField(
model_name='mockc... | [
"django.db.migrations.AlterUniqueTogether",
"django.db.migrations.RenameField"
] | [((267, 355), 'django.db.migrations.RenameField', 'migrations.RenameField', ([], {'model_name': '"""mockcompleted"""', 'old_name': '"""test"""', 'new_name': '"""exam"""'}), "(model_name='mockcompleted', old_name='test',\n new_name='exam')\n", (289, 355), False, 'from django.db import migrations\n'), ((408, 504), 'dj... |
#!/usr/bin/env python3
# SPDX-FileCopyrightText: 2021 <NAME> <<EMAIL>>
#
# SPDX-License-Identifier: BSD-2-Clause
# vim: ts=4 expandtab
"""Final Fantasy XIV commands"""
from __future__ import annotations
from typing import Dict, List, Tuple
from collections import defaultdict
import datetime
import requests
import... | [
"datetime.datetime.utcfromtimestamp",
"collections.defaultdict",
"requests.get"
] | [((3696, 3713), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (3707, 3713), False, 'from collections import defaultdict\n'), ((2577, 2698), 'requests.get', 'requests.get', (['"""https://xivapi.com/character/search"""'], {'params': "{'name': name, 'server': server, 'private_key': self.key}"}), "(... |
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, IntegerField
from wtforms.validators import InputRequired, Length, ValidationError
from appi2c.ext.icon.icon_models import Icon
class IconForm(FlaskForm):
html_class = StringField('Class Html', validators=[InputRequired(), Length(max=60... | [
"wtforms.IntegerField",
"wtforms.validators.ValidationError",
"wtforms.SubmitField",
"wtforms.validators.Length",
"wtforms.validators.InputRequired"
] | [((364, 385), 'wtforms.SubmitField', 'SubmitField', (['"""Insert"""'], {}), "('Insert')\n", (375, 385), False, 'from wtforms import StringField, SubmitField, IntegerField\n'), ((657, 675), 'wtforms.IntegerField', 'IntegerField', (['"""id"""'], {}), "('id')\n", (669, 675), False, 'from wtforms import StringField, Submit... |
"""schema is a library for validating Python data structures, such as those
obtained from config-files, forms, external services or command-line
parsing, converted from JSON/YAML (or something else) to Python data-types."""
import re
import copy
try:
from contextlib import ExitStack
except ImportError:
from c... | [
"contextlib2.ExitStack",
"copy.deepcopy"
] | [((26842, 26853), 'contextlib2.ExitStack', 'ExitStack', ([], {}), '()\n', (26851, 26853), False, 'from contextlib2 import ExitStack\n'), ((44482, 44508), 'copy.deepcopy', 'copy.deepcopy', (['schema_dict'], {}), '(schema_dict)\n', (44495, 44508), False, 'import copy\n')] |
from binder.conn import Connection, REPEATABLE_READ, _VALID_ISOLATION_LEVELS
from binder.sqlgen import DIALECT_MYSQL
_ISOLATION_SQL = "SET SESSION TRANSACTION ISOLATION LEVEL %s"
class MysqlConnection(Connection):
def __init__(self, *args, **kwargs):
import MySQLdb
read_only = kwargs.pop('read_o... | [
"MySQLdb.connect",
"binder.conn.Connection.__init__"
] | [((714, 746), 'MySQLdb.connect', 'MySQLdb.connect', (['*args'], {}), '(*args, **kwargs)\n', (729, 746), False, 'import MySQLdb\n'), ((787, 861), 'binder.conn.Connection.__init__', 'Connection.__init__', (['self', 'dbconn', 'dberror', 'DIALECT_MYSQL', '"""%s"""', 'read_only'], {}), "(self, dbconn, dberror, DIALECT_MYSQL... |
import os
from unittest import TestCase
from py_jama_rest_client.client import JamaClient
from test import CountedJamaClient
jama_url = os.environ['JAMA_API_URL']
jama_api_client_id = os.environ['JAMA_API_CLIENT_ID']
jama_api_client_secret = os.environ['JAMA_API_CLIENT_SECRET']
class TestJamaClientIter(TestCase):
... | [
"py_jama_rest_client.client.JamaClient",
"test.CountedJamaClient"
] | [((337, 426), 'test.CountedJamaClient', 'CountedJamaClient', (['jama_url', '(jama_api_client_id, jama_api_client_secret)'], {'oauth': '(True)'}), '(jama_url, (jama_api_client_id, jama_api_client_secret),\n oauth=True)\n', (354, 426), False, 'from test import CountedJamaClient\n'), ((1111, 1189), 'py_jama_rest_client... |
import logging
import pickledb
logger = logging.getLogger(__name__)
class DB:
def __init__(self, cfg):
self.path = cfg.file_read_ids_database
self.db = pickledb.load(self.path, auto_dump=True)
def load(self, tax_id):
return self.db.lgetall(str(tax_id))[0]
def save(self, d):
... | [
"logging.getLogger",
"pickledb.load"
] | [((43, 70), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (60, 70), False, 'import logging\n'), ((177, 217), 'pickledb.load', 'pickledb.load', (['self.path'], {'auto_dump': '(True)'}), '(self.path, auto_dump=True)\n', (190, 217), False, 'import pickledb\n')] |
from garuda_dir.garuda_pb2 import Void
class GarudaCustom(object):
def CustomCallDemo(self, context, void):
'''
rpc CustomCallDemo(Void) returns (Void);
'''
print("Just a dummy RPC call")
return Void()
| [
"garuda_dir.garuda_pb2.Void"
] | [((241, 247), 'garuda_dir.garuda_pb2.Void', 'Void', ([], {}), '()\n', (245, 247), False, 'from garuda_dir.garuda_pb2 import Void\n')] |
from src.lib.TestSpec import Spec
from src.lib.AssertSpec import AssertSpec
from src.lib.AssertType import AssertType
from src.lib.Param import Param
from src.lib.ParamType import ParamType
from src.lib.Test import Test
import libraries
testspecs = [Spec(
repo="sbi",
filename="{0}/projects/sbi/tests/li... | [
"src.lib.Param.Param"
] | [((511, 640), 'src.lib.Param.Param', 'Param', ([], {'name': '"""num_samples"""', 'param_line': '(42)', 'param_col': '(18)', 'param_type': 'ParamType.ITER', 'default_val': '(1000)', 'value_range': '[100, 1000]'}), "(name='num_samples', param_line=42, param_col=18, param_type=ParamType\n .ITER, default_val=1000, value... |
# -*- coding: UTF-8 -*-
import arcpy
import re
import os
import codecs
#ツール定義
class FeatureToWKTCSV(object):
def __init__(self):
self.label = _("Feature To UTF-8 WKT CSV")
self.description = _("Creates a UTF-8 WKT CSV from specified features.")
self.category = _("DataManagement")
self.canRunInBac... | [
"arcpy.Describe",
"arcpy.da.SearchCursor",
"arcpy.ListFields",
"re.sub",
"codecs.open"
] | [((1274, 1300), 'arcpy.Describe', 'arcpy.Describe', (['inFeatures'], {}), '(inFeatures)\n', (1288, 1300), False, 'import arcpy\n'), ((1400, 1428), 'arcpy.ListFields', 'arcpy.ListFields', (['inFeatures'], {}), '(inFeatures)\n', (1416, 1428), False, 'import arcpy\n'), ((1715, 1759), 'arcpy.da.SearchCursor', 'arcpy.da.Sea... |
from scapy.all import sendp, Dot11, RadioTap, RandMAC
from datetime import datetime
import logging
from argparse import ArgumentParser, RawDescriptionHelpFormatter
import re
import sys
logger = logging.getLogger(__name__)
console_handler = logging.StreamHandler()
formatter = logging.Formatter(
'%(asctime)s - %(nam... | [
"logging.getLogger",
"logging.StreamHandler",
"argparse.ArgumentParser",
"logging.Formatter",
"re.match",
"datetime.datetime.now",
"scapy.all.RandMAC",
"scapy.all.RadioTap",
"sys.exit"
] | [((195, 222), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (212, 222), False, 'import logging\n'), ((241, 264), 'logging.StreamHandler', 'logging.StreamHandler', ([], {}), '()\n', (262, 264), False, 'import logging\n'), ((277, 350), 'logging.Formatter', 'logging.Formatter', (['"""%(asct... |
from flask import Blueprint, redirect, render_template , request ,session, g , current_app ,jsonify , flash ,send_from_directory,make_response
from werkzeug.utils import secure_filename
from db import User,db
from flask_socketio import emit
import logging
import os
from utils import *
import magic
import pandas as pd
... | [
"flask.render_template",
"flask.request.args.get",
"db.db.session.delete",
"pandas.read_csv",
"flask.request.form.to_dict",
"werkzeug.utils.secure_filename",
"logging.info",
"os.remove",
"flask.jsonify",
"os.path.exists",
"flask.send_from_directory",
"flask.flash",
"db.User.find",
"db.User... | [((328, 361), 'flask.Blueprint', 'Blueprint', (['"""main_route"""', '__name__'], {}), "('main_route', __name__)\n", (337, 361), False, 'from flask import Blueprint, redirect, render_template, request, session, g, current_app, jsonify, flash, send_from_directory, make_response\n'), ((482, 511), 'flask.request.args.get',... |
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 20 15:50:32 2022
@author: kkrao
"""
import os
import pandas as pd
import init
csvs = os.listdir(os.path.join(init.dir_root, "data","gee","all_states"))
df = pd.read_csv(os.path.join(init.dir_root, "data","gee",\
"lightnings_22_feb_2022_... | [
"pandas.DataFrame",
"os.path.splitext",
"os.path.join"
] | [((148, 204), 'os.path.join', 'os.path.join', (['init.dir_root', '"""data"""', '"""gee"""', '"""all_states"""'], {}), "(init.dir_root, 'data', 'gee', 'all_states')\n", (160, 204), False, 'import os\n'), ((222, 319), 'os.path.join', 'os.path.join', (['init.dir_root', '"""data"""', '"""gee"""', '"""lightnings_22_feb_2022... |
import xml.etree.ElementTree as ET
from freeswitch import *
"""
Freeswitch Azure bot Application
This script interacts with Azure echo bot API via UniMRCP server.
* Revision: 1
* Date: May 7, 2021
* Vendor: Universal Speech Solutions LLC
"""
class AzureBotApp:
"""A class representing ... | [
"xml.etree.ElementTree.fromstring"
] | [((1177, 1203), 'xml.etree.ElementTree.fromstring', 'ET.fromstring', (['self.result'], {}), '(self.result)\n', (1190, 1203), True, 'import xml.etree.ElementTree as ET\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on 2019年7月30日
@author: Irony
@site: https://pyqt5.com https://github.com/892768447
@email: <EMAIL>
@file: CustomWidgets.CLoadingBar
@description: Load strip
"""
from PyQt5.QtCore import Qt, QRectF, pyqtProperty, QPropertyAnimation,\
QEasingCurve... | [
"PyQt5.QtCore.pyqtProperty",
"PyQt5.QtGui.QPainter",
"PyQt5.QtGui.QColor",
"PyQt5.QtCore.QPropertyAnimation",
"PyQt5.QtWidgets.QProgressBar.update"
] | [((558, 575), 'PyQt5.QtGui.QColor', 'QColor', (['"""#2d8cf0"""'], {}), "('#2d8cf0')\n", (564, 575), False, 'from PyQt5.QtGui import QColor, QPainter\n'), ((595, 612), 'PyQt5.QtGui.QColor', 'QColor', (['"""#ed4014"""'], {}), "('#ed4014')\n", (601, 612), False, 'from PyQt5.QtGui import QColor, QPainter\n'), ((1474, 1491)... |
from shopyo.app import create_app
# CONFIG_JSON_PATH = os.path.dirname(os.path.abspath(__file__))
# try:
# if not os.path.exists("config.json"):
# trycopy("config_demo.json", "config.json")
# except Exception as e:
# print(e)
# sys.exit(1)
# with open(os.path.join(CONFIG_JSON_PATH, "config.json... | [
"shopyo.app.create_app"
] | [((413, 437), 'shopyo.app.create_app', 'create_app', (['"""production"""'], {}), "('production')\n", (423, 437), False, 'from shopyo.app import create_app\n')] |
#!/usr/bin/env python3
from find_terms import *
from DataDef import File
import dictionary
from refactoring_support import *
def main(args):
# global special_domains
Refactoring.run_filter_phase = False
file_list = args[1]
if len(args) > 2:
outfile_prefix = args[2]
else:
outfile_... | [
"DataDef.File",
"dictionary.initialize_utilities"
] | [((549, 582), 'dictionary.initialize_utilities', 'dictionary.initialize_utilities', ([], {}), '()\n', (580, 582), False, 'import dictionary\n'), ((619, 634), 'DataDef.File', 'File', (['file_list'], {}), '(file_list)\n', (623, 634), False, 'from DataDef import File\n')] |
import pybullet as p
import time
useMaximalCoordinates=False
p.connect(p.GUI)
pole = p.loadURDF("cartpole.urdf", useMaximalCoordinates=useMaximalCoordinates)
for i in range (p.getNumJoints(pole)):
#disable default constraint-based motors
p.setJointMotorControl2(pole,i,p.POSITION_CONTROL,targetPosition=0,force=0)
p... | [
"pybullet.getJointInfo",
"pybullet.readUserDebugParameter",
"pybullet.addUserDebugParameter",
"pybullet.connect",
"pybullet.getNumJoints",
"pybullet.setGravity",
"pybullet.setTimeStep",
"time.sleep",
"pybullet.stepSimulation",
"pybullet.setRealTimeSimulation",
"pybullet.isConnected",
"pybullet... | [((63, 79), 'pybullet.connect', 'p.connect', (['p.GUI'], {}), '(p.GUI)\n', (72, 79), True, 'import pybullet as p\n'), ((87, 159), 'pybullet.loadURDF', 'p.loadURDF', (['"""cartpole.urdf"""'], {'useMaximalCoordinates': 'useMaximalCoordinates'}), "('cartpole.urdf', useMaximalCoordinates=useMaximalCoordinates)\n", (97, 159... |
import numpy as np
from skimage import util, exposure, io, color
# from matplotlib import pyplot as plt
import cv2
def view_histogram_bw(image):
"""
Args: View the histogram of a black and white image
image: Float array of the image
Returns: Hist and its bin array
"""
hist, bins = np.histo... | [
"cv2.merge",
"skimage.util.invert",
"skimage.exposure.adjust_log",
"skimage.exposure.adjust_gamma",
"skimage.io.imread",
"cv2.equalizeHist",
"skimage.exposure.rescale_intensity",
"cv2.cvtColor",
"cv2.split",
"numpy.percentile",
"skimage.color.gray2rgb"
] | [((2188, 2217), 'numpy.percentile', 'np.percentile', (['image', '(2, 98)'], {}), '(image, (2, 98))\n', (2201, 2217), True, 'import numpy as np\n'), ((2236, 2289), 'skimage.exposure.rescale_intensity', 'exposure.rescale_intensity', (['image'], {'in_range': '(p2, p98)'}), '(image, in_range=(p2, p98))\n', (2262, 2289), Fa... |
# TG-UserBot - A modular Telegram UserBot script for Python.
# Copyright (C) 2019 Kandarp <https://github.com/kandnub>
#
# TG-UserBot is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | [
"ast.fix_missing_locations",
"ast.walk",
"ast.Load",
"ast.Store",
"ast.parse",
"ast.arg",
"ast.AsyncFunctionDef"
] | [((1634, 1657), 'ast.parse', 'ast.parse', (['code', '"""exec"""'], {}), "(code, 'exec')\n", (1643, 1657), False, 'import ast\n'), ((3668, 3704), 'ast.fix_missing_locations', 'ast.fix_missing_locations', (['glob_copy'], {}), '(glob_copy)\n', (3693, 3704), False, 'import ast\n'), ((3882, 3917), 'ast.fix_missing_locations... |
import heapq as heapq
class Vertex:
def __init__(self, id: int, birthday: int):
self.id = id
self.birthday = birthday
self.in_vertices = set([id])
self.out_vertices = set([id])
self.root = id
def __lt__(self, other):
return self.birthday < other.b... | [
"heapq.heappush",
"heapq.heappop"
] | [((5068, 5112), 'heapq.heappush', 'heapq.heappush', (['self.unprocessed_vertices', 'v'], {}), '(self.unprocessed_vertices, v)\n', (5082, 5112), True, 'import heapq as heapq\n'), ((5418, 5459), 'heapq.heappush', 'heapq.heappush', (['self.unprocessed_edges', 'e'], {}), '(self.unprocessed_edges, e)\n', (5432, 5459), True,... |
import numpy as np
import pytest
from skimage.measure import approximate_polygon, subdivide_polygon
from skimage.measure._polygon import _SUBDIVISION_MASKS
square = np.array([
[0, 0], [0, 1], [0, 2], [0, 3],
[1, 3], [2, 3], [3, 3],
[3, 2], [3, 1], [3, 0],
[2, 0], [1, 0], [0, 0]
])
def test_approximat... | [
"numpy.testing.assert_equal",
"skimage.measure.approximate_polygon",
"skimage.measure.subdivide_polygon",
"numpy.array",
"pytest.raises",
"numpy.testing.run_module_suite",
"numpy.testing.assert_array_equal"
] | [((166, 285), 'numpy.array', 'np.array', (['[[0, 0], [0, 1], [0, 2], [0, 3], [1, 3], [2, 3], [3, 3], [3, 2], [3, 1], [3,\n 0], [2, 0], [1, 0], [0, 0]]'], {}), '([[0, 0], [0, 1], [0, 2], [0, 3], [1, 3], [2, 3], [3, 3], [3, 2], [\n 3, 1], [3, 0], [2, 0], [1, 0], [0, 0]])\n', (174, 285), True, 'import numpy as np\n'... |
import logging
import os
import requests
logger = logging.getLogger(__name__)
class MonzoClientError(Exception):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
class MonzoClient(object):
_HTTPS = "https://"
_BASE_URL = "api.monzo.com/"
_WHOAMI = "ping/whoami/"
_... | [
"logging.getLogger",
"requests.get",
"requests.post",
"os.getenv"
] | [((51, 78), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (68, 78), False, 'import logging\n'), ((465, 489), 'os.getenv', 'os.getenv', (['"""MONZO_TOKEN"""'], {}), "('MONZO_TOKEN')\n", (474, 489), False, 'import os\n'), ((853, 891), 'requests.get', 'requests.get', (['req_url'], {'headers... |
import FWCore.ParameterSet.Config as cms
digiSamples_ = [1,2,3,4,5,6,7,8,9,10]
uncalibOOTAmps_ = [4,6]
ecalGpuTask = cms.untracked.PSet(
params = cms.untracked.PSet(
runGpuTask = cms.untracked.bool(False),
gpuOnlyPlots = cms.untracked.bool(True),
uncalibOOTAmps = cms.untracked.vint32(uncal... | [
"FWCore.ParameterSet.Config.untracked.double",
"FWCore.ParameterSet.Config.untracked.string",
"FWCore.ParameterSet.Config.untracked.vint32",
"FWCore.ParameterSet.Config.untracked.int32",
"FWCore.ParameterSet.Config.untracked.bool"
] | [((193, 218), 'FWCore.ParameterSet.Config.untracked.bool', 'cms.untracked.bool', (['(False)'], {}), '(False)\n', (211, 218), True, 'import FWCore.ParameterSet.Config as cms\n'), ((243, 267), 'FWCore.ParameterSet.Config.untracked.bool', 'cms.untracked.bool', (['(True)'], {}), '(True)\n', (261, 267), True, 'import FWCore... |
import detect_faces
import json
import http.client, urllib.request, urllib.parse, urllib.error, requests, json
from PIL import Image
def saveIds():
file = open("people.json")
data = json.loads(file.read())
file.close()
for person in data['people']:
response = detect_faces.get_fid_an... | [
"json.loads",
"json.dumps",
"detect_faces.get_fid_and_pred",
"requests.request",
"detect_faces.get_fid_and_pred_from_PIL_image"
] | [((723, 774), 'detect_faces.get_fid_and_pred_from_PIL_image', 'detect_faces.get_fid_and_pred_from_PIL_image', (['image'], {}), '(image)\n', (767, 774), False, 'import detect_faces\n'), ((791, 811), 'json.loads', 'json.loads', (['response'], {}), '(response)\n', (801, 811), False, 'import http.client, urllib.request, ur... |
from matalg.core.atoms import Symbol, MetaSymbol, \
RegularSymbol, SymbolSequence, Context
def test_Symbol():
pass
def test_MetaSymbol():
pass
def test_RegularSymbol():
pass
def test_SymbolSequence():
s = SymbolSequence()
assert len(s) == 0
sym1 = Symbol("a")
sym2 = RegularSymbol("b"... | [
"matalg.core.atoms.Context",
"matalg.core.atoms.Symbol",
"matalg.core.atoms.MetaSymbol",
"matalg.core.atoms.RegularSymbol",
"matalg.core.atoms.SymbolSequence"
] | [((229, 245), 'matalg.core.atoms.SymbolSequence', 'SymbolSequence', ([], {}), '()\n', (243, 245), False, 'from matalg.core.atoms import Symbol, MetaSymbol, RegularSymbol, SymbolSequence, Context\n'), ((280, 291), 'matalg.core.atoms.Symbol', 'Symbol', (['"""a"""'], {}), "('a')\n", (286, 291), False, 'from matalg.core.at... |
#import base64
#import binascii
from datetime import datetime
import json
import traceback
import sqlite3
from google.protobuf.json_format import MessageToJson, Parse, MessageToDict
from utils.sqlQueries import *
from utils.getData import *
DB_CONNECTION = sqlite3.connect("QRL_BC_DATA.sqlite3")
class SqliteDB... | [
"traceback.format_exc",
"datetime.datetime.now",
"sqlite3.connect"
] | [((265, 303), 'sqlite3.connect', 'sqlite3.connect', (['"""QRL_BC_DATA.sqlite3"""'], {}), "('QRL_BC_DATA.sqlite3')\n", (280, 303), False, 'import sqlite3\n'), ((1334, 1356), 'traceback.format_exc', 'traceback.format_exc', ([], {}), '()\n', (1354, 1356), False, 'import traceback\n'), ((1583, 1597), 'datetime.datetime.now... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `dicom_wsi` package."""
import datetime
import os
from yaml import load, BaseLoader
from ..dicom_wsi.base_attributes import build_base
from ..dicom_wsi.parse_wsi import get_wsi
from ..dicom_wsi.sequence_attributes import build_sequences
from ..dicom_wsi.shar... | [
"os.path.realpath",
"datetime.date.today",
"os.path.join"
] | [((469, 504), 'os.path.join', 'os.path.join', (['dir_path', '"""base.yaml"""'], {}), "(dir_path, 'base.yaml')\n", (481, 504), False, 'import os\n'), ((425, 451), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (441, 451), False, 'import os\n'), ((982, 1003), 'datetime.date.today', 'datetime.... |
from typing import List, Union
import pytest
from mockito import mock, unstub, verifyStubbedInvocationsAreUsed, when
from ...config import config
from ...core.entities.mod import Mod
from ...core.entities.sites import Sites
from ...core.entities.version_info import Stabilities, VersionInfo
from .update import Update
... | [
"mockito.verifyStubbedInvocationsAreUsed",
"mockito.unstub",
"mockito.mock",
"mockito.when",
"pytest.mark.parametrize"
] | [((1296, 1833), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""name,old,new,pretend,expected"""', '[(\'Remove file when new file has been downloaded\', \'old\', \'new\', False, \n True), (\'Keep file when no new file has been downloaded\', \'old\', \'old\',\n False, False), (\'Keep old file when new ... |
from flask import request, Blueprint
from server.service.login_service import validate_login
login_blueprint = Blueprint('login_urls', __name__)
@login_blueprint.route('/login', methods=['GET'])
def get_login():
user_name = request.args.get('userName')
password = request.args.get('password')
return vali... | [
"flask.request.args.get",
"flask.Blueprint",
"server.service.login_service.validate_login"
] | [((113, 146), 'flask.Blueprint', 'Blueprint', (['"""login_urls"""', '__name__'], {}), "('login_urls', __name__)\n", (122, 146), False, 'from flask import request, Blueprint\n'), ((232, 260), 'flask.request.args.get', 'request.args.get', (['"""userName"""'], {}), "('userName')\n", (248, 260), False, 'from flask import r... |
def do(payload, config, plugin_config, inputs):
from dku_aws.boto3_command import get_instances_and_spot, split_fsg
instanceFamily = plugin_config.get("instanceFamily")
instanceVCPUsMin = plugin_config.get("instanceVCPUsMin")
instanceVCPUsMax = plugin_config.get("instanceVCPUsMax")
memoryMin =... | [
"dku_aws.boto3_command.get_instances_and_spot"
] | [((420, 444), 'dku_aws.boto3_command.get_instances_and_spot', 'get_instances_and_spot', ([], {}), '()\n', (442, 444), False, 'from dku_aws.boto3_command import get_instances_and_spot, split_fsg\n')] |
# -*- coding: utf-8 -*-
import glob as glob
import logging
import os
from typing import Iterable, List, Union, Callable, Any
import pandas as pd
from sklearn.externals.joblib import Parallel, delayed
from parsers.semantic.graphs.tranformers import GraphTransformer
from utils.commons import safe_concurrency_backend, M... | [
"logging.getLogger",
"sklearn.externals.joblib.delayed",
"utils.commons.safe_concurrency_backend",
"os.path.join",
"sklearn.externals.joblib.Parallel",
"os.path.basename",
"utils.commons.ModuleShutUpWarning"
] | [((434, 461), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (451, 461), False, 'import logging\n'), ((810, 843), 'utils.commons.safe_concurrency_backend', 'safe_concurrency_backend', (['backend'], {}), '(backend)\n', (834, 843), False, 'from utils.commons import safe_concurrency_backend,... |
import numpy as np
# the type of float to use throughout the session.
_FLOATX = 'float32'
_EPSILON = 10e-8
_UID_PREFIXES = {}
def epsilon():
return _EPSILON
def set_epsilon(e):
global _EPSILON
_EPSILON = e
def floatx():
'''Returns the default float type, as a string
(e.g. 'float16', 'float32'... | [
"numpy.asarray"
] | [((652, 680), 'numpy.asarray', 'np.asarray', (['x'], {'dtype': '_FLOATX'}), '(x, dtype=_FLOATX)\n', (662, 680), True, 'import numpy as np\n')] |
import unittest
from datetime import (
datetime,
timezone,
timedelta
)
from jsonier import *
@jsonified
class Present:
name = Field(str, required=True)
price = Field(float, required=True)
@jsonified
class Address:
street = Field(str, omit_empty=False)
street2 = Field(str)
city = Fie... | [
"unittest.main",
"datetime.datetime",
"datetime.timedelta"
] | [((5131, 5146), 'unittest.main', 'unittest.main', ([], {}), '()\n', (5144, 5146), False, 'import unittest\n'), ((4719, 4746), 'datetime.datetime', 'datetime', (['(2020)', '(3)', '(12)', '(0)', '(0)'], {}), '(2020, 3, 12, 0, 0)\n', (4727, 4746), False, 'from datetime import datetime, timezone, timedelta\n'), ((4951, 498... |
from django.template import loader
from django.http import HttpResponse, JsonResponse
from django.views.generic import ListView
from rest_framework.permissions import AllowAny
from rest_framework.views import APIView
from .models import Semester, Course, Section, SectionCapacities
import datetime
import pytz
from res... | [
"pytz.timezone",
"django.http.JsonResponse",
"django.http.HttpResponse",
"datetime.datetime.today",
"django.template.loader.get_template"
] | [((500, 547), 'django.template.loader.get_template', 'loader.get_template', (['"""getcrndetails/index.html"""'], {}), "('getcrndetails/index.html')\n", (519, 547), False, 'from django.template import loader\n'), ((634, 659), 'datetime.datetime.today', 'datetime.datetime.today', ([], {}), '()\n', (657, 659), False, 'imp... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019/3/13 10:40
# @Author : wendy
# @Usage : Set some global config here
# @File : Config.py
# @Software: PyCharm
import cv2
import configparser
class Config(object):
def __init__(self):
self.COLORS = [(255, 0, 0), (0, 255, 0), (0, 0, 255)]
... | [
"configparser.ConfigParser"
] | [((750, 777), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (775, 777), False, 'import configparser\n')] |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import logging
from typing import List
from detectron2.engine import HookBase
from detectron2.utils.registry import Registry
logger = logging.getLogger(__name__)
# List of functions to add hooks for trainer, all functions i... | [
"logging.getLogger",
"detectron2.utils.registry.Registry"
] | [((230, 257), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (247, 257), False, 'import logging\n'), ((430, 464), 'detectron2.utils.registry.Registry', 'Registry', (['"""TRAINER_HOOKS_REGISTRY"""'], {}), "('TRAINER_HOOKS_REGISTRY')\n", (438, 464), False, 'from detectron2.utils.registry im... |
# -*- coding: utf-8 -*-
# Copyright 2018 Etsy Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | [
"marshmallow.fields.Nested",
"boundary_layer.logger.logger.debug",
"marshmallow.fields.List",
"marshmallow.fields.Dict",
"marshmallow.fields.String",
"jsonschema.Draft4Validator.check_schema",
"marshmallow.fields.Boolean"
] | [((885, 901), 'marshmallow.fields.Dict', 'ma.fields.Dict', ([], {}), '()\n', (899, 901), True, 'import marshmallow as ma\n'), ((929, 948), 'marshmallow.fields.Boolean', 'ma.fields.Boolean', ([], {}), '()\n', (946, 948), True, 'import marshmallow as ma\n'), ((964, 996), 'marshmallow.fields.List', 'ma.fields.List', (['ma... |
# Generated by Django 2.0.6 on 2018-07-12 10:30
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('host_management', '0008_auto_20180712_1028'),
]
operations = [
migrations.AlterField(
model_nam... | [
"django.db.models.ForeignKey"
] | [((381, 522), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'on_delete': 'django.db.models.deletion.CASCADE', 'related_name': '"""db_host"""', 'to': '"""host_management.HostInfo"""', 'verbose_name': '"""主机"""'}), "(on_delete=django.db.models.deletion.CASCADE, related_name\n ='db_host', to='host_managemen... |
import logging
import os
import signal
import subprocess
import tempfile
from typing import List, Sequence, Optional, Tuple, Union
import numpy as np
import pandas as pd
import prctl
import soundfile as sf
from d3m import container, utils
from d3m.base import utils as base_utils
from d3m.metadata import base as metada... | [
"logging.getLogger",
"soundfile.info",
"d3m.primitive_interfaces.base.CallResult",
"d3m.metadata.base.DataMetadata",
"d3m.container.DataFrame",
"d3m.base.utils.get_tabular_resource",
"os.path.join",
"joblib.Parallel",
"os.path.dirname",
"numpy.zeros",
"prctl.set_pdeathsig",
"tempfile.NamedTemp... | [((560, 587), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (577, 587), False, 'import logging\n'), ((1610, 1648), 'tempfile.NamedTemporaryFile', 'tempfile.NamedTemporaryFile', ([], {'mode': '"""rb"""'}), "(mode='rb')\n", (1637, 1648), False, 'import tempfile\n'), ((2820, 2845), 'soundfi... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.ticker as tick
from statistics import mean
from tqdm import tqdm
import multiprocessing as mp
from . import model as dymod
class Filter:
"""誤ベクトル数の確認,誤ベクトル数によるフィルタリング処理"""
@classmethod
def get_incorrect_vector_examp... | [
"statistics.mean",
"matplotlib.pyplot.grid",
"pandas.read_csv",
"matplotlib.ticker.MultipleLocator",
"matplotlib.pyplot.gca",
"tqdm.tqdm",
"multiprocessing.cpu_count",
"matplotlib.pyplot.axhline",
"numpy.sum",
"multiprocessing.Pool",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show"
] | [((1637, 1664), 'statistics.mean', 'mean', (['incorrect_vector_list'], {}), '(incorrect_vector_list)\n', (1641, 1664), False, 'from statistics import mean\n'), ((1849, 1898), 'matplotlib.pyplot.axhline', 'plt.axhline', (['incorrect_vector_mean'], {'color': '"""black"""'}), "(incorrect_vector_mean, color='black')\n", (1... |
# Generated by Django 3.2.2 on 2021-06-04 04:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blweb', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='VehicleModel',
fields=[
('id... | [
"django.db.models.CharField",
"django.db.models.BigAutoField",
"django.db.models.IntegerField"
] | [((323, 419), 'django.db.models.BigAutoField', 'models.BigAutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (342, 419), False, 'from django.db import migrations, m... |
import math
from torch import nn
from torch.autograd import Function
from torch.autograd.function import once_differentiable
from torch.nn.modules.utils import _pair
import max_convolution2d_sampler_backend as max_convolution2d
def max_conv2d(input,
weight,
kernel_size=2,
... | [
"max_convolution2d_sampler_backend.forward",
"torch.nn.modules.utils._pair"
] | [((1239, 1257), 'torch.nn.modules.utils._pair', '_pair', (['kernel_size'], {}), '(kernel_size)\n', (1244, 1257), False, 'from torch.nn.modules.utils import _pair\n'), ((1281, 1295), 'torch.nn.modules.utils._pair', '_pair', (['padding'], {}), '(padding)\n', (1286, 1295), False, 'from torch.nn.modules.utils import _pair\... |
from datetime import timedelta
def datetime_range(start, end, delta):
current = start
if not isinstance(delta, timedelta):
delta = timedelta(**delta)
while current < end:
yield current
current += delta
TOL_IS_ZERO = 2.5 * 2e-2
def negative(value, tol=TOL_IS_ZERO):
"""
C... | [
"datetime.timedelta"
] | [((149, 167), 'datetime.timedelta', 'timedelta', ([], {}), '(**delta)\n', (158, 167), False, 'from datetime import timedelta\n')] |
import unittest
from core.fst_info import FstInfo
class TestFstInfo(unittest.TestCase):
def test_get_info(self):
expected_bytes = 'some_text'.encode()
fst_info = FstInfo('cat')
output = fst_info.get_info(expected_bytes)
self.assertEqual(output, expected_bytes)
if __name__ == '__... | [
"unittest.main",
"core.fst_info.FstInfo"
] | [((333, 348), 'unittest.main', 'unittest.main', ([], {}), '()\n', (346, 348), False, 'import unittest\n'), ((185, 199), 'core.fst_info.FstInfo', 'FstInfo', (['"""cat"""'], {}), "('cat')\n", (192, 199), False, 'from core.fst_info import FstInfo\n')] |
from scannerpy import Database, Job, ColumnType, DeviceType
import os
import sys
import math
import numpy as np
from tqdm import tqdm
import six.moves.urllib as urllib
import kernels
# What model to download.
MODEL_TEMPLATE_URL = 'http://download.tensorflow.org/models/object_detection/{:s}.tar.gz'
if __name__ == '__... | [
"scannerpy.Database",
"os.path.basename",
"sys.exit",
"kernels.smooth_box",
"numpy.fromstring",
"kernels.nms_bulk"
] | [((622, 632), 'scannerpy.Database', 'Database', ([], {}), '()\n', (630, 632), False, 'from scannerpy import Database, Job, ColumnType, DeviceType\n'), ((1991, 2026), 'kernels.nms_bulk', 'kernels.nms_bulk', (['bundled_data_list'], {}), '(bundled_data_list)\n', (2007, 2026), False, 'import kernels\n'), ((2049, 2106), 'ke... |
from pymodelica import compile_fmu
fmu_name = compile_fmu("{{model_name}}", "{{model_name}}.mo",
version="{{fmi_version}}", target="{{fmi_api}}",
compiler_options={'extra_lib_dirs':["{{sim_lib_path}}"]})
| [
"pymodelica.compile_fmu"
] | [((47, 215), 'pymodelica.compile_fmu', 'compile_fmu', (['"""{{model_name}}"""', '"""{{model_name}}.mo"""'], {'version': '"""{{fmi_version}}"""', 'target': '"""{{fmi_api}}"""', 'compiler_options': "{'extra_lib_dirs': ['{{sim_lib_path}}']}"}), "('{{model_name}}', '{{model_name}}.mo', version=\n '{{fmi_version}}', targ... |
#!/usr/bin/env python3
import re
import argparse
from collections import defaultdict
from os.path import basename, splitext
def revcomp(seq):
return seq.translate(str.maketrans('ACGTacgtRYMKrymkVBHDvbhd', 'TGCAtgcaYRKMyrkmBVDHbvdh'))[::-1]
def cvt2stable(pri, traversal):
if traversal != "*":
a = []
... | [
"argparse.ArgumentParser",
"re.compile",
"collections.defaultdict",
"re.finditer",
"os.path.basename"
] | [((2019, 2044), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2042, 2044), False, 'import argparse\n'), ((2146, 2184), 're.compile', 're.compile', (['"""^S\t(\\\\S+)\t(\\\\S+)(\t.*)"""'], {}), "('^S\\t(\\\\S+)\\t(\\\\S+)(\\t.*)')\n", (2156, 2184), False, 'import re\n'), ((2197, 2235), 're.com... |