code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import glob
import os
import time
import cv2
import numpy as np
from Pre_Processing import frameManipulator
commands = ['bin', 'lay', 'place', 'set']
prepositions = ['at', 'by', 'in', 'with']
colors = ['blue', 'green', 'red', 'white']
adverbs = ['again', 'now', 'please', 'soon']
alphabet = [chr(x) for x in range(ord... | [
"cv2.resize",
"os.makedirs",
"cv2.cvtColor",
"cv2.imwrite",
"Pre_Processing.frameManipulator.getVideoDataFromPath",
"os.path.exists",
"time.time",
"cv2.VideoCapture",
"numpy.hstack",
"cv2.CascadeClassifier",
"glob.glob",
"os.listdir",
"numpy.vstack"
] | [((654, 681), 'cv2.VideoCapture', 'cv2.VideoCapture', (['videoPath'], {}), '(videoPath)\n', (670, 681), False, 'import cv2\n'), ((1243, 1261), 'numpy.vstack', 'np.vstack', (['newList'], {}), '(newList)\n', (1252, 1261), True, 'import numpy as np\n'), ((1546, 1575), 'cv2.imwrite', 'cv2.imwrite', (['imagePath', 'image'],... |
import numpy as np
import math
from pressiotools import linalg as la
def read_binary_array(fileName, nCols):
# read a numpy array from a binary file "fileName"
if nCols==1:
return np.fromfile(fileName)
else:
array = np.fromfile(fileName)
nRows = int(len(array) / float(nCols))
return array.reshap... | [
"numpy.fromfile",
"pressiotools.linalg.MultiVector",
"pressiotools.linalg.Vector",
"math.log10",
"numpy.loadtxt"
] | [((190, 211), 'numpy.fromfile', 'np.fromfile', (['fileName'], {}), '(fileName)\n', (201, 211), True, 'import numpy as np\n'), ((232, 253), 'numpy.fromfile', 'np.fromfile', (['fileName'], {}), '(fileName)\n', (243, 253), True, 'import numpy as np\n'), ((459, 479), 'numpy.loadtxt', 'np.loadtxt', (['fileName'], {}), '(fil... |
from flask import Flask, request, jsonify
from flask_cors import CORS
app = Flask(__name__)
CORS(app)
@app.route('/api/data', methods=['GET'])
def data():
query = ''
with open('stats.json', 'r') as db:
query = db.read()
print(query)
return query
@app.route('/api/sendData', methods=['... | [
"flask_cors.CORS",
"flask.Flask",
"flask.request.get_json"
] | [((77, 92), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (82, 92), False, 'from flask import Flask, request, jsonify\n'), ((94, 103), 'flask_cors.CORS', 'CORS', (['app'], {}), '(app)\n', (98, 103), False, 'from flask_cors import CORS\n'), ((358, 376), 'flask.request.get_json', 'request.get_json', ([], {}... |
from setuptools import setup
from os import path
from codecs import open
here = path.abspath( path.dirname( __file__ ) )
with open( path.join( here, 'README.md' ), encoding='utf-8' ) as file :
long_description = file.read()
for line in open( path.join( 'meteostat', '__init__.py' ) ) :
if line.startswith( '_... | [
"os.path.dirname",
"os.path.join",
"setuptools.setup"
] | [((372, 1272), 'setuptools.setup', 'setup', ([], {'name': '"""meteostat2"""', 'versio': '__version__', 'description': '"""Meteostat alternative API for python"""', 'long_description': 'long_description', 'url': '"""https://github.com/SNR20db/meteostat2"""', 'license': '"""MIT"""', 'Classifiers': "['Development Status :... |
import pytest
from numpy.random import RandomState
from skvalid.parameters import TypeOf
from skvalid.parameters import Enum
from skvalid.parameters import Union
from skvalid.parameters import Interval
from skvalid.parameters import Const
import typing
@pytest.mark.parametrize('type_of,value',
... | [
"skvalid.parameters.TypeOf",
"skvalid.parameters.Union",
"skvalid.parameters.Const",
"pytest.raises",
"skvalid.parameters.Enum",
"pytest.mark.parametrize",
"skvalid.parameters.Interval"
] | [((2457, 2596), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""members, msg"""', "[([], 'members must have at least one item'), ((),\n 'members must have at least one item')]"], {}), "('members, msg', [([],\n 'members must have at least one item'), ((),\n 'members must have at least one item')])\n... |
import os
os.system("chmod 777 /content/xorta/Miners/ethminer/v0.11.0_Nvidia_Optimized/Linux/ethminer")
| [
"os.system"
] | [((10, 113), 'os.system', 'os.system', (['"""chmod 777 /content/xorta/Miners/ethminer/v0.11.0_Nvidia_Optimized/Linux/ethminer"""'], {}), "(\n 'chmod 777 /content/xorta/Miners/ethminer/v0.11.0_Nvidia_Optimized/Linux/ethminer'\n )\n", (19, 113), False, 'import os\n')] |
# RTC clock with DS1307
#
# 2017-0225 various tests, since micropython 1.8.7 changes RTC interface
# Sources:
# ESP8266 - connection to RTC, I2C-connection with NodeMCU
# MicroPython class RTC: https://micropython.org/resources/docs/en/latest/wipy/library/machine.RTC.html
# class RTC is only for WiPy board, but als... | [
"machine.RTC",
"time.sleep"
] | [((704, 717), 'machine.RTC', 'machine.RTC', ([], {}), '()\n', (715, 717), False, 'import machine\n'), ((1763, 1778), 'time.sleep', 'time.sleep', (['(7.0)'], {}), '(7.0)\n', (1773, 1778), False, 'import time\n'), ((1804, 1819), 'time.sleep', 'time.sleep', (['(1.0)'], {}), '(1.0)\n', (1814, 1819), False, 'import time\n')... |
# -*- coding: utf-8 -*-
import boto3
from boto3.dynamodb.conditions import Key
TABLE_PREFIX = 'KanshinCom-'
USER_TABLE = TABLE_PREFIX + 'user'
KEYWORD_TABLE = TABLE_PREFIX + 'keyword'
CONNECTION_TABLE = TABLE_PREFIX + 'connection'
DIARY_TABLE = TABLE_PREFIX + 'diary'
dynamodb = boto3.resource('dynamodb', region_name... | [
"boto3.dynamodb.conditions.Key",
"boto3.resource"
] | [((282, 333), 'boto3.resource', 'boto3.resource', (['"""dynamodb"""'], {'region_name': '"""us-west-2"""'}), "('dynamodb', region_name='us-west-2')\n", (296, 333), False, 'import boto3\n'), ((520, 570), 'boto3.resource', 'boto3.resource', (['"""s3"""'], {'region_name': '"""ap-northeast-1"""'}), "('s3', region_name='ap-n... |
import numpy as np
import sys
# convert any index to a 4 tuple
def unpackIndex(i, default):
a = b = c = d = default
if type(i) == int:
d = i
elif len(i) == 1:
d = i[0]
elif len(i) == 2:
c = i[0]
d = i[1]
elif len(i) == 3:
b = i[0]
c = i[1]
d =... | [
"numpy.load",
"numpy.zeros"
] | [((479, 501), 'numpy.load', 'np.load', (["(path + '.npy')"], {}), "(path + '.npy')\n", (486, 501), True, 'import numpy as np\n'), ((1660, 1689), 'numpy.zeros', 'np.zeros', (['(1)'], {'dtype': 'np.float32'}), '(1, dtype=np.float32)\n', (1668, 1689), True, 'import numpy as np\n'), ((1138, 1167), 'numpy.zeros', 'np.zeros'... |
x1=[]
x2=[]
x3=[]
import sys
import numpy as np
f1 = open("light_gbm.txt")
for line in f1:
x1.append(float((line.strip().split('\t')[1])))
#print x1
f2 = open("simese_cnn.txt")
for line in f2:
x2.append(0.5 + 0.5*float((line.strip().split('\t')[1])))
#print x2
f3 = open("matchpyramid.txt")
for line in f3:
... | [
"numpy.asarray",
"numpy.vstack"
] | [((385, 399), 'numpy.asarray', 'np.asarray', (['x1'], {}), '(x1)\n', (395, 399), True, 'import numpy as np\n'), ((403, 417), 'numpy.asarray', 'np.asarray', (['x2'], {}), '(x2)\n', (413, 417), True, 'import numpy as np\n'), ((421, 435), 'numpy.asarray', 'np.asarray', (['x3'], {}), '(x3)\n', (431, 435), True, 'import num... |
from mujoco_base import MuJoCoBase
def main():
xml_path = "./xml/ball.xml"
mjb = MuJoCoBase(xml_path)
mjb.simulate()
if __name__ == "__main__":
main()
| [
"mujoco_base.MuJoCoBase"
] | [((91, 111), 'mujoco_base.MuJoCoBase', 'MuJoCoBase', (['xml_path'], {}), '(xml_path)\n', (101, 111), False, 'from mujoco_base import MuJoCoBase\n')] |
from django.conf import settings
settings.configure(
SESSION_ENGINE='rdb_session.main'
)
| [
"django.conf.settings.configure"
] | [((35, 88), 'django.conf.settings.configure', 'settings.configure', ([], {'SESSION_ENGINE': '"""rdb_session.main"""'}), "(SESSION_ENGINE='rdb_session.main')\n", (53, 88), False, 'from django.conf import settings\n')] |
"""
Module with a function for plotting spectra.
"""
import os
import math
import warnings
import itertools
from typing import Optional, Union, Tuple, List
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from typeguard import typechecked
from matplotlib.ticker import AutoMinorLocator, Mu... | [
"matplotlib.pyplot.subplot",
"numpy.abs",
"matplotlib.pyplot.clf",
"math.ceil",
"matplotlib.pyplot.close",
"os.getcwd",
"species.read.read_filter.ReadFilter",
"numpy.isnan",
"numpy.argsort",
"numpy.log10",
"matplotlib.pyplot.figure",
"matplotlib.ticker.AutoMinorLocator",
"math.log10",
"mat... | [((5193, 5241), 'matplotlib.pyplot.rc', 'plt.rc', (['"""axes"""'], {'edgecolor': '"""black"""', 'linewidth': '(2.2)'}), "('axes', edgecolor='black', linewidth=2.2)\n", (5199, 5241), True, 'import matplotlib.pyplot as plt\n'), ((33899, 33908), 'matplotlib.pyplot.clf', 'plt.clf', ([], {}), '()\n', (33906, 33908), True, '... |
from btclib_node.p2p.messages import get_payload
from btclib_node.p2p.messages.errors import Notfound, Reject, RejectCode
def test_not_found():
msg = Notfound([(1, "00" * 32)])
msg_bytes = bytes.fromhex("00" * 4) + msg.serialize()
assert msg == Notfound.deserialize(get_payload(msg_bytes)[1])
def test_re... | [
"btclib_node.p2p.messages.errors.RejectCode",
"btclib_node.p2p.messages.get_payload",
"btclib_node.p2p.messages.errors.Notfound"
] | [((156, 182), 'btclib_node.p2p.messages.errors.Notfound', 'Notfound', (["[(1, '00' * 32)]"], {}), "([(1, '00' * 32)])\n", (164, 182), False, 'from btclib_node.p2p.messages.errors import Notfound, Reject, RejectCode\n'), ((351, 365), 'btclib_node.p2p.messages.errors.RejectCode', 'RejectCode', (['(66)'], {}), '(66)\n', (... |
from meraki_sdk.meraki_sdk_client import MerakiSdkClient
from tools.api_key import key
from get_network_id import get_network_id
meraki = MerakiSdkClient(key)
# net_id = get_network_id()
net_id = 'L_594475150812909110'
cient_id = 'k01816e'
clients_controller = meraki.clients
params = {}
params['network_id'] = net_id... | [
"meraki_sdk.meraki_sdk_client.MerakiSdkClient"
] | [((139, 159), 'meraki_sdk.meraki_sdk_client.MerakiSdkClient', 'MerakiSdkClient', (['key'], {}), '(key)\n', (154, 159), False, 'from meraki_sdk.meraki_sdk_client import MerakiSdkClient\n')] |
import numpy as np
import cv2
def preprocess(img, side):
img = cv2.rotate(img, cv2.ROTATE_90_COUNTERCLOCKWISE)
img = cv2.transpose(img)
size_y, size_x, _ = img.shape
img_crop_size = (480, 480)
min_resize = max(img_crop_size[0] / size_x, img_crop_size[1] / size_y)
img = cv2.resize(img, (int(siz... | [
"cv2.GaussianBlur",
"cv2.Canny",
"cv2.rotate",
"cv2.medianBlur",
"cv2.cvtColor",
"cv2.getStructuringElement",
"cv2.dilate",
"cv2.waitKey",
"cv2.transpose",
"cv2.split",
"cv2.merge",
"cv2.imshow"
] | [((69, 116), 'cv2.rotate', 'cv2.rotate', (['img', 'cv2.ROTATE_90_COUNTERCLOCKWISE'], {}), '(img, cv2.ROTATE_90_COUNTERCLOCKWISE)\n', (79, 116), False, 'import cv2\n'), ((127, 145), 'cv2.transpose', 'cv2.transpose', (['img'], {}), '(img)\n', (140, 145), False, 'import cv2\n'), ((890, 927), 'cv2.cvtColor', 'cv2.cvtColor'... |
#!/usr/bin/python3
#
# Copyright (C) 2019 Trinity College of Dublin, the University of Dublin.
# Copyright (c) 2019 <NAME>
# Author: <NAME> <<EMAIL>>
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Licen... | [
"packetout.PacketOutMsg",
"facemod.FaceModMsg"
] | [((1713, 1727), 'packetout.PacketOutMsg', 'PacketOutMsg', ([], {}), '()\n', (1725, 1727), False, 'from packetout import PacketOutMsg\n'), ((1958, 1970), 'facemod.FaceModMsg', 'FaceModMsg', ([], {}), '()\n', (1968, 1970), False, 'from facemod import FaceModMsg\n')] |
import datetime
import re
from django.http import HttpResponse
from django.utils.dateparse import parse_datetime
from mtp_common.utils import format_currency
from openpyxl import Workbook
from security.models import credit_sources, disbursement_methods
from security.templatetags.security import (
format_card_numb... | [
"security.models.disbursement_methods.get",
"security.models.credit_sources.get",
"security.utils.NameSet",
"openpyxl.Workbook",
"security.templatetags.security.format_disbursement_resolution",
"security.utils.EmailSet",
"mtp_common.utils.format_currency",
"security.templatetags.security.format_card_n... | [((10580, 10598), 're.compile', 're.compile', (['"""\\\\s+"""'], {}), "('\\\\s+')\n", (10590, 10598), False, 'import re\n'), ((10850, 10868), 're.compile', 're.compile', (['"""\\\\s+"""'], {}), "('\\\\s+')\n", (10860, 10868), False, 'import re\n'), ((1460, 1485), 'openpyxl.Workbook', 'Workbook', ([], {'write_only': '(T... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'designer/qcode.ui'
#
# Created by: PyQt5 UI code generator 5.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_DialogShowQrCode(object):
def setupUi(self, DialogShowQrCode... | [
"PyQt5.QtWidgets.QLabel",
"PyQt5.QtWidgets.QSizePolicy",
"PyQt5.QtWidgets.QFrame",
"PyQt5.QtWidgets.QWidget",
"PyQt5.QtCore.QRect",
"PyQt5.QtWidgets.QHBoxLayout",
"PyQt5.QtWidgets.QDialog",
"PyQt5.QtGui.QFont",
"PyQt5.QtWidgets.QVBoxLayout",
"PyQt5.QtGui.QPixmap",
"PyQt5.QtCore.QMetaObject.conne... | [((10059, 10091), 'PyQt5.QtWidgets.QApplication', 'QtWidgets.QApplication', (['sys.argv'], {}), '(sys.argv)\n', (10081, 10091), False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((10115, 10134), 'PyQt5.QtWidgets.QDialog', 'QtWidgets.QDialog', ([], {}), '()\n', (10132, 10134), False, 'from PyQt5 import QtCore, QtG... |
from Client.interfaces import IClient
from Command.base import BaseCommand, CommandType
from Database.interfaces import IDatabase
from Timer.event import TimeoutEvent
from Timer.timestamp import Timestamp
from Conf.command import CMD_RES
class Set(BaseCommand):
args_order = ['key', 'value', 'expires_time']
... | [
"Timer.timestamp.Timestamp"
] | [((920, 948), 'Timer.timestamp.Timestamp', 'Timestamp', (['expires_time', '"""s"""'], {}), "(expires_time, 's')\n", (929, 948), False, 'from Timer.timestamp import Timestamp\n')] |
"""
The Atari environment(env) wrapper. Some envs needed some configurations which you can find below.
"""
import gym
import numpy as np
from scipy.misc import imresize
class AtariWrapper():
def __init__(self, env):
self.env = env
self.observation_space = self.env.observation_space
self.r... | [
"gym.envs.classic_control.rendering.SimpleImageViewer",
"gym.make",
"gym.spaces.discrete.Discrete"
] | [((2844, 2875), 'gym.spaces.discrete.Discrete', 'gym.spaces.discrete.Discrete', (['(3)'], {}), '(3)\n', (2872, 2875), False, 'import gym\n'), ((3047, 3078), 'gym.spaces.discrete.Discrete', 'gym.spaces.discrete.Discrete', (['(4)'], {}), '(4)\n', (3075, 3078), False, 'import gym\n'), ((4692, 4723), 'gym.spaces.discrete.D... |
import os
import shutil
from pathlib import Path
from pydantic import DirectoryPath, FilePath
from pydantic.validators import path_validator
__all__ = [
'FilePath',
'DirectoryPath',
'AutoCreateDirectoryPath',
'DirectoryFindUp',
'PathExpandUser',
'ExecutablePath',
]
class PathExpandUser(Direct... | [
"os.makedirs",
"os.getcwd",
"shutil.which",
"pathlib.Path",
"os.access"
] | [((1653, 1671), 'shutil.which', 'shutil.which', (['path'], {}), '(path)\n', (1665, 1671), False, 'import shutil\n'), ((728, 745), 'os.makedirs', 'os.makedirs', (['path'], {}), '(path)\n', (739, 745), False, 'import os\n'), ((1129, 1140), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (1138, 1140), False, 'import os\n'), (... |
import unittest
from ishell.console import Console
from ishell.command import Command
import io
from contextlib import redirect_stdout
class TestConsole(unittest.TestCase):
def test_console_creation(self):
"""Console must be created."""
c = Console()
assert isinstance(c, Console)
def ... | [
"unittest.main",
"io.StringIO",
"contextlib.redirect_stdout",
"ishell.command.Command",
"ishell.console.Console"
] | [((7223, 7238), 'unittest.main', 'unittest.main', ([], {}), '()\n', (7236, 7238), False, 'import unittest\n'), ((263, 272), 'ishell.console.Console', 'Console', ([], {}), '()\n', (270, 272), False, 'from ishell.console import Console\n'), ((422, 431), 'ishell.console.Console', 'Console', ([], {}), '()\n', (429, 431), F... |
#!/usr/bin/env python3
#
# Tests if the Fitzhugh-Nagumo toy model runs.
#
# This file is part of PINTS (https://github.com/pints-team/pints/) which is
# released under the BSD 3-clause license. See accompanying LICENSE.md for
# copyright notice and full license details.
#
import unittest
import pints
import pints.toy
i... | [
"unittest.main",
"numpy.linspace",
"pints.toy.FitzhughNagumoModel"
] | [((2848, 2863), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2861, 2863), False, 'import unittest\n'), ((529, 560), 'pints.toy.FitzhughNagumoModel', 'pints.toy.FitzhughNagumoModel', ([], {}), '()\n', (558, 560), False, 'import pints\n'), ((1142, 1183), 'pints.toy.FitzhughNagumoModel', 'pints.toy.FitzhughNagumoM... |
from sklearn.metrics import matthews_corrcoef
y_true = [+1, +1, +1, -1]
y_pred = [+1, -1, +1, +1]
matthews_corrcoef(y_true, y_pred) | [
"sklearn.metrics.matthews_corrcoef"
] | [((98, 131), 'sklearn.metrics.matthews_corrcoef', 'matthews_corrcoef', (['y_true', 'y_pred'], {}), '(y_true, y_pred)\n', (115, 131), False, 'from sklearn.metrics import matthews_corrcoef\n')] |
from chatterbot import ChatBot
from chatterbot.trainers import ListTrainer
from spacy.cli import download
download('en_core_web_sm')
class ENGSM:
ISO_639_1 = 'en_core_web_sm'
chatbot = ChatBot('Botencio', tagger_langugage=ENGSM)
conversa = [
'Olá',
'Eai',
'Como você está?',
'Estou bem, e você... | [
"spacy.cli.download",
"chatterbot.trainers.ListTrainer",
"chatterbot.ChatBot"
] | [((108, 134), 'spacy.cli.download', 'download', (['"""en_core_web_sm"""'], {}), "('en_core_web_sm')\n", (116, 134), False, 'from spacy.cli import download\n'), ((194, 237), 'chatterbot.ChatBot', 'ChatBot', (['"""Botencio"""'], {'tagger_langugage': 'ENGSM'}), "('Botencio', tagger_langugage=ENGSM)\n", (201, 237), False, ... |
from inspect import iscoroutinefunction
from typing import Any, Callable, Optional
from ..protocol import Observable, Observer, Subscription, rx_observer_from
from .rx_create import rx_create
__all__ = ["rx_map"]
def rx_map(
observable: Observable, transform: Callable, expand_arg_parameters: Optional[bool] = Fa... | [
"inspect.iscoroutinefunction"
] | [((1226, 1256), 'inspect.iscoroutinefunction', 'iscoroutinefunction', (['transform'], {}), '(transform)\n', (1245, 1256), False, 'from inspect import iscoroutinefunction\n')] |
import os
from sendgrid import sendgrid, Email, Content, Mail, To
from django.conf import settings
class SendGridAPIError(Exception):
pass
class EmailClient(object):
def __init__(self, from_email=None, api_key=None):
self.from_email = from_email if from_email else settings.DEFAULT_FROM_EMAIL
... | [
"sendgrid.Mail",
"sendgrid.Email",
"sendgrid.Content",
"os.environ.get",
"sendgrid.To",
"sendgrid.sendgrid.SendGridAPIClient"
] | [((916, 956), 'sendgrid.sendgrid.SendGridAPIClient', 'sendgrid.SendGridAPIClient', (['self.api_key'], {}), '(self.api_key)\n', (942, 956), False, 'from sendgrid import sendgrid, Email, Content, Mail, To\n'), ((1061, 1083), 'sendgrid.Email', 'Email', (['self.from_email'], {}), '(self.from_email)\n', (1066, 1083), False,... |
import skrf
import tkinter as tk
from matplotlib.figure import Figure
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
import numpy as np
import CircuitFig
from PIL import ImageTk, Image, ImageDraw
import io
import MatchCal
l2z = lambda l: l[0] + 1j * l[1]
s4cmp = lambda sf: 'nH' if sf == 'l' else 'pF'... | [
"skrf.Network",
"PIL.Image.new",
"PIL.ImageTk.PhotoImage",
"io.BytesIO",
"tkinter.Button",
"CircuitFig.CircuitFig",
"tkinter.Entry",
"MatchCal.MatchCal",
"matplotlib.figure.Figure",
"tkinter.Frame",
"PIL.ImageDraw.Draw",
"tkinter.Label",
"matplotlib.backends.backend_tkagg.FigureCanvasTkAgg"
... | [((519, 582), 'CircuitFig.CircuitFig', 'CircuitFig.CircuitFig', (['color', 'stage', 'sh_se', 'cmp_l', 'cmp_v', 'z_val'], {}), '(color, stage, sh_se, cmp_l, cmp_v, z_val)\n', (540, 582), False, 'import CircuitFig\n'), ((683, 734), 'PIL.Image.new', 'Image.new', (['"""RGBA"""', '(300, 180)', '(255, 255, 255, 255)'], {}), ... |
from multiprocessing import Process, Queue, Pipe
from baselines import deepq
import gym
from deepq.asyn_sec.actor_interact_env import actor_inter
from deepq.asyn_sec.simple_multi_agent import learn
# from deepq.asyn_trainer_actor.new_models import mlp
from deepq.models import mlp
# from p2os_test.src.seventh_edition_g... | [
"deepq.models.mlp",
"gym.make",
"deepq.asyn_sec.simple_multi_agent.learn",
"baselines.common.set_global_seeds",
"p2os_test.src.sixth_edition_gpw.set_gpw_num",
"deepq.asyn_sec.actor_interact_env.actor_inter",
"multiprocessing.Pipe",
"multiprocessing.Queue",
"multiprocessing.Process"
] | [((525, 550), 'gym.make', 'gym.make', (['"""GpwTrainer-v0"""'], {}), "('GpwTrainer-v0')\n", (533, 550), False, 'import gym\n'), ((639, 676), 'deepq.models.mlp', 'mlp', (['[256, 256, 128]'], {'layer_norm': '(True)'}), '([256, 256, 128], layer_norm=True)\n', (642, 676), False, 'from deepq.models import mlp\n'), ((687, 10... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.9 on 2016-10-07 12:48
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import wagtail.core.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
('wagtailcore',... | [
"django.db.models.OneToOneField",
"django.db.models.CharField",
"django.db.models.ForeignKey",
"django.db.models.BooleanField",
"django.db.models.IntegerField"
] | [((483, 653), 'django.db.models.OneToOneField', 'models.OneToOneField', ([], {'auto_created': '(True)', 'on_delete': 'django.db.models.deletion.CASCADE', 'parent_link': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'to': '"""wagtailcore.Page"""'}), "(auto_created=True, on_delete=django.db.models.deletion\n... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2020 by <NAME>. All rights reserved. This file is part of
# the Robot OS project and is released under the "Apache Licence, Version 2.0".
# Please see the LICENSE file included as part of this package.
#
# author: <NAME>
# created: 2020-01-18
# modified: 2... | [
"colorama.init",
"threading.Thread",
"gpiozero.Button",
"lib.message.Message",
"time.sleep"
] | [((395, 401), 'colorama.init', 'init', ([], {}), '()\n', (399, 401), False, 'from colorama import init, Fore, Style\n'), ((2109, 2125), 'gpiozero.Button', 'GpioButton', (['_pin'], {}), '(_pin)\n', (2119, 2125), True, 'from gpiozero import Button as GpioButton\n'), ((2753, 2774), 'lib.message.Message', 'Message', (['Eve... |
import math
import numpy as np
## Real Data:
# %% Kinect Color Camera
color_cam_matrix = np.array([ 1.0526303338534365e+03, 0., 9.3528526085572480e+02, 0., 1.0534191001014469e+03, 5.2225718970556716e+02, 0., 0., 1. ]).reshape(3,3)
color_distortion_coeffs = np.array([ 4.5467150011699140e-02, -7.4470107942918126e-02, -6... | [
"numpy.set_printoptions",
"math.atan2",
"math.tan",
"numpy.array",
"numpy.eye",
"numpy.round"
] | [((425, 434), 'numpy.eye', 'np.eye', (['(3)'], {}), '(3)\n', (431, 434), True, 'import numpy as np\n'), ((991, 1000), 'numpy.eye', 'np.eye', (['(3)'], {}), '(3)\n', (997, 1000), True, 'import numpy as np\n'), ((3004, 3109), 'numpy.array', 'np.array', (['[[0.0, -1.0, 0.0, 0.0], [0.0, 0.0, -1.0, 0.0], [1.0, 0.0, 0.0, 0.0... |
# pylint: disable=missing-module-docstring
# pylint: disable=missing-class-docstring
# pylint: disable=missing-function-docstring
import pytest
from quantify_scheduler.schemas.examples import utils
@pytest.mark.parametrize(
"filename",
[
"qblox_test_mapping.json",
"transmon_test_config.json",... | [
"quantify_scheduler.schemas.examples.utils.load_json_example_scheme",
"pytest.mark.parametrize"
] | [((202, 327), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""filename"""', "['qblox_test_mapping.json', 'transmon_test_config.json',\n 'zhinst_test_mapping.json']"], {}), "('filename', ['qblox_test_mapping.json',\n 'transmon_test_config.json', 'zhinst_test_mapping.json'])\n", (225, 327), False, 'impo... |
from deeplearning import tf_util as U
from init import make_env_fn, make_model_fn
from collections import namedtuple
import os, argparse, json
import numpy as np
def eval_robot(args, env, pi):
rewards = []
lengths = []
for j in range(args.nepisodes):
rewards.append(0)
lengths.append(0)
... | [
"json.dump",
"json.load",
"deeplearning.tf_util.initialize",
"argparse.ArgumentParser",
"init.make_env_fn",
"deeplearning.tf_util.reset",
"deeplearning.tf_util.make_session",
"numpy.mean",
"init.make_model_fn",
"os.path.join",
"deeplearning.tf_util.Experiment"
] | [((601, 610), 'deeplearning.tf_util.reset', 'U.reset', ([], {}), '()\n', (608, 610), True, 'from deeplearning import tf_util as U\n'), ((775, 798), 'init.make_env_fn', 'make_env_fn', (['train_args'], {}), '(train_args)\n', (786, 798), False, 'from init import make_env_fn, make_model_fn\n'), ((814, 839), 'init.make_mode... |
import logging
from albow.widgets.Control import Control
from albow.input.TextEditor import TextEditor
class Field(Control, TextEditor):
"""
Field is an abstract base class for controls that edit a value with a textual representation. It provides
facilities for
- Converting between the text and i... | [
"albow.input.TextEditor.TextEditor.__init__",
"logging.getLogger"
] | [((2501, 2528), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (2518, 2528), False, 'import logging\n'), ((2770, 2825), 'albow.input.TextEditor.TextEditor.__init__', 'TextEditor.__init__', (['self'], {'width': 'predictedWidth'}), '(self, width=predictedWidth, **kwds)\n', (2789, 2825), Fal... |
# This Python file uses the following encoding: utf-8
# It has been edited by fix-complaints.py .
#############################################################################
##
## Copyright (C) 2019 The Qt Company Ltd.
## Contact: https://www.qt.io/licensing/
##
## This file is part of Qt for Python.
##
## $QT_BEGIN... | [
"PySide2.QtCore.Slot",
"PySide2.QtWidgets.QApplication",
"PySide2.QtWidgets.QWidget.__init__",
"time.ctime",
"PySide2.QtCore.QTimer.singleShot",
"random.choice",
"platform.platform",
"PySide2.QtWidgets.QVBoxLayout",
"PySide2.QtWidgets.QPushButton",
"sys.version.splitlines",
"sys.exit"
] | [((3152, 3158), 'PySide2.QtCore.Slot', 'Slot', ([], {}), '()\n', (3156, 3158), False, 'from PySide2.QtCore import Slot, Qt, QTimer\n'), ((3467, 3481), 'PySide2.QtWidgets.QApplication', 'QApplication', ([], {}), '()\n', (3479, 3481), False, 'from PySide2.QtWidgets import QApplication, QLabel, QPushButton, QVBoxLayout, Q... |
# -*- coding: utf-8 -*-
import re
import time
from ..base.account import BaseAccount
class DepositfilesCom(BaseAccount):
__name__ = "DepositfilesCom"
__type__ = "account"
__version__ = "0.39"
__status__ = "testing"
__pyload_version__ = "0.5"
__description__ = """Depositfiles.com account pl... | [
"time.strptime",
"re.search"
] | [((729, 775), 'time.strptime', 'time.strptime', (['validuntil', '"""%Y-%m-%d %H:%M:%S"""'], {}), "(validuntil, '%Y-%m-%d %H:%M:%S')\n", (742, 775), False, 'import time\n'), ((598, 662), 're.search', 're.search', (['"""Sie haben Gold Zugang bis: <b>(.*?)</b></div>"""', 'html'], {}), "('Sie haben Gold Zugang bis: <b>(.*?... |
# Copyright Contributors to the Packit project.
# SPDX-License-Identifier: MIT
from requre.import_system import UpgradeImportSystem
from requre.simple_object import Simple
FILTERS = UpgradeImportSystem().decorate("time.sleep", Simple.decorator_plain())
| [
"requre.import_system.UpgradeImportSystem",
"requre.simple_object.Simple.decorator_plain"
] | [((229, 253), 'requre.simple_object.Simple.decorator_plain', 'Simple.decorator_plain', ([], {}), '()\n', (251, 253), False, 'from requre.simple_object import Simple\n'), ((184, 205), 'requre.import_system.UpgradeImportSystem', 'UpgradeImportSystem', ([], {}), '()\n', (203, 205), False, 'from requre.import_system import... |
"""Added tags table
Revision ID: 42b486977799
Revises: <PASSWORD>
Create Date: 2014-02-05 23:57:37.029556
"""
# revision identifiers, used by Alembic.
revision = '42b486977799'
down_revision = '<PASSWORD>'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table('tags',
... | [
"alembic.op.drop_table",
"sqlalchemy.Enum",
"alembic.op.drop_index",
"alembic.op.create_index",
"sqlalchemy.ForeignKey",
"sqlalchemy.Column"
] | [((780, 830), 'alembic.op.create_index', 'op.create_index', (['"""tags_name"""', '"""tags"""', "['tag_name']"], {}), "('tags_name', 'tags', ['tag_name'])\n", (795, 830), False, 'from alembic import op\n'), ((854, 880), 'alembic.op.drop_index', 'op.drop_index', (['"""tags_name"""'], {}), "('tags_name')\n", (867, 880), F... |
"""
Bot that wishes happy birthday
"""
import datetime
import json
import logging
import math
import os
import requests
import sys
from dotenv import load_dotenv
from telegram import Update
from telegram.ext import Updater, CommandHandler, CallbackContext
# Load .env file
load_dotenv()
TOKEN = os.getenv("TOKEN")
#... | [
"logging.basicConfig",
"math.floor",
"dotenv.load_dotenv",
"datetime.datetime.utcnow",
"telegram.ext.Updater",
"datetime.datetime.strptime",
"datetime.timedelta",
"datetime.time",
"telegram.ext.CommandHandler",
"os.getenv",
"logging.getLogger"
] | [((276, 289), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (287, 289), False, 'from dotenv import load_dotenv\n'), ((299, 317), 'os.getenv', 'os.getenv', (['"""TOKEN"""'], {}), "('TOKEN')\n", (308, 317), False, 'import os\n'), ((479, 575), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.... |
from flask import Flask, jsonify
from flask import request, render_template
from flask_cors import CORS
import json, os, glob, requests
import base64
from settings import *
from bs4 import BeautifulSoup
import yaml
import re
import string, random
import uuid
app = Flask(__name__)
CORS(app)
annotations = []
@app.route... | [
"os.remove",
"json.loads",
"flask_cors.CORS",
"re.finditer",
"flask.Flask",
"os.path.exists",
"yaml.dump",
"json.dumps",
"base64.b64decode",
"uuid.uuid1",
"flask.jsonify",
"base64.b64encode",
"bs4.BeautifulSoup",
"os.path.join",
"re.compile"
] | [((266, 281), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (271, 281), False, 'from flask import Flask, jsonify\n'), ((282, 291), 'flask_cors.CORS', 'CORS', (['app'], {}), '(app)\n', (286, 291), False, 'from flask_cors import CORS\n'), ((397, 421), 'json.loads', 'json.loads', (['request.data'], {}), '(re... |
from authlib.common.encoding import json_dumps
from didcomm.common.types import (
VerificationMethodType,
VerificationMaterial,
VerificationMaterialFormat,
)
from didcomm.did_doc.did_doc import VerificationMethod, DIDDoc, DIDCommService
from didcomm.protocols.routing.forward import (
PROFILE_DIDCOMM_V2... | [
"didcomm.did_doc.did_doc.DIDCommService",
"authlib.common.encoding.json_dumps",
"didcomm.did_doc.did_doc.DIDDoc"
] | [((7106, 7950), 'didcomm.did_doc.did_doc.DIDDoc', 'DIDDoc', ([], {'did': '"""did:example:bob"""', 'authentication_kids': '[]', 'key_agreement_kids': "['did:example:bob#key-x25519-1', 'did:example:bob#key-x25519-2',\n 'did:example:bob#key-x25519-3', 'did:example:bob#key-p256-1',\n 'did:example:bob#key-p256-2', 'di... |
#!/usr/bin/python
import numpy as np
# Construct an array by executing a function over each coordinate.
def f(x, y):
return 2*x + y + 1
a = np.fromfunction(f, (5, 4), dtype=int)
print(a)
# anonymous functoin
b = np.fromfunction(lambda x, y: 2*x + y, (2, 2))
print(b)
| [
"numpy.fromfunction"
] | [((148, 185), 'numpy.fromfunction', 'np.fromfunction', (['f', '(5, 4)'], {'dtype': 'int'}), '(f, (5, 4), dtype=int)\n', (163, 185), True, 'import numpy as np\n'), ((221, 268), 'numpy.fromfunction', 'np.fromfunction', (['(lambda x, y: 2 * x + y)', '(2, 2)'], {}), '(lambda x, y: 2 * x + y, (2, 2))\n', (236, 268), True, '... |
import math
import random
import json
import os
from copy import deepcopy
from datetime import date, timedelta
from itertools import cycle
from dateutil.relativedelta import relativedelta
from django.contrib.auth.models import User
from django.utils import timezone
from indicators.models import (
Indicator,
I... | [
"random.sample",
"random.shuffle",
"indicators.views.views_indicators.generate_periodic_targets",
"workflow.models.Organization.objects.get",
"itertools.cycle",
"workflow.models.Organization.objects.get_or_create",
"indicators.models.DisaggregationType.objects.filter",
"os.path.join",
"workflow.mode... | [((25237, 25284), 'workflow.models.Organization.objects.get_or_create', 'Organization.objects.get_or_create', ([], {'name': '"""Test"""'}), "(name='Test')\n", (25271, 25284), False, 'from workflow.models import Program, Country, Organization, TolaUser, SiteProfile, Sector\n'), ((25294, 25338), 'workflow.models.Organiza... |
# this file for custom tags
from django import template
from ..models import Post
from django.db.models import Count
# these two lines below for custom filters
from django.utils.safestring import mark_safe
import markdown
register = template.Library()
'''
Each module that contains template tags needs to defi... | [
"django.db.models.Count",
"django.template.Library",
"markdown.markdown"
] | [((242, 260), 'django.template.Library', 'template.Library', ([], {}), '()\n', (258, 260), False, 'from django import template\n'), ((1813, 1836), 'markdown.markdown', 'markdown.markdown', (['text'], {}), '(text)\n', (1830, 1836), False, 'import markdown\n'), ((1031, 1048), 'django.db.models.Count', 'Count', (['"""comm... |
import logging
import re
from typing import Optional
import ujson
from IPy import IP
from ordered_set import OrderedSet
from irrd import __version__
from irrd.conf import get_setting, RPKI_IRR_PSEUDO_SOURCE
from irrd.mirroring.nrtm_generator import NRTMGenerator, NRTMGeneratorException
from irrd.rpki.status import RP... | [
"irrd.utils.validators.parse_as_number",
"irrd.server.query_resolver.InvalidQueryException",
"irrd.mirroring.nrtm_generator.NRTMGenerator",
"irrd.conf.get_setting",
"ordered_set.OrderedSet",
"irrd.server.query_resolver.QueryResolver",
"IPy.IP",
"irrd.storage.queries.DatabaseStatusQuery",
"ujson.dump... | [((905, 932), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (922, 932), False, 'import logging\n'), ((1848, 1917), 'irrd.server.query_resolver.QueryResolver', 'QueryResolver', ([], {'preloader': 'preloader', 'database_handler': 'database_handler'}), '(preloader=preloader, database_handle... |
#!/usr/bin/env python3
"""
Delete old deployments and services with test-prefixed names. This is used to
clean up the Telepresence test cluster, as Telepresence tests currently leak.
"""
import argparse
import datetime
import json
from subprocess import check_output
from typing import Dict, List
def get_kubectl() ->... | [
"argparse.ArgumentParser",
"json.loads",
"subprocess.check_output",
"datetime.datetime.strptime",
"datetime.timedelta",
"datetime.datetime.now",
"argparse.ArgumentTypeError"
] | [((785, 832), 'datetime.datetime.now', 'datetime.datetime.now', ([], {'tz': 'datetime.timezone.utc'}), '(tz=datetime.timezone.utc)\n', (806, 832), False, 'import datetime\n'), ((990, 1032), 'datetime.datetime.strptime', 'datetime.datetime.strptime', (['timestamp', 'fmt'], {}), '(timestamp, fmt)\n', (1016, 1032), False,... |
"""
# Copyright 2022 Red Hat
#
# 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 agr... | [
"cibyl.models.attribute.AttributeDictValue",
"logging.getLogger"
] | [((687, 714), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (704, 714), False, 'import logging\n'), ((3813, 3884), 'cibyl.models.attribute.AttributeDictValue', 'AttributeDictValue', (['dict1.name'], {'attr_type': 'dict1.attr_type', 'value': 'models'}), '(dict1.name, attr_type=dict1.attr_... |
"""
15N T1
======
Analyzes 15N T1 experiments. This keeps the spin system purely in-phase
throughout, and is calculated using the (1n)×(1n), single-spin matrix,
where n is the number of states::
{ Iz(a), Iz(b), ... }
References
----------
Kay, Nicholson, Delaglio, Bax, and Torchia. J Mag Reson (1992) 97:359-375... | [
"functools.lru_cache",
"chemex.helper.validate",
"chemex.nmr.liouvillian.Basis",
"chemex.experiments.helper.load_experiment"
] | [((884, 912), 'chemex.helper.validate', 'ch.validate', (['config', '_SCHEMA'], {}), '(config, _SCHEMA)\n', (895, 912), True, 'import chemex.helper as ch\n'), ((935, 973), 'chemex.nmr.liouvillian.Basis', 'cnl.Basis', ([], {'type': '"""iz"""', 'spin_system': '"""nh"""'}), "(type='iz', spin_system='nh')\n", (944, 973), Tr... |
import fortnitepy,fortniteAPI
async def SetCosmeticMSG(self,message):
msg = message.content.upper().strip()
args = msg.split(" ")
Lang = self.DefaultLang
if "--LANG=" in msg:
msg = msg + " "
Lang = GetValue(msg,"--LANG="," ")
msg = msg.replace("--LANG=" + Lang, "").st... | [
"fortniteAPI.GetEmote",
"fortniteAPI.GetEmoji",
"fortniteAPI.GetBackpack",
"fortniteAPI.GetPickaxe",
"fortniteAPI.GetSkin"
] | [((444, 475), 'fortniteAPI.GetSkin', 'fortniteAPI.GetSkin', (['Item', 'Lang'], {}), '(Item, Lang)\n', (463, 475), False, 'import fortnitepy, fortniteAPI\n'), ((572, 607), 'fortniteAPI.GetBackpack', 'fortniteAPI.GetBackpack', (['Item', 'Lang'], {}), '(Item, Lang)\n', (595, 607), False, 'import fortnitepy, fortniteAPI\n'... |
from pyclk import Sig, Reg, In, Out, List, Module
from .memory import memory
from .ddr2fpga import ddr2fpga
from .fpga2ddr import fpga2ddr
from .iterator import iterator
from .functions import func
from .fpga_state import FPGA_state
from random import randint
import asyncio
import numpy as np
class Simu(Module):
... | [
"pyclk.List",
"asyncio.sleep",
"random.randint",
"pyclk.Sig"
] | [((1123, 1129), 'pyclk.List', 'List', ([], {}), '()\n', (1127, 1129), False, 'from pyclk import Sig, Reg, In, Out, List, Module\n'), ((1156, 1162), 'pyclk.List', 'List', ([], {}), '()\n', (1160, 1162), False, 'from pyclk import Sig, Reg, In, Out, List, Module\n'), ((1189, 1195), 'pyclk.List', 'List', ([], {}), '()\n', ... |
from datetime import datetime
import os.path as op
import re
from uuid import uuid4
from . import models
from .pynwb_utils import (
_get_pynwb_metadata,
get_neurodata_types,
get_nwb_version,
ignore_benign_pynwb_warnings,
metadata_cache,
)
from .utils import ensure_datetime
from . import __version__... | [
"re.fullmatch",
"uuid.uuid4",
"os.path.isdir",
"os.path.getsize",
"datetime.datetime.now"
] | [((829, 843), 'os.path.isdir', 'op.isdir', (['path'], {}), '(path)\n', (837, 843), True, 'import os.path as op\n'), ((3056, 3134), 're.fullmatch', 're.fullmatch', (['"""(\\\\d+)\\\\s*(y(ear)?|m(onth)?|w(eek)?|d(ay)?)s?"""', 'age'], {'flags': 're.I'}), "('(\\\\d+)\\\\s*(y(ear)?|m(onth)?|w(eek)?|d(ay)?)s?', age, flags=re... |
import logging
import os
from google.appengine.api import memcache
from google.appengine.ext import webapp
from google.appengine.ext.webapp import template
from google.appengine.ext.webapp.util import run_wsgi_app
from twimonial.models import User, Twimonial
from twimonial.ui import render_write
import config
class... | [
"google.appengine.ext.webapp.util.run_wsgi_app",
"twimonial.ui.render_write",
"twimonial.models.User.get_by_screen_name",
"twimonial.models.Twimonial.get_tos_from",
"google.appengine.ext.webapp.WSGIApplication",
"google.appengine.api.memcache.set",
"google.appengine.api.memcache.get"
] | [((2607, 2760), 'google.appengine.ext.webapp.WSGIApplication', 'webapp.WSGIApplication', (["[('/user/([_a-zA-Z0-9]+)', UserPage), (\n '/userlist/([_a-zA-Z0-9]+)/([-_a-zA-Z0-9]+)', UserListPage)]"], {'debug': 'config.DEBUG'}), "([('/user/([_a-zA-Z0-9]+)', UserPage), (\n '/userlist/([_a-zA-Z0-9]+)/([-_a-zA-Z0-9]+)'... |
import queue
import networkx
from math import radians, sin, cos, sqrt, asin
from util import hav
def shortest_path(g, source, dest):
"""Return single source single destination shortest path using A* search.
Haversine distance is used as heuristic.
Arguments:
g -- networkx graph loaded from shapefile
source ... | [
"queue.PriorityQueue"
] | [((994, 1015), 'queue.PriorityQueue', 'queue.PriorityQueue', ([], {}), '()\n', (1013, 1015), False, 'import queue\n')] |
from typing import Any
from datetime import datetime
# Defaults
def noop(*args, **kw):
"""No operation. Returns nothing"""
pass
def identity(x: Any) -> Any:
"""Returns argument x"""
return x
def default_now() -> datetime:
return datetime.utcnow()
def default_comparer(x: Any, y: Any) -> bool:... | [
"datetime.datetime.utcnow"
] | [((255, 272), 'datetime.datetime.utcnow', 'datetime.utcnow', ([], {}), '()\n', (270, 272), False, 'from datetime import datetime\n')] |
# Using the logger.exception() method
import logging
logger = logging.getLogger()
try:
print('starting')
x = 1 / 0
print(x)
except:
logger.exception('an exception message')
print('Done')
| [
"logging.getLogger"
] | [((64, 83), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (81, 83), False, 'import logging\n')] |
# import curses and GPIO
import curses
import serial
import time
from picamera.array import PiRGBArray
from picamera import PiCamera
import cv2
import numpy as np
ser = serial.Serial("/dev/ttyUSB0", "9600")
serLidar = serial.Serial("/dev/ttyACM0", "115200")
cap = cv2.VideoCapture(0)
piCam = False
#check if picamera ex... | [
"serial.Serial",
"numpy.save",
"curses.noecho",
"curses.initscr",
"curses.endwin",
"cv2.VideoCapture",
"curses.cbreak",
"numpy.array",
"picamera.array.PiRGBArray",
"curses.nocbreak",
"curses.echo",
"picamera.PiCamera"
] | [((170, 207), 'serial.Serial', 'serial.Serial', (['"""/dev/ttyUSB0"""', '"""9600"""'], {}), "('/dev/ttyUSB0', '9600')\n", (183, 207), False, 'import serial\n'), ((219, 258), 'serial.Serial', 'serial.Serial', (['"""/dev/ttyACM0"""', '"""115200"""'], {}), "('/dev/ttyACM0', '115200')\n", (232, 258), False, 'import serial\... |
# -*- coding: utf-8 -*-
############################################################################
#
# Copyright © 2013, 2015 OnlineGroups.net and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany th... | [
"zope.component.createObject"
] | [((1715, 1777), 'zope.component.createObject', 'createObject', (['"""groupserver.UserFromId"""', 'self.context', 'authorId'], {}), "('groupserver.UserFromId', self.context, authorId)\n", (1727, 1777), False, 'from zope.component import createObject\n')] |
# Copyright (c) 2020 Graphcore Ltd. All rights reserved.
import numpy as np
import popart
import torch
from op_tester import op_tester
def test_asinh(op_tester):
# create test data
# Notice: as asinh(x) = ln(x + sqrt(x^2 + 1)), absolute precision
# deteriorates for larger negative numbers as you will have... | [
"op_tester.op_tester.setPatterns",
"numpy.power",
"op_tester.op_tester.run",
"popart.reservedGradientPrefix",
"numpy.array",
"numpy.arcsinh"
] | [((342, 461), 'numpy.array', 'np.array', (['[-30.0, -20.12, -2.2, -1.5, -0.2, 0.0, 0.234, 1.0, 1.2, 2.0, 3.0, 10.0, \n 100.0, 2001.0]'], {'dtype': 'np.float32'}), '([-30.0, -20.12, -2.2, -1.5, -0.2, 0.0, 0.234, 1.0, 1.2, 2.0, 3.0, \n 10.0, 100.0, 2001.0], dtype=np.float32)\n', (350, 461), True, 'import numpy as n... |
import argparse
def add_one(num: int) -> int:
if not num:
return 0
return num + 1
def add_with_args(num: int) -> int:
added = add_one(num)
return added
def parse_command_line_args() -> argparse.Namespace:
parser = argparse.ArgumentParser(description='My python template.')
parser.ad... | [
"argparse.ArgumentParser"
] | [((248, 306), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""My python template."""'}), "(description='My python template.')\n", (271, 306), False, 'import argparse\n')] |
from datetime import (
datetime,
timezone,
)
def current_datetime() -> datetime:
"""Get current datetime in `UTC`.
:return: A ``datetime`` instance.
"""
return datetime.now(tz=timezone.utc)
NULL_DATETIME = datetime.max.replace(tzinfo=timezone.utc)
| [
"datetime.datetime.now",
"datetime.datetime.max.replace"
] | [((235, 276), 'datetime.datetime.max.replace', 'datetime.max.replace', ([], {'tzinfo': 'timezone.utc'}), '(tzinfo=timezone.utc)\n', (255, 276), False, 'from datetime import datetime, timezone\n'), ((187, 216), 'datetime.datetime.now', 'datetime.now', ([], {'tz': 'timezone.utc'}), '(tz=timezone.utc)\n', (199, 216), Fals... |
# painting.py
import os
import cv2 as cv
import numpy as np
from matplotlib import pyplot as plt
from preprocess import Kmeans
from monitor import Monitor
import tkinter as tk
import csv
from utils import BlankImg
class Painting():
def __init__(self, K, shape):
#self.radius = 3
self.K = K
... | [
"csv.reader",
"cv2.imwrite",
"utils.BlankImg",
"numpy.zeros",
"cv2.imread"
] | [((4358, 4377), 'cv2.imread', 'cv.imread', (['filename'], {}), '(filename)\n', (4367, 4377), True, 'import cv2 as cv\n'), ((436, 455), 'numpy.zeros', 'np.zeros', (['self.size'], {}), '(self.size)\n', (444, 455), True, 'import numpy as np\n'), ((663, 682), 'utils.BlankImg', 'BlankImg', (['self.size'], {}), '(self.size)\... |
import re
import requests
from accounts.models import Company, CustomUser
from django.contrib.auth.decorators import login_required
from django.shortcuts import redirect, render
from django.urls import reverse
from django.views import View
from django.views.generic import DetailView, ListView, TemplateView
from django... | [
"pages.models.DataSource.objects.get_or_create",
"django.shortcuts.redirect",
"accounts.models.Company.objects.get",
"pages.models.Auction.objects.all",
"django.urls.reverse",
"pages.models.Auction.objects.filter",
"accounts.models.Company.objects.filter",
"requests.get",
"accounts.models.CustomUser... | [((2416, 2437), 'pages.models.Auction.objects.all', 'Auction.objects.all', ([], {}), '()\n', (2435, 2437), False, 'from pages.models import Auction, Bid, DataSource\n'), ((6371, 6388), 'pages.models.Bid.objects.all', 'Bid.objects.all', ([], {}), '()\n', (6386, 6388), False, 'from pages.models import Auction, Bid, DataS... |
# -*- coding: utf-8 -*-
"""
examples.bromelia_hss
~~~~~~~~~~~~~~~~~~~~~
This module contains an example on how to setup a dummy HSS
by using the Bromelia class features of bromelia library.
:copyright: (c) 2020 <NAME>.
:license: MIT, see LICENSE for more details.
"""
import os
import sys
ba... | [
"os.path.abspath",
"os.path.dirname",
"sys.path.insert",
"bromelia.Bromelia",
"os.path.join"
] | [((386, 410), 'os.path.dirname', 'os.path.dirname', (['basedir'], {}), '(basedir)\n', (401, 410), False, 'import os\n'), ((426, 455), 'os.path.dirname', 'os.path.dirname', (['examples_dir'], {}), '(examples_dir)\n', (441, 455), False, 'import os\n'), ((457, 489), 'sys.path.insert', 'sys.path.insert', (['(0)', 'bromelia... |
import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="fast_sql_manager",
version="0.1.5",
author="<NAME>",
author_email="<EMAIL>",
description="Um pacote simples para realizar operações no banco",
long_description=long_d... | [
"setuptools.find_packages"
] | [((454, 480), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (478, 480), False, 'import setuptools\n')] |
from django.db import transaction
from rest_framework import viewsets
from .serializers import TaskSerializer, CreateTaskSerializer
from .models import Task
class TaskViewSet(viewsets.ModelViewSet):
queryset = Task.objects.all()
serializer_class = TaskSerializer
def get_serializer(self, data=None, *args... | [
"django.db.transaction.atomic"
] | [((581, 601), 'django.db.transaction.atomic', 'transaction.atomic', ([], {}), '()\n', (599, 601), False, 'from django.db import transaction\n')] |
import os
import pickle
import re
import string
from flask import Flask, request, jsonify
CUR_DIR = os.path.dirname(__file__)
STOP_WORDS = pickle.load(open(
os.path.join(CUR_DIR,
'pkl_objects',
'stopwords.pkl'), 'rb'))
VECTORIZER = pickle.load(open(
os.path.join(CUR_DIR,
... | [
"os.path.join",
"os.path.dirname",
"flask.Flask",
"flask.jsonify",
"re.sub",
"flask.request.get_json"
] | [((102, 127), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (117, 127), False, 'import os\n'), ((697, 712), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (702, 712), False, 'from flask import Flask, request, jsonify\n'), ((800, 857), 're.sub', 're.sub', (['"""((www\\\\.[^\\\\s]... |
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
REQUIRES = ['numpy', 'pytest', 'flask']
config = {
'description': 'Fibonacci webservice (with neural network)',
'author': '<NAME>',
'url': 'https://github.com/soerendip/fibo',
'download_url': 'https://github... | [
"distutils.core.setup"
] | [((562, 577), 'distutils.core.setup', 'setup', ([], {}), '(**config)\n', (567, 577), False, 'from distutils.core import setup\n')] |
from itertools import chain, combinations
import numpy as np
from numpy.testing import assert_allclose
from wpca.tests.tools import assert_allclose_upto_sign
from wpca.utils import orthonormalize, random_orthonormal, weighted_mean
def test_orthonormalize():
rand = np.random.RandomState(42)
X = rand.randn(3,... | [
"numpy.average",
"numpy.eye",
"wpca.utils.orthonormalize",
"numpy.random.RandomState",
"numpy.linalg.norm",
"numpy.dot",
"wpca.utils.random_orthonormal",
"wpca.utils.weighted_mean"
] | [((273, 298), 'numpy.random.RandomState', 'np.random.RandomState', (['(42)'], {}), '(42)\n', (294, 298), True, 'import numpy as np\n'), ((333, 350), 'wpca.utils.orthonormalize', 'orthonormalize', (['X'], {}), '(X)\n', (347, 350), False, 'from wpca.utils import orthonormalize, random_orthonormal, weighted_mean\n'), ((43... |
import numpy as np
from acoustics.turbulence import Gaussian2DTemp, VonKarman2DTemp, Comparison, Field2D
def main():
mu_0 = np.sqrt(10.0**(-6))
correlation_length = 1.0 # Typical correlation length for Gaussian spectrum.
x = 20.0
y = 0.0
z = 40.0
plane = (1,0,1)
#f_re... | [
"acoustics.turbulence.Comparison",
"acoustics.turbulence.Field2D",
"acoustics.turbulence.Gaussian2DTemp",
"numpy.sqrt",
"acoustics.turbulence.VonKarman2DTemp"
] | [((134, 153), 'numpy.sqrt', 'np.sqrt', (['(10.0 ** -6)'], {}), '(10.0 ** -6)\n', (141, 153), True, 'import numpy as np\n'), ((647, 774), 'acoustics.turbulence.Gaussian2DTemp', 'Gaussian2DTemp', ([], {'plane': 'plane', 'a': 'correlation_length', 'mu_0': 'mu_0', 'wavenumber_resolution': 'wavenumber_resolution', 'max_mode... |
import ctypes
import pytest
c_lib = ctypes.CDLL('../solutions/0434-segment-string/segment-string.so')
@pytest.mark.parametrize('str, ans',
[(b'Hello, my name is John', 5),
(b'Hello', 1),
(b"love live! mu'sic forever", 4),
(b"", 0)])
def test_segment_string(str, ans):
out = c_lib.countSegments(str)
assert o... | [
"pytest.mark.parametrize",
"ctypes.CDLL"
] | [((37, 102), 'ctypes.CDLL', 'ctypes.CDLL', (['"""../solutions/0434-segment-string/segment-string.so"""'], {}), "('../solutions/0434-segment-string/segment-string.so')\n", (48, 102), False, 'import ctypes\n'), ((105, 239), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""str, ans"""', '[(b\'Hello, my name is ... |
import torch as th
from tqdm import tqdm
from . import BaseFlow, register_flow
from ..models import build_model
from ..models.GATNE import NSLoss
import torch
from tqdm.auto import tqdm
from numpy import random
import dgl
from ..sampler.GATNE_sampler import NeighborSampler, generate_pairs
@register_flow("GATNE_traine... | [
"torch.utils.data.DataLoader",
"torch.cat",
"dgl.sampling.random_walk",
"dgl.edge_type_subgraph",
"numpy.random.shuffle"
] | [((1512, 1706), 'torch.utils.data.DataLoader', 'torch.utils.data.DataLoader', (['self.train_pairs'], {'batch_size': 'self.args.batch_size', 'collate_fn': 'self.neighbor_sampler.sample', 'shuffle': '(True)', 'num_workers': 'self.args.num_workers', 'pin_memory': '(True)'}), '(self.train_pairs, batch_size=self.args.\n ... |
# import logging
from pathlib import Path
from enum import Enum
import uvicorn
from fastapi import FastAPI
from custom_logger import CustomizeLogger
import schemas
from mappings.daft_listings import get_daft_search_result
from mappings.listing_details import get_listing_details
# logger = logging.getLogger(__name_... | [
"mappings.listing_details.get_listing_details",
"mappings.daft_listings.get_daft_search_result",
"pathlib.Path",
"uvicorn.run",
"fastapi.FastAPI",
"custom_logger.CustomizeLogger.make_logger"
] | [((422, 464), 'fastapi.FastAPI', 'FastAPI', ([], {'title': '"""CustomLogger"""', 'debug': '(False)'}), "(title='CustomLogger', debug=False)\n", (429, 464), False, 'from fastapi import FastAPI\n'), ((478, 518), 'custom_logger.CustomizeLogger.make_logger', 'CustomizeLogger.make_logger', (['config_path'], {}), '(config_pa... |
import asyncio
import discord
import datetime
import pytz
import random
import colorsys
import os
from discord.ext import commands
from cogs.utils.embed import passembed
from cogs.utils.embed import errorembed
class Mod(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.case = {}
... | [
"discord.Activity",
"discord.ext.commands.command",
"asyncio.sleep",
"discord.ext.commands.check",
"cogs.utils.embed.errorembed",
"discord.Color.red",
"discord.ext.commands.has_any_role",
"discord.PermissionOverwrite",
"discord.Color",
"random.random",
"pytz.timezone",
"cogs.utils.embed.passem... | [((433, 451), 'discord.ext.commands.command', 'commands.command', ([], {}), '()\n', (449, 451), False, 'from discord.ext import commands\n'), ((457, 498), 'discord.ext.commands.has_any_role', 'commands.has_any_role', (['"""Server Moderator"""'], {}), "('Server Moderator')\n", (478, 498), False, 'from discord.ext import... |
from django.db import models
from django.db.models.signals import pre_save
from django.dispatch import receiver
from django.contrib.auth.models import User
import datetime
class File(models.Model):
"""The actual DLL file itself"""
STATUS_UNKNOWN = 'unknown'
STATUS_VALID = 'valid'
STATUS_MALWARE = 'mal... | [
"django.db.models.TextField",
"django.contrib.auth.models.User.objects.get",
"django.db.models.ForeignKey",
"django.db.models.CharField",
"django.dispatch.receiver",
"django.db.models.BooleanField",
"django.db.models.DateField",
"django.db.models.DateTimeField"
] | [((3108, 3139), 'django.dispatch.receiver', 'receiver', (['pre_save'], {'sender': 'File'}), '(pre_save, sender=File)\n', (3116, 3139), False, 'from django.dispatch import receiver\n'), ((924, 978), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'default': 'datetime.datetime.utcnow'}), '(default=datetim... |
# -*- coding: utf-8 -*-
# from __future__ import annotations
from typing import Optional, TypeVar
from abc import ABC, abstractmethod
UnitOfWork = TypeVar('UnitOfWork', bound='UnitOfWork')
class UnitOfWork(ABC):
"""
Unit of work
"""
@abstractmethod
def commit(self):
"""
Commit ... | [
"typing.TypeVar"
] | [((150, 191), 'typing.TypeVar', 'TypeVar', (['"""UnitOfWork"""'], {'bound': '"""UnitOfWork"""'}), "('UnitOfWork', bound='UnitOfWork')\n", (157, 191), False, 'from typing import Optional, TypeVar\n')] |
#!/usr/bin/env python3
"""
Creates the header file for the OSERDES test with the correct configuration
of the DATA_WIDTH and DATA_RATE
"""
import argparse
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument(
'--input', required=True, help="Input top file to be gener... | [
"argparse.ArgumentParser"
] | [((183, 227), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '__doc__'}), '(description=__doc__)\n', (206, 227), False, 'import argparse\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import sys
from dcos_migrate.cmd import run
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
run()
| [
"dcos_migrate.cmd.run",
"re.sub"
] | [((145, 196), 're.sub', 're.sub', (['"""(-script\\\\.pyw|\\\\.exe)?$"""', '""""""', 'sys.argv[0]'], {}), "('(-script\\\\.pyw|\\\\.exe)?$', '', sys.argv[0])\n", (151, 196), False, 'import re\n'), ((200, 205), 'dcos_migrate.cmd.run', 'run', ([], {}), '()\n', (203, 205), False, 'from dcos_migrate.cmd import run\n')] |
"""
Modification History:
Date: 3/16/2021
Time: 6:00PM
Description:
Will extract the phonemes from a TextGrid file and change them into
syllables using the ARPABET dictionary. Two functions will be used
to do this process. First function, get_phoneme, will get all of the
... | [
"pyglet.media.Player",
"pyglet.app.run",
"pyglet.media.StreamingSource",
"pyglet.media.load",
"pyglet.window.Window"
] | [((1462, 1504), 'pyglet.window.Window', 'pyglet.window.Window', (['width', 'height', 'title'], {}), '(width, height, title)\n', (1482, 1504), False, 'import pyglet\n'), ((1602, 1623), 'pyglet.media.Player', 'pyglet.media.Player', ([], {}), '()\n', (1621, 1623), False, 'import pyglet\n'), ((1637, 1667), 'pyglet.media.St... |
# imports
# re and datetime live on the base OS image, but twilio, dropbox, and cv2 must be installed every time a new docker container is started
# this may take a minute or two the first time you run this program after restarting your computer
import sh
import re
import datetime
from robot_command.rpl import *
# Set... | [
"datetime.datetime.today",
"dropbox.Dropbox",
"cv2.destroyAllWindows",
"cv2.imwrite",
"sh.sudo.pip3.install",
"cv2.VideoCapture",
"twilio.rest.Client",
"re.sub"
] | [((1401, 1420), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (1417, 1420), False, 'import cv2\n'), ((1603, 1626), 'cv2.destroyAllWindows', 'cv2.destroyAllWindows', ([], {}), '()\n', (1624, 1626), False, 'import cv2\n'), ((2010, 2042), 'dropbox.Dropbox', 'dropbox.Dropbox', (['dropbox_api_key'], {}), '... |
#
# SPDX-License-Identifier: Apache-2.0
#
# Copyright 2020 <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 app... | [
"unittest.mock.patch",
"unittest.mock.call"
] | [((2689, 2745), 'unittest.mock.patch', 'patch', (['"""kios.factory.persistence_manager"""'], {'autospec': '(True)'}), "('kios.factory.persistence_manager', autospec=True)\n", (2694, 2745), False, 'from unittest.mock import patch, call\n'), ((2788, 2875), 'unittest.mock.patch', 'patch', (['"""kios.operation.time"""'], {... |
#-*- coding: utf-8 -*-
# site: http://clickagain.sakura.ne.jp/cgi-bin/sort11/data.cgi?level10=1&mix=1
from bs4 import BeautifulSoup
import urllib
import re
def getGroup(arr, g):
for ele in arr:
if (ele[0] == g):
return ele
# if not, add group
new_group = (g, [])
arr.append( new_group )
return new_group
def... | [
"bs4.BeautifulSoup",
"urllib.urlopen"
] | [((1794, 1881), 'urllib.urlopen', 'urllib.urlopen', (['"""http://clickagain.sakura.ne.jp/cgi-bin/sort11/data.cgi?level12=1"""'], {}), "(\n 'http://clickagain.sakura.ne.jp/cgi-bin/sort11/data.cgi?level12=1')\n", (1808, 1881), False, 'import urllib\n'), ((1885, 1904), 'bs4.BeautifulSoup', 'BeautifulSoup', (['data'], {... |
import argparse
import torch
from torch import nn
from torch import optim
from torchvision import transforms, datasets, models
from collections import OrderedDict
from PIL import Image
import numpy as np
import json
#Take inputs from user
parser = argparse.ArgumentParser()
parser.add_argument('path_to_image', type=st... | [
"torch.from_numpy",
"json.load",
"torch.topk",
"argparse.ArgumentParser",
"torch.load",
"torchvision.models.densenet121",
"torchvision.transforms.Normalize",
"PIL.Image.open",
"torchvision.transforms.ToTensor",
"torch.exp",
"numpy.array",
"torchvision.transforms.CenterCrop",
"torchvision.mod... | [((250, 275), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (273, 275), False, 'import argparse\n'), ((870, 890), 'torch.load', 'torch.load', (['filepath'], {}), '(filepath)\n', (880, 890), False, 'import torch\n'), ((1899, 1916), 'PIL.Image.open', 'Image.open', (['image'], {}), '(image)\n', (... |
from bottle import run, get, view, post, request
import json
import jwt
import requests
##############################
@get("/company")
@view("index_company.html")
def do():
return dict(company_name="SUPER")
@get("/company-token")
@view("index_company_token.html")
def do():
return dict(company_name="Token ... | [
"bottle.view",
"json.load",
"bottle.get",
"bottle.run",
"requests.post",
"bottle.post",
"jwt.decode"
] | [((123, 138), 'bottle.get', 'get', (['"""/company"""'], {}), "('/company')\n", (126, 138), False, 'from bottle import run, get, view, post, request\n'), ((140, 166), 'bottle.view', 'view', (['"""index_company.html"""'], {}), "('index_company.html')\n", (144, 166), False, 'from bottle import run, get, view, post, reques... |
from redis.exceptions import RedisError
from rq.exceptions import NoSuchJobError
from rq.job import Job
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy_utils import ChoiceType
from busy_beaver.extensions import db, rq
class BaseModel(db.Model):
__abstract__ = True
id = db.Column(db.Inte... | [
"busy_beaver.extensions.db.String",
"sqlalchemy_utils.ChoiceType",
"busy_beaver.extensions.db.Column",
"busy_beaver.extensions.db.func.current_timestamp",
"rq.job.Job.fetch"
] | [((303, 342), 'busy_beaver.extensions.db.Column', 'db.Column', (['db.Integer'], {'primary_key': '(True)'}), '(db.Integer, primary_key=True)\n', (312, 342), False, 'from busy_beaver.extensions import db, rq\n'), ((1356, 1374), 'busy_beaver.extensions.db.Column', 'db.Column', (['db.JSON'], {}), '(db.JSON)\n', (1365, 1374... |
import unittest, sys
import timidi.tests
def test():
return unittest.main(timidi.tests)
if __name__ == "__main__":
sys.exit(0 if test() else 1)
| [
"unittest.main"
] | [((67, 94), 'unittest.main', 'unittest.main', (['timidi.tests'], {}), '(timidi.tests)\n', (80, 94), False, 'import unittest, sys\n')] |
from django.core.management.base import BaseCommand, CommandError
import time
from atlas.prodtask.mcevgen import sync_cvmfs_db
class Command(BaseCommand):
args = ''
help = 'Sync cvmfs JOs'
def handle(self, *args, **options):
self.stdout.write('Start sync cvmfs for JOs at %s'%time.ctime())
... | [
"atlas.prodtask.mcevgen.sync_cvmfs_db",
"time.ctime"
] | [((339, 354), 'atlas.prodtask.mcevgen.sync_cvmfs_db', 'sync_cvmfs_db', ([], {}), '()\n', (352, 354), False, 'from atlas.prodtask.mcevgen import sync_cvmfs_db\n'), ((300, 312), 'time.ctime', 'time.ctime', ([], {}), '()\n', (310, 312), False, 'import time\n'), ((524, 536), 'time.ctime', 'time.ctime', ([], {}), '()\n', (5... |
from django.http import Http404
from django.utils.translation import ugettext as _
from django.views.generic import DetailView, ListView
from django.views.generic.detail import SingleObjectMixin
from ..core.views import PaginatedListView
from .models import Account, Bookmark, BookmarkTag
class SingleAccountMixin(Sin... | [
"django.utils.translation.ugettext"
] | [((4728, 4765), 'django.utils.translation.ugettext', '_', (['"""No Tags found matching the query"""'], {}), "('No Tags found matching the query')\n", (4729, 4765), True, 'from django.utils.translation import ugettext as _\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from conans import ConanFile, CMake, tools
import os
class ConanSqlite3(ConanFile):
name = "sqlite3"
version = "3.21.0"
year = "2017"
sha1 = "ebe33c20d37a715db95288010c1009cd560f2452"
description = "Self-contained, serverless, in-process SQL database ... | [
"conans.tools.get",
"os.rename",
"conans.CMake"
] | [((1209, 1248), 'conans.tools.get', 'tools.get', (['download_url'], {'sha1': 'self.sha1'}), '(download_url, sha1=self.sha1)\n', (1218, 1248), False, 'from conans import ConanFile, CMake, tools\n'), ((1257, 1291), 'os.rename', 'os.rename', (['archive_name', '"""sources"""'], {}), "(archive_name, 'sources')\n", (1266, 12... |
from s_vae.data.mnist import create_MNIST, vis_mnist
from s_vae.data.synthetic_hypersphere import create_synthetic_hypersphere
def create_dataset(config: dict, seed=0):
data_config = config['data']
name = data_config['name']
path = data_config['path']
train_ratio = data_config['train_ratio']
if n... | [
"s_vae.data.synthetic_hypersphere.create_synthetic_hypersphere",
"s_vae.data.mnist.create_MNIST"
] | [((351, 371), 's_vae.data.mnist.create_MNIST', 'create_MNIST', (['config'], {}), '(config)\n', (363, 371), False, 'from s_vae.data.mnist import create_MNIST, vis_mnist\n'), ((619, 738), 's_vae.data.synthetic_hypersphere.create_synthetic_hypersphere', 'create_synthetic_hypersphere', (['path', 'latent_dim', 'observed_dim... |
import numpy as np
import fvcore.nn.weight_init as weight_init
import torch
from torch import nn
from torch.nn import functional as F
from typing import Dict
from detectron2.layers import Conv2d, Linear, ShapeSpec, get_norm
from detectron2.modeling.roi_heads import ROI_BOX_HEAD_REGISTRY
from ..attention import SelfAtt... | [
"torch.flatten",
"torch.nn.BatchNorm3d",
"torch.stack",
"fvcore.nn.weight_init.c2_xavier_fill",
"detectron2.modeling.roi_heads.ROI_BOX_HEAD_REGISTRY.register",
"torch.cat",
"detectron2.layers.Linear",
"torch.nn.BatchNorm2d",
"fvcore.nn.weight_init.c2_msra_fill"
] | [((388, 420), 'detectron2.modeling.roi_heads.ROI_BOX_HEAD_REGISTRY.register', 'ROI_BOX_HEAD_REGISTRY.register', ([], {}), '()\n', (418, 420), False, 'from detectron2.modeling.roi_heads import ROI_BOX_HEAD_REGISTRY\n'), ((4020, 4053), 'detectron2.layers.Linear', 'Linear', (['self._output_size', 'fc_dim'], {}), '(self._o... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mlagents/envs/communicator_objects/brain_parameters_proto.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.pro... | [
"google.protobuf.symbol_database.Default",
"google.protobuf.descriptor.FieldDescriptor"
] | [((519, 545), 'google.protobuf.symbol_database.Default', '_symbol_database.Default', ([], {}), '()\n', (543, 545), True, 'from google.protobuf import symbol_database as _symbol_database\n'), ((2397, 2788), 'google.protobuf.descriptor.FieldDescriptor', '_descriptor.FieldDescriptor', ([], {'name': '"""vector_observation_... |
from setuptools import Extension, setup
from Cython.Build import cythonize
import numpy as np
import os.path as osp
__version__ = '1.1.4'
url = 'https://github.com/jannessm/quadric-mesh-simplification'
files = [
'simplify.c',
'array.c',
'clean_mesh.c',
'contract_pair.c',
'edges.c',
'maths.c',
'mesh_inversion.... | [
"os.path.abspath",
"Cython.Build.cythonize",
"os.path.join",
"numpy.get_include"
] | [((850, 872), 'Cython.Build.cythonize', 'cythonize', (['ext_modules'], {}), '(ext_modules)\n', (859, 872), False, 'from Cython.Build import cythonize\n'), ((480, 501), 'os.path.abspath', 'osp.abspath', (['__file__'], {}), '(__file__)\n', (491, 501), True, 'import os.path as osp\n'), ((572, 598), 'os.path.join', 'osp.jo... |
import tensorflow as tf
from tensorflow.python.keras import activations
class CoralOrdinal(tf.keras.layers.Layer):
# We skip input_dim/input_shape here and put in the build() method as recommended in the tutorial,
# in case the user doesn't know the input dimensions when defining the model.
def __init__(self, n... | [
"tensorflow.matmul",
"tensorflow.python.keras.activations.get"
] | [((1200, 1227), 'tensorflow.python.keras.activations.get', 'activations.get', (['activation'], {}), '(activation)\n', (1215, 1227), False, 'from tensorflow.python.keras import activations\n'), ((2808, 2834), 'tensorflow.matmul', 'tf.matmul', (['inputs', 'self.fc'], {}), '(inputs, self.fc)\n', (2817, 2834), True, 'impor... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 9 17:53:39 2019
@author: alankar
"""
import numpy as np
import matplotlib.pyplot as plt
from scipy.special.orthogonal import p_roots #Legendre Polynomial roots
from scipy import constants
def gauss_quad(func,a,b,n,*args):#Legendre
[x,w] = p_r... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"scipy.special.orthogonal.p_roots",
"matplotlib.pyplot.figure",
"numpy.exp",
"numpy.linspace",
"matplotlib.pyplot.tick_params",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.grid",
"matp... | [((634, 659), 'numpy.linspace', 'np.linspace', (['(5)', '(500)', '(1000)'], {}), '(5, 500, 1000)\n', (645, 659), True, 'import numpy as np\n'), ((712, 740), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(13, 10)'}), '(figsize=(13, 10))\n', (722, 740), True, 'import matplotlib.pyplot as plt\n'), ((740, 771... |
from django.contrib import admin
from django import forms
from django.db.models import Sum
from django.shortcuts import redirect
from django.http import HttpResponseRedirect
from .models import *
from .forms import *
# Register your models here.
class RelationalProductInline(admin.TabularInline):
search_fields = ... | [
"django.shortcuts.redirect",
"django.contrib.admin.register"
] | [((657, 680), 'django.contrib.admin.register', 'admin.register', (['Product'], {}), '(Product)\n', (671, 680), False, 'from django.contrib import admin\n'), ((1403, 1429), 'django.contrib.admin.register', 'admin.register', (['SalesOrder'], {}), '(SalesOrder)\n', (1417, 1429), False, 'from django.contrib import admin\n'... |
import types
import sys
from .equation import *
from .pick import *
from .calculus import *
from functools import wraps
this_module = sys.modules[__name__]
def _get_imported_names(module):
names = module.__all__ if hasattr(module, '__all__') else dir(module)
return [name for name in names if not name.start... | [
"functools.wraps"
] | [((365, 376), 'functools.wraps', 'wraps', (['func'], {}), '(func)\n', (370, 376), False, 'from functools import wraps\n')] |
import os
import sys
from synchronizers.new_base.SyncInstanceUsingAnsible import SyncInstanceUsingAnsible
from synchronizers.new_base.modelaccessor import *
from xos.logger import Logger, logging
parentdir = os.path.join(os.path.dirname(__file__), "..")
sys.path.insert(0, parentdir)
logger = Logger(level=logging.INFO... | [
"os.path.dirname",
"sys.path.insert",
"xos.logger.Logger"
] | [((255, 284), 'sys.path.insert', 'sys.path.insert', (['(0)', 'parentdir'], {}), '(0, parentdir)\n', (270, 284), False, 'import sys\n'), ((295, 321), 'xos.logger.Logger', 'Logger', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (301, 321), False, 'from xos.logger import Logger, logging\n'), ((222, 247), 'os.... |
"""
Component Model
"""
# Third Party Library
from django.db import models
class ComponentGroup(models.Model):
UPTIME_CHOICES = (
('on', 'ON'),
('off', 'OFF')
)
name = models.CharField(max_length=100, verbose_name="Name")
description = models.CharField(max_length=200, verbose_name="... | [
"django.db.models.CharField",
"django.db.models.DateTimeField"
] | [((201, 254), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)', 'verbose_name': '"""Name"""'}), "(max_length=100, verbose_name='Name')\n", (217, 254), False, 'from django.db import models\n'), ((273, 333), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(200)', 'verbo... |