code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from keras_audio.library.utility.audio_utils import compute_melgram
from keras_audio.library.utility.gtzan_loader import download_gtzan_genres_if_not_found
import numpy as np
def load_audio_path_label_pairs(max_allowed_pairs=None):
download_gtzan_genres_if_not_found('../very_large_data/gtzan')
audio_paths = []... | [
"keras_audio.library.utility.gtzan_loader.download_gtzan_genres_if_not_found",
"keras_audio.library.utility.audio_utils.compute_melgram",
"numpy.min",
"numpy.max"
] | [((237, 299), 'keras_audio.library.utility.gtzan_loader.download_gtzan_genres_if_not_found', 'download_gtzan_genres_if_not_found', (['"""../very_large_data/gtzan"""'], {}), "('../very_large_data/gtzan')\n", (271, 299), False, 'from keras_audio.library.utility.gtzan_loader import download_gtzan_genres_if_not_found\n'), ... |
# Generated by Django 2.2.4 on 2019-08-04 21:33
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('feeds', '0004_webproxy'),
]
operations = [
migrations.AddField(
model_name='source',
name='description',
... | [
"django.db.models.TextField"
] | [((327, 366), 'django.db.models.TextField', 'models.TextField', ([], {'blank': '(True)', 'null': '(True)'}), '(blank=True, null=True)\n', (343, 366), False, 'from django.db import migrations, models\n')] |
from django.test import TestCase
from scheduler.idd import get_schedule
from tests.contexts import (
ShowContext,
ClassContext,
)
from tests.factories.scheduler_factories import LabelFactory
from scheduler.models import ResourceAllocation
class TestGetSchedule(TestCase):
def test_get_teacher_w_label(self... | [
"scheduler.idd.get_schedule",
"tests.contexts.ClassContext",
"scheduler.models.ResourceAllocation.objects.get",
"tests.contexts.ShowContext",
"tests.factories.scheduler_factories.LabelFactory"
] | [((341, 355), 'tests.contexts.ClassContext', 'ClassContext', ([], {}), '()\n', (353, 355), False, 'from tests.contexts import ShowContext, ClassContext\n'), ((374, 469), 'scheduler.models.ResourceAllocation.objects.get', 'ResourceAllocation.objects.get', ([], {'event': 'context.sched_event', 'resource__worker__role': '... |
import sys
from PIL import Image
imgs = [
'udg_estanteria_der_01',
'udg_estanteria_der_02',
'udg_estanteria_izq_01',
'udg_estanteria_izq_02',
'udg_estanteria_top_vacio',
'udg_jarron_flores',
'udg_jarron_der',
'udg_jarron_izq',
'udg_libro_inclinado_01',
'udg_libro_inclinado_02',
... | [
"PIL.Image.new",
"PIL.Image.open"
] | [((658, 701), 'PIL.Image.new', 'Image.new', (['"""RGB"""', '(total_width, max_height)'], {}), "('RGB', (total_width, max_height))\n", (667, 701), False, 'from PIL import Image\n'), ((517, 530), 'PIL.Image.open', 'Image.open', (['x'], {}), '(x)\n', (527, 530), False, 'from PIL import Image\n')] |
import requests
from ..utils.exceptions import BestBuyAPIError
from ..constants import (
API_SEARCH_PARAMS,
BASE_URL,
BULK_API,
STORE_SEARCH_PARAMS,
PRODUCT_SEARCH_PARAMS,
)
class BestBuyCore(object):
def __init__(self, api_key):
"""API's base class
:params:
:api_key (... | [
"requests.get"
] | [((696, 735), 'requests.get', 'requests.get', (['url'], {'params': 'valid_payload'}), '(url, params=valid_payload)\n', (708, 735), False, 'import requests\n')] |
# coding=utf-8
# Copyright 2018-2020 EVA
#
# 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 ... | [
"src.parser.table_ref.TableInfo",
"src.parser.select_statement.SelectStatement",
"pathlib.Path",
"src.parser.table_ref.TableRef",
"src.parser.create_statement.ColumnDefinition",
"src.utils.logging_manager.LoggingManager",
"unittest.main",
"src.parser.parser.Parser"
] | [((10135, 10150), 'unittest.main', 'unittest.main', ([], {}), '()\n', (10148, 10150), False, 'import unittest\n'), ((1278, 1286), 'src.parser.parser.Parser', 'Parser', ([], {}), '()\n', (1284, 1286), False, 'from src.parser.parser import Parser\n'), ((2033, 2041), 'src.parser.parser.Parser', 'Parser', ([], {}), '()\n',... |
from logging import getLogger
from urllib.parse import urlencode
from flask import Blueprint, abort, g, jsonify, request
from flask.views import MethodView
from flask_api.status import HTTP_404_NOT_FOUND
from flask_login import current_user
from flask_security.decorators import http_auth_required
from core import db
... | [
"logging.getLogger",
"flask.request.args.get",
"core.db.session.commit",
"flask.request.args.copy",
"processor.models.UriPrefix.query.filter_by",
"urllib.parse.urlencode",
"flask.jsonify",
"processor.models.Uri.query.filter",
"processor.models.Event.query.filter_by",
"flask.abort",
"user.tokens.... | [((670, 689), 'logging.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (679, 689), False, 'from logging import getLogger\n'), ((695, 740), 'flask.Blueprint', 'Blueprint', (['"""api"""', '__name__'], {'url_prefix': '"""/api"""'}), "('api', __name__, url_prefix='/api')\n", (704, 740), False, 'from flask impo... |
import sqlite3
import pkg_resources
def _db_connect():
db_path = pkg_resources.resource_filename("dhivehi_nlp", "data/dhivehi_nlp.db")
con = sqlite3.connect(db_path)
return con | [
"sqlite3.connect",
"pkg_resources.resource_filename"
] | [((71, 140), 'pkg_resources.resource_filename', 'pkg_resources.resource_filename', (['"""dhivehi_nlp"""', '"""data/dhivehi_nlp.db"""'], {}), "('dhivehi_nlp', 'data/dhivehi_nlp.db')\n", (102, 140), False, 'import pkg_resources\n'), ((151, 175), 'sqlite3.connect', 'sqlite3.connect', (['db_path'], {}), '(db_path)\n', (166... |
from setuptools import setup
setup(name='sparseMuJoCo',
version='1.0.0',
install_requires=['gym', 'mujoco-py']
)
| [
"setuptools.setup"
] | [((30, 116), 'setuptools.setup', 'setup', ([], {'name': '"""sparseMuJoCo"""', 'version': '"""1.0.0"""', 'install_requires': "['gym', 'mujoco-py']"}), "(name='sparseMuJoCo', version='1.0.0', install_requires=['gym',\n 'mujoco-py'])\n", (35, 116), False, 'from setuptools import setup\n')] |
"""Games, or Adversarial Search (Chapter 5)"""
import collections
import random
from utils import argmax
from canvas import Canvas
infinity = float('inf')
GameState = collections.namedtuple('GameState', 'to_move, utility, board, moves')
# _____________________________________________________________________________... | [
"collections.namedtuple",
"canvas.Canvas.__init__"
] | [((170, 239), 'collections.namedtuple', 'collections.namedtuple', (['"""GameState"""', '"""to_move, utility, board, moves"""'], {}), "('GameState', 'to_move, utility, board, moves')\n", (192, 239), False, 'import collections\n'), ((11014, 11063), 'canvas.Canvas.__init__', 'Canvas.__init__', (['self', 'varname', 'id', '... |
from os import environ
from sanic.log import logger
from sanic import Sanic
from sanic.request import Request
from sanic.response import HTTPResponse, text
import asyncio
import aio_pika
import ujson
AMQP_CONN_STRING = environ.get('AMQP_CONN_STRING')
AMQP_QUEUE = environ.get('AMQP_QUEUE')
AMQP_ORDERS_EXCHANGE = enviro... | [
"ujson.dumps",
"os.environ.get",
"sanic.log.logger.debug",
"sanic.Sanic",
"asyncio.get_event_loop",
"sanic.response.text"
] | [((220, 251), 'os.environ.get', 'environ.get', (['"""AMQP_CONN_STRING"""'], {}), "('AMQP_CONN_STRING')\n", (231, 251), False, 'from os import environ\n'), ((265, 290), 'os.environ.get', 'environ.get', (['"""AMQP_QUEUE"""'], {}), "('AMQP_QUEUE')\n", (276, 290), False, 'from os import environ\n'), ((314, 349), 'os.enviro... |
#!/usr/bin/python
import argparse
import nidmm
import sys
def example(resource_name, option_string, function, range, digits):
with nidmm.Session(resource_name=resource_name, options=option_string) as session:
session.configure_measurement_digits(measurement_function=nidmm.Function[function], range=range,... | [
"nidmm.Function.__members__.keys",
"argparse.ArgumentParser",
"nidmm.Session"
] | [((476, 632), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Performs a single measurement using the NI-DMM API."""', 'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter'}), "(description=\n 'Performs a single measurement using the NI-DMM API.', formatter_class=\n argparse.A... |
# -*- coding:utf-8 -*-
# /usr/bin/env python
"""
Date: 2020/10/18 20:29
Desc: 电影票房数据
https://www.endata.com.cn/BoxOffice/BO/RealTime/reTimeBO.html
"""
import datetime
import json
import os
import pandas as pd
import requests
from py_mini_racer import py_mini_racer
def _get_js_path(name, module_file):
"""
获取 ... | [
"requests.post",
"datetime.datetime.strptime",
"os.path.join",
"py_mini_racer.py_mini_racer.MiniRacer",
"os.path.dirname",
"pandas.DataFrame",
"datetime.timedelta"
] | [((540, 582), 'os.path.join', 'os.path.join', (['module_folder', '"""movie"""', 'name'], {}), "(module_folder, 'movie', name)\n", (552, 582), False, 'import os\n'), ((1079, 1105), 'datetime.timedelta', 'datetime.timedelta', ([], {'days': '(1)'}), '(days=1)\n', (1097, 1105), False, 'import datetime\n'), ((1369, 1394), '... |
from brownie import *
from .settings import *
from .contracts import *
from .contract_addresses import *
import time
def main():
load_accounts()
# Initialise Project
operator = accounts[0]
wallet = accounts[1]
# GP: Split into public and miso access control
access_control = deploy_access_con... | [
"time.sleep"
] | [((3431, 3444), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (3441, 3444), False, 'import time\n')] |
"""
ET Correction Tool:
This script creates evapotranspiration Dfs2 from single/multiple reference ET
time-series, and applies spatially, monthly varying solar radiation correction
factors to the reference ET data and creates the MIKE SHE input ET Dfs2 file.
Created on Wed Apr 28 15:50:07 2021
@author: <NA... | [
"winreg.OpenKey",
"tkinter.Button",
"shapely.geometry.Point",
"shapely.geometry.Polygon",
"mikeio.eum.ItemInfo",
"tkinter.Label",
"os.remove",
"os.path.exists",
"os.listdir",
"tkinter.Entry",
"winreg.QueryValueEx",
"clr.AddReference",
"datetime.date",
"winreg.ConnectRegistry",
"pandas.Da... | [((1839, 1883), 'clr.AddReference', 'clr.AddReference', (['"""DHI.Generic.MikeZero.DFS"""'], {}), "('DHI.Generic.MikeZero.DFS')\n", (1855, 1883), False, 'import clr\n'), ((1885, 1929), 'clr.AddReference', 'clr.AddReference', (['"""DHI.Generic.MikeZero.EUM"""'], {}), "('DHI.Generic.MikeZero.EUM')\n", (1901, 1929), False... |
from unittest import TestCase
from esrally import exceptions
from esrally.utils import io
from esrally.track import params
class SliceTests(TestCase):
def test_slice_with_source_larger_than_slice(self):
source = params.Slice(io.StringAsFileSource, 2, 5)
data = [
'{"key": "value1"}',
... | [
"esrally.track.params.PartitionBulkIndexParamSource",
"esrally.track.params.BulkIndexParamSource",
"esrally.track.params.register_param_source_for_name",
"esrally.track.params._unregister_param_source_for_name",
"esrally.track.params.bounds",
"esrally.track.params.Slice",
"esrally.track.params.build_con... | [((227, 268), 'esrally.track.params.Slice', 'params.Slice', (['io.StringAsFileSource', '(2)', '(5)'], {}), '(io.StringAsFileSource, 2, 5)\n', (239, 268), False, 'from esrally.track import params\n'), ((805, 846), 'esrally.track.params.Slice', 'params.Slice', (['io.StringAsFileSource', '(0)', '(5)'], {}), '(io.StringAsF... |
from copy import deepcopy
from ray import tune
import numpy as np
from softlearning.misc.utils import get_git_rev, deep_update
import os
DEFAULT_KEY = '__DEFAULT_KEY__'
M = 256
N = 2
REPARAMETERIZE = True
NUM_COUPLING_LAYERS = 2
"""
Policy params
"""
GAUSSIAN_POLICY_PARAMS_BASE = {
'type': 'GaussianPolicy',
... | [
"ray.tune.sample_from",
"ray.tune.grid_search",
"numpy.random.randint",
"softlearning.misc.utils.get_git_rev",
"copy.deepcopy"
] | [((12928, 13230), 'ray.tune.grid_search', 'tune.grid_search', (["[{'type': 'ConvnetPreprocessor', 'kwargs': {'conv_filters': (64,) * 3,\n 'conv_kernel_sizes': (3,) * 3, 'conv_strides': (2,) * 3,\n 'normalization_type': normalization_type, 'downsampling_type': 'conv',\n 'output_kwargs': {'type': 'flatten'}}} fo... |
# -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
from __future__ import unicode_literals
import logging
import re
import sys
import time
import traceback
from django.utils import timezone
from cronman.base import BaseCronObject
from cronman.exceptions import (
CronJobNotRegistered,
CronTaskInvalidStatus,
... | [
"logging.getLogger",
"cronman.utils.TabularFormatter",
"cronman.monitor.send_errors_to_sentry",
"cronman.worker.worker_file.CronWorkerPIDFile.get_file_name",
"cronman.worker.signal_notifier.SignalNotifier",
"cronman.job.cron_job_registry.get",
"cronman.models.CronTask.objects.filter",
"re.match",
"t... | [((939, 987), 'logging.getLogger', 'logging.getLogger', (['"""cronman.command.cron_worker"""'], {}), "('cronman.command.cron_worker')\n", (956, 987), False, 'import logging\n'), ((5582, 5610), 'cronman.monitor.send_errors_to_sentry', 'send_errors_to_sentry', (['_kill'], {}), '(_kill)\n', (5603, 5610), False, 'from cron... |
#pylint:disable=undefined-variable,wildcard-import,no-name-in-module
#pylint:disable=no-member
import adafruit_logging as logging
logger = logging.getLogger('test')
logger.setLevel(logging.ERROR)
logger.info('Info message')
logger.error('Error message')
| [
"adafruit_logging.getLogger"
] | [((141, 166), 'adafruit_logging.getLogger', 'logging.getLogger', (['"""test"""'], {}), "('test')\n", (158, 166), True, 'import adafruit_logging as logging\n')] |
#!/usr/bin/env python3
#
# Copyright (c) 2016 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | [
"json.loads",
"uuid.UUID",
"empower.core.slice.Slice",
"empower.persistence.Session",
"empower.datatypes.etheraddress.EtherAddress",
"empower.restserver.validate.validate"
] | [((1342, 1362), 'empower.restserver.validate.validate', 'validate', ([], {'max_args': '(1)'}), '(max_args=1)\n', (1350, 1362), False, 'from empower.restserver.validate import validate\n'), ((1768, 1957), 'empower.restserver.validate.validate', 'validate', ([], {'returncode': '(201)', 'input_schema': "{'version': {'type... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# IkaLog
# ======
# Copyright (C) 2015 <NAME>
# Copyright (C) 2015 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http... | [
"cv2.getPerspectiveTransform",
"cv2.findHomography",
"pickle.load",
"numpy.sum",
"cv2.warpPerspective",
"cv2.cvtColor",
"ikalog.inputs.filters.WarpFilterModel",
"cv2.KeyPoint",
"numpy.float32"
] | [((3835, 3869), 'numpy.float32', 'np.float32', (['[kp.pt for kp in mkp1]'], {}), '([kp.pt for kp in mkp1])\n', (3845, 3869), True, 'import numpy as np\n'), ((3883, 3917), 'numpy.float32', 'np.float32', (['[kp.pt for kp in mkp2]'], {}), '([kp.pt for kp in mkp2])\n', (3893, 3917), True, 'import numpy as np\n'), ((4040, 4... |
# coding=utf-8
# Copyright 2022 HuggingFace Inc. team.
#
# 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... | [
"transformers.FlaxSpeechEncoderDecoderModel.from_pretrained",
"jax.nn.log_softmax",
"transformers.FlaxGPT2LMHeadModel",
"numpy.array",
"transformers.is_flax_available",
"transformers.FlaxWav2Vec2Model",
"flax.training.common_utils.onehot",
"transformers.modeling_flax_pytorch_utils.load_flax_weights_in... | [((1190, 1209), 'transformers.is_flax_available', 'is_flax_available', ([], {}), '()\n', (1207, 1209), False, 'from transformers import is_flax_available, is_torch_available\n'), ((1806, 1826), 'transformers.is_torch_available', 'is_torch_available', ([], {}), '()\n', (1824, 1826), False, 'from transformers import is_f... |
import os
import subprocess
import sys
import zipfile
if (os.path.exists("build")):
dl=[]
for r,ndl,fl in os.walk("build"):
r=r.replace("\\","/").strip("/")+"/"
dl=[r+k for k in ndl]+dl
for f in fl:
os.remove(r+f)
for k in dl:
if (k not in ["build/client","build/server"]):
os.rmdir(k)
else:
os.mkdi... | [
"os.path.exists",
"zipfile.ZipFile",
"subprocess.run",
"os.path.join",
"os.rmdir",
"os.mkdir",
"sys.exit",
"os.walk",
"os.remove"
] | [((61, 84), 'os.path.exists', 'os.path.exists', (['"""build"""'], {}), "('build')\n", (75, 84), False, 'import os\n'), ((493, 507), 'os.walk', 'os.walk', (['"""src"""'], {}), "('src')\n", (500, 507), False, 'import os\n'), ((111, 127), 'os.walk', 'os.walk', (['"""build"""'], {}), "('build')\n", (118, 127), False, 'impo... |
import collections
import json
import random
import re
from datetime import timedelta, datetime
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.core.cache import cache
from django.db.models import Q
from django.http import JsonResponse, FileResponse
... | [
"taggit.models.Tag.objects.all",
"datetime.timedelta",
"django.core.cache.cache.get",
"django.shortcuts.render",
"datetime.datetime.datetime.now",
"django.shortcuts.get_object_or_404",
"json.dumps",
"django.utils.timezone.now",
"django.shortcuts.redirect",
"json.loads",
"taggit.models.Tag.object... | [((902, 939), 'django.core.cache.cache.set', 'cache.set', (['"""coca"""', 'coca'], {'timeout': 'None'}), "('coca', coca, timeout=None)\n", (911, 939), False, 'from django.core.cache import cache\n'), ((1131, 1145), 'django.utils.timezone.now', 'timezone.now', ([], {}), '()\n', (1143, 1145), False, 'from django.utils im... |
"""
MCCP - Mud Client Compression Protocol
This implements the MCCP v2 telnet protocol as per
http://tintin.sourceforge.net/mccp/. MCCP allows for the server to
compress data when sending to supporting clients, reducing bandwidth
by 70-90%.. The compression is done using Python's builtin zlib
library. If the client d... | [
"zlib.compressobj"
] | [((2512, 2531), 'zlib.compressobj', 'zlib.compressobj', (['(9)'], {}), '(9)\n', (2528, 2531), False, 'import zlib\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import argparse
from DBGater.db_singleton_mongo import SynDevAdmin
from elsapy.elsclient import ElsClient
from elsapy.elssearch import ElsSearch
from Borges.setti... | [
"elsapy.elsclient.ElsClient",
"DBGater.db_singleton_mongo.SynDevAdmin.db_access",
"argparse.ArgumentParser"
] | [((507, 532), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (530, 532), False, 'import argparse\n'), ((652, 675), 'DBGater.db_singleton_mongo.SynDevAdmin.db_access', 'SynDevAdmin.db_access', ([], {}), '()\n', (673, 675), False, 'from DBGater.db_singleton_mongo import SynDevAdmin\n'), ((945, 97... |
# This contains a catalog of explicit solutions to some SDEs.
from sampi.sdes.base import StochDiffEq
import numpy as np
def basic_linear(a=1, b=1):
"""Returns a function implementing the explicit solution to the SDE
dX_t = a X_t dt + b X_t dW_t.
"""
drift = lambda x, t : a*x
diffusio... | [
"numpy.exp",
"numpy.arccos",
"numpy.sqrt",
"sampi.sdes.base.StochDiffEq"
] | [((422, 527), 'sampi.sdes.base.StochDiffEq', 'StochDiffEq', ([], {'drift': 'drift', 'diffusion': 'diffusion', 'true_sol': 'true_sol', 'eqn': '"""dX_t = a X_t dt + b X_t dW_t"""'}), "(drift=drift, diffusion=diffusion, true_sol=true_sol, eqn=\n 'dX_t = a X_t dt + b X_t dW_t')\n", (433, 527), False, 'from sampi.sdes.ba... |
from flask.ext.script import Manager
from flask.ext.migrate import Migrate, MigrateCommand
import os
from application.models import *
from application.routes import app
from application import db
app.config.from_object(os.environ.get('SETTINGS'))
print(app.config)
migrate = Migrate(app, db)
manager = Manager(app)
... | [
"flask.ext.script.Manager",
"os.environ.get",
"flask.ext.migrate.Migrate"
] | [((280, 296), 'flask.ext.migrate.Migrate', 'Migrate', (['app', 'db'], {}), '(app, db)\n', (287, 296), False, 'from flask.ext.migrate import Migrate, MigrateCommand\n'), ((307, 319), 'flask.ext.script.Manager', 'Manager', (['app'], {}), '(app)\n', (314, 319), False, 'from flask.ext.script import Manager\n'), ((222, 248)... |
from setuptools import setup
import os
working_dir = os.path.dirname(os.path.realpath(__file__))
requirementPath = working_dir + '/requirements.txt'
install_requires = []
if os.path.isfile(requirementPath):
with open(requirementPath) as f:
install_requires = f.read().splitlines()
setup(
name='coding_ra... | [
"os.path.isfile",
"os.path.realpath",
"setuptools.setup"
] | [((175, 206), 'os.path.isfile', 'os.path.isfile', (['requirementPath'], {}), '(requirementPath)\n', (189, 206), False, 'import os\n'), ((294, 486), 'setuptools.setup', 'setup', ([], {'name': '"""coding_raymondcentral_nichols_2020"""', 'install_requires': 'install_requires', 'version': '"""1.0"""', 'packages': "['']", '... |
import bokeh
import pandas as pd
import numpy as np
import os
from bokeh import events
from bokeh.io import show
from bokeh.plotting import figure, output_file, ColumnDataSource
from bokeh.models.widgets import ColorPicker, Select, Toggle, Dropdown, DataTable, NumberFormatter, TableColumn,TextInput, Button, TextAreaInp... | [
"bokeh.models.widgets.Dropdown",
"bokeh.plotting.figure",
"pandas.read_csv",
"bokeh.models.widgets.Slider",
"bokeh.layouts.Row",
"bokeh.models.widgets.Button",
"bokeh.layouts.Column",
"numpy.array",
"bokeh.models.widgets.Div",
"bokeh.models.widgets.NumberFormatter",
"bokeh.models.ToolbarBox",
... | [((758, 805), 'bokeh.plotting.output_file', 'output_file', (['"""index.html"""'], {'title': '"""NaViA v 1.0"""'}), "('index.html', title='NaViA v 1.0')\n", (769, 805), False, 'from bokeh.plotting import figure, output_file, ColumnDataSource\n'), ((1177, 1349), 'bokeh.plotting.figure', 'figure', ([], {'plot_width': '(... |
from flask import abort, redirect, render_template, request, url_for
from app import user_api_client
from app.main import main
from app.main.forms import ContactNotifyTeam
QUESTION_TICKET_TYPE = 'ask-question-give-feedback'
PROBLEM_TICKET_TYPE = "report-problem"
@main.route('/support/<ticket_type>', methods=['GET',... | [
"app.user_api_client.send_contact_email",
"app.main.forms.ContactNotifyTeam",
"flask.url_for",
"app.main.main.route",
"flask.abort"
] | [((268, 329), 'app.main.main.route', 'main.route', (['"""/support/<ticket_type>"""'], {'methods': "['GET', 'POST']"}), "('/support/<ticket_type>', methods=['GET', 'POST'])\n", (278, 329), False, 'from app.main import main\n'), ((368, 387), 'app.main.forms.ContactNotifyTeam', 'ContactNotifyTeam', ([], {}), '()\n', (385,... |
import connector_pb2_grpc
import connector_pb2
import grpc
import prom
class Service(connector_pb2_grpc.ConnectorServicer):
def GetMetaInfo(self, request, context):
return connector_pb2.MetaInfo(
name = 'Prometheus Connector',
version = '0.0.1',
developer = 'Qlik'
)
def GetData(self, req... | [
"prom.build_chunks",
"grpc.RpcError",
"connector_pb2.MetaInfo",
"prom.build_metadata"
] | [((179, 269), 'connector_pb2.MetaInfo', 'connector_pb2.MetaInfo', ([], {'name': '"""Prometheus Connector"""', 'version': '"""0.0.1"""', 'developer': '"""Qlik"""'}), "(name='Prometheus Connector', version='0.0.1',\n developer='Qlik')\n", (201, 269), False, 'import connector_pb2\n'), ((1161, 1189), 'prom.build_metadat... |
from flask import Response, request
from io import BytesIO
import xml.etree.ElementTree
from fHDHR.tools import sub_el
class RMG_Devices_DeviceKey_Scanners():
endpoints = ["/devices/<devicekey>/scanners", "/rmg/devices/<devicekey>/scanners"]
endpoint_name = "rmg_devices_devicekey_scanners"
endpoint_metho... | [
"flask.request.args.get",
"fHDHR.tools.sub_el",
"io.BytesIO",
"flask.Response"
] | [((595, 642), 'flask.request.args.get', 'request.args.get', (['"""type"""'], {'default': '"""0"""', 'type': 'str'}), "('type', default='0', type=str)\n", (611, 642), False, 'from flask import Response, request\n'), ((1427, 1436), 'io.BytesIO', 'BytesIO', ([], {}), '()\n', (1434, 1436), False, 'from io import BytesIO\n'... |
import netket as nk
import numpy as np
from numpy import linalg as la
import pandas as pd
import os
from netket.hilbert import Fock
from tqdm import tqdm
# Model params
model = 'mbl'
N = 8
seed = 3
W = 15.0
U = 1.0
J = 1.0
dt = 1
gamma = 0.1
# Ansatz params
beta = 2
alpha = 2
n_samples = 5000
n_iter = 1000
np.random... | [
"netket.operator.LocalOperator",
"numpy.sqrt",
"netket.optimizer.Sgd",
"netket.models.NDM",
"numpy.linalg.norm",
"os.path.exists",
"netket.graph.disjoint_union",
"netket.optimizer.SR",
"netket.operator.boson.number",
"netket.operator.LocalLiouvillian",
"netket.operator.boson.create",
"numpy.li... | [((311, 331), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (325, 331), True, 'import numpy as np\n'), ((590, 621), 'numpy.random.uniform', 'np.random.uniform', (['(-1.0)', '(1.0)', 'N'], {}), '(-1.0, 1.0, N)\n', (607, 621), True, 'import numpy as np\n'), ((644, 682), 'netket.hilbert.Fock', 'Fock',... |
import networkx as nx
import numpy as np
import matplotlib.pyplot as plt
def vis_causal_net(adata, key='RDI', layout = 'circular', top_n_edges = 10, edge_color = 'gray', figsize=(6, 6)):
"""Visualize inferred causal regulatory network
This plotting function visualize the inferred causal regulatory network inf... | [
"numpy.where",
"networkx.DiGraph",
"numpy.max",
"numpy.argsort",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show"
] | [((1402, 1447), 'numpy.where', 'np.where', (['(df_mat.values - df_mat.T.values < 0)'], {}), '(df_mat.values - df_mat.T.values < 0)\n', (1410, 1447), True, 'import numpy as np\n'), ((1459, 1504), 'numpy.where', 'np.where', (['(df_mat.values - df_mat.T.values < 0)'], {}), '(df_mat.values - df_mat.T.values < 0)\n', (1467,... |
from collections import namedtuple
import numpy as np
import pytest
from numpy.testing import assert_allclose
from pytest_lazyfixture import lazy_fixture
from emukit.quadrature.methods.warpings import IdentityWarping, SquareRootWarping
def create_fixture_parameters():
return [pytest.param(lazy_fixture(warping.n... | [
"collections.namedtuple",
"numpy.ones",
"numpy.random.rand",
"emukit.quadrature.methods.warpings.IdentityWarping",
"emukit.quadrature.methods.warpings.SquareRootWarping",
"pytest_lazyfixture.lazy_fixture",
"numpy.random.seed"
] | [((697, 732), 'collections.namedtuple', 'namedtuple', (['"""WarpingTest"""', "['name']"], {}), "('WarpingTest', ['name'])\n", (707, 732), False, 'from collections import namedtuple\n'), ((421, 438), 'emukit.quadrature.methods.warpings.IdentityWarping', 'IdentityWarping', ([], {}), '()\n', (436, 438), False, 'from emuki... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from ceasiompy.utils.moduleinterfaces import CPACSInOut, AIRCRAFT_XPATH, CEASIOM_XPATH
# ===== RCE integration =====
RCE = {
"name": "Optimisation module",
"description": "This module implements the optimization routine for a workflow",
"exec": "pwd\npython ... | [
"ceasiompy.utils.moduleinterfaces.CPACSInOut"
] | [((443, 455), 'ceasiompy.utils.moduleinterfaces.CPACSInOut', 'CPACSInOut', ([], {}), '()\n', (453, 455), False, 'from ceasiompy.utils.moduleinterfaces import CPACSInOut, AIRCRAFT_XPATH, CEASIOM_XPATH\n')] |
import pytest
import torch
from torch.nn.functional import mse_loss
from torch.autograd import gradcheck
from torch.testing import assert_allclose
import kornia as kornia
import kornia.testing as utils # test utils
from kornia.geometry.subpix.spatial_soft_argmax import _get_center_kernel2d, _get_center_kernel3d
cl... | [
"torch.as_tensor",
"kornia.ConvSoftArgmax3d",
"kornia.gaussian_blur2d",
"kornia.geometry.subpix.spatial_soft_argmax._get_center_kernel3d",
"torch.testing.assert_allclose",
"kornia.geometry.ConvQuadInterp3d",
"kornia.SpatialSoftArgmax2d",
"kornia.testing.tensor_to_gradcheck_var",
"kornia.losses.js_di... | [((638, 910), 'torch.tensor', 'torch.tensor', (['[[[[0.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 0.0]], [[0.0, 0.0, 0.0], [\n 0.0, 0.0, 0.0], [0.0, 0.0, 0.0]]], [[[0.0, 0.0, 0.0], [0.0, 0.0, 0.0],\n [0.0, 0.0, 0.0]], [[0.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 0.0]]]]'], {'device': 'device', 'dtype': 'dtype'}),... |
# -*- coding: utf-8 -*-
"""
** Affective IT for SuriRobot
**
** Made by <NAME>
** Login <<EMAIL>>
**
** Started on Wed Oct 17 10:51:11 2017 <NAME>
"""
import requests
import json
"""
Méthode pour call l'API Beyond Verbal et soumettre un extrait sonore à étude.
1er param: clé API
2e param : Path de l'extrait audi... | [
"json.dumps",
"requests.post"
] | [((371, 490), 'requests.post', 'requests.post', (['"""https://token.beyondverbal.com/token"""'], {'data': "{'grant_type': 'client_credentials', 'apiKey': API_Key}"}), "('https://token.beyondverbal.com/token', data={'grant_type':\n 'client_credentials', 'apiKey': API_Key})\n", (384, 490), False, 'import requests\n'),... |
import aiohttp
from graia.application.message.chain import MessageChain
from graia.application.message.elements.internal import Plain
async def get_history_today() -> list:
"""
Get history today
Args:
None
Examples:
message = await get_history_today()
Return:
[
... | [
"aiohttp.ClientSession",
"graia.application.message.elements.internal.Plain"
] | [((533, 556), 'aiohttp.ClientSession', 'aiohttp.ClientSession', ([], {}), '()\n', (554, 556), False, 'import aiohttp\n'), ((890, 906), 'graia.application.message.elements.internal.Plain', 'Plain', ([], {'text': 'text'}), '(text=text)\n', (895, 906), False, 'from graia.application.message.elements.internal import Plain\... |
from typing import List
import math
import matplotlib#type: ignore
import matplotlib.pyplot as plt#type: ignore
import config
import world as w
# Data for plotting
k_values: List[int] = [i for i in range(1,20)]
grays_prob: List[float] = [0 for k in k_values]
upper_bound = [math.pow(math.e, -i*1369/12400) for i in k_v... | [
"world.World",
"matplotlib.pyplot.xticks",
"math.pow",
"math.log",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
] | [((1793, 1807), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (1805, 1807), True, 'import matplotlib.pyplot as plt\n'), ((2003, 2037), 'matplotlib.pyplot.xticks', 'matplotlib.pyplot.xticks', (['k_values'], {}), '(k_values)\n', (2027, 2037), False, 'import matplotlib\n'), ((2147, 2157), 'matplotlib.pyp... |
import os
from hub.dataload.uploader import SnpeffPostUpdateUploader
from .cgi_parser import load_data
class CGIUploader(SnpeffPostUpdateUploader):
name = "cgi"
__metadata__ = {"mapper": 'observed',
"assembly": "hg19",
"src_meta": {
"url": "http... | [
"os.path.exists",
"os.path.join"
] | [((736, 795), 'os.path.join', 'os.path.join', (['data_folder', '"""cgi_biomarkers_per_variant.tsv"""'], {}), "(data_folder, 'cgi_biomarkers_per_variant.tsv')\n", (748, 795), False, 'import os\n'), ((810, 836), 'os.path.exists', 'os.path.exists', (['input_file'], {}), '(input_file)\n', (824, 836), False, 'import os\n')] |
import setuptools
setuptools.setup(
name='dashathon',
version='0.9.0',
description='A dashboard to help athletes train for marathons using 20 years of historical data',
author='<NAME>, <NAME>, <NAME>, <NAME>',
author_email='<EMAIL>, <EMAIL>, <EMAIL>, <EMAIL>',
url='https://github.com/w... | [
"setuptools.find_packages"
] | [((356, 382), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (380, 382), False, 'import setuptools\n')] |
from PySide2.QtWidgets import QHBoxLayout, QVBoxLayout, QLabel, QCheckBox, QLineEdit, QTableWidget, QTableWidgetItem, QAbstractScrollArea
from PySide2.QtCore import QSize
from angr.knowledge_plugins import Function
from .view import BaseView
from ..widgets.qstring_table import QStringTable
from ..widgets.qfunction_co... | [
"logging.getLogger",
"PySide2.QtWidgets.QTableWidgetItem",
"elasticsearch.Elasticsearch",
"PySide2.QtWidgets.QHBoxLayout",
"PySide2.QtCore.QSize",
"PySide2.QtWidgets.QLineEdit",
"PySide2.QtWidgets.QCheckBox",
"PySide2.QtWidgets.QLabel",
"PySide2.QtWidgets.QTableWidget",
"PySide2.QtWidgets.QVBoxLay... | [((481, 508), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (498, 508), False, 'import logging\n'), ((1149, 1190), 'elasticsearch.Elasticsearch', 'Elasticsearch', (["['http://172.17.0.1:9200']"], {}), "(['http://172.17.0.1:9200'])\n", (1162, 1190), False, 'from elasticsearch import Elast... |
from wsgiref.simple_server import make_server
from pyramid.config import Configurator
from pyramid.response import Response
def hello_world(request):
return Response('Hello World!')
if __name__ == '__main__':
with Configurator() as config:
config.add_route('hello', '/')
config.add_view(hello_w... | [
"pyramid.response.Response",
"pyramid.config.Configurator",
"wsgiref.simple_server.make_server"
] | [((162, 186), 'pyramid.response.Response', 'Response', (['"""Hello World!"""'], {}), "('Hello World!')\n", (170, 186), False, 'from pyramid.response import Response\n'), ((432, 465), 'wsgiref.simple_server.make_server', 'make_server', (['"""0.0.0.0"""', '(8099)', 'app'], {}), "('0.0.0.0', 8099, app)\n", (443, 465), Fal... |
import numpy as np
from molsysmt import puw
def atomic_radius(molecular_system, selection='all', type='vdw'):
from molsysmt.basic import get
from molsysmt.physico_chemical_properties.atoms.radius import units
from molsysmt._private_tools._digestion import digest_target
if type=='vdw':
from mo... | [
"molsysmt.basic.get",
"numpy.array"
] | [((454, 522), 'molsysmt.basic.get', 'get', (['molecular_system'], {'target': '"""atom"""', 'selection': 'selection', 'type': '(True)'}), "(molecular_system, target='atom', selection=selection, type=True)\n", (457, 522), False, 'from molsysmt.basic import get\n'), ((667, 683), 'numpy.array', 'np.array', (['output'], {})... |
import copy
import os
import tempfile
import tarfile
import pytest
import torch
from allennlp.version import _MAJOR, _MINOR
from allennlp.commands.train import train_model
from allennlp.common import Params
from allennlp.common.meta import Meta
from allennlp.common.checks import ConfigurationError
from allennlp.commo... | [
"tempfile.TemporaryDirectory",
"allennlp.models.archival.archive_model",
"tarfile.open",
"allennlp.commands.train.train_model",
"os.path.join",
"allennlp.common.meta.Meta",
"pytest.raises",
"allennlp.models.archival.load_archive",
"allennlp.models.archival._check_version_compatibility",
"pytest.wa... | [((1293, 1314), 'allennlp.common.meta.Meta', 'Meta', ([], {'version': '"""1.2.0"""'}), "(version='1.2.0')\n", (1297, 1314), False, 'from allennlp.common.meta import Meta\n'), ((1159, 1220), 'pytest.warns', 'pytest.warns', (['UserWarning'], {'match': '"""trained on a newer version"""'}), "(UserWarning, match='trained on... |
# Generated by Django 3.2.8 on 2021-11-13 18:02
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
('accounts', '0008_user_image'),
]
operations = [
migrations.CreateModel(
... | [
"django.db.models.UUIDField",
"django.db.models.DateField",
"django.db.models.FloatField",
"django.db.models.TextField",
"django.db.models.TimeField",
"django.db.models.IntegerField",
"django.db.models.ForeignKey",
"django.db.models.ManyToManyField",
"django.db.models.SlugField",
"django.db.models... | [((7516, 7574), 'django.db.models.ManyToManyField', 'models.ManyToManyField', ([], {'blank': '(True)', 'to': '"""courses.Promotion"""'}), "(blank=True, to='courses.Promotion')\n", (7538, 7574), False, 'from django.db import migrations, models\n'), ((7696, 7782), 'django.db.models.ManyToManyField', 'models.ManyToManyFie... |
import errno
import json
import os
import time
from packaging import version
from . import __version__, settings, utils
def get_global_config_path():
old_path = os.path.join(os.path.expanduser("~"), settings.ALDRYN_DOT_FILE)
if os.path.exists(old_path):
return old_path
else:
return setti... | [
"os.path.expanduser",
"os.path.exists",
"os.path.dirname",
"json.load",
"packaging.version.parse",
"time.time",
"json.dump"
] | [((240, 264), 'os.path.exists', 'os.path.exists', (['old_path'], {}), '(old_path)\n', (254, 264), False, 'import os\n'), ((182, 205), 'os.path.expanduser', 'os.path.expanduser', (['"""~"""'], {}), "('~')\n", (200, 205), False, 'import os\n'), ((1677, 1703), 'packaging.version.parse', 'version.parse', (['__version__'], ... |
import time
import stdiomask
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.chrome.options import ... | [
"selenium.webdriver.support.ui.WebDriverWait",
"styles.pretty_print.styled_error",
"utils.config._parse_selemrc",
"utils.config._is_initialized",
"styles.pretty_print.styled_warning",
"selenium.webdriver.support.expected_conditions.presence_of_element_located",
"styles.pretty_print.styled_input",
"sty... | [((1777, 1794), 'utils.config._is_initialized', '_is_initialized', ([], {}), '()\n', (1792, 1794), False, 'from utils.config import _is_initialized, _write_selemrc, _parse_selemrc\n'), ((3242, 3315), 'styles.pretty_print.styled_success', 'styled_success', (['"""\nAuthentication successful. You are now logged in!!"""'],... |
"""
Loaders for different formats provided by PubMed.
"""
__author__ = "<NAME>"
__all__ = ['PXMLLoader', 'PXMLFetcher', 'PMCLoader', 'PMCFetcher']
import os
import logging
import urllib.parse
import urllib.request
import itertools as it
from lxml import etree
from ._load import DocIterator, text_node
from ..doc.... | [
"itertools.groupby",
"itertools.count",
"lxml.etree.iterparse",
"logging.info"
] | [((1530, 1541), 'itertools.count', 'it.count', (['(1)'], {}), '(1)\n', (1538, 1541), True, 'import itertools as it\n'), ((8124, 8161), 'lxml.etree.iterparse', 'etree.iterparse', (['source'], {'tag': 'self.tag'}), '(source, tag=self.tag)\n', (8139, 8161), False, 'from lxml import etree\n'), ((9438, 9512), 'logging.info'... |
import numpy as np
import sys
from sklearn.metrics import label_ranking_average_precision_score
if len(sys.argv) != 4:
print("Usage: python compute_lrap.py preds_file test_file all_class_file")
exit(-1)
preds_file = sys.argv[1]
test_file = sys.argv[2]
all_class_file = sys.argv[3]
class2index = {}
with open(... | [
"numpy.loadtxt",
"sklearn.metrics.label_ranking_average_precision_score",
"numpy.zeros"
] | [((437, 459), 'numpy.loadtxt', 'np.loadtxt', (['preds_file'], {}), '(preds_file)\n', (447, 459), True, 'import numpy as np\n'), ((469, 492), 'numpy.zeros', 'np.zeros', (['y_score.shape'], {}), '(y_score.shape)\n', (477, 492), True, 'import numpy as np\n'), ((659, 713), 'sklearn.metrics.label_ranking_average_precision_s... |
import click
from functions import *
from graphs import *
from datasets.statistics import *
@click.group(chain=True, invoke_without_command=True)
def cli():
pass
@cli.command(name='genTopo', help='Generates a topology for the simulation')
@click.option('-t','--topology', default='scale-free', type=click.Choice ([... | [
"click.group",
"click.Choice",
"click.option",
"click.echo"
] | [((94, 146), 'click.group', 'click.group', ([], {'chain': '(True)', 'invoke_without_command': '(True)'}), '(chain=True, invoke_without_command=True)\n', (105, 146), False, 'import click\n'), ((434, 530), 'click.option', 'click.option', (['"""-n"""', '"""--nodes"""'], {'type': 'int', 'default': '(10)', 'help': '"""Numbe... |
# coding: utf-8
# See notebook:
# https://github.com/paninski-lab/yass-examples/blob/master/batch/multi_channel_apply_memory.ipynb
"""
Applying transformations to large files in batches:
BatchProcessor.multi_channel_apply lets you apply transformations to
batches of data where every batch has observations from every... | [
"logging.basicConfig",
"yass.batch.BatchProcessor",
"numpy.max",
"numpy.stack",
"os.path.expanduser"
] | [((571, 610), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (590, 610), False, 'import logging\n'), ((656, 717), 'os.path.expanduser', 'os.path.expanduser', (['"""~/data/ucl-neuropixel/rawDataSample.bin"""'], {}), "('~/data/ucl-neuropixel/rawDataSample.bin')\n"... |
#!/usr/bin/env python
# coding=utf-8
'''
@Author: John
@Email: <EMAIL>
@Date: 2020-06-12 00:50:49
@LastEditor: John
LastEditTime: 2021-12-22 14:01:37
@Discription:
@Environment: python 3.7.7
'''
'''off-policy
'''
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import ran... | [
"random.sample",
"random.randrange",
"torch.load",
"torch.tensor",
"torch.nn.MSELoss",
"torch.nn.Linear",
"torch.no_grad",
"random.random",
"numpy.float32",
"math.exp"
] | [((602, 634), 'torch.nn.Linear', 'nn.Linear', (['state_dim', 'hidden_dim'], {}), '(state_dim, hidden_dim)\n', (611, 634), True, 'import torch.nn as nn\n'), ((660, 693), 'torch.nn.Linear', 'nn.Linear', (['hidden_dim', 'hidden_dim'], {}), '(hidden_dim, hidden_dim)\n', (669, 693), True, 'import torch.nn as nn\n'), ((718, ... |
# !/usr/bin/env python3
# -*-coding:utf-8 -*-
"""
# File : test_adbutil_wrapper.py
# Time :2/10/21 08:22
# Author :<NAME>
"""
import os
import unittest
from adbutils_wrapper.adb import AdbUtilWrapper
from testdata import TestUtil
class TestAdbUtilsWrapper(unittest.TestCase):
@classmethod
def... | [
"unittest.main",
"adbutils_wrapper.adb.AdbUtilWrapper",
"testdata.TestUtil.get_test_data_path"
] | [((1126, 1141), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1139, 1141), False, 'import unittest\n'), ((377, 410), 'adbutils_wrapper.adb.AdbUtilWrapper', 'AdbUtilWrapper', (['"""127.0.0.1"""', '(5037)'], {}), "('127.0.0.1', 5037)\n", (391, 410), False, 'from adbutils_wrapper.adb import AdbUtilWrapper\n'), ((80... |
# Copyright 1999-2021 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | [
"numpy.random.bytes",
"numpy.random.rand",
"mars.config.option_context",
"mars.core.tile",
"pandas.Index",
"numpy.array",
"pandas.RangeIndex",
"numpy.random.RandomState",
"pandas.date_range",
"mars.dataframe.base.astype",
"numpy.empty",
"pandas.DataFrame",
"numpy.dtype",
"mars.dataframe.da... | [((1558, 1578), 'mars.dataframe.datasource.dataframe.from_pandas', 'from_pandas_df', (['data'], {}), '(data)\n', (1572, 1578), True, 'from mars.dataframe.datasource.dataframe import from_pandas as from_pandas_df\n'), ((1589, 1599), 'mars.dataframe.base.to_gpu', 'to_gpu', (['df'], {}), '(df)\n', (1595, 1599), False, 'fr... |
import requests
from flask import Flask, request
import os
import info
import isolate
app = Flask(__name__)
@app.route('/')
def status():
executor_status = {
"language": info.language,
"status": config['status'],
}
return executor_status
@app.route('/compile', methods=["POST"])
def compi... | [
"os.makedirs",
"flask.Flask",
"info.name_binary",
"requests.get",
"info.compile_command",
"info.name_code",
"info.compile_error_message",
"isolate.run"
] | [((94, 109), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (99, 109), False, 'from flask import Flask, request\n'), ((2556, 2643), 'isolate.run', 'isolate.run', (["config['submission_binary_path']", 'stdin', 'time_limit', 'memory_limit', 'env'], {}), "(config['submission_binary_path'], stdin, time_limit,\... |
import unittest
import os
import mock as mock
import inspect
import shutil
from kalliope.core.Models import Singleton
from kalliope.core.ConfigurationManager import SettingLoader
from kalliope.core import HookManager
from kalliope.core.Models.Settings import Settings
class TestInit(unittest.TestCase):
def set... | [
"mock.patch",
"kalliope.core.HookManager.on_order_not_found",
"os.makedirs",
"inspect.currentframe",
"kalliope.core.HookManager.on_stop_listening",
"kalliope.core.HookManager.on_start",
"kalliope.core.HookManager.on_triggered",
"kalliope.core.HookManager.on_start_listening",
"kalliope.core.HookManag... | [((3238, 3253), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3251, 3253), False, 'import unittest\n'), ((400, 465), 'os.makedirs', 'os.makedirs', (['"""/tmp/kalliope/tests/kalliope_resources_dir/neurons"""'], {}), "('/tmp/kalliope/tests/kalliope_resources_dir/neurons')\n", (411, 465), False, 'import os\n'), ((4... |
# Copyright (c) 2021, VRAI Labs and/or its affiliates. All rights reserved.
#
# This software is licensed under the Apache License, Version 2.0 (the
# "License") as published by the Apache Software Foundation.
#
# You may not use this file except in compliance with the License. You may
# obtain a copy of the License at... | [
"asyncio.set_event_loop",
"asyncio.new_event_loop",
"asyncio.get_event_loop",
"typing.TypeVar"
] | [((747, 760), 'typing.TypeVar', 'TypeVar', (['"""_T"""'], {}), "('_T')\n", (754, 760), False, 'from typing import Any, Coroutine, TypeVar\n'), ((1092, 1116), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (1114, 1116), False, 'import asyncio\n'), ((804, 828), 'asyncio.get_event_loop', 'asyncio.ge... |
from math import gcd
def get_primitive_pythagorean_triples(max_length):
"""
Get Pythagorean triples up to a+b+c <= max_length
"""
# Use Euclid's formula: choose coprime numbers m, n with m > n > 0, m, n not both odd
# Then a = m^2 - n^2, b = 2*m*n, c = m^2 + n^2
triples = []
n = 1
while... | [
"math.gcd"
] | [((1106, 1115), 'math.gcd', 'gcd', (['m', 'n'], {}), '(m, n)\n', (1109, 1115), False, 'from math import gcd\n')] |
import unittest
import azure.cosmos.cosmos_client_connection as cosmos_client_connection
import pytest
import azure.cosmos.documents as documents
import azure.cosmos.errors as errors
from azure.cosmos.http_constants import HttpHeaders, StatusCodes, SubStatusCodes
import azure.cosmos.retry_utility as retry_utility
impor... | [
"azure.cosmos.global_endpoint_manager._GlobalEndpointManager",
"azure.cosmos.request_object._RequestObject",
"azure.cosmos.errors.HTTPFailure",
"azure.cosmos.documents.ConnectionPolicy",
"pytest.mark.usefixtures",
"azure.cosmos.documents.DatabaseAccount",
"azure.cosmos.cosmos_client_connection.CosmosCli... | [((624, 659), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""teardown"""'], {}), "('teardown')\n", (647, 659), False, 'import pytest\n'), ((1604, 1632), 'azure.cosmos.documents.ConnectionPolicy', 'documents.ConnectionPolicy', ([], {}), '()\n', (1630, 1632), True, 'import azure.cosmos.documents as documents... |
__author__ = 'jparedes'
import numpy as np
from itertools import combinations, product, chain
from .support_filter import support_basic_premises, support_premises_derived
from .similarity_filter import similarity_basic_premises, similarity_derived_premises
from .pcd_filter import pcd_basic_premises, pcd_derived_premis... | [
"itertools.combinations",
"itertools.chain",
"itertools.product",
"numpy.hstack"
] | [((4456, 4485), 'itertools.combinations', 'combinations', (['ref_premises', '(2)'], {}), '(ref_premises, 2)\n', (4468, 4485), False, 'from itertools import combinations, product, chain\n'), ((6264, 6286), 'numpy.hstack', 'np.hstack', (['new_ux_prev'], {}), '(new_ux_prev)\n', (6273, 6286), True, 'import numpy as np\n'),... |
# coding=utf-8
import os
import json
import pytest
import responses
import watson_developer_cloud
@responses.activate
def test_success():
models_url = 'https://stream.watsonplatform.net/speech-to-text/api/v1/models'
models_response = '{"models": [{"url": "https://stream.watsonplatform.net/speech-to-text/api/v... | [
"responses.add",
"watson_developer_cloud.SpeechToTextV1",
"os.path.dirname",
"pytest.raises",
"responses.RequestsMock"
] | [((538, 649), 'responses.add', 'responses.add', (['responses.GET', 'models_url'], {'body': 'models_response', 'status': '(200)', 'content_type': '"""application/json"""'}), "(responses.GET, models_url, body=models_response, status=200,\n content_type='application/json')\n", (551, 649), False, 'import responses\n'), ... |
# Copyright 2010 <NAME> <EMAIL>
#
# 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 writin... | [
"ortools.constraint_solver.pywrapcp.Solver"
] | [((1464, 1496), 'ortools.constraint_solver.pywrapcp.Solver', 'pywrapcp.Solver', (['"""xkcd knapsack"""'], {}), "('xkcd knapsack')\n", (1479, 1496), False, 'from ortools.constraint_solver import pywrapcp\n')] |
import sys
import random
import math
def is_coprime(a, b):
status = 1
for i in range(1, a+1):
if a%i==0 and b%i==0:
status = i
return status == 1
def is_prime(n) :
if (n <= 1) :
return False
if (n <= 3) :
return True
if (n % 2 == 0 or n % 3 == 0) :
... | [
"sys.exit",
"random.randrange"
] | [((684, 708), 'random.randrange', 'random.randrange', (['(1)', 'phi'], {}), '(1, phi)\n', (700, 708), False, 'import random\n'), ((759, 783), 'random.randrange', 'random.randrange', (['(1)', 'phi'], {}), '(1, phi)\n', (775, 783), False, 'import random\n'), ((1884, 1895), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', ... |
import chord_recognition
import numpy as np
import miditoolkit
import copy
# parameters for input
DEFAULT_VELOCITY_BINS = np.linspace(0, 128, 32+1, dtype=np.int)
DEFAULT_FRACTION = 16
DEFAULT_DURATION_BINS = np.arange(60, 3841, 60, dtype=int)
DEFAULT_TEMPO_INTERVALS = [range(30, 90), range(90, 150), range(150, 210)]
... | [
"miditoolkit.Note",
"miditoolkit.midi.containers.TempoChange",
"numpy.searchsorted",
"chord_recognition.MIDIChord",
"miditoolkit.midi.containers.Marker",
"numpy.linspace",
"miditoolkit.midi.containers.Instrument",
"miditoolkit.midi.parser.MidiFile",
"numpy.arange"
] | [((123, 164), 'numpy.linspace', 'np.linspace', (['(0)', '(128)', '(32 + 1)'], {'dtype': 'np.int'}), '(0, 128, 32 + 1, dtype=np.int)\n', (134, 164), True, 'import numpy as np\n'), ((209, 243), 'numpy.arange', 'np.arange', (['(60)', '(3841)', '(60)'], {'dtype': 'int'}), '(60, 3841, 60, dtype=int)\n', (218, 243), True, 'i... |
import unittest
import hcl2
from checkov.terraform.checks.resource.linode.user_email_set import check
from checkov.common.models.enums import CheckResult
class Testuser_email_set(unittest.TestCase):
def test_success(self):
hcl_res = hcl2.loads("""
resource "linode_user" "test" {
email="<... | [
"unittest.main",
"checkov.terraform.checks.resource.linode.user_email_set.check.scan_resource_conf",
"hcl2.loads"
] | [((898, 913), 'unittest.main', 'unittest.main', ([], {}), '()\n', (911, 913), False, 'import unittest\n'), ((249, 360), 'hcl2.loads', 'hcl2.loads', (['"""\n resource "linode_user" "test" {\n email="<EMAIL>"\n }\n """'], {}), '(\n """\n resource "linode_user" "test" {\n email... |
import numpy as np
import math
from data_parser import loadData
def c(t):
return math.cos(math.radians(t))
def s(t):
return math.sin(math.radians(t))
def generate_angles(num_dofs):
angles = np.random.uniform(low = -360, high = 360, size = (num_dofs,))
return angles
#TODO find the right imp... | [
"data_parser.loadData",
"math.radians",
"math.cos",
"numpy.array",
"math.atan2",
"numpy.random.uniform",
"math.sin"
] | [((3186, 3223), 'data_parser.loadData', 'loadData', (['"""inputs.txt"""', '"""outputs.txt"""'], {}), "('inputs.txt', 'outputs.txt')\n", (3194, 3223), False, 'from data_parser import loadData\n'), ((214, 269), 'numpy.random.uniform', 'np.random.uniform', ([], {'low': '(-360)', 'high': '(360)', 'size': '(num_dofs,)'}), '... |
from lambdaz import a0
def test_len():
l = (a0._len_() > 3)._
assert next(filter(l, [(), (1,2), (1,2,3,4)])) == (1,2,3,4)
| [
"lambdaz.a0._len_"
] | [((50, 60), 'lambdaz.a0._len_', 'a0._len_', ([], {}), '()\n', (58, 60), False, 'from lambdaz import a0\n')] |
"""
Classes for visualizing echo data
"""
import numpy as np
import matplotlib.colors as colors
# import datetime as dt
from matplotlib.dates import date2num
from collections import defaultdict
import echopype_model
# Colormap: multi-frequency availability from Jech & Michaels 2006
MF_COLORS = np.array([[0,0,0],\
... | [
"matplotlib.dates.date2num",
"numpy.searchsorted",
"matplotlib.colors.ListedColormap",
"numpy.array",
"numpy.linspace",
"collections.defaultdict",
"numpy.around",
"matplotlib.colors.BoundaryNorm",
"numpy.arange"
] | [((588, 620), 'matplotlib.colors.ListedColormap', 'colors.ListedColormap', (['MF_COLORS'], {}), '(MF_COLORS)\n', (609, 620), True, 'import matplotlib.colors as colors\n'), ((1338, 1372), 'matplotlib.colors.ListedColormap', 'colors.ListedColormap', (['EK60_COLORS'], {}), '(EK60_COLORS)\n', (1359, 1372), True, 'import ma... |
import jwt
import pytest
from aiohttp import web
from aiohttp_jwt import JWTMiddleware
def test_throw_on_invalid_secret():
with pytest.raises(RuntimeError):
JWTMiddleware(secret_or_pub_key='')
async def test_get_payload(create_app, aiohttp_client, fake_payload, token):
async def handler(request):
... | [
"aiohttp_jwt.JWTMiddleware",
"pytest.mark.parametrize",
"pytest.raises",
"aiohttp.web.json_response",
"jwt.encode"
] | [((2806, 3072), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""schema, correct_token, req_property_exists, resp_status"""', "[('Bearer', True, True, 200), ('Invalid_scheme', True, False, 200), (\n 'Invalid_scheme', False, False, 200), ('Bearer', False, False, 401), (\n '', False, False, 200)]"], {}),... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Created by <NAME>
import os
import random
import requests
from string import ascii_letters, digits
from typing import Optional
class Picsum:
"""Class used to retrieve an image from Picsum and save it locally.
Once retrieved, the image can be shown interactively... | [
"random.choice",
"os.path.join",
"requests.get",
"os.path.isfile",
"os.path.isdir"
] | [((1968, 1998), 'requests.get', 'requests.get', (['self.request_url'], {}), '(self.request_url)\n', (1980, 1998), False, 'import requests\n'), ((5218, 5237), 'os.path.isdir', 'os.path.isdir', (['path'], {}), '(path)\n', (5231, 5237), False, 'import os\n'), ((5725, 5749), 'os.path.isfile', 'os.path.isfile', (['rnd_name'... |
import os
from flask import Flask, render_template, send_file
from flask.ext.assets import Environment
from config import debug, secret
app = Flask(__name__)
app.secret_key = secret
app.debug = debug
assets = Environment(app)
assets.debug = debug
assets.auto_build = True
assets.from_yaml(os.path.join(app.static_fo... | [
"flask.ext.assets.Environment",
"flask.render_template",
"os.path.join",
"flask.Flask"
] | [((146, 161), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (151, 161), False, 'from flask import Flask, render_template, send_file\n'), ((214, 230), 'flask.ext.assets.Environment', 'Environment', (['app'], {}), '(app)\n', (225, 230), False, 'from flask.ext.assets import Environment\n'), ((294, 341), 'os.... |
# coding: utf-8
from codecs import open
from os import path
from setuptools import find_packages, setup
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='binflakes',
version='0',
description='A catal... | [
"os.path.dirname",
"setuptools.find_packages",
"os.path.join"
] | [((127, 149), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file__)\n', (139, 149), False, 'from os import path\n'), ((162, 191), 'os.path.join', 'path.join', (['here', '"""README.rst"""'], {}), "(here, 'README.rst')\n", (171, 191), False, 'from os import path\n'), ((766, 838), 'setuptools.find_packages', ... |
import asyncio
import functools
import secrets
from concurrent.futures import ThreadPoolExecutor
from concurrent.futures import TimeoutError as FutureTimeoutError
from logging import Logger, getLogger
from typing import TYPE_CHECKING, Any, Dict, Tuple
from urllib.parse import urlparse
from broadcaster._backends.base i... | [
"logging.getLogger",
"urllib.parse.urlparse",
"asyncapi.GCloudPubSubPublishTimeoutError",
"asyncio.sleep",
"concurrent.futures.ThreadPoolExecutor",
"google.cloud.pubsub_v1.SubscriberClient",
"google.cloud.pubsub_v1.PublisherClient",
"functools.partial",
"asyncapi.GCloudPubSubConsumerDisconnectError"... | [((850, 869), 'logging.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (859, 869), False, 'from logging import Logger, getLogger\n'), ((899, 936), 'urllib.parse.urlparse', 'urlparse', (['url'], {'scheme': '"""gcloud-pubsub"""'}), "(url, scheme='gcloud-pubsub')\n", (907, 936), False, 'from urllib.parse impo... |
# Generated by Django 3.1.7 on 2021-05-10 06:35
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('gyoithon', '0009_auto_20210510_1401'),
]
operations = [
migrations.AddField(
... | [
"datetime.datetime",
"django.db.models.CharField"
] | [((392, 461), 'django.db.models.CharField', 'models.CharField', ([], {'default': '"""N/A"""', 'max_length': '(10)', 'verbose_name': '"""Status"""'}), "(default='N/A', max_length=10, verbose_name='Status')\n", (408, 461), False, 'from django.db import migrations, models\n'), ((623, 683), 'datetime.datetime', 'datetime.d... |
# ! /usr/bin/env python
from __future__ import print_function
import random
from terminalone import T1, filters
from terminalone.utils import credentials
from terminalone.vendor import six
from terminalone.errors import AuthRequiredError
from dotenv import load_dotenv
import os
dotenv_path = os.path.join(os.getcwd... | [
"terminalone.utils.credentials",
"os.environ.get",
"terminalone.T1",
"os.getcwd",
"dotenv.load_dotenv",
"terminalone.vendor.six.iterkeys",
"random.randint"
] | [((332, 356), 'dotenv.load_dotenv', 'load_dotenv', (['dotenv_path'], {}), '(dotenv_path)\n', (343, 356), False, 'from dotenv import load_dotenv\n'), ((311, 322), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (320, 322), False, 'import os\n'), ((424, 468), 'os.environ.get', 'os.environ.get', (['"""ACCEPTANCE_TEST_ADVERTIS... |
# ===========================================================================
# This module is created based on the code from 2 libraries: Lasagne and keras
# Original work Copyright (c) 2014-2015 keras contributors
# Original work Copyright (c) 2014-2015 Lasagne contributors
# Modified work Copyright 2016-2017 TrungNT... | [
"numpy.prod",
"numpy.sqrt",
"numpy.asarray",
"numpy.max",
"numpy.zeros",
"numpy.nonzero",
"numpy.linalg.svd",
"numpy.random.RandomState"
] | [((745, 779), 'numpy.random.RandomState', 'np.random.RandomState', (['_MAGIC_SEED'], {}), '(_MAGIC_SEED)\n', (766, 779), True, 'import numpy as np\n'), ((893, 927), 'numpy.random.RandomState', 'np.random.RandomState', (['_MAGIC_SEED'], {}), '(_MAGIC_SEED)\n', (914, 927), True, 'import numpy as np\n'), ((1848, 1876), 'n... |
'''
Collection of algorithms for transforming coordinates commoly used in
Geophysics.
Glossary:
---------
Geocentric Geodetic Coordinates (GGC)
Geocentric Geodetic System (GGS)
Geocentric Cartesian Coordinates (GCC)
Geocentric Cartesian System (GCS)
Geocentric Spherical Coordinates (GSC)
Geocentric Spherical System (G... | [
"numpy.abs",
"numpy.sqrt",
"numpy.isscalar",
"numpy.tan",
"numpy.logical_not",
"numpy.asarray",
"numpy.arcsin",
"numpy.max",
"numpy.deg2rad",
"numpy.arctan2",
"numpy.cos",
"numpy.sign",
"numpy.min",
"numpy.sin",
"numpy.rad2deg",
"numpy.zeros_like",
"numpy.arctan"
] | [((1405, 1423), 'numpy.asarray', 'np.asarray', (['height'], {}), '(height)\n', (1415, 1423), True, 'import numpy as np\n'), ((1434, 1454), 'numpy.asarray', 'np.asarray', (['latitude'], {}), '(latitude)\n', (1444, 1454), True, 'import numpy as np\n'), ((1465, 1486), 'numpy.asarray', 'np.asarray', (['longitude'], {}), '(... |
from typing import Dict, Tuple
from pynput.keyboard import Key
import configs
from models.mouse import MouseEvent, MousePressEvent, MouseReleaseEvent
from models.keyboard import KeyboardEvent, KeyboardPressEvent, KeyboardReleaseEvent
from time import time_ns
from utils.constructors import NewKeyboardEvent, NewMouseEve... | [
"utils.utils.GetID",
"time.time_ns"
] | [((531, 538), 'utils.utils.GetID', 'GetID', ([], {}), '()\n', (536, 538), False, 'from utils.utils import GetID\n'), ((540, 549), 'time.time_ns', 'time_ns', ([], {}), '()\n', (547, 549), False, 'from time import time_ns\n'), ((832, 839), 'utils.utils.GetID', 'GetID', ([], {}), '()\n', (837, 839), False, 'from utils.uti... |
import base64
import boto3
from botocore.exceptions import ClientError
import pytest
import sure # noqa # pylint: disable=unused-import
from moto import mock_autoscaling, mock_ec2
from moto.core import ACCOUNT_ID
from tests import EXAMPLE_AMI_ID
@mock_autoscaling
def test_create_launch_configuration():
client ... | [
"boto3.client",
"base64.b64decode",
"pytest.param",
"pytest.raises"
] | [((322, 374), 'boto3.client', 'boto3.client', (['"""autoscaling"""'], {'region_name': '"""us-east-1"""'}), "('autoscaling', region_name='us-east-1')\n", (334, 374), False, 'import boto3\n'), ((1357, 1383), 'base64.b64decode', 'base64.b64decode', (['userdata'], {}), '(userdata)\n', (1373, 1383), False, 'import base64\n'... |
import pandas as pd
import numpy as np
from PIL import Image, ImageDraw, ImageFont
import h5py
import os
from sortedcontainers import SortedDict
from scipy.ndimage.filters import gaussian_filter
import scipy.spatial
from itertools import islice
def generate_gaussian_kernels(round_decimals=3, sigma_threshold=4, sigma_... | [
"numpy.mean",
"numpy.ceil",
"PIL.Image.open",
"scipy.ndimage.filters.gaussian_filter",
"pandas.read_csv",
"os.path.splitext",
"h5py.File",
"os.path.split",
"numpy.linspace",
"numpy.zeros",
"pandas.DataFrame",
"sortedcontainers.SortedDict",
"numpy.round"
] | [((620, 665), 'numpy.linspace', 'np.linspace', (['sigma_min', 'sigma_max', 'num_sigmas'], {}), '(sigma_min, sigma_max, num_sigmas)\n', (631, 665), True, 'import numpy as np\n'), ((1144, 1168), 'sortedcontainers.SortedDict', 'SortedDict', (['kernels_dict'], {}), '(kernels_dict)\n', (1154, 1168), False, 'from sortedconta... |
import discord
import requests
from redbot.core import checks, commands
from redbot.core.config import Config
from .cdtembed import Embed
files = {
"bcg_en": "https://raw.githubusercontent.com/CollectorDevTeam/assets/master/data/json/snapshots/en/bcg_en.json",
"bcg_stat_en": "https://raw.githubuserco... | [
"redbot.core.checks.is_owner",
"redbot.core.commands.command",
"requests.get",
"redbot.core.config.Config.get_conf",
"redbot.core.commands.group"
] | [((1961, 1978), 'redbot.core.checks.is_owner', 'checks.is_owner', ([], {}), '()\n', (1976, 1978), False, 'from redbot.core import checks, commands\n'), ((1985, 2001), 'redbot.core.commands.group', 'commands.group', ([], {}), '()\n', (1999, 2001), False, 'from redbot.core import checks, commands\n'), ((6264, 6281), 'red... |
# this file contains the invert() function that defines the right-side
# vector of the normal equations and calls the conjugate-gradient solver
from conj_grad import cg_solve
from operators import (forward_w,forward_beta,adjoint_w,adjoint_beta,Hc,
adjoint_Ub,adjoint_Uw,adjoint_Vb,adjoint_Vw,for... | [
"conj_grad.cg_solve",
"operators.forward_U",
"scipy.fft.fft2",
"operators.forward_beta",
"numpy.max",
"numpy.array",
"operators.Hc",
"operators.forward_V",
"operators.forward_w"
] | [((705, 721), 'numpy.max', 'np.max', (['vel_locs'], {}), '(vel_locs)\n', (711, 721), True, 'import numpy as np\n'), ((1030, 1085), 'conj_grad.cg_solve', 'cg_solve', (['b', 'inv_w', 'inv_beta', 'eps_w', 'eps_beta', 'vel_locs'], {}), '(b, inv_w, inv_beta, eps_w, eps_beta, vel_locs)\n', (1038, 1085), False, 'from conj_gra... |
origin_dir='13.119076,77.579578'
destination_dir = '13.104043,77.583720'
waypoints_dir = ['13.104043,77.583720','13.104043,77.583720']
from datetime import datetime
now = datetime.now()
import googlemaps
#### Setting u the API key to connect to Google maps API
apikey = '<KEY>'
#Perform request to use the Google Maps ... | [
"datetime.datetime.now",
"googlemaps.Client"
] | [((173, 187), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (185, 187), False, 'from datetime import datetime\n'), ((344, 373), 'googlemaps.Client', 'googlemaps.Client', ([], {'key': 'apikey'}), '(key=apikey)\n', (361, 373), False, 'import googlemaps\n')] |
## regression.py
## scalar regression
## note that `calcMargiProb`, `calcJointProb`, `calcCondiProb`, and `estEntropy` aren't currently used in any methods.
import numpy as np
import pandas as pd
import tensorflow as tf
import itertools as it
import scipy.special as ss
import time
def eNet(alpha, lam, v)... | [
"scipy.special.xlogy",
"tensorflow.reduce_sum",
"numpy.log",
"tensorflow.reduce_mean",
"tensorflow.sign",
"tensorflow.placeholder",
"tensorflow.Session",
"numpy.random.seed",
"tensorflow.matmul",
"tensorflow.square",
"pandas.DataFrame",
"tensorflow.train.AdamOptimizer",
"tensorflow.zeros",
... | [((744, 760), 'numpy.zeros', 'np.zeros', (['(M, M)'], {}), '((M, M))\n', (752, 760), True, 'import numpy as np\n'), ((856, 880), 'numpy.sum', 'np.sum', (['G[cadId == i, j]'], {}), '(G[cadId == i, j])\n', (862, 880), True, 'import numpy as np\n'), ((1270, 1279), 'numpy.log', 'np.log', (['(2)'], {}), '(2)\n', (1276, 1279... |
from arche.rules.result import Level, Message, Result
from conftest import create_named_df, create_result
import pandas as pd
import pytest
@pytest.mark.parametrize(
"source, target",
[(("summary", "details", {"err": ["1"]}), ("summary", "details", {"err": ["1"]}))],
)
def test_message_eq(source, target):
... | [
"pandas.Series",
"arche.rules.result.Result.tensors_equal",
"conftest.create_result",
"arche.rules.result.Message",
"pytest.mark.parametrize",
"arche.rules.result.Result",
"pandas.DataFrame",
"conftest.create_named_df"
] | [((143, 272), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""source, target"""', "[(('summary', 'details', {'err': ['1']}), ('summary', 'details', {'err': [\n '1']}))]"], {}), "('source, target', [(('summary', 'details', {'err':\n ['1']}), ('summary', 'details', {'err': ['1']}))])\n", (166, 272), Fal... |
from pyopenproject.api_connection.exceptions.request_exception import RequestError
from pyopenproject.api_connection.requests.patch_request import PatchRequest
from pyopenproject.business.exception.business_error import BusinessError
from pyopenproject.business.services.command.query.query_command import QueryCommand
f... | [
"pyopenproject.business.exception.business_error.BusinessError",
"pyopenproject.api_connection.requests.patch_request.PatchRequest",
"pyopenproject.model.query.Query"
] | [((713, 728), 'pyopenproject.model.query.Query', 'Query', (['json_obj'], {}), '(json_obj)\n', (718, 728), False, 'from pyopenproject.model.query import Query\n'), ((782, 830), 'pyopenproject.business.exception.business_error.BusinessError', 'BusinessError', (['f"""Error to star: {self.query.id}"""'], {}), "(f'Error to ... |
import torch
import random
import numpy as np
# MAX_SEQ = 200
# MIN_SEQ = 3
# SEED = 2021
def set_random_seeds(seed=0):
torch.manual_seed(seed)
torch.cuda.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
random.seed(seed)
np.random.seed(seed)
torch.backends.cudnn.deterministic = True
to... | [
"torch.cuda.manual_seed_all",
"torch.manual_seed",
"random.seed",
"numpy.random.seed",
"torch.cuda.manual_seed"
] | [((126, 149), 'torch.manual_seed', 'torch.manual_seed', (['seed'], {}), '(seed)\n', (143, 149), False, 'import torch\n'), ((154, 182), 'torch.cuda.manual_seed', 'torch.cuda.manual_seed', (['seed'], {}), '(seed)\n', (176, 182), False, 'import torch\n'), ((187, 219), 'torch.cuda.manual_seed_all', 'torch.cuda.manual_seed_... |
from django.contrib import admin
from .models import Category, Post
admin.site.register(Post)
admin.site.register(Category) | [
"django.contrib.admin.site.register"
] | [((69, 94), 'django.contrib.admin.site.register', 'admin.site.register', (['Post'], {}), '(Post)\n', (88, 94), False, 'from django.contrib import admin\n'), ((95, 124), 'django.contrib.admin.site.register', 'admin.site.register', (['Category'], {}), '(Category)\n', (114, 124), False, 'from django.contrib import admin\n... |
"""Set up the environment for doctests
This file is automatically evaluated by py.test. It ensures that we can write
doctests without distracting import statements in the doctest.
"""
import numpy
import pytest
@pytest.fixture(autouse=True)
def set_doctest_env(doctest_namespace):
"""Inject objects into the testi... | [
"pytest.fixture"
] | [((215, 243), 'pytest.fixture', 'pytest.fixture', ([], {'autouse': '(True)'}), '(autouse=True)\n', (229, 243), False, 'import pytest\n')] |
import argparse
import requests
import json
import os
import yaml
import sys
def is_local_file_path(s):
"""Does not consider paths above cwd to be valid."""
if (
isinstance(s, str)
and s.startswith('./')
and os.path.exists(s)
and os.path.isfile(s)
and os.path.abspath(s)... | [
"os.path.exists",
"argparse.ArgumentParser",
"json.dumps",
"os.getcwd",
"os.path.isfile",
"yaml.safe_load",
"os.path.abspath"
] | [((1259, 1323), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""HTTP Service Build Server"""'}), "(description='HTTP Service Build Server')\n", (1282, 1323), False, 'import argparse\n'), ((242, 259), 'os.path.exists', 'os.path.exists', (['s'], {}), '(s)\n', (256, 259), False, 'import os\n... |
import os
import cv2
import matplotlib.pyplot as plt
import numpy as np
import pykitti
import torch
import torchvision.transforms.functional as F
from torch import hub
from torchvision.datasets import Cityscapes
from autolabeling import autolabel
from autolabeling.classes import get_lidar_colormap
from lilanet.utils ... | [
"numpy.clip",
"torch.as_tensor",
"autolabeling.autolabel.get_points_in_fov_90",
"numpy.sqrt",
"autolabeling.autolabel.transfer_labels",
"autolabeling.autolabel.semantic_segmentation",
"numpy.array",
"torch.cuda.is_available",
"matplotlib.pyplot.imshow",
"autolabeling.autolabel.spherical_projection... | [((384, 424), 'torch.zeros', 'torch.zeros', (['[256, 3]'], {'dtype': 'torch.uint8'}), '([256, 3], dtype=torch.uint8)\n', (395, 424), False, 'import torch\n'), ((800, 852), 'autolabeling.autolabel.pinhole_projection', 'autolabel.pinhole_projection', (['points', 'T_cam0', 'K_cam0'], {}), '(points, T_cam0, K_cam0)\n', (82... |
import arrayfire as af
import typing as tp
from ._array import ndarray, _wrap_af_array
def count_nonzero(a: ndarray,
axis: tp.Optional[int] = None) \
-> tp.Union[int, ndarray]:
return _wrap_af_array(af.count(a._af_array, dim=axis))
def diff(a: ndarray,
n: int = 1,
ax... | [
"arrayfire.diff2",
"arrayfire.sort",
"arrayfire.diff1",
"arrayfire.sort_by_key",
"arrayfire.count",
"arrayfire.set_intersect",
"arrayfire.set_unique",
"arrayfire.set_union",
"arrayfire.where"
] | [((2245, 2317), 'arrayfire.sort_by_key', 'af.sort_by_key', (['values._af_array', 'keys._af_array'], {'is_ascending': 'ascending'}), '(values._af_array, keys._af_array, is_ascending=ascending)\n', (2259, 2317), True, 'import arrayfire as af\n'), ((2879, 2923), 'arrayfire.set_unique', 'af.set_unique', (['ar._af_array'], ... |
from unittest import TestCase
class TestDukeMTMC(TestCase):
def test_all(self):
import os.path as osp
from reid.datasets import DukeMTMC
from reid.utils.serialization import read_json
root, split_id, num_val = '/tmp/open-reid/dukemtmc', 0, 100
dataset = DukeMTMC(root, spli... | [
"os.path.join",
"reid.datasets.DukeMTMC"
] | [((301, 366), 'reid.datasets.DukeMTMC', 'DukeMTMC', (['root'], {'split_id': 'split_id', 'num_val': 'num_val', 'download': '(True)'}), '(root, split_id=split_id, num_val=num_val, download=True)\n', (309, 366), False, 'from reid.datasets import DukeMTMC\n'), ((552, 579), 'os.path.join', 'osp.join', (['root', '"""meta.jso... |
from typing import Tuple
import pytest
from more_itertools import only
from adam.ontology.phase2_ontology import gravitationally_aligned_axis_is_largest
from adam.axes import HorizontalAxisOfObject, FacingAddresseeAxis, AxesInfo
from adam.language_specific.english.english_language_generator import (
PREFER_DITRANS... | [
"adam.ontology.phase1_ontology.strictly_above",
"adam.ontology.phase1_spatial_relations.Region",
"adam.axes.HorizontalAxisOfObject",
"adam_test_utils.situation_object",
"adam.situation.Action",
"adam.ontology.phase2_ontology.gravitationally_aligned_axis_is_largest",
"adam.ontology.phase1_ontology.far",
... | [((2128, 2220), 'adam.language_specific.english.english_language_generator.SimpleRuleBasedEnglishLanguageGenerator', 'SimpleRuleBasedEnglishLanguageGenerator', ([], {'ontology_lexicon': 'GAILA_PHASE_1_ENGLISH_LEXICON'}), '(ontology_lexicon=\n GAILA_PHASE_1_ENGLISH_LEXICON)\n', (2167, 2220), False, 'from adam.languag... |
# emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
# ex: set sts=4 ts=4 sw=4 noet:
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the datalad package for the
# copyright and license terms.
#
# ## ### ##... | [
"logging.getLogger",
"datalad.api.ls",
"os.path.lexists",
"os.unlink",
"datalad.dochelpers.exc_str"
] | [((1193, 1240), 'logging.getLogger', 'getLogger', (['"""datalad.crawler.pipelines.openfmri"""'], {}), "('datalad.crawler.pipelines.openfmri')\n", (1202, 1240), False, 'from logging import getLogger\n'), ((2439, 2460), 'os.path.lexists', 'lexists', (['"""README.txt"""'], {}), "('README.txt')\n", (2446, 2460), False, 'fr... |
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | [
"logging.getLogger",
"logging.Formatter",
"logging.StreamHandler",
"colorlog.ColoredFormatter"
] | [((843, 870), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (860, 870), False, 'import logging\n'), ((884, 924), 'logging.StreamHandler', 'logging.StreamHandler', ([], {'stream': 'sys.stderr'}), '(stream=sys.stderr)\n', (905, 924), False, 'import logging\n'), ((937, 1037), 'logging.Forma... |
#!/usr/bin/env python3
import logging
import os
import sys
from pathlib import Path
import click
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
from scapy.all import ASN1_OID, IP, SNMP, UDP, SNMPget, SNMPvarbind, conf, sr1
@click.command()
@click.argument('ip')
@click.option('-p', 'port', default=161,... | [
"logging.getLogger",
"click.argument",
"click.option",
"os.path.join",
"scapy.all.sr1",
"scapy.all.UDP",
"scapy.all.ASN1_OID",
"os.path.abspath",
"sys.stdout.flush",
"click.command",
"scapy.all.IP"
] | [((242, 257), 'click.command', 'click.command', ([], {}), '()\n', (255, 257), False, 'import click\n'), ((259, 279), 'click.argument', 'click.argument', (['"""ip"""'], {}), "('ip')\n", (273, 279), False, 'import click\n'), ((281, 340), 'click.option', 'click.option', (['"""-p"""', '"""port"""'], {'default': '(161)', 'h... |