code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from typing import Iterator, Tuple, Set, List, Dict, Any, Optional, Type
import logging
import subprocess
import pexpect
import tempfile
import os
import json
import csv
import attr
import functools
import time
import math
import argparse
import concurrent.futures
from ruamel.yaml import YAML
from ground_truth impor... | [
"argparse.ArgumentParser",
"os.path.dirname",
"logging.StreamHandler",
"ruamel.yaml.YAML",
"verify_test_data.VerifiedEntry",
"ground_truth.DatabaseEntry.from_dict",
"os.path.join",
"logging.getLogger"
] | [((559, 587), 'logging.getLogger', 'logging.getLogger', (['"""houston"""'], {}), "('houston')\n", (576, 587), False, 'import logging\n'), ((715, 738), 'logging.StreamHandler', 'logging.StreamHandler', ([], {}), '()\n', (736, 738), False, 'import logging\n'), ((945, 1004), 'argparse.ArgumentParser', 'argparse.ArgumentPa... |
"""Build a file URL."""
import os
import inspect
import subprocess
REVISION_CMD = "git rev-parse --short HEAD"
def _get_git_revision():
# Comes from scikit-learn
# https://github.com/scikit-learn/scikit-learn/blob/master/doc/sphinxext/github_link.py
try:
revision = subprocess.check_output(REVISIO... | [
"inspect.getsourcelines",
"inspect.getsourcefile"
] | [((539, 565), 'inspect.getsourcefile', 'inspect.getsourcefile', (['obj'], {}), '(obj)\n', (560, 565), False, 'import inspect\n'), ((839, 866), 'inspect.getsourcelines', 'inspect.getsourcelines', (['obj'], {}), '(obj)\n', (861, 866), False, 'import inspect\n')] |
"""Plots (and/or saves) the graphical trading data using Matplotlib"""
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
from models.Trading import TechnicalAnalysis
import datetime, re, sys
sys.path.append('.')
class TradingGraphs():
def __init__(self, tech... | [
"matplotlib.pyplot.style.use",
"numpy.arange",
"matplotlib.pyplot.tick_params",
"matplotlib.pyplot.tight_layout",
"sys.path.append",
"pandas.DataFrame",
"matplotlib.pyplot.axvline",
"matplotlib.pyplot.close",
"datetime.timedelta",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.subplots",
"matp... | [((248, 268), 'sys.path.append', 'sys.path.append', (['"""."""'], {}), "('.')\n", (263, 268), False, 'import datetime, re, sys\n'), ((799, 815), 'matplotlib.pyplot.close', 'plt.close', (['"""all"""'], {}), "('all')\n", (808, 815), True, 'import matplotlib.pyplot as plt\n'), ((1175, 1199), 'matplotlib.pyplot.style.use',... |
# Copyright 2017 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 applicable law or a... | [
"tensorflow.reverse",
"tensorflow.size",
"tensorflow.maximum",
"tensorflow.contrib.data.Dataset.zip",
"tensorflow.concat",
"tensorflow.constant",
"tensorflow.string_split",
"tensorflow.minimum",
"tensorflow.TensorShape",
"collections.namedtuple"
] | [((1123, 1281), 'collections.namedtuple', 'collections.namedtuple', (['"""BatchedInput"""', "('initializer', 'source', 'target_input', 'target_output',\n 'source_sequence_length', 'target_sequence_length')"], {}), "('BatchedInput', ('initializer', 'source',\n 'target_input', 'target_output', 'source_sequence_leng... |
import torch
import torch.optim as optim
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter
from torchvision import datasets, transforms
import argparse
import os
import os.path as osp
from pprint import pprint
from train import train_model
from model import WideResNet
from atta... | [
"argparse.ArgumentParser",
"torch.utils.data.DataLoader",
"os.makedirs",
"torchvision.transforms.RandomHorizontalFlip",
"os.path.exists",
"model.WideResNet",
"train.train_model",
"torchvision.transforms.ToTensor",
"torchvision.datasets.CIFAR10",
"torch.utils.tensorboard.SummaryWriter",
"torch.nn... | [((373, 442), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""PGD based adversarial training"""'}), "(description='PGD based adversarial training')\n", (396, 442), False, 'import argparse\n'), ((1088, 1130), 'os.path.join', 'osp.join', (['args.result_path', '"""model.latest"""'], {}), "(a... |
import argparse
from igibson.examples.behavior.behavior_demo_batch import behavior_demo_batch
from igibson.metrics.agent import BehaviorRobotMetric
from igibson.metrics.disarrangement import KinematicDisarrangement, LogicalDisarrangement
from igibson.metrics.gaze import GazeMetric
from igibson.metrics.task import Task... | [
"igibson.metrics.disarrangement.LogicalDisarrangement",
"argparse.ArgumentParser",
"igibson.metrics.gaze.GazeMetric",
"igibson.metrics.disarrangement.KinematicDisarrangement",
"igibson.metrics.agent.BehaviorRobotMetric",
"igibson.examples.behavior.behavior_demo_batch.behavior_demo_batch",
"igibson.metri... | [((360, 452), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Collect metrics from BEHAVIOR demos in manifest."""'}), "(description=\n 'Collect metrics from BEHAVIOR demos in manifest.')\n", (383, 452), False, 'import argparse\n'), ((1321, 1416), 'igibson.examples.behavior.behavior_dem... |
__all__ = ['cactus']
import os
import warnings
from pathlib import Path
import pytorch_lightning as pl
import wandb
from pytorch_lightning.loggers import WandbLogger
from unsupervised_meta_learning.cactus import *
from unsupervised_meta_learning.protonets import (CactusPrototypicalModel,
... | [
"pytorch_lightning.Trainer",
"warnings.simplefilter",
"wandb.finish",
"os.getcwd",
"pytorch_lightning.loggers.WandbLogger",
"unsupervised_meta_learning.protonets.CactusPrototypicalModel",
"warnings.catch_warnings",
"os.path.join"
] | [((571, 582), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (580, 582), False, 'import os\n'), ((968, 1248), 'pytorch_lightning.loggers.WandbLogger', 'WandbLogger', ([], {'project': '"""protonet"""', 'config': "{'batch_size': batch_size, 'steps': 30000, 'dataset': 'omniglot', 'cactus':\n True, 'pre-loaded-partitions':... |
#coding=utf8
import os, json, pickle, argparse, sys, time
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
from asdl.asdl import ASDLGrammar
from asdl.transition_system import TransitionSystem
from asdl.action_info import get_action_infos
from preprocess.common_utils import Preprocessor
def process_example(... | [
"asdl.asdl.ASDLGrammar.from_filepath",
"preprocess.common_utils.Preprocessor",
"argparse.ArgumentParser",
"os.path.dirname",
"time.time",
"asdl.transition_system.TransitionSystem.get_class_by_lang",
"asdl.action_info.get_action_infos"
] | [((662, 699), 'asdl.action_info.get_action_infos', 'get_action_infos', ([], {'tgt_actions': 'actions'}), '(tgt_actions=actions)\n', (678, 699), False, 'from asdl.action_info import get_action_infos\n'), ((1367, 1410), 'asdl.asdl.ASDLGrammar.from_filepath', 'ASDLGrammar.from_filepath', (['GRAMMAR_FILEPATH'], {}), '(GRAM... |
import h5py
import numpy as np
import math
import matplotlib.pyplot as plt
# multiple h5 files?
f = h5py.File('shockwave.h5', 'r')
dset2 = f['2'] # fourier
k_density_re = dset2['k_density_re'][...]
k_density_im = dset2['k_density_im'][...]
kx = dset2['kx'][...]
tk = dset2['t'][...]
k_density = k_density_re + 1j * k_d... | [
"h5py.File",
"numpy.abs",
"numpy.angle",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.subplots",
"numpy.gradient"
] | [((101, 131), 'h5py.File', 'h5py.File', (['"""shockwave.h5"""', '"""r"""'], {}), "('shockwave.h5', 'r')\n", (110, 131), False, 'import h5py\n'), ((1842, 1870), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(2)'], {'sharex': '(True)'}), '(2, sharex=True)\n', (1854, 1870), True, 'import matplotlib.pyplot as plt\n'), (... |
# Generated by Django 2.2.5 on 2020-01-15 12:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('post', '0047_auto_20200109_2243'),
]
operations = [
migrations.RemoveField(
model_name='post',
name='publish',
... | [
"django.db.migrations.RemoveField",
"django.db.models.CharField"
] | [((232, 289), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""post"""', 'name': '"""publish"""'}), "(model_name='post', name='publish')\n", (254, 289), False, 'from django.db import migrations, models\n'), ((430, 533), 'django.db.models.CharField', 'models.CharField', ([], {'choice... |
import logging
from django.apps import apps
from django.conf import settings
from rest_framework import serializers
from zconnect.serializers import CreateDeviceSerializer, DeviceSerializer
from zconnect.models import Product
from .models import DemoDevice
logger = logging.getLogger(__name__)
class DemoDeviceSeri... | [
"django.apps.apps.get_model",
"logging.getLogger"
] | [((270, 297), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (287, 297), False, 'import logging\n'), ((378, 424), 'django.apps.apps.get_model', 'apps.get_model', (['settings.ZCONNECT_DEVICE_MODEL'], {}), '(settings.ZCONNECT_DEVICE_MODEL)\n', (392, 424), False, 'from django.apps import app... |
# Copyright 1999-2020 Alibaba Group Holding 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 a... | [
"functools.partial",
"time.time",
"collections.defaultdict",
"sys.exc_info",
"logging.getLogger"
] | [((1146, 1173), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1163, 1173), False, 'import logging\n'), ((8004, 8020), 'collections.defaultdict', 'defaultdict', (['set'], {}), '(set)\n', (8015, 8020), False, 'from collections import defaultdict\n'), ((31489, 31505), 'collections.defaultd... |
# By Snu
# The creator is not responsible for misuse
"""
MIT License
Copyright (c) 2022 Snu
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the ... | [
"discord.ext.commands.command",
"discord.ext.commands.has_permissions",
"random.choice",
"asyncio.get_running_loop",
"discord.Permissions.all",
"datetime.datetime.now"
] | [((1649, 1694), 'discord.ext.commands.command', 'commands.command', ([], {'aliases': "content['spam'][1:]"}), "(aliases=content['spam'][1:])\n", (1665, 1694), False, 'from discord.ext import commands\n'), ((2411, 2457), 'discord.ext.commands.command', 'commands.command', ([], {'aliases': "content['purge'][1:]"}), "(ali... |
import argparse
# set for MSR-VTT defaults
def parse_opts():
parser = argparse.ArgumentParser()
parser.add_argument(
'--dataset',
type=str,
default='msvd',
choices=[
'msvd',
'msrvtt'],
help='Dataset to use')
parser.add_argument(
'--... | [
"argparse.ArgumentParser"
] | [((76, 101), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (99, 101), False, 'import argparse\n')] |
import ctypes
import ctypes.util
import os
import unittest
import sys
import meg
class TestLibmatrix(unittest.TestCase):
def test(self):
matrix = meg.libmatrix.mxCreateDoubleMatrix(
3, 4, meg.libmatrix.Complexity.REAL)
self.assertEqual(meg.libmatrix.mxIsNumeric(matrix), True)
s... | [
"unittest.main",
"meg.libmatrix.mxIsNumeric",
"meg.libmatrix.mxDestroyArray",
"meg.libmatrix.mxGetDimensions",
"meg.libmatrix.mxGetImagData",
"meg.libmatrix.mxGetNumberOfDimensions",
"meg.libmatrix.mxCreateDoubleMatrix"
] | [((691, 706), 'unittest.main', 'unittest.main', ([], {}), '()\n', (704, 706), False, 'import unittest\n'), ((160, 231), 'meg.libmatrix.mxCreateDoubleMatrix', 'meg.libmatrix.mxCreateDoubleMatrix', (['(3)', '(4)', 'meg.libmatrix.Complexity.REAL'], {}), '(3, 4, meg.libmatrix.Complexity.REAL)\n', (194, 231), False, 'import... |
# Generated by Django 3.0.3 on 2020-05-30 16:13
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('courses', '0015_course_fee_type'),
('profiles', '0001_initial'),
('course_homes', '0015_learningtopic_info')... | [
"django.db.models.DateField",
"django.db.models.IntegerField",
"django.db.models.CharField",
"django.db.models.ForeignKey"
] | [((461, 500), 'django.db.models.DateField', 'models.DateField', ([], {'blank': '(True)', 'null': '(True)'}), '(blank=True, null=True)\n', (477, 500), False, 'from django.db import migrations, models\n'), ((631, 670), 'django.db.models.DateField', 'models.DateField', ([], {'blank': '(True)', 'null': '(True)'}), '(blank=... |
# Copyright 2018 SAS Project 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 requ... | [
"util.configurable_testcase",
"json.dumps",
"reference_models.geo.utils.ShrinkAndCleanPolygon",
"reference_models.geo.utils.PolygonsAlmostEqual",
"os.path.join",
"json.loads",
"util.getCertificateFingerprint",
"os.path.dirname",
"os.path.exists",
"util.loadConfig",
"util.getCertFilename",
"ref... | [((1789, 1849), 'os.path.join', 'os.path.join', (['"""testcases"""', '"""output"""', '"""test_WINNF_FT_S_PCR_1"""'], {}), "('testcases', 'output', 'test_WINNF_FT_S_PCR_1')\n", (1801, 1849), False, 'import os\n'), ((2036, 2097), 'os.path.join', 'os.path.join', (['ppa_zone_data_dir_path', 'ppa_zone_data_file_name'], {}),... |
# Use the original version with BERTMNLI to reproduce the results.
# from moverscore import get_idf_dict, word_mover_score
# Recommend to use this version (DistilBERT) for evaluation, if the speed is your concern.
# from moverscore_v2 import get_idf_dict, word_mover_score
import sys
del sys.path[0]
import os
os.enviro... | [
"json.dump",
"json.load",
"os.path.dirname",
"moverscore.word_mover_score",
"moverscore.get_idf_dict",
"os.path.join"
] | [((557, 575), 'moverscore.get_idf_dict', 'get_idf_dict', (['hyps'], {}), '(hyps)\n', (569, 575), False, 'from moverscore import get_idf_dict, word_mover_score\n'), ((595, 613), 'moverscore.get_idf_dict', 'get_idf_dict', (['refs'], {}), '(refs)\n', (607, 613), False, 'from moverscore import get_idf_dict, word_mover_scor... |
'''
File: cal_metrics.py
Author: <NAME>
Version: 0.1
Create: 2014-01-03 11:12:17
Description: Calcuating the statistic metrics metrics
'''
# updated (2014-01-03 11:12:29): updated the code
import logging
def cal_error_bound_2d(x, y, scale):
'''
calculate error budget based on x time of the Landsat and ... | [
"logging.warning",
"logging.info"
] | [((3461, 3499), 'logging.info', 'logging.info', (["('process %s lines' % _no)"], {}), "('process %s lines' % _no)\n", (3473, 3499), False, 'import logging\n'), ((3523, 3558), 'logging.warning', 'logging.warning', (['"""no values loaded"""'], {}), "('no values loaded')\n", (3538, 3558), False, 'import logging\n'), ((321... |
import pickle
import json
import sqlite3
from twisted.enterprise import adbapi
class DB:
filename = "skynet.db"
_db = None
_ready = False
@staticmethod
def get_db():
if DB._db is None:
def callb(con):
con.row_factory = sqlite3.Row
DB._db = adbapi.Co... | [
"pickle.loads",
"json.loads",
"pickle.dumps",
"json.dumps",
"twisted.enterprise.adbapi.ConnectionPool"
] | [((3039, 3059), 'pickle.dumps', 'pickle.dumps', (['script'], {}), '(script)\n', (3051, 3059), False, 'import pickle\n'), ((3452, 3472), 'pickle.dumps', 'pickle.dumps', (['script'], {}), '(script)\n', (3464, 3472), False, 'import pickle\n'), ((311, 374), 'twisted.enterprise.adbapi.ConnectionPool', 'adbapi.ConnectionPool... |
"""Simple validation of specifications passed to slybot"""
from os.path import dirname, join
import json
import rfc3987
from urlparse import urlparse, parse_qsl
from urllib import urlencode
from urllib2 import unquote
from jsonschema import Draft3Validator, RefResolver, FormatChecker
_PATH = dirname(__file__)
def... | [
"jsonschema.FormatChecker.cls_checks",
"jsonschema.Draft3Validator.DEFAULT_TYPES.copy",
"os.path.dirname",
"jsonschema.RefResolver",
"urlparse.urlparse",
"os.path.join",
"jsonschema.FormatChecker"
] | [((297, 314), 'os.path.dirname', 'dirname', (['__file__'], {}), '(__file__)\n', (304, 314), False, 'from os.path import dirname, join\n'), ((352, 379), 'os.path.join', 'join', (['_PATH', '"""schemas.json"""'], {}), "(_PATH, 'schemas.json')\n", (356, 379), False, 'from os.path import dirname, join\n'), ((544, 580), 'jso... |
import pygame
from Tile import Tile
from random import randint
from Character import Character
from Character import Direction
__author__ = '<NAME>'
"""
The Zombie class defines a zombie NPC for this game
"""
class Zombie(Character):
# Character definition in map.txt
SPAWN_ZONE = "!"
ORIGINAL_ZOMBIE_IM... | [
"pygame.image.load",
"Tile.Tile.get_tile",
"random.randint",
"Character.Character.__init__"
] | [((326, 364), 'pygame.image.load', 'pygame.image.load', (['"""images/zombie.png"""'], {}), "('images/zombie.png')\n", (343, 364), False, 'import pygame\n'), ((615, 645), 'Character.Character.__init__', 'Character.__init__', (['self', 'x', 'y'], {}), '(self, x, y)\n', (633, 645), False, 'from Character import Character\... |
#-*- coding:utf-8 -*-
# Importando Bibliotecas
import os
import funcoes
arquivo = funcoes.open_file_mod()
#-------------------------------------------------------------------------------------------------------
q2 = input("Deseja passar um ano para saber o Ranking de Pib per capita por estado(caso não queira mandare... | [
"os.remove",
"os.path.exists",
"funcoes.open_file_mod"
] | [((83, 106), 'funcoes.open_file_mod', 'funcoes.open_file_mod', ([], {}), '()\n', (104, 106), False, 'import funcoes\n'), ((2469, 2510), 'os.path.exists', 'os.path.exists', (['"""questao_02/saida_q2.txt"""'], {}), "('questao_02/saida_q2.txt')\n", (2483, 2510), False, 'import os\n'), ((2549, 2585), 'os.remove', 'os.remov... |
import scrapy
import json5
class XqbotSpider(scrapy.Spider):
name = 'dmt'
allowed_domains = ['www.xueqiu.com']
start_urls = ['https://xueqiu.com/P/ZH2126346',
'https://xueqiu.com/P/ZH2268976',
]
def parse(self, response):
# pass
#print(response.text)
#page ... | [
"json5.loads"
] | [((881, 898), 'json5.loads', 'json5.loads', (['data'], {}), '(data)\n', (892, 898), False, 'import json5\n')] |
from abc import ABC
from typing import Hashable, Any
from pathlib import Path
from os import getenv
import logging
import yaml
class ConfigLocationError(Exception):
pass
class BaseConfig(ABC):
def __init__(self):
self.log = logging.getLogger(self.__class__.__name__)
@property
def as_dict(se... | [
"pathlib.Path",
"yaml.safe_load",
"os.getenv",
"logging.getLogger"
] | [((244, 286), 'logging.getLogger', 'logging.getLogger', (['self.__class__.__name__'], {}), '(self.__class__.__name__)\n', (261, 286), False, 'import logging\n'), ((1997, 2016), 'pathlib.Path', 'Path', (['self.filepath'], {}), '(self.filepath)\n', (2001, 2016), False, 'from pathlib import Path\n'), ((1229, 1243), 'os.ge... |
'''
PyPi 更换为国内镜像源
'''
import sys
import os
mirrors = '''\
[global]
timeout = 60
index-url = https://mirrors.ustc.edu.cn/pypi/web/simple/
extra-index-url = https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/\
'''
user = os.path.expanduser('~')
if sys.platform == 'win32':
os.mkdir(f"{user}/AppData/Roaming/pi... | [
"os.mkdir",
"os.path.expanduser"
] | [((228, 251), 'os.path.expanduser', 'os.path.expanduser', (['"""~"""'], {}), "('~')\n", (246, 251), False, 'import os\n'), ((284, 323), 'os.mkdir', 'os.mkdir', (['f"""{user}/AppData/Roaming/pip"""'], {}), "(f'{user}/AppData/Roaming/pip')\n", (292, 323), False, 'import os\n'), ((495, 519), 'os.mkdir', 'os.mkdir', (['f""... |
from django.conf import settings
from django.template.loader import render_to_string
class FieldFaker:
"""
Base class to return faker and kwargs
for a given model field
:faker - the Faker method to be called
:faker_kwargs - the kwargs to be passed to the faker method
:unquote_kwargs - the kwa... | [
"django.template.loader.render_to_string",
"faker.Faker"
] | [((1115, 1160), 'django.template.loader.render_to_string', 'render_to_string', (['self.template', 'self.context'], {}), '(self.template, self.context)\n', (1131, 1160), False, 'from django.template.loader import render_to_string\n'), ((9195, 9202), 'faker.Faker', 'Faker', ([], {}), '()\n', (9200, 9202), False, 'from fa... |
import os
import time
import numpy as np
import pandas as pd
import normalizedDistance
from pprint import pprint
from recourse.builder import RecourseBuilder
from recourse.builder import ActionSet
def genExp(model_trained, factual_sample, norm_type, dataset_obj):
start_time = time.time()
# SIMPLE HACK!!
# Act... | [
"numpy.sum",
"time.time",
"normalizedDistance.getDistanceBetweenSamples",
"recourse.builder.ActionSet",
"pandas.Series",
"numpy.add",
"recourse.builder.RecourseBuilder",
"numpy.round"
] | [((282, 293), 'time.time', 'time.time', ([], {}), '()\n', (291, 293), False, 'import time\n'), ((1428, 1471), 'recourse.builder.ActionSet', 'ActionSet', ([], {'X': 'X', 'custom_bounds': 'custom_bounds'}), '(X=X, custom_bounds=custom_bounds)\n', (1437, 1471), False, 'from recourse.builder import ActionSet\n'), ((2692, 2... |
import streamlit as st
from code import helpers
import pandas as pd
st.title("Datos")
st.markdown("Cargue un archivo de datos en formato Fishtalk para su procesamiento.")
c1, c2, c3 = st.columns([3,1,3])
# Upload button
upload_text = "Cargar archivo"
uploaded_file = c1.file_uploader(upload_text)
# Work and use a ... | [
"streamlit.markdown",
"streamlit.columns",
"streamlit.spinner",
"streamlit.title",
"code.helpers.clean_file",
"pandas.read_excel",
"streamlit.info",
"streamlit.empty"
] | [((70, 87), 'streamlit.title', 'st.title', (['"""Datos"""'], {}), "('Datos')\n", (78, 87), True, 'import streamlit as st\n'), ((89, 178), 'streamlit.markdown', 'st.markdown', (['"""Cargue un archivo de datos en formato Fishtalk para su procesamiento."""'], {}), "(\n 'Cargue un archivo de datos en formato Fishtalk pa... |
import socket
import threading
import time
import logging
class Handler(threading.Thread):
def __init__(self, port):
threading.Thread.__init__(self)
logging.info(f"Handler listening on 0.0.0.0:{port}")
self.connected = False
self.port = int(port)
def run(self):
self.so... | [
"logging.info",
"threading.Thread.__init__",
"socket.socket"
] | [((131, 162), 'threading.Thread.__init__', 'threading.Thread.__init__', (['self'], {}), '(self)\n', (156, 162), False, 'import threading\n'), ((171, 223), 'logging.info', 'logging.info', (['f"""Handler listening on 0.0.0.0:{port}"""'], {}), "(f'Handler listening on 0.0.0.0:{port}')\n", (183, 223), False, 'import loggin... |
#!/usr/bin/env python
# coding=utf8
import os
import matplotlib as mpl
import numpy as np
import path
import pytest
from triflow import Model, Simulation, display_fields, display_probe # noqa
if os.environ.get('DISPLAY', '') == '':
print('no display found. Using non-interactive Agg backend')
mpl.use('Agg')... | [
"triflow.Model",
"triflow.display_probe",
"path.tempdir",
"os.environ.get",
"triflow.display_fields",
"matplotlib.use",
"triflow.Simulation",
"numpy.linspace",
"numpy.cos",
"pytest.mark.parametrize"
] | [((1367, 1420), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""fmt"""', "['png', 'svg', 'pdf']"], {}), "('fmt', ['png', 'svg', 'pdf'])\n", (1390, 1420), False, 'import pytest\n'), ((1707, 1760), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""fmt"""', "['png', 'svg', 'pdf']"], {}), "('fmt', ['p... |
#
# -*- coding: utf-8 -*-
#
# Copyright (c) 2021 Intel Corporation
#
# 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 app... | [
"pandas.DataFrame",
"neural_compressor.experimental.Quantization",
"tensorflow.io.gfile.GFile",
"utils.tokenizer.Subtokenizer",
"six.unichr",
"tensorflow.compat.v1.logging.info",
"time.time",
"tensorflow.compat.v1.Session",
"neural_compressor.experimental.common.Model",
"numpy.array",
"tensorflo... | [((3905, 3966), 'tensorflow.compat.v1.logging.info', 'tf.compat.v1.logging.info', (["('Loading graph from: ' + file_name)"], {}), "('Loading graph from: ' + file_name)\n", (3930, 3966), True, 'import tensorflow as tf\n'), ((4475, 4505), 'utils.tokenizer.Subtokenizer', 'Subtokenizer', (['FLAGS.vocab_file'], {}), '(FLAGS... |
from distutils.core import setup
setup(
name = 'Esse3Api',
packages = ['Esse3Api'],
version = '1.1',
license = 'MIT',
description = 'A python library to query and interact with Cineca\'s ESSE3 REST API',
author = '<NAME>',
author_email = '<EMAIL>',
url = 'https://github.com/LorenzoLeonar... | [
"distutils.core.setup"
] | [((33, 838), 'distutils.core.setup', 'setup', ([], {'name': '"""Esse3Api"""', 'packages': "['Esse3Api']", 'version': '"""1.1"""', 'license': '"""MIT"""', 'description': '"""A python library to query and interact with Cineca\'s ESSE3 REST API"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'url': '"""htt... |
# vFabric Administration Server API
# Copyright (c) 2012 VMware, 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
... | [
"datetime.datetime.utcfromtimestamp",
"vas.gemfire.CacheServerNodeInstances.CacheServerNodeInstance",
"vas.util.LinkUtils.LinkUtils.get_link_href"
] | [((2861, 2929), 'vas.util.LinkUtils.LinkUtils.get_link_href', 'LinkUtils.get_link_href', (['self._details', '"""cache-server-node-instance"""'], {}), "(self._details, 'cache-server-node-instance')\n", (2884, 2929), False, 'from vas.util.LinkUtils import LinkUtils\n'), ((2964, 3013), 'vas.util.LinkUtils.LinkUtils.get_li... |
# from app.main.models.ChallengesModel import ChallengesModel
from ..models.AttemptsModel import AttemptsModel
from ..models.ContestsChallengesModel import contests_challenges
from ..models.UsersModel import UserModel
from app.main import db
import uuid
import json
def get_raw_data(contest_id):
data_raw = db.en... | [
"app.main.db.engine.execute"
] | [((315, 651), 'app.main.db.engine.execute', 'db.engine.execute', (["('select total.user_id, total.total, total.contest_id, u.name, u.email, c.contest_name from (select sum(max_score) as total, user_id, contest_id from attempts where contest_id = %s group by user_id) as total join users as u on u.id = total.user_id join... |
import argparse
import torch
import os
import numpy as np
import datasets.crowd as crowd
from models import vgg19
def run():
torch.multiprocessing.freeze_support()
parser = argparse.ArgumentParser(description='Test ')
parser.add_argument('--device', default='0', help='assign device')
parser.add_argume... | [
"numpy.abs",
"argparse.ArgumentParser",
"torch.utils.data.DataLoader",
"os.makedirs",
"torch.sum",
"torch.load",
"torch.set_grad_enabled",
"os.path.exists",
"numpy.square",
"models.vgg19",
"torch.multiprocessing.freeze_support",
"numpy.array",
"cv2.applyColorMap",
"torch.device",
"os.pat... | [((130, 168), 'torch.multiprocessing.freeze_support', 'torch.multiprocessing.freeze_support', ([], {}), '()\n', (166, 168), False, 'import torch\n'), ((183, 227), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Test """'}), "(description='Test ')\n", (206, 227), False, 'import argparse\n'... |
# coding=utf-8
# Copyright 2020 The uncertainty_metrics Authors.
#
# 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.compat.v2.keras.layers.Lambda",
"tensorflow.compat.v2.test.main",
"tensorflow.compat.v2.enable_v2_behavior",
"tensorflow.compat.v2.convert_to_tensor",
"numpy.array",
"uncertainty_metrics.ExpectedCalibrationError"
] | [((6981, 7004), 'tensorflow.compat.v2.enable_v2_behavior', 'tf.enable_v2_behavior', ([], {}), '()\n', (7002, 7004), True, 'import tensorflow.compat.v2 as tf\n'), ((7007, 7021), 'tensorflow.compat.v2.test.main', 'tf.test.main', ([], {}), '()\n', (7019, 7021), True, 'import tensorflow.compat.v2 as tf\n'), ((884, 942), 'n... |
"""
Convolutional LSTM cell implementation from https://github.com/loliverhennigh
"""
import tensorflow as tf
class BasicConvLSTMCell(object):
"""Basic Conv LSTM recurrent network cell.
"""
def __init__(self, shape, filter_size, num_features, forget_bias=1.0,
input_size=None, state_is_tuple=False... | [
"tensorflow.constant_initializer",
"tensorflow.variable_scope",
"tensorflow.concat",
"tensorflow.nn.sigmoid",
"tensorflow.nn.conv2d",
"tensorflow.split",
"tensorflow.get_variable"
] | [((3677, 3724), 'tensorflow.variable_scope', 'tf.variable_scope', (["(scope or 'Conv')"], {'reuse': 'reuse'}), "(scope or 'Conv', reuse=reuse)\n", (3694, 3724), True, 'import tensorflow as tf\n'), ((3739, 3851), 'tensorflow.get_variable', 'tf.get_variable', (['"""Matrix"""', '[filter_size[0], filter_size[1], total_arg_... |
from panda3d.core import CollisionTube, CollisionNode
from libotp.nametag.NametagGroup import *
from toontown.pets import Pet
from toontown.suit import SuitDNA, Suit
from toontown.toon import NPCToons, Toon, ToonDNA
from toontown.toonbase import TTLocalizer
from toontown.toonbase import ToontownGlobals
def createToon(... | [
"toontown.toon.ToonDNA.ToonDNA",
"panda3d.core.CollisionNode",
"toontown.suit.Suit.Suit",
"toontown.suit.SuitDNA.SuitDNA",
"panda3d.core.CollisionTube",
"toontown.toonbase.ToontownGlobals.CogDepts.index",
"toontown.toon.NPCToons.createLocalNPC",
"toontown.pets.Pet.Pet",
"toontown.toon.Toon.Toon"
] | [((458, 489), 'toontown.toon.NPCToons.createLocalNPC', 'NPCToons.createLocalNPC', (['toonId'], {}), '(toonId)\n', (481, 489), False, 'from toontown.toon import NPCToons, Toon, ToonDNA\n'), ((1464, 1475), 'toontown.toon.Toon.Toon', 'Toon.Toon', ([], {}), '()\n', (1473, 1475), False, 'from toontown.toon import NPCToons, ... |
from backend_web import sql, pd
def query_sql(PATH_SQL: str, Query: str, fetch: bool):
with sql.connect(PATH_SQL) as conn:
cur = conn.cursor()
cur.execute(Query)
if fetch:
return cur.fetchone()
conn.commit()
return 0
def sql_tables(PATH_SQL: str, Query: str):
wi... | [
"smtplib.SMTP_SSL",
"json.load",
"os.getcwd",
"email.message.EmailMessage",
"os.environ.get",
"backend_web.sql.connect"
] | [((3136, 3167), 'os.environ.get', 'os.environ.get', (['"""EMAIL_ADDRESS"""'], {}), "('EMAIL_ADDRESS')\n", (3150, 3167), False, 'import os\n'), ((3184, 3211), 'os.environ.get', 'os.environ.get', (['"""EMAIL_KEY"""'], {}), "('EMAIL_KEY')\n", (3198, 3211), False, 'import os\n'), ((3223, 3237), 'email.message.EmailMessage'... |
"""Video classification configuration definition."""
from typing import Optional, Tuple
import dataclasses
from official.core import config_definitions as cfg
from official.core import exp_factory
from official.modeling import hyperparams
from official.modeling import optimization
from official.vision.beta.configs impo... | [
"official.modeling.optimization.OptimizationConfig",
"official.core.exp_factory.register_config_factory",
"official.core.config_definitions.TrainerConfig",
"official.core.config_definitions.RuntimeConfig"
] | [((3701, 3755), 'official.core.exp_factory.register_config_factory', 'exp_factory.register_config_factory', (['"""yt8m_experiment"""'], {}), "('yt8m_experiment')\n", (3736, 3755), False, 'from official.core import exp_factory\n'), ((3341, 3573), 'official.modeling.optimization.OptimizationConfig', 'optimization.Optimiz... |
# Copyright (c) 2021, TU Wien, Department of Geodesy and Geoinformation
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice,... | [
"h5py.File",
"numpy.datetime64",
"numpy.dtype",
"xarray.Dataset",
"numpy.array",
"numpy.tile",
"numpy.repeat",
"collections.OrderedDict",
"ascat.read_native.eps_native.set_flags"
] | [((7767, 7786), 'numpy.array', 'np.array', (['[4, 3, 5]'], {}), '([4, 3, 5])\n', (7775, 7786), True, 'import numpy as np\n'), ((8330, 8346), 'ascat.read_native.eps_native.set_flags', 'set_flags', (['flags'], {}), '(flags)\n', (8339, 8346), False, 'from ascat.read_native.eps_native import set_flags\n'), ((5399, 5412), '... |
'''
Functions similar to blocks.graph
'''
import logging
import numpy
import theano
from theano import tensor
from theano.sandbox.rng_mrg import MRG_RandomStreams
from blocks.config import config
from blocks.bricks.base import Brick, application
from picklable_itertools.extras import equizip
from blocks.graph impo... | [
"theano.tensor.log",
"numpy.zeros_like",
"numpy.log",
"theano.tensor.exp",
"theano.tensor.cast",
"numpy.float32",
"blocks.bricks.base.application",
"theano.tensor.patternbroadcast",
"theano.tensor.grad",
"theano.sandbox.rng_mrg.MRG_RandomStreams",
"theano.tensor.sqrt",
"collections.OrderedDict... | [((387, 414), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (404, 414), False, 'import logging\n'), ((945, 1065), 'blocks.bricks.base.application', 'application', ([], {'inputs': "['train_cost', 'model_cost', 'model_prior_mean', 'model_prior_variance']", 'outputs': "['total_cost']"}), "(... |
import conpy, mne # Import required Python modules
# Define source space on average brain, morph to subject
src_avg = mne.setup_source_space('fsaverage', spacing='ico4')
src_sub = mne.morph_source_spaces(src_avg, subject='sub002')
# Discard deep sources
info = mne.io.read_info('sub002-epo.fif') # Read information a... | [
"mne.make_forward_solution",
"conpy.restrict_src_to_vertices",
"mne.make_bem_solution",
"mne.setup_source_space",
"conpy.forward_to_tangential",
"mne.make_bem_model",
"mne.io.read_info",
"conpy.select_vertices_in_sensor_range",
"mne.morph_source_spaces"
] | [((120, 171), 'mne.setup_source_space', 'mne.setup_source_space', (['"""fsaverage"""'], {'spacing': '"""ico4"""'}), "('fsaverage', spacing='ico4')\n", (142, 171), False, 'import conpy, mne\n'), ((182, 232), 'mne.morph_source_spaces', 'mne.morph_source_spaces', (['src_avg'], {'subject': '"""sub002"""'}), "(src_avg, subj... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import json
from vilya.libs.template import st
from vilya.models.project import CodeDoubanProject
_q_exports = []
class BrowsefilesUI:
_q_exports = ['setting']
def __init__(self, proj_name):
self.proj = proj_name
def _q_access(sel... | [
"json.dumps",
"vilya.models.project.CodeDoubanProject.get_by_name"
] | [((518, 558), 'vilya.models.project.CodeDoubanProject.get_by_name', 'CodeDoubanProject.get_by_name', (['self.proj'], {}), '(self.proj)\n', (547, 558), False, 'from vilya.models.project import CodeDoubanProject\n'), ((896, 939), 'vilya.models.project.CodeDoubanProject.get_by_name', 'CodeDoubanProject.get_by_name', (['pr... |
from Tweet import Tweet
import schedule
from functools import wraps
from threading import Thread
from time import sleep
def Threaded(function):
'''
Every call of the decorated function will spawn a
daemonized thread. Returns a threading.Thread object.
'''
@wraps(function)
def wrapper(*args, **k... | [
"schedule.run_pending",
"threading.Thread",
"time.sleep",
"schedule.every",
"functools.wraps"
] | [((278, 293), 'functools.wraps', 'wraps', (['function'], {}), '(function)\n', (283, 293), False, 'from functools import wraps\n'), ((345, 394), 'threading.Thread', 'Thread', ([], {'target': 'function', 'args': 'args', 'kwargs': 'kwargs'}), '(target=function, args=args, kwargs=kwargs)\n', (351, 394), False, 'from thread... |
#!/usr/bin/env python
# Copyright 2018-present Facebook, 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 applica... | [
"xml.etree.ElementTree.parse",
"xml.etree.ElementTree.register_namespace",
"argparse.ArgumentParser",
"os.path.basename",
"os.getcwd",
"glob.glob",
"os.path.join",
"os.chdir",
"shutil.copy"
] | [((769, 834), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Build buck\'s choco package"""'}), '(description="Build buck\'s choco package")\n', (792, 834), False, 'import argparse\n'), ((2168, 2203), 'xml.etree.ElementTree.register_namespace', 'ElemTree.register_namespace', (['""""""', ... |
import sublime
import sublime_plugin
import os.path
import os
import sys
import inspect
from collections import defaultdict
### Start of fixing import paths
# realpath() with make your script run, even if you symlink it :)
cmd_folder = os.path.realpath(os.path.abspath(os.path.split(inspect.getfile(inspect.currentframe... | [
"sublime.message_dialog",
"sublime_plugin.WindowCommand.__init__",
"os.getcwd",
"os.path.dirname",
"sublime.Region",
"sys.path.insert",
"collections.defaultdict",
"sublime.active_window",
"sublime.load_settings",
"inspect.currentframe",
"os.path.expanduser",
"os.chdir"
] | [((1014, 1025), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (1023, 1025), False, 'import os\n'), ((365, 395), 'sys.path.insert', 'sys.path.insert', (['(0)', 'cmd_folder'], {}), '(0, cmd_folder)\n', (380, 395), False, 'import sys\n'), ((629, 662), 'sys.path.insert', 'sys.path.insert', (['(0)', 'cmd_subfolder'], {}), '(0... |
import pathlib
import requests
class InputManager:
def __init__(self, year: int, day: int):
self.year = year
self.day = day
self.cache_dir = pathlib.Path(".aoc_cache")
self.cache_dir.mkdir(exist_ok=True)
self.cache_file = self.cache_dir / f"{year}-{day:02}.txt"
def ... | [
"pathlib.Path",
"requests.get"
] | [((173, 199), 'pathlib.Path', 'pathlib.Path', (['""".aoc_cache"""'], {}), "('.aoc_cache')\n", (185, 199), False, 'import pathlib\n'), ((980, 1021), 'requests.get', 'requests.get', (['url'], {'headers': 'session_header'}), '(url, headers=session_header)\n', (992, 1021), False, 'import requests\n'), ((677, 702), 'pathlib... |
from flask_user import UserManager
from .create_app import (
app,
db
)
from .user_app import (
user_blueprint,
User,
Role,
UsersRoles
)
from .auth_app import auth_blueprint
from .dashboard_app import dashboard_blueprint
from .wisata_app import wisata_blueprint
from .loader import *
user_manag... | [
"flask_user.UserManager"
] | [((325, 351), 'flask_user.UserManager', 'UserManager', (['app', 'db', 'User'], {}), '(app, db, User)\n', (336, 351), False, 'from flask_user import UserManager\n')] |
# Generated by Django 2.1.4 on 2019-02-16 18:54
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('finance', '0003_transaction_transaction_date'),
]
operations = [
migrations.AlterModelOptions(
... | [
"django.db.models.ForeignKey",
"django.db.models.BooleanField",
"django.db.models.DecimalField",
"django.db.migrations.AlterModelOptions",
"django.db.models.DateTimeField"
] | [((278, 371), 'django.db.migrations.AlterModelOptions', 'migrations.AlterModelOptions', ([], {'name': '"""transaction"""', 'options': "{'ordering': ('-created_at',)}"}), "(name='transaction', options={'ordering': (\n '-created_at',)})\n", (306, 371), False, 'from django.db import migrations, models\n'), ((516, 619),... |
# Copyright (c) 1996-2015 PSERC. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
"""Quadratic Program Solver for PYPOWER.
"""
import sys
from pandapower.pypower.qps_pips import qps_pips
#from pandapower.pypower.qps_ipopt import qps_ipopt
#fro... | [
"pandapower.pypower.qps_pips.qps_pips"
] | [((5862, 5911), 'pandapower.pypower.qps_pips.qps_pips', 'qps_pips', (['H', 'c', 'A', 'l', 'u', 'xmin', 'xmax', 'x0', 'pips_opt'], {}), '(H, c, A, l, u, xmin, xmax, x0, pips_opt)\n', (5870, 5911), False, 'from pandapower.pypower.qps_pips import qps_pips\n')] |
#!/usr/bin/env python
"""
Linux on Hyper-V and Azure Test Code, ver. 1.0.0
Copyright (c) Microsoft Corporation
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.apa... | [
"argparse.ArgumentParser",
"logging.basicConfig",
"junit_xml.TestCase",
"pkgutil.iter_modules",
"sys.stdout.flush",
"junit_xml.TestSuite.to_file",
"junit_xml.TestSuite",
"logging.getLogger"
] | [((958, 1079), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s %(levelname)s: %(message)s"""', 'datefmt': '"""%y/%m/%d %H:%M:%S"""', 'level': 'logging.INFO'}), "(format='%(asctime)s %(levelname)s: %(message)s',\n datefmt='%y/%m/%d %H:%M:%S', level=logging.INFO)\n", (977, 1079), False, '... |
from django.urls import path
from django.conf.urls import url
from coach import views
urlpatterns = [
path(
route = 'new',
view = views.CreateCoachView.as_view(),
name = 'create'
),
path(
route = 'feed',
view = views.CoachFeedView.as_view(),
name = 'feed'
... | [
"coach.views.CoachFeedView.as_view",
"coach.views.CreateCoachView.as_view",
"coach.views.EditCoachView.as_view",
"coach.views.CoachDeleteView.as_view"
] | [((152, 183), 'coach.views.CreateCoachView.as_view', 'views.CreateCoachView.as_view', ([], {}), '()\n', (181, 183), False, 'from coach import views\n'), ((266, 295), 'coach.views.CoachFeedView.as_view', 'views.CoachFeedView.as_view', ([], {}), '()\n', (293, 295), False, 'from coach import views\n'), ((381, 410), 'coach... |
# -*- coding: utf-8 -*-
"""
===============================================================================
Generating pulse trains
===============================================================================
This example shows how to use :py:class:`~pulse2percept.stimuli.PulseTrain`
and its variants.
Biphasic pul... | [
"pulse2percept.stimuli.BiphasicTripletTrain",
"pulse2percept.stimuli.BiphasicPulseTrain",
"pulse2percept.stimuli.PulseTrain",
"pulse2percept.stimuli.Stimulus",
"pulse2percept.stimuli.AsymmetricBiphasicPulseTrain",
"numpy.concatenate"
] | [((945, 1010), 'pulse2percept.stimuli.BiphasicPulseTrain', 'BiphasicPulseTrain', (['(20)', '(30)', '(2)'], {'stim_dur': '(200)', 'cathodic_first': '(False)'}), '(20, 30, 2, stim_dur=200, cathodic_first=False)\n', (963, 1010), False, 'from pulse2percept.stimuli import BiphasicPulseTrain\n'), ((1207, 1284), 'pulse2percep... |
"""
lsm303-python // Python library for the LSM303D I2C accelerometer/magnetometer
This file is part of lsm303-python.
[https://github.com/jackw01/lsm303-python]
MIT License
Copyright (c) 2020 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this ... | [
"micropython.const"
] | [((1570, 1579), 'micropython.const', 'const', (['(24)'], {}), '(24)\n', (1575, 1579), False, 'from micropython import const\n'), ((1638, 1647), 'micropython.const', 'const', (['(32)'], {}), '(32)\n', (1643, 1647), False, 'from micropython import const\n'), ((1814, 1823), 'micropython.const', 'const', (['(35)'], {}), '(... |
# Generated by Django 2.2.12 on 2020-05-12 15:18
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("reporting_common", "0022_auto_20200505_1707")]
operations = [migrations.DeleteModel(name="SIUnitScale")]
| [
"django.db.migrations.DeleteModel"
] | [((212, 254), 'django.db.migrations.DeleteModel', 'migrations.DeleteModel', ([], {'name': '"""SIUnitScale"""'}), "(name='SIUnitScale')\n", (234, 254), False, 'from django.db import migrations\n')] |
import discord
import operator
import datetime
import os
import re
import asyncio
import aiohttp
from discord.ext import commands
from __main__ import send_cmd_help, user_allowed
from cogs.utils import checks
from cogs.utils.dataIO import dataIO
from cogs.utils.chat_formatting import box, pagify, escape_mass_mentions
f... | [
"PIL.Image.new",
"re.split",
"discord.ext.commands.command",
"discord.utils.find",
"__main__.user_allowed",
"os.makedirs",
"os.path.exists",
"PIL.Image.open",
"cogs.utils.checks.admin_or_permissions",
"os.path.isfile",
"operator.attrgetter",
"re.findall",
"aiohttp.get",
"os.path.join",
"... | [((1258, 1274), 're.split', 're.split', (['""" """', 's'], {}), "(' ', s)\n", (1266, 1274), False, 'import re\n'), ((8317, 8352), 'discord.ext.commands.command', 'commands.command', ([], {'pass_context': '(True)'}), '(pass_context=True)\n', (8333, 8352), False, 'from discord.ext import commands\n'), ((8866, 8901), 'dis... |
from switchlang import switch
from django.conf import settings
from django.http import Http404
from django.views.decorators.csrf import csrf_exempt
from django.views.generic import View
class PageNotFoundView(View):
"""
Fallback view for the dispatch helper below.
All this view does is return a 404, and... | [
"switchlang.switch",
"django.http.Http404"
] | [((644, 653), 'django.http.Http404', 'Http404', ([], {}), '()\n', (651, 653), False, 'from django.http import Http404\n'), ((1184, 1211), 'switchlang.switch', 'switch', (['request.site.domain'], {}), '(request.site.domain)\n', (1190, 1211), False, 'from switchlang import switch\n')] |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2022 CERN.
#
# Invenio-App-RDM is free software; you can redistribute it and/or modify
# it under the terms of the MIT License; see LICENSE file for more details.
"""Record migration script from InvenioRDM 8.0 to 9.0.
Disclaimer: This script is intended to be executed *only o... | [
"invenio_rdm_records.records.api.RDMRecord.model_cls.query.all",
"click.echo",
"invenio_db.db.session.commit",
"invenio_db.db.session.rollback",
"click.secho",
"invenio_rdm_records.records.api.RDMRecord"
] | [((2016, 2047), 'invenio_rdm_records.records.api.RDMRecord.model_cls.query.all', 'RDMRecord.model_cls.query.all', ([], {}), '()\n', (2045, 2047), False, 'from invenio_rdm_records.records.api import RDMRecord\n'), ((2087, 2123), 'invenio_rdm_records.records.api.RDMRecord', 'RDMRecord', (['record.data'], {'model': 'recor... |
"""This module implements the RYGate."""
from __future__ import annotations
import numpy as np
from bqskit.ir.gates.qubitgate import QubitGate
from bqskit.qis.unitary.differentiable import DifferentiableUnitary
from bqskit.qis.unitary.optimizable import LocallyOptimizableUnitary
from bqskit.qis.unitary.unitary import... | [
"bqskit.qis.unitary.unitarymatrix.UnitaryMatrix",
"numpy.sin",
"numpy.array",
"numpy.real",
"numpy.cos",
"numpy.sqrt"
] | [((1151, 1172), 'numpy.cos', 'np.cos', (['(params[0] / 2)'], {}), '(params[0] / 2)\n', (1157, 1172), True, 'import numpy as np\n'), ((1187, 1208), 'numpy.sin', 'np.sin', (['(params[0] / 2)'], {}), '(params[0] / 2)\n', (1193, 1208), True, 'import numpy as np\n'), ((1225, 1265), 'bqskit.qis.unitary.unitarymatrix.UnitaryM... |
import copy
import os.path as osp
_root_ = '../../../..'
_base_ = [osp.join(_root_, 'configs/base.py'),'../model_samplers/ar50to101v2.py']
manipulate_arch = False
_data_root_ = '/data1/Data/imagenet'
# model settings
model = dict(
type='DynamicMOCO',
queue_len=65536,
feat_dim=128,
momentum=0.999,
... | [
"os.path.join"
] | [((1004, 1048), 'os.path.join', 'osp.join', (['_data_root_', '"""train_10percent.txt"""'], {}), "(_data_root_, 'train_10percent.txt')\n", (1012, 1048), True, 'import os.path as osp\n'), ((1067, 1112), 'os.path.join', 'osp.join', (['_data_root_', '"""ILSVRC2012_img_train"""'], {}), "(_data_root_, 'ILSVRC2012_img_train')... |
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | [
"bezier._plot_helpers.add_plot_boundary",
"tests.functional.utils.get_parser",
"matplotlib.pyplot.show",
"matplotlib.pyplot.close",
"tests.functional.utils.save_fig",
"seaborn.set"
] | [((1107, 1142), 'bezier._plot_helpers.add_plot_boundary', '_plot_helpers.add_plot_boundary', (['ax'], {}), '(ax)\n', (1138, 1142), False, 'from bezier import _plot_helpers\n'), ((1267, 1287), 'matplotlib.pyplot.close', 'plt.close', (['ax.figure'], {}), '(ax.figure)\n', (1276, 1287), True, 'import matplotlib.pyplot as p... |
import pytest
from goodboy.i18n import set_process_locale
from goodboy.types.numeric import Int
from goodboy.validator import Validator
schema = Int()
def test_validate():
assert Validator(schema).validate(42).is_valid
assert not Validator(schema).validate("42").is_valid
def test_validate_with_typecast():... | [
"goodboy.types.numeric.Int",
"pytest.mark.parametrize",
"goodboy.i18n.set_process_locale",
"goodboy.validator.Validator"
] | [((147, 152), 'goodboy.types.numeric.Int', 'Int', ([], {}), '()\n', (150, 152), False, 'from goodboy.types.numeric import Int\n'), ((458, 569), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""languages,message"""', "[(['ru'], 'не может быть null'), (['en'], 'cannot be null')]"], {}), "('languages,message', ... |
"""Settings that need to be set in order to run the tests."""
import logging
import os
from oscar import get_core_apps
from oscar.defaults import * # NOQA
ASIAPAY_PAYDOLLAR_URL = "ASIAPAY_URL"
ASIAPAY_MERCHANT_ID = "12345"
logging.getLogger('factory').setLevel(logging.WARN)
HAYSTACK_CONNECTIONS = {
'default':... | [
"os.path.dirname",
"oscar.get_core_apps",
"logging.getLogger"
] | [((774, 799), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (789, 799), False, 'import os\n'), ((844, 869), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (859, 869), False, 'import os\n'), ((2049, 2074), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Muges
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, mer... | [
"mutagen.File",
"logging.getLogger"
] | [((1560, 1587), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1577, 1587), False, 'import logging\n'), ((2145, 2172), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (2162, 2172), False, 'import logging\n'), ((1614, 1636), 'mutagen.File', 'mutagen.File', ([... |
import traceback
import uuid
from types import TracebackType
from typing import List, Type
class Alarm:
""" Stores all information about a thrown exception. """
def __init__(
self,
exc_type: Type[BaseException],
exc: BaseException,
exc_traceback: TracebackType
) -> None:
... | [
"uuid.uuid1",
"traceback.format_tb"
] | [((1906, 1945), 'traceback.format_tb', 'traceback.format_tb', (['self.exc_traceback'], {}), '(self.exc_traceback)\n', (1925, 1945), False, 'import traceback\n'), ((1539, 1578), 'traceback.format_tb', 'traceback.format_tb', (['self.exc_traceback'], {}), '(self.exc_traceback)\n', (1558, 1578), False, 'import traceback\n'... |
from cupy import _core
erf = _core.create_ufunc(
'cupyx_scipy_erf', ('f->f', 'd->d'),
'out0 = erf(in0)',
doc='''Error function.
.. seealso:: :meth:`scipy.special.erf`
''')
erfc = _core.create_ufunc(
'cupyx_scipy_erfc', ('f->f', 'd->d'),
'out0 = erfc(in0)',
doc='''Complementary erro... | [
"cupy._core.create_ufunc"
] | [((31, 191), 'cupy._core.create_ufunc', '_core.create_ufunc', (['"""cupyx_scipy_erf"""', "('f->f', 'd->d')", '"""out0 = erf(in0)"""'], {'doc': '"""Error function.\n\n .. seealso:: :meth:`scipy.special.erf`\n\n """'}), '(\'cupyx_scipy_erf\', (\'f->f\', \'d->d\'), \'out0 = erf(in0)\',\n doc="""Error function.\n\... |
from fastapi.testclient import TestClient
import unittest
from RobotFrameworkService.main import app
class EndpointTesttest_s(unittest.TestCase):
def test_is_service_available(self):
with TestClient(app) as client:
response = client.get("/status")
self.assertEqual(200, response.status... | [
"fastapi.testclient.TestClient"
] | [((203, 218), 'fastapi.testclient.TestClient', 'TestClient', (['app'], {}), '(app)\n', (213, 218), False, 'from fastapi.testclient import TestClient\n'), ((384, 399), 'fastapi.testclient.TestClient', 'TestClient', (['app'], {}), '(app)\n', (394, 399), False, 'from fastapi.testclient import TestClient\n'), ((599, 614), ... |
from aoc import data
import sys
from math import ceil
earliest, idString = data()
earliest = int(earliest)
ids = [x if x == 'x' else int(x) for x in idString.split(',')]
def part1(earliest, ids):
ids = [x for x in ids if x != 'x']
soonest = {ceil(earliest / id) * id:id for id in ids}
bus = soonest[min(soo... | [
"aoc.data",
"math.ceil"
] | [((76, 82), 'aoc.data', 'data', ([], {}), '()\n', (80, 82), False, 'from aoc import data\n'), ((252, 271), 'math.ceil', 'ceil', (['(earliest / id)'], {}), '(earliest / id)\n', (256, 271), False, 'from math import ceil\n')] |
#!/usr/bin/env python3
import logging
import numpy as np
import copy
import crosstalk
import gates
import predistortion
import pulses
import qubits
import readout
import tomography
# Allow logging to Labber's instrument log
log = logging.getLogger('LabberDriver')
# TODO Reduce calc of CZ by finding all unique TwoQub... | [
"numpy.kaiser",
"numpy.sum",
"readout.Demodulation",
"numpy.abs",
"numpy.floor",
"numpy.ones",
"numpy.arange",
"numpy.convolve",
"numpy.round",
"predistortion.Predistortion",
"tomography.StateTomography",
"numpy.zeros_like",
"crosstalk.Crosstalk",
"numpy.max",
"tomography.ProcessTomograp... | [((232, 265), 'logging.getLogger', 'logging.getLogger', (['"""LabberDriver"""'], {}), "('LabberDriver')\n", (249, 265), False, 'import logging\n'), ((5054, 5084), 'tomography.ProcessTomography', 'tomography.ProcessTomography', ([], {}), '()\n', (5082, 5084), False, 'import tomography\n'), ((5192, 5220), 'tomography.Sta... |
# encoding: utf-8
from __future__ import unicode_literals
from os.path import join
from dvc.scm import SCM
from dvc.scm.git import GitTree
from dvc.scm.tree import WorkingTree
from tests.basic_env import TestDir, TestGit
class TestWorkingTree(TestDir):
def setUp(self):
super(TestWorkingTree, self).set... | [
"dvc.scm.git.GitTree",
"os.path.join",
"dvc.scm.tree.WorkingTree",
"dvc.scm.SCM"
] | [((345, 358), 'dvc.scm.tree.WorkingTree', 'WorkingTree', ([], {}), '()\n', (356, 358), False, 'from dvc.scm.tree import WorkingTree\n'), ((1280, 1299), 'dvc.scm.SCM', 'SCM', (['self._root_dir'], {}), '(self._root_dir)\n', (1283, 1299), False, 'from dvc.scm import SCM\n'), ((1320, 1347), 'dvc.scm.git.GitTree', 'GitTree'... |
#
# @file plotter.py
# @package openmoc.plotter
# @brief The plotter module provides utility functions to plot data from
# OpenMOCs C++ classes, in particular, the geomery, including Material,
# Cells and flat source regions, and fluxes and pin powers.
# @author <NAME> (<EMAIL>)
# @date March 10, 2013
im... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.loglog",
"numpy.sum",
"numpy.abs",
"matplotlib.pyplot.suptitle",
"numpy.isnan",
"matplotlib.pyplot.figure",
"numpy.arange",
"numpy.unique",
"openmoc.get_output_directory",
"matplotlib.pyplot.close",
"matplotlib.pyplot.imshow",
"matplotlib.cm.Scal... | [((486, 507), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (500, 507), False, 'import matplotlib\n'), ((898, 908), 'matplotlib.pyplot.ioff', 'plt.ioff', ([], {}), '()\n', (906, 908), True, 'import matplotlib.pyplot as plt\n'), ((2455, 2471), 'numpy.array', 'np.array', (['coords'], {}), '(coords... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Determine screen gamma using motion-nulling method
of <NAME> Smith, 1994, Vision Research, 34, 2727-2740
A similar system had been used early for chromatic isoluminance:
Anstis SM, <NAME>. A minimum motion technique for judging equiluminance.
In: Sharpe MJD & LT Colour... | [
"numpy.random.randint",
"numpy.arange",
"psychopy.tools.filetools.toFile",
"psychopy.event.clearEvents",
"psychopy.gui.DlgFromDict",
"builtins.range",
"psychopy.event.getKeys",
"psychopy.tools.filetools.fromFile",
"builtins.next",
"psychopy.visual.Window",
"psychopy.core.quit",
"time.localtime... | [((1183, 1204), 'psychopy.gui.DlgFromDict', 'gui.DlgFromDict', (['info'], {}), '(info)\n', (1198, 1204), False, 'from psychopy import visual, core, event, gui, data\n'), ((1495, 1564), 'psychopy.visual.Window', 'visual.Window', (['(1024, 768)'], {'units': '"""pix"""', 'allowGUI': '(True)', 'bitsMode': 'None'}), "((1024... |
################################################################################
# #
# MACHINE-SPECIFIC FUNCTIONS #
# ... | [
"os.uname",
"os.path.join",
"re.compile"
] | [((1595, 1615), 're.compile', 're.compile', (['"""ba\\\\d+"""'], {}), "('ba\\\\d+')\n", (1605, 1615), False, 'import re\n'), ((2036, 2089), 'os.path.join', 'os.path.join', (["os.environ['HOME']", '"""local-gnu-openmpi"""'], {}), "(os.environ['HOME'], 'local-gnu-openmpi')\n", (2048, 2089), False, 'import os\n'), ((1569,... |
import logging
from typing import AsyncGenerator
from aioredis import ConnectionError
from aioredis import RedisError
from app.db.redis import redis
async def get_redis() -> AsyncGenerator:
try:
await redis.set("health_check", "OK")
yield redis
except ConnectionError as e:
logging.er... | [
"app.db.redis.redis.set",
"logging.error",
"app.db.redis.redis.close"
] | [((217, 248), 'app.db.redis.redis.set', 'redis.set', (['"""health_check"""', '"""OK"""'], {}), "('health_check', 'OK')\n", (226, 248), False, 'from app.db.redis import redis\n'), ((310, 359), 'logging.error', 'logging.error', (['f"""connection to redis failed: {e}"""'], {}), "(f'connection to redis failed: {e}')\n", (3... |
import os, sys, titlecase, datetime, json, re, urllib, time, glob
import pathos.multiprocessing as multiprocessing
from email.utils import formataddr
from bs4 import BeautifulSoup
from itertools import chain
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *
#
from howdy import resourceD... | [
"titlecase.titlecase",
"howdy.email.email_basegui.PNGWidget",
"howdy.email.email.send_individual_email_full",
"howdy.core.check_valid_RST",
"howdy.core.core.get_mapped_email_contacts",
"os.path.join",
"howdy.core.core.set_date_newsletter",
"howdy.core.QDialogWithPrinting",
"datetime.datetime.now",
... | [((20795, 20859), 'howdy.core.core.checkServerCredentials', 'core.checkServerCredentials', ([], {'doLocal': 'doLocal', 'verify': 'self.verify'}), '(doLocal=doLocal, verify=self.verify)\n', (20822, 20859), False, 'from howdy.core import core, QDialogWithPrinting, check_valid_RST, convert_string_RST, HtmlView\n'), ((2299... |
import json
import os
import pytest
import requests
from subprocess import Popen
import sys
from testpath.tempdir import TemporaryDirectory
import time
from urllib.parse import urljoin
from selenium.webdriver import Firefox, Remote, Chrome
from .utils import Notebook
pjoin = os.path.join
def _wait_for_server(proc, ... | [
"subprocess.Popen",
"json.load",
"urllib.parse.urljoin",
"selenium.webdriver.Firefox",
"os.environ.copy",
"pytest.fixture",
"os.path.exists",
"time.sleep",
"os.environ.get",
"selenium.webdriver.Remote",
"testpath.tempdir.TemporaryDirectory",
"selenium.webdriver.Chrome"
] | [((968, 999), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (982, 999), False, 'import pytest\n'), ((3403, 3434), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (3417, 3434), False, 'import pytest\n'), ((3715, 3745), 'pytest.fi... |
from django.contrib import admin
from .models import Category, Post, Author
admin.site.register(Category)
admin.site.register(Post)
admin.site.register(Author)
# Register your models here.
| [
"django.contrib.admin.site.register"
] | [((77, 106), 'django.contrib.admin.site.register', 'admin.site.register', (['Category'], {}), '(Category)\n', (96, 106), False, 'from django.contrib import admin\n'), ((107, 132), 'django.contrib.admin.site.register', 'admin.site.register', (['Post'], {}), '(Post)\n', (126, 132), False, 'from django.contrib import admi... |
#!/usr/bin/env python3
"""
This Python script is designed to query multiple online repositories for the
antonyms associated with a specific word.
"""
__author__ = '<NAME>'
__date__ = 'October 15, 2020'
__status__ = 'Production'
__license__ = 'MIT'
__copyright__ = "Copyright (C) 2020 <NAME>"
##########################... | [
"wordhoard.utilities.basic_soup.Query",
"ratelimit.limits",
"wordhoard.utilities.caching.cache_antonyms",
"traceback.format_tb",
"backoff.on_exception",
"wordhoard.utilities.cleansing.flatten_multidimensional_list",
"wordhoard.utilities.caching.insert_word_cache_antonyms",
"bs4.BeautifulSoup",
"word... | [((1623, 1650), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1640, 1650), False, 'import logging\n'), ((3090, 3180), 'backoff.on_exception', 'on_exception', (['expo', 'RateLimitException'], {'max_time': '(60)', 'on_backoff': 'self._backoff_handler'}), '(expo, RateLimitException, max_ti... |
from os import path
import glob
from data.sr import base
class SR291(base.SRBase):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
def get_path(self) -> str:
return path.join(self.dpath, 'SR291')
| [
"os.path.join"
] | [((217, 247), 'os.path.join', 'path.join', (['self.dpath', '"""SR291"""'], {}), "(self.dpath, 'SR291')\n", (226, 247), False, 'from os import path\n')] |
import os
from cryptol import CryptolConnection, CryptolContext, cry
import cryptol
import cryptol.cryptoltypes
from BitVector import *
dir_path = os.path.dirname(os.path.realpath(__file__))
c = cryptol.connect("cabal new-exec --verbose=0 cryptol-remote-api")
c.change_directory(dir_path)
c.load_file("Foo.cry")
x_... | [
"cryptol.connect",
"cryptol.add_cryptol_module",
"os.path.realpath"
] | [((198, 262), 'cryptol.connect', 'cryptol.connect', (['"""cabal new-exec --verbose=0 cryptol-remote-api"""'], {}), "('cabal new-exec --verbose=0 cryptol-remote-api')\n", (213, 262), False, 'import cryptol\n'), ((652, 688), 'cryptol.add_cryptol_module', 'cryptol.add_cryptol_module', (['"""Foo"""', 'c'], {}), "('Foo', c)... |
from asyncpg import Connection
from discord import Embed, User
from discord.utils import utcnow
from discord.ext import commands
from bot import GrowContext, GrowTube, MessagedError
from growconomy.constants import currency_name, embed_color, currency_emoji
from growconomy.views import ConfirmView
class Career(comman... | [
"discord.utils.utcnow",
"growconomy.views.ConfirmView",
"bot.MessagedError",
"discord.ext.commands.group"
] | [((675, 718), 'discord.ext.commands.group', 'commands.group', ([], {'invoke_without_command': '(True)'}), '(invoke_without_command=True)\n', (689, 718), False, 'from discord.ext import commands\n'), ((610, 648), 'bot.MessagedError', 'MessagedError', (['"""You\'re not registered"""'], {}), '("You\'re not registered")\n'... |
'''
Code of 'Searching Central Difference Convolutional Networks for Face Anti-Spoofing'
By <NAME> & <NAME>, 2019
If you use the code, please cite:
@inproceedings{yu2020searching,
title={Searching Central Difference Convolutional Networks for Face Anti-Spoofing},
author={<NAME> and <NAME> and <NAME> and <NAME... | [
"os.mkdir",
"numpy.abs",
"sklearn.metrics.roc_curve",
"numpy.argmax",
"os.path.isdir",
"os.path.basename",
"torch.load",
"os.path.exists",
"torch.save",
"sklearn.metrics.auc",
"shutil.copyfile",
"os.path.join",
"os.listdir"
] | [((876, 892), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n', (886, 892), False, 'import os\n'), ((5255, 5276), 'numpy.argmax', 'np.argmax', (['RightIndex'], {}), '(RightIndex)\n', (5264, 5276), True, 'import numpy as np\n'), ((6862, 6910), 'sklearn.metrics.roc_curve', 'roc_curve', (['test_labels', 'test_scores... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
*t4mon* - T4 monitoring **test functions** for gen_plot.py
"""
from __future__ import absolute_import
import six
import pandas as pd
from t4mon import df_tools, gen_plot
from matplotlib import pyplot as plt
from .base import TEST_DATAFRAME, BaseTestClass
class Tes... | [
"t4mon.gen_plot.to_base64",
"pandas.DataFrame",
"t4mon.gen_plot.plot_var",
"matplotlib.pyplot.figure",
"t4mon.df_tools.consolidate_data",
"six.b"
] | [((931, 990), 't4mon.df_tools.consolidate_data', 'df_tools.consolidate_data', (['self.test_data'], {'system': '"""SYSTEM1"""'}), "(self.test_data, system='SYSTEM1')\n", (956, 990), False, 'from t4mon import df_tools, gen_plot\n'), ((1073, 1168), 't4mon.gen_plot.plot_var', 'gen_plot.plot_var', (['dataframe', '"""FRONTEN... |
from django.core.management.base import BaseCommand, CommandError
from django.utils import timezone
from django.db import IntegrityError
from base64 import b64encode
import ed25519
import sys
class Command(BaseCommand):
help = 'Manage Drawpile External Authentication'
#def add_arguments(self, parser):
... | [
"ed25519.create_keypair"
] | [((632, 656), 'ed25519.create_keypair', 'ed25519.create_keypair', ([], {}), '()\n', (654, 656), False, 'import ed25519\n')] |
"""Test for field definitions issue"""
# pylint: disable=unused-argument
import pytest
from widgetastic.widget import TextInput
from testsuite.ui.views.admin.audience.account_user import AccountUserEditView, AccountUserDetailView
from testsuite.ui.views.admin.audience.fields_definitions import FieldsDefinitionsCreateV... | [
"pytest.mark.issue",
"widgetastic.widget.TextInput"
] | [((786, 855), 'pytest.mark.issue', 'pytest.mark.issue', (['"""https://issues.redhat.com/browse/THREESCALE-7955"""'], {}), "('https://issues.redhat.com/browse/THREESCALE-7955')\n", (803, 855), False, 'import pytest\n'), ((1331, 1386), 'widgetastic.widget.TextInput', 'TextInput', (['browser'], {'id': '"""user_extra_field... |
#!/usr/bin/env python
from main import setup_logging
from flotilla.cli import cli
if __name__ == '__main__':
setup_logging()
cli()
| [
"flotilla.cli.cli",
"main.setup_logging"
] | [((115, 130), 'main.setup_logging', 'setup_logging', ([], {}), '()\n', (128, 130), False, 'from main import setup_logging\n'), ((135, 140), 'flotilla.cli.cli', 'cli', ([], {}), '()\n', (138, 140), False, 'from flotilla.cli import cli\n')] |
import global_vars
import os
def heuristic_value(board,pred):
return manhattan_distance(board) + distance_from_start(board,pred)
#self explanatory
def distance_from_start(board,pred):
distance = 0
while to_tuple(board) != global_vars.start:
board = pred[to_tuple(board)][0]
distance+=1
... | [
"os.system"
] | [((2062, 2110), 'os.system', 'os.system', (["('cls' if os.name == 'nt' else 'clear')"], {}), "('cls' if os.name == 'nt' else 'clear')\n", (2071, 2110), False, 'import os\n')] |
#
from modules import ilmodule
import requests
import os
import time
import pickledb
import globals
class FaceFinder(ilmodule.ILModule):
def __init__(self):
super().__init__()
self.people_db = "g:\Projects\imagelib_github\db\people.pdb"
self.db = pickledb.load(self.people_db, False)
... | [
"requests.post",
"os.path.basename",
"pickledb.load",
"time.sleep"
] | [((278, 314), 'pickledb.load', 'pickledb.load', (['self.people_db', '(False)'], {}), '(self.people_db, False)\n', (291, 314), False, 'import pickledb\n'), ((901, 914), 'time.sleep', 'time.sleep', (['(2)'], {}), '(2)\n', (911, 914), False, 'import time\n'), ((1009, 1035), 'os.path.basename', 'os.path.basename', (['fileP... |
"""Like source.py, but uses streams."""
from __future__ import print_function
import argparse
import sys
from trollius import *
from trollius import test_utils
ARGS = argparse.ArgumentParser(description="TCP data sink example.")
ARGS.add_argument(
'--tls', action='store_true', dest='tls',
default=False, help... | [
"trollius.windows_events.ProactorEventLoop",
"sys.stdout.flush",
"argparse.ArgumentParser",
"trollius.test_utils.dummy_ssl_context"
] | [((170, 231), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""TCP data sink example."""'}), "(description='TCP data sink example.')\n", (193, 231), False, 'import argparse\n'), ((1537, 1555), 'sys.stdout.flush', 'sys.stdout.flush', ([], {}), '()\n', (1553, 1555), False, 'import sys\n'), (... |
# coding: utf-8
import pprint
import re
import six
class AgreeTenantAuthorizationV2Req:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
an... | [
"six.iteritems"
] | [((4917, 4950), 'six.iteritems', 'six.iteritems', (['self.openapi_types'], {}), '(self.openapi_types)\n', (4930, 4950), False, 'import six\n')] |
# -*- coding: utf-8 -*-
'''
Support for reboot, shutdown, etc
'''
# Import python libs
import logging
import re
# Import salt libs
import salt.utils
# Set up logging
log = logging.getLogger(__name__)
# Define the module's virtual name
__virtualname__ = 'system'
def __virtual__():
'''
This only supports Wi... | [
"re.search",
"logging.getLogger"
] | [((175, 202), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (192, 202), False, 'import logging\n'), ((3421, 3472), 're.search', 're.search', (['"""ComputerName\\\\s+REG_SZ\\\\s+(\\\\S+)"""', 'line'], {}), "('ComputerName\\\\s+REG_SZ\\\\s+(\\\\S+)', line)\n", (3430, 3472), False, 'import ... |
import subprocess
def get_diff(path):
if not path.startswith("/"):
path = "/" + path
result = subprocess.run(
["git", "-C", path, "diff", "--staged"], capture_output=True, encoding="utf8"
)
return result.stdout
| [
"subprocess.run"
] | [((113, 210), 'subprocess.run', 'subprocess.run', (["['git', '-C', path, 'diff', '--staged']"], {'capture_output': '(True)', 'encoding': '"""utf8"""'}), "(['git', '-C', path, 'diff', '--staged'], capture_output=True,\n encoding='utf8')\n", (127, 210), False, 'import subprocess\n')] |
from rest_framework import routers
from .views import ChatViewSet
from .views import TalkViewSet
from . import views
from django.urls import path
chat_router = routers.DefaultRouter()
chat_router.register(r'', ChatViewSet)
talk_router = routers.DefaultRouter()
talk_router.register(r'', TalkViewSet)
app_name = 'cha... | [
"django.urls.path",
"rest_framework.routers.DefaultRouter"
] | [((162, 185), 'rest_framework.routers.DefaultRouter', 'routers.DefaultRouter', ([], {}), '()\n', (183, 185), False, 'from rest_framework import routers\n'), ((240, 263), 'rest_framework.routers.DefaultRouter', 'routers.DefaultRouter', ([], {}), '()\n', (261, 263), False, 'from rest_framework import routers\n'), ((344, ... |
"""This test checks for correct fork() behavior.
"""
import _imp as imp
import os
import signal
import sys
import threading
import time
import unittest
from test.fork_wait import ForkWait
from test import support
# Skip test if fork does not exist.
support.get_attribute(os, 'fork')
class ForkTest(ForkWait):
de... | [
"unittest.main",
"test.support.reap_children",
"test.support.get_attribute",
"threading.Thread",
"time.sleep",
"os.kill",
"os._exit",
"threading.Event",
"os.fork",
"_imp.acquire_lock",
"_imp.release_lock"
] | [((253, 286), 'test.support.get_attribute', 'support.get_attribute', (['os', '"""fork"""'], {}), "(os, 'fork')\n", (274, 286), False, 'from test import support\n'), ((3244, 3267), 'test.support.reap_children', 'support.reap_children', ([], {}), '()\n', (3265, 3267), False, 'from test import support\n'), ((3320, 3335), ... |
from .Layers import Layer,TileLayer,FXLayer
from Lib import Vector,Img
from Engine import Items
from . import Tiles,Player
from random import shuffle
from Objects import War
V=Vector.VectorX
exp=Img.sndget("bomb")
class Area(object):
backcol=(0,0,0)
infinite=False
large=False
explored=()
building=No... | [
"Lib.Img.sndget",
"random.shuffle",
"Lib.Vector.Coordinate"
] | [((195, 213), 'Lib.Img.sndget', 'Img.sndget', (['"""bomb"""'], {}), "('bomb')\n", (205, 213), False, 'from Lib import Vector, Img\n'), ((5649, 5662), 'random.shuffle', 'shuffle', (['locs'], {}), '(locs)\n', (5656, 5662), False, 'from random import shuffle\n'), ((1204, 1232), 'Lib.Vector.Coordinate', 'Vector.Coordinate'... |
import komand
from .schema import StopAndQuarantineFileInput, StopAndQuarantineFileOutput
# Custom imports below
class StopAndQuarantineFile(komand.Action):
def __init__(self):
super(self.__class__, self).__init__(
name='stop_and_quarantine_file',
description='Stop executi... | [
"komand.helper.clean"
] | [((973, 1002), 'komand.helper.clean', 'komand.helper.clean', (['response'], {}), '(response)\n', (992, 1002), False, 'import komand\n')] |
from wildlifelicensing.apps.applications.models import Application
from wildlifelicensing.apps.dashboard.views import officer
from wildlifelicensing.apps.main.models import WildlifeLicence
from wildlifelicensing.apps.returns.models import Return
class DataTableApplicationView(officer.DataTableApplicationsOfficerView)... | [
"wildlifelicensing.apps.main.models.WildlifeLicence.objects.filter",
"wildlifelicensing.apps.returns.models.Return.objects.filter",
"wildlifelicensing.apps.applications.models.Application.objects.filter"
] | [((593, 644), 'wildlifelicensing.apps.main.models.WildlifeLicence.objects.filter', 'WildlifeLicence.objects.filter', ([], {'holder': 'self.args[0]'}), '(holder=self.args[0])\n', (623, 644), False, 'from wildlifelicensing.apps.main.models import WildlifeLicence\n'), ((373, 437), 'wildlifelicensing.apps.applications.mode... |
import re
import sys
depRelHeader="""\
## %s : %s
"""
oneDepFig="""
<div class="sd-parse">
%s
%s(%s, %s)
</div>
"""
header="""\
---
layout: base
title: '%(relname)s'
shortdef : '%(shortdef)s'
---
"""
footer=""
### {\emph{advcl}: adverbial clause modifier}
relRe=re.compile(r"\{\\emph\{(.*?)\}:\s+(.*)\}\\\\$") #... | [
"sys.stdin.next",
"re.compile"
] | [((271, 328), 're.compile', 're.compile', (['"""\\\\{\\\\\\\\emph\\\\{(.*?)\\\\}:\\\\s+(.*)\\\\}\\\\\\\\\\\\\\\\$"""'], {}), "('\\\\{\\\\\\\\emph\\\\{(.*?)\\\\}:\\\\s+(.*)\\\\}\\\\\\\\\\\\\\\\$')\n", (281, 328), False, 'import re\n'), ((486, 590), 're.compile', 're.compile', (['"""\\\\\\\\> +``(.*?)\'\' +\\\\\\\\> *\\\... |