code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from pymatting.util.util import (
grid_coordinates,
sparse_conv_matrix,
weights_to_laplacian,
)
import numpy as np
def uniform_laplacian(image, radius=1):
"""This function returns a Laplacian matrix with all weights equal to one.
Parameters
------------
image: numpy.ndarray
Image ... | [
"numpy.ones",
"pymatting.util.util.weights_to_laplacian"
] | [((666, 689), 'pymatting.util.util.weights_to_laplacian', 'weights_to_laplacian', (['W'], {}), '(W)\n', (686, 689), False, 'from pymatting.util.util import grid_coordinates, sparse_conv_matrix, weights_to_laplacian\n'), ((617, 652), 'numpy.ones', 'np.ones', (['(window_size, window_size)'], {}), '((window_size, window_s... |
from model import *
from collections import defaultdict
def sort_urls(clientip):
urlcnt = defaultdict(int)
for request in Request.where(clientip=clientip).select():
urlcnt[request.host + request.url] += 1
return zip(sorted(urlcnt.keys(), key=lambda k: urlcnt[k])[::-1], sorted(urlcnt.values())[::... | [
"collections.defaultdict"
] | [((96, 112), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (107, 112), False, 'from collections import defaultdict\n')] |
import unittest
from tkinter import messagebox
from moneymanager import MoneyManager, item_types
class TestMoneyManager(unittest.TestCase):
def setUp(self):
self.user = MoneyManager()
self.user.balance = 1000.0
def test_legal_deposit_works(self):
'''Tests that depositing ... | [
"unittest.main",
"moneymanager.MoneyManager"
] | [((1978, 1993), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1991, 1993), False, 'import unittest\n'), ((192, 206), 'moneymanager.MoneyManager', 'MoneyManager', ([], {}), '()\n', (204, 206), False, 'from moneymanager import MoneyManager, item_types\n')] |
from ufora.FORA.python.PurePython.testModules.same_line_number.B import B
class A(object):
def __init__(self, m):
self.m = m
def foo(self):
return B(self.m)
| [
"ufora.FORA.python.PurePython.testModules.same_line_number.B.B"
] | [((174, 183), 'ufora.FORA.python.PurePython.testModules.same_line_number.B.B', 'B', (['self.m'], {}), '(self.m)\n', (175, 183), False, 'from ufora.FORA.python.PurePython.testModules.same_line_number.B import B\n')] |
# -*- coding: utf-8 -*-
"""
clikraken.api.private.get_balance
This module queries the Balance method of Kraken's API
and outputs the results in a tabular format.
Licensed under the Apache License, Version 2.0. See the LICENSE file.
"""
import argparse
from collections import OrderedDict
from decimal import Decimal
... | [
"clikraken.clikraken_utils.csv",
"clikraken.clikraken_utils._tabulate",
"decimal.Decimal",
"clikraken.api.api_utils.query_api",
"collections.OrderedDict",
"clikraken.clikraken_utils.process_options"
] | [((617, 640), 'clikraken.clikraken_utils.process_options', 'process_options', (['{}', '{}'], {}), '({}, {})\n', (632, 640), False, 'from clikraken.clikraken_utils import process_options\n'), ((968, 1009), 'clikraken.api.api_utils.query_api', 'query_api', (['"""private"""', '"""Balance"""', '{}', 'args'], {}), "('privat... |
import os
import sys
cmd1 = "python train_scratch.py --save_path='experiments/CIFAR10/baseline/mobilenetv2/'"
os.system(cmd1)
| [
"os.system"
] | [((111, 126), 'os.system', 'os.system', (['cmd1'], {}), '(cmd1)\n', (120, 126), False, 'import os\n')] |
"""
★ Task: Write an algorithm that can find whether a word is present in a sentence. ★
"""
import string
from datastruct.tree import Trie
def math_word(word: str, sentence: str) -> bool:
table = str.maketrans({key: None for key in string.punctuation})
sentence = sentence.translate(table).lower()
words = ... | [
"datastruct.tree.Trie"
] | [((355, 361), 'datastruct.tree.Trie', 'Trie', ([], {}), '()\n', (359, 361), False, 'from datastruct.tree import Trie\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import gzip
import json
import os
import time
from tqdm import tqdm
from clinicgen.data.image2text import _CaptioningData
class Flickr30kData(_CaptioningData):
IMAGE_NUM = 158915
DIR_IMAGES = 'flickr30k-images'
FILE_CAPTIONS = os.path.join('flickr30k', 'resul... | [
"tqdm.tqdm",
"json.load",
"os.path.join",
"time.time"
] | [((288, 339), 'os.path.join', 'os.path.join', (['"""flickr30k"""', '"""results_20130124.token"""'], {}), "('flickr30k', 'results_20130124.token')\n", (300, 339), False, 'import os\n'), ((1464, 1502), 'os.path.join', 'os.path.join', (['root', 'self.FILE_CAPTIONS'], {}), '(root, self.FILE_CAPTIONS)\n', (1476, 1502), Fals... |
import matplotlib.pyplot as plt
import csv
import pandas as pd
import numpy as np
# room d137b #
file = open("data_raw/_d137b.csv")
read = csv.reader(file, delimiter=';')
_read = pd.DataFrame(list(read)).to_numpy()
data_start = 1
data_end = 511
e2_q = _read[:, 1][data_start:data_end].astype(np.float) * -1
e2_ti = _re... | [
"csv.reader"
] | [((141, 172), 'csv.reader', 'csv.reader', (['file'], {'delimiter': '""";"""'}), "(file, delimiter=';')\n", (151, 172), False, 'import csv\n')] |
import functools
def foo(x, y):
print(x, " * ", y)
return x * y
r = range(5, 10)
res = functools.reduce(foo, r)
print(res)
| [
"functools.reduce"
] | [((100, 124), 'functools.reduce', 'functools.reduce', (['foo', 'r'], {}), '(foo, r)\n', (116, 124), False, 'import functools\n')] |
import json
from tempfile import NamedTemporaryFile
from datetime import datetime
import zzlog
def test_loginfo():
with NamedTemporaryFile() as f:
logger = zzlog.setup(
logger_root='.',
filename=f.name,
)
message = 'Hello World!'
logger.error(message)
... | [
"tempfile.NamedTemporaryFile",
"json.loads",
"zzlog.setup",
"datetime.datetime.strptime",
"datetime.datetime.now"
] | [((128, 148), 'tempfile.NamedTemporaryFile', 'NamedTemporaryFile', ([], {}), '()\n', (146, 148), False, 'from tempfile import NamedTemporaryFile\n'), ((172, 217), 'zzlog.setup', 'zzlog.setup', ([], {'logger_root': '"""."""', 'filename': 'f.name'}), "(logger_root='.', filename=f.name)\n", (183, 217), False, 'import zzlo... |
from copy import deepcopy
from numpy import zeros
from pyNastran.converters.cart3d.cart3d import Cart3D
from pyNastran.bdf.field_writer_8 import print_card_8
from pyNastran.bdf.field_writer_16 import print_card_16
class Cart3d_Mesher(Cart3D):
def __init__(self, log=None, debug=False):
Cart3D.__init__(sel... | [
"copy.deepcopy",
"pyNastran.converters.cart3d.cart3d.Cart3D.read_cart3d",
"pyNastran.bdf.field_writer_8.print_card_8",
"numpy.zeros",
"pyNastran.converters.cart3d.cart3d.Cart3D.__init__",
"pyNastran.bdf.field_writer_16.print_card_16"
] | [((301, 344), 'pyNastran.converters.cart3d.cart3d.Cart3D.__init__', 'Cart3D.__init__', (['self'], {'log': 'log', 'debug': 'debug'}), '(self, log=log, debug=debug)\n', (316, 344), False, 'from pyNastran.converters.cart3d.cart3d import Cart3D\n'), ((417, 485), 'pyNastran.converters.cart3d.cart3d.Cart3D.read_cart3d', 'Car... |
from textwrap import dedent
import pytest
from tests.cli.run_cli import run_cli
from tests.helpers.common_test_tables import customers_test_table
from tests.helpers.data_source_fixture import DataSourceFixture
from tests.helpers.fixtures import test_data_source
from tests.helpers.mock_file_system import MockFileSystem... | [
"textwrap.dedent",
"pytest.mark.skipif",
"tests.cli.run_cli.run_cli"
] | [((324, 454), 'pytest.mark.skipif', 'pytest.mark.skipif', (["(test_data_source != 'postgres')"], {'reason': '"""Run for postgres only as nothing data source specific is tested."""'}), "(test_data_source != 'postgres', reason=\n 'Run for postgres only as nothing data source specific is tested.')\n", (342, 454), False... |
import sys
import numpy as np
import matplotlib.pyplot as plt
import population
import world_data
countries, provinces = world_data.get_countries_provinces()
countryPopulation = population.get_all_population_data()
countries.extend(['Hubei'])
# todo: single loop, cleanup
countryDeaths = []
for country in countries:... | [
"world_data.get_countries_provinces",
"matplotlib.pyplot.show",
"world_data.get_country_xcdr",
"population.get_all_population_data",
"population.get_population",
"matplotlib.pyplot.figure",
"sys.exc_info"
] | [((123, 159), 'world_data.get_countries_provinces', 'world_data.get_countries_provinces', ([], {}), '()\n', (157, 159), False, 'import world_data\n'), ((180, 216), 'population.get_all_population_data', 'population.get_all_population_data', ([], {}), '()\n', (214, 216), False, 'import population\n'), ((2514, 2550), 'mat... |
import asyncio
from dataclasses import dataclass
from typing import Dict, List
import aiohttp
from bs4 import BeautifulSoup
from products.models import Product
@dataclass
class CrawlerResponse:
url: str
image: str
content: str
name: str
class Crawler(object):
async def _fetch_url(self, url: s... | [
"asyncio.get_event_loop",
"products.models.Product.objects.filter",
"products.models.Product.objects.bulk_create",
"aiohttp.ClientSession",
"products.models.Product",
"bs4.BeautifulSoup"
] | [((724, 761), 'bs4.BeautifulSoup', 'BeautifulSoup', (['content', '"""html.parser"""'], {}), "(content, 'html.parser')\n", (737, 761), False, 'from bs4 import BeautifulSoup\n'), ((1364, 1401), 'bs4.BeautifulSoup', 'BeautifulSoup', (['content', '"""html.parser"""'], {}), "(content, 'html.parser')\n", (1377, 1401), False,... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.urls import reverse_lazy
from django.views.generic import ListView
from portfolio.blog.models import Blog
from portfolio.blog.forms import BlogForm
from portfolio.views import BaseSudoView
class BlogFormView(BaseSudoView):
model = Blog
... | [
"django.urls.reverse_lazy",
"portfolio.blog.models.Blog.objects.filter",
"portfolio.blog.models.Blog.objects.all"
] | [((400, 441), 'django.urls.reverse_lazy', 'reverse_lazy', (['"""portfolio:blog:blog_index"""'], {}), "('portfolio:blog:blog_index')\n", (412, 441), False, 'from django.urls import reverse_lazy\n'), ((801, 819), 'portfolio.blog.models.Blog.objects.all', 'Blog.objects.all', ([], {}), '()\n', (817, 819), False, 'from port... |
#
from QAPUBSUB.producer import publisher_routing
from QAPUBSUB.consumer import subscriber_routing
from QUANTAXIS.QAEngine import QA_Thread
from QA_OTGBroker import on_pong, on_message, on_error, subscribe_quote, on_close, login, peek
import websocket
import threading
import click
import time
import json
import pymongo... | [
"websocket.WebSocketApp",
"pymongo.MongoClient",
"threading.Thread",
"QAPUBSUB.consumer.subscriber_routing",
"json.loads",
"time.sleep",
"QA_OTGBroker.subscribe_quote",
"QA_OTGBroker.peek"
] | [((536, 698), 'websocket.WebSocketApp', 'websocket.WebSocketApp', (['"""wss://openmd.shinnytech.com/t/md/front/mobile"""'], {'on_pong': 'on_pong', 'on_message': 'self.on_message', 'on_error': 'on_error', 'on_close': 'on_close'}), "('wss://openmd.shinnytech.com/t/md/front/mobile',\n on_pong=on_pong, on_message=self.o... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import sys
import subprocess
from flask import Flask, render_template
from sh import git
app = Flask(__name__)
version = git("rev-parse", "--short", "HEAD").strip()
command = os.getenv("HEATLAMP_SCRIPT")
def validate():
... | [
"flask.Flask",
"subprocess.call",
"flask.render_template",
"sh.git",
"os.getenv",
"sys.exit"
] | [((192, 207), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (197, 207), False, 'from flask import Flask, render_template\n'), ((273, 301), 'os.getenv', 'os.getenv', (['"""HEATLAMP_SCRIPT"""'], {}), "('HEATLAMP_SCRIPT')\n", (282, 301), False, 'import os\n'), ((1075, 1122), 'flask.render_template', 'render_... |
"""
This module provides distance helper functions.
"""
import numpy as np
import diversipy
def distance_to_boundary(points, cuboid=None):
"""Calculate the distance of each point to the boundary of some cuboid.
This distance is simply the minimum of all differences between
a point and the lower and uppe... | [
"numpy.minimum",
"numpy.abs",
"diversipy.cube.unitcube",
"numpy.asarray",
"numpy.expand_dims",
"numpy.linalg.norm",
"numpy.all",
"numpy.atleast_2d"
] | [((1091, 1143), 'numpy.minimum', 'np.minimum', (['dists_to_min_bounds', 'dists_to_max_bounds'], {}), '(dists_to_min_bounds, dists_to_max_bounds)\n', (1101, 1143), True, 'import numpy as np\n'), ((1155, 1179), 'numpy.all', 'np.all', (['(distances >= 0.0)'], {}), '(distances >= 0.0)\n', (1161, 1179), True, 'import numpy ... |
#!/usr/bin/env python3
from brownie import accounts, network, project, config
OPENSEA_FORMAT = "https://testnets.opensea.io/assets/{}/{}"
sample_token_uri = "https://ipfs.io/ipfs/QmPwpUKU1KAxbuTCNBCLfE6N4EPWvyY7g2oBCjfLvtHvof?filename=picture.json"
def main():
print("testing...")
proj = project.load('./', na... | [
"brownie.project.NFT.ArtistPicture.deploy",
"brownie.network.connect",
"brownie.project.load",
"brownie.accounts.add"
] | [((299, 329), 'brownie.project.load', 'project.load', (['"""./"""'], {'name': '"""NFT"""'}), "('./', name='NFT')\n", (311, 329), False, 'from brownie import accounts, network, project, config\n'), ((424, 467), 'brownie.accounts.add', 'accounts.add', (["config['wallets']['from_key']"], {}), "(config['wallets']['from_key... |
from fabric.api import *
import re
env.hosts=['nimbus-gateway.eng.vmware.com']
env.user=''# Active Directory username
env.password=''# Active Directory password
vm_name=""
def find_vcenter(output):
for x in reversed(output.splitlines()):
if re.search('"done"',x):
pass
elif re.search('".*: %s"... | [
"re.search"
] | [((252, 274), 're.search', 're.search', (['""""done\\""""', 'x'], {}), '(\'"done"\', x)\n', (261, 274), False, 'import re\n'), ((301, 335), 're.search', 're.search', (['(\'".*: %s"\' % vm_name)', 'x'], {}), '(\'".*: %s"\' % vm_name, x)\n', (310, 335), False, 'import re\n'), ((406, 429), 're.search', 're.search', (['"""... |
"""Map from manufacturer to standard clusters for thermostatic valves."""
import logging
from zigpy.profiles import zha
import zigpy.types as t
from zigpy.zcl.clusters.general import Basic, Groups, Identify, Ota, Scenes, Time
from . import (
TuyaManufClusterAttributes,
TuyaPowerConfigurationCluster,
TuyaT... | [
"logging.getLogger"
] | [((1296, 1323), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1313, 1323), False, 'import logging\n')] |
from panther_base_helpers import gsuite_details_lookup as details_lookup
from panther_base_helpers import gsuite_parameter_lookup as param_lookup
USER_SUSPENDED_EVENTS = {
'account_disabled_generic',
'account_disabled_spamming_through_relay',
'account_disabled_spamming',
'account_disabled_hijacked',
}
... | [
"panther_base_helpers.gsuite_details_lookup"
] | [((530, 593), 'panther_base_helpers.gsuite_details_lookup', 'details_lookup', (['"""account_warning"""', 'USER_SUSPENDED_EVENTS', 'event'], {}), "('account_warning', USER_SUSPENDED_EVENTS, event)\n", (544, 593), True, 'from panther_base_helpers import gsuite_details_lookup as details_lookup\n'), ((431, 494), 'panther_b... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations
def load_initial_data(apps, schema_editor):
Locale = apps.get_model('base', 'Locale')
for locale_kwargs in LOCALES:
Locale.objects.create(**locale_kwargs)
Project = a... | [
"django.db.migrations.RunPython"
] | [((1592, 1631), 'django.db.migrations.RunPython', 'migrations.RunPython', (['load_initial_data'], {}), '(load_initial_data)\n', (1612, 1631), False, 'from django.db import migrations\n')] |
"""
@Project : DuReader
@Module : punctuation_sub.py
@Author : Deco [<EMAIL>]
@Created : 5/16/18 1:36 PM
@Desc :
"""
import string
import re
def clean_sentence(st):
intab = string.punctuation + '。,“”‘’():;?·—《》、'
outtab = ' '
table = str.maketrans(dict.fromkeys(intab, outtab))
st1 = st... | [
"re.sub"
] | [((523, 550), 're.sub', 're.sub', (['in_tab', 'out_tab', 'st'], {}), '(in_tab, out_tab, st)\n', (529, 550), False, 'import re\n'), ((757, 784), 're.sub', 're.sub', (['in_tab', 'out_tab', 'st'], {}), '(in_tab, out_tab, st)\n', (763, 784), False, 'import re\n')] |
# Author: Hologram <<EMAIL>>
#
# Copyright 2016 - Hologram (Konekt, Inc.)
#
# LICENSE: Distributed under the terms of the MIT License
#
# test_Modem.py - This file implements unit tests for the Modem class.
import pytest
import sys
sys.path.append(".")
sys.path.append("..")
sys.path.append("../..")
from Exceptions.Ho... | [
"sys.path.append",
"pytest.raises",
"Hologram.Network.Modem.Modem._check_registered_helper",
"Hologram.Network.Modem.Modem"
] | [((234, 254), 'sys.path.append', 'sys.path.append', (['"""."""'], {}), "('.')\n", (249, 254), False, 'import sys\n'), ((255, 276), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (270, 276), False, 'import sys\n'), ((277, 301), 'sys.path.append', 'sys.path.append', (['"""../.."""'], {}), "('../..'... |
from app.Empleados import Empleados #en from ya declaro el modulo
from app.Ejecutivo import Ejecutivo
import time
if __name__== "__main__":
# este es el main
print(__name__)
# Paso los parametros... 1 Modulo, 2 Clase, 3 Parametro
e1 = Empleados("Juan", 2500)
# Creo el segundo objeto
... | [
"app.Ejecutivo.Ejecutivo",
"app.Empleados.Empleados"
] | [((261, 284), 'app.Empleados.Empleados', 'Empleados', (['"""Juan"""', '(2500)'], {}), "('Juan', 2500)\n", (270, 284), False, 'from app.Empleados import Empleados\n'), ((325, 349), 'app.Empleados.Empleados', 'Empleados', (['"""Maria"""', '(4250)'], {}), "('Maria', 4250)\n", (334, 349), False, 'from app.Empleados import ... |
import os.path as osp
from unittest import TestCase
import matplotlib.pyplot as plt
from pylinac import CatPhan503, CatPhan504, CatPhan600
from pylinac.core.geometry import Point
from tests.utils import save_file, LoadingTestBase, LocationMixin
TEST_DIR = osp.join(osp.dirname(__file__), 'test_files', 'CBCT')
plt.clo... | [
"tests.utils.save_file",
"os.path.join",
"matplotlib.pyplot.close",
"os.path.dirname",
"pylinac.CatPhan504.from_demo_images",
"pylinac.core.geometry.Point"
] | [((313, 329), 'matplotlib.pyplot.close', 'plt.close', (['"""all"""'], {}), "('all')\n", (322, 329), True, 'import matplotlib.pyplot as plt\n'), ((268, 289), 'os.path.dirname', 'osp.dirname', (['__file__'], {}), '(__file__)\n', (279, 289), True, 'import os.path as osp\n'), ((425, 453), 'os.path.join', 'osp.join', (['TES... |
# -*- coding: utf-8 -*-
from collections import defaultdict
class SystemMetricsGrabber:
def __init__(self):
self.epoch = -1
self.metrics = {}
def update(self, **kwargs):
self.metrics[self.epoch].update(**kwargs)
def update_epoch(self):
self.epoch += 1
self.metrics... | [
"collections.defaultdict"
] | [((3383, 3401), 'collections.defaultdict', 'defaultdict', (['float'], {}), '(float)\n', (3394, 3401), False, 'from collections import defaultdict\n'), ((3421, 3439), 'collections.defaultdict', 'defaultdict', (['float'], {}), '(float)\n', (3432, 3439), False, 'from collections import defaultdict\n'), ((3463, 3480), 'col... |
import pytest
import brightwind as bw
DATA = bw.load_csv(bw.demo_datasets.demo_data)
DATA = bw.apply_cleaning(DATA, bw.demo_datasets.demo_cleaning_file)
WSPD_COLS = ['Spd80mN', 'Spd80mS', 'Spd60mN', 'Spd60mS', 'Spd40mN', 'Spd40mS']
WDIR_COLS = ['Dir78mS', 'Dir58mS', 'Dir38mS']
def test_average():
# Specify colum... | [
"brightwind.Shear.BySector",
"brightwind.apply_cleaning",
"brightwind.Shear.TimeSeries",
"brightwind.Shear.scale",
"brightwind.Shear.Average",
"brightwind.load_csv",
"brightwind.Shear.TimeOfDay"
] | [((46, 85), 'brightwind.load_csv', 'bw.load_csv', (['bw.demo_datasets.demo_data'], {}), '(bw.demo_datasets.demo_data)\n', (57, 85), True, 'import brightwind as bw\n'), ((93, 153), 'brightwind.apply_cleaning', 'bw.apply_cleaning', (['DATA', 'bw.demo_datasets.demo_cleaning_file'], {}), '(DATA, bw.demo_datasets.demo_clean... |
import importlib
import os
import re
import shlex
import subprocess
import sys
import warnings
from importlib.metadata import PackageNotFoundError, distribution
from importlib.util import find_spec
from pathlib import Path
from shutil import rmtree
from unittest import skip
import pytest
import requests
from .unit_te... | [
"importlib.util.find_spec",
"pytest.skip",
"sys.platform.lower",
"pytest.mark.skipif",
"shutil.rmtree",
"importlib.metadata.distribution"
] | [((3957, 3998), 'pytest.mark.skipif', 'pytest.mark.skipif', (['(True)'], {'reason': '"""broken"""'}), "(True, reason='broken')\n", (3975, 3998), False, 'import pytest\n'), ((4730, 4789), 'pytest.mark.skipif', 'pytest.mark.skipif', (['not_local'], {'reason': '"""requires matplotlib"""'}), "(not_local, reason='requires m... |
import numpy as np
a = np.arange(6)
print(a)
# [0 1 2 3 4 5]
print(a.reshape(2, 3))
# [[0 1 2]
# [3 4 5]]
print(a.reshape(-1, 3))
# [[0 1 2]
# [3 4 5]]
print(a.reshape(2, -1))
# [[0 1 2]
# [3 4 5]]
# print(a.reshape(3, 4))
# ValueError: cannot reshape array of size 6 into shape (3,4)
# print(a.reshape(-1, 4))
... | [
"numpy.array",
"numpy.arange"
] | [((24, 36), 'numpy.arange', 'np.arange', (['(6)'], {}), '(6)\n', (33, 36), True, 'import numpy as np\n'), ((411, 422), 'numpy.array', 'np.array', (['l'], {}), '(l)\n', (419, 422), True, 'import numpy as np\n'), ((480, 491), 'numpy.array', 'np.array', (['l'], {}), '(l)\n', (488, 491), True, 'import numpy as np\n')] |
import random
import time
def random_sleep_time():
x = random.randint(5,15)
x = x*0.1
time.sleep(x)
| [
"random.randint",
"time.sleep"
] | [((64, 85), 'random.randint', 'random.randint', (['(5)', '(15)'], {}), '(5, 15)\n', (78, 85), False, 'import random\n'), ((105, 118), 'time.sleep', 'time.sleep', (['x'], {}), '(x)\n', (115, 118), False, 'import time\n')] |
"""
The interface for data preprocessing.
Authors:
<NAME>
"""
import numpy as np
import pandas as pd
from collections import Counter
class FeatureExtractor(object):
def __init__(self):
self.idf_vec = None
self.mean_vec = None
self.events = None
def df_fit_transform(self, X_se... | [
"pandas.DataFrame",
"numpy.sum",
"numpy.log",
"numpy.tile",
"collections.Counter"
] | [((900, 922), 'pandas.DataFrame', 'pd.DataFrame', (['x_counts'], {}), '(x_counts)\n', (912, 922), True, 'import pandas as pd\n'), ((1085, 1109), 'numpy.sum', 'np.sum', (['(X_df > 0)'], {'axis': '(0)'}), '(X_df > 0, axis=0)\n', (1091, 1109), True, 'import numpy as np\n'), ((1133, 1172), 'numpy.log', 'np.log', (['(num_in... |
from django.contrib import admin
# Register your models here.
from app1.models import Release
from app1.models import Comments
from app1.models import User
from app1.models import Collections
admin.site.register(Release )
admin.site.register(Comments)
admin.site.register(User)
admin.site.register( Collection... | [
"django.contrib.admin.site.register"
] | [((200, 228), 'django.contrib.admin.site.register', 'admin.site.register', (['Release'], {}), '(Release)\n', (219, 228), False, 'from django.contrib import admin\n'), ((231, 260), 'django.contrib.admin.site.register', 'admin.site.register', (['Comments'], {}), '(Comments)\n', (250, 260), False, 'from django.contrib imp... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Python implementation of <NAME>'s MST code
# <NAME>
# October 11, 2016
# MIT License
import sys
import toml
import parameters
import model
import controller
import reference
import output
from utils import time
def run(config):
"""Run a fixed length simulation based... | [
"model.MST",
"controller.LQG",
"output.Plotter",
"parameters.LookupTable",
"utils.time",
"reference.Translator",
"sys.exit"
] | [((408, 438), 'parameters.LookupTable', 'parameters.LookupTable', (['config'], {}), '(config)\n', (430, 438), False, 'import parameters\n'), ((465, 490), 'model.MST', 'model.MST', (['params', 'config'], {}), '(params, config)\n', (474, 490), False, 'import model\n'), ((523, 556), 'controller.LQG', 'controller.LQG', (["... |
from django.contrib import admin
from django.urls import path, include
from allez.views import index
urlpatterns = [
path('admin/', admin.site.urls),
path('', index, name='index'),
path('carnival/', include('carnival.urls')),
path('accounts/', include('accounts.urls')),
path('accounts/', include('... | [
"django.urls.path",
"django.urls.include"
] | [((123, 154), 'django.urls.path', 'path', (['"""admin/"""', 'admin.site.urls'], {}), "('admin/', admin.site.urls)\n", (127, 154), False, 'from django.urls import path, include\n'), ((160, 189), 'django.urls.path', 'path', (['""""""', 'index'], {'name': '"""index"""'}), "('', index, name='index')\n", (164, 189), False, ... |
#---------------------------------------------------------------------------------------------
# Create an application called "Online Auction" with id "online_auc"
#
# Create a device to represent the app server called "OA-AppServer-1" with id "oa-appserver-1"
#
# Create a type of entity to represent transa... | [
"pycurl.Curl",
"json.dumps"
] | [((2614, 2627), 'pycurl.Curl', 'pycurl.Curl', ([], {}), '()\n', (2625, 2627), False, 'import pycurl\n'), ((2741, 2762), 'json.dumps', 'json.dumps', (['newEntity'], {}), '(newEntity)\n', (2751, 2762), False, 'import json\n'), ((3432, 3445), 'pycurl.Curl', 'pycurl.Curl', ([], {}), '()\n', (3443, 3445), False, 'import pyc... |
"""
A group of spiking neurons with noise `~U(0, potential_noise_scale)` is added
to `n_neurons * prob_rand_fire` neurons at each step.
Each spiking neuron has an internal membrane potential that
increases with each incoming spike. The potential persists but slowly
decreases over time. Each neuron fires when its poten... | [
"numpy.int_",
"numpy.random.uniform",
"spikey.module.Key"
] | [((3757, 3828), 'numpy.random.uniform', 'np.random.uniform', (['(0)', 'self._potential_noise_scale'], {'size': 'self._n_neurons'}), '(0, self._potential_noise_scale, size=self._n_neurons)\n', (3774, 3828), True, 'import numpy as np\n'), ((2339, 2417), 'spikey.module.Key', 'Key', (['"""potential_noise_scale"""', '"""Mul... |
from snovault import (
CONNECTION,
upgrade_step,
)
@upgrade_step('hotspot_quality_metric', '3', '4')
def hotspot_quality_metric_3_4(value, system):
return
@upgrade_step('hotspot_quality_metric', '4', '5')
def hotspot_quality_metric_4_5(value, system):
# http://redmine.encodedcc.org/issues/2491
i... | [
"re.sub",
"snovault.upgrade_step"
] | [((62, 110), 'snovault.upgrade_step', 'upgrade_step', (['"""hotspot_quality_metric"""', '"""3"""', '"""4"""'], {}), "('hotspot_quality_metric', '3', '4')\n", (74, 110), False, 'from snovault import CONNECTION, upgrade_step\n'), ((172, 220), 'snovault.upgrade_step', 'upgrade_step', (['"""hotspot_quality_metric"""', '"""... |
"""
숫자 5를 6으로 볼수도, 6을 5로 볼수도 있다.
"""
from sys import stdin
a, b = map(str, stdin.readline().split())
max_val = int(a.replace('5', '6')) + int(b.replace('5', '6'))
min_val = int(a.replace('6', '5')) + int(b.replace('6', '5'))
print(min_val, max_val) | [
"sys.stdin.readline"
] | [((77, 93), 'sys.stdin.readline', 'stdin.readline', ([], {}), '()\n', (91, 93), False, 'from sys import stdin\n')] |
import torch
import bert.tokenization as tokenization
from bert.modeling import BertConfig, BertModel
from sqlova.utils.utils_wikisql import *
from sqlova.model.nl2sql.wikisql_models import *
from sqlnet.dbengine import DBEngine
from train import test
import random
from decimal import Decimal
device = torch.device("cu... | [
"bert.modeling.BertConfig.from_json_file",
"torch.load",
"torch.cuda.is_available",
"bert.tokenization.FullTokenizer",
"bert.modeling.BertModel"
] | [((1245, 1288), 'bert.modeling.BertConfig.from_json_file', 'BertConfig.from_json_file', (['bert_config_file'], {}), '(bert_config_file)\n', (1270, 1288), False, 'from bert.modeling import BertConfig, BertModel\n'), ((1305, 1374), 'bert.tokenization.FullTokenizer', 'tokenization.FullTokenizer', ([], {'vocab_file': 'voca... |
from skimage import color
import numpy as np
from matplotlib import pyplot as plt
def plot_cielab(l):
min_range = -110
max_range = 110
ab_range = np.linspace(min_range, max_range, 500)
b, a = np.meshgrid(ab_range, ab_range)
color_cielab = np.array([np.ones(a.shape) * l, a, b]).T
color_rgb = co... | [
"numpy.meshgrid",
"numpy.ones",
"numpy.any",
"skimage.color.lab2rgb",
"numpy.sin",
"numpy.arange",
"numpy.array",
"numpy.linspace",
"numpy.cos",
"matplotlib.pyplot.subplots"
] | [((159, 197), 'numpy.linspace', 'np.linspace', (['min_range', 'max_range', '(500)'], {}), '(min_range, max_range, 500)\n', (170, 197), True, 'import numpy as np\n'), ((210, 241), 'numpy.meshgrid', 'np.meshgrid', (['ab_range', 'ab_range'], {}), '(ab_range, ab_range)\n', (221, 241), True, 'import numpy as np\n'), ((318, ... |
from setuptools import setup
VERSION = '6.10.0'
setup(
name='Marvin',
version=VERSION,
description='Marvin - Python client for Cosmic',
author='<NAME>',
author_email='<EMAIL>',
maintainer='Mission Critical Cloud',
maintainer_email='<EMAIL>',
long_description='Marvin is the Cosmic pytho... | [
"setuptools.setup"
] | [((50, 983), 'setuptools.setup', 'setup', ([], {'name': '"""Marvin"""', 'version': 'VERSION', 'description': '"""Marvin - Python client for Cosmic"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'maintainer': '"""Mission Critical Cloud"""', 'maintainer_email': '"""<EMAIL>"""', 'long_description': '"""Ma... |
# Generated by Django 3.0.10 on 2021-06-22 12:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('bypass', '0010_auto_20210622_1509'),
]
operations = [
migrations.AlterModelOptions(
name='vdgoobject',
options={'or... | [
"django.db.migrations.AlterModelOptions"
] | [((235, 396), 'django.db.migrations.AlterModelOptions', 'migrations.AlterModelOptions', ([], {'name': '"""vdgoobject"""', 'options': "{'ordering': ['address'], 'verbose_name': 'Объект ВДГО',\n 'verbose_name_plural': 'Объекты ВДГО'}"}), "(name='vdgoobject', options={'ordering': [\n 'address'], 'verbose_name': 'Объ... |
import re
from typing import List
DCOS_MIGRATE_NAMESPACE = "migration.dcos.d2iq.com"
_invalid_label = re.compile('[^-a-zA-Z0-9]')
def make_label(name: str) -> str:
# An alphanumeric (a-z, and 0-9) string, with a maximum length of 63
# characters, with the '-' character allowed anywhere except the first or
... | [
"re.compile"
] | [((104, 131), 're.compile', 're.compile', (['"""[^-a-zA-Z0-9]"""'], {}), "('[^-a-zA-Z0-9]')\n", (114, 131), False, 'import re\n'), ((2670, 2699), 're.compile', 're.compile', (['"""[^-._a-zA-Z0-9]"""'], {}), "('[^-._a-zA-Z0-9]')\n", (2680, 2699), False, 'import re\n')] |
#
# Copyright 2019 EPAM Systems
#
# 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... | [
"odahuflow.jupyterlab.handlers.base.build_redirect_url",
"odahuflow.jupyterlab.handlers.helper.url_join",
"odahuflow.sdk.clients.oauth_handler.get_oauth_token_issuer_url",
"odahuflow.jupyterlab.handlers.base.build_oauth_url"
] | [((1733, 1750), 'odahuflow.jupyterlab.handlers.base.build_oauth_url', 'build_oauth_url', ([], {}), '()\n', (1748, 1750), False, 'from odahuflow.jupyterlab.handlers.base import build_redirect_url, build_oauth_url\n'), ((1778, 1816), 'odahuflow.sdk.clients.oauth_handler.get_oauth_token_issuer_url', 'get_oauth_token_issue... |
from Statistics.Mean import mean
from numpy import absolute, asarray
def var(data):
x = (absolute(asarray(data) - mean(data)))
y = x **2
z = mean(y)
return round(z, 13)
# variance is the square of mean deviation
| [
"Statistics.Mean.mean",
"numpy.asarray"
] | [((155, 162), 'Statistics.Mean.mean', 'mean', (['y'], {}), '(y)\n', (159, 162), False, 'from Statistics.Mean import mean\n'), ((104, 117), 'numpy.asarray', 'asarray', (['data'], {}), '(data)\n', (111, 117), False, 'from numpy import absolute, asarray\n'), ((120, 130), 'Statistics.Mean.mean', 'mean', (['data'], {}), '(d... |
"""
Matrix related utility functions
"""
#***************************************************************************************************
# Copyright 2015, 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
# Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government retains cert... | [
"numpy.linalg.eigvals",
"numpy.sum",
"numpy.diag_indices_from",
"numpy.abs",
"scipy.sparse.issparse",
"numpy.empty",
"numpy.allclose",
"pygsti.tools.basistools.change_basis",
"numpy.imag",
"numpy.linalg.svd",
"numpy.linalg.norm",
"numpy.isclose",
"scipy.sparse.linalg._expm_multiply.LazyOpera... | [((2965, 2987), 'numpy.linalg.eigvals', '_np.linalg.eigvals', (['mx'], {}), '(mx)\n', (2983, 2987), True, 'import numpy as _np\n'), ((4368, 4384), 'numpy.sum', '_np.sum', (['(ar ** 2)'], {}), '(ar ** 2)\n', (4375, 4384), True, 'import numpy as _np\n'), ((4800, 4817), 'numpy.linalg.svd', '_np.linalg.svd', (['m'], {}), '... |
from etl.jobs.transformation.treatment_component_transformer_job import transform_treatment_component
from tests.etl.workflow.treatment_component.expected_outputs import expected_treatments_components
from tests.etl.workflow.treatment_component.input_data import treatment_and_component_helper, treatment
from tests.util... | [
"etl.jobs.transformation.treatment_component_transformer_job.transform_treatment_component",
"tests.util.assert_df_are_equal_ignore_id",
"tests.util.convert_to_dataframe"
] | [((467, 534), 'tests.util.convert_to_dataframe', 'convert_to_dataframe', (['spark_session', 'treatment_and_component_helper'], {}), '(spark_session, treatment_and_component_helper)\n', (487, 534), False, 'from tests.util import convert_to_dataframe, assert_df_are_equal_ignore_id\n'), ((554, 600), 'tests.util.convert_to... |
import sys
sys.path.append("..")
from engineering_tool.temperatures import *
def Gas_Temperature():
pressure = 0.22 # atm
volume = 10 # Litre or 1 Litre = 1000 cm^3
n_Mole_H2O = 0.056 # mol H2O 1 g / 18 g.mol^-1
R_H2O = 0.08206 # L.atm.mol^-1K^-1
temp = Temperature.Gas(pressure,v... | [
"sys.path.append"
] | [((11, 32), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (26, 32), False, 'import sys\n')] |
'''
Created on Jun 27, 2016
@author: rajajosh
'''
import numpy
from scipy.spatial.distance import euclidean
class KNNClassifier(object):
"K-Nearest Neighbors classifier class"
len=0
x_train=[]
y_train=[]
kVal=1
clusters = set()
def __init__(self):
'''
Const... | [
"numpy.asarray",
"scipy.spatial.distance.euclidean"
] | [((1417, 1438), 'numpy.asarray', 'numpy.asarray', (['retArr'], {}), '(retArr)\n', (1430, 1438), False, 'import numpy\n'), ((883, 919), 'scipy.spatial.distance.euclidean', 'euclidean', (['testData', 'self.x_train[i]'], {}), '(testData, self.x_train[i])\n', (892, 919), False, 'from scipy.spatial.distance import euclidean... |
# Generated by Django 4.0 on 2022-02-26 16:03
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('contatos', '0021_alter_chat_data'),
]
operations = [
migrations.AlterField(
model_name='chat',
name='d... | [
"datetime.datetime"
] | [((385, 434), 'datetime.datetime', 'datetime.datetime', (['(2022)', '(2)', '(26)', '(13)', '(3)', '(54)', '(155992)'], {}), '(2022, 2, 26, 13, 3, 54, 155992)\n', (402, 434), False, 'import datetime\n')] |
import os
import random
import time
import requests
random.seed(time.time())
ITERATIONS = int(os.getenv('ITERATIONS', '1000000'))
def generate_random_int():
return random.randint(0, 1024)
def generate_random_float():
return random.random()
def request(url):
ri = str(generate_random_int())
respon... | [
"random.randint",
"time.time",
"os.environ.get",
"random.random",
"requests.get",
"os.getenv"
] | [((65, 76), 'time.time', 'time.time', ([], {}), '()\n', (74, 76), False, 'import time\n'), ((96, 130), 'os.getenv', 'os.getenv', (['"""ITERATIONS"""', '"""1000000"""'], {}), "('ITERATIONS', '1000000')\n", (105, 130), False, 'import os\n'), ((172, 195), 'random.randint', 'random.randint', (['(0)', '(1024)'], {}), '(0, 1... |
import argparse
import os
import sys
import pwnlib
from pwnlib.context import context
choices = map(str, [16,32,64])
choices += list(context.oses)
choices += list(context.architectures)
choices += list(context.endiannesses)
def context_arg(arg):
try: context.arch = arg
except Exception: pass
try: context... | [
"pwnlib.commandline.main.main",
"argparse.ArgumentParser",
"sys.argv.insert",
"os.path.basename"
] | [((498, 585), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Pwntools Command-line Interface"""', 'prog': '"""pwn"""'}), "(description='Pwntools Command-line Interface', prog\n ='pwn')\n", (521, 585), False, 'import argparse\n'), ((793, 817), 'sys.argv.insert', 'sys.argv.insert', (['(... |
# Ultroid - UserBot
# Copyright (C) 2020 TeamUltroid
#
# This file is a part of < https://github.com/TeamUltroid/Ultroid/ >
# PLease read the GNU Affero General Public License in
# <https://www.github.com/TeamUltroid/Ultroid/blob/main/LICENSE/>.
"""
✘ Commands Available -
•`{i}calc` - Inline Calculator
"""
import r... | [
"re.compile"
] | [((1210, 1232), 're.compile', 're.compile', (['"""calc(.*)"""'], {}), "('calc(.*)')\n", (1220, 1232), False, 'import re\n')] |
import os
from codecs import open
from setuptools import setup
here = os.path.abspath(os.path.dirname(__file__))
# load about information
about = {}
with open(os.path.join(here, 'seq_interval', '__version__.py'), 'r', 'utf-8') as f:
exec(f.read(), about)
requires = []
setup(
name=about['__title__'],
ver... | [
"os.path.dirname",
"os.path.join",
"setuptools.setup"
] | [((277, 1124), 'setuptools.setup', 'setup', ([], {'name': "about['__title__']", 'version': "about['__version__']", 'keywords': "about['__keywords__']", 'description': "about['__description__']", 'author': "about['__author__']", 'author_email': "about['__author_email__']", 'url': "about['__url__']", 'packages': "['seq_i... |
# -*- coding: utf-8 -*-
"""
Azure Resource Manager (ARM) Redis Operations State Module
.. versionadded:: 2.0.0
.. versionchanged:: 4.0.0
:maintainer: <<EMAIL>>
:configuration: This module requires Azure Resource Manager credentials to be passed via acct. Note that the
authentication parameters are case sensitive... | [
"logging.getLogger",
"time.sleep"
] | [((1819, 1846), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1836, 1846), False, 'import logging\n'), ((11230, 11257), 'time.sleep', 'time.sleep', (['poller_interval'], {}), '(poller_interval)\n', (11240, 11257), False, 'import time\n')] |
# Name: main
# Author: Reacubeth
# Time: 2020/5/28 12:27
# Mail: <EMAIL>
# Site: www.omegaxyz.com
# *_*coding:utf-8 *_*
from paper2XML import PaperXML
from predictNER import ModelPredict
import time
import warnings
warnings.filterwarnings("ignore")
if __name__ == '__main__':
model = ModelPredict('save')
whi... | [
"paper2XML.PaperXML",
"time.time",
"predictNER.ModelPredict",
"warnings.filterwarnings"
] | [((217, 250), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (240, 250), False, 'import warnings\n'), ((292, 312), 'predictNER.ModelPredict', 'ModelPredict', (['"""save"""'], {}), "('save')\n", (304, 312), False, 'from predictNER import ModelPredict\n'), ((466, 477), 'time... |
# Notebooks-contrib test
import os
import sys
def bsql_start():
"""
set up users to use SQL in the RAPIDS AI ecosystem
> try to import BlazingContext from BlazingSQL
> offer to install BlazingSQL if module not found
BlazingSQL prereqs:
> Conda: https://docs.blazingdb.com/docs/i... | [
"sys.version.split",
"os.system"
] | [((1147, 1174), 'os.system', 'os.system', (['"""apt-get update"""'], {}), "('apt-get update')\n", (1156, 1174), False, 'import os\n'), ((1187, 1230), 'os.system', 'os.system', (['"""apt-get -y install default-jre"""'], {}), "('apt-get -y install default-jre')\n", (1196, 1230), False, 'import os\n'), ((1594, 1616), 'sys... |
# Copyright 2018-2021 Streamlit Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | [
"streamlit.uploaded_file_manager.UploadedFileManager",
"streamlit.state.session_state.SessionState",
"streamlit.proto.ForwardMsg_pb2.ForwardMsg"
] | [((1256, 1268), 'streamlit.proto.ForwardMsg_pb2.ForwardMsg', 'ForwardMsg', ([], {}), '()\n', (1266, 1268), False, 'from streamlit.proto.ForwardMsg_pb2 import ForwardMsg\n'), ((1861, 1873), 'streamlit.proto.ForwardMsg_pb2.ForwardMsg', 'ForwardMsg', ([], {}), '()\n', (1871, 1873), False, 'from streamlit.proto.ForwardMsg_... |
#t16.py
#nltk matplotlib
#python 2.7+
import nltk, matplotlib
def vocab_growth(text):
vocabulary = set()
for text in texts:
for word in text:
vocabulary.add(word)
yield len(vocabulary)
#def speeches():
# presidents = []
# texts = nltk.defaultdi... | [
"matplotlib.plot",
"matplotlib.show",
"matplotlib.legend",
"matplotlib.title"
] | [((1058, 1111), 'matplotlib.plot', 'matplotlib.plot', (['growth'], {'label': 'president', 'linewidth': '(2)'}), '(growth, label=president, linewidth=2)\n', (1073, 1111), False, 'import matplotlib\n'), ((1119, 1188), 'matplotlib.title', 'matplotlib.title', (['"""Vocabulary Growth in State-of-the-Union Addresses"""'], {}... |
import os
import argparse
import base64
import warnings
from multiprocessing import Pool
import shutil
import zlib
import numpy as np
import cv2
import h5py
from tqdm import tqdm
def encode_single(info):
source_path, target_path, video, video_index, num_videos, delete = info
print('Encoding {} / {} file.'.fo... | [
"os.mkdir",
"tqdm.tqdm",
"numpy.void",
"argparse.ArgumentParser",
"os.path.exists",
"multiprocessing.Pool",
"os.path.split",
"os.path.join",
"os.listdir"
] | [((942, 973), 'os.path.exists', 'os.path.exists', (['opt.source_path'], {}), '(opt.source_path)\n', (956, 973), False, 'import os\n'), ((1066, 1093), 'os.listdir', 'os.listdir', (['opt.source_path'], {}), '(opt.source_path)\n', (1076, 1093), False, 'import os\n'), ((2466, 2497), 'os.path.exists', 'os.path.exists', (['o... |
# testutils.py
# -*- coding: utf8 -*-
# vim:fileencoding=utf8 ai ts=4 sts=4 et sw=4
# Copyright 2016 National Research Foundation (South African Radio Astronomy Observatory)
# BSD license - see LICENSE for details
from __future__ import absolute_import, division, print_function
from future import standard_library
sta... | [
"mock.patch.object",
"future.standard_library.install_aliases",
"time.sleep",
"sys.exc_info",
"logging.getLogger"
] | [((317, 351), 'future.standard_library.install_aliases', 'standard_library.install_aliases', ([], {}), '()\n', (349, 351), False, 'from future import standard_library\n'), ((442, 469), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (459, 469), False, 'import logging\n'), ((2474, 2490), 't... |
import math
import operator
import numpy as np
def _convert_to_float(fl):
""" This method converts ONLY the numeric values of a string into floats """
try:
return float(fl)
except (ValueError, TypeError):
return fl
def _wrap_to_pi(angle):
""" This method wrap the input angle to 360 [... | [
"operator.itemgetter",
"numpy.array",
"numpy.sign",
"numpy.deg2rad"
] | [((835, 1029), 'numpy.array', 'np.array', (['[-x1 * x0 - y1 * y0 - z1 * z0 + w1 * w0, x1 * w0 + y1 * z0 - z1 * y0 + w1 *\n x0, -x1 * z0 + y1 * w0 + z1 * x0 + w1 * y0, x1 * y0 - y1 * x0 + z1 * w0 +\n w1 * z0]'], {'dtype': 'np.float64'}), '([-x1 * x0 - y1 * y0 - z1 * z0 + w1 * w0, x1 * w0 + y1 * z0 - z1 *\n y0 +... |
#!/usr/bin/env python
# coding=utf-8
from __future__ import division, print_function, unicode_literals
from collections import OrderedDict
from brainstorm.layers.base_layer import Layer
from brainstorm.structure.buffer_structure import (BufferStructure,
StructureTemp... | [
"brainstorm.structure.buffer_structure.BufferStructure",
"brainstorm.structure.buffer_structure.StructureTemplate",
"brainstorm.utils.flatten_time_and_features",
"brainstorm.utils.flatten_time",
"collections.OrderedDict",
"brainstorm.structure.construction.ConstructionWrapper.create"
] | [((596, 691), 'brainstorm.structure.construction.ConstructionWrapper.create', 'ConstructionWrapper.create', (['RecurrentLayerImpl'], {'size': 'size', 'name': 'name', 'activation': 'activation'}), '(RecurrentLayerImpl, size=size, name=name,\n activation=activation)\n', (622, 691), False, 'from brainstorm.structure.co... |
# -*- coding: utf-8 -*-
from pyramid.view import view_config
from pyramid.response import Response
from intranet3 import helpers as h
from intranet3.utils.views import BaseView
from intranet3.utils import google_calendar as cal
from intranet3.forms.employees import (
LateJustificationForm,
WrongTimeJustificati... | [
"intranet3.models.DBSession.add",
"pyramid.response.Response",
"intranet3.models.Absence",
"intranet3.log.INFO_LOG",
"intranet3.forms.employees.AbsenceCreateForm",
"intranet3.models.Late",
"intranet3.helpers.get_working_days",
"intranet3.lib.employee.user_leave",
"intranet3.forms.employees.LateJusti... | [((505, 523), 'intranet3.log.INFO_LOG', 'INFO_LOG', (['__name__'], {}), '(__name__)\n', (513, 523), False, 'from intranet3.log import INFO_LOG\n'), ((785, 879), 'pyramid.view.view_config', 'view_config', ([], {'route_name': '"""employee_form_late_justification"""', 'permission': '"""can_justify_late"""'}), "(route_name... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Provide some reward processors.
It processes the rewards before returning them; this can be useful to standardize, normalize, center them for instance.
"""
import numpy as np
from pyrobolearn.rewards.reward import Reward
__author__ = "<NAME>"
__copyright__ = "Copyrig... | [
"numpy.random.uniform",
"numpy.minimum",
"numpy.maximum",
"numpy.clip",
"numpy.sqrt"
] | [((1534, 1590), 'numpy.random.uniform', 'np.random.uniform', ([], {'low': 'self.range[0]', 'high': 'self.range[1]'}), '(low=self.range[0], high=self.range[1])\n', (1551, 1590), True, 'import numpy as np\n'), ((3361, 3397), 'numpy.clip', 'np.clip', (['reward', 'self.low', 'self.high'], {}), '(reward, self.low, self.high... |
import logging
import ray
from ray.rllib.policy.sample_batch import SampleBatch
from ray.rllib.utils.memory import ray_get_and_free
logger = logging.getLogger(__name__)
def collect_samples(agents, sample_batch_size, num_envs_per_worker,
train_batch_size):
"""Collects at least train_batch_siz... | [
"ray.rllib.policy.sample_batch.SampleBatch.concat_samples",
"ray.rllib.utils.memory.ray_get_and_free",
"logging.getLogger"
] | [((143, 170), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (160, 170), False, 'import logging\n'), ((1113, 1153), 'ray.rllib.policy.sample_batch.SampleBatch.concat_samples', 'SampleBatch.concat_samples', (['trajectories'], {}), '(trajectories)\n', (1139, 1153), False, 'from ray.rllib.po... |
import yaml
_required = ["servers"]
class Config(object):
def __init__(self, configFile):
self.configFile = configFile
self._configData = {}
def readConfig(self):
try:
with open(self.configFile, "r") as config:
configData = yaml.safe_load(config)
e... | [
"yaml.safe_load"
] | [((288, 310), 'yaml.safe_load', 'yaml.safe_load', (['config'], {}), '(config)\n', (302, 310), False, 'import yaml\n')] |
#!/usr/bin/env python
from __future__ import print_function
from mmstructlib.cli import ArgParse
from mmstructlib.tools.preprocess import strip_water, strip_hydrogen
from mmstructlib.radii import add_radii
from mmstructlib.tools.summarize import from_atom
import sys
mirror = "/var/data/pdb"
def window_gen(half_win... | [
"mmstructlib.sas.nsc.area_atoms",
"mmstructlib.radii.add_radii",
"mmstructlib.sas.nsc.atoms_area_weighted",
"mmstructlib.tools.preprocess.strip_hydrogen",
"sys.exit",
"mmstructlib.tools.summarize.from_atom",
"mmstructlib.cli.ArgParse",
"mmstructlib.sas.alpha_shapes.area_atoms",
"mmstructlib.tools.pr... | [((866, 941), 'mmstructlib.cli.ArgParse', 'ArgParse', (['"""Calculate residue-wise surface area"""'], {'mirror_default_path': 'mirror'}), "('Calculate residue-wise surface area', mirror_default_path=mirror)\n", (874, 941), False, 'from mmstructlib.cli import ArgParse\n'), ((1873, 1895), 'mmstructlib.tools.preprocess.st... |
# Copyright 2021 PerfKitBenchmarker 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 appli... | [
"perfkitbenchmarker.errors.Resource.RetryableDeletionError",
"perfkitbenchmarker.errors.Resource.RetryableCreationError",
"perfkitbenchmarker.providers.equinix.util.MetalAndParse",
"perfkitbenchmarker.vm_util.Retry"
] | [((2539, 2554), 'perfkitbenchmarker.vm_util.Retry', 'vm_util.Retry', ([], {}), '()\n', (2552, 2554), False, 'from perfkitbenchmarker import vm_util\n'), ((2639, 2698), 'perfkitbenchmarker.providers.equinix.util.MetalAndParse', 'util.MetalAndParse', (["['device', 'get', '-i', self.device_id]"], {}), "(['device', 'get', ... |
import time
from typing import Optional
from mitmproxy import ctx
from mitmproxy import flowfilter
from mitmproxy.script import concurrent
from mitmproxy.exceptions import OptionsError
matchall = flowfilter.parse(".")
class Sleeper:
def __init__(self):
self.filter: Optional[flowfilter.TFilter] = matchal... | [
"mitmproxy.flowfilter.parse",
"mitmproxy.exceptions.OptionsError",
"mitmproxy.flowfilter.match",
"time.sleep"
] | [((199, 220), 'mitmproxy.flowfilter.parse', 'flowfilter.parse', (['"""."""'], {}), "('.')\n", (215, 220), False, 'from mitmproxy import flowfilter\n'), ((1237, 1272), 'mitmproxy.flowfilter.match', 'flowfilter.match', (['self.filter', 'flow'], {}), '(self.filter, flow)\n', (1253, 1272), False, 'from mitmproxy import flo... |
# Copyright (c) 2019 NVIDIA CORPORATION. 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 applicabl... | [
"modeling.BertForPreTraining.from_pretrained",
"argparse.ArgumentParser",
"modeling.BertConfig.from_json_file",
"torch.device"
] | [((726, 751), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (749, 751), False, 'import argparse\n'), ((1717, 1765), 'modeling.BertConfig.from_json_file', 'BertConfig.from_json_file', (['args.bert_config_path'], {}), '(args.bert_config_path)\n', (1742, 1765), False, 'from modeling import BertFo... |
"""Schema classes for test Reports."""
import functools
import json
from copy import deepcopy
import six
from six.moves import range
# pylint: disable=no-name-in-module,import-error
if six.PY2:
from collections import MutableMapping, MutableSequence
else:
from collections.abc import MutableMapping, MutableSeq... | [
"functools.partial",
"copy.deepcopy",
"testplan.common.utils.timing.Interval",
"marshmallow.fields.Dict",
"marshmallow.fields.Integer",
"six.iterkeys",
"marshmallow.fields.List",
"marshmallow.fields.Bool",
"json.dumps",
"marshmallow.fields.String",
"marshmallow.fields.Str",
"testplan.common.se... | [((884, 911), 'testplan.common.serialization.fields.UTCDateTime', 'custom_fields.UTCDateTime', ([], {}), '()\n', (909, 911), True, 'from testplan.common.serialization import fields as custom_fields\n'), ((922, 964), 'testplan.common.serialization.fields.UTCDateTime', 'custom_fields.UTCDateTime', ([], {'allow_none': '(T... |
"""
Classes for running a Gretel Job as a local container
"""
from __future__ import annotations
import atexit
import io
import signal
import tarfile
import uuid
from dataclasses import dataclass
from pathlib import Path
from time import sleep
from typing import Dict, Iterator, List, Optional, Tuple, TYPE_CHECKING, U... | [
"docker.from_env",
"atexit.register",
"io.BytesIO",
"uuid.uuid4",
"docker.types.containers.DeviceRequest",
"gretel_client.projects.exceptions.DockerEnvironmentError",
"smart_open.open",
"time.sleep",
"tqdm.auto.tqdm",
"pathlib.Path",
"gretel_client.projects.exceptions.ContainerRunError",
"gret... | [((1042, 1089), 'docker.types.containers.DeviceRequest', 'DeviceRequest', ([], {'count': '(-1)', 'capabilities': "[['gpu']]"}), "(count=-1, capabilities=[['gpu']])\n", (1055, 1089), False, 'from docker.types.containers import DeviceRequest\n'), ((11283, 11303), 'gretel_client.config.get_session_config', 'get_session_co... |
import logging
logging.basicConfig(filename='ews.log', level=logging.INFO, format='%(asctime)s - %(message)s')
default_app_config = 'ews.apps.EwsConfig'
| [
"logging.basicConfig"
] | [((16, 116), 'logging.basicConfig', 'logging.basicConfig', ([], {'filename': '"""ews.log"""', 'level': 'logging.INFO', 'format': '"""%(asctime)s - %(message)s"""'}), "(filename='ews.log', level=logging.INFO, format=\n '%(asctime)s - %(message)s')\n", (35, 116), False, 'import logging\n')] |
from __future__ import print_function
import threading
import math
from numpy import sign, clip
import rospy
from geometry_msgs.msg import Twist
from nav_msgs.msg import Odometry
from b2_logic.odometry_helpers import heading_from_odometry, normalize_theta, calc_steering_angle
# Mode enum
MODE_FORWARD = 0
MODE_OBSTAC... | [
"rospy.logwarn",
"b2_logic.odometry_helpers.heading_from_odometry",
"rospy.logerr",
"nav_msgs.msg.Odometry",
"b2_logic.odometry_helpers.calc_steering_angle",
"b2_logic.odometry_helpers.normalize_theta",
"threading.RLock",
"geometry_msgs.msg.Twist",
"rospy.Rate",
"numpy.clip",
"rospy.is_shutdown"... | [((994, 1004), 'nav_msgs.msg.Odometry', 'Odometry', ([], {}), '()\n', (1002, 1004), False, 'from nav_msgs.msg import Odometry\n'), ((1032, 1049), 'threading.RLock', 'threading.RLock', ([], {}), '()\n', (1047, 1049), False, 'import threading\n'), ((1480, 1504), 'rospy.Rate', 'rospy.Rate', (['self._loophz'], {}), '(self.... |
# for Coverage
from mock import patch, MagicMock
class TestAll:
def test_channels(self):
from pyEX import DeepChannels
DeepChannels.options()
def test_tops(self):
from pyEX import topsWS
with patch('pyEX.marketdata.ws._stream'):
topsWS()
topsWS('test')
... | [
"pyEX.marketdata.ws.DeepChannels.options",
"pyEX.tradingStatusWS",
"pyEX.tradeBreakWS",
"pyEX.tradesWS",
"pyEX.opHaltStatusWS",
"pyEX.systemEventWS",
"mock.patch",
"pyEX.lastWS",
"pyEX.topsWS",
"pyEX.bookWS",
"pyEX.officialPriceWS",
"pyEX.ssrStatusWS",
"pyEX.deepWS",
"pyEX.securityEventWS"... | [((141, 163), 'pyEX.marketdata.ws.DeepChannels.options', 'DeepChannels.options', ([], {}), '()\n', (161, 163), False, 'from pyEX.marketdata.ws import DeepChannels\n'), ((235, 270), 'mock.patch', 'patch', (['"""pyEX.marketdata.ws._stream"""'], {}), "('pyEX.marketdata.ws._stream')\n", (240, 270), False, 'from mock import... |
from solution import Item, Cart
def test_empty_cart():
cart = Cart()
cart.cart_list == []
assert f'{cart:short}' == ''
assert f'{cart:long}' == ''
def test_cart_1_item():
cart = Cart()
assert len(cart.cart_list) == 0
item = Item(2, 'grain', 'rice', 1)
cart.add(item)
assert len(car... | [
"solution.Cart",
"solution.Item"
] | [((67, 73), 'solution.Cart', 'Cart', ([], {}), '()\n', (71, 73), False, 'from solution import Item, Cart\n'), ((200, 206), 'solution.Cart', 'Cart', ([], {}), '()\n', (204, 206), False, 'from solution import Item, Cart\n'), ((255, 282), 'solution.Item', 'Item', (['(2)', '"""grain"""', '"""rice"""', '(1)'], {}), "(2, 'gr... |
from django.contrib import admin
from .models import Supplier
# Register your models here.
admin.site.register(Supplier)
| [
"django.contrib.admin.site.register"
] | [((94, 123), 'django.contrib.admin.site.register', 'admin.site.register', (['Supplier'], {}), '(Supplier)\n', (113, 123), False, 'from django.contrib import admin\n')] |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2021 <NAME> (The Compiler) <<EMAIL>>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, e... | [
"re.split"
] | [((6357, 6387), 're.split', 're.split', (['pattern', 's', 'maxsplit'], {}), '(pattern, s, maxsplit)\n', (6365, 6387), False, 'import re\n'), ((6501, 6531), 're.split', 're.split', (['pattern', 's', 'maxsplit'], {}), '(pattern, s, maxsplit)\n', (6509, 6531), False, 'import re\n')] |
#! /usr/bin/python
# -*- coding: utf-8 -*-
import tensorflow as tf
from tensorlayer.layers.core import Layer
from tensorlayer import logging
from tensorlayer.decorators import deprecated_alias
__all__ = [
'Stack',
'UnStack',
]
class Stack(Layer):
"""
The :class:`Stack` class is a layer for stacki... | [
"tensorflow.stack",
"tensorlayer.logging.info",
"tensorflow.unstack"
] | [((1273, 1332), 'tensorlayer.logging.info', 'logging.info', (["('Stack %s: axis: %d' % (self.name, self.axis))"], {}), "('Stack %s: axis: %d' % (self.name, self.axis))\n", (1285, 1332), False, 'from tensorlayer import logging\n'), ((1426, 1474), 'tensorflow.stack', 'tf.stack', (['inputs'], {'axis': 'self.axis', 'name':... |
# Copyright 2021 AI Redefined Inc. <<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 ... | [
"copy.deepcopy",
"cogment_verse_torch_agents.muzero.utils.flush_queue",
"cogment_verse_torch_agents.muzero.schedule.LinearScheduleWithWarmup"
] | [((1545, 1570), 'copy.deepcopy', 'copy.deepcopy', (['self.agent'], {}), '(self.agent)\n', (1558, 1570), False, 'import copy\n'), ((1662, 1887), 'cogment_verse_torch_agents.muzero.schedule.LinearScheduleWithWarmup', 'LinearScheduleWithWarmup', (['self.config.training.optimizer.learning_rate', 'self.config.training.optim... |
from sslcommerz_python_api import SSLCSession
from decimal import Decimal
def response():
mypayment = SSLCSession(sslc_is_sandbox=True, sslc_store_id='your_sslc_store_id', sslc_store_pass='<PASSWORD>c_store_<PASSWORD>')
mypayment.set_urls(success_url='example.com/success', fail_url='example.com/failed', cancel_url... | [
"sslcommerz_python_api.SSLCSession",
"decimal.Decimal"
] | [((105, 226), 'sslcommerz_python_api.SSLCSession', 'SSLCSession', ([], {'sslc_is_sandbox': '(True)', 'sslc_store_id': '"""your_sslc_store_id"""', 'sslc_store_pass': '"""<PASSWORD>c_store_<PASSWORD>"""'}), "(sslc_is_sandbox=True, sslc_store_id='your_sslc_store_id',\n sslc_store_pass='<PASSWORD>c_store_<PASSWORD>')\n"... |
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import matplotlib.gridspec as gridspec
import numpy as np
def isSampleFree(sample, obs, dimW):
for o in range(0, obs.shape[0] // (2 * dimW)):
isFree = 0
for d in range(0, sample.shape[0]):
if (sample[d] < obs[2 * dimW... | [
"matplotlib.pyplot.show",
"matplotlib.patches.Rectangle",
"matplotlib.pyplot.scatter",
"numpy.zeros",
"matplotlib.pyplot.figure",
"numpy.linspace",
"numpy.concatenate"
] | [((1127, 1192), 'numpy.concatenate', 'np.concatenate', (['(obs1, obs2, obs3, obs4, obs5, obsBounds)'], {'axis': '(0)'}), '((obs1, obs2, obs3, obs4, obs5, obsBounds), axis=0)\n', (1141, 1192), True, 'import numpy as np\n'), ((1264, 1295), 'numpy.linspace', 'np.linspace', (['(0)', '(1)'], {'num': 'gridSize'}), '(0, 1, nu... |
#!/usr/bin/python
# coding: utf-8
import requests
import json
import smtplib
import datetime
import config
def send_mail(recipients, subject, body):
headers = [
"From: " + config.MAIL_SENDER,
"Subject: " + subject,
"To: " + (', '.join(recipients) if isinstance(recipients, list) else reci... | [
"requests.get",
"datetime.date.today",
"json.loads",
"smtplib.SMTP"
] | [((447, 497), 'smtplib.SMTP', 'smtplib.SMTP', (['config.MAIL_SERVER', 'config.MAIL_PORT'], {}), '(config.MAIL_SERVER, config.MAIL_PORT)\n', (459, 497), False, 'import smtplib\n'), ((918, 991), 'requests.get', 'requests.get', (['"""https://query.yahooapis.com/v1/public/yql"""'], {'params': 'payload'}), "('https://query.... |
#!/usr/bin/env python3
"""Run precommit checks on the repository."""
import argparse
import os
import pathlib
import re
import subprocess
import sys
def main() -> int:
"""Execute the main routine."""
parser = argparse.ArgumentParser()
parser.add_argument(
"--overwrite",
help="Overwrites th... | [
"os.environ.copy",
"argparse.ArgumentParser",
"subprocess.check_call",
"pathlib.Path"
] | [((219, 244), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (242, 244), False, 'import argparse\n'), ((2315, 2332), 'os.environ.copy', 'os.environ.copy', ([], {}), '()\n', (2330, 2332), False, 'import os\n'), ((2598, 2643), 'subprocess.check_call', 'subprocess.check_call', (["['coverage', 'rep... |
import os
import sys
one_level_up = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
sys.path.insert(1, one_level_up)
from app import config
from app.tests import test_utils
from relational.scripts import generator
from relational.scripts import pred_builder
from analysis import analysis
from analysis im... | [
"os.path.dirname",
"sys.path.insert"
] | [((99, 131), 'sys.path.insert', 'sys.path.insert', (['(1)', 'one_level_up'], {}), '(1, one_level_up)\n', (114, 131), False, 'import sys\n'), ((65, 90), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (80, 90), False, 'import os\n')] |
# -*- coding:utf8 -*-
from flask import Flask
from flask import jsonify
from flask import render_template
from flask import request
app = Flask(__name__)
from data_adapter import *
import psycopg2
from models.datasource import DataSource
@app.route('/config')
def config():
return render_template('react_test.html... | [
"flask.Flask",
"flask.jsonify",
"flask.render_template",
"models.meta_data.MetaData",
"psycopg2.connect"
] | [((139, 154), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (144, 154), False, 'from flask import Flask\n'), ((288, 322), 'flask.render_template', 'render_template', (['"""react_test.html"""'], {}), "('react_test.html')\n", (303, 322), False, 'from flask import render_template\n'), ((365, 394), 'flask.ren... |
import sys
import inspect
import functools
import re
from codetiming import Timer
sys.path.insert(0, 'D:\\projects\\aoc2020\\')
from helper import loadingUtils, pretty
DAY = 4
def get_path():
return "day{:02d}".format(DAY)
def string_to_dict(line: str):
out = {}
for field in line.split(" "):
k, v... | [
"inspect.stack",
"codetiming.Timer",
"helper.pretty.print2DMap",
"helper.loadingUtils.import_multiline",
"sys.path.insert",
"functools.reduce",
"re.search"
] | [((82, 127), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""D:\\\\projects\\\\aoc2020\\\\"""'], {}), "(0, 'D:\\\\projects\\\\aoc2020\\\\')\n", (97, 127), False, 'import sys\n'), ((3893, 3900), 'codetiming.Timer', 'Timer', ([], {}), '()\n', (3898, 3900), False, 'from codetiming import Timer\n'), ((4345, 4352), 'code... |
import numpy as np
import pandas as pd
import os
from psrqpy import QueryATNF
from utmost_psr import utils, plot
def UTMOST_NS_module_params():
"""
System parameters for a single UTMOST-2D North-South module.
output:
-------
UTMOST_NS_module: dict
Dictionary containing module parameters (... | [
"numpy.cos",
"numpy.sqrt"
] | [((1611, 1644), 'numpy.sqrt', 'np.sqrt', (['((period - width) / width)'], {}), '((period - width) / width)\n', (1618, 1644), True, 'import numpy as np\n'), ((2264, 2309), 'numpy.cos', 'np.cos', (['((psr_DECJ - Latitude) * np.pi / 180.0)'], {}), '((psr_DECJ - Latitude) * np.pi / 180.0)\n', (2270, 2309), True, 'import nu... |
# Copyright 2018 The TensorFlow 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... | [
"tensorflow.python.ops.ragged.ragged_factory_ops.constant",
"tensorflow.python.ops.ragged.ragged_tensor.RaggedTensor.from_row_splits",
"tensorflow.python.platform.googletest.main"
] | [((2895, 2912), 'tensorflow.python.platform.googletest.main', 'googletest.main', ([], {}), '()\n', (2910, 2912), False, 'from tensorflow.python.platform import googletest\n'), ((1302, 1374), 'tensorflow.python.ops.ragged.ragged_factory_ops.constant', 'ragged_factory_ops.constant', (['[[1, 2, 3, 4], [5], [], [6, 7, 8, 9... |
# Generated by Django 3.2.7 on 2021-10-27 11:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Bake_bot', '0004_alter_order_deliivery_address'),
]
operations = [
migrations.AddField(
model_name='order',
name='de... | [
"django.db.models.DateTimeField",
"django.db.models.TimeField"
] | [((352, 402), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'auto_now_add': '(True)', 'null': '(True)'}), '(auto_now_add=True, null=True)\n', (372, 402), False, 'from django.db import migrations, models\n'), ((528, 574), 'django.db.models.TimeField', 'models.TimeField', ([], {'auto_now_add': '(True)',... |
#! /usr/bin/env python
# $Id: test_get_parser_class.py 7504 2012-08-27 07:55:20Z grubert $
# Author: <NAME>
# Maintainer: <EMAIL>
# Copyright: This module has been placed in the public domain.
"""
test get_parser_class
"""
from __init__ import DocutilsTestSupport
from docutils.parsers import get_parser_class
class ... | [
"unittest.main",
"docutils.parsers.get_parser_class"
] | [((820, 835), 'unittest.main', 'unittest.main', ([], {}), '()\n', (833, 835), False, 'import unittest\n'), ((435, 458), 'docutils.parsers.get_parser_class', 'get_parser_class', (['"""rst"""'], {}), "('rst')\n", (451, 458), False, 'from docutils.parsers import get_parser_class\n'), ((735, 767), 'docutils.parsers.get_par... |
#! python3
# -*- coding: utf-8 -*-
import os
import sys
import shutil
import tkinter
from tkinter import ttk, messagebox
from PIL import Image, ImageDraw, ImageFont # pip install Pillow
import piexif # pip install piexif
префикс_имён_файлов = 'D_'
имя_папки_с_датой = 'Дата'
имя_папки_без_даты = 'Оригиналы'
размер_шри... | [
"tkinter.StringVar",
"os.mkdir",
"tkinter.Label",
"tkinter.ttk.Entry",
"os.path.isdir",
"tkinter.messagebox.showerror",
"tkinter.ttk.Frame",
"PIL.ImageFont.truetype",
"PIL.Image.open",
"piexif.load",
"tkinter.ttk.Button",
"PIL.ImageDraw.Draw",
"os.path.split",
"os.path.join",
"tkinter.Tk... | [((5431, 5443), 'tkinter.Tk', 'tkinter.Tk', ([], {}), '()\n', (5441, 5443), False, 'import tkinter\n'), ((3991, 4068), 'PIL.ImageFont.truetype', 'ImageFont.truetype', (['"""%WINDIR%\\\\Fonts\\\\arial.ttf"""', 'относительный_размер_шрифта'], {}), "('%WINDIR%\\\\Fonts\\\\arial.ttf', относительный_размер_шрифта)\n", (4009... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
@author: peter.s
@project: EmptyModel
@time: 2019/11/6 16:42
@desc:
"""
import pickle
from aehn.preprocess.data_source import DataSource
def get_static_data_callback(data):
"""
callback generator for getting data online
:param data:
:return:
"""
... | [
"pickle.load",
"aehn.preprocess.data_source.DataSource"
] | [((1066, 1131), 'aehn.preprocess.data_source.DataSource', 'DataSource', (["(self._data_name + '_train')"], {'cache_dir': 'self._cache_dir'}), "(self._data_name + '_train', cache_dir=self._cache_dir)\n", (1076, 1131), False, 'from aehn.preprocess.data_source import DataSource\n'), ((1155, 1220), 'aehn.preprocess.data_so... |
from v_process import *
import config
import os
def data_process():
for folder_name in os.listdir(config.video_folder):
print(folder_name)
if 'train_without' in folder_name :
pro = Process(config.video_folder + folder_name + '/')
pro.rename()
# if 'gray' in confi... | [
"os.listdir"
] | [((92, 123), 'os.listdir', 'os.listdir', (['config.video_folder'], {}), '(config.video_folder)\n', (102, 123), False, 'import os\n')] |
#!/usr/bin/env python
"""
Created on 2015-04-04T11:28:18
"""
from __future__ import division, print_function
import sys
import subprocess
from sqlalchemy import create_engine
try:
import pymysql
except ImportError:
print('You need pymysql installed')
sys.exit(1)
__author__ = "<NAME> (github: @mattgiguer... | [
"sqlalchemy.create_engine",
"subprocess.check_output",
"sys.exit"
] | [((620, 660), 'subprocess.check_output', 'subprocess.check_output', (['cmd'], {'shell': '(True)'}), '(cmd, shell=True)\n', (643, 660), False, 'import subprocess\n'), ((266, 277), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (274, 277), False, 'import sys\n'), ((2030, 2066), 'sqlalchemy.create_engine', 'create_engine... |
from pymdc.rest import REST
from pymdc.api.files import Files
# A list of bucket objects for a user account.
class Buckets():
def __init__(self, key_pair):
self.key_pair = key_pair
def create(self, name, storage, transfer, key_pairs, callback=None):
# Get pub keys.
pub_keys = []
... | [
"pymdc.api.files.Files",
"pymdc.rest.REST"
] | [((588, 659), 'pymdc.rest.REST', 'REST', (['"""POST"""', '"""/buckets"""', 'params'], {'callback': 'callback', 'auth': 'self.key_pair'}), "('POST', '/buckets', params, callback=callback, auth=self.key_pair)\n", (592, 659), False, 'from pymdc.rest import REST\n'), ((830, 890), 'pymdc.rest.REST', 'REST', (['"""GET"""', '... |