code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import pytest
from unittest.mock import Mock
from prompt_toolkit.layout import to_container
from prompt_toolkit.key_binding.key_processor import KeyProcessor, KeyPress
from .. import VerticalMenu, MenuEntry
def get_menu_text(menu):
""" Get the formatted text corresponding to the menu """
control = to_contai... | [
"unittest.mock.Mock",
"prompt_toolkit.layout.to_container",
"prompt_toolkit.key_binding.key_processor.KeyPress",
"pytest.raises",
"prompt_toolkit.key_binding.key_processor.KeyProcessor"
] | [((539, 565), 'prompt_toolkit.key_binding.key_processor.KeyProcessor', 'KeyProcessor', (['key_bindings'], {}), '(key_bindings)\n', (551, 565), False, 'from prompt_toolkit.key_binding.key_processor import KeyProcessor, KeyPress\n'), ((2413, 2419), 'unittest.mock.Mock', 'Mock', ([], {}), '()\n', (2417, 2419), False, 'fro... |
#
# Copyright 2019 Xilinx Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | [
"pytorch_nndct.quantization.module_transform.ModuleTransformer",
"torch.device",
"pytorch_nndct.qproc.base.dump_xmodel",
"pytorch_nndct.utils.module_util.module_name_from_node",
"nndct_shared.utils.option_util.set_option_value",
"pytorch_nndct.parse.utils.get_short_name",
"pytorch_nndct.quantization.mod... | [((3028, 3064), 'pytorch_nndct.utils.module_util.module_name_from_node', 'mod_util.module_name_from_node', (['node'], {}), '(node)\n', (3058, 3064), True, 'from pytorch_nndct.utils import module_util as mod_util\n'), ((6727, 6770), 'pytorch_nndct.qproc.base.dump_xmodel', 'qproc.dump_xmodel', (['output_dir', 'deploy_che... |
"""Created JWKS from list of Certificates"""
import argparse
import json
import sys
import time
from cryptography import x509
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.asymmetric import ec, rsa
from cryptojwt.jwk.ec i... | [
"cryptojwt.jwk.rsa.RSAKey",
"argparse.ArgumentParser",
"cryptojwt.jws.jws.JWS",
"cryptojwt.utils.b64e",
"cryptojwt.jwk.ec.ECKey",
"json.dumps",
"cryptojwt.jwk.x509.import_public_key_from_pem_data",
"cryptojwt.jwx.key_from_jwk_dict",
"cryptography.hazmat.primitives.hashes.SHA256",
"json.load",
"t... | [((705, 746), 'cryptojwt.jwk.x509.import_public_key_from_pem_data', 'import_public_key_from_pem_data', (['pem_data'], {}), '(pem_data)\n', (736, 746), False, 'from cryptojwt.jwk.x509 import import_public_key_from_pem_data\n'), ((1887, 1955), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '""... |
import sys
import os
from PyQt5.QtWidgets import QApplication, QWidget
from PyQt5.QtGui import QIcon
from PyQt5 import uic
from PyQt5.QtCore import *
from PyQt5.QtWebKit import *
from PyQt5.QtWebKitWidgets import *
# I created main.ui in QTDesigner found in ProgramData/Anaconda3/Library/bin on Windows
uifile = os.path... | [
"PyQt5.uic.loadUiType",
"PyQt5.QtWidgets.QApplication",
"os.getcwd"
] | [((384, 406), 'PyQt5.uic.loadUiType', 'uic.loadUiType', (['uifile'], {}), '(uifile)\n', (398, 406), False, 'from PyQt5 import uic\n'), ((326, 337), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (335, 337), False, 'import os\n'), ((1537, 1559), 'PyQt5.QtWidgets.QApplication', 'QApplication', (['sys.argv'], {}), '(sys.argv... |
from ple import PLE
from ple.games.pong import Pong
import pygame
import time
import sys
game = Pong(width=300, height=200)
p = PLE(game, fps=30, display_screen=True, force_fps=True)
p.init()
print(p.getActionSet())
nb_frames = 1000
action = None
for f in range(nb_frames):
if p.game_over():
p.reset_gam... | [
"pygame.event.get",
"ple.PLE",
"time.sleep",
"sys.exit",
"ple.games.pong.Pong"
] | [((97, 124), 'ple.games.pong.Pong', 'Pong', ([], {'width': '(300)', 'height': '(200)'}), '(width=300, height=200)\n', (101, 124), False, 'from ple.games.pong import Pong\n'), ((130, 184), 'ple.PLE', 'PLE', (['game'], {'fps': '(30)', 'display_screen': '(True)', 'force_fps': '(True)'}), '(game, fps=30, display_screen=Tru... |
#!/usr/bin/env python3
# Dask based cleaning script (can be easily modified to pandas/modin/...)
import time
import sys
import json
import os
import glob
import argparse
import psutil
import platform
tstart = time.time()
import pandas as pd
import math
pandas_startup_time = time.time() - tstart
tstart = time.time()
... | [
"platform.python_implementation",
"argparse.ArgumentParser",
"os.makedirs",
"pandas.read_csv",
"psutil.Process",
"dask.dataframe.read_csv",
"modin.pandas.DataFrame",
"os.path.join",
"dask.distributed.Client",
"os.path.isfile",
"sys.exit",
"pandas.DataFrame",
"ray.init",
"time.time"
] | [((211, 222), 'time.time', 'time.time', ([], {}), '()\n', (220, 222), False, 'import time\n'), ((308, 319), 'time.time', 'time.time', ([], {}), '()\n', (317, 319), False, 'import time\n'), ((277, 288), 'time.time', 'time.time', ([], {}), '()\n', (286, 288), False, 'import time\n'), ((594, 605), 'time.time', 'time.time'... |
# Copyright 2017-present Open Networking Foundation
#
# 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... | [
"xosconfig.Config",
"synchronizers.new_base.modelaccessor.FabricCrossconnectServiceInstance.objects.filter"
] | [((820, 828), 'xosconfig.Config', 'Config', ([], {}), '()\n', (826, 828), False, 'from xosconfig import Config\n'), ((1503, 1575), 'synchronizers.new_base.modelaccessor.FabricCrossconnectServiceInstance.objects.filter', 'FabricCrossconnectServiceInstance.objects.filter', ([], {'id': 'service_instance.id'}), '(id=servic... |
import numpy as np
import tensorflow as tf
from basic_nn import Linear
def mse(y_pred, y_true):
return tf.reduce_mean((y_pred - y_true)**2)
if __name__ == "__main__":
f = np.asarray([[1, 1],[2, 1], [3, 1], [4, 1], [5, 1]], dtype=float)
t = np.asarray([[1, 2], [2, 4], [3, 6], [4, 8], [5, 10]], dtype=float)... | [
"basic_nn.Linear",
"tensorflow.placeholder",
"tensorflow.Session",
"numpy.asarray",
"tensorflow.global_variables_initializer",
"tensorflow.train.GradientDescentOptimizer",
"tensorflow.reduce_mean"
] | [((108, 146), 'tensorflow.reduce_mean', 'tf.reduce_mean', (['((y_pred - y_true) ** 2)'], {}), '((y_pred - y_true) ** 2)\n', (122, 146), True, 'import tensorflow as tf\n'), ((181, 246), 'numpy.asarray', 'np.asarray', (['[[1, 1], [2, 1], [3, 1], [4, 1], [5, 1]]'], {'dtype': 'float'}), '([[1, 1], [2, 1], [3, 1], [4, 1], [... |
import logging_local
logging_local.setup_logging()
# with open('config.yaml', 'r') as f:
# config = yaml.safe_load(f.read())
# logging.config.dictConfig(config)
# Get the logger specified in the file
logger = logging_local.logging.getLogger(__name__)
logger.debug('debug main module')
logger.error('Loaded err... | [
"logging_local.logging.getLogger",
"logging_local.setup_logging"
] | [((22, 51), 'logging_local.setup_logging', 'logging_local.setup_logging', ([], {}), '()\n', (49, 51), False, 'import logging_local\n'), ((220, 261), 'logging_local.logging.getLogger', 'logging_local.logging.getLogger', (['__name__'], {}), '(__name__)\n', (251, 261), False, 'import logging_local\n')] |
# Generated by Django 3.0.3 on 2020-04-21 20:42
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0008_auto_20200421_2058'),
]
operations = [
migrations.RemoveField(
model_name='user_movie',
... | [
"datetime.timedelta",
"django.db.migrations.RemoveField"
] | [((248, 315), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""user_movie"""', 'name': '"""insert_date"""'}), "(model_name='user_movie', name='insert_date')\n", (270, 315), False, 'from django.db import migrations, models\n'), ((494, 515), 'datetime.timedelta', 'datetime.timedelta',... |
# controller for mspdebug subprocess (that can talk to an actual msp430 chip)
import sys
import re
import subprocess
import time
import signal
import utils
######################################################################
# non-blocking read support for subproces.PIPE
# see: http://stackoverflow.com/questions/3... | [
"signal.sigwait",
"re.escape",
"re.compile",
"subprocess.Popen",
"time.sleep",
"utils.summarize_triple",
"threading.Thread",
"queue.Queue",
"re.search"
] | [((895, 920), 'time.sleep', 'time.sleep', (['enq_sleeptime'], {}), '(enq_sleeptime)\n', (905, 920), False, 'import time\n'), ((11582, 11602), 'time.sleep', 'time.sleep', (['interval'], {}), '(interval)\n', (11592, 11602), False, 'import time\n'), ((2733, 2756), 're.escape', 're.escape', (['"""(mspdebug)"""'], {}), "('(... |
#!/usr/bin/env python
"""
Finetuning script that can be used to train a custom classifier on top of our pretrained models.
Usage:
train_classifier.py --path_in=PATH
[--model_name=NAME]
[--model_version=VERSION]
[--num_layers_to_finetune=NUM]
... | [
"tools.directories.get_videos_dir",
"sense.downstream_tasks.nn_utils.LogisticRegression",
"sys.exit",
"sense.loading.get_relevant_weights",
"tools.sense_studio.project_utils.load_project_config",
"docopt.docopt",
"sense.loading.ModelConfig",
"sense.finetuning.extract_features",
"tools.directories.ge... | [((2336, 2389), 'sense.loading.ModelConfig', 'ModelConfig', (['"""StridedInflatedEfficientNet"""', '"""pro"""', '[]'], {}), "('StridedInflatedEfficientNet', 'pro', [])\n", (2347, 2389), False, 'from sense.loading import ModelConfig\n'), ((2395, 2447), 'sense.loading.ModelConfig', 'ModelConfig', (['"""StridedInflatedMob... |
"""
This file was generated by the tool TatSuSAG (the TatSu syntax analyser generator)
Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
"""
from poc.classes.AuxISourceAnalyser import AuxISourceAnalyser
from poc.classes.AuxInterpretation import AuxInterpretation
from poc.cl... | [
"poc.classes.AuxSTConstructor.AuxSTConstructor"
] | [((603, 622), 'poc.classes.AuxSTConstructor.AuxSTConstructor', 'AuxSTConstructor', (['i'], {}), '(i)\n', (619, 622), False, 'from poc.classes.AuxSTConstructor import AuxSTConstructor\n')] |
import numpy as np
import numba as nb
import scrtbp.exceptions as exceptions
from scrtbp.taylor import expansion
from scrtbp.taylor import steppers
from scrtbp.util import root
def generate_event_observer(StepperClass, FuncAdapter, one_way_mode=True):
if one_way_mode:
# only - to + roots are detected
... | [
"scrtbp.util.root.Brackets",
"scrtbp.taylor.expansion.generate_taylor_expansion",
"scrtbp.taylor.steppers.generate_step_limter_proxy",
"scrtbp.taylor.steppers.generate_fixed_stepper",
"numba.njit",
"scrtbp.util.root.solve",
"numba.jitclass",
"numpy.empty",
"scrtbp.taylor.steppers.generate_adaptive_s... | [((553, 579), 'numba.njit', 'nb.njit', (['py_root_condition'], {}), '(py_root_condition)\n', (560, 579), True, 'import numba as nb\n'), ((829, 861), 'numba.jitclass', 'nb.jitclass', (['event_observer_spec'], {}), '(event_observer_spec)\n', (840, 861), True, 'import numba as nb\n'), ((2702, 2778), 'scrtbp.taylor.expansi... |
###############################################################################
# PyDial: Multi-domain Statistical Spoken Dialogue System Software
###############################################################################
#
# Copyright 2015 - 2017
# Cambridge University Engineering Department Dialogue Systems Grou... | [
"numpy.multiply",
"Queue.PriorityQueue",
"numpy.log10",
"theano.tensor.sum",
"numpy.random.multinomial",
"numpy.argsort",
"theano.tensor.arange",
"numpy.zeros",
"numpy.dot",
"numpy.random.uniform",
"theano.tensor.set_subtensor",
"theano.tensor.tanh",
"numpy.concatenate",
"operator.itemgett... | [((3864, 3909), 'theano.tensor.set_subtensor', 'T.set_subtensor', (['hot_x[idx_x[:cutoff_x]]', '(1.0)'], {}), '(hot_x[idx_x[:cutoff_x]], 1.0)\n', (3879, 3909), True, 'import theano.tensor as T\n'), ((5150, 5183), 'theano.tensor.nnet.sigmoid', 'T.nnet.sigmoid', (['self.Wemb[w_t, :]'], {}), '(self.Wemb[w_t, :])\n', (5164... |
import PixelBotData.supportingFunctions as supportingFunctions
import configparser
from logging import warning
import sys
from random import randint
import sys
import discord
from discord.ext import commands
import platform
import logging
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s [%(levelnam... | [
"configparser.ConfigParser",
"logging.warning",
"PixelBotData.supportingFunctions.getTime",
"platform.system",
"sys.exit",
"discord.Color.blue",
"discord.ext.commands.command",
"PixelBotData.supportingFunctions.getDate",
"random.randint"
] | [((2578, 2643), 'discord.ext.commands.command', 'commands.command', ([], {'aliases': "['q', 'Q', 'Quote', 'quotes', 'Quotes']"}), "(aliases=['q', 'Q', 'Quote', 'quotes', 'Quotes'])\n", (2594, 2643), False, 'from discord.ext import commands\n'), ((699, 721), 'random.randint', 'randint', (['(1)', 'quoteTotal'], {}), '(1,... |
import pyspark
from pyspark import SparkContext
from pyspark.streaming import StreamingContext
sc=SparkContext('local[2]',appName="MyStreamWordCount")
ssc=StreamingContext(sc,2)
lines = ssc.socketTextStream('localhost',9999)
counts = lines.flatMap(lambda line: line.split(" ")).map(lambda word: (word, 1)).reduceByKey(l... | [
"pyspark.streaming.StreamingContext",
"pyspark.SparkContext"
] | [((99, 152), 'pyspark.SparkContext', 'SparkContext', (['"""local[2]"""'], {'appName': '"""MyStreamWordCount"""'}), "('local[2]', appName='MyStreamWordCount')\n", (111, 152), False, 'from pyspark import SparkContext\n'), ((156, 179), 'pyspark.streaming.StreamingContext', 'StreamingContext', (['sc', '(2)'], {}), '(sc, 2)... |
from subprocess import Popen
from subprocess import PIPE, STDOUT
from scripts.os_check import ADB, SUC, SEP
print("Removing lockscreen ...")
Popen([ADB, 'shell', SUC, 'rm', '/data/system/*.key'], stdout=PIPE, stderr=STDOUT).stdout.read().decode('UTF-8')
Popen([ADB, 'shell', SUC, 'rm', '/data/system/locksetting... | [
"subprocess.Popen"
] | [((149, 236), 'subprocess.Popen', 'Popen', (["[ADB, 'shell', SUC, 'rm', '/data/system/*.key']"], {'stdout': 'PIPE', 'stderr': 'STDOUT'}), "([ADB, 'shell', SUC, 'rm', '/data/system/*.key'], stdout=PIPE, stderr=\n STDOUT)\n", (154, 236), False, 'from subprocess import Popen\n'), ((263, 358), 'subprocess.Popen', 'Popen... |
import os
from flask import Flask
app = Flask(__name__)
@app.route("/")
def index():
return "FACULDADE IMPACTA - ENGENHARIA DA COMPUTAÇÃO"
if __name__ == "__main__":
port = int(os.environ.get("PORT", 5000))
app.run(host='0.0.0.0', port=port)
| [
"os.environ.get",
"flask.Flask"
] | [((44, 59), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (49, 59), False, 'from flask import Flask\n'), ((198, 226), 'os.environ.get', 'os.environ.get', (['"""PORT"""', '(5000)'], {}), "('PORT', 5000)\n", (212, 226), False, 'import os\n')] |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, print_function, unicode_literals, \
absolute_import
import os
import unittest
import numpy as np
from pymatgen.io.lammps.output import LammpsRun, LammpsLog, LammpsDump
_... | [
"pymatgen.io.lammps.output.LammpsLog",
"numpy.testing.assert_array_almost_equal",
"pymatgen.io.lammps.output.LammpsRun.from_dict",
"numpy.arange",
"os.path.join",
"os.path.dirname",
"pymatgen.io.lammps.output.LammpsRun",
"numpy.testing.assert_almost_equal",
"pymatgen.io.lammps.output.LammpsLog.from_... | [((388, 413), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (403, 413), False, 'import os\n'), ((4580, 4595), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4593, 4595), False, 'import unittest\n'), ((906, 978), 'numpy.testing.assert_array_equal', 'np.testing.assert_array_equal', (['at... |
# -*- coding:utf-8 -*-
# author:平手友梨奈ii
# e-mail:<EMAIL>
# datetime:1993/12/01
# filename:configs.py
# software: PyCharm
import numpy as np
import tensorflow as tf
import keras.backend as K
from keras.layers import Input, Lambda
from keras.models import Model
from keras.optimizers import Adam
from keras.callbacks impo... | [
"utils.utils.get_random_mosaic_data",
"time.sleep",
"numpy.array",
"utils.utils.get_random_data",
"tensorflow.Session",
"keras.backend.clear_session",
"keras.models.Model",
"keras.callbacks.EarlyStopping",
"numpy.random.seed",
"tensorflow.ConfigProto",
"numpy.maximum",
"keras.optimizers.Adam",... | [((12705, 12721), 'tensorflow.ConfigProto', 'tf.ConfigProto', ([], {}), '()\n', (12719, 12721), True, 'import tensorflow as tf\n'), ((5218, 5255), 'numpy.array', 'np.array', (['true_boxes'], {'dtype': '"""float32"""'}), "(true_boxes, dtype='float32')\n", (5226, 5255), True, 'import numpy as np\n'), ((5274, 5310), 'nump... |
"""Contains cliquery functions to describe and open webpages"""
from __future__ import absolute_import, print_function
import sys
from six import PY2
from six.moves import input
from .config import CONFIG
from .pyteaser import summarize
from . import utils, CONTINUE
def get_google_query_url(query):
"""Get Goog... | [
"sys.stderr.write",
"six.moves.input"
] | [((1839, 1884), 'sys.stderr.write', 'sys.stderr.write', (['"""Failed to open browser.\n"""'], {}), "('Failed to open browser.\\n')\n", (1855, 1884), False, 'import sys\n'), ((1486, 1501), 'six.moves.input', 'input', (['CONTINUE'], {}), '(CONTINUE)\n', (1491, 1501), False, 'from six.moves import input\n')] |
# Copyright (c) 2021 <NAME>
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
import numpy as np
import torch
import cv2
class InputPipeLine:
"""
InputPipeLine : this class starts capturing video from camera and resizes the frames
to... | [
"torch.as_tensor",
"cv2.resize",
"numpy.transpose",
"cv2.VideoCapture"
] | [((746, 765), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (762, 765), False, 'import cv2\n'), ((1933, 1991), 'cv2.resize', 'cv2.resize', (['frame', '(self.target_width, self.target_height)'], {}), '(frame, (self.target_width, self.target_height))\n', (1943, 1991), False, 'import cv2\n'), ((2017, 204... |
# Generated by Django 4.0.3 on 2022-03-24 15:56
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('inventory', '0012_remove_group_hosts_host_groups'),
]
operations = [
migrations.AlterField(
mod... | [
"django.db.models.ForeignKey"
] | [((380, 502), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'blank': '(True)', 'default': 'dict', 'on_delete': 'django.db.models.deletion.SET_DEFAULT', 'to': '"""inventory.variable"""'}), "(blank=True, default=dict, on_delete=django.db.models.\n deletion.SET_DEFAULT, to='inventory.variable')\n", (397, 50... |
from django.contrib import messages
from django.db import IntegrityError
from django.shortcuts import redirect
from .models import Subscriber
from .tasks import async_send_newsletter
def subscribe(request):
if request.method == 'POST':
email = request.POST.get('email')
subscriber = Sub... | [
"django.contrib.messages.error",
"django.shortcuts.redirect",
"django.contrib.messages.success"
] | [((1002, 1018), 'django.shortcuts.redirect', 'redirect', (['"""home"""'], {}), "('home')\n", (1010, 1018), False, 'from django.shortcuts import redirect\n'), ((1212, 1300), 'django.contrib.messages.success', 'messages.success', (['request', '"""You have successfully unsubscribed from our newsletter!"""'], {}), "(reques... |
# -*- coding: utf-8 ; test-case-name: bridgedb.test.test_HTTPServer -*-
#
# This file is part of BridgeDB, a Tor bridge distribution system.
#
# :authors: please see included AUTHORS file
# :copyright: (c) 2007-2014, The Tor Project, Inc.
# (c) 2013-2014, <NAME>
# :license: see LICENSE for licensing informa... | [
"bridgedb.crypto.getKey",
"bridgedb.captcha.GimpCaptcha",
"logging.debug",
"base64.b64encode",
"logging.exception",
"bridgedb.Filters.filterBridgesByTransport",
"bridgedb.captcha.ReCaptcha",
"twisted.web.server.Site",
"bridgedb.Filters.filterBridgesByNotBlockedIn",
"bridgedb.translations.getLocale... | [((2119, 2236), 'mako.lookup.TemplateLookup', 'TemplateLookup', ([], {'directories': '[TEMPLATE_DIR]', 'output_encoding': '"""utf-8"""', 'filesystem_checks': '(False)', 'collection_size': '(500)'}), "(directories=[TEMPLATE_DIR], output_encoding='utf-8',\n filesystem_checks=False, collection_size=500)\n", (2133, 2236... |
## https://github.com/dsmorgan/yacgb
import ccxt
import time
import datetime
from datetime import timezone
import logging
import os
import sys
import json
import re
#from model.orders import Orders, orders_init
#from yacgb.lookup import OrderBookLookup
#from yacgb.bdt import BacktestDateTime
from yacgb.awshelper impo... | [
"logging.getLogger",
"yacgb.awshelper.yacgb_aws_ps",
"logging.basicConfig",
"yacgb.orderslookup.OrdersGet",
"re.compile",
"json.dumps",
"os.environ.get",
"model.gbot.Gbot.scan",
"json.load",
"datetime.datetime.now",
"yacgb.lookup.ohlcvLookup",
"yacgb.gbotrunner.GbotRunner",
"yacgb.bdt.Backte... | [((669, 688), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (686, 688), False, 'import logging\n'), ((867, 902), 'yacgb.awshelper.yacgb_aws_ps', 'yacgb_aws_ps', ([], {'with_decryption': '(False)'}), '(with_decryption=False)\n', (879, 902), False, 'from yacgb.awshelper import yacgb_aws_ps\n'), ((937, 950),... |
from fints2ledger.transaction_retriever import TRetriever
from fints.client import FinTS3PinTanClient
from fints2ledger.csv_converter import CsvConverter
from mt940.models import Date
class Fints2Csv:
def __init__(self, config):
self.config = config
def retrieveAndSave(self):
client = FinTS3P... | [
"fints2ledger.csv_converter.CsvConverter",
"fints2ledger.transaction_retriever.TRetriever",
"fints.client.FinTS3PinTanClient",
"mt940.models.Date.today"
] | [((313, 471), 'fints.client.FinTS3PinTanClient', 'FinTS3PinTanClient', (["self.config['fints']['blz']", "self.config['fints']['account']", "self.config['fints']['password']", "self.config['fints']['endpoint']"], {}), "(self.config['fints']['blz'], self.config['fints'][\n 'account'], self.config['fints']['password'],... |
from model.contact import Contact
from random import randrange
def test_delete_some_contact(app):
if app.contact.count() == 0:
app.contact.create(Contact(firstname="firstname", lastname="lastname", address="address", email1="email1",
email2="email2", email3="email3", hom... | [
"model.contact.Contact"
] | [((160, 358), 'model.contact.Contact', 'Contact', ([], {'firstname': '"""firstname"""', 'lastname': '"""lastname"""', 'address': '"""address"""', 'email1': '"""email1"""', 'email2': '"""email2"""', 'email3': '"""email3"""', 'homephone': '"""+555"""', 'mobile': '"""(1)111"""', 'workphone': '"""2-22"""', 'phone2': '"""44... |
# -*- coding: utf-8 -*- #
"""*********************************************************************************************"""
# FileName [ upstream/cpc/expert.py ]
# Synopsis [ the cpc wrapper ]
# Author [ S3PRL ]
# Copyright [ Copyleft(c), Speech Lab, NTU, Taiwan ]
"""*************************... | [
"torch.load",
"argparse.Namespace",
"torch.nn.utils.rnn.pad_sequence"
] | [((917, 953), 'torch.load', 'torch.load', (['ckpt'], {'map_location': '"""cpu"""'}), "(ckpt, map_location='cpu')\n", (927, 953), False, 'import torch\n'), ((1502, 1538), 'torch.nn.utils.rnn.pad_sequence', 'pad_sequence', (['wavs'], {'batch_first': '(True)'}), '(wavs, batch_first=True)\n', (1514, 1538), False, 'from tor... |
import numpy as np
try:
import cupy as cp
except:
cp = np
#CupyScalars = NumpyScalars
import pytissueoptics.vectors as vc
class NativeScalars:
""" An array of scalars that is compatible with operations on Vectors
There is a reason for not using numpy.array directly: we want to
add new functi... | [
"numpy.random.rand",
"numpy.equal",
"cupy.subtract",
"numpy.array",
"cupy.equal",
"cupy.negative",
"cupy.full",
"cupy.true_divide",
"numpy.multiply",
"cupy.random.rand",
"numpy.random.random",
"numpy.asarray",
"numpy.subtract",
"cupy.multiply",
"cupy.asarray",
"numpy.add",
"cupy.add"... | [((658, 673), 'numpy.array', 'np.array', (['array'], {}), '(array)\n', (666, 673), True, 'import numpy as np\n'), ((4508, 4527), 'numpy.negative', 'np.negative', (['self.v'], {}), '(self.v)\n', (4519, 4527), True, 'import numpy as np\n'), ((4764, 4789), 'numpy.equal', 'np.equal', (['self.v', 'other.v'], {}), '(self.v, ... |
from flask import Flask,render_template, request, redirect, url_for, abort, flash, session
import sqlalchemy
from werkzeug.security import generate_password_hash
from flask_login import login_manager, login_user, login_required,logout_user,current_user,LoginManager
from flask_user import roles_required
from datetime im... | [
"flask.render_template",
"flask_login.LoginManager",
"flask_login.login_manager.init_app",
"flask.Flask",
"db.db.init_app",
"models.roles.Role",
"models.category_model.Category.query.filter_by",
"sqlalchemy.desc",
"models.user_model.UserModel",
"models.category_model.Category.query.all",
"flask.... | [((1336, 1351), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (1341, 1351), False, 'from flask import Flask, render_template, request, redirect, url_for, abort, flash, session\n'), ((1599, 1656), 'sqlalchemy.create_engine', 'create_engine', (['"""mysql+pymysql://root:@localhost/flaskapp"""'], {}), "('mysq... |
import numpy as np
from matplotlib.colors import ListedColormap
import matplotlib.pyplot as plt
def plot_surface(X, y, clf, title="", xlabel="", ylabel=""):
x_min, x_max = X.min(), X.max()
xx, yy = np.meshgrid(np.linspace(x_min[0], x_max[0], num=50),
np.linspace(x_min[1], x_max[1], num=50))
if hasattr(clf,... | [
"matplotlib.colors.ListedColormap",
"matplotlib.pyplot.figure",
"numpy.linspace",
"matplotlib.pyplot.show"
] | [((514, 526), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (524, 526), True, 'import matplotlib.pyplot as plt\n'), ((875, 885), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (883, 885), True, 'import matplotlib.pyplot as plt\n'), ((214, 253), 'numpy.linspace', 'np.linspace', (['x_min[0]', 'x_ma... |
"""
生成电池系统模拟数据帧
Author: 孙昊阳
Created on: 2022/03/14
API:
- generate_module_id(_id=None)
- generate_common_frame_id(num)
- generate_feedback_frame_id(num)
- generate_data(Type)
- generate_verification(module_id, frame_id, data)
- generate_frame(module_id, frame_id, data, veri)
"""
import random
from mqtt.d... | [
"mqtt.decode.K9120CanDecode",
"random.randint"
] | [((5576, 5597), 'mqtt.decode.K9120CanDecode', 'K9120CanDecode', (['frame'], {}), '(frame)\n', (5590, 5597), False, 'from mqtt.decode import K9120CanDecode\n'), ((6246, 6267), 'mqtt.decode.K9120CanDecode', 'K9120CanDecode', (['frame'], {}), '(frame)\n', (6260, 6267), False, 'from mqtt.decode import K9120CanDecode\n'), (... |
import logging
from typing import Callable, Dict, List
import asyncio
from slack.web.client import WebClient
from slack.rtm.client import RTMClient
from machine.models import User
from machine.models import Channel
from machine.settings import import_settings
from machine.utils import Singleton
logger = logging.getL... | [
"logging.getLogger",
"slack.web.client.WebClient",
"asyncio.new_event_loop",
"machine.models.User.from_api_response",
"slack.rtm.client.RTMClient.on",
"slack.rtm.client.RTMClient",
"machine.settings.import_settings",
"machine.models.Channel.from_api_response"
] | [((308, 335), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (325, 335), False, 'import logging\n'), ((913, 930), 'machine.settings.import_settings', 'import_settings', ([], {}), '()\n', (928, 930), False, 'from machine.settings import import_settings\n'), ((1077, 1127), 'slack.rtm.client... |
#!/usr/bin/env python3
'''commands
Slackのスラッシュコマンドを受け取って、フィルタリング情報を追加する。
'''
__author__ = '<NAME>'
__version__ = '0.1'
__date__ = '2018/08/26'
from flask import Flask, render_template, request, redirect, url_for, Response
import json
from model import Condition, session
import settings
app = Flask(__name__)
... | [
"model.Condition",
"model.session.add",
"flask.Flask",
"model.session.commit",
"model.session.query"
] | [((304, 319), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (309, 319), False, 'from flask import Flask, render_template, request, redirect, url_for, Response\n'), ((1317, 1328), 'model.Condition', 'Condition', ([], {}), '()\n', (1326, 1328), False, 'from model import Condition, session\n'), ((1822, 1844)... |
import time
import numpy as np
import tensorflow as tf
import awesome_gans.image_utils as iu
import awesome_gans.segan.segan_model as segan
from awesome_gans.datasets import MNISTDataSet
results = {'output': './gen_img/', 'checkpoint': './model/checkpoint', 'model': './model/SEGAN-model.ckpt'}
train_step = {
'g... | [
"awesome_gans.segan.segan_model.SEGAN",
"numpy.reshape",
"tensorflow.Session",
"tensorflow.global_variables_initializer",
"numpy.zeros",
"awesome_gans.datasets.MNISTDataSet",
"numpy.random.uniform",
"tensorflow.ConfigProto",
"awesome_gans.image_utils.save_images",
"time.time"
] | [((404, 415), 'time.time', 'time.time', ([], {}), '()\n', (413, 415), False, 'import time\n'), ((533, 549), 'tensorflow.ConfigProto', 'tf.ConfigProto', ([], {}), '()\n', (547, 549), True, 'import tensorflow as tf\n'), ((479, 493), 'awesome_gans.datasets.MNISTDataSet', 'MNISTDataSet', ([], {}), '()\n', (491, 493), False... |
# Copyright © 2019 Province of British Columbia
#
# 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... | [
"faker.Factory.create",
"datetime.timedelta",
"datetime.datetime.utcnow"
] | [((1047, 1068), 'faker.Factory.create', 'FakerFactory.create', ([], {}), '()\n', (1066, 1068), True, 'from faker import Factory as FakerFactory\n'), ((2025, 2042), 'datetime.datetime.utcnow', 'datetime.utcnow', ([], {}), '()\n', (2040, 2042), False, 'from datetime import datetime, timedelta\n'), ((2045, 2063), 'datetim... |
from .GCLocation import GCLocation
from .GCDayData import GCDayData
from .GCGregorianDate import GCGregorianDate, Today
from .GCStringBuilder import GCStringBuilder,SBTF_TEXT,SBTF_RTF
from math import floor
from . import GCUT as GCUT
import datetime
from . import GCMath as GCMath
from . import GCEarthData as GCEarthDat... | [
"datetime.datetime.now",
"math.floor"
] | [((15758, 15781), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (15779, 15781), False, 'import datetime\n'), ((15844, 15867), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (15865, 15867), False, 'import datetime\n'), ((1871, 1880), 'math.floor', 'floor', (['dd'], {}), '(dd)\n... |
#!/usr/bin/env python
#coding: utf-8
# Test all test case
import watchtipstest
import importlib
import unittest
g_module_names = ['appcontrollers', 'auth', 'wtpep8']
def get_suite_from_module_names(module_names):
suite = unittest.TestSuite()
for module_name in module_names:
module = importlib.impor... | [
"unittest.TestSuite",
"watchtipstest.main",
"importlib.import_module",
"unittest.TestLoader"
] | [((230, 250), 'unittest.TestSuite', 'unittest.TestSuite', ([], {}), '()\n', (248, 250), False, 'import unittest\n'), ((556, 581), 'watchtipstest.main', 'watchtipstest.main', (['suite'], {}), '(suite)\n', (574, 581), False, 'import watchtipstest\n'), ((305, 341), 'importlib.import_module', 'importlib.import_module', (['... |
import pygame
from pygame.locals import *
FULLSCREEN = 0
BLACK = (0, 0, 0)
RED = (255, 0, 0)
MAX_WIDTH = 800
MAX_HEIGHT = 600
RESOLUTION = (MAX_WIDTH, MAX_HEIGHT)
def redraw_screen(screen, width, height, x, y):
screen.fill(BLACK)
pygame.draw.rect(screen, RED, (x, y, width, height))
pygame.display.update(... | [
"pygame.init",
"pygame.quit",
"pygame.event.get",
"pygame.display.set_mode",
"pygame.time.Clock",
"pygame.key.get_pressed",
"pygame.draw.rect",
"pygame.display.set_caption",
"pygame.display.mode_ok",
"pygame.display.update"
] | [((241, 293), 'pygame.draw.rect', 'pygame.draw.rect', (['screen', 'RED', '(x, y, width, height)'], {}), '(screen, RED, (x, y, width, height))\n', (257, 293), False, 'import pygame\n'), ((298, 321), 'pygame.display.update', 'pygame.display.update', ([], {}), '()\n', (319, 321), False, 'import pygame\n'), ((455, 468), 'p... |
from __future__ import print_function
import bz2
import datetime
import gc
import io
import os
import sys
import tempfile
from django.conf import settings
from django.core import management
from django.utils.text import slugify
def incremental_backup(parameters):
to_transmit = []
# Dump full content of thes... | [
"sys.stdout.flush",
"django.utils.text.slugify",
"django.core.management.call_command",
"os.path.join",
"io.open",
"datetime.timedelta",
"tempfile.gettempdir",
"gc.collect",
"io.StringIO"
] | [((855, 876), 'tempfile.gettempdir', 'tempfile.gettempdir', ([], {}), '()\n', (874, 876), False, 'import tempfile\n'), ((1100, 1118), 'sys.stdout.flush', 'sys.stdout.flush', ([], {}), '()\n', (1116, 1118), False, 'import sys\n'), ((1134, 1147), 'io.StringIO', 'io.StringIO', ([], {}), '()\n', (1145, 1147), False, 'impor... |
import psycopg2
import Comandos
from os import system
class Usuario:
def __init__(self, username, password):
self.username = username
self.__password = password
def __check_usuario(self, username, password):
if (self.username == username):
if (self.__password =... | [
"Comandos.añadir",
"Comandos.hashF",
"Comandos.Buscar",
"Comandos.Crear_tabla",
"os.system"
] | [((2457, 2487), 'Comandos.Crear_tabla', 'Comandos.Crear_tabla', (['"""Huella"""'], {}), "('Huella')\n", (2477, 2487), False, 'import Comandos\n'), ((2493, 2506), 'os.system', 'system', (['"""cls"""'], {}), "('cls')\n", (2499, 2506), False, 'from os import system\n'), ((1706, 1722), 'Comandos.hashF', 'Comandos.hashF', (... |
#!../manage/exec-in-virtualenv.sh
# -*- coding: UTF-8 -*-
# File: queryhandler.py
# Date: Thu Jun 18 22:52:39 2015 +0800
# Author: <NAME> <<EMAIL>>
from bson.binary import Binary
from threading import Thread
from multiprocessing import Pool
from ukdbconn import get_mongo, global_counter, new_paper
from uklogger impor... | [
"ukdbconn.get_mongo",
"ukdbconn.new_paper",
"bson.binary.Binary",
"lib.textutil.title_beautify",
"fetcher.register_parser.get_parser_list",
"pdfprocess.postprocess",
"searcher.register_searcher.get_searcher_list",
"job.JobContext",
"contentsearch.SoPaperSearcher",
"multiprocessing.Pool",
"sys.ex... | [((5179, 5196), 'contentsearch.SoPaperSearcher', 'SoPaperSearcher', ([], {}), '()\n', (5194, 5196), False, 'from contentsearch import SoPaperSearcher\n'), ((1805, 1826), 'lib.textutil.title_beautify', 'title_beautify', (['query'], {}), '(query)\n', (1819, 1826), False, 'from lib.textutil import title_beautify, parse_fi... |
import os
from setuptools import setup, find_namespace_packages
def find_resource_files(directory):
paths = []
for (path, directories, filenames) in os.walk(directory):
for filename in filenames:
paths.append(os.path.join('..', path, filename))
return paths
# -- Extension Definition ... | [
"setuptools.find_namespace_packages",
"os.path.join",
"os.walk"
] | [((159, 177), 'os.walk', 'os.walk', (['directory'], {}), '(directory)\n', (166, 177), False, 'import os\n'), ((856, 1039), 'setuptools.find_namespace_packages', 'find_namespace_packages', ([], {'exclude': "['ez_setup', 'examples', 'docker', '.github', 'docs', 'helm', 'tethysext/' +\n ext_package + '/tests', 'tethyse... |
# -*- coding: utf-8 -*-
from __future__ import with_statement
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import os
from stacktraces import __version__
def read(fname):
try:
with open(os.path.join(os.path.dirname(__file__), fname), "r") as fp:
... | [
"os.path.dirname"
] | [((265, 290), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (280, 290), False, 'import os\n')] |
# coding=utf-8
# Copyright 2022 The OpenBMB team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | [
"json.loads",
"json.dumps",
"os.path.join",
"copy.deepcopy"
] | [((1477, 1493), 'json.loads', 'json.loads', (['text'], {}), '(text)\n', (1487, 1493), False, 'import json\n'), ((1886, 1914), 'copy.deepcopy', 'copy.deepcopy', (['self.__dict__'], {}), '(self.__dict__)\n', (1899, 1914), False, 'import copy\n'), ((1067, 1100), 'os.path.join', 'os.path.join', (['path', '"""config.json"""... |
# -*- coding: utf-8 -*-
"""
@Time : 2020/3/22 15:59
@Author : 半纸梁
@File : urls.py
"""
from django.urls import path
from cart import views
app_name = 'cart'
urlpatterns = [
path('index/', views.CartIndexView.as_view(), name="index"),
path('add/', views.AddCartView.as_view(), name="add"),
path('edit/... | [
"cart.views.CartIndexView.as_view",
"cart.views.AddCartView.as_view",
"cart.views.CartEditView.as_view"
] | [((200, 229), 'cart.views.CartIndexView.as_view', 'views.CartIndexView.as_view', ([], {}), '()\n', (227, 229), False, 'from cart import views\n'), ((263, 290), 'cart.views.AddCartView.as_view', 'views.AddCartView.as_view', ([], {}), '()\n', (288, 290), False, 'from cart import views\n'), ((338, 366), 'cart.views.CartEd... |
import os
import time
import unittest
from numpy.testing import assert_almost_equal
from supervised.tuner.time_controller import TimeController
class TimeControllerTest(unittest.TestCase):
def test_to_and_from_json(self):
tc = TimeController(
start_time=time.time(),
total_time_lim... | [
"time.time"
] | [((281, 292), 'time.time', 'time.time', ([], {}), '()\n', (290, 292), False, 'import time\n'), ((1992, 2003), 'time.time', 'time.time', ([], {}), '()\n', (2001, 2003), False, 'import time\n'), ((852, 863), 'time.time', 'time.time', ([], {}), '()\n', (861, 863), False, 'import time\n')] |
import pytest
import c_macro_evaluator.c_macro_evaluator as dut
macro_str = "#define TEST"
not_macro_str = "define TEST2"
multiline_macro = r"""#define MACRO 1+2\
+4+5\
*3
"""
recursive_macro = "#define RECURSIVE MACRO+1"
circular_macro = "#define CIRCULAR CIRCULAR*2"
conditional_macro = r"""
#define ... | [
"c_macro_evaluator.c_macro_evaluator.parse_options",
"c_macro_evaluator.c_macro_evaluator.MacroEvaluator.MACRO_REGEX.match",
"c_macro_evaluator.c_macro_evaluator.MacroEvaluator",
"c_macro_evaluator.c_macro_evaluator.main",
"pytest.raises"
] | [((823, 870), 'c_macro_evaluator.c_macro_evaluator.MacroEvaluator.MACRO_REGEX.match', 'dut.MacroEvaluator.MACRO_REGEX.match', (['macro_str'], {}), '(macro_str)\n', (859, 870), True, 'import c_macro_evaluator.c_macro_evaluator as dut\n'), ((2067, 2129), 'c_macro_evaluator.c_macro_evaluator.MacroEvaluator', 'dut.MacroEva... |
import os
from pathlib import Path
from PIL import Image
from skimage import io
SUFFIX = "_saliency.png"
def save_saliency_output(saliency_image, filename, output_dir):
predict = saliency_image
predict = predict.squeeze()
predict_np = predict.cpu().data.numpy()
im = Image.fromarray(predict_np * 255... | [
"os.path.exists",
"PIL.Image.fromarray",
"os.makedirs",
"pathlib.Path",
"skimage.io.imread"
] | [((349, 368), 'skimage.io.imread', 'io.imread', (['filename'], {}), '(filename)\n', (358, 368), False, 'from skimage import io\n'), ((460, 486), 'os.path.exists', 'os.path.exists', (['output_dir'], {}), '(output_dir)\n', (474, 486), False, 'import os\n'), ((496, 534), 'os.makedirs', 'os.makedirs', (['output_dir'], {'ex... |
# -*- coding: utf-8 -*-
"""
Created on Sat Oct 27 10:24:02 2018
@author: Martin
"""
import pickle
from tkinter import *
from tkinter import filedialog
class monApp:
def __init__(self):
self.fen = Tk()
self.positionListe =0
self.ListeDePersonnes = []
self.pr... | [
"pickle.dump",
"pickle.load",
"tkinter.filedialog.asksaveasfilename",
"tkinter.filedialog.askopenfilename"
] | [((1652, 1772), 'tkinter.filedialog.asksaveasfilename', 'filedialog.asksaveasfilename', ([], {'title': '"""Ouvrir votre document"""', 'filetypes': "[('pkl files', '.pkl'), ('all files', '.*')]"}), "(title='Ouvrir votre document', filetypes=[(\n 'pkl files', '.pkl'), ('all files', '.*')])\n", (1680, 1772), False, 'fr... |
import cadquery as cq
from typing import List, Union, Tuple
from imp import reload
from types import SimpleNamespace
from OCP.TopoDS import TopoDS_Shape
from OCP.AIS import AIS_ColoredShape
from OCP.Quantity import \
Quantity_TOC_RGB as TOC_RGB, Quantity_Color
from PyQt5.QtGui import QColor
def find_cq_obje... | [
"types.SimpleNamespace",
"cadquery.Compound.makeCompound",
"imp.reload",
"PyQt5.QtGui.QColor",
"OCP.AIS.AIS_ColoredShape",
"OCP.Quantity.Quantity_Color",
"PyQt5.QtGui.QColor.fromRgbF",
"cadquery.Workplane",
"cadquery.Shape.cast"
] | [((1167, 1197), 'cadquery.Compound.makeCompound', 'cq.Compound.makeCompound', (['vals'], {}), '(vals)\n', (1191, 1197), True, 'import cadquery as cq\n'), ((1243, 1261), 'cadquery.Workplane', 'cq.Workplane', (['"""XY"""'], {}), "('XY')\n", (1255, 1261), True, 'import cadquery as cq\n'), ((1405, 1436), 'OCP.AIS.AIS_Color... |
import Agent
import aux_functions
from collections import deque
import pickle
import numpy as np
import torch
import torch.optim as optim
def init_algo(data_path, history_power_td=60000, weather_dim=6):
agents = deque(maxlen=4)
policy = Agent.Policy(state_size=weather_dim)
optimizer = o... | [
"numpy.mean",
"collections.deque",
"pickle.dump",
"aux_functions.preprocess_weather_data",
"aux_functions.preprocess_power_data",
"torch.Tensor",
"torch.no_grad",
"Agent.Policy",
"Agent.Agent"
] | [((226, 241), 'collections.deque', 'deque', ([], {'maxlen': '(4)'}), '(maxlen=4)\n', (231, 241), False, 'from collections import deque\n'), ((257, 293), 'Agent.Policy', 'Agent.Policy', ([], {'state_size': 'weather_dim'}), '(state_size=weather_dim)\n', (269, 293), False, 'import Agent\n'), ((383, 413), 'collections.dequ... |
from typing import List
import altair as alt
import datetime
import streamlit as st
import pandas as pd
from pyrva_talk.twitter import api
from pyrva_talk.streamlit import show_chart, select_scale
def display(handles: List[str], since: datetime.date) -> None:
"""Render Mentions App."""
if isinstance(handles,... | [
"pyrva_talk.twitter.api.get_tweets",
"pyrva_talk.streamlit.show_chart",
"altair.Chart",
"altair.Y",
"altair.X",
"streamlit.dataframe",
"pandas.DataFrame",
"altair.Color",
"pandas.to_datetime",
"streamlit.title"
] | [((360, 407), 'streamlit.title', 'st.title', (['f"""Comparison of tweets since {since}"""'], {}), "(f'Comparison of tweets since {since}')\n", (368, 407), True, 'import streamlit as st\n'), ((1182, 1200), 'pandas.DataFrame', 'pd.DataFrame', (['data'], {}), '(data)\n', (1194, 1200), True, 'import pandas as pd\n'), ((126... |
"""
Used to generate a sample from an MFGP sample.
-- <EMAIL>
"""
# pylint: disable=import-error
# pylint: disable=no-member
# pylint: disable=invalid-name
# pylint: disable=relative-import
# pylint: disable=too-many-locals
# pylint: disable=no-name-in-module
# pylint: disable=superfluous-parens
import numpy as n... | [
"numpy.random.get_state",
"numpy.random.set_state",
"scipy.interpolate.RectBivariateSpline",
"mf_func.get_noisy_mfof_from_mfof",
"numpy.random.random",
"gp.kernel.SEKernel",
"numpy.array",
"numpy.linspace",
"numpy.zeros",
"mf_func.MFOptFunction",
"numpy.random.seed",
"mf_gp.get_mfgp_from_fidel... | [((821, 842), 'numpy.random.get_state', 'np.random.get_state', ([], {}), '()\n', (840, 842), True, 'import numpy as np\n'), ((845, 872), 'numpy.random.seed', 'np.random.seed', (['random_seed'], {}), '(random_seed)\n', (859, 872), True, 'import numpy as np\n'), ((1003, 1016), 'numpy.array', 'np.array', (['[1]'], {}), '(... |
# -*- coding: UTF-8 -*#
import datetime
def pretty_area(x):
return int(x) / 1000000
def pretty_seconds(x):
return datetime.timedelta(seconds=x)
def pretty_time(x):
return datetime.datetime.fromtimestamp(x)
class VacuumStatus:
"""Container for status reports from the vacuum."""
def __init__(s... | [
"datetime.timedelta",
"datetime.datetime.fromtimestamp"
] | [((126, 155), 'datetime.timedelta', 'datetime.timedelta', ([], {'seconds': 'x'}), '(seconds=x)\n', (144, 155), False, 'import datetime\n'), ((189, 223), 'datetime.datetime.fromtimestamp', 'datetime.datetime.fromtimestamp', (['x'], {}), '(x)\n', (220, 223), False, 'import datetime\n'), ((5657, 5686), 'datetime.timedelta... |
"""
Specific metric tasks for community.
Override the base metric tasks to add specific ones only required on community.
"""
# Disable import error because -ext is not available on pylint
# pylint: disable=import-error
from readthedocsext.monitoring.metrics.database import (
AvgBuildTimeMetric,
AvgBuildTrigge... | [
"readthedocsext.monitoring.metrics.latency.BuildLatencyMetric",
"readthedocsext.monitoring.metrics.database.AvgBuildTimeMetric",
"readthedocsext.monitoring.metrics.database.ConcurrencyLimitedBuildsMetric",
"readthedocsext.monitoring.metrics.redislen.RedislenMetric",
"readthedocsext.monitoring.metrics.databa... | [((762, 802), 'readthedocsext.monitoring.metrics.redislen.RedislenMetric', 'RedislenMetric', ([], {'queue_name': '"""build-large"""'}), "(queue_name='build-large')\n", (776, 802), False, 'from readthedocsext.monitoring.metrics.redislen import RedislenMetric\n'), ((812, 848), 'readthedocsext.monitoring.metrics.database.... |
import pytest
from datetime import date
from datetime import datetime as dt
from datetime import time
from datetime import timedelta as td
from tomlkit._compat import timezone as tz
from tomlkit._utils import _utc
from tomlkit._utils import parse_rfc3339
@pytest.mark.parametrize(
"string, expected",
[
... | [
"datetime.datetime",
"datetime.time",
"tomlkit._utils.parse_rfc3339",
"datetime.date",
"datetime.timedelta"
] | [((968, 989), 'tomlkit._utils.parse_rfc3339', 'parse_rfc3339', (['string'], {}), '(string)\n', (981, 989), False, 'from tomlkit._utils import parse_rfc3339\n'), ((1144, 1165), 'tomlkit._utils.parse_rfc3339', 'parse_rfc3339', (['string'], {}), '(string)\n', (1157, 1165), False, 'from tomlkit._utils import parse_rfc3339\... |
import os
import shutil
import random
paths = os.listdir("WikiCoref/WikiCoref-CoNLL")
random.seed(4) # just for consistency
random.shuffle(paths)
for i in range(len(paths)):
paths[i] = "WikiCoref/WikiCoref-CoNLL/" + paths[i]
percent_taining=80
percent_dev=10
num_paths = len(paths)
train_mark = int(num_paths*per... | [
"os.listdir",
"random.shuffle",
"random.seed",
"os.chdir",
"os.mkdir",
"shutil.copy"
] | [((47, 86), 'os.listdir', 'os.listdir', (['"""WikiCoref/WikiCoref-CoNLL"""'], {}), "('WikiCoref/WikiCoref-CoNLL')\n", (57, 86), False, 'import os\n'), ((87, 101), 'random.seed', 'random.seed', (['(4)'], {}), '(4)\n', (98, 101), False, 'import random\n'), ((125, 146), 'random.shuffle', 'random.shuffle', (['paths'], {}),... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (t... | [
"mock.Mock",
"allura.webhooks.WebhookValidator",
"alluratest.controller.setup_basic_test",
"allura.tests.decorators.audits",
"allura.webhooks.send_webhook",
"allura.lib.helpers.push_config",
"allura.webhooks.RepoPushWebhookSender",
"six.text_type",
"datetime.timedelta",
"allura.tests.decorators.wi... | [((1909, 1966), 'allura.tests.decorators.with_tool', 'td.with_tool', (['test_project_with_repo', '"""git"""', '"""src"""', '"""Git"""'], {}), "(test_project_with_repo, 'git', 'src', 'Git')\n", (1921, 1966), True, 'from allura.tests import decorators as td\n'), ((1979, 2038), 'allura.tests.decorators.with_tool', 'td.wit... |
"""
Title:
Author:
Description:
"""
import unittest
from coast_core import code_detection
@unittest.skip("Not implemented yet")
class TestCodeDetection(unittest.TestCase):
pass
| [
"unittest.skip"
] | [((108, 144), 'unittest.skip', 'unittest.skip', (['"""Not implemented yet"""'], {}), "('Not implemented yet')\n", (121, 144), False, 'import unittest\n')] |
import connexion, flask
import json
import os, sys, signal
import resource
import logging
import traceback
from typing import Iterable, Callable
rlimit_child_process_bytes = 34359738368 # 32 GiB
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../../../../../ARAX/ARAXQuery")
import ARAX_query
sys.path... | [
"logging.debug",
"connexion.request.get_json",
"os.fork",
"logging.info",
"logging.error",
"ARAX_query.ARAXQuery",
"sys.stderr.flush",
"json.dumps",
"response.Response.from_dict",
"resource.setrlimit",
"sys.stdout.flush",
"traceback.print_exc",
"os.close",
"flask.Response",
"os.fdopen",
... | [((747, 847), 'logging.debug', 'logging.debug', (['"""[query_controller]: Creating pipe and forking a child to handle the query"""'], {}), "(\n '[query_controller]: Creating pipe and forking a child to handle the query'\n )\n", (760, 847), False, 'import logging\n'), ((862, 871), 'os.pipe', 'os.pipe', ([], {}), '... |
"""
TODO:
Functions for interacting with api's
Send and receive coins
"""
import hashlib
import secrets
from typing import Tuple
from utils.secp256k1 import b58_encode, point_mul
class Wallet:
def __init__(self):
self.private_key = self.create_private_key()
@staticmethod
def create_priv... | [
"utils.secp256k1.b58_encode",
"hashlib.sha256",
"secrets.token_bytes",
"hashlib.new"
] | [((355, 378), 'secrets.token_bytes', 'secrets.token_bytes', (['(32)'], {}), '(32)\n', (374, 378), False, 'import secrets\n'), ((720, 744), 'hashlib.new', 'hashlib.new', (['"""ripemd160"""'], {}), "('ripemd160')\n", (731, 744), False, 'import hashlib\n'), ((1132, 1151), 'utils.secp256k1.b58_encode', 'b58_encode', (['add... |
from django.shortcuts import render, redirect, HttpResponse
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.models import User
from django.views.generic import View
from django.utils.text import slugify
from django.core.paginator import Paginator
from .utils import WelcomeView
from... | [
"django.shortcuts.render",
"django.contrib.auth.authenticate",
"django.utils.text.slugify",
"django.shortcuts.HttpResponse",
"django.contrib.auth.login",
"django.contrib.auth.models.User.objects.filter",
"django.shortcuts.redirect",
"django.contrib.auth.models.User.objects.create_user",
"django.cont... | [((948, 992), 'django.shortcuts.render', 'render', (['request', 'self.template', 'self.context'], {}), '(request, self.template, self.context)\n', (954, 992), False, 'from django.shortcuts import render, redirect, HttpResponse\n'), ((1474, 1518), 'django.shortcuts.render', 'render', (['request', 'self.template', 'self.... |
#! /usr/bin/env python3
from mvnc import mvncapi as mvnc
import numpy, cv2
import sys, os
import cPickle as pickle
import fd
def getPaddingSize(img):
h, w, _ = img.shape
top, bottom, left, right = (0,0,0,0)
if w < int(h / 3 * 4):
tmp = int(h / 3 * 4) - w
left = tmp // 2
right = tm... | [
"numpy.mean",
"os.listdir",
"cPickle.dump",
"numpy.sqrt",
"fd.detect_face",
"cv2.copyMakeBorder",
"numpy.subtract",
"mvnc.mvncapi.Device",
"numpy.square",
"numpy.any",
"cv2.cvtColor",
"numpy.std",
"cv2.resize",
"cv2.imread",
"mvnc.mvncapi.EnumerateDevices"
] | [((565, 606), 'cv2.resize', 'cv2.resize', (['image_to_classify', '(640, 480)'], {}), '(image_to_classify, (640, 480))\n', (575, 606), False, 'import numpy, cv2\n'), ((699, 792), 'cv2.copyMakeBorder', 'cv2.copyMakeBorder', (['image', 'top', 'bottom', 'left', 'right', 'cv2.BORDER_CONSTANT'], {'value': '[0, 0, 0]'}), '(im... |
'''
Created on Sep 24, 2016
@author: Wajih-PC
'''
import numpy as np
from scipy.special import erfinv
def sigmrnd(input):
# Declaring variables as np float type to avoid Overflow warnings
minusone = np.float(-1.0)
plusone = np.float(1.0)
sigmVals = np.true_divide(plusone,np.add(plusone,n... | [
"numpy.where",
"numpy.multiply",
"numpy.float",
"numpy.random.uniform"
] | [((220, 234), 'numpy.float', 'np.float', (['(-1.0)'], {}), '(-1.0)\n', (228, 234), True, 'import numpy as np\n'), ((251, 264), 'numpy.float', 'np.float', (['(1.0)'], {}), '(1.0)\n', (259, 264), True, 'import numpy as np\n'), ((372, 408), 'numpy.random.uniform', 'np.random.uniform', (['(0)', '(1)', 'input.shape'], {}), ... |
def is_anagram(word1, word2):
"""Receives two words and returns True/False (boolean) if word2 is
an anagram of word1, ignore case and spacing.
About anagrams: https://en.wikipedia.org/wiki/Anagram"""
# short way
# word1 = word1.strip().replace(' ', '').lower()
# word2 = word2.strip().... | [
"pytest.mark.parametrize"
] | [((1217, 1540), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""word1, word2"""', "[('rail safety', 'fairy tales'), ('roast beef', 'eat for BSE'), ('restful',\n 'fluster'), ('funeral', 'real fun'), ('adultery', 'true lady'), (\n 'customers', 'store scum'), ('forty five', 'over fifty'), ('<NAME>',\n ... |
from RappCloud.Objects import (
File,
Payload)
from Cloud import (
CloudMsg,
CloudRequest,
CloudResponse)
class SpeechRecognitionGoogle(CloudMsg):
""" Speech Recognition Google Cloud Message object """
class Request(CloudRequest):
""" Speech Recognition Google Cloud Request obje... | [
"RappCloud.Objects.File",
"RappCloud.Objects.Payload"
] | [((1106, 1169), 'RappCloud.Objects.Payload', 'Payload', ([], {'language': 'self.language', 'audio_source': 'self.audio_source'}), '(language=self.language, audio_source=self.audio_source)\n', (1113, 1169), False, 'from RappCloud.Objects import File, Payload\n'), ((1333, 1371), 'RappCloud.Objects.File', 'File', (['self.... |
"""Verfication of requests from designer backend"""
from hetdesrun.auth.keycloak import KeycloakBearerVerifier
from hetdesrun.webservice.config import runtime_config
kc_bearer_verifier = KeycloakBearerVerifier.from_creds(
auth_url=runtime_config.hd_keycloak_auth_url or "",
realm=runtime_config.hd_keycloak_re... | [
"hetdesrun.auth.keycloak.KeycloakBearerVerifier.from_creds"
] | [((190, 384), 'hetdesrun.auth.keycloak.KeycloakBearerVerifier.from_creds', 'KeycloakBearerVerifier.from_creds', ([], {'auth_url': "(runtime_config.hd_keycloak_auth_url or '')", 'realm': "(runtime_config.hd_keycloak_realm or '')", 'audience': 'runtime_config.hd_keycloak_runtime_audience'}), "(auth_url=runtime_config.\n ... |
# Copyright 2019 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, ... | [
"os.path.exists",
"subprocess.Popen",
"os.path.join",
"builtins.str",
"os.environ.copy",
"future.standard_library.install_aliases",
"shutil.copytree",
"builtins.range",
"time.sleep",
"os.mkdir",
"shutil.rmtree",
"threading.Thread",
"socket.gethostname"
] | [((721, 755), 'future.standard_library.install_aliases', 'standard_library.install_aliases', ([], {}), '()\n', (753, 755), False, 'from future import standard_library\n'), ((890, 926), 'os.path.join', 'os.path.join', (['MNT_DIR', '"""clusterfuzz"""'], {}), "(MNT_DIR, 'clusterfuzz')\n", (902, 926), False, 'import os\n')... |
"""
Module to provide tests related to the MD037 rule.
"""
from test.markdown_scanner import MarkdownScanner
import pytest
@pytest.mark.rules
def test_md037_good_valid_emphasis():
"""
Test to make sure this rule does not trigger with a document that
contains one or more valid emphasis sequences.
"""
... | [
"test.markdown_scanner.MarkdownScanner"
] | [((349, 366), 'test.markdown_scanner.MarkdownScanner', 'MarkdownScanner', ([], {}), '()\n', (364, 366), False, 'from test.markdown_scanner import MarkdownScanner\n'), ((1004, 1021), 'test.markdown_scanner.MarkdownScanner', 'MarkdownScanner', ([], {}), '()\n', (1019, 1021), False, 'from test.markdown_scanner import Mark... |
# -*- coding: utf-8 -*-
# Author: <NAME>
import codecs
import os
from setuptools import find_packages, setup
# metadata
NAME = 'unidiff'
DESCRIPTION = 'Unified diff parsing/metadata extraction library.'
KEYWORDS = ['unified', 'diff', 'parse', 'metadata']
URL = 'http://github.com/matiasb/python-unidiff'
EMAIL = '<EM... | [
"os.path.dirname",
"setuptools.find_packages",
"os.path.join"
] | [((384, 409), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (399, 409), False, 'import os\n'), ((466, 498), 'os.path.join', 'os.path.join', (['HERE', '"""README.rst"""'], {}), "(HERE, 'README.rst')\n", (478, 498), False, 'import os\n'), ((621, 665), 'os.path.join', 'os.path.join', (['HERE', ... |
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth import get_user_model
from rest_framework.authentication import BasicAuthentication
from rest_framework.exceptions import AuthenticationFailed
class AuthenticationBasic(BasicAuthentication):
def authenticate_credentials(self, useri... | [
"django.contrib.auth.get_user_model",
"django.utils.translation.ugettext_lazy"
] | [((449, 465), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (463, 465), False, 'from django.contrib.auth import get_user_model\n'), ((651, 682), 'django.utils.translation.ugettext_lazy', '_', (['"""Invalid username/password."""'], {}), "('Invalid username/password.')\n", (652, 682), True, 'f... |
#!/usr/bin/env python
#----------------------------------------------------------------------------
# Copyright (c) 2013, yt Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#----------------------------------... | [
"numpy.distutils.misc_util.Configuration"
] | [((488, 537), 'numpy.distutils.misc_util.Configuration', 'Configuration', (['"""extern"""', 'parent_package', 'top_path'], {}), "('extern', parent_package, top_path)\n", (501, 537), False, 'from numpy.distutils.misc_util import Configuration\n')] |
# Copyright (c) 2021 <NAME>. All rights reserved.
# This code is licensed under Apache 2.0 with Commons Clause license (see LICENSE.md for details)
"""Base class for working with records.
vectorbt works with two different representations of data: matrices and records.
A matrix, in this context, is just an array of o... | [
"vectorbt.generic.stats_builder.StatsBuilderMixin.stats_defaults.__get__",
"numpy.argsort",
"vectorbt.utils.attr_.get_dict_attr",
"vectorbt.base.reshape_fns.to_1d_array",
"numpy.flatnonzero",
"numpy.asarray",
"numpy.take",
"vectorbt.records.col_mapper.ColumnMapper",
"vectorbt.records.nb.is_col_sorte... | [((12280, 12319), 'vectorbt._typing.TypeVar', 'tp.TypeVar', (['"""RecordsT"""'], {'bound': '"""Records"""'}), "('RecordsT', bound='Records')\n", (12290, 12319), True, 'from vectorbt import _typing as tp\n'), ((15048, 15143), 'vectorbt.base.array_wrapper.Wrapping.__init__', 'Wrapping.__init__', (['self', 'wrapper'], {'r... |
"""
sphinx.domains.math
~~~~~~~~~~~~~~~~~~~
The math domain.
:copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import warnings
from typing import Any, Dict, Iterable, List, Tuple
from docutils import nodes
from docutils.nodes import Elem... | [
"sphinx.locale.__",
"docutils.nodes.make_id",
"docutils.nodes.Text",
"sphinx.util.logging.getLogger",
"warnings.warn",
"sphinx.util.nodes.make_refnode"
] | [((883, 910), 'sphinx.util.logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (900, 910), False, 'from sphinx.util import logging\n'), ((5315, 5402), 'warnings.warn', 'warnings.warn', (['"""MathDomain.add_equation() is deprecated."""', 'RemovedInSphinx40Warning'], {}), "('MathDomain.add_equati... |
'''
Created on Apr 3, 2012
@author: Dan
'''
from Common.Converter import *
from Common.Module import *
from Common.Symbol import DevicePart
from Common.Device import Deviceset
class Library(object):
__slots__ = ("name", "modules", "symbols", "converter", "deviceparts")
def __init__(self, nod... | [
"Common.Device.Deviceset"
] | [((962, 996), 'Common.Device.Deviceset', 'Deviceset', (['deviceset', 'symConverter'], {}), '(deviceset, symConverter)\n', (971, 996), False, 'from Common.Device import Deviceset\n')] |
import numpy as np
import json
# with open("pattern.json", "r") as fh:
# patterns = json.load(fh)
class Pat_Match(object):
def __init__(self, config, label_to_id, filt=None):
self.config = config
self.label_to_id = label_to_id
self.patterns = config.patterns
if filt is not No... | [
"numpy.zeros",
"numpy.amax",
"numpy.argmax"
] | [((603, 632), 'numpy.zeros', 'np.zeros', (['[num_text, num_pat]'], {}), '([num_text, num_pat])\n', (611, 632), True, 'import numpy as np\n'), ((648, 686), 'numpy.zeros', 'np.zeros', (['[num_text, config.num_class]'], {}), '([num_text, config.num_class])\n', (656, 686), True, 'import numpy as np\n'), ((1159, 1182), 'num... |
# Generated by Django 2.1 on 2018-08-30 13:46
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('order', '0009_update_permissions_django_21'),
]
operations = [
migrations.AlterModelOptions(
name='order',
options={'permissio... | [
"django.db.migrations.AlterModelOptions"
] | [((233, 346), 'django.db.migrations.AlterModelOptions', 'migrations.AlterModelOptions', ([], {'name': '"""order"""', 'options': "{'permissions': (('export_order', 'Can export order'),)}"}), "(name='order', options={'permissions': ((\n 'export_order', 'Can export order'),)})\n", (261, 346), False, 'from django.db imp... |
import collections
import dominoes
import unittest
class TestSeries(unittest.TestCase):
def test_init(self):
s1 = dominoes.Series()
self.assertEqual(len(s1.games), 1)
self.assertEqual(len(s1.games[0].board), 1)
self.assertEqual(s1.games[0].board.left_end(), 6)
self.assertEq... | [
"unittest.main",
"dominoes.Result",
"dominoes.Domino",
"dominoes.Series"
] | [((7683, 7698), 'unittest.main', 'unittest.main', ([], {}), '()\n', (7696, 7698), False, 'import unittest\n'), ((127, 144), 'dominoes.Series', 'dominoes.Series', ([], {}), '()\n', (142, 144), False, 'import dominoes\n'), ((789, 822), 'dominoes.Series', 'dominoes.Series', ([], {'target_score': '(100)'}), '(target_score=... |
import os
from typing import NamedTuple, Sequence
import subprocess
class UnoOfficePaths(NamedTuple):
uno_path: str
uno_python_path: str
class EnvironmentVariables:
UNO_PATH = 'UNO_PATH'
UNO_PYTHON_PATH = 'UNO_PYTHON_PATH'
UNO_OFFICE_BINARY_PATH = 'UNO_OFFICE_BINARY_PATH'
class DefaultValues:... | [
"subprocess.check_output",
"os.environ.get"
] | [((513, 539), 'os.environ.get', 'os.environ.get', (['"""UNO_PATH"""'], {}), "('UNO_PATH')\n", (527, 539), False, 'import os\n'), ((613, 646), 'os.environ.get', 'os.environ.get', (['"""UNO_PYTHON_PATH"""'], {}), "('UNO_PYTHON_PATH')\n", (627, 646), False, 'import os\n'), ((734, 774), 'os.environ.get', 'os.environ.get', ... |
# Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | [
"eventlet.patcher.original",
"eventlet.monkey_patch",
"sys.modules.keys"
] | [((1439, 1532), 'eventlet.monkey_patch', 'eventlet.monkey_patch', ([], {'os': '(True)', 'select': '(True)', 'socket': '(True)', 'thread': 'patch_thread', 'time': '(True)'}), '(os=True, select=True, socket=True, thread=\n patch_thread, time=True)\n', (1460, 1532), False, 'import eventlet\n'), ((1835, 1853), 'sys.modu... |
import cv2
camera = cv2.VideoCapture(0)
for i in range(15):
return_value, image = camera.read()
print(return_value, image.shape)
cv2.imwrite('iloveyou'+str(i)+'.jpg', image)
del(camera) | [
"cv2.VideoCapture"
] | [((21, 40), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (37, 40), False, 'import cv2\n')] |
# Copyright 2018 The Texar Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | [
"collections.deque"
] | [((1460, 1469), 'collections.deque', 'deque', (['[]'], {}), '([])\n', (1465, 1469), False, 'from collections import deque\n'), ((1488, 1497), 'collections.deque', 'deque', (['[]'], {}), '([])\n', (1493, 1497), False, 'from collections import deque\n')] |
# -*- coding: utf-8 -*-
"""
Created on Tue May 7 20:05:27 2019
@author: diksha
"""
import random
guess=random.randrange(1,11)
i=6
while i!=0:
print("enter number")
no=int(input())
i=i-1
print("no of chances left:",i)
print("play again")
i=6
while i!=0:
print("enter number")
... | [
"random.randrange"
] | [((105, 128), 'random.randrange', 'random.randrange', (['(1)', '(11)'], {}), '(1, 11)\n', (121, 128), False, 'import random\n')] |
# -- Project information -----------------------------------------------------
project = "2i2c Pilot Hubs Infrastructure"
copyright = "2020, 2i2c.org"
author = "2<EMAIL>"
# -- General configuration ---------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can... | [
"pandas.DataFrame",
"yaml.safe_load",
"pathlib.Path"
] | [((3392, 3414), 'pandas.DataFrame', 'pd.DataFrame', (['hub_list'], {}), '(hub_list)\n', (3404, 3414), True, 'import pandas as pd\n'), ((3430, 3441), 'pathlib.Path', 'Path', (['"""tmp"""'], {}), "('tmp')\n", (3434, 3441), False, 'from pathlib import Path\n'), ((3595, 3615), 'pathlib.Path', 'Path', (['"""../terraform"""'... |
import datetime
'''
The ones that create the response data. Convert it back to
bytestring, and then send it back to the client.
__init__():
Prepare the datetime.
__call__():
Do nothing.
construct():
Create the server_headers, and then create the response headers.
... | [
"datetime.datetime.now"
] | [((549, 572), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (570, 572), False, 'import datetime\n'), ((606, 629), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (627, 629), False, 'import datetime\n'), ((664, 687), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '(... |
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import page_sets
from core import perf_benchmark
from telemetry import benchmark
from telemetry.page import page_test
from telemetry.value import scalar
fro... | [
"telemetry.web_perf.metrics.memory_timeline.MemoryTimelineMetric",
"telemetry.timeline.tracing_category_filter.TracingCategoryFilter",
"telemetry.web_perf.timeline_based_measurement.Options",
"telemetry.web_perf.metrics.smoothness.SmoothnessMetric",
"telemetry.benchmark.Disabled",
"telemetry.value.scalar.... | [((1221, 1250), 'telemetry.benchmark.Disabled', 'benchmark.Disabled', (['"""android"""'], {}), "('android')\n", (1239, 1250), False, 'from telemetry import benchmark\n'), ((1784, 1815), 'telemetry.benchmark.Disabled', 'benchmark.Disabled', (['"""reference"""'], {}), "('reference')\n", (1802, 1815), False, 'from telemet... |
import json
_jplaylistpartial = """
{
"description": "Having friends over for dinner? Here's the perfect playlist.",
"id": "59ZbFPES4DQwEjBpWHzrtC",
"name": "Dinner with Friends",
"tracks": {
"items": [
{
"track": {
"id": "2zhk0kypGeOPsaaZcjyc14",
"name": "Burning House",
... | [
"json.loads"
] | [((16383, 16412), 'json.loads', 'json.loads', (['_jplaylistpartial'], {}), '(_jplaylistpartial)\n', (16393, 16412), False, 'import json\n')] |
import numpy as np
from PIL import Image
from loader_base import LoaderBase
import os
class LoaderNumpy(LoaderBase):
def __init__(self, root, data_transform=[], target_transform=[]):
super(LoaderNumpy, self).__init__(root, data_transform, target_transform)
def index_dataset(self, dir):
# get... | [
"os.path.join",
"os.listdir",
"numpy.left_shift",
"numpy.ndarray"
] | [((1027, 1061), 'numpy.ndarray', 'np.ndarray', (['(x, y)'], {'dtype': 'np.int16'}), '((x, y), dtype=np.int16)\n', (1037, 1061), True, 'import numpy as np\n'), ((1112, 1133), 'numpy.left_shift', 'np.left_shift', (['out', '(8)'], {}), '(out, 8)\n', (1125, 1133), True, 'import numpy as np\n'), ((548, 577), 'os.path.join',... |
from mjcf import elements as e
def main():
#########################
# Level 1
mujoco = e.Mujoco(
model="tendon"
)
#########################
# Level 2
compiler = e.Compiler(
coordinate="global",
)
default = e.Default()
visual = e.Visual()
worldbody = e.Worl... | [
"mjcf.elements.Default",
"mjcf.elements.Body",
"mjcf.elements.Spatial",
"mjcf.elements.Geom",
"mjcf.elements.Joint",
"mjcf.elements.spatial.Geom",
"mjcf.elements.Site",
"mjcf.elements.Mujoco",
"mjcf.elements.Compiler",
"mjcf.elements.Tendon",
"mjcf.elements.spatial.Pulley",
"mjcf.elements.visu... | [((102, 126), 'mjcf.elements.Mujoco', 'e.Mujoco', ([], {'model': '"""tendon"""'}), "(model='tendon')\n", (110, 126), True, 'from mjcf import elements as e\n'), ((201, 232), 'mjcf.elements.Compiler', 'e.Compiler', ([], {'coordinate': '"""global"""'}), "(coordinate='global')\n", (211, 232), True, 'from mjcf import elemen... |
#! /usr/bin/env python3
import empire.arguments as arguments
import sys
if __name__ == '__main__':
args = arguments.args
if args.subparser_name == 'server':
import empire.server.server as server
server.run(args)
elif args.subparser_name == 'client':
import empire.client.client a... | [
"empire.client.client.start",
"empire.server.server.run",
"sys.exit"
] | [((357, 368), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (365, 368), False, 'import sys\n'), ((223, 239), 'empire.server.server.run', 'server.run', (['args'], {}), '(args)\n', (233, 239), True, 'import empire.server.server as server\n'), ((337, 351), 'empire.client.client.start', 'client.start', ([], {}), '()\n', ... |
"""
Shim to maintain backwards compatibility with old IPython.nbformat imports.
"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import sys
from warnings import warn
from IPython.utils.shimmodule import ShimModule, ShimWarning
warn("The `IPython.nbformat` packa... | [
"warnings.warn",
"IPython.utils.shimmodule.ShimModule"
] | [((286, 427), 'warnings.warn', 'warn', (['"""The `IPython.nbformat` package has been deprecated since IPython 4.0. You should import from nbformat instead."""', 'ShimWarning'], {}), "(\n 'The `IPython.nbformat` package has been deprecated since IPython 4.0. You should import from nbformat instead.'\n , ShimWarnin... |
from podiomirror.auth.authenticator import Authenticator
from podiomirror.auth.token import Token
class AppAuthenticator(Authenticator):
def __init__(self, client_id, client_secret, auto_refresh=True):
self.client_id = client_id
self.client_secret = client_secret
self.auto_refresh = auto_r... | [
"podiomirror.auth.token.Token"
] | [((686, 916), 'podiomirror.auth.token.Token', 'Token', (['self.client_id', 'self.client_secret', 'app_id'], {'access_token': "data['access_token']", 'token_type': "data['token_type']", 'expires_in': "data['expires_in']", 'refresh_token': "data['refresh_token']", 'auto_refresh': 'self.auto_refresh'}), "(self.client_id, ... |
# Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | [
"pytest.mark.parametrize",
"nvflare.apis.shareable.Shareable",
"time.sleep",
"threading.Thread"
] | [((1232, 1243), 'nvflare.apis.shareable.Shareable', 'Shareable', ([], {}), '()\n', (1241, 1243), False, 'from nvflare.apis.shareable import Shareable\n'), ((2291, 2349), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""method"""', 'TestController.ALL_APIS'], {}), "('method', TestController.ALL_APIS)\n", (231... |
import slackweb
from sets import Set
from datetime import datetime
from slackclient import SlackClient
from cli.settings import Settings
from cli.appconfig import AppConfig
from cli.utils import printException, printErrorMsg
class WebHook:
def __init__(self):
self.disabled = True
self.emoji = ':... | [
"cli.utils.printException",
"slackclient.SlackClient",
"datetime.datetime.now",
"slackweb.Slack",
"sets.Set",
"cli.settings.Settings",
"cli.appconfig.AppConfig"
] | [((456, 466), 'cli.settings.Settings', 'Settings', ([], {}), '()\n', (464, 466), False, 'from cli.settings import Settings\n'), ((495, 506), 'cli.appconfig.AppConfig', 'AppConfig', ([], {}), '()\n', (504, 506), False, 'from cli.appconfig import AppConfig\n'), ((5660, 5674), 'datetime.datetime.now', 'datetime.now', ([],... |
# Generated by nuclio.export.NuclioExporter on 2020-02-27 19:29
import os
import zipfile
import json
from tempfile import mktemp
import pandas as pd
def open_archive(context,
target_dir='content',
archive_url=''):
"""Open a file/object archive into a target directory"""
... | [
"os.listdir",
"zipfile.ZipFile",
"mlrun.artifacts.TableArtifact",
"os.makedirs",
"json.dumps",
"os.path.join",
"pandas.DataFrame"
] | [((326, 364), 'os.makedirs', 'os.makedirs', (['target_dir'], {'exist_ok': '(True)'}), '(target_dir, exist_ok=True)\n', (337, 364), False, 'import os\n'), ((474, 507), 'zipfile.ZipFile', 'zipfile.ZipFile', (['archive_url', '"""r"""'], {}), "(archive_url, 'r')\n", (489, 507), False, 'import zipfile\n'), ((1299, 1360), 'p... |
from django.shortcuts import render, get_object_or_404
from django.http import HttpResponse, HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.utils import timezone
from django.contrib.auth.models import User
from django.contrib.auth import authenticate, login, logout
from .models import Ar... | [
"django.shortcuts.render",
"django.contrib.auth.authenticate",
"django.shortcuts.get_object_or_404",
"django.contrib.auth.login",
"django.core.urlresolvers.reverse",
"django.contrib.auth.models.User.objects.filter",
"django.contrib.auth.models.User.objects.get",
"django.contrib.auth.models.User.object... | [((595, 642), 'django.shortcuts.render', 'render', (['request', '"""showcase/index.html"""', 'context'], {}), "(request, 'showcase/index.html', context)\n", (601, 642), False, 'from django.shortcuts import render, get_object_or_404\n'), ((692, 733), 'django.shortcuts.get_object_or_404', 'get_object_or_404', (['Gallery'... |
from .quantizer import quantize
from .io_helper import write_quantized_output
from numpy import floor
import os
from jinja2 import Environment, FileSystemLoader
from shutil import copy
from .caf_verilog_base import CafVerilogBase
class CpxMultiply(CafVerilogBase):
def __init__(self, x, y, x_i_bits=12, x_q_bits=0... | [
"os.path.join",
"numpy.floor",
"jinja2.Environment"
] | [((2683, 2718), 'jinja2.Environment', 'Environment', ([], {'loader': 'template_loader'}), '(loader=template_loader)\n', (2694, 2718), False, 'from jinja2 import Environment, FileSystemLoader\n'), ((2003, 2027), 'numpy.floor', 'floor', (['self.x_quant.real'], {}), '(self.x_quant.real)\n', (2008, 2027), False, 'from nump... |