code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import numpy as np
import sounddevice as sd
MME = 0
sd.default.channels = 2
sd.default.dtype = 'int16'
sd.default.latency = 'low'
sd.default.samplerate = 48000
class PCMStream:
def __init__(self):
self.stream = None
def read(self, num_bytes):
# frame is 4 bytes
... | [
"sounddevice.InputStream",
"sounddevice.query_devices"
] | [((756, 774), 'sounddevice.query_devices', 'sd.query_devices', ([], {}), '()\n', (772, 774), True, 'import sounddevice as sd\n'), ((624, 650), 'sounddevice.InputStream', 'sd.InputStream', ([], {'device': 'num'}), '(device=num)\n', (638, 650), True, 'import sounddevice as sd\n')] |
from abc import ABC
import numpy as np
from sklearn.cluster import DBSCAN, KMeans
from typing import Callable, Optional, Union
class BaseClusterer(ABC):
"""Abstract base class for Clusterers."""
def __call__(self, data: np.ndarray) -> np.ndarray:
pass
class DbscanClusterer(BaseClusterer):
"""DBS... | [
"sklearn.cluster.KMeans",
"sklearn.cluster.DBSCAN"
] | [((842, 991), 'sklearn.cluster.DBSCAN', 'DBSCAN', ([], {'eps': 'eps', 'min_samples': 'min_samples', 'metric': 'metric', 'metric_params': 'metric_params', 'algorithm': 'algorithm', 'leaf_size': 'leaf_size', 'p': 'p', 'n_jobs': 'None'}), '(eps=eps, min_samples=min_samples, metric=metric, metric_params=\n metric_params... |
# (C) Copyright 2015 Hewlett Packard Enterprise Development LP
# 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/LICEN... | [
"opstestfw.returnStruct",
"opstestfw.LogOutput"
] | [((6583, 6654), 'opstestfw.returnStruct', 'opstestfw.returnStruct', ([], {'returnCode': 'finalReturnCode', 'buffer': 'bufferString'}), '(returnCode=finalReturnCode, buffer=bufferString)\n', (6605, 6654), False, 'import opstestfw\n'), ((1446, 1534), 'opstestfw.LogOutput', 'opstestfw.LogOutput', (['"""error"""', '"""Need... |
import numpy as np
def sigmoid(t):
return 1 / (1 + np.exp(-t))
def sigmoid_derivative(p):
return p * (1 - p)
class NeuralNetwork:
#Do not change this function header
def __init__(self,x=[[]],y=[],numLayers=2,numNodes=2,eta=0.001,maxIter=10000):
self.data = np.append(x,np.ones([len(x),1]),1)
... | [
"numpy.random.rand",
"numpy.exp",
"numpy.array",
"numpy.append",
"numpy.outer",
"numpy.dot"
] | [((342, 353), 'numpy.array', 'np.array', (['y'], {}), '(y)\n', (350, 353), True, 'import numpy as np\n'), ((56, 66), 'numpy.exp', 'np.exp', (['(-t)'], {}), '(-t)\n', (62, 66), True, 'import numpy as np\n'), ((746, 780), 'numpy.random.rand', 'np.random.rand', (['(self.nNodes + 1)', '(1)'], {}), '(self.nNodes + 1, 1)\n',... |
import argparse
import os
import cv2
import numpy as np
import torch
from torch import nn
from deepface.backbones.iresnet import iresnet18, iresnet34, iresnet50, iresnet100, iresnet200
from deepface.backbones.mobilefacenet import get_mbf
from deepface.commons import functions
import gdown
url={
'ms1mv3_r50':'https:... | [
"deepface.backbones.iresnet.iresnet34",
"deepface.backbones.iresnet2060.iresnet2060",
"deepface.backbones.mobilefacenet.get_mbf",
"deepface.backbones.iresnet.iresnet18",
"torch.from_numpy",
"os.path.exists",
"argparse.ArgumentParser",
"deepface.backbones.iresnet.iresnet50",
"os.mkdir",
"gdown.down... | [((3328, 3343), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (3341, 3343), False, 'import torch\n'), ((3678, 3693), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (3691, 3693), False, 'import torch\n'), ((4617, 4646), 'deepface.commons.functions.get_deepface_home', 'functions.get_deepface_home', ([], {}), '... |
from plugin.core.environment import Environment
from ConfigParser import NoOptionError, NoSectionError, ParsingError, SafeConfigParser
import logging
import os
log = logging.getLogger(__name__)
CONFIGURATION_FILES = [
'advanced'
]
class ConfigurationFile(object):
def __init__(self, path):
self._pat... | [
"logging.getLogger",
"ConfigParser.SafeConfigParser",
"os.path.join",
"os.path.relpath"
] | [((168, 195), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (185, 195), False, 'import logging\n'), ((353, 413), 'os.path.relpath', 'os.path.relpath', (['self._path', 'Environment.path.plugin_support'], {}), '(self._path, Environment.path.plugin_support)\n', (368, 413), False, 'import os... |
#!/usr/bin/env python3
"""
Lists the effective alarms.
"""
import click
from jaws_libp.clients import EffectiveAlarmConsumer
# pylint: disable=missing-function-docstring,no-value-for-parameter
@click.command()
@click.option('--monitor', is_flag=True, help="Monitor indefinitely")
@click.option('--nometa', is_fla... | [
"click.option",
"jaws_libp.clients.EffectiveAlarmConsumer",
"click.command"
] | [((202, 217), 'click.command', 'click.command', ([], {}), '()\n', (215, 217), False, 'import click\n'), ((219, 287), 'click.option', 'click.option', (['"""--monitor"""'], {'is_flag': '(True)', 'help': '"""Monitor indefinitely"""'}), "('--monitor', is_flag=True, help='Monitor indefinitely')\n", (231, 287), False, 'impor... |
import pytest
import xarray as xr
from datatree.datatree import DataTree
from datatree.mapping import TreeIsomorphismError, check_isomorphic, map_over_subtree
from datatree.testing import assert_equal
from datatree.treenode import TreeNode
from .test_datatree import create_test_datatree
empty = xr.Dataset()
class ... | [
"xarray.merge",
"datatree.mapping.check_isomorphic",
"xarray.Dataset",
"datatree.datatree.DataTree.from_dict",
"datatree.treenode.TreeNode",
"datatree.testing.assert_equal",
"pytest.raises",
"datatree.datatree.DataTree"
] | [((299, 311), 'xarray.Dataset', 'xr.Dataset', ([], {}), '()\n', (309, 311), True, 'import xarray as xr\n'), ((525, 570), 'datatree.datatree.DataTree.from_dict', 'DataTree.from_dict', ([], {'data_objects': "{'a': empty}"}), "(data_objects={'a': empty})\n", (543, 570), False, 'from datatree.datatree import DataTree\n'), ... |
from os import system
from requests import get
from pyfiglet import figlet_format
from colored import fore, back, style, attr
attr(0)
print(back.BLACK)
print(fore.BLUE_VIOLET + style.BOLD)
system("clear")
print(figlet_format("DIRETORY BRUTE\nBY MOLEEY", width=58, justify="center", font="smslant"))
site = input("Link ... | [
"os.system",
"pyfiglet.figlet_format",
"requests.get",
"colored.attr"
] | [((126, 133), 'colored.attr', 'attr', (['(0)'], {}), '(0)\n', (130, 133), False, 'from colored import fore, back, style, attr\n'), ((189, 204), 'os.system', 'system', (['"""clear"""'], {}), "('clear')\n", (195, 204), False, 'from os import system\n'), ((212, 305), 'pyfiglet.figlet_format', 'figlet_format', (['"""DIRETO... |
# -*- coding: utf-8 -*-
# Copyright (C) 2021 <NAME>
'''
MIT License
Copyright (c) 2021 <NAME>
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... | [
"pynmea2.parse"
] | [((3785, 3804), 'pynmea2.parse', 'pynmea2.parse', (['nmea'], {}), '(nmea)\n', (3798, 3804), False, 'import pynmea2\n')] |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~----->>>
# _ _
# .__(.)< ?? >(.)__.
# \___) (___/
# @Time : 2022/3/20 下午10:06
# @Author : wds -->> <EMAIL>
# @File : util.py
# ~~~~~~~~~~~~~~~~~~~~~~... | [
"sklearn.cluster.KMeans",
"numpy.mean",
"numpy.unique",
"numpy.min",
"numpy.max",
"numpy.argsort",
"numpy.dot",
"numpy.std",
"torch.where"
] | [((1697, 1713), 'numpy.argsort', 'np.argsort', (['(-phi)'], {}), '(-phi)\n', (1707, 1713), True, 'import numpy as np\n'), ((2065, 2101), 'numpy.mean', 'np.mean', (['data'], {'axis': '(1)', 'keepdims': '(True)'}), '(data, axis=1, keepdims=True)\n', (2072, 2101), True, 'import numpy as np\n'), ((2114, 2149), 'numpy.std',... |
"""
Original: <NAME>
New Author: <NAME>
"""
from __future__ import print_function
import httplib2
import os
import re
import time
import base64
from apiclient import discovery
from apiclient import errors
from oauth2client import client
from oauth2client import tools
from oauth2client.file import Storage
import smtp... | [
"os.path.exists",
"os.makedirs",
"argparse.ArgumentParser",
"os.path.join",
"oauth2client.client.flow_from_clientsecrets",
"oauth2client.tools.run",
"oauth2client.file.Storage",
"oauth2client.tools.run_flow",
"os.path.expanduser"
] | [((714, 737), 'os.path.expanduser', 'os.path.expanduser', (['"""~"""'], {}), "('~')\n", (732, 737), False, 'import os\n'), ((759, 797), 'os.path.join', 'os.path.join', (['home_dir', '""".credentials"""'], {}), "(home_dir, '.credentials')\n", (771, 797), False, 'import os\n'), ((899, 959), 'os.path.join', 'os.path.join'... |
from inspect import getargspec
from uuid import uuid4
from utils.logging import log_error
ACTIONS = {}
DYNAMIC_PARAMS = ["user", "parser_return", "execution_state", "resend", "delay"]
class ActionConfig(object):
@staticmethod
def do_action(action_config, user, parser_return=None, execution_state=[],
... | [
"inspect.getargspec",
"utils.logging.log_error",
"uuid.uuid4"
] | [((2093, 2100), 'uuid.uuid4', 'uuid4', ([], {}), '()\n', (2098, 2100), False, 'from uuid import uuid4\n'), ((3479, 3518), 'utils.logging.log_error', 'log_error', (['e', "('Error in action ' + name)"], {}), "(e, 'Error in action ' + name)\n", (3488, 3518), False, 'from utils.logging import log_error\n'), ((3032, 3046), ... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from FER.em_network.models.model import TimeDistributed
class PhaseNet(nn.Module):
def __init__(self):
super(PhaseNet, self).__init__()
self.group1 = nn.Sequential(
nn.Conv2d(12, 24, kernel_size=(5, 5), stride=1, paddi... | [
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.Dropout",
"torch.mean",
"torch.nn.Conv2d",
"torch.nn.MaxPool2d",
"torch.nn.Linear",
"torch.randn",
"torch.cat",
"torch.device"
] | [((4908, 4928), 'torch.device', 'torch.device', (['"""cuda"""'], {}), "('cuda')\n", (4920, 4928), False, 'import torch\n'), ((5123, 5153), 'torch.randn', 'torch.randn', (['(8)', '(100)', '(1)', '(91)', '(10)'], {}), '(8, 100, 1, 91, 10)\n', (5134, 5153), False, 'import torch\n'), ((5199, 5229), 'torch.randn', 'torch.ra... |
"""
https://www.kaggle.com/weicongkong/feedback-prize-huggingface-baseline-training/edit
Copyright (C) <NAME>, 23/02/2022
"""
# %% [markdown]
# # HuggingFace Training Baseline
#
# I wanted to create my own baseline for this competition, and I tried to do so "without peeking" at the kernels published by others. Ideall... | [
"wandb.login",
"datasets.Dataset.from_pandas",
"datasets.load_metric",
"transformers.TrainingArguments",
"pandas.DataFrame",
"pandas.merge",
"os.path.join",
"numpy.argmax",
"wandb.init",
"spacy.displacy.render",
"transformers.AutoModelForTokenClassification.from_pretrained",
"wandb.finish",
... | [((1613, 1637), 'wandb.login', 'wandb.login', ([], {'key': '"""<KEY>"""'}), "(key='<KEY>')\n", (1624, 1637), False, 'import wandb\n'), ((1638, 1695), 'wandb.init', 'wandb.init', ([], {'project': '"""feedback_prize"""', 'entity': '"""wilsonkong"""'}), "(project='feedback_prize', entity='wilsonkong')\n", (1648, 1695), Fa... |
from flask import render_template, url_for
from appname.mailers import Mailer
class InviteEmail(Mailer):
TEMPLATE = 'email/teams/invite.html'
def __init__(self, invite):
self.recipient = None
self.invite = invite
self.recipient_email = invite.invite_email or (invite.user and invite.us... | [
"flask.render_template",
"flask.url_for"
] | [((520, 628), 'flask.url_for', 'url_for', (['"""auth.invite_page"""'], {'invite_id': 'self.invite.id', 'secret': 'self.invite.invite_secret', '_external': '(True)'}), "('auth.invite_page', invite_id=self.invite.id, secret=self.invite.\n invite_secret, _external=True)\n", (527, 628), False, 'from flask import render_... |
"""Python module name validation.
Compatible with python 2 and python 3, to ensure cookiecutter support
across various platforms
"""
import logging
import sys
import re
logging.basicConfig()
logger = logging.getLogger(__name__)
REF_URL = "https://www.python.org/dev/peps/pep-0008/#package-and-module-names"
def vali... | [
"logging.basicConfig",
"re.match",
"logging.getLogger",
"sys.exit"
] | [((171, 192), 'logging.basicConfig', 'logging.basicConfig', ([], {}), '()\n', (190, 192), False, 'import logging\n'), ((202, 229), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (219, 229), False, 'import logging\n'), ((560, 603), 're.match', 're.match', (['"""^[a-z][_a-z0-9]+$"""', 'pack... |
"""This module contains all the actual logic of the project.
The main method is run when the microcontroller starts and afer each sleep cycle.
"""
import logging
import machine
import network
import ntptime
import os
import sdcard
import ujson
import urequests
import utime
from Adafruit_Thermal import Adafruit_Therma... | [
"logging.getLogger",
"utime.sleep",
"machine.RTC",
"os.mount",
"machine.SPI",
"ujson.dumps",
"machine.deepsleep",
"machine.Pin",
"os.ilistdir",
"network.WLAN",
"Adafruit_Thermal.Adafruit_Thermal",
"ntptime.settime",
"utime.time",
"urequests.get",
"ujson.load"
] | [((539, 566), 'logging.getLogger', 'logging.getLogger', (['"""Logger"""'], {}), "('Logger')\n", (556, 566), False, 'import logging\n'), ((577, 609), 'Adafruit_Thermal.Adafruit_Thermal', 'Adafruit_Thermal', ([], {'baudrate': '(19200)'}), '(baudrate=19200)\n', (593, 609), False, 'from Adafruit_Thermal import Adafruit_The... |
"""
Contains the views of the 'evaluate' blueprint.
"""
# pylint: disable=invalid-name
from flask import Blueprint, render_template, request
from project.evaluate.forms import EvaluateForm
from project.evaluate.helpers import evaluate_pass
evaluate_blueprint = Blueprint('evaluate', __name__, url_prefix='/evaluate... | [
"flask.render_template",
"project.evaluate.forms.EvaluateForm",
"flask.Blueprint",
"project.evaluate.helpers.evaluate_pass"
] | [((267, 322), 'flask.Blueprint', 'Blueprint', (['"""evaluate"""', '__name__'], {'url_prefix': '"""/evaluate"""'}), "('evaluate', __name__, url_prefix='/evaluate')\n", (276, 322), False, 'from flask import Blueprint, render_template, request\n'), ((462, 488), 'project.evaluate.forms.EvaluateForm', 'EvaluateForm', (['req... |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
'''
@author: lx0hacker
@date:2018-02-07
'''
import requests
from urllib.parse import unquote,urlparse
import re
import os
import os.path
from bs4 import BeautifulSoup
requests.packages.urllib3.disable_warnings()
import time
import random
'''
@url : 漫画的入口
@return 创建的文件夹的名字
'... | [
"os.path.exists",
"random.uniform",
"os.listdir",
"requests.packages.urllib3.disable_warnings",
"urllib.parse.urlparse",
"re.match",
"requests.get",
"time.sleep",
"bs4.BeautifulSoup",
"os.chdir",
"os.path.isdir",
"os.mkdir"
] | [((212, 256), 'requests.packages.urllib3.disable_warnings', 'requests.packages.urllib3.disable_warnings', ([], {}), '()\n', (254, 256), False, 'import requests\n'), ((352, 365), 'urllib.parse.urlparse', 'urlparse', (['url'], {}), '(url)\n', (360, 365), False, 'from urllib.parse import unquote, urlparse\n'), ((374, 428)... |
from aioredis import Redis, from_url
from core.config import settings
async def init_redis_pool() -> Redis:
if settings.USE_REDIS_SENTINEL:
pass
else:
redis = await from_url(
settings.REDIS_URL,
password=settings.REDIS_PASSWORD,
encoding="utf-8",
... | [
"aioredis.from_url"
] | [((192, 299), 'aioredis.from_url', 'from_url', (['settings.REDIS_URL'], {'password': 'settings.REDIS_PASSWORD', 'encoding': '"""utf-8"""', 'db': 'settings.REDIS_DB'}), "(settings.REDIS_URL, password=settings.REDIS_PASSWORD, encoding=\n 'utf-8', db=settings.REDIS_DB)\n", (200, 299), False, 'from aioredis import Redis... |
# -*- coding: utf-8 -*-
"""
Get messages save them locally and delete them from the queue.
It's very fast we get thousands messages per minute.
If the queue is empty we sleep for 20 seconds.
We store the messages in yamlfiles, it will create some markers like !!omap.
Besides that we use it for readability.
"""
import... | [
"boto3.client",
"xmltodict.parse",
"mlrepricer.parser.main",
"ruamel.yaml.YAML",
"time.sleep",
"boto3.resource",
"pandas.DataFrame"
] | [((555, 573), 'ruamel.yaml.YAML', 'YAML', ([], {'typ': '"""unsafe"""'}), "(typ='unsafe')\n", (559, 573), False, 'from ruamel.yaml import YAML\n'), ((843, 889), 'boto3.resource', 'boto3.resource', (['"""sqs"""'], {'region_name': 'region_name'}), "('sqs', region_name=region_name)\n", (857, 889), False, 'import boto3\n'),... |
# Copyright 2019 Alibaba Cloud 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 la... | [
"alibabacloud.request.APIRequest",
"alibabacloud.client.AlibabaCloudClient.__init__",
"alibabacloud.utils.parameter_validation.verify_params"
] | [((942, 1107), 'alibabacloud.client.AlibabaCloudClient.__init__', 'AlibabaCloudClient.__init__', (['self', 'client_config'], {'credentials_provider': 'credentials_provider', 'retry_policy': 'retry_policy', 'endpoint_resolver': 'endpoint_resolver'}), '(self, client_config, credentials_provider=\n credentials_provider... |
import json
from . import Protocol, Activity, Item
def load_schema(filepath):
with open(filepath) as fp:
data = json.load(fp)
if "@type" not in data:
raise ValueError("Missing @type key")
schema_type = data["@type"]
if schema_type == "reproschema:Protocol":
return Protocol.from... | [
"json.load"
] | [((126, 139), 'json.load', 'json.load', (['fp'], {}), '(fp)\n', (135, 139), False, 'import json\n')] |
from django.db import transaction
from api.management.data_script import OperationalDataScript
from api.models.notification import Notification
class UpdateNotifications(OperationalDataScript):
"""
Update notifications name
"""
is_revertable = False
comment = 'Update notifications name'
def ... | [
"api.models.notification.Notification.objects.get"
] | [((431, 502), 'api.models.notification.Notification.objects.get', 'Notification.objects.get', ([], {'notification_code': '"""CREDIT_APPLICATION_ISSUED"""'}), "(notification_code='CREDIT_APPLICATION_ISSUED')\n", (455, 502), False, 'from api.models.notification import Notification\n'), ((638, 708), 'api.models.notificati... |
"""
Functions for retrieving strings from files
"""
import os
def string_from_file(string, strip=True):
"""
Return an unaltered string or the contents of a file if the string
begins with @ and the rest of it points at a path.
If 'strip' is True, remove leading and trailing whitespace
(default be... | [
"os.path.expanduser"
] | [((682, 712), 'os.path.expanduser', 'os.path.expanduser', (['string[1:]'], {}), '(string[1:])\n', (700, 712), False, 'import os\n')] |
import unittest
import numpy as np
from bert2tf import Executor, ElectraDiscriminator, BertTokenizer
from tests import Bert2TFTestCase
class MyTestCase(Bert2TFTestCase):
@unittest.skip('just run on local machine')
def test_create_electra_model(self):
model = Executor.load_config('ElectraDiscriminato... | [
"bert2tf.BertTokenizer",
"bert2tf.Executor.load_config",
"numpy.array",
"bert2tf.ElectraDiscriminator",
"unittest.skip"
] | [((179, 221), 'unittest.skip', 'unittest.skip', (['"""just run on local machine"""'], {}), "('just run on local machine')\n", (192, 221), False, 'import unittest\n'), ((1059, 1101), 'unittest.skip', 'unittest.skip', (['"""just run on local machine"""'], {}), "('just run on local machine')\n", (1072, 1101), False, 'impo... |
import numpy as np
import unittest
from deepblast.dataset.alphabet import UniprotTokenizer
import numpy.testing as npt
class TestAlphabet(unittest.TestCase):
def test_tokenizer(self):
tokenizer = UniprotTokenizer(pad_ends=True)
res = tokenizer(b'ARNDCQEGHILKMFPSTWYVXOUBZ')
# Need to accou... | [
"unittest.main",
"numpy.array",
"deepblast.dataset.alphabet.UniprotTokenizer",
"numpy.testing.assert_allclose"
] | [((1260, 1275), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1273, 1275), False, 'import unittest\n'), ((211, 242), 'deepblast.dataset.alphabet.UniprotTokenizer', 'UniprotTokenizer', ([], {'pad_ends': '(True)'}), '(pad_ends=True)\n', (227, 242), False, 'from deepblast.dataset.alphabet import UniprotTokenizer\n'... |
"""Tests for drg module"""
import sys
import os
import pkg_resources
import pytest
import numpy as np
import networkx as nx
import cantera as ct
from ..sampling import data_files, InputIgnition
from ..drg import graph_search, create_drg_matrix, run_drg, trim_drg, reduce_drg
# Taken from http://stackoverflow.com/a/2... | [
"tempfile.TemporaryDirectory",
"numpy.allclose",
"numpy.isclose",
"cantera.ConstantCp",
"networkx.DiGraph",
"os.path.join",
"pkg_resources.resource_filename",
"numpy.array",
"tempfile.mkdtemp",
"shutil.rmtree",
"cantera.Reaction.fromCti",
"cantera.Solution",
"cantera.Species"
] | [((971, 989), 'os.path.join', 'os.path.join', (['file'], {}), '(file)\n', (983, 989), False, 'import os\n'), ((1001, 1053), 'pkg_resources.resource_filename', 'pkg_resources.resource_filename', (['__name__', 'file_path'], {}), '(__name__, file_path)\n', (1032, 1053), False, 'import pkg_resources\n'), ((1798, 1856), 'ca... |
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 23 12:59:35 2019
Binomial test
@author: tadahaya
"""
import pandas as pd
import numpy as np
import scipy.stats as stats
import statsmodels.stats.multitest as multitest
from scipy.stats import rankdata
class Calculator():
def __init__(self):
... | [
"pandas.DataFrame",
"scipy.stats.binom_test",
"statsmodels.stats.multitest.multipletests"
] | [((332, 346), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (344, 346), True, 'import pandas as pd\n'), ((1926, 2018), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': "['p value', 'adjusted p value', 'overlap', 'hit No.', 'total No.']"}), "(columns=['p value', 'adjusted p value', 'overlap', 'hit No.',\n ... |
import os
from argparse import SUPPRESS
import numpy as np
from pysam import Samfile, Fastafile
from scipy.stats import scoreatpercentile
# Internal
from rgt.Util import GenomeData, HmmData, ErrorHandler
from rgt.GenomicRegionSet import GenomicRegionSet
from rgt.HINT.biasTable import BiasTable
from rgt.HINT.signalProc... | [
"rgt.Util.GenomeData",
"scipy.stats.scoreatpercentile",
"rgt.Util.ErrorHandler",
"rgt.HINT.signalProcessing.GenomicSignal",
"os.getcwd",
"rgt.HINT.biasTable.BiasTable",
"numpy.std",
"pysam.Samfile",
"rgt.Util.HmmData",
"rgt.GenomicRegionSet.GenomicRegionSet",
"numpy.nan_to_num",
"os.remove"
] | [((3332, 3346), 'rgt.Util.ErrorHandler', 'ErrorHandler', ([], {}), '()\n', (3344, 3346), False, 'from rgt.Util import GenomeData, HmmData, ErrorHandler\n'), ((3576, 3610), 'pysam.Samfile', 'Samfile', (['args.input_files[0]', '"""rb"""'], {}), "(args.input_files[0], 'rb')\n", (3583, 3610), False, 'from pysam import Samf... |
import matplotlib.pyplot as plt
import random, math
import simpy
class Model:
def __init__(self, env, cap, ub, mt, vt):
self.env = env
self.cap = cap # number of seats
self.ub = ub # maximum queue length
self.mt = mt # mean of eating time
self.vt = vt # variance of eatin... | [
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"simpy.Environment",
"math.sqrt",
"random.expovariate",
"matplotlib.pyplot.show"
] | [((2759, 2778), 'simpy.Environment', 'simpy.Environment', ([], {}), '()\n', (2776, 2778), False, 'import simpy\n'), ((2585, 2643), 'matplotlib.pyplot.plot', 'plt.plot', (['self.time', 'self.in_queue'], {'drawstyle': '"""steps-post"""'}), "(self.time, self.in_queue, drawstyle='steps-post')\n", (2593, 2643), True, 'impor... |
from utils import osUtils as ou
import random
from tqdm import tqdm
from data_set import filepaths as fp
import pandas as pd
def readRecData(path,test_ratio = 0.1):
df = pd.read_csv(path,sep='\t',header=None)
a = df.sort_values(by=[0,3],axis=0)
a.to_csv('a.csv')
print(a)
return
if __name__ == '__m... | [
"pandas.read_csv"
] | [((175, 215), 'pandas.read_csv', 'pd.read_csv', (['path'], {'sep': '"""\t"""', 'header': 'None'}), "(path, sep='\\t', header=None)\n", (186, 215), True, 'import pandas as pd\n')] |
from abc import ABC, abstractmethod
from typing import TYPE_CHECKING, Sequence, Type, TypeVar
from eth._utils.datatypes import Configurable
from eth.constants import ZERO_HASH32
from eth_typing import BLSSignature, Hash32
from eth_utils import humanize_hash
from ssz.hashable_container import HashableContainer, SignedH... | [
"eth_utils.humanize_hash",
"ssz.sedes.List",
"typing.TypeVar"
] | [((1029, 1081), 'typing.TypeVar', 'TypeVar', (['"""TBeaconBlockBody"""'], {'bound': '"""BeaconBlockBody"""'}), "('TBeaconBlockBody', bound='BeaconBlockBody')\n", (1036, 1081), False, 'from typing import TYPE_CHECKING, Sequence, Type, TypeVar\n'), ((3162, 3214), 'typing.TypeVar', 'TypeVar', (['"""TBaseBeaconBlock"""'], ... |
import numpy as np
from scipy import signal
from .. import MaskSeparationBase
from ...core import utils
from ...core import constants
class Duet(MaskSeparationBase):
"""
The DUET algorithm was originally proposed by S.Rickard and F.Dietrich for DOA
estimation and further developed for BSS and demixing b... | [
"numpy.abs",
"numpy.mat",
"scipy.signal.convolve2d",
"numpy.ones_like",
"numpy.ones",
"numpy.logical_and",
"numpy.sqrt",
"numpy.logical_not",
"numpy.floor",
"numpy.column_stack",
"numpy.logical_xor",
"numpy.log",
"numpy.exp",
"numpy.array",
"numpy.nonzero",
"numpy.histogram2d",
"nump... | [((9712, 9739), 'numpy.abs', 'np.abs', (['inter_channel_ratio'], {}), '(inter_channel_ratio)\n', (9718, 9739), True, 'import numpy as np\n'), ((11221, 11326), 'numpy.logical_and', 'np.logical_and', (['(self.attenuation_min < self.symmetric_atn)', '(self.symmetric_atn < self.attenuation_max)'], {}), '(self.attenuation_m... |
from __future__ import unicode_literals
import os
import django
from django.test import TestCase
from mock import call, patch
from storage.brokers.host_broker import HostBroker
from storage.delete_files_job import delete_files
from storage.test import utils as storage_test_utils
class TestDeleteFiles(TestCase):
... | [
"storage.brokers.host_broker.HostBroker",
"django.setup",
"mock.patch",
"os.path.join",
"storage.delete_files_job.delete_files",
"mock.call",
"storage.test.utils.create_file"
] | [((507, 558), 'mock.patch', 'patch', (['"""storage.brokers.host_broker.os.path.exists"""'], {}), "('storage.brokers.host_broker.os.path.exists')\n", (512, 558), False, 'from mock import call, patch\n'), ((564, 610), 'mock.patch', 'patch', (['"""storage.brokers.host_broker.os.remove"""'], {}), "('storage.brokers.host_br... |
from django.db import models
# Helper functions
def project_cover(instance, filename):
return "Project_{0}/cover_{1}".format(instance.id, filename)
def project_image(instance, filename):
return "Project_{0}/image_{1}".format(instance.project.id, filename)
def client_logo(instance, filename):
return "Cl... | [
"django.db.models.EmailField",
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.ImageField",
"django.db.models.CharField"
] | [((507, 610), 'django.db.models.CharField', 'models.CharField', (['"""Title"""'], {'help_text': '"""Title of the project"""', 'max_length': '(64)', 'null': '(False)', 'blank': '(False)'}), "('Title', help_text='Title of the project', max_length=64,\n null=False, blank=False)\n", (523, 610), False, 'from django.db im... |
from django.http import HttpResponse
from django.shortcuts import render
def home(request):
return render(request,'index.html')
def table(request):
return render(request,"basic-table.html") | [
"django.shortcuts.render"
] | [((103, 132), 'django.shortcuts.render', 'render', (['request', '"""index.html"""'], {}), "(request, 'index.html')\n", (109, 132), False, 'from django.shortcuts import render\n'), ((163, 198), 'django.shortcuts.render', 'render', (['request', '"""basic-table.html"""'], {}), "(request, 'basic-table.html')\n", (169, 198)... |
#!/usr/bin/env python
import sys
import os
import plotGlobalEndemicBehaviour as analysisFile
thisDir = os.path.dirname(os.path.abspath(__file__))
filenames = []
thepath = "/Users/pascal/Coding/uni/Masterarbeit/Tests/results/finalcont/"
scen = "scen"
thisScen = scen
listfile = "/comp3.txt" #"/testing_list.txt"
scenari... | [
"os.path.abspath"
] | [((120, 145), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (135, 145), False, 'import os\n')] |
from pathlib import Path
from fhir.resources.codesystem import CodeSystem
from oops_fhir.utils import CodeSystemConcept
__all__ = ["v3HL7ContextConductionStyle"]
_resource = CodeSystem.parse_file(Path(__file__).with_suffix(".json"))
class v3HL7ContextConductionStyle:
"""
v3 Code System HL7ContextConducti... | [
"oops_fhir.utils.CodeSystemConcept",
"pathlib.Path"
] | [((614, 978), 'oops_fhir.utils.CodeSystemConcept', 'CodeSystemConcept', (["{'code': 'C', 'definition':\n 'Definition: Context conduction is defined using the contextConductionCode and contextConductionInd attributes on ActRelationship and Participation.\\r\\n\\n \\n U... |
"""
Authors: <<NAME>, <NAME>>
Copyright: (C) 2019-2020 <http://www.dei.unipd.it/
Department of Information Engineering> (DEI), <http://www.unipd.it/ University of Padua>, Italy
License: <http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0>
"""
import os
import math
import s... | [
"numpy.mean",
"numpy.median",
"pickle.dump",
"sklearn.metrics.pairwise.cosine_similarity",
"numpy.random.choice",
"functools.reduce",
"numpy.std",
"pickle.load",
"numpy.max",
"os.path.isfile",
"numpy.array",
"numpy.random.randint",
"numpy.argsort",
"numpy.random.seed",
"numpy.min",
"xm... | [((834, 854), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (848, 854), True, 'import numpy as np\n'), ((11079, 11126), 'numpy.random.choice', 'np.random.choice', (['allowed_docs'], {'size': 'batch_size'}), '(allowed_docs, size=batch_size)\n', (11095, 11126), True, 'import numpy as np\n'), ((11860,... |
# copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve.
#
# 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... | [
"paddle.nn.Dropout",
"paddle.nn.functional.softmax_with_cross_entropy",
"paddle.nn.LSTM",
"paddle.mean",
"numpy.zeros",
"paddle.to_tensor",
"paddle.nn.Linear",
"paddle.reshape",
"paddle.nn.functional.softmax",
"paddle.nn.initializer.Uniform"
] | [((1628, 1704), 'paddle.nn.LSTM', 'LSTM', ([], {'input_size': 'hidden_size', 'hidden_size': 'hidden_size', 'num_layers': 'num_layers'}), '(input_size=hidden_size, hidden_size=hidden_size, num_layers=num_layers)\n', (1632, 1704), False, 'from paddle.nn import LSTM, Embedding, Dropout, Linear\n'), ((2294, 2397), 'paddle.... |
import pytest
from demo_project.main import app
from fastapi.testclient import TestClient
openapi_schema = {
'openapi': '3.0.2',
'info': {
'title': 'My Project',
'description': '## Welcome to my API! \n This is my description, written in `markdown`',
'version': '1.0.0',
},
'path... | [
"fastapi.testclient.TestClient"
] | [((5712, 5731), 'fastapi.testclient.TestClient', 'TestClient', ([], {'app': 'app'}), '(app=app)\n', (5722, 5731), False, 'from fastapi.testclient import TestClient\n')] |
import display
import pytest
import msgflo
import gevent
import os.path
BROKER = os.environ.get('MSGFLO_BROKER', 'mqtt://localhost')
# Helper for running one iteration of next_state()
def run_next(state, inputs):
current = display.State(**state)
inputs = display.Inputs(**inputs)
next = display.next_sta... | [
"display.State",
"urllib.parse.urlparse",
"gevent.sleep",
"paho.mqtt.client.Client",
"display.Inputs",
"display.Participant",
"msgflo.run",
"pytest.fixture",
"display.next_state"
] | [((1187, 1203), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (1201, 1203), False, 'import pytest\n'), ((1421, 1437), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (1435, 1437), False, 'import pytest\n'), ((232, 254), 'display.State', 'display.State', ([], {}), '(**state)\n', (245, 254), False, 'import ... |
import random
import sys
sys.path.append("../../")
from gfxlcd.driver.ssd1306.spi import SPI
from gfxlcd.driver.ssd1306.ssd1306 import SSD1306
def hole(x, y):
o.draw_pixel(x+1, y)
o.draw_pixel(x+2, y)
o.draw_pixel(x+3, y)
o.draw_pixel(x+1, y + 4)
o.draw_pixel(x+2, y + 4)
o.draw_pixel(x+3, y + ... | [
"gfxlcd.driver.ssd1306.spi.SPI",
"sys.path.append",
"random.randint",
"gfxlcd.driver.ssd1306.ssd1306.SSD1306"
] | [((25, 50), 'sys.path.append', 'sys.path.append', (['"""../../"""'], {}), "('../../')\n", (40, 50), False, 'import sys\n'), ((499, 504), 'gfxlcd.driver.ssd1306.spi.SPI', 'SPI', ([], {}), '()\n', (502, 504), False, 'from gfxlcd.driver.ssd1306.spi import SPI\n'), ((509, 530), 'gfxlcd.driver.ssd1306.ssd1306.SSD1306', 'SSD... |
def corpus_file_transform(src_file,dst_file):
import os
assert os.path.isfile(src_file),'Src File Not Exists.'
with open(src_file,'r',encoding = 'utf-8') as text_corpus_src:
with open(dst_file,'w',encoding = 'utf-8') as text_corpus_dst:
from tqdm.notebook import tqdm
text_co... | [
"pickle.dump",
"pickle.load",
"os.path.isfile",
"numpy.array",
"numpy.isnan"
] | [((71, 95), 'os.path.isfile', 'os.path.isfile', (['src_file'], {}), '(src_file)\n', (85, 95), False, 'import os\n'), ((1002, 1016), 'pickle.load', 'pickle.load', (['f'], {}), '(f)\n', (1013, 1016), False, 'import pickle\n'), ((1064, 1087), 'pickle.dump', 'pickle.dump', (['feature', 'f'], {}), '(feature, f)\n', (1075, 1... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2020 VMware, Inc. All Rights Reserved.
# SPDX-License-Identifier: BSD-2-Clause
import unittest
from tern.load import docker_api
from tern.utils import rootfs
from test_fixtures import create_working_dir
from test_fixtures import remove_working_dir
class TestLoadDockerAPI(un... | [
"tern.load.docker_api.check_docker_setup",
"tern.load.docker_api.build_image",
"test_fixtures.create_working_dir",
"tern.utils.rootfs.set_working_dir",
"tern.load.docker_api.extract_image",
"unittest.main",
"tern.load.docker_api.remove_image",
"test_fixtures.remove_working_dir",
"tern.load.docker_ap... | [((1919, 1934), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1932, 1934), False, 'import unittest\n'), ((504, 535), 'tern.load.docker_api.check_docker_setup', 'docker_api.check_docker_setup', ([], {}), '()\n', (533, 535), False, 'from tern.load import docker_api\n'), ((544, 564), 'test_fixtures.create_working_d... |
"""
Expected to be run from repo root
"""
import shutil
import os
def copy_golds(dir_path):
for f in os.listdir(os.path.join(dir_path, "gold")):
try:
shutil.copy(
os.path.join(dir_path, "build", f),
os.path.join(dir_path, "gold", f)
)
except ... | [
"os.listdir",
"os.path.join"
] | [((464, 483), 'os.listdir', 'os.listdir', (['"""tests"""'], {}), "('tests')\n", (474, 483), False, 'import os\n'), ((118, 148), 'os.path.join', 'os.path.join', (['dir_path', '"""gold"""'], {}), "(dir_path, 'gold')\n", (130, 148), False, 'import os\n'), ((510, 537), 'os.path.join', 'os.path.join', (['"""tests"""', 'name... |
# -*- coding: utf-8 -*-
import logging
import os
from django.utils import six
from .base import * # noqa
SECRET_KEY = 'dev-<KEY>'
ALLOWED_HOSTS = []
DEBUG = True
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
INTERNAL_IPS = ('127.0.0.1',) # Used by app debug_toolbar
# Add the Python core Null... | [
"django.utils.six.itervalues"
] | [((602, 636), 'django.utils.six.itervalues', 'six.itervalues', (["LOGGING['loggers']"], {}), "(LOGGING['loggers'])\n", (616, 636), False, 'from django.utils import six\n')] |
import click
import logging
from django.core.management.base import BaseCommand
from sendcloud.core.members import MemberAPI
logger = logging.getLogger('sendcloud')
class Command(BaseCommand):
help = __doc__
table_width = 120
def add_arguments(self, parser):
parser.add_argument(
'-... | [
"logging.getLogger",
"click.echo",
"sendcloud.core.members.MemberAPI"
] | [((136, 166), 'logging.getLogger', 'logging.getLogger', (['"""sendcloud"""'], {}), "('sendcloud')\n", (153, 166), False, 'import logging\n'), ((1877, 1889), 'click.echo', 'click.echo', ([], {}), '()\n', (1887, 1889), False, 'import click\n'), ((1898, 1943), 'click.echo', 'click.echo', (['"""Django Send Cloud CLI Dashbo... |
"""
Attention is all you need!
"""
from typing import Dict, List, Any
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.parallel
from allennlp.data.vocabulary import Vocabulary
from allennlp.models.model import Model
from allennlp.modules import TextFieldEmbedder, Seq2SeqEncoder, Feed... | [
"torch.nn.functional.softmax",
"utils.detector.SimpleDetector",
"torch.nn.Dropout",
"allennlp.modules.TimeDistributed",
"allennlp.nn.InitializerApplicator",
"torch.nn.CrossEntropyLoss",
"allennlp.training.metrics.CategoricalAccuracy",
"torch.nn.ReLU",
"allennlp.models.model.Model.register",
"torch... | [((820, 859), 'allennlp.models.model.Model.register', 'Model.register', (['"""MultiModalAttentionQA"""'], {}), "('MultiModalAttentionQA')\n", (834, 859), False, 'from allennlp.models.model import Model\n'), ((1427, 1450), 'allennlp.nn.InitializerApplicator', 'InitializerApplicator', ([], {}), '()\n', (1448, 1450), Fals... |
import sys
import io
import time
import argparse
import re
from pyctest import *
def getState(test):
return test.c_test_machine.current_state
'''
@see PycTestCase
'''
class TestStartAndTransition(PycTestCase):
def __init__(self):
super(PycTestCase, self).__init__()
def runTest(se... | [
"argparse.ArgumentParser"
] | [((5339, 5397), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Statemachine tester"""'}), "(description='Statemachine tester')\n", (5362, 5397), False, 'import argparse\n')] |
import sys
import datetime
import pytest
import pandas as pd
try:
import unittest.mock as mock
except ImportError:
import mock
from dagster_pandas import DataFrame
from dagster import (
DependencyDefinition,
InputDefinition,
List,
ModeDefinition,
Nothing,
OutputDefinition,
Path,
... | [
"dagster_gcp.BigQueryDeleteDatasetSolidDefinition",
"mock.patch.dict",
"dagster.List",
"dagster.ModeDefinition",
"dagster.execute_pipeline",
"dagster_gcp.BigQueryCreateDatasetSolidDefinition",
"dagster.InputDefinition",
"dagster.core.definitions.create_environment_type",
"dagster.core.types.evaluato... | [((873, 1154), 'dagster_gcp.BigQuerySolidDefinition', 'BigQuerySolidDefinition', (['"""test"""', '[\'SELECT 1 AS field1, 2 AS field2;\',\n """SELECT *\n FROM `weathersource-com.pub_weather_data_samples.sample_weather_history_anomaly_us_zipcode_daily`\n ORDER BY postal_code ASC, date_valid_std A... |
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 1 14:52:43 2018
@author: user
"""
import pandas as pd
from keras import preprocessing
import os
import datetime
from multiclass.AnalizeRunner import AnalizeRunner
##################################################
prefix = "dataset"
data_path = "C:\\... | [
"os.makedirs",
"pandas.read_csv",
"multiclass.AnalizeRunner.AnalizeRunner",
"datetime.datetime.now",
"keras.preprocessing.sequence.pad_sequences"
] | [((618, 633), 'multiclass.AnalizeRunner.AnalizeRunner', 'AnalizeRunner', ([], {}), '()\n', (631, 633), False, 'from multiclass.AnalizeRunner import AnalizeRunner\n'), ((1239, 1268), 'os.makedirs', 'os.makedirs', (['main_folder_name'], {}), '(main_folder_name)\n', (1250, 1268), False, 'import os\n'), ((669, 766), 'panda... |
import json
import urllib.request
import subprocess
from time import sleep
from constants import ANKI_USER, DECK_NAME
NOTE_TYPE = 'vomBuch-insAnki Note'
ANKI_APP = None
def request(action, **params): # from AnkiConnect's page
return {'action': action, 'params': params, 'version': 6}
def invoke(action, **para... | [
"subprocess.Popen",
"time.sleep"
] | [((3429, 3437), 'time.sleep', 'sleep', (['(5)'], {}), '(5)\n', (3434, 3437), False, 'from time import sleep\n'), ((2466, 2509), 'subprocess.Popen', 'subprocess.Popen', (["['anki', '-p', ANKI_USER]"], {}), "(['anki', '-p', ANKI_USER])\n", (2482, 2509), False, 'import subprocess\n'), ((2518, 2526), 'time.sleep', 'sleep',... |
import subprocess
from datetime import datetime
from pathlib import Path
from typing import Any
from typing import List
from typing import Optional
from typing import Union
from pyspark.sql import DataFrame
from pyspark.sql import functions as F
from cishouseholds.edit import assign_from_map
from cishouseholds.edit i... | [
"cishouseholds.edit.update_column_values_from_map",
"cishouseholds.pipeline.load.extract_from_table",
"pathlib.Path",
"cishouseholds.pipeline.pipeline_stages.register_pipeline_stage",
"cishouseholds.pipeline.config.get_config",
"pyspark.sql.functions.col",
"cishouseholds.edit.rename_column_names",
"su... | [((782, 822), 'cishouseholds.pipeline.pipeline_stages.register_pipeline_stage', 'register_pipeline_stage', (['"""tables_to_csv"""'], {}), "('tables_to_csv')\n", (805, 822), False, 'from cishouseholds.pipeline.pipeline_stages import register_pipeline_stage\n'), ((1549, 1592), 'cishouseholds.pipeline.pipeline_stages.regi... |
import os
from flask import Flask
from flask_restful import Resource, Api
app = Flask(__name__)
api = Api(app)
class EnvironmentVariablesEndpoint(Resource):
def get(self):
return [(key, os.environ[key]) for key in os.environ.keys()]
api.add_resource(EnvironmentVariablesEndpoint, '/')
if __name__ == '... | [
"os.environ.keys",
"flask_restful.Api",
"flask.Flask"
] | [((82, 97), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (87, 97), False, 'from flask import Flask\n'), ((104, 112), 'flask_restful.Api', 'Api', (['app'], {}), '(app)\n', (107, 112), False, 'from flask_restful import Resource, Api\n'), ((230, 247), 'os.environ.keys', 'os.environ.keys', ([], {}), '()\n', ... |
from __future__ import annotations
import os
import signal
import subprocess
import sys
import time
from multiprocessing import cpu_count
from typing import List, Union
import click
from .__version__ import __version__
from .routing.commands import display_urls
from .utils import F, import_from_string, import_module... | [
"click.Choice",
"uvloop.install",
"time.sleep",
"multiprocessing.cpu_count",
"click.echo",
"sys.exit",
"os.kill",
"hypercorn.trio.serve",
"click.secho",
"click.group",
"subprocess.Popen",
"click.option",
"trio.Event",
"asyncio.get_event_loop",
"click.command",
"click.argument",
"sign... | [((825, 868), 'click.group', 'click.group', ([], {'help': 'f"""Index.py {__version__}"""'}), "(help=f'Index.py {__version__}')\n", (836, 868), False, 'import click\n'), ((450, 491), 'click.echo', 'click.echo', (['"""Execute command: """'], {'nl': '(False)'}), "('Execute command: ', nl=False)\n", (460, 491), False, 'imp... |
from fastapi import Request
from fastapi.responses import JSONResponse
from db import AuthDb
async def auth_check(request: Request, call_next):
if (request.url.path == "/") or (request.url.path == "/docs"):
response = await call_next(request)
return response
else:
try:
""... | [
"fastapi.responses.JSONResponse"
] | [((598, 656), 'fastapi.responses.JSONResponse', 'JSONResponse', (["{'message': 'Unauthorized'}"], {'status_code': '(403)'}), "({'message': 'Unauthorized'}, status_code=403)\n", (610, 656), False, 'from fastapi.responses import JSONResponse\n'), ((803, 861), 'fastapi.responses.JSONResponse', 'JSONResponse', (["{'message... |
import sys, os
from tests.data import DNA_QUERY, PEPTIDE_QUERY
myPath = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, myPath + '/../')
from fastapi.testclient import TestClient
from main import app
client = TestClient(app)
REQUIRED_RESPONSE_DATA = [
'query',
'weights',
'seq_t... | [
"os.path.abspath",
"fastapi.testclient.TestClient",
"sys.path.insert"
] | [((116, 151), 'sys.path.insert', 'sys.path.insert', (['(0)', "(myPath + '/../')"], {}), "(0, myPath + '/../')\n", (131, 151), False, 'import sys, os\n'), ((226, 241), 'fastapi.testclient.TestClient', 'TestClient', (['app'], {}), '(app)\n', (236, 241), False, 'from fastapi.testclient import TestClient\n'), ((89, 114), '... |
import sqlite3
import datetime
import time
import logging
import os
from bot_constant import CQ_ROOT
CQ_IMAGE_ROOT = os.path.join(CQ_ROOT, r'data/image')
logger = logging.getLogger("CTB." + __name__)
class FileDB:
def __init__(self, db_name: str):
self.conn = sqlite3.connect(db_name, check_same_thread=F... | [
"logging.getLogger",
"os.path.exists",
"os.listdir",
"sqlite3.connect",
"os.path.join",
"os.path.isfile",
"datetime.datetime.now",
"os.walk",
"os.remove"
] | [((118, 153), 'os.path.join', 'os.path.join', (['CQ_ROOT', '"""data/image"""'], {}), "(CQ_ROOT, 'data/image')\n", (130, 153), False, 'import os\n'), ((165, 201), 'logging.getLogger', 'logging.getLogger', (["('CTB.' + __name__)"], {}), "('CTB.' + __name__)\n", (182, 201), False, 'import logging\n'), ((276, 325), 'sqlite... |
import board3d as go_board
import numpy as np
import global_vars_go as gvg
def games_to_states(game_data):
train_boards = []
train_next_moves = []
for game_index in range(len(game_data)):
board = go_board.setup_board(game_data[game_index])
for node in game_data[game_index].get_main... | [
"numpy.copy",
"board3d.make_move",
"numpy.zeros",
"board3d.setup_board",
"board3d.switch_player_perspec"
] | [((1261, 1323), 'numpy.zeros', 'np.zeros', (['(gvg.board_size, gvg.board_size, gvg.board_channels)'], {}), '((gvg.board_size, gvg.board_size, gvg.board_channels))\n', (1269, 1323), True, 'import numpy as np\n'), ((225, 268), 'board3d.setup_board', 'go_board.setup_board', (['game_data[game_index]'], {}), '(game_data[gam... |
import os
import struct
def readFile(path):
if not os.path.isfile(path):
raise FileNotFoundError
else:
with open(path, 'r') as file:
source = file.read()
return source
def cleaner(source):
lines = source.split('\n')
for i in range(len(lines)... | [
"os.path.isfile",
"struct.unpack"
] | [((60, 80), 'os.path.isfile', 'os.path.isfile', (['path'], {}), '(path)\n', (74, 80), False, 'import os\n'), ((1022, 1071), 'struct.unpack', 'struct.unpack', (['""">i"""', 'object_dict[memory_location]'], {}), "('>i', object_dict[memory_location])\n", (1035, 1071), False, 'import struct\n')] |
from jinja2 import Environment, FileSystemLoader, Template, TemplateNotFound
import collections
import os
import yaml
from os.path import dirname, basename
from .env import environ
from ..log import logger
def reader(fn):
logger.debug('loading', f=fn)
try:
tmplenv = Environment(loader=FileSystemLoader(... | [
"os.path.dirname",
"os.path.basename",
"yaml.load"
] | [((442, 457), 'yaml.load', 'yaml.load', (['part'], {}), '(part)\n', (451, 457), False, 'import yaml\n'), ((374, 386), 'os.path.basename', 'basename', (['fn'], {}), '(fn)\n', (382, 386), False, 'from os.path import dirname, basename\n'), ((320, 331), 'os.path.dirname', 'dirname', (['fn'], {}), '(fn)\n', (327, 331), Fals... |
import numpy as np
def white_noise(im, scale):
im = im + np.random.normal(0.0, scale, im.shape)
im = np.maximum(im, 0.0)
im = np.minimum(im, 1.0)
return im
def salt_and_pepper(im, prob):
if prob > 1 or prob < 0:
raise ValueError("Prob must be within 0 to 1")
if im.ndim == 2:
... | [
"numpy.random.normal",
"numpy.random.rand",
"numpy.minimum",
"numpy.squeeze",
"numpy.maximum"
] | [((111, 130), 'numpy.maximum', 'np.maximum', (['im', '(0.0)'], {}), '(im, 0.0)\n', (121, 130), True, 'import numpy as np\n'), ((140, 159), 'numpy.minimum', 'np.minimum', (['im', '(1.0)'], {}), '(im, 1.0)\n', (150, 159), True, 'import numpy as np\n'), ((381, 401), 'numpy.random.rand', 'np.random.rand', (['h', 'w'], {}),... |
from django.conf.urls import url
from accounts import views as account_views
urlpatterns = [
url(r'users/$', account_views.users_list, name='users-list'),
url(r'users/new/$', account_views.user_create, name='user-create'),
url(r'user/(?P<pk>\d+)/$', account_views.user_single, name='user-single'),
url(... | [
"django.conf.urls.url"
] | [((99, 158), 'django.conf.urls.url', 'url', (['"""users/$"""', 'account_views.users_list'], {'name': '"""users-list"""'}), "('users/$', account_views.users_list, name='users-list')\n", (102, 158), False, 'from django.conf.urls import url\n'), ((165, 230), 'django.conf.urls.url', 'url', (['"""users/new/$"""', 'account_v... |
from qrogue.game.logic.actors import Player, Robot
from qrogue.game.logic.actors.controllables import TestBot, LukeBot
from qrogue.game.world.map import CallbackPack
from qrogue.util import Logger, PathConfig, AchievementManager, RandomManager, CommonPopups, CheatConfig
from qrogue.util.achievements import Achievement... | [
"qrogue.util.Logger.instance",
"qrogue.util.RandomManager.instance",
"qrogue.util.PathConfig.read",
"qrogue.util.PathConfig.find_latest_save_file",
"qrogue.game.logic.actors.Player",
"qrogue.util.CheatConfig.did_cheat",
"qrogue.util.AchievementManager",
"qrogue.game.world.map.CallbackPack.instance",
... | [((2731, 2754), 'qrogue.util.CheatConfig.did_cheat', 'CheatConfig.did_cheat', ([], {}), '()\n', (2752, 2754), False, 'from qrogue.util import Logger, PathConfig, AchievementManager, RandomManager, CommonPopups, CheatConfig\n'), ((963, 971), 'qrogue.game.logic.actors.Player', 'Player', ([], {}), '()\n', (969, 971), Fals... |
import sqlite3
connection = sqlite3.connect("rpg.db")
create_sql = """
CREATE TABLE IF NOT EXISTS Heroi(
id INTEGER PRIMARY KEY,
nome TEXT NOT NULL,
fisico INTEGER NOT NULL,
magia INTEGER NOT NULL,
agilidade INTEGER NOT NULL
)
"""
cursor = connection.cursor()
#2o passo: pegar o cursor
cursor.ex... | [
"sqlite3.connect"
] | [((33, 58), 'sqlite3.connect', 'sqlite3.connect', (['"""rpg.db"""'], {}), "('rpg.db')\n", (48, 58), False, 'import sqlite3\n'), ((599, 624), 'sqlite3.connect', 'sqlite3.connect', (['"""rpg.db"""'], {}), "('rpg.db')\n", (614, 624), False, 'import sqlite3\n')] |
from cms.app_base import CMSApp
from cms.apphook_pool import apphook_pool
from django.utils.translation import ugettext_lazy as _
class FactsApphook(CMSApp):
name = _("Facts")
urls = ["facts.urls"]
apphook_pool.register(FactsApphook)
| [
"cms.apphook_pool.apphook_pool.register",
"django.utils.translation.ugettext_lazy"
] | [((208, 243), 'cms.apphook_pool.apphook_pool.register', 'apphook_pool.register', (['FactsApphook'], {}), '(FactsApphook)\n', (229, 243), False, 'from cms.apphook_pool import apphook_pool\n'), ((170, 180), 'django.utils.translation.ugettext_lazy', '_', (['"""Facts"""'], {}), "('Facts')\n", (171, 180), True, 'from django... |
'''
MIT License
Copyright (c) 2019 <NAME> and <NAME>
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, merge, publ... | [
"re.search",
"re.compile"
] | [((1134, 1632), 're.compile', 're.compile', (['"""(?P<ipaddress>\\\\d{1,3}\\\\.\\\\d{1,3}\\\\.\\\\d{1,3}\\\\ \\\\\n .\\\\d{1,3}) - - \\\\[(?P<dateandtime>\\\\d{2}\\\\/[a-z]{3} \\\\\n \\\\/\\\\d{4}:\\\\d{2}:\\\\d{2}:\\\\d{2} (\\\\+|\\\\-)\\\\d{4})\\\\] \\\\\n ... |
from .coordinates import Coordinates
from typing import List
import csv
import pandas as pd
class Tracker:
@staticmethod
def load(csv_path: str):
airsim_results = pd.read_csv(csv_path, encoding='utf-8')
tracker = Tracker()
for index, row in airsim_results.iterrows():
coord... | [
"csv.DictWriter",
"pandas.read_csv"
] | [((181, 220), 'pandas.read_csv', 'pd.read_csv', (['csv_path'], {'encoding': '"""utf-8"""'}), "(csv_path, encoding='utf-8')\n", (192, 220), True, 'import pandas as pd\n'), ((1355, 1423), 'csv.DictWriter', 'csv.DictWriter', (['csv_file'], {'fieldnames': 'fieldnames', 'lineterminator': '"""\n"""'}), "(csv_file, fieldnames... |
'''
-*- coding: utf-8 -*-
@Time : 18-12-1 下午4:19
@Author : SamSa
@Site :
@File : like_blog.py
@Software: PyCharm
@Statement: 收藏博客
'''
from flask import session
from flask_restful import Resource, reqparse
from App.models.likeModel import Like
parse = reqparse.RequestParser()
parse.add_argument('blog_id')
cla... | [
"flask.session.get",
"flask_restful.reqparse.RequestParser",
"App.models.likeModel.Like"
] | [((261, 285), 'flask_restful.reqparse.RequestParser', 'reqparse.RequestParser', ([], {}), '()\n', (283, 285), False, 'from flask_restful import Resource, reqparse\n'), ((385, 407), 'flask.session.get', 'session.get', (['"""user_id"""'], {}), "('user_id')\n", (396, 407), False, 'from flask import session\n'), ((501, 507... |
API_KEY = ""
DONT_PRINT_USAGE_FOR = []
REP_DIRECTORY = "C:\\GabenStorage"
MAX_UPLOAD_SIZE_MB = 300
UNITY = {
"2017.2.0f3": "C:\\Program Files\\Unity\\Editor\\Unity.exe",
"2017.4.3f1": "C:\\Program Files\\Unity2017.4.3\\Editor\\Unity.exe"
}
QUOTES = ["I'm a handsome man with a charming personality.", \
"If Nvid... | [
"random.choice"
] | [((1457, 1478), 'random.choice', 'random.choice', (['QUOTES'], {}), '(QUOTES)\n', (1470, 1478), False, 'import random\n')] |
from datetime import datetime
import sys
sys.path.insert(1, r'C:\Users\ASUS\Desktop\sources\Telegram\werewolf\Darkhelper\2\V2\Databases')
from Databases.Groups import GroupsPlayersBase , GroupsBase , GroupsControlBase
from Databases.Groups.Bet import BetBase
from Databases.Users import AdminsBase
from Database... | [
"Databases.Users.AdminsBase.Show_All_Admins",
"sys.path.insert",
"Databases.Groups.Bet.BetBase.win",
"Databases.Users.UsersBase.Show_Group_ALL_User_Points",
"Databases.Users.AdminsBase.Show_Owner",
"Databases.Stats.AdminStatsBase.Show_Gap_All_Admins_Points",
"Databases.Groups.GroupsBase.Add_Group",
"D... | [((44, 158), 'sys.path.insert', 'sys.path.insert', (['(1)', '"""C:\\\\Users\\\\ASUS\\\\Desktop\\\\sources\\\\Telegram\\\\werewolf\\\\Darkhelper\\\\2\\\\V2\\\\Databases"""'], {}), "(1,\n 'C:\\\\Users\\\\ASUS\\\\Desktop\\\\sources\\\\Telegram\\\\werewolf\\\\Darkhelper\\\\2\\\\V2\\\\Databases'\n )\n", (59, 158), Fal... |
from unittest import mock
from . import mock_2_sql
# odbc.connect
# connection.cursor()
# cursor.execute()
# results.description
# results.fetchall
@mock.patch('mocking.mock_2_sql.odbc')
def test_get_emp_name_wih_max_sal(odbc):
result = mock.Mock()
result.description = [["name"], ["salary"]]
result.fetch... | [
"unittest.mock.patch",
"unittest.mock.Mock"
] | [((152, 189), 'unittest.mock.patch', 'mock.patch', (['"""mocking.mock_2_sql.odbc"""'], {}), "('mocking.mock_2_sql.odbc')\n", (162, 189), False, 'from unittest import mock\n'), ((244, 255), 'unittest.mock.Mock', 'mock.Mock', ([], {}), '()\n', (253, 255), False, 'from unittest import mock\n'), ((408, 419), 'unittest.mock... |
from datetime import timedelta
from django.core.management.base import BaseCommand
from django.db.models import Q
from django.utils.timezone import now
from django_scopes import scopes_disabled
from pretix.base.models import Event, Quota
from pretix.base.services.quotas import QuotaAvailability
class Command(BaseComm... | [
"django_scopes.scopes_disabled",
"pretix.base.services.quotas.QuotaAvailability",
"django.utils.timezone.now",
"django.db.models.Q",
"pretix.base.models.Event.objects.filter"
] | [((536, 553), 'django_scopes.scopes_disabled', 'scopes_disabled', ([], {}), '()\n', (551, 553), False, 'from django_scopes import scopes_disabled\n'), ((608, 681), 'pretix.base.models.Event.objects.filter', 'Event.objects.filter', ([], {'plugins__contains': '"""pretix_hide_sold_out"""', 'live': '(True)'}), "(plugins__c... |
from django.contrib import admin
from .models import Cinema, ShowTime
class CinemaAdmin(admin.ModelAdmin):
list_display = ('title', 'genre', 'trailer', 'description', 'mpaa',)
search_fields = ('title',)
empty_value_display = '-пусто-'
class ShowTimeAdmin(admin.ModelAdmin):
list_display = ('cinema',... | [
"django.contrib.admin.site.register"
] | [((393, 433), 'django.contrib.admin.site.register', 'admin.site.register', (['Cinema', 'CinemaAdmin'], {}), '(Cinema, CinemaAdmin)\n', (412, 433), False, 'from django.contrib import admin\n'), ((434, 478), 'django.contrib.admin.site.register', 'admin.site.register', (['ShowTime', 'ShowTimeAdmin'], {}), '(ShowTime, Show... |
import scrapy
import scrapy.spiders
from techradarscraper.items import TechLoader
class TechRadarSpider(scrapy.spiders.Spider):
name = 'techradar'
start_urls = ['https://www.thoughtworks.com/radar/a-z']
def parse(self, response):
links = response.css('.a-z-links > ul > li.blip.hit > a')
... | [
"scrapy.crawler.CrawlerProcess",
"scrapy.utils.project.get_project_settings",
"techradarscraper.items.TechLoader",
"scrapy.Request"
] | [((746, 768), 'scrapy.utils.project.get_project_settings', 'get_project_settings', ([], {}), '()\n', (766, 768), False, 'from scrapy.utils.project import get_project_settings\n'), ((1049, 1073), 'scrapy.crawler.CrawlerProcess', 'CrawlerProcess', (['settings'], {}), '(settings)\n', (1063, 1073), False, 'from scrapy.craw... |
import os
import federate_learning as fl
from federate_learning.orchestrator.control_strategy import ControlType
from federate_learning.orchestrator.control_strategy.control_strategy import Target
from federate_learning.orchestrator.control_strategy.control_strategy_factory import ControlStrategyFactory
num_rounds = i... | [
"federate_learning.orchestrator.OrchestratorApp",
"federate_learning.Model",
"federate_learning.orchestrator.control_strategy.control_strategy.Target",
"os.getenv"
] | [((1805, 1876), 'federate_learning.Model', 'fl.Model', ([], {'name': 'model', 'framework': '"""TF"""', 'control_strategy': 'control_strategy'}), "(name=model, framework='TF', control_strategy=control_strategy)\n", (1813, 1876), True, 'import federate_learning as fl\n'), ((1966, 2007), 'federate_learning.orchestrator.Or... |
# views.py
#Importar conector MySQL
import mysql.connector
import requests
import json
from flask import render_template, request
from flask_table import Table, Col
from app import app
##Conexión a la BD
inf_Activos_Fijos = mysql.connector.connect(
host="localhost",
user="root",
passwd="<PASSWORD>",
databas... | [
"flask.render_template",
"json.loads",
"requests.post",
"flask.request.form.get",
"app.app.route",
"flask_table.Col"
] | [((384, 398), 'app.app.route', 'app.route', (['"""/"""'], {}), "('/')\n", (393, 398), False, 'from app import app\n'), ((456, 480), 'app.app.route', 'app.route', (['"""/index.html"""'], {}), "('/index.html')\n", (465, 480), False, 'from app import app\n'), ((538, 560), 'app.app.route', 'app.route', (['"""/404.html"""']... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2017-01-28 15:24
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('manage_room', '0004_auto_20170127_1505'),
]
operations = [
migrations.Remov... | [
"django.db.migrations.RemoveField",
"django.db.models.PositiveSmallIntegerField"
] | [((304, 362), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""slide"""', 'name': '"""prev_id"""'}), "(model_name='slide', name='prev_id')\n", (326, 362), False, 'from django.db import migrations, models\n'), ((508, 553), 'django.db.models.PositiveSmallIntegerField', 'models.Positiv... |
import os
os.system("sudo apt-get update")
#os.system('sudo apt-get install openjdk-8-jre -y')
os.system('wget --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz')
os.system('tar -zxf jdk-8u131-lin... | [
"os.system"
] | [((10, 42), 'os.system', 'os.system', (['"""sudo apt-get update"""'], {}), "('sudo apt-get update')\n", (19, 42), False, 'import os\n'), ((95, 296), 'os.system', 'os.system', (['"""wget --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b660... |
"""
Procuret Python
Test With Supplier Module
author: <EMAIL>
"""
from procuret.ancillary.command_line import CommandLine
from procuret.tests.variants.with_session import TestWithSession
class TestWithSupplier(TestWithSession):
def __init__(self) -> None:
cl = CommandLine.load()
self._supplier_... | [
"procuret.ancillary.command_line.CommandLine.load"
] | [((277, 295), 'procuret.ancillary.command_line.CommandLine.load', 'CommandLine.load', ([], {}), '()\n', (293, 295), False, 'from procuret.ancillary.command_line import CommandLine\n')] |
"""Tests the musicbrainz plugin."""
import datetime
from unittest.mock import patch
import musicbrainzngs # noqa: F401
import pytest
import tests.plugins.musicbrainz.resources as mb_rsrc
from moe.plugins import musicbrainz as moe_mb
@pytest.fixture
def mock_mb_by_id():
"""Mock the musicbrainzngs api call `get... | [
"moe.plugins.musicbrainz.get_album_by_id",
"datetime.date",
"unittest.mock.patch.object",
"moe.plugins.musicbrainz.get_matching_album",
"unittest.mock.patch"
] | [((349, 441), 'unittest.mock.patch', 'patch', (['"""moe.plugins.musicbrainz.mb_core.musicbrainzngs.get_release_by_id"""'], {'autospec': '(True)'}), "('moe.plugins.musicbrainz.mb_core.musicbrainzngs.get_release_by_id',\n autospec=True)\n", (354, 441), False, 'from unittest.mock import patch\n'), ((1610, 1647), 'moe.p... |
# -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'formulaSetupDialog.ui'
##
## Created by: Qt User Interface Compiler version 5.15.1
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
#######... | [
"pjrd.helpers.dbConnection",
"sys.path.append"
] | [((508, 534), 'sys.path.append', 'sys.path.append', (['"""../pjrd"""'], {}), "('../pjrd')\n", (523, 534), False, 'import sys\n'), ((11730, 11759), 'pjrd.helpers.dbConnection', 'dbConnection', (['"""FormulaSchema"""'], {}), "('FormulaSchema')\n", (11742, 11759), False, 'from pjrd.helpers import test, dbConnection\n'), (... |
"""
@Time : 203/21/19 17:11
@Author : TaylorMei
@Email : <EMAIL>
@Project : iccv
@File : crop_image.py
@Function:
"""
import os
import numpy as np
import skimage.io
input_path = '/media/iccd/TAYLORMEI/depth/image'
output_path = '/media/iccd/TAYLORMEI/depth/crop'
if not os.path.exists(output_path):
... | [
"os.path.exists",
"os.listdir",
"os.path.join",
"numpy.sum",
"os.mkdir"
] | [((356, 378), 'os.listdir', 'os.listdir', (['input_path'], {}), '(input_path)\n', (366, 378), False, 'import os\n'), ((290, 317), 'os.path.exists', 'os.path.exists', (['output_path'], {}), '(output_path)\n', (304, 317), False, 'import os\n'), ((323, 344), 'os.mkdir', 'os.mkdir', (['output_path'], {}), '(output_path)\n'... |
import os
import pytest
from pyriksprot import interface
from pyriksprot.corpus import parlaclarin
from ..utility import RIKSPROT_PARLACLARIN_FAKE_FOLDER, RIKSPROT_PARLACLARIN_FOLDER
jj = os.path.join
def test_to_protocol_in_depth_validation_of_correct_parlaclarin_xml():
protocol: interface.Protocol = parlac... | [
"pytest.mark.parametrize",
"pyriksprot.corpus.parlaclarin.XmlUntangleProtocol",
"pyriksprot.corpus.parlaclarin.ProtocolMapper.to_protocol"
] | [((724, 784), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""filename"""', "['prot-197879--14.xml']"], {}), "('filename', ['prot-197879--14.xml'])\n", (747, 784), False, 'import pytest\n'), ((980, 1045), 'pyriksprot.corpus.parlaclarin.ProtocolMapper.to_protocol', 'parlaclarin.ProtocolMapper.to_protocol', (... |
from django.contrib import admin
# Register your models here.
from .models import DpDienste,DpBesatzung
class BesatzungInline(admin.TabularInline):
model = DpBesatzung
extra = 0
class DiensteAdmin(admin.ModelAdmin):
list_display = ('tag', 'schicht', 'ordner', 'ordner_name')
list_filter = ('ordner_... | [
"django.contrib.admin.site.register"
] | [((408, 452), 'django.contrib.admin.site.register', 'admin.site.register', (['DpDienste', 'DiensteAdmin'], {}), '(DpDienste, DiensteAdmin)\n', (427, 452), False, 'from django.contrib import admin\n')] |
# -*- coding: utf-8 -*-
# Define here the models for your spider middleware
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/spider-middleware.html
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from scrapy.http import HtmlResponse
class JSMiddleware(objec... | [
"selenium.webdriver.PhantomJS",
"selenium.webdriver.support.ui.WebDriverWait",
"scrapy.http.HtmlResponse"
] | [((491, 534), 'selenium.webdriver.PhantomJS', 'webdriver.PhantomJS', ([], {'service_args': 'configure'}), '(service_args=configure)\n', (510, 534), False, 'from selenium import webdriver\n'), ((550, 575), 'selenium.webdriver.support.ui.WebDriverWait', 'WebDriverWait', (['driver', '(10)'], {}), '(driver, 10)\n', (563, 5... |
from collections import defaultdict
from coalib.bearlib.aspects.collections import aspectlist
class bearclass(type):
"""
Metaclass for :class:`coalib.bears.Bear.Bear` and therefore all bear
classes.
Pushing bears into the future... ;)
"""
# by default a bear class has no aspects
aspects... | [
"coalib.bearlib.aspects.collections.aspectlist"
] | [((343, 357), 'coalib.bearlib.aspects.collections.aspectlist', 'aspectlist', (['[]'], {}), '([])\n', (353, 357), False, 'from coalib.bearlib.aspects.collections import aspectlist\n'), ((890, 904), 'coalib.bearlib.aspects.collections.aspectlist', 'aspectlist', (['[]'], {}), '([])\n', (900, 904), False, 'from coalib.bear... |
from pathlib import Path
import pandas as pd
import config
from mbs.mbs import *
import streamlit as st
from streamlit_autorefresh import st_autorefresh
import yaml
# ====================================
# Authentication
# ====================================
AK = config.API_KEY # not really necessary
AKS = config.AP... | [
"streamlit_autorefresh.st_autorefresh",
"streamlit.markdown",
"pandas.read_csv",
"pathlib.Path",
"yaml.safe_load",
"streamlit.plotly_chart",
"streamlit.dataframe",
"streamlit.set_page_config",
"streamlit.columns",
"streamlit.title"
] | [((551, 565), 'pathlib.Path', 'Path', (['"""./data"""'], {}), "('./data')\n", (555, 565), False, 'from pathlib import Path\n'), ((577, 603), 'pathlib.Path', 'Path', (['"""./log/log_file.txt"""'], {}), "('./log/log_file.txt')\n", (581, 603), False, 'from pathlib import Path\n'), ((621, 653), 'pathlib.Path', 'Path', (['"... |
from rest_framework import serializers
from .models import (
Flow,
DailyFlowRuns,
Group,
DailyGroupCount,
Channel,
DailyChannelCount,
Label,
)
class FlowSerializer(serializers.ModelSerializer):
class Meta:
model = Flow
fields = ["uuid", "name", "is_active"]
rea... | [
"rest_framework.serializers.IntegerField",
"rest_framework.serializers.CharField"
] | [((786, 823), 'rest_framework.serializers.CharField', 'serializers.CharField', ([], {'max_length': '(255)'}), '(max_length=255)\n', (807, 823), False, 'from rest_framework import serializers\n'), ((835, 872), 'rest_framework.serializers.CharField', 'serializers.CharField', ([], {'max_length': '(255)'}), '(max_length=25... |
import numpy as np
import gzip
from Bio import SeqIO
from pathlib import Path
import os
import subprocess
import tarfile
from io import BytesIO
#for parallel computing
from joblib import Parallel, delayed
import multiprocessing
num_cores_energy = multiprocessing.cpu_count()
from tqdm import tqdm
import pandas as pd
imp... | [
"tarfile.open",
"subprocess.run",
"os.path.join",
"io.BytesIO",
"multiprocessing.cpu_count",
"numpy.log",
"numpy.exp",
"numpy.sum",
"numpy.zeros",
"joblib.Parallel",
"Bio.SeqIO.parse",
"pandas.DataFrame",
"joblib.delayed",
"numpy.load",
"numpy.round"
] | [((247, 274), 'multiprocessing.cpu_count', 'multiprocessing.cpu_count', ([], {}), '()\n', (272, 274), False, 'import multiprocessing\n'), ((748, 780), 'tarfile.open', 'tarfile.open', (['path_h_DCA', '"""r:gz"""'], {}), "(path_h_DCA, 'r:gz')\n", (760, 780), False, 'import tarfile\n'), ((998, 1030), 'tarfile.open', 'tarf... |
import torch
import torch.nn.functional as F
from cogdl.utils import spmm
from . import BaseLayer
class GINELayer(BaseLayer):
r"""The modified GINConv operator from the `"Graph convolutions that can finally model local structure" paper
<https://arxiv.org/pdf/2011.15069.pdf>`__.
Parameters
---------... | [
"torch.FloatTensor",
"torch.nn.functional.relu",
"cogdl.utils.spmm"
] | [((1052, 1066), 'cogdl.utils.spmm', 'spmm', (['graph', 'x'], {}), '(graph, x)\n', (1056, 1066), False, 'from cogdl.utils import spmm\n'), ((1247, 1263), 'torch.nn.functional.relu', 'F.relu', (['(x + attr)'], {}), '(x + attr)\n', (1253, 1263), True, 'import torch.nn.functional as F\n'), ((752, 776), 'torch.FloatTensor',... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-03-24 19:29
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('isisdata', '0060_auto_20170324_1741'),
]
operations = [
migrations.RemoveField(
... | [
"django.db.migrations.RemoveField"
] | [((293, 382), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""historicaltracking"""', 'name': '"""subject_content_type"""'}), "(model_name='historicaltracking', name=\n 'subject_content_type')\n", (315, 382), False, 'from django.db import migrations\n'), ((422, 510), 'django.db.... |
import base64
import binascii
from typing import Union
from peewee import DatabaseProxy, Model, CharField, BooleanField, DateTimeField, IntegerField, ForeignKeyField, \
CompositeKey, DoesNotExist
from db.fields import BytesField
database_proxy = DatabaseProxy()
class BaseModel(Model):
class Meta:
d... | [
"peewee.BooleanField",
"peewee.CharField",
"peewee.DatabaseProxy",
"db.fields.BytesField",
"peewee.CompositeKey",
"peewee.ForeignKeyField",
"peewee.IntegerField",
"base64.b64decode",
"peewee.DateTimeField"
] | [((253, 268), 'peewee.DatabaseProxy', 'DatabaseProxy', ([], {}), '()\n', (266, 268), False, 'from peewee import DatabaseProxy, Model, CharField, BooleanField, DateTimeField, IntegerField, ForeignKeyField, CompositeKey, DoesNotExist\n'), ((380, 410), 'peewee.IntegerField', 'IntegerField', ([], {'primary_key': '(True)'})... |
import requests
'''
Makes a request to an API endpoint
Takes authorization header if needed
'''
url = "http://127.0.0.1:8000/api/test"
payload={}
headers = {
'Accept': 'application/json',
'Authorization': 'token' # Specify an access token if needed
}
response = requests.request("GET", url, headers=headers, data... | [
"requests.request"
] | [((270, 329), 'requests.request', 'requests.request', (['"""GET"""', 'url'], {'headers': 'headers', 'data': 'payload'}), "('GET', url, headers=headers, data=payload)\n", (286, 329), False, 'import requests\n')] |
import cloudpassage
import json
import os
policy_file_name = "firewall.json"
config_file_name = "portal.yaml.local"
tests_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "../"))
config_file = os.path.join(tests_dir, "configs/", config_file_name)
policy_file = os.path.join(tests_dir, 'policies/', policy_f... | [
"cloudpassage.FirewallPolicy",
"cloudpassage.ApiKeyManager",
"json.loads",
"cloudpassage.FirewallInterface",
"json.dumps",
"os.path.join",
"cloudpassage.FirewallService",
"cloudpassage.HaloSession",
"os.path.dirname",
"cloudpassage.FirewallRule",
"cloudpassage.FirewallZone"
] | [((207, 260), 'os.path.join', 'os.path.join', (['tests_dir', '"""configs/"""', 'config_file_name'], {}), "(tests_dir, 'configs/', config_file_name)\n", (219, 260), False, 'import os\n'), ((275, 329), 'os.path.join', 'os.path.join', (['tests_dir', '"""policies/"""', 'policy_file_name'], {}), "(tests_dir, 'policies/', po... |
import os
import random
import argparse
import time
from datetime import datetime
from tqdm import tqdm
import paddle
paddle.disable_static()
import paddle.nn.functional as F
import paddle.optimizer as optim
from pgl.utils.data import Dataloader
import numpy as np
from models import DeepFRI
from data_preprocessing i... | [
"custom_metrics.do_compute_metrics",
"paddle.no_grad",
"argparse.ArgumentParser",
"paddle.nn.functional.sigmoid",
"tqdm.tqdm",
"utils.add_saved_args_and_params",
"datetime.datetime.now",
"paddle.disable_static",
"data_preprocessing.MyDataset",
"numpy.concatenate",
"paddle.load",
"models.DeepFR... | [((120, 143), 'paddle.disable_static', 'paddle.disable_static', ([], {}), '()\n', (141, 143), False, 'import paddle\n'), ((623, 656), 'tqdm.tqdm', 'tqdm', (['data_loader'], {'desc': 'f"""{desc}"""'}), "(data_loader, desc=f'{desc}')\n", (627, 656), False, 'from tqdm import tqdm\n'), ((827, 854), 'numpy.concatenate', 'np... |
from pathlib import Path
from ruamel import yaml
with Path(__file__).parent.parent.joinpath("config.yaml").resolve().open("r") as fin:
__DEFAULT_CONFIG: dict = yaml.safe_load(fin)
def set_default_config(ip: str, port: int, log_directory: str):
global __DEFAULT_CONFIG
__DEFAULT_CONFIG.update(dict(ip=... | [
"ruamel.yaml.safe_load",
"pathlib.Path"
] | [((170, 189), 'ruamel.yaml.safe_load', 'yaml.safe_load', (['fin'], {}), '(fin)\n', (184, 189), False, 'from ruamel import yaml\n'), ((60, 74), 'pathlib.Path', 'Path', (['__file__'], {}), '(__file__)\n', (64, 74), False, 'from pathlib import Path\n')] |