code stringlengths 21 1.03M | apis list | extract_api stringlengths 74 8.23M |
|---|---|---|
"""Copyright (c) 2017 Cisco Systems, Inc.
Name:
asa_cluster.py
Usage:
Submodule for Legacy ASA GTP feature.
Author:
raywa
"""
import re
from .asa_config import AsaConfig
class AsaGtpConfig(AsaConfig):
"""ASA Config for GTP inherited from AsaConfig
"""
def __init__(self, **kwargs):
"""I... | [
"re.search"
] | [((3409, 3436), 're.search', 're.search', (['""" (\\\\d+)"""', 'param'], {}), "(' (\\\\d+)', param)\n", (3418, 3436), False, 'import re\n'), ((2162, 2198), 're.search', 're.search', (['"""GTP Statistics:"""', 'output'], {}), "('GTP Statistics:', output)\n", (2171, 2198), False, 'import re\n')] |
import os
import cv2
import requests
import pickle
import numpy as np
import tensorflow as tf
import tensorflow_hub as hub
from cv2.ximgproc import createSuperpixelSEEDS
from mplime.models import Model
# mobilenet
MODEL_URL = "https://tfhub.dev/google/imagenet/mobilenet_v2_140_224/classification/3"
# inception-v3
# MO... | [
"numpy.asarray",
"numpy.copy",
"tensorflow.Dimension",
"os.path.exists",
"cv2.cvtColor",
"numpy.zeros",
"tensorflow.Graph",
"tensorflow_hub.get_expected_image_size",
"tensorflow.Session",
"tensorflow.nn.softmax",
"cv2.resize",
"requests.get",
"tensorflow.global_variables_initializer",
"cv2... | [((653, 663), 'tensorflow.Graph', 'tf.Graph', ([], {}), '()\n', (661, 663), True, 'import tensorflow as tf\n'), ((1404, 1423), 'tensorflow.Session', 'tf.Session', ([], {'graph': 'g'}), '(graph=g)\n', (1414, 1423), True, 'import tensorflow as tf\n'), ((1545, 1572), 'os.path.exists', 'os.path.exists', (['PICKLE_NAME'], {... |
import random
from collections import deque
from enum import Enum, auto
from functools import total_ordering
from typing import Dict, List, Optional, Union
### HELPER FUNCTIONS ##########################################################
# TODO: Maybe move this back to Deck but allow the creating of a base Deck with
#... | [
"enum.auto",
"random.randint",
"collections.deque"
] | [((895, 901), 'enum.auto', 'auto', ([], {}), '()\n', (899, 901), False, 'from enum import Enum, auto\n'), ((914, 920), 'enum.auto', 'auto', ([], {}), '()\n', (918, 920), False, 'from enum import Enum, auto\n'), ((691, 711), 'random.randint', 'random.randint', (['(0)', 'i'], {}), '(0, i)\n', (705, 711), False, 'import r... |
'''
The benchmarker
Run the benchmark of agent vs environments, or environment vs agents, or both.
Generate benchmark specs like so:
- take a spec
- for each in benchmark envs
- use the template env spec to update spec
- append to benchmark specs
Interchange agent and env for the reversed benchmark.
'''
from sl... | [
"slm_lab.lib.util.write",
"slm_lab.lib.logger.get_logger",
"slm_lab.lib.logger.info",
"os.path.exists",
"slm_lab.lib.util.read",
"pydash.get"
] | [((434, 480), 'slm_lab.lib.util.read', 'util.read', (['f"""{spec_util.SPEC_DIR}/_agent.json"""'], {}), "(f'{spec_util.SPEC_DIR}/_agent.json')\n", (443, 480), False, 'from slm_lab.lib import logger, util\n'), ((497, 541), 'slm_lab.lib.util.read', 'util.read', (['f"""{spec_util.SPEC_DIR}/_env.json"""'], {}), "(f'{spec_ut... |
#!/usr/bin/env python3
import unittest
import numpy as np
from pytorch_translate import vocab_reduction
from pytorch_translate.test import utils as test_utils
class TestVocabReduction(unittest.TestCase):
def test_get_translation_candidates(self):
lexical_dictionaries = test_utils.create_lexical_dictiona... | [
"pytorch_translate.test.utils.create_lexical_dictionaries",
"pytorch_translate.vocab_reduction.get_translation_candidates",
"pytorch_translate.test.utils.create_vocab_reduction_expected_array",
"pytorch_translate.test.utils.create_vocab_dictionaries",
"numpy.testing.assert_array_equal"
] | [((286, 326), 'pytorch_translate.test.utils.create_lexical_dictionaries', 'test_utils.create_lexical_dictionaries', ([], {}), '()\n', (324, 326), True, 'from pytorch_translate.test import utils as test_utils\n'), ((356, 394), 'pytorch_translate.test.utils.create_vocab_dictionaries', 'test_utils.create_vocab_dictionarie... |
from django.conf.urls import url
urlpatterns = [
url(r"^register$", "usercenter.views.register", name="usercenter_register"),
url(r"^logout", "django.contrib.auth.views.logout_then_login", name="logout_then_login"),
url(r"^activate/(?P<code>\w+)$", "usercenter.views.activate", name="usercenter_activate"),
] | [
"django.conf.urls.url"
] | [((51, 125), 'django.conf.urls.url', 'url', (['"""^register$"""', '"""usercenter.views.register"""'], {'name': '"""usercenter_register"""'}), "('^register$', 'usercenter.views.register', name='usercenter_register')\n", (54, 125), False, 'from django.conf.urls import url\n'), ((129, 221), 'django.conf.urls.url', 'url', ... |
import unittest
import requests
import json
# https://api.gouv.fr/documentation/temps_reel_transport
class UnitTestsGeoApiGouvFrDecoupageAdministrative(unittest.TestCase):
def test_first_api(self):
print('test_first_api')
url = "https://tr.transport.data.gouv.fr/"
response = requests.req... | [
"json.loads",
"requests.request",
"unittest.main"
] | [((612, 627), 'unittest.main', 'unittest.main', ([], {}), '()\n', (625, 627), False, 'import unittest\n'), ((308, 336), 'requests.request', 'requests.request', (['"""GET"""', 'url'], {}), "('GET', url)\n", (324, 336), False, 'import requests\n'), ((508, 536), 'requests.request', 'requests.request', (['"""GET"""', 'url'... |
from django.urls import include, path
from apps.auth.urls import api as auth_urls
from apps.tables.urls import api as tables_urls
app_name = 'api'
urlpatterns = [
path('auth/', include(auth_urls, namespace='auth')),
path('tables/', include(tables_urls, namespace='tables')),
]
| [
"django.urls.include"
] | [((183, 219), 'django.urls.include', 'include', (['auth_urls'], {'namespace': '"""auth"""'}), "(auth_urls, namespace='auth')\n", (190, 219), False, 'from django.urls import include, path\n'), ((242, 282), 'django.urls.include', 'include', (['tables_urls'], {'namespace': '"""tables"""'}), "(tables_urls, namespace='table... |
#!/usr/bin/env python3
"""
superstat -- easy multi directory git status
MIT License
Copyright (c) 2019 <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 witho... | [
"subprocess.run",
"os.path.dirname",
"os.getcwd",
"os.system",
"argparse.ArgumentParser",
"pathlib.Path"
] | [((1311, 1322), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (1320, 1322), False, 'import os\n'), ((1342, 1367), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (1357, 1367), False, 'import os\n'), ((1733, 1830), 'subprocess.run', 'subprocess.run', (["['git', 'status', '--short']"], {'capture_o... |
from tortoise import fields
from tortoise.models import Model
from crimsobot.models import DiscordUser
from crimsobot.models.user import User
class CringoStatistic(Model):
uuid = fields.UUIDField(pk=True)
user = fields.ForeignKeyField('models.User', related_name='cringo_statistics', index=True)
plays = ... | [
"tortoise.fields.DatetimeField",
"tortoise.fields.FloatField",
"tortoise.fields.UUIDField",
"tortoise.fields.ForeignKeyField",
"tortoise.fields.IntField",
"crimsobot.models.user.User.get_by_discord_user"
] | [((186, 211), 'tortoise.fields.UUIDField', 'fields.UUIDField', ([], {'pk': '(True)'}), '(pk=True)\n', (202, 211), False, 'from tortoise import fields\n'), ((223, 310), 'tortoise.fields.ForeignKeyField', 'fields.ForeignKeyField', (['"""models.User"""'], {'related_name': '"""cringo_statistics"""', 'index': '(True)'}), "(... |
import os
import subprocess
from utils.IO import get_srilm_bin_path, read_json, save_list, get_tmp_folder, check_file
def generate_model(text_file):
max_order = 3
command = os.path.join(get_srilm_bin_path(), 'ngram-count')
model_file = text_file.split('.')[0] + '.lm'
for order in reversed(range(0, m... | [
"utils.IO.get_tmp_folder",
"utils.IO.get_srilm_bin_path",
"utils.IO.read_json",
"subprocess.Popen"
] | [((685, 705), 'utils.IO.read_json', 'read_json', (['file_path'], {}), '(file_path)\n', (694, 705), False, 'from utils.IO import get_srilm_bin_path, read_json, save_list, get_tmp_folder, check_file\n'), ((1006, 1026), 'utils.IO.read_json', 'read_json', (['file_path'], {}), '(file_path)\n', (1015, 1026), False, 'from uti... |
import re
from collections import namedtuple
from . import spec_for
from ..elements import *
@spec_for(Block)
class BlockSpec:
accepts_text = False
@classmethod
def create(cls, text):
"""Try to create an element from a given text. Normally, this function
looks only markers and uses only... | [
"re.compile"
] | [((1478, 1697), 're.compile', 're.compile', (['"""\n ^\n (\\\\={1,6}) # marker\n [ ]+ # required whitespace\n (.*) # text\n [ ]+ # required whitespace\n \\\\1\n $\n """', 're.VERBOSE'], {}), '(\n """\n ^\n (\\\\={1,6}) # m... |
from infrastructure.db.question_template_schema import QuestionTemplate
import logging
logger = logging.getLogger(__name__)
class QuestionTemplateRepositoryPostgres:
def add_question_template(self, db, question_template):
db.add(question_template)
db.commit()
logger.info("Added new questi... | [
"logging.getLogger"
] | [((97, 124), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (114, 124), False, 'import logging\n')] |
# coding=utf-8
from OTLMOW.OTLModel.BaseClasses.OTLAttribuut import OTLAttribuut
from OTLMOW.OTLModel.Classes.NietWeggebondenDetectie import NietWeggebondenDetectie
from OTLMOW.OTLModel.Datatypes.DtcTijdsduur import DtcTijdsduur
from OTLMOW.OTLModel.Datatypes.KlDrukknopMerk import KlDrukknopMerk
from OTLMOW.OTLModel.Da... | [
"OTLMOW.OTLModel.BaseClasses.OTLAttribuut.OTLAttribuut"
] | [((1298, 1566), 'OTLMOW.OTLModel.BaseClasses.OTLAttribuut.OTLAttribuut', 'OTLAttribuut', ([], {'field': 'DtcTijdsduur', 'naam': '"""bewakingstijd"""', 'label': '"""bewakingstijd"""', 'objectUri': '"""https://wegenenverkeer.data.vlaanderen.be/ns/onderdeel#Drukknop.bewakingstijd"""', 'definition': '"""Wachttijd (in uren)... |
import numpy as np
import matplotlib.pyplot as plt
import subprocess
import scipy.stats
import sys
from scipy.signal import savgol_filter
file=sys.argv[1]
def mutPlot_noGap(seqs):
sym=['A','I','L','M','V','F','W','Y','N','C','Q','S','T','D','E','R','H','K','G','P','X']
ent=[]
mL=0
# Getting longest s... | [
"subprocess.call",
"scipy.signal.savgol_filter",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylabel",
"numpy.array",
"matplotlib.pyplot.plot"
] | [((1662, 1689), 'scipy.signal.savgol_filter', 'savgol_filter', (['y', 'savF_w', '(3)'], {}), '(y, savF_w, 3)\n', (1675, 1689), False, 'from scipy.signal import savgol_filter\n'), ((1940, 1954), 'matplotlib.pyplot.plot', 'plt.plot', (['yhat'], {}), '(yhat)\n', (1948, 1954), True, 'import matplotlib.pyplot as plt\n'), ((... |
from corsheaders.signals import check_request_enabled
# Allow CORS for All GBFS Urls
def cors_allow(sender, request, **kwargs):
return request.path.startswith("/gbfs/")
check_request_enabled.connect(cors_allow)
| [
"corsheaders.signals.check_request_enabled.connect"
] | [((177, 218), 'corsheaders.signals.check_request_enabled.connect', 'check_request_enabled.connect', (['cors_allow'], {}), '(cors_allow)\n', (206, 218), False, 'from corsheaders.signals import check_request_enabled\n')] |
import random
def get_number():
die_number = random.randint(1, 10)
return die_number
random_number = get_number()
print(random_number)
| [
"random.randint"
] | [((53, 74), 'random.randint', 'random.randint', (['(1)', '(10)'], {}), '(1, 10)\n', (67, 74), False, 'import random\n')] |
import ctypes
import os
import sys
import threading
import time
from ctypes import *
import numpy as np
def get_timingprice(*instrument_list):
while(1):
price = api.getprice(c_char_p(bytes(instrument_list[0], 'utf-8')))
global closelist
closelist.append(price)
ip_hq = 'tcp://172.16.17.... | [
"threading.Thread",
"time.sleep"
] | [((1109, 1122), 'time.sleep', 'time.sleep', (['(5)'], {}), '(5)\n', (1119, 1122), False, 'import time\n'), ((1162, 1175), 'time.sleep', 'time.sleep', (['(5)'], {}), '(5)\n', (1172, 1175), False, 'import time\n'), ((1358, 1371), 'time.sleep', 'time.sleep', (['(5)'], {}), '(5)\n', (1368, 1371), False, 'import time\n'), (... |
from __future__ import absolute_import
import re # noqa: F401
import six
from ionoscloud.api_client import ApiClient
from ionoscloud.exceptions import ( # noqa: F401
ApiTypeError,
ApiValueError
)
class UserManagementApi(object):
def __init__(self, api_client=None):
if api_client is None:
... | [
"ionoscloud.exceptions.ApiTypeError",
"ionoscloud.exceptions.ApiValueError",
"ionoscloud.api_client.ApiClient",
"six.iteritems"
] | [((5749, 5790), 'six.iteritems', 'six.iteritems', (["local_var_params['kwargs']"], {}), "(local_var_params['kwargs'])\n", (5762, 5790), False, 'import six\n'), ((14801, 14842), 'six.iteritems', 'six.iteritems', (["local_var_params['kwargs']"], {}), "(local_var_params['kwargs'])\n", (14814, 14842), False, 'import six\n'... |
import torch
import torch.nn as nn
import torch.backends.cudnn as cudnn
cudnn.benchmark = True
cudnn.deterministic = True
device = torch.device('cuda')
class Net(nn.Module):
def __init__(self):
super(Net, self).__init__()
self.l = nn.Linear(10, 10)
def forward(self, x):
return... | [
"torch.device",
"torch.nn.parallel.DataParallel",
"torch.nn.Linear",
"torch.nn.MSELoss",
"torch.randn"
] | [((135, 155), 'torch.device', 'torch.device', (['"""cuda"""'], {}), "('cuda')\n", (147, 155), False, 'import torch\n'), ((406, 435), 'torch.nn.parallel.DataParallel', 'nn.parallel.DataParallel', (['net'], {}), '(net)\n', (430, 435), True, 'import torch.nn as nn\n'), ((478, 490), 'torch.nn.MSELoss', 'nn.MSELoss', ([], {... |
#!/usr/bin/env python2
import thread
import json
import fnmatch
import socketio
from gevent.pywsgi import WSGIServer
sio = socketio.Server(async_mode='gevent',ping_timeout=30, logger=False, engineio_logger=False)
app = socketio.WSGIApp(sio)
def sio_connect_handler(sid, environ):
print("connect", sid)
sio.on... | [
"gevent.pywsgi.WSGIServer",
"thread.start_new_thread",
"json.dumps",
"socketio.WSGIApp",
"socketio.Server"
] | [((129, 223), 'socketio.Server', 'socketio.Server', ([], {'async_mode': '"""gevent"""', 'ping_timeout': '(30)', 'logger': '(False)', 'engineio_logger': '(False)'}), "(async_mode='gevent', ping_timeout=30, logger=False,\n engineio_logger=False)\n", (144, 223), False, 'import socketio\n'), ((225, 246), 'socketio.WSGIA... |
# Generated by Django 2.2.10 on 2020-09-24 22:24
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('stock', '0001_initial'),
]
operations = [
migrations.DeleteModel(
name='Dreamreal',
),
]
| [
"django.db.migrations.DeleteModel"
] | [((215, 255), 'django.db.migrations.DeleteModel', 'migrations.DeleteModel', ([], {'name': '"""Dreamreal"""'}), "(name='Dreamreal')\n", (237, 255), False, 'from django.db import migrations\n')] |
# coding: utf-8
"""
Thingsboard REST API
For instructions how to authorize requests please visit <a href='http://thingsboard.io/docs/reference/rest-api/'>REST API documentation page</a>.
OpenAPI spec version: 2.0
Contact: <EMAIL>
Generated by: https://github.com/swagger-api/swagger-codegen.git
""... | [
"swagger_client.apis.customer_controller_api.CustomerControllerApi",
"unittest.main"
] | [((1832, 1847), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1845, 1847), False, 'import unittest\n'), ((692, 759), 'swagger_client.apis.customer_controller_api.CustomerControllerApi', 'swagger_client.apis.customer_controller_api.CustomerControllerApi', ([], {}), '()\n', (757, 759), False, 'import swagger_clien... |
# Generated by Django 4.0.3 on 2022-04-04 21:14
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='CatagoryPrice',
fields=[
... | [
"django.db.models.ForeignKey",
"django.db.models.BigAutoField",
"django.db.models.ManyToManyField",
"django.db.models.DateTimeField",
"django.db.models.DecimalField",
"django.db.models.BooleanField",
"django.db.models.TextField",
"django.db.models.CharField"
] | [((342, 438), 'django.db.models.BigAutoField', 'models.BigAutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (361, 438), False, 'from django.db import migrations, m... |
import logging
import os
from pathlib import Path
from ruamel import yaml
from ruamel.yaml.parser import ParserError, ScannerError
logger = logging.getLogger('logsmith')
config_file_name = 'config.yaml'
accounts_file_name = 'accounts.yaml'
log_file_name = 'app.log'
active_group_file_name = 'active_group'
def get_ap... | [
"ruamel.yaml.round_trip_dump",
"pathlib.Path.home",
"logging.getLogger",
"os.remove",
"os.path.exists",
"ruamel.yaml.safe_load"
] | [((142, 171), 'logging.getLogger', 'logging.getLogger', (['"""logsmith"""'], {}), "('logsmith')\n", (159, 171), False, 'import logging\n'), ((977, 1036), 'ruamel.yaml.round_trip_dump', 'yaml.round_trip_dump', (['d'], {'indent': '(4)', 'default_flow_style': '(False)'}), '(d, indent=4, default_flow_style=False)\n', (997,... |
import os
from Crypto.Cipher import AES
from Crypto import Random
import codecs
#import argparse
def find_all_file_loc(outputkey):
allfiles=[]
with open(outputkey,'r') as f:
enckey=bytes(f.readline(),'utf-8')
ivlocfile = Random.new().read(AES.block_size)
cipherlocfile = AES.n... | [
"Crypto.Random.new",
"Crypto.Cipher.AES.new",
"codecs.decode",
"os.remove"
] | [((1219, 1239), 'os.remove', 'os.remove', (['outputkey'], {}), '(outputkey)\n', (1228, 1239), False, 'import os\n'), ((315, 359), 'Crypto.Cipher.AES.new', 'AES.new', (['keylocfile', 'AES.MODE_CFB', 'ivlocfile'], {}), '(keylocfile, AES.MODE_CFB, ivlocfile)\n', (322, 359), False, 'from Crypto.Cipher import AES\n'), ((940... |
import os
import argparse
import sentry_sdk
import settings
import bot
import vk
COMMANDS = {
'start_bot': bot.start_bot,
'start_vk_polling': vk.service.start,
}
if not settings.DEBUG:
sentry_sdk.init(settings.SENTRY_URL)
def main():
parser = argparse.ArgumentParser()
parser.add_argument('com... | [
"os.getpid",
"argparse.ArgumentParser",
"sentry_sdk.init"
] | [((202, 238), 'sentry_sdk.init', 'sentry_sdk.init', (['settings.SENTRY_URL'], {}), '(settings.SENTRY_URL)\n', (217, 238), False, 'import sentry_sdk\n'), ((266, 291), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (289, 291), False, 'import argparse\n'), ((542, 553), 'os.getpid', 'os.getpid', ([... |
# CMD Utils
# Copyright (C) 2021 - Javinator9889
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# ... | [
"string.Template",
"shlex.split",
"subprocess.Popen",
"re.compile"
] | [((3074, 3090), 'shlex.split', 'shlex.split', (['cmd'], {}), '(cmd)\n', (3085, 3090), False, 'import shlex\n'), ((3117, 3208), 'subprocess.Popen', 'Popen', (['cmd'], {'stdout': 'PIPE', 'stderr': 'STDOUT', 'bufsize': '(1)', 'universal_newlines': '(True)', 'shell': 'shell'}), '(cmd, stdout=PIPE, stderr=STDOUT, bufsize=1,... |
# Copyright (c) 2010-2017 <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, publish, distrib... | [
"simpleparse.dispatchprocessor.getString",
"simpleparse.dispatchprocessor.singleMap"
] | [((2448, 2477), 'simpleparse.dispatchprocessor.getString', 'getString', (['sublist[0]', 'buffer'], {}), '(sublist[0], buffer)\n', (2457, 2477), False, 'from simpleparse.dispatchprocessor import DispatchProcessor, getString, singleMap\n'), ((2597, 2626), 'simpleparse.dispatchprocessor.getString', 'getString', (['sublist... |
import pytest
import json
@pytest.mark.resource_test
def test_sell_in(client):
"""Test the GET request of Sellin resource, test if since a request it can get an item by its sell_in
Args:
client (test_client Flask): It's the test_client() object from APP Flask
"""
rv = client.get("/items/selli... | [
"json.loads"
] | [((371, 390), 'json.loads', 'json.loads', (['rv.data'], {}), '(rv.data)\n', (381, 390), False, 'import json\n'), ((1006, 1025), 'json.loads', 'json.loads', (['rv.data'], {}), '(rv.data)\n', (1016, 1025), False, 'import json\n')] |
DESC='''
MSC network properties
'''
import argparse
from itertools import product
import networkx as nx
import numpy as np
from os import environ,getenv
from os.path import basename
import pandas as pd
from pdb import set_trace
import scipy
import sqlite3
import sys
sys.path.append('../../../SPREAD_multipathway_simul... | [
"scipy.sparse.csr_matrix",
"itertools.product",
"scipy.sparse.linalg.eigs",
"argparse.ArgumentParser",
"networkx.strongly_connected_components",
"numpy.ones",
"sys.path.append",
"pandas.concat",
"networkx.DiGraph",
"msc_network.MultiScaleNet"
] | [((269, 344), 'sys.path.append', 'sys.path.append', (['"""../../../SPREAD_multipathway_simulator/simulator/scripts"""'], {}), "('../../../SPREAD_multipathway_simulator/simulator/scripts')\n", (284, 344), False, 'import sys\n'), ((451, 544), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': 'DES... |
from typing import Tuple
import numpy as np
from skimage import io
def open_rgb(
file_path: str,
control_channel: int = 0,
probe_channel: int = 1
) -> Tuple[np.ndarray, np.ndarray]:
""" Opens RGB images and returns the control and probe images
Parameters
-----------
file_path... | [
"skimage.io.imread"
] | [((686, 706), 'skimage.io.imread', 'io.imread', (['file_path'], {}), '(file_path)\n', (695, 706), False, 'from skimage import io\n')] |
from model.group import Group
def test_modify_group(app):
app.session.login(username="admin", password="<PASSWORD>")
app.group.modify(Group(name="test333", header="test333", footer="test333"))
app.session.logout() | [
"model.group.Group"
] | [((144, 201), 'model.group.Group', 'Group', ([], {'name': '"""test333"""', 'header': '"""test333"""', 'footer': '"""test333"""'}), "(name='test333', header='test333', footer='test333')\n", (149, 201), False, 'from model.group import Group\n')] |
# This script is for doing secure voting.
# It uses the ElGamal homomorphic encryption scheme for encrypting
# and tallying the votes. It uses the Pedersen protocol for key
# generation. Instead of having a smaller number of authorities that
# voters need to trust, voters trust only themselves. Votes can only be
# tall... | [
"random.SystemRandom",
"functools.reduce",
"fractions.gcd"
] | [((659, 695), 'functools.reduce', 'reduce', (['(lambda x, y: x * y)', 'iterable'], {}), '(lambda x, y: x * y, iterable)\n', (665, 695), False, 'from functools import reduce\n'), ((1046, 1065), 'fractions.gcd', 'fractions_gcd', (['a', 'b'], {}), '(a, b)\n', (1059, 1065), True, 'from fractions import gcd as fractions_gcd... |
import os
import re
import urllib
from django import template
from django.conf import settings
from django.contrib.flatpages.models import FlatPage
from django.contrib.sites.models import Site
from django.core.files.storage import default_storage
from django.db.models.loading import get_model, get_models
from django.d... | [
"django.template.loader.render_to_string",
"re.match",
"django.utils.hashcompat.md5_constructor",
"djutils.utils.images.resize",
"re.compile",
"django.contrib.flatpages.models.FlatPage.objects.get",
"django.template.TemplateSyntaxError",
"django.db.models.loading.get_models",
"djutils.utils.highligh... | [((755, 773), 'django.template.Library', 'template.Library', ([], {}), '()\n', (771, 773), False, 'from django import template\n'), ((9000, 9039), 're.compile', 're.compile', (['"""<inline (?P<attrs>[^>]+)>"""'], {}), "('<inline (?P<attrs>[^>]+)>')\n", (9010, 9039), False, 'import re\n'), ((9051, 9097), 're.compile', '... |
# Copyright (c) <2003-2021> <Newton Game Dynamics>
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages
# arising from the use of this software.
# Permission is granted to anyone to use this software for any purpose,
# including ... | [
"bpy.app.handlers.depsgraph_update_pre.append",
"newton.NewtonWorld",
"bpy.app.handlers.frame_change_pre.append",
"bpy.props.IntProperty",
"bpy.props.FloatProperty"
] | [((463, 483), 'newton.NewtonWorld', 'newton.NewtonWorld', ([], {}), '()\n', (481, 483), False, 'import newton\n'), ((873, 930), 'bpy.app.handlers.depsgraph_update_pre.append', 'bpy.app.handlers.depsgraph_update_pre.append', (['NewtonStart'], {}), '(NewtonStart)\n', (917, 930), False, 'import bpy\n'), ((931, 985), 'bpy.... |
from copy import deepcopy
from optax import sgd
from .._base.test_case import TestCase
from .._core.q import Q
from .._core.policy import Policy
from ..utils import get_transition_batch
from ._clippeddoubleqlearning import ClippedDoubleQLearning
class TestClippedDoubleQLearning(TestCase):
def setUp(self):
... | [
"copy.deepcopy",
"optax.sgd"
] | [((988, 1007), 'copy.deepcopy', 'deepcopy', (['q1.params'], {}), '(q1.params)\n', (996, 1007), False, 'from copy import deepcopy\n'), ((1026, 1045), 'copy.deepcopy', 'deepcopy', (['q2.params'], {}), '(q2.params)\n', (1034, 1045), False, 'from copy import deepcopy\n'), ((1072, 1099), 'copy.deepcopy', 'deepcopy', (['q1.f... |
import keras.backend as K
from ..core import GraphLayer
class GraphPoolingCell(GraphLayer):
"""
Applies a kind of hierarchical pooling on a graph,
assigning adjacency matrix and nodes to a new graph configuration.
For more details, see the "Pooling with an assignement matrix" section
on page ... | [
"keras.backend.dot",
"keras.backend.transpose",
"keras.backend.reshape",
"keras.backend.int_shape"
] | [((2060, 2082), 'keras.backend.int_shape', 'K.int_shape', (['adjacency'], {}), '(adjacency)\n', (2071, 2082), True, 'import keras.backend as K\n'), ((2101, 2119), 'keras.backend.int_shape', 'K.int_shape', (['nodes'], {}), '(nodes)\n', (2112, 2119), True, 'import keras.backend as K\n'), ((2281, 2304), 'keras.backend.tra... |
from EDA import Trends as correlations, Likes as likes, Views as views, Comments as comments
def init_eda(df, categories):
correlations.eda(df)
likes.likes_eda(df, categories)
views.eda(df, categories)
comments.eda(df, categories)
| [
"EDA.Views.eda",
"EDA.Trends.eda",
"EDA.Comments.eda",
"EDA.Likes.likes_eda"
] | [((129, 149), 'EDA.Trends.eda', 'correlations.eda', (['df'], {}), '(df)\n', (145, 149), True, 'from EDA import Trends as correlations, Likes as likes, Views as views, Comments as comments\n'), ((154, 185), 'EDA.Likes.likes_eda', 'likes.likes_eda', (['df', 'categories'], {}), '(df, categories)\n', (169, 185), True, 'fro... |
# Generated by Django 3.2.9 on 2021-12-14 00:12
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AU... | [
"django.db.models.ForeignKey",
"django.db.models.BigAutoField",
"django.db.models.URLField",
"django.db.models.ImageField",
"django.db.models.TextField",
"django.db.migrations.swappable_dependency",
"django.db.models.OneToOneField",
"django.db.models.CharField",
"django.db.models.EmailField"
] | [((277, 334), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (308, 334), False, 'from django.db import migrations, models\n'), ((467, 563), 'django.db.models.BigAutoField', 'models.BigAutoField', ([], {'auto_created': '... |
#!/usr/bin/env python
from __future__ import division, absolute_import, print_function
from functools import partial
import subprocess
from distutils.util import strtobool
import numpy as np
from jams.const import huge
from jams.npyio import savez_compressed
from jams.closest import closest
# ToDo:
# Handling constra... | [
"numpy.load",
"functools.partial",
"numpy.sum",
"numpy.where",
"numpy.zeros",
"numpy.ones",
"sobol.i4_sobol_generate",
"jams.lhs.lhs",
"numpy.random.uniform",
"numpy.linalg.norm",
"numpy.sqrt",
"numpy.random.seed",
"subprocess.check_output",
"numpy.array",
"doctest.testmod",
"numpy.any... | [((4115, 4128), 'numpy.array', 'np.array', (['[0]'], {}), '([0])\n', (4123, 4128), True, 'import numpy as np\n'), ((41505, 41517), 'numpy.array', 'np.array', (['lb'], {}), '(lb)\n', (41513, 41517), True, 'import numpy as np\n'), ((41527, 41539), 'numpy.array', 'np.array', (['ub'], {}), '(ub)\n', (41535, 41539), True, '... |
import click
from pyfiglet import Figlet
import blur as blurProcess
import resize as resizeProcess
import rotate as rotateProcess
import sharper as sharperProcess
# import writeText as writeTextProcess
click.secho(Figlet(font='slant').renderText('ImageRemake v1.0'), fg='red', bold=True)
@click.command()
@click.optio... | [
"click.echo",
"pyfiglet.Figlet",
"click.command",
"rotate.rotate",
"resize.resize",
"click.option",
"sharper.sharpen",
"blur.process"
] | [((292, 307), 'click.command', 'click.command', ([], {}), '()\n', (305, 307), False, 'import click\n'), ((309, 405), 'click.option', 'click.option', (['"""-p"""', '"""--path"""'], {'required': '(True)', 'type': 'str', 'help': '"""Defines path of target image."""'}), "('-p', '--path', required=True, type=str, help=\n ... |
from flask import Flask, render_template, request, redirect, url_for
import binascii as ba
import os
from io import BytesIO
from PIL import Image
import matplotlib.pyplot as plt
import numpy as np
import util
import sqlite3
import requests
app = Flask(__name__)
app.config.update(
TEMPLATES_AUTO_RELOAD=True,
D... | [
"flask.url_for",
"binascii.b2a_base64",
"sqlite3.connect",
"util.convert_to_28x28_image",
"flask.render_template",
"requests.post",
"os.environ.get",
"flask.Flask",
"os.makedirs"
] | [((248, 263), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (253, 263), False, 'from flask import Flask, render_template, request, redirect, url_for\n'), ((2828, 2868), 'flask.render_template', 'render_template', (['"""index.html"""'], {'data': 'data'}), "('index.html', data=data)\n", (2843, 2868), False,... |
from django.db import models
from django.conf import settings
from webdnd.player.models.abstract import AbstractPlayerModel
class Alignment(AbstractPlayerModel):
# Both on a 0-100 scale
align_moral = models.IntegerField(default=50, blank=False, null=False)
align_order = models.IntegerField(default=50, b... | [
"django.db.models.IntegerField"
] | [((212, 268), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'default': '(50)', 'blank': '(False)', 'null': '(False)'}), '(default=50, blank=False, null=False)\n', (231, 268), False, 'from django.db import models\n'), ((287, 343), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'default': '... |
from discord.ext import commands
@commands.command()
async def hello(ctx):
await ctx.send("Mimimi!")
def setup(bot):
bot.add_command(hello)
| [
"discord.ext.commands.command"
] | [((36, 54), 'discord.ext.commands.command', 'commands.command', ([], {}), '()\n', (52, 54), False, 'from discord.ext import commands\n')] |
# Generated by Django 3.0.3 on 2020-04-01 05:23
import uuid
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('books', '0001_initial'),
]
operations = [
migrations.CreateModel(
... | [
"django.db.models.UUIDField",
"django.db.models.ForeignKey",
"django.db.models.DecimalField",
"django.db.models.IntegerField"
] | [((386, 477), 'django.db.models.UUIDField', 'models.UUIDField', ([], {'default': 'uuid.uuid4', 'editable': '(False)', 'primary_key': '(True)', 'serialize': '(False)'}), '(default=uuid.uuid4, editable=False, primary_key=True,\n serialize=False)\n', (402, 477), False, 'from django.db import migrations, models\n'), ((5... |
from itertools import groupby
from .char_table import A2K_TABLE, ALPHABET_ALL, ALPHABET_NUMERAL_ALL, AN2K_TABLE
def _convert(text, conv_table):
return text.translate(conv_table)
def convert(text, delimiter, conv_table, target_words):
"""
Parameters
----------
text :str
delimiter : str
... | [
"itertools.groupby"
] | [((578, 620), 'itertools.groupby', 'groupby', (['text', '(lambda x: x in target_words)'], {}), '(text, lambda x: x in target_words)\n', (585, 620), False, 'from itertools import groupby\n')] |
from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = (
[
path("admin/", admin.site.urls),
path("ckeditor/", include("ckeditor_uploader.urls")),
path("", include("blog.urls")),
... | [
"django.urls.path",
"django.urls.include",
"django.conf.urls.static.static"
] | [((545, 606), 'django.conf.urls.static.static', 'static', (['settings.MEDIA_URL'], {'document_root': 'settings.MEDIA_ROOT'}), '(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)\n', (551, 606), False, 'from django.conf.urls.static import static\n'), ((475, 538), 'django.conf.urls.static.static', 'static', (['setti... |
# -*- coding: utf-8 -*-
# __title__ = 'Assign\nRebar Partition'
__author__ = 'htl'
import clr
clr.AddReference('RevitAPI')
clr.AddReference('RevitAPIUI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.UI import *
import rpw
from rpw.ui.forms import Label, CheckBox, Button, TextBox, FlexForm
uiapp = __revit__
ui... | [
"rpw.ui.forms.Button",
"rpw.ui.forms.FlexForm",
"rpw.ui.forms.CheckBox",
"clr.AddReference",
"rpw.ui.forms.Label",
"rpw.ui.forms.TextBox"
] | [((95, 123), 'clr.AddReference', 'clr.AddReference', (['"""RevitAPI"""'], {}), "('RevitAPI')\n", (111, 123), False, 'import clr\n'), ((124, 154), 'clr.AddReference', 'clr.AddReference', (['"""RevitAPIUI"""'], {}), "('RevitAPIUI')\n", (140, 154), False, 'import clr\n'), ((863, 902), 'rpw.ui.forms.FlexForm', 'FlexForm', ... |
# -*- coding: utf-8 -*-
# ====================================== #
# @Author : <NAME>
# @Email : <EMAIL>
# @File : kinetic.py
# ALL RIGHTS ARE RESERVED UNLESS STATED.
# ====================================== #
from pyGTOInt.core.AnalyticInteg.gtoMath import norm_GTO, K_GTO
from pyGTOInt.core.AnalyticInteg.overl... | [
"pyGTOInt.core.AnalyticInteg.gtoMath.norm_GTO",
"pyGTOInt.core.AnalyticInteg.gtoMath.K_GTO",
"time.time",
"numpy.array",
"pyGTOInt.core.AnalyticInteg.overlap._Sij"
] | [((1019, 1037), 'pyGTOInt.core.AnalyticInteg.gtoMath.K_GTO', 'K_GTO', (['a', 'b', 'dAB_2'], {}), '(a, b, dAB_2)\n', (1024, 1037), False, 'from pyGTOInt.core.AnalyticInteg.gtoMath import norm_GTO, K_GTO\n'), ((2779, 2798), 'numpy.array', 'np.array', (['[0, 0, 0]'], {}), '([0, 0, 0])\n', (2787, 2798), True, 'import numpy... |
import logging
from typing import Union
LoggerType = logging.Logger
def create_logger(name: str, log_level: Union[str, int]) -> LoggerType:
"""
return a logger configured with name and log_level
"""
logger = logging.getLogger(name)
logger.setLevel(log_level)
if not logger.hasHandlers():
... | [
"logging.getLogger",
"logging.StreamHandler",
"logging.Formatter"
] | [((227, 250), 'logging.getLogger', 'logging.getLogger', (['name'], {}), '(name)\n', (244, 250), False, 'import logging\n'), ((333, 356), 'logging.StreamHandler', 'logging.StreamHandler', ([], {}), '()\n', (354, 356), False, 'import logging\n'), ((377, 409), 'logging.Formatter', 'logging.Formatter', (['"""%(message)s"""... |
"""NLP module tests."""
import unittest
from namebot import nlp
class NLPTestCase(unittest.TestCase):
def test_create_synset_basic(self):
res = nlp.get_synsets(['potato'])
self.assertIsInstance(res, dict)
for synset, vals in res.iteritems():
self.assertIsInstance(vals, dict)... | [
"namebot.nlp.get_verb_lemmas",
"namebot.nlp._get_synset_words",
"namebot.nlp.get_synsets",
"namebot.nlp.get_synsets_definitions"
] | [((161, 188), 'namebot.nlp.get_synsets', 'nlp.get_synsets', (["['potato']"], {}), "(['potato'])\n", (176, 188), False, 'from namebot import nlp\n'), ((460, 499), 'namebot.nlp.get_synsets_definitions', 'nlp.get_synsets_definitions', (["['potato']"], {}), "(['potato'])\n", (487, 499), False, 'from namebot import nlp\n'),... |
from application.db_utils import pool
def removeEntry(_sIdentifier, _sColumn, _sTable):
try:
conn = pool.connection()
cursor = conn.cursor()
cursor.execute("""DELETE FROM %s WHERE %s = %s""",(_sTable, _sColumn,
_sTable))
except:
return False
return True
def ge... | [
"db_utils.pool.connection",
"dotenv.load_dotenv"
] | [((1302, 1319), 'db_utils.pool.connection', 'pool.connection', ([], {}), '()\n', (1317, 1319), False, 'from db_utils import pool\n'), ((2344, 2361), 'db_utils.pool.connection', 'pool.connection', ([], {}), '()\n', (2359, 2361), False, 'from db_utils import pool\n'), ((2549, 2566), 'db_utils.pool.connection', 'pool.conn... |
from Instrucciones.Excepcion import Excepcion
from Instrucciones.TablaSimbolos.Instruccion import Instruccion
from Instrucciones.PLpgSQL import Exit
class For(Instruccion):
def __init__(self, indice, reverse, rango, cambio, sentencias, label, strGram, linea, columna):
Instruccion.__init__(self, None, linea... | [
"Instrucciones.TablaSimbolos.Instruccion.Instruccion.__init__",
"Instrucciones.Excepcion.Excepcion"
] | [((282, 339), 'Instrucciones.TablaSimbolos.Instruccion.Instruccion.__init__', 'Instruccion.__init__', (['self', 'None', 'linea', 'columna', 'strGram'], {}), '(self, None, linea, columna, strGram)\n', (302, 339), False, 'from Instrucciones.TablaSimbolos.Instruccion import Instruccion\n'), ((1235, 1356), 'Instrucciones.E... |
import bpy
import olc.rename
# Function to draw pop up UI with custom messages
def ShowMessageBox(message = "", title = "Message Box", icon = 'INFO'):
def draw(self, context):
self.layout.label(text=message)
bpy.context.window_manager.popup_menu(draw, title = title, icon = icon)
# Classes to implement... | [
"bpy.utils.unregister_class",
"bpy.utils.register_class",
"bpy.context.window_manager.popup_menu",
"bpy.props.IntProperty",
"bpy.props.StringProperty"
] | [((225, 292), 'bpy.context.window_manager.popup_menu', 'bpy.context.window_manager.popup_menu', (['draw'], {'title': 'title', 'icon': 'icon'}), '(draw, title=title, icon=icon)\n', (262, 292), False, 'import bpy\n'), ((550, 604), 'bpy.props.StringProperty', 'bpy.props.StringProperty', ([], {'name': '"""Look For:"""', 'd... |
from __main__ import vtk, qt, ctk, slicer
import logging
import os
# TrainUS parameters
import TrainUSLib.TrainUSParameters as Parameters
#------------------------------------------------------------------------------
#
# HardwareSelection
#
#---------------------------------------------------------------------------... | [
"os.path.join",
"__main__.slicer.util.childWidgetVariables",
"__main__.qt.QVBoxLayout",
"TrainUSLib.TrainUSParameters.instance.setParameter",
"__main__.slicer.util.loadUI",
"TrainUSLib.TrainUSParameters.instance.getParameterString",
"logging.debug"
] | [((733, 775), 'logging.debug', 'logging.debug', (['"""HardwareSelection.cleanup"""'], {}), "('HardwareSelection.cleanup')\n", (746, 775), False, 'import logging\n'), ((907, 949), 'logging.debug', 'logging.debug', (['"""HardwareSelection.setupUi"""'], {}), "('HardwareSelection.setupUi')\n", (920, 949), False, 'import lo... |
'''valor = 0
while True:
número = int(input('Digite um número: '))
if número % 2 != 0:
valor = 1 #ímpar
else:
valor = 2 #par
resp = str(input('É ímpar ou par: ')).strip().lower()[0]
if ((resp == 'í' or resp == 'i') and valor == 1) or (resp == 'p' and valor == 2):
print('Você... | [
"random.randint"
] | [((451, 465), 'random.randint', 'randint', (['(0)', '(10)'], {}), '(0, 10)\n', (458, 465), False, 'from random import randint\n')] |
from django.shortcuts import render
from apps.Summarize import main
from django.shortcuts import redirect
from django.core.files.storage import FileSystemStorage
from apps import views
def index(request):
return render(request,'apps/index.html')
def ketik(request):
return render(request,'apps/unggah.html')
de... | [
"django.core.files.storage.FileSystemStorage",
"django.shortcuts.render",
"apps.Summarize.main.ketik",
"apps.Summarize.main.main"
] | [((216, 250), 'django.shortcuts.render', 'render', (['request', '"""apps/index.html"""'], {}), "(request, 'apps/index.html')\n", (222, 250), False, 'from django.shortcuts import render\n'), ((282, 317), 'django.shortcuts.render', 'render', (['request', '"""apps/unggah.html"""'], {}), "(request, 'apps/unggah.html')\n", ... |
from django.core.management.base import BaseCommand, CommandError
from marketgrab.models import Data, MovingAvg, Movements
from django.db.models import Avg, Min, Max
from django.conf import *
import datetime
import time
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import numpy as np
class Command(Ba... | [
"matplotlib.pyplot.grid",
"django.db.models.Max",
"matplotlib.pyplot.figure",
"numpy.arange",
"matplotlib.mlab.normpdf",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.xlabel",
"marketgrab.models.Data.objects.filter",
"django.db.models.Avg",
"matplotlib.pyplot.close",
"matplotlib.pyplot.tight_layo... | [((654, 686), 'numpy.array', 'np.array', (['[i.date for i in data]'], {}), '([i.date for i in data])\n', (662, 686), True, 'import numpy as np\n'), ((703, 743), 'numpy.array', 'np.array', (['[i.aclose_price for i in data]'], {}), '([i.aclose_price for i in data])\n', (711, 743), True, 'import numpy as np\n'), ((756, 77... |
import time
import sys
sys.path.insert(0, './runner/')
from Programs import Program
from Enviroment import Enviroment
def main():
programs = Program.getPrograms()
for program in programs:
program.getExecuted();
program.execute([]);
program.save();
for program in programs:
program.makeResults();
if __name... | [
"Programs.Program.getPrograms",
"sys.path.insert"
] | [((23, 54), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""./runner/"""'], {}), "(0, './runner/')\n", (38, 54), False, 'import sys\n'), ((144, 165), 'Programs.Program.getPrograms', 'Program.getPrograms', ([], {}), '()\n', (163, 165), False, 'from Programs import Program\n')] |
# Data Preprocessing and Cleaning Script
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import os, requests, webbrowser
import xlrd
from datetime import datetime
datafile = os.path.join(os.path.dirname(os.getcwd()), "dataset", "air-quality-london-mean-roadside.xlsx")
sheet_name = "london-me... | [
"pandas.read_excel",
"os.getcwd",
"pandas.datetime.combine",
"sklearn.preprocessing.Imputer"
] | [((638, 683), 'pandas.read_excel', 'pd.read_excel', (['datafile'], {'sheetname': 'sheet_name'}), '(datafile, sheetname=sheet_name)\n', (651, 683), True, 'import pandas as pd\n'), ((783, 831), 'sklearn.preprocessing.Imputer', 'Imputer', ([], {'missing_values': '"""NaN"""', 'strategy': '"""median"""'}), "(missing_values=... |
# -*- coding: utf-8 -*-
"""
【简介】
自动化测试用例
"""
import sys
import unittest
import HTMLTestRunner
import time
from PyQt5.QtWidgets import *
from PyQt5.QtTest import QTest
from PyQt5.QtCore import Qt , QThread , pyqtSignal
import CallMatrixWinUi
# 继承 QThread 类
class BackWorkThread(QThread):
# 声明一个信号,同时返回一个... | [
"PyQt5.QtTest.QTest.keyClicks",
"PyQt5.QtTest.QTest.mouseClick",
"CallMatrixWinUi.CallMatrixWinUi",
"unittest.main",
"unittest.TestSuite",
"PyQt5.QtCore.pyqtSignal",
"time.sleep",
"unittest.TextTestRunner"
] | [((340, 355), 'PyQt5.QtCore.pyqtSignal', 'pyqtSignal', (['str'], {}), '(str)\n', (350, 355), False, 'from PyQt5.QtCore import Qt, QThread, pyqtSignal\n'), ((7525, 7540), 'unittest.main', 'unittest.main', ([], {}), '()\n', (7538, 7540), False, 'import unittest\n'), ((7591, 7611), 'unittest.TestSuite', 'unittest.TestSuit... |
from fastapi import FastAPI, WebSocket, WebSocketDisconnect
from fastapi.middleware.cors import CORSMiddleware
from typing import Optional
from tinydb import TinyDB, Query
from pydantic import BaseModel
import hashlib, uuid, json, traceback, requests
from classes.utils import Utils
from classes.connection_manager impo... | [
"tinydb.TinyDB",
"json.loads",
"json.dumps",
"tinydb.Query",
"classes.connection_manager.ConnectionManager",
"fastapi.FastAPI",
"uuid.uuid4",
"traceback.print_exc"
] | [((438, 462), 'tinydb.TinyDB', 'TinyDB', (['"""./data/db.json"""'], {}), "('./data/db.json')\n", (444, 462), False, 'from tinydb import TinyDB, Query\n'), ((522, 531), 'fastapi.FastAPI', 'FastAPI', ([], {}), '()\n', (529, 531), False, 'from fastapi import FastAPI, WebSocket, WebSocketDisconnect\n'), ((2591, 2610), 'cla... |
# *****************************************************************
# Copyright 2013 MIT Lincoln Laboratory
# Project: SPAR
# Authors: SY
# Description: Section class
#
#
# Modifications:
# Date Name Modification
# ---- ---- ... | [
"spar_python.report_generation.common.regression.regress",
"logging.getLogger",
"spar_python.report_generation.common.graphing.box_plot",
"spar_python.report_generation.common.latex_classes.LatexImage"
] | [((868, 895), 'logging.getLogger', 'logging.getLogger', (['__file__'], {}), '(__file__)\n', (885, 895), False, 'import logging\n'), ((5810, 5854), 'spar_python.report_generation.common.graphing.box_plot', 'graphing.box_plot', (['""""""', 'inputs'], {'y_scale': '"""log"""'}), "('', inputs, y_scale='log')\n", (5827, 5854... |
from setuptools import setup, find_packages
long_description = 'Traceroute with Python for Windows & Linux'
setup(
name ='traceroute-imt',
version ='1.5.0',
author ='<NAME>',
author_email ='<EMAIL>',
description ='Traceroute with Python for Windows and Linux',
... | [
"setuptools.find_packages"
] | [((461, 476), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (474, 476), False, 'from setuptools import setup, find_packages\n')] |
import pandas as pd
import requests
from lxml import html
tarot_cards = pd.read_csv("tarot.csv")
def fetch_content(url):
print(f"FETCHING {url}")
res = requests.get(url)
tree = html.fromstring(res.content)
xpath = "(//*[not(self::script or self::style)]/text()[string-length() > 50])"
output = "\n... | [
"pandas.read_csv",
"lxml.html.fromstring",
"requests.get"
] | [((73, 97), 'pandas.read_csv', 'pd.read_csv', (['"""tarot.csv"""'], {}), "('tarot.csv')\n", (84, 97), True, 'import pandas as pd\n'), ((163, 180), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (175, 180), False, 'import requests\n'), ((192, 220), 'lxml.html.fromstring', 'html.fromstring', (['res.content'], ... |
import csv
import obonet
import sys
sys.path.append("./")
class KnowledgeBase:
"""Class representing a knowledge base.
Attributes
----------
kb (str): the knowledge base to represent, including "hp", "medic", "ctd_anatomy", "ctd_chemicals", "chebi", "go_bp"
Methods
-------
... | [
"sys.path.append",
"csv.reader",
"obonet.read_obo"
] | [((37, 58), 'sys.path.append', 'sys.path.append', (['"""./"""'], {}), "('./')\n", (52, 58), False, 'import sys\n'), ((1470, 1495), 'obonet.read_obo', 'obonet.read_obo', (['filepath'], {}), '(filepath)\n', (1485, 1495), False, 'import obonet\n'), ((3963, 3998), 'csv.reader', 'csv.reader', (['kb_file'], {'delimiter': '""... |
#setup
import math
from matplotlib import cm
from matplotlib import gridspec
from matplotlib import pyplot as plt
import pandas as pd
import numpy as np
import tensorflow as tf
from tensorflow.python.data import Dataset
tf.logging.set_verbosity(tf.logging.ERROR)
pd.set_option('display.max_row', 10)
pd.set_option('disp... | [
"tensorflow.logging.set_verbosity",
"tensorflow.feature_column.numeric_column",
"numpy.random.permutation",
"pandas.set_option",
"pandas.read_csv"
] | [((221, 263), 'tensorflow.logging.set_verbosity', 'tf.logging.set_verbosity', (['tf.logging.ERROR'], {}), '(tf.logging.ERROR)\n', (245, 263), True, 'import tensorflow as tf\n'), ((264, 300), 'pandas.set_option', 'pd.set_option', (['"""display.max_row"""', '(10)'], {}), "('display.max_row', 10)\n", (277, 300), True, 'im... |
#!/usr/bin/env python3
#
# Script to convert SCM AMV trajectory to xyz format trajectory
# by <NAME>
# 2020/10
#
# You can import the module and then call .main() or use it as a script
import sys, os, glob
from ase import io
def main(argv):
inFile = argv[0]
outFile = argv[1]
data = []
nAtoms = None
... | [
"sys.exit"
] | [((949, 960), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (957, 960), False, 'import sys, os, glob\n')] |
'''
Functions used to display important variables
'''
import numpy as np
import matplotlib.pyplot as plt
#incremental variable for the image saving
i = 0
def connectpoints(x,y):
'''
Draw a lign between a series of points
'''
for i in range(0, len(x), 1):
plt.plot(x[i:i+2], y[i:i+2], '... | [
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.draw",
"matplotlib.pyplot.show",
"matplotlib.pyplot.pause",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.close",
"matplotlib.pyplot.title",
"matplotlib.pyplot.quiver",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.plot"
] | [((454, 485), 'matplotlib.pyplot.plot', 'plt.plot', (['[x, xn]', '[y, yn]', '"""g"""'], {}), "([x, xn], [y, yn], 'g')\n", (462, 485), True, 'import matplotlib.pyplot as plt\n'), ((912, 975), 'matplotlib.pyplot.quiver', 'plt.quiver', (['*origin', 'V[0]', 'V[1]'], {'color': "['r', 'b', 'g']", 'scale': '(1)'}), "(*origin,... |
#!/usr/bin/python
# X(t) = X0 * exp{x(t)}
#
# We use extended state variables Y = [ x, (z), mu, volAdj ],
#
# dx(t) = [mu - 0.5*sigma^2]dt + sigma dW
# dr_d(t) = 0 dt (domestic rates)
# dr_f(t) = 0 dt (foreign rates)
# dz(t) = 0 dt (stochastic volatility, currently not implemented)
# m... | [
"numpy.sqrt",
"numpy.array",
"numpy.exp"
] | [((829, 844), 'numpy.array', 'np.array', (['[0.0]'], {}), '([0.0])\n', (837, 844), True, 'import numpy as np\n'), ((1207, 1219), 'numpy.exp', 'np.exp', (['Y[0]'], {}), '(Y[0])\n', (1213, 1219), True, 'import numpy as np\n'), ((1135, 1146), 'numpy.sqrt', 'np.sqrt', (['dt'], {}), '(dt)\n', (1142, 1146), True, 'import num... |
from unittest import TestCase
import unittest
from equadratures import *
import numpy as np
from scipy.stats import skew, kurtosis
def rosenbrock_fun(x):
return (1 - x[0])**2 + 100*(x[1] - x[0]**2)**2
def phi(x):
return np.sqrt(3) * x
def fun(X):
x = phi(X)
return 0.1 + 0.2 * x[0] + 0.3 * x[1] * x[2] +... | [
"numpy.testing.assert_array_less",
"unittest.main",
"numpy.random.rand",
"scipy.stats.skew",
"numpy.random.uniform",
"numpy.vstack",
"numpy.random.randn",
"numpy.sqrt",
"numpy.var",
"numpy.abs",
"numpy.mean",
"numpy.random.seed",
"numpy.testing.assert_almost_equal"
] | [((6448, 6463), 'unittest.main', 'unittest.main', ([], {}), '()\n', (6461, 6463), False, 'import unittest\n'), ((229, 239), 'numpy.sqrt', 'np.sqrt', (['(3)'], {}), '(3)\n', (236, 239), True, 'import numpy as np\n'), ((1275, 1295), 'numpy.mean', 'np.mean', (['model_evals'], {}), '(model_evals)\n', (1282, 1295), True, 'i... |
import markdown2
from jinja2 import Environment, PackageLoader, select_autoescape
from slugify import slugify
from iteration_utilities import unique_everseen
import os
from os.path import join
from livereload import Server
import sys
import shutil
from datetime import datetime
import config
def abs_path(path):
pa... | [
"os.path.join",
"markdown2.markdown_path",
"os.listdir",
"jinja2.PackageLoader",
"datetime.datetime.strptime",
"os.path.abspath",
"asyncio.WindowsSelectorEventLoopPolicy",
"sys.platform.startswith",
"asyncio.get_event_loop_policy",
"livereload.Server",
"jinja2.select_autoescape",
"iteration_ut... | [((386, 409), 'os.path.join', 'join', (['package_dir', 'path'], {}), '(package_dir, path)\n', (390, 409), False, 'from os.path import join\n'), ((9270, 9314), 'os.makedirs', 'os.makedirs', (['all_pages_folder'], {'exist_ok': '(True)'}), '(all_pages_folder, exist_ok=True)\n', (9281, 9314), False, 'import os\n'), ((9319,... |
"""Code for loading trajectory data and rotating, interpolating and translating it"""
import pathlib
import glob
from typing import List, Dict
import numpy as np
from scipy.spatial.transform import Rotation as Rot
from scipy import interpolate
rot = Rot.from_euler("x", -23.5, degrees=True)
class SplRep:
def __i... | [
"scipy.spatial.transform.Rotation.from_euler",
"scipy.interpolate.splrep",
"pathlib.Path",
"numpy.dtype",
"scipy.interpolate.splev",
"numpy.fromfile",
"numpy.arange"
] | [((252, 292), 'scipy.spatial.transform.Rotation.from_euler', 'Rot.from_euler', (['"""x"""', '(-23.5)'], {'degrees': '(True)'}), "('x', -23.5, degrees=True)\n", (266, 292), True, 'from scipy.spatial.transform import Rotation as Rot\n'), ((4066, 4128), 'numpy.dtype', 'np.dtype', (["[('x', 'f8'), ('y', 'f8'), ('z', 'f8'),... |
# -*- coding: utf-8 -*-
"""TensorFlow_1.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/11EsCDRpNZNLh76haYtB7Rn3deot1n4sH
## Importing all Dependencies
"""
import matplotlib.pyplot as plt
import tensorflow as tf
import numpy as np
from sklearn.m... | [
"tensorflow.truncated_normal",
"tensorflow.nn.softmax_cross_entropy_with_logits_v2",
"numpy.arange",
"matplotlib.pyplot.xlabel",
"tensorflow.cast",
"tensorflow.Session",
"tensorflow.reduce_mean",
"matplotlib.pyplot.show",
"tensorflow.argmax",
"matplotlib.pyplot.tight_layout",
"tensorflow.nn.soft... | [((666, 693), 'sklearn.preprocessing.OneHotEncoder', 'OneHotEncoder', ([], {'sparse': '(False)'}), '(sparse=False)\n', (679, 693), False, 'from sklearn.preprocessing import OneHotEncoder\n'), ((1742, 1771), 'numpy.argmax', 'np.argmax', (['testY[0:9]'], {'axis': '(1)'}), '(testY[0:9], axis=1)\n', (1751, 1771), True, 'im... |
from flask import Flask, jsonify, request
import tensorflow as tf
import tensorflow_hub as hub
import sys
import logging
from healthcheck import HealthCheck
app = Flask(__name__)
logging.basicConfig(filename="flask.log", level=logging.DEBUG,
format="%(asctime)s %(levelname)s %(name)s %(threadName)s : ... | [
"tensorflow_hub.load",
"logging.basicConfig",
"flask.jsonify",
"flask.request.args.get",
"healthcheck.HealthCheck",
"flask.Flask",
"flask.request.get_json"
] | [((164, 179), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (169, 179), False, 'from flask import Flask, jsonify, request\n'), ((180, 321), 'logging.basicConfig', 'logging.basicConfig', ([], {'filename': '"""flask.log"""', 'level': 'logging.DEBUG', 'format': '"""%(asctime)s %(levelname)s %(name)s %(thread... |
import json
import os
import torch
from torch.utils.data import TensorDataset
from functools import partial
from multiprocessing import Pool, cpu_count
from transformers.data.processors.squad import (
squad_convert_example_to_features,
squad_convert_example_to_features_init,
SquadExample,
DataProcessor... | [
"os.path.join",
"torch.utils.data.TensorDataset",
"kitanaqa.get_logger",
"functools.partial",
"multiprocessing.cpu_count",
"json.load",
"multiprocessing.Pool",
"torch.tensor",
"transformers.data.processors.squad.SquadExample",
"tqdm.tqdm"
] | [((532, 544), 'kitanaqa.get_logger', 'get_logger', ([], {}), '()\n', (542, 544), False, 'from kitanaqa import get_logger\n'), ((2219, 2230), 'multiprocessing.cpu_count', 'cpu_count', ([], {}), '()\n', (2228, 2230), False, 'from multiprocessing import Pool, cpu_count\n'), ((2241, 2334), 'multiprocessing.Pool', 'Pool', (... |
import datetime
import os
import re
import time
from random import Random
import dask
import dask.array as da
import joblib
import numpy as np
import pandas as pd
import xarray as xr
from dask import delayed
from nltk.stem.porter import PorterStemmer
from sklearn.datasets import make_classification
from sklearn.featur... | [
"wordbatch.extractors.WordBag",
"wordbatch.transformers.Dictionary",
"numpy.sum",
"pandas.read_csv",
"wordbatch.transformers.Tokenizer",
"os.makedirs",
"dask.datasets.make_people",
"re.compile",
"datetime.datetime",
"dask.visualize",
"dask.array.random.random",
"wordbatch.batcher.Batcher",
"... | [((647, 667), 're.compile', 're.compile', (['"""[\\\\W+]"""'], {}), "('[\\\\W+]')\n", (657, 667), False, 'import re\n'), ((678, 706), 're.compile', 're.compile', (['"""\\\\W*[0-9]+\\\\W*"""'], {}), "('\\\\W*[0-9]+\\\\W*')\n", (688, 706), False, 'import re\n'), ((719, 745), 're.compile', 're.compile', (['"""(\\\\w)\\\\1... |
import sys
from tkinter import N
from wordle_solver import *
solver = WordleSolver()
if len(sys.argv) < 3:
msg = "\
First argument:\n\
A comma-sep-string of size WORD_SIZE (e.g. 5). Each token should be 1-2 chars in length. Valid tokens:\n\
1) ? -> An unknown position\n\
... | [
"sys.exit"
] | [((811, 822), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (819, 822), False, 'import sys\n')] |
# -*- coding: utf-8 -*-
from pmdarima.datasets import load_heartrate, load_lynx, load_wineind,\
load_woolyrnq, load_ausbeer, load_austres, load_gasoline, \
load_airpassengers, load_taylor, load_msft, load_sunspots, _base as base
import numpy as np
import pandas as pd
import os
import shutil
from numpy.testin... | [
"os.path.join",
"pmdarima.datasets._base._cache.pop",
"pmdarima.datasets._base.get_data_cache_path",
"os.path.exists",
"pytest.mark.parametrize",
"shutil.rmtree",
"numpy.testing.assert_array_equal",
"pytest.param"
] | [((805, 961), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""f"""', '[load_heartrate, load_lynx, load_wineind, load_woolyrnq, load_ausbeer,\n load_austres, load_taylor, load_airpassengers]'], {}), "('f', [load_heartrate, load_lynx, load_wineind,\n load_woolyrnq, load_ausbeer, load_austres, load_taylo... |
import numpy as np
import tensorflow as tf
import cv2 # 用来读取图片并进行预处理
import glob # 读取某文件夹所有测试图片
import time # 主要是用来计算推理花费时间
# Load TFLite model and allocate tensors.
model_path = "./ckpt/output.tflite" # tflite路径
interpreter = tf.lite.Interpreter(model_path)
interpreter.allocate_tensors()
input_details = interpre... | [
"cv2.waitKey",
"cv2.resize",
"cv2.rectangle",
"cv2.imread",
"glob.glob",
"time.time",
"tensorflow.lite.Interpreter",
"cv2.destroyAllWindows",
"numpy.expand_dims"
] | [((232, 263), 'tensorflow.lite.Interpreter', 'tf.lite.Interpreter', (['model_path'], {}), '(model_path)\n', (251, 263), True, 'import tensorflow as tf\n'), ((1416, 1443), 'glob.glob', 'glob.glob', (['"""./JPEGImages/*"""'], {}), "('./JPEGImages/*')\n", (1425, 1443), False, 'import glob\n'), ((501, 532), 'cv2.resize', '... |
# -*- coding: utf-8 -*-
import copy
import importlib.resources as res
import json
import logging
import pandas as pd
import re
from .. import DATA_DIR, LOG_FORMAT, METADATA_DIR
from ..data import utils
from Levenshtein import jaro_winkler
from shapely.geometry import Point, Polygon
from sklearn.metrics.pairwise import ... | [
"shapely.geometry.Point",
"copy.deepcopy",
"logging.getLogger",
"Levenshtein.jaro_winkler",
"json.dump",
"importlib.resources.path",
"json.load",
"logging.basicConfig",
"pandas.Series",
"pandas.DataFrame",
"sklearn.metrics.pairwise.cosine_similarity",
"shapely.geometry.Polygon",
"sklearn.fea... | [((3998, 4039), 'pandas.DataFrame', 'pd.DataFrame', ([], {'data': 'names', 'columns': 'headers'}), '(data=names, columns=headers)\n', (4010, 4039), True, 'import pandas as pd\n'), ((4624, 4773), 'pandas.Series', 'pd.Series', (["{'name': match['full_name'], 'match_id': match['match_id'], 'match_name':\n match['match_... |
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
from datetime import datetime, timedelta
import pytest
from mock import MagicMock
from intelliflow.api_ext import *
from intelliflow.core.platform.definitions.compute import (
ComputeFailedSessionState,
Comp... | [
"pytest.raises",
"intelliflow.utils.test.data_emulation.add_test_data",
"datetime.timedelta",
"datetime.datetime.now"
] | [((5829, 5843), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (5841, 5843), False, 'from datetime import datetime, timedelta\n'), ((7953, 7967), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (7965, 7967), False, 'from datetime import datetime, timedelta\n'), ((9693, 9766), 'intelliflow.utils.t... |
import setuptools
setuptools.setup(
name="ursadb",
version="1.0",
author="msm",
author_email="<EMAIL>",
description="ursadb",
url="https://github.com/CERT-Polska/ursadb-cli",
packages=["ursadb"],
scripts=['bin/ursaclient'],
include_package_data=True,
classifiers=[
"Progr... | [
"setuptools.setup"
] | [((19, 408), 'setuptools.setup', 'setuptools.setup', ([], {'name': '"""ursadb"""', 'version': '"""1.0"""', 'author': '"""msm"""', 'author_email': '"""<EMAIL>"""', 'description': '"""ursadb"""', 'url': '"""https://github.com/CERT-Polska/ursadb-cli"""', 'packages': "['ursadb']", 'scripts': "['bin/ursaclient']", 'include_... |
"""Property
A container to store and process general property's defined by the user.
Provides a simple interface to define new properties.
This container stores all relevant info required for a specific
property and provides methods to evaluate propertys based on specfic
dependencies such as temperature, pressure, ... | [
"sympy.parsing.sympy_parser.parse_expr",
"snapReactors.functions.checkerrors._isstr",
"numpy.linspace",
"numpy.matrix",
"numpy.where",
"snapReactors.functions.checkerrors._isnumber",
"snapReactors.functions.checkerrors._isnonnegative",
"bisect.bisect_left",
"snapReactors.functions.parameters.ALLOWED... | [((4280, 4310), 'snapReactors.functions.checkerrors._isstr', '_isstr', (['id', '"""property name/id"""'], {}), "(id, 'property name/id')\n", (4286, 4310), False, 'from snapReactors.functions.checkerrors import _isstr, _isarray, _explengtharray, _isnonnegativearray, _isnumber, _isnonnegative\n'), ((4319, 4354), 'snapRea... |
import argparse
import json
from pathlib import Path
from typing import Dict, List, Tuple
import cv2
import numpy as np
from tqdm import tqdm
def paths2ids(paths: List[Path]) -> Dict[str, Path]:
return {x.stem: x for x in paths}
def get_mask(size: Tuple[int, int], label: dict) -> np.ndarray:
mask = np.zero... | [
"argparse.ArgumentParser",
"json.load",
"numpy.zeros",
"cv2.fillPoly",
"numpy.array"
] | [((313, 327), 'numpy.zeros', 'np.zeros', (['size'], {}), '(size)\n', (321, 327), True, 'import numpy as np\n'), ((340, 363), 'numpy.array', 'np.array', (["label['quad']"], {}), "(label['quad'])\n", (348, 363), True, 'import numpy as np\n'), ((376, 410), 'cv2.fillPoly', 'cv2.fillPoly', (['mask', '[poly]', '(255,)'], {})... |
from datetime import datetime
import json
from flask_sqlalchemy import SQLAlchemy
from server import escpos
db = SQLAlchemy()
class Table(db.Model):
name = db.Column(db.TEXT, primary_key=True)
waiter = db.Column(db.TEXT)
def as_dict(self):
return dict(
name=self.name,
waite... | [
"json.loads",
"json.dumps",
"flask_sqlalchemy.SQLAlchemy",
"datetime.datetime.now",
"server.escpos.reset",
"server.escpos.big"
] | [((113, 125), 'flask_sqlalchemy.SQLAlchemy', 'SQLAlchemy', ([], {}), '()\n', (123, 125), False, 'from flask_sqlalchemy import SQLAlchemy\n'), ((2563, 2584), 'json.loads', 'json.loads', (['self.menu'], {}), '(self.menu)\n', (2573, 2584), False, 'import json\n'), ((774, 790), 'json.dumps', 'json.dumps', (['menu'], {}), '... |
# coding:utf-8
from flask import Flask
from flask import request
import requests
import json
import re
import logging
#from apscheduler.schedulers.blocking import BlockingScheduler
from datetime import datetime
import pytz
import configparser
from tinydb import TinyDB, Query
from bs4 import BeautifulSoup
# create lo... | [
"tinydb.TinyDB",
"requests.get",
"json.dumps",
"datetime.datetime.now",
"tinydb.Query",
"pytz.timezone",
"logging.basicConfig",
"configparser.SafeConfigParser",
"re.search",
"logging.debug",
"flask.Flask",
"bs4.BeautifulSoup"
] | [((403, 443), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG'}), '(level=logging.DEBUG)\n', (422, 443), False, 'import logging\n'), ((452, 467), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (457, 467), False, 'from flask import Flask\n'), ((494, 525), 'configparser.SafeConfig... |
import struct
def rf(file, format):
answer = struct.unpack(format, file.read(struct.calcsize(format)))
return answer[0] if len(answer) == 1 else answer
def rf_str(file):
string = b''
while True:
char = struct.unpack('<c', file.read(1))[0]
if char == b'\x00':
break
s... | [
"struct.calcsize",
"struct.pack"
] | [((422, 448), 'struct.pack', 'struct.pack', (['format', '*args'], {}), '(format, *args)\n', (433, 448), False, 'import struct\n'), ((82, 105), 'struct.calcsize', 'struct.calcsize', (['format'], {}), '(format)\n', (97, 105), False, 'import struct\n')] |
# Copyright 2017 QuantRocket - All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
"quantrocket.houston.houston.put",
"quantrocket.exceptions.DataInsertionError",
"quantrocket.cli.utils.output.json_to_cli",
"os.remove",
"quantrocket.houston.houston.get",
"getpass.getpass",
"time.time",
"quantrocket.houston.houston.post",
"quantrocket.houston.houston.raise_for_status_with_json"
] | [((1970, 2013), 'quantrocket.houston.houston.get', 'houston.get', (['"""/db/databases"""'], {'params': 'params'}), "('/db/databases', params=params)\n", (1981, 2013), False, 'from quantrocket.houston import houston\n'), ((2018, 2062), 'quantrocket.houston.houston.raise_for_status_with_json', 'houston.raise_for_status_w... |
# coding: utf-8
import random
import unittest
from algorithms.searching.linear_search import linear_search
class TestCase(unittest.TestCase):
def test(self):
array = [random.randint(-100, 100) for i in range(10000)]
target = random.choice(array)
expected = array.index(target)
self... | [
"algorithms.searching.linear_search.linear_search",
"random.choice",
"random.randint",
"unittest.main"
] | [((749, 764), 'unittest.main', 'unittest.main', ([], {}), '()\n', (762, 764), False, 'import unittest\n'), ((248, 268), 'random.choice', 'random.choice', (['array'], {}), '(array)\n', (261, 268), False, 'import random\n'), ((182, 207), 'random.randint', 'random.randint', (['(-100)', '(100)'], {}), '(-100, 100)\n', (196... |
import numpy as np
from matplotlib import pyplot as plt
from sklearn import datasets
from sklearn.linear_model import SGDRegressor
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
from sklearn.metrics import r2_score
from sklearn.metrics import mean_squared_error
b... | [
"sklearn.metrics.mean_squared_error",
"matplotlib.pyplot.scatter",
"numpy.dot",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylabel",
"sklearn.preprocessing.StandardScaler",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",... | [((363, 385), 'sklearn.datasets.load_boston', 'datasets.load_boston', ([], {}), '()\n', (383, 385), False, 'from sklearn import datasets\n'), ((518, 565), 'sklearn.model_selection.train_test_split', 'train_test_split', (['data_x', 'data_y'], {'test_size': '(0.2)'}), '(data_x, data_y, test_size=0.2)\n', (534, 565), Fals... |
from django.contrib.gis import forms
from . import models
class MyGeoForm(forms.Form):
class Meta:
model = models.WorldBorder
mpoly = forms.MultiPolygonField(widget=
forms.OSMWidget(attrs={'map_width': 800, 'map_height': 500})) | [
"django.contrib.gis.forms.OSMWidget"
] | [((192, 252), 'django.contrib.gis.forms.OSMWidget', 'forms.OSMWidget', ([], {'attrs': "{'map_width': 800, 'map_height': 500}"}), "(attrs={'map_width': 800, 'map_height': 500})\n", (207, 252), False, 'from django.contrib.gis import forms\n')] |
#
# (C) Copyright 2000- NOAA.
#
# (C) Copyright 2000- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of ... | [
"makaniino.learning.models.unet.unet",
"copy.deepcopy",
"logging.getLogger"
] | [((536, 574), 'logging.getLogger', 'logging.getLogger', (['"""trans_learn_model"""'], {}), "('trans_learn_model')\n", (553, 574), False, 'import logging\n'), ((764, 801), 'copy.deepcopy', 'copy.deepcopy', (['MLModel.default_params'], {}), '(MLModel.default_params)\n', (777, 801), False, 'import copy\n'), ((1928, 2483),... |
from collections import namedtuple
from . import parse_cctray
from .data_access import get_connection
from .go_client import go_client
def get_previous_stage(current_stage):
result = get_connection().fetch_previous_stage(current_stage.pipeline_name, current_stage.pipeline_counter,
... | [
"collections.namedtuple"
] | [((3881, 4123), 'collections.namedtuple', 'namedtuple', (['"""GraphData"""', "['pipeline_name', 'pipeline_counter', 'stage_counter', 'stage_name',\n 'stage_result', 'job_name', 'scheduled_date', 'job_result',\n 'failure_stage', 'agent_name', 'tests_run', 'tests_failed', 'tests_skipped'\n ]"], {}), "('GraphData... |
"""
Django admin page for waffle utils models
"""
from django.contrib import admin
from config_models.admin import KeyedConfigurationModelAdmin
from .forms import WaffleFlagCourseOverrideAdminForm
from .models import WaffleFlagCourseOverrideModel
class WaffleFlagCourseOverrideAdmin(KeyedConfigurationModelAdmin):
... | [
"django.contrib.admin.site.register"
] | [((794, 879), 'django.contrib.admin.site.register', 'admin.site.register', (['WaffleFlagCourseOverrideModel', 'WaffleFlagCourseOverrideAdmin'], {}), '(WaffleFlagCourseOverrideModel,\n WaffleFlagCourseOverrideAdmin)\n', (813, 879), False, 'from django.contrib import admin\n')] |
import torch
from torch.utils.data import Dataset
from tqdm import tqdm
import colorsys
class SubClassDataset(Dataset):
def __init__(self, dataset, classes):
self.dataset = dataset
self.classes = classes
print('Subsampling dataset...')
self.indices = [i for i, (_, y) in enumerate(... | [
"torch.rand",
"torch.Tensor",
"torch.zeros",
"torch.randperm",
"torch.cat",
"tqdm.tqdm"
] | [((320, 333), 'tqdm.tqdm', 'tqdm', (['dataset'], {}), '(dataset)\n', (324, 333), False, 'from tqdm import tqdm\n'), ((1459, 1484), 'torch.cat', 'torch.cat', (['(half1, half2)'], {}), '((half1, half2))\n', (1468, 1484), False, 'import torch\n'), ((1295, 1329), 'torch.zeros', 'torch.zeros', (['(classes // 2)', '(3)', '(1... |
#! /usr/bin/python2
#### Multiple Timestep Prediction, extrapolate prednet predictions
#### Latest Revisions X. Du 2020/01
import hickle as hkl
import numpy as np
import os
from keras import backend as K
from keras.preprocessing.image import Iterator
from keras.models import Model, model_from_json
from keras.layers ... | [
"hickle.load",
"keras.models.Model",
"keras.models.model_from_json",
"keras.layers.Input",
"keras.callbacks.ModelCheckpoint",
"keras.backend.abs",
"keras.utils.multi_gpu_model",
"keras.callbacks.LearningRateScheduler"
] | [((1843, 1908), 'keras.models.model_from_json', 'model_from_json', (['json_string'], {'custom_objects': "{'PredNet': PredNet}"}), "(json_string, custom_objects={'PredNet': PredNet})\n", (1858, 1908), False, 'from keras.models import Model, model_from_json\n'), ((2561, 2579), 'keras.layers.Input', 'Input', (['input_shap... |
import pytest
from trailscraper.iam import Action
@pytest.mark.parametrize("test_input,expected", [
(Action('autoscaling', 'DescribeLaunchConfigurations'), "LaunchConfiguration"),
(Action('autoscaling', 'CreateLaunchConfiguration'), "LaunchConfiguration"),
(Action('autoscaling', 'DeleteLaunchConfiguratio... | [
"trailscraper.iam.Action"
] | [((108, 161), 'trailscraper.iam.Action', 'Action', (['"""autoscaling"""', '"""DescribeLaunchConfigurations"""'], {}), "('autoscaling', 'DescribeLaunchConfigurations')\n", (114, 161), False, 'from trailscraper.iam import Action\n'), ((192, 242), 'trailscraper.iam.Action', 'Action', (['"""autoscaling"""', '"""CreateLaunc... |
"""
Grok allows you to set up catalog indexes in your application with a
special indexes declaration.
Let's set up a site in which we manage a couple of objects::
>>> herd = Herd()
>>> getRootFolder()['herd'] = herd
>>> from zope.component.hooks import setSite
>>> setSite(herd)
Now we add some indexable obje... | [
"zope.interface.Attribute",
"zope.interface.implementer"
] | [((2585, 2606), 'zope.interface.implementer', 'implementer', (['IMammoth'], {}), '(IMammoth)\n', (2596, 2606), False, 'from zope.interface import Interface, Attribute, implementer\n'), ((2226, 2242), 'zope.interface.Attribute', 'Attribute', (['"""Age"""'], {}), "('Age')\n", (2235, 2242), False, 'from zope.interface imp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.