code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import logging
import discord
from discord.ext import commands
class Errors(commands.Cog, name="Error handler"):
def __init__(self, bot):
self.bot = bot
self.logger = logging.getLogger(__name__)
@commands.Cog.listener()
async def on_ready(self):
self.logger.info("I'm ready!")
... | [
"discord.ext.commands.Cog.listener",
"logging.getLogger"
] | [((224, 247), 'discord.ext.commands.Cog.listener', 'commands.Cog.listener', ([], {}), '()\n', (245, 247), False, 'from discord.ext import commands\n'), ((323, 346), 'discord.ext.commands.Cog.listener', 'commands.Cog.listener', ([], {}), '()\n', (344, 346), False, 'from discord.ext import commands\n'), ((190, 217), 'log... |
def run_imports():
import re
import string
import nltk
import pandas as pd
def clean_text(text):
import re
import string.punctuation
import nltk
from nltk.corpus import stopwords
import pandas as pd
stopwords = nltk.corpus.stopwords.words('english')
text = "".join([char ... | [
"re.split",
"nltk.WordNetLemmatizer",
"nltk.corpus.stopwords.words",
"nltk.PorterStemmer"
] | [((255, 293), 'nltk.corpus.stopwords.words', 'nltk.corpus.stopwords.words', (['"""english"""'], {}), "('english')\n", (282, 293), False, 'import nltk\n'), ((386, 408), 're.split', 're.split', (['"""\\\\W+"""', 'text'], {}), "('\\\\W+', text)\n", (394, 408), False, 'import re\n'), ((748, 768), 'nltk.PorterStemmer', 'nlt... |
import logging
from django.core.management.base import BaseCommand
from geotrek.feedback.helpers import SuricateMessenger
from geotrek.feedback.models import PendingEmail, PendingSuricateAPIRequest
logger = logging.getLogger(__name__)
class Command(BaseCommand):
def add_arguments(self, parser):
parser.a... | [
"logging.getLogger",
"geotrek.feedback.helpers.SuricateMessenger",
"geotrek.feedback.models.PendingEmail.objects.all"
] | [((208, 235), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (225, 235), False, 'import logging\n'), ((706, 732), 'geotrek.feedback.models.PendingEmail.objects.all', 'PendingEmail.objects.all', ([], {}), '()\n', (730, 732), False, 'from geotrek.feedback.models import PendingEmail, Pending... |
import numpy as np
import cv2
def rescale(im, target_size, max_size):
"""
only resize input image to target size and return scale
Parameters:
----------
im : numpy.array
BGR image input by opencv
target_size: int
one dimensional size (the short side)
max_size: int
o... | [
"cv2.resize",
"numpy.round",
"numpy.min"
] | [((471, 492), 'numpy.min', 'np.min', (['im_shape[0:2]'], {}), '(im_shape[0:2])\n', (477, 492), True, 'import numpy as np\n'), ((511, 532), 'numpy.min', 'np.min', (['im_shape[0:2]'], {}), '(im_shape[0:2])\n', (517, 532), True, 'import numpy as np\n'), ((762, 851), 'cv2.resize', 'cv2.resize', (['im', 'None', 'None'], {'f... |
#!/usr/bin/python3
import numpy as np
import matplotlib.pyplot as plt
from math import sqrt
class perceptron:
def __init__(self):
#self.w = np.random.rand(2)
self.w = np.array([0.5, 0.5])
self.w = normalize_v(self.w)
#self.b = np.random.rand()
self.b = 1
def get_loss... | [
"matplotlib.pyplot.plot",
"numpy.array",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.show"
] | [((2187, 2220), 'numpy.array', 'np.array', (['[(x / norm) for x in v]'], {}), '([(x / norm) for x in v])\n', (2195, 2220), True, 'import numpy as np\n'), ((2444, 2487), 'matplotlib.pyplot.scatter', 'plt.scatter', (['X[:, 0]', 'X[:, 1]'], {'color': 'colors'}), '(X[:, 0], X[:, 1], color=colors)\n', (2455, 2487), True, 'i... |
# -*- coding: utf-8 -*-
"""
serializer handlers list module.
"""
import pyrin.converters.serializer.services as serializer_services
import pyrin.configuration.services as config_services
from pyrin.converters.serializer.decorators import serializer
from pyrin.converters.serializer.handlers.base import SerializerBase
... | [
"pyrin.converters.serializer.services.serialize",
"pyrin.converters.serializer.decorators.serializer",
"pyrin.configuration.services.get"
] | [((323, 335), 'pyrin.converters.serializer.decorators.serializer', 'serializer', ([], {}), '()\n', (333, 335), False, 'from pyrin.converters.serializer.decorators import serializer\n'), ((667, 717), 'pyrin.configuration.services.get', 'config_services.get', (['"""api"""', '"""schema"""', '"""index_name"""'], {}), "('ap... |
import abc, logging, os, anytree
from dbac_lib.dbac_primitives import IPrimitiveCollection, HardMiningSVM
from dbac_lib.dbac_feature_ext import IFeatureExtractor
from dbac_lib.dbac_util import CycleIterator, batch_iterator, TicToc
from dbac_lib import dbac_expression
import numpy as np
import tensorflow as tf
import te... | [
"logging.getLogger",
"tensorflow.equal",
"tensorflow.shape",
"dbac_lib.dbac_expression.list2exp_parse",
"numpy.random.rand",
"numpy.hstack",
"tensorflow.split",
"numpy.logical_not",
"numpy.array",
"dbac_lib.dbac_util.batch_iterator",
"tensorflow.variables_initializer",
"dbac_lib.dbac_expressio... | [((560, 587), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (577, 587), False, 'import abc, logging, os, anytree\n'), ((4839, 4878), 'dbac_lib.dbac_expression.list2exp_parse', 'dbac_expression.list2exp_parse', (['exp_lst'], {}), '(exp_lst)\n', (4869, 4878), False, 'from dbac_lib import d... |
''' Syslog logging handler '''
import logging
import logging.handlers
import sys
from core.logs import BaseLogging
class Logger(BaseLogging):
''' Handler class for Syslog Logging '''
def setup(self):
''' Setup class for handler '''
lh = logging.handlers.SysLogHandler(
facility=sel... | [
"logging.Formatter",
"logging.handlers.SysLogHandler"
] | [((264, 365), 'logging.handlers.SysLogHandler', 'logging.handlers.SysLogHandler', ([], {'facility': "self.config['logging']['plugins']['syslog']['facility']"}), "(facility=self.config['logging']['plugins'][\n 'syslog']['facility'])\n", (294, 365), False, 'import logging\n'), ((426, 498), 'logging.Formatter', 'loggin... |
from pyco import user_input
from pyco.color import Fore, Back, Style
user_input("Plain prompt: ")
user_input(Fore.GREEN + "Prompt in green: ")
user_input(Fore.BRIGHT_RED + "Prompt in bright red, user input in cyan: ", input_color=Fore.CYAN)
user_input(Fore.BLUE + Back.BRIGHT_WHITE + "Prompt in blue on a bright white b... | [
"pyco.user_input"
] | [((70, 98), 'pyco.user_input', 'user_input', (['"""Plain prompt: """'], {}), "('Plain prompt: ')\n", (80, 98), False, 'from pyco import user_input\n'), ((99, 143), 'pyco.user_input', 'user_input', (["(Fore.GREEN + 'Prompt in green: ')"], {}), "(Fore.GREEN + 'Prompt in green: ')\n", (109, 143), False, 'from pyco import ... |
import binascii
import datetime
import hashlib
import hmac
import os
import uuid
from typing import Dict, List, Optional, Type, Union
from fastapi import HTTPException, Query, status
from pydantic import BaseModel, Extra, validator
from ..config import settings
from .auth import TYPING_AUTH
from . import EBaseModel, ... | [
"uuid.uuid4",
"datetime.datetime.fromtimestamp",
"pydantic.validator"
] | [((1289, 1332), 'pydantic.validator', 'validator', (['"""user_id"""'], {'pre': '(True)', 'always': '(True)'}), "('user_id', pre=True, always=True)\n", (1298, 1332), False, 'from pydantic import BaseModel, Extra, validator\n'), ((1377, 1389), 'uuid.uuid4', 'uuid.uuid4', ([], {}), '()\n', (1387, 1389), False, 'import uui... |
import joblib
import numpy as np
import pandas as pd
import streamlit as st
APP_FILE = "app.py"
MODEL_JOBLIB_FILE = "model.joblib"
def main():
"""This function runs/ orchestrates the Machine Learning App Registry"""
st.markdown(
"""
# Machine Learning App
The main objective of this app is buildin... | [
"streamlit.checkbox",
"streamlit.markdown",
"pandas.read_csv",
"streamlit.number_input",
"streamlit.balloons",
"streamlit.button",
"streamlit.write",
"numpy.array",
"streamlit.success",
"joblib.load"
] | [((229, 592), 'streamlit.markdown', 'st.markdown', (['"""\n# Machine Learning App \n\nThe main objective of this app is building a customer segmentation based on credit card \npayments behavior during the last six months to define marketing strategies. \nYou can find the source code for this project in the following [G... |
'''
config.py
Written by <NAME>
'''
import argparse
import yaml
import os
import glob
def get_parser():
parser = argparse.ArgumentParser(description='Point Cloud Segmentation')
parser.add_argument('--config', type=str, default='config/pointgroup_default_scannet.yaml', help='path to config file')
### pret... | [
"os.path.join",
"yaml.load",
"argparse.ArgumentParser"
] | [((119, 182), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Point Cloud Segmentation"""'}), "(description='Point Cloud Segmentation')\n", (142, 182), False, 'import argparse\n'), ((901, 964), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Point Cloud Segm... |
from hashlib import sha256
from hmac import new as hmac
from random import randint
from re import fullmatch
from socket import socket
from struct import pack as encode
from subprocess import PIPE, STDOUT, Popen
from crcmod.predefined import mkCrcFun
from goodix import FLAGS_TRANSPORT_LAYER_SECURITY_DATA, Device
from ... | [
"tool.warning",
"hmac.new",
"hashlib.sha256",
"socket.socket",
"tool.connect_device",
"goodix.Device",
"struct.pack",
"re.fullmatch",
"crcmod.predefined.mkCrcFun",
"random.randint"
] | [((1729, 1757), 'goodix.Device', 'Device', (['product', 'USBProtocol'], {}), '(product, USBProtocol)\n', (1735, 1757), False, 'from goodix import FLAGS_TRANSPORT_LAYER_SECURITY_DATA, Device\n'), ((6901, 6917), 'random.randint', 'randint', (['(0)', '(9999)'], {}), '(0, 9999)\n', (6908, 6917), False, 'from random import ... |
from distutils.core import setup
from panpun import PANPUN
setup(
name='TuiTse-TsuSin',
description='對齊資訊',
long_description='共兩句漢羅對--起-來,掠出字數落勾ê位a̍h-sī無合教典ê用字',
packages=['tuitse'],
version=PANPUN,
author='<NAME>',
author_email='<EMAIL>',
url='https://ithuan.tw/',
download_url='h... | [
"distutils.core.setup"
] | [((62, 712), 'distutils.core.setup', 'setup', ([], {'name': '"""TuiTse-TsuSin"""', 'description': '"""對齊資訊"""', 'long_description': '"""共兩句漢羅對--起-來,掠出字數落勾ê位a̍h-sī無合教典ê用字"""', 'packages': "['tuitse']", 'version': 'PANPUN', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'url': '"""https://ithuan.tw/"""', 'dow... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@Author : yanyongyu
@Date : 2021-03-09 16:45:25
@LastEditors : yanyongyu
@LastEditTime : 2021-08-04 13:41:12
@Description : None
@GitHub : https://github.com/yanyongyu
"""
__author__ = "yanyongyu"
from datetime import timedelta
from t... | [
"src.libs.github.Github",
"src.libs.playwright.get_new_page",
"datetime.timedelta"
] | [((825, 838), 'src.libs.github.Github', 'Github', (['token'], {}), '(token)\n', (831, 838), False, 'from src.libs.github import Github\n'), ((1247, 1268), 'datetime.timedelta', 'timedelta', ([], {'minutes': '(30)'}), '(minutes=30)\n', (1256, 1268), False, 'from datetime import timedelta\n'), ((917, 977), 'src.libs.gith... |
from pypeflow.io import (
syscall, capture, cd,
mkdirs, symlink, rm, touch, filesize, exists_and_not_empty) # needed?
import contextlib
import io
import logging
import os
import pprint
import sys
if sys.version_info >= (3, 0):
NativeIO = io.StringIO
else:
NativeIO = io.BytesIO
LOG = logging... | [
"logging.getLogger",
"os.path.exists",
"json.loads",
"os.path.isabs",
"msgpack.packb",
"json.dumps",
"io.BytesIO",
"os.path.join",
"msgpack.unpackb",
"os.path.dirname",
"os.unlink",
"pypeflow.io.filesize"
] | [((313, 332), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (330, 332), False, 'import logging\n'), ((3166, 3245), 'msgpack.unpackb', 'msgpack.unpackb', (['content'], {'raw': '(False)', 'max_map_len': '(2 ** 25)', 'max_array_len': '(2 ** 25)'}), '(content, raw=False, max_map_len=2 ** 25, max_array_len=2 *... |
# -*- coding: utf-8 -*-
import numpy as np
import tensorflow as tf
import scipy
class PlaceCells(object):
def __init__(self, options):
self.Np = options.Np
self.sigma = options.place_cell_rf
self.surround_scale = options.surround_scale
self.box_width = options.box_width
se... | [
"tensorflow.random.uniform",
"tensorflow.reduce_min",
"numpy.roll",
"tensorflow.random.set_seed",
"tensorflow.transpose",
"tensorflow.reduce_sum",
"scipy.interpolate.griddata",
"numpy.linspace",
"numpy.zeros",
"tensorflow.gather",
"tensorflow.nn.softmax",
"tensorflow.reshape",
"tensorflow.ma... | [((509, 530), 'tensorflow.random.set_seed', 'tf.random.set_seed', (['(0)'], {}), '(0)\n', (527, 530), True, 'import tensorflow as tf\n'), ((545, 637), 'tensorflow.random.uniform', 'tf.random.uniform', (['(self.Np,)', '(-self.box_width / 2)', '(self.box_width / 2)'], {'dtype': 'tf.float64'}), '((self.Np,), -self.box_wid... |
#!/usr/bin/env python
"""
Setup script for sen1_ard_gamma. Use like this for Unix:
$ python setup.py install
"""
# Copyright 2019 <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
#
# ... | [
"os.path.join"
] | [((1215, 1254), 'os.path.join', 'os.path.join', (['"""share"""', '"""sen1_ard_gamma"""'], {}), "('share', 'sen1_ard_gamma')\n", (1227, 1254), False, 'import os\n'), ((1272, 1333), 'os.path.join', 'os.path.join', (['"""share"""', '"""sen1_ard_gamma"""', '"""loggingconfig.json"""'], {}), "('share', 'sen1_ard_gamma', 'log... |
import argparse
import json
import re
from typing import List
quiet = False
def print_message(message: str):
"""
Print message to STDOUT if the quiet option is set to False (this is the default).
:param message: message to print
:return: None
"""
global quiet
if not quiet:
print(m... | [
"argparse.ArgumentParser",
"re.compile",
"json.dumps",
"re.match",
"json.dump"
] | [((1309, 1435), 're.compile', 're.compile', (['"""^\\\\[(.+)\\\\] \\\\[(\\\\w+)\\\\] \\\\[client (\\\\d{1,3}(?:\\\\.\\\\d{1,3}){3})\\\\] ([\\\\w\\\\s]+): (\\\\S+)$"""', 're.IGNORECASE'], {}), "(\n '^\\\\[(.+)\\\\] \\\\[(\\\\w+)\\\\] \\\\[client (\\\\d{1,3}(?:\\\\.\\\\d{1,3}){3})\\\\] ([\\\\w\\\\s]+): (\\\\S+)$'\n ... |
from historical_periods.scraping_histo_periods_tt import get_dictionary_from_json, get_historical_dictionary, save_dictionary_as_json
import sys, os
sys.path.insert(0,"/Users/camillesanchez/Desktop/hmi/imdbpy-master/")
from imdb import IMDb
def getIMDbDataFromFields(IMDb_id, *fields):
""" Returns IMDb Datas from I... | [
"sys.path.insert",
"os.path.join",
"historical_periods.scraping_histo_periods_tt.get_historical_dictionary",
"historical_periods.scraping_histo_periods_tt.save_dictionary_as_json",
"imdb.IMDb",
"historical_periods.scraping_histo_periods_tt.get_dictionary_from_json"
] | [((149, 219), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""/Users/camillesanchez/Desktop/hmi/imdbpy-master/"""'], {}), "(0, '/Users/camillesanchez/Desktop/hmi/imdbpy-master/')\n", (164, 219), False, 'import sys, os\n'), ((482, 488), 'imdb.IMDb', 'IMDb', ([], {}), '()\n', (486, 488), False, 'from imdb import IMDb\... |
import torch
import torch.nn as nn
import math
class PositionalEncoding(nn.Module):
def __init__(self, out_channels, kernel_size, heads, bias=False, encoding='learnable', r_dim=256):
super(PositionalEncoding, self).__init__()
self.out_channels = out_channels
self.kernel_size = kernel_size... | [
"torch.nn.Dropout",
"torch.sin",
"torch.nn.Conv2d",
"math.log",
"torch.cat",
"torch.cos",
"torch.zeros",
"torch.arange",
"torch.randn"
] | [((2372, 2434), 'torch.cat', 'torch.cat', (['(k_out_h + self.rel_h, k_out_w + self.rel_w)'], {'dim': '(1)'}), '((k_out_h + self.rel_h, k_out_w + self.rel_w), dim=1)\n', (2381, 2434), False, 'import torch\n'), ((2615, 2636), 'torch.nn.Dropout', 'nn.Dropout', ([], {'p': 'dropout'}), '(p=dropout)\n', (2625, 2636), True, '... |
# -*- coding: utf-8 -*-
"""Provides ``get_redis_client``, a redis client factory that can be used
directly, or in contect of a Pyramid application as a request method.
"""
__all__ = [
'GetRedisClient',
'get_redis_client'
]
import logging
logger = logging.getLogger(__name__)
from pyramid_redis import DEFAU... | [
"logging.getLogger",
"pyramid_redis.hooks.RedisFactory"
] | [((260, 287), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (277, 287), False, 'import logging\n'), ((487, 501), 'pyramid_redis.hooks.RedisFactory', 'RedisFactory', ([], {}), '()\n', (499, 501), False, 'from pyramid_redis.hooks import RedisFactory\n')] |
from itertools import count
from ..library.combinatorics.partitions import Partitions
from ..library.number_theory.primes import is_prime
def solve(bound: int=5_000) -> int:
primes = []
partitions_class = Partitions(primes)
# use explicit partition class, because we want to dynamically add to
# numbe... | [
"itertools.count"
] | [((425, 433), 'itertools.count', 'count', (['(2)'], {}), '(2)\n', (430, 433), False, 'from itertools import count\n')] |
import os, requests
import urllib.request
from packaging import version
from PyQt5.QtWidgets import QApplication, QFileDialog
REPO = '7i80'
def checkUpdates(parent):
response = requests.get(f"https://api.github.com/repos/jethornton/{REPO}/releases/latest")
repoVersion = response.json()["name"]
if version.parse(r... | [
"PyQt5.QtWidgets.QFileDialog.getExistingDirectory",
"os.path.join",
"requests.get",
"PyQt5.QtWidgets.QApplication.processEvents",
"packaging.version.parse"
] | [((182, 261), 'requests.get', 'requests.get', (['f"""https://api.github.com/repos/jethornton/{REPO}/releases/latest"""'], {}), "(f'https://api.github.com/repos/jethornton/{REPO}/releases/latest')\n", (194, 261), False, 'import os, requests\n'), ((791, 870), 'requests.get', 'requests.get', (['f"""https://api.github.com/... |
import numpy as np
#--------------------------------------------------------------------------
# nx = 29
# ny = 44
# R = (30.0 / (1000.0 * 3600.0)) # [m/s]
# da = 900 # [m2]
# dur = (75 * 60) # [sec] (75 minutes or 4500 sec)
# A = (nx * ny * da)
# vol_tot = (A * R * dur)
# print( vol_tot )
#-----------------------... | [
"numpy.fromfile",
"numpy.zeros"
] | [((2214, 2265), 'numpy.fromfile', 'np.fromfile', (['grid_unit'], {'count': 'n_values', 'dtype': 'dtype'}), '(grid_unit, count=n_values, dtype=dtype)\n', (2225, 2265), True, 'import numpy as np\n'), ((1140, 1175), 'numpy.zeros', 'np.zeros', (['(ny, nx)'], {'dtype': '"""float32"""'}), "((ny, nx), dtype='float32')\n", (11... |
# Copyright (c) Facebook, Inc. and its affiliates.
import unittest
from unittest.mock import MagicMock, patch
import torch
from tests.trainers.test_training_loop import TrainerTrainingLoopMock
class TestEvalLoop(unittest.TestCase):
@patch(
"mmf.common.test_reporter.PathManager",
return_value=Mag... | [
"torch.random.manual_seed",
"unittest.mock.MagicMock",
"unittest.mock.patch",
"tests.trainers.test_training_loop.TrainerTrainingLoopMock"
] | [((358, 420), 'unittest.mock.patch', 'patch', (['"""mmf.common.test_reporter.get_mmf_env"""'], {'return_value': '""""""'}), "('mmf.common.test_reporter.get_mmf_env', return_value='')\n", (363, 420), False, 'from unittest.mock import MagicMock, patch\n'), ((465, 492), 'torch.random.manual_seed', 'torch.random.manual_see... |
"""
Classes for lighting in renderer
Author: <NAME>
"""
import numpy as np
from autolab_core import RigidTransform
class Color(object):
WHITE = np.array([255, 255, 255])
BLACK = np.array([0, 0, 0])
RED = np.array([255, 0, 0])
GREEN = np.array([0, 255, 0])
BLUE = np.array([0, 0, 255])
class Mat... | [
"numpy.array",
"numpy.eye",
"numpy.ones",
"numpy.zeros"
] | [((150, 175), 'numpy.array', 'np.array', (['[255, 255, 255]'], {}), '([255, 255, 255])\n', (158, 175), True, 'import numpy as np\n'), ((188, 207), 'numpy.array', 'np.array', (['[0, 0, 0]'], {}), '([0, 0, 0])\n', (196, 207), True, 'import numpy as np\n'), ((220, 241), 'numpy.array', 'np.array', (['[255, 0, 0]'], {}), '(... |
import itertools
from typing import List
from pathlib import Path
import uvicorn
from fastapi import FastAPI, Query
from starlette.middleware.cors import CORSMiddleware
from starlette.responses import UJSONResponse
from hictools.hgserver.store import TileSetDB, TileSet
def create_app(db):
app = FastAPI()
ap... | [
"fastapi.FastAPI",
"socket.socket",
"pathlib.Path",
"hictools.hgserver.store.TileSetDB",
"hictools.hgserver.store.TileSet.tiles",
"hictools.hgserver.store.TileSet.tileset_info",
"hictools.hgserver.store.TileSet.meta",
"fastapi.Query"
] | [((304, 313), 'fastapi.FastAPI', 'FastAPI', ([], {}), '()\n', (311, 313), False, 'from fastapi import FastAPI, Query\n'), ((1378, 1389), 'fastapi.Query', 'Query', (['None'], {}), '(None)\n', (1383, 1389), False, 'from fastapi import FastAPI, Query\n'), ((1441, 1464), 'fastapi.Query', 'Query', (['None'], {'alias': '"""d... |
import sys
import os
import logging
import argparse
import time
import json
import serial
import yaml
import ssl
import paho.mqtt.client as mqtt
from struct import *
def buildFrame(command, data=''):
frame = [255]
frame.extend(map(ord, command))
frame.extend(map(ord, data))
frame.insert(0, len(frame))
retur... | [
"logging.basicConfig",
"logging.debug",
"argparse.ArgumentParser",
"os.getenv",
"paho.mqtt.client.Client",
"json.dumps",
"logging.warning",
"os.path.join",
"time.sleep",
"yaml.safe_load",
"serial.Serial",
"sys.exit",
"logging.info"
] | [((663, 695), 'logging.warning', 'logging.warning', (['"""Frame invalid"""'], {}), "('Frame invalid')\n", (678, 695), False, 'import logging\n'), ((1944, 1959), 'time.sleep', 'time.sleep', (['(0.5)'], {}), '(0.5)\n', (1954, 1959), False, 'import time\n'), ((6228, 6279), 'logging.info', 'logging.info', (['f"""Connected ... |
#!/usr/bin/env python
import sys
import math
import random
import json
### Enter a location in an urban area and then generate a set random locations nearby.
### Continue to use a similar process to generate a smaller number near surrounding urban areas
### until you get the number of locations you need. Next, these ... | [
"math.cos",
"random.uniform",
"math.sin",
"math.sqrt"
] | [((730, 754), 'random.uniform', 'random.uniform', (['(0.0)', '(1.0)'], {}), '(0.0, 1.0)\n', (744, 754), False, 'import random\n'), ((770, 794), 'random.uniform', 'random.uniform', (['(0.0)', '(1.0)'], {}), '(0.0, 1.0)\n', (784, 794), False, 'import random\n'), ((824, 836), 'math.sqrt', 'math.sqrt', (['a'], {}), '(a)\n'... |
# Copyright (c) 2021, eQualit.ie inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import absolute_import
from setuptools import setup
# To use a consistent encoding
from codecs import open
f... | [
"os.path.join",
"os.path.dirname",
"codecs.open",
"setuptools.setup"
] | [((649, 1055), 'setuptools.setup', 'setup', ([], {'name': '"""deflect"""', 'version': '"""0.0.1"""', 'description': '"""Provides the orchestration functionality for Deflect-next"""', 'long_description': 'long_description', 'tests_require': 'tests_require', 'extras_require': "{'test': tests_require}", 'test_suite': '"""... |
#from rasa_core.channels.facebook import FacebookInput
from rasa_core.channels.socketio import SocketIOInput
from rasa_core.interpreter import RasaNLUInterpreter
import yaml
from rasa_core.utils import EndpointConfig
from rasa_core.agent import Agent
from flask import Flask
from flask import render_template, jso... | [
"flask.render_template",
"flask.Flask"
] | [((472, 487), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (477, 487), False, 'from flask import Flask\n'), ((545, 574), 'flask.render_template', 'render_template', (['"""index.html"""'], {}), "('index.html')\n", (560, 574), False, 'from flask import render_template, jsonify, request\n')] |
from setuptools import setup, find_packages
setup(
name='openapc-treemaps',
version='1.0',
description="Visual Frontend for OpenAPC data, based on OffenerHaushalt",
long_description='',
classifiers=[
],
keywords='',
author='<NAME>',
author_email='<EMAIL>',
url='https://opena... | [
"setuptools.find_packages"
] | [((361, 417), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "['ez_setup', 'examples', 'tests']"}), "(exclude=['ez_setup', 'examples', 'tests'])\n", (374, 417), False, 'from setuptools import setup, find_packages\n')] |
# apps/vendor/admin.py
# Django modules
from django.contrib import admin
# Locals
from apps.vendor.models import Vendor
# Register your models here.
admin.site.register(Vendor) | [
"django.contrib.admin.site.register"
] | [((154, 181), 'django.contrib.admin.site.register', 'admin.site.register', (['Vendor'], {}), '(Vendor)\n', (173, 181), False, 'from django.contrib import admin\n')] |
# Copyright (C) 2021 <NAME>. All rights reserved
# Reichergasse 131, A-3411 Weidling
# ****************************************************************************
# This program 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 Sof... | [
"common.require_attributes",
"roundup.cgi.TranslationService.get_translation"
] | [((1900, 2010), 'common.require_attributes', 'common.require_attributes', (['_', 'cl', 'nodeid', 'new_values', '"""rc_brand"""', '"""rc_product_type"""', '"""substance"""', '"""number"""'], {}), "(_, cl, nodeid, new_values, 'rc_brand',\n 'rc_product_type', 'substance', 'number')\n", (1925, 2010), False, 'import comm... |
import textattack
TRANSFORMATION = textattack.transformations.WordSwapWordNet()
| [
"textattack.transformations.WordSwapWordNet"
] | [((35, 79), 'textattack.transformations.WordSwapWordNet', 'textattack.transformations.WordSwapWordNet', ([], {}), '()\n', (77, 79), False, 'import textattack\n')] |
import FWCore.ParameterSet.Config as cms
from CalibMuon.DTCalibration.dtSegmentSelection_cfi import dtSegmentSelection
dtVDriftSegmentCalibration = cms.EDAnalyzer("DTVDriftSegmentCalibration",
# Segment selection
dtSegmentSelection,
recHits4DLabel = cms.InputTag('dt4DSegments'),
rootFileName = cms.unt... | [
"FWCore.ParameterSet.Config.untracked.string",
"FWCore.ParameterSet.Config.InputTag"
] | [((264, 292), 'FWCore.ParameterSet.Config.InputTag', 'cms.InputTag', (['"""dt4DSegments"""'], {}), "('dt4DSegments')\n", (276, 292), True, 'import FWCore.ParameterSet.Config as cms\n'), ((313, 356), 'FWCore.ParameterSet.Config.untracked.string', 'cms.untracked.string', (['"""DTVDriftHistos.root"""'], {}), "('DTVDriftHi... |
""" A3C in Code - ExperienceReplayMemory
Based On:
A3C Code as in the book Deep Reinforcement Learning, Chapter 12.
Runtime: Python 3.6.5
DocStrings: GoogleStyle
Author : <NAME> (<EMAIL>)
******************************************************************
Adjusted: <NAME>
@author: sebtac
@contact: https://www... | [
"logging.basicConfig",
"collections.deque",
"logging.getLogger"
] | [((693, 714), 'logging.basicConfig', 'logging.basicConfig', ([], {}), '()\n', (712, 714), False, 'import logging\n'), ((777, 796), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (794, 796), False, 'import logging\n'), ((1987, 2015), 'collections.deque', 'deque', ([], {'maxlen': 'queue_capacity'}), '(maxlen... |
"""
WeatherAPI client implementation.
Use this to make requests to weatherapi.com.
"""
import os
import json
from datetime import datetime as dt
import requests
from . import cache
from . import errors
from . import types
__all__ = ['Client']
# some constants
_TYPE_CACHE = 'c'
_TYPE_JSON = 'r'
class Client:
... | [
"os.path.dirname",
"datetime.datetime.now",
"requests.Session"
] | [((713, 731), 'requests.Session', 'requests.Session', ([], {}), '()\n', (729, 731), False, 'import requests\n'), ((1093, 1118), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (1108, 1118), False, 'import os\n'), ((8238, 8246), 'datetime.datetime.now', 'dt.now', ([], {}), '()\n', (8244, 8246),... |
import asyncio
import os
import re
import shlex
import subprocess
import sys
import uuid
from asyncio import AbstractEventLoop
from contextlib import suppress
from datetime import datetime, timedelta
from pathlib import Path
from time import sleep, time
from typing import Any, AsyncIterator, Callable, ContextManager, D... | [
"neuro_sdk.RemoteImage.new_external_image",
"re.compile",
"shlex.split",
"re_assert.Matches",
"time.sleep",
"datetime.timedelta",
"neuro_sdk.Resources",
"contextlib.suppress",
"asyncio.gather",
"asyncio.sleep",
"pytest.mark.skipif",
"aiohttp.test_utils.unused_port",
"os.urandom",
"re.match... | [((739, 825), 'pytest.mark.skipif', 'pytest.mark.skipif', (["(sys.platform != 'linux')"], {'reason': '"""PTY tests require Linux box"""'}), "(sys.platform != 'linux', reason=\n 'PTY tests require Linux box')\n", (757, 825), False, 'import pytest\n'), ((1033, 1071), 're.compile', 're.compile', (['"""\\\\033\\\\[[;?0-... |
import json
from django.test import TestCase, LiveServerTestCase
import django.test.client
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
import oauthlib.oauth1.rfc5849
from restless_oauth.models import *
import requests
from oau... | [
"json.loads",
"oauth_hook.OAuthHook",
"django.contrib.sites.models.Site.objects.clear_cache",
"django.core.urlresolvers.reverse",
"django.contrib.sites.models.Site.objects.get",
"django.contrib.auth.models.User.objects.all",
"django.contrib.auth.models.User.objects.create_user",
"urlparse.urlparse"
] | [((4054, 4076), 'django.contrib.sites.models.Site.objects.get', 'Site.objects.get', ([], {'id': '(1)'}), '(id=1)\n', (4070, 4076), False, 'from django.contrib.sites.models import Site\n'), ((4133, 4159), 'django.contrib.sites.models.Site.objects.clear_cache', 'Site.objects.clear_cache', ([], {}), '()\n', (4157, 4159), ... |
from django.test import TestCase
from maps.models import KmlMap
from django.core.urlresolvers import reverse
class ResponseStatus(TestCase):
def setUp(self):
self.testKML = KmlMap(name="Test KML", slug="test-kml", kml="blah blah blah")
self.testKML.save()
def test_kml_map(self):
resp... | [
"maps.models.KmlMap",
"django.core.urlresolvers.reverse"
] | [((188, 250), 'maps.models.KmlMap', 'KmlMap', ([], {'name': '"""Test KML"""', 'slug': '"""test-kml"""', 'kml': '"""blah blah blah"""'}), "(name='Test KML', slug='test-kml', kml='blah blah blah')\n", (194, 250), False, 'from maps.models import KmlMap\n'), ((496, 518), 'django.core.urlresolvers.reverse', 'reverse', (['""... |
#nvda_eoaProxy.pyw
#A part of NonVisual Desktop Access (NVDA)
#Copyright (C) 2014 NV Access Limited
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
"""NVDA proxy process for Ease of Access in Windows Vista/7.
This version of Ease of Access terminates ATs on every deskto... | [
"winKernel.closeHandle",
"ctypes.byref",
"ctypes.create_unicode_buffer",
"ctypes.windll.user32.CloseDesktop",
"winUser.FindWindow",
"os.path.join",
"winKernel.openProcess",
"time.sleep",
"winUser.getWindowThreadProcessID",
"ctypes.windll.user32.OpenInputDesktop",
"winKernel.waitForSingleObject",... | [((789, 845), 'winKernel.openProcess', 'winKernel.openProcess', (['winKernel.SYNCHRONIZE', '(False)', 'pid'], {}), '(winKernel.SYNCHRONIZE, False, pid)\n', (810, 845), False, 'import winKernel\n'), ((894, 944), 'ctypes.windll.user32.OpenInputDesktop', 'ctypes.windll.user32.OpenInputDesktop', (['(0)', '(False)', '(0)'],... |
import random
from datetime import datetime
import factory
from tests.factories import faker
from faker import Factory
from config.db import db
from federation_api.people.model import Person
class PersonFactory(factory.alchemy.SQLAlchemyModelFactory):
class Meta:
model = Person
sqlalchemy_session ... | [
"tests.factories.faker.email",
"tests.factories.faker.phone_number",
"random.randint",
"tests.factories.faker.name"
] | [((378, 391), 'tests.factories.faker.email', 'faker.email', ([], {}), '()\n', (389, 391), False, 'from tests.factories import faker\n'), ((437, 457), 'tests.factories.faker.phone_number', 'faker.phone_number', ([], {}), '()\n', (455, 457), False, 'from tests.factories import faker\n'), ((508, 534), 'random.randint', 'r... |
# -*- coding: utf-8 -*-
##########################################################################
# NSAp - Copyright (C) CEA, 2021
# Distributed under the terms of the CeCILL-B license, as published by
# the CEA-CNRS-INRIA. Refer to the LICENSE file or to
# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
#... | [
"nibabel.save",
"nibabel.load",
"numpy.dot",
"numpy.savetxt",
"nibabel.Nifti1Image",
"numpy.loadtxt"
] | [((9689, 9716), 'numpy.savetxt', 'np.savetxt', (['trffile', 'affine'], {}), '(trffile, affine)\n', (9699, 9716), True, 'import numpy as np\n'), ((10278, 10298), 'nibabel.load', 'nibabel.load', (['imfile'], {}), '(imfile)\n', (10290, 10298), False, 'import nibabel\n'), ((10313, 10335), 'nibabel.load', 'nibabel.load', ([... |
"""
Unit tests for dynophore.viz.plot.static.
Will only test if static plotting raises errors.
"""
import pytest
import matplotlib
from dynophores.viz import plot
@pytest.mark.parametrize(
"superfeature_ids",
[
("all"), # Default
(("all",)),
("AR[4605,4607,4603,4606,4604]"),
... | [
"dynophores.viz.plot.static.envpartners_all_in_one",
"dynophores.viz.plot.static.envpartners_occurrences",
"dynophores.viz.plot.static.superfeatures_occurrences",
"dynophores.viz.plot.static.envpartners_distances",
"pytest.mark.parametrize",
"pytest.raises",
"dynophores.viz.plot.static.superfeatures_vs_... | [((169, 392), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""superfeature_ids"""', "['all', ('all',), 'AR[4605,4607,4603,4606,4604]', [\n 'AR[4605,4607,4603,4606,4604]', 'AR[4622,4615,4623,4613,4614,4621]'], [\n 'all', 'AR[4622,4615,4623,4613,4614,4621]']]"], {}), "('superfeature_ids', ['all', ('all'... |
import argparse
import logging
import json
from sanic import Sanic, response
from node import Node
from blockchain.transaction import Transaction
from blockchain.block import Block
logging.basicConfig(level=logging.INFO)
log = logging.getLogger(__name__)
log.setLevel(logging.DEBUG)
parser = argparse.ArgumentParser(... | [
"logging.basicConfig",
"logging.getLogger",
"sanic.response.json",
"argparse.ArgumentParser",
"sanic.Sanic",
"node.Node"
] | [((184, 223), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (203, 223), False, 'import logging\n'), ((230, 257), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (247, 257), False, 'import logging\n'), ((296, 358), 'argparse.Argumen... |
from sqlalchemy import Boolean, Column, String
from sqlalchemy.dialects.mysql import INTEGER as Integer, TINYINT as TinyInteger
from ichnaea.models.base import _Model
class ApiKey(_Model):
"""
ApiKey model.
The allow_fallback and fallback columns determine if and what
fallback location provider shou... | [
"sqlalchemy.String",
"sqlalchemy.Column"
] | [((1221, 1236), 'sqlalchemy.Column', 'Column', (['Integer'], {}), '(Integer)\n', (1227, 1236), False, 'from sqlalchemy import Boolean, Column, String\n'), ((1297, 1312), 'sqlalchemy.Column', 'Column', (['Boolean'], {}), '(Boolean)\n', (1303, 1312), False, 'from sqlalchemy import Boolean, Column, String\n'), ((1360, 137... |
import logging
import sys
from cliff.command import Command
from ActivityEvent import ActivityEvent
this = sys.modules[__name__]
this.types = ["cycle","sleep","run"]
this.units = ["km","min"]
this.timeout = 86400 # 1 day
class Start(Command):
"Start an activity. Give activity type as argument. Only one activity ... | [
"logging.getLogger",
"ActivityEvent.ActivityEvent"
] | [((356, 383), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (373, 383), False, 'import logging\n'), ((794, 831), 'ActivityEvent.ActivityEvent', 'ActivityEvent', (['this.types', 'this.units'], {}), '(this.types, this.units)\n', (807, 831), False, 'from ActivityEvent import ActivityEvent\n... |
import cv2
import numpy as np
import matplotlib.pyplot as plt
def canny(image):
gray = cv2.cvtColor(image, cv2.COLOR_RGB2GRAY)
blur = cv2.GaussianBlur(gray,(5,5),0)
canny = cv2.Canny(blur, 50, 150)
return canny
def display_lines(image, lines):
line_image = np.zeros_like(image)
if lines is no... | [
"numpy.copy",
"cv2.fillPoly",
"cv2.Canny",
"cv2.line",
"numpy.zeros_like",
"cv2.bitwise_and",
"cv2.imshow",
"numpy.array",
"cv2.cvtColor",
"cv2.GaussianBlur",
"cv2.waitKey",
"cv2.imread"
] | [((786, 814), 'cv2.imread', 'cv2.imread', (['"""test_image.jpg"""'], {}), "('test_image.jpg')\n", (796, 814), False, 'import cv2\n'), ((828, 842), 'numpy.copy', 'np.copy', (['image'], {}), '(image)\n', (835, 842), True, 'import numpy as np\n'), ((871, 899), 'cv2.imshow', 'cv2.imshow', (['"""result"""', 'canny1'], {}), ... |
from data.models import Student, Grade_8, Grade_9, Grade_10, Grade_11, Grade_12
from itertools import zip_longest
from django.db.models import Q
from django.http import QueryDict
def get_year_keys(dict):
'''checks if there are grade_XX_year:0000 keys'''
for key, val in dict.items():
if key[:6] == "gra... | [
"data.models.Student.objects.all",
"django.db.models.Q",
"django.http.QueryDict",
"data.models.Student.objects.filter"
] | [((1964, 1999), 'data.models.Student.objects.filter', 'Student.objects.filter', ([], {'active': '(True)'}), '(active=True)\n', (1986, 1999), False, 'from data.models import Student, Grade_8, Grade_9, Grade_10, Grade_11, Grade_12\n'), ((1155, 1196), 'data.models.Student.objects.filter', 'Student.objects.filter', ([], {'... |
import pickle
import matplotlib.pyplot as plt
from visualization.plots import plot_conf_int
passive_e1_accs = []
# passive_e5_accs = []
# passive_e10_accs = []
#
# passive_ae_e1_accs = []
# passive_ae_es01_t1_accs = []
# passive_ae_es01_t2_accs = []
#
ll_1_accs = []
ll_2_accs = []
ll_3_accs = []
#
# ll2_margin_1_accs... | [
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"visualization.plots.plot_conf_int",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.show"
] | [((7744, 7812), 'visualization.plots.plot_conf_int', 'plot_conf_int', (['passive_e1_accs', '(2000)', '(20)', '(200)', '"""passive"""'], {'color': '"""C0"""'}), "(passive_e1_accs, 2000, 20, 200, 'passive', color='C0')\n", (7757, 7812), False, 'from visualization.plots import plot_conf_int\n'), ((9719, 9797), 'visualizat... |
# coding: utf-8
"""
Senzing REST API
This is the Senzing REST API. It describes the REST interface to Senzing API functions available via REST. It leverages the Senzing native API which is documented at [https://docs.senzing.com](https://docs.senzing.com) # noqa: E501
OpenAPI spec version: 1.6.0
... | [
"unittest.main"
] | [((1724, 1739), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1737, 1739), False, 'import unittest\n')] |
# -*- coding: utf-8 -*-
#
# BBRMom
# Copyright (C) 2021 <NAME> - Istituto Nazionale di Ricerca Metrologica (INRIM)
#
# 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 restriction, incl... | [
"matplotlib.dates.ConciseDateFormatter",
"os.path.exists",
"collections.deque",
"os.makedirs",
"os.path.join",
"datetime.date.today",
"time.sleep",
"pyvisa.ResourceManager",
"datetime.datetime.now",
"os.path.basename",
"matplotlib.dates.AutoDateLocator",
"time.time"
] | [((1438, 1460), 'pyvisa.ResourceManager', 'visa.ResourceManager', ([], {}), '()\n', (1458, 1460), True, 'import pyvisa as visa\n'), ((1759, 1774), 'time.sleep', 'time.sleep', (['(0.1)'], {}), '(0.1)\n', (1769, 1774), False, 'import time\n'), ((1796, 1811), 'time.sleep', 'time.sleep', (['(0.1)'], {}), '(0.1)\n', (1806, ... |
"""
LinkedList - example
"""
import ds_03_00_users as DB
from A_Classes.user import User
from B_Data_Structures.linkedList import LinkedList
def main():
linked_list = LinkedList()
for user in DB.user_to_add:
print(user)
linked_list.add(User(*user))
print()
linked_li... | [
"B_Data_Structures.linkedList.LinkedList",
"ds_03_00_users.user_to_add.append",
"A_Classes.user.User"
] | [((184, 196), 'B_Data_Structures.linkedList.LinkedList', 'LinkedList', ([], {}), '()\n', (194, 196), False, 'from B_Data_Structures.linkedList import LinkedList\n'), ((387, 443), 'ds_03_00_users.user_to_add.append', 'DB.user_to_add.append', (["('<EMAIL>', 'user3', 'user3', 31)"], {}), "(('<EMAIL>', 'user3', 'user3', 31... |
import pygame
import time
class cggframe():
def __init__(self):
pass
def main(self,ti):
self.endflag=0
while self.endflag==0:
for event in pygame.event.get():
if event.type==pygame.QUIT:
self.endflag=1
i... | [
"pygame.display.flip",
"time.sleep",
"pygame.event.get"
] | [((201, 219), 'pygame.event.get', 'pygame.event.get', ([], {}), '()\n', (217, 219), False, 'import pygame\n'), ((407, 428), 'pygame.display.flip', 'pygame.display.flip', ([], {}), '()\n', (426, 428), False, 'import pygame\n'), ((476, 490), 'time.sleep', 'time.sleep', (['ti'], {}), '(ti)\n', (486, 490), False, 'import t... |
import argparse
from all.environments import GymEnvironment
from all.experiments import Experiment
from all.presets import classic_control
def run_classic():
parser = argparse.ArgumentParser(description="Run a classic control benchmark.")
parser.add_argument("env", help="Name of the env (e.g. CartPole-v1)")
... | [
"all.environments.GymEnvironment",
"argparse.ArgumentParser"
] | [((173, 244), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Run a classic control benchmark."""'}), "(description='Run a classic control benchmark.')\n", (196, 244), False, 'import argparse\n'), ((764, 808), 'all.environments.GymEnvironment', 'GymEnvironment', (['args.env'], {'device': ... |
import argparse
import importlib.util
import os
import yaml
from datetime import datetime
from descriptors import cachedproperty
from argcmdr import RootCommand, Command, main, cmdmethod
from sqlalchemy.engine.url import URL
from triage.component.architect.feature_generators import FeatureGenerator
from triage.compo... | [
"argcmdr.cmdmethod",
"triage.component.results_schema.stamp_db",
"triage.experiments.SingleThreadedExperiment",
"verboselogs.VerboseLogger",
"triage.util.db.create_engine",
"os.path.exists",
"triage.component.catwalk.storage.Store.factory",
"triage.component.results_schema.upgrade_db",
"triage.compo... | [((964, 999), 'verboselogs.VerboseLogger', 'verboselogs.VerboseLogger', (['__name__'], {}), '(__name__)\n', (989, 999), False, 'import verboselogs, logging\n'), ((1507, 1539), 'os.path.abspath', 'os.path.abspath', (['"""database.yaml"""'], {}), "('database.yaml')\n", (1522, 1539), False, 'import os\n'), ((1565, 1597), ... |
'''
Created on Mar 25, 2014
@author: sean
'''
import time
class Event(object):
EVENT_TYPES = {
17: 'restore',
18: 'power_on',
19: 'power_off',
}
def __init__(self, conn, event_id):
self.conn = conn
self.event... | [
"time.time",
"time.sleep"
] | [((1064, 1075), 'time.time', 'time.time', ([], {}), '()\n', (1073, 1075), False, 'import time\n'), ((1349, 1374), 'time.sleep', 'time.sleep', (['poll_interval'], {}), '(poll_interval)\n', (1359, 1374), False, 'import time\n'), ((1135, 1146), 'time.time', 'time.time', ([], {}), '()\n', (1144, 1146), False, 'import time\... |
# rnc.py - functions for handling Dominican Republic tax registration
#
# Copyright (C) 2015 <NAME>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, ... | [
"stdnum.util.clean"
] | [((1530, 1549), 'stdnum.util.clean', 'clean', (['number', '""" -"""'], {}), "(number, ' -')\n", (1535, 1549), False, 'from stdnum.util import clean\n')] |
import numpy as np #we use numpy for lots of things
def main():
i=0 #integers can be declared with a number
n=10 #here is another integer
x=119.0 #floating point nums are declared with a "."
#we can use numpy to declare arrays quickly
y=np.zeros(n,dtype=float)
#we cn use for loops to iterate... | [
"numpy.zeros"
] | [((262, 286), 'numpy.zeros', 'np.zeros', (['n'], {'dtype': 'float'}), '(n, dtype=float)\n', (270, 286), True, 'import numpy as np\n')] |
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 31 12:44:45 2022
@author: Danie
DEPRICATED FILE DO NOT USE
Old biolerplate work for when stage 3 classification was just going to be selecting a set of representative
points create by ModelsA B and C. Has terrible accuracy and should absolutley not be used.
"""
import... | [
"random.shuffle",
"matplotlib.pyplot.show",
"os.path.join",
"os.getcwd",
"matplotlib.pyplot.figure",
"tensorflow.keras.models.load_model",
"pandas.DataFrame",
"csv.reader",
"test_iterator.TestIterator",
"mpl_toolkits.mplot3d.Axes3D",
"sklearn.svm.SVC"
] | [((1307, 1316), 'sklearn.svm.SVC', 'svm.SVC', ([], {}), '()\n', (1314, 1316), False, 'from sklearn import svm\n'), ((1334, 1348), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (1346, 1348), True, 'import pandas as pd\n'), ((1890, 1915), 'random.shuffle', 'random.shuffle', (['file_list'], {}), '(file_list)\n', (... |
import codecs
from distutils.core import setup
def read(fname):
'''
Read a file from the directory where setup.py resides
'''
with codecs.open(fname, encoding='utf-8') as rfh:
return rfh.read()
try:
description = read('README.txt')
except:
description = read('README.md')
setup(
... | [
"codecs.open",
"distutils.core.setup"
] | [((309, 1014), 'distutils.core.setup', 'setup', ([], {'name': '"""python-ldap-test"""', 'version': '"""0.3.1"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'packages': "['ldap_test', 'ldap_test.test']", 'url': '"""https://github.com/zoldar/python-ldap-test/"""', 'license': '"""LICENSE.txt"""', 'descrip... |
# Copyright 2014 Cloudbase Solutions Srl
#
# 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 l... | [
"tempest.scenario.utils.ImageUtils",
"tempest.common.utils.windows.remote_client.WinRemoteClient",
"tempest.test.services",
"oslo_log.log.getLogger"
] | [((883, 910), 'oslo_log.log.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (900, 910), True, 'from oslo_log import log as logging\n'), ((5808, 5843), 'tempest.test.services', 'test.services', (['"""compute"""', '"""network"""'], {}), "('compute', 'network')\n", (5821, 5843), False, 'from tempest i... |
#!/usr/bin/env python
"""
File: DataSet
Date: 5/1/18
Author: <NAME> (<EMAIL>)
This file provides loading of the BraTS datasets
for ease of use in TensorFlow models.
"""
import os
import pandas as pd
import numpy as np
import nibabel as nib
from tqdm import tqdm
from BraTS.Patient import *
from BraTS.structure impo... | [
"os.path.join",
"os.listdir",
"numpy.empty"
] | [((2138, 2164), 'numpy.empty', 'np.empty', ([], {'shape': 'mris_shape'}), '(shape=mris_shape)\n', (2146, 2164), True, 'import numpy as np\n'), ((2186, 2212), 'numpy.empty', 'np.empty', ([], {'shape': 'segs_shape'}), '(shape=segs_shape)\n', (2194, 2212), True, 'import numpy as np\n'), ((5800, 5836), 'os.path.join', 'os.... |
# -*- coding: utf8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | [
"mock.patch",
"tuskar_ui.api.tuskar.Role",
"django.core.urlresolvers.reverse",
"tuskar_ui.api.tuskar.Parameter",
"tuskar_ui.test.test_data.tuskar_data.data",
"tuskar_ui.api.tuskar.Plan",
"openstack_dashboard.test.test_data.utils.TestDataContainer"
] | [((882, 945), 'django.core.urlresolvers.reverse', 'urlresolvers.reverse', (['"""horizon:infrastructure:parameters:index"""'], {}), "('horizon:infrastructure:parameters:index')\n", (902, 945), False, 'from django.core import urlresolvers\n'), ((979, 1070), 'django.core.urlresolvers.reverse', 'urlresolvers.reverse', (['"... |
import web
import pandas as pd
import numpy as np
import os
import subprocess
class NoEntriesError(Exception):
pass
def get_field(webdb, table, field, **conds):
r = webdb.where(table, **conds).first()
if not r or field not in r:
raise NoEntriesError(f"Field {field} not found in {table} for {cond... | [
"subprocess.check_output",
"os.listdir",
"pandas.read_csv",
"web.database",
"subprocess.Popen",
"os.path.join",
"pandas.concat"
] | [((755, 791), 'web.database', 'web.database', (["('sqlite:///' + db_path)"], {}), "('sqlite:///' + db_path)\n", (767, 791), False, 'import web\n'), ((882, 931), 'os.path.join', 'os.path.join', (['csv_location', '"""csv_data_master.csv"""'], {}), "(csv_location, 'csv_data_master.csv')\n", (894, 931), False, 'import os\n... |
# Set up the command line app
import argparse
from typing import Optional
from googlesheethelper import GoogleSheetHelper
from process_localisation import Localisation
from output.template_helper import TemplateGenerator
SCOPES = ['https://www.googleapis.com/auth/spreadsheets.readonly']
def main(spreadsheet_id: str... | [
"googlesheethelper.GoogleSheetHelper",
"argparse.ArgumentParser",
"output.template_helper.TemplateGenerator",
"process_localisation.Localisation"
] | [((860, 1020), 'googlesheethelper.GoogleSheetHelper', 'GoogleSheetHelper', ([], {'scopes': 'SCOPES', 'credentials': 'credentials', 'spreadsheet_id': 'spreadsheet_id', 'sheet_name': 'sheet_name', 'plurals_sheet_name': 'plurals_sheet_name'}), '(scopes=SCOPES, credentials=credentials, spreadsheet_id=\n spreadsheet_id, ... |
#!/usr/bin/env python3
# Used to check key files to make sure you have all the keys necessary to use this tool suite
from pathlib import Path
from binascii import crc32
# (crc32): (name)
KEY_NAMES = {
0xD416B5E1: "1BL_pub",
0xDCC4B906: "HVX_prv",
0xE86E10FD: "Master_pub",
0x4233AD81: "PIRS_prv_dev",
0x4C523F84:... | [
"binascii.crc32",
"pathlib.Path"
] | [((423, 435), 'pathlib.Path', 'Path', (['"""Keys"""'], {}), "('Keys')\n", (427, 435), False, 'from pathlib import Path\n'), ((583, 594), 'binascii.crc32', 'crc32', (['data'], {}), '(data)\n', (588, 594), False, 'from binascii import crc32\n')] |
import numpy as np
import pandas as pd
import pytest
import numpy.testing as npt
import matplotlib.pyplot as plt
from pulse2percept.viz import scatter_correlation, correlation_matrix
def test_scatter_correlation():
x = np.arange(100)
_, ax = plt.subplots()
ax = scatter_correlation(x, x, ax=ax)
npt.as... | [
"numpy.zeros",
"pytest.raises",
"pulse2percept.viz.scatter_correlation",
"pandas.DataFrame",
"pulse2percept.viz.correlation_matrix",
"matplotlib.pyplot.subplots",
"numpy.arange"
] | [((226, 240), 'numpy.arange', 'np.arange', (['(100)'], {}), '(100)\n', (235, 240), True, 'import numpy as np\n'), ((253, 267), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (265, 267), True, 'import matplotlib.pyplot as plt\n'), ((277, 309), 'pulse2percept.viz.scatter_correlation', 'scatter_correlatio... |
import sys
import json
from json_settings import Settings
from json_settings import DictionarySetting
from json_settings import StringSetSetting
from json_settings import SettingErrorMessage
class MainSettings(Settings):
@Settings.assign
def __init__(self, values):
self.entries = EntryDictionarySet... | [
"sys.exit"
] | [((1031, 1042), 'sys.exit', 'sys.exit', (['e'], {}), '(e)\n', (1039, 1042), False, 'import sys\n')] |
# coding=utf-8
# Copyright 2020 The Google Research Authors.
#
# 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 applicab... | [
"tf3d.standard_fields.get_output_voxel_fields",
"tensorflow.boolean_mask",
"tensorflow.ones",
"tf3d.standard_fields.get_input_point_fields",
"tf3d.standard_fields.get_input_voxel_fields",
"tf3d.standard_fields.get_output_point_fields",
"tensorflow.reshape",
"tensorflow.cast",
"tensorflow.squeeze",
... | [((817, 885), 'tensorflow.squeeze', 'tf.squeeze', (['inputs[standard_fields.InputDataFields.num_valid_points]'], {}), '(inputs[standard_fields.InputDataFields.num_valid_points])\n', (827, 885), True, 'import tensorflow as tf\n'), ((1589, 1634), 'tensorflow.cast', 'tf.cast', (['valid_mask_num_points'], {'dtype': 'tf.boo... |
# @author: <NAME>
# @license: General Public License (GPL)
# @contact: <EMAIL>
# @Hardware Note: CPU:AMD3900
# @Hardware Note: GPU: EVGA GTX1080ti
# @Software Note: Python3.6+CUDA+CUDNN+Pycharm+Pytorch
# @Version: 1.0
import pandas as pd # use functions in panda package to save the loss value into html files
import tor... | [
"torchvision.transforms.ToPILImage",
"torchvision.models.vgg19",
"torch.nn.Sequential",
"L_BFGS.optimier_with_L_BFGS_Algorithms",
"Models_get_the_loss_value.model_which_get_style_and_content_loss_value",
"Gram_Matrix.Gram_Matrix_for_style_features",
"Calculation_Style_Loss.Calculation_of_Style_Loss",
... | [((1864, 1920), 'loading_image_to_tensor.load_img_to_tensor', 'loading_image_to_tensor.load_img_to_tensor', (['load_s_image'], {}), '(load_s_image)\n', (1906, 1920), False, 'import loading_image_to_tensor\n'), ((2131, 2187), 'loading_image_to_tensor.load_img_to_tensor', 'loading_image_to_tensor.load_img_to_tensor', (['... |
from pypy.interpreter.error import oefmt
from .apiset import API
@API.func("HPy HPy_CallTupleDict(HPyContext *ctx, HPy callable, HPy args, HPy kw)")
def HPy_CallTupleDict(space, handles, ctx, h_callable, h_args, h_kw):
w_callable = handles.deref(h_callable)
w_args = handles.deref(h_args) if h_args else None
... | [
"pypy.interpreter.error.oefmt"
] | [((522, 614), 'pypy.interpreter.error.oefmt', 'oefmt', (['space.w_TypeError', '"""HPy_CallTupleDict requires args to be a tuple or null handle"""'], {}), "(space.w_TypeError,\n 'HPy_CallTupleDict requires args to be a tuple or null handle')\n", (527, 614), False, 'from pypy.interpreter.error import oefmt\n'), ((697,... |
'''
Advent of Code - 2018
--- Day 12: Subterranean Sustainability ---
'''
from collections import defaultdict
def next_generation(state, rules, zero_idx):
state = list('...' + ''.join(state) + '...')
zero_idx += 3
new_state = state[:]
for p in range(2, len(state) - 2):
new_state[p] = rules[... | [
"collections.defaultdict"
] | [((616, 641), 'collections.defaultdict', 'defaultdict', (["(lambda : '.')"], {}), "(lambda : '.')\n", (627, 641), False, 'from collections import defaultdict\n'), ((991, 1016), 'collections.defaultdict', 'defaultdict', (["(lambda : '.')"], {}), "(lambda : '.')\n", (1002, 1016), False, 'from collections import defaultdi... |
# This file is part of Indico.
# Copyright (C) 2002 - 2020 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from datetime import datetime, timedelta
import pytest
from pytz import timezone
from indico.util.date_t... | [
"datetime.datetime",
"pytz.timezone",
"indico.util.date_time.iterdays",
"indico.util.date_time.format_human_timedelta",
"indico.util.date_time.strftime_all_years",
"pytest.mark.parametrize",
"datetime.timedelta"
] | [((2346, 2371), 'pytz.timezone', 'timezone', (['"""Europe/Zurich"""'], {}), "('Europe/Zurich')\n", (2354, 2371), False, 'from pytz import timezone\n'), ((3545, 3672), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (["('from_', 'to', 'skip_weekends', 'day_whitelist', 'day_blacklist', 'expected')", 'iterdays_test_... |
import unittest
# from threatnote.main import active_reports
class active_reports(unittest.TestCase):
def test_list_reports(self):
"""
Test that it can sum a list of integers
"""
data = [1, 2, 3]
result = 6
self.assertEqual(result, 6)
if __name__ == '_... | [
"unittest.main"
] | [((335, 350), 'unittest.main', 'unittest.main', ([], {}), '()\n', (348, 350), False, 'import unittest\n')] |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, division, print_function, absolute_import
import sys
import os
import datetime
import logging
from contextlib import contextmanager
import uuid as uuidgen
# first party
from ..query import Query
from ..exception import InterfaceError, UniqueError
from ..... | [
"logging.getLogger",
"sys.exc_info",
"os.linesep.join",
"uuid.uuid4"
] | [((415, 442), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (432, 442), False, 'import logging\n'), ((1036, 1051), 'uuid.uuid4', 'uuidgen.uuid4', ([], {}), '()\n', (1049, 1051), True, 'import uuid as uuidgen\n'), ((21886, 21912), 'os.linesep.join', 'os.linesep.join', (['query_str'], {}),... |
# coding: utf-8
"""
Copyright 2016 SmartBear Software
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... | [
"six.iteritems"
] | [((19248, 19277), 'six.iteritems', 'iteritems', (['self.swagger_types'], {}), '(self.swagger_types)\n', (19257, 19277), False, 'from six import iteritems\n')] |
import os
import subprocess
from glob import glob
from setuptools import setup, find_packages
from wheel.bdist_wheel import bdist_wheel
from wheel.pep425tags import get_platform
here = os.path.dirname(__file__)
source = os.path.join(here, 'charliecloud')
subprocess.check_call(['make'], cwd=source)
included_files = [... | [
"subprocess.check_call",
"os.access",
"setuptools.setup",
"os.path.join",
"os.path.dirname"
] | [((186, 211), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (201, 211), False, 'import os\n'), ((221, 255), 'os.path.join', 'os.path.join', (['here', '"""charliecloud"""'], {}), "(here, 'charliecloud')\n", (233, 255), False, 'import os\n'), ((257, 300), 'subprocess.check_call', 'subprocess.c... |
#!/usr/bin/env python3
# Copyright (c) 2021, The University of Southern California.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above cop... | [
"check_logic_forms.convert_all",
"term.TermDB",
"metarecord.MetaRecord",
"json.loads",
"check_predicates.__is_const_str",
"sentence_record.SentenceDB",
"argparse.ArgumentParser",
"pathlib.Path",
"json.dumps",
"metarecord.MetaDB",
"collections.defaultdict",
"similarity.similarity_select",
"ch... | [((2430, 2442), 'sentence_record.SentenceDB', 'SentenceDB', ([], {}), '()\n', (2440, 2442), False, 'from sentence_record import SentenceRecord, SentenceDB\n'), ((2624, 2648), 'sentence_record.SentenceRecord', 'SentenceRecord', (['*rows[0]'], {}), '(*rows[0])\n', (2638, 2648), False, 'from sentence_record import Sentenc... |
# Copyright 2015 Open Platform for NFV Project, Inc. and its contributors
# This software is distributed under the terms and conditions of the 'Apache-2.0'
# license which can be found in the file 'LICENSE' in this package distribution
# or at 'http://www.apache.org/licenses/LICENSE-2.0'.
from setuptools import setup,... | [
"setuptools.find_packages"
] | [((502, 517), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (515, 517), False, 'from setuptools import setup, find_packages\n')] |
# -*- coding: utf-8 -*-
"""Tests for backoff_utils._backoff"""
from datetime import datetime
import pytest
import backoff_utils.strategies as strategies
from backoff_utils._decorator import apply_backoff
_attempts = 0
_was_successful = False
def when_successful(value):
"""Update the global ``_was_successful`... | [
"datetime.datetime.utcnow",
"backoff_utils.strategies.Polynomial",
"backoff_utils.strategies.Exponential",
"backoff_utils.strategies.Fixed",
"pytest.raises"
] | [((3383, 3400), 'datetime.datetime.utcnow', 'datetime.utcnow', ([], {}), '()\n', (3398, 3400), False, 'from datetime import datetime\n'), ((3922, 3939), 'datetime.datetime.utcnow', 'datetime.utcnow', ([], {}), '()\n', (3937, 3939), False, 'from datetime import datetime\n'), ((3237, 3269), 'pytest.raises', 'pytest.raise... |
#!/usr/bin/env python
"""Computes the result of a stats cPickle file.
A stats cPickle file has the following format:
- List of N elements, each representing a track.
- Each position (or track) contains the rank index of the covers
corresponding to this position.
The results this script computes are:
- Mean Avera... | [
"pylab.title",
"numpy.mean",
"argparse.ArgumentParser",
"numpy.where",
"numpy.asarray",
"pylab.xlabel",
"pylab.legend",
"utils.load_pickle",
"pylab.figure",
"utils.configure_logger",
"numpy.zeros",
"numpy.sum",
"numpy.isnan",
"pylab.ylabel",
"numpy.arange",
"pylab.show"
] | [((2950, 2965), 'numpy.mean', 'np.mean', (['mean_r'], {}), '(mean_r)\n', (2957, 2965), True, 'import numpy as np\n'), ((3236, 3251), 'numpy.mean', 'np.mean', (['mean_r'], {}), '(mean_r)\n', (3243, 3251), True, 'import numpy as np\n'), ((3321, 3338), 'numpy.asarray', 'np.asarray', (['ranks'], {}), '(ranks)\n', (3331, 33... |
#!/usr/env/bin python3
from context import jyserver
from jyserver.Server import Server, Client
import time
class App(Client):
def __init__(self):
self.start0 = time.time()
def index(self):
self.h(html = '''
All browser tabs should be the same
<p id="time">WHEN</p>
''') ... | [
"jyserver.Server.Server",
"time.time",
"time.sleep"
] | [((477, 488), 'jyserver.Server.Server', 'Server', (['App'], {}), '(App)\n', (483, 488), False, 'from jyserver.Server import Server, Client\n'), ((174, 185), 'time.time', 'time.time', ([], {}), '()\n', (183, 185), False, 'import time\n'), ((453, 466), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (463, 466), False... |
#!/usr/bin/env python
# 2014-07-11 DHT22.py
import time
import pigpio
class sensor:
def __init__(self, pi, gpio):
"""
Instantiate with the Pi and gpio to which the DHT22 output
pin is connected.
Optionally a LED may be specified. This will be blinked for
each successful reading.
... | [
"pigpio.tickDiff",
"pigpio.pi",
"time.sleep",
"time.time"
] | [((1502, 1539), 'pigpio.tickDiff', 'pigpio.tickDiff', (['self.high_tick', 'tick'], {}), '(self.high_tick, tick)\n', (1517, 1539), False, 'import pigpio\n'), ((4794, 4811), 'time.sleep', 'time.sleep', (['(0.017)'], {}), '(0.017)\n', (4804, 4811), False, 'import time\n'), ((5249, 5260), 'pigpio.pi', 'pigpio.pi', ([], {})... |
from bottle import route, run, template
from datetime import datetime
@route('/hello')
def hello():
now = datetime.now()
return template('Hello World! {{now}}', now=now)
run(host='localhost', port=8080, debug=True)
| [
"datetime.datetime.now",
"bottle.template",
"bottle.run",
"bottle.route"
] | [((73, 88), 'bottle.route', 'route', (['"""/hello"""'], {}), "('/hello')\n", (78, 88), False, 'from bottle import route, run, template\n'), ((182, 226), 'bottle.run', 'run', ([], {'host': '"""localhost"""', 'port': '(8080)', 'debug': '(True)'}), "(host='localhost', port=8080, debug=True)\n", (185, 226), False, 'from bo... |
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
"json.dumps",
"time.sleep"
] | [((2982, 3007), 'time.sleep', 'time.sleep', (['wait_interval'], {}), '(wait_interval)\n', (2992, 3007), False, 'import time\n'), ((2499, 2524), 'json.dumps', 'json.dumps', (['submitted_job'], {}), '(submitted_job)\n', (2509, 2524), False, 'import json\n')] |
# coding: utf-8
from azure.storage.blob import BlockBlobService
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------... | [
"azure.storage.blob.BlockBlobService",
"azure.storage.common.CloudStorageAccount"
] | [((723, 802), 'azure.storage.common.CloudStorageAccount', 'CloudStorageAccount', ([], {'account_name': '"""<account_name>"""', 'account_key': '"""<account_key>"""'}), "(account_name='<account_name>', account_key='<account_key>')\n", (742, 802), False, 'from azure.storage.common import CloudStorageAccount\n'), ((893, 96... |
import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="Task-6-Report-of-Monaco-2018-Racing",
version="0.0.3",
author="<NAME>",
author_email="<EMAIL>",
description="This package processes driver statistics",
long_descripti... | [
"setuptools.find_packages"
] | [((599, 625), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (623, 625), False, 'import setuptools\n')] |
"""Package entroq provides a client library for working with EntroQ.
"""
import base64
import json
import threading
import time
import uuid
import grpc
from google.protobuf import json_format
from grpc_health.v1 import health_pb2
from grpc_health.v1 import health_pb2_grpc
from grpc_status import rpc_status
from . i... | [
"grpc_status.rpc_status.from_call",
"grpc_health.v1.health_pb2_grpc.HealthStub",
"threading.Lock",
"grpc.insecure_channel",
"base64.b64decode",
"uuid.uuid4",
"threading.Event",
"google.protobuf.json_format.MessageToDict",
"time.time",
"threading.Thread"
] | [((723, 748), 'grpc_status.rpc_status.from_call', 'rpc_status.from_call', (['exc'], {}), '(exc)\n', (743, 748), False, 'from grpc_status import rpc_status\n'), ((3603, 3635), 'grpc.insecure_channel', 'grpc.insecure_channel', (['self.addr'], {}), '(self.addr)\n', (3624, 3635), False, 'import grpc\n'), ((3724, 3764), 'gr... |
from test.common import TestCase
import torch
from brnolm.language_models.lstm_model import LSTMLanguageModel
class OutputExtractionTests(TestCase):
def test_multilayer(self):
model = LSTMLanguageModel(4, ninp=10, nhid=10, nlayers=2, dropout=0.0)
h0 = model.init_hidden(3)
o, h1 = model(t... | [
"torch.tensor",
"brnolm.language_models.lstm_model.LSTMLanguageModel"
] | [((200, 262), 'brnolm.language_models.lstm_model.LSTMLanguageModel', 'LSTMLanguageModel', (['(4)'], {'ninp': '(10)', 'nhid': '(10)', 'nlayers': '(2)', 'dropout': '(0.0)'}), '(4, ninp=10, nhid=10, nlayers=2, dropout=0.0)\n', (217, 262), False, 'from brnolm.language_models.lstm_model import LSTMLanguageModel\n'), ((319, ... |
import jinja2
from sanic import response
from .util import get_banner
j2 = jinja2.Environment(
loader=jinja2.PackageLoader(__name__, "templates"),
autoescape=jinja2.select_autoescape(["html", "xml"]),
)
j2.globals.update({"len": len, "get_banner": get_banner})
def renderpost_filter(t, show_thread_link=Fal... | [
"jinja2.select_autoescape",
"jinja2.PackageLoader"
] | [((109, 152), 'jinja2.PackageLoader', 'jinja2.PackageLoader', (['__name__', '"""templates"""'], {}), "(__name__, 'templates')\n", (129, 152), False, 'import jinja2\n'), ((169, 210), 'jinja2.select_autoescape', 'jinja2.select_autoescape', (["['html', 'xml']"], {}), "(['html', 'xml'])\n", (193, 210), False, 'import jinja... |
import warnings
import numpy as np
from . import dispatch, B, Numeric
from ..shape import unwrap_dimension
from ..types import NPDType, NPRandomState, Int
__all__ = []
@dispatch
def create_random_state(_: NPDType, seed: Int = 0):
return np.random.RandomState(seed=seed)
@dispatch
def global_random_state(_: NP... | [
"warnings.warn",
"numpy.random.RandomState"
] | [((246, 278), 'numpy.random.RandomState', 'np.random.RandomState', ([], {'seed': 'seed'}), '(seed=seed)\n', (267, 278), True, 'import numpy as np\n'), ((561, 630), 'warnings.warn', 'warnings.warn', (['"""Casting random number of type float to type integer."""'], {}), "('Casting random number of type float to type integ... |
from wsgiref.simple_server import make_server
from pyramid.config import Configurator
from pyramid.response import Response
from pyramid.view import view_config
import pyramid.httpexceptions as exc
import re
from pyramid.request import Request
from _pybgpstream import BGPStream, BGPRecord, BGPElem
from datetime impor... | [
"_pybgpstream.BGPStream",
"pyramid.config.Configurator",
"_pybgpstream.BGPRecord",
"pdb.set_trace",
"wsgiref.simple_server.make_server"
] | [((417, 432), 'pdb.set_trace', 'pdb.set_trace', ([], {}), '()\n', (430, 432), False, 'import pdb\n'), ((838, 849), '_pybgpstream.BGPStream', 'BGPStream', ([], {}), '()\n', (847, 849), False, 'from _pybgpstream import BGPStream, BGPRecord, BGPElem\n'), ((1232, 1243), '_pybgpstream.BGPRecord', 'BGPRecord', ([], {}), '()\... |
import datetime
class Table(object):
def __init__(self):
self.idn = ''
self.q = []
self.min_wait = datetime.timedelta(minutes = 0) | [
"datetime.timedelta"
] | [((107, 136), 'datetime.timedelta', 'datetime.timedelta', ([], {'minutes': '(0)'}), '(minutes=0)\n', (125, 136), False, 'import datetime\n')] |
"""
Author: <NAME>
Affiliation: NAIST & OSX
"""
from __future__ import annotations
import inspect
import random
from abc import ABC, abstractmethod, abstractstaticmethod
from itertools import count
from typing import Dict, Iterator, List, Optional, Type
import gym
import jax
import numpy as np
import structlog
from c... | [
"structlog.get_logger",
"jax.random.PRNGKey",
"inspect.getmembers",
"random.seed",
"itertools.count",
"numpy.random.seed"
] | [((915, 923), 'itertools.count', 'count', (['(0)'], {}), '(0)\n', (920, 923), False, 'from itertools import count\n'), ((1931, 1985), 'inspect.getmembers', 'inspect.getmembers', (['solver'], {'predicate': 'inspect.ismethod'}), '(solver, predicate=inspect.ismethod)\n', (1949, 1985), False, 'import inspect\n'), ((2280, 2... |
#!/usr/bin/env python3
from subprocess import run
from os import path
import sys
curr_script_dir = path.abspath(path.dirname(__file__))
run(
[
sys.executable,
path.join(curr_script_dir, "setup.py"),
"bdist_wheel",
"--universal",
],
check=True,
)
run(
[sys.executable, p... | [
"os.path.dirname",
"os.path.join"
] | [((114, 136), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file__)\n', (126, 136), False, 'from os import path\n'), ((182, 220), 'os.path.join', 'path.join', (['curr_script_dir', '"""setup.py"""'], {}), "(curr_script_dir, 'setup.py')\n", (191, 220), False, 'from os import path\n'), ((319, 357), 'os.path.j... |
import json
from django.test import TestCase
from restlib2.http import codes
from avocado.conf import OPTIONAL_DEPS
from serrano.resources import API_VERSION
class ExporterResourceTestCase(TestCase):
def test_delete(self):
self.client.get('/api/data/export/csv/')
response = self.client.delete('/ap... | [
"json.loads"
] | [((768, 796), 'json.loads', 'json.loads', (['response.content'], {}), '(response.content)\n', (778, 796), False, 'import json\n'), ((436, 464), 'json.loads', 'json.loads', (['response.content'], {}), '(response.content)\n', (446, 464), False, 'import json\n')] |
# -*- encoding: utf-8 -*-
import io
import re
import os
from os.path import dirname
from os.path import join
import inspect
from setuptools import setup
def read(*names, **kwargs):
return io.open(
join(dirname(__file__), *names),
encoding=kwargs.get("encoding", "utf8")
).read()
instreq = [l.... | [
"os.path.dirname"
] | [((217, 234), 'os.path.dirname', 'dirname', (['__file__'], {}), '(__file__)\n', (224, 234), False, 'from os.path import dirname\n')] |