code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import click
from yearn.scripts.load import load as script_load
@click.group()
def cli():
pass
@cli.command()
@click.argument('path', default='.')
@click.option('--scgi', default=None)
@click.option('--mount', default=None) # TODO: support multiple mounts
def load(path, scgi, mount):
click.echo('Loading t... | [
"click.argument",
"click.group",
"yearn.scripts.load.load",
"click.option",
"click.echo"
] | [((68, 81), 'click.group', 'click.group', ([], {}), '()\n', (79, 81), False, 'import click\n'), ((120, 155), 'click.argument', 'click.argument', (['"""path"""'], {'default': '"""."""'}), "('path', default='.')\n", (134, 155), False, 'import click\n'), ((157, 193), 'click.option', 'click.option', (['"""--scgi"""'], {'de... |
# Copyright (c) <NAME>
# See LICENSE for details.
""" Implementations to some of the abstract classes used by this module. """
import os
import time
from uuid import uuid4
try:
from ConfigParser import RawConfigParser
except ImportError:
# noinspection PyUnresolvedReferences
from configparser import RawCo... | [
"uuid.uuid4",
"os.path.dirname",
"os.path.abspath",
"configparser.RawConfigParser",
"time.time"
] | [((1337, 1354), 'configparser.RawConfigParser', 'RawConfigParser', ([], {}), '()\n', (1352, 1354), False, 'from configparser import RawConfigParser\n'), ((1375, 1396), 'os.path.abspath', 'os.path.abspath', (['path'], {}), '(path)\n', (1390, 1396), False, 'import os\n'), ((865, 872), 'uuid.uuid4', 'uuid4', ([], {}), '()... |
from django.views.generic import TemplateView, ListView, DetailView, CreateView, UpdateView, DeleteView
from django.urls import reverse_lazy
from .forms import TechnikaForm, EditTechnika
from .models import Technika
class ApiePageView(TemplateView):
template_name = 'technikosnuoma/apie.html'
class NuomojuPageVi... | [
"django.urls.reverse_lazy"
] | [((1158, 1180), 'django.urls.reverse_lazy', 'reverse_lazy', (['"""ieskau"""'], {}), "('ieskau')\n", (1170, 1180), False, 'from django.urls import reverse_lazy\n')] |
#!/usr/bin/python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
"""
Name : smgr_dhcp_event.py
Author : <NAME>
Description : Small python script that gets called from DHCP server to
notify of new IP address assignment or removal to hosts. This
script takes that information and does update to the DB for the... | [
"pycurl.Curl",
"argparse.ArgumentParser",
"cgitb.enable"
] | [((1011, 1086), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '""" Add a server to server manager DB. """'}), "(description=' Add a server to server manager DB. ')\n", (1034, 1086), False, 'import argparse\n'), ((2580, 2607), 'cgitb.enable', 'cgitb.enable', ([], {'format': '"""text"""'}), "... |
from core.models import Node
from core.services.DisplayDataService import DisplayDataService
import math
from pkg_resources import resource_string
class DetailedGraphVisualization(DisplayDataService):
def __init__(self):
self.links = []
self.found = []
self.row_chars = 30
self.grap... | [
"core.models.Node",
"pkg_resources.resource_string"
] | [((324, 330), 'core.models.Node', 'Node', ([], {}), '()\n', (328, 330), False, 'from core.models import Node\n'), ((4103, 4149), 'pkg_resources.resource_string', 'resource_string', (['__name__', '"""detailed_graph.js"""'], {}), "(__name__, 'detailed_graph.js')\n", (4118, 4149), False, 'from pkg_resources import resourc... |
import binascii
import struct
import ecdsa
import utils
class TxIn:
def __init__(self, prevTrxHash, prevOutputIdx, inputAmount):
self.inputAmount = inputAmount
self.prevOutputHash = binascii.unhexlify(prevTrxHash)[::-1]
self.prevOutputIdx = prevOutputIdx
def serialize(self):
r... | [
"utils.addressToScriptPubKey",
"utils.privateKeyToCompressedPublicKey",
"struct.pack",
"utils.privateKeyToPublicKey",
"utils.sign",
"utils.derSigToHexSig",
"utils.varstr",
"binascii.unhexlify",
"ecdsa.SigningKey.from_string"
] | [((1061, 1103), 'utils.addressToScriptPubKey', 'utils.addressToScriptPubKey', (['senderAddress'], {}), '(senderAddress)\n', (1088, 1103), False, 'import utils\n'), ((204, 235), 'binascii.unhexlify', 'binascii.unhexlify', (['prevTrxHash'], {}), '(prevTrxHash)\n', (222, 235), False, 'import binascii\n'), ((679, 708), 'st... |
import os
import sys
import argparse
import numpy as np
from .validate_ic import validate_ic
__all__ = ["validation_pipeline"]
def validation_pipeline(cat_folder, visit_num, sne_SED_path):
"""
Parameters
----------
cat_folder is a string; the path to the directory containing the
phosim_NNNNN.txt c... | [
"os.path.join",
"numpy.isnan"
] | [((1163, 1211), 'os.path.join', 'os.path.join', (["os.environ['TWINKLES_DIR']", '"""data"""'], {}), "(os.environ['TWINKLES_DIR'], 'data')\n", (1175, 1211), False, 'import os\n'), ((1238, 1302), 'os.path.join', 'os.path.join', (['twinkles_data_dir', '"""cosmoDC2_v1.1.4_agn_cache.csv"""'], {}), "(twinkles_data_dir, 'cosm... |
"""
Interceptor example using ICMP
Requirements:
iptables -I INPUT 1 -p icmp -j NFQUEUE --queue-balance 0:2
"""
import time
from packetracer import interceptor
from packetracer.layer3 import ip, icmp
# Add iptables rule:
# iptables -I INPUT 1 -p icmp -j NFQUEUE --queue-balance 0:2
# ICMP Echo request intercepting... | [
"time.sleep",
"packetracer.layer3.ip.IP",
"packetracer.interceptor.Interceptor"
] | [((820, 845), 'packetracer.interceptor.Interceptor', 'interceptor.Interceptor', ([], {}), '()\n', (843, 845), False, 'from packetracer import interceptor\n'), ((380, 391), 'packetracer.layer3.ip.IP', 'ip.IP', (['data'], {}), '(data)\n', (385, 391), False, 'from packetracer.layer3 import ip, icmp\n'), ((901, 916), 'time... |
import pandas as pd
import sklearn as sk
import scipy
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
def plot_general_statistics(df):
means = df.mean(axis=1)
medians = df.median(axis=1)
std = df.std(axis=1)
maxval = df.max(axis=1)
minval = df.min(axis=1)
skew = df.ske... | [
"matplotlib.pyplot.figure",
"pandas.read_csv",
"matplotlib.pyplot.show"
] | [((4498, 4589), 'pandas.read_csv', 'pd.read_csv', (['"""C:\\\\Users\\\\DYN\\\\Desktop\\\\exoplanet_classification_repo\\\\data\\\\final.csv"""'], {}), "(\n 'C:\\\\Users\\\\DYN\\\\Desktop\\\\exoplanet_classification_repo\\\\data\\\\final.csv')\n", (4509, 4589), True, 'import pandas as pd\n'), ((5084, 5094), 'matplotl... |
import pytest
import pandas as pd
import pickle
from hashlib import sha256
from tempfile import NamedTemporaryFile
from ketl.loader.Loader import (
BaseLoader, DatabaseLoader, HashLoader, DelimitedFileLoader, ParquetLoader,
LocalFileLoader, PickleLoader
)
from ketl.db.settings import get_engine
@pytest.fixt... | [
"pandas.DataFrame.from_records",
"ketl.loader.Loader.PickleLoader",
"ketl.loader.Loader.DelimitedFileLoader",
"ketl.db.settings.get_engine",
"pandas.read_parquet",
"pandas.read_csv",
"pandas.util.hash_pandas_object",
"ketl.loader.Loader.LocalFileLoader",
"ketl.loader.Loader.BaseLoader",
"pytest.ra... | [((354, 428), 'pandas.DataFrame.from_records', 'pd.DataFrame.from_records', (['[(1, 2, 3), (4, 5, 6)]'], {'columns': "['x', 'y', 'z']"}), "([(1, 2, 3), (4, 5, 6)], columns=['x', 'y', 'z'])\n", (379, 428), True, 'import pandas as pd\n'), ((479, 496), 'ketl.loader.Loader.BaseLoader', 'BaseLoader', (['"""foo"""'], {}), "(... |
####################################################################
# Copyright (c) 2020 <NAME> #
# #
# This source code is licensed under the MIT license found in the #
# LICENSE file in the root directory of this source tr... | [
"os.path.isfile",
"numpy.array",
"numpy.dot"
] | [((6030, 6073), 'numpy.array', 'numpy.array', (['list_points'], {'dtype': 'numpy.int32'}), '(list_points, dtype=numpy.int32)\n', (6041, 6073), False, 'import numpy, os\n'), ((6228, 6271), 'numpy.array', 'numpy.array', (['list_points'], {'dtype': 'numpy.int32'}), '(list_points, dtype=numpy.int32)\n', (6239, 6271), False... |
import shapefile
# import finoa
import shapely
# import matplotlib
import numpy as np
import matplotlib.pyplot as plt
# import matplotlib.pyplot as plt
# import pandas as pd
from pyproj import Proj, transform
# import stateplane
__author__ = '<NAME>'
def distPL(Point, lineseg):
# input:Point(x,y);lineseg[(x,y)... | [
"numpy.sqrt",
"shapefile.Writer",
"matplotlib.pyplot.figure",
"numpy.min",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.show"
] | [((1512, 1528), 'numpy.min', 'np.min', (['distlist'], {}), '(distlist)\n', (1518, 1528), True, 'import numpy as np\n'), ((1563, 1615), 'numpy.sqrt', 'np.sqrt', (['((P1[0] - P2[0]) ** 2 + (P1[1] - P2[1]) ** 2)'], {}), '((P1[0] - P2[0]) ** 2 + (P1[1] - P2[1]) ** 2)\n', (1570, 1615), True, 'import numpy as np\n'), ((4507,... |
from django.contrib import admin
from .models import Class
@admin.register(Class)
class ExerciseAdmin(admin.ModelAdmin):
list_display = ('cls_id', 'description', 'name')
list_editable = ('description', 'name' )
ordering = ('cls_id',)
| [
"django.contrib.admin.register"
] | [((62, 83), 'django.contrib.admin.register', 'admin.register', (['Class'], {}), '(Class)\n', (76, 83), False, 'from django.contrib import admin\n')] |
import boto3
import time
# Get the service resource
sqs = boto3.resource('sqs')
# Create the queue. This returns an SQS.Queue instance
queue = sqs.create_queue(QueueName='requestQueue', Attributes={
'DelaySeconds': '0'
})
print(queue.url)
val = input("Enter your value: ")
response ... | [
"boto3.resource",
"time.sleep"
] | [((60, 81), 'boto3.resource', 'boto3.resource', (['"""sqs"""'], {}), "('sqs')\n", (74, 81), False, 'import boto3\n'), ((360, 374), 'time.sleep', 'time.sleep', (['(30)'], {}), '(30)\n', (370, 374), False, 'import time\n')] |
# data.world-py
# Copyright 2017 data.world, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the
# License.
#
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | [
"configparser.ConfigParser",
"re.compile",
"os.environ.get",
"configparser.DEFAULTSECT.lower",
"os.path.isfile",
"os.path.dirname",
"tempfile.gettempdir",
"os.path.expanduser",
"configparser.SafeConfigParser"
] | [((1373, 1403), 'os.path.expanduser', 'path.expanduser', (['"""~/.dw/cache"""'], {}), "('~/.dw/cache')\n", (1388, 1403), False, 'from os import path\n'), ((1927, 1958), 'os.environ.get', 'os.environ.get', (['"""DW_AUTH_TOKEN"""'], {}), "('DW_AUTH_TOKEN')\n", (1941, 1958), False, 'import os\n'), ((1985, 2015), 'os.envir... |
from sentence_transformers import CrossEncoder
from .dataset import HardNegativeDataset
from torch.utils.data import DataLoader
from sentence_transformers import SentenceTransformer
from transformers import AutoTokenizer
import tqdm
import os
import logging
logger = logging.getLogger(__name__)
def hard_negative_colla... | [
"logging.getLogger",
"os.listdir",
"os.path.join",
"sentence_transformers.CrossEncoder",
"transformers.AutoTokenizer.from_pretrained",
"torch.utils.data.DataLoader",
"tqdm.trange"
] | [((267, 294), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (284, 294), False, 'import logging\n'), ((777, 829), 'os.path.join', 'os.path.join', (['generated_path', '"""hard-negatives.jsonl"""'], {}), "(generated_path, 'hard-negatives.jsonl')\n", (789, 829), False, 'import os\n'), ((859,... |
#!/usr/bin/env python
from __future__ import absolute_import
import json
import signal
import socket
import ssl
import time
import SOAPpy
from appscale.tools.appscale_logger import AppScaleLogger
from appscale.tools.custom_exceptions import (
AppControllerException, BadSecretException, TimeoutException)
class A... | [
"signal.signal",
"json.loads",
"appscale.tools.appscale_logger.AppScaleLogger.log",
"appscale.tools.custom_exceptions.BadSecretException",
"json.dumps",
"time.sleep",
"signal.alarm",
"SOAPpy.SOAPProxy",
"appscale.tools.custom_exceptions.TimeoutException",
"appscale.tools.custom_exceptions.AppContr... | [((1984, 2037), 'SOAPpy.SOAPProxy', 'SOAPpy.SOAPProxy', (["('https://%s:%s' % (host, self.PORT))"], {}), "('https://%s:%s' % (host, self.PORT))\n", (2000, 2037), False, 'import SOAPpy\n'), ((3320, 3366), 'signal.signal', 'signal.signal', (['signal.SIGALRM', 'timeout_handler'], {}), '(signal.SIGALRM, timeout_handler)\n'... |
import os
import shutil
from typing import (Callable,
Tuple)
import pytest
from hypothesis import given
from rsrc.models import Base
from rsrc_local.models import (Directory,
File)
from tests import strategies
from tests.utils import (implication,
... | [
"tests.utils.touch",
"pytest.raises",
"os.mkdir",
"shutil.rmtree",
"hypothesis.given"
] | [((336, 368), 'hypothesis.given', 'given', (['strategies.existent_files'], {}), '(strategies.existent_files)\n', (341, 368), False, 'from hypothesis import given\n'), ((441, 477), 'hypothesis.given', 'given', (['strategies.non_existent_files'], {}), '(strategies.non_existent_files)\n', (446, 477), False, 'from hypothes... |
from dataclasses import dataclass, field
from typing import List, Optional
from bindings.csw.actuate_type import ActuateType
from bindings.csw.show_type import ShowType
from bindings.csw.symbol_type_enumeration import SymbolTypeEnumeration
from bindings.csw.type_type import TypeType
__NAMESPACE__ = "http://www.opengis... | [
"dataclasses.field"
] | [((494, 579), 'dataclasses.field', 'field', ([], {'default_factory': 'list', 'metadata': "{'type': 'Wildcard', 'namespace': '##any'}"}), "(default_factory=list, metadata={'type': 'Wildcard', 'namespace': '##any'}\n )\n", (499, 579), False, 'from dataclasses import dataclass, field\n'), ((684, 779), 'dataclasses.fiel... |
from uuid import UUID
from fbsrankings.command import CalculateRankingsForSeasonCommand
from fbsrankings.common import EventBus
from fbsrankings.domain import ColleyMatrixRankingService
from fbsrankings.domain import GameStrengthRankingService
from fbsrankings.domain import SeasonData
from fbsrankings.domain import Se... | [
"fbsrankings.domain.SimultaneousWinsRankingService",
"fbsrankings.domain.TeamRecordService",
"fbsrankings.infrastructure.UnitOfWork",
"fbsrankings.domain.SeasonID",
"fbsrankings.domain.SRSRankingService",
"fbsrankings.domain.SeasonData",
"fbsrankings.domain.StrengthOfScheduleRankingService",
"fbsranki... | [((961, 1007), 'fbsrankings.infrastructure.UnitOfWork', 'UnitOfWork', (['self._data_source', 'self._event_bus'], {}), '(self._data_source, self._event_bus)\n', (971, 1007), False, 'from fbsrankings.infrastructure import UnitOfWork\n'), ((1736, 1782), 'fbsrankings.domain.SeasonData', 'SeasonData', (['season', 'teams', '... |
from django.urls import path, include, re_path
from . import views
app_name = 'accounts'
urlpatterns = [
re_path(r'^reachus', views.reachus, name='reachus'),
re_path(r'^login', views.login, name='login'),
re_path(r'^signup', views.signup, name='signup'),
re_path(r'^campus_signup', views.campus_signup, ... | [
"django.urls.re_path",
"django.urls.path"
] | [((110, 160), 'django.urls.re_path', 're_path', (['"""^reachus"""', 'views.reachus'], {'name': '"""reachus"""'}), "('^reachus', views.reachus, name='reachus')\n", (117, 160), False, 'from django.urls import path, include, re_path\n'), ((167, 211), 'django.urls.re_path', 're_path', (['"""^login"""', 'views.login'], {'na... |
#! /usr/bin/env python3
# Copyright(c) 2019 Intel Corporation.
# License: MIT See LICENSE file in root directory.
from argparse import ArgumentParser, SUPPRESS
from openvino.inference_engine import IENetwork, IEPlugin, IECore
import cv2
import logging as log
import numpy as np
import os
import sys
import time
# Spec... | [
"logging.basicConfig",
"cv2.rectangle",
"openvino.inference_engine.IEPlugin",
"cv2.flip",
"argparse.ArgumentParser",
"os.path.splitext",
"logging.info",
"numpy.argmax",
"os.getcwd",
"cv2.putText",
"cv2.imshow",
"cv2.waitKey",
"cv2.destroyAllWindows",
"cv2.VideoCapture",
"time.time",
"c... | [((529, 559), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'add_help': '(False)'}), '(add_help=False)\n', (543, 559), False, 'from argparse import ArgumentParser, SUPPRESS\n'), ((1437, 1531), 'logging.basicConfig', 'log.basicConfig', ([], {'format': '"""[ %(levelname)s ] %(message)s"""', 'level': 'log.INFO', 'str... |
"""
twitch user id type change
"""
from yoyo import step
__depends__ = {'20190126_02_Fnsd3-drop-twitch-chatlog-insert-trigger'}
steps = [
step('''
ALTER TABLE `twitch_badges`
CHANGE COLUMN `channel_id` `channel_id` VARCHAR(36) NOT NULL ,
CHANGE COLUMN `user_id` `user_id` VARCHAR(36) NOT NULL ;
'... | [
"yoyo.step"
] | [((145, 333), 'yoyo.step', 'step', (['"""\n ALTER TABLE `twitch_badges` \n CHANGE COLUMN `channel_id` `channel_id` VARCHAR(36) NOT NULL ,\n CHANGE COLUMN `user_id` `user_id` VARCHAR(36) NOT NULL ;\n """'], {}), '(\n """\n ALTER TABLE `twitch_badges` \n CHANGE COLUMN `channel_id` `channel_id` VARCHA... |
import os
import time
from argparse import ArgumentParser
def bulid_Parser():
'''
Parse the command line argument
'''
parser = ArgumentParser()
parser.add_argument('-file','--file',required=True,type=str,help='Enter the file name to be deleted, case sensitive')
parser.add_argument('-folder','--... | [
"argparse.ArgumentParser",
"os.path.join",
"time.time",
"os.walk",
"os.remove"
] | [((144, 160), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (158, 160), False, 'from argparse import ArgumentParser\n'), ((622, 642), 'os.walk', 'os.walk', (['args.folder'], {}), '(args.folder)\n', (629, 642), False, 'import os\n'), ((1004, 1015), 'time.time', 'time.time', ([], {}), '()\n', (1013, 1015... |
from vistrails.core.modules.utils import make_modules_dict
try:
# read_numpy requires numpy
import numpy
except ImportError: # pragma: no cover
numpy_modules = []
else:
from read_numpy import _modules as numpy_modules
from read_csv import _modules as csv_modules
from read_excel import _modules as exce... | [
"vistrails.core.modules.utils.make_modules_dict"
] | [((389, 485), 'vistrails.core.modules.utils.make_modules_dict', 'make_modules_dict', (['numpy_modules', 'csv_modules', 'excel_modules', 'json_modules'], {'namespace': '"""read"""'}), "(numpy_modules, csv_modules, excel_modules, json_modules,\n namespace='read')\n", (406, 485), False, 'from vistrails.core.modules.uti... |
import sys, json, copy
def main():
result = json.load(sys.stdin)
print(json.dumps(result))
return 0
def printErrorAsJson(errormessage):
print(json.dumps({"Error":errormessage}))
if __name__ == '__main__':
sys.exit(main())
| [
"json.load",
"json.dumps"
] | [((49, 69), 'json.load', 'json.load', (['sys.stdin'], {}), '(sys.stdin)\n', (58, 69), False, 'import sys, json, copy\n'), ((80, 98), 'json.dumps', 'json.dumps', (['result'], {}), '(result)\n', (90, 98), False, 'import sys, json, copy\n'), ((168, 203), 'json.dumps', 'json.dumps', (["{'Error': errormessage}"], {}), "({'E... |
# Generated by Django 3.0 on 2020-09-15 07:24
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Comment',
fields=[
... | [
"django.db.models.ForeignKey",
"django.db.models.ImageField",
"django.db.models.AutoField",
"django.db.models.DateTimeField",
"django.db.models.CharField"
] | [((334, 427), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (350, 427), False, 'from django.db import migrations, models\... |
import torch
import torch.nn as nn
from torch.nn.modules.conv import _ConvNd
multiply_adds = 1
def count_conv2d(input, output, kernel_size, bias=None):
batch_size = input.size()[0]
out_h = output.size(2)
out_w = output.size(3)
cout = output.size()[1]
cin = input.size()[1]
kernel_ops = multip... | [
"torch.tensor"
] | [((1154, 1202), 'torch.tensor', 'torch.tensor', (['[kernel_size]'], {'device': 'input.device'}), '([kernel_size], device=input.device)\n', (1166, 1202), False, 'import torch\n')] |
import json
import os
import logging
import click
from .Client import Client
logging.basicConfig(format="{%(asctime)s} (%(name)s) [%(levelname)s]: %(message)s",
datefmt="%x, %X",
level=logging.INFO)
@click.group(invoke_without_command=True)
@click.option("--port", default=80... | [
"logging.basicConfig",
"click.group",
"click.option",
"os.path.isfile",
"json.load",
"os.path.expanduser"
] | [((80, 211), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""{%(asctime)s} (%(name)s) [%(levelname)s]: %(message)s"""', 'datefmt': '"""%x, %X"""', 'level': 'logging.INFO'}), "(format=\n '{%(asctime)s} (%(name)s) [%(levelname)s]: %(message)s', datefmt=\n '%x, %X', level=logging.INFO)\n", (99, 211... |
# 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, software
# d... | [
"mock.Mock",
"rally.plugins.openstack.scenarios.neutron.security_groups.NeutronSecurityGroup",
"ddt.data"
] | [((755, 877), 'ddt.data', 'ddt.data', (['{}', "{'security_group_create_args': {}}", "{'security_group_create_args': {'description': 'fake-description'}}"], {}), "({}, {'security_group_create_args': {}}, {\n 'security_group_create_args': {'description': 'fake-description'}})\n", (763, 877), False, 'import ddt\n'), ((... |
import os
from unittest import TestCase
from fake_proxy.core import api
from fake_proxy.core.exceptions import ProxyTypeError
class TestApi(TestCase):
def tearDown(self):
if 'PROXY_PATH' in os.environ:
del os.environ['PROXY_PATH']
def setUp(self):
path = 'test/sample_proxysources... | [
"fake_proxy.core.api.format_proxy_type",
"fake_proxy.core.api.proxy_sources",
"fake_proxy.core.api.reload",
"fake_proxy.core.api.get_from_source",
"fake_proxy.core.api.get"
] | [((385, 397), 'fake_proxy.core.api.reload', 'api.reload', ([], {}), '()\n', (395, 397), False, 'from fake_proxy.core import api\n'), ((513, 532), 'fake_proxy.core.api.proxy_sources', 'api.proxy_sources', ([], {}), '()\n', (530, 532), False, 'from fake_proxy.core import api\n'), ((1524, 1596), 'fake_proxy.core.api.get_f... |
# -*- coding: utf-8 -*-
# Django settings for testapp.
import os
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
DEBUG = True
ADMINS = (
# ('<NAME>', '<EMAIL>'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': '',
}
}
ALLOWED_HOSTS = ... | [
"os.path.abspath",
"os.path.join"
] | [((455, 486), 'os.path.join', 'os.path.join', (['BASE_DIR', '"""media"""'], {}), "(BASE_DIR, 'media')\n", (467, 486), False, 'import os\n'), ((525, 557), 'os.path.join', 'os.path.join', (['BASE_DIR', '"""static"""'], {}), "(BASE_DIR, 'static')\n", (537, 557), False, 'import os\n'), ((93, 118), 'os.path.abspath', 'os.pa... |
"""
dealing with sampling things
"""
import os
import sys
import copy
import random
import numpy as np
import global_settings
import update_settings as us
import job_drivers
def get_uniform_uncertainties(n_size=3, value=3.0, exclude=None):
"""
return uniform uncertainties
"""
result = np.ones(n_size)... | [
"random.uniform",
"numpy.ones",
"global_settings.get_s_a_setting",
"os.path.join",
"update_settings.update_s_a_setting",
"os.path.isfile",
"os.path.realpath",
"job_drivers.make_run_timeout",
"numpy.savetxt",
"copy.deepcopy",
"numpy.loadtxt",
"os.remove"
] | [((305, 320), 'numpy.ones', 'np.ones', (['n_size'], {}), '(n_size)\n', (312, 320), True, 'import numpy as np\n'), ((891, 906), 'numpy.ones', 'np.ones', (['n_size'], {}), '(n_size)\n', (898, 906), True, 'import numpy as np\n'), ((1204, 1245), 'global_settings.get_s_a_setting', 'global_settings.get_s_a_setting', (['data_... |
#!/usr/bin/env python
from sqlalchemy import engine_from_config
from pyramid.config import Configurator
from chatter4.models import DBSession
from chatter4.views import socketio_service
from chatter4.views import index
from chatter4.views import get_log
def simple_route(config, name, url, fn, renderer=None):
if... | [
"pyramid.config.Configurator",
"sqlalchemy.engine_from_config",
"chatter4.models.DBSession.configure"
] | [((535, 549), 'pyramid.config.Configurator', 'Configurator', ([], {}), '()\n', (547, 549), False, 'from pyramid.config import Configurator\n'), ((564, 607), 'sqlalchemy.engine_from_config', 'engine_from_config', (['settings', '"""sqlalchemy."""'], {}), "(settings, 'sqlalchemy.')\n", (582, 607), False, 'from sqlalchemy ... |
import sys
import yaml
import pandas as pd
from attacut import utils
OUTPUT = "./writing/tables/hyperopt-results-{algo}.tex"
ROW_TEMPLATE = r"""
{algo} & {seq_level} & {ch_feat} & {sy_feat} & {output_tag} & {test_score} & {avg_score} \\
"""
highlight = [
"ID-CNN-CRF(SY)-SchemeA",
"ID-CNN(CH+SY)-BI",
"Bi... | [
"yaml.safe_load",
"pandas.read_csv"
] | [((1383, 1401), 'yaml.safe_load', 'yaml.safe_load', (['fh'], {}), '(fh)\n', (1397, 1401), False, 'import yaml\n'), ((1611, 1641), 'pandas.read_csv', 'pd.read_csv', (["data[key]['path']"], {}), "(data[key]['path'])\n", (1622, 1641), True, 'import pandas as pd\n')] |
import copy
import time
from collections import defaultdict, namedtuple
import kaa
from . import keybind, theme, modebase, menu
class DefaultMode(modebase.ModeBase):
DOCUMENT_MODE = True
MODENAME = 'default'
SHOW_LINENO = False
SHOW_BLANK_LINE = True
VI_COMMAND_MODE = False
KEY_BINDS = [
... | [
"collections.namedtuple",
"kaa.app.macro.is_recording",
"kaa.app.mainframe.is_idle",
"kaa.app.macro.record",
"collections.defaultdict",
"kaa.app.file_commands.notify_fileupdated",
"kaa.app.messagebar.set_message",
"copy.deepcopy",
"time.time"
] | [((5466, 5553), 'collections.namedtuple', 'namedtuple', (['"""_headerinfo"""', "['token', 'parent', 'name', 'dispname', 'lineno', 'pos']"], {}), "('_headerinfo', ['token', 'parent', 'name', 'dispname', 'lineno',\n 'pos'])\n", (5476, 5553), False, 'from collections import defaultdict, namedtuple\n'), ((1286, 1311), '... |
#! /usr/bin/env python
###############################################################################
# tf_agents_C51.py
#
# Training script of a Categorial DQN agent. It is patterned after the examples in the
# tf-agents library.
#
# It does include callbacks that are compatible with viewing training progress on
#... | [
"tf_agents.environments.tf_py_environment.TFPyEnvironment",
"tf_agents.eval.metric_utils.MetricsGroup",
"tf_agents.eval.metric_utils.log_metrics",
"tensorflow.compat.v1.train.AdamOptimizer",
"tensorflow.compat.v1.enable_v2_behavior",
"tf_agents.eval.metric_utils.eager_compute",
"logging.info",
"tf_age... | [((2007, 2040), 'tensorflow.compat.v1.enable_v2_behavior', 'tf.compat.v1.enable_v2_behavior', ([], {}), '()\n', (2038, 2040), True, 'import tensorflow as tf\n'), ((4091, 4122), 'os.path.join', 'os.path.join', (['root_dir', '"""train"""'], {}), "(root_dir, 'train')\n", (4103, 4122), False, 'import os\n'), ((4138, 4168),... |
from datetime import datetime, timezone
from typing import List
class TwitchStream:
"""
A container class for parts of a Twitch stream.
Attributes
-----------
id: :class:`str`
The ID of the stream.
user_id: :class:`str`
The ID of the user who's streaming.
user_login: :clas... | [
"datetime.datetime.fromisoformat"
] | [((1792, 1839), 'datetime.datetime.fromisoformat', 'datetime.fromisoformat', (["data['started_at'][:-1]"], {}), "(data['started_at'][:-1])\n", (1814, 1839), False, 'from datetime import datetime, timezone\n')] |
# -*- coding: utf-8 -*-
"""
Functions to evaluate a trained model
Note: The file was more or less taken from Spotlight
"""
import numpy as np
import scipy.stats as st
FLOAT_MAX = np.finfo(np.float32).max
def mrr_score(model, test, train=None):
"""
Compute mean reciprocal rank (MRR) scores. One score
... | [
"numpy.clip",
"numpy.isscalar",
"scipy.stats.rankdata",
"numpy.random.choice",
"numpy.array",
"numpy.random.seed",
"numpy.finfo"
] | [((184, 204), 'numpy.finfo', 'np.finfo', (['np.float32'], {}), '(np.float32)\n', (192, 204), True, 'import numpy as np\n'), ((1428, 1442), 'numpy.array', 'np.array', (['mrrs'], {}), '(mrrs)\n', (1436, 1442), True, 'import numpy as np\n'), ((2846, 2860), 'numpy.isscalar', 'np.isscalar', (['k'], {}), '(k)\n', (2857, 2860... |
import pytest
from django.core.exceptions import ValidationError
from users.models import Profile
from users.tests.factories import ProfileFactory
@pytest.mark.django_db
def test_profile_exist_after_user_is_deleted():
profile = ProfileFactory()
profile.user.delete()
assert Profile.objects.all().count()... | [
"users.models.Profile.objects.first",
"users.models.Profile.objects.all",
"users.tests.factories.ProfileFactory",
"pytest.raises"
] | [((235, 251), 'users.tests.factories.ProfileFactory', 'ProfileFactory', ([], {}), '()\n', (249, 251), False, 'from users.tests.factories import ProfileFactory\n'), ((475, 491), 'users.tests.factories.ProfileFactory', 'ProfileFactory', ([], {}), '()\n', (489, 491), False, 'from users.tests.factories import ProfileFactor... |
"""
Contains unit tests for the functions in the package.
Author: <NAME>
Year: 2021
"""
import time
import numpy as np
import pandas as pd
from .classifier_comparisons import _rank_single_dataset
# -----------------------------------------
# Main function
# -----------------------------------------
def main(... | [
"numpy.array"
] | [((755, 791), 'numpy.array', 'np.array', (['[0.3, 0.1, 0.04, 0.6, 1.0]'], {}), '([0.3, 0.1, 0.04, 0.6, 1.0])\n', (763, 791), True, 'import numpy as np\n'), ((807, 832), 'numpy.array', 'np.array', (['[3, 2, 1, 4, 5]'], {}), '([3, 2, 1, 4, 5])\n', (815, 832), True, 'import numpy as np\n'), ((939, 974), 'numpy.array', 'np... |
import os
import discord
import dotenv
dotenv.load_dotenv()
client = discord.AutoShardedClient(
intents=discord.Intents(guilds=True, guild_messages=True),
member_cache_flags=discord.MemberCacheFlags.none(),
max_messages=0,
activity=discord.Activity(type=discord.ActivityType.watching, name="announceme... | [
"os.getenv",
"discord.Intents",
"discord.MemberCacheFlags.none",
"dotenv.load_dotenv",
"discord.Activity",
"discord.Embed"
] | [((41, 61), 'dotenv.load_dotenv', 'dotenv.load_dotenv', ([], {}), '()\n', (59, 61), False, 'import dotenv\n'), ((111, 160), 'discord.Intents', 'discord.Intents', ([], {'guilds': '(True)', 'guild_messages': '(True)'}), '(guilds=True, guild_messages=True)\n', (126, 160), False, 'import discord\n'), ((185, 216), 'discord.... |
# Generated by Django 3.0.8 on 2020-07-20 21:09
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('neighbourhoodApp', '0007_amenity_business_neighbourhood_post'),
]
operations = [
migrations.RemoveField(
model_name='amenity',
... | [
"django.db.migrations.DeleteModel",
"django.db.migrations.RemoveField"
] | [((253, 319), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""amenity"""', 'name': '"""neighbourhood"""'}), "(model_name='amenity', name='neighbourhood')\n", (275, 319), False, 'from django.db import migrations\n'), ((364, 431), 'django.db.migrations.RemoveField', 'migrations.Remov... |
# Copyright 2018 PayTrace, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | [
"pyasn1.type.univ.SequenceOf"
] | [((1919, 1936), 'pyasn1.type.univ.SequenceOf', 'univ.SequenceOf', ([], {}), '()\n', (1934, 1936), False, 'from pyasn1.type import univ\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Sep 30 19:29:51 2018
@author: pi
"""
import logging
from radiostate import RadioState
from wifiscanner import WifiScanner
from radioevents import StationButtonEvent, PowerButtonEvent
from encoder import EncoderEvent
from powerbutton import PowerEvent
... | [
"radiostate.RadioState.__init__",
"wifiscanner.WifiScanner"
] | [((431, 472), 'radiostate.RadioState.__init__', 'RadioState.__init__', (['self', 'context', 'owner'], {}), '(self, context, owner)\n', (450, 472), False, 'from radiostate import RadioState\n'), ((1278, 1291), 'wifiscanner.WifiScanner', 'WifiScanner', ([], {}), '()\n', (1289, 1291), False, 'from wifiscanner import WifiS... |
import requests
import csv
REPO = 'UUDigitalHumanitieslab/texcavator'
with open('issues.csv', 'wb') as f:
writer = csv.writer(f, dialect='excel', delimiter=';')
writer.writerow(['number', 'issue', 'state', 'labels', 'url'])
p = {'state': 'all', 'sort': 'created', 'direction': 'asc', 'per_page': 100}
... | [
"csv.writer"
] | [((121, 166), 'csv.writer', 'csv.writer', (['f'], {'dialect': '"""excel"""', 'delimiter': '""";"""'}), "(f, dialect='excel', delimiter=';')\n", (131, 166), False, 'import csv\n')] |
# -*- coding: utf-8 -*-
from inspect import (
getmembers,
ismethod
)
class TInterface(object):
_dict_attrs = ()
def to_dict(self, limit=None):
m = getmembers(self, lambda x: not ismethod(x))
m = [i for i in m if not i[0].startswith('_')]
if limit:
m = [i for i i... | [
"inspect.ismethod"
] | [((208, 219), 'inspect.ismethod', 'ismethod', (['x'], {}), '(x)\n', (216, 219), False, 'from inspect import getmembers, ismethod\n')] |
import pytest
from rst2json.writers import get_json_writer_class, html4, html5, latex, xelatex
@pytest.mark.parametrize(
"fmt,cls",
[
("html", html4.Writer),
("HTML", html4.Writer),
("html4", html4.Writer),
("HTML4", html4.Writer),
("html5", html5.Writer),
("HTM... | [
"pytest.mark.parametrize",
"rst2json.writers.get_json_writer_class",
"pytest.raises"
] | [((98, 580), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""fmt,cls"""', "[('html', html4.Writer), ('HTML', html4.Writer), ('html4', html4.Writer), (\n 'HTML4', html4.Writer), ('html5', html5.Writer), ('HTML5', html5.Writer\n ), ('latex', latex.Writer), ('LaTeX', latex.Writer), ('LATEX', latex.\n ... |
#!/usr/local/bin/python
# coding=utf-8
import numpy as np
import matplotlib.pylab as plt
N = 10
# Generates 1D Laplace matrix using Dirichlet boundary conditions
def generate_1D(N):
L = np.zeros(shape=((N - 1), (N - 1)))
for i in range(0, N - 1): # rows
for j in range(0, N - 1): # columns
... | [
"matplotlib.pylab.subplots",
"numpy.linalg.solve",
"matplotlib.pylab.Figure",
"numpy.linspace",
"numpy.zeros",
"matplotlib.pylab.show",
"numpy.random.randn"
] | [((504, 526), 'numpy.random.randn', 'np.random.randn', (['(N - 1)'], {}), '(N - 1)\n', (519, 526), True, 'import numpy as np\n'), ((531, 552), 'numpy.linalg.solve', 'np.linalg.solve', (['L', 'b'], {}), '(L, b)\n', (546, 552), True, 'import numpy as np\n'), ((634, 662), 'numpy.linspace', 'np.linspace', (['(0.0)', '(1.0)... |
"""
Defines the blueprint for the companies
"""
from flask import Blueprint
from flask_restful import Api
from resources import CompanyResource
COMPANY_BLUEPRINT = Blueprint("company", __name__)
Api(COMPANY_BLUEPRINT).add_resource(
CompanyResource, "/company"
)
| [
"flask.Blueprint",
"flask_restful.Api"
] | [((166, 196), 'flask.Blueprint', 'Blueprint', (['"""company"""', '__name__'], {}), "('company', __name__)\n", (175, 196), False, 'from flask import Blueprint\n'), ((197, 219), 'flask_restful.Api', 'Api', (['COMPANY_BLUEPRINT'], {}), '(COMPANY_BLUEPRINT)\n', (200, 219), False, 'from flask_restful import Api\n')] |
import femagtools.machine.sm
import pathlib
import pytest
import numpy as np
@pytest.fixture
def sm():
smpars = {"m": 3, "p": 3, "r1": 0.01, "r2": 40, "rotor_mass": 9.941, "kfric_b": 1,
"ldq": [
{"ex_current": 0.6, "i1": [0.0, 82.0, 164.0, 246.0, 328.0, 410.0],
"... | [
"pytest.approx"
] | [((83456, 83485), 'pytest.approx', 'pytest.approx', (['iqdf'], {'rel': '(0.01)'}), '(iqdf, rel=0.01)\n', (83469, 83485), False, 'import pytest\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from collections import defaultdict
with open('23a_data.txt', 'r') as f:
input_data = f.read().split('\n')[:-1]
pipes = [[], []]
def set_reg(curr_inst, prog_id, regs, played, *values):
if type(values[1]) is int:
regs[values[0]] = values[1]
else:
... | [
"collections.defaultdict"
] | [((1124, 1147), 'collections.defaultdict', 'defaultdict', (['(lambda : 0)'], {}), '(lambda : 0)\n', (1135, 1147), False, 'from collections import defaultdict\n')] |
from typing import List, Dict, Any
from data_tools.wrappers.users import is_read_permitted, is_write_permitted, get_read_permitted_records, \
get_all_read_permitted_records
from data_tools.db_models import User, Sample, SampleGroup, db
from data_tools.util import AuthException, NotFoundException
def get_sample_g... | [
"data_tools.wrappers.users.get_read_permitted_records",
"data_tools.wrappers.users.is_read_permitted",
"data_tools.db_models.SampleGroup.query.filter_by",
"data_tools.db_models.db.session.add",
"data_tools.db_models.db.session.delete",
"data_tools.util.NotFoundException",
"data_tools.wrappers.users.get_... | [((518, 578), 'data_tools.wrappers.users.get_all_read_permitted_records', 'get_all_read_permitted_records', (['user', 'SampleGroup', 'filter_by'], {}), '(user, SampleGroup, filter_by)\n', (548, 578), False, 'from data_tools.wrappers.users import is_read_permitted, is_write_permitted, get_read_permitted_records, get_all... |
from typing import List, Optional, Any
import vk_api
from vk_api.longpoll import VkLongPoll, VkEventType
from threading import Timer
from datetime import datetime
import time
import typing
import re
import json
def get_all_history_gens(peer_id: int) -> typing.Generator[dict, None, None]:
offset = 0
... | [
"vk_api.VkApi",
"time.sleep",
"datetime.datetime.now",
"vk_api.longpoll.VkLongPoll"
] | [((4636, 4677), 'vk_api.VkApi', 'vk_api.VkApi', ([], {'app_id': '(6146827)', 'token': 'token'}), '(app_id=6146827, token=token)\n', (4648, 4677), False, 'import vk_api\n'), ((4716, 4738), 'vk_api.longpoll.VkLongPoll', 'VkLongPoll', (['vk'], {'wait': '(0)'}), '(vk, wait=0)\n', (4726, 4738), False, 'from vk_api.longpoll ... |
# Copyright (C) 2021 poypoyan
from setuptools import setup
from Cython.Build import cythonize
import numpy
setup(
name="edhsmm",
version="0.1.2",
description="An(other) implementation of Explicit Duration HMM/HSMM in Python 3",
long_description=open("README.md", encoding="utf-8").read(),
long_desc... | [
"numpy.get_include"
] | [((993, 1012), 'numpy.get_include', 'numpy.get_include', ([], {}), '()\n', (1010, 1012), False, 'import numpy\n')] |
"""Caller Module."""
from collections import OrderedDict
import click
from scphylo.commands.caller._1rename import rename
from scphylo.commands.caller._1sra import sra
from scphylo.commands.caller._2fastp import fastp
from scphylo.commands.caller._3bwa import bwa
from scphylo.commands.caller._3star import star
from ... | [
"collections.OrderedDict"
] | [((1629, 1642), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (1640, 1642), False, 'from collections import OrderedDict\n')] |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime, json, logging, os, pprint, random
from .models import Validator, ViewHelper
from django.conf import settings as project_settings
from django.contrib.auth import logout
from django.core.urlresolvers import reverse
from django.http import H... | [
"logging.getLogger",
"django.http.HttpResponseBadRequest",
"transformer_app.lib.info_helper.get_commit",
"django.http.HttpResponse",
"json.dumps",
"transformer_app.lib.info_helper.make_context",
"datetime.datetime.now",
"transformer_app.lib.info_helper.get_branch",
"random.SystemRandom"
] | [((485, 512), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (502, 512), False, 'import datetime, json, logging, os, pprint, random\n'), ((865, 888), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (886, 888), False, 'import datetime, json, logging, os, pprint, random\... |
"""Challenge: given a json string, which represents a list of goods
with every good is a dict with keys "name" and "price", sort it in
the following way:
- main sorting criterion is price, ASC
- if prices are equal, sort goods using their name in alphabetical order
"""
import json
def sort_by_price_ascending(json_s... | [
"json.loads",
"json.dumps"
] | [((397, 420), 'json.loads', 'json.loads', (['json_string'], {}), '(json_string)\n', (407, 420), False, 'import json\n'), ((616, 638), 'json.dumps', 'json.dumps', (['goods_list'], {}), '(goods_list)\n', (626, 638), False, 'import json\n')] |
from termcolor import colored
from colorama import init
class ConsoleLogger:
def __init__(self,parent):
self.row_number = 0
self.parent = parent
def start_message(self):
print("\x1B[2J\x1B[1;1H") #console cleared
print("Server Started....\n")
print(colored("[~] House of... | [
"termcolor.colored"
] | [((421, 478), 'termcolor.colored', 'colored', (['"""Source code: https://github.com/House-of-IoT\n"""'], {}), "('Source code: https://github.com/House-of-IoT\\n')\n", (428, 478), False, 'from termcolor import colored\n'), ((494, 597), 'termcolor.colored', 'colored', (['"""Got an issue?: https://github.com/House-of-IoT/... |
# coding: utf-8
import leancloud
from leancloud import Engine
from leancloud import LeanEngineError
from app import app
from logentries import LogentriesHandler
import logging
from qiniu import Auth
from qiniu import BucketManager
import requests
import os
import json
import time
engine = Engine(app)
log = logg... | [
"logging.getLogger",
"leancloud.LeanEngineError",
"qiniu.Auth",
"json.dumps",
"os.environ.get",
"time.strftime",
"leancloud.Engine",
"time.time",
"qiniu.BucketManager"
] | [((297, 308), 'leancloud.Engine', 'Engine', (['app'], {}), '(app)\n', (303, 308), False, 'from leancloud import Engine\n'), ((316, 347), 'logging.getLogger', 'logging.getLogger', (['"""logentries"""'], {}), "('logentries')\n", (333, 347), False, 'import logging\n'), ((457, 483), 'os.environ.get', 'os.environ.get', (['"... |
from typing import TypeVar, Iterable, Union
from linkedlist import SingleNode,ContainerIterMixin
T = TypeVar("T")
class Queue(ContainerIterMixin):
def __init__(self):
self._first = None
self._last = None
self._len = 0
def clear(self) -> None:
self._first = None
self._... | [
"linkedlist.SingleNode",
"typing.TypeVar"
] | [((102, 114), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (109, 114), False, 'from typing import TypeVar, Iterable, Union\n'), ((445, 466), 'linkedlist.SingleNode', 'SingleNode', (['val', 'None'], {}), '(val, None)\n', (455, 466), False, 'from linkedlist import SingleNode, ContainerIterMixin\n')] |
from FrameLibDocs.utils import write_json, read_yaml
from FrameLibDocs.classes import qParseAndBuild, Documentation
def main(docs):
"""
Creates a dict for the Max Documentation system.
This dict contains is essential for maxObjectLauncher/Refpages to pull the right info.
"""
object_info = read_ya... | [
"FrameLibDocs.utils.read_yaml",
"FrameLibDocs.classes.qParseAndBuild",
"FrameLibDocs.utils.write_json",
"FrameLibDocs.classes.Documentation"
] | [((313, 354), 'FrameLibDocs.utils.read_yaml', 'read_yaml', (['docs.object_relationships_path'], {}), '(docs.object_relationships_path)\n', (322, 354), False, 'from FrameLibDocs.utils import write_json, read_yaml\n'), ((481, 497), 'FrameLibDocs.classes.qParseAndBuild', 'qParseAndBuild', ([], {}), '()\n', (495, 497), Fal... |
# _ _ _ _ _ _ _ _
# /\ \ /\ \ _ / /\ /\ \ /\_\/\_\ _ _\ \ /\ \
# / \ \ \ \ \ /_/ / / / \ \ / / / / //\_\/\__ \ \ \ \
# / /\ \ \ \ \ \ \___\/ / /\ \ \ /\ \/ \ \/ / / /_ \... | [
"wget.download",
"torch.utils.data.random_split",
"torch.load",
"tqdm.tqdm",
"eve.app.space.EveBox",
"eve.app.utils.get_device",
"torchvision.transforms.RandomHorizontalFlip",
"os.path.isfile",
"torchvision.transforms.RandomCrop",
"torch.nn.functional.cross_entropy",
"torchvision.datasets.CIFAR1... | [((7464, 7476), 'torch.no_grad', 'th.no_grad', ([], {}), '()\n', (7474, 7476), True, 'import torch as th\n'), ((8364, 8376), 'torch.no_grad', 'th.no_grad', ([], {}), '()\n', (8374, 8376), True, 'import torch as th\n'), ((3630, 3648), 'eve.app.utils.get_device', 'get_device', (['device'], {}), '(device)\n', (3640, 3648)... |
import argparse
import runpy
import todoist
import logging
import logging.handlers
from datetime import datetime
import httplib2
import os
from apiclient import discovery
import oauth2client
from oauth2client import client
from oauth2client import tools
MY_LOCATION = os.path.dirname(os.path.realpath(__file__))
LOG_F... | [
"logging.getLogger",
"os.path.exists",
"logging.StreamHandler",
"argparse.ArgumentParser",
"os.makedirs",
"logging.Formatter",
"logging.handlers.RotatingFileHandler",
"os.path.join",
"oauth2client.client.flow_from_clientsecrets",
"os.path.realpath",
"oauth2client.file.Storage",
"httplib2.Http"... | [((330, 376), 'os.path.join', 'os.path.join', (['MY_LOCATION', '"""todoist.gmail.log"""'], {}), "(MY_LOCATION, 'todoist.gmail.log')\n", (342, 376), False, 'import os\n'), ((651, 678), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (668, 678), False, 'import logging\n'), ((732, 805), 'logg... |
# -*- coding: utf-8 -*-
############################################################################
# Copyright 2020 cloudnative.to open source team , @stevensu1977
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may... | [
"hmac.new",
"flask.request.get_json",
"collections.defaultdict",
"flask.request.headers.get",
"flask.jsonify"
] | [((1627, 1684), 'hmac.new', 'hmac.new', (['github_secret'], {'msg': 'data', 'digestmod': 'hashlib.sha1'}), '(github_secret, msg=data, digestmod=hashlib.sha1)\n', (1635, 1684), False, 'import hmac\n'), ((2602, 2640), 'flask.request.headers.get', 'request.headers.get', (['"""X-Hub-Signature"""'], {}), "('X-Hub-Signature'... |
#MenuTitle: Transform Images with Proper Maths...
# -*- coding: utf-8 -*-
from __future__ import print_function, division, unicode_literals
__doc__="""
(GUI) Batch scale and move images in selected layers, using the maths you learned at school. Based on mekkablue's Transform Images script.
"""
import vanilla
import Gl... | [
"vanilla.FloatingWindow",
"vanilla.TextBox",
"vanilla.EditText",
"vanilla.CheckBox",
"vanilla.Button"
] | [((542, 707), 'vanilla.FloatingWindow', 'vanilla.FloatingWindow', (['(windowWidth, windowHeight)', '"""Transform Images with Proper Maths"""'], {'autosaveName': '"""com.Tosche.TransformImagesWithRealMaths.mainwindow"""'}), "((windowWidth, windowHeight),\n 'Transform Images with Proper Maths', autosaveName=\n 'com... |
from django.contrib.auth import get_user_model
from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin
from django.urls import reverse
from django.views.generic import DetailView, RedirectView
from django.contrib import messages
from django.http import Http404
from django.contrib.auth import logo... | [
"django.contrib.auth.logout",
"django.contrib.auth.get_user_model",
"github.Github",
"django.urls.reverse",
"django.utils.timezone.now",
"django.contrib.messages.add_message",
"django.http.Http404"
] | [((397, 413), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (411, 413), False, 'from django.contrib.auth import get_user_model\n'), ((1267, 1293), 'github.Github', 'Github', (['github_token.token'], {}), '(github_token.token)\n', (1273, 1293), False, 'from github import Github\n'), ((1867, 1... |
# -*- coding: utf-8 -*-
# Copyright 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | [
"solar.core.log.log.debug",
"os.path.join"
] | [((949, 990), 'solar.core.log.log.debug', 'log.debug', (['"""action_file: %s"""', 'action_file'], {}), "('action_file: %s', action_file)\n", (958, 990), False, 'from solar.core.log import log\n'), ((1019, 1070), 'os.path.join', 'os.path.join', (['self.dirs[resource.name]', 'action_file'], {}), '(self.dirs[resource.name... |
import click
from paukenator import __version__
from paukenator import Config, Lesson, Text, Selector
from paukenator.exercises import HiddenWord
from paukenator import nlp
EPILOGUE = f"""\b
version: {__version__}
Have fun and keep learning!
"""
class SelectorSpec(click.ParamType):
'''Validate value of --selec... | [
"paukenator.Selector",
"paukenator.Lesson",
"click.group",
"click.option",
"paukenator.nlp.ParagraphAnnotator",
"paukenator.nlp.TokenAnnotator",
"click.echo",
"paukenator.Text.load_from_file",
"paukenator.nlp.Text.load_from_file",
"click.Path",
"paukenator.nlp.SentenceAnnotator",
"paukenator.C... | [((1692, 1749), 'click.group', 'click.group', ([], {'invoke_without_command': '(True)', 'epilog': 'EPILOGUE'}), '(invoke_without_command=True, epilog=EPILOGUE)\n', (1703, 1749), False, 'import click\n'), ((1751, 1827), 'click.option', 'click.option', (['"""--version"""', '"""-v"""'], {'is_flag': '(True)', 'help': '"""S... |
import json
import numpy as np
from mian.core.constants import SAMPLE_METADATA_FILENAME
from mian.analysis.correlations_selection import CorrelationsSelection
from mian.model.metadata import Metadata
from mian.model.taxonomy import Taxonomy
from tests.analysis.analysis_test_utils import AnalysisTestUtils
import unitt... | [
"tests.analysis.analysis_test_utils.AnalysisTestUtils.compare_two_objects",
"tests.analysis.analysis_test_utils.AnalysisTestUtils.get_expected_output",
"mian.model.taxonomy.Taxonomy",
"json.dumps",
"tests.analysis.analysis_test_utils.AnalysisTestUtils.get_test_input_as_table",
"tests.analysis.analysis_tes... | [((2463, 2478), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2476, 2478), False, 'import unittest\n'), ((446, 493), 'tests.analysis.analysis_test_utils.AnalysisTestUtils.create_default_user_request', 'AnalysisTestUtils.create_default_user_request', ([], {}), '()\n', (491, 493), False, 'from tests.analysis.analy... |
from jinja2 import Environment, FileSystemLoader
from werkzeug.wrappers import Response
class TemplateRenderer(object):
def __init__(self, template_dir,
asset_handler=None, context_processors=None):
self.jinja_env = Environment(
loader=FileSystemLoader(template_dir),
... | [
"jinja2.FileSystemLoader"
] | [((279, 309), 'jinja2.FileSystemLoader', 'FileSystemLoader', (['template_dir'], {}), '(template_dir)\n', (295, 309), False, 'from jinja2 import Environment, FileSystemLoader\n')] |
import pandas as pd
import json
from functions import typeOfJson
def zones_upload(es, path, name):
with open(path, "r") as f:
data = json.load(f)
data = data["features"]
category = typeOfJson(name, data[0]["properties"])
if category == "corine":
return corine_upload(es, data, name)
else:
return adm... | [
"json.load",
"functions.typeOfJson"
] | [((139, 151), 'json.load', 'json.load', (['f'], {}), '(f)\n', (148, 151), False, 'import json\n'), ((192, 231), 'functions.typeOfJson', 'typeOfJson', (['name', "data[0]['properties']"], {}), "(name, data[0]['properties'])\n", (202, 231), False, 'from functions import typeOfJson\n')] |
# Generated by Django 2.2.18 on 2021-04-07 20:09
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.utils.timezone
import librarian.models
import re
class Migration(migrations.Migration):
replaces = [('librarian', '0101_squashed'), ('librarian',... | [
"django.db.models.TextField",
"django.db.models.ForeignKey",
"re.compile",
"django.db.models.ManyToManyField",
"django.db.models.FileField",
"django.db.models.BooleanField",
"django.db.models.AutoField",
"django.db.models.BigIntegerField",
"django.db.models.DateTimeField",
"django.db.migrations.sw... | [((1118, 1175), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (1149, 1175), False, 'from django.db import migrations, models\n'), ((3809, 4048), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'blank': '(True... |
# Copyright 2022 The Sigstore Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | [
"requests.get"
] | [((983, 1012), 'requests.get', 'requests.get', (['oidc_config_url'], {}), '(oidc_config_url)\n', (995, 1012), False, 'import requests\n')] |
from robot import Robot
import time
__author__ = 'stefan'
robot = Robot("ESP_116285")
i = 0
while True:
for s in range(-101, 101, 1):
print("%04d drive %+04d, %+04d\t%s" % (i, s, s, robot.drive(s, s)))
i += 1
| [
"robot.Robot"
] | [((68, 87), 'robot.Robot', 'Robot', (['"""ESP_116285"""'], {}), "('ESP_116285')\n", (73, 87), False, 'from robot import Robot\n')] |
import argparse
# Setup Parser and args
parser = argparse.ArgumentParser()
# Add positional Arg
parser.add_argument("square", type=int, help="Number which is to be squared")
# Optional Arg
parser.add_argument("-v", "--verbosity", help="Increase verbosity of output")
# Required Arg
parser.add_argument("-a", "--acc... | [
"argparse.ArgumentParser"
] | [((52, 77), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (75, 77), False, 'import argparse\n')] |
import pytest
from atomphys import Atom
@pytest.fixture(scope="module")
def rubidium():
return Atom("Rb")
| [
"pytest.fixture",
"atomphys.Atom"
] | [((44, 74), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (58, 74), False, 'import pytest\n'), ((102, 112), 'atomphys.Atom', 'Atom', (['"""Rb"""'], {}), "('Rb')\n", (106, 112), False, 'from atomphys import Atom\n')] |
from typing import Dict
import torch
from torch import nn as nn
from dirty.utils import util
from dirty.utils.vocab import Vocab
class SimpleDecoder(nn.Module):
def __init__(self, config):
super(SimpleDecoder, self).__init__()
self.vocab = vocab = Vocab.load(config["vocab_file"])
self.o... | [
"dirty.utils.vocab.Vocab.load"
] | [((273, 305), 'dirty.utils.vocab.Vocab.load', 'Vocab.load', (["config['vocab_file']"], {}), "(config['vocab_file'])\n", (283, 305), False, 'from dirty.utils.vocab import Vocab\n')] |
from nengo.utils.compat import pickle
from python_util.gpumodel import IGPUModel
def plain_pickle(loadfile, savefile):
load_dic = IGPUModel.load_checkpoint(loadfile)
options = {}
for o in load_dic['op'].get_options_list():
options[o.name] = o.value
load_dic['op'] = options
with open(sav... | [
"python_util.gpumodel.IGPUModel.load_checkpoint",
"nengo.utils.compat.pickle.dump",
"argparse.ArgumentParser"
] | [((137, 172), 'python_util.gpumodel.IGPUModel.load_checkpoint', 'IGPUModel.load_checkpoint', (['loadfile'], {}), '(loadfile)\n', (162, 172), False, 'from python_util.gpumodel import IGPUModel\n'), ((480, 558), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Convert checkpoint to plain pic... |
# coding: utf-8
from __future__ import (
absolute_import,
print_function,
unicode_literals,
)
import base64
from pydocx.constants import EMUS_PER_PIXEL
from pydocx.openxml.packaging import ImagePart, MainDocumentPart
from pydocx.test import DocumentGeneratorTestCase
from pydocx.test.utils import Wordproc... | [
"pydocx.test.utils.WordprocessingDocumentFactory"
] | [((1666, 1697), 'pydocx.test.utils.WordprocessingDocumentFactory', 'WordprocessingDocumentFactory', ([], {}), '()\n', (1695, 1697), False, 'from pydocx.test.utils import WordprocessingDocumentFactory\n'), ((3660, 3691), 'pydocx.test.utils.WordprocessingDocumentFactory', 'WordprocessingDocumentFactory', ([], {}), '()\n'... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import shorturl
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
os.system('python setup.py bdist_wheel upload')
sys.ex... | [
"os.system",
"sys.exit",
"distutils.core.setup"
] | [((362, 1041), 'distutils.core.setup', 'setup', ([], {'name': '"""django-shorturl"""', 'packages': "['shorturl']", 'version': '"""0.1.0"""', 'description': '"""A django short URL app."""', 'long_description': 'readme', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'url': '"""https://github.com/lefterisnik/... |
from __future__ import annotations
from dataclasses import dataclass
from typing import Sequence, Tuple, Optional, List, Dict, Any, Iterable
import logging
from pathlib import Path
import os
from concurrent.futures import ThreadPoolExecutor
from requests import HTTPError
from catpy.applications import CatmaidClientApp... | [
"logging.getLogger",
"pandas.UInt64Dtype",
"pathlib.Path",
"concurrent.futures.ThreadPoolExecutor",
"numpy.array",
"pandas.concat",
"catpy.applications.morphology.lol_to_df"
] | [((482, 509), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (499, 509), False, 'import logging\n'), ((1269, 1453), 'catpy.applications.morphology.lol_to_df', 'lol_to_df', (['response', "['connector_id', 'x', 'y', 'z', 'confidence', 'edit_time', 'user_id']", '[np.uint64, np.float64, np.fl... |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI 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 ... | [
"collections.deque",
"aea.configurations.base.PublicId.from_str",
"json.dumps",
"asyncio.wait",
"asyncio.Event",
"yoti_python_sdk.Client",
"asyncio.get_event_loop",
"typing.cast",
"aea.mail.base.Envelope"
] | [((1694, 1733), 'aea.configurations.base.PublicId.from_str', 'PublicId.from_str', (['"""fetchai/yoti:0.1.0"""'], {}), "('fetchai/yoti:0.1.0')\n", (1711, 1733), False, 'from aea.configurations.base import PublicId\n'), ((8498, 8537), 'aea.configurations.base.PublicId.from_str', 'PublicId.from_str', (['"""fetchai/yoti:0.... |
"""
Acceleration with Vectors
by <NAME>.
Demonstration of the basics of motion with vector.
A "Mover" object stores location, velocity, and acceleration as vectors The
motion is controlled by affecting the acceleration (in this case towards the
mouse)
For more examples of simulating motion and physics with vectors, se... | [
"mover.Mover"
] | [((476, 483), 'mover.Mover', 'Mover', ([], {}), '()\n', (481, 483), False, 'from mover import Mover\n')] |
# Generated by Django 3.2.5 on 2021-07-29 07:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('deals', '0002_auto_20210728_1353'),
]
operations = [
migrations.AlterField(
model_name='deal',
name='normalPrice',
... | [
"django.db.models.FloatField"
] | [((337, 365), 'django.db.models.FloatField', 'models.FloatField', ([], {'null': '(True)'}), '(null=True)\n', (354, 365), False, 'from django.db import migrations, models\n'), ((488, 516), 'django.db.models.FloatField', 'models.FloatField', ([], {'null': '(True)'}), '(null=True)\n', (505, 516), False, 'from django.db im... |
'''
copied from https://github.com/sigsep/sigsep-mus-2018-analysis/blob/master/aggregate.py
'''
from pathlib import Path
import pandas as pd
import json
import argparse
def museval2df(json_path):
with open(json_path) as json_file:
json_string = json.loads(json_file.read())
df = pd.json_normalize(
... | [
"pandas.json_normalize",
"argparse.ArgumentParser",
"pathlib.Path",
"pandas.melt",
"pandas.concat"
] | [((1141, 1175), 'pandas.concat', 'pd.concat', (['data'], {'ignore_index': '(True)'}), '(data, ignore_index=True)\n', (1150, 1175), True, 'import pandas as pd\n'), ((1298, 1353), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Aggregate Folder"""'}), "(description='Aggregate Folder')\n", (... |
"""empty message
Revision ID: 10243a168c8c
Revises: 4<PASSWORD>fa
Create Date: 2019-03-06 16:15:26.654499
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '10243a168c8c'
down_revision = '40f69d3fd3fa'
branch_labels = None
depends_on = None
def upgrade():
#... | [
"alembic.op.f",
"alembic.op.create_index",
"alembic.op.drop_index"
] | [((385, 451), 'alembic.op.drop_index', 'op.drop_index', (['"""ix_companies_company_name"""'], {'table_name': '"""companies"""'}), "('ix_companies_company_name', table_name='companies')\n", (398, 451), False, 'from alembic import op\n'), ((753, 845), 'alembic.op.create_index', 'op.create_index', (['"""ix_companies_compa... |
from pathlib import Path
from allennlp.models import Model
from allennlp.data import Instance
from allennlp.data import Vocabulary
from allennlp.data import DataLoader
from allennlp.data import DatasetReader
from typing import Any, Tuple, Iterable
from allennlp.training.trainer import Trainer
from allennlp.training.tra... | [
"allennlp.training.optimizers.HuggingfaceAdamWOptimizer",
"oos_detect.train.callbacks.LogMetricsToWandb",
"oos_detect.utilities.exceptions.UnskippableSituationError",
"allennlp.data.Vocabulary.from_pretrained_transformer",
"allennlp.data.data_loaders.MultiProcessDataLoader",
"allennlp.data.Vocabulary.from... | [((2652, 2760), 'allennlp.data.data_loaders.MultiProcessDataLoader', 'MultiProcessDataLoader', ([], {'reader': 'data_reader', 'data_path': 'data_path', 'batch_size': 'batch_size', 'shuffle': 'shuffle'}), '(reader=data_reader, data_path=data_path, batch_size=\n batch_size, shuffle=shuffle)\n', (2674, 2760), False, 'f... |
"""Code used to create the examples in the overflow paper.
This module contains the code used to create the examples in the paper at
https://arxiv.org/pdf/2001.09611v1, referred to as the overflow paper.
Execute this module as a script to reproduce the examples. The code has been
tested using Python 3.5.2, NumPy ... | [
"numpy.flipud",
"numpy.arange",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"numpy.floor",
"overflow_algorithm.solve_overflow_traffic_equation",
"create_overflow_networks.square_network_example",
"numpy.zeros",
"numpy.linspace",
"matplotlib.pyplot.figure",
"create_overflow_networks.w... | [((2160, 2171), 'numpy.zeros', 'np.zeros', (['n'], {}), '(n)\n', (2168, 2171), True, 'import numpy as np\n'), ((2264, 2292), 'numpy.linspace', 'np.linspace', (['(0)', '(1.0)', 'grid_nr'], {}), '(0, 1.0, grid_nr)\n', (2275, 2292), True, 'import numpy as np\n'), ((2314, 2342), 'numpy.linspace', 'np.linspace', (['(0)', '(... |
import numpy as np
import pytest
from keras.utils.test_utils import layer_test
from keras import layers
from keras.models import Sequential
@pytest.mark.parametrize(
'padding,stride,data_format',
[(padding, stride, data_format)
for padding in ['valid', 'same']
for stride in [1, 2]
for data_for... | [
"keras.layers.Masking",
"keras.layers.GlobalAveragePooling1D",
"keras.utils.test_utils.layer_test",
"keras.models.Sequential",
"pytest.main",
"pytest.mark.parametrize",
"numpy.random.randint",
"numpy.array_equal"
] | [((144, 348), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""padding,stride,data_format"""', "[(padding, stride, data_format) for padding in ['valid', 'same'] for stride in\n [1, 2] for data_format in ['channels_first', 'channels_last']]"], {}), "('padding,stride,data_format', [(padding, stride,\n da... |
__version__ = '0.3'
import logging
class NinjaLogger(logging.Handler):
"""
A class which sends records to https://wwww.ninjalog.io
"""
def __init__(self, email, client_id, client_secret,
log_format='%(asctime)s %(levelname)s (%(pathname)s:%(lineno)d): %(message)s'):
logging.Handler._... | [
"jwt.decode",
"logging.Handler.__init__",
"requests.post",
"logging.Formatter"
] | [((303, 333), 'logging.Handler.__init__', 'logging.Handler.__init__', (['self'], {}), '(self)\n', (327, 333), False, 'import logging\n'), ((450, 581), 'requests.post', 'requests.post', (['"""https://www.ninjalog.io/api/v1/auth/token"""'], {'json': "{'email': email, 'client_id': client_id}", 'headers': 'self.headers'}),... |
import json
import string
from backports.tempfile import TemporaryDirectory
from django.test import override_settings
from django.urls import reverse
from django_webtest import WebTest, WebTestMixin
from hypothesis import given, settings
from hypothesis.extra.django import TestCase
from hypothesis.strategies import te... | [
"hypothesis.strategies.text",
"json.loads",
"hypothesis.settings.load_profile",
"json.dumps",
"backports.tempfile.TemporaryDirectory",
"hypothesis.settings.register_profile",
"django.test.override_settings",
"rest_framework_simplejwt.tokens.AccessToken.for_user",
"django.urls.reverse"
] | [((546, 593), 'hypothesis.settings.register_profile', 'settings.register_profile', (['"""ci"""'], {'deadline': '(800.0)'}), "('ci', deadline=800.0)\n", (571, 593), False, 'from hypothesis import given, settings\n'), ((594, 621), 'hypothesis.settings.load_profile', 'settings.load_profile', (['"""ci"""'], {}), "('ci')\n"... |
import time
import threading
from crawler import run as crawler_run
from webapi import run as webapi_run
from webapi import APIMiddleware
from config import configger
def watch_thread():
while True:
try:
google_storage_length = api_mdw.get_len('ggl')
nongoogle_storage_length = api... | [
"threading.Thread",
"webapi.APIMiddleware",
"time.sleep"
] | [((768, 783), 'webapi.APIMiddleware', 'APIMiddleware', ([], {}), '()\n', (781, 783), False, 'from webapi import APIMiddleware\n'), ((803, 838), 'threading.Thread', 'threading.Thread', ([], {'target': 'webapi_run'}), '(target=webapi_run)\n', (819, 838), False, 'import threading\n'), ((859, 896), 'threading.Thread', 'thr... |
import random
chars ='abcdefghijklmnopqrstuvwxyz1234567890@#$*!?();:/'
length =input('password length ?')
length=int(length)
password=''
for c in range(length):
password +=random.choice(chars)
print(password)
| [
"random.choice"
] | [((182, 202), 'random.choice', 'random.choice', (['chars'], {}), '(chars)\n', (195, 202), False, 'import random\n')] |
from dataclasses import astuple, dataclass
import numpy as np
import torch
from copy import deepcopy
class Binarizer:
def __init__(self, binarization):
self.bin = binarization
def __call__(self, tens):
if self.bin is None:
return tens
elif self.bin[0] == "neq":
... | [
"torch.FloatTensor",
"numpy.array",
"torch.tensor",
"torch.nn.Parameter",
"dataclasses.astuple",
"copy.deepcopy",
"torch.zeros"
] | [((4869, 4912), 'numpy.array', 'np.array', (['[[1, 1, 1], [1, 1, 1], [1, 1, 1]]'], {}), '([[1, 1, 1], [1, 1, 1], [1, 1, 1]])\n', (4877, 4912), True, 'import numpy as np\n'), ((5030, 5086), 'torch.nn.Parameter', 'torch.nn.Parameter', ([], {'data': 'kernel_var', 'requires_grad': '(False)'}), '(data=kernel_var, requires_g... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'NewTier.ui'
#
# Created: Tue May 28 11:30:42 2013
# by: PyQt4 UI code generator 4.9.6
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except Attribu... | [
"PyQt4.QtGui.QWidget",
"PyQt4.QtCore.QMetaObject.connectSlotsByName",
"PyQt4.QtGui.QLabel",
"PyQt4.QtGui.QDialogButtonBox",
"PyQt4.QtCore.QLocale",
"PyQt4.QtGui.QLineEdit",
"PyQt4.QtGui.QGridLayout",
"PyQt4.QtGui.QApplication.translate",
"PyQt4.QtCore.QRect"
] | [((481, 545), 'PyQt4.QtGui.QApplication.translate', 'QtGui.QApplication.translate', (['context', 'text', 'disambig', '_encoding'], {}), '(context, text, disambig, _encoding)\n', (509, 545), False, 'from PyQt4 import QtCore, QtGui\n'), ((983, 1020), 'PyQt4.QtGui.QDialogButtonBox', 'QtGui.QDialogButtonBox', (['DialogNewT... |
#!/usr/bin/env python3
'''
booksdatasource.py
Interface by <NAME>, 21 September 2021
Code by <NAME>, <NAME>
revised by <NAME> and <NAME>, 9 October 2021
For use in the "books" assignment at the beginning of Carleton's
CS 257 Software Design class, Fall 2021.
'''
from functools import cmp_to... | [
"functools.cmp_to_key",
"csv.reader"
] | [((3228, 3244), 'csv.reader', 'csv.reader', (['file'], {}), '(file)\n', (3238, 3244), False, 'import csv\n'), ((6160, 6194), 'functools.cmp_to_key', 'cmp_to_key', (['Author.compare_authors'], {}), '(Author.compare_authors)\n', (6170, 6194), False, 'from functools import cmp_to_key\n'), ((9489, 9527), 'functools.cmp_to_... |
import torch
import numpy as np
from utils import get_2d_joints, get_all_32joints
from utils.data import un_normalize_data, H36M_NAMES
dim_to_use_2d = [0, 1, 2, 3, 4, 5, 6, 7, 12, 13, 14, 15, 16, 17, 24, 25, 26, 27, 30, 31, 34, 35, 36, 37,
38, 39, 50, 51, 52, 53, 54, 55]
dim_to_use_3d = [3, 4, 5, 6, ... | [
"torch.tensor",
"utils.data.un_normalize_data",
"numpy.load",
"utils.get_2d_joints"
] | [((679, 708), 'numpy.load', 'np.load', (['"""models/mean_3d.npy"""'], {}), "('models/mean_3d.npy')\n", (686, 708), True, 'import numpy as np\n'), ((723, 751), 'numpy.load', 'np.load', (['"""models/std_3d.npy"""'], {}), "('models/std_3d.npy')\n", (730, 751), True, 'import numpy as np\n'), ((1636, 1708), 'utils.data.un_n... |
from dbconnect import connection
from classes import *
import gc
def getUser(id):
c, conn = connection()
x = c.execute("SELECT * FROM users WHERE uid = %s", [id])
if x == 0:
return None
else:
user = c.fetchone()
c.execute("SHOW COLUMNS FROM users")
labels = [i[0] for i... | [
"dbconnect.connection"
] | [((97, 109), 'dbconnect.connection', 'connection', ([], {}), '()\n', (107, 109), False, 'from dbconnect import connection\n')] |
import base64
from beacons.portal.models import IBeacon, EddyStone
class BeaconHelper(object):
"""
Helper of Beacons
"""
@staticmethod
def create_beacon(form):
"""
Return appropiate beacon
"""
if form.get('type') == 'iBEACON':
return IBeacon(form)
... | [
"beacons.portal.models.EddyStone",
"beacons.portal.models.IBeacon",
"base64.b64decode"
] | [((329, 344), 'beacons.portal.models.EddyStone', 'EddyStone', (['form'], {}), '(form)\n', (338, 344), False, 'from beacons.portal.models import IBeacon, EddyStone\n'), ((724, 755), 'base64.b64decode', 'base64.b64decode', (['advertised_id'], {}), '(advertised_id)\n', (740, 755), False, 'import base64\n'), ((300, 313), '... |