code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import tensorflow as tf
import pandas as pd
import numpy as np
import sys
import time
from cflow import ConditionalFlow
from MoINN.modules.subnetworks import DenseSubNet
from utils import train_density_estimation, plot_loss, plot_tau_ratio
# import data
tau1_gen = np.reshape(np.load("../data/tau1s_Pythia_gen.npy"), ... | [
"cflow.ConditionalFlow",
"tensorflow.keras.optimizers.schedules.InverseTimeDecay",
"tensorflow.data.Dataset.from_tensor_slices",
"utils.train_density_estimation",
"tensorflow.keras.optimizers.Adam",
"numpy.split",
"utils.plot_tau_ratio",
"tensorflow.constant",
"numpy.concatenate",
"tensorflow.redu... | [((758, 779), 'numpy.split', 'np.split', (['data_gen', '(2)'], {}), '(data_gen, 2)\n', (766, 779), True, 'import numpy as np\n'), ((802, 823), 'numpy.split', 'np.split', (['data_sim', '(2)'], {}), '(data_sim, 2)\n', (810, 823), True, 'import numpy as np\n'), ((986, 1095), 'cflow.ConditionalFlow', 'ConditionalFlow', ([]... |
# -*- coding: utf-8 -*-
# Created on Sat Jun 05 2021
# Last modified on Mon Jun 07 2021
# Copyright (c) CaMOS Development Team. All Rights Reserved.
# Distributed under a MIT License. See LICENSE for more info.
import numpy as np
import camos.model.image as img
from camos.utils.apptools import getGui
class InputData... | [
"camos.model.image.Stack",
"camos.utils.apptools.getGui"
] | [((2021, 2097), 'camos.model.image.Stack', 'img.Stack', (['self.file'], {'dx': '(1)', 'dz': '(1)', 'units': '"""nm"""', 'persistence': 'self.memoryPersist'}), "(self.file, dx=1, dz=1, units='nm', persistence=self.memoryPersist)\n", (2030, 2097), True, 'import camos.model.image as img\n'), ((1329, 1337), 'camos.utils.ap... |
import tarfile
import tempfile
from . import Task, TaskVar
class TaskReadFile(Task, name="read-file"):
"""
Read contents of a file in the image into a variable.
"""
class Schema:
path = TaskVar(help="Container file path to read data from")
var = TaskVar(help="Destination variable nam... | [
"tempfile.TemporaryFile",
"tarfile.open"
] | [((450, 474), 'tempfile.TemporaryFile', 'tempfile.TemporaryFile', ([], {}), '()\n', (472, 474), False, 'import tempfile\n'), ((646, 680), 'tarfile.open', 'tarfile.open', ([], {'fileobj': 'tf', 'mode': '"""r"""'}), "(fileobj=tf, mode='r')\n", (658, 680), False, 'import tarfile\n')] |
from abc import ABC, abstractmethod
import numpy as np
class SwarmAlgorithm(ABC):
'''
A base abstract class for different swarm algorithms.
Parameters
----------
D : int
Search space dimension.
N : int
Population size.
fit_func : callable
Fitness (objective) functi... | [
"numpy.copy",
"numpy.ndarray.argmin",
"numpy.tile",
"numpy.random.seed",
"numpy.random.uniform",
"numpy.argmin"
] | [((3954, 3977), 'numpy.copy', 'np.copy', (['new_population'], {}), '(new_population)\n', (3961, 3977), True, 'import numpy as np\n'), ((4113, 4143), 'numpy.ndarray.argmin', 'np.ndarray.argmin', (['self.scores'], {}), '(self.scores)\n', (4130, 4143), True, 'import numpy as np\n'), ((4165, 4201), 'numpy.copy', 'np.copy',... |
from datetime import time
from vnpy.app.cta_strategy import (
CtaTemplate,
StopOrder,
TickData,
BarData,
TradeData,
OrderData,
BarGenerator,
ArrayManager
)
from vnpy.app.cta_strategy.base import (
EngineType,
STOPORDER_PREFIX,
StopOrder,
StopOrderStatus,
)
from vnpy.app.c... | [
"vnpy.app.cta_strategy.TSMtools.TSMArrayManager",
"datetime.time",
"vnpy.app.cta_strategy.BarGenerator"
] | [((493, 517), 'datetime.time', 'time', ([], {'hour': '(14)', 'minute': '(57)'}), '(hour=14, minute=57)\n', (497, 517), False, 'from datetime import time\n'), ((558, 581), 'datetime.time', 'time', ([], {'hour': '(21)', 'minute': '(0)'}), '(hour=21, minute=0)\n', (562, 581), False, 'from datetime import time\n'), ((609, ... |
# Slixmpp: The Slick XMPP Library
# Copyright (C) 2020 <NAME> <<EMAIL>>
# This file is part of Slixmpp.
# See the file LICENSE for copying permission.
from typing import (
List,
Optional,
Set,
Tuple,
)
from slixmpp import JID, Iq
from slixmpp.exceptions import IqError, IqTimeout
from slixmpp.plugins im... | [
"slixmpp.plugins.xep_0369.stanza.Subscribe",
"slixmpp.plugins.xep_0405.stanza.register_plugins"
] | [((848, 873), 'slixmpp.plugins.xep_0405.stanza.register_plugins', 'stanza.register_plugins', ([], {}), '()\n', (871, 873), False, 'from slixmpp.plugins.xep_0405 import stanza\n'), ((2144, 2166), 'slixmpp.plugins.xep_0369.stanza.Subscribe', 'mix_stanza.Subscribe', ([], {}), '()\n', (2164, 2166), True, 'from slixmpp.plug... |
from control.controller_veiculos import ControllerVeiculos
from control.controller_proprietario import ControllerProprietario
from control.controller_area import ControllerAreaEstacionamento
from model.constants import *
controller_veiculo = ControllerVeiculos()
controller_proprietario = ControllerProprietario()
cont... | [
"control.controller_area.ControllerAreaEstacionamento",
"control.controller_proprietario.ControllerProprietario",
"control.controller_veiculos.ControllerVeiculos"
] | [((244, 264), 'control.controller_veiculos.ControllerVeiculos', 'ControllerVeiculos', ([], {}), '()\n', (262, 264), False, 'from control.controller_veiculos import ControllerVeiculos\n'), ((291, 315), 'control.controller_proprietario.ControllerProprietario', 'ControllerProprietario', ([], {}), '()\n', (313, 315), False... |
import logging
import itertools
import asyncio
import random
import aiomsg
import aiorun
logging.basicConfig(level="DEBUG")
async def main():
s = aiomsg.Søcket(send_mode=aiomsg.SendMode.ROUNDROBIN)
await s.connect()
async def receiver():
while True:
msg = await s.recv_string()
... | [
"logging.basicConfig",
"aiorun.asyncio.get_running_loop",
"aiomsg.Søcket",
"itertools.count",
"random.randint"
] | [((91, 125), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': '"""DEBUG"""'}), "(level='DEBUG')\n", (110, 125), False, 'import logging\n'), ((154, 205), 'aiomsg.Søcket', 'aiomsg.Søcket', ([], {'send_mode': 'aiomsg.SendMode.ROUNDROBIN'}), '(send_mode=aiomsg.SendMode.ROUNDROBIN)\n', (167, 205), False, 'import... |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
"""
Author : Virink <<EMAIL>>
Date : 2019/04/18, 14:49
"""
import string
import re
L = string.ascii_lowercase
U = string.ascii_uppercase
A = string.ascii_letters
def func_atbash(*args):
"""埃特巴什码解码"""
arg = args[0]
arg = arg.lower().replace(' ', 'vv... | [
"re.match"
] | [((2773, 2805), 're.match', 're.match', (['"""^[\\\\.\\\\-\\\\/ ]+$"""', 'arg'], {}), "('^[\\\\.\\\\-\\\\/ ]+$', arg)\n", (2781, 2805), False, 'import re\n'), ((4221, 4245), 're.match', 're.match', (['"""^[ab]+$"""', 'arg'], {}), "('^[ab]+$', arg)\n", (4229, 4245), False, 'import re\n')] |
from .utils import (get_prescription, get_attributes, get_group)
from .models import Disease, Result, Score, Question, SurveyResponse
from .analysis import cardio_risk_group, diabetes_risk_group, stroke_risk_group
from statistics import mean
from celery import shared_task
@shared_task
def worker(session_id):
df, ... | [
"statistics.mean"
] | [((1662, 1704), 'statistics.mean', 'mean', (['[res.risk_factor for res in results]'], {}), '([res.risk_factor for res in results])\n', (1666, 1704), False, 'from statistics import mean\n')] |
import json
import random
import subprocess
from stests.core.logging import log_event
from stests.chain.utils import execute_cli
from stests.chain.utils import DeployDispatchInfo
from stests.core.types.chain import Account
from stests.core.types.infra import Network
from stests.core.types.infra import Node
from stests... | [
"json.loads",
"stests.core.logging.log_event",
"stests.core.utils.paths.get_path_to_client",
"stests.chain.utils.execute_cli",
"random.randint"
] | [((518, 586), 'stests.chain.utils.execute_cli', 'execute_cli', (['_CLIENT_METHOD', 'EventType.WFLOW_DEPLOY_DISPATCH_FAILURE'], {}), '(_CLIENT_METHOD, EventType.WFLOW_DEPLOY_DISPATCH_FAILURE)\n', (529, 586), False, 'from stests.chain.utils import execute_cli\n'), ((1079, 1117), 'stests.core.utils.paths.get_path_to_clien... |
from functools import wraps
from collections import Iterable
from django.conf import settings
from django.shortcuts import render
from django.core.exceptions import PermissionDenied
from django.utils.decorators import available_attrs
from django.utils.encoding import force_str
from django.utils.six.moves.urllib.parse i... | [
"django.shortcuts.render",
"django.utils.six.moves.urllib.parse.urlparse",
"django.shortcuts.resolve_url",
"django.contrib.auth.views.redirect_to_login",
"waliki.utils.is_authenticated",
"django.utils.decorators.available_attrs"
] | [((1149, 1171), 'waliki.utils.is_authenticated', 'is_authenticated', (['user'], {}), '(user)\n', (1165, 1171), False, 'from waliki.utils import is_authenticated\n'), ((2374, 2404), 'waliki.utils.is_authenticated', 'is_authenticated', (['request.user'], {}), '(request.user)\n', (2390, 2404), False, 'from waliki.utils im... |
"""
Generate coulomb matrices for molecules.
See Montavon et al., _New Journal of Physics_ __15__ (2013) 095003.
"""
import numpy as np
from typing import Any, List, Optional
from deepchem.utils.typing import RDKitMol
from deepchem.utils.data_utils import pad_array
from deepchem.feat.base_classes import MolecularFeat... | [
"numpy.abs",
"numpy.linalg.eig",
"rdkit.Chem.AddHs",
"numpy.asarray",
"numpy.triu_indices_from",
"numpy.squeeze",
"numpy.argsort",
"numpy.array",
"numpy.zeros",
"numpy.outer",
"rdkit.Chem.AllChem.ETKDG",
"numpy.linalg.norm",
"rdkit.Chem.RemoveHs",
"numpy.random.RandomState",
"deepchem.ut... | [((3568, 3588), 'numpy.asarray', 'np.asarray', (['features'], {}), '(features)\n', (3578, 3588), True, 'import numpy as np\n'), ((5033, 5049), 'numpy.asarray', 'np.asarray', (['rval'], {}), '(rval)\n', (5043, 5049), True, 'import numpy as np\n'), ((5793, 5825), 'numpy.random.RandomState', 'np.random.RandomState', (['se... |
"""A simple wrapper around contextlib.suppress"""
import contextlib
from functools import wraps
__version__ = "0.1.1"
def suppress(*exceptions):
def wrap(func):
@wraps(func)
def inner(*args, **kwargs):
with contextlib.suppress(exceptions):
return func(*args, **kwargs... | [
"contextlib.suppress",
"functools.wraps"
] | [((179, 190), 'functools.wraps', 'wraps', (['func'], {}), '(func)\n', (184, 190), False, 'from functools import wraps\n'), ((423, 434), 'functools.wraps', 'wraps', (['func'], {}), '(func)\n', (428, 434), False, 'from functools import wraps\n'), ((244, 275), 'contextlib.suppress', 'contextlib.suppress', (['exceptions'],... |
import asyncio
import contextlib
import glob
import itertools
import logging
import os
import pytest
import uvloop
try:
import tracemalloc
tracemalloc.start()
except ImportError:
# Not available in pypy
pass
# clear compiled cython tests
for path in itertools.chain(
glob.glob(os.path.join('... | [
"logging.getLogger",
"logging.StreamHandler",
"tracemalloc.start",
"os.path.join",
"os.environ.get",
"os.unlink",
"contextlib.closing",
"pytest.fixture",
"asyncio.set_event_loop"
] | [((411, 451), 'pytest.fixture', 'pytest.fixture', ([], {'params': '[asyncio, uvloop]'}), '(params=[asyncio, uvloop])\n', (425, 451), False, 'import pytest\n'), ((513, 541), 'pytest.fixture', 'pytest.fixture', ([], {'autouse': '(True)'}), '(autouse=True)\n', (527, 541), False, 'import pytest\n'), ((150, 169), 'tracemall... |
#!/usr/bin/env python
# coding: utf-8
# This script generates a zone plate pattern (based on partial filling) given the material, energy, grid size and number of zones as input
# In[1]:
import numpy as np
import matplotlib.pyplot as plt
from numba import njit
from joblib import Parallel, delayed
from tqdm import tq... | [
"numpy.sqrt",
"numpy.where",
"urllib.request.Request",
"numpy.arcsin",
"os.getcwd",
"numpy.array",
"numpy.zeros",
"numpy.linspace",
"urllib.parse.urlencode",
"numpy.meshgrid",
"numpy.shape",
"urllib.request.urlopen"
] | [((4720, 4735), 'numpy.zeros', 'np.zeros', (['zones'], {}), '(zones)\n', (4728, 4735), True, 'import numpy as np\n'), ((6546, 6569), 'numpy.array', 'np.array', (['zones_to_fill'], {}), '(zones_to_fill)\n', (6554, 6569), True, 'import numpy as np\n'), ((7066, 7097), 'numpy.linspace', 'np.linspace', (['(-x1)', 'x1', 'gri... |
# pylint: disable=no-self-use,invalid-name
from __future__ import division
from __future__ import absolute_import
import pytest
from allennlp.data.dataset_readers import SnliReader
from allennlp.common.util import ensure_list
from allennlp.common.testing import AllenNlpTestCase
class TestSnliReader(object):
@py... | [
"pytest.mark.parametrize",
"allennlp.common.util.ensure_list",
"allennlp.data.dataset_readers.SnliReader"
] | [((318, 365), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['u"""lazy"""', '(True, False)'], {}), "(u'lazy', (True, False))\n", (341, 365), False, 'import pytest\n'), ((424, 445), 'allennlp.data.dataset_readers.SnliReader', 'SnliReader', ([], {'lazy': 'lazy'}), '(lazy=lazy)\n', (434, 445), False, 'from allenn... |
from django.contrib import admin
from .models import AppropriatedHistory
@admin.register(AppropriatedHistory)
class AppropriatedHistoryAdmin(admin.ModelAdmin):
list_display = [
'fiscal_year',
'source',
'dollars_received'
]
list_editable = [
'dollars_received',
]
or... | [
"django.contrib.admin.register"
] | [((77, 112), 'django.contrib.admin.register', 'admin.register', (['AppropriatedHistory'], {}), '(AppropriatedHistory)\n', (91, 112), False, 'from django.contrib import admin\n')] |
#!flask/bin/python
# Copyright 2021 <NAME> (@luisblazquezm)
# See LICENSE for details.
from flask_restx import Api
api = Api(version='1.0',
title='Influencer Detection Project',
description="**PORBI Influencer Detection project's Flask RESTX API**") | [
"flask_restx.Api"
] | [((124, 257), 'flask_restx.Api', 'Api', ([], {'version': '"""1.0"""', 'title': '"""Influencer Detection Project"""', 'description': '"""**PORBI Influencer Detection project\'s Flask RESTX API**"""'}), '(version=\'1.0\', title=\'Influencer Detection Project\', description=\n "**PORBI Influencer Detection project\'s F... |
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | [
"numpy.mean",
"numpy.ones",
"argparse.ArgumentParser",
"numpy.argmax",
"numpy.min",
"numpy.max",
"os.path.dirname",
"numpy.array",
"cv2.cvtColor",
"numpy.std",
"platform.machine",
"cv2.resize",
"cv2.imread"
] | [((873, 898), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (896, 898), False, 'import argparse\n'), ((2870, 2888), 'platform.machine', 'platform.machine', ([], {}), '()\n', (2886, 2888), False, 'import platform\n'), ((7710, 7737), 'cv2.imread', 'cv2.imread', (['args.image_path'], {}), '(args.... |
from selenium import webdriver
navegador = webdriver.Chrome()
navegador.get("https://webstatic-sea.mihoyo.com/ys/event/signin-sea/index.html?act_id=e202102251931481&lang=pt-pt") | [
"selenium.webdriver.Chrome"
] | [((44, 62), 'selenium.webdriver.Chrome', 'webdriver.Chrome', ([], {}), '()\n', (60, 62), False, 'from selenium import webdriver\n')] |
import argparse
from argparse import ArgumentError
from libvirt_vm_optimizer.util.utils import Profile
class Settings:
def __init__(self, libvirt_xml=None,
output_xml=None,
in_place=False,
profile=Profile.DEFAULT,
force_multithreaded_pinning=Fal... | [
"libvirt_vm_optimizer.util.utils.Profile.from_str",
"argparse.ArgumentError",
"argparse.ArgumentParser"
] | [((698, 828), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'usage': '"""libvirt-vm-optimizer.py [LIBVIRT_XML]\n\n - optimizes LIBVIRT_XML (supports kvm|qemu)"""'}), '(usage=\n """libvirt-vm-optimizer.py [LIBVIRT_XML]\n\n - optimizes LIBVIRT_XML (supports kvm|qemu)"""\n )\n', (721, 828), False, 'imp... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""This module contains class MRT_File.
The MRT_File class contains the functionality to load and parse
mrt files. This is done through a series of steps, detailed in README.
"""
__authors__ = ["<NAME>", "<NAME>"]
__credits__ = ["<NAME>", "<NAME>", "<NAME>"]
__Lisence__... | [
"os.path.basename",
"logging.debug"
] | [((2857, 2917), 'logging.debug', 'logging.debug', (['f"""Wrote {self.csv_name}\n\tFrom {self.url}"""'], {}), '(f"""Wrote {self.csv_name}\n\tFrom {self.url}""")\n', (2870, 2917), False, 'import logging\n'), ((1454, 1481), 'os.path.basename', 'os.path.basename', (['self.path'], {}), '(self.path)\n', (1470, 1481), False, ... |
#!/usr/bin/python3
print("content-type: text/html")
print()
import subprocess as sp
import cgi
fs = cgi.FieldStorage()
cmd = fs.getvalue("command")
output = sp.getoutput("sudo "+cmd)
print("<body style='padding: 40px;'>")
print('<h1 style="color:#df405a;" >Output</h1>')
print("<pre>{}</pre>".format(ou... | [
"subprocess.getoutput",
"cgi.FieldStorage"
] | [((111, 129), 'cgi.FieldStorage', 'cgi.FieldStorage', ([], {}), '()\n', (127, 129), False, 'import cgi\n'), ((172, 199), 'subprocess.getoutput', 'sp.getoutput', (["('sudo ' + cmd)"], {}), "('sudo ' + cmd)\n", (184, 199), True, 'import subprocess as sp\n')] |
from flask import Flask
from flask_restful_swagger.swagger import SwaggerRegistry
try:
from unittest.mock import patch
except ImportError:
from mock import patch
@patch("flask_restful_swagger.swagger._get_current_registry")
@patch("flask_restful_swagger.swagger.render_homepage")
def test_get_swagger_registr... | [
"mock.patch",
"flask_restful_swagger.swagger.SwaggerRegistry",
"flask.Flask"
] | [((175, 235), 'mock.patch', 'patch', (['"""flask_restful_swagger.swagger._get_current_registry"""'], {}), "('flask_restful_swagger.swagger._get_current_registry')\n", (180, 235), False, 'from mock import patch\n'), ((237, 291), 'mock.patch', 'patch', (['"""flask_restful_swagger.swagger.render_homepage"""'], {}), "('fla... |
# This codes are referenced from the Github repo (https://github.com/parulnith/Building-a-Simple-Chatbot-in-Python-using-NLTK/blob/master/chatbot.py)
# Loading the required packages
import nltk
import random
import string
import warnings
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics... | [
"textblob.TextBlob",
"random.choice",
"sklearn.metrics.pairwise.cosine_similarity",
"nltk.word_tokenize",
"nltk.stem.WordNetLemmatizer",
"nltk.sent_tokenize",
"sklearn.feature_extraction.text.TfidfVectorizer",
"warnings.filterwarnings"
] | [((395, 428), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (418, 428), False, 'import warnings\n'), ((660, 684), 'nltk.sent_tokenize', 'nltk.sent_tokenize', (['text'], {}), '(text)\n', (678, 684), False, 'import nltk\n'), ((699, 723), 'nltk.word_tokenize', 'nltk.word_tok... |
import subprocess
import os.path
import json
import time
import urllib.parse
from typing import Any, Tuple
import config
from requests_html import HTMLSession
from markdownify import markdownify
class Data:
def __init__(
self,
data_file_path: str = config.DATA_FILE_PATH,
preload: bool = Fa... | [
"subprocess.check_output",
"json.loads",
"json.dumps",
"requests_html.HTMLSession",
"json.load",
"time.time",
"json.dump"
] | [((1311, 1361), 'subprocess.check_output', 'subprocess.check_output', (['f"""curl {url}"""'], {'shell': '(True)'}), "(f'curl {url}', shell=True)\n", (1334, 1361), False, 'import subprocess\n'), ((1996, 2007), 'time.time', 'time.time', ([], {}), '()\n', (2005, 2007), False, 'import time\n'), ((2338, 2359), 'json.dumps',... |
import os
import sys
os.chdir(os.path.dirname(__file__))
sys.path.append(os.path.dirname(__file__))
sys.path.append(os.path.join(sys.path[0], '/var/www/haproxy-wi/app/'))
from bottle import route, run, template, hook, response, request, post
import sql
import funct
def return_dict_from_out(id, out):
data = {}
data... | [
"bottle.request.body.getvalue",
"funct.upload_and_restart",
"funct.ssh_command",
"sql.select_servers",
"os.path.join",
"funct.get_config_var",
"sql.get_dick_permit",
"funct.logging",
"os.path.dirname",
"sql.get_setting",
"funct.subprocess_execute",
"funct.show_backends",
"funct.get_config",
... | [((30, 55), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (45, 55), False, 'import os\n'), ((73, 98), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (88, 98), False, 'import os\n'), ((116, 169), 'os.path.join', 'os.path.join', (['sys.path[0]', '"""/var/www/haproxy-... |
""" Waymo dataset with votes.
Author: <NAME>
Date: 2020
"""
import os
import sys
import numpy as np
import pickle
from torch.utils.data import Dataset
import scipy.io as sio # to load .mat files for depth points
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
# ROOT_DIR = os.path.dirname(BASE_DIR)
sys.path.appe... | [
"numpy.array",
"sys.path.append",
"os.path.exists",
"box_util.get_corners_from_labels_array",
"numpy.random.random",
"numpy.delete",
"numpy.max",
"pc_util.random_sampling",
"numpy.min",
"numpy.tile",
"pc_util.write_oriented_bbox",
"pickle.load",
"model_util_waymo.WaymoDatasetConfig",
"nump... | [((307, 332), 'sys.path.append', 'sys.path.append', (['BASE_DIR'], {}), '(BASE_DIR)\n', (322, 332), False, 'import sys\n'), ((527, 547), 'model_util_waymo.WaymoDatasetConfig', 'WaymoDatasetConfig', ([], {}), '()\n', (545, 547), False, 'from model_util_waymo import WaymoDatasetConfig\n'), ((241, 266), 'os.path.abspath',... |
import unittest
import sin_testing as st
import pexpect
import os
class TestFail(st.SmokeTest):
@st.sinan("build")
def build(self, child, app_desc):
if not os.path.isfile(os.path.join(os.getcwd(),
"test", "test_module.erl")):
raise "Nome module f... | [
"sin_testing.AppDesc",
"os.makedirs",
"sin_testing.sinan",
"os.path.join",
"os.getcwd",
"os.chdir",
"unittest.main"
] | [((104, 121), 'sin_testing.sinan', 'st.sinan', (['"""build"""'], {}), "('build')\n", (112, 121), True, 'import sin_testing as st\n'), ((1243, 1262), 'sin_testing.sinan', 'st.sinan', (['"""gen foo"""'], {}), "('gen foo')\n", (1251, 1262), True, 'import sin_testing as st\n'), ((2764, 2779), 'unittest.main', 'unittest.mai... |
from budgetportal.models import (
FinancialYear,
Sphere,
Government,
Department,
Programme,
)
from django.core.management import call_command
from django.test import TestCase
from tempfile import NamedTemporaryFile
from StringIO import StringIO
import yaml
class BasicPagesTestCase(TestCase):
de... | [
"StringIO.StringIO",
"budgetportal.models.Programme.objects.all",
"budgetportal.models.Department.objects.get",
"budgetportal.models.Department.objects.all",
"django.core.management.call_command",
"budgetportal.models.Programme.objects.get",
"budgetportal.models.FinancialYear.objects.create",
"budgetp... | [((350, 394), 'budgetportal.models.FinancialYear.objects.create', 'FinancialYear.objects.create', ([], {'slug': '"""2030-31"""'}), "(slug='2030-31')\n", (378, 394), False, 'from budgetportal.models import FinancialYear, Sphere, Government, Department, Programme\n'), ((433, 492), 'budgetportal.models.Sphere.objects.crea... |
import json
import logging
import ssl
import sys
from oidcrp.exception import ResponseError
logger = logging.getLogger(__name__)
def load_json(file_name):
with open(file_name) as fp:
js = json.load(fp)
return js
def fed_parse_response(instance, info, sformat="", state="", **kwargs):
if sformat... | [
"logging.getLogger",
"json.load",
"oidcrp.exception.ResponseError"
] | [((103, 130), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (120, 130), False, 'import logging\n'), ((204, 217), 'json.load', 'json.load', (['fp'], {}), '(fp)\n', (213, 217), False, 'import json\n'), ((506, 549), 'oidcrp.exception.ResponseError', 'ResponseError', (['"""Missing or faulty ... |
"""state consumed
Revision ID: 0be658f07ac6
Revises: bd1e892d0609
Create Date: 2021-07-18 21:26:04.588007
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.sql import table, column
from sqlalchemy import String
# revision identifiers, used by Alembic.
revision = '0be658f07ac6'
down_revision = 'bd1e... | [
"sqlalchemy.sql.column",
"alembic.op.bulk_insert",
"alembic.op.execute"
] | [((693, 784), 'alembic.op.bulk_insert', 'op.bulk_insert', (['states_table', "[{'cd': 'CONSUMED', 'description': 'CONSUMED by a corp'}]"], {}), "(states_table, [{'cd': 'CONSUMED', 'description':\n 'CONSUMED by a corp'}])\n", (707, 784), False, 'from alembic import op\n'), ((950, 1005), 'alembic.op.execute', 'op.execu... |
import numpy as np
class Agent:
def __init__(self):
self.q_table = np.zeros(shape=(3, ))
self.rewards = []
self.averaged_rewards = []
self.total_rewards = 0
self.action_cursor = 1
class HystereticAgentMatrix:
def __init__(self, environment, increasing_learning_rate=0.9... | [
"numpy.zeros",
"numpy.argmax",
"numpy.random.randint",
"numpy.max"
] | [((80, 100), 'numpy.zeros', 'np.zeros', ([], {'shape': '(3,)'}), '(shape=(3,))\n', (88, 100), True, 'import numpy as np\n'), ((2484, 2524), 'numpy.random.randint', 'np.random.randint', (['(0)', 'self.num_of_action'], {}), '(0, self.num_of_action)\n', (2501, 2524), True, 'import numpy as np\n'), ((2560, 2584), 'numpy.ar... |
# -*- coding: utf-8 -*-
# Copyright 2020 The PsiZ 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 r... | [
"tensorflow.shape",
"psiz.keras.initializers.RandomAttention",
"tensorflow.keras.utils.serialize_keras_object",
"tensorflow.keras.initializers.Ones",
"tensorflow.ones_like",
"tensorflow.keras.initializers.serialize",
"tensorflow.rank",
"tensorflow.concat",
"tensorflow.keras.regularizers.get",
"ten... | [((1520, 1618), 'tensorflow.keras.utils.register_keras_serializable', 'tf.keras.utils.register_keras_serializable', ([], {'package': '"""psiz.keras.layers"""', 'name': '"""GroupAttention"""'}), "(package='psiz.keras.layers',\n name='GroupAttention')\n", (1562, 1618), True, 'import tensorflow as tf\n'), ((5502, 5592)... |
# coding=utf-8
# *** WARNING: this file was generated by the Kulado Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import json
import warnings
import kulado
import kulado.runtime
from .. import utilities, tables
class GetAccountResult:
"""
A... | [
"kulado.runtime.invoke"
] | [((3673, 3752), 'kulado.runtime.invoke', 'kulado.runtime.invoke', (['"""azure:batch/getAccount:getAccount"""', '__args__'], {'opts': 'opts'}), "('azure:batch/getAccount:getAccount', __args__, opts=opts)\n", (3694, 3752), False, 'import kulado\n')] |
import os.path as osp
import numpy as np
import math
from tqdm import tqdm
import torch.nn as nn
import torch.backends.cudnn as cudnn
import torch.utils.data
from torchvision import transforms, datasets
from ofa.utils import AverageMeter, accuracy
from ofa.model_zoo import ofa_specialized
from ofa.imagenet_classifica... | [
"torch.nn.CrossEntropyLoss",
"ofa.model_zoo.ofa_specialized",
"numpy.array",
"torchvision.transforms.ColorJitter",
"copy.deepcopy",
"numpy.mean",
"ofa.utils.accuracy",
"torchvision.transforms.ToTensor",
"torchvision.transforms.RandomResizedCrop",
"random.randint",
"torchvision.transforms.RandomH... | [((4567, 4607), 'ofa.imagenet_classification.elastic_nn.utils.set_running_statistics', 'set_running_statistics', (['net', 'data_loader'], {}), '(net, data_loader)\n', (4589, 4607), False, 'from ofa.imagenet_classification.elastic_nn.utils import set_running_statistics\n'), ((5384, 5398), 'ofa.utils.AverageMeter', 'Aver... |
from netCDF4 import Dataset
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.patches import Polygon
from matplotlib.collections import PatchCollection
import matplotlib.cm as cm
import numpy as np
#-------------------------------------------------------------
def plot_subfigure(axis, array, nCells, n... | [
"matplotlib.pyplot.savefig",
"netCDF4.Dataset",
"matplotlib.collections.PatchCollection",
"matplotlib.pyplot.close",
"numpy.array",
"numpy.sum",
"matplotlib.pyplot.cla",
"matplotlib.pyplot.subplots",
"matplotlib.patches.Polygon",
"matplotlib.pyplot.get_cmap"
] | [((505, 523), 'matplotlib.pyplot.get_cmap', 'plt.get_cmap', (['cmap'], {}), '(cmap)\n', (517, 523), True, 'import matplotlib.pyplot as plt\n'), ((1132, 1167), 'matplotlib.collections.PatchCollection', 'PatchCollection', (['patches'], {'cmap': 'cmap'}), '(patches, cmap=cmap)\n', (1147, 1167), False, 'from matplotlib.col... |
import glob
import json
import os
import subprocess
import time
import xml.etree.ElementTree as ET
from xml.etree.ElementTree import ParseError
import geopandas as gpd
import rasterio
import numpy as np
from shapely.geometry import Polygon
class PipelineError(RuntimeError):
def __init__(self, message):
s... | [
"geopandas.sjoin",
"xml.etree.ElementTree.parse",
"geopandas.read_file",
"os.makedirs",
"subprocess.run",
"os.path.join",
"numpy.array",
"shapely.geometry.Polygon",
"numpy.stack",
"os.path.basename",
"time.time",
"numpy.meshgrid",
"geopandas.GeoDataFrame",
"numpy.arange",
"os.remove"
] | [((3566, 3592), 'os.path.basename', 'os.path.basename', (['poly_shp'], {}), '(poly_shp)\n', (3582, 3592), False, 'import os\n'), ((3607, 3632), 'os.path.join', 'os.path.join', (['odir', 'fname'], {}), '(odir, fname)\n', (3619, 3632), False, 'import os\n'), ((3637, 3669), 'os.makedirs', 'os.makedirs', (['odir'], {'exist... |
#!/usr/bin/env python3
import unittest
import sys
sys.path.insert(0, '.')
from random import choice
from PIL import Image
from stego.encoder import embed
from stego.decoder import extract, _decompress, IncorrectPassword
from stego.base import make_array, as_string, extract_metadata
images = ['test/rgba.png', 'test/... | [
"sys.path.insert",
"random.choice",
"PIL.Image.open",
"stego.decoder._decompress",
"stego.encoder.embed",
"unittest.main",
"stego.base.extract_metadata"
] | [((52, 75), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""."""'], {}), "(0, '.')\n", (67, 75), False, 'import sys\n'), ((363, 377), 'random.choice', 'choice', (['images'], {}), '(images)\n', (369, 377), False, 'from random import choice\n'), ((537, 554), 'PIL.Image.open', 'Image.open', (['image'], {}), '(image)\n'... |
import pandas as pd
from rpy2 import robjects
from epysurv.simulation.utils import add_date_time_index_to_frame, r_list_to_frame
def test_add_date_time_index_to_frame():
df = add_date_time_index_to_frame(pd.DataFrame({"a": [1, 2, 3]}))
freq = pd.infer_freq(df.index)
assert freq == "W-MON"
def test_r_li... | [
"pandas.infer_freq",
"pandas.DataFrame",
"pandas.testing.assert_frame_equal",
"epysurv.simulation.utils.r_list_to_frame",
"rpy2.robjects.r"
] | [((254, 277), 'pandas.infer_freq', 'pd.infer_freq', (['df.index'], {}), '(df.index)\n', (267, 277), True, 'import pandas as pd\n'), ((356, 402), 'rpy2.robjects.r', 'robjects.r', (['"""simulated = list(n_cases = 1:10)"""'], {}), "('simulated = list(n_cases = 1:10)')\n", (366, 402), False, 'from rpy2 import robjects\n'),... |
import os
import pytest
from dashboard_generator import DashboardGenerator
def test_generate_widget_ensure_return_value_is_dict(env_variables):
response = DashboardGenerator()._generate_widget(y=1, period=60, pipeline='foo')
assert type(response) == dict
def test_generate_widget_ensure_values_are_used_pro... | [
"dashboard_generator.DashboardGenerator"
] | [((162, 182), 'dashboard_generator.DashboardGenerator', 'DashboardGenerator', ([], {}), '()\n', (180, 182), False, 'from dashboard_generator import DashboardGenerator\n'), ((445, 465), 'dashboard_generator.DashboardGenerator', 'DashboardGenerator', ([], {}), '()\n', (463, 465), False, 'from dashboard_generator import D... |
"""
Tests for opencadd.structure.superposition.engines.mda
"""
import pytest
from opencadd.structure.core import Structure
from opencadd.structure.superposition.engines.mda import MDAnalysisAligner
def test_mda_instantiation():
aligner = MDAnalysisAligner()
def test_mda_calculation():
aligner = MDAnalysisA... | [
"pytest.approx",
"opencadd.structure.core.Structure.from_pdbid",
"opencadd.structure.superposition.engines.mda.MDAnalysisAligner"
] | [((245, 264), 'opencadd.structure.superposition.engines.mda.MDAnalysisAligner', 'MDAnalysisAligner', ([], {}), '()\n', (262, 264), False, 'from opencadd.structure.superposition.engines.mda import MDAnalysisAligner\n'), ((309, 328), 'opencadd.structure.superposition.engines.mda.MDAnalysisAligner', 'MDAnalysisAligner', (... |
import engine
print("Python: Script 2")
class Rotation(metaclass=engine.MetaComponent):
def __init__(self):
self.trans = 5
result = engine.query(Color)
print("Python: Query colors from Script 2")
for c in result:
c.string()
print("--------------------")
| [
"engine.query"
] | [((147, 166), 'engine.query', 'engine.query', (['Color'], {}), '(Color)\n', (159, 166), False, 'import engine\n')] |
import gzip, os, struct, zipfile, io
class SmartFileReader(object):
def __init__(self, file, *args, **kwargs):
if file[-3:]=='.gz':
with open(file, 'rb') as f:
f.seek(-4, 2)
self._filesize = struct.unpack('I', f.read(4))[0]
self.file = gzip.open(file, *args, **kwargs)
elif file[-4:]=='.zip':
... | [
"zipfile.ZipFile",
"gzip.open"
] | [((258, 290), 'gzip.open', 'gzip.open', (['file', '*args'], {}), '(file, *args, **kwargs)\n', (267, 290), False, 'import gzip, os, struct, zipfile, io\n'), ((325, 351), 'zipfile.ZipFile', 'zipfile.ZipFile', (['file', '"""r"""'], {}), "(file, 'r')\n", (340, 351), False, 'import gzip, os, struct, zipfile, io\n')] |
from pathlib import Path
from typing import Dict
from eodatasets3 import serialise
from .common import assert_same, dump_roundtrip
def test_valid_document_works(tmp_path: Path, example_metadata: Dict):
generated_doc = dump_roundtrip(example_metadata)
# Do a serialisation roundtrip and check that it's still ... | [
"eodatasets3.serialise.from_doc"
] | [((498, 531), 'eodatasets3.serialise.from_doc', 'serialise.from_doc', (['generated_doc'], {}), '(generated_doc)\n', (516, 531), False, 'from eodatasets3 import serialise\n'), ((535, 571), 'eodatasets3.serialise.from_doc', 'serialise.from_doc', (['reserialised_doc'], {}), '(reserialised_doc)\n', (553, 571), False, 'from... |
import numpy as np
import matplotlib.pyplot as plt
####################
def merge_dicts(list_of_dicts):
results = {}
for d in list_of_dicts:
for key in d.keys():
if key in results.keys():
results[key].append(d[key])
else:
results[key] = [d[key]]... | [
"numpy.mean",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.clf",
"numpy.max",
"matplotlib.pyplot.close",
"matplotlib.pyplot.rcParams.update",
"numpy.zeros",
"matplotlib.pyplot.bar",
"numpy.sum",
"numpy.array",
"matplotlib.pyplot.tight_layou... | [((502, 542), 'numpy.zeros', 'np.zeros', ([], {'shape': '(2, 2, 2, 2, num_layers)'}), '(shape=(2, 2, 2, 2, num_layers))\n', (510, 542), True, 'import numpy as np\n'), ((551, 591), 'numpy.zeros', 'np.zeros', ([], {'shape': '(2, 2, 2, 2, num_layers)'}), '(shape=(2, 2, 2, 2, num_layers))\n', (559, 591), True, 'import nump... |
#!/usr/bin/env python
#
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | [
"traceback.format_exception_only",
"re.compile",
"sys.stderr.flush",
"sys.stderr.write",
"sys.exc_info",
"os.path.basename",
"sys.exit",
"sys.stdout.write"
] | [((2031, 2089), 'sys.stdout.write', 'sys.stdout.write', (["('%d.%d.%d' % (r.major, r.minor, r.patch))"], {}), "('%d.%d.%d' % (r.major, r.minor, r.patch))\n", (2047, 2089), False, 'import sys\n'), ((2533, 2585), 'sys.stdout.write', 'sys.stdout.write', (["('%d.%d.%d' % (major, minor, micro))"], {}), "('%d.%d.%d' % (major... |
#!/usr/bin/python
import httplib
import random
import argparse
import sys
#Get options
parser = argparse.ArgumentParser(
description='Testing vote app')
parser.add_argument(
'-port',
type=int,
help='port of server',
default=8000)
parser.add_argument(
'-host',
... | [
"httplib.HTTPConnection",
"random.randint",
"argparse.ArgumentParser"
] | [((97, 152), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Testing vote app"""'}), "(description='Testing vote app')\n", (120, 152), False, 'import argparse\n'), ((555, 599), 'httplib.HTTPConnection', 'httplib.HTTPConnection', (['args.host', 'args.port'], {}), '(args.host, args.port)\n'... |
from uuid import UUID
import django_rq
import logging
from datetime import datetime, timezone, timedelta
from django.core.mail import mail_managers
from django.db.models import Count
from django.db.models.functions import TruncDay
from django.http import HttpResponse, HttpResponseRedirect, Http404
from django.shortcu... | [
"logging.getLogger",
"django.db.models.Count",
"vm_manager.utils.utils.get_nectar",
"django.core.mail.mail_managers",
"operator.itemgetter",
"django_rq.get_scheduler",
"django.shortcuts.render",
"datetime.datetime",
"django.http.HttpResponse",
"vm_manager.models.Volume.objects.exclude",
"vm_mana... | [((709, 736), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (726, 736), False, 'import logging\n'), ((1046, 1101), 'django.http.HttpResponse', 'HttpResponse', (['"""do something"""'], {'content_type': '"""text/plain"""'}), "('do something', content_type='text/plain')\n", (1058, 1101), Fa... |
import pytest
from common.common import NETTING_ACCOUNT
from fixture.application import Application
@pytest.fixture(scope="session")
def app(request):
base_url = request.config.getoption("--base_url")
fixture = Application(base_url)
fixture.wd.maximize_window()
fixture.wd.implicitly_wait(10)
yield... | [
"pytest.fixture",
"fixture.application.Application"
] | [((103, 134), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (117, 134), False, 'import pytest\n'), ((533, 549), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (547, 549), False, 'import pytest\n'), ((221, 242), 'fixture.application.Application', 'Application', (['ba... |
import os
import re
#hack for python2 support
try:
from .blkdiscoveryutil import *
except:
from blkdiscoveryutil import *
class Blkid(BlkDiscoveryUtil):
def parse_line(self,line):
details = {}
diskline = line.split(':',1)
if len(diskline) < 2:
return
path = disk... | [
"os.listdir",
"re.finditer",
"pprint.PrettyPrinter",
"re.search"
] | [((2183, 2213), 'pprint.PrettyPrinter', 'pprint.PrettyPrinter', ([], {'indent': '(4)'}), '(indent=4)\n', (2203, 2213), False, 'import pprint\n'), ((349, 395), 're.finditer', 're.finditer', (['"""(\\\\S+)\\\\="([^"]+)\\""""', 'diskline[1]'], {}), '(\'(\\\\S+)\\\\="([^"]+)"\', diskline[1])\n', (360, 395), False, 'import ... |
#!/usr/bin/python3
#
# Copyright (c) 2012 <NAME> <<EMAIL>>
#
# 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, modif... | [
"paleomix.common.command.TempOutputFile",
"paleomix.nodes.bwa._get_max_threads",
"paleomix.common.command.InputFile",
"paleomix.nodes.bwa._new_cleanup_command",
"paleomix.node.NodeError",
"paleomix.node.CommandNode.__init__",
"paleomix.nodes.bwa._get_node_description",
"paleomix.common.command.Paralle... | [((1544, 1661), 'paleomix.common.versions.Requirement', 'versions.Requirement', ([], {'call': "('bowtie2', '--version')", 'regexp': '"""version (\\\\d+\\\\.\\\\d+\\\\.\\\\d+)"""', 'specifiers': '""">=2.3.0"""'}), "(call=('bowtie2', '--version'), regexp=\n 'version (\\\\d+\\\\.\\\\d+\\\\.\\\\d+)', specifiers='>=2.3.0... |
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' #내 맥북에서 발생되는 에러를 없애기 위한 코드
import tensorflow as tf
#using matrix
x_data = [[73., 80., 75.], [93., 88., 93.,], [89., 91., 90.], [96., 98., 100.], [73., 66., 70.]]
y_data = [[152.], [185.], [180.], [196.], [142.]]
X = tf.placeholder(tf.float32, shape=[None, 3]) #n개의 데... | [
"tensorflow.random_normal",
"tensorflow.placeholder",
"tensorflow.Session",
"tensorflow.train.GradientDescentOptimizer",
"tensorflow.global_variables_initializer",
"tensorflow.matmul",
"tensorflow.square"
] | [((270, 313), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32'], {'shape': '[None, 3]'}), '(tf.float32, shape=[None, 3])\n', (284, 313), True, 'import tensorflow as tf\n'), ((364, 407), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32'], {'shape': '[None, 1]'}), '(tf.float32, shape=[None, 1])\n', (37... |
from rubicon.repository.asynchronous import AsynchronousBaseRepository
from rubicon.repository.utils import json
class S3Repository(AsynchronousBaseRepository):
"""The asynchronous S3 repository uses `asyncio` to
persist Rubicon data to a remote S3 bucket.
S3 credentials can be specified via environment ... | [
"rubicon.repository.utils.json.dumps"
] | [((1538, 1556), 'rubicon.repository.utils.json.dumps', 'json.dumps', (['domain'], {}), '(domain)\n', (1548, 1556), False, 'from rubicon.repository.utils import json\n')] |
####
# This script demonstrates how to use the Tableau Server Client
# to create new projects, both at the root level and how to nest them using
# parent_id.
#
#
# To run the script, you must have installed Python 3.6 or later.
####
import argparse
import logging
import sys
import tableauserverclient as TSC
def cre... | [
"logging.basicConfig",
"argparse.ArgumentParser",
"tableauserverclient.ProjectItem",
"sys.exit",
"tableauserverclient.PersonalAccessTokenAuth",
"tableauserverclient.Server"
] | [((683, 742), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Create new projects."""'}), "(description='Create new projects.')\n", (706, 742), False, 'import argparse\n'), ((1737, 1777), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging_level'}), '(level=logging_level... |
#!/usr/bin/python
#
# Copyright 2020 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | [
"dm_construction.get_unity_environment",
"numpy.random.choice",
"absl.testing.parameterized.named_parameters",
"absl.testing.absltest.main",
"dm_construction.get_environment",
"numpy.random.randint",
"numpy.random.seed",
"numpy.random.uniform",
"absl.flags.DEFINE_string"
] | [((850, 894), 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""backend"""', '"""docker"""', '""""""'], {}), "('backend', 'docker', '')\n", (869, 894), False, 'from absl import flags\n'), ((1580, 1600), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (1594, 1600), True, 'import numpy as np\n')... |
from dataclasses import asdict
from hanzi_font_deconstructor.common.generate_training_data import (
STROKE_VIEW_BOX,
get_training_input_svg_and_masks,
)
from os import path, makedirs
from pathlib import Path
import shutil
import argparse
PROJECT_ROOT = Path(__file__).parents[2]
DEST_FOLDER = PROJECT_ROOT / "da... | [
"os.path.exists",
"os.makedirs",
"argparse.ArgumentParser",
"pathlib.Path",
"shutil.rmtree",
"hanzi_font_deconstructor.common.generate_training_data.get_training_input_svg_and_masks"
] | [((335, 447), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Generate training data for a model to deconstruct hanzi into strokes"""'}), "(description=\n 'Generate training data for a model to deconstruct hanzi into strokes')\n", (358, 447), False, 'import argparse\n'), ((676, 700), '... |
from generic_dataset.data_pipeline import DataPipeline
from generic_dataset.generic_sample import synchronize_on_fields
from generic_dataset.sample_generator import SampleGenerator
import numpy as np
import generic_dataset.utilities.save_load_methods as slm
pipeline_rgb_to_gbr = DataPipeline().add_operation(lambda dat... | [
"generic_dataset.data_pipeline.DataPipeline",
"generic_dataset.generic_sample.synchronize_on_fields"
] | [((367, 435), 'generic_dataset.generic_sample.synchronize_on_fields', 'synchronize_on_fields', ([], {'field_names': "{'field_3'}", 'check_pipeline': '(False)'}), "(field_names={'field_3'}, check_pipeline=False)\n", (388, 435), False, 'from generic_dataset.generic_sample import synchronize_on_fields\n'), ((281, 295), 'g... |
from setuptools import setup
setup(name='neural_networks_tfw1',
version='0.1',
description='Implementing Neural Networks with Tensorflow',
packages=['neural_networks_tfw1'],
author='<NAME>',
author_email='<EMAIL>',
zip_safe=False)
| [
"setuptools.setup"
] | [((30, 245), 'setuptools.setup', 'setup', ([], {'name': '"""neural_networks_tfw1"""', 'version': '"""0.1"""', 'description': '"""Implementing Neural Networks with Tensorflow"""', 'packages': "['neural_networks_tfw1']", 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'zip_safe': '(False)'}), "(name='neural_ne... |
from django.template.loader import render_to_string
from django.core.mail import send_mail
from django.conf import settings
from django.contrib.auth import get_user_model
from django.db.models import Q
from wagtail.wagtailcore.models import PageRevision, GroupPagePermission
from wagtail.wagtailusers.models import User... | [
"django.contrib.auth.get_user_model",
"django.core.mail.send_mail",
"wagtail.wagtailcore.models.GroupPagePermission.objects.filter",
"wagtail.wagtailusers.models.UserProfile.get_for_user",
"wagtail.wagtailcore.models.PageRevision.objects.get",
"django.db.models.Q"
] | [((1258, 1274), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (1272, 1274), False, 'from django.contrib.auth import get_user_model\n'), ((1444, 1544), 'wagtail.wagtailcore.models.GroupPagePermission.objects.filter', 'GroupPagePermission.objects.filter', ([], {'permission_type': 'permission_t... |
import pandas as pd
import dateutil
from lusidtools.lpt import lpt
from lusidtools.lpt import lse
from lusidtools.lpt import stdargs
from .either import Either
import re
import urllib.parse
rexp = re.compile(r".*page=([^=']{10,}).*")
TOOLNAME = "scopes"
TOOLTIP = "List scopes"
def parse(extend=None, args=None):
... | [
"re.compile",
"lusidtools.lpt.stdargs.Parser",
"pandas.DataFrame",
"lusidtools.lpt.lpt.to_df",
"pandas.concat",
"lusidtools.lpt.lpt.standard_flow"
] | [((198, 233), 're.compile', 're.compile', (['""".*page=([^=\']{10,}).*"""'], {}), '(".*page=([^=\']{10,}).*")\n', (208, 233), False, 'import re\n'), ((1873, 1936), 'lusidtools.lpt.lpt.standard_flow', 'lpt.standard_flow', (['parse', 'lse.connect', 'process_args', 'display_df'], {}), '(parse, lse.connect, process_args, d... |
from redgrease import GearsBuilder
gb = GearsBuilder()
gb.run()
| [
"redgrease.GearsBuilder"
] | [((41, 55), 'redgrease.GearsBuilder', 'GearsBuilder', ([], {}), '()\n', (53, 55), False, 'from redgrease import GearsBuilder\n')] |
from copy import copy
from itertools import groupby
import unittest
from datetime import datetime, timedelta
from typing import List
from activitywatch.base import Watcher, Activity, Logger
from activitywatch.settings import Settings
from activitywatch.utils import floor_datetime, ceil_datetime
from activitywatch.filt... | [
"datetime.datetime",
"activitywatch.filters.chunk.chunk_by_tags",
"activitywatch.base.Activity",
"copy.copy",
"datetime.datetime.now",
"activitywatch.settings.Settings",
"activitywatch.base.Watcher.__init__",
"datetime.timedelta",
"activitywatch.base.Logger.__init__"
] | [((1826, 1844), 'datetime.timedelta', 'timedelta', ([], {'hours': '(1)'}), '(hours=1)\n', (1835, 1844), False, 'from datetime import datetime, timedelta\n'), ((584, 594), 'activitywatch.settings.Settings', 'Settings', ([], {}), '()\n', (592, 594), False, 'from activitywatch.settings import Settings\n'), ((654, 676), 'a... |
import json
from collections import OrderedDict
from typing import Union, List
import clip
import torch
import torch.nn as nn
import torch.nn.functional as F
from libs.definitions import ROOT
label_file = ROOT / 'imagenet_class_index.json'
with open(label_file, 'r') as f:
labels = json.load(f)
_DEFAULT_CLASSNAM... | [
"torch.stack",
"torch.nn.Conv2d",
"torch.cuda.is_available",
"torch.nn.functional.interpolate",
"clip.load",
"json.load",
"torch.no_grad",
"clip.tokenize",
"torch.nn.functional.softmax"
] | [((289, 301), 'json.load', 'json.load', (['f'], {}), '(f)\n', (298, 301), False, 'import json\n'), ((4697, 4712), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (4710, 4712), False, 'import torch\n'), ((7731, 7746), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (7744, 7746), False, 'import torch\n'), ((3317,... |
import time
import pytest
from flask import g
from flask import session
import paho.mqtt.client as paho
from SmartSleep.db import get_db
from flask import json
import runpy
msg_nr = 0
messages = [""]
broker = 'broker.emqx.io'
port = 1883
def update_contor():
global msg_nr
msg_nr += 1
def on_message(client... | [
"paho.mqtt.client.Client",
"flask.json.loads",
"time.sleep"
] | [((357, 384), 'flask.json.loads', 'json.loads', (['message.payload'], {}), '(message.payload)\n', (367, 384), False, 'from flask import json\n'), ((1499, 1512), 'time.sleep', 'time.sleep', (['(2)'], {}), '(2)\n', (1509, 1512), False, 'import time\n'), ((1532, 1566), 'paho.mqtt.client.Client', 'paho.Client', (['"""clien... |
import theano.tensor as tt
def explin(x):
return tt.where(x >= 0, 1 + x, tt.exp(x))
def log_exp1p(x):
return tt.log1p(tt.exp(x))
| [
"theano.tensor.exp"
] | [((76, 85), 'theano.tensor.exp', 'tt.exp', (['x'], {}), '(x)\n', (82, 85), True, 'import theano.tensor as tt\n'), ((124, 133), 'theano.tensor.exp', 'tt.exp', (['x'], {}), '(x)\n', (130, 133), True, 'import theano.tensor as tt\n')] |
from pyEtherCAT import MasterEtherCAT #ライブラリの読出し
nic = "eth0" # ネットワークカードのアドレスを記載
cat = MasterEtherCAT.MasterEtherCAT(nic)
ADP = 0x0000 #1台目
ADDR = 0x0E00 #コアレジスタのアドレス
cat.APRD(IDX=0x00, ADP=ADP, ADO=ADDR, DATA=[0,0,0,0,0,0,0,0]) #DATAは0を8個(64bit分)の枠を指示
(DATA, WKC) = cat.socket_read() #結果を読出し
print("[0x{:04X}]= 0x{:... | [
"pyEtherCAT.MasterEtherCAT.MasterEtherCAT"
] | [((88, 122), 'pyEtherCAT.MasterEtherCAT.MasterEtherCAT', 'MasterEtherCAT.MasterEtherCAT', (['nic'], {}), '(nic)\n', (117, 122), False, 'from pyEtherCAT import MasterEtherCAT\n')] |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import pprint
from base import BaseObject
from base import FileIO
class PythonLOCParser(BaseObject):
""" Parse T/LOC from a Python File
"""
def __init__(self,
file_path: str,
is_debug: bool = False):
"""
C... | [
"base.BaseObject.__init__",
"base.FileIO.file_to_lines",
"pprint.pformat"
] | [((581, 616), 'base.BaseObject.__init__', 'BaseObject.__init__', (['self', '__name__'], {}), '(self, __name__)\n', (600, 616), False, 'from base import BaseObject\n'), ((735, 788), 'base.FileIO.file_to_lines', 'FileIO.file_to_lines', (['self._file_path'], {'use_sort': '(False)'}), '(self._file_path, use_sort=False)\n',... |
import os
import angr
test_location = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'binaries', 'tests')
def test_vtable_extraction_x86_64():
p = angr.Project(os.path.join(test_location, "x86_64", "cpp_classes"), auto_load_libs=False)
vtables_sizes = {0x403cb0: 24, 0x403cd8: 1... | [
"os.path.realpath",
"os.path.join"
] | [((71, 97), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (87, 97), False, 'import os\n'), ((197, 249), 'os.path.join', 'os.path.join', (['test_location', '"""x86_64"""', '"""cpp_classes"""'], {}), "(test_location, 'x86_64', 'cpp_classes')\n", (209, 249), False, 'import os\n')] |
# -*- coding: utf-8 -*-
from rest_framework import serializers
from django_countries.serializer_fields import CountryField
from .models import Event, CountryEvent
class CountryEventSerializer(serializers.ModelSerializer):
code = serializers.ReadOnlyField(source='country.code')
name = serializers.SerializerM... | [
"rest_framework.serializers.SerializerMethodField",
"rest_framework.serializers.ReadOnlyField"
] | [((237, 285), 'rest_framework.serializers.ReadOnlyField', 'serializers.ReadOnlyField', ([], {'source': '"""country.code"""'}), "(source='country.code')\n", (262, 285), False, 'from rest_framework import serializers\n'), ((297, 332), 'rest_framework.serializers.SerializerMethodField', 'serializers.SerializerMethodField'... |
from collections import Counter
import numpy as np
def keep_word(word):
return word.is_alpha
def unique_words(problems):
return set([word.lemma_ for problem in problems for word in problem.tokens() if keep_word(word)])
def create_word2idx(vocab):
return {word: idx for idx, word in enumerate(vocab)}
... | [
"collections.Counter"
] | [((718, 732), 'collections.Counter', 'Counter', (['words'], {}), '(words)\n', (725, 732), False, 'from collections import Counter\n')] |
from threading import Lock
from time import time
from ui import Menu
from ui.utils import clamp, check_value_lock, to_be_foreground
class NumberedMenu(Menu):
"""
This Menu allows the user to jump to entries using the numpad. If the menu is 10 entries or less
the navigation is instant. Otherwise, it lets ... | [
"ui.Menu.set_keymap",
"threading.Lock",
"ui.Menu.__init__",
"ui.Menu.process_contents",
"ui.Menu.idle_loop",
"ui.Menu.before_activate",
"ui.Menu.deactivate",
"time.time"
] | [((906, 942), 'ui.Menu.__init__', 'Menu.__init__', (['self', '*args'], {}), '(self, *args, **kwargs)\n', (919, 942), False, 'from ui import Menu\n'), ((1005, 1011), 'threading.Lock', 'Lock', ([], {}), '()\n', (1009, 1011), False, 'from threading import Lock\n'), ((1268, 1294), 'ui.Menu.before_activate', 'Menu.before_ac... |
import math
import torch
from bisect import bisect_right
class _LRScheduler:
def __init__(self, optimizer, last_epoch=-1):
self.optimizer = optimizer
self.base_lr = optimizer.lr
self.last_epoch = last_epoch
def step(self):
self.last_epoch += 1
self.optimizer.lr = self.... | [
"math.cos",
"bisect.bisect_right"
] | [((931, 977), 'bisect.bisect_right', 'bisect_right', (['self.milestones', 'self.last_epoch'], {}), '(self.milestones, self.last_epoch)\n', (943, 977), False, 'from bisect import bisect_right\n'), ((1535, 1583), 'math.cos', 'math.cos', (['(math.pi * self.last_epoch / self.T_max)'], {}), '(math.pi * self.last_epoch / sel... |
import os
import platform
import unittest
import nose
from conans import tools
from conans.errors import ConanException
from conans.model.version import Version
from conans import __version__ as client_version
from conans.model import settings
from conans.test.utils.tools import TestClient
from conans.test.assets.vis... | [
"conans.tools.vs_comntools",
"conans.model.settings.Settings",
"conans.tools.vcvars_command",
"nose.SkipTest",
"conans.tools.vs_installation_path",
"platform.system",
"conans.tools.environment_append",
"conans.test.assets.visual_project_files.get_vs_project_files",
"conans.tools.vswhere",
"conans.... | [((1400, 1424), 'conans.tools.vs_comntools', 'tools.vs_comntools', (['"""14"""'], {}), "('14')\n", (1418, 1424), False, 'from conans import tools\n'), ((1629, 1653), 'conans.tools.vs_comntools', 'tools.vs_comntools', (['"""15"""'], {}), "('15')\n", (1647, 1653), False, 'from conans import tools\n'), ((2121, 2150), 'con... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import argparse
import json
import os
from pinliner import __version__
import sys
TEMPLATE_FILE = 'importer.template'
TEMPLATE_PATTERN = '${CONTENTS}'
def output(cfg, what, newline=True):
# We need indentation for PEP8
cfg... | [
"argparse.FileType",
"json.dumps",
"os.path.join",
"os.path.splitext",
"os.path.split",
"os.path.isfile",
"os.path.dirname",
"sys.stderr.write",
"os.path.isdir",
"sys.exit",
"os.path.getmtime"
] | [((640, 676), 'os.path.join', 'os.path.join', (['base_dir', 'package_path'], {}), '(base_dir, package_path)\n', (652, 676), False, 'import os\n'), ((2931, 2959), 'json.dumps', 'json.dumps', (['inliner_packages'], {}), '(inliner_packages)\n', (2941, 2959), False, 'import json\n'), ((6878, 6914), 'os.path.join', 'os.path... |
from dotenv import load_dotenv
load_dotenv()
import os
import boto3
#s3 = boto3.resource('s3')
s3 = boto3.resource('s3', aws_access_key_id=os.environ.get("AWS_KEY_ID"),
aws_secret_access_key=os.environ.get("AWS_SECRET_KEY"))
for bucket in s3.buckets.all():
print(bucket.name)
| [
"os.environ.get",
"dotenv.load_dotenv"
] | [((31, 44), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (42, 44), False, 'from dotenv import load_dotenv\n'), ((141, 169), 'os.environ.get', 'os.environ.get', (['"""AWS_KEY_ID"""'], {}), "('AWS_KEY_ID')\n", (155, 169), False, 'import os\n'), ((215, 247), 'os.environ.get', 'os.environ.get', (['"""AWS_SECRET_K... |
#!/usr/bin/env python
# filename: pair.py
#
# Copyright (c) 2015 <NAME>
# License: The MIT license (http://opensource.org/licenses/MIT)
#
# 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 witho... | [
"abtools.germlines.get_germline",
"Bio.Seq.Seq",
"abtools.sequence.Sequence",
"abtools.alignment.global_alignment",
"sys.exc_info",
"copy.deepcopy"
] | [((16837, 16857), 'copy.deepcopy', 'copy.deepcopy', (['pairs'], {}), '(pairs)\n', (16850, 16857), False, 'import copy\n'), ((8464, 8518), 'abtools.germlines.get_germline', 'germlines.get_germline', (["seq['v_gene']['full']", 'species'], {}), "(seq['v_gene']['full'], species)\n", (8486, 8518), False, 'from abtools impor... |
""" Main program to launch proc/hdfs.py
"""
import argparse
import logging
from pars import addargs
import sys
import logging
logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.INFO)
from proc.hdfs import DIRHDFS
def gettestargs(parser) :
i = "/home/sbartkowski/work/webhdfsdirectory/testdata/... | [
"logging.basicConfig",
"pars.addargs",
"proc.hdfs.DIRHDFS",
"argparse.ArgumentParser"
] | [((127, 202), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(levelname)s:%(message)s"""', 'level': 'logging.INFO'}), "(format='%(levelname)s:%(message)s', level=logging.INFO)\n", (146, 202), False, 'import logging\n'), ((536, 607), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'descri... |
"""JSON (de)serialization framework.
The framework presented here is somewhat based on `Go's "json" package`_
(especially the ``omitempty`` functionality).
.. _`Go's "json" package`: http://golang.org/pkg/encoding/json/
"""
import abc
import binascii
import logging
import OpenSSL
import six
from josepy import b64,... | [
"logging.getLogger",
"OpenSSL.crypto.dump_certificate",
"six.itervalues",
"six.add_metaclass",
"binascii.hexlify",
"josepy.errors.UnrecognizedTypeError",
"abc.ABCMeta.__new__",
"OpenSSL.crypto.dump_certificate_request",
"josepy.b64.b64encode",
"josepy.errors.DeserializationError",
"six.iteritems... | [((356, 383), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (373, 383), False, 'import logging\n'), ((6373, 6416), 'six.add_metaclass', 'six.add_metaclass', (['JSONObjectWithFieldsMeta'], {}), '(JSONObjectWithFieldsMeta)\n', (6390, 6416), False, 'import six\n'), ((6326, 6369), 'abc.ABCMe... |
#
# Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending
#
import jpy
_JCallbackAdapter = jpy.get_type('io.deephaven.server.plugin.python.CallbackAdapter')
def initialize_all_and_register_into(callback: _JCallbackAdapter):
try:
from . import register
except ModuleNotFoundError as e:
... | [
"jpy.get_type"
] | [((102, 167), 'jpy.get_type', 'jpy.get_type', (['"""io.deephaven.server.plugin.python.CallbackAdapter"""'], {}), "('io.deephaven.server.plugin.python.CallbackAdapter')\n", (114, 167), False, 'import jpy\n')] |
"""Tests for parse tree pretty printing that preserves formatting
Test case descriptions are in file test/data/output.test.
"""
import os.path
import re
from typing import Undefined, Any
from mypy import build
from mypy.myunit import Suite, run_test
from mypy.test.helpers import assert_string_arrays_equal
from mypy... | [
"re.sub",
"mypy.build.build",
"mypy.output.OutputVisitor",
"mypy.parse.parse"
] | [((2901, 2925), 're.sub', 're.sub', (['regexp', '""""""', 'path'], {}), "(regexp, '', path)\n", (2907, 2925), False, 'import re\n'), ((1409, 1540), 'mypy.build.build', 'build.build', (['"""main"""'], {'target': 'build.SEMANTIC_ANALYSIS', 'program_text': 'src', 'flags': '[build.TEST_BUILTINS]', 'alt_lib_path': 'test_tem... |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import un... | [
"sklearn.tree.DecisionTreeRegressor",
"test_utils.dump_binary_classification",
"sklearn.tree.DecisionTreeClassifier",
"test_utils.dump_one_class_classification",
"test_utils.dump_multiple_regression",
"test_utils.dump_multiple_classification",
"unittest.main",
"test_utils.dump_single_regression",
"s... | [((2379, 2394), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2392, 2394), False, 'import unittest\n'), ((905, 929), 'sklearn.tree.DecisionTreeClassifier', 'DecisionTreeClassifier', ([], {}), '()\n', (927, 929), False, 'from sklearn.tree import DecisionTreeClassifier\n'), ((938, 1124), 'test_utils.dump_one_class... |
"""Asset definitions for the simple_lakehouse example."""
import pandas as pd
from lakehouse import Column, computed_table, source_table
from pyarrow import date32, float64, string
sfo_q2_weather_sample_table = source_table(
path="data", columns=[Column("tmpf", float64()), Column("valid_date", string())],
)
@com... | [
"pyarrow.date32",
"pyarrow.float64",
"pandas.to_datetime",
"pyarrow.string"
] | [((643, 689), 'pandas.to_datetime', 'pd.to_datetime', (["sfo_q2_weather_sample['valid']"], {}), "(sfo_q2_weather_sample['valid'])\n", (657, 689), True, 'import pandas as pd\n'), ((267, 276), 'pyarrow.float64', 'float64', ([], {}), '()\n', (274, 276), False, 'from pyarrow import date32, float64, string\n'), ((300, 308),... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 11 13:30:53 2017
@author: laoj
"""
import numpy as np
import pymc3 as pm
import theano.tensor as tt
from pymc3.distributions.distribution import Discrete, draw_values, generate_samples, infer_shape
from pymc3.distributions.dist_math import bound, lo... | [
"pymc3.distributions.dist_math.factln",
"theano.tensor.ones",
"theano.tensor.all",
"theano.tensor.abs_",
"numpy.array",
"pymc3.sample",
"pymc3.distributions.distribution.generate_samples",
"theano.tensor.dot",
"theano.tensor.shape_padleft",
"theano.tensor.log",
"numpy.asarray",
"numpy.random.m... | [((406, 458), 'numpy.array', 'np.array', (['[[106], [143], [102], [116], [183], [150]]'], {}), '([[106], [143], [102], [116], [183], [150]])\n', (414, 458), True, 'import numpy as np\n'), ((468, 719), 'numpy.array', 'np.array', (['[[0.21245365, 0.41223126, 0.37531509], [0.13221011, 0.50537169, 0.3624182],\n [0.08813... |
# Copyright 2018 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softwa... | [
"logging.getLogger",
"implant.core.CommandRemote",
"implant.core.Parameter",
"concurrent.futures.ThreadPoolExecutor",
"os.getloadavg",
"asyncio.get_event_loop",
"time.time"
] | [((697, 724), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (714, 724), False, 'import logging\n'), ((811, 873), 'implant.core.Parameter', 'core.Parameter', ([], {'default': '"""ping"""', 'description': '"""Meaningful data."""'}), "(default='ping', description='Meaningful data.')\n", (82... |
import sqlite3
with sqlite3.connect('storage.db') as conn:
cursor = conn.cursor()
cursor.execute(
"""
CREATE TABLE IF NOT EXISTS Produtos (
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
price REAL,
compra_id INTEGER,
... | [
"sqlite3.connect"
] | [((21, 50), 'sqlite3.connect', 'sqlite3.connect', (['"""storage.db"""'], {}), "('storage.db')\n", (36, 50), False, 'import sqlite3\n'), ((655, 684), 'sqlite3.connect', 'sqlite3.connect', (['"""storage.db"""'], {}), "('storage.db')\n", (670, 684), False, 'import sqlite3\n'), ((1091, 1120), 'sqlite3.connect', 'sqlite3.co... |
# changelog.py -- Python module for Debian changelogs
# Copyright (C) 2006-7 <NAME> <<EMAIL>>
# Copyright (C) 2008 Canonical Ltd.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version... | [
"os.path.exists",
"socket.getfqdn",
"re.compile",
"os.getuid",
"re.finditer",
"warnings.warn",
"six.text_type",
"six.u"
] | [((6899, 7040), 're.compile', 're.compile', (["('^(\\\\w%(name_chars)s*) \\\\(([^\\\\(\\\\) \\\\t]+)\\\\)((\\\\s+%(name_chars)s+)+)\\\\;' %\n {'name_chars': '[-+0-9a-z.]'})", 're.IGNORECASE'], {}), "(\n '^(\\\\w%(name_chars)s*) \\\\(([^\\\\(\\\\) \\\\t]+)\\\\)((\\\\s+%(name_chars)s+)+)\\\\;' %\n {'name_chars':... |
import requests
import os
import subprocess
import gidgethub
from gidgethub import sansio
AUTOMERGE_LABEL = ":robot: automerge"
def comment_on_pr(issue_number, message):
"""
Leave a comment on a PR/Issue
"""
request_headers = sansio.create_headers(
"miss-islington", oauth_token=os.getenv("... | [
"requests.patch",
"requests.post",
"os.getenv"
] | [((498, 566), 'requests.post', 'requests.post', (['issue_comment_url'], {'headers': 'request_headers', 'json': 'data'}), '(issue_comment_url, headers=request_headers, json=data)\n', (511, 566), False, 'import requests\n'), ((1238, 1304), 'requests.patch', 'requests.patch', (['edit_issue_url'], {'headers': 'request_head... |
import aiosqlite
import sqlite3
import asyncio
import nonebot
from nonebot.log import logger
driver: nonebot.Driver = nonebot.get_driver()
config: nonebot.config.Config = driver.config
@driver.on_startup
async def init_db():
config.db = await aiosqlite.connect("src/static/Kiba.db")
logger.info("Kiba Kernel -... | [
"nonebot.log.logger.info",
"aiosqlite.connect",
"nonebot.get_driver"
] | [((119, 139), 'nonebot.get_driver', 'nonebot.get_driver', ([], {}), '()\n', (137, 139), False, 'import nonebot\n'), ((294, 358), 'nonebot.log.logger.info', 'logger.info', (['"""Kiba Kernel -> Starting to Create "Kiba Database\\""""'], {}), '(\'Kiba Kernel -> Starting to Create "Kiba Database"\')\n', (305, 358), False, ... |
from typing import Callable, Optional, Sequence, Tuple, Union
import numpy
from dexp.processing.utils.nd_slice import nd_split_slices, remove_margin_slice
from dexp.processing.utils.normalise import Normalise
from dexp.utils import xpArray
from dexp.utils.backends import Backend
def scatter_gather_i2i(
function... | [
"dexp.processing.utils.nd_slice.nd_split_slices",
"dexp.utils.backends.Backend.get_xp_module",
"dexp.utils.backends.Backend.to_backend",
"dexp.processing.utils.nd_slice.remove_margin_slice",
"dexp.utils.backends.Backend.to_numpy",
"numpy.empty"
] | [((2346, 2398), 'numpy.empty', 'numpy.empty', ([], {'shape': 'image.shape', 'dtype': 'internal_dtype'}), '(shape=image.shape, dtype=internal_dtype)\n', (2357, 2398), False, 'import numpy\n'), ((2534, 2559), 'dexp.utils.backends.Backend.to_backend', 'Backend.to_backend', (['image'], {}), '(image)\n', (2552, 2559), False... |
import AppKit
from PyObjCTools.TestSupport import TestCase, min_os_level
class TestNSPDFInfo(TestCase):
@min_os_level("10.9")
def testMethods(self):
self.assertResultIsBOOL(AppKit.NSPDFInfo.isFileExtensionHidden)
self.assertArgIsBOOL(AppKit.NSPDFInfo.setFileExtensionHidden_, 0)
| [
"PyObjCTools.TestSupport.min_os_level"
] | [((111, 131), 'PyObjCTools.TestSupport.min_os_level', 'min_os_level', (['"""10.9"""'], {}), "('10.9')\n", (123, 131), False, 'from PyObjCTools.TestSupport import TestCase, min_os_level\n')] |
# -*- coding: utf-8 -*-
# !/usr/bin/python
__author__ = 'ma_keling'
# Version : 1.0.0
# Start Time : 2018-11-29
# Update Time :
# Change Log :
## 1.
## 2.
## 3.
import time
import arcpy
import math
def express_arcpy_error():
severity = arcpy.GetMaxSeverity()
if severity =... | [
"arcpy.GetMessages",
"arcpy.AddField_management",
"arcpy.GetMaxSeverity",
"arcpy.AddMessage",
"math.pow",
"arcpy.Describe",
"arcpy.da.SearchCursor",
"math.log",
"arcpy.GetParameter",
"time.time",
"arcpy.SpatialReference",
"arcpy.da.UpdateCursor"
] | [((279, 301), 'arcpy.GetMaxSeverity', 'arcpy.GetMaxSeverity', ([], {}), '()\n', (299, 301), False, 'import arcpy\n'), ((8135, 8156), 'arcpy.GetParameter', 'arcpy.GetParameter', (['(0)'], {}), '(0)\n', (8153, 8156), False, 'import arcpy\n'), ((8231, 8252), 'arcpy.GetParameter', 'arcpy.GetParameter', (['(1)'], {}), '(1)\... |
from multiprocessing import Queue, Value
from time import sleep
from access_face_vision.source.camera import Camera
from access_face_vision.utils import create_parser
from access_face_vision import access_logger
LOG_LEVEL = 'debug'
logger, log_que, que_listener = access_logger.set_main_process_logger(LOG_LEVEL)
def... | [
"multiprocessing.Value",
"time.sleep",
"access_face_vision.access_logger.set_main_process_logger",
"access_face_vision.utils.create_parser",
"multiprocessing.Queue"
] | [((266, 314), 'access_face_vision.access_logger.set_main_process_logger', 'access_logger.set_main_process_logger', (['LOG_LEVEL'], {}), '(LOG_LEVEL)\n', (303, 314), False, 'from access_face_vision import access_logger\n'), ((391, 406), 'access_face_vision.utils.create_parser', 'create_parser', ([], {}), '()\n', (404, 4... |
from utils.deserializer.protobuf_deserializer import ProtoLoader
from pathlib import Path
import pandas as pd
import pytest
PROTOFILES_DIR_PATH = Path(__file__).parent.joinpath("protofilesdir").absolute().__str__()
INVALID_PATH = "some/wrong/path"
@pytest.mark.parametrize('filepath', ["test_file.pb", "test_file_1.tx... | [
"pytest.mark.parametrize",
"utils.deserializer.protobuf_deserializer.ProtoLoader",
"pathlib.Path"
] | [((252, 347), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""filepath"""', "['test_file.pb', 'test_file_1.txt', 'test_file_2.xml']"], {}), "('filepath', ['test_file.pb', 'test_file_1.txt',\n 'test_file_2.xml'])\n", (275, 347), False, 'import pytest\n'), ((436, 468), 'utils.deserializer.protobuf_deserial... |
"""add run_type
Revision ID: 5dd2ba8222b1
Revises: 079a74c15e8b
Create Date: 2021-07-22 23:53:04.043651
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '5dd2ba8222b1'
down_revision = '079a74c15e8b'
branch_labels = None
... | [
"sqlalchemy.ForeignKeyConstraint",
"alembic.op.create_foreign_key",
"sqlalchemy.DateTime",
"alembic.op.drop_constraint",
"alembic.op.alter_column",
"alembic.op.drop_column",
"alembic.op.drop_table",
"sqlalchemy.PrimaryKeyConstraint",
"sqlalchemy.Text",
"alembic.op.execute",
"sqlalchemy.String"
] | [((471, 582), 'alembic.op.execute', 'op.execute', (['"""UPDATE triage_metadata.experiment_runs SET run_type=\'experiment\' WHERE run_type IS NULL"""'], {}), '(\n "UPDATE triage_metadata.experiment_runs SET run_type=\'experiment\' WHERE run_type IS NULL"\n )\n', (481, 582), False, 'from alembic import op\n'), ((57... |
# Generated by Django 3.0.7 on 2020-07-09 22:12
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0009_auto_20200709_1430'),
]
operations = [
migrations.AlterField(
model_name='location',
name='lat',
... | [
"django.db.models.IntegerField"
] | [((331, 373), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'blank': '(True)', 'null': '(True)'}), '(blank=True, null=True)\n', (350, 373), False, 'from django.db import migrations, models\n'), ((494, 536), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'blank': '(True)', 'null': '(True)'... |
import unittest
import csv
import numpy as np
from viroconcom.fitting import Fit
def read_benchmark_dataset(path='tests/testfiles/1year_dataset_A.txt'):
"""
Reads a datasets provided for the environmental contour benchmark.
Parameters
----------
path : string
Path to dataset including the... | [
"numpy.abs",
"numpy.asarray",
"numpy.exp",
"viroconcom.fitting.Fit",
"csv.reader",
"numpy.random.RandomState"
] | [((1299, 1312), 'numpy.asarray', 'np.asarray', (['x'], {}), '(x)\n', (1309, 1312), True, 'import numpy as np\n'), ((1321, 1334), 'numpy.asarray', 'np.asarray', (['y'], {}), '(y)\n', (1331, 1334), True, 'import numpy as np\n'), ((825, 860), 'csv.reader', 'csv.reader', (['csv_file'], {'delimiter': '""";"""'}), "(csv_file... |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
u"""
Created at 2020.09.04 by <NAME>
"""
import warnings
warnings.filterwarnings("ignore")
import click
from cli.climb import climb
from cli.diff import diff
@click.group()
def main():
pass
main.add_command(climb)
main.add_command(diff)
if __name__ == '__main__':
... | [
"click.group",
"warnings.filterwarnings"
] | [((103, 136), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (126, 136), False, 'import warnings\n'), ((208, 221), 'click.group', 'click.group', ([], {}), '()\n', (219, 221), False, 'import click\n')] |
import os
from data.raw_data_loader.base.base_raw_data_loader import Seq2SeqRawDataLoader
class RawDataLoader(Seq2SeqRawDataLoader):
def __init__(self, data_path):
super().__init__(data_path)
self.cnn_path = "cnn/stories"
self.dailymail_path = "dailymail/stories"
def load_data(self)... | [
"os.path.join"
] | [((460, 503), 'os.path.join', 'os.path.join', (['self.data_path', 'self.cnn_path'], {}), '(self.data_path, self.cnn_path)\n', (472, 503), False, 'import os\n'), ((803, 852), 'os.path.join', 'os.path.join', (['self.data_path', 'self.dailymail_path'], {}), '(self.data_path, self.dailymail_path)\n', (815, 852), False, 'im... |