code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import pandas as pd
import requests
from selenium.common.exceptions import TimeoutException
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
import json
import requests
import bitstamp.client
file = open("/Users/davidkatzaudio/Desktop/trading_bot/bitstamp.json", "r").read() #reads json formated... | [
"json.loads"
] | [((340, 356), 'json.loads', 'json.loads', (['file'], {}), '(file)\n', (350, 356), False, 'import json\n'), ((383, 399), 'json.loads', 'json.loads', (['file'], {}), '(file)\n', (393, 399), False, 'import json\n'), ((421, 437), 'json.loads', 'json.loads', (['file'], {}), '(file)\n', (431, 437), False, 'import json\n')] |
from __future__ import print_function
import numpy as np
from . import utils
from numpy import linalg as LA
import math
def ODL_updateD(D, E, F, iterations=100, tol=1e-8):
"""
The main algorithm in ODL.
Solving the optimization problem:
D = arg min_D -2trace(E'*D) + trace(D*F*D') subject to: ||d_i||_... | [
"numpy.eye",
"numpy.linalg.eig",
"math.sqrt",
"numpy.dot",
"numpy.zeros",
"numpy.linalg.norm",
"numpy.zeros_like"
] | [((2437, 2453), 'numpy.zeros_like', 'np.zeros_like', (['D'], {}), '(D)\n', (2450, 2453), True, 'import numpy as np\n'), ((2464, 2482), 'numpy.eye', 'np.eye', (['D.shape[1]'], {}), '(D.shape[1])\n', (2470, 2482), True, 'import numpy as np\n'), ((3251, 3267), 'numpy.zeros_like', 'np.zeros_like', (['X'], {}), '(X)\n', (32... |
from django.conf.urls import patterns, include, url
from django.contrib import admin
from rest_framework.authtoken.views import obtain_auth_token
from board.urls import router
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'scrum.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
... | [
"django.conf.urls.include",
"django.conf.urls.url"
] | [((368, 421), 'django.conf.urls.url', 'url', (['"""api/token"""', 'obtain_auth_token'], {'name': '"""api-token"""'}), "('api/token', obtain_auth_token, name='api-token')\n", (371, 421), False, 'from django.conf.urls import patterns, include, url\n'), ((441, 461), 'django.conf.urls.include', 'include', (['router.urls'],... |
# Given a face image and a model, creates a new image plotting the nose coordinates (or what the model thinks is the nose!)
from __future__ import print_function
import keras
from PIL import Image
import numpy as np
from data_utils import *
import argparse
def main():
parser = argparse.ArgumentParser()
pars... | [
"keras.models.load_model",
"PIL.Image.open",
"numpy.asarray",
"argparse.ArgumentParser"
] | [((286, 311), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (309, 311), False, 'import argparse\n'), ((845, 867), 'PIL.Image.open', 'Image.open', (['args.image'], {}), '(args.image)\n', (855, 867), False, 'from PIL import Image\n'), ((999, 1015), 'numpy.asarray', 'np.asarray', (['data'], {}), ... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from django.template.context import Context
from cms.api import create_page
from cms.test_utils.testcases import CMSTestCase
from djangocms_helper.base_test import BaseTestCase
class CascadeTestCase(CMSTestCase, BaseTe... | [
"django.template.context.Context",
"cms.api.create_page",
"django.contrib.admin.sites.AdminSite"
] | [((397, 462), 'cms.api.create_page', 'create_page', ([], {'title': '"""HOME"""', 'template': '"""testing.html"""', 'language': '"""en"""'}), "(title='HOME', template='testing.html', language='en')\n", (408, 462), False, 'from cms.api import create_page\n'), ((752, 775), 'django.contrib.admin.sites.AdminSite', 'admin.si... |
import math
import queue
class Solution:
def vertices(self):
return [(x, y) for y in range(len(self.grid[0])) for x in range(len(self.grid))]
def adjacent(self, u):
l = list()
if u[0] + 1 < len(self.grid):
l.append((u[0] + 1, u[1]))
if u[1] + 1 < len(self.grid[0])... | [
"queue.PriorityQueue"
] | [((523, 544), 'queue.PriorityQueue', 'queue.PriorityQueue', ([], {}), '()\n', (542, 544), False, 'import queue\n')] |
from abc import ABCMeta, abstractmethod
from tgt_grease.core import Logging, GreaseContainer
from datetime import datetime
import sys
import os
import traceback
class Command(object):
"""Abstract class for commands in GREASE
Attributes:
__metaclass__ (ABCMeta): Metadata class object
purpose (... | [
"sys.exc_info",
"traceback.format_exception",
"tgt_grease.core.GreaseContainer",
"datetime.datetime.utcnow"
] | [((1401, 1418), 'datetime.datetime.utcnow', 'datetime.utcnow', ([], {}), '()\n', (1416, 1418), False, 'from datetime import datetime\n'), ((1067, 1090), 'tgt_grease.core.GreaseContainer', 'GreaseContainer', (['Logger'], {}), '(Logger)\n', (1082, 1090), False, 'from tgt_grease.core import Logging, GreaseContainer\n'), (... |
import tensorflow as tf
import numpy as np
from TensorflowLearning.common import deal_label
(train_images, train_labels), (test_images, test_labels) = tf.keras.datasets.mnist.load_data()
train_images, test_images = train_images / 255.0, test_images / 255.0
train_images = np.reshape(train_images, [-1, 784])
test_images... | [
"TensorflowLearning.common.deal_label",
"numpy.reshape",
"tensorflow.keras.datasets.mnist.load_data"
] | [((152, 187), 'tensorflow.keras.datasets.mnist.load_data', 'tf.keras.datasets.mnist.load_data', ([], {}), '()\n', (185, 187), True, 'import tensorflow as tf\n'), ((273, 308), 'numpy.reshape', 'np.reshape', (['train_images', '[-1, 784]'], {}), '(train_images, [-1, 784])\n', (283, 308), True, 'import numpy as np\n'), ((3... |
# This script will delete the volumes which are in available state and has no tags attached to it.
# Available state means that the volume is not attached to any instance.
# Import modules.
import boto3
# Initiate AWS session with ec2-admin profile.
aws_session = boto3.session.Session(profile_name="inderpalaws02-ec... | [
"boto3.session.Session"
] | [((268, 329), 'boto3.session.Session', 'boto3.session.Session', ([], {'profile_name': '"""inderpalaws02-ec2-admin"""'}), "(profile_name='inderpalaws02-ec2-admin')\n", (289, 329), False, 'import boto3\n')] |
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the MIT License. See the LICENSE file in the root of this
# repository for complete details.
"""
Processors and tools specific to the `Twisted <https://twistedmatrix.com/>`_
networking engine.
See also :doc:`structlog's Twisted su... | [
"sys.exc_info",
"zope.interface.implementer",
"twisted.python.failure.Failure",
"twisted.python.log.textFromEventDict"
] | [((5811, 5836), 'zope.interface.implementer', 'implementer', (['ILogObserver'], {}), '(ILogObserver)\n', (5822, 5836), False, 'from zope.interface import implementer\n'), ((6404, 6429), 'zope.interface.implementer', 'implementer', (['ILogObserver'], {}), '(ILogObserver)\n', (6415, 6429), False, 'from zope.interface imp... |
from __future__ import annotations
import io
import tempfile
import typing
import contextlib
import apicall.config as config
import apicall.arguments as arg
class StartCondition(typing.NamedTuple):
""" コマンドの実行開始時の条件 """
args: typing.List[str]
config: typing.Optional[config.Config]
def parse(self) -> ... | [
"contextlib.redirect_stdout",
"apicall.config.Config",
"apicall.arguments.parse",
"contextlib.redirect_stderr",
"tempfile.TemporaryFile"
] | [((354, 392), 'apicall.arguments.parse', 'arg.parse', (['self.args[0]', 'self.args[1:]'], {}), '(self.args[0], self.args[1:])\n', (363, 392), True, 'import apicall.arguments as arg\n'), ((889, 918), 'tempfile.TemporaryFile', 'tempfile.TemporaryFile', (['"""w+t"""'], {}), "('w+t')\n", (911, 918), False, 'import tempfile... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import cv2
import numpy as np
import constants as const
import transformations.shadow_mask as mask
def add_n_ellipses_light(image, intensity = 0.5, blur_width = 6, n = 1):
inverted_colors = const.WHITE - image
inverted_shadow = add_n_ellipses_shadow(inverted_colors, i... | [
"cv2.ellipse",
"numpy.zeros",
"transformations.shadow_mask.apply_shadow_mask",
"numpy.random.uniform"
] | [((908, 949), 'numpy.zeros', 'np.zeros', (['image.shape[:2]'], {'dtype': 'np.uint8'}), '(image.shape[:2], dtype=np.uint8)\n', (916, 949), True, 'import numpy as np\n'), ((1039, 1100), 'transformations.shadow_mask.apply_shadow_mask', 'mask.apply_shadow_mask', (['image', 'blur_width', 'intensity', 'ellipse'], {}), '(imag... |
# coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from swagger_server.models.base_model_ import Model
from swagger_server import util
class Impedance(Model):
"""NOTE: This class is auto generated by the swagger c... | [
"swagger_server.util.deserialize_model"
] | [((1861, 1894), 'swagger_server.util.deserialize_model', 'util.deserialize_model', (['dikt', 'cls'], {}), '(dikt, cls)\n', (1883, 1894), False, 'from swagger_server import util\n')] |
import datetime
import sys
import time
import pytest
from airflow import DAG
from airflow.hooks.http_hook import HttpHook
from bedrock_plugin import RunPipelineOperator
if sys.version_info >= (3, 3):
from unittest.mock import PropertyMock, patch
else:
from mock import PropertyMock, patch
def test_run_pipel... | [
"bedrock_plugin.RunPipelineOperator.GET_PIPELINE_RUN_PATH.format",
"bedrock_plugin.RunPipelineOperator.RUN_PIPELINE_PATH.format",
"mock.patch.object",
"datetime.datetime.now",
"pytest.fail",
"pytest.raises",
"mock.PropertyMock",
"bedrock_plugin.RunPipelineOperator",
"bedrock_plugin.RunPipelineOperat... | [((524, 697), 'bedrock_plugin.RunPipelineOperator', 'RunPipelineOperator', ([], {'task_id': '"""run_pipeline"""', 'dag': 'dag', 'conn_id': 'airflow_connection', 'pipeline_id': 'pipeline_id', 'run_source_commit': '"""master"""', 'environment_id': 'environment_id'}), "(task_id='run_pipeline', dag=dag, conn_id=\n airfl... |
#usr/bin/env python
import time
import io
import os
import re
import sys
from io import open
from sys import argv
import pandas as pd
## ARGV
if len (sys.argv) < 4:
print ("\nUsage:")
print ("python3 %s repeatMasker info_sequence_names folder\n" %os.path.abspath(argv[0]))
exit()
repeatMasker_file = argv[1]
convers... | [
"pandas.read_csv",
"io.open",
"os.path.basename",
"os.path.abspath",
"re.sub"
] | [((681, 708), 'io.open', 'open', (['repeatmasker_bed', '"""w"""'], {}), "(repeatmasker_bed, 'w')\n", (685, 708), False, 'from io import open\n'), ((738, 766), 'io.open', 'open', (['repeatMasker_file', '"""r"""'], {}), "(repeatMasker_file, 'r')\n", (742, 766), False, 'from io import open\n'), ((556, 591), 'os.path.basen... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-09-06 05:52
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('std_bounties', '0014_remove_category_platform'),
]
operations = [
migratio... | [
"django.db.models.BooleanField"
] | [((425, 458), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'default': '(True)'}), '(default=True)\n', (444, 458), False, 'from django.db import migrations, models\n'), ((597, 630), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'default': '(True)'}), '(default=True)\n', (616, 630), False... |
"""Inspect APIs
"""
import operator
import unittest
import requests
from .config import *
from .techstacks_dtos import *
@dataclass_json(undefined=Undefined.EXCLUDE)
@dataclass
class GithubRepo:
name: str
description: Optional[str] = None
homepage: Optional[str] = None
lang: Optional[str] = field(m... | [
"operator.attrgetter",
"requests.get"
] | [((555, 616), 'requests.get', 'requests.get', (['f"""https://api.github.com/orgs/{org_name}/repos"""'], {}), "(f'https://api.github.com/orgs/{org_name}/repos')\n", (567, 616), False, 'import requests\n'), ((716, 747), 'operator.attrgetter', 'operator.attrgetter', (['"""watchers"""'], {}), "('watchers')\n", (735, 747), ... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'listingSemisUI.ui'
#
# Created by: PyQt4 UI code generator 4.11.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf... | [
"PyQt4.QtCore.QMetaObject.connectSlotsByName",
"PyQt4.QtGui.QPushButton",
"PyQt4.QtGui.QLabel",
"PyQt4.QtCore.QRect",
"PyQt4.QtGui.QTableView",
"PyQt4.QtGui.QApplication.translate",
"PyQt4.QtGui.QFont"
] | [((456, 520), 'PyQt4.QtGui.QApplication.translate', 'QtGui.QApplication.translate', (['context', 'text', 'disambig', '_encoding'], {}), '(context, text, disambig, _encoding)\n', (484, 520), False, 'from PyQt4 import QtCore, QtGui\n'), ((812, 834), 'PyQt4.QtGui.QTableView', 'QtGui.QTableView', (['Form'], {}), '(Form)\n'... |
from setuptools import setup
setup(name="r_example", version="0.0.1")
| [
"setuptools.setup"
] | [((30, 70), 'setuptools.setup', 'setup', ([], {'name': '"""r_example"""', 'version': '"""0.0.1"""'}), "(name='r_example', version='0.0.1')\n", (35, 70), False, 'from setuptools import setup\n')] |
import torch
import torch.onnx
from models.slim import Slim
x = torch.randn(1, 3, 160, 160)
model = Slim()
model.load_state_dict(torch.load("../pretrained_weights/slim_160_latest.pth", map_location="cpu"))
model.eval()
torch.onnx.export(model, x, "../pretrained_weights/slim_160_latest.onnx", input_names=["input1"], ou... | [
"models.slim.Slim",
"torch.load",
"torch.randn",
"torch.onnx.export"
] | [((65, 92), 'torch.randn', 'torch.randn', (['(1)', '(3)', '(160)', '(160)'], {}), '(1, 3, 160, 160)\n', (76, 92), False, 'import torch\n'), ((101, 107), 'models.slim.Slim', 'Slim', ([], {}), '()\n', (105, 107), False, 'from models.slim import Slim\n'), ((220, 347), 'torch.onnx.export', 'torch.onnx.export', (['model', '... |
from allauth.account.models import EmailAddress
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class Scope(object):
READ = 'read'
WRITE = 'write'
class DitSSOInternalAccount(ProviderAccount):
def get_profile_url(... | [
"allauth.account.models.EmailAddress"
] | [((785, 825), 'allauth.account.models.EmailAddress', 'EmailAddress', ([], {'email': 'email', 'verified': '(True)'}), '(email=email, verified=True)\n', (797, 825), False, 'from allauth.account.models import EmailAddress\n')] |
#************************************************
# <NAME>
# Constants to hold conjugations of helper verbs
# Fall 2016
#************************************************
import conjugation as conj
import tense as tn
ALLER_PRESENT = conj.Conjugation("aller", tn.Tense.PRESENT,
"vais",... | [
"conjugation.Conjugation"
] | [((236, 331), 'conjugation.Conjugation', 'conj.Conjugation', (['"""aller"""', 'tn.Tense.PRESENT', '"""vais"""', '"""vas"""', '"""va"""', '"""allons"""', '"""allez"""', '"""vont"""'], {}), "('aller', tn.Tense.PRESENT, 'vais', 'vas', 'va', 'allons',\n 'allez', 'vont')\n", (252, 331), True, 'import conjugation as conj\... |
from apis.models import User
from flask_marshmallow.schema import Schema
from flask_marshmallow.fields import fields
class UserSchema(Schema):
email = fields.Email(required=True)
name = fields.String()
address = fields.String(required=True) | [
"flask_marshmallow.fields.fields.Email",
"flask_marshmallow.fields.fields.String"
] | [((156, 183), 'flask_marshmallow.fields.fields.Email', 'fields.Email', ([], {'required': '(True)'}), '(required=True)\n', (168, 183), False, 'from flask_marshmallow.fields import fields\n'), ((195, 210), 'flask_marshmallow.fields.fields.String', 'fields.String', ([], {}), '()\n', (208, 210), False, 'from flask_marshmal... |
#
# Stripped version of "hookenv.py" (By <NAME>, 2020 <EMAIL>)
#
#
# Copyright 2014-2015 Canonical Limited.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses... | [
"subprocess.check_output",
"yaml.safe_dump",
"subprocess.check_call",
"json.dumps",
"os.environ.get",
"os.path.join",
"functools.wraps",
"yaml.safe_load",
"subprocess.call",
"tempfile.NamedTemporaryFile",
"os.remove"
] | [((1650, 1661), 'functools.wraps', 'wraps', (['func'], {}), '(func)\n', (1655, 1661), False, 'from functools import wraps\n'), ((3079, 3116), 'os.environ.get', 'os.environ.get', (['"""JUJU_RELATION"""', 'None'], {}), "('JUJU_RELATION', None)\n", (3093, 3116), False, 'import os\n'), ((3912, 3952), 'os.environ.get', 'os.... |
import logging
import asyncio
import grpc
import products_pb2
import products_pb2_grpc
GRPC_HOST_PORT = 'localhost:8080'
async def main():
async with grpc.aio.insecure_channel(GRPC_HOST_PORT) as channel:
stub = products_pb2_grpc.ProductServiceStub(channel)
response = await stub.GetV... | [
"logging.basicConfig",
"grpc.aio.insecure_channel",
"products_pb2.ClientRequestType",
"products_pb2_grpc.ProductServiceStub"
] | [((524, 545), 'logging.basicConfig', 'logging.basicConfig', ([], {}), '()\n', (543, 545), False, 'import logging\n'), ((169, 210), 'grpc.aio.insecure_channel', 'grpc.aio.insecure_channel', (['GRPC_HOST_PORT'], {}), '(GRPC_HOST_PORT)\n', (194, 210), False, 'import grpc\n'), ((239, 284), 'products_pb2_grpc.ProductService... |
#!/bin/env python
# Copyright 2021 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | [
"nmigen.Signal",
"nmigen.Module",
"random.randrange"
] | [((834, 842), 'nmigen.Module', 'Module', ([], {}), '()\n', (840, 842), False, 'from nmigen import Signal, Module\n'), ((862, 871), 'nmigen.Signal', 'Signal', (['(8)'], {}), '(8)\n', (868, 871), False, 'from nmigen import Signal, Module\n'), ((1045, 1066), 'random.randrange', 'random.randrange', (['(256)'], {}), '(256)\... |
"""Description
"""
import sys, os, tempfile, argparse
import tensorflow as tf
import numpy as np
from definitions import *
from feeder import SampleReader
from model import SptAudioGen, SptAudioGenParams
from pyutils.iolib.audio import save_wav
import myutils
def parse_arguments():
parser = argparse.ArgumentPars... | [
"pyutils.iolib.audio.save_wav",
"myutils.gen_360video",
"tensorflow.compat.v1.Session",
"os.remove",
"myutils.load_params",
"model.SptAudioGenParams",
"model.SptAudioGen",
"tensorflow.compat.v1.placeholder",
"argparse.ArgumentParser",
"numpy.stack",
"numpy.concatenate",
"tensorflow.train.lates... | [((299, 402), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '__doc__', 'formatter_class': 'argparse.RawDescriptionHelpFormatter'}), '(description=__doc__, formatter_class=argparse.\n RawDescriptionHelpFormatter)\n', (322, 402), False, 'import sys, os, tempfile, argparse\n'), ((8303, 8420... |
#!/usr/bin/env python3
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from test_framework.mininode import CTransaction, NetworkThread
from test_framework.blocktools import create_coinbase, create_block, add_witness_commitment
from test_framework.script import CScript, C... | [
"test_framework.ub_utils.calc_block_reward",
"json.dumps",
"os.path.dirname",
"test_framework.script.read_contract_bytecode_hex",
"random.randint",
"decimal.Decimal"
] | [((760, 770), 'decimal.Decimal', 'Decimal', (['(0)'], {}), '(0)\n', (767, 770), False, 'from decimal import Decimal\n'), ((2739, 2789), 'test_framework.script.read_contract_bytecode_hex', 'read_contract_bytecode_hex', (['contract_bytecode_path'], {}), '(contract_bytecode_path)\n', (2765, 2789), False, 'from test_framew... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" get vertical section of a point cloud using command line interface of CloudCompare
command line parameters: input_file, e1, n1, e2, n2, tolerance
e.g. python section_cc.py pc_ftszv_5cm.txt 660125.48 230851.85 660128.75 230835.43 0.20
"""
import sys
import... | [
"math.hypot",
"platform.system",
"sys.exit"
] | [((733, 751), 'math.hypot', 'math.hypot', (['de', 'dn'], {}), '(de, dn)\n', (743, 751), False, 'import math\n'), ((465, 475), 'sys.exit', 'sys.exit', ([], {}), '()\n', (473, 475), False, 'import sys\n'), ((1327, 1344), 'platform.system', 'platform.system', ([], {}), '()\n', (1342, 1344), False, 'import platform\n'), ((... |
'''
This is based on pytorch-image-models' ModelEMA
https://github.com/rwightman/pytorch-image-models/blob/9a25fdf3ad0414b4d66da443fe60ae0aa14edc84/timm/utils/model_ema.py
This altered version refactors the load and save functionality to support Determined's fault tolerance features.
'''
from typing import Any, Dict, ... | [
"torch.no_grad",
"torch.load",
"collections.OrderedDict",
"copy.deepcopy"
] | [((1833, 1848), 'copy.deepcopy', 'deepcopy', (['model'], {}), '(model)\n', (1841, 1848), False, 'from copy import deepcopy\n'), ((2557, 2604), 'torch.load', 'torch.load', (['checkpoint_path'], {'map_location': '"""cpu"""'}), "(checkpoint_path, map_location='cpu')\n", (2567, 2604), False, 'import torch\n'), ((2721, 2734... |
from slackbot.bot import respond_to
from slackbot.bot import listen_to
import prtg_helper
import re
@respond_to('^\s*pause ([\S]*)(?: for (.+))?', re.IGNORECASE)
def stats(message, device_name=None, reason=None):
if device_name == 'None':
message.reply('Specify a device name, fool!')
else:
did ... | [
"prtg_helper.pause_device",
"slackbot.bot.respond_to",
"prtg_helper.get_deviceid"
] | [((102, 164), 'slackbot.bot.respond_to', 'respond_to', (['"""^\\\\s*pause ([\\\\S]*)(?: for (.+))?"""', 're.IGNORECASE'], {}), "('^\\\\s*pause ([\\\\S]*)(?: for (.+))?', re.IGNORECASE)\n", (112, 164), False, 'from slackbot.bot import respond_to\n'), ((846, 892), 'slackbot.bot.respond_to', 'respond_to', (['"""^\\\\s*unp... |
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
import types
from typing import Sequence, Callable
from inspect import Parameter, Signature
import logging
from azure.ai.ml.entities._job.p... | [
"logging.getLogger",
"types.CodeType",
"inspect.Signature",
"azure.ai.ml.entities._job.pipeline._exceptions.UserErrorException",
"types.FunctionType",
"azure.ai.ml._ml_exceptions.ValidationException",
"azure.ai.ml.entities._job.pipeline._exceptions.UnexpectedKeywordError"
] | [((494, 521), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (511, 521), False, 'import logging\n'), ((6213, 6234), 'inspect.Signature', 'Signature', (['parameters'], {}), '(parameters)\n', (6222, 6234), False, 'from inspect import Parameter, Signature\n'), ((2942, 3065), 'types.FunctionT... |
from django.urls import path
from .views import PrincipalIndex, Sobre
urlpatterns = [
path('', PrincipalIndex, name='index'),
path('sobre/', Sobre, name='sobre'),
] | [
"django.urls.path"
] | [((93, 131), 'django.urls.path', 'path', (['""""""', 'PrincipalIndex'], {'name': '"""index"""'}), "('', PrincipalIndex, name='index')\n", (97, 131), False, 'from django.urls import path\n'), ((137, 172), 'django.urls.path', 'path', (['"""sobre/"""', 'Sobre'], {'name': '"""sobre"""'}), "('sobre/', Sobre, name='sobre')\n... |
"""
This file imports all the relevant classes for daily use.
"""
# This snippet ensures all submodules get reloaded properly as we like to
# modify things when using it.
from importlib import reload
import pycqed.analysis_v2.base_analysis as ba
reload(ba)
import pycqed.analysis_v2.simple_analysis as sa
reload(sa)
imp... | [
"importlib.reload"
] | [((247, 257), 'importlib.reload', 'reload', (['ba'], {}), '(ba)\n', (253, 257), False, 'from importlib import reload\n'), ((306, 316), 'importlib.reload', 'reload', (['sa'], {}), '(sa)\n', (312, 316), False, 'from importlib import reload\n'), ((369, 379), 'importlib.reload', 'reload', (['ta'], {}), '(ta)\n', (375, 379)... |
import sys
from set_up import Setup
from estimator import CommonEstimator
import json
import h5py
#from utils import get_memory_usage
import numpy as np
SEED = 12939 #from random.org
np.random.seed(SEED)
print('python main.py fpType fpSize estimators.json dataset')
fpType = sys.argv[1]
fpSize = int(sys.argv[2])
tr... | [
"set_up.Setup",
"numpy.random.seed",
"estimator.CommonEstimator"
] | [((184, 204), 'numpy.random.seed', 'np.random.seed', (['SEED'], {}), '(SEED)\n', (198, 204), True, 'import numpy as np\n'), ((604, 640), 'set_up.Setup', 'Setup', (['fpType', 'dataset'], {'verbose': '(True)'}), '(fpType, dataset, verbose=True)\n', (609, 640), False, 'from set_up import Setup\n'), ((1051, 1112), 'estimat... |
#======================================================================
#
# This module contains routines to postprocess the VFI
# solutions.
#
# <NAME>, 01/19
# edited by <NAME>, with <NAME> and <NAME>, 11/2021
#======================================================================
import numpy as np... | [
"numpy.fabs",
"numpy.random.default_rng",
"pickle.load",
"datetime.datetime.now",
"numpy.empty",
"numpy.savetxt",
"numpy.set_printoptions"
] | [((917, 931), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (929, 931), False, 'from datetime import datetime\n'), ((1011, 1036), 'numpy.random.default_rng', 'np.random.default_rng', (['dt'], {}), '(dt)\n', (1032, 1036), True, 'import numpy as np\n'), ((1164, 1180), 'numpy.empty', 'np.empty', (['(1, 3)'], ... |
from vapoursynth import core, GRAYS, RGBS, GRAY, YUV, RGB # You need Vapoursynth R37 or newer
from functools import partial
# If yuv444 is True chroma will be upscaled instead of downscaled
# If gray is True the output will be grayscale
def Debilinear(src, width, height, yuv444=False, gray=False, chromaloc=None, opt... | [
"vapoursynth.core.std.ShufflePlanes",
"functools.partial",
"vapoursynth.core.register_format"
] | [((2226, 2276), 'vapoursynth.core.register_format', 'core.register_format', (['GRAY', 'src_st', 'src_bits', '(0)', '(0)'], {}), '(GRAY, src_st, src_bits, 0, 0)\n', (2246, 2276), False, 'from vapoursynth import core, GRAYS, RGBS, GRAY, YUV, RGB\n'), ((2548, 2648), 'vapoursynth.core.register_format', 'core.register_forma... |
import sys
import configparser
import requests
import json
from dataclasses import dataclass
@dataclass
class Category:
id : int
name : str
@dataclass
class Account:
id : int
book_id : int
name : str
balance : float
unit : str
@dataclass
clas... | [
"json.loads",
"configparser.RawConfigParser",
"requests.get"
] | [((3280, 3310), 'configparser.RawConfigParser', 'configparser.RawConfigParser', ([], {}), '()\n', (3308, 3310), False, 'import configparser\n'), ((587, 633), 'requests.get', 'requests.get', (['endpoint'], {'headers': 'requestHeaders'}), '(endpoint, headers=requestHeaders)\n', (599, 633), False, 'import requests\n'), ((... |
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
# http://www.apache.org/licenses/LICENSE-2.0
# or in the "license" file... | [
"numpy.prod",
"numpy.sqrt",
"numpy.log",
"unittest.main",
"numpy.divide",
"numpy.mean",
"numpy.multiply",
"numpy.tanh",
"numpy.subtract",
"numpy.max",
"numpy.exp",
"numpy.testing.assert_almost_equal",
"numpy.min",
"numpy.maximum",
"numpy.abs",
"numpy.ceil",
"onnx.helper.make_node",
... | [((11776, 11791), 'unittest.main', 'unittest.main', ([], {}), '()\n', (11789, 11791), False, 'import unittest\n'), ((1161, 1202), 'onnx.helper.make_node', 'helper.make_node', (['"""Abs"""', "['ip1']", "['ip2']"], {}), "('Abs', ['ip1'], ['ip2'])\n", (1177, 1202), False, 'from onnx import helper\n'), ((1466, 1527), 'onnx... |
#!/usr/bin/env python3
import logging
from deepnox import loggers
from deepnox.helpers.testing_helpers import BaseTestCase
class LoadGuardLoggerTestCase(BaseTestCase):
"""
LoadGuardLogger unit tests.
"""
def test____init__(self):
logger = LoadGuardLogger()
self.assertIsInstance(logg... | [
"deepnox.loggers.setup"
] | [((1108, 1123), 'deepnox.loggers.setup', 'loggers.setup', ([], {}), '()\n', (1121, 1123), False, 'from deepnox import loggers\n')] |
from django.core.files.uploadedfile import SimpleUploadedFile
from unittest import TestCase
from ..forms import CertFileUploadForm, NotificationSendForm
import os
class CertFileUploadFormTest(TestCase):
def setUp(self):
self.cert_file = os.path.dirname(os.path.abspath(__file__)) + '/files/test.pem'
... | [
"os.path.abspath"
] | [((269, 294), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (284, 294), False, 'import os\n')] |
# -*- coding: utf-8 -*-
# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0, as
# published by the Free Software Foundation.
#
# This program is also d... | [
"logging.getLogger",
"socket.create_connection",
"mysqlx.get_session",
"mysqlx.statement.SqlStatement",
"urllib.quote_plus",
"mysqlx._get_connection_settings",
"socket.socket",
"unittest.skipIf",
"tests.get_mysqlx_config",
"urllib.quote",
"mysqlx.errors.ProgrammingError",
"time.time"
] | [((1906, 1942), 'logging.getLogger', 'logging.getLogger', (['tests.LOGGER_NAME'], {}), '(tests.LOGGER_NAME)\n', (1923, 1942), False, 'import logging\n'), ((8958, 9033), 'unittest.skipIf', 'unittest.skipIf', (['(tests.MYSQL_VERSION < (5, 7, 12))', '"""XPlugin not compatible"""'], {}), "(tests.MYSQL_VERSION < (5, 7, 12),... |
"""The tests for deCONZ logbook."""
from copy import deepcopy
from homeassistant.components import logbook
from homeassistant.components.deconz.deconz_event import CONF_DECONZ_EVENT
from homeassistant.components.deconz.gateway import get_gateway_from_config_entry
from homeassistant.const import CONF_DEVICE_ID, CONF_E... | [
"homeassistant.setup.async_setup_component",
"homeassistant.components.deconz.gateway.get_gateway_from_config_entry",
"homeassistant.components.logbook.EntityAttributeCache",
"copy.deepcopy",
"tests.components.logbook.test_init.MockLazyEventPartialState"
] | [((651, 679), 'copy.deepcopy', 'deepcopy', (['DECONZ_WEB_REQUEST'], {}), '(DECONZ_WEB_REQUEST)\n', (659, 679), False, 'from copy import deepcopy\n'), ((1337, 1386), 'homeassistant.components.deconz.gateway.get_gateway_from_config_entry', 'get_gateway_from_config_entry', (['hass', 'config_entry'], {}), '(hass, config_en... |
# -*- coding: utf-8 -*-
import io
import tokenize
from textwrap import dedent
import pytest
@pytest.fixture(scope='session')
def parse_tokens():
"""Parses tokens from a string."""
def factory(code: str):
lines = io.StringIO(dedent(code))
return list(tokenize.generate_tokens(lambda: next(line... | [
"pytest.fixture",
"textwrap.dedent"
] | [((97, 128), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (111, 128), False, 'import pytest\n'), ((244, 256), 'textwrap.dedent', 'dedent', (['code'], {}), '(code)\n', (250, 256), False, 'from textwrap import dedent\n')] |
"""
This code implements the Growing Neural Gas algorithm that creates a graph
that learns the topologies in the given input data.
See e.g. followning documents references:
https://papers.nips.cc/paper/893-a-growing-neural-gas-network-learns-topologies.pdf
http://www.booru.net/download/MasterThesisProj.pdf
"""
fro... | [
"numpy.random.rand",
"numpy.random.randint",
"FeatureGraph.graph.Graph",
"numpy.linalg.norm"
] | [((1105, 1112), 'FeatureGraph.graph.Graph', 'Graph', ([], {}), '()\n', (1110, 1112), False, 'from FeatureGraph.graph import Graph\n'), ((3182, 3220), 'numpy.linalg.norm', 'np.linalg.norm', (['(vertex_vect - ref_vect)'], {}), '(vertex_vect - ref_vect)\n', (3196, 3220), True, 'import numpy as np\n'), ((6748, 6772), 'nump... |
import os
import glob
import shutil
import filecmp
import unittest
from sra2variant import WGS_PE, ARTIC_PE
from sra2variant.pipeline.sra2fastq import FastqDumpWrapper, PrefetchWrapper
THIS_DIR = os.path.join(
os.path.dirname(__file__),
os.pardir,
"sra2variant"
)
DATA_DIR = os.path.join(THIS_DIR, "data")
... | [
"os.path.exists",
"os.makedirs",
"sra2variant.pipeline.sra2fastq.PrefetchWrapper",
"os.rename",
"os.path.join",
"sra2variant.pipeline.sra2fastq.FastqDumpWrapper",
"os.path.dirname",
"os.cpu_count",
"shutil.rmtree",
"unittest.main",
"filecmp.cmp",
"os.remove"
] | [((289, 319), 'os.path.join', 'os.path.join', (['THIS_DIR', '"""data"""'], {}), "(THIS_DIR, 'data')\n", (301, 319), False, 'import os\n'), ((331, 361), 'os.path.join', 'os.path.join', (['THIS_DIR', '"""temp"""'], {}), "(THIS_DIR, 'temp')\n", (343, 361), False, 'import os\n'), ((216, 241), 'os.path.dirname', 'os.path.di... |
from six.moves.urllib.parse import quote_plus
from . import get_cookies
def setup_session(openid, password, username=None,
check_url=None,
session=None, verify=False):
"""
A special call to get_cookies.setup_session that is tailored for
ESGF credentials.
username s... | [
"six.moves.urllib.parse.quote_plus"
] | [((1244, 1262), 'six.moves.urllib.parse.quote_plus', 'quote_plus', (['openid'], {}), '(openid)\n', (1254, 1262), False, 'from six.moves.urllib.parse import quote_plus\n')] |
from moviepy.editor import *
from PIL import Image
import os
import json
def save_frame(frame, path):
image = Image.fromarray(frame)
image.save(path)
def get_frames(video_path, frames_save_path):
# TODO: create meta-file .json
video_clip = VideoFileClip(video_path)
video_fps = video_clip.fps
... | [
"PIL.Image.fromarray",
"os.listdir",
"os.path.join",
"os.path.isdir",
"os.mkdir",
"json.dump"
] | [((116, 138), 'PIL.Image.fromarray', 'Image.fromarray', (['frame'], {}), '(frame)\n', (131, 138), False, 'from PIL import Image\n'), ((479, 510), 'os.path.isdir', 'os.path.isdir', (['frames_save_path'], {}), '(frames_save_path)\n', (492, 510), False, 'import os\n'), ((520, 546), 'os.mkdir', 'os.mkdir', (['frames_save_p... |
import db
INITIAL_MENU = 99
def show_header():
COL_NUM = 60
print("-" * COL_NUM)
print("{:^60}".format("TASKS"))
print("-" * COL_NUM)
print("{:^60}".format("Digite 0 para voltar ao menu inicial ou Ctrl + C para sair."))
# print("-" * COL_NUM)
def show_todos():
for todo in db.get_todos():
... | [
"db.get_todos",
"db.complete",
"db.add",
"db.remove"
] | [((304, 318), 'db.get_todos', 'db.get_todos', ([], {}), '()\n', (316, 318), False, 'import db\n'), ((616, 628), 'db.add', 'db.add', (['task'], {}), '(task)\n', (622, 628), False, 'import db\n'), ((769, 784), 'db.complete', 'db.complete', (['id'], {}), '(id)\n', (780, 784), False, 'import db\n'), ((924, 937), 'db.remove... |
import os
import json
import numpy as np
import glob
from datetime import datetime
import shutil
from sklearn.model_selection import train_test_split
np.random.seed(41)
#0为背景
classname_to_id = {"__background__": 0,"short": 1,"solder":2,"solderball":3}
class Lableme2CoCo:
def __init__(self):
self.images =... | [
"labelme.utils.img_b64_to_arr",
"os.path.exists",
"os.makedirs",
"sklearn.model_selection.train_test_split",
"datetime.datetime.now",
"numpy.random.seed",
"os.path.basename",
"json.load",
"glob.glob"
] | [((150, 168), 'numpy.random.seed', 'np.random.seed', (['(41)'], {}), '(41)\n', (164, 168), True, 'import numpy as np\n'), ((4431, 4466), 'glob.glob', 'glob.glob', (["(labelme_path + '/*.json')"], {}), "(labelme_path + '/*.json')\n", (4440, 4466), False, 'import glob\n'), ((4547, 4594), 'sklearn.model_selection.train_te... |
from pipeline_generator.generators import PipelineGenerator
data={
"graph": {
"nodes": {
"node1":
{
"id": "node1",
"parent": "task1",
"name": "Batch Read from CSV",
"category": 0,
... | [
"pipeline_generator.generators.PipelineGenerator.generate_pipeline"
] | [((5811, 5885), 'pipeline_generator.generators.PipelineGenerator.generate_pipeline', 'PipelineGenerator.generate_pipeline', (["data['graph']", "data['dag_properties']"], {}), "(data['graph'], data['dag_properties'])\n", (5846, 5885), False, 'from pipeline_generator.generators import PipelineGenerator\n')] |
import logging
import optparse
import sys
from celery.events.cursesmon import evtop
from celery.events.dumper import evdump
from celery.events.snapshot import evcam
OPTION_LIST = (
optparse.make_option('-d', '--dump',
action="store_true", dest="dump",
help="Dump events to stdout."),
optparse.... | [
"celery.events.snapshot.evcam",
"optparse.OptionParser",
"celery.events.dumper.evdump",
"celery.events.cursesmon.evtop",
"optparse.make_option"
] | [((188, 294), 'optparse.make_option', 'optparse.make_option', (['"""-d"""', '"""--dump"""'], {'action': '"""store_true"""', 'dest': '"""dump"""', 'help': '"""Dump events to stdout."""'}), "('-d', '--dump', action='store_true', dest='dump', help\n ='Dump events to stdout.')\n", (208, 294), False, 'import optparse\n')... |
import os
from distutils.dir_util import copy_tree
def copy_directory(deploy_mode, source, destination):
if not os.path.exists(source):
raise Exception("Source directory for cache [{0}] does not exist".format(source))
print("deploy_mode::", deploy_mode)
if "local" == deploy_mode:
print("Lo... | [
"os.path.exists",
"distutils.dir_util.copy_tree"
] | [((118, 140), 'os.path.exists', 'os.path.exists', (['source'], {}), '(source)\n', (132, 140), False, 'import os\n'), ((339, 369), 'distutils.dir_util.copy_tree', 'copy_tree', (['source', 'destination'], {}), '(source, destination)\n', (348, 369), False, 'from distutils.dir_util import copy_tree\n')] |
"""
Texture Replacement
+++++++++++++++++++
Example of how to replace a texture in game with an external image.
``createTexture()`` and ``removeTexture()`` are to be called from a
module Python Controller.
"""
from bge import logic
from bge import texture
def createTexture(cont):
"""Create a new Dynamic Texture"... | [
"bge.texture.ImageFFmpeg",
"bge.texture.materialID",
"bge.logic.expandPath",
"bge.texture.Texture",
"bge.logic.texture.refresh"
] | [((415, 456), 'bge.texture.materialID', 'texture.materialID', (['obj', '"""IMoriginal.png"""'], {}), "(obj, 'IMoriginal.png')\n", (433, 456), False, 'from bge import texture\n'), ((509, 533), 'bge.texture.Texture', 'texture.Texture', (['obj', 'ID'], {}), '(obj, ID)\n', (524, 533), False, 'from bge import texture\n'), (... |
import random
import string
from datetime import datetime
import pytz
from ..baseclient import BaseClient
from ..exceptions import FailedToExecuteException
from ..torrent import TorrentData, TorrentState
TORRENTS = {}
def randomString(rng, letters, stringLength):
return "".join(rng.choice(letters) for i in ran... | [
"random.Random"
] | [((1310, 1329), 'random.Random', 'random.Random', (['seed'], {}), '(seed)\n', (1323, 1329), False, 'import random\n')] |
import threading
import requests
import json
# Global list of urls used by threads making requests
CONTENT_OBJS = []
RESOURCE_OBJS = []
class Requester(threading.Thread):
def __init__(self):
self.base_url = ""
threading.Thread.__init__(self)
def run(self):
while len(CONTENT_OBJS) ... | [
"threading.Thread.__init__",
"json.loads",
"requests.get"
] | [((232, 263), 'threading.Thread.__init__', 'threading.Thread.__init__', (['self'], {}), '(self)\n', (257, 263), False, 'import threading\n'), ((835, 852), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (847, 852), False, 'import requests\n'), ((877, 902), 'json.loads', 'json.loads', (['response.text'], {}), ... |
from model.contact import Contact
from model.group import Group
from fixture.orm import ORMFixture
import random
db = ORMFixture(host="127.0.0.1", name="addressbook", user="root", password="")
group = Group(id="69")
def test_add_contact_in_group(app):
if len(db.get_contactlist()) == 0 or len(db.get_contacts_in_gr... | [
"model.group.Group",
"fixture.orm.ORMFixture",
"model.contact.Contact"
] | [((119, 193), 'fixture.orm.ORMFixture', 'ORMFixture', ([], {'host': '"""127.0.0.1"""', 'name': '"""addressbook"""', 'user': '"""root"""', 'password': '""""""'}), "(host='127.0.0.1', name='addressbook', user='root', password='')\n", (129, 193), False, 'from fixture.orm import ORMFixture\n'), ((203, 217), 'model.group.Gr... |
import argparse
import logging
import os
import random
import subprocess
import utils
def run(exe_path, scp_path, out_dir, wave_len, num_outputs, remove_files, log_level):
logging.basicConfig(level=log_level)
for _ in range(num_outputs):
inputs = {
'blackman_coeff': '%.4f' % (random.random... | [
"logging.basicConfig",
"utils.generate_rand_boolean",
"os.path.exists",
"argparse.ArgumentParser",
"utils.generate_rand_window_type",
"subprocess.call",
"random.random",
"logging.info",
"random.randint",
"os.remove"
] | [((178, 214), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'log_level'}), '(level=log_level)\n', (197, 214), False, 'import logging\n'), ((2064, 2141), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Generate spectrogram data using Kaldi."""'}), "(description='Generate spe... |
#!/usr/bin/env python3
# std
import unittest
# 3rd
import numpy as np
# ours
from clusterking.util.testing import MyTestCase
from clusterking.scan.wilsonscanner import WilsonScanner
from clusterking.data.data import Data
# noinspection PyUnusedLocal
def simple_func(w, q):
return q + 1
class TestWilsonScanner... | [
"unittest.main",
"numpy.array",
"clusterking.scan.wilsonscanner.WilsonScanner",
"clusterking.data.data.Data"
] | [((1945, 1960), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1958, 1960), False, 'import unittest\n'), ((375, 424), 'clusterking.scan.wilsonscanner.WilsonScanner', 'WilsonScanner', ([], {'scale': '(5)', 'eft': '"""WET"""', 'basis': '"""flavio"""'}), "(scale=5, eft='WET', basis='flavio')\n", (388, 424), False, '... |
import tkinter as tk
from tkinter import messagebox
master = tk.Tk()
r=StringVar()
tk.Label(master,text="<NAME>").grid(row=0)
tk.Label(master,text="<NAME>").grid(row=1)
tk.Label(master,text="result",textvariable=r).grid(row=3)
e1 = tk.Entry(master)
e2 = tk.Entry(master)
e1.grid(row=0,column=1)
e2.grid(ro... | [
"tkinter.Tk",
"tkinter.Entry",
"tkinter.Label"
] | [((72, 79), 'tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (77, 79), True, 'import tkinter as tk\n'), ((245, 261), 'tkinter.Entry', 'tk.Entry', (['master'], {}), '(master)\n', (253, 261), True, 'import tkinter as tk\n'), ((267, 283), 'tkinter.Entry', 'tk.Entry', (['master'], {}), '(master)\n', (275, 283), True, 'import tkint... |
# Copyright 2021 cms.rendner (<NAME>)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | [
"pandas.MultiIndex.from_product",
"pandas.DataFrame.from_dict"
] | [((620, 856), 'pandas.DataFrame.from_dict', 'pd.DataFrame.from_dict', (["{('A', 'col_0'): [0, 1, 2, 3, 4, 5], ('A', 'col_1'): [6, 7, 8, 9, 10, 11],\n ('B', 'col_2'): [12, 13, 14, 15, 16, 17], ('B', 'col_3'): [18, 19, 20, \n 21, 22, 23], ('C', 'col_4'): [24, 25, 26, 27, 28, 29]}"], {}), "({('A', 'col_0'): [0, 1, 2... |
"""Portfolio."""
import itertools
from contextlib import contextmanager
from enum import Enum, auto
import numpy as np
from .base import Quotes
from .performance import BriefPerformance, Performance, Stats
from .utils import fromtimestamp, timeit
__all__ = (
'Portfolio',
'Position',
'Order',
)
class ... | [
"enum.auto",
"numpy.where",
"itertools.product",
"numpy.sum",
"numpy.maximum.accumulate",
"numpy.cumsum",
"numpy.zeros_like"
] | [((6096, 6102), 'enum.auto', 'auto', ([], {}), '()\n', (6100, 6102), False, 'from enum import Enum, auto\n'), ((6116, 6122), 'enum.auto', 'auto', ([], {}), '()\n', (6120, 6122), False, 'from enum import Enum, auto\n'), ((6138, 6144), 'enum.auto', 'auto', ([], {}), '()\n', (6142, 6144), False, 'from enum import Enum, au... |
import json
import os
import os.path as path
import sys
def preview_component(component):
component.enable_preview = True
return component
def run_preview(
manager_module_name,
options,
module_name: str = '__main__',
):
module = sys.modules[module_name]
worker_path = path.joi... | [
"os.path.dirname",
"os.path.pathsep.join",
"json.dumps"
] | [((322, 344), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file__)\n', (334, 344), True, 'import os.path as path\n'), ((538, 565), 'os.path.pathsep.join', 'path.pathsep.join', (['sys.path'], {}), '(sys.path)\n', (555, 565), True, 'import os.path as path\n'), ((728, 747), 'json.dumps', 'json.dumps', (['opt... |
import logging
import ray
from ray.rllib.optimizers.policy_optimizer import PolicyOptimizer
from ray.rllib.utils.annotations import override
from ray.rllib.utils.timer import TimerStat
logger = logging.getLogger(__name__)
class TorchDistributedDataParallelOptimizer(PolicyOptimizer):
"""EXPERIMENTAL: torch distr... | [
"logging.getLogger",
"ray.rllib.optimizers.policy_optimizer.PolicyOptimizer.__init__",
"ray.rllib.utils.timer.TimerStat",
"ray.rllib.utils.annotations.override",
"ray.rllib.optimizers.policy_optimizer.PolicyOptimizer.stats"
] | [((196, 223), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (213, 223), False, 'import logging\n'), ((1886, 1911), 'ray.rllib.utils.annotations.override', 'override', (['PolicyOptimizer'], {}), '(PolicyOptimizer)\n', (1894, 1911), False, 'from ray.rllib.utils.annotations import override\... |
"""
Forms have an application_url() method to easily retrieve the url of the
application, like views does::
>>> getRootFolder()['world'] = world = IceWorld()
>>> world['arthur'] = Mammoth()
And we can access the display form which display the application URL::
>>> from zope.testbrowser.wsgi import Browser
>... | [
"grok.PageTemplate",
"grok.context",
"zope.schema.TextLine"
] | [((1030, 1154), 'grok.PageTemplate', 'grok.PageTemplate', (['"""\n<p>\n Test display: application <tal:replace tal:replace="view/application_url" />\n</p>"""'], {}), '(\n """\n<p>\n Test display: application <tal:replace tal:replace="view/application_url" />\n</p>"""\n )\n', (1047, 1154), False, 'import grok\... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from pathlib import Path
from typing import Callable
from classy_vision.generic.registry_utils import import_all_modules
FILE_ROOT = Path(__file__).parent
MODEL_TRUNKS_REGISTRY = {}
MODEL_TRUNKS_NAMES = set()
def register_model_trunk(name: s... | [
"classy_vision.generic.registry_utils.import_all_modules",
"pathlib.Path"
] | [((1646, 1698), 'classy_vision.generic.registry_utils.import_all_modules', 'import_all_modules', (['FILE_ROOT', '"""vissl.models.trunks"""'], {}), "(FILE_ROOT, 'vissl.models.trunks')\n", (1664, 1698), False, 'from classy_vision.generic.registry_utils import import_all_modules\n'), ((208, 222), 'pathlib.Path', 'Path', (... |
# Future
from __future__ import annotations
# Standard Library
import asyncio
import os
# Local
from cd.bot import CD
from cd.config import TOKEN
from cd.utilities.logger import setup_logger
setup_logger()
os.environ["JISHAKU_NO_UNDERSCORE"] = "True"
os.environ["JISHAKU_HIDE"] = "True"
os.environ["JISHAKU_NO_DM_TR... | [
"cd.utilities.logger.setup_logger",
"cd.bot.CD"
] | [((195, 209), 'cd.utilities.logger.setup_logger', 'setup_logger', ([], {}), '()\n', (207, 209), False, 'from cd.utilities.logger import setup_logger\n'), ((346, 350), 'cd.bot.CD', 'CD', ([], {}), '()\n', (348, 350), False, 'from cd.bot import CD\n')] |
import json
from telethon import events, Button
from asyncio import exceptions
from .. import jdbot, chat_id, BOT_SET_JSON_FILE_USER, BOT_SET, ch_name
from .utils import split_list, logger, press_event
@jdbot.on(events.NewMessage(from_users=chat_id, pattern='^/set$'))
async def bot_set(event):
SENDER = event.send... | [
"json.load",
"telethon.Button.inline",
"json.dump",
"telethon.events.NewMessage"
] | [((214, 269), 'telethon.events.NewMessage', 'events.NewMessage', ([], {'from_users': 'chat_id', 'pattern': '"""^/set$"""'}), "(from_users=chat_id, pattern='^/set$')\n", (231, 269), False, 'from telethon import events, Button\n'), ((3157, 3216), 'telethon.events.NewMessage', 'events.NewMessage', ([], {'from_users': 'cha... |
import turtle
def tree(t: turtle.Turtle, branchLen: int):
if branchLen > 5:
t.forward(branchLen)
t.right(20)
tree(t, branchLen - 15)
t.left(40)
tree(t, branchLen - 15)
t.right(20)
t.backward(branchLen)
if __name__ == '__main__':
t = turtle.Turtle()
... | [
"turtle.Screen",
"turtle.Turtle"
] | [((304, 319), 'turtle.Turtle', 'turtle.Turtle', ([], {}), '()\n', (317, 319), False, 'import turtle\n'), ((333, 348), 'turtle.Screen', 'turtle.Screen', ([], {}), '()\n', (346, 348), False, 'import turtle\n')] |
import tkinter
from tkinter import ttk, filedialog
import os, sys
# Get the current directory of this file for use in finding the icon file
# Try handles the executable version
# Except handles running this file as a .py
try:
CURRENT_DIR = f"{sys._MEIPASS}/UI"
except AttributeError:
CURRENT_DIR = os.path.dirna... | [
"tkinter.filedialog.askdirectory",
"tkinter.ttk.Button",
"tkinter.ttk.Entry",
"tkinter.ttk.Frame",
"tkinter.ttk.Label",
"os.path.join",
"tkinter.Tk",
"os.path.abspath",
"tkinter.filedialog.askopenfilename"
] | [((643, 655), 'tkinter.Tk', 'tkinter.Tk', ([], {}), '()\n', (653, 655), False, 'import tkinter\n'), ((991, 1035), 'tkinter.ttk.Frame', 'ttk.Frame', (['self.window'], {'width': '(100)', 'height': '(90)'}), '(self.window, width=100, height=90)\n', (1000, 1035), False, 'from tkinter import ttk, filedialog\n'), ((1068, 111... |
#!/usr/bin/env python3
# Contains some unnecessary imports
import sys
import argparse
import json, base64
import socket
import os
import subprocess
import csv
import datetime
import time
import sys
import itertools
from tqdm import tqdm
import json
# Logging
import logging
import logging.config
logging.config.fileConfi... | [
"logging.getLogger",
"argparse.ArgumentParser",
"subprocess.Popen",
"subprocess.run",
"tqdm.tqdm",
"itertools.product",
"os.environ.copy",
"os.path.join",
"os.path.normpath",
"os.path.dirname",
"os.path.isfile",
"os.path.isdir",
"logging.config.fileConfig",
"os.mkdir",
"sys.exit",
"jso... | [((296, 337), 'logging.config.fileConfig', 'logging.config.fileConfig', (['"""logging.conf"""'], {}), "('logging.conf')\n", (321, 337), False, 'import logging\n'), ((347, 374), 'logging.getLogger', 'logging.getLogger', (['"""client"""'], {}), "('client')\n", (364, 374), False, 'import logging\n'), ((624, 681), 'argpars... |
import json
import numpy as np
import os
from photogrammetry_importer.types.camera import Camera
from photogrammetry_importer.types.point import Point
from photogrammetry_importer.file_handlers.utility import (
check_radial_distortion,
)
from photogrammetry_importer.blender_utility.logging_utility import log_repor... | [
"photogrammetry_importer.file_handlers.utility.check_radial_distortion",
"photogrammetry_importer.types.camera.Camera",
"os.path.join",
"os.path.splitext",
"photogrammetry_importer.blender_utility.logging_utility.log_report",
"os.path.isfile",
"numpy.array",
"os.path.dirname",
"os.path.isdir",
"js... | [((5921, 5975), 'photogrammetry_importer.blender_utility.logging_utility.log_report', 'log_report', (['"""INFO"""', '"""parse_meshroom_sfm_file: ..."""', 'op'], {}), "('INFO', 'parse_meshroom_sfm_file: ...', op)\n", (5931, 5975), False, 'from photogrammetry_importer.blender_utility.logging_utility import log_report\n')... |
"""Convert Senate speech data from 114th Congress to bag of words format.
The data is provided by [1]. Specifically, we use the `hein-daily` data. To
run this script, make sure the relevant files are in
`data/senate-speeches-114/raw/`. The files needed for this script are
`speeches_114.txt`, `descr_114.txt`, and `1... | [
"os.path.exists",
"numpy.unique",
"os.makedirs",
"sklearn.feature_extraction.text.CountVectorizer",
"numpy.delete",
"numpy.where",
"os.path.join",
"scipy.sparse.csr_matrix",
"numpy.array",
"numpy.sum",
"os.path.dirname",
"setup_utils.remove_cooccurring_ngrams"
] | [((875, 932), 'os.path.join', 'os.path.join', (['project_dir', '"""data/senate-speeches-114/raw"""'], {}), "(project_dir, 'data/senate-speeches-114/raw')\n", (887, 932), False, 'import os\n'), ((944, 1003), 'os.path.join', 'os.path.join', (['project_dir', '"""data/senate-speeches-114/clean"""'], {}), "(project_dir, 'da... |
# pylint:disable=unused-variable
# pylint:disable=unused-argument
# pylint:disable=redefined-outer-name
import pytest
from servicelib import openapi
@pytest.fixture
def multi_doc_oas(here):
openapi_path = here / "data" / "oas3-parts" / "petstore.yaml"
assert openapi_path.exists()
return openapi_path
@... | [
"pytest.fail",
"servicelib.openapi.create_openapi_specs"
] | [((642, 685), 'servicelib.openapi.create_openapi_specs', 'openapi.create_openapi_specs', (['multi_doc_oas'], {}), '(multi_doc_oas)\n', (670, 685), False, 'from servicelib import openapi\n'), ((753, 797), 'servicelib.openapi.create_openapi_specs', 'openapi.create_openapi_specs', (['single_doc_oas'], {}), '(single_doc_oa... |
from typing import List, Dict
import numpy as np
import torch
from tqdm import tqdm
from utils.fov_expansion import Expander
from inversion.video.video_config import VideoConfig
from utils.common import tensor2im, get_identity_transform
def postprocess_and_smooth_inversions(results: Dict, net, opts: VideoConfig):
... | [
"utils.common.get_identity_transform",
"utils.fov_expansion.Expander",
"torch.from_numpy",
"utils.common.tensor2im",
"torch.no_grad"
] | [((902, 925), 'utils.fov_expansion.Expander', 'Expander', ([], {'G': 'net.decoder'}), '(G=net.decoder)\n', (910, 925), False, 'from utils.fov_expansion import Expander\n'), ((1057, 1072), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (1070, 1072), False, 'import torch\n'), ((1128, 1152), 'utils.common.get_identit... |
import unittest
from os import path
from os.path import join
from pyrep import PyRep
from pyrep.robots.arms.panda import Panda
from pyrep.robots.end_effectors.panda_gripper import PandaGripper
from rlbench import environment
from rlbench.backend.const import TTT_FILE
from rlbench.backend.scene import Scene
from rlbench... | [
"rlbench.backend.scene.Scene",
"rlbench.observation_config.ObservationConfig",
"pyrep.robots.arms.panda.Panda",
"pyrep.robots.end_effectors.panda_gripper.PandaGripper",
"os.path.join",
"rlbench.tasks.reach_target.ReachTarget",
"numpy.array_equal",
"pyrep.PyRep",
"os.path.abspath",
"rlbench.noise_m... | [((571, 593), 'os.path.abspath', 'path.abspath', (['__file__'], {}), '(__file__)\n', (583, 593), False, 'from os import path\n'), ((843, 850), 'pyrep.PyRep', 'PyRep', ([], {}), '()\n', (848, 850), False, 'from pyrep import PyRep\n'), ((1224, 1324), 'rlbench.observation_config.ObservationConfig', 'ObservationConfig', ([... |
"""The CO2 Signal integration."""
from __future__ import annotations
from datetime import timedelta
import logging
from typing import TypedDict, cast
import CO2Signal
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_API_KEY, CONF_LATITUDE, CONF_LONGITUDE
from homeassistant.co... | [
"logging.getLogger",
"datetime.timedelta",
"typing.cast"
] | [((625, 652), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (642, 652), False, 'import logging\n'), ((4260, 4289), 'typing.cast', 'cast', (['CO2SignalResponse', 'data'], {}), '(CO2SignalResponse, data)\n', (4264, 4289), False, 'from typing import TypedDict, cast\n'), ((1883, 1904), 'date... |
"""
Running operational space control with a PyGame display, and using the pydmps
library to specify a trajectory for the end-effector to follow, in
this case, a bell shaped velocity profile.
To install the pydmps library, clone https://github.com/studywolf/pydmps
and run 'python setup.py develop'
***NOTE*** there are... | [
"pydmps.DMPs_discrete",
"matplotlib.pyplot.plot",
"numpy.exp",
"numpy.sum",
"numpy.linspace",
"numpy.array",
"numpy.vstack",
"numpy.cumsum",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.show"
] | [((1667, 1697), 'numpy.linspace', 'np.linspace', (['(0)', '(np.pi * 2)', '(100)'], {}), '(0, np.pi * 2, 100)\n', (1678, 1697), True, 'import numpy as np\n'), ((1838, 1847), 'numpy.sum', 'np.sum', (['g'], {}), '(g)\n', (1844, 1847), True, 'import numpy as np\n'), ((1951, 1963), 'numpy.cumsum', 'np.cumsum', (['g'], {}), ... |
from django.db import models
class Document(models.Model):
description = models.CharField(max_length=255, blank=True)
document = models.FileField(upload_to='')
uploaded_at = models.DateTimeField(auto_now_add=True)
def __str__(self):
return self.document.name
# pylint: disable=arguments-... | [
"django.db.models.DateTimeField",
"django.db.models.FileField",
"django.db.models.CharField"
] | [((80, 124), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(255)', 'blank': '(True)'}), '(max_length=255, blank=True)\n', (96, 124), False, 'from django.db import models\n'), ((140, 170), 'django.db.models.FileField', 'models.FileField', ([], {'upload_to': '""""""'}), "(upload_to='')\n", (156, ... |
from torch.utils.data import DataLoader
import torch
from tqdm import tqdm
import os
from shutil import copyfile
import numpy as np
import matplotlib.pyplot as plt
from src.generic_model import Criterian
from .dataloader import DataLoaderSYNTH
from src.utils.data_manipulation import denormalize_mean_variance
import tr... | [
"numpy.array",
"train_synth.config.pretrained_path.split",
"numpy.save",
"matplotlib.pyplot.plot",
"src.utils.utils.calculate_batch_fscore",
"src.utils.parallel.DataParallelModel",
"matplotlib.pyplot.savefig",
"src.UNET_ResNet.UNetWithResnet50Encoder",
"src.generic_model.Criterian",
"shutil.copyfi... | [((1249, 1281), 'os.makedirs', 'os.makedirs', (['base'], {'exist_ok': '(True)'}), '(base, exist_ok=True)\n', (1260, 1281), False, 'import os\n'), ((2940, 2956), 'tqdm.tqdm', 'tqdm', (['dataloader'], {}), '(dataloader)\n', (2944, 2956), False, 'from tqdm import tqdm\n'), ((6590, 6656), 'shutil.copyfile', 'copyfile', (['... |
import requests
import psycopg2
class LocationExtractor:
def __init__(self, page):
self.page = page
self.data = requests.get(page).json()
self.__conn = "host='localhost' dbname='ricknmorty' user='postgres' password='<PASSWORD>'"
def get_results(self):
return self.data['results'... | [
"psycopg2.connect",
"requests.get"
] | [((955, 984), 'psycopg2.connect', 'psycopg2.connect', (['self.__conn'], {}), '(self.__conn)\n', (971, 984), False, 'import psycopg2\n'), ((133, 151), 'requests.get', 'requests.get', (['page'], {}), '(page)\n', (145, 151), False, 'import requests\n')] |
#
# Copyright (c) 2021 Airbyte, Inc., all rights reserved.
#
from unittest.mock import MagicMock
import pytest
import requests
from airbyte_cdk.models.airbyte_protocol import SyncMode
from source_linnworks.streams import LinnworksStream, Location, ProcessedOrderDetails, ProcessedOrders, StockItems, StockLocations
@... | [
"source_linnworks.streams.StockItems",
"unittest.mock.MagicMock",
"source_linnworks.streams.ProcessedOrderDetails",
"requests.get",
"pytest.mark.parametrize",
"source_linnworks.streams.StockLocations",
"pytest.raises",
"source_linnworks.streams.LinnworksStream"
] | [((1666, 1801), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (["('header_name', 'header_value', 'expected')", "[('Retry-After', '123', 123), ('Retry-After', '-123', -123)]"], {}), "(('header_name', 'header_value', 'expected'), [(\n 'Retry-After', '123', 123), ('Retry-After', '-123', -123)])\n", (1689, 1801)... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Third party libraries
import tornado.web
# Engine libraries
from engine.search import DefaultSearch
class SearchHandler(tornado.web.RequestHandler):
def initialize(self, database, parser, options, logger):
"""
Initializes the database with parameters... | [
"engine.search.DefaultSearch"
] | [((703, 743), 'engine.search.DefaultSearch', 'DefaultSearch', (['options', 'database', 'parser'], {}), '(options, database, parser)\n', (716, 743), False, 'from engine.search import DefaultSearch\n')] |
# ==============================================================================
# MIT License
#
# Copyright 2020 Institute for Automotive Engineering of RWTH Aachen University.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "S... | [
"numpy.array"
] | [((1367, 1553), 'numpy.array', 'np.array', (['[[4.651574574230558e-14, 10.192351107009959, -5.36318723862984e-07], [-\n 5.588661045867985e-07, 0.0, 2.3708767903941617], [35.30731833118676, \n 0.0, -1.7000018578614013]]'], {}), '([[4.651574574230558e-14, 10.192351107009959, -5.36318723862984e-07\n ], [-5.588661... |
import os, sys
import argparse
from collections import defaultdict
import numpy as np
from netCDF4 import Dataset
import adios2
try:
from mpi4py import MPI
if MPI.COMM_WORLD.Get_size() > 1:
parallel = True
else:
parallel = False
except ImportError:
parallel = False
def progress(cou... | [
"argparse.ArgumentParser",
"netCDF4.Dataset",
"mpi4py.MPI.COMM_WORLD.Get_size",
"numpy.array",
"collections.defaultdict",
"adios2.open",
"sys.stdout.flush",
"numpy.zeros_like",
"sys.stdout.write"
] | [((536, 562), 'sys.stdout.write', 'sys.stdout.write', (['"""\x1b[K"""'], {}), "('\\x1b[K')\n", (552, 562), False, 'import os, sys\n'), ((638, 656), 'sys.stdout.flush', 'sys.stdout.flush', ([], {}), '()\n', (654, 656), False, 'import os, sys\n'), ((1095, 1181), 'netCDF4.Dataset', 'Dataset', (['output_file', '"""w"""'], ... |
from list import List
class Clean(object):
class Commands:
# Docker rm: removes containers
# Docker rmi: removes images
# Using listing commmands from List file, with -q to only show ids
EXITED_CONTAINER = 'docker rm $({} -q)'.format(List.Commands.EXITED_CONTAINER)
DANGLIN... | [
"list.List.change_report"
] | [((621, 696), 'list.List.change_report', 'List.change_report', (['cls.Commands.DANGLING_IMAGE', 'List.Commands.EXITED_IMAGE'], {}), '(cls.Commands.DANGLING_IMAGE, List.Commands.EXITED_IMAGE)\n', (639, 696), False, 'from list import List\n'), ((732, 818), 'list.List.change_report', 'List.change_report', (['cls.Commands.... |
import joblib
import PySimpleGUI as sg
import pandas as pd
def predict_patient(age: int, sex: int, cp: int, trestbps: int,
chol: int, fbs: int, restecg: int, thalach: int,
exang: int, oldpeak: float, slope: int, ca: int, thal: int):
a_patient = {
'age': age,
... | [
"PySimpleGUI.Checkbox",
"PySimpleGUI.Combo",
"PySimpleGUI.Text",
"PySimpleGUI.Button",
"PySimpleGUI.Input",
"joblib.load",
"pandas.DataFrame",
"PySimpleGUI.popup_ok",
"PySimpleGUI.Window"
] | [((838, 880), 'joblib.load', 'joblib.load', (['"""./column_transformer.joblib"""'], {}), "('./column_transformer.joblib')\n", (849, 880), False, 'import joblib\n'), ((897, 927), 'joblib.load', 'joblib.load', (['"""./scaler.joblib"""'], {}), "('./scaler.joblib')\n", (908, 927), False, 'import joblib\n'), ((943, 978), 'j... |
import FWCore.ParameterSet.Config as cms
#Tracks without extra and hits
#AOD content
RecoTrackerAOD = cms.PSet(
outputCommands = cms.untracked.vstring(
'keep recoTracks_ctfWithMaterialTracksP5_*_*',
'keep recoTracks_ctfWithMaterialTracksP5LHCNavigation_*_*',
'keep recoTracks_rsWithMaterialTracksP5... | [
"FWCore.ParameterSet.Config.untracked.vstring"
] | [((134, 1016), 'FWCore.ParameterSet.Config.untracked.vstring', 'cms.untracked.vstring', (['"""keep recoTracks_ctfWithMaterialTracksP5_*_*"""', '"""keep recoTracks_ctfWithMaterialTracksP5LHCNavigation_*_*"""', '"""keep recoTracks_rsWithMaterialTracksP5_*_*"""', '"""keep recoTracks_cosmictrackfinderP5_*_*"""', '"""keep r... |
from django.shortcuts import render
from django.http import HttpResponse, JsonResponse
from django.utils.translation import gettext as _
from django.core.mail import send_mail
from django.conf import settings
def index(request):
context={
'subject': ''
}
if request.method=='GET':
context['subject... | [
"django.shortcuts.render",
"django.http.HttpResponse",
"django.utils.translation.gettext",
"django.core.mail.send_mail"
] | [((365, 419), 'django.shortcuts.render', 'render', (['request', '"""contact/index.html"""'], {'context': 'context'}), "(request, 'contact/index.html', context=context)\n", (371, 419), False, 'from django.shortcuts import render\n'), ((2363, 2418), 'django.utils.translation.gettext', '_', (['"""You do not have permissio... |
import tempfile
import unittest
from collections import namedtuple
import six
from conans.client.rest.uploader_downloader import Uploader
from conans.errors import AuthenticationException, ForbiddenException
from conans.test.utils.tools import TestBufferConanOutput
from conans.util.files import save
class UploaderU... | [
"collections.namedtuple",
"tempfile.mktemp",
"conans.util.files.save",
"six.assertRaisesRegex",
"conans.test.utils.tools.TestBufferConanOutput"
] | [((585, 608), 'conans.test.utils.tools.TestBufferConanOutput', 'TestBufferConanOutput', ([], {}), '()\n', (606, 608), False, 'from conans.test.utils.tools import TestBufferConanOutput\n'), ((685, 702), 'tempfile.mktemp', 'tempfile.mktemp', ([], {}), '()\n', (700, 702), False, 'import tempfile\n'), ((711, 735), 'conans.... |
# Copyright 2018 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softwa... | [
"numpy.array",
"tensorflow.constant",
"numpy.sum"
] | [((886, 899), 'numpy.array', 'np.array', (['mat'], {}), '(mat)\n', (894, 899), True, 'import numpy as np\n'), ((911, 940), 'tensorflow.constant', 'tf.constant', (['mat'], {'dtype': 'dtype'}), '(mat, dtype=dtype)\n', (922, 940), True, 'import tensorflow as tf\n'), ((853, 866), 'numpy.sum', 'np.sum', (['shape'], {}), '(s... |
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
"selenium.webdriver.support.ui.WebDriverWait",
"selenium.webdriver.support.expected_conditions.invisibility_of_element_located",
"selenium.webdriver.support.expected_conditions.visibility_of_element_located"
] | [((1219, 1270), 'selenium.webdriver.support.expected_conditions.visibility_of_element_located', 'EC.visibility_of_element_located', (["(By.ID, 'screen')"], {}), "((By.ID, 'screen'))\n", (1251, 1270), True, 'from selenium.webdriver.support import expected_conditions as EC\n'), ((1291, 1344), 'selenium.webdriver.support.... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
def kml2latlon(ifile):
"""Read lon lat from kml file with single path"""
from fastkml import kml, geometry
with open(ifile, 'rt') as myfile:
doc = myfile.read()
k = kml.KML()
k.from_string(doc.encode("utf-8"))
f = list(k.features())
g... | [
"fastkml.kml.KML"
] | [((239, 248), 'fastkml.kml.KML', 'kml.KML', ([], {}), '()\n', (246, 248), False, 'from fastkml import kml, geometry\n')] |
from collections import Counter
import random
import numpy as np
def matches(vector, a):
"""
Returns indices where the elements of a vector match some value.
Args:
vector (ndarray(int)): A 1D numpy array describing a vector.
a (int): The value to match.
Returns:
list(int): A l... | [
"collections.Counter",
"random.choice",
"numpy.array_equal"
] | [((6665, 6706), 'numpy.array_equal', 'np.array_equal', (['self.vector', 'other.vector'], {}), '(self.vector, other.vector)\n', (6679, 6706), True, 'import numpy as np\n'), ((5918, 5941), 'random.choice', 'random.choice', (['too_many'], {}), '(too_many)\n', (5931, 5941), False, 'import random\n'), ((5960, 5982), 'random... |
import os
from aioweb.conf import settings
from aioweb.util import package_path
def setup(router):
router.root('site#index')
router.get('site#test')
router.static('/static/', [
os.path.join(package_path('aioweb'), 'assets'),
os.path.join(settings.BASE_DIR, 'app/assets'),
])
| [
"os.path.join",
"aioweb.util.package_path"
] | [((256, 301), 'os.path.join', 'os.path.join', (['settings.BASE_DIR', '"""app/assets"""'], {}), "(settings.BASE_DIR, 'app/assets')\n", (268, 301), False, 'import os\n'), ((213, 235), 'aioweb.util.package_path', 'package_path', (['"""aioweb"""'], {}), "('aioweb')\n", (225, 235), False, 'from aioweb.util import package_pa... |
from dataclasses import dataclass, field
from datetime import datetime
from typing import List, Optional
from .allowance import Allowance
from .allowance_limit_enforcement import AllowanceLimitEnforcement
from .allowance_reset_type import AllowanceResetType
from .instance_status import InstanceStatus
@dataclass
clas... | [
"dataclasses.field"
] | [((367, 440), 'dataclasses.field', 'field', ([], {'default': '"""co.yellowdog.platform.model.AccountAllowance"""', 'init': '(False)'}), "(default='co.yellowdog.platform.model.AccountAllowance', init=False)\n", (372, 440), False, 'from dataclasses import dataclass, field\n'), ((465, 496), 'dataclasses.field', 'field', (... |
from django.conf import settings
from mapentity.registry import registry
from . import models
app_name = 'maintenance'
urlpatterns = registry.register(models.Intervention, menu=settings.INTERVENTION_MODEL_ENABLED)
urlpatterns += registry.register(models.Project, menu=settings.PROJECT_MODEL_ENABLED)
| [
"mapentity.registry.registry.register"
] | [((137, 222), 'mapentity.registry.registry.register', 'registry.register', (['models.Intervention'], {'menu': 'settings.INTERVENTION_MODEL_ENABLED'}), '(models.Intervention, menu=settings.INTERVENTION_MODEL_ENABLED\n )\n', (154, 222), False, 'from mapentity.registry import registry\n'), ((233, 303), 'mapentity.regis... |
from torch.utils.data import Dataset
import torch
import json, os, random, time
import cv2
import torchvision.transforms as transforms
from data_transform.transform_wrapper import TRANSFORMS
import numpy as np
from utils.utils import get_category_list
import math
from PIL import Image
class BaseSet(Dataset)... | [
"torchvision.transforms.ToPILImage",
"os.path.join",
"math.sqrt",
"time.sleep",
"os.path.isfile",
"numpy.array",
"random.random",
"cv2.cvtColor",
"json.load",
"torchvision.transforms.ToTensor",
"cv2.imread",
"torchvision.transforms.Compose"
] | [((4008, 4042), 'torchvision.transforms.Compose', 'transforms.Compose', (['transform_list'], {}), '(transform_list)\n', (4026, 4042), True, 'import torchvision.transforms as transforms\n'), ((4821, 4852), 'os.path.join', 'os.path.join', (["now_info['fpath']"], {}), "(now_info['fpath'])\n", (4833, 4852), False, 'import ... |
"""
TODO
- add description about the file.
"""
import pygame
from Board import Board
class Screen(Board):
"""
set caption also stores variables for initialize window (wth and hgt)
:return: none
"""
def __init__(self):
super().__init__()
# create instantiation of board
se... | [
"pygame.init",
"pygame.display.set_mode",
"pygame.display.flip",
"pygame.display.set_icon",
"pygame.display.quit",
"Board.Board",
"pygame.display.set_caption",
"pygame.image.load"
] | [((331, 338), 'Board.Board', 'Board', ([], {}), '()\n', (336, 338), False, 'from Board import Board\n'), ((370, 405), 'pygame.display.set_caption', 'pygame.display.set_caption', (['"""Chess"""'], {}), "('Chess')\n", (396, 405), False, 'import pygame\n'), ((441, 480), 'pygame.image.load', 'pygame.image.load', (['"""ches... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import setuptools
with open('README.md') as readme_file:
readme = readme_file.read()
setuptools.setup(
name='ska-oso-oet',
version="2.13.2",
description="This project contains the code for the Observation Execution Tool, the application which provides hig... | [
"setuptools.find_packages"
] | [((579, 616), 'setuptools.find_packages', 'setuptools.find_packages', ([], {'where': '"""src"""'}), "(where='src')\n", (603, 616), False, 'import setuptools\n')] |