code
stringlengths
22
1.05M
apis
listlengths
1
3.31k
extract_api
stringlengths
75
3.25M
from chainer.links import BatchNormalization, GroupNormalization from chainermn.links import MultiNodeBatchNormalization from chainer.functions import softmax_cross_entropy from chainer.optimizers import Adam from chainer.iterators import MultiprocessIterator, SerialIterator from chainer.optimizer import WeightDecay fr...
[ "chainer.training.extensions.PrintReport", "chainermn.create_communicator", "chainer.training.extensions.snapshot_object", "chainer.iterators.SerialIterator", "chainer.training.StandardUpdater", "chainermn.create_multi_node_optimizer", "src.training.updaters.boundseg_updater.BoundSegUpdater", "src.dat...
[((3554, 3660), 'src.links.model.vaeseg.Encoder', 'Encoder', ([], {'base_channels': 'base_channels', 'norm': 'norm', 'bn_first': 'bn_first', 'ndim_latent': 'ndim_latent', 'comm': 'comm'}), '(base_channels=base_channels, norm=norm, bn_first=bn_first,\n ndim_latent=ndim_latent, comm=comm)\n', (3561, 3660), False, 'fro...
from tqdm import tqdm from toolz.functoolz import compose from torch.utils.data import Dataset class LMDataset(Dataset): """Wraps a wikitext dataset from pytorch NLP which is provided as a list of tokens """ def __init__(self, tokens, max_len=256): self.max_len = max_len self.data = [...
[ "toolz.functoolz.compose" ]
[((917, 948), 'toolz.functoolz.compose', 'compose', (['*self.transforms[::-1]'], {}), '(*self.transforms[::-1])\n', (924, 948), False, 'from toolz.functoolz import compose\n')]
from ..core.base import ErsiliaBase from ..app.app import AppBase, StreamlitApp import subprocess import os import shutil import streamlit class DeployBase(ErsiliaBase): def __init__(self, config_json=None, credentials_json=None): ErsiliaBase.__init__( self, config_json=config_json, credential...
[ "os.path.exists", "subprocess.Popen", "os.path.join", "os.getcwd", "shutil.copytree", "os.chdir", "os.path.basename", "shutil.rmtree" ]
[((1525, 1547), 'os.path.exists', 'os.path.exists', (['path_d'], {}), '(path_d)\n', (1539, 1547), False, 'import os\n'), ((1591, 1622), 'shutil.copytree', 'shutil.copytree', (['path_o', 'path_d'], {}), '(path_o, path_d)\n', (1606, 1622), False, 'import shutil\n'), ((5674, 5685), 'os.getcwd', 'os.getcwd', ([], {}), '()\...
import os def append_pdbs(pdb_file1, pdb_file2, path): new_pdb = [] with open(pdb_file1, 'r') as f: lines = f.readlines() for line in lines: if line.startswith('ATOM'): new_pdb.append(line) separating_line = 'TER' + '\n' new_pdb.append(separat...
[ "os.path.basename" ]
[((582, 609), 'os.path.basename', 'os.path.basename', (['pdb_file1'], {}), '(pdb_file1)\n', (598, 609), False, 'import os\n'), ((641, 668), 'os.path.basename', 'os.path.basename', (['pdb_file2'], {}), '(pdb_file2)\n', (657, 668), False, 'import os\n')]
import argparse import os import sourcetraildb as srctrl def main(): parser = argparse.ArgumentParser(description="SourcetrailDB Python API Example") parser.add_argument("--database-file-path", help="path to the generated Sourcetrail database file", type=str, required=True) parser.add_argument("--source-file-path...
[ "sourcetraildb.recordSymbolLocation", "sourcetraildb.close", "sourcetraildb.beginTransaction", "sourcetraildb.recordReference", "argparse.ArgumentParser", "sourcetraildb.getLastError", "sourcetraildb.recordFileLanguage", "sourcetraildb.recordSymbolDefinitionKind", "sourcetraildb.commitTransaction", ...
[((80, 151), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""SourcetrailDB Python API Example"""'}), "(description='SourcetrailDB Python API Example')\n", (103, 151), False, 'import argparse\n'), ((1191, 1205), 'sourcetraildb.clear', 'srctrl.clear', ([], {}), '()\n', (1203, 1205), True, '...
import tadtool.tad as tad import tadtool.plot as tp # load regions data set regions = tad.HicRegionFileReader().regions("chr12_20-35Mb_regions.bed") # load matrix matrix = tad.HicMatrixFileReader().matrix("chr12_20-35Mb.matrix.txt") # prepare plot tad_plot = tp.TADtoolPlot(matrix, regions, norm='lin', max_dist=10000...
[ "tadtool.tad.HicRegionFileReader", "tadtool.tad.HicMatrixFileReader", "tadtool.plot.TADtoolPlot", "matplotlib.pyplot.show" ]
[((262, 352), 'tadtool.plot.TADtoolPlot', 'tp.TADtoolPlot', (['matrix', 'regions'], {'norm': '"""lin"""', 'max_dist': '(1000000)', 'algorithm': '"""insulation"""'}), "(matrix, regions, norm='lin', max_dist=1000000, algorithm=\n 'insulation')\n", (276, 352), True, 'import tadtool.plot as tp\n'), ((446, 456), 'matplot...
# Copyright (c) 2021 <NAME> from pylib_sakata import init as init # uncomment the follows when the file is executed in a Python console. # init.close_all() # init.clear_all() import os import shutil import numpy as np from control import matlab from pylib_sakata import ctrl from pylib_sakata import plot print('Star...
[ "pylib_sakata.plot.plot_nyquist_assistline", "os.path.exists", "numpy.log10", "pylib_sakata.ctrl.pid", "os.makedirs", "pylib_sakata.ctrl.pi", "pylib_sakata.plot.plot_nyquist", "pylib_sakata.plot.savefig", "pylib_sakata.ctrl.sys2frd", "shutil.rmtree", "numpy.linspace", "pylib_sakata.ctrl.feedba...
[((400, 432), 'os.path.exists', 'os.path.exists', (['figurefolderName'], {}), '(figurefolderName)\n', (414, 432), False, 'import os\n'), ((470, 499), 'os.makedirs', 'os.makedirs', (['figurefolderName'], {}), '(figurefolderName)\n', (481, 499), False, 'import os\n'), ((731, 751), 'pylib_sakata.ctrl.tf', 'ctrl.tf', (['[1...
"""Config flow for gs_alarm.""" from __future__ import annotations from typing import Any import voluptuous as vol from homeassistant import config_entries from homeassistant.data_entry_flow import FlowResult from homeassistant.core import callback from .const import DOMAIN from pyg90alarm import G90Alarm import...
[ "logging.getLogger", "voluptuous.Required", "pyg90alarm.G90Alarm.discover" ]
[((340, 367), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (357, 367), False, 'import logging\n'), ((419, 442), 'voluptuous.Required', 'vol.Required', (['"""ip_addr"""'], {}), "('ip_addr')\n", (431, 442), True, 'import voluptuous as vol\n'), ((872, 891), 'pyg90alarm.G90Alarm.discover', ...
from flask import Blueprint # 每一个模块蓝图可以拥有自己的静态文件夹,默认的app会设置好系统级别的static # 但是蓝图需要自己手动设置注册静态文件的路径 # 为了区分加载的是主应用下的static还是模块下的static,给模块初始化的时候添加url前缀 # 添加前缀后,那么该蓝图.route的时候就自动添加了该前缀, 加载img的时候使用/cart/static/xxx.img # 如果模块模板和主营业模板下都拥有相同的html名字,则优先加载主营业下的模板 cart_blue = Blueprint('cart', __name__, stat...
[ "flask.Blueprint" ]
[((266, 371), 'flask.Blueprint', 'Blueprint', (['"""cart"""', '__name__'], {'static_folder': '"""static"""', 'template_folder': '"""templates"""', 'url_prefix': '"""/cart"""'}), "('cart', __name__, static_folder='static', template_folder=\n 'templates', url_prefix='/cart')\n", (275, 371), False, 'from flask import B...
# coding=utf-8 import os import glob __author__ = 'royarzun' __version__ = '1.3.5' __all__ = [os.path.basename(f)[:-3] for f in glob.glob(os.path.dirname(__file__) + "/*.py")]
[ "os.path.dirname", "os.path.basename" ]
[((95, 114), 'os.path.basename', 'os.path.basename', (['f'], {}), '(f)\n', (111, 114), False, 'import os\n'), ((139, 164), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (154, 164), False, 'import os\n')]
import time from serial import Serial class BLTouch: def __init__(self, port: str = "/dev/ttyACM1", baudrate: int = 9600, timeout: int = 0.1) -> None: self.ser = Serial(port=port, baudrate=baudrate, timeout=timeout) self.port = port self.baudrate = baudrate self.data = "" ...
[ "serial.Serial", "time.sleep" ]
[((177, 230), 'serial.Serial', 'Serial', ([], {'port': 'port', 'baudrate': 'baudrate', 'timeout': 'timeout'}), '(port=port, baudrate=baudrate, timeout=timeout)\n', (183, 230), False, 'from serial import Serial\n'), ((320, 333), 'time.sleep', 'time.sleep', (['(2)'], {}), '(2)\n', (330, 333), False, 'import time\n'), ((6...
from oms_cms.config import settings from oms_cms.backend.utils.models import EmailsFeedback from sendgrid import SendGridAPIClient from sendgrid.helpers.mail import Mail def send_mail_contact(subject, message): """Отправка письма через SendGrid""" message = Mail( from_email=settings.DEFAULT_FROM_EMAI...
[ "oms_cms.backend.utils.models.EmailsFeedback.objects.all", "sendgrid.SendGridAPIClient" ]
[((480, 527), 'sendgrid.SendGridAPIClient', 'SendGridAPIClient', (['settings.EMAIL_HOST_PASSWORD'], {}), '(settings.EMAIL_HOST_PASSWORD)\n', (497, 527), False, 'from sendgrid import SendGridAPIClient\n'), ((359, 387), 'oms_cms.backend.utils.models.EmailsFeedback.objects.all', 'EmailsFeedback.objects.all', ([], {}), '()...
import sqlite3 from typing import List from datetime import datetime # ██ ██ █████ ██ ████████ ██ ██ ███████ ████████ # ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ # ██ █ ██ ███████ ██ ██ ██ ██ ███████ ██ # ██ ███ ██ ██ ██ ██ ██ ██ ██ ██ ██ # ███ ███ ██ █...
[ "datetime.datetime.now" ]
[((525, 539), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (537, 539), False, 'from datetime import datetime\n')]
from django.contrib.auth.mixins import LoginRequiredMixin from django.core.serializers import serialize, deserialize from django.http import HttpResponseRedirect, HttpResponse from django.shortcuts import redirect from django.views.generic import FormView from accounts.models import BaseUser from database.forms import...
[ "database.models.structural_models.ModelSet.objects.get", "accounts.models.BaseUser.objects.get", "database.models.schedule_models.Timeblock.objects.get", "django.core.serializers.deserialize", "django.http.HttpResponse", "accounts.models.BaseUser.objects.filter", "database.models.schedule_models.Course...
[((1377, 1403), 'django.core.serializers.serialize', 'serialize', (['"""json"""', 'objects'], {}), "('json', objects)\n", (1386, 1403), False, 'from django.core.serializers import serialize, deserialize\n'), ((2707, 2766), 'django.core.serializers.serialize', 'serialize', (['"""python"""', 'objects'], {'use_natural_for...
import pandas as pd import numpy as np import helper import project_helper import project_tests # Compute the Highs and Lows in a Window def get_high_lows_lookback(high, low, lookback_days): """ Get the highs and lows in a lookback window. Parameters ---------- high : DataFrame ...
[ "pandas.DataFrame", "numpy.array" ]
[((1674, 1728), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': 'close.columns', 'index': 'close.index'}), '(columns=close.columns, index=close.index)\n', (1686, 1728), True, 'import pandas as pd\n'), ((4434, 4490), 'pandas.DataFrame', 'pd.DataFrame', (['[]'], {'columns': 'col_values', 'index': 'index_values'}), '...
# https://realpython.com/python-redis/ import time import logging import functools import json import redis # https://github.com/andymccurdy/redis-py from logdecorator import log_on_start, log_on_end, log_on_error # https://github.com/sighalt/logdecorator from settings import REDIS_CONNECTION, RETRY_MAX_ATTEMPTS, RE...
[ "logdecorator.log_on_start", "logdecorator.log_on_end", "logdecorator.log_on_error", "json.dumps", "redis.ConnectionPool", "functools.wraps", "redis.Redis", "time.sleep" ]
[((1118, 1171), 'logdecorator.log_on_start', 'log_on_start', (['logging.DEBUG', '"""Store: -> [{key}] ... """'], {}), "(logging.DEBUG, 'Store: -> [{key}] ... ')\n", (1130, 1171), False, 'from logdecorator import log_on_start, log_on_end, log_on_error\n'), ((1177, 1296), 'logdecorator.log_on_error', 'log_on_error', (['l...
import click from arbol.arbol import aprint, asection from dexp.cli.defaults import DEFAULT_STORE from dexp.cli.parsing import _get_output_path, _parse_channels from dexp.datasets.open_dataset import glob_datasets @click.command() @click.argument("input_paths", nargs=-1) # , help='input path' @click.option("--outp...
[ "click.argument", "arbol.arbol.aprint", "click.option", "dexp.datasets.open_dataset.glob_datasets", "arbol.arbol.asection", "dexp.cli.parsing._get_output_path", "click.command", "dexp.cli.parsing._parse_channels" ]
[((218, 233), 'click.command', 'click.command', ([], {}), '()\n', (231, 233), False, 'import click\n'), ((235, 274), 'click.argument', 'click.argument', (['"""input_paths"""'], {'nargs': '(-1)'}), "('input_paths', nargs=-1)\n", (249, 274), False, 'import click\n'), ((300, 335), 'click.option', 'click.option', (['"""--o...
""" This command essentially migrates data used for a number of items used by the R class. This should fix any issues related to: WRONGTYPE Operation against a key holding the wrong kind of value These include: * """ from __future__ import unicode_literals import json from django.core.management.base import No...
[ "redis_metrics.utils.get_r", "json.loads" ]
[((593, 600), 'redis_metrics.utils.get_r', 'get_r', ([], {}), '()\n', (598, 600), False, 'from redis_metrics.utils import get_r\n'), ((2413, 2429), 'json.loads', 'json.loads', (['data'], {}), '(data)\n', (2423, 2429), False, 'import json\n')]
import os import shutil import sys import pytest import requests from .. import StorageTests from vdirsyncer.storage.etesync import EtesyncCalendars from vdirsyncer.storage.etesync import EtesyncContacts pytestmark = pytest.mark.skipif(os.getenv('ETESYNC_TESTS', '') != 'true', reason...
[ "requests.post", "os.getenv", "wsgi_intercept.requests_intercept.uninstall", "wsgi_intercept.add_wsgi_intercept", "wsgi_intercept.requests_intercept.install", "os.path.dirname", "wsgi_intercept.remove_wsgi_intercept", "pytest.fixture" ]
[((350, 381), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (364, 381), False, 'import pytest\n'), ((2424, 2456), 'pytest.fixture', 'pytest.fixture', ([], {'params': "['VCARD']"}), "(params=['VCARD'])\n", (2438, 2456), False, 'import pytest\n'), ((2600, 2633), 'pytest.fixt...
import urllib.request,json from .models import Source, Article #Getting api Key api_key = None #Getting the urls sources_url = None top_headlines_url = None everything_url = None category_url = None language_url = None search_url = None def configure_request(app): global api_key, sources_url, top_headlines_url,...
[ "json.loads" ]
[((966, 990), 'json.loads', 'json.loads', (['sources_data'], {}), '(sources_data)\n', (976, 990), False, 'import urllib.request, json\n'), ((1512, 1538), 'json.loads', 'json.loads', (['headlines_data'], {}), '(headlines_data)\n', (1522, 1538), False, 'import urllib.request, json\n'), ((2072, 2097), 'json.loads', 'json....
import threading import time _timers = {} class DiscreteEventEmitter(): def __init__(self, interval, period_length, group, callback, start_immediate=False): self.interval = float(interval) self.period_length = period_length self.group = group self.intervals = self.period_length / ...
[ "threading.Timer", "time.time" ]
[((767, 778), 'time.time', 'time.time', ([], {}), '()\n', (776, 778), False, 'import time\n'), ((571, 639), 'threading.Timer', 'threading.Timer', (['(0 if start_immediate else self.interval)', 'self._tick'], {}), '(0 if start_immediate else self.interval, self._tick)\n', (586, 639), False, 'import threading\n'), ((951,...
__author__ = 'scottumsted' import gc import resource import time class ResourceHelper(): def __init__(self, module=None): self.module = '' if module is None else '\nmodule:\t'+module+'\n' gc.disable() self.reset() def reset(self): self.start_mem = resource.getrusage(res...
[ "resource.getrusage", "gc.disable", "time.time" ]
[((209, 221), 'gc.disable', 'gc.disable', ([], {}), '()\n', (219, 221), False, 'import gc\n'), ((529, 540), 'time.time', 'time.time', ([], {}), '()\n', (538, 540), False, 'import time\n'), ((298, 338), 'resource.getrusage', 'resource.getrusage', (['resource.RUSAGE_SELF'], {}), '(resource.RUSAGE_SELF)\n', (316, 338), Fa...
from datetime import datetime import click from pygments import highlight, lexers, formatters import hexdump from pymobiledevice3.cli.cli_common import Command from pymobiledevice3.lockdown import LockdownClient from pymobiledevice3.services.pcapd import PcapdService @click.group() def cli(): """ apps cli """ ...
[ "datetime.datetime.fromtimestamp", "click.group", "click.option", "pymobiledevice3.services.pcapd.PcapdService", "hexdump.hexdump", "click.File", "pygments.formatters.TerminalTrueColorFormatter", "pygments.lexers.HspecLexer", "pygments.lexers.HexdumpLexer" ]
[((273, 286), 'click.group', 'click.group', ([], {}), '()\n', (284, 286), False, 'import click\n'), ((419, 540), 'click.option', 'click.option', (['"""-c"""', '"""--count"""'], {'type': 'click.INT', 'default': '(-1)', 'help': '"""Number of packets to sniff. Omit to endless sniff."""'}), "('-c', '--count', type=click.IN...
from telethon import events @bot.on(events.NewMessage(outgoing=True, incoming=False)) async def hi(event): text = event.text for a in range(1): await bot.send_file(event.chat_id, text)
[ "telethon.events.NewMessage" ]
[((36, 84), 'telethon.events.NewMessage', 'events.NewMessage', ([], {'outgoing': '(True)', 'incoming': '(False)'}), '(outgoing=True, incoming=False)\n', (53, 84), False, 'from telethon import events\n')]
""" The lidar system, data and fit (1 of 2 datasets) ================================================ Generate a chart of the data fitted by Gaussian curve """ import numpy as np import matplotlib.pyplot as plt from scipy.optimize import leastsq def model(t, coeffs): return coeffs[0] + coeffs[1] * np.exp(- ((t-...
[ "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "numpy.exp", "numpy.array", "scipy.optimize.leastsq", "numpy.load", "matplotlib.pyplot.subplots", "matplotlib.pyplot.legend", "matplotlib.pyplot.show" ]
[((424, 449), 'numpy.load', 'np.load', (['"""waveform_1.npy"""'], {}), "('waveform_1.npy')\n", (431, 449), True, 'import numpy as np\n'), ((487, 524), 'numpy.array', 'np.array', (['[3, 30, 15, 1]'], {'dtype': 'float'}), '([3, 30, 15, 1], dtype=float)\n', (495, 524), True, 'import numpy as np\n'), ((535, 579), 'scipy.op...
import os, re, openpyxl from openpyxl import load_workbook path = os.getcwd() files = os.listdir('testFiles/single') print(files) files_xls = [f for f in files if f[-4:] == 'xlsx'] print(files_xls) for f in files_xls: wb = load_workbook("testFiles/single/"+f) ws = wb['資料'] for i in range(1,ws.max_row)...
[ "openpyxl.load_workbook", "os.listdir", "os.getcwd" ]
[((68, 79), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (77, 79), False, 'import os, re, openpyxl\n'), ((88, 118), 'os.listdir', 'os.listdir', (['"""testFiles/single"""'], {}), "('testFiles/single')\n", (98, 118), False, 'import os, re, openpyxl\n'), ((231, 269), 'openpyxl.load_workbook', 'load_workbook', (["('testFile...
from flask_wtf import FlaskForm from wtforms import StringField,TextAreaField,SubmitField from wtforms.validators import Required class PitchForm(FlaskForm): pitches= TextAreaField('Write your Pitch',validators=[Required()]) submit = SubmitField('Submit') class UpdateProfile(FlaskForm): bio = TextAreaFi...
[ "wtforms.validators.Required", "wtforms.SubmitField" ]
[((244, 265), 'wtforms.SubmitField', 'SubmitField', (['"""Submit"""'], {}), "('Submit')\n", (255, 265), False, 'from wtforms import StringField, TextAreaField, SubmitField\n'), ((385, 406), 'wtforms.SubmitField', 'SubmitField', (['"""Submit"""'], {}), "('Submit')\n", (396, 406), False, 'from wtforms import StringField,...
"""Standard Light-node types""" from OpenGL.GL import * from math import pi from vrml.vrml97 import basenodes, nodetypes from vrml.vrml97 import transformmatrix from vrml import node from OpenGLContext.arrays import array, dot, identity from OpenGLContext import vectorutilities class Light(object ):#nodetypes.Light, n...
[ "OpenGLContext.vectorutilities.orientToXYZR", "OpenGLContext.arrays.identity", "vrml.vrml97.transformmatrix.rotMatrix", "vrml.vrml97.transformmatrix.transMatrix", "OpenGLContext.arrays.array", "OpenGLContext.arrays.dot", "vrml.vrml97.transformmatrix.perspectiveMatrix" ]
[((3005, 3092), 'vrml.vrml97.transformmatrix.perspectiveMatrix', 'transformmatrix.perspectiveMatrix', (['cutOffAngle', 'aspect', 'near', 'far'], {'inverse': 'inverse'}), '(cutOffAngle, aspect, near, far, inverse=\n inverse)\n', (3038, 3092), False, 'from vrml.vrml97 import transformmatrix\n'), ((5013, 5064), 'OpenGL...
from functools import partial import torch import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import build_conv_layer from mmcv.runner import load_checkpoint from mmedit.models.common import (PixelShufflePack, ResidualBlockNoBN, make_layer) from mmedit.models.registr...
[ "mmedit.models.common.make_layer", "mmcv.runner.load_checkpoint", "mmedit.models.common.PixelShufflePack", "torch.cat", "mmedit.utils.get_root_logger", "torch.nn.functional.interpolate", "torch.nn.functional.relu", "mmedit.models.registry.BACKBONES.register_module", "torch.clamp" ]
[((7767, 7794), 'mmedit.models.registry.BACKBONES.register_module', 'BACKBONES.register_module', ([], {}), '()\n', (7792, 7794), False, 'from mmedit.models.registry import BACKBONES\n'), ((1288, 1381), 'mmedit.models.common.make_layer', 'make_layer', (['ResidualBlockNoBN', 'num_blocks'], {'mid_channels': 'mid_channels'...
import os from .check_type import KERNEL_VER_INPUT from .definition_script import * from .get_url import * def buildmain(): os.chdir('../../catalog') if os.path.exists(KERNEL_VER_INPUT): os.remove((KERNEL_VER_INPUT) + '/install.sh') os.remove((KERNEL_VER_INPUT) + '/README.md') os.rmdir...
[ "os.path.exists", "os.chdir", "os.rmdir", "os.mkdir", "os.system", "os.remove" ]
[((129, 154), 'os.chdir', 'os.chdir', (['"""../../catalog"""'], {}), "('../../catalog')\n", (137, 154), False, 'import os\n'), ((163, 195), 'os.path.exists', 'os.path.exists', (['KERNEL_VER_INPUT'], {}), '(KERNEL_VER_INPUT)\n', (177, 195), False, 'import os\n'), ((424, 450), 'os.chdir', 'os.chdir', (['KERNEL_VER_INPUT'...
import argparse import pandas as pd from gamestonk_terminal.helper_funcs import parse_known_args_and_warn def gainers(l_args): parser = argparse.ArgumentParser( add_help=False, prog="gainers", description="Print up to 25 top ticker gainers. [Source: Yahoo Finance]", ) parser.add_a...
[ "pandas.read_html", "gamestonk_terminal.helper_funcs.parse_known_args_and_warn", "argparse.ArgumentParser" ]
[((142, 276), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'add_help': '(False)', 'prog': '"""gainers"""', 'description': '"""Print up to 25 top ticker gainers. [Source: Yahoo Finance]"""'}), "(add_help=False, prog='gainers', description=\n 'Print up to 25 top ticker gainers. [Source: Yahoo Finance]')...
import asn1tools foo = asn1tools.compile_files('sequence.asn', 'oer') # encoded = foo.encode('Signature', ('sm2Signature', 0xABCD)) encoded = foo.encode('SignedDataPayload', {'data': 0x08, 'extDataHash': 0x16}) print(encoded)
[ "asn1tools.compile_files" ]
[((24, 70), 'asn1tools.compile_files', 'asn1tools.compile_files', (['"""sequence.asn"""', '"""oer"""'], {}), "('sequence.asn', 'oer')\n", (47, 70), False, 'import asn1tools\n')]
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import...
[ "pulumi.get", "pulumi.getter", "pulumi.set", "pulumi.InvokeOptions", "pulumi.runtime.invoke" ]
[((3810, 3838), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""dryRun"""'}), "(name='dryRun')\n", (3823, 3838), False, 'import pulumi\n'), ((3943, 3978), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""enableDetails"""'}), "(name='enableDetails')\n", (3956, 3978), False, 'import pulumi\n'), ((4722, 4753), 'pul...
from __future__ import division import os import urllib, cStringIO import pymongo as pm ## first establish ssh tunnel to server where database is running import base64 import numpy as np from numpy import * import PIL from PIL import Image import base64 import matplotlib from matplotlib import pylab, mlab, pyplot from ...
[ "os.path.exists", "os.makedirs", "seaborn.set_context", "os.path.join", "IPython.display.clear_output", "seaborn.set_style", "os.system", "os.walk" ]
[((403, 428), 'seaborn.set_context', 'sns.set_context', (['"""poster"""'], {}), "('poster')\n", (418, 428), True, 'import seaborn as sns\n'), ((429, 451), 'seaborn.set_style', 'sns.set_style', (['"""white"""'], {}), "('white')\n", (442, 451), True, 'import seaborn as sns\n'), ((2007, 2030), 'os.path.exists', 'os.path.e...
import unittest from status import Failed, InProgress, NotStarted, Status, Succeeded class StatusTests(unittest.TestCase): def test_init(self): with self.assertRaises(NotImplementedError) as e: Status() self.assertEqual( str(e.exception), "Please instantiate on...
[ "status.Status", "status.Succeeded", "status.NotStarted", "status.Failed", "status.InProgress" ]
[((221, 229), 'status.Status', 'Status', ([], {}), '()\n', (227, 229), False, 'from status import Failed, InProgress, NotStarted, Status, Succeeded\n'), ((1532, 1540), 'status.Failed', 'Failed', ([], {}), '()\n', (1538, 1540), False, 'from status import Failed, InProgress, NotStarted, Status, Succeeded\n'), ((1542, 155...
import os from django.conf import settings from django.shortcuts import render from .forms import ClsForm from .models import Model, Tagger def classify(request): if request.method == 'POST': form = ClsForm(request.POST) if form.is_valid(): sauvegarde = True tex...
[ "django.shortcuts.render", "os.path.join" ]
[((382, 423), 'os.path.join', 'os.path.join', (['settings.BASE_DIR', '"""files/"""'], {}), "(settings.BASE_DIR, 'files/')\n", (394, 423), False, 'import os\n'), ((793, 885), 'django.shortcuts.render', 'render', (['request', '"""cls/home.html"""', "{'form': form, 'sauvegarde': sauvegarde, 'tags': tags}"], {}), "(request...
# pylint: disable=unused-argument, no-self-use from marshmallow import Schema, fields, EXCLUDE, post_load from draft_kings.response.objects.draft_group import ContestType, League, Game, DraftGroup, DraftGroupResponse class ContestTypeSchema(Schema): class Meta: unknown = EXCLUDE contestTypeId = fie...
[ "draft_kings.response.objects.draft_group.DraftGroupResponse", "draft_kings.response.objects.draft_group.League", "marshmallow.fields.Int", "marshmallow.fields.AwareDateTime", "draft_kings.response.objects.draft_group.ContestType", "draft_kings.response.objects.draft_group.DraftGroup", "marshmallow.fiel...
[((317, 370), 'marshmallow.fields.Int', 'fields.Int', ([], {'attribute': '"""contest_type_id"""', 'missing': 'None'}), "(attribute='contest_type_id', missing=None)\n", (327, 370), False, 'from marshmallow import Schema, fields, EXCLUDE, post_load\n'), ((386, 433), 'marshmallow.fields.Str', 'fields.Str', ([], {'attribut...
from __future__ import annotations import itertools import logging import math import re from collections import Counter from itertools import combinations, starmap from typing import Dict, Iterable, List, TextIO, Tuple import networkx as nx import numpy as np import numpy.typing as npt from networkx.drawing.nx_pydot...
[ "logging.getLogger", "numpy.abs", "numpy.unique", "re.compile", "numpy.where", "networkx.Graph", "itertools.combinations", "collections.Counter", "numpy.zeros", "numpy.array", "numpy.array_equal", "numpy.sign", "itertools.chain.from_iterable", "numpy.linalg.norm", "networkx.nx_pydot.to_p...
[((423, 450), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (440, 450), False, 'import logging\n'), ((469, 523), 're.compile', 're.compile', (['"""^\\\\-\\\\-\\\\-\\\\sscanner\\\\s\\\\d+\\\\s\\\\-\\\\-\\\\-$"""'], {}), "('^\\\\-\\\\-\\\\-\\\\sscanner\\\\s\\\\d+\\\\s\\\\-\\\\-\\\\-$')\n",...
# -*- coding: utf-8 -*- """ Microsoft-Windows-WMPNSS-PublicAPI GUID : 614696c9-85af-4e64-b389-d2c0db4ff87b """ from construct import Int8sl, Int8ul, Int16ul, Int16sl, Int32sl, Int32ul, Int64sl, Int64ul, Bytes, Double, Float32l, Struct from etl.utils import WString, CString, SystemTime, Guid from etl.dtyp import Sid fro...
[ "construct.Struct", "etl.parsers.etw.core.guid" ]
[((523, 569), 'construct.Struct', 'Struct', (["('Enable' / Int8ul)", "('HResult' / Int32ul)"], {}), "('Enable' / Int8ul, 'HResult' / Int32ul)\n", (529, 569), False, 'from construct import Int8sl, Int8ul, Int16ul, Int16sl, Int32sl, Int32ul, Int64sl, Int64ul, Bytes, Double, Float32l, Struct\n'), ((746, 792), 'construct.S...
# # Copyright 2021 Splunk 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 or agreed to in writing, so...
[ "splunktalib.conf_manager.request.content_request", "splunktalib.common.util.format_stanza_name" ]
[((1546, 1601), 'splunktalib.conf_manager.request.content_request', 'content_request', (['uri', 'session_key', '"""POST"""', 'payload', 'msg'], {}), "(uri, session_key, 'POST', payload, msg)\n", (1561, 1601), False, 'from splunktalib.conf_manager.request import content_request\n'), ((2390, 2441), 'splunktalib.conf_mana...
from binarydataclass import ( from_bytes, Uint8, Uint16, Uint32, Uint64, Int8, Int16, Int32, Int64, binaryfield, int_decoder, ) from dataclasses import dataclass @dataclass class PointWithTypes: a: Uint8 b: Uint16 c: Uint32 d: Uint64 e: Int8 f: Int16...
[ "binarydataclass.int_decoder", "binarydataclass.from_bytes" ]
[((846, 1006), 'binarydataclass.from_bytes', 'from_bytes', (['PointWithTypes', "b'\\x01\\x00\\x02\\x00\\x00\\x00\\x05\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x01\\xff\\xff\\x00\\x00\\x00\\x05\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff'"], {}), "(PointWithTypes,\n b'\\x01\\x00\\x02\\x00\\x00\\x00\\x05\\xff\\xff\\xff\\x...
# -*- coding: utf-8 -*- """ Test for the core. """ import unittest import os import zipfile import shutil import updater class TestCore(unittest.TestCase): """ Unit-tests for the core. """ def setUp(self): os.chdir(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) # Set the working dire...
[ "updater.create_archive", "os.makedirs", "zipfile.ZipFile", "updater.apply_archive", "os.path.isfile", "shutil.rmtree", "os.path.abspath", "os.remove" ]
[((462, 571), 'updater.create_archive', 'updater.create_archive', (['"""tests/in"""'], {'ignore_list': "(updater.COMMON_FILTERS + ['no.+'])", 'package_name': 'out_name'}), "('tests/in', ignore_list=updater.COMMON_FILTERS + [\n 'no.+'], package_name=out_name)\n", (484, 571), False, 'import updater\n'), ((770, 789), '...
''' :Author: <NAME> <<EMAIL>> :Date: 2017-04-06 :Copyright: 2017-2018, Karr Lab :License: MIT ''' # example program using example spam module # TODO(Arthur): cover after MVP wc_sim done import spam # pragma: no cover for cmd in ["ls -l", "date", "no_such_command", 7, None, 'kill']: # pragma: no cover try: ...
[ "spam.nothing", "spam.system" ]
[((488, 502), 'spam.nothing', 'spam.nothing', ([], {}), '()\n', (500, 502), False, 'import spam\n'), ((335, 351), 'spam.system', 'spam.system', (['cmd'], {}), '(cmd)\n', (346, 351), False, 'import spam\n')]
# Spider: A Spider in the game. The most basic unit. # DO NOT MODIFY THIS FILE # Never try to directly create an instance of this class, or modify its member variables. # Instead, you should only be reading its variables and calling its functions. from games.spiders.game_object import GameObject # <<-- Creer-Merge: ...
[ "games.spiders.game_object.GameObject.__init__" ]
[((775, 800), 'games.spiders.game_object.GameObject.__init__', 'GameObject.__init__', (['self'], {}), '(self)\n', (794, 800), False, 'from games.spiders.game_object import GameObject\n')]
# main.py from __future__ import absolute_import from __future__ import division from __future__ import print_function import glob import tensorflow as tf from datasets.aracati import Aracati from keras import backend as K from models.unet import Unet from trainers.trainer import Trainer from utils.logger import Log...
[ "utils.config.process_config", "tensorflow.Session", "keras.backend.set_session", "tensorflow.logging.set_verbosity", "trainers.trainer.Trainer", "models.unet.Unet", "datasets.aracati.Aracati.load_data", "utils.dirs.create_dirs", "datasets.aracati.Aracati", "utils.logger.Logger", "glob.glob", ...
[((429, 456), 'tensorflow.logging.set_verbosity', 'tf.logging.set_verbosity', (['(3)'], {}), '(3)\n', (453, 456), True, 'import tensorflow as tf\n'), ((535, 650), 'utils.dirs.create_dirs', 'create_dirs', (['config', '[config.checkpoint_dir, config.evaluate_dir, config.presentation_dir,\n config.summary_dir]'], {}), ...
import uuid from .exception import InvalidPath class Path(object): def __init__(self, path): self.name = None self.procedure = None; self.is_wildcard = False self.path = None if type(path) is str or type(path) is unicode: self.path = str(path) splitt...
[ "uuid.UUID" ]
[((816, 840), 'uuid.UUID', 'uuid.UUID', ([], {'hex': 'self.name'}), '(hex=self.name)\n', (825, 840), False, 'import uuid\n')]
# coding = utf-8 # Create date: 2018-11-15 # Author :<NAME> from utils.connect_to_os import executor, connection def test_ros_local_service(ros_kvm_init, cloud_config_url): kwargs = dict(cloud_config='{url}default.yml'.format(url=cloud_config_url), is_install_to_hard_drive=True) tuple_return = ros_kvm_init(*...
[ "utils.connect_to_os.executor" ]
[((562, 597), 'utils.connect_to_os.executor', 'executor', (['client', 'create_test_image'], {}), '(client, create_test_image)\n', (570, 597), False, 'from utils.connect_to_os import executor, connection\n'), ((602, 636), 'utils.connect_to_os.executor', 'executor', (['client', 'build_test_image'], {}), '(client, build_t...
import csv path = "/home/ubuntu/data_set_5/" csv_binary = "driving_log.csv" lines = [] #read in the csv file with open(path + csv_binary) as csvfile: reader = csv.reader(csvfile) for line in reader: lines.append(line) from sklearn.model_selection import train_test_split train_samples, validation_samp...
[ "keras.layers.core.Flatten", "cv2.imread", "cv2.flip", "keras.layers.convolutional.Convolution2D", "sklearn.model_selection.train_test_split", "sklearn.utils.shuffle", "keras.layers.Lambda", "keras.models.Sequential", "numpy.array", "keras.layers.Cropping2D", "keras.layers.core.Dropout", "csv....
[((326, 364), 'sklearn.model_selection.train_test_split', 'train_test_split', (['lines'], {'test_size': '(0.2)'}), '(lines, test_size=0.2)\n', (342, 364), False, 'from sklearn.model_selection import train_test_split\n'), ((2650, 2662), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (2660, 2662), False, 'fro...
#!/usr/bin/env python3 """Using getmembers() """ # end_pymotw_header import inspect from pprint import pprint import example pprint(inspect.getmembers(example.A), width=65)
[ "inspect.getmembers" ]
[((135, 164), 'inspect.getmembers', 'inspect.getmembers', (['example.A'], {}), '(example.A)\n', (153, 164), False, 'import inspect\n')]
# -*- coding: utf-8 -*- """ This module will provide a plugin for Darjeeling that adds CMT support. """ __all__ = ('StartTest',) from typing import (Tuple, Dict, Any, Sequence, NoReturn, Mapping, Iterator, Optional, Callable) import os import attr import bugzoo import darjeeling from darjeeling im...
[ "os.path.exists", "attr.s", "os.path.isabs", "loguru.logger.debug", "loguru.logger.info", "loguru.logger.warning", "os.path.join", "darjeeling.exceptions.BadConfigurationException", "attr.ib" ]
[((797, 835), 'attr.s', 'attr.s', ([], {'frozen': '(True)', 'auto_attribs': '(True)'}), '(frozen=True, auto_attribs=True)\n', (803, 835), False, 'import attr\n'), ((4276, 4295), 'attr.s', 'attr.s', ([], {'frozen': '(True)'}), '(frozen=True)\n', (4282, 4295), False, 'import attr\n'), ((5863, 5911), 'attr.s', 'attr.s', (...
# Copyright lowRISC contributors. # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 r"""Contains life cycle state encoding class which is used to generate new life cycle encodings. """ import logging as log import random from collections import OrderedDict ...
[ "collections.OrderedDict", "random.choice", "lib.common.random_or_hexvalue", "lib.common.is_valid_codeword", "lib.common.hd_histogram", "lib.common.get_hd", "random.getrandbits", "lib.common.ecc_encode", "logging.info", "lib.common.check_int", "Crypto.Hash.cSHAKE128.new" ]
[((5987, 6028), 'lib.common.check_int', 'check_int', (["config['secded']['data_width']"], {}), "(config['secded']['data_width'])\n", (5996, 6028), False, 'from lib.common import check_int, ecc_encode, get_hd, hd_histogram, is_valid_codeword, random_or_hexvalue, scatter_bits\n'), ((6065, 6105), 'lib.common.check_int', '...
#!/usr/bin/env python3 import sys dataset, action = sys.argv[1:] assert(dataset in {'mb', 'kitti'}) assert(action in {'test_te', 'train_tr'}) workers = [ ('localhost', '-gpu 1'), ('localhost', '-gpu 2'), ('localhost', '-gpu 3'), ('localhost', '-gpu 4'), ] if dataset == 'kitti' and action == 'train_t...
[ "subprocess.check_output", "random.choice", "multiprocessing.current_process" ]
[((2511, 2551), 'subprocess.check_output', 'subprocess.check_output', (['cmd'], {'shell': '(True)'}), '(cmd, shell=True)\n', (2534, 2551), False, 'import subprocess\n'), ((2158, 2191), 'multiprocessing.current_process', 'multiprocessing.current_process', ([], {}), '()\n', (2189, 2191), False, 'import multiprocessing\n'...
""" .. module: dispatch.tag.recommender :platform: Unix :copyright: (c) 2019 by Netflix Inc., see AUTHORS for more :license: Apache, see LICENSE for more details. """ import logging from typing import List, Any from collections import defaultdict import tempfile import pandas as pd from pandas.core.frame i...
[ "logging.getLogger", "pandas.read_pickle", "tempfile.gettempdir", "collections.defaultdict", "pandas.DataFrame" ]
[((435, 462), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (452, 462), False, 'import logging\n'), ((821, 846), 'pandas.read_pickle', 'pd.read_pickle', (['file_name'], {}), '(file_name)\n', (835, 846), True, 'import pandas as pd\n'), ((2474, 2511), 'pandas.DataFrame', 'pd.DataFrame', ([...
import sys import os from decimal import Decimal from fractions import Fraction import pytest sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..')) import votelib.evaluate import votelib.evaluate.openlist def test_open_list_elem(): pref = votelib.evaluate.openlist.ThresholdOpenList(jump_fraction=...
[ "os.path.dirname", "pytest.mark.parametrize", "fractions.Fraction", "decimal.Decimal" ]
[((797, 887), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (["('is_list_pref', 'result')", '[(True, [2, 1]), (False, [4, 3])]'], {}), "(('is_list_pref', 'result'), [(True, [2, 1]), (False,\n [4, 3])])\n", (820, 887), False, 'import pytest\n'), ((126, 151), 'os.path.dirname', 'os.path.dirname', (['__file__']...
""" The Specializer is responsible for loading up sourcecode, specializing code-templates for Externs and possibly other things down the road. """ # pylint: disable=no-member # The ndarray member is added dynamically and therefore not visible to pylint. import logging import os import numpy as np from py...
[ "os.path.exists", "os.path.isabs", "os.sep.join", "os.path.basename", "os.stat", "logging.error" ]
[((1786, 1809), 'os.path.isabs', 'os.path.isabs', (['filename'], {}), '(filename)\n', (1799, 1809), False, 'import os\n'), ((1954, 1980), 'os.path.basename', 'os.path.basename', (['filename'], {}), '(filename)\n', (1970, 1980), False, 'import os\n'), ((843, 905), 'logging.error', 'logging.error', (['"""Cannot find spec...
import json import requests import environ from requests.auth import HTTPBasicAuth def modify_destination(): env = environ.Env() environ.Env.read_env() # your destination ID destination_id = '' API_KEY = env("API_KEY") API_SECRET = env("API_SECRET") base64 = HTTPBasicAuth(API_KEY, API_S...
[ "requests.patch", "requests.auth.HTTPBasicAuth", "environ.Env", "environ.Env.read_env" ]
[((121, 134), 'environ.Env', 'environ.Env', ([], {}), '()\n', (132, 134), False, 'import environ\n'), ((139, 161), 'environ.Env.read_env', 'environ.Env.read_env', ([], {}), '()\n', (159, 161), False, 'import environ\n'), ((292, 326), 'requests.auth.HTTPBasicAuth', 'HTTPBasicAuth', (['API_KEY', 'API_SECRET'], {}), '(API...
""" Defines the Quotation repository """ from sqlalchemy.orm.exc import NoResultFound from config import ALPHAVANTAGE_API_KEY from alpha_vantage.timeseries import TimeSeries from models import Company, Quotation from util.quotation_utils import map_quotation_key class QuotationRepository: """ The repository for...
[ "models.Quotation", "models.Quotation.query.filter_by", "util.quotation_utils.map_quotation_key", "models.Company.query.filter_by", "alpha_vantage.timeseries.TimeSeries" ]
[((640, 676), 'alpha_vantage.timeseries.TimeSeries', 'TimeSeries', ([], {'key': 'ALPHAVANTAGE_API_KEY'}), '(key=ALPHAVANTAGE_API_KEY)\n', (650, 676), False, 'from alpha_vantage.timeseries import TimeSeries\n'), ((760, 783), 'util.quotation_utils.map_quotation_key', 'map_quotation_key', (['data'], {}), '(data)\n', (777,...
from datetime import timedelta from functools import lru_cache from typing import Optional from slasher import Slasher from .common import simplify_segments def slasher_to_segments(s: Slasher) -> Optional[list]: if s.intervals: return simplify_segments([[start, start + s.duration.total_seconds()] for start in s.int...
[ "datetime.timedelta", "slasher.Slasher.from_url" ]
[((413, 483), 'slasher.Slasher.from_url', 'Slasher.from_url', (['f"""https://www.twitch.tv/videos/{video_id}"""'], {}), "(f'https://www.twitch.tv/videos/{video_id}', **kwargs)\n", (429, 483), False, 'from slasher import Slasher\n'), ((852, 872), 'datetime.timedelta', 'timedelta', ([], {'minutes': '(1)'}), '(minutes=1)\...
#!/usr/bin/env python import os import glob HERE = os.path.dirname(__file__) files = glob.glob(os.path.join(HERE, '../data/json/*.json')) from codetalker import testing import codetalker.contrib.json as json parse_rule = testing.parse_rule(__name__, json.grammar) def make_parse(fname): text = open(fname).read(...
[ "codetalker.testing.parse_rule", "os.path.join", "os.path.dirname", "os.path.basename", "codetalker.contrib.json.loads" ]
[((52, 77), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (67, 77), False, 'import os\n'), ((225, 267), 'codetalker.testing.parse_rule', 'testing.parse_rule', (['__name__', 'json.grammar'], {}), '(__name__, json.grammar)\n', (243, 267), False, 'from codetalker import testing\n'), ((97, 138),...
""" Algorithm : Message in converted in binary values. Binary digit 0 corresponds to an odd RGB value and binary digit 1 corresponds to an even RGB value of the image. If binary value of the message is 1 then the sum of R, G and B values will be an even integer otherwise it will be odd. """ from PIL import Image from ...
[ "numpy.array", "numpy.shape", "PIL.Image.open", "PIL.Image.fromarray" ]
[((638, 660), 'PIL.Image.open', 'Image.open', (['"""test.jpg"""'], {}), "('test.jpg')\n", (648, 660), False, 'from PIL import Image\n'), ((735, 748), 'numpy.shape', 'np.shape', (['img'], {}), '(img)\n', (743, 748), True, 'import numpy as np\n'), ((755, 765), 'numpy.array', 'array', (['img'], {}), '(img)\n', (760, 765),...
"""Scripts to create clothes""" # Utilities import csv import random categories_list = ['camisa', 'blusa', 'camiseta', 'chaqueta', 'pantalones', 'falda', 'sombrero', 'gorra'] SIZES_LIST = ['XS', 'S', 'M', 'L', 'XL', 'XXL', 'NS'] color_list = ['amarillo', 'verde', 'rojo', 'azul', 'beige', 'naranja'] GENDER_LIST = ['F'...
[ "csv.writer", "random.choice", "random.randint" ]
[((652, 678), 'random.choice', 'random.choice', (['values_list'], {}), '(values_list)\n', (665, 678), False, 'import random\n'), ((826, 846), 'random.randint', 'random.randint', (['(0)', '(2)'], {}), '(0, 2)\n', (840, 846), False, 'import random\n'), ((1070, 1094), 'csv.writer', 'csv.writer', (['clothes_file'], {}), '(...
# Generated by Django 3.1.5 on 2021-05-11 13:47 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('blog', '0010_auto_20210509_1936'), ] operations = [ migrations.CreateModel( name='Contact', fields=[ ...
[ "django.db.models.EmailField", "django.db.models.TextField", "django.db.models.IntegerField", "django.db.models.AutoField", "django.db.models.CharField" ]
[((870, 900), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'default': '(0)'}), '(default=0)\n', (889, 900), False, 'from django.db import migrations, models\n'), ((328, 421), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)...
# Generated by Django 2.1.4 on 2019-01-18 13:46 import django.utils.timezone from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("accesstoken", "0001_initial"), ] operations = [ migrations.AddField( model_name="accesstoken", ...
[ "django.db.models.DateTimeField" ]
[((364, 419), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'default': 'django.utils.timezone.now'}), '(default=django.utils.timezone.now)\n', (384, 419), False, 'from django.db import migrations, models\n')]
import pytest from yaplox.ast_printer import AstPrinter from yaplox.expr import Binary from yaplox.parser import Parser from yaplox.scanner import Scanner from yaplox.stmt import Expression from yaplox.token import Token from yaplox.token_type import TokenType class TestParser: def test_parser(self, mocker): ...
[ "yaplox.ast_printer.AstPrinter", "yaplox.parser.Parser", "pytest.raises", "yaplox.scanner.Scanner", "yaplox.token.Token" ]
[((2518, 2562), 'yaplox.parser.Parser', 'Parser', (['tokens'], {'on_token_error': 'on_error_mock'}), '(tokens, on_token_error=on_error_mock)\n', (2524, 2562), False, 'from yaplox.parser import Parser\n'), ((3391, 3455), 'yaplox.token.Token', 'Token', ([], {'token_type': 'TokenType.EOF', 'lexeme': '""""""', 'literal': '...
import basilica import os from dotenv import load_dotenv load_dotenv() BASCILICA_API_KEY=os.getenv("BASCILICA_API_KEY", default="oops") sentences = [ "This is a sentence!", "This is a similar sentence!", "I don't think this sentence is very similar at all...", ] with basilica.Connection(BASCILICA_API_KEY)...
[ "basilica.Connection", "os.getenv", "dotenv.load_dotenv" ]
[((58, 71), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (69, 71), False, 'from dotenv import load_dotenv\n'), ((91, 137), 'os.getenv', 'os.getenv', (['"""BASCILICA_API_KEY"""'], {'default': '"""oops"""'}), "('BASCILICA_API_KEY', default='oops')\n", (100, 137), False, 'import os\n'), ((282, 320), 'basilica.Co...
from contextvars import ContextVar from typing import Optional from telethon.tl.custom import Message class Context: __print_output: ContextVar[str] __msg: ContextVar[Optional[Message]] def __init__(self): self.__msg = ContextVar('msg') self.__print_output = ContextVar('print_output', de...
[ "contextvars.ContextVar" ]
[((243, 260), 'contextvars.ContextVar', 'ContextVar', (['"""msg"""'], {}), "('msg')\n", (253, 260), False, 'from contextvars import ContextVar\n'), ((291, 329), 'contextvars.ContextVar', 'ContextVar', (['"""print_output"""'], {'default': '""""""'}), "('print_output', default='')\n", (301, 329), False, 'from contextvars...
import time from functools import wraps import os import sys import traceback import _ctypes IS_CUS_ENABLE = True STDOUT = sys.stdout #python setup.py sdist bdist_wheel #python -m twine upload dist/* def set_cus_enable(): global IS_CUS_ENABLE IS_CUS_ENABLE = True def set_cus_disable(): global IS_CUS_EN...
[ "os.path.join", "functools.wraps", "sys._getframe", "os.path.dirname", "sys.exit", "time.localtime" ]
[((576, 601), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (591, 601), False, 'import os\n'), ((845, 870), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (860, 870), False, 'import os\n'), ((1655, 1666), 'functools.wraps', 'wraps', (['func'], {}), '(func)\n', (166...
import os import sys import argparse import torch import torch.distributed as dist from torch.nn.parallel import DistributedDataParallel from torch.utils.data import DataLoader, DistributedSampler from torchvision.transforms import functional as tfms # import wandb from apex import amp import numpy as np from nump...
[ "torch.utils.data.DistributedSampler", "apex.amp.scale_loss", "numpy.random.rand", "photobooth.transforms.rot_90", "ignite.engine.Engine", "apex.amp.initialize", "torch.distributed.get_rank", "argparse.ArgumentParser", "photobooth.transforms.crop_bounding_box", "ignite.engine._prepare_batch", "i...
[((907, 944), 'torch.tensor', 'torch.tensor', (['[0.4488, 0.4371, 0.404]'], {}), '([0.4488, 0.4371, 0.404])\n', (919, 944), False, 'import torch\n'), ((2348, 2373), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2371, 2373), False, 'import argparse\n'), ((3355, 3388), 'torch.cuda.set_device', ...
from datetime import datetime, timedelta from logging import StreamHandler, ERROR from copy import copy import os from nose.tools import eq_, raises from apscheduler.jobstores.ram_store import RAMJobStore from apscheduler.scheduler import Scheduler, SchedulerAlreadyRunningError from apscheduler.job import Job from ap...
[ "datetime.datetime", "apscheduler.jobstores.ram_store.RAMJobStore", "logging.StreamHandler", "apscheduler.scheduler.logger.addHandler", "nose.tools.eq_", "apscheduler.scheduler.logger.removeHandler", "apscheduler.events.SchedulerEvent", "datetime.timedelta", "datetime.datetime.now", "apscheduler.s...
[((3364, 3392), 'datetime.datetime', 'datetime', (['(2011)', '(4)', '(3)', '(18)', '(40)'], {}), '(2011, 4, 3, 18, 40)\n', (3372, 3392), False, 'from datetime import datetime, timedelta\n'), ((802, 818), 'nose.tools.raises', 'raises', (['KeyError'], {}), '(KeyError)\n', (808, 818), False, 'from nose.tools import eq_, r...
""" Capture video frames """ import cv2 def get_frame(): """ Reads frames from camera """ capture = cv2.VideoCapture(0) # Camera index while capture.isOpened(): ret, frame = capture.read() if ret: cv2.imshow('Input frame', frame) gray_scaled = cv...
[ "cv2.imwrite", "cv2.imshow", "cv2.destroyAllWindows", "cv2.VideoCapture", "cv2.cvtColor", "cv2.waitKey" ]
[((127, 146), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (143, 146), False, 'import cv2\n'), ((578, 601), 'cv2.destroyAllWindows', 'cv2.destroyAllWindows', ([], {}), '()\n', (599, 601), False, 'import cv2\n'), ((829, 853), 'cv2.imwrite', 'cv2.imwrite', (['name', 'frame'], {}), '(name, frame)\n', (8...
from types import SimpleNamespace import pytest from mock import patch, MagicMock from backend.lambdas.tasks.check_queue_size import handler pytestmark = [pytest.mark.unit, pytest.mark.task] @patch("backend.lambdas.tasks.check_queue_size.sqs") def test_it_returns_correct_queue_size(mock_resource): mock_queue =...
[ "mock.patch", "mock.MagicMock", "types.SimpleNamespace" ]
[((197, 248), 'mock.patch', 'patch', (['"""backend.lambdas.tasks.check_queue_size.sqs"""'], {}), "('backend.lambdas.tasks.check_queue_size.sqs')\n", (202, 248), False, 'from mock import patch, MagicMock\n'), ((321, 332), 'mock.MagicMock', 'MagicMock', ([], {}), '()\n', (330, 332), False, 'from mock import patch, MagicM...
# Generated by Django 3.2.8 on 2021-12-25 11:57 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('company', '0001_initial'), ] operations = [ migrations.RemoveField( model_name='gim_mba', name='company_ptr', ), ...
[ "django.db.migrations.DeleteModel", "django.db.migrations.RemoveField" ]
[((216, 280), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""gim_mba"""', 'name': '"""company_ptr"""'}), "(model_name='gim_mba', name='company_ptr')\n", (238, 280), False, 'from django.db import migrations\n'), ((325, 388), 'django.db.migrations.RemoveField', 'migrations.RemoveFie...
from django.db.models.query import Prefetch from geotrek.api.v2 import serializers as api_serializers, \ filters as api_filters, viewsets as api_viewsets from geotrek.common.models import Attachment from geotrek.flatpages import models as flatpages_models class FlatPageViewSet(api_viewsets.GeotrekViewSet): f...
[ "geotrek.common.models.Attachment.objects.select_related", "geotrek.flatpages.models.FlatPage.objects.order_by" ]
[((545, 602), 'geotrek.flatpages.models.FlatPage.objects.order_by', 'flatpages_models.FlatPage.objects.order_by', (['"""order"""', '"""pk"""'], {}), "('order', 'pk')\n", (587, 602), True, 'from geotrek.flatpages import models as flatpages_models\n'), ((699, 743), 'geotrek.common.models.Attachment.objects.select_related...
from ecolor import slow_color, slow_print, ecolor ecolor("This is red text", "red") ecolor("This is bold blue text", "bold_blue") slow_print("This is slow_print\n", 0.025) slow_color("This is slow_print but colorful\n", "blue", 0.025) slow_color("This is slow_print but colorful and bold\n", "bold_blue", 0.025)
[ "ecolor.ecolor", "ecolor.slow_print", "ecolor.slow_color" ]
[((50, 83), 'ecolor.ecolor', 'ecolor', (['"""This is red text"""', '"""red"""'], {}), "('This is red text', 'red')\n", (56, 83), False, 'from ecolor import slow_color, slow_print, ecolor\n'), ((84, 129), 'ecolor.ecolor', 'ecolor', (['"""This is bold blue text"""', '"""bold_blue"""'], {}), "('This is bold blue text', 'b...
#!/usr/bin/env python """Tests for the GRR Foreman.""" from __future__ import absolute_import from __future__ import unicode_literals from grr_response_core.lib import flags from grr_response_core.lib import rdfvalue from grr_response_core.lib import utils from grr_response_core.lib.rdfvalues import client as rdf_clie...
[ "grr_response_server.foreman_rules.ForemanRegexClientRule", "grr_response_server.aff4.FACTORY.Create", "grr_response_core.lib.rdfvalues.protodict.Dict", "grr_response_core.lib.rdfvalue.RDFDatetime.FromSecondsSinceEpoch", "grr_response_core.lib.flags.StartMain", "grr_response_server.foreman_rules.ForemanRu...
[((20106, 20125), 'grr.test_lib.test_lib.main', 'test_lib.main', (['argv'], {}), '(argv)\n', (20119, 20125), False, 'from grr.test_lib import test_lib\n'), ((20157, 20178), 'grr_response_core.lib.flags.StartMain', 'flags.StartMain', (['main'], {}), '(main)\n', (20172, 20178), False, 'from grr_response_core.lib import f...
import os import cv2 import numpy as np import random from tqdm import tqdm TEMP_CACHE_NAME = './~temp.png' gaussian_blur_params = [1, 3, 3, 3, 3, 3, 5] def build_dataset(data_dir, new_dir='datasets', dataset_name='rvl-cdip', mode='train'): origin_dir = os.path.join(data_dir, dataset_name) label_path = os.pa...
[ "os.path.exists", "os.path.join", "os.makedirs" ]
[((261, 297), 'os.path.join', 'os.path.join', (['data_dir', 'dataset_name'], {}), '(data_dir, dataset_name)\n', (273, 297), False, 'import os\n'), ((315, 364), 'os.path.join', 'os.path.join', (['origin_dir', '"""labels"""', "(mode + '.txt')"], {}), "(origin_dir, 'labels', mode + '.txt')\n", (327, 364), False, 'import o...
# Copyright 2020 Huawei Technologies Co., Ltd # # 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...
[ "torch.split", "torch.nn.CrossEntropyLoss", "torch.stack", "torch.nn.functional.kl_div", "torch.nn.functional.softmax" ]
[((1706, 1737), 'torch.split', 'torch.split', (['output', 'split_size'], {}), '(output, split_size)\n', (1717, 1737), False, 'import torch\n'), ((1495, 1522), 'torch.nn.CrossEntropyLoss', 'torch.nn.CrossEntropyLoss', ([], {}), '()\n', (1520, 1522), False, 'import torch\n'), ((1890, 1914), 'torch.nn.functional.softmax',...
from __future__ import absolute_import from __future__ import print_function from __future__ import division import numpy as np import numpy.testing as npt from reinforceflow.core import SumTree, MinTree def test_sumtree_sum(): capacity = 100000 dataset = list(range(capacity)) dataset_actual = list(range...
[ "reinforceflow.core.MinTree", "numpy.array", "numpy.testing.assert_almost_equal", "numpy.sum", "numpy.zeros_like", "reinforceflow.core.SumTree" ]
[((355, 372), 'reinforceflow.core.SumTree', 'SumTree', (['capacity'], {}), '(capacity)\n', (362, 372), False, 'from reinforceflow.core import SumTree, MinTree\n'), ((575, 588), 'reinforceflow.core.SumTree', 'SumTree', (['size'], {}), '(size)\n', (582, 588), False, 'from reinforceflow.core import SumTree, MinTree\n'), (...
""" Meta resource used in the endpoints to generalize the methods and how they work in order to make all endpoints the same. It should allow all CRUD (create, read, update, delete) operations """ # Import from libraries from flask import request from flask_restful import Resource from functools import wraps # Import f...
[ "functools.wraps" ]
[((1775, 1786), 'functools.wraps', 'wraps', (['func'], {}), '(func)\n', (1780, 1786), False, 'from functools import wraps\n')]
import threading import logging import time class ThreadHelperException(Exception): pass class ThreadHelper(threading.Thread): """ The class provides a frame for the threads used in the framework. """ # ------------------------------------------------------------------------------...
[ "threading.Thread.__init__", "logging.debug", "threading.Lock", "time.sleep", "threading.Event" ]
[((784, 815), 'threading.Thread.__init__', 'threading.Thread.__init__', (['self'], {}), '(self)\n', (809, 815), False, 'import threading\n'), ((898, 914), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (912, 914), False, 'import threading\n'), ((946, 963), 'threading.Event', 'threading.Event', ([], {}), '()\n', ...
#!-*-coding:utf-8-*- import sys # import PyQt4 QtCore and QtGui modules from PyQt5.QtWidgets import * from PyQt5.QtGui import * from PyQt5 import QtCore from pylinac import LeedsTOR from TorTor import Ui_MainWindow class DirectoryPath(object): def __init__(self, pathDir,getCountImages): self._pathDir = pa...
[ "TorTor.Ui_MainWindow", "pylinac.LeedsTOR" ]
[((727, 742), 'TorTor.Ui_MainWindow', 'Ui_MainWindow', ([], {}), '()\n', (740, 742), False, 'from TorTor import Ui_MainWindow\n'), ((1822, 1841), 'pylinac.LeedsTOR', 'LeedsTOR', (['d.pathDir'], {}), '(d.pathDir)\n', (1830, 1841), False, 'from pylinac import LeedsTOR\n'), ((1513, 1531), 'pylinac.LeedsTOR', 'LeedsTOR', (...
# Generated by Django 3.2.9 on 2022-01-12 22:48 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('ContractorApp', '0025_job_employer'), ] operations = [ migrations.AddField( model_name='job', name='employer_email',...
[ "django.db.models.EmailField" ]
[((339, 395), 'django.db.models.EmailField', 'models.EmailField', ([], {'blank': '(True)', 'max_length': '(254)', 'null': '(True)'}), '(blank=True, max_length=254, null=True)\n', (356, 395), False, 'from django.db import migrations, models\n')]
#!/usr/bin/env python # Copyright [2010] [Anso Labs, 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 requi...
[ "os.path.dirname", "setuptools.find_packages" ]
[((736, 764), 'os.path.dirname', 'os.path.dirname', (['sys.argv[0]'], {}), '(sys.argv[0])\n', (751, 764), False, 'import os\n'), ((970, 985), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (983, 985), False, 'from setuptools import setup, find_packages\n')]
import unittest.mock as mock from urllib.parse import quote as param_encoder from django.urls import reverse from django.core.exceptions import ImproperlyConfigured from rest_framework import status from api.models import PublicDataset, Workspace, Resource from api.tests.base import BaseAPITestCase from api.tests impo...
[ "api.models.Resource.objects.create", "django.urls.reverse", "django.core.exceptions.ImproperlyConfigured", "unittest.mock.patch", "api.models.PublicDataset.objects.all", "api.models.PublicDataset.objects.get" ]
[((4890, 4942), 'unittest.mock.patch', 'mock.patch', (['"""api.views.public_dataset.query_dataset"""'], {}), "('api.views.public_dataset.query_dataset')\n", (4900, 4942), True, 'import unittest.mock as mock\n'), ((6780, 6845), 'unittest.mock.patch', 'mock.patch', (['"""api.views.public_dataset.create_dataset_from_param...
import numpy as np import pandas as pd import matplotlib.pyplot as plt plt.rcParams.update({'font.size': 18}) pol_thres=0.7 xlsx_filename='Data_1_5.83.xlsx' table=pd.read_excel(xlsx_filename, index_col=None, header=None) Ex, Ey, Ez, h, X, T, n2, labs =[],[],[],[],[],[],[],[] for i in range(9): Ex.append(table[0...
[ "matplotlib.pyplot.savefig", "matplotlib.pyplot.ylabel", "numpy.where", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.rcParams.update", "matplotlib.pyplot.figure", "matplotlib.pyplot.axes", "numpy.cos", "pandas.read_excel", "numpy.sin", "matplotlib.pyplot.legend" ]
[((72, 110), 'matplotlib.pyplot.rcParams.update', 'plt.rcParams.update', (["{'font.size': 18}"], {}), "({'font.size': 18})\n", (91, 110), True, 'import matplotlib.pyplot as plt\n'), ((165, 222), 'pandas.read_excel', 'pd.read_excel', (['xlsx_filename'], {'index_col': 'None', 'header': 'None'}), '(xlsx_filename, index_co...
import sys import os import warnings import importlib from importlib.util import find_spec def import_module(name, package=None): return importlib.import_module(name, package=package) def import_string(import_name, package=None, *, silent=False): """Imports an object or module based on a string. """ try: ret...
[ "importlib.import_module", "importlib.util.find_spec", "os.path.dirname", "sys.exc_info", "warnings.simplefilter", "sys.modules.pop", "os.path.abspath" ]
[((2925, 2987), 'warnings.simplefilter', 'warnings.simplefilter', (['"""always"""', 'ModuleMovedDeprecationWarning'], {}), "('always', ModuleMovedDeprecationWarning)\n", (2946, 2987), False, 'import warnings\n'), ((141, 187), 'importlib.import_module', 'importlib.import_module', (['name'], {'package': 'package'}), '(na...
'''Functions to calculate substrate thermal noise ''' from __future__ import division, print_function import numpy as np from numpy import exp, inf, pi, sqrt import scipy.special import scipy.integrate from .. import const from ..const import BESSEL_ZEROS as zeta from ..const import J0M as j0m def substrate_thermor...
[ "numpy.exp", "numpy.sqrt" ]
[((3510, 3526), 'numpy.exp', 'exp', (['(-2 * km * h)'], {}), '(-2 * km * h)\n', (3513, 3526), False, 'from numpy import exp, inf, pi, sqrt\n'), ((3649, 3679), 'numpy.exp', 'exp', (['(-(zeta * r0 / a) ** 2 / 4)'], {}), '(-(zeta * r0 / a) ** 2 / 4)\n', (3652, 3679), False, 'from numpy import exp, inf, pi, sqrt\n'), ((595...
import os, json from blockfrost import BlockFrostApi, ApiError from blockfrost.utils import convert_json_to_object hash = "8f55e18a94e4c0951e5b8bd8910b2cb20aa4d742b1608fda3a06793d39fb07b1" xpub = "d507c8f866691bd96e131334c355188b1a1d0b2fa0ab11545075aab332d77d9eb19657ad13ee581b56b0f8d744d66ca356b93d42fe176b3de007d53e9c...
[ "blockfrost.BlockFrostApi", "os.getenv", "blockfrost.utils.convert_json_to_object" ]
[((405, 420), 'blockfrost.BlockFrostApi', 'BlockFrostApi', ([], {}), '()\n', (418, 420), False, 'from blockfrost import BlockFrostApi, ApiError\n'), ((1034, 1076), 'os.getenv', 'os.getenv', (['"""BLOCKFROST_PROJECT_ID_MAINNET"""'], {}), "('BLOCKFROST_PROJECT_ID_MAINNET')\n", (1043, 1076), False, 'import os, json\n'), (...
from stests.chain import set_deploy from stests.chain.utils import execute_cli from stests.chain.utils import DeployDispatchInfo from stests.events import EventType # Method upon client to be invoked. _CLIENT_METHOD = "put-deploy" # Name of smart contract to dispatch & invoke. _CONTRACT_FNAME = "withdraw_bid.wasm" ...
[ "stests.chain.set_deploy.execute", "stests.chain.utils.execute_cli" ]
[((323, 391), 'stests.chain.utils.execute_cli', 'execute_cli', (['_CLIENT_METHOD', 'EventType.WFLOW_DEPLOY_DISPATCH_FAILURE'], {}), '(_CLIENT_METHOD, EventType.WFLOW_DEPLOY_DISPATCH_FAILURE)\n', (334, 391), False, 'from stests.chain.utils import execute_cli\n'), ((730, 1003), 'stests.chain.set_deploy.execute', 'set_dep...
import logging import os from doc_curation.md.file import MdFile from indic_transliteration import sanscript from selenium import webdriver from selenium.common.exceptions import NoSuchElementException from selenium.webdriver.chrome import options from selenium.webdriver.remote.remote_connection import LOGGER from d...
[ "logging.basicConfig", "selenium.webdriver.chrome.options.Options", "os.path.exists", "selenium.webdriver.remote.remote_connection.LOGGER.setLevel", "selenium.webdriver.Chrome", "doc_curation.text_data.get_subunit_path_list", "urllib.parse.quote", "logging.info", "doc_curation.text_data.get_subunit_...
[((350, 382), 'selenium.webdriver.remote.remote_connection.LOGGER.setLevel', 'LOGGER.setLevel', (['logging.WARNING'], {}), '(logging.WARNING)\n', (365, 382), False, 'from selenium.webdriver.remote.remote_connection import LOGGER\n'), ((438, 476), 'urllib3.connectionpool.log.setLevel', 'urllibLogger.setLevel', (['loggin...
# Sample code from the TorchVision 0.3 Object Detection Finetuning Tutorial # http://pytorch.org/tutorials/intermediate/torchvision_tutorial.html import os import numpy as np import torch import random import json import argparse from PIL import Image import cv2 from alfworld.agents.detector.engine import train_one_...
[ "cv2.rectangle", "numpy.uint8", "torch.as_tensor", "alfworld.agents.detector.transforms.ToTensor", "cv2.imshow", "alfworld.agents.detector.transforms.RandomHorizontalFlip", "numpy.array", "alfworld.agents.detector.transforms.Compose", "torch.cuda.is_available", "os.listdir", "argparse.ArgumentPa...
[((6642, 6663), 'alfworld.agents.detector.transforms.Compose', 'T.Compose', (['transforms'], {}), '(transforms)\n', (6651, 6663), True, 'import alfworld.agents.detector.transforms as T\n'), ((7326, 7375), 'torch.utils.data.Subset', 'torch.utils.data.Subset', (['dataset', 'indices[:-4000]'], {}), '(dataset, indices[:-40...
import os, glob import matplotlib.pyplot as plt import matplotlib.patches as patches import javabridge import bioformats def init_vm(): javabridge.start_vm(class_path=bioformats.JARS) #remove annoying logs myloglevel="ERROR" # user string argument for logLevel. rootLoggerName = javabridge.get_static_field("...
[ "matplotlib.patches.Rectangle", "bioformats.formatreader.make_image_reader_class", "javabridge.start_vm", "javabridge.call", "matplotlib.pyplot.Axes", "os.path.realpath", "javabridge.kill_vm", "matplotlib.pyplot.figure", "javabridge.static_call", "javabridge.get_static_field", "bioformats.format...
[((140, 187), 'javabridge.start_vm', 'javabridge.start_vm', ([], {'class_path': 'bioformats.JARS'}), '(class_path=bioformats.JARS)\n', (159, 187), False, 'import javabridge\n'), ((291, 384), 'javabridge.get_static_field', 'javabridge.get_static_field', (['"""org/slf4j/Logger"""', '"""ROOT_LOGGER_NAME"""', '"""Ljava/lan...
from __future__ import division from past.utils import old_div #=============================================================================== # SCG Scaled conjugate gradient optimization. # # Copyright (c) <NAME> (1996-2001) # updates by <NAME> 2013 # # Permission is granted for anyone to copy, use, or modif...
[ "logging.getLogger", "numpy.dot", "math.sqrt", "past.utils.old_div" ]
[((3475, 3494), 'past.utils.old_div', 'old_div', (['(-mu)', 'delta'], {}), '(-mu, delta)\n', (3482, 3494), False, 'from past.utils import old_div\n'), ((2600, 2618), 'numpy.dot', 'np.dot', (['d', 'gradnew'], {}), '(d, gradnew)\n', (2606, 2618), True, 'import numpy as np\n'), ((2735, 2747), 'numpy.dot', 'np.dot', (['d',...
import os import progressbar import numpy as np import tensorflow as tf import skimage.io as io from sklearn.preprocessing import LabelBinarizer from pathutils import list_images def _byte_feature(value): return tf.train.Feature(bytes_list=tf.train.BytesList(value=[value])) def _int64_feature(value): retu...
[ "progressbar.Bar", "sklearn.preprocessing.LabelBinarizer", "tensorflow.train.Int64List", "tensorflow.train.BytesList", "skimage.io.imread", "progressbar.Timer", "tensorflow.train.Features", "tensorflow.python_io.TFRecordWriter", "pathutils.list_images", "progressbar.ETA" ]
[((861, 897), 'tensorflow.python_io.TFRecordWriter', 'tf.python_io.TFRecordWriter', (['outFile'], {}), '(outFile)\n', (888, 897), True, 'import tensorflow as tf\n'), ((1055, 1071), 'sklearn.preprocessing.LabelBinarizer', 'LabelBinarizer', ([], {}), '()\n', (1069, 1071), False, 'from sklearn.preprocessing import LabelBi...
from django.conf.urls import patterns, include, url urlpatterns = patterns('', url(r'^$', 'simplemooc.accounts.views.dashboard', name='dashboard'), url(r'^entrar/$', 'django.contrib.auth.views.login', {'template_name': 'accounts/login.html'}, name='login'), url(r'^sair/$', 'django.contrib...
[ "django.conf.urls.url" ]
[((84, 150), 'django.conf.urls.url', 'url', (['"""^$"""', '"""simplemooc.accounts.views.dashboard"""'], {'name': '"""dashboard"""'}), "('^$', 'simplemooc.accounts.views.dashboard', name='dashboard')\n", (87, 150), False, 'from django.conf.urls import patterns, include, url\n'), ((166, 277), 'django.conf.urls.url', 'url...
""" HAProxy SPOA - Modsecurity and Python This is a heavily Work in Progress Run this with the spoa binary, like: RULES=modsec-rules.conf ./spoa -f modsecurity-spoa.py """ import logging import os import spoa import sys import ModSecurity import time import json from pprint import pprint class modsectransaction(): ...
[ "logging.basicConfig", "logging.getLogger", "os.path.exists", "ModSecurity.ModSecurityIntervention", "json.dumps", "os.environ.get", "time.perf_counter", "logging.warning", "ModSecurity.Rules", "sys.exit", "ModSecurity.ModSecurity", "spoa.register_message", "spoa.set_var_int32", "time.time...
[((7662, 7701), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (7681, 7701), False, 'import logging\n'), ((7713, 7736), 'os.environ.get', 'os.environ.get', (['"""RULES"""'], {}), "('RULES')\n", (7727, 7736), False, 'import os\n'), ((7972, 8021), 'spoa.register_m...
# -*- coding: utf-8 -*- # # <NAME> # orthologue # (c) 1998-2019 all rights reserved # # access to the framework import pyre # superclass from .Package import Package # my declaration class Library(Package): """ Base class for third party libraries """ # user configurable state defines = pyre.pr...
[ "pyre.properties.paths", "pyre.properties.strings" ]
[((313, 338), 'pyre.properties.strings', 'pyre.properties.strings', ([], {}), '()\n', (336, 338), False, 'import pyre\n'), ((424, 447), 'pyre.properties.paths', 'pyre.properties.paths', ([], {}), '()\n', (445, 447), False, 'import pyre\n'), ((540, 563), 'pyre.properties.paths', 'pyre.properties.paths', ([], {}), '()\n'...
import arabic_reshaper import itertools import math import matplotlib.pyplot as plt import numpy as np import os import seaborn as sns import sys import warnings from bidi.algorithm import get_display from matplotlib import rc from matplotlib.backends import backend_gtk3 from iran_stock import get_iran_stock_network ...
[ "numpy.column_stack", "numpy.count_nonzero", "matplotlib.rc", "numpy.save", "numpy.mean", "os.path.exists", "numpy.max", "matplotlib.pyplot.close", "numpy.matmul", "numpy.linalg.lstsq", "numpy.min", "sys.stdout.flush", "arabic_reshaper.reshape", "numpy.abs", "numpy.ones", "numpy.square...
[((354, 417), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {'module': 'backend_gtk3.__name__'}), "('ignore', module=backend_gtk3.__name__)\n", (377, 417), False, 'import warnings\n'), ((446, 480), 'os.path.join', 'os.path.join', (['OUTPUT_DIR', '"""xi.npy"""'], {}), "(OUTPUT_DIR, 'xi.npy')\n...
# Copyright 2016-2022 Swiss National Supercomputing Centre (CSCS/ETH Zurich) # ReFrame Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: BSD-3-Clause # # unittests/conftest.py -- pytest fixtures used in multiple unit tests # import contextlib import pytest import reframe.co...
[ "contextlib.suppress", "reframe.core.runtime.temp_runtime" ]
[((810, 870), 'reframe.core.runtime.temp_runtime', 'rt.temp_runtime', (['self.config_file', 'self.system', 'self.options'], {}), '(self.config_file, self.system, self.options)\n', (825, 870), True, 'import reframe.core.runtime as rt\n'), ((928, 962), 'contextlib.suppress', 'contextlib.suppress', (['StopIteration'], {})...
import logging import os import time import pytest from helpers.cluster import ClickHouseCluster from helpers.test_tools import TSV logging.getLogger().setLevel(logging.INFO) logging.getLogger().addHandler(logging.StreamHandler()) SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) @pytest.fixture(scope="modu...
[ "logging.getLogger", "logging.StreamHandler", "helpers.cluster.ClickHouseCluster", "time.sleep", "pytest.param", "os.path.realpath", "pytest.fixture", "logging.info" ]
[((294, 324), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (308, 324), False, 'import pytest\n'), ((208, 231), 'logging.StreamHandler', 'logging.StreamHandler', ([], {}), '()\n', (229, 231), False, 'import logging\n'), ((263, 289), 'os.path.realpath', 'os.path.realpath', ([...