code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import numpy as np
import tensorflow as tf
def discretize(value,action_dim,n_outputs):
discretization = tf.round(value)
discretization = tf.minimum(tf.constant(n_outputs-1, dtype=tf.float32,shape=[1,action_dim]),
tf.maximum(tf.constant(0, dtype=tf.float32,shape=[1,action_dim]), tf.... | [
"tensorflow.Session",
"tensorflow.constant",
"tensorflow.round",
"tensorflow.to_int32",
"numpy.array",
"tensorflow.to_float"
] | [((113, 128), 'tensorflow.round', 'tf.round', (['value'], {}), '(value)\n', (121, 128), True, 'import tensorflow as tf\n'), ((359, 386), 'tensorflow.to_int32', 'tf.to_int32', (['discretization'], {}), '(discretization)\n', (370, 386), True, 'import tensorflow as tf\n'), ((426, 484), 'numpy.array', 'np.array', (['(0, 0.... |
import copy
import sys
import ChessAI.GameController.game_figures as Figures
from ChessBoard.chess_board import Board
from ChessBoard.chess_figure import FigureType, Side
from Vector2d.Vector2d import Vector2d, Move
class GameBoard:
default_white_king_pos = Vector2d(4, 7)
default_black_king_pos = Vector2d(4,... | [
"sys.stdout.write",
"Vector2d.Vector2d.Move",
"copy.deepcopy",
"ChessBoard.chess_figure.Side.get_oposite",
"ChessAI.GameController.game_figures.Bishop",
"ChessAI.GameController.game_figures.King",
"ChessAI.GameController.game_figures.Rook",
"ChessAI.GameController.game_figures.Knight",
"Vector2d.Vec... | [((265, 279), 'Vector2d.Vector2d.Vector2d', 'Vector2d', (['(4)', '(7)'], {}), '(4, 7)\n', (273, 279), False, 'from Vector2d.Vector2d import Vector2d, Move\n'), ((309, 323), 'Vector2d.Vector2d.Vector2d', 'Vector2d', (['(4)', '(0)'], {}), '(4, 0)\n', (317, 323), False, 'from Vector2d.Vector2d import Vector2d, Move\n'), (... |
import cbmpy
import numpy as np
import os
import sys
import pandas as pd
import re
modelLoc = sys.argv[1]
growthMediumLoc = sys.argv[2]
scriptLoc = sys.argv[3]
proteomicsLoc = sys.argv[4]
resultsFolder = sys.argv[5]
model = cbmpy.CBRead.readSBML3FBC(modelLoc, scan_notes_gpr = False)
growthData = pd.read_csv(growthMed... | [
"os.mkdir",
"pandas.read_csv",
"cbmpy.CBCPLEX.cplx_analyzeModel",
"os.path.isdir",
"cbmpy.CBCPLEX.cplx_FluxVariabilityAnalysis",
"cbmpy.CBRead.readSBML3FBC",
"os.path.split",
"os.chdir"
] | [((226, 283), 'cbmpy.CBRead.readSBML3FBC', 'cbmpy.CBRead.readSBML3FBC', (['modelLoc'], {'scan_notes_gpr': '(False)'}), '(modelLoc, scan_notes_gpr=False)\n', (251, 283), False, 'import cbmpy\n'), ((299, 327), 'pandas.read_csv', 'pd.read_csv', (['growthMediumLoc'], {}), '(growthMediumLoc)\n', (310, 327), True, 'import pa... |
import numpy as np
from scipy.interpolate import RegularGridInterpolator
from scipy.ndimage.filters import gaussian_filter
"""
Elastic deformation of images as described in
<NAME>, "Best Practices for
Convolutional Neural Networks applied to Visual
Document Analysis", in
Proc. of the International Conference on D... | [
"numpy.random.rand",
"scipy.interpolate.RegularGridInterpolator",
"numpy.arange",
"numpy.reshape"
] | [((1499, 1599), 'scipy.interpolate.RegularGridInterpolator', 'RegularGridInterpolator', (['coords', 'img_numpy'], {'method': 'method', 'bounds_error': '(False)', 'fill_value': 'c_val'}), '(coords, img_numpy, method=method, bounds_error=\n False, fill_value=c_val)\n', (1522, 1599), False, 'from scipy.interpolate impo... |
# Copyright 2020 The TensorFlow 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | [
"numpy.sum",
"numpy.maximum",
"tensorflow.compat.v1.reduce_mean",
"tensorflow.compat.v1.transpose",
"tensorflow.compat.v1.matmul",
"tensorflow.compat.v1.gather",
"tensorflow.compat.v1.disable_eager_execution",
"os.path.join",
"numpy.pad",
"tensorflow.compat.v1.square",
"tensorflow.compat.v1.sque... | [((980, 1008), 'tensorflow.compat.v1.disable_eager_execution', 'tf.disable_eager_execution', ([], {}), '()\n', (1006, 1008), True, 'import tensorflow.compat.v1 as tf\n'), ((4902, 4929), 'tensorflow_graphics.projects.cvxnet.lib.libmise.mise.MISE', 'mise.MISE', (['(32)', '(3)', 'level_set'], {}), '(32, 3, level_set)\n', ... |
import keras
import numpy as np
from keras.models import Sequential
from keras.layers import Dense
from keras.datasets import mnist
x_train = None
y_train = None
x_test = None
y_test = None
def init():
global x_train, y_train, x_test, y_test
(x_train_tmp, y_train_tmp), (x_test_tmp, y_test_tmp) = mnist.load_d... | [
"keras.datasets.mnist.load_data",
"numpy.zeros",
"time.time",
"keras.layers.Dense",
"keras.models.Sequential"
] | [((308, 325), 'keras.datasets.mnist.load_data', 'mnist.load_data', ([], {}), '()\n', (323, 325), False, 'from keras.datasets import mnist\n'), ((490, 516), 'numpy.zeros', 'np.zeros', (['(train_size, 10)'], {}), '((train_size, 10))\n', (498, 516), True, 'import numpy as np\n'), ((601, 626), 'numpy.zeros', 'np.zeros', ([... |
import logging
from pathlib import Path
from scrapy import Spider, Request
from scrapy.crawler import CrawlerProcess
from scrapy_playwright.page import PageCoroutine
class HandleTimeoutMiddleware:
def process_exception(self, request, exception, spider):
logging.info("Caught exception: %s", exception.__cl... | [
"logging.info",
"pathlib.Path",
"scrapy.Request",
"scrapy.crawler.CrawlerProcess"
] | [((1285, 1514), 'scrapy.crawler.CrawlerProcess', 'CrawlerProcess', ([], {'settings': "{'TWISTED_REACTOR':\n 'twisted.internet.asyncioreactor.AsyncioSelectorReactor',\n 'DOWNLOAD_HANDLERS': {'https':\n 'scrapy_playwright.handler.ScrapyPlaywrightDownloadHandler'},\n 'RETRY_TIMES': 0}"}), "(settings={'TWISTED_... |
from machine import Pin, PWM
# Initialization
pwmFan = PWM(Pin(21), duty=0)
reverseFan = Pin(22, Pin.OUT)
# Turn Fan forward 70% speed
reverseFan.value(0)
pwmFan.duty(70)
# Decrease speed
pwmFan.duty(50)
# Decrease speed further (it might stop)
pwmFan.duty(30)
# Turn Fan backwards 70% speed
reverseFan.value(1)
pwmFan... | [
"machine.Pin"
] | [((89, 105), 'machine.Pin', 'Pin', (['(22)', 'Pin.OUT'], {}), '(22, Pin.OUT)\n', (92, 105), False, 'from machine import Pin, PWM\n'), ((59, 66), 'machine.Pin', 'Pin', (['(21)'], {}), '(21)\n', (62, 66), False, 'from machine import Pin, PWM\n')] |
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)
n = int(readline())
a, b = map(int, readline().split())
p = list(map(int, readline().split()))
memo = [0, 0, 0]
for check in p:
if check <= a:
memo[0] += 1
... | [
"sys.setrecursionlimit"
] | [((116, 146), 'sys.setrecursionlimit', 'sys.setrecursionlimit', (['(10 ** 7)'], {}), '(10 ** 7)\n', (137, 146), False, 'import sys\n')] |
"""
MIT License
Copyright (c) 2020 <NAME>
"""
from flask import Blueprint
user_bp = Blueprint("user", __name__)
from . import views
| [
"flask.Blueprint"
] | [((91, 118), 'flask.Blueprint', 'Blueprint', (['"""user"""', '__name__'], {}), "('user', __name__)\n", (100, 118), False, 'from flask import Blueprint\n')] |
#!/usr/bin/env python3
import asyncio
import unittest
import sixtynine
class TestSixtynine(unittest.TestCase):
def setUp(self):
self.loop = asyncio.get_event_loop()
def tearDown(self):
self.loop.close()
def test_mouthful(self):
self.assertEqual(self.loop.run_until_complete(sixt... | [
"asyncio.get_event_loop",
"sixtynine.mouthful"
] | [((156, 180), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (178, 180), False, 'import asyncio\n'), ((316, 336), 'sixtynine.mouthful', 'sixtynine.mouthful', ([], {}), '()\n', (334, 336), False, 'import sixtynine\n')] |
#!/usr/bin/env python3
from pyaim import CCPPasswordRESTSecure
aimccp = CCPPasswordRESTSecure('https://cyberark.dvdangelo33.dev/', "clientcert.pem", verify=True)
r = aimccp.GetPassword(appid='pyAIM',safe='D-AWS-AccessKeys',username='AnsibleAWSUser')
print(r)
| [
"pyaim.CCPPasswordRESTSecure"
] | [((74, 167), 'pyaim.CCPPasswordRESTSecure', 'CCPPasswordRESTSecure', (['"""https://cyberark.dvdangelo33.dev/"""', '"""clientcert.pem"""'], {'verify': '(True)'}), "('https://cyberark.dvdangelo33.dev/', 'clientcert.pem',\n verify=True)\n", (95, 167), False, 'from pyaim import CCPPasswordRESTSecure\n')] |
from __future__ import unicode_literals, division, absolute_import
import logging
from flexget import plugin
from flexget.plugin import priority, register_plugin, plugins
log = logging.getLogger('builtins')
def all_builtins():
"""Helper function to return an iterator over all builtin plugins."""
return (plug... | [
"flexget.plugin.priority",
"flexget.plugin.plugins.itervalues",
"flexget.plugin.register_plugin",
"logging.getLogger"
] | [((178, 207), 'logging.getLogger', 'logging.getLogger', (['"""builtins"""'], {}), "('builtins')\n", (195, 207), False, 'import logging\n'), ((1749, 1818), 'flexget.plugin.register_plugin', 'register_plugin', (['PluginDisableBuiltins', '"""disable_builtins"""'], {'api_ver': '(2)'}), "(PluginDisableBuiltins, 'disable_bui... |
from dotenv import load_dotenv
from os import environ, path
from pathlib import Path
load_dotenv(verbose=True)
parent_path = Path(__file__).parent
dotenv_path = path.join(parent_path, ".env")
load_dotenv(dotenv_path)
CSRF_COOKIE_SECURE = True
CSRF_COOKIE_HTTPONLY = True
SECRET_KEY = environ.get("SECRET_KEY")
SPOT... | [
"dotenv.load_dotenv",
"os.environ.get",
"pathlib.Path",
"os.path.join"
] | [((87, 112), 'dotenv.load_dotenv', 'load_dotenv', ([], {'verbose': '(True)'}), '(verbose=True)\n', (98, 112), False, 'from dotenv import load_dotenv\n'), ((164, 194), 'os.path.join', 'path.join', (['parent_path', '""".env"""'], {}), "(parent_path, '.env')\n", (173, 194), False, 'from os import environ, path\n'), ((195,... |
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, PasswordField
from wtforms.validators import Email,DataRequired,Length, ValidationError
from SIS.models import Info
import email_validator
class sisForm(FlaskForm):
rollNo = StringField('Roll No',
validators=[Data... | [
"wtforms.validators.Email",
"wtforms.validators.Length",
"SIS.models.Info.query.filter_by",
"wtforms.SubmitField",
"wtforms.validators.DataRequired",
"wtforms.validators.ValidationError"
] | [((975, 996), 'wtforms.SubmitField', 'SubmitField', (['"""Submit"""'], {}), "('Submit')\n", (986, 996), False, 'from wtforms import StringField, SubmitField, PasswordField\n'), ((2053, 2074), 'wtforms.SubmitField', 'SubmitField', (['"""Submit"""'], {}), "('Submit')\n", (2064, 2074), False, 'from wtforms import StringFi... |
# -*- coding:utf-8 -*-
from __future__ import unicode_literals
from django import forms
class JsonMixinForm(forms.Form):
boolean = forms.BooleanField()
char = forms.CharField(
min_length=3,
max_length=6)
integer = forms.IntegerField(
min_value=3,
max_valu... | [
"django.forms.BooleanField",
"django.forms.CharField",
"django.forms.IntegerField"
] | [((140, 160), 'django.forms.BooleanField', 'forms.BooleanField', ([], {}), '()\n', (158, 160), False, 'from django import forms\n'), ((172, 215), 'django.forms.CharField', 'forms.CharField', ([], {'min_length': '(3)', 'max_length': '(6)'}), '(min_length=3, max_length=6)\n', (187, 215), False, 'from django import forms\... |
from django.conf.urls import patterns, include, url
urlpatterns = patterns('',
# Examples:
url(r'^service/.*/(?P<service_id>[0-9]+)/edit/?$', 'r_pass.views.edit'),
url(r'^service/.*/(?P<service_id>[0-9]+)/?$', 'r_pass.views.service'),
url(r'^create/?$', 'r_pass.views.create'),
url(r'', 'r_pass.view... | [
"django.conf.urls.url"
] | [((100, 170), 'django.conf.urls.url', 'url', (['"""^service/.*/(?P<service_id>[0-9]+)/edit/?$"""', '"""r_pass.views.edit"""'], {}), "('^service/.*/(?P<service_id>[0-9]+)/edit/?$', 'r_pass.views.edit')\n", (103, 170), False, 'from django.conf.urls import patterns, include, url\n'), ((177, 245), 'django.conf.urls.url', '... |
from regex_matchers import retrieve_exceptions
from utils import chunks
import threading
import glob
from pathlib import Path
import os
def extract_exceptions(files):
for path in files:
fileName = Path(path).stem
outputFile = f"ignored_data/exceptions/{fileName}.txt"
if os.path.isfile(outpu... | [
"regex_matchers.retrieve_exceptions",
"threading.Thread",
"os.path.isfile",
"pathlib.Path",
"utils.chunks",
"glob.glob"
] | [((867, 908), 'glob.glob', 'glob.glob', (['"""ignored_data/downloads/*.xml"""'], {}), "('ignored_data/downloads/*.xml')\n", (876, 908), False, 'import glob\n'), ((946, 968), 'utils.chunks', 'chunks', (['files', 'threads'], {}), '(files, threads)\n', (952, 968), False, 'from utils import chunks\n'), ((1191, 1233), 'glob... |
from __future__ import print_function
import sys, h5py as h5, numpy as np, yt, csv
from time import time, sleep
from PreFRBLE.file_system import *
from PreFRBLE.parameter import *
from time import time
def TimeElapsed( func, *args, **kwargs ):
""" measure time taken to compute function """
def MeasureTime():
... | [
"os.open",
"h5py.File",
"csv.reader",
"os.unlink",
"fcntl.flock",
"time.sleep",
"time.time",
"numpy.where",
"numpy.array",
"os.close",
"sys.exit"
] | [((3834, 3865), 'numpy.array', 'np.array', (['FRBs'], {'dtype': 'FRB_dtype'}), '(FRBs, dtype=FRB_dtype)\n', (3842, 3865), True, 'import sys, h5py as h5, numpy as np, yt, csv\n'), ((333, 339), 'time.time', 'time', ([], {}), '()\n', (337, 339), False, 'from time import time\n'), ((735, 784), 'sys.exit', 'sys.exit', (['""... |
import logging
import os
import shutil
import sys
import tempfile
from pyflink.dataset import ExecutionEnvironment
from pyflink.table import BatchTableEnvironment, TableConfig, DataTypes
from pyflink.table import expressions as expr
from pyflink.table.descriptors import OldCsv, FileSystem, Schema
from pyflink.table.ex... | [
"pyflink.table.expressions.lit",
"pyflink.dataset.ExecutionEnvironment.get_execution_environment",
"pyflink.table.descriptors.OldCsv",
"pyflink.table.DataTypes.STRING",
"pyflink.table.TableConfig",
"pyflink.table.BatchTableEnvironment.create",
"pyflink.table.DataTypes.BIGINT",
"pyflink.table.descripto... | [((372, 420), 'pyflink.dataset.ExecutionEnvironment.get_execution_environment', 'ExecutionEnvironment.get_execution_environment', ([], {}), '()\n', (418, 420), False, 'from pyflink.dataset import ExecutionEnvironment\n'), ((468, 481), 'pyflink.table.TableConfig', 'TableConfig', ([], {}), '()\n', (479, 481), False, 'fro... |
import git
import ray
from ray import tune
from ray.tune import CLIReporter
from agent0.common.utils import parse_arguments
from agent0.nips_encoder.trainer import Trainer, Config
if __name__ == '__main__':
repo = git.Repo(search_parent_directories=True)
sha = repo.git.rev_parse(repo.head.object.hexsha, short... | [
"ray.init",
"ray.tune.CLIReporter",
"git.Repo",
"agent0.nips_encoder.trainer.Config",
"agent0.common.utils.parse_arguments"
] | [((220, 260), 'git.Repo', 'git.Repo', ([], {'search_parent_directories': '(True)'}), '(search_parent_directories=True)\n', (228, 260), False, 'import git\n'), ((377, 397), 'agent0.nips_encoder.trainer.Config', 'Config', ([], {'sha': 'sha_long'}), '(sha=sha_long)\n', (383, 397), False, 'from agent0.nips_encoder.trainer ... |
from __future__ import annotations
import typing as t
from dataclasses import dataclass
from pathlib import Path
from loguru import logger
from rich.console import Console
from rich.console import ConsoleOptions
from rich.console import Group
from rich.console import group
from rich.console import RenderResult
from r... | [
"loguru.logger.trace",
"rich.tree.Tree",
"rich.markdown.Markdown",
"rich.console.group",
"rich.table.Table"
] | [((1514, 1529), 'rich.table.Table', 'Table', ([], {'box': 'None'}), '(box=None)\n', (1519, 1529), False, 'from rich.table import Table\n'), ((1630, 1679), 'rich.table.Table', 'Table', ([], {'title': '"""Common Packages"""', 'show_header': '(False)'}), "(title='Common Packages', show_header=False)\n", (1635, 1679), Fals... |
from gpiozero import Robot, Motor, MotionSensor
from signal import pause
robot = Robot(left=Motor(4, 14), right=Motor(17, 18))
pir = MotionSensor(5)
pir.when_motion = robot.forward
pir.when_no_motion = robot.stop
pause()
| [
"gpiozero.Motor",
"signal.pause",
"gpiozero.MotionSensor"
] | [((134, 149), 'gpiozero.MotionSensor', 'MotionSensor', (['(5)'], {}), '(5)\n', (146, 149), False, 'from gpiozero import Robot, Motor, MotionSensor\n'), ((216, 223), 'signal.pause', 'pause', ([], {}), '()\n', (221, 223), False, 'from signal import pause\n'), ((93, 105), 'gpiozero.Motor', 'Motor', (['(4)', '(14)'], {}), ... |
#!/usr/bin/env python
"""SequenceMotifDecomposer is a motif finder algorithm.
@author: <NAME>
@email: <EMAIL>
"""
import logging
import multiprocessing as mp
import os
from collections import defaultdict
from eden import apply_async
import numpy as np
from scipy.sparse import vstack
from eden.util.iterated_maximum_s... | [
"pylab.close",
"sklearn.cluster.MiniBatchKMeans",
"weblogolib.jpeg_formatter",
"Bio.Seq.Seq",
"Bio.SeqIO.write",
"numpy.nan_to_num",
"weblogolib.eps_formatter",
"random.sample",
"scipy.cluster.hierarchy.linkage",
"joblib.dump",
"eden.apply_async",
"sklearn.metrics.classification_report",
"co... | [((1145, 1172), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1162, 1172), False, 'import logging\n'), ((2325, 2335), 'numpy.sort', 'np.sort', (['x'], {}), '(x)\n', (2332, 2335), True, 'import numpy as np\n'), ((3092, 3110), 'numpy.vstack', 'np.vstack', (['cluster'], {}), '(cluster)\n',... |
from __future__ import print_function
import logging
import os
import re
import socket
import sys
import time
from process_tests import TestProcess
from process_tests import TestSocket
from process_tests import dump_on_error
from process_tests import wait_for_strings
from remote_pdb import set_trace
TIMEOUT = int(o... | [
"remote_pdb.set_trace",
"logging.basicConfig",
"time.sleep",
"logging.info",
"process_tests.wait_for_strings",
"process_tests.dump_on_error",
"process_tests.TestProcess",
"os.getenv"
] | [((319, 359), 'os.getenv', 'os.getenv', (['"""REMOTE_PDB_TEST_TIMEOUT"""', '(10)'], {}), "('REMOTE_PDB_TEST_TIMEOUT', 10)\n", (328, 359), False, 'import os\n'), ((3582, 3626), 'remote_pdb.set_trace', 'set_trace', ([], {'patch_stdstreams': 'patch_stdstreams'}), '(patch_stdstreams=patch_stdstreams)\n', (3591, 3626), Fals... |
import yaml
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
import os
import torch
import torchvision
import matplotlib.pyplot as plt
import seaborn as sns
import torch.nn as nn
from torch.utils.data import Dataset, DataLoader
import torchvision.tr... | [
"yaml.safe_load",
"torchvision.transforms.Normalize",
"torch.no_grad",
"os.path.join",
"torch.utils.data.DataLoader",
"torchvision.transforms.RandomRotation",
"torch.load",
"torch.exp",
"torchvision.transforms.CenterCrop",
"torchvision.transforms.RandomHorizontalFlip",
"math.sqrt",
"torch.cuda... | [((596, 626), 'os.path.join', 'os.path.join', (['data_dir', '"""test"""'], {}), "(data_dir, 'test')\n", (608, 626), False, 'import os\n'), ((876, 898), 'yaml.safe_load', 'yaml.safe_load', (['stream'], {}), '(stream)\n', (890, 898), False, 'import yaml\n'), ((1167, 1242), 'torchvision.transforms.Normalize', 'transforms.... |
import asyncio
import sys
import binascii
import bitcoin.core
import pylibbitcoin.client
def block_header(client):
index = sys.argv[2]
return client.block_header(int(index))
def last_height(client):
return client.last_height()
def block_height(client):
hash = sys.argv[2]
return client.block_he... | [
"binascii.unhexlify",
"asyncio.get_event_loop",
"sys.exit"
] | [((2612, 2636), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (2634, 2636), False, 'import asyncio\n'), ((1363, 1394), 'binascii.unhexlify', 'binascii.unhexlify', (['sys.argv[2]'], {}), '(sys.argv[2])\n', (1381, 1394), False, 'import binascii\n'), ((2064, 2130), 'sys.exit', 'sys.exit', (["('Usag... |
import pyrosetta
import pandas as pd
from typing import Tuple, List, Dict, Set, Any, Optional, Sequence
from .base import BaseDocumentarian
class AttributeDocumentarian(BaseDocumentarian):
"""
Analyses a Pyrosetta object and determines what is different from default.
For example. Give a working XML script... | [
"pandas.DataFrame"
] | [((4398, 4417), 'pandas.DataFrame', 'pd.DataFrame', (['proto'], {}), '(proto)\n', (4410, 4417), True, 'import pandas as pd\n')] |
import more_itertools as mit
import numpy as np
# Methods to do dynamic error thresholding on timeseries data
# Implementation inspired by: https://arxiv.org/pdf/1802.04431.pdf
def get_forecast_errors(y_hat,
y_true,
window_size=5,
batch_size=30,... | [
"numpy.std",
"more_itertools.consecutive_groups",
"numpy.percentile",
"numpy.mean",
"numpy.arange"
] | [((4460, 4484), 'numpy.mean', 'np.mean', (['smoothed_errors'], {}), '(smoothed_errors)\n', (4467, 4484), True, 'import numpy as np\n'), ((4497, 4520), 'numpy.std', 'np.std', (['smoothed_errors'], {}), '(smoothed_errors)\n', (4503, 4520), True, 'import numpy as np\n'), ((4884, 4913), 'numpy.arange', 'np.arange', (['(2.5... |
# -*- coding: utf-8 -*-
from collections import defaultdict
import commonware.log
from amo.utils import find_language
import mkt
log = commonware.log.getLogger('z.webapps')
def get_locale_properties(manifest, property, default_locale=None):
locale_dict = {}
for locale in manifest.get('locales', {}):
... | [
"collections.defaultdict",
"mkt.ratinginteractives.RATING_INTERACTIVES.get",
"mkt.ratingdescriptors.RATING_DESCS.get"
] | [((2061, 2078), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (2072, 2078), False, 'from collections import defaultdict\n'), ((2114, 2157), 'mkt.ratingdescriptors.RATING_DESCS.get', 'mkt.ratingdescriptors.RATING_DESCS.get', (['key'], {}), '(key)\n', (2152, 2157), False, 'import mkt\n'), ((2609, ... |
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 7 21:27:18 2019
@author: biyef
"""
from PIL import Image, ImageFilter
import tensorflow as tf
import matplotlib.pyplot as plt
import mnist_lenet5_backward
import mnist_lenet5_forward
import numpy as np
def imageprepare():
im = Image.open('D:/workspace/machine-learn... | [
"matplotlib.pyplot.show",
"tensorflow.train.Saver",
"tensorflow.global_variables_initializer",
"matplotlib.pyplot.imshow",
"tensorflow.argmax",
"tensorflow.Session",
"PIL.Image.open",
"mnist_lenet5_forward.forward",
"tensorflow.placeholder",
"numpy.reshape",
"tensorflow.Graph",
"tensorflow.tra... | [((282, 348), 'PIL.Image.open', 'Image.open', (['"""D:/workspace/machine-learning/mnist/img/origin-9.png"""'], {}), "('D:/workspace/machine-learning/mnist/img/origin-9.png')\n", (292, 348), False, 'from PIL import Image, ImageFilter\n'), ((353, 367), 'matplotlib.pyplot.imshow', 'plt.imshow', (['im'], {}), '(im)\n', (36... |
import threading
import pickle
import json
import sys
import random
import uuid
import time
sys.path.append('..')
from game import Game, GameState
from utils import string_to_byte, byte_to_string
class GameController():
SPECIAL_KEYWORD = b"xaxaxayarmaW"
MAX_RECEIVE_TIME_DIFFERENCE = 0.010 # in seconds
de... | [
"sys.path.append",
"threading.Thread",
"uuid.uuid4",
"random.randint",
"pickle.dumps",
"random.choice",
"json.dumps",
"time.time",
"threading.Lock",
"time.sleep",
"utils.string_to_byte",
"game.Game"
] | [((93, 114), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (108, 114), False, 'import sys\n'), ((406, 416), 'game.Game', 'Game', (['(4)', '(4)'], {}), '(4, 4)\n', (410, 416), False, 'from game import Game, GameState\n'), ((437, 453), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (451, 45... |
from jiwer import wer
ground_truth = "কুমিল্লার খাদি সারা দেশে পরিচিত"
hypothesis = "কুমিল্লার খাদে সারা দেশে পরিচিত"
error = wer(ground_truth, hypothesis)
error
| [
"jiwer.wer"
] | [((128, 157), 'jiwer.wer', 'wer', (['ground_truth', 'hypothesis'], {}), '(ground_truth, hypothesis)\n', (131, 157), False, 'from jiwer import wer\n')] |
# Software License Agreement (BSD License)
#
# Copyright (c) 2012, Fraunhofer FKIE/US, <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain th... | [
"threading.Timer",
"roslaunch.ROSLaunchConfig",
"roslaunch.XmlLoader",
"multimaster_msgs_fkie.msg.Capability",
"os.path.isfile",
"rospy.get_name",
"rospy.logwarn",
"multimaster_msgs_fkie.srv.ListNodesResponse",
"rospy.set_param",
"os.path.exists",
"os.path.dirname",
"sys.getfilesystemencoding"... | [((2902, 2919), 'threading.RLock', 'threading.RLock', ([], {}), '()\n', (2917, 2919), False, 'import threading\n'), ((2972, 3007), 'rospy.get_param', 'rospy.get_param', (['"""~launch_file"""', '""""""'], {}), "('~launch_file', '')\n", (2987, 3007), False, 'import rospy\n'), ((3016, 3067), 'rospy.loginfo', 'rospy.loginf... |
import numpy as np
from sklearn.neighbors import KNeighborsClassifier
def classify_from_embeddings(model,
train_images,
train_labels,
test_images,
test_labels,
k=5,
... | [
"sklearn.neighbors.KNeighborsClassifier"
] | [((857, 978), 'sklearn.neighbors.KNeighborsClassifier', 'KNeighborsClassifier', ([], {'n_neighbors': 'k', 'weights': 'distance_weighting', 'algorithm': '"""auto"""', 'metric': 'distance_metric', 'n_jobs': '(-1)'}), "(n_neighbors=k, weights=distance_weighting, algorithm=\n 'auto', metric=distance_metric, n_jobs=-1)\n... |
import pint
import pytest
@pytest.fixture(scope="session")
def ureg():
"""Application-wide units registry."""
registry = pint.get_application_registry()
# Used by .compat.ixmp, .compat.pyam
registry.define("USD = [USD]")
registry.define("case = [case]")
yield registry
| [
"pint.get_application_registry",
"pytest.fixture"
] | [((29, 60), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (43, 60), False, 'import pytest\n'), ((131, 162), 'pint.get_application_registry', 'pint.get_application_registry', ([], {}), '()\n', (160, 162), False, 'import pint\n')] |
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import jsonlines
import torch
import random
import numpy as np
import _pickle as cPickle
class Flickr30kRetrievalDatabase(torch.utils.data.Da... | [
"_pickle.load",
"numpy.load",
"jsonlines.open",
"random.choice"
] | [((902, 927), 'jsonlines.open', 'jsonlines.open', (['imdb_path'], {}), '(imdb_path)\n', (916, 927), False, 'import jsonlines\n'), ((2703, 2736), 'random.choice', 'random.choice', (['self.image_id_list'], {}), '(self.image_id_list)\n', (2716, 2736), False, 'import random\n'), ((2827, 2867), 'random.choice', 'random.choi... |
""" Script for generating a reversed dictionary """
import argparse
import numpy as np
import sys
def parse_arguments(args_to_parse):
description = "Load a *.npy archive of a dictionary and swap (reverse) the dictionary keys and values around"
parser = argparse.ArgumentParser(description=description)
gen... | [
"numpy.load",
"numpy.save",
"argparse.ArgumentParser"
] | [((264, 312), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': 'description'}), '(description=description)\n', (287, 312), False, 'import argparse\n'), ((877, 920), 'numpy.save', 'np.save', (['args.output_file', 'reversed_wordvec'], {}), '(args.output_file, reversed_wordvec)\n', (884, 920), Tr... |
#!/usr/bin/env python
import rospy
from geometry_msgs.msg import Twist
from sensor_msgs.msg import Joy
toggle = False
def callback(data):
global toggle
twist = Twist()
twist.linear.x = 1.5*data.axes[1]
twist.linear.y = -1.5*data.axes[0]
twist.angular.z = 1.5*data.axes[3]
if(data.buttons[4] == 1):
toggle = Tru... | [
"rospy.Subscriber",
"rospy.Publisher",
"geometry_msgs.msg.Twist",
"rospy.init_node",
"rospy.spin"
] | [((164, 171), 'geometry_msgs.msg.Twist', 'Twist', ([], {}), '()\n', (169, 171), False, 'from geometry_msgs.msg import Twist\n'), ((579, 628), 'rospy.Publisher', 'rospy.Publisher', (['"""/cmd_vel"""', 'Twist'], {'queue_size': '(10)'}), "('/cmd_vel', Twist, queue_size=10)\n", (594, 628), False, 'import rospy\n'), ((678, ... |
import time
from load_gym import load_gym
import action_helpers as ah
import dl_model_1 as m1
def append_winnings(all_states, all_winnings, winnings):
while len(all_winnings) < len(all_states):
id = len(all_winnings)
player_id = all_states[id].player_to_act
all_winnings.append(winnings[pla... | [
"dl_model_1.create_model_1",
"load_gym.load_gym",
"time.time",
"dl_model_1.train_model",
"action_helpers.randomize_action",
"dl_model_1.calculate_action"
] | [((3952, 3962), 'load_gym.load_gym', 'load_gym', ([], {}), '()\n', (3960, 3962), False, 'from load_gym import load_gym\n'), ((4006, 4025), 'dl_model_1.create_model_1', 'm1.create_model_1', ([], {}), '()\n', (4023, 4025), True, 'import dl_model_1 as m1\n'), ((3673, 3692), 'dl_model_1.create_model_1', 'm1.create_model_1'... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-10-27 18:49
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('project', '0003_voting'),
]
operations = [
m... | [
"django.db.migrations.RemoveField",
"django.db.models.ForeignKey"
] | [((319, 377), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""foto"""', 'name': '"""category"""'}), "(model_name='foto', name='category')\n", (341, 377), False, 'from django.db import migrations, models\n'), ((422, 480), 'django.db.migrations.RemoveField', 'migrations.RemoveField',... |
from pathlib import Path
import os
from pysam import VariantFile
import pytest
import yaml
from vembrane import errors
from vembrane import __version__, filter_vcf
CASES = Path(__file__).parent.joinpath("testcases")
def test_version():
assert __version__ == "0.1.0"
@pytest.mark.parametrize(
"testcase", [d... | [
"pytest.raises",
"yaml.load",
"os.listdir",
"pathlib.Path"
] | [((515, 559), 'yaml.load', 'yaml.load', (['config_fp'], {'Loader': 'yaml.FullLoader'}), '(config_fp, Loader=yaml.FullLoader)\n', (524, 559), False, 'import yaml\n'), ((174, 188), 'pathlib.Path', 'Path', (['__file__'], {}), '(__file__)\n', (178, 188), False, 'from pathlib import Path\n'), ((759, 783), 'pytest.raises', '... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import with_statement
from __future__ import unicode_literals
import pytest
import sys
from sets import Set
from dnscherry.auth.modLdap import Auth, CaFileDontExist
import cherrypy
import logging
import ldap
cfg = {
'auth.ldap.module': 'dnscherry.backend.... | [
"dnscherry.auth.modLdap.Auth",
"ldap.simple_bind_s"
] | [((1219, 1242), 'dnscherry.auth.modLdap.Auth', 'Auth', (['cfg', 'cherrypy.log'], {}), '(cfg, cherrypy.log)\n', (1223, 1242), False, 'from dnscherry.auth.modLdap import Auth, CaFileDontExist\n'), ((1430, 1454), 'dnscherry.auth.modLdap.Auth', 'Auth', (['cfg2', 'cherrypy.log'], {}), '(cfg2, cherrypy.log)\n', (1434, 1454),... |
from typing import Any
from gevent.monkey import patch_thread # type: ignore
from doge.common.doge import Executer, Request, Response
from doge.common.utils import import_string
patch_thread()
class BaseFilter(Executer):
def __init__(self, context: Any, _next: Executer):
self.next = _next
def exe... | [
"doge.common.utils.import_string",
"gevent.monkey.patch_thread"
] | [((182, 196), 'gevent.monkey.patch_thread', 'patch_thread', ([], {}), '()\n', (194, 196), False, 'from gevent.monkey import patch_thread\n'), ((628, 644), 'doge.common.utils.import_string', 'import_string', (['f'], {}), '(f)\n', (641, 644), False, 'from doge.common.utils import import_string\n')] |
#!/usr/bin/env python3
############################################################################################
# #
# Program purpose: Adds more number of elements to a deque object from an iterable #
# ... | [
"random.randint"
] | [((973, 991), 'random.randint', 'randint', (['low', 'high'], {}), '(low, high)\n', (980, 991), False, 'from random import randint\n'), ((1202, 1221), 'random.randint', 'randint', (['(0)', 'max_ext'], {}), '(0, max_ext)\n', (1209, 1221), False, 'from random import randint\n')] |
from django.db import models
from django.utils.translation import gettext_lazy as _
from django.urls import reverse
from parts.core.managers import AbstractUpdateViewManager
from parts.core.models import TimeStampModel
class PartsNumber(AbstractUpdateViewManager, TimeStampModel):
SOURCE_CODE = (
("01", ... | [
"django.utils.translation.gettext_lazy"
] | [((1363, 1379), 'django.utils.translation.gettext_lazy', '_', (['"""partnumbers"""'], {}), "('partnumbers')\n", (1364, 1379), True, 'from django.utils.translation import gettext_lazy as _\n'), ((1403, 1419), 'django.utils.translation.gettext_lazy', '_', (['"""Part Number"""'], {}), "('Part Number')\n", (1404, 1419), Tr... |
# -*- encoding: utf-8 -*- #
__author__ = 'FeiZhang <EMAIL>'
__date__ = '2019-07-20'
from mysqlconn import MyConn
from settings import DB_CONFIG
from gendocx import gen_doc, doc_append_table
def main():
"""
entry point
:return:
"""
try:
my_conn = MyConn(DB_CONFIG)
conn = my_conn.co... | [
"gendocx.doc_append_table",
"mysqlconn.MyConn",
"gendocx.gen_doc"
] | [((277, 294), 'mysqlconn.MyConn', 'MyConn', (['DB_CONFIG'], {}), '(DB_CONFIG)\n', (283, 294), False, 'from mysqlconn import MyConn\n'), ((461, 492), 'gendocx.gen_doc', 'gen_doc', (['"""数据库表结构说明"""', '"""FEIZHANG"""'], {}), "('数据库表结构说明', 'FEIZHANG')\n", (468, 492), False, 'from gendocx import gen_doc, doc_append_table\n... |
#!/usr/bin/python3
#-*- coding: utf8 -*-
# @author : <NAME>
"""
Génère une page HTML.
"""
pass
# On fait les imports nécessaires selon le contexte
# Pour pouvoir créer un répertoire, ici pour y mettre les fichiers HTML
import os
# On fait les imports nécessaires selon le contexte
# Pour générer les fichiers HTML... | [
"os.mkdir",
"os.path.exists"
] | [((964, 993), 'os.path.exists', 'os.path.exists', (['"""./pagesWeb/"""'], {}), "('./pagesWeb/')\n", (978, 993), False, 'import os\n'), ((1003, 1026), 'os.mkdir', 'os.mkdir', (['"""./pagesWeb/"""'], {}), "('./pagesWeb/')\n", (1011, 1026), False, 'import os\n')] |
from django.shortcuts import render, redirect, get_list_or_404, get_object_or_404
from database.models import user, restaurant, address
from helper import parse_req_body, userTypeChecker
import django.views
# Create your views here.
def home(request):
my_user = None
# makes sure user is deliverer
try:
... | [
"helper.parse_req_body",
"database.models.restaurant.Order.objects.filter",
"database.models.restaurant.DeliveryBid.objects.filter",
"database.models.user.Deliverer.objects.get",
"helper.userTypeChecker",
"django.shortcuts.redirect",
"database.models.restaurant.Restaurant.objects.all",
"database.model... | [((715, 755), 'database.models.user.Deliverer.objects.get', 'user.Deliverer.objects.get', ([], {'user': 'my_user'}), '(user=my_user)\n', (741, 755), False, 'from database.models import user, restaurant, address\n'), ((2034, 2089), 'django.shortcuts.render', 'render', (['request', '"""deliverer/home.html"""'], {'context... |
from fastapi import APIRouter
router = APIRouter()
@router.get("/items2/{item_id}")
async def read_item2(item_id: int):
return {"item_id": item_id}
| [
"fastapi.APIRouter"
] | [((40, 51), 'fastapi.APIRouter', 'APIRouter', ([], {}), '()\n', (49, 51), False, 'from fastapi import APIRouter\n')] |
# Scrapy settings for edzapp project
#
# For simplicity, this file contains only the most important settings by
# default. All the other settings are documented here:
#
# http://doc.scrapy.org/topics/settings.html
#
from edzapp import constants
BOT_NAME = 'edzapp'
BOT_VERSION = '1.0'
SPIDER_MODULES = ['edzapp.spi... | [
"os.path.realpath",
"os.path.join"
] | [((728, 754), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (744, 754), False, 'import os\n'), ((776, 819), 'os.path.join', 'os.path.join', (['PROJECT_ROOT', '"""django_edzapp"""'], {}), "(PROJECT_ROOT, 'django_edzapp')\n", (788, 819), False, 'import os\n')] |
import numpy as np
import cv2
import glob
import sys
sys.path.append("../")
import calipy
Rt_path = "./CameraData/Rt.json"
TVRt_path = "./Cameradata/TVRt.json"
Rt_back_to_front = calipy.Transform(Rt_path).inv()
Rt_TV_to_back = calipy.Transform(TVRt_path)
Rt_TV_to_front = Rt_back_to_front.dot(Rt_TV_to_back)
#origin ... | [
"sys.path.append",
"numpy.transpose",
"calipy.Transform",
"calipy.vtkRenderer",
"numpy.array"
] | [((53, 75), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (68, 75), False, 'import sys\n'), ((229, 256), 'calipy.Transform', 'calipy.Transform', (['TVRt_path'], {}), '(TVRt_path)\n', (245, 256), False, 'import calipy\n'), ((950, 968), 'calipy.Transform', 'calipy.Transform', ([], {}), '()\n', (... |
import json
from asyncio import create_task
from pathlib import Path
from redbot.core.bot import Red
from .pfpimgen import PfpImgen
with open(Path(__file__).parent / "info.json") as fp:
__red_end_user_data_statement__ = json.load(fp)["end_user_data_statement"]
# from https://github.com/phenom4n4n/Fixator10-Cogs... | [
"pathlib.Path",
"json.load"
] | [((227, 240), 'json.load', 'json.load', (['fp'], {}), '(fp)\n', (236, 240), False, 'import json\n'), ((145, 159), 'pathlib.Path', 'Path', (['__file__'], {}), '(__file__)\n', (149, 159), False, 'from pathlib import Path\n')] |
from datetime import date
from django.test import TestCase
from django.shortcuts import reverse
from django_dynamic_fixture import G
from wildlifelicensing.apps.main.tests.helpers import get_or_create_default_customer, is_login_page, \
get_or_create_default_assessor, add_assessor_to_assessor_group, SocialClient, ... | [
"wildlifelicensing.apps.main.helpers.is_assessor",
"wildlifelicensing.apps.main.tests.helpers.add_assessor_to_assessor_group",
"wildlifelicensing.apps.applications.tests.helpers.get_or_create_assessment",
"wildlifelicensing.apps.main.tests.helpers.add_to_group",
"wildlifelicensing.apps.main.tests.helpers.cl... | [((910, 924), 'wildlifelicensing.apps.main.tests.helpers.SocialClient', 'SocialClient', ([], {}), '()\n', (922, 924), False, 'from wildlifelicensing.apps.main.tests.helpers import get_or_create_default_customer, is_login_page, get_or_create_default_assessor, add_assessor_to_assessor_group, SocialClient, get_or_create_d... |
from binomo import apiAlfaBinomo
if __name__ == '__main__':
aApiAlfa = apiAlfaBinomo('','', timeBotWait = 120, loginError = True) # timeBotWait 120seg (tiempo de espera hasta resolver el capcha), loginError True
aApiAlfa.actionDV('EURUSD') # par
aApiAlfa.buy("CALL") # compra o venta (PUT)
aApiAlfa.listO... | [
"binomo.apiAlfaBinomo"
] | [((75, 130), 'binomo.apiAlfaBinomo', 'apiAlfaBinomo', (['""""""', '""""""'], {'timeBotWait': '(120)', 'loginError': '(True)'}), "('', '', timeBotWait=120, loginError=True)\n", (88, 130), False, 'from binomo import apiAlfaBinomo\n')] |
from icemac.addressbook.i18n import _
from .interfaces import IBirthDate
import icemac.addressbook.browser.base
import zope.component
class ExportList(icemac.addressbook.browser.base.BaseView):
"""List available export formats."""
title = _('Export person data')
def exporters(self):
"""Iterable ... | [
"icemac.addressbook.i18n._"
] | [((250, 273), 'icemac.addressbook.i18n._', '_', (['"""Export person data"""'], {}), "('Export person data')\n", (251, 273), False, 'from icemac.addressbook.i18n import _\n'), ((794, 841), 'icemac.addressbook.i18n._', '_', (['"""iCalendar export of birth date (.ics file)"""'], {}), "('iCalendar export of birth date (.ic... |
import os
PKG_PATH = os.path.abspath(os.path.dirname(__file__))
class PrivaError(Exception):
def __init__(self, code, message):
super().__init__(code, message)
def __str__(self):
return ': '.join(map(str, self.args))
class BasePriva:
"""Base class for Priva (private battl... | [
"os.path.dirname"
] | [((40, 65), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (55, 65), False, 'import os\n')] |
"""
@author: <NAME>
@title: SmartSearch - An Intelligent Search Engine.
@date: 05/06/2019
"""
import time
import argparse
from crawl_all_sites import crawl_for_sites
from generate_data import create_documents
from generate_data import create_data_directory
from clean_documents import remove_extra_lines_an... | [
"argparse.ArgumentParser",
"generate_data.create_documents",
"generate_data.create_data_directory",
"time.time",
"crawl_all_sites.crawl_for_sites"
] | [((358, 422), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Crawler for Search Engine"""'}), "(description='Crawler for Search Engine')\n", (381, 422), False, 'import argparse\n'), ((1084, 1095), 'time.time', 'time.time', ([], {}), '()\n', (1093, 1095), False, 'import time\n'), ((1170, ... |
from random import randrange
from pygame import *
import project10.config
class SquishSprite(pygame.sprite.Sprite):
def __init__(self, image):
pygame.sprite.Sprite.__init__(self)
self.image = pygame.image.__loader__(image).convert()
self.rect = self.image.get_rect()
screen = pygame... | [
"random.randrange"
] | [((689, 731), 'random.randrange', 'randrange', (['self.area.left', 'self.area.right'], {}), '(self.area.left, self.area.right)\n', (698, 731), False, 'from random import randrange\n')] |
import responses
import pytest
from binance.spot import Spot as Client
from tests.util import mock_http_response
from tests.util import random_str
from binance.lib.utils import encoded_string
from binance.error import ParameterRequiredError
mock_item = {"key_1": "value_1", "key_2": "value_2"}
key = random_str()
secr... | [
"pytest.mark.parametrize",
"binance.spot.Spot",
"binance.lib.utils.encoded_string",
"tests.util.random_str"
] | [((303, 315), 'tests.util.random_str', 'random_str', ([], {}), '()\n', (313, 315), False, 'from tests.util import random_str\n'), ((325, 337), 'tests.util.random_str', 'random_str', ([], {}), '()\n', (335, 337), False, 'from tests.util import random_str\n'), ((376, 388), 'tests.util.random_str', 'random_str', ([], {}),... |
#
# Copyright (c) 2015-2016 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
from nfv_vim import database
from nfv_vim.tables._table import Table
_image_table = None
class ImageTable(Table):
"""
Image Table
"""
def __init__(self):
super(ImageTable, self).__init__()
def... | [
"nfv_vim.database.database_image_delete",
"nfv_vim.database.database_image_add",
"nfv_vim.database.database_image_get_list"
] | [((754, 788), 'nfv_vim.database.database_image_get_list', 'database.database_image_get_list', ([], {}), '()\n', (786, 788), False, 'from nfv_vim import database\n'), ((358, 392), 'nfv_vim.database.database_image_add', 'database.database_image_add', (['value'], {}), '(value)\n', (385, 392), False, 'from nfv_vim import d... |
#!/usr/bin/env python
#
# mcmandelbrot
#
# An example package for AsynQueue:
# Asynchronous task queueing based on the Twisted framework, with task
# prioritization and a powerful worker interface.
#
# Copyright (C) 2015 by <NAME>,
# http://edsuom.com/AsynQueue
#
# See edsuom.com for API documentation as well as inform... | [
"twisted.application.service.Application",
"twisted.application.internet.TCPServer",
"mcmandelbrot.vroot.VRoot",
"twisted.web.server.Site.__init__",
"mcmandelbrot.vroot.openPackageFile",
"twisted.web.static.Data",
"twisted.web.http.unquote",
"twisted.web.resource.Resource",
"mcmandelbrot.image.Image... | [((8904, 8965), 'twisted.application.service.Application', 'service.Application', (['"""Interactive Mandelbrot Set HTTP Server"""'], {}), "('Interactive Mandelbrot Set HTTP Server')\n", (8923, 8965), False, 'from twisted.application import internet, service\n'), ((2325, 2367), 'twisted.web.static.Data', 'static.Data', ... |
from .generator_traj import generate_traj, EmptyError
from .motion_type import random_rot
from ..features.prePostTools import traj_to_dist
import numpy as np
def generate_n_steps(N, nstep, ndim, sub=False, noise_level=0.25):
add = 0
if ndim == 3:
add = 1
size = nstep
X_train = np.zeros((N, ... | [
"numpy.sum",
"numpy.zeros",
"numpy.random.random",
"numpy.array",
"numpy.random.normal",
"numpy.random.rand",
"numpy.concatenate"
] | [((307, 335), 'numpy.zeros', 'np.zeros', (['(N, size, 5 + add)'], {}), '((N, size, 5 + add))\n', (315, 335), True, 'import numpy as np\n'), ((370, 393), 'numpy.zeros', 'np.zeros', (['(N, size, 10)'], {}), '((N, size, 10))\n', (378, 393), True, 'import numpy as np\n'), ((416, 433), 'numpy.zeros', 'np.zeros', (['(N, 27)'... |
import numpy as np, networkx as nx, math
from scipy.sparse.csgraph import dijkstra
from scipy.sparse import csr_matrix, identity
def make_Zs(Y,ind1,ind0,pscores1,pscores0,subsample=False):
"""Generates vector of Z_i's, used to construct HT estimator.
Parameters
----------
Y : numpy float array
... | [
"math.sqrt",
"numpy.ix_",
"numpy.ones",
"networkx.connected_components",
"scipy.sparse.csgraph.dijkstra",
"numpy.sqrt"
] | [((1433, 1460), 'numpy.ones', 'np.ones', (['Y.size'], {'dtype': 'bool'}), '(Y.size, dtype=bool)\n', (1440, 1460), True, 'import numpy as np, networkx as nx, math\n'), ((1789, 1804), 'numpy.ones', 'np.ones', (['Y.size'], {}), '(Y.size)\n', (1796, 1804), True, 'import numpy as np, networkx as nx, math\n'), ((3827, 3862),... |
from qtpy.QtWidgets import QLabel
from qthandy import opaque
def test_opaque(qtbot):
widget = QLabel('Test')
qtbot.addWidget(widget)
widget.show()
opaque(widget)
assert widget.graphicsEffect()
| [
"qthandy.opaque",
"qtpy.QtWidgets.QLabel"
] | [((101, 115), 'qtpy.QtWidgets.QLabel', 'QLabel', (['"""Test"""'], {}), "('Test')\n", (107, 115), False, 'from qtpy.QtWidgets import QLabel\n'), ((167, 181), 'qthandy.opaque', 'opaque', (['widget'], {}), '(widget)\n', (173, 181), False, 'from qthandy import opaque\n')] |
import pandas as pd
import seaborn as sns
from matplotlib import pyplot as plt
import math
#getting a list of cytokines names/labels
cyt_list = 'IL1B,IL2,IL4,IL5,IL6,IL7,CXCL8,IL10,IL12B,IL13,IL17A,CSF3,CSF2,IFNG,CCL2,CCL4,TNF,IL1RN,IL9,IL15,CCL11,FGF2,CXCL10,PDGFB,CCL5,VEGFA,CCL3'.split(',')
#getting dataframe from c... | [
"math.sqrt",
"matplotlib.pyplot.clf",
"pandas.read_csv",
"matplotlib.pyplot.legend",
"pandas.read_excel",
"seaborn.distplot"
] | [((352, 427), 'pandas.read_excel', 'pd.read_excel', (['"""../database/db.xlsx"""'], {'sheet_name': '"""SM NM"""', 'usecols': '"""F:AF,CB"""'}), "('../database/db.xlsx', sheet_name='SM NM', usecols='F:AF,CB')\n", (365, 427), True, 'import pandas as pd\n'), ((3467, 3531), 'pandas.read_csv', 'pd.read_csv', (['"""data/cyto... |
# THE FOLLOWING CODE CAN BE USED IN YOUR SAGEMAKER NOTEBOOK TO TEST AN UPLOADED IMAGE TO YOUR S3 BUCKET AGAINST YOUR MODEL
import os
import urllib.request
import boto3
from IPython.display import Image
import cv2
import json
import numpy as np
# input the S3 bucket you are using for this project and the file path fo... | [
"boto3.client",
"numpy.argmax",
"cv2.imwrite",
"cv2.imread",
"IPython.display.Image"
] | [((567, 585), 'boto3.client', 'boto3.client', (['"""s3"""'], {}), "('s3')\n", (579, 585), False, 'import boto3\n'), ((712, 737), 'cv2.imread', 'cv2.imread', (['tmp_file_name'], {}), '(tmp_file_name)\n', (722, 737), False, 'import cv2\n'), ((925, 963), 'cv2.imwrite', 'cv2.imwrite', (['resized_file_name', 'newimg'], {}),... |
#!/usr/bin/env python3
# date: 2020.05.29
# It use normal loop to animate point and checkMouse to close program on click
from graphics import * # PEP8: `import *` is not preferred
import random
import time
# --- main ---
win = GraphWin("My Window",500,500)
win.setBackground(color_rgb(0,0,0))
pt = Point(250, 250)
... | [
"random.randint",
"time.sleep"
] | [((430, 453), 'random.randint', 'random.randint', (['(-10)', '(10)'], {}), '(-10, 10)\n', (444, 453), False, 'import random\n'), ((463, 486), 'random.randint', 'random.randint', (['(-10)', '(10)'], {}), '(-10, 10)\n', (477, 486), False, 'import random\n'), ((511, 526), 'time.sleep', 'time.sleep', (['(0.1)'], {}), '(0.1... |
import unittest
from gaphas.examples import Box
from gaphor import UML
from gaphor.application import Application
from gaphor.diagram.general.comment import CommentItem
from gaphor.ui.mainwindow import DiagramPage
class DiagramPageTestCase(unittest.TestCase):
def setUp(self):
Application.init(
... | [
"gaphas.examples.Box",
"gaphor.application.Application.shutdown",
"gaphor.application.Application.get_service",
"gaphor.application.Application.init"
] | [((293, 497), 'gaphor.application.Application.init', 'Application.init', ([], {'services': "['event_manager', 'component_registry', 'element_factory', 'main_window',\n 'properties', 'namespace', 'diagrams', 'toolbox', 'elementeditor',\n 'export_menu', 'tools_menu']"}), "(services=['event_manager', 'component_regi... |
import pandas as pd
files = [
'students_wt_15.csv',
'students_st_16.csv',
'students_wt_16.csv',
'students_st_17.csv',
]
for filename in files:
path = f'input/{filename}'
students = pd.read_csv(path, index_col=0)
print('From:', students.columns)
students = students[['hash', 'Sex', 'Nati... | [
"pandas.read_csv"
] | [((207, 237), 'pandas.read_csv', 'pd.read_csv', (['path'], {'index_col': '(0)'}), '(path, index_col=0)\n', (218, 237), True, 'import pandas as pd\n')] |
import urllib.request as url
from paderbox.io.cache_dir import get_cache_dir
def fetch_file_from_url(fpath, file=None):
"""
Checks if local cache directory possesses an example named <file>.
If not found, loads data from urlpath and stores it under <fpath>
Args:
fpath: url to the example repo... | [
"paderbox.io.cache_dir.get_cache_dir",
"urllib.request.urlopen"
] | [((409, 424), 'paderbox.io.cache_dir.get_cache_dir', 'get_cache_dir', ([], {}), '()\n', (422, 424), False, 'from paderbox.io.cache_dir import get_cache_dir\n'), ((594, 612), 'urllib.request.urlopen', 'url.urlopen', (['fpath'], {}), '(fpath)\n', (605, 612), True, 'import urllib.request as url\n')] |
from django.test import Client, TestCase
from django.contrib.auth import get_user_model
from django.urls import reverse, resolve
from .views import ProfileUpdateView
from .forms import CustomUserCreationForm
# Create your tests here.
class CustomUserTests(TestCase):
def test_create_user(self):
User = get... | [
"django.urls.reverse",
"django.contrib.auth.get_user_model"
] | [((317, 333), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (331, 333), False, 'from django.contrib.auth import get_user_model\n'), ((763, 779), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (777, 779), False, 'from django.contrib.auth import get_user_model\n'), (... |
import pickle
from collections import deque
from datetime import datetime
from textwrap import dedent
import pytest
from dateutil.parser import isoparse
from pytz import UTC
from validx import exc
def test_validation_error():
te = exc.InvalidTypeError(expected=int, actual=str)
assert te.context == deque([])... | [
"validx.exc.OptionsError",
"validx.exc.MaxLengthError",
"validx.exc.Step",
"validx.exc.Extra",
"validx.exc.RecursionMaxDepthError",
"validx.exc.FloatValueError",
"validx.exc.ForbiddenKeyError",
"validx.exc.PatternMatchError",
"collections.deque",
"validx.exc.MaxValueError",
"validx.exc.MinLength... | [((239, 285), 'validx.exc.InvalidTypeError', 'exc.InvalidTypeError', ([], {'expected': 'int', 'actual': 'str'}), '(expected=int, actual=str)\n', (259, 285), False, 'from validx import exc\n'), ((1708, 1732), 'validx.exc.MissingKeyError', 'exc.MissingKeyError', (['"""x"""'], {}), "('x')\n", (1727, 1732), False, 'from va... |
#!/usr/bin/env python
"""
PubMed (Scholar publications)
@website https://www.ncbi.nlm.nih.gov/pubmed/
@provide-api yes (https://www.ncbi.nlm.nih.gov/home/develop/api/)
@using-api yes
@results XML
@stable yes
@parse url, title, publishedDate, content
More info on api: https://www.ncbi.nlm.n... | [
"searx.url_utils.urlencode",
"lxml.etree.XML",
"flask_babel.gettext",
"searx.poolrequests.get"
] | [((1364, 1387), 'lxml.etree.XML', 'etree.XML', (['resp.content'], {}), '(resp.content)\n', (1373, 1387), False, 'from lxml import etree\n'), ((1704, 1729), 'searx.poolrequests.get', 'get', (['retrieve_url_encoded'], {}), '(retrieve_url_encoded)\n', (1707, 1729), False, 'from searx.poolrequests import get\n'), ((910, 93... |
"""
* Project Name: NAD-Logging-Service
* File Name: exception_test.py
* Programmer: <NAME>
* Date: Sun, Nov 15, 2020
* Description: This file contains exception tests for the Logger app.
"""
import pytest
from .sample_data import exception_logs as sample_logs
@pytest.mark.parametrize("data", sample_logs)
def... | [
"pytest.mark.parametrize"
] | [((272, 316), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""data"""', 'sample_logs'], {}), "('data', sample_logs)\n", (295, 316), False, 'import pytest\n')] |
from importlib import import_module
from pythonapm.instrumentation import instrument_method
from pythonapm.logger import agentlogger
from pythonapm import constants
methods = [
'process_request',
'process_view',
'process_exception',
'process_template_response',
'process_response'
]
def instru... | [
"pythonapm.instrumentation.instrument_method",
"importlib.import_module",
"pythonapm.logger.agentlogger"
] | [((688, 714), 'importlib.import_module', 'import_module', (['module_path'], {}), '(module_path)\n', (701, 714), False, 'from importlib import import_module\n'), ((1026, 1085), 'pythonapm.logger.agentlogger', 'agentlogger', (['"""django middleware instrumentation error"""', 'exc'], {}), "('django middleware instrumentat... |
import re
from flask import request
from website.app.api import api
from spider.database import *
from website.app.util import JsonSuccess, JsonError, ParamCheck, Param, error
@api.route('/popular_songs_list', endpoint='get_popular_song_list')
@error
@ParamCheck({'type': Param(int),
'offset': Param(in... | [
"website.app.api.api.route",
"website.app.util.Param",
"website.app.util.JsonSuccess",
"re.escape"
] | [((182, 248), 'website.app.api.api.route', 'api.route', (['"""/popular_songs_list"""'], {'endpoint': '"""get_popular_song_list"""'}), "('/popular_songs_list', endpoint='get_popular_song_list')\n", (191, 248), False, 'from website.app.api import api\n'), ((917, 990), 'website.app.api.api.route', 'api.route', (['"""/popu... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# linkedin_login.py
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
import parameters
# install webdrive when needed
driver = webdriver.Chrome(ChromeDriverManager().install())
# driver.get method() will navigate to a page given by... | [
"webdriver_manager.chrome.ChromeDriverManager"
] | [((232, 253), 'webdriver_manager.chrome.ChromeDriverManager', 'ChromeDriverManager', ([], {}), '()\n', (251, 253), False, 'from webdriver_manager.chrome import ChromeDriverManager\n')] |
from .models import Task
from django.http import HttpResponse
def index(request):
collection = Task.objects.all()
return HttpResponse(collection)
| [
"django.http.HttpResponse"
] | [((132, 156), 'django.http.HttpResponse', 'HttpResponse', (['collection'], {}), '(collection)\n', (144, 156), False, 'from django.http import HttpResponse\n')] |
#!/usr/bin/python3
import random
from urizen.core.map import Map
NORTH = 'N'
SOUTH = 'S'
EAST = 'E'
WEST = 'W'
class LFD_WormSimpleFactory(object):
def generate(self, w, h, length=None, turn_chance=0.4):
if not length:
length = int(w*h/2)
return self._gen_main(w, h, length, turn_ch... | [
"random.random",
"random.choice",
"urizen.core.map.Map"
] | [((403, 437), 'urizen.core.map.Map', 'Map', (['xsize', 'ysize'], {'fill_symbol': '"""#"""'}), "(xsize, ysize, fill_symbol='#')\n", (406, 437), False, 'from urizen.core.map import Map\n'), ((590, 631), 'random.choice', 'random.choice', (['[NORTH, SOUTH, EAST, WEST]'], {}), '([NORTH, SOUTH, EAST, WEST])\n', (603, 631), F... |
import os
import json
from urllib.request import urlopen
from io import BytesIO
from zipfile import ZipFile
import numpy as np
from torch.utils.data import Dataset
def download_and_unzip(url, extract_to='.'):
print(f"Waiting for response from {url}")
http_response = urlopen(url)
print(f"Downloading data f... | [
"os.listdir",
"os.walk",
"os.path.join",
"urllib.request.urlopen"
] | [((277, 289), 'urllib.request.urlopen', 'urlopen', (['url'], {}), '(url)\n', (284, 289), False, 'from urllib.request import urlopen\n'), ((513, 554), 'os.walk', 'os.walk', (['f"""{dataset_folder}/TLiDB_{name}"""'], {}), "(f'{dataset_folder}/TLiDB_{name}')\n", (520, 554), False, 'import os\n'), ((921, 947), 'os.listdir'... |
from starlette.responses import PlainTextResponse
def ping(_):
return PlainTextResponse('')
| [
"starlette.responses.PlainTextResponse"
] | [((76, 97), 'starlette.responses.PlainTextResponse', 'PlainTextResponse', (['""""""'], {}), "('')\n", (93, 97), False, 'from starlette.responses import PlainTextResponse\n')] |
"""Parent class for each non-unit test. Creates and removes a new test table for each test."""
# TODO: integrate creating/removing a database
from unittest import TestCase
from flask_server_files.flask_app import app
from flask_server_files.sqla_instance import fsa
# from flask.ext.testing import TestCase
class ... | [
"flask_server_files.sqla_instance.fsa.create_all",
"flask_server_files.sqla_instance.fsa.init_app",
"flask_server_files.sqla_instance.fsa.drop_all",
"flask_server_files.sqla_instance.fsa.session.remove",
"flask_server_files.flask_app.app.test_client"
] | [((556, 573), 'flask_server_files.flask_app.app.test_client', 'app.test_client', ([], {}), '()\n', (571, 573), False, 'from flask_server_files.flask_app import app\n'), ((620, 637), 'flask_server_files.sqla_instance.fsa.init_app', 'fsa.init_app', (['app'], {}), '(app)\n', (632, 637), False, 'from flask_server_files.sql... |
import os
import sys
import json
import atexit
from argparse import ArgumentParser
from shutil import get_terminal_size
from subprocess import Popen, PIPE
from textwrap import dedent
from pkg_resources import get_distribution
from databricks_dbapi import databricks
from tabulate import tabulate
MAX_ROWS = 100
HISTORY... | [
"pkg_resources.get_distribution",
"atexit.register",
"subprocess.Popen",
"json.load",
"sys.stdin.read",
"argparse.ArgumentParser",
"textwrap.dedent",
"shutil.get_terminal_size",
"readline.read_history_file",
"tabulate.tabulate",
"sys.stdout.isatty",
"os.path.expanduser",
"sys.exit"
] | [((336, 359), 'os.path.expanduser', 'os.path.expanduser', (['"""~"""'], {}), "('~')\n", (354, 359), False, 'import os\n'), ((1129, 1145), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (1143, 1145), False, 'from argparse import ArgumentParser\n'), ((1483, 1517), 'tabulate.tabulate', 'tabulate', (['rows[... |
import numpy as np
from sklearn.metrics import accuracy_score
from sklearn.metrics import precision_recall_curve
from sklearn.metrics import auc
from sklearn.metrics import matthews_corrcoef
from sklearn.metrics import roc_auc_score
from sklearn.metrics import roc_curve
from sklearn.metrics import classification_repor... | [
"numpy.sum",
"scripts.visualization.plot_roc_curve",
"sklearn.metrics.roc_curve",
"numpy.argmax",
"scripts.visualization.plot_confusion_matrix",
"sklearn.metrics.classification_report",
"sklearn.metrics.roc_auc_score",
"sklearn.metrics.precision_recall_curve",
"sklearn.metrics.auc",
"sklearn.metri... | [((1023, 1040), 'numpy.argmax', 'np.argmax', (['fscore'], {}), '(fscore)\n', (1032, 1040), True, 'import numpy as np\n'), ((1546, 1569), 'numpy.arange', 'np.arange', (['(0)', '(1)', '(0.0001)'], {}), '(0, 1, 0.0001)\n', (1555, 1569), True, 'import numpy as np\n'), ((1746, 1763), 'numpy.argmax', 'np.argmax', (['scores']... |
#####################################################################################################################
#####################################################################################################################
# See how TROPOMI NO2 responds to the Suez Canal blockage
# When downloading the ... | [
"pandas.read_csv",
"geoviews.extension",
"matplotlib.pyplot.figure",
"numpy.arange",
"glob.glob",
"geoviews.renderer",
"numpy.round",
"os.chdir",
"pandas.DataFrame",
"matplotlib.pyplot.close",
"pandas.merge",
"matplotlib.pyplot.rcParams.update",
"datetime.timedelta",
"geopandas.read_file",... | [((1696, 1819), 'os.chdir', 'os.chdir', (['"""/rds/projects/2018/maraisea-glu-01/Study/Research_Data/TROPOMI/project_2_Suez_Canal/Oversample_output"""'], {}), "(\n '/rds/projects/2018/maraisea-glu-01/Study/Research_Data/TROPOMI/project_2_Suez_Canal/Oversample_output'\n )\n", (1704, 1819), False, 'import os\n'), (... |
import torch
import torchvision
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.distributions as dists
import numpy as np
import scipy.io
import foolbox
import input_data
import argparse
from tqdm import tqdm
import data_loader
import math
import os
import tensorflow as t... | [
"numpy.random.seed",
"argparse.ArgumentParser",
"data_loader.load_dataset",
"numpy.nan_to_num",
"numpy.argmax",
"torch.sqrt",
"torch.nn.init.uniform_",
"cleverhans.attacks.FastGradientMethod",
"torch.nn.functional.dropout",
"torch.randn",
"tensorflow.ConfigProto",
"numpy.arange",
"cleverhans... | [((542, 567), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (565, 567), False, 'import argparse\n'), ((1379, 1408), 'numpy.random.seed', 'np.random.seed', (['args.randseed'], {}), '(args.randseed)\n', (1393, 1408), True, 'import numpy as np\n'), ((1409, 1441), 'torch.manual_seed', 'torch.manua... |
"""
Mergence
^^^^^^^^
All parsed plain text files should be merged into a single file to handle them
as an unified large corpus data.
.. autoclass:: MergeFiles
"""
from langumo.building import Builder
from langumo.utils import AuxiliaryFile, AuxiliaryFileManager, colorful
class MergeFiles(Builder):
"""Merge fi... | [
"langumo.utils.AuxiliaryFile.opens"
] | [((905, 938), 'langumo.utils.AuxiliaryFile.opens', 'AuxiliaryFile.opens', (['inputs', '"""rb"""'], {}), "(inputs, 'rb')\n", (924, 938), False, 'from langumo.utils import AuxiliaryFile, AuxiliaryFileManager, colorful\n')] |
"""
From http://arxiv.org/pdf/1204.0375.pdf
"""
from numpy import dot, sum, tile, linalg
from numpy.linalg import inv
def kf_predict(X, P, A, Q, B, U):
"""
X: The mean state estimate of the previous step (k−1).
P: The state covariance of previous step (k−1).
A: The transition n × n matrix.
Q: The ... | [
"numpy.dot",
"numpy.linalg.inv"
] | [((811, 820), 'numpy.dot', 'dot', (['H', 'X'], {}), '(H, X)\n', (814, 820), False, 'from numpy import dot, sum, tile, linalg\n'), ((427, 436), 'numpy.dot', 'dot', (['A', 'X'], {}), '(A, X)\n', (430, 436), False, 'from numpy import dot, sum, tile, linalg\n'), ((439, 448), 'numpy.dot', 'dot', (['B', 'U'], {}), '(B, U)\n'... |
# -*- coding: utf-8 -*-
import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
try:
long_description = open("README.md").read()
except IOError:
long_description = ""
setup(
name="word-embedder",
version="1.0.0",
description="Word Embedder",
li... | [
"os.path.dirname",
"setuptools.find_packages"
] | [((103, 128), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (118, 128), False, 'import os\n'), ((371, 386), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (384, 386), False, 'from setuptools import setup, find_packages\n')] |
"""The purpose of this module is to test the TemporaryResources context manager
The purpose of the TemporaryResources context manager is to enable using temporary, specific
configuration of resources when creating a custom Template.
If you use the global configuration `pn.config` for your templates you will include t... | [
"panel_components.resources.TemporaryResources._is_panel_style_file",
"panel.extension",
"pytest.fixture",
"panel_components.resources.TemporaryResources",
"panel.io.resources.Resources",
"panel.config.raw_css.append",
"panel.config.css_files.append"
] | [((720, 766), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""', 'autouse': '(True)'}), "(scope='function', autouse=True)\n", (734, 766), False, 'import pytest\n'), ((1076, 1092), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (1090, 1092), False, 'import pytest\n'), ((1541, 1578), 'panel.confi... |
#!/usr/bin/env python
"""
4a. Add nxos1 to your my_devices.py file.
Ensure that you include the necessary information to set the NX-API port to 8443.
This is done using 'optional_args' in NAPALM so you should have the following key-value pair defined:
"optional_args": {"port": 8443}
4b. Create a new function named... | [
"requests.packages.urllib3.disable_warnings",
"my_functions.napalm_conn",
"my_functions.create_checkpoint"
] | [((1808, 1874), 'requests.packages.urllib3.disable_warnings', 'requests.packages.urllib3.disable_warnings', (['InsecureRequestWarning'], {}), '(InsecureRequestWarning)\n', (1850, 1874), False, 'import requests\n'), ((2033, 2051), 'my_functions.napalm_conn', 'napalm_conn', (['nxos1'], {}), '(nxos1)\n', (2044, 2051), Fal... |
# -*- coding: utf-8 -*-
"""
{{NAMEPROJECT}}.users.controllers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
{{NAME}} user controllers module
:copyright: (c) {{YEAR}} by {{AUTHOR}}.
:license: BSD, see LICENSE for more details.
"""
from flask import current_app, render_template, Blueprint
from flask_security im... | [
"flask.Blueprint",
"flask.render_template",
"flask.current_app.logger.debug"
] | [((353, 402), 'flask.Blueprint', 'Blueprint', (['"""users"""', '__name__'], {'url_prefix': '"""/users"""'}), "('users', __name__, url_prefix='/users')\n", (362, 402), False, 'from flask import current_app, render_template, Blueprint\n'), ((499, 545), 'flask.current_app.logger.debug', 'current_app.logger.debug', (['u"""... |
# Ros Client
import rospy
# Standard Python Libraries
import threading
import os
import time
# Messages
from geometry_msgs.msg import Twist
# Third Party Libraries
from flask import Flask, request, Response
from pi_drone_server.html import html
from pi_drone_server.camera import Camera
# Globals
current_speed = 0
c... | [
"threading.Thread",
"pi_drone_server.camera.Camera",
"flask.Flask",
"rospy.Publisher",
"geometry_msgs.msg.Twist",
"time.sleep",
"time.time",
"rospy.is_shutdown",
"threading.Event",
"rospy.init_node"
] | [((364, 381), 'threading.Event', 'threading.Event', ([], {}), '()\n', (379, 381), False, 'import threading\n'), ((388, 403), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (393, 403), False, 'from flask import Flask, request, Response\n'), ((454, 506), 'rospy.Publisher', 'rospy.Publisher', (['"""robot_twis... |
# -*- mode:python; coding:utf-8; -*-
from sqlalchemy import create_engine
from html_templates import html_begin, html_end, html_links_li
from mysql import mysql_connect_data
__all__ = ["links"]
def links(lang, connect_data=mysql_connect_data):
e = create_engine(connect_data)
if lang not in ("ru", "en"):
... | [
"sqlalchemy.create_engine",
"html_templates.html_links_li.format"
] | [((258, 285), 'sqlalchemy.create_engine', 'create_engine', (['connect_data'], {}), '(connect_data)\n', (271, 285), False, 'from sqlalchemy import create_engine\n'), ((516, 568), 'html_templates.html_links_li.format', 'html_links_li.format', ([], {'link': 'record[0]', 'desc': 'record[1]'}), '(link=record[0], desc=record... |
# represents items that used by Storage;
# can be either a directory or media file, or non-media file
import abc
import hashlib
import os
import uuid
from enum import Enum
class StorageItemStatus(Enum):
UNKNOWN = 'Unknown'
ON_TARGET = 'On Target'
UPLOADING = 'Uploading'
UPLOAD_FAILED = 'Upload Failed'... | [
"uuid.uuid1",
"hashlib.sha256",
"os.path.abspath"
] | [((520, 541), 'os.path.abspath', 'os.path.abspath', (['path'], {}), '(path)\n', (535, 541), False, 'import os\n'), ((1093, 1109), 'hashlib.sha256', 'hashlib.sha256', ([], {}), '()\n', (1107, 1109), False, 'import hashlib\n'), ((485, 497), 'uuid.uuid1', 'uuid.uuid1', ([], {}), '()\n', (495, 497), False, 'import uuid\n')... |
from aes import AES
from hmac import new as new_hmac, compare_digest
from hashlib import pbkdf2_hmac
import os
AES_KEY_SIZE = 16
HMAC_KEY_SIZE = 16
IV_SIZE = 16
SALT_SIZE = 16
HMAC_SIZE = 32
def get_key_iv(password, salt, workload=100000):
"""
Stretches the password and extracts an AES key, an HMAC key and ... | [
"aes.AES",
"hmac.new",
"hashlib.pbkdf2_hmac",
"hmac.compare_digest",
"os.urandom"
] | [((378, 469), 'hashlib.pbkdf2_hmac', 'pbkdf2_hmac', (['"""sha256"""', 'password', 'salt', 'workload', '(AES_KEY_SIZE + IV_SIZE + HMAC_KEY_SIZE)'], {}), "('sha256', password, salt, workload, AES_KEY_SIZE + IV_SIZE +\n HMAC_KEY_SIZE)\n", (389, 469), False, 'from hashlib import pbkdf2_hmac\n'), ((1115, 1136), 'os.urand... |
from django.test import TestCase
from .models import Image,Profile
from django.contrib.auth.models import User
# Create your tests here.
class ProfileTestCase(TestCase):
# SetUp method
def setUp(self):
#creating a user instance
self.user = User(username="chris",email="<EMAIL>"... | [
"django.contrib.auth.models.User",
"django.contrib.auth.models.User.objects.all"
] | [((283, 345), 'django.contrib.auth.models.User', 'User', ([], {'username': '"""chris"""', 'email': '"""<EMAIL>"""', 'password': '"""<PASSWORD>"""'}), "(username='chris', email='<EMAIL>', password='<PASSWORD>')\n", (287, 345), False, 'from django.contrib.auth.models import User\n'), ((754, 822), 'django.contrib.auth.mod... |
import numpy as np
def LoadData(FileName):
'''
Loads hollow data into structured numpy array of floats and returns a tuple
of column headers along with the structured array.
'''
data = np.genfromtxt(FileName, names=True, delimiter=',')
return data.dtype.names, data
def SegmentDataByAspect(F... | [
"numpy.genfromtxt"
] | [((208, 258), 'numpy.genfromtxt', 'np.genfromtxt', (['FileName'], {'names': '(True)', 'delimiter': '""","""'}), "(FileName, names=True, delimiter=',')\n", (221, 258), True, 'import numpy as np\n')] |
import os
from .version import __version__
def get_include():
''' Path of cython headers for compiling cython modules '''
return os.path.dirname(os.path.abspath(__file__))
| [
"os.path.abspath"
] | [((154, 179), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (169, 179), False, 'import os\n')] |