code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import os
import yaml
_RekallAPI = None
_RekallSessionAPI = None
def RekallAPI(current):
yaml_path = os.path.join(current.request.folder, "private", "api.yaml")
global _RekallAPI
if _RekallAPI is None:
_RekallAPI = {}
for desc in yaml.load(open(yaml_path).read()):
_RekallAPI[de... | [
"os.path.join"
] | [((107, 166), 'os.path.join', 'os.path.join', (['current.request.folder', '"""private"""', '"""api.yaml"""'], {}), "(current.request.folder, 'private', 'api.yaml')\n", (119, 166), False, 'import os\n'), ((407, 474), 'os.path.join', 'os.path.join', (['current.request.folder', '"""private"""', '"""session_api.yaml"""'], ... |
import tensorflow as tf
from script.model.sklearn_like_model.NetModule.BaseNetModule import BaseNetModule
from script.util.Stacker import Stacker
from script.util.tensor_ops import CONV_FILTER_3311, relu, CONV_FILTER_2222
class VGG16NetModule(BaseNetModule):
def __init__(self, x, n_classes, capacity=No... | [
"script.util.Stacker.Stacker",
"tensorflow.variable_scope"
] | [((633, 661), 'tensorflow.variable_scope', 'tf.variable_scope', (['self.name'], {}), '(self.name)\n', (650, 661), True, 'import tensorflow as tf\n'), ((691, 728), 'script.util.Stacker.Stacker', 'Stacker', (['self.x'], {'verbose': 'self.verbose'}), '(self.x, verbose=self.verbose)\n', (698, 728), False, 'from script.util... |
import cv2
import joblib
from skimage.feature import hog
import numpy
import pygame
clf = joblib.load("digits.pkl")
pygame.init()
screen = pygame.display.set_mode((600, 400))
screen.fill((255, 255, 255))
pygame.display.set_caption("Draw the Number")
loop = True
while loop:
for event in pygame.event.get():
... | [
"cv2.rectangle",
"pygame.mouse.get_pressed",
"pygame.init",
"pygame.quit",
"cv2.imshow",
"numpy.array",
"cv2.threshold",
"pygame.display.set_mode",
"pygame.mouse.get_pos",
"pygame.image.save",
"joblib.load",
"pygame.display.update",
"cv2.waitKey",
"cv2.cvtColor",
"cv2.resize",
"cv2.Gau... | [((90, 115), 'joblib.load', 'joblib.load', (['"""digits.pkl"""'], {}), "('digits.pkl')\n", (101, 115), False, 'import joblib\n'), ((117, 130), 'pygame.init', 'pygame.init', ([], {}), '()\n', (128, 130), False, 'import pygame\n'), ((141, 176), 'pygame.display.set_mode', 'pygame.display.set_mode', (['(600, 400)'], {}), '... |
import os
import requests
from bs4 import BeautifulSoup
from coveopush import CoveoConstants
from coveopush import CoveoPermissions
from coveopush import CoveoPush
from coveopush import Document
from dotenv import load_dotenv, find_dotenv
load_dotenv(find_dotenv())
def find_gen(index):
if 1 <= index <= 151:
... | [
"coveopush.CoveoPermissions.PermissionIdentity",
"dotenv.find_dotenv",
"coveopush.CoveoPush.Push",
"os.environ.get",
"requests.get",
"bs4.BeautifulSoup",
"coveopush.Document"
] | [((253, 266), 'dotenv.find_dotenv', 'find_dotenv', ([], {}), '()\n', (264, 266), False, 'from dotenv import load_dotenv, find_dotenv\n'), ((704, 758), 'requests.get', 'requests.get', (['"""https://pokemondb.net/pokedex/national"""'], {}), "('https://pokemondb.net/pokedex/national')\n", (716, 758), False, 'import reques... |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: pogoprotos/data/telemetry/battle_party_telemetry.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from go... | [
"google.protobuf.symbol_database.Default",
"google.protobuf.descriptor.FieldDescriptor"
] | [((521, 547), 'google.protobuf.symbol_database.Default', '_symbol_database.Default', ([], {}), '()\n', (545, 547), True, 'from google.protobuf import symbol_database as _symbol_database\n'), ((1535, 1901), 'google.protobuf.descriptor.FieldDescriptor', '_descriptor.FieldDescriptor', ([], {'name': '"""battle_party_click_... |
#%%
import matplotlib.pyplot as plt
import matplotlib as mpl
import numpy as np
x = np.linspace(0, 20, 100)
plt.plot(x, np.sin(x))
plt.show()
# %%
x = np.arange(0,9,0.1)
y = np.sin(x)
y1 = np.cos(x)
plt.title("y=xin(x)")
plt.xlabel("x")
plt.ylabel("y")
plt.plot(x,y,"-b",x,y1,"-r")
plt.show()
# %%
a = np.array([22,87... | [
"matplotlib.pyplot.hist",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.array",
"numpy.linspace",
"numpy.cos",
"numpy.sin",
"matplotlib.pyplot.title",
"numpy.arange",
"matplotlib.pyplot.show"
] | [((85, 108), 'numpy.linspace', 'np.linspace', (['(0)', '(20)', '(100)'], {}), '(0, 20, 100)\n', (96, 108), True, 'import numpy as np\n'), ((132, 142), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (140, 142), True, 'import matplotlib.pyplot as plt\n'), ((153, 173), 'numpy.arange', 'np.arange', (['(0)', '(9)',... |
from magma import *
from mantle import *
from loam import Peripheral
#from .peripherals.fifo import FIFO
#from .peripherals.uart.tx import UARTTX
class USART(Peripheral):
name = 'usart'
IO = ["RX", In(Bit), "TX", Out(Bit)]
def __init__(self, fpga, name='usart0'):
super(USART,self).__init__(fpga, ... | [
"loam.Peripheral.on"
] | [((704, 723), 'loam.Peripheral.on', 'Peripheral.on', (['self'], {}), '(self)\n', (717, 723), False, 'from loam import Peripheral\n')] |
import hashlib
import json
import os
import requests
import sys
import time
def compute_beat_saber_hash(directory):
global custom_levels_directory
global info_dat_filename
directory = custom_levels_directory + "\\" + directory + "\\"
# Skip, if the 'info.dat' file doesn't exist.
if not os.path.i... | [
"json.loads",
"os.listdir",
"requests.request",
"time.sleep",
"os.path.isfile",
"os.path.isdir",
"hashlib.sha1"
] | [((585, 612), 'json.loads', 'json.loads', (['info_dat_string'], {}), '(info_dat_string)\n', (595, 612), False, 'import json\n'), ((1457, 1471), 'hashlib.sha1', 'hashlib.sha1', ([], {}), '()\n', (1469, 1471), False, 'import hashlib\n'), ((2462, 2497), 'os.listdir', 'os.listdir', (['custom_levels_directory'], {}), '(cust... |
# gaffer needs to be imported at top-most
import Gaffer
# now we can import centipede
import centipede
# running serialized task
centipede.TaskWrapper.Subprocess.runSerializedTask()
| [
"centipede.TaskWrapper.Subprocess.runSerializedTask"
] | [((131, 183), 'centipede.TaskWrapper.Subprocess.runSerializedTask', 'centipede.TaskWrapper.Subprocess.runSerializedTask', ([], {}), '()\n', (181, 183), False, 'import centipede\n')] |
from ClusterDataGen.NetworkToTree import *
from ClusterDataGen.LGT_network import *
from ClusterDataGen.tree_to_newick import *
from datetime import datetime
import pandas as pd
import numpy as np
import pickle
import time
import sys
def make_data_fun(net_num, unique, partial, num_trees, train_data=True):
# PARA... | [
"pickle.dump",
"datetime.datetime.now",
"numpy.random.randint",
"numpy.quantile",
"numpy.log2",
"time.time",
"numpy.round"
] | [((755, 766), 'time.time', 'time.time', ([], {}), '()\n', (764, 766), False, 'import time\n'), ((790, 816), 'numpy.random.randint', 'np.random.randint', (['(10)', '(120)'], {}), '(10, 120)\n', (807, 816), True, 'import numpy as np\n'), ((1030, 1041), 'time.time', 'time.time', ([], {}), '()\n', (1039, 1041), False, 'imp... |
import numpy as np
from sklearn.utils import indexable
from sklearn.utils.validation import _num_samples
from sklearn.model_selection._split import _BaseKFold
from hypernets.utils import logging
logger = logging.get_logger(__name__)
class PrequentialSplit(_BaseKFold):
STRATEGY_PREQ_BLS = 'preq-bls'
STRATEGY_... | [
"sklearn.utils.indexable",
"sklearn.utils.validation._num_samples",
"hypernets.utils.logging.get_logger",
"numpy.arange"
] | [((205, 233), 'hypernets.utils.logging.get_logger', 'logging.get_logger', (['__name__'], {}), '(__name__)\n', (223, 233), False, 'from hypernets.utils import logging\n'), ((3521, 3544), 'sklearn.utils.indexable', 'indexable', (['X', 'y', 'groups'], {}), '(X, y, groups)\n', (3530, 3544), False, 'from sklearn.utils impor... |
import os
import sys
import json
import unittest
from climate.lib import utilities
class TestUtilities(unittest.TestCase):
def test_dict_to_rcd(self):
"""Testing dictionary being passed to resolve_cli_data function."""
_dict = {
"general": {},
"commands": {}
}
... | [
"os.path.join",
"climate.lib.utilities.write_json",
"os.path.isfile",
"climate.lib.utilities.get_entry",
"climate.lib.utilities.add_space",
"os.path.basename",
"unittest.main",
"climate.lib.utilities.resolve_cli_data"
] | [((2799, 2814), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2812, 2814), False, 'import unittest\n'), ((600, 655), 'os.path.join', 'os.path.join', (['"""climate/lib/tests/data"""', '"""test_cli.json"""'], {}), "('climate/lib/tests/data', 'test_cli.json')\n", (612, 655), False, 'import os\n'), ((1683, 1740), 'o... |
from django.shortcuts import render, redirect
from .forms import MyForm
from .models import Todo
def index(request):
todos = Todo.objects.all()
return render(request, 'todo_app/index.html', {'todos': todos})
def create(request):
forms = MyForm(request.POST or None)
contex = {
'todo': forms
... | [
"django.shortcuts.render",
"django.shortcuts.redirect"
] | [((161, 217), 'django.shortcuts.render', 'render', (['request', '"""todo_app/index.html"""', "{'todos': todos}"], {}), "(request, 'todo_app/index.html', {'todos': todos})\n", (167, 217), False, 'from django.shortcuts import render, redirect\n'), ((789, 836), 'django.shortcuts.render', 'render', (['request', '"""todo_ap... |
from benchmark import *
import oneflow_benchmark
from flowvision.models.alexnet import alexnet
@oneflow_benchmark.ci_settings(compare={"median": "5%"})
def test_alexnet_batch_size1(benchmark, net=alexnet, input_shape=[1, 3, 224, 224]):
model, x, optimizer = fetch_args(net, input_shape)
benchmark(run, model, x... | [
"oneflow_benchmark.ci_settings"
] | [((98, 153), 'oneflow_benchmark.ci_settings', 'oneflow_benchmark.ci_settings', ([], {'compare': "{'median': '5%'}"}), "(compare={'median': '5%'})\n", (127, 153), False, 'import oneflow_benchmark\n'), ((336, 391), 'oneflow_benchmark.ci_settings', 'oneflow_benchmark.ci_settings', ([], {'compare': "{'median': '5%'}"}), "(... |
from datetime import datetime
import uuid
# Message class
class Message():
# Main initialiser
def __init__(self, title, body, from_id, from_name, to_id, to_name, id="", deleted=False, hidden_for_sender=False):
self.title = title
self.body = body
self.from_id = from_id
self.fro... | [
"uuid.uuid4",
"datetime.datetime.utcnow"
] | [((422, 439), 'datetime.datetime.utcnow', 'datetime.utcnow', ([], {}), '()\n', (437, 439), False, 'from datetime import datetime\n'), ((528, 540), 'uuid.uuid4', 'uuid.uuid4', ([], {}), '()\n', (538, 540), False, 'import uuid\n')] |
"""Command line tools for optimisation."""
import datetime
import json
import logging
from pathlib import Path
from typing import List
import click
import matplotlib.pyplot as plt
import numpy as np
from hoqunm.data_tools.base import (EXAMPLE_FILEPATH_OPTIMISATION_COMPUTATION,
EXA... | [
"numpy.prod",
"click.Choice",
"pathlib.Path",
"click.option",
"hoqunm.data_tools.modelling.HospitalModel.load",
"hoqunm.simulation.evaluators.EvaluationResults.load",
"numpy.ndindex",
"hoqunm.simulation.evaluators.SimulationEvaluator",
"matplotlib.pyplot.close",
"hoqunm.optimisation.optimators.Opt... | [((5230, 5245), 'click.command', 'click.command', ([], {}), '()\n', (5243, 5245), False, 'import click\n'), ((5793, 5912), 'click.option', 'click.option', (['"""--waiting"""', '"""-w"""'], {'is_flag': '(True)', 'help': '"""If waiting shall be assessed according to given waiting map."""'}), "('--waiting', '-w', is_flag=... |
#!/usr/bin/python
# Copyright 2018 <NAME>
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE.txt or copy at
# https://www.bfgroup.xyz/b2/LICENSE.txt)
# Tests the <relevant> feature
import BoostBuild
t = BoostBuild.Tester(use_test_config=False)
t.write("xxx.jam", """
impor... | [
"BoostBuild.Tester"
] | [((250, 290), 'BoostBuild.Tester', 'BoostBuild.Tester', ([], {'use_test_config': '(False)'}), '(use_test_config=False)\n', (267, 290), False, 'import BoostBuild\n')] |
import json
from jupyter_server.base.handlers import JupyterHandler, APIHandler
from jupyter_server.extension.handler import ExtensionHandlerMixin
import tornado
from tornado.websocket import WebSocketHandler, websocket_connect
from tornado.ioloop import IOLoop
class AuthDefaultHandler(ExtensionHandlerMixin, Jupyter... | [
"json.dumps"
] | [((1126, 1140), 'json.dumps', 'json.dumps', (['{}'], {}), '({})\n', (1136, 1140), False, 'import json\n')] |
from milight import MiLight, LightBulb, color_from_hex
from . import LightController
class MiLightController(LightController):
VENDOR = "milight"
def __init__(self, host, port, bulbs, *args, **kwargs):
super(MiLightController, self).__init__(*args, **kwargs)
self._milight = MiLight({'host':... | [
"milight.color_from_hex",
"milight.LightBulb"
] | [((418, 434), 'milight.LightBulb', 'LightBulb', (['bulbs'], {}), '(bulbs)\n', (427, 434), False, 'from milight import MiLight, LightBulb, color_from_hex\n'), ((884, 910), 'milight.color_from_hex', 'color_from_hex', (['color_code'], {}), '(color_code)\n', (898, 910), False, 'from milight import MiLight, LightBulb, color... |
# Copyright (c) 2016, 2017, 2018, 2019 <NAME>.
#
# clgen is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# clgen is distributed in th... | [
"re.compile",
"labm8.py.bazelutil.DataPath",
"subprocess.Popen",
"deeplearning.clgen.errors.ClangTimeout",
"json.dumps",
"tempfile.NamedTemporaryFile",
"deeplearning.clgen.errors.ClangException"
] | [((1343, 1388), 'labm8.py.bazelutil.DataPath', 'bazelutil.DataPath', (['f"""{_LLVM_REPO}/bin/clang"""'], {}), "(f'{_LLVM_REPO}/bin/clang')\n", (1361, 1388), False, 'from labm8.py import bazelutil\n'), ((1475, 1507), 're.compile', 're.compile', (['"""# \\\\d+ "<stdin>" 2"""'], {}), '(\'# \\\\d+ "<stdin>" 2\')\n', (1485,... |
from typing import List
import httpx
import lxml.html
from pydantic import BaseModel
from .config import plugin_config
class SaucenaoResult(BaseModel):
Similarity: str
Title: str
Content: str
URL: str
def __str__(self) -> str:
return '\n'.join(
f'{k}: {v}' if k != 'Content' ... | [
"httpx.AsyncClient"
] | [((572, 601), 'httpx.AsyncClient', 'httpx.AsyncClient', ([], {'timeout': '(10)'}), '(timeout=10)\n', (589, 601), False, 'import httpx\n')] |
import os
import sys
sys.path.insert(0, os.path.abspath(".."))
# from checkassume.datasets import load_data
# def test_stat_breuschpagan():
# var1 = 1
# var2 = 2
# var3 = 3
# assert (var1 + var2) == var3
# def test_stat_durbin()
| [
"os.path.abspath"
] | [((41, 62), 'os.path.abspath', 'os.path.abspath', (['""".."""'], {}), "('..')\n", (56, 62), False, 'import os\n')] |
# Generated by Django 3.2.3 on 2021-08-03 09:16
import django.core.serializers.json
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('contenttypes', '0002_remove_content_typ... | [
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.JSONField",
"django.db.models.AutoField",
"django.db.models.DateTimeField",
"django.db.models.CharField"
] | [((461, 554), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (477, 554), False, 'from django.db import migrations, models\... |
from django import forms
from django.forms import ModelForm
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
from crispy_forms.layout import Layout, Field
from crispy_forms.bootstrap import (AppendedText)
from crispy_forms.helper import FormHelper
from .models import P... | [
"django.forms.EmailField",
"crispy_forms.bootstrap.AppendedText",
"crispy_forms.helper.FormHelper",
"crispy_forms.layout.Field"
] | [((451, 469), 'django.forms.EmailField', 'forms.EmailField', ([], {}), '()\n', (467, 469), False, 'from django import forms\n'), ((1136, 1152), 'crispy_forms.helper.FormHelper', 'FormHelper', (['self'], {}), '(self)\n', (1146, 1152), False, 'from crispy_forms.helper import FormHelper\n'), ((1648, 1664), 'crispy_forms.h... |
#!/usr/bin/env python
import wx
import os
import sys
try:
dirName = os.path.dirname(os.path.abspath(__file__))
except:
dirName = os.path.dirname(os.path.abspath(sys.argv[0]))
sys.path.append(os.path.split(dirName)[0])
try:
from agw import gradientbutton as GB
bitmapDir = "bitmaps/"
except ImportErr... | [
"wx.BoxSizer",
"os.path.split",
"wx.FlexGridSizer",
"wx.StaticText",
"os.path.normpath",
"wx.lib.agw.gradientbutton.GradientButton",
"wx.SystemSettings.GetFont",
"os.path.basename",
"os.path.abspath",
"wx.Panel",
"wx.Panel.__init__"
] | [((91, 116), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (106, 116), False, 'import sys, os\n'), ((203, 225), 'os.path.split', 'os.path.split', (['dirName'], {}), '(dirName)\n', (216, 225), False, 'import sys, os\n'), ((534, 565), 'wx.Panel.__init__', 'wx.Panel.__init__', (['self', 'parent... |
#!/usr/bin/env python
#
# Copyright 2007 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | [
"google.appengine.datastore.datastore_pb.CommitResponse",
"google.appengine.runtime.apiproxy_errors.ApplicationError",
"google.appengine.api.api_base_pb2.VoidProto",
"google.appengine.datastore.datastore_pb.DeleteResponse",
"google.appengine.datastore.datastore_stub_util.get_service_converter",
"google.ap... | [((1553, 1608), 'google.appengine.api.apiproxy_stub.APIProxyStub.__init__', 'apiproxy_stub.APIProxyStub.__init__', (['self', 'SERVICE_NAME'], {}), '(self, SERVICE_NAME)\n', (1588, 1608), False, 'from google.appengine.api import apiproxy_stub\n'), ((1666, 1702), 'google.appengine.datastore.datastore_pbs.get_entity_conve... |
import platform, sys, os
sys.path.append(os.getcwd())
from PyQt5 import uic
from PyQt5.QtWidgets import *
from PyQt5 import *
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from lib.ssqt import SSQt
'''
Eu sei to repetindo muito codigo
os icones nao sao do mesmo tamanho
e alem disso fica mais facil caso um d... | [
"PyQt5.uic.loadUiType",
"pdb.set_trace",
"os.getcwd"
] | [((458, 502), 'PyQt5.uic.loadUiType', 'uic.loadUiType', (['"""sources/dialog/ui/error.ui"""'], {}), "('sources/dialog/ui/error.ui')\n", (472, 502), False, 'from PyQt5 import uic\n'), ((1122, 1165), 'PyQt5.uic.loadUiType', 'uic.loadUiType', (['"""sources/dialog/ui/info.ui"""'], {}), "('sources/dialog/ui/info.ui')\n", (1... |
# Copyright (c) 2012-2016 Seafile Ltd.
import os
from fabric.api import task
@task
def update(path):
"""Add copyright stuff to the begining of files.
"""
for filename in path_to_pyfile_list(path):
do_update(filename)
@task
def check(path):
"""Check copyright stuff for files.
"""
for f... | [
"os.path.isdir",
"os.path.join",
"os.walk"
] | [((1146, 1165), 'os.path.isdir', 'os.path.isdir', (['path'], {}), '(path)\n', (1159, 1165), False, 'import os\n'), ((1311, 1324), 'os.walk', 'os.walk', (['path'], {}), '(path)\n', (1318, 1324), False, 'import os\n'), ((1388, 1417), 'os.path.join', 'os.path.join', (['root', 'directory'], {}), '(root, directory)\n', (140... |
"""Setup file for fullqualname."""
from setuptools import setup
description = 'Fully qualified names for Python objects'
with open('README.rst') as file:
long_description = file.read()
_classifiers = [
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Langu... | [
"setuptools.setup"
] | [((592, 877), 'setuptools.setup', 'setup', ([], {'name': '"""fullqualname"""', 'version': '"""0.1.0"""', 'py_modules': "['fullqualname']", 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'description': 'description', 'long_description': 'long_description', 'url': '"""https://github.com/etgalloway/fullqualnam... |
# <NAME> Python 3.8 2020-08-18 - 2020-09-01 #
# zipgeo.py takes a .csv file with 6 fields and geocodes it
# *by zipcode* first; then via api and address.
# ("AnyID","address","city","state","zip","country")
import pandas as pd
from uszipcode import SearchEngine
import os
import sys
from keys import ... | [
"geopy.geocoders.ArcGIS",
"geopy.geocoders.Nominatim",
"uszipcode.SearchEngine",
"os.getcwd",
"geopy.geocoders.Bing",
"pandas.io.parsers.read_csv",
"sys.exit",
"pandas.DataFrame",
"geopy.geocoders.OpenCage",
"pandas.to_datetime"
] | [((504, 523), 'geopy.geocoders.ArcGIS', 'ArcGIS', ([], {'timeout': '(100)'}), '(timeout=100)\n', (510, 523), False, 'from geopy.geocoders import ArcGIS, Bing, Nominatim, OpenCage\n'), ((532, 559), 'geopy.geocoders.Bing', 'Bing', (['bing_key'], {'timeout': '(100)'}), '(bing_key, timeout=100)\n', (536, 559), False, 'from... |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from builtins import super
from future import standard_library
standard_library.install_aliases()
from vcfx.field.nodes import Field
#######
# TODO(cassidy): Figure out w... | [
"future.standard_library.install_aliases",
"builtins.super"
] | [((212, 246), 'future.standard_library.install_aliases', 'standard_library.install_aliases', ([], {}), '()\n', (244, 246), False, 'from future import standard_library\n'), ((462, 483), 'builtins.super', 'super', (['BusyTime', 'self'], {}), '(BusyTime, self)\n', (467, 483), False, 'from builtins import super\n')] |
from discord import Embed
from requests import get
from xml.etree.ElementTree import fromstring
from config import open_API_KEY
# 버스 API URL
Bus_URL = "http://apis.data.go.kr/1613000/ArvlInfoInqireService/getSttnAcctoSpcifyRouteBusArvlPrearngeInfoList"
# 버스정보 가져오기
async def bus_parser(nodeid, routeid):
# 버스 파라미... | [
"xml.etree.ElementTree.fromstring",
"discord.Embed",
"requests.get"
] | [((505, 536), 'requests.get', 'get', (['Bus_URL'], {'params': 'Bus_params'}), '(Bus_URL, params=Bus_params)\n', (508, 536), False, 'from requests import get\n'), ((551, 579), 'xml.etree.ElementTree.fromstring', 'fromstring', (['response.content'], {}), '(response.content)\n', (561, 579), False, 'from xml.etree.ElementT... |
import numpy as np
import networkx as nx
from scipy.spatial.distance import cosine
from scipy import sparse
from tqdm import tqdm
class RandomWalk:
def __init__(self, graph: nx.Graph, num_walks: int = 10, walk_length: int = 80) -> None:
r"""
Generate randomly uniform random walks
"""
... | [
"networkx.adjacency_matrix",
"numpy.random.choice",
"tqdm.tqdm",
"numpy.array",
"scipy.sparse.coo_matrix"
] | [((2066, 2097), 'networkx.adjacency_matrix', 'nx.adjacency_matrix', (['self.graph'], {}), '(self.graph)\n', (2085, 2097), True, 'import networkx as nx\n'), ((2262, 2316), 'tqdm.tqdm', 'tqdm', (['edges'], {'desc': '"""Computing Transition probabilities"""'}), "(edges, desc='Computing Transition probabilities')\n", (2266... |
#!/usr/bin/env python
from distutils.core import setup
setup(name='toxpipenv',
version='1.0',
description='Just some tests',
author='<NAME>',
author_email='<EMAIL>',
packages=['toxpipenv'],
)
| [
"distutils.core.setup"
] | [((57, 195), 'distutils.core.setup', 'setup', ([], {'name': '"""toxpipenv"""', 'version': '"""1.0"""', 'description': '"""Just some tests"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'packages': "['toxpipenv']"}), "(name='toxpipenv', version='1.0', description='Just some tests',\n author='<NAME>',... |
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | [
"os.environ.keys",
"pytest.config.getoption",
"pycarbon.tests.mnist.dataset_with_unischema.tf_example_carbon.train_and_test",
"pycarbon.tests.mnist.dataset_with_unischema.tf_example_carbon_unified_api.train_and_test",
"pycarbon.tests.mnist.dataset_with_unischema.generate_pycarbon_mnist.mnist_data_to_pycarbo... | [((1174, 1218), 'pytest.config.getoption', 'pytest.config.getoption', (['"""--carbon-sdk-path"""'], {}), "('--carbon-sdk-path')\n", (1197, 1218), False, 'import pytest\n'), ((1387, 1430), 'pytest.config.getoption', 'pytest.config.getoption', (['"""--pyspark-python"""'], {}), "('--pyspark-python')\n", (1410, 1430), Fals... |
import random
from PIL import ImageOps, ImageEnhance, ImageFilter, Image
import torchvision.transforms as transforms
PARAMETER_MAX = 10 # What is the max 'level' a transform could be predicted
def int_parameter(level, maxval) -> int:
"""
A function to scale between zero to max val with casting to int
:p... | [
"PIL.ImageOps.autocontrast",
"PIL.ImageOps.solarize",
"PIL.ImageEnhance.Brightness",
"PIL.ImageEnhance.Color",
"PIL.ImageEnhance.Contrast",
"PIL.ImageEnhance.Sharpness",
"PIL.ImageOps.invert",
"PIL.ImageOps.posterize",
"random.random",
"PIL.ImageOps.equalize"
] | [((1725, 1751), 'PIL.ImageOps.autocontrast', 'ImageOps.autocontrast', (['img'], {}), '(img)\n', (1746, 1751), False, 'from PIL import ImageOps, ImageEnhance, ImageFilter, Image\n'), ((2012, 2034), 'PIL.ImageOps.equalize', 'ImageOps.equalize', (['img'], {}), '(img)\n', (2029, 2034), False, 'from PIL import ImageOps, Ima... |
import lab as B
from matrix import LowerTriangular, UpperTriangular
# noinspection PyUnresolvedReferences
from .util import approx, dense1, dense2, diag1
def test_lowertriangular_formatting():
assert (
str(LowerTriangular(B.ones(3, 3))) == ""
"<lower-triangular matrix: batch=(), shape=(3, 3), dt... | [
"matrix.UpperTriangular",
"lab.ones",
"matrix.LowerTriangular"
] | [((623, 635), 'lab.ones', 'B.ones', (['(3)', '(3)'], {}), '(3, 3)\n', (629, 635), True, 'import lab as B\n'), ((645, 665), 'matrix.LowerTriangular', 'LowerTriangular', (['mat'], {}), '(mat)\n', (660, 665), False, 'from matrix import LowerTriangular, UpperTriangular\n'), ((1310, 1322), 'lab.ones', 'B.ones', (['(3)', '(3... |
from pygrank.algorithms.utils import MethodHasher, call, ensure_used_args, remove_used_args
from pygrank.core.signals import GraphSignal, to_signal, NodeRanking
from pygrank.core import backend, GraphSignalGraph, GraphSignalData
from typing import Union, Optional
class Postprocessor(NodeRanking):
def __init__(sel... | [
"pygrank.core.backend.sum",
"pygrank.algorithms.utils.call",
"pygrank.core.signals.to_signal",
"pygrank.core.backend.max",
"pygrank.core.backend.min",
"pygrank.core.backend.abs",
"pygrank.algorithms.utils.remove_used_args",
"pygrank.algorithms.utils.ensure_used_args"
] | [((621, 663), 'pygrank.algorithms.utils.remove_used_args', 'remove_used_args', (['self.ranker.rank', 'kwargs'], {}), '(self.ranker.rank, kwargs)\n', (637, 663), False, 'from pygrank.algorithms.utils import MethodHasher, call, ensure_used_args, remove_used_args\n'), ((2178, 2211), 'pygrank.core.signals.to_signal', 'to_s... |
import serial
steps_per_rev = 1540
arduino = serial.Serial('/dev/ttyUSB1',9600)
def bits_to_byte(bits):
byte = 0
if type(bits) != list:
raise TypeError("type must be list")
if len(bits) != 8:
raise ValueError("you must input 8 bits, no more or less")
for i in range(0,8):
if bits... | [
"serial.Serial"
] | [((45, 80), 'serial.Serial', 'serial.Serial', (['"""/dev/ttyUSB1"""', '(9600)'], {}), "('/dev/ttyUSB1', 9600)\n", (58, 80), False, 'import serial\n')] |
import argparse
import json
import torchvision
from torchvision.io import read_image, write_png
from torchvision.io.image import ImageReadMode
from torchvision.utils import draw_bounding_boxes
import torchvision.transforms.functional as F
import torch
from collections import Counter
from easydl.datasets.coco_detection... | [
"torchvision.io.write_png",
"argparse.ArgumentParser",
"torch.stack",
"torchvision.io.read_image",
"torchvision.models.detection.fasterrcnn_resnet50_fpn",
"torchvision.transforms.functional.convert_image_dtype",
"torchvision.utils.draw_bounding_boxes",
"json.dump"
] | [((370, 395), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (393, 395), False, 'import argparse\n'), ((516, 585), 'torchvision.models.detection.fasterrcnn_resnet50_fpn', 'torchvision.models.detection.fasterrcnn_resnet50_fpn', ([], {'pretrained': '(True)'}), '(pretrained=True)\n', (568, 585), F... |
import common.constants as cn
from common_python.testing import helpers
from common_python.util.persister import Persister
from classifier import \
main_multi_classifier_feature_optimizer as main
import numpy as np
import os
import pandas as pd
import unittest
IGNORE_TEST = False
IS_REPORT = False
FILENAME = "... | [
"os.path.exists",
"common_python.testing.helpers.isValidDataFrame",
"classifier.main_multi_classifier_feature_optimizer._getData",
"common_python.util.persister.Persister",
"classifier.main_multi_classifier_feature_optimizer._makePath",
"os.path.join",
"unittest.main",
"classifier.main_multi_classifie... | [((420, 447), 'os.path.join', 'os.path.join', (['DIR', 'FILENAME'], {}), '(DIR, FILENAME)\n', (432, 447), False, 'import os\n'), ((374, 401), 'os.path.abspath', 'os.path.abspath', (['"""__file__"""'], {}), "('__file__')\n", (389, 401), False, 'import os\n'), ((2313, 2328), 'unittest.main', 'unittest.main', ([], {}), '(... |
from setuptools import setup, find_packages
with open("README.md", "r") as readme_file:
readme = readme_file.read()
requirements = ["numpy>=1.21", "Pillow>=8.4", "setuptools>=57", "scikit-image>=0.19","patchify>=0.2.3"]
extra_test = [
'pytest>=4',
'pytest-cov>=2',
]
extra_dev = [
*extra_test,
]
set... | [
"setuptools.find_packages"
] | [((648, 663), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (661, 663), False, 'from setuptools import setup, find_packages\n')] |
import sys
def check_leap_year(year):
if (year % 4) == 0:
if (year % 100) == 0:
if (year % 400) == 0:
return 1
else:
return 0
else:
return 1
else:
return 0
def get_next_date(dd, mm, yy):
if check_leap_year(yy)... | [
"sys.exit"
] | [((1719, 1730), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (1727, 1730), False, 'import sys\n'), ((1801, 1812), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (1809, 1812), False, 'import sys\n'), ((1883, 1894), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (1891, 1894), False, 'import sys\n'), ((1565, 1576), '... |
import sys
from copy import deepcopy
ALPHABET = ['A', 'C', 'G', 'T']
def RepresentsInt(s):
try:
int(s)
return True
except ValueError:
return False
def process_input(adj_list):
for edge in adj_list:
if RepresentsInt(edge[0]) and RepresentsInt(edge[1]):
break
... | [
"sys.stdin.read",
"copy.deepcopy"
] | [((6845, 6863), 'copy.deepcopy', 'deepcopy', (['adj_list'], {}), '(adj_list)\n', (6853, 6863), False, 'from copy import deepcopy\n'), ((6879, 6897), 'copy.deepcopy', 'deepcopy', (['adj_list'], {}), '(adj_list)\n', (6887, 6897), False, 'from copy import deepcopy\n'), ((7622, 7640), 'copy.deepcopy', 'deepcopy', (['adj_li... |
from sys import argv, exit as sys_exit
from PyQt5.QtWidgets import QApplication
if __name__ == '__main__':
from gui import SecretCodeWindow
app = QApplication(argv)
win = SecretCodeWindow()
win.show()
sys_exit(app.exec_()) | [
"gui.SecretCodeWindow",
"PyQt5.QtWidgets.QApplication"
] | [((156, 174), 'PyQt5.QtWidgets.QApplication', 'QApplication', (['argv'], {}), '(argv)\n', (168, 174), False, 'from PyQt5.QtWidgets import QApplication\n'), ((186, 204), 'gui.SecretCodeWindow', 'SecretCodeWindow', ([], {}), '()\n', (202, 204), False, 'from gui import SecretCodeWindow\n')] |
from django.urls import path, include
from . import views
urlpatterns = [
path("", views.index, name="index"),
path("removecity", views.removeCity, name="removecity"),
path("removeallcities", views.removeAllCities, name="removeallcities")
]
| [
"django.urls.path"
] | [((79, 114), 'django.urls.path', 'path', (['""""""', 'views.index'], {'name': '"""index"""'}), "('', views.index, name='index')\n", (83, 114), False, 'from django.urls import path, include\n'), ((120, 175), 'django.urls.path', 'path', (['"""removecity"""', 'views.removeCity'], {'name': '"""removecity"""'}), "('removeci... |
import datetime
from django.test import TestCase
from django.utils import timezone
from django.urls import reverse
from .models import Game
def create_question(question_text, days):
"""
Create a question with the given `question_text` and published the
given number of `days` offset to now (negative fo... | [
"django.utils.timezone.now",
"datetime.timedelta"
] | [((433, 447), 'django.utils.timezone.now', 'timezone.now', ([], {}), '()\n', (445, 447), False, 'from django.utils import timezone\n'), ((450, 479), 'datetime.timedelta', 'datetime.timedelta', ([], {'days': 'days'}), '(days=days)\n', (468, 479), False, 'import datetime\n'), ((791, 805), 'django.utils.timezone.now', 'ti... |
from django import forms
from django_countries.fields import CountryField
from workshops.models import (
Language,
Person,
TrainingProgress,
TrainingRequirement,
)
from workshops.forms import BootstrapHelper
# this is used instead of Django Autocomplete Light widgets
# see issue #1330: https://github.... | [
"workshops.models.Person._meta.get_field",
"django_countries.fields.CountryField",
"django.forms.CharField",
"workshops.forms.BootstrapHelper",
"django.forms.URLField",
"workshops.fields.ModelSelect2MultipleWidget",
"workshops.models.TrainingRequirement.objects.filter",
"workshops.models.Language.obje... | [((499, 545), 'django.forms.CharField', 'forms.CharField', ([], {'disabled': '(True)', 'required': '(False)'}), '(disabled=True, required=False)\n', (514, 545), False, 'from django import forms\n'), ((754, 924), 'django.forms.CharField', 'forms.CharField', ([], {'disabled': '(True)', 'required': '(False)', 'help_text':... |
import warnings
warnings.filterwarnings('ignore')
import multiprocessing as mp
try:
mp.set_start_method('spawn')
except RuntimeError:
pass
nlp=None
ENGLISH=None
stopwords=set()
MANIFEST={}
spellingd={}
DEFAULT_NUM_PROC=4
PARALLELIZED_CMDS=['preprocess']
PART_REFERRING_CMDS=['install','preprocess','zip','upload','sh... | [
"logging.basicConfig",
"multiprocessing.set_start_method",
"os.path.join",
"os.path.realpath",
"os.path.dirname",
"warnings.filterwarnings",
"os.path.expanduser"
] | [((16, 49), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (39, 49), False, 'import warnings, six, shutil\n'), ((1391, 1424), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (1414, 1424), False, 'import warnings, six, shutil\n'... |
# Copyright (c) OpenMMLab. All rights reserved.
import os.path as osp
import warnings
import numpy as np
import onnxruntime as ort
import torch
from torch import nn
from mmedit.models import BaseMattor, BasicRestorer, build_model
def inference_with_session(sess, io_binding, output_names, input_tensor):
device_t... | [
"os.path.exists",
"onnxruntime.get_device",
"onnxruntime.SessionOptions",
"onnxruntime.InferenceSession",
"torch.from_numpy",
"mmcv.ops.get_onnxruntime_op_path",
"mmedit.models.build_model",
"warnings.warn",
"torch.cat"
] | [((2347, 2369), 'torch.from_numpy', 'torch.from_numpy', (['pred'], {}), '(pred)\n', (2363, 2369), False, 'import torch\n'), ((3543, 3563), 'onnxruntime.SessionOptions', 'ort.SessionOptions', ([], {}), '()\n', (3561, 3563), True, 'import onnxruntime as ort\n'), ((3620, 3650), 'os.path.exists', 'osp.exists', (['ort_custo... |
"""
Custom callback to save output images to TensorBoard.
Author: <NAME>
Date Created: 2020-05-14
"""
import tensorflow as tf
from tensorflow.keras.callbacks import Callback
from PIL import Image
from io import BytesIO
class SaveImagesCallback(Callback):
"""Saves model output images to TensorBoard directory.
... | [
"tensorflow.cast"
] | [((1548, 1583), 'tensorflow.cast', 'tf.cast', (['(fake_image * 255)', 'tf.int32'], {}), '(fake_image * 255, tf.int32)\n', (1555, 1583), True, 'import tensorflow as tf\n'), ((1738, 1774), 'tensorflow.cast', 'tf.cast', (['(blank_image * 255)', 'tf.int32'], {}), '(blank_image * 255, tf.int32)\n', (1745, 1774), True, 'impo... |
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 13 14:52:52 2019
@author: yifan
"""
import csv, time, random, math
from mpi4py import MPI
import numpy
def eucl_distance(point_one, point_two):#计算两点欧式距离
if(len(point_one) != len(point_two)):
raise Exception("Error: non comparable points")
... | [
"math.sqrt",
"numpy.array",
"numpy.zeros",
"mpi4py.MPI.Finalize",
"time.time"
] | [((486, 505), 'math.sqrt', 'math.sqrt', (['sum_diff'], {}), '(sum_diff)\n', (495, 505), False, 'import csv, time, random, math\n'), ((1562, 1573), 'time.time', 'time.time', ([], {}), '()\n', (1571, 1573), False, 'import csv, time, random, math\n'), ((3111, 3125), 'mpi4py.MPI.Finalize', 'MPI.Finalize', ([], {}), '()\n',... |
import numpy as np
import pykin.utils.transform_utils as t_utils
import pykin.utils.kin_utils as k_utils
import pykin.kinematics.jacobian as jac
from pykin.planners.planner import Planner
from pykin.utils.error_utils import OriValueError, CollisionError
from pykin.utils.kin_utils import ShellColors as sc, logging_ti... | [
"numpy.identity",
"pykin.utils.log_utils.create_logger",
"pykin.utils.transform_utils.get_quaternion_from_rpy",
"pykin.utils.error_utils.OriValueError",
"pykin.utils.kin_utils.calc_pose_error",
"pykin.utils.transform_utils.get_linear_interpoation",
"pykin.utils.error_utils.CollisionError",
"numpy.asar... | [((467, 510), 'pykin.utils.log_utils.create_logger', 'create_logger', (['"""Cartesian Planner"""', '"""debug"""'], {}), "('Cartesian Planner', 'debug')\n", (480, 510), False, 'from pykin.utils.log_utils import create_logger\n'), ((6242, 6253), 'numpy.zeros', 'np.zeros', (['(7)'], {}), '(7)\n', (6250, 6253), True, 'impo... |
# SPDX-FileCopyrightText: 2018 <NAME> for Adafruit Industries
#
# SPDX-License-Identifier: MIT
import random
import time
import board
import digitalio
import neopixel
pixel_pin = board.D10 # The pin the NeoPixels are connected to
button_switch_pin = board.D9 # Pin button is attached to
vibration_switch_pin = board... | [
"digitalio.DigitalInOut",
"neopixel.NeoPixel",
"random.randint",
"time.monotonic"
] | [((502, 577), 'neopixel.NeoPixel', 'neopixel.NeoPixel', (['pixel_pin', 'pixel_count'], {'brightness': '(0.4)', 'auto_write': '(False)'}), '(pixel_pin, pixel_count, brightness=0.4, auto_write=False)\n', (519, 577), False, 'import neopixel\n'), ((621, 662), 'digitalio.DigitalInOut', 'digitalio.DigitalInOut', (['button_sw... |
# Copyright 2020, Battelle Energy Alliance, LLC
# ALL RIGHTS RESERVED
import random
import numpy as np
def initialize(self, runInfo, inputs):
seed = 9491
random.seed(seed)
def run(self,Input):
# intput:
# output:
numberDaysSD = float(random.randint(10,30))
costPerDay = 0.8 + 0.4 * random.random()
cos... | [
"numpy.ones",
"random.random",
"random.randint",
"random.seed"
] | [((159, 176), 'random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (170, 176), False, 'import random\n'), ((247, 269), 'random.randint', 'random.randint', (['(10)', '(30)'], {}), '(10, 30)\n', (261, 269), False, 'import random\n'), ((381, 408), 'numpy.ones', 'np.ones', (["Input['time'].size"], {}), "(Input['time']... |
from time import sleep
from .core import Attempt, Question, TestCase
import pymongo
import random
def _attempt_checker(mongo_uri):
db = pymongo.MongoClient(mongo_uri)
db = db.openjudge
while True:
attempt = db.attempt_queue.find_one_and_delete({})
if attempt is None:
sleep(rand... | [
"pymongo.MongoClient",
"random.random"
] | [((142, 172), 'pymongo.MongoClient', 'pymongo.MongoClient', (['mongo_uri'], {}), '(mongo_uri)\n', (161, 172), False, 'import pymongo\n'), ((316, 331), 'random.random', 'random.random', ([], {}), '()\n', (329, 331), False, 'import random\n')] |
from aspose.email import MailMessage
from aspose.email.storage.pst import *
from aspose.email.mime import HeaderCollection
import aspose.email.mapi.msg as msg
from aspose.email.mapi import MapiMessage, MapiProperty, MapiMessageFlags
def run():
dataDir = "Data/"
#ExStart: SavingMessageInDraftStatus
# Create an insta... | [
"aspose.email.mapi.MapiMessage"
] | [((363, 376), 'aspose.email.mapi.MapiMessage', 'MapiMessage', ([], {}), '()\n', (374, 376), False, 'from aspose.email.mapi import MapiMessage, MapiProperty, MapiMessageFlags\n')] |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-08-24 17:36
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('golf', '0028_tournamentdate_date'),
]
... | [
"django.db.models.IntegerField",
"django.db.models.ForeignKey"
] | [((446, 573), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'blank': '(True)', 'null': '(True)', 'on_delete': 'django.db.models.deletion.CASCADE', 'to': '"""golf.Club"""', 'verbose_name': '"""Club"""'}), "(blank=True, null=True, on_delete=django.db.models.\n deletion.CASCADE, to='golf.Club', verbose_name... |
# -*- coding: utf-8 -*-
from __future__ import division
import random
from operator import itemgetter
import numpy as np
from common.gamestate import BoardState
def other_player(player_id):
if player_id == 1:
return 2
elif player_id == 2:
return 1
def state_transition(player_id, state, a... | [
"random.choice",
"numpy.random.choice",
"common.gamestate.BoardState",
"numpy.array",
"operator.itemgetter"
] | [((2650, 2681), 'random.choice', 'random.choice', (['possible_actions'], {}), '(possible_actions)\n', (2663, 2681), False, 'import random\n'), ((3197, 3239), 'numpy.random.choice', 'np.random.choice', (['actions'], {'p': 'probabilities'}), '(actions, p=probabilities)\n', (3213, 3239), True, 'import numpy as np\n'), ((4... |
import numpy as np
import seaborn as sns
import matplotlib.pylab as plt
import math
import os
import pandas as pd
import re
def search_year(year, years):
for idx, _year in enumerate(years):
if idx == len(years) -1:
continue
if year >= _year and year < years[idx + 1]:
return ... | [
"os.path.exists",
"math.ceil",
"os.makedirs",
"matplotlib.pylab.tight_layout",
"matplotlib.pylab.figure",
"matplotlib.pylab.title",
"os.path.join",
"seaborn.heatmap",
"numpy.sum",
"numpy.zeros",
"pandas.DataFrame",
"re.search"
] | [((10689, 10723), 'numpy.zeros', 'np.zeros', (['topic_numbers'], {'dtype': 'int'}), '(topic_numbers, dtype=int)\n', (10697, 10723), True, 'import numpy as np\n'), ((12076, 12100), 'numpy.zeros', 'np.zeros', (['(150)'], {'dtype': 'int'}), '(150, dtype=int)\n', (12084, 12100), True, 'import numpy as np\n'), ((22191, 2222... |
import turtle
import random
x=150
def square(turtle,x):
turtle.fd(x)
turtle.right(90)
def draw():
x=150
t=turtle.Turtle()
t.speed(0)
t.color("yellow")
s=turtle.Screen()
s.colormode(255)
s.bgcolor("black")
for i in range(1000):
r=random.randint(1,255)
g=random.rand... | [
"turtle.right",
"turtle.Turtle",
"turtle.fd",
"turtle.Screen",
"random.randint"
] | [((60, 72), 'turtle.fd', 'turtle.fd', (['x'], {}), '(x)\n', (69, 72), False, 'import turtle\n'), ((77, 93), 'turtle.right', 'turtle.right', (['(90)'], {}), '(90)\n', (89, 93), False, 'import turtle\n'), ((122, 137), 'turtle.Turtle', 'turtle.Turtle', ([], {}), '()\n', (135, 137), False, 'import turtle\n'), ((181, 196), ... |
#!/usr/bin/env python3
import argparse
import glob
import os
import send2trash
script_info = ("""
Script to make a Manifest.csv file for importing fastq.gz files into a qiime 2 environment.
To Install:
Open Qiime2 conda environment
Install python package "send2trash" using: pip install send2trash
Put ... | [
"argparse.ArgumentParser",
"os.path.split",
"os.path.isfile",
"os.path.abspath",
"send2trash.send2trash",
"glob.glob"
] | [((2446, 2469), 'os.path.isfile', 'os.path.isfile', (['file_in'], {}), '(file_in)\n', (2460, 2469), False, 'import os\n'), ((3171, 3197), 'os.path.abspath', 'os.path.abspath', (['directory'], {}), '(directory)\n', (3186, 3197), False, 'import os\n'), ((3302, 3336), 'glob.glob', 'glob.glob', (["(dir_abs + '/*.fastq.gz')... |
# Copyright 2021 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 applica... | [
"python_fuzzing.FuzzingHelper",
"atheris.Setup",
"atheris.Fuzz",
"atheris.instrument_imports",
"tensorflow.raw_ops.RaggedCountSparseOutput"
] | [((783, 811), 'atheris.instrument_imports', 'atheris.instrument_imports', ([], {}), '()\n', (809, 811), False, 'import atheris\n'), ((1052, 1078), 'python_fuzzing.FuzzingHelper', 'FuzzingHelper', (['input_bytes'], {}), '(input_bytes)\n', (1065, 1078), False, 'from python_fuzzing import FuzzingHelper\n'), ((1377, 1443),... |
#!/usr/bin/env python
"""The setup script."""
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
"numpy==1.20.3",
"scipy==1.7.0",
"Cython==0.29.2... | [
"setuptools.find_packages"
] | [((1404, 1445), 'setuptools.find_packages', 'find_packages', ([], {'include': "['bore', 'bore.*']"}), "(include=['bore', 'bore.*'])\n", (1417, 1445), False, 'from setuptools import setup, find_packages\n')] |
# Copyright (c) 2019 CyPhyHouse. All Rights Reserved.
import pickle
import socket
import src.objects.message as message
MAX_UDP_SIZE = 65507 # https://en.wikipedia.org/wiki/User_Datagram_Protocol
def send(msg: message.Message, ip: str, port: int, retry=1) -> None:
"""
:param msg: message to be sent
:... | [
"pickle.dumps",
"socket.socket"
] | [((600, 648), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_DGRAM'], {}), '(socket.AF_INET, socket.SOCK_DGRAM)\n', (613, 648), False, 'import socket\n'), ((786, 803), 'pickle.dumps', 'pickle.dumps', (['msg'], {}), '(msg)\n', (798, 803), False, 'import pickle\n')] |
# coding: utf-8
from django.conf.urls.defaults import patterns, include, url
from django.views.generic import TemplateView
from registration.views import LoginView
urlpatterns = patterns('',
(r'^accounts/', include('registration.backends.default.urls')),
url(r'^login/', LoginView.as_view(), name='login'),
... | [
"django.views.generic.TemplateView.as_view",
"registration.views.LoginView.as_view",
"django.conf.urls.defaults.include"
] | [((212, 257), 'django.conf.urls.defaults.include', 'include', (['"""registration.backends.default.urls"""'], {}), "('registration.backends.default.urls')\n", (219, 257), False, 'from django.conf.urls.defaults import patterns, include, url\n'), ((280, 299), 'registration.views.LoginView.as_view', 'LoginView.as_view', ([... |
import pytest
from PySide2 import QtWidgets
import sys
from numpy import ones
from SciDataTool import DataTime, DataLinspace
class TestGUI(object):
@classmethod
def setup_class(cls):
"""Run at the begining of every test to setup the gui"""
if not QtWidgets.QApplication.instance():
... | [
"SciDataTool.DataTime",
"numpy.ones",
"PySide2.QtWidgets.QApplication.instance",
"PySide2.QtWidgets.QApplication",
"SciDataTool.DataLinspace"
] | [((462, 529), 'SciDataTool.DataLinspace', 'DataLinspace', ([], {'name': '"""time"""', 'unit': '"""s"""', 'initial': '(0)', 'final': '(10)', 'number': '(11)'}), "(name='time', unit='s', initial=0, final=10, number=11)\n", (474, 529), False, 'from SciDataTool import DataTime, DataLinspace\n'), ((550, 558), 'numpy.ones', ... |
#!/usr/bin/env python3
# Advent of Code 2016 - Day 1
# Using turtle graphics to find the location of Easter Bunny HQ.
# It's slow, but draws pretty maps.
import sys
import turtle
if len(sys.argv) < 2:
print("Usage: {} puzzle.txt".format(sys.argv[0]))
sys.exit(1)
with open(sys.argv[1]) as f:
# init turtle... | [
"turtle.position",
"turtle.setheading",
"turtle.right",
"turtle.home",
"turtle.speed",
"turtle.ycor",
"turtle.left",
"sys.exit",
"turtle.xcor"
] | [((261, 272), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (269, 272), False, 'import sys\n'), ((339, 362), 'turtle.speed', 'turtle.speed', (['"""fastest"""'], {}), "('fastest')\n", (351, 362), False, 'import turtle\n'), ((367, 380), 'turtle.home', 'turtle.home', ([], {}), '()\n', (378, 380), False, 'import turtle\n... |
###################################################################################################
# Copyright (c) 2021 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restr... | [
"numpy.product",
"tensorflow.shape_n",
"tensorflow.py_function",
"tensorflow.dynamic_stitch",
"tensorflow.GradientTape",
"tensorflow.range",
"tensorflow.constant",
"base.custom_lbfgs.Struct",
"tensorflow.dynamic_partition",
"tensorflow.reshape",
"numpy.finfo",
"tensorflow.cast"
] | [((2416, 2453), 'tensorflow.shape_n', 'tf.shape_n', (['model.trainable_variables'], {}), '(model.trainable_variables)\n', (2426, 2453), True, 'import tensorflow as tf\n'), ((2899, 2916), 'tensorflow.constant', 'tf.constant', (['part'], {}), '(part)\n', (2910, 2916), True, 'import tensorflow as tf\n'), ((2736, 2756), 'n... |
"""Point metrics for forecasting a single point per time step."""
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
import scipy.stats
import torch
import torch.nn.functional as F
from torch.nn.utils import rnn
from pytorch_forecasting.metrics.base_metrics import MultiHorizonMetric
from pytorch_for... | [
"torch.exp",
"torch.arange",
"pytorch_forecasting.utils.unpack_sequence",
"torch.cat"
] | [((5040, 5063), 'pytorch_forecasting.utils.unpack_sequence', 'unpack_sequence', (['target'], {}), '(target)\n', (5055, 5063), False, 'from pytorch_forecasting.utils import create_mask, unpack_sequence, unsqueeze_like\n'), ((5320, 5343), 'pytorch_forecasting.utils.unpack_sequence', 'unpack_sequence', (['target'], {}), '... |
import tkinter as tk
from animation import Animation
anim=Animation()
root=tk.Tk()
root.geometry("{}x{}".format(200, 300))
tk.Button(root, text="resize", command=lambda: anim.resize(root,500,400,20,5)).pack()
root.mainloop()
| [
"animation.Animation",
"tkinter.Tk"
] | [((59, 70), 'animation.Animation', 'Animation', ([], {}), '()\n', (68, 70), False, 'from animation import Animation\n'), ((78, 85), 'tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (83, 85), True, 'import tkinter as tk\n')] |
#!/usr/bin/env python
# coding: utf-8
# <div class="alert alert-block alert-info">
# <b><h1>ENGR 1330 Computational Thinking with Data Science </h1></b>
# </div>
#
# Copyright © 2021 <NAME> and <NAME>
#
# Last GitHub Commit Date:
#
# # 15: The `matplotlib` package
# - explore different types of plots
# -... | [
"pandas.read_csv",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.barh",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.scatter",
"pandas.DataFrame",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotli... | [((5090, 5117), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(10, 5)'}), '(figsize=(10, 5))\n', (5100, 5117), True, 'from matplotlib import pyplot as plt\n'), ((5197, 5252), 'matplotlib.pyplot.bar', 'plt.bar', (['flavors', 'cartons'], {'color': '"""lightblue"""', 'width': '(0.4)'}), "(flavors, cartons, c... |
import numpy as np
import pandas as pd
from loguru import logger
def count_column_values_within_ranges(df_inp, column_name, bins=None):
"""
Count the number of values of a specific column according to the define ranges.
:param pd.DataFrame df_inp: pandas dataframe
:param column_name: column name to b... | [
"loguru.logger.warning",
"numpy.arange"
] | [((432, 455), 'numpy.arange', 'np.arange', (['(0)', '(7000)', '(100)'], {}), '(0, 7000, 100)\n', (441, 455), True, 'import numpy as np\n'), ((1602, 1671), 'loguru.logger.warning', 'logger.warning', (['"""No bins specified, will use a default range 0-10000"""'], {}), "('No bins specified, will use a default range 0-1000... |
#!/usr/bin/env python
# Columbia Engineering
# MECS 4603 - Fall 2017
import math
import numpy
import time
import rospy
import random
from std_msgs.msg import Header
from geometry_msgs.msg import Pose2D
from state_estimator.msg import RobotPose
from state_estimator.msg import SensorData
from state_estimator.msg impor... | [
"numpy.random.normal",
"state_estimator.msg.Landmark",
"state_estimator.msg.RobotPose",
"rospy.init_node",
"math.sqrt",
"state_estimator.msg.SensorData",
"math.sin",
"rospy.Time.now",
"math.cos",
"state_estimator.msg.LandmarkSet",
"math.fabs",
"rospy.spin",
"math.atan2",
"state_estimator.m... | [((458, 468), 'state_estimator.msg.Landmark', 'Landmark', ([], {}), '()\n', (466, 468), False, 'from state_estimator.msg import Landmark\n'), ((4985, 5036), 'rospy.init_node', 'rospy.init_node', (['"""mobile_robot_sim"""'], {'anonymous': '(True)'}), "('mobile_robot_sim', anonymous=True)\n", (5000, 5036), False, 'import... |
from piccolo.apps.migrations.commands.base import BaseMigrationManager
from piccolo.apps.migrations.tables import Migration
from piccolo.utils.printing import get_fixed_length_string
class CheckMigrationManager(BaseMigrationManager):
def __init__(self, app_name: str):
self.app_name = app_name
supe... | [
"piccolo.apps.migrations.tables.Migration.exists",
"piccolo.utils.printing.get_fixed_length_string"
] | [((982, 1015), 'piccolo.utils.printing.get_fixed_length_string', 'get_fixed_length_string', (['app_name'], {}), '(app_name)\n', (1005, 1015), False, 'from piccolo.utils.printing import get_fixed_length_string\n'), ((1538, 1566), 'piccolo.utils.printing.get_fixed_length_string', 'get_fixed_length_string', (['_id'], {}),... |
import cv2
import os
import numpy as np
import traceback
from time import *
import winsound
import pyttsx3
# s1,s2:就是识别人的名字
subjects = ["stranger", "hfp", "lc"]
def menu():
"""菜单"""
print("*"*10 + "人脸识别系统" + "*"*10)
print("*"*10 + "菜单" + "*"*10)
print("*"*5 + "1、进行检测" + "*"*8)
... | [
"cv2.rectangle",
"cv2.face.LBPHFaceRecognizer_create",
"cv2.imshow",
"numpy.array",
"cv2.destroyAllWindows",
"cv2.CascadeClassifier",
"os.listdir",
"cv2.VideoWriter",
"cv2.VideoWriter_fourcc",
"traceback.print_exc",
"cv2.waitKey",
"cv2.putText",
"cv2.cvtColor",
"cv2.imread",
"cv2.imwrite... | [((550, 569), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (566, 569), False, 'import cv2\n'), ((612, 733), 'cv2.CascadeClassifier', 'cv2.CascadeClassifier', (['"""G:\\\\Opencv 4.5.3\\\\opencv\\\\build\\\\etc\\\\lbpcascades\\\\lbpcascade_frontalface_improved.xml"""'], {}), "(\n 'G:\\\\Opencv 4.5.3... |
""" Unit tests for the units library."""
from six.moves import cStringIO
import math
import os
import unittest
from openmdao.test.util import assert_rel_error
from openmdao.units import PhysicalQuantity, NumberDict, UnitsOnlyPQ, PhysicalUnit, convert_units, get_conversion_tuple
from openmdao.units.units impo... | [
"openmdao.units.units.add_unit",
"openmdao.units.units.import_library",
"openmdao.units.units.add_offset_unit",
"math.tan",
"openmdao.units.PhysicalQuantity",
"openmdao.units.convert_units",
"openmdao.units.get_conversion_tuple",
"math.cos",
"os.path.dirname",
"openmdao.test.util.assert_rel_error"... | [((2465, 2492), 'openmdao.units.units.import_library', 'import_library', (['default_lib'], {}), '(default_lib)\n', (2479, 2492), False, 'from openmdao.units.units import import_library, add_unit, add_offset_unit\n'), ((27411, 27426), 'unittest.main', 'unittest.main', ([], {}), '()\n', (27424, 27426), False, 'import uni... |
import sys
sys.path.append(r"C:\Projekte\01_eydamPrototyping\mp_modbus")
import mp_modbus
srv = mp_modbus.modbus_tcp_server("127.0.0.1", 503, context={
"co":{"startAddr": 1000, "registers": bytearray([0xFF, 0x00, 0x00, 0x00]*5)},
"di":{"startAddr": 1000, "registers": bytearray([0xFF, 0x00, 0x00, 0x00]*5)},
... | [
"sys.path.append"
] | [((11, 74), 'sys.path.append', 'sys.path.append', (['"""C:\\\\Projekte\\\\01_eydamPrototyping\\\\mp_modbus"""'], {}), "('C:\\\\Projekte\\\\01_eydamPrototyping\\\\mp_modbus')\n", (26, 74), False, 'import sys\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Project: Fable Input Output
# https://github.com/silx-kit/fabio
#
# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
#
# Principal author: <NAME> (<EMAIL>)
#
# This program is free software: you can redistribute it an... | [
"logging.getLogger",
"unittest.TestSuite",
"fabio.edfimage.EdfImage",
"fabio.dtrekimage.DtrekImage",
"fabio.brukerimage.BrukerImage",
"fabio.openimage.openimage",
"fabio.fit2dmaskimage.Fit2dMaskImage",
"fabio.OXDimage.OXDimage",
"unittest.TextTestRunner",
"fabio.marccdimage.MarccdImage"
] | [((1137, 1164), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1154, 1164), False, 'import logging\n'), ((7259, 7279), 'unittest.TestSuite', 'unittest.TestSuite', ([], {}), '()\n', (7277, 7279), False, 'import unittest\n'), ((7626, 7651), 'unittest.TextTestRunner', 'unittest.TextTestRunn... |
import os
import numpy as np
import matplotlib.pyplot as plt
import torch
from torchvision import transforms
from torch.utils.data import DataLoader
from model import VAELightningModule
from data import CelebADataset
def generate_samples(checkpoint_path, z=512, num_samples=16, save_dir="plots"):
print("Startin... | [
"os.path.join",
"model.VAELightningModule.load_from_checkpoint",
"data.CelebADataset",
"torch.normal",
"torch.utils.data.DataLoader",
"matplotlib.pyplot.subplots"
] | [((354, 410), 'model.VAELightningModule.load_from_checkpoint', 'VAELightningModule.load_from_checkpoint', (['checkpoint_path'], {}), '(checkpoint_path)\n', (393, 410), False, 'from model import VAELightningModule\n'), ((506, 566), 'torch.normal', 'torch.normal', ([], {'mean': '(0.0)', 'std': '(1.0)', 'size': '(num_samp... |
"""
`dumpsqsh` - a tool for viewing or extracting SquashFS contents
Author: (C) 2019 <NAME> <<EMAIL>>
"""
import struct
from binascii import b2a_hex
import datetime
import os
import os.path
import lzma
import zlib
try:
import lzo
except ImportError:
lzo = False
try:
import lz4.block
except ImportError:... | [
"datetime.datetime.utcfromtimestamp",
"lzo.decompress",
"argparse.ArgumentParser",
"binascii.b2a_hex",
"os.path.join",
"zstd.decompress",
"lzma.decompress",
"struct.unpack",
"zlib.decompress",
"struct.unpack_from"
] | [((33651, 33706), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""SQUASHFS dumper."""'}), "(description='SQUASHFS dumper.')\n", (33674, 33706), False, 'import argparse\n'), ((3186, 3243), 'struct.unpack', 'struct.unpack', (["(fs.byteorder + '4H2L')", 'data[:self.MINSIZE]'], {}), "(fs.byte... |
import logging
from celery import task
logger = logging.getLogger('celery.task')
@task
def update_avatars():
"""
Proceed the avatars update
"""
from helpers import AvatarHelper
expired = AvatarHelper.list_expired(sources=['gravatar', 'url'])
if expired:
logger.info('There are %s ex... | [
"logging.getLogger",
"helpers.AvatarHelper.list_expired",
"helpers.AvatarHelper.update"
] | [((50, 82), 'logging.getLogger', 'logging.getLogger', (['"""celery.task"""'], {}), "('celery.task')\n", (67, 82), False, 'import logging\n'), ((212, 266), 'helpers.AvatarHelper.list_expired', 'AvatarHelper.list_expired', ([], {'sources': "['gravatar', 'url']"}), "(sources=['gravatar', 'url'])\n", (237, 266), False, 'fr... |
from dataclasses import dataclass, field
from datetime import datetime
import vigorish.database as db
from vigorish.enums import DataSet
from vigorish.patch.base import Patch, PatchList
from vigorish.util.dt_format_strings import DATE_ONLY
from vigorish.util.result import Result
@dataclass
class BBRefGamesForDatePat... | [
"datetime.datetime.strptime",
"vigorish.util.result.Result.Ok",
"vigorish.database.GameScrapeStatus.find_by_bbref_game_id",
"dataclasses.field"
] | [((887, 904), 'dataclasses.field', 'field', ([], {'repr': '(False)'}), '(repr=False)\n', (892, 904), False, 'from dataclasses import dataclass, field\n'), ((794, 809), 'vigorish.util.result.Result.Ok', 'Result.Ok', (['data'], {}), '(data)\n', (803, 809), False, 'from vigorish.util.result import Result\n'), ((1431, 1517... |
#
# Copyright (c) 2019 MagicStack Inc.
# All rights reserved.
#
# See LICENSE for details.
##
from django.http import JsonResponse
from django.views import View
from _django import models, serializers
from rest_framework import viewsets
class CustomView(View):
"""
Custom view that allows more explicit contr... | [
"django.http.JsonResponse"
] | [((693, 711), 'django.http.JsonResponse', 'JsonResponse', (['resp'], {}), '(resp)\n', (705, 711), False, 'from django.http import JsonResponse\n'), ((822, 852), 'django.http.JsonResponse', 'JsonResponse', (['resp'], {'safe': '(False)'}), '(resp, safe=False)\n', (834, 852), False, 'from django.http import JsonResponse\n... |
# -*- coding: utf-8 -*-
# Learn more: https://github.com/kennethreitz/setup.py
from setuptools import setup, find_packages
with open('README.rst') as f:
readme = f.read()
with open('LICENSE') as f:
license = f.read()
setup(
name='iDS_Longterm_Emissions',
version='0.1.0',
description='Package f... | [
"setuptools.find_packages"
] | [((502, 542), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "('tests', 'docs')"}), "(exclude=('tests', 'docs'))\n", (515, 542), False, 'from setuptools import setup, find_packages\n')] |
import ast
import logging
import six
import sys
TRUST_AST_TYPES = (ast.Call, ast.Module, ast.List, ast.Tuple, ast.Dict, ast.Name, ast.Num, ast.Str,
ast.Assign, ast.Load)
if sys.version_info[:2] == (3, 3):
TRUST_AST_TYPES = TRUST_AST_TYPES + (ast.Bytes,)
elif six.PY3:
TRUST_AST_TYPES = TRUS... | [
"logging.getLogger",
"ast.parse",
"ast.NodeVisitor.generic_visit"
] | [((854, 881), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (871, 881), False, 'import logging\n'), ((2616, 2657), 'ast.NodeVisitor.generic_visit', 'ast.NodeVisitor.generic_visit', (['self', 'node'], {}), '(self, node)\n', (2645, 2657), False, 'import ast\n'), ((2705, 2720), 'ast.parse',... |
#
# PYCONFR 2019 - PLB - <NAME>/NLP
#
import os
import sbttimport as si
import dataprocess as dp
import insightviz as iv
import pandas as pd
import cv2
import glob
package_directory = os.path.dirname(os.path.abspath(__file__))
class Orchestrator:
def __init__(self, nb=1, lang="fr"):
self.data_import = s... | [
"pandas.Series",
"cv2.imread",
"dataprocess.Process_NLP",
"cv2.VideoWriter_fourcc",
"os.path.abspath",
"pandas.concat",
"glob.glob",
"sbttimport.Data_import"
] | [((202, 227), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (217, 227), False, 'import os\n'), ((319, 351), 'sbttimport.Data_import', 'si.Data_import', ([], {'lang': 'lang', 'nb': 'nb'}), '(lang=lang, nb=nb)\n', (333, 351), True, 'import sbttimport as si\n'), ((726, 737), 'pandas.Series', 'p... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Liftaway Low-Level (GPIO and PCA) module."""
import random
import busio
import RPi.GPIO as GPIO
from adafruit_pca9685 import PCA9685
from board import SCL, SDA
from liftaway.constants import control_outputs
i2c_bus = busio.I2C(SCL, SDA)
pca = PCA9685(i2c_bus)
def i... | [
"random.choice",
"adafruit_pca9685.PCA9685",
"RPi.GPIO.output",
"busio.I2C",
"liftaway.constants.control_outputs.get",
"liftaway.constants.control_outputs.values"
] | [((270, 289), 'busio.I2C', 'busio.I2C', (['SCL', 'SDA'], {}), '(SCL, SDA)\n', (279, 289), False, 'import busio\n'), ((296, 312), 'adafruit_pca9685.PCA9685', 'PCA9685', (['i2c_bus'], {}), '(i2c_bus)\n', (303, 312), False, 'from adafruit_pca9685 import PCA9685\n'), ((2062, 2086), 'liftaway.constants.control_outputs.value... |
# Generated by Django 2.2.4 on 2019-09-01 11:34
from django.db import migrations, models
import podcasts.models.common
class Migration(migrations.Migration):
dependencies = [
('podcasts', '0002_episode_image'),
]
operations = [
migrations.AlterField(
model_name='podcast',
... | [
"django.db.models.ImageField"
] | [((362, 490), 'django.db.models.ImageField', 'models.ImageField', ([], {'blank': '(True)', 'null': '(True)', 'upload_to': 'podcasts.models.common.cover_image_filename', 'verbose_name': '"""Cover Image"""'}), "(blank=True, null=True, upload_to=podcasts.models.common.\n cover_image_filename, verbose_name='Cover Image'... |
import json
import os
from . import _dirpath
def get_credentials() -> dict:
"""
Get the credentials from Data/credentials.json
Returns:
dict -> key, secret
"""
with open(os.path.join(_dirpath, "..", "..", "Data", "credentials.json")) as jsonf:
creds = json.load(jsonf)
return cred... | [
"json.load",
"os.path.join"
] | [((287, 303), 'json.load', 'json.load', (['jsonf'], {}), '(jsonf)\n', (296, 303), False, 'import json\n'), ((197, 259), 'os.path.join', 'os.path.join', (['_dirpath', '""".."""', '""".."""', '"""Data"""', '"""credentials.json"""'], {}), "(_dirpath, '..', '..', 'Data', 'credentials.json')\n", (209, 259), False, 'import o... |
"""
Requires matplotlib
pipenv install matplotlib
python plot.py
"""
import yaml
import numpy
import matplotlib.pyplot as plt
from connected_conics import conic, helpers
fullspec = """
- r: [8]
e: [0.0]
d: 6.0
- r: [9]
e: [0.5]
d: 10.0
- r: [11]
e: [1.1]
d: 12.0
"""
fullspec_dict = yaml.safe_load(fullspec)... | [
"connected_conics.conic.find_val_vectorized",
"connected_conics.helpers.get_conic_from_fullspec",
"matplotlib.pyplot.plot",
"yaml.safe_load",
"numpy.linspace",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show"
] | [((296, 320), 'yaml.safe_load', 'yaml.safe_load', (['fullspec'], {}), '(fullspec)\n', (310, 320), False, 'import yaml\n'), ((325, 374), 'connected_conics.helpers.get_conic_from_fullspec', 'helpers.get_conic_from_fullspec', (['fullspec_dict', '(0)'], {}), '(fullspec_dict, 0)\n', (356, 374), False, 'from connected_conics... |
from difflib import SequenceMatcher
import importlib
from django.conf import settings
from django.db import IntegrityError
from .models import Alias
def default_comparison_function(a, b):
return SequenceMatcher(None, a, b).ratio()
class Domain:
_configurations = {}
def __init__(
self,
n... | [
"difflib.SequenceMatcher",
"importlib.import_module"
] | [((201, 228), 'difflib.SequenceMatcher', 'SequenceMatcher', (['None', 'a', 'b'], {}), '(None, a, b)\n', (216, 228), False, 'from difflib import SequenceMatcher\n'), ((1976, 2012), 'importlib.import_module', 'importlib.import_module', (['module_name'], {}), '(module_name)\n', (1999, 2012), False, 'import importlib\n')] |
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | [
"django_cloud_deploy.cloudlib.billing.BillingClient",
"absl.testing.absltest.main",
"django_cloud_deploy.tests.unit.cloudlib.lib.http_fake.HttpRequestFake"
] | [((4025, 4040), 'absl.testing.absltest.main', 'absltest.main', ([], {}), '()\n', (4038, 4040), False, 'from absl.testing import absltest\n'), ((1365, 1421), 'django_cloud_deploy.tests.unit.cloudlib.lib.http_fake.HttpRequestFake', 'http_fake.HttpRequestFake', (['BILLING_ACCOUNT_LIST_RESPONSE'], {}), '(BILLING_ACCOUNT_LI... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# #
# RMG Website - A Django-powered website for Reaction Mechanism Generator #
# ... | [
"django.shortcuts.render",
"django.shortcuts.get_object_or_404",
"numpy.exp",
"numpy.array",
"django.urls.reverse",
"numpy.arange"
] | [((2799, 2851), 'django.shortcuts.render', 'render', (['request', '"""pdep.html"""', "{'networks': networks}"], {}), "(request, 'pdep.html', {'networks': networks})\n", (2805, 2851), False, 'from django.shortcuts import render, get_object_or_404\n'), ((3472, 3513), 'django.shortcuts.get_object_or_404', 'get_object_or_4... |
# Generated by Django 3.2.11 on 2022-03-28 03:41
from django.db import migrations
import json
from teleband.musics.api.serializers import *
data = {
"name": "Air for Band",
"ensemble_type": "Band",
"parts": [
{
"name": "Air for Band Melody",
"part_type": "Melody",
... | [
"json.dumps",
"django.db.migrations.RunPython"
] | [((4715, 4783), 'django.db.migrations.RunPython', 'migrations.RunPython', (['update_site_forward', 'migrations.RunPython.noop'], {}), '(update_site_forward, migrations.RunPython.noop)\n', (4735, 4783), False, 'from django.db import migrations\n'), ((4400, 4453), 'json.dumps', 'json.dumps', (["flatios[part['name']][t['t... |
import numpy as np
import pickle
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import Dataset, DataLoader
import torch.optim as optim
import sys
from data_utils import *
from AIWAE_models import *
from sys import exit
import argparse
import time
import bisect
## parameter par... | [
"torch.optim.lr_scheduler.LambdaLR",
"argparse.ArgumentParser",
"torch.utils.data.DataLoader",
"torch.mean",
"pickle.load",
"bisect.bisect",
"sys.exit",
"numpy.cumsum"
] | [((333, 418), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Annealed Importance Weighted Auto-Encoder"""'}), "(description='Annealed Importance Weighted Auto-Encoder'\n )\n", (356, 418), False, 'import argparse\n'), ((1763, 1822), 'torch.utils.data.DataLoader', 'DataLoader', (['train... |
from . import util, config
from datetime import date
import sys
import re
import requests
from pathlib import Path
import json
import boto3
import gzip
DefaultVersion = 'v2'
class StatIds:
Combined = 'combined'
MedianTripTimes = 'median-trip-times'
AllStatIds = [
StatIds.Combined,
StatIds.MedianTripT... | [
"json.loads",
"pathlib.Path",
"json.dumps",
"re.match",
"requests.get",
"boto3.resource"
] | [((3727, 3747), 'requests.get', 'requests.get', (['s3_url'], {}), '(s3_url)\n', (3739, 3747), False, 'import requests\n'), ((4059, 4077), 'json.loads', 'json.loads', (['r.text'], {}), '(r.text)\n', (4069, 4077), False, 'import json\n'), ((6108, 6258), 'json.dumps', 'json.dumps', (["{'version': DefaultVersion, 'stat_id'... |
#
# Copyright 2013-2021 The Foundry Visionmongers Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | [
"pytest.fixture",
"openassetio._core.audit.auditApiCall",
"openassetio._core.audit.auditor"
] | [((1167, 1195), 'pytest.fixture', 'pytest.fixture', ([], {'autouse': '(True)'}), '(autouse=True)\n', (1181, 1195), False, 'import pytest\n'), ((3784, 3799), 'openassetio._core.audit.auditor', 'audit.auditor', ([], {}), '()\n', (3797, 3799), False, 'from openassetio._core import audit\n'), ((4435, 4480), 'openassetio._c... |
from typing import Dict
import dask.dataframe as dd
import numpy as np
import tensorflow as tf
from logger import get_logger
logger = get_logger(__name__)
def dd_tfrecord(df: dd.DataFrame, tfrecord_path: str) -> None:
feature_func = {
np.int64: lambda value: tf.train.Feature(int64_list=tf.train.Int64Li... | [
"logger.get_logger",
"tensorflow.reduce_sum",
"tensorflow.metrics.mean",
"tensorflow.train.Int64List",
"tensorflow.compat.as_bytes",
"tensorflow.reduce_mean",
"tensorflow.cast",
"tensorflow.nn.zero_fraction",
"tensorflow.metrics.accuracy",
"tensorflow.train.get_global_step",
"tensorflow.train.Fl... | [((137, 157), 'logger.get_logger', 'get_logger', (['__name__'], {}), '(__name__)\n', (147, 157), False, 'from logger import get_logger\n'), ((1697, 1718), 'dask.dataframe.read_csv', 'dd.read_csv', (['csv_path'], {}), '(csv_path)\n', (1708, 1718), True, 'import dask.dataframe as dd\n'), ((3004, 3045), 'tensorflow.summar... |
# Enthought library imports
from enable.api import Component, ComponentEditor
from traits.api import HasTraits, Instance, Property, Int, Float, Array, Range, cached_property
from traitsui.api import Item, View, Group
# Chaco imports
from chaco.api import ArrayDataSource, MultiArrayDataSource, DataRange1D, \
Li... | [
"traits.api.Instance",
"chaco.api.LinearMapper",
"chaco.api.DataRange1D",
"chaco.api.ArrayDataSource",
"chaco.api.MultiArrayDataSource",
"traitsui.api.Item",
"enable.api.ComponentEditor",
"traits.api.Int"
] | [((456, 476), 'traits.api.Instance', 'Instance', (['QuiverPlot'], {}), '(QuiverPlot)\n', (464, 476), False, 'from traits.api import HasTraits, Instance, Property, Int, Float, Array, Range, cached_property\n'), ((489, 496), 'traits.api.Int', 'Int', (['(10)'], {}), '(10)\n', (492, 496), False, 'from traits.api import Has... |