code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="fastBio",
version="0.1.7",
author="<NAME>",
author_email="<EMAIL>",
description="Deep learning for biological sequences with fastai",
long_description=long_description,
long_descri... | [
"setuptools.find_packages"
] | [((418, 444), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (442, 444), False, 'import setuptools\n')] |
import hou
import os
def main(arguments):
print("Save & Increment File")
try:
scene_path = hou.hipFile.path()
path_split = scene_path.split("/")
versions_dir = '/'.join(path_split[:-2])
dirs = os.listdir(versions_dir)
version = 1
for dir in dirs:
st... | [
"os.mkdir",
"hou.hipFile.path",
"hou.hipFile.save",
"hou.hipFile.setName",
"os.path.exists",
"os.path.join",
"os.listdir"
] | [((108, 126), 'hou.hipFile.path', 'hou.hipFile.path', ([], {}), '()\n', (124, 126), False, 'import hou\n'), ((236, 260), 'os.listdir', 'os.listdir', (['versions_dir'], {}), '(versions_dir)\n', (246, 260), False, 'import os\n'), ((867, 903), 'os.path.join', 'os.path.join', (['versions_dir', 'work_dir'], {}), '(versions_... |
"""Functions for making lens-shaped surfaces."""
from dataclasses import dataclass
from typing import Sequence, Tuple, Callable
import numpy as np
from .. import functions
from ..types import Sequence2, Sequence3
from ..sdb import *
__all__ = ['make_spherical_singlet', 'make_toroidal_singlet', 'make_spherical_singlet_... | [
"numpy.asarray"
] | [((1665, 1691), 'numpy.asarray', 'np.asarray', (['vertex0', 'float'], {}), '(vertex0, float)\n', (1675, 1691), True, 'import numpy as np\n'), ((2206, 2225), 'numpy.asarray', 'np.asarray', (['vertex0'], {}), '(vertex0)\n', (2216, 2225), True, 'import numpy as np\n'), ((2749, 2766), 'numpy.asarray', 'np.asarray', (['pitc... |
#!/usr/bin/python
# -*- coding:utf-8 -*-
import sys
import os
picdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'pic')
libdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'lib')
if os.path.exists(libdir):
sys.path.append(libdir)
import logging
from ... | [
"sys.path.append",
"PIL.Image.new",
"logging.basicConfig",
"os.path.realpath",
"os.path.exists",
"PIL.Image.open",
"time.sleep",
"logging.info",
"waveshare_epd.epd7in5_V2.EPD",
"waveshare_epd.epd7in5_V2.epdconfig.module_exit"
] | [((247, 269), 'os.path.exists', 'os.path.exists', (['libdir'], {}), '(libdir)\n', (261, 269), False, 'import os\n'), ((424, 464), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG'}), '(level=logging.DEBUG)\n', (443, 464), False, 'import logging\n'), ((275, 298), 'sys.path.append', 'sys.path.a... |
from aoc2019.d3 import WireTracer
import unittest
class Test2019Day3(unittest.TestCase):
def test_2019_D3_C1(self):
wire_1 = ["R8", "U5", "L5", "D3"]
wire_2 = ["U7", "R6", "D4", "L4"]
tracer = WireTracer(wire_1, wire_2)
self.assertEqual(tracer.find_distance(), 6)
self.asser... | [
"unittest.main",
"aoc2019.d3.WireTracer"
] | [((1227, 1242), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1240, 1242), False, 'import unittest\n'), ((223, 249), 'aoc2019.d3.WireTracer', 'WireTracer', (['wire_1', 'wire_2'], {}), '(wire_1, wire_2)\n', (233, 249), False, 'from aoc2019.d3 import WireTracer\n'), ((556, 582), 'aoc2019.d3.WireTracer', 'WireTrace... |
"""Downstream expert for Query-by-Example Spoken Term Detection on QUESST 2014."""
from collections import defaultdict
from concurrent.futures import ProcessPoolExecutor, as_completed
from pathlib import Path
import numpy as np
import torch
import torch.nn as nn
from lxml import etree
from torch.utils.data import Dat... | [
"torch.utils.data.DataLoader",
"pathlib.Path",
"torch.stack",
"torch.nn.CosineEmbeddingLoss"
] | [((922, 934), 'pathlib.Path', 'Path', (['expdir'], {}), '(expdir)\n', (926, 934), False, 'from pathlib import Path\n'), ((1122, 1146), 'torch.nn.CosineEmbeddingLoss', 'nn.CosineEmbeddingLoss', ([], {}), '()\n', (1144, 1146), True, 'import torch.nn as nn\n'), ((1203, 1372), 'torch.utils.data.DataLoader', 'DataLoader', (... |
# old autoupdates? where did this come from?
import discord_wrapper as discord
import dbl
import asyncio
import logging
import logging.config
import os
from data import meta
from images import shop
from utils import sql
from utils.times import day_string as parse_second_time
def getEnv(name,default=None):
value =... | [
"images.shop.getTime",
"images.shop.generate",
"asyncio.sleep",
"data.meta.getStatus",
"data.meta.getNews",
"images.shop.getShopData",
"os.environ.get",
"utils.sql.Database",
"discord_wrapper.Client",
"utils.times.day_string",
"logging.config.dictConfig",
"discord_wrapper.Object",
"logging.g... | [((1417, 1458), 'logging.config.dictConfig', 'logging.config.dictConfig', (['logging_config'], {}), '(logging_config)\n', (1442, 1458), False, 'import logging\n'), ((1469, 1485), 'discord_wrapper.Client', 'discord.Client', ([], {}), '()\n', (1483, 1485), True, 'import discord_wrapper as discord\n'), ((1504, 1541), 'uti... |
# %%-- Import
import torch
import copy
import torch.nn as nn
import torch.nn.parallel
import torch.optim as optim
import torch.utils.data as Data
from torch.autograd import Variable
import numpy as np
import pandas as pd
pd.options.mode.chained_assignment = None # default='warn'
import time
import datetime
import gc
... | [
"torch.nn.Dropout",
"seaborn.heatmap",
"numpy.argmax",
"sklearn.model_selection.train_test_split",
"sklearn.metrics.accuracy_score",
"sklearn.preprocessing.MinMaxScaler",
"sklearn.metrics.classification_report",
"numpy.shape",
"LumiGAN.dataset.Dataset",
"numpy.random.randint",
"matplotlib.pyplot... | [((1375, 1400), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (1398, 1400), False, 'import torch\n'), ((1663, 1680), 'LumiGAN.logger.Logger', 'Logger', (['tracefile'], {}), '(tracefile)\n', (1669, 1680), False, 'from LumiGAN.logger import Logger\n'), ((4128, 4157), 'torch.manual_seed', 'torch.... |
# https://open.kattis.com/problems/batterup
import sys
int(input())
ns = sys.stdin.readline().split()
ns = map(int, ns)
ns = list(filter(lambda a: a != -1, ns))
print(sum(ns) / len(ns)) | [
"sys.stdin.readline"
] | [((76, 96), 'sys.stdin.readline', 'sys.stdin.readline', ([], {}), '()\n', (94, 96), False, 'import sys\n')] |
import ipaddress
import logging
LOG = logging.getLogger(__name__)
class IPAddress(object):
def __init__(self, ip: str):
self.__json = ip
self.ip = None
self.ip_subnet = None
self.version = 0
self.ip_reverse_pointer = None
self.subnet_or_ip(ip)
def subnet_or_ip... | [
"ipaddress.ip_network",
"ipaddress.ip_address",
"logging.getLogger"
] | [((39, 66), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (56, 66), False, 'import logging\n'), ((839, 863), 'ipaddress.ip_address', 'ipaddress.ip_address', (['ip'], {}), '(ip)\n', (859, 863), False, 'import ipaddress\n'), ((1150, 1181), 'ipaddress.ip_network', 'ipaddress.ip_network', ([... |
# -*- coding: utf-8 -*-
from gi.repository import Gtk
from manyssh.about import About
class Toolbar(Gtk.Toolbar):
"""
ManySSH toolbar.
"""
def __init__(self, win, *args, **kwargs):
"""
:param win: ManySSH window
:type win: manyssh.win.Window
"""
super(Toolbar... | [
"gi.repository.Gtk.ToolButton.new_from_stock",
"manyssh.about.About"
] | [((377, 425), 'gi.repository.Gtk.ToolButton.new_from_stock', 'Gtk.ToolButton.new_from_stock', (['Gtk.STOCK_CONVERT'], {}), '(Gtk.STOCK_CONVERT)\n', (406, 425), False, 'from gi.repository import Gtk\n'), ((668, 716), 'gi.repository.Gtk.ToolButton.new_from_stock', 'Gtk.ToolButton.new_from_stock', (['Gtk.STOCK_REFRESH'], ... |
import os
from fastapi import FastAPI
import logging
from motor.motor_asyncio import (
AsyncIOMotorClient,
AsyncIOMotorCollection,
AsyncIOMotorDatabase,
)
from odmantic.engine import AIOEngine
from app.core.config import MONGODB_DB_TEST, MONGODB_URI, MONGODB_DB, MONGODB_URI_TEST
logger = logging.getLogg... | [
"odmantic.engine.AIOEngine",
"os.environ.get",
"logging.info",
"motor.motor_asyncio.AsyncIOMotorClient",
"logging.getLogger"
] | [((305, 332), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (322, 332), False, 'import logging\n'), ((1579, 1626), 'logging.info', 'logging.info', (['"""Close mongodb client connection"""'], {}), "('Close mongodb client connection')\n", (1591, 1626), False, 'import logging\n'), ((429, 45... |
'''
# tests/test_fantasymath.py
'''
import logging
import random
import sys
import unittest
from nflfantasy.fantasymath import Scraper, Parser
class fantasymath_test(unittest.TestCase):
'''
Tests DRAFT.com scraper, parser, agent
'''
def setUp(self):
self.s = Scraper()
self.p = Par... | [
"unittest.main",
"random.randint",
"logging.basicConfig",
"nflfantasy.fantasymath.Scraper",
"nflfantasy.fantasymath.Parser"
] | [((1075, 1133), 'logging.basicConfig', 'logging.basicConfig', ([], {'stream': 'sys.stdout', 'level': 'logging.INFO'}), '(stream=sys.stdout, level=logging.INFO)\n', (1094, 1133), False, 'import logging\n'), ((1138, 1153), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1151, 1153), False, 'import unittest\n'), ((29... |
from bge import logic
import math
import mathutils
scene = logic.getCurrentScene()
class PlayerOrientationManager:
def __init__(self):
pass
def linearOrient(player, target):
pass
def orient_player(self, player):
if (player.targetManager.active == False):
orientController = scene.objects['orientControlle... | [
"bge.logic.getCurrentController",
"bge.logic.getCurrentScene",
"math.degrees",
"math.atan2"
] | [((60, 83), 'bge.logic.getCurrentScene', 'logic.getCurrentScene', ([], {}), '()\n', (81, 83), False, 'from bge import logic\n'), ((979, 1007), 'bge.logic.getCurrentController', 'logic.getCurrentController', ([], {}), '()\n', (1005, 1007), False, 'from bge import logic\n'), ((433, 459), 'math.atan2', 'math.atan2', (['x_... |
# -*- coding: utf-8 -*-
import numpy
from scipy import spatial
from numpy import matrix
from math import sqrt
from panda3d.core import Point3, TransformState
from panda3d.bullet import BulletSphereShape, BulletRigidBodyNode
from random import uniform, gauss, random
from time import time
import math
from cellpack.mgl_... | [
"cellpack.autopack.helper.toggleDisplay",
"numpy.sum",
"panda3d.bullet.BulletRigidBodyNode",
"numpy.ones",
"panda3d.core.Point3",
"panda3d.bullet.BulletSphereShape",
"numpy.arange",
"scipy.spatial.cKDTree",
"random.gauss",
"cellpack.autopack.helper.host.find",
"numpy.copy",
"math.radians",
"... | [((4183, 4200), 'numpy.identity', 'numpy.identity', (['(4)'], {}), '(4)\n', (4197, 4200), False, 'import numpy\n'), ((7186, 7224), 'numpy.ones', 'numpy.ones', (['self.sphere_points_nb', '"""i"""'], {}), "(self.sphere_points_nb, 'i')\n", (7196, 7224), False, 'import numpy\n'), ((14265, 14303), 'cellpack.autopack.ldSeque... |
#!/usr/bin/env python
from dipy.data import get_sphere
from nose.tools import assert_equal
import numpy as np
from scipy.spatial.distance import (cosine, euclidean, mahalanobis)
from scipy.special import logsumexp, softmax
import torch
from torch.nn.utils.rnn import PackedSequence
from dwi_ml.models.direction_getter_m... | [
"numpy.random.seed",
"dwi_ml.models.direction_getter_models.GaussianMixtureDirectionGetter",
"numpy.allclose",
"dipy.data.get_sphere",
"scipy.spatial.distance.mahalanobis",
"numpy.random.randint",
"dwi_ml.models.direction_getter_models.SingleGaussianDirectionGetter",
"dwi_ml.models.utils.fisher_von_mi... | [((1863, 1887), 'numpy.random.randint', 'np.random.randint', (['(1)', '(10)'], {}), '(1, 10)\n', (1880, 1887), True, 'import numpy as np\n'), ((2752, 2773), 'numpy.asarray', 'np.asarray', (['mean_loss'], {}), '(mean_loss)\n', (2762, 2773), True, 'import numpy as np\n'), ((2815, 2835), 'numpy.random.seed', 'np.random.se... |
from __future__ import print_function
import torch
import torch.nn as nn
#from torchvision import datasets, transforms
from sklearn.datasets import load_iris, load_breast_cancer
from sklearn.model_selection import train_test_split
from torch.utils.data import TensorDataset, SubsetRandomSampler
from torch import Tensor
... | [
"sklearn.datasets.load_iris",
"torch.eye",
"sklearn.model_selection.train_test_split",
"torch.randn",
"torch.mm",
"torch.utils.data.TensorDataset",
"torch.no_grad",
"torch.nn.MSELoss",
"torch.nn.BCELoss",
"torch.utils.data.DataLoader",
"torch.Tensor",
"torch.zeros",
"torch.matmul",
"math.s... | [((1754, 1765), 'sklearn.datasets.load_iris', 'load_iris', ([], {}), '()\n', (1763, 1765), False, 'from sklearn.datasets import load_iris, load_breast_cancer\n'), ((1878, 1915), 'sklearn.model_selection.train_test_split', 'train_test_split', (['X', 'y'], {'test_size': '(0.1)'}), '(X, y, test_size=0.1)\n', (1894, 1915),... |
import pytest
from main import plot,format_eq, validEq
plot("x")
def plot_test():
x = "x+2"
assert plot(x)
def format_eq_test():
assert format_eq()
def validEq_test():
assert validEq()
| [
"main.validEq",
"main.plot",
"main.format_eq"
] | [((61, 70), 'main.plot', 'plot', (['"""x"""'], {}), "('x')\n", (65, 70), False, 'from main import plot, format_eq, validEq\n'), ((120, 127), 'main.plot', 'plot', (['x'], {}), '(x)\n', (124, 127), False, 'from main import plot, format_eq, validEq\n'), ((167, 178), 'main.format_eq', 'format_eq', ([], {}), '()\n', (176, 1... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from peewee import FloatField, BlobField, ForeignKeyField
from .base import BaseModel
from .challenge_set import ChallengeSet
from .crash import Crash
from .job import Job
from ..peewee_extensions import EnumField... | [
"peewee.BlobField",
"peewee.ForeignKeyField",
"peewee.FloatField"
] | [((403, 457), 'peewee.ForeignKeyField', 'ForeignKeyField', (['ChallengeSet'], {'related_name': '"""exploits"""'}), "(ChallengeSet, related_name='exploits')\n", (418, 457), False, 'from peewee import FloatField, BlobField, ForeignKeyField\n'), ((468, 513), 'peewee.ForeignKeyField', 'ForeignKeyField', (['Job'], {'related... |
import os
import re
#get the path of every file in every directory and subdirectory
for root, dirs, files in os.walk("."):
for file in files:
if file == "archive_filelist.csv":
os.remove(os.path.join(root, file))
continue
filename = os.path.join(root,file)
#renam... | [
"os.walk",
"os.path.join",
"re.sub"
] | [((110, 122), 'os.walk', 'os.walk', (['"""."""'], {}), "('.')\n", (117, 122), False, 'import os\n'), ((281, 305), 'os.path.join', 'os.path.join', (['root', 'file'], {}), '(root, file)\n', (293, 305), False, 'import os\n'), ((214, 238), 'os.path.join', 'os.path.join', (['root', 'file'], {}), '(root, file)\n', (226, 238)... |
import os
from . import locked as locked_repo
from dvc.repo.scm_context import scm_context
from dvc.utils import resolve_output, resolve_paths, relpath
from dvc.utils.fs import path_isin
@locked_repo
@scm_context
def imp_url(self, url, out=None, fname=None, erepo=None, locked=True):
from dvc.dvcfile import Dvcfi... | [
"os.path.abspath",
"dvc.dvcfile.Dvcfile",
"dvc.stage.Stage.create",
"os.path.exists",
"dvc.utils.resolve_paths",
"dvc.utils.relpath",
"dvc.utils.resolve_output"
] | [((366, 390), 'dvc.utils.resolve_output', 'resolve_output', (['url', 'out'], {}), '(url, out)\n', (380, 390), False, 'from dvc.utils import resolve_output, resolve_paths, relpath\n'), ((413, 437), 'dvc.utils.resolve_paths', 'resolve_paths', (['self', 'out'], {}), '(self, out)\n', (426, 437), False, 'from dvc.utils impo... |
'''
Using code learnt from https://www.datacamp.com/community/tutorials
'''
from sklearn import datasets, svm, metrics
import numpy as np
import matplotlib.pyplot as plt
import random
from sklearn.model_selection import train_test_split
# import minst dataset
b = datasets.load_digits()
# print out the number and l... | [
"sklearn.datasets.load_digits",
"matplotlib.pyplot.show",
"matplotlib.pyplot.get_cmap",
"random.randint",
"sklearn.svm.SVC",
"matplotlib.pyplot.imshow",
"sklearn.model_selection.train_test_split",
"sklearn.metrics.accuracy_score",
"numpy.argsort",
"numpy.random.choice"
] | [((268, 290), 'sklearn.datasets.load_digits', 'datasets.load_digits', ([], {}), '()\n', (288, 290), False, 'from sklearn import datasets, svm, metrics\n'), ((580, 617), 'random.randint', 'random.randint', (['(0)', 'number_of_examples'], {}), '(0, number_of_examples)\n', (594, 617), False, 'import random\n'), ((680, 700... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
from PyQt5.QtWidgets import QApplication, QWidget
app = QApplication([])
mw = QWidget()
rect = mw.frameGeometry()
center = app.desktop().availableGeometry().center() # This is where QDesktopWidget is used
rect.moveCenter(center)
mw.move(rect... | [
"PyQt5.QtWidgets.QApplication",
"PyQt5.QtWidgets.QWidget"
] | [((132, 148), 'PyQt5.QtWidgets.QApplication', 'QApplication', (['[]'], {}), '([])\n', (144, 148), False, 'from PyQt5.QtWidgets import QApplication, QWidget\n'), ((155, 164), 'PyQt5.QtWidgets.QWidget', 'QWidget', ([], {}), '()\n', (162, 164), False, 'from PyQt5.QtWidgets import QApplication, QWidget\n')] |
from mixcoatl.resource import Resource
from mixcoatl.decorators.lazy import lazy_property
from mixcoatl.decorators.validations import required_attrs
from mixcoatl.utils import uncamel, camelize, camel_keys, uncamel_keys
import json
class ConfigurationManagementSystem(Resource):
"""A configuration management syst... | [
"mixcoatl.utils.uncamel",
"mixcoatl.resource.Resource",
"mixcoatl.resource.Resource.__init__",
"mixcoatl.utils.uncamel_keys",
"mixcoatl.utils.camelize"
] | [((992, 1034), 'mixcoatl.resource.Resource.__init__', 'Resource.__init__', (['self'], {'endpoint': 'endpoint'}), '(self, endpoint=endpoint)\n', (1009, 1034), False, 'from mixcoatl.resource import Resource\n'), ((1108, 1145), 'mixcoatl.resource.Resource', 'Resource', (['cls.PATH'], {'endpoint': 'endpoint'}), '(cls.PATH,... |
import xml.etree.ElementTree as ET
import requests
import json
import logging
import settings
class WFSClient:
RESPONSE_NAMESPACE = {"wfs": "http://www.opengis.net/wfs",
"ogc": "http://www.opengis.net/ogc",
"ows": "http://www.opengis.net/ows"
... | [
"logging.debug",
"json.loads",
"logging.basicConfig",
"xml.etree.ElementTree.fromstring",
"xml.etree.ElementTree.register_namespace",
"xml.etree.ElementTree.Element",
"xml.etree.ElementTree.SubElement",
"requests.get",
"xml.etree.ElementTree.tostring",
"requests.post"
] | [((647, 719), 'logging.basicConfig', 'logging.basicConfig', ([], {'filename': '"""/var/tmp/plugin.log"""', 'level': 'logging.DEBUG'}), "(filename='/var/tmp/plugin.log', level=logging.DEBUG)\n", (666, 719), False, 'import logging\n'), ((782, 842), 'xml.etree.ElementTree.Element', 'ET.Element', (['"""wfs:Transaction"""']... |
import os,json
from datacite import DataCiteMDSClient, schema40
def create_doi(metadata,url):
password = os.environ['DATACITE']
prefix = '10.33569'
# Initialize the MDS client.
d = DataCiteMDSClient(
username='CALTECH.LIBRARY',
password=password,
prefix=prefix,
... | [
"json.load",
"datacite.schema40.tostring",
"datacite.DataCiteMDSClient",
"datacite.schema40.validate",
"datacite.schema40.validator.validate"
] | [((201, 322), 'datacite.DataCiteMDSClient', 'DataCiteMDSClient', ([], {'username': '"""CALTECH.LIBRARY"""', 'password': 'password', 'prefix': 'prefix', 'url': '"""https://mds.test.datacite.org"""'}), "(username='CALTECH.LIBRARY', password=password, prefix=\n prefix, url='https://mds.test.datacite.org')\n", (218, 322... |
import copy
import logging
import os
import pytest
import tifftools
from .datastore import datastore
LOGGER = logging.getLogger('tifftools')
def test_write_already_exists(tmp_path):
path = datastore.fetch('d043-200.tif')
info = tifftools.read_tiff(path)
destpath = tmp_path / 'sample.tiff'
tifftool... | [
"copy.deepcopy",
"os.path.getsize",
"os.path.dirname",
"tifftools.write_tiff",
"pytest.raises",
"tifftools.read_tiff",
"logging.getLogger"
] | [((114, 144), 'logging.getLogger', 'logging.getLogger', (['"""tifftools"""'], {}), "('tifftools')\n", (131, 144), False, 'import logging\n'), ((242, 267), 'tifftools.read_tiff', 'tifftools.read_tiff', (['path'], {}), '(path)\n', (261, 267), False, 'import tifftools\n'), ((312, 348), 'tifftools.write_tiff', 'tifftools.w... |
import intern
from intern.remote.boss import BossRemote
from intern.resource.boss.resource import ChannelResource
from intern.remote.dvid import DVIDRemote
import matplotlib.pyplot as plt
import numpy as np
# BOSS Data fetch:
boss = BossRemote({
"protocol": "https",
"host": "api.theboss.io",
"token": "db1... | [
"matplotlib.pyplot.imshow",
"intern.remote.boss.BossRemote",
"matplotlib.pyplot.show",
"intern.remote.dvid.DVIDRemote"
] | [((235, 351), 'intern.remote.boss.BossRemote', 'BossRemote', (["{'protocol': 'https', 'host': 'api.theboss.io', 'token':\n 'db1cec2c865fc84e48772f4f4a5f010c0a180b88'}"], {}), "({'protocol': 'https', 'host': 'api.theboss.io', 'token':\n 'db1cec2c865fc84e48772f4f4a5f010c0a180b88'})\n", (245, 351), False, 'from inte... |
from collections import abc
from typing import Union
import sqlalchemy as sa
from .base import Operation
from jessiql.sainfo.columns import resolve_column_by_name
from jessiql.query_object import SortQuery, SortingDirection
from jessiql.typing import SAModelOrAlias, SAAttribute
from jessiql.util.expressions import js... | [
"jessiql.util.expressions.json_field_subpath_as_text",
"jessiql.sainfo.columns.resolve_column_by_name"
] | [((2034, 2088), 'jessiql.sainfo.columns.resolve_column_by_name', 'resolve_column_by_name', (['field.name', 'Model'], {'where': 'where'}), '(field.name, Model, where=where)\n', (2056, 2088), False, 'from jessiql.sainfo.columns import resolve_column_by_name\n'), ((2237, 2285), 'jessiql.util.expressions.json_field_subpath... |
from idunn import settings
from idunn.places import POI, Place
from idunn.utils.es_wrapper import get_elasticsearch
from idunn.datasources.mimirsbrunn import fetch_es_poi
def get_poi(id: str, lang: str = None) -> Place:
"""Handler that returns points-of-interest"""
es = get_elasticsearch()
if not lang:
... | [
"idunn.places.POI",
"idunn.datasources.mimirsbrunn.fetch_es_poi",
"idunn.utils.es_wrapper.get_elasticsearch"
] | [((281, 300), 'idunn.utils.es_wrapper.get_elasticsearch', 'get_elasticsearch', ([], {}), '()\n', (298, 300), False, 'from idunn.utils.es_wrapper import get_elasticsearch\n'), ((400, 420), 'idunn.datasources.mimirsbrunn.fetch_es_poi', 'fetch_es_poi', (['id', 'es'], {}), '(id, es)\n', (412, 420), False, 'from idunn.datas... |
"""
Created on May 17, 2016
@author: xiul, t-zalipt
"""
import json
import ast
from deep_dialog import dialog_config
from deep_dialog.agents import DQNAgent
from deep_dialog.dialog_system import StateTracker
from deep_dialog.nlg import nlg
from deep_dialog.nlu.nlu_ensemble_predict import *
class Comp... | [
"deep_dialog.nlg.nlg",
"deep_dialog.dialog_system.StateTracker",
"deep_dialog.agents.DQNAgent"
] | [((524, 596), 'deep_dialog.agents.DQNAgent', 'DQNAgent', (['movie_dictionary', 'act_set', 'slot_set', 'params'], {'phase': '"""inference"""'}), "(movie_dictionary, act_set, slot_set, params, phase='inference')\n", (532, 596), False, 'from deep_dialog.agents import DQNAgent\n'), ((693, 742), 'deep_dialog.dialog_system.S... |
"""
.. module:: _test_deliver_data
:synopsis: Test module for deliver_data.py
.. moduleauthor:: <NAME> <<EMAIL>>
"""
import gzip
import os
import unittest
import deliver_data
#--------------------
class TestGetDataKepler(unittest.TestCase):
""" Main test class. """
reference_file_path = "unit_test_reffi... | [
"unittest.main",
"gzip.open",
"deliver_data.deliver_data",
"unittest.skip",
"os.path.isfile"
] | [((1694, 1765), 'unittest.skip', 'unittest.skip', (['"""Skipping test of two Kepler lightcurves - unsupported."""'], {}), "('Skipping test of two Kepler lightcurves - unsupported.')\n", (1707, 1765), False, 'import unittest\n'), ((20374, 20389), 'unittest.main', 'unittest.main', ([], {}), '()\n', (20387, 20389), False,... |
import time
from riglib import blackrock
channels = [5, 6, 7, 8]
obj = blackrock.Spikes(channels)
obj.start()
for i in range(10):
print(obj.get())
time.sleep(0.01)
| [
"riglib.blackrock.Spikes",
"time.sleep"
] | [((72, 98), 'riglib.blackrock.Spikes', 'blackrock.Spikes', (['channels'], {}), '(channels)\n', (88, 98), False, 'from riglib import blackrock\n'), ((158, 174), 'time.sleep', 'time.sleep', (['(0.01)'], {}), '(0.01)\n', (168, 174), False, 'import time\n')] |
from __future__ import annotations
from abc import ABC
import ast
from ast import Expression, Constant, Name
from ast import Tuple as AstTuple
from dataclasses import dataclass
from typing import Any, Optional
_PREDEFINED_CASE = object()
_DEFAULT_KEYWORD = "case"
__all__ = ["__annotations__", "Switch", "default"]
... | [
"ast.parse",
"dataclasses.dataclass"
] | [((396, 418), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (405, 418), False, 'from dataclasses import dataclass\n'), ((2783, 2810), 'ast.parse', 'ast.parse', (['val'], {'mode': '"""eval"""'}), "(val, mode='eval')\n", (2792, 2810), False, 'import ast\n')] |
import os
import pytest
import pandas as pd
from stadtradeln_data_tools.pandas_importer import load_csv, write_csv
@pytest.fixture
def csv_filename():
filename = "test.csv"
df = pd.DataFrame({'edge_geo': ['LINESTRING(0 0,0 1)',
'LINESTRING(0 1,1 1)',
... | [
"pandas.DataFrame",
"os.remove",
"stadtradeln_data_tools.pandas_importer.load_csv",
"stadtradeln_data_tools.pandas_importer.write_csv"
] | [((188, 346), 'pandas.DataFrame', 'pd.DataFrame', (["{'edge_geo': ['LINESTRING(0 0,0 1)', 'LINESTRING(0 1,1 1)',\n 'LINESTRING(1 1,1 0)', 'LINESTRING(1 0,0 0)'], 'occurrences': [3, 4, 5, 6]}"], {}), "({'edge_geo': ['LINESTRING(0 0,0 1)', 'LINESTRING(0 1,1 1)',\n 'LINESTRING(1 1,1 0)', 'LINESTRING(1 0,0 0)'], 'occ... |
#!/home/raytech/gitdemo/facedetect/venv/bin/python3
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| [
"django.core.management.execute_from_command_line"
] | [((119, 157), 'django.core.management.execute_from_command_line', 'management.execute_from_command_line', ([], {}), '()\n', (155, 157), False, 'from django.core import management\n')] |
import functools
from soup_language import *
from language_server import server
def two_counters(max=1):
# create the two actions
def inc(key, env):
env[key] = env[key] + 1
def reset(key, env):
env[key] = 0
# define the guard/action behaviors
i0 = Behavior(lambda env: env['a'] < ... | [
"functools.partial"
] | [((325, 352), 'functools.partial', 'functools.partial', (['inc', '"""a"""'], {}), "(inc, 'a')\n", (342, 352), False, 'import functools\n'), ((410, 439), 'functools.partial', 'functools.partial', (['reset', '"""a"""'], {}), "(reset, 'a')\n", (427, 439), False, 'import functools\n'), ((499, 526), 'functools.partial', 'fu... |
# Generated by Django 3.0.8 on 2020-10-23 13:46
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('account', '0004_auto_20201023_1340'),
]
operations = [
migrations.RemoveField(
model_name='passwordresetlog',
name='ensure',... | [
"django.db.migrations.RemoveField"
] | [((227, 295), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""passwordresetlog"""', 'name': '"""ensure"""'}), "(model_name='passwordresetlog', name='ensure')\n", (249, 295), False, 'from django.db import migrations\n')] |
# coding=utf-8
"""
Usage:
python3 -m pyku
Commands:
deploy - create and deploys a channel archive to Roku(s)
Flags:
-c, --channel - Path to channel to be deployed, REQUIRED
--skip-discovery - skip device discovery and use only device designated in config
keypress - simulates a remote ... | [
"pyku.utils.get_selected_from_config",
"pyku.channel.Channel",
"click.confirm",
"click.option",
"click.echo",
"click.Path",
"click.group",
"pyku.utils.run_device_discovery"
] | [((750, 763), 'click.group', 'click.group', ([], {}), '()\n', (761, 763), False, 'import click\n'), ((1115, 1182), 'click.option', 'click.option', (['"""--skip-discovery"""', '"""skip_discovery"""'], {'flag_value': '(True)'}), "('--skip-discovery', 'skip_discovery', flag_value=True)\n", (1127, 1182), False, 'import cli... |
#!/usr/bin/python
#
# Copyright 2019 Polyaxon, 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 o... | [
"rhea.ConfigSpec",
"hestia.user_path.polyaxon_user_path",
"polyaxon.schemas.api.authentication.AccessTokenConfig.from_dict",
"polyaxon.schemas.cli.client_configuration.ClientConfig.from_dict",
"os.path.join"
] | [((1186, 1206), 'hestia.user_path.polyaxon_user_path', 'polyaxon_user_path', ([], {}), '()\n', (1204, 1206), False, 'from hestia.user_path import polyaxon_user_path\n'), ((1224, 1272), 'os.path.join', 'os.path.join', (['TMP_POLYAXON_PATH', '""".polyaxonauth"""'], {}), "(TMP_POLYAXON_PATH, '.polyaxonauth')\n", (1236, 12... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import pickle
import sys
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import gridspec
# TODO: store in pandas dataframe
class Journal:
"""Journal.
Class for representing the Hodgkin-Huxley model.
All model parameters can b... | [
"matplotlib.pyplot.subplot",
"pickle.dump",
"matplotlib.pyplot.show",
"numpy.ceil",
"numpy.asarray",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.rcParams.update",
"pickle.load",
"matplotlib.pyplot.rc",
"numpy.mean",
"matplotlib.pyplot.gca",
"matplotlib.gridspec... | [((6530, 6557), 'matplotlib.pyplot.rcParams.update', 'plt.rcParams.update', (['params'], {}), '(params)\n', (6549, 6557), True, 'import matplotlib.pyplot as plt\n'), ((6566, 6593), 'matplotlib.pyplot.rc', 'plt.rc', (['"""text"""'], {'usetex': '(True)'}), "('text', usetex=True)\n", (6572, 6593), True, 'import matplotlib... |
import os
import subprocess
def update(token=None):
if token is None:
token = os.environ["STATUS_GH_TOKEN"]
subprocess.check_call([
"statuspage",
"update",
"--org",
"conda-forge",
"--name",
"status",
"--token",
token
])
def main():... | [
"argparse.ArgumentParser",
"subprocess.check_call"
] | [((127, 240), 'subprocess.check_call', 'subprocess.check_call', (["['statuspage', 'update', '--org', 'conda-forge', '--name', 'status',\n '--token', token]"], {}), "(['statuspage', 'update', '--org', 'conda-forge',\n '--name', 'status', '--token', token])\n", (148, 240), False, 'import subprocess\n'), ((355, 433)... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
import logging
import falcon
from raven import Client, setup_logging
from raven.handlers.logging import SentryHandler
from raven.utils.encoding import to_unicode
from raven.utils.wsgi import get_environ
class Sentry(obje... | [
"raven.utils.encoding.to_unicode",
"raven.utils.wsgi.get_environ",
"raven.handlers.logging.SentryHandler"
] | [((2090, 2129), 'raven.handlers.logging.SentryHandler', 'SentryHandler', (['self.client'], {'level': 'level'}), '(self.client, level=level)\n', (2103, 2129), False, 'from raven.handlers.logging import SentryHandler\n'), ((4032, 4046), 'raven.utils.encoding.to_unicode', 'to_unicode', (['ex'], {}), '(ex)\n', (4042, 4046)... |
import math
from src.errors import *
class kinematics:
def __init__(self, kinvalues):
"""
:param kinvalues: dictionary of known values, used keys = ['X','X0','V','V0','A','T']
"""
self.values = kinvalues
self.solved = False
# calls calculate attributes to start th... | [
"math.sqrt"
] | [((2972, 3073), 'math.sqrt', 'math.sqrt', (["(self.values['V0'] ** 2 + 2 * self.values['A'] * (self.values['X'] - self.\n values['X0']))"], {}), "(self.values['V0'] ** 2 + 2 * self.values['A'] * (self.values['X'] -\n self.values['X0']))\n", (2981, 3073), False, 'import math\n')] |
import os
from core.response import get_response
# Very basic auth layer for certain slack function to only allow certain users actions to functions
def is_user_admin(client, user_id):
admin_emails = os.getenv('SLACK_ADMIN_EMAILS')
if admin_emails == None:
return False
user = client.users_profile... | [
"core.response.get_response",
"os.getenv"
] | [((205, 236), 'os.getenv', 'os.getenv', (['"""SLACK_ADMIN_EMAILS"""'], {}), "('SLACK_ADMIN_EMAILS')\n", (214, 236), False, 'import os\n'), ((622, 764), 'core.response.get_response', 'get_response', (['"""SLACK_AUTHENTICATION_ERROR"""', "{'message':\n f'User: {user_id} is not an admin in call to {func.__name__}. Abor... |
# Generated by Django 3.2 on 2021-04-19 15:39
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('books', '0002_rename_authords_book_authors'),
]
operations = [
migrations.AlterField(
model_name=... | [
"django.db.models.ForeignKey",
"django.db.models.ManyToManyField"
] | [((374, 439), 'django.db.models.ManyToManyField', 'models.ManyToManyField', ([], {'related_name': '"""authors"""', 'to': '"""books.Author"""'}), "(related_name='authors', to='books.Author')\n", (396, 439), False, 'from django.db import migrations, models\n'), ((562, 669), 'django.db.models.ForeignKey', 'models.ForeignK... |
##########
import web
import hmac
from hashlib import sha256
from lib.utils import db, render, etherpad, memcache
from lib.validate import make_cookie
##########
class LoginPage:
def GET(self):
return render('login.html')
def POST(self):
uid = web.input().login_uid
pw = web.input()... | [
"hmac",
"lib.utils.memcache.set",
"web.input",
"lib.utils.render",
"web.seeother",
"lib.validate.make_cookie"
] | [((218, 238), 'lib.utils.render', 'render', (['"""login.html"""'], {}), "('login.html')\n", (224, 238), False, 'from lib.utils import db, render, etherpad, memcache\n'), ((274, 285), 'web.input', 'web.input', ([], {}), '()\n', (283, 285), False, 'import web\n'), ((309, 320), 'web.input', 'web.input', ([], {}), '()\n', ... |
from setuptools import setup
from os import path
import sys
if sys.version_info < (3, 6):
sys.exit('Sorry, Python < 3.6 is not supported')
here = path.abspath(path.dirname(__file__))
with open("README.md", "r") as fh:
long_description = fh.read()
requires = [
'requests==2.24.0',
'keystoneauth1==3.17... | [
"os.path.dirname",
"setuptools.setup",
"sys.exit"
] | [((364, 678), 'setuptools.setup', 'setup', ([], {'name': '"""sels8s"""', 'version': '"""1.0.7"""', 'author_email': '"""<EMAIL>"""', 'description': '"""SDK for python serverless functions"""', 'long_description': 'long_description', 'long_description_content_type': '"""text/markdown"""', 'url': '"""https://github.com/se... |
from __future__ import print_function, division
from time import sleep
import pymongo
from monary import Monary
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from neuralnilm.consts import DATA_FOLD_NAMES
from neuralnilm.utils import get_colors
from neuralnilm.config import config
class Monito... | [
"pymongo.MongoClient",
"matplotlib.pyplot.title",
"pandas.DataFrame",
"monary.Monary",
"matplotlib.pyplot.show",
"neuralnilm.utils.get_colors",
"time.sleep",
"neuralnilm.config.config.get",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.subplots"
] | [((1051, 1087), 'pymongo.MongoClient', 'pymongo.MongoClient', (['self.mongo_host'], {}), '(self.mongo_host)\n', (1070, 1087), False, 'import pymongo\n'), ((2121, 2149), 'monary.Monary', 'Monary', ([], {'host': 'self.mongo_host'}), '(host=self.mongo_host)\n', (2127, 2149), False, 'from monary import Monary\n'), ((3040, ... |
from sqlalchemy.schema import FetchedValue
from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy.dialects.postgresql import UUID
from app.api.utils.models_mixins import SoftDeleteMixin, AuditMixin, Base
from app.extensions import db
from app.api.constants import PERMIT_EDIT_GROUP, PERMIT_AMENDM... | [
"app.extensions.db.ForeignKey",
"app.extensions.db.relationship",
"sqlalchemy.ext.associationproxy.association_proxy",
"app.extensions.db.Column",
"sqlalchemy.dialects.postgresql.UUID",
"sqlalchemy.schema.FetchedValue"
] | [((805, 841), 'app.extensions.db.Column', 'db.Column', (['db.String'], {'nullable': '(False)'}), '(db.String, nullable=False)\n', (814, 841), False, 'from app.extensions import db\n'), ((1103, 1123), 'app.extensions.db.Column', 'db.Column', (['db.String'], {}), '(db.String)\n', (1112, 1123), False, 'from app.extensions... |
#!/usr/bin/python
#-*- coding:utf-8 -*-
import sys
import struct
import numpy as np
import tensorflow as tf
import random
def matmul_f32():
para = []
dim0 = []
dim1 = []
# init the input data and parameters
dim_count = int(np.random.randint(4, high=6, size=1))
for i in range(0, dim_count-2):... | [
"tensorflow.Session",
"random.choice",
"numpy.shape",
"tensorflow.matmul",
"numpy.random.randint",
"numpy.random.normal"
] | [((926, 947), 'random.choice', 'random.choice', (['(0, 1)'], {}), '((0, 1))\n', (939, 947), False, 'import random\n'), ((962, 983), 'random.choice', 'random.choice', (['(0, 1)'], {}), '((0, 1))\n', (975, 983), False, 'import random\n'), ((1724, 1770), 'numpy.random.normal', 'np.random.normal', (['zero_point1', 'std1'],... |
from final_project.accounts.helpers import UserAndProfileData
from django import test as django_test
from django.contrib.auth import get_user_model
from django.urls import reverse
from final_project.accounts.helpers import UserAndProfileData
from final_project.accounts.models import Profile
from final_project.main.mod... | [
"final_project.main.models.Post.objects.create",
"final_project.main.models.Post.objects.first",
"final_project.main.models.Post.objects.get",
"final_project.accounts.models.Profile.objects.create",
"django.contrib.auth.get_user_model",
"django.urls.reverse"
] | [((423, 439), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (437, 439), False, 'from django.contrib.auth import get_user_model\n'), ((914, 974), 'final_project.accounts.models.Profile.objects.create', 'Profile.objects.create', ([], {'user': 'user'}), '(**self.VALID_PROFILE_DATA, user=user)\n... |
import sqlite3
class AdsDataBase:
def __init__(self):
self.database = sqlite3.connect('ads.db', check_same_thread = False)
self.c = self.database.cursor()
try:
self.c.execute("""create table ads
(number integer primary key,
name text,
image text,
pos_x real,
pos_y real)""")
except:
... | [
"sqlite3.connect"
] | [((74, 124), 'sqlite3.connect', 'sqlite3.connect', (['"""ads.db"""'], {'check_same_thread': '(False)'}), "('ads.db', check_same_thread=False)\n", (89, 124), False, 'import sqlite3\n')] |
# -*- coding: utf-8 -*-
import yaml
import sys
def load_yaml(file):
with open(file, encoding='utf-8') as f:
data = f.read()
return yaml.safe_load_all(data)
if __name__ == '__main__':
abc = load_yaml("./appinfo.yml")
for item in abc:
#print(item['project'].keys())
projects ... | [
"yaml.dump",
"yaml.safe_load_all"
] | [((153, 177), 'yaml.safe_load_all', 'yaml.safe_load_all', (['data'], {}), '(data)\n', (171, 177), False, 'import yaml\n'), ((3331, 3433), 'yaml.dump', 'yaml.dump', (['proj'], {'stream': 'sys.stdout', 'allow_unicode': '(True)', 'default_flow_style': '(False)', 'sort_keys': '(False)'}), '(proj, stream=sys.stdout, allow_u... |
import json
import pandas as pd
from pandas.io.json import json_normalize
import numpy as np
from bokeh.io import output_file, output_notebook, save
from bokeh.plotting import figure, show
from bokeh.models import ColumnDataSource, LabelSet
from bokeh.layouts import row, column, gridplot
from bokeh.models.wid... | [
"bokeh.io.output_file",
"pandas.io.json.json_normalize",
"json.load"
] | [((1695, 1731), 'bokeh.io.output_file', 'output_file', (['out_html'], {'mode': '"""inline"""'}), "(out_html, mode='inline')\n", (1706, 1731), False, 'from bokeh.io import output_file, output_notebook, save\n'), ((703, 738), 'pandas.io.json.json_normalize', 'pd.io.json.json_normalize', (["j['Log']"], {}), "(j['Log'])\n"... |
import socket
import cv2
import numpy
from io import BytesIO
from PIL import Image
import struct
IP = "localhost"
PORT = 9999
address = (IP, PORT)
HEADSIZE = 12
def byte_to_img(byte):
str_buf = BytesIO(byte)
img = numpy.array(Image.open(str_buf))
str_buf.close()
return img
def receive2(process=None... | [
"io.BytesIO",
"cv2.waitKey",
"socket.socket",
"struct.unpack",
"cv2.imshow",
"PIL.Image.open",
"cv2.destroyAllWindows"
] | [((201, 214), 'io.BytesIO', 'BytesIO', (['byte'], {}), '(byte)\n', (208, 214), False, 'from io import BytesIO\n'), ((353, 402), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (366, 402), False, 'import socket\n'), ((1399, 1422), 'cv2.destroyAl... |
from pubnub.endpoints.objects_v2.objects_endpoint import ObjectsEndpoint, \
IncludeCustomEndpoint, UuidEndpoint
from pubnub.enums import PNOperationType
from pubnub.enums import HttpMethod
from pubnub.models.consumer.objects_v2.uuid import PNGetUUIDMetadataResult
class GetUuid(ObjectsEndpoint, UuidEndpoint, Inclu... | [
"pubnub.endpoints.objects_v2.objects_endpoint.IncludeCustomEndpoint.__init__",
"pubnub.models.consumer.objects_v2.uuid.PNGetUUIDMetadataResult",
"pubnub.endpoints.objects_v2.objects_endpoint.UuidEndpoint.__init__",
"pubnub.endpoints.objects_v2.objects_endpoint.ObjectsEndpoint.__init__"
] | [((425, 463), 'pubnub.endpoints.objects_v2.objects_endpoint.ObjectsEndpoint.__init__', 'ObjectsEndpoint.__init__', (['self', 'pubnub'], {}), '(self, pubnub)\n', (449, 463), False, 'from pubnub.endpoints.objects_v2.objects_endpoint import ObjectsEndpoint, IncludeCustomEndpoint, UuidEndpoint\n'), ((472, 499), 'pubnub.end... |
# !/usr/bin/python
# -*- coding:utf-8 -*-
# Author: <NAME>
# Created Time: 2019-09-11 10:25:23
'''
BEGIN
function:
API
return:
code:0 success
END
'''
import tornado.ioloop
import tornado.web
from tornado.options import define, options, parse_command_line
from atm import settings
from atm.shortcuts import get_... | [
"tornado.options.define",
"atm.shortcuts.get_routes",
"tornado.options.parse_command_line"
] | [((328, 371), 'tornado.options.define', 'define', (['"""host"""'], {'default': '"""0.0.0.0"""', 'type': 'str'}), "('host', default='0.0.0.0', type=str)\n", (334, 371), False, 'from tornado.options import define, options, parse_command_line\n'), ((372, 410), 'tornado.options.define', 'define', (['"""port"""'], {'default... |
# Generated by Django 3.1.4 on 2021-01-06 06:24
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('problem', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='problem',
name='rating',
... | [
"django.db.models.IntegerField"
] | [((326, 359), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'default': '(5000)'}), '(default=5000)\n', (345, 359), False, 'from django.db import migrations, models\n')] |
#!/usr/bin/env python
# encoding: utf-8
import struct
from numpy import (
int32, int64, float32, float64,
int8, uint8, int16, uint16, uint32, uint64, frombuffer
)
import struct
_const = {
'i32.const': int32,
'i64.const': int64,
'f32,const': float32,
'f64.const': float64,
}
_binary = {
# 3... | [
"numpy.uint32",
"numpy.uint64",
"math.sqrt",
"numpy.frombuffer",
"struct.unpack",
"struct.pack",
"time.sleep",
"numpy.int32",
"numpy.int64",
"numpy.float64"
] | [((362, 374), 'numpy.int32', 'int32', (['(x + y)'], {}), '(x + y)\n', (367, 374), False, 'from numpy import int32, int64, float32, float64, int8, uint8, int16, uint16, uint32, uint64, frombuffer\n'), ((404, 416), 'numpy.int32', 'int32', (['(x - y)'], {}), '(x - y)\n', (409, 416), False, 'from numpy import int32, int64,... |
#!/usr/bin/env python
from distutils.core import setup
setup(
name="test_package",
version="1.0.2",
packages=[
"Jinja2==2.7.2",
],
) | [
"distutils.core.setup"
] | [((57, 128), 'distutils.core.setup', 'setup', ([], {'name': '"""test_package"""', 'version': '"""1.0.2"""', 'packages': "['Jinja2==2.7.2']"}), "(name='test_package', version='1.0.2', packages=['Jinja2==2.7.2'])\n", (62, 128), False, 'from distutils.core import setup\n')] |
import collections
class Solver:
def __init__(self):
"""
__init__ --> Initializes a list for the instance to save
all the regions that formed the pact with SPACE region
"""
self.kingdoms_pact_forged_with = list()
def __check_if_won_over_kingdom(
self, to_kingdo... | [
"collections.Counter"
] | [((1170, 1205), 'collections.Counter', 'collections.Counter', (['encoded_string'], {}), '(encoded_string)\n', (1189, 1205), False, 'import collections\n')] |
import os
from pal.generator.abstract_generator import AbstractGenerator
from pal.logger import logger
from pal.config import config
from pal.exception import PalGeneratorException
from pal.filter import filters
from pal.transform import transforms
import pal.gadget
class CHeaderGenerator(AbstractGenerator):
def... | [
"os.path.abspath",
"pal.exception.PalGeneratorException"
] | [((2026, 2055), 'os.path.abspath', 'os.path.abspath', (['outfile_path'], {}), '(outfile_path)\n', (2041, 2055), False, 'import os\n'), ((2468, 2494), 'pal.exception.PalGeneratorException', 'PalGeneratorException', (['msg'], {}), '(msg)\n', (2489, 2494), False, 'from pal.exception import PalGeneratorException\n')] |
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | [
"aiida.orm.data.base.Str",
"aiida.orm.data.base.Bool",
"aiida.orm.data.base.Float",
"aiida.orm.data.base.Int"
] | [((936, 947), 'aiida.orm.data.base.Bool', 'Bool', (['value'], {}), '(value)\n', (940, 947), False, 'from aiida.orm.data.base import BaseType, Int, Bool, Float, Str\n'), ((1004, 1014), 'aiida.orm.data.base.Int', 'Int', (['value'], {}), '(value)\n', (1007, 1014), False, 'from aiida.orm.data.base import BaseType, Int, Boo... |
import os
import unittest
from pychemia import pcm_log, HAS_PYMONGO
from pychemia.population import NonCollinearMagMoms
from pychemia.searcher import HarmonySearch, FireFly, GeneticAlgorithm
from .local_mongo import has_local_mongo
import logging
class SearcherTest(unittest.TestCase):
def test_harmony(self):
... | [
"pychemia.population.NonCollinearMagMoms",
"logging.basicConfig",
"pychemia.pcm_log.debug",
"pychemia.searcher.HarmonySearch",
"os.path.isfile",
"pychemia.searcher.FireFly",
"pychemia.searcher.GeneticAlgorithm"
] | [((419, 459), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG'}), '(level=logging.DEBUG)\n', (438, 459), False, 'import logging\n'), ((648, 678), 'pychemia.pcm_log.debug', 'pcm_log.debug', (['"""HarmonySearch"""'], {}), "('HarmonySearch')\n", (661, 678), False, 'from pychemia import pcm_log,... |
# -*- coding: utf8 -*-
#!/usr/bin/python
#encoding:utf-8
import urllib
from bs4 import BeautifulSoup
url = "http://www.thsrc.com.tw/tw/TimeTable/SearchResult"
request = urllib.request.Request(url)
request.add_header("User-Agent","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/537.36 (KHTML, like Gecko)... | [
"bs4.BeautifulSoup",
"urllib.request.Request",
"urllib.request.urlopen",
"urllib.parse.urlencode"
] | [((172, 199), 'urllib.request.Request', 'urllib.request.Request', (['url'], {}), '(url)\n', (194, 199), False, 'import urllib\n'), ((796, 843), 'urllib.request.urlopen', 'urllib.request.urlopen', (['request'], {'data': 'form_data'}), '(request, data=form_data)\n', (818, 843), False, 'import urllib\n'), ((874, 908), 'bs... |
from PIL import Image
from UPL.Core import file_exists
"""
Converts any image file to an icon file
"""
def img2ico(infile, outfile, sizes=[(48,48)]):
if outfile.endswith(".ico"):
if file_exists(infile):
img = Image.open(infile)
img.save(outfile, sizes=sizes)
else:
return f"{infile} does not... | [
"UPL.Core.file_exists",
"PIL.Image.open"
] | [((194, 213), 'UPL.Core.file_exists', 'file_exists', (['infile'], {}), '(infile)\n', (205, 213), False, 'from UPL.Core import file_exists\n'), ((225, 243), 'PIL.Image.open', 'Image.open', (['infile'], {}), '(infile)\n', (235, 243), False, 'from PIL import Image\n')] |
from setuptools import setup, find_packages
setup(name="visbeer", version="0.0.1", packages=find_packages(),
install_requires=['flask'])
#install_requires=['SQLAlchemy', 'VISlib', 'werkzeug', 'webob', 'visapps >= 2.2'])
| [
"setuptools.find_packages"
] | [((93, 108), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (106, 108), False, 'from setuptools import setup, find_packages\n')] |
# Copyright 2019 Open Source Robotics Foundation, 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... | [
"ros2doctor.api.Report",
"struct.unpack",
"socket.socket",
"ros2doctor.api.format.doctor_warn",
"ros2doctor.api.Result",
"psutil.net_if_stats",
"psutil.net_if_addrs",
"ros2doctor.api.format.doctor_error"
] | [((4564, 4572), 'ros2doctor.api.Result', 'Result', ([], {}), '()\n', (4570, 4572), False, 'from ros2doctor.api import Result\n'), ((5941, 5962), 'psutil.net_if_stats', 'psutil.net_if_stats', ([], {}), '()\n', (5960, 5962), False, 'import psutil\n'), ((5989, 6020), 'ros2doctor.api.Report', 'Report', (['"""NETWORK CONFIG... |
# Generated by Django 3.1.2 on 2021-04-12 16:08
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0004_auto_20210412_1704'),
]
operations = [
migrations.RemoveField(
model_name='animal',
name='type',
... | [
"django.db.migrations.RemoveField",
"django.db.models.ManyToManyField",
"django.db.models.ImageField"
] | [((232, 288), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""animal"""', 'name': '"""type"""'}), "(model_name='animal', name='type')\n", (254, 288), False, 'from django.db import migrations, models\n'), ((432, 517), 'django.db.models.ManyToManyField', 'models.ManyToManyField', ([]... |
from gecko_fetcher import get_coingecko_front_page
class TestGetCoingeckoFrontPage:
def setup_class(self):
# setup_class called once for the class"
self.n_entries = 5
self.pages = 3
self.resp = get_coingecko_front_page(n=self.n_entries, p_max=self.pages)
def test_get_coingecko... | [
"gecko_fetcher.get_coingecko_front_page"
] | [((232, 292), 'gecko_fetcher.get_coingecko_front_page', 'get_coingecko_front_page', ([], {'n': 'self.n_entries', 'p_max': 'self.pages'}), '(n=self.n_entries, p_max=self.pages)\n', (256, 292), False, 'from gecko_fetcher import get_coingecko_front_page\n')] |
import sys
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.ticker import MultipleLocator
majorLocatorX = MultipleLocator(5)
minorLocatorX = MultipleLocator(5)
majorLocatorY = MultipleLocator(20)
minorLocatorY = MultipleLocator(10)
a1985 = [2]
a1987 = [3]
a1995 = [4, 5]
a1996 = [6]... | [
"matplotlib.pyplot.show",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.rc",
"numpy.linspace",
"numpy.exp",
"matplotlib.ticker.MultipleLocator",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig"
] | [((143, 161), 'matplotlib.ticker.MultipleLocator', 'MultipleLocator', (['(5)'], {}), '(5)\n', (158, 161), False, 'from matplotlib.ticker import MultipleLocator\n'), ((178, 196), 'matplotlib.ticker.MultipleLocator', 'MultipleLocator', (['(5)'], {}), '(5)\n', (193, 196), False, 'from matplotlib.ticker import MultipleLoca... |
"""Class for building custom balance sheets.
"""
__copyright__ = "Copyright (C) 2021 <NAME>"
from datetime import datetime
from finpack.utils import add_char
class BalanceSheet:
def __init__(self, data):
self._data = data
self.WIDTH = 70
self.TAB = 5
self.categories = self._build... | [
"datetime.datetime.now",
"finpack.utils.add_char"
] | [((332, 346), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (344, 346), False, 'from datetime import datetime\n'), ((432, 458), 'finpack.utils.add_char', 'add_char', (['self.WIDTH', 'char'], {}), '(self.WIDTH, char)\n', (440, 458), False, 'from finpack.utils import add_char\n'), ((6243, 6257), 'finpack.uti... |
from app.tests import test_kernel
@test_kernel.container.register('another_test_plugin', tags=['plugin'])
class AnotherTestPlugin(object):
pass
| [
"app.tests.test_kernel.container.register"
] | [((37, 107), 'app.tests.test_kernel.container.register', 'test_kernel.container.register', (['"""another_test_plugin"""'], {'tags': "['plugin']"}), "('another_test_plugin', tags=['plugin'])\n", (67, 107), False, 'from app.tests import test_kernel\n')] |
from django.utils.translation import ugettext_noop as _
from corehq.apps.reports.generic import GenericTabularReport, GetParamsMixin
from corehq.apps.reports.standard import CustomProjectReport
from corehq.apps.hqwebapp.decorators import use_nvd3_v3
from custom.care_pathways.filters import GeographyFilter, MalawiPPTY... | [
"custom.care_pathways.utils.get_domain_configuration",
"django.utils.translation.ugettext_noop"
] | [((3375, 3394), 'django.utils.translation.ugettext_noop', '_', (['"""Custom Reports"""'], {}), "('Custom Reports')\n", (3376, 3394), True, 'from django.utils.translation import ugettext_noop as _\n'), ((1398, 1435), 'custom.care_pathways.utils.get_domain_configuration', 'get_domain_configuration', (['self.domain'], {})... |
from __future__ import unicode_literals
from django.core.urlresolvers import reverse
from django.db import models
from django.utils import timezone
from accounts.models import UserProfile
class Event(models.Model):
name = models.CharField(max_length=100, unique=True)
slug = models.SlugField(max_length=100,
... | [
"django.db.models.TextField",
"django.core.urlresolvers.reverse",
"django.db.models.CharField",
"django.db.models.ForeignKey",
"django.utils.timezone.now",
"django.db.models.SlugField",
"django.db.models.BooleanField",
"django.db.models.ImageField",
"django.db.models.DecimalField",
"django.db.mode... | [((230, 275), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)', 'unique': '(True)'}), '(max_length=100, unique=True)\n', (246, 275), False, 'from django.db import models\n'), ((287, 383), 'django.db.models.SlugField', 'models.SlugField', ([], {'max_length': '(100)', 'null': '(True)', 'blank... |
import random
import string
import pyperclip
class User:
user_list = []
def __init__(self,username,password):
self.username = username
self.password = password
def save_user(self):
User.user_list.append(self)
@classmethod
def user_exist(cls, ... | [
"random.choice",
"pyperclip.copy"
] | [((1648, 1681), 'pyperclip.copy', 'pyperclip.copy', (['found_credentials'], {}), '(found_credentials)\n', (1662, 1681), False, 'import pyperclip\n'), ((1863, 1886), 'random.choice', 'random.choice', (['password'], {}), '(password)\n', (1876, 1886), False, 'import random\n')] |
import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="baike",
license="Apache 2.0",
version="1.5.0",
author="Lightyears",
author_email="<EMAIL>",
description="BaiduBaike search bot",
long_description=long_description... | [
"setuptools.find_packages"
] | [((837, 863), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (861, 863), False, 'import setuptools\n')] |
import uuid
# Return a new message identifier
def generate_new_message_uuid():
return f"nook-message-{uuid.uuid4()}"
| [
"uuid.uuid4"
] | [((108, 120), 'uuid.uuid4', 'uuid.uuid4', ([], {}), '()\n', (118, 120), False, 'import uuid\n')] |
# Copyright 2021 <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 wr... | [
"q2_sra.lib.munging.find_sra_col",
"q2_sra.lib.efetch.bioproject_to_df",
"q2_sra.lib.efetch.runs_to_df"
] | [((960, 1030), 'q2_sra.lib.efetch.bioproject_to_df', 'bioproject_to_df', (['bioproject'], {'batch_size': 'batch_size', 'print_stdout': '(True)'}), '(bioproject, batch_size=batch_size, print_stdout=True)\n', (976, 1030), False, 'from q2_sra.lib.efetch import runs_to_df, bioproject_to_df, DEFAULT_BATCH\n'), ((1561, 1594)... |
from argparse import ArgumentParser, FileType
from json import load, dumps
from operator import itemgetter
from os import access, linesep, makedirs, path as os_path, W_OK
# pip install iso8601
from iso8601 import parse_date
class_defs = [] # List of generated class names
class_props = {} # Map of generated class na... | [
"iso8601.parse_date",
"os.path.abspath",
"json.load",
"argparse.ArgumentParser",
"os.makedirs",
"os.path.isdir",
"os.path.exists",
"json.dumps",
"operator.itemgetter",
"os.access",
"argparse.FileType"
] | [((601, 630), 'os.access', 'access', (['prospective_dir', 'W_OK'], {}), '(prospective_dir, W_OK)\n', (607, 630), False, 'from os import access, linesep, makedirs, path as os_path, W_OK\n'), ((2633, 2674), 'json.dumps', 'dumps', (['json_dict'], {'indent': "(' ' * num_spaces)"}), "(json_dict, indent=' ' * num_spaces)\n",... |
import tkinter as tk
import random
import math
screen_width = 500
screen_height = 500
r = 200
PI = 3.14159265358979323846264338327
canvas = tk.Canvas(width=screen_width, height=screen_height)
canvas.pack()
canvas.create_oval(50,50,450,450, width=2)
canvas.create_rectangle(50,50,450,450, width=2)
in_circle = 0
i... | [
"random.randrange",
"tkinter.Canvas",
"math.sqrt",
"tkinter.mainloop"
] | [((146, 197), 'tkinter.Canvas', 'tk.Canvas', ([], {'width': 'screen_width', 'height': 'screen_height'}), '(width=screen_width, height=screen_height)\n', (155, 197), True, 'import tkinter as tk\n'), ((1078, 1091), 'tkinter.mainloop', 'tk.mainloop', ([], {}), '()\n', (1089, 1091), True, 'import tkinter as tk\n'), ((387, ... |
from dataclasses import dataclass
import logging
from typing import Any, Dict, List, Sequence
from h5py import File
from pyproj.crs import ProjectedCRS, GeographicCRS
from pyproj.crs.datum import CustomDatum, CustomEllipsoid
from pyproj.crs.coordinate_operation import GeostationarySatelliteConversion
from shapely.geom... | [
"shapely.geometry.Polygon",
"pyproj.crs.GeographicCRS",
"shapely.geometry.mapping",
"pyproj.crs.coordinate_operation.GeostationarySatelliteConversion",
"pyproj.crs.datum.CustomEllipsoid.from_name",
"stactools.goes.attributes.GlobalAttributes.from_nc",
"stactools.goes.errors.GOESInvalidGeometryError",
... | [((665, 699), 'pyproj.crs.datum.CustomEllipsoid.from_name', 'CustomEllipsoid.from_name', (['"""GRS80"""'], {}), "('GRS80')\n", (690, 699), False, 'from pyproj.crs.datum import CustomDatum, CustomEllipsoid\n'), ((710, 737), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (727, 737), False, ... |
from django.shortcuts import render
# Create your views here.
from django.views.decorators.csrf import ensure_csrf_cookie
@ensure_csrf_cookie
def index(request):
return render(request, 'frontend/index.html')
| [
"django.shortcuts.render"
] | [((176, 214), 'django.shortcuts.render', 'render', (['request', '"""frontend/index.html"""'], {}), "(request, 'frontend/index.html')\n", (182, 214), False, 'from django.shortcuts import render\n')] |
# Code for paper:
# [Title] - "PAN: Towards Fast Action Recognition via Learning Persistence of Appearance"
# [Author] - <NAME>, <NAME>, <NAME>, <NAME>
# [Github] - https://github.com/zhang-can/PAN-PyTorch
import torch
from torch import nn
import math
class PA(nn.Module):
def __init__(self, n_length):
su... | [
"torch.nn.Dropout",
"torch.nn.ReLU",
"torch.nn.PairwiseDistance",
"torch.nn.Conv2d",
"torch.cat",
"torch.nn.init.normal_",
"torch.nn.Softmax",
"torch.nn.init.constant_",
"torch.nn.Linear",
"math.log",
"torch.nn.MaxPool3d",
"torch.nn.AdaptiveAvgPool1d"
] | [((373, 397), 'torch.nn.Conv2d', 'nn.Conv2d', (['(3)', '(8)', '(7)', '(1)', '(3)'], {}), '(3, 8, 7, 1, 3)\n', (382, 397), False, 'from torch import nn\n'), ((1646, 1669), 'torch.nn.AdaptiveAvgPool1d', 'nn.AdaptiveAvgPool1d', (['(1)'], {}), '(1)\n', (1666, 1669), False, 'from torch import nn\n'), ((1913, 1930), 'torch.n... |
import re
import gzip
import os
import time
import json
import codecs
import urllib.request, urllib.parse # urllib.error
import pytz
import logging
import sys
import platform
from socket import gethostname
from datetime import timedelta, datetime
from sqlalchemy import create_engine, func
from sqlalchemy.orm import se... | [
"os.popen",
"logging.Formatter",
"scrutiny.models.BreakinAttempts",
"json.loads",
"datetime.timedelta",
"math.log",
"datetime.datetime.now",
"time.localtime",
"scrutiny.models.BannedIPs",
"logging.StreamHandler",
"time.sleep",
"scrutiny.models.SubnetDetails",
"platform.linux_distribution",
... | [((890, 919), 'logging.getLogger', 'logging.getLogger', (['"""scrutiny"""'], {}), "('scrutiny')\n", (907, 919), False, 'import logging\n'), ((940, 1002), 'logging.Formatter', 'logging.Formatter', (['"""%(asctime)s [%(levelname)s] - %(message)s"""'], {}), "('%(asctime)s [%(levelname)s] - %(message)s')\n", (957, 1002), F... |
# Generated by Django 3.2.9 on 2021-12-24 15:51
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('django_2fa', '0004_devic... | [
"django.db.migrations.swappable_dependency",
"django.db.models.BigAutoField",
"django.db.models.ForeignKey",
"django.db.models.BooleanField",
"django.db.models.SlugField",
"django.db.models.DateTimeField"
] | [((227, 284), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (258, 284), False, 'from django.db import migrations, models\n'), ((473, 569), 'django.db.models.BigAutoField', 'models.BigAutoField', ([], {'auto_created': '... |
# -*- coding: utf-8 -*-
import urllib.parse
import requests
import globalVar
import os,time
import urllib
import string
import shutil
import re
import base64
from bs4 import BeautifulSoup
import random
import pdfkit
class csdnToPdf:
url='https://blog.csdn.net/AI_BigData_wh'
bName = ''
blogName='AI_BigData_wh\\'... | [
"urllib.parse.unquote",
"globalVar.text3.configure",
"os.makedirs",
"random.uniform",
"requests.Session",
"pdfkit.from_file",
"os.path.exists",
"os.rename",
"os.path.dirname",
"time.sleep",
"time.time",
"os.path.isfile",
"requests.get",
"bs4.BeautifulSoup",
"shutil.rmtree",
"requests.p... | [((635, 674), 'globalVar.text3.configure', 'globalVar.text3.configure', ([], {'text': 'content'}), '(text=content)\n', (660, 674), False, 'import globalVar\n'), ((857, 875), 'requests.Session', 'requests.Session', ([], {}), '()\n', (873, 875), False, 'import requests\n'), ((1201, 1216), 'time.sleep', 'time.sleep', (['(... |
from hazma.vector_mediator import VectorMediator, KineticMixing
from hazma.parameters import vh
from hazma.parameters import electron_mass as me
import numpy as np
import os
from os import path
def e_cm_mw(mx, vrel=1e-3):
"""Computes DM COM energy, assuming its velocity is much less than c.
"""
return 2 *... | [
"os.makedirs",
"numpy.geomspace",
"os.path.dirname",
"os.path.exists",
"os.path.join"
] | [((514, 536), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file__)\n', (526, 536), False, 'from os import path\n'), ((599, 620), 'os.makedirs', 'os.makedirs', (['data_dir'], {}), '(data_dir)\n', (610, 620), False, 'import os\n'), ((1539, 1566), 'numpy.geomspace', 'np.geomspace', (['(1.0)', 'e_cm', '(10)']... |
""" Artist class. """
# Local imports
import spotifython.constants as const
from spotifython.endpoints import Endpoints
import spotifython.utils as utils
# pylint: disable = pointless-string-statement, too-many-instance-attributes
# pylint: disable = too-many-branches
class Artist:
""" Represents an Artist objec... | [
"spotifython.utils.get_field",
"spotifython.utils.spotifython_eq",
"spotifython.utils.request",
"spotifython.track.Track",
"spotifython.utils.spotifython_hash",
"spotifython.utils.SpotifyError",
"spotifython.utils.paginate_get"
] | [((2428, 2461), 'spotifython.utils.spotifython_eq', 'utils.spotifython_eq', (['self', 'other'], {}), '(self, other)\n', (2448, 2461), True, 'import spotifython.utils as utils\n'), ((2717, 2745), 'spotifython.utils.spotifython_hash', 'utils.spotifython_hash', (['self'], {}), '(self)\n', (2739, 2745), True, 'import spoti... |
from django.urls import path, include
from django.contrib.auth import views as auth_views
from . import forms, views
urlpatterns = [
path('', views.index, name='index'),
path('api/games/', views.api_games, name='api_games'),
path('api/player/<id>', views.api_player, name='api_player'),
path('rules/', ... | [
"django.urls.path"
] | [((138, 173), 'django.urls.path', 'path', (['""""""', 'views.index'], {'name': '"""index"""'}), "('', views.index, name='index')\n", (142, 173), False, 'from django.urls import path, include\n'), ((179, 232), 'django.urls.path', 'path', (['"""api/games/"""', 'views.api_games'], {'name': '"""api_games"""'}), "('api/game... |
#!/opt/libreoffice5.2/program/python
# -*- coding: utf-8 -*-
import xml.etree.ElementTree as ET
import os
import sys
from settings import getDIC, createBK
import types
class Elem(ET.Element):
'''
キーワード引数textでテキストノードを付加するxml.etree.ElementTree.Element派生クラス。
'''
def __init__(self, tag, attrib={},**kwargs... | [
"settings.getDIC",
"xml.etree.ElementTree.ElementTree",
"os.chdir",
"settings.createBK"
] | [((11709, 11734), 'os.chdir', 'os.chdir', (["DIC['SRC_PATH']"], {}), "(DIC['SRC_PATH'])\n", (11717, 11734), False, 'import os\n'), ((7671, 7704), 'settings.createBK', 'createBK', (['filename', "DIC['BACKUP']"], {}), "(filename, DIC['BACKUP'])\n", (7679, 7704), False, 'from settings import getDIC, createBK\n'), ((11659,... |
from pathlib import Path
import pickle
JOB_ID = 10000
PICKLE_FILE_PATH = Path('/Users/Harold/Desktop/Job {}.pkl'.format(JOB_ID))
SAMPLE_RATE = 24000
CLIP_PERIOD = 1
CLIP_DURATION = .250
NUM_CLIPS = 10000
def main():
clips = create_clips()
data = {
'job_id': JOB_ID,
'clips': clips
... | [
"pickle.dump"
] | [((386, 410), 'pickle.dump', 'pickle.dump', (['data', 'file_'], {}), '(data, file_)\n', (397, 410), False, 'import pickle\n')] |
#!/usr/bin/env python3.9
import sys
import os
import time
import datetime
import stat
import json
import tarfile
import re
from pathlib import Path, PurePath
import utils
def disk_item_listing(files_or_folder_to_list, ls_format='*', output_format='text'):
""" Create a manifest of one or more folders or files
... | [
"os.walk",
"json.dumps",
"win32security.GetFileSecurity",
"grp.getgrgid",
"os.path.join",
"utils.is_first_wtar_file",
"re.findall",
"win32security.LookupAccountSid",
"tarfile.open",
"stat.S_ISDIR",
"utils.get_current_os_names",
"re.search",
"os.lstat",
"stat.S_ISLNK",
"datetime.datetime.... | [((2326, 2354), 'utils.get_current_os_names', 'utils.get_current_os_names', ([], {}), '()\n', (2352, 2354), False, 'import utils\n'), ((3128, 3177), 'utils.is_first_wtar_file', 'utils.is_first_wtar_file', (['files_or_folder_to_list'], {}), '(files_or_folder_to_list)\n', (3152, 3177), False, 'import utils\n'), ((6153, 6... |
import torch
import sys, os
sys.path.insert(0, os.path.abspath(os.path.join(os.getcwd(), "./../../../../")))
sys.path.insert(0, os.path.abspath(os.path.join(os.getcwd(), "./../../../")))
from fedml_api.model.cv.vgg import vgg11_bn, VGG_SNIP
from fedml_api.model.cv.resnet import resnet56
from fedml_api.model.cv.wrn.wrn ... | [
"os.getcwd",
"torch.load",
"numpy.where",
"fedml_api.model.cv.vgg.vgg11_bn"
] | [((418, 428), 'fedml_api.model.cv.vgg.vgg11_bn', 'vgg11_bn', ([], {}), '()\n', (426, 428), False, 'from fedml_api.model.cv.vgg import vgg11_bn, VGG_SNIP\n'), ((558, 568), 'fedml_api.model.cv.vgg.vgg11_bn', 'vgg11_bn', ([], {}), '()\n', (566, 568), False, 'from fedml_api.model.cv.vgg import vgg11_bn, VGG_SNIP\n'), ((456... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import djorm_pgfulltext.fields
class Migration(migrations.Migration):
dependencies = [
('sbirez', '0003_auto_20150219_1959'),
]
operations = [
migrations.RunSQL("""ALTER TABLE sbirez... | [
"django.db.migrations.RunSQL"
] | [((281, 479), 'django.db.migrations.RunSQL', 'migrations.RunSQL', (['"""ALTER TABLE sbirez_topic ALTER COLUMN fts TYPE tsvector USING (fts::tsvector)"""'], {'reverse_sql': '"""ALTER TABLE sbirez_topic ALTER COLUMN fts TYPE text USING (fts::text)"""'}), "(\n 'ALTER TABLE sbirez_topic ALTER COLUMN fts TYPE tsvector US... |
from itertools import product
def calculator(program, value):
acc=value
for i in program:
if i == "1":
acc += 3
elif i == "2":
acc *= 2
return acc
def build_program(v, g, m):
for i in range(1, m + 1):
space = ["12"] * m
for k in pro... | [
"itertools.product"
] | [((317, 332), 'itertools.product', 'product', (['*space'], {}), '(*space)\n', (324, 332), False, 'from itertools import product\n')] |
import numpy as np
from pandas import Series, DataFrame
import pandas as pd
# Let's learn/review about Index Objects
my_ser = Series([1, 2, 3, 4], index=['A', 'B', 'C', 'D'])
# Get the index
my_index = my_ser.index
# Can grab index ranges
my_index[2:]
# What happens if we try to change an index value?
my_index[0]... | [
"pandas.Series"
] | [((129, 177), 'pandas.Series', 'Series', (['[1, 2, 3, 4]'], {'index': "['A', 'B', 'C', 'D']"}), "([1, 2, 3, 4], index=['A', 'B', 'C', 'D'])\n", (135, 177), False, 'from pandas import Series, DataFrame\n')] |
from abc import ABC
import pathlib
class BaseAnnotator(ABC):
def __init__(self):
self.resources_dir = str(pathlib.Path('~/.cache/ig/models/').expanduser().absolute())
| [
"pathlib.Path"
] | [((120, 155), 'pathlib.Path', 'pathlib.Path', (['"""~/.cache/ig/models/"""'], {}), "('~/.cache/ig/models/')\n", (132, 155), False, 'import pathlib\n')] |
import sys
import os
import time
import argparse
import textwrap
import smtplib
import numpy
import cv2
import movidius
import imutils
from imutils.video import VideoStream
arguments = argparse.ArgumentParser(
description="Heimdall AI Camera PoC using Intel Movidius Neural Compute Stick 1.")
arguments.add_argumen... | [
"numpy.float16",
"imutils.video.VideoStream",
"movidius.allocate",
"cv2.putText",
"argparse.ArgumentParser",
"smtplib.SMTP",
"cv2.cvtColor",
"cv2.waitKey",
"cv2.imshow",
"time.sleep",
"time.time",
"cv2.rectangle",
"movidius.attach",
"movidius.deattach",
"cv2.destroyAllWindows"
] | [((186, 297), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Heimdall AI Camera PoC using Intel Movidius Neural Compute Stick 1."""'}), "(description=\n 'Heimdall AI Camera PoC using Intel Movidius Neural Compute Stick 1.')\n", (209, 297), False, 'import argparse\n'), ((3172, 3203), '... |