code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
# -*- coding: utf-8 -*-
#------------------------------------------------------------------------------
# file: $Id$
# auth: <NAME> <<EMAIL>>
# date: 2016/02/19
# copy: (C) Copyright 2016-EOT Cadit Inc., All Rights Reserved.
#------------------------------------------------------------------------------
import re
impo... | [
"yaml.load",
"re.compile"
] | [((461, 509), 're.compile', 're.compile', (['"""([a-f0-9][a-f0-9])+"""', 're.IGNORECASE'], {}), "('([a-f0-9][a-f0-9])+', re.IGNORECASE)\n", (471, 509), False, 'import re\n'), ((3203, 3278), 're.compile', 're.compile', (['"""^ in "<string>", line 1, column (\\\\d+):$"""'], {'flags': 're.MULTILINE'}), '(\'^ in "<string... |
from threading import Thread
from xml.etree import ElementTree
def sort(seq):
quicksort(seq,0,len(seq)-1)
return seq
def quicksort(seq, low, high):
if low<high:
partn = partition(seq,low,high)
t1 = Thread(target=quicksort,args=(seq,low,partn-1))
t1.start()
t1.join()
t2 = Thread(target=quicksort,args=(s... | [
"threading.Thread",
"xml.etree.ElementTree.parse"
] | [((624, 654), 'xml.etree.ElementTree.parse', 'ElementTree.parse', (['"""input.xml"""'], {}), "('input.xml')\n", (641, 654), False, 'from xml.etree import ElementTree\n'), ((208, 260), 'threading.Thread', 'Thread', ([], {'target': 'quicksort', 'args': '(seq, low, partn - 1)'}), '(target=quicksort, args=(seq, low, partn ... |
#Burada da https://github.com/AlperN21/MouseMakro da olduğu gibi klavyeyi dinliyeceğiz.
import keyboard #Klavye kütüphanesi
import time #Zaman k
keyboard.start_recording() #Klavyeyi dinliyoruz
ksüre = int(input("Klavye kaydı kaç saniye sürsün----->"))
print("Kayıt başlatılıyor!")
print("3")
print("2")
print("... | [
"keyboard.replay",
"keyboard.start_recording",
"keyboard.stop_recording",
"time.sleep"
] | [((150, 176), 'keyboard.start_recording', 'keyboard.start_recording', ([], {}), '()\n', (174, 176), False, 'import keyboard\n'), ((325, 346), 'time.sleep', 'time.sleep', (['(ksüre / 4)'], {}), '(ksüre / 4)\n', (335, 346), False, 'import time\n'), ((441, 462), 'time.sleep', 'time.sleep', (['(ksüre / 4)'], {}), '(ksüre /... |
import io
import logging
import sqlite3
from os.path import abspath, dirname, join, exists
import numpy as np
from speaker_verification.utils.logger import SpeakerVerificationLogger
DATABASE_PATH = join(abspath(dirname(__file__)), "SQL", "sqlite.db")
logger = SpeakerVerificationLogger(name=__file__)
logger.setLevel(... | [
"os.path.exists",
"sqlite3.register_converter",
"sqlite3.register_adapter",
"speaker_verification.utils.logger.SpeakerVerificationLogger",
"sqlite3.connect",
"io.BytesIO",
"os.path.dirname",
"numpy.load",
"numpy.save"
] | [((263, 303), 'speaker_verification.utils.logger.SpeakerVerificationLogger', 'SpeakerVerificationLogger', ([], {'name': '__file__'}), '(name=__file__)\n', (288, 303), False, 'from speaker_verification.utils.logger import SpeakerVerificationLogger\n'), ((673, 722), 'sqlite3.register_adapter', 'sqlite3.register_adapter',... |
from typing import Any, List
from boa3.builtin.interop.contract import create_multisig_account
from boa3.builtin.type import ECPoint, UInt160
def main(minimum_sigs: int, public_keys: List[ECPoint], arg: Any) -> UInt160:
return create_multisig_account(minimum_sigs, public_keys, arg)
| [
"boa3.builtin.interop.contract.create_multisig_account"
] | [((234, 289), 'boa3.builtin.interop.contract.create_multisig_account', 'create_multisig_account', (['minimum_sigs', 'public_keys', 'arg'], {}), '(minimum_sigs, public_keys, arg)\n', (257, 289), False, 'from boa3.builtin.interop.contract import create_multisig_account\n')] |
# The functions defined here were copied based on the source code
# defined in xarray
import datetime
from typing import Any, Iterable
import numpy as np
import pandas as pd
try:
import cftime
except ImportError:
cftime = None
try:
import dask.array
dask_array_type = dask.array.Array
except Impor... | [
"pandas.isnull",
"pandas.to_timedelta",
"dask.is_dask_collection",
"xarray.core.duck_array_ops._datetime_nanmin",
"numpy.asarray",
"numpy.array",
"numpy.issubdtype",
"numpy.isnan",
"numpy.timedelta64",
"numpy.isnat",
"numpy.dtype",
"numpy.zeros_like"
] | [((2217, 2233), 'numpy.asarray', 'np.asarray', (['data'], {}), '(data)\n', (2227, 2233), True, 'import numpy as np\n'), ((875, 901), 'dask.is_dask_collection', 'dask.is_dask_collection', (['x'], {}), '(x)\n', (898, 901), False, 'import dask\n'), ((2511, 2525), 'numpy.isnat', 'np.isnat', (['data'], {}), '(data)\n', (251... |
# Copyright Amazon.com Inc. or its affiliates. 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. A copy of the
# License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanyin... | [
"boto3.client",
"logging.debug",
"acktest.k8s.resource.get_resource_exists",
"acktest.k8s.resource.delete_custom_resource",
"acktest.k8s.resource.wait_resource_consumed_by_controller",
"acktest.k8s.resource.get_resource",
"acktest.resources.random_suffix_name",
"time.sleep",
"e2e.load_ec2_resource",... | [((988, 1018), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (1002, 1018), False, 'import pytest\n'), ((1048, 1067), 'boto3.client', 'boto3.client', (['"""ec2"""'], {}), "('ec2')\n", (1060, 1067), False, 'import boto3\n'), ((1709, 1746), 'acktest.resources.random_suffix_name... |
#!/usr/bin/env python
# encoding: utf-8
from os import remove
import os.path
from multiprocessing import Process, Lock
from Naked.toolshed.system import stderr, stdout, file_exists
from doxx.commands.pull import pull_binary_file, pull_text_file
from doxx.commands.unpack import unpack_run
from doxx.utilities.filesyste... | [
"doxx.utilities.filesystem._create_dirs",
"Naked.toolshed.system.stderr",
"doxx.commands.pull.pull_text_file",
"doxx.commands.pull.pull_binary_file",
"multiprocessing.Process",
"Naked.toolshed.system.file_exists",
"doxx.utilities.filesystem._make_os_dependent_path",
"os.remove",
"Naked.toolshed.syst... | [((5572, 5606), 'doxx.utilities.filesystem._make_os_dependent_path', '_make_os_dependent_path', (['file_path'], {}), '(file_path)\n', (5595, 5606), False, 'from doxx.utilities.filesystem import _create_dirs, _make_os_dependent_path\n'), ((5995, 6017), 'Naked.toolshed.system.file_exists', 'file_exists', (['file_path'], ... |
"""Prepare dataset."""
import argparse
import collections
import datetime
import typing
import os
import re
import tensorflow as tf
from sklearn.model_selection import train_test_split
def preprocess_sentence(text: str) -> str:
# create a space between a word and the punctuation following it
text = re.sub(r"... | [
"argparse.ArgumentParser",
"os.makedirs",
"sklearn.model_selection.train_test_split",
"os.path.join",
"os.path.dirname",
"datetime.datetime.now",
"tensorflow.keras.utils.get_file",
"re.sub"
] | [((311, 345), 're.sub', 're.sub', (['"""([?.!,¿])"""', '""" \\\\1 """', 'text'], {}), "('([?.!,¿])', ' \\\\1 ', text)\n", (317, 345), False, 'import re\n'), ((358, 385), 're.sub', 're.sub', (['"""[" "]+"""', '""" """', 'text'], {}), '(\'[" "]+\', \' \', text)\n', (364, 385), False, 'import re\n'), ((474, 510), 're.sub'... |
from kommand import control
if __name__ == '__main__':
control(json_file='metric.json')
| [
"kommand.control"
] | [((61, 93), 'kommand.control', 'control', ([], {'json_file': '"""metric.json"""'}), "(json_file='metric.json')\n", (68, 93), False, 'from kommand import control\n')] |
"""
Copyright 2019 <NAME>.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distribut... | [
"gs_quant.risk.Formatters.get"
] | [((1329, 1357), 'gs_quant.risk.Formatters.get', 'Formatters.get', (['risk_measure'], {}), '(risk_measure)\n', (1343, 1357), False, 'from gs_quant.risk import Formatters, RiskRequest\n')] |
import math
import torch.nn as nn
from rls.nn.activations import Act_REGISTER, default_act
Vec_REGISTER = {}
class VectorIdentityNetwork(nn.Sequential):
def __init__(self, in_dim, *args, **kwargs):
super().__init__()
self.h_dim = self.in_dim = in_dim
self.add_module(f'identity', nn.Ide... | [
"math.ceil",
"math.floor",
"math.log2",
"torch.nn.Linear",
"torch.nn.Identity"
] | [((523, 544), 'math.log2', 'math.log2', (['self.h_dim'], {}), '(self.h_dim)\n', (532, 544), False, 'import math\n'), ((557, 579), 'math.log2', 'math.log2', (['self.in_dim'], {}), '(self.in_dim)\n', (566, 579), False, 'import math\n'), ((314, 327), 'torch.nn.Identity', 'nn.Identity', ([], {}), '()\n', (325, 327), True, ... |
import psycopg2
import psycopg2.extensions
from shapely import wkb
import binascii
def make_shapely_geometry(value, cursor=None):
return wkb.loads(binascii.a2b_hex(value))
def connect(*a, **kw):
c = psycopg2.connect(*a, **kw)
#c = psycopg2.extensions.connection(*a, **kw)
GEOMETRY_OID = get_o... | [
"psycopg2.connect",
"psycopg2.extensions.register_type",
"binascii.a2b_hex",
"psycopg2.extensions.new_type"
] | [((214, 240), 'psycopg2.connect', 'psycopg2.connect', (['*a'], {}), '(*a, **kw)\n', (230, 240), False, 'import psycopg2\n'), ((342, 427), 'psycopg2.extensions.new_type', 'psycopg2.extensions.new_type', (['(GEOMETRY_OID,)', '"""GEOMETRY"""', 'make_shapely_geometry'], {}), "((GEOMETRY_OID,), 'GEOMETRY', make_shapely_geom... |
import pytest
from jumpscale.loader import j
from tests.base_tests import BaseTests
@pytest.mark.integration
class SshClientTests(BaseTests):
def setUp(self):
super().setUp()
self.info("Get a ssh key")
self.ssh_client_name = self.random_name()
self.sshkey_file_name = self.random_n... | [
"jumpscale.loader.j.sals.fs.join_paths",
"jumpscale.loader.j.clients.docker.delete",
"jumpscale.loader.j.clients.sshkey.get",
"jumpscale.loader.j.sals.fs.rmtree",
"jumpscale.loader.j.clients.sshclient.get",
"jumpscale.loader.j.clients.docker.get",
"jumpscale.loader.j.sals.fs.mkdir",
"jumpscale.loader.... | [((409, 441), 'jumpscale.loader.j.sals.fs.mkdir', 'j.sals.fs.mkdir', (['self.sshkey_dir'], {}), '(self.sshkey_dir)\n', (424, 441), False, 'from jumpscale.loader import j\n'), ((465, 507), 'jumpscale.loader.j.clients.sshkey.get', 'j.clients.sshkey.get', (['self.ssh_client_name'], {}), '(self.ssh_client_name)\n', (485, 5... |
import numpy as np
def run_optimizer(opt, cost_f, iterations, *args, **kwargs):
errors = [cost_f.eval(cost_f.x_start, cost_f.y_start)]
xs,ys= [cost_f.x_start],[cost_f.y_start]
for epochs in range(iterations):
x, y= opt.step(*args, **kwargs)
xs.append(x)
ys.append(y)
errors.... | [
"numpy.array"
] | [((369, 381), 'numpy.array', 'np.array', (['xs'], {}), '(xs)\n', (377, 381), True, 'import numpy as np\n'), ((406, 418), 'numpy.array', 'np.array', (['ys'], {}), '(ys)\n', (414, 418), True, 'import numpy as np\n')] |
# Copyright ClusterHQ Inc. See LICENSE file for details.
"""
Test validation of keys generated by flocker-ca.
"""
from __future__ import print_function
from OpenSSL.SSL import Context, TLSv1_METHOD, Error as SSLError
from twisted.trial.unittest import TestCase
from twisted.internet.endpoints import (
SSL4Serve... | [
"OpenSSL.SSL.Context",
"twisted.internet.endpoints.SSL4ServerEndpoint",
"twisted.internet.endpoints.SSL4ClientEndpoint",
"twisted.internet.defer.gatherResults",
"twisted.internet.endpoints.connectProtocol",
"twisted.internet.defer.Deferred"
] | [((3102, 3175), 'twisted.internet.endpoints.SSL4ServerEndpoint', 'SSL4ServerEndpoint', (['reactor', 'port', 'context_factory'], {'interface': '"""127.0.0.1"""'}), "(reactor, port, context_factory, interface='127.0.0.1')\n", (3120, 3175), False, 'from twisted.internet.endpoints import SSL4ServerEndpoint, connectProtocol... |
from ctypes import util
from typing import List
from ._augment import Augment
from ._augment_groups import AugmentGroups
from effect import *
from effect import EffectTypes as ET
from util import many_effs_with_same_amount
GROUP = AugmentGroups.TRIA
CONFLICT = (GROUP,)
augments: List[Augment] = []
_primary_names =... | [
"util.many_effs_with_same_amount"
] | [((359, 408), 'util.many_effs_with_same_amount', 'many_effs_with_same_amount', (['OFFENSIVE_POT', '(1.0225)'], {}), '(OFFENSIVE_POT, 1.0225)\n', (385, 408), False, 'from util import many_effs_with_same_amount\n')] |
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html
'''
Scraped data -> Item Containers -> Json/CSV files
Scraped data -> Item Containers -> Pipeline -> SQL/MongoDB
'''
# useful for handling different ... | [
"json.dumps"
] | [((4730, 4774), 'json.dumps', 'json.dumps', (['item._values'], {'ensure_ascii': '(False)'}), '(item._values, ensure_ascii=False)\n', (4740, 4774), False, 'import json\n')] |
#!/bin/env python3
"""
Prepend "MT-" to mitochondrial gene names (if not already present) in
a gtf for cases when the mitochondrial chromosome is named "MT"
"""
import argparse
import gtfez
def parse_args():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument(
'gtf',
typ... | [
"gtfez.GTFRecord",
"argparse.FileType",
"argparse.ArgumentParser"
] | [((224, 268), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '__doc__'}), '(description=__doc__)\n', (247, 268), False, 'import argparse\n'), ((586, 607), 'gtfez.GTFRecord', 'gtfez.GTFRecord', (['line'], {}), '(line)\n', (601, 607), False, 'import gtfez\n'), ((322, 344), 'argparse.FileType',... |
# Copyright 2017-2019 Red Hat, Inc.
# 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 law... | [
"tscli.textoutput.TextOutputAPIs",
"click.argument",
"tscli.restapi.ConsumeAPIs",
"click.option",
"click.command"
] | [((700, 715), 'click.command', 'click.command', ([], {}), '()\n', (713, 715), False, 'import click\n'), ((717, 806), 'click.option', 'click.option', (['"""--server-url"""'], {'envvar': '"""TRANSTATS_SERVER"""', 'help': '"""Transtats Server URL"""'}), "('--server-url', envvar='TRANSTATS_SERVER', help=\n 'Transtats Se... |
# Filename: preprocessing.py
# Authors: apadin, mgkallit
# Start Date: 3/7/2017
# Last Update: 3/7/2017
"""Helper functions for preprocessing data
scale_features - Scale X matrix to put values in range of about -0.5 to 0.5
auto_regression - Adds n auto-regressive features to the X matrix
"""
#==========... | [
"numpy.concatenate",
"numpy.roll",
"numpy.nan_to_num"
] | [((616, 639), 'numpy.nan_to_num', 'np.nan_to_num', (['X_scaled'], {}), '(X_scaled)\n', (629, 639), True, 'import numpy as np\n'), ((783, 796), 'numpy.roll', 'np.roll', (['y', '(1)'], {}), '(y, 1)\n', (790, 796), True, 'import numpy as np\n'), ((826, 851), 'numpy.concatenate', 'np.concatenate', (['(X, y)', '(1)'], {}), ... |
from enum import IntEnum
from lib.importer import read_file
class Segment(IntEnum):
TOP=1
TOP_LEFT=2
TOP_RIGHT=3
MIDDLE=4
BOTTOM_LEFT=5
BOTTOM_RIGHT=6
BOTTOM=7
def part_a() -> int:
lines = read_file('day8', line_cb=lambda x: tuple(map(lambda y: y.split(), x.split(' | '))))
displ... | [
"lib.importer.read_file"
] | [((325, 371), 'lib.importer.read_file', 'read_file', (['"""day8_display"""'], {'line_filter_cb': 'bool'}), "('day8_display', line_filter_cb=bool)\n", (334, 371), False, 'from lib.importer import read_file\n')] |
# Generated by Django 3.1.7 on 2021-03-28 06:45
from django.db import migrations, models
import uuid
class Migration(migrations.Migration):
dependencies = [
('employees', '0002_auto_20210328_0030'),
]
operations = [
migrations.CreateModel(
name='Request',
fields=... | [
"django.db.models.DateTimeField",
"django.db.models.UUIDField",
"django.db.models.CharField"
] | [((347, 435), 'django.db.models.UUIDField', 'models.UUIDField', ([], {'default': 'uuid.uuid4', 'primary_key': '(True)', 'serialize': '(False)', 'unique': '(True)'}), '(default=uuid.uuid4, primary_key=True, serialize=False,\n unique=True)\n', (363, 435), False, 'from django.db import migrations, models\n'), ((459, 52... |
import time
import hashlib
import secrets
from rest_framework import viewsets
from rest_framework.permissions import AllowAny
from rest_framework.response import Response
from .serializers import ShortenerSerializer
from .models import Shortener
# Shortener Viewset
class ShortenerViewSet(viewsets.ModelViewSet):
... | [
"secrets.token_urlsafe",
"time.time"
] | [((843, 867), 'secrets.token_urlsafe', 'secrets.token_urlsafe', (['(8)'], {}), '(8)\n', (864, 867), False, 'import secrets\n'), ((671, 682), 'time.time', 'time.time', ([], {}), '()\n', (680, 682), False, 'import time\n')] |
#!/usr/bin/python
import datetime
import signal
import sys
import time
import RPi.GPIO as GPIO
from components import rebooter, rgb, pir, matrix, oled, continuousP1, joystick, writer, data
# Setup classes
###################################################################################################
debug = Fa... | [
"signal.signal",
"RPi.GPIO.cleanup",
"sys.exit",
"components.pir.PIR",
"datetime.datetime.utcnow",
"components.oled.OLED",
"components.data.Data",
"components.continuousP1.P1",
"time.sleep",
"components.joystick.Joystick",
"components.rgb.RGB",
"components.matrix.Matrix",
"components.writer.... | [((333, 344), 'components.data.Data', 'data.Data', ([], {}), '()\n', (342, 344), False, 'from components import rebooter, rgb, pir, matrix, oled, continuousP1, joystick, writer, data\n'), ((356, 376), 'components.matrix.Matrix', 'matrix.Matrix', (['_data'], {}), '(_data)\n', (369, 376), False, 'from components import r... |
import logging
import os
import sys
# Set up path so that tests can find SUT package
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
# Set up standadr logging config
_logger = logging.getLogger()
print()
if _logger is None:
_logger = logging.basicConfig()
print("Using new lo... | [
"logging.getLogger",
"logging.basicConfig",
"logging.StreamHandler",
"logging.Formatter",
"os.path.dirname"
] | [((213, 232), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (230, 232), False, 'import logging\n'), ((419, 442), 'logging.StreamHandler', 'logging.StreamHandler', ([], {}), '()\n', (440, 442), False, 'import logging\n'), ((275, 296), 'logging.basicConfig', 'logging.basicConfig', ([], {}), '()\n', (294, 29... |
# Copyright 2019 Atalaya Tech, 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 writing, ... | [
"bentoml.adapters.utils.get_default_accept_image_formats",
"bentoml.adapters.utils.check_file_extension"
] | [((3454, 3488), 'bentoml.adapters.utils.get_default_accept_image_formats', 'get_default_accept_image_formats', ([], {}), '()\n', (3486, 3488), False, 'from bentoml.adapters.utils import check_file_extension, get_default_accept_image_formats\n'), ((4464, 4527), 'bentoml.adapters.utils.check_file_extension', 'check_file_... |
from collections import defaultdict
#import MySQLdb # this is not available on windows for anaconda and python 3.4
from bs4 import BeautifulSoup
import operator
import os
from tornado.httpclient import AsyncHTTPClient
import tornado.ioloop
import tornado.web
from tornado.options import define, options
define("port", d... | [
"bs4.BeautifulSoup",
"os.path.dirname",
"collections.defaultdict",
"tornado.httpclient.AsyncHTTPClient",
"tornado.options.define",
"operator.itemgetter"
] | [((304, 372), 'tornado.options.define', 'define', (['"""port"""'], {'default': '(8888)', 'help': '"""run on the given port"""', 'type': 'int'}), "('port', default=8888, help='run on the given port', type=int)\n", (310, 372), False, 'from tornado.options import define, options\n'), ((642, 659), 'tornado.httpclient.Async... |
from typing import List
import hikari
import lightbulb
import tweepy
import os
with open("./secrets/twitter") as t:
_twitter = t.read().splitlines()
_twitter_api = _twitter[0]
_twitter_secret_api = _twitter[1]
_twitter_access = _twitter[2]
_twitter_access_secret = _twitter[3]
authenti... | [
"lightbulb.Plugin",
"tweepy.OAuth1UserHandler",
"lightbulb.option",
"tweepy.API",
"lightbulb.command",
"lightbulb.implements"
] | [((328, 418), 'tweepy.OAuth1UserHandler', 'tweepy.OAuth1UserHandler', (["os.environ['TWITTER_API']", "os.environ['TWITTER_API_SECRET']"], {}), "(os.environ['TWITTER_API'], os.environ[\n 'TWITTER_API_SECRET'])\n", (352, 418), False, 'import tweepy\n'), ((522, 572), 'tweepy.API', 'tweepy.API', (['authenticator'], {'wa... |
'''
<NAME>
Python version: 3.6
Conway's Game of life
'''
import numpy
import math
def get_generation(cells, generations):
#_ the direction of adjacent cells
adj = ((-2, -2), (-2, -1), (-2, 0), (-1, -2), (-1, 0),
(0, -2), (0, -1), (0, 0))
def status(cells, cur):
print("\n... | [
"numpy.full",
"numpy.random.randint"
] | [((2251, 2287), 'numpy.random.randint', 'numpy.random.randint', (['(2)'], {'size': '(3, 5)'}), '(2, size=(3, 5))\n', (2271, 2287), False, 'import numpy\n'), ((616, 664), 'numpy.full', 'numpy.full', (['(h + 2, w + 2)', '(-1)'], {'dtype': 'numpy.int8'}), '((h + 2, w + 2), -1, dtype=numpy.int8)\n', (626, 664), False, 'imp... |
import torch
import typing
def check_vector(x, name):
if not torch.is_tensor(x):
raise RuntimeError('{} needs to be a Tensor'.format(name))
if x.dim() != 1:
raise RuntimeError('{} needs to be a vector (one-dimensional Tensor)'.format(name))
def check_scalar(x, name):
if not torch.is_tens... | [
"torch.is_tensor",
"torch.zeros_like"
] | [((740, 759), 'torch.zeros_like', 'torch.zeros_like', (['x'], {}), '(x)\n', (756, 759), False, 'import torch\n'), ((1217, 1241), 'torch.is_tensor', 'torch.is_tensor', (['tensors'], {}), '(tensors)\n', (1232, 1241), False, 'import torch\n'), ((1421, 1445), 'torch.is_tensor', 'torch.is_tensor', (['tensors'], {}), '(tenso... |
import boto3
from boto3.dynamodb.conditions import Key
from pprint import pprint
def get_item():
"""Get item from the DynamoDB table."""
dynamo_db = boto3.resource("dynamodb")
table = dynamo_db.Table("devices")
response = table.query(KeyConditionExpression=Key("name").eq("core02-wdc01"))
for item ... | [
"boto3.resource",
"pprint.pprint",
"boto3.dynamodb.conditions.Key"
] | [((159, 185), 'boto3.resource', 'boto3.resource', (['"""dynamodb"""'], {}), "('dynamodb')\n", (173, 185), False, 'import boto3\n'), ((350, 362), 'pprint.pprint', 'pprint', (['item'], {}), '(item)\n', (356, 362), False, 'from pprint import pprint\n'), ((275, 286), 'boto3.dynamodb.conditions.Key', 'Key', (['"""name"""'],... |
'''
ArpSpoofer.py by <NAME> 1/2021
This script prforming an arp spoofing on the local newtwork.
It doing so by constantly sending 'is at' responses to the attacked
computer with our mac and the desired IP, so that the attacked computer thinks
that we are the ip we sent him.
'''
from time import sleep
import argparse
... | [
"netifaces.gateways",
"time.sleep",
"getmac.get_mac_address",
"argparse.ArgumentParser"
] | [((900, 905), 'getmac.get_mac_address', 'gma', ([], {}), '()\n', (903, 905), True, 'from getmac import get_mac_address as gma\n'), ((1383, 1403), 'netifaces.gateways', 'netifaces.gateways', ([], {}), '()\n', (1401, 1403), False, 'import netifaces\n'), ((2326, 2460), 'argparse.ArgumentParser', 'argparse.ArgumentParser',... |
import zmq
import sys
import math
import numpy
class Broker:
context = zmq.Context()
router = context.socket(zmq.ROUTER)
#poller = zmq.Poller()
p = 0
def __init__(self, n):
self.op = {"WorkDone":self.serverResponse, "serverFREE":self.serverFree}
self.router.bind("tcp://*:5000")
... | [
"math.ceil",
"math.floor",
"math.acos",
"math.sqrt",
"numpy.random.randint",
"zmq.Context"
] | [((77, 90), 'zmq.Context', 'zmq.Context', ([], {}), '()\n', (88, 90), False, 'import zmq\n'), ((3913, 3937), 'math.sqrt', 'math.sqrt', (['(x * x + y * y)'], {}), '(x * x + y * y)\n', (3922, 3937), False, 'import math\n'), ((4196, 4210), 'math.acos', 'math.acos', (['var'], {}), '(var)\n', (4205, 4210), False, 'import ma... |
from functools import partial
from typing import Any, List, Optional
import torch
from torch import nn
from torch.nn import functional as F
BATCH_NORM_MOMENTUM = 0.005
ENABLE_BIAS = True
activation_fn = nn.ELU()
class ASPPConv(nn.Sequential):
def __init__(self, in_channels: int, out_channels: int, dilation: int)... | [
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.Dropout",
"torch.nn.ModuleList",
"torch.nn.Conv2d",
"torch.nn.functional.interpolate",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.ELU",
"torch.cat"
] | [((205, 213), 'torch.nn.ELU', 'nn.ELU', ([], {}), '()\n', (211, 213), False, 'from torch import nn\n'), ((1018, 1083), 'torch.nn.functional.interpolate', 'F.interpolate', (['x'], {'size': 'size', 'mode': '"""bilinear"""', 'align_corners': '(False)'}), "(x, size=size, mode='bilinear', align_corners=False)\n", (1031, 108... |
from cv2 import cv2
import time
import pyautogui
import numpy as np
import mss
from os import listdir
# from run import getBackgroundText
import torch
from random import randint
# example_captcha_img = cv2.imread('images/example.png')
model = torch.hub.load('./captcha', 'custom', "captcha/bomb_captcha.pt", source='lo... | [
"os.listdir",
"torch.hub.load",
"mss.mss",
"random.randint",
"numpy.where",
"cv2.cv2.imread",
"pyautogui.moveTo",
"pyautogui.mouseUp",
"pyautogui.mouseDown",
"time.sleep",
"cv2.cv2.cvtColor",
"cv2.cv2.matchTemplate",
"cv2.cv2.groupRectangles"
] | [((245, 330), 'torch.hub.load', 'torch.hub.load', (['"""./captcha"""', '"""custom"""', '"""captcha/bomb_captcha.pt"""'], {'source': '"""local"""'}), "('./captcha', 'custom', 'captcha/bomb_captcha.pt', source='local'\n )\n", (259, 330), False, 'import torch\n'), ((1264, 1281), 'os.listdir', 'listdir', (['dir_name'], ... |
"""
yxf: Convert from XLSForm to YAML and back.
To convert an XLSForm to a YAML file: `python -m yxf form.xlsx`.
By default, the result will be called `form.yaml`, in other words, the same name
as the input file with the extension changed to `.yaml`. You can specify a
different output file name using the `--output ot... | [
"logging.getLogger",
"logging.basicConfig",
"collections.OrderedDict",
"strictyaml.as_document",
"argparse.ArgumentParser",
"openpyxl.load_workbook",
"re.match",
"markdown_it.MarkdownIt",
"openpyxl.Workbook"
] | [((641, 674), 'logging.getLogger', 'logging.getLogger', (['"""yxf.__main__"""'], {}), "('yxf.__main__')\n", (658, 674), False, 'import logging\n'), ((727, 752), 'collections.OrderedDict', 'collections.OrderedDict', ([], {}), '()\n', (750, 752), False, 'import collections\n'), ((2369, 2388), 'openpyxl.Workbook', 'openpy... |
from datetime import datetime
import xml.etree.ElementTree as ET
import unicodedata as ud
import enchant
import re
from stdnum import isbn
from stdnum import exceptions
# -----------------------------------------------------------------------------
def preprocessISBNString(inputISBN):
"""This function normalizes a g... | [
"re.sub",
"doctest.testmod",
"stdnum.isbn.to_isbn10",
"stdnum.isbn.to_isbn13"
] | [((1152, 1180), 're.sub', 're.sub', (['"""\\\\D"""', '""""""', 'inputISBN'], {}), "('\\\\D', '', inputISBN)\n", (1158, 1180), False, 'import re\n'), ((4141, 4158), 'doctest.testmod', 'doctest.testmod', ([], {}), '()\n', (4156, 4158), False, 'import doctest\n'), ((2947, 2976), 'stdnum.isbn.to_isbn10', 'isbn.to_isbn10', ... |
import sys
import h5py
import numpy as np
from pydata.increment import __next_index__
if 'pyslave' in sys.modules :
from pyslave import __slave_disp__ as disp
else:
disp = print
class createh5(h5py.File):
"""Create a new H5 file to save data.
Use the append_dataset to add data to the file."""... | [
"pyslave.__slave_disp__",
"h5py.File"
] | [((1502, 1511), 'pyslave.__slave_disp__', 'disp', (['msg'], {}), '(msg)\n', (1506, 1511), True, 'from pyslave import __slave_disp__ as disp\n'), ((1871, 1895), 'h5py.File', 'h5py.File', (['filename', '"""r"""'], {}), "(filename, 'r')\n", (1880, 1895), False, 'import h5py\n')] |
from mininet.topo import Topo
from mininet.net import Mininet
from mininet.node import CPULimitedHost
from mininet.link import TCLink
from mininet.log import setLogLevel
import time
import sys
import os
from gdb_log_utils import *
class GDPSimulationTopo(Topo):
def build(self, n, loss_rate=None):
switch = ... | [
"time.sleep",
"mininet.log.setLogLevel",
"sys.exit",
"os.system",
"mininet.net.Mininet"
] | [((740, 751), 'sys.exit', 'sys.exit', (['(2)'], {}), '(2)\n', (748, 751), False, 'import sys\n'), ((965, 984), 'mininet.log.setLogLevel', 'setLogLevel', (['"""info"""'], {}), "('info')\n", (976, 984), False, 'from mininet.log import setLogLevel\n'), ((1048, 1066), 'mininet.net.Mininet', 'Mininet', ([], {'topo': 'topo'}... |
"""Represent fhir entity."""
from os import stat
from anvil.transformers.fhir import make_workspace_id, make_identifier
import logging
INSTITUTES = []
class Organization:
"""Create fhir entity."""
class_name = "organization"
resource_type = "Organization"
@staticmethod
def slug(resource):
... | [
"logging.getLogger",
"anvil.transformers.fhir.make_identifier",
"anvil.transformers.fhir.make_workspace_id"
] | [((353, 380), 'anvil.transformers.fhir.make_workspace_id', 'make_workspace_id', (['resource'], {}), '(resource)\n', (370, 380), False, 'from anvil.transformers.fhir import make_workspace_id, make_identifier\n'), ((2194, 2220), 'anvil.transformers.fhir.make_identifier', 'make_identifier', (['institute'], {}), '(institut... |
import numpy as np
import cv2
from enum import Enum
class Models(Enum):
ssd_lite = 'ssd_lite'
tiny_yolo = 'tiny_yolo'
tf_lite = 'tf_lite'
def __str__(self):
return self.value
@staticmethod
def from_string(s):
try:
return Models[s]
except KeyError:
... | [
"numpy.radians",
"cv2.warpAffine",
"numpy.minimum",
"numpy.where",
"numpy.sin",
"numpy.append",
"numpy.array",
"numpy.argsort",
"numpy.zeros",
"numpy.cos",
"cv2.cvtColor",
"numpy.maximum",
"cv2.getRotationMatrix2D",
"cv2.resize",
"cv2.imread"
] | [((483, 505), 'cv2.imread', 'cv2.imread', (['image_path'], {}), '(image_path)\n', (493, 505), False, 'import cv2\n'), ((517, 555), 'cv2.cvtColor', 'cv2.cvtColor', (['image', 'cv2.COLOR_BGR2RGB'], {}), '(image, cv2.COLOR_BGR2RGB)\n', (529, 555), False, 'import cv2\n'), ((1412, 1429), 'numpy.radians', 'np.radians', (['th... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'Ui_ProprietorWindow.ui'
#
# Created by: PyQt5 UI code generator 5.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_ProprietorWindow(object):
def setupUi(self, ProprietorW... | [
"PyQt5.QtWidgets.QWidget",
"PyQt5.QtWidgets.QToolButton",
"PyQt5.QtWidgets.QTextEdit",
"PyQt5.QtWidgets.QLineEdit",
"PyQt5.QtWidgets.QComboBox",
"PyQt5.QtCore.QMetaObject.connectSlotsByName",
"PyQt5.QtWidgets.QFrame",
"PyQt5.QtCore.QRect",
"PyQt5.QtWidgets.QLabel",
"PyQt5.QtWidgets.QStackedWidget"... | [((511, 545), 'PyQt5.QtWidgets.QFrame', 'QtWidgets.QFrame', (['ProprietorWindow'], {}), '(ProprietorWindow)\n', (527, 545), False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((854, 883), 'PyQt5.QtWidgets.QWidget', 'QtWidgets.QWidget', (['self.frame'], {}), '(self.frame)\n', (871, 883), False, 'from PyQt5 import Q... |
import unittest
from qfilter import qfilter
class QFilterTest(unittest.TestCase):
def setUp(self):
pass
def test_filter_eq(self):
exp = qfilter(dict(field1__eq=2))
self.assertEqual('where "field1" = :field1__eq', exp.where)
self.assertEqual({'field1__eq': 2}, exp.data)
d... | [
"unittest.main",
"qfilter.qfilter"
] | [((6886, 6901), 'unittest.main', 'unittest.main', ([], {}), '()\n', (6899, 6901), False, 'import unittest\n'), ((4608, 4642), 'qfilter.qfilter', 'qfilter', (['param'], {'quote_fields': '(False)'}), '(param, quote_fields=False)\n', (4615, 4642), False, 'from qfilter import qfilter\n'), ((6557, 6597), 'qfilter.qfilter', ... |
# test_ss.py
import unittest
from SelectionSort import sortSS
class SelectionSortTest(unittest.TestCase):
def test_empty_array(self):
self.assertEqual(sortSS([]), [])
def test_one_value_array(self):
self.assertEqual(sortSS([2]), [2])
def test_sort1(self):
self.assertEqual(sortSS(... | [
"unittest.main",
"SelectionSort.sortSS"
] | [((794, 809), 'unittest.main', 'unittest.main', ([], {}), '()\n', (807, 809), False, 'import unittest\n'), ((165, 175), 'SelectionSort.sortSS', 'sortSS', (['[]'], {}), '([])\n', (171, 175), False, 'from SelectionSort import sortSS\n'), ((243, 254), 'SelectionSort.sortSS', 'sortSS', (['[2]'], {}), '([2])\n', (249, 254),... |
from time import time
__all__ = ["solve_nlopt_proxy"]
# ------------------------------------------------------------------------------
# Optimization
# ------------------------------------------------------------------------------
def solve_nlopt_proxy(topology, constraints, parameters, algorithm, iters, eps=None,... | [
"compas_cem.optimization.Optimizer",
"time.time"
] | [((2333, 2344), 'compas_cem.optimization.Optimizer', 'Optimizer', ([], {}), '()\n', (2342, 2344), False, 'from compas_cem.optimization import Optimizer\n'), ((2559, 2565), 'time.time', 'time', ([], {}), '()\n', (2563, 2565), False, 'from time import time\n'), ((2659, 2665), 'time.time', 'time', ([], {}), '()\n', (2663,... |
import warnings
class LogWrapper(object):
def __init__(self, logger, context):
self.logger = logger
self.context = context
def __call__(self, key, value):
warnings.warn(
"Calling context.iopipe.log() has been deprecated, use "
"context.iopipe.metric() instead"
... | [
"warnings.warn"
] | [((190, 302), 'warnings.warn', 'warnings.warn', (['"""Calling context.iopipe.log() has been deprecated, use context.iopipe.metric() instead"""'], {}), "(\n 'Calling context.iopipe.log() has been deprecated, use context.iopipe.metric() instead'\n )\n", (203, 302), False, 'import warnings\n')] |
from functools import partial
import torch.nn as nn
import torch.optim as optim
import torch.optim.lr_scheduler as lr_sched
from .fastai_optim import OptimWrapper
from .learning_schedules_fastai import CosineWarmupLR, OneCycle
class FusedOptimizer(optim.Optimizer):
def __init__(self, all_params, lr=None, weight... | [
"torch.optim.Adam",
"torch.optim.SGD",
"torch.optim.lr_scheduler.LambdaLR",
"functools.partial",
"torch.optim.AdamW"
] | [((3041, 3113), 'torch.optim.Adam', 'optim.Adam', (['params'], {'lr': 'optim_cfg.LR', 'weight_decay': 'optim_cfg.WEIGHT_DECAY'}), '(params, lr=optim_cfg.LR, weight_decay=optim_cfg.WEIGHT_DECAY)\n', (3051, 3113), True, 'import torch.optim as optim\n'), ((5139, 5199), 'torch.optim.lr_scheduler.LambdaLR', 'lr_sched.Lambda... |
from ebonite import Ebonite
from ebonite.runtime.debug import run_test_model_server
def main():
# create remote ebonite client from saved configuration
ebnt = Ebonite.from_config_file('client_config.json')
model = ebnt.get_model('add_one_model', 'my_task', 'my_project')
# run flask service with this... | [
"ebonite.runtime.debug.run_test_model_server",
"ebonite.Ebonite.from_config_file"
] | [((170, 216), 'ebonite.Ebonite.from_config_file', 'Ebonite.from_config_file', (['"""client_config.json"""'], {}), "('client_config.json')\n", (194, 216), False, 'from ebonite import Ebonite\n'), ((331, 359), 'ebonite.runtime.debug.run_test_model_server', 'run_test_model_server', (['model'], {}), '(model)\n', (352, 359)... |
from .astronomy_object_type import AstronomyObjectType
from .astronomy_day import AstronomyDay
from .astronomy_current import AstronomyCurrent
from libtad.common.exceptions import MalformedXMLException
import xml.etree.ElementTree as ET
from typing import List
class AstronomyObjectDetails:
"""
A class used to ... | [
"libtad.common.exceptions.MalformedXMLException"
] | [((1461, 1488), 'libtad.common.exceptions.MalformedXMLException', 'MalformedXMLException', (['name'], {}), '(name)\n', (1482, 1488), False, 'from libtad.common.exceptions import MalformedXMLException\n')] |
from django.conf.urls import url
from django.contrib import admin
from . import views
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^$', views.indexview.as_view(), name='index'),
url(r'^login/$', views.login, name='login'),
url(r'^logout/$', views.logout, name='logout'),
url(r'^register/'... | [
"django.conf.urls.url"
] | [((107, 138), 'django.conf.urls.url', 'url', (['"""^admin/"""', 'admin.site.urls'], {}), "('^admin/', admin.site.urls)\n", (110, 138), False, 'from django.conf.urls import url\n'), ((202, 244), 'django.conf.urls.url', 'url', (['"""^login/$"""', 'views.login'], {'name': '"""login"""'}), "('^login/$', views.login, name='... |
"""app.engagement.endpoints module"""
from uuid import UUID
from flask import Blueprint
from flask import request
from flask_restful import Api
from flask_restful import Resource
from app.engagement.schemas import EngagementSchema
from app.engagement.utils import create_engagement
from app.engagement.utils import upd... | [
"uuid.UUID",
"flask_restful.Api",
"app.engagement.schemas.EngagementSchema",
"app.engagement.utils.create_engagement",
"flask.Blueprint"
] | [((353, 386), 'flask.Blueprint', 'Blueprint', (['"""engagement"""', '__name__'], {}), "('engagement', __name__)\n", (362, 386), False, 'from flask import Blueprint\n'), ((404, 422), 'flask_restful.Api', 'Api', (['engagement_bp'], {}), '(engagement_bp)\n', (407, 422), False, 'from flask_restful import Api\n'), ((732, 76... |
from datetime import datetime
import numpy as np
import pandas as pd
from sklearn.utils import shuffle
from data_process import data_process_utils
from data_process.census_process.census_data_creation_config import census_data_creation
from data_process.census_process.census_degree_process_utils import consistentize_... | [
"data_process.data_process_utils.save_df_data",
"pandas.read_csv",
"datetime.datetime.utcnow",
"data_process.census_process.census_degree_process_utils.consistentize_census9495_columns",
"sklearn.utils.shuffle",
"data_process.data_process_utils.combine_src_tgt_data",
"numpy.concatenate",
"data_process... | [((2656, 2723), 'pandas.read_csv', 'pd.read_csv', (['data_path'], {'names': 'CENSUS_COLUMNS', 'skipinitialspace': '(True)'}), '(data_path, names=CENSUS_COLUMNS, skipinitialspace=True)\n', (2667, 2723), True, 'import pandas as pd\n'), ((3020, 3060), 'data_process.census_process.census_degree_process_utils.consistentize_... |
import torch
import torch.nn.functional as F
from .evaluator import Evaluator
class PIT2015Evaluator(Evaluator):
def get_scores(self):
self.model.eval()
self.data_loader.init_epoch()
n_dev_correct = 0
total_loss = 0
acc_total = 0
rel_total = 0
pre_total = 0... | [
"torch.max",
"torch.nn.functional.nll_loss"
] | [((892, 943), 'torch.nn.functional.nll_loss', 'F.nll_loss', (['scores', 'batch.label'], {'size_average': '(False)'}), '(scores, batch.label, size_average=False)\n', (902, 943), True, 'import torch.nn.functional as F\n'), ((608, 628), 'torch.max', 'torch.max', (['scores', '(1)'], {}), '(scores, 1)\n', (617, 628), False,... |
import math
from typing import Optional, Union, Tuple, List
import numpy as np
import torch
import torch.nn.functional as F
from torch import Tensor
from torch_geometric.utils.num_nodes import maybe_num_nodes
from torch_scatter import scatter, segment_csr, gather_csr
from torch_scatter.utils import broadcast
import ... | [
"torch.tanh",
"torch_geometric.utils.num_nodes.maybe_num_nodes",
"torch_scatter.utils.broadcast",
"torch.sigmoid",
"math.sqrt",
"torch.nn.functional.dropout",
"numpy.max",
"torch_scatter.scatter",
"torch_scatter.segment_csr",
"torch.cat",
"torch.tensor_split"
] | [((946, 973), 'torch.cat', 'torch.cat', (['tensors'], {'dim': 'dim'}), '(tensors, dim=dim)\n', (955, 973), False, 'import torch\n'), ((1591, 1628), 'torch.tensor_split', 'torch.tensor_split', (['input', '(2)'], {'dim': 'dim'}), '(input, 2, dim=dim)\n', (1609, 1628), False, 'import torch\n'), ((5872, 5904), 'torch_geome... |
#!/usr/bin/python
# Copyright 2016, <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | [
"repoxplorer.index.Connector",
"random.choice",
"random.randint"
] | [((1801, 1851), 'random.randint', 'random.randint', (['epoch_start', '(epoch_start + 1000000)'], {}), '(epoch_start, epoch_start + 1000000)\n', (1815, 1851), False, 'import random\n'), ((2305, 2357), 'random.randint', 'random.randint', (['(author_date + 1)', '(author_date + 10000)'], {}), '(author_date + 1, author_date... |
"""
Class that downloads historical data from
Yahoo and stores the requested values using
MongoDB.
"""
import requests
from enum import Enum
import datetime
import dataManagement
from dataManagement import DatabaseClient
class Frequency(Enum):
""" The frequency type for historical stock data. """
DAY = 0
... | [
"datetime.date",
"requests.get"
] | [((528, 553), 'datetime.date', 'datetime.date', (['(2015)', '(1)', '(2)'], {}), '(2015, 1, 2)\n', (541, 553), False, 'import datetime\n'), ((2417, 2434), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (2429, 2434), False, 'import requests\n')] |
"""Utility Functions about Instruments
"""
import numpy as np
from exojax.utils.constants import c
def R2STD(R):
""" compute Standard deveiation of Gaussian velocity distribution from spectral resolution
Args:
R: spectral resolution R
Returns:
beta (km/s) standard deviation of Gaussian v... | [
"numpy.linspace",
"numpy.log"
] | [((898, 927), 'numpy.linspace', 'np.linspace', (['(1000)', '(2000)', '(1000)'], {}), '(1000, 2000, 1000)\n', (909, 927), True, 'import numpy as np\n'), ((562, 584), 'numpy.log', 'np.log', (['(nu[-1] / nu[0])'], {}), '(nu[-1] / nu[0])\n', (568, 584), True, 'import numpy as np\n'), ((381, 392), 'numpy.log', 'np.log', (['... |
from jeweler.bracelet import bracelet_fc
def test_bracelet_fc():
help(bracelet_fc)
result = bracelet_fc(6, 3, [1, 2, 3])
print(type(result))
for i in result:
print(i)
print()
del result[2:]
for i in result:
print(i)
if __name__ == "__main__":
test_bracelet_fc()
| [
"jeweler.bracelet.bracelet_fc"
] | [((102, 130), 'jeweler.bracelet.bracelet_fc', 'bracelet_fc', (['(6)', '(3)', '[1, 2, 3]'], {}), '(6, 3, [1, 2, 3])\n', (113, 130), False, 'from jeweler.bracelet import bracelet_fc\n')] |
#!/usr/bin/env python3
import RPi.GPIO as GPIO
import sys
import time
from pathlib import Path
"""
Example usage:
sudo -u solarthing /opt/solarthing/other/rpi/gpio_1wire_reload.py 14 /sys/bus/w1/devices/28-0301a279f5ff/name /sys/bus/w1/devices/28-0301a279ffb2/name
I recommend using pin 17, but pin 14 works as long a... | [
"RPi.GPIO.cleanup",
"pathlib.Path",
"RPi.GPIO.setup",
"RPi.GPIO.output",
"time.sleep",
"RPi.GPIO.setmode"
] | [((514, 536), 'RPi.GPIO.setmode', 'GPIO.setmode', (['GPIO.BCM'], {}), '(GPIO.BCM)\n', (526, 536), True, 'import RPi.GPIO as GPIO\n'), ((683, 708), 'RPi.GPIO.setup', 'GPIO.setup', (['pin', 'GPIO.OUT'], {}), '(pin, GPIO.OUT)\n', (693, 708), True, 'import RPi.GPIO as GPIO\n'), ((713, 740), 'RPi.GPIO.output', 'GPIO.output'... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-12-09 02:40
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('bevim', '0005_merge'),
]
operations = [
mig... | [
"django.db.models.ForeignKey",
"django.db.models.AutoField",
"django.db.models.IntegerField"
] | [((425, 518), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (441, 518), False, 'from django.db import migrations, models\... |
"""
Exceptions for Arx!
"""
class WalrusJudgement(Exception):
WALRUSFACTS = [
"Walruses hook their tusks on ice to rest in water.",
"Walruses employ a tusk-based hierarchy; the bigger the better.",
"Breaking a tusk usually means a walrus drops in social status.",
"A mama walrus carr... | [
"random.choice"
] | [((1283, 1307), 'random.choice', 'choice', (['self.WALRUSFACTS'], {}), '(self.WALRUSFACTS)\n', (1289, 1307), False, 'from random import choice\n')] |
import numpy as np
import seaborn as sns
import torch
from torch import nn
from torch import optim
import torch.nn.functional as F
from torchvision import datasets, transforms, models
import torchvision.models as models
from PIL import Image
import json
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.... | [
"torch.nn.ReLU",
"torch.nn.Dropout",
"torch.max",
"torch.exp",
"torch.cuda.is_available",
"argparse.ArgumentParser",
"torchvision.datasets.ImageFolder",
"torchvision.transforms.ToTensor",
"torchvision.transforms.RandomResizedCrop",
"torchvision.transforms.RandomHorizontalFlip",
"torch.nn.NLLLoss... | [((6842, 6882), 'torch.save', 'torch.save', (['checkpoint', '"""checkpoint.pth"""'], {}), "(checkpoint, 'checkpoint.pth')\n", (6852, 6882), False, 'import torch\n'), ((6936, 6956), 'torch.load', 'torch.load', (['filepath'], {}), '(filepath)\n', (6946, 6956), False, 'import torch\n'), ((7263, 7288), 'argparse.ArgumentPa... |
# desktop news notifier
import feedparser
import notify2
import os
import time
def parseFeed():
f = feedparser.parse("https://theprint.in/category/defence/")
ICON_PATH = os.getcwd() + "/icon.ico"
notify2.init("News Notify")
for newsitem in f['items']:
n = notify2.Notification(newsitem... | [
"notify2.init",
"feedparser.parse",
"notify2.Notification",
"time.sleep",
"os.getcwd"
] | [((111, 168), 'feedparser.parse', 'feedparser.parse', (['"""https://theprint.in/category/defence/"""'], {}), "('https://theprint.in/category/defence/')\n", (127, 168), False, 'import feedparser\n'), ((217, 244), 'notify2.init', 'notify2.init', (['"""News Notify"""'], {}), "('News Notify')\n", (229, 244), False, 'import... |
from flask import Flask
def create_app():
app = Flask(__name__)
@app.route('/')
def root():
return ("<h1>Welcome to Sign-Lingo!</h1>")
return app | [
"flask.Flask"
] | [((58, 73), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (63, 73), False, 'from flask import Flask\n')] |
# coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | [
"numpy.log",
"ast.literal_eval",
"gin.configurable",
"tensorflow.compat.v1.constant",
"tensorflow.compat.v1.concat",
"tensorflow.compat.v1.Session"
] | [((1099, 1135), 'gin.configurable', 'gin.configurable', (['"""DistributionSpec"""'], {}), "('DistributionSpec')\n", (1115, 1135), False, 'import gin\n'), ((2695, 2730), 'ast.literal_eval', 'ast.literal_eval', (['distribution_spec'], {}), '(distribution_spec)\n', (2711, 2730), False, 'import ast\n'), ((5961, 5991), 'ten... |
from singlecellmultiomics.modularDemultiplexer.baseDemultiplexMethods import UmiBarcodeDemuxMethod
# Cell seq 1 with 6bp UMI
class CELSeq1_c8_u4(UmiBarcodeDemuxMethod):
def __init__(self, barcodeFileParser, **kwargs):
self.barcodeFileAlias = 'celseq1'
UmiBarcodeDemuxMethod.__init__(
se... | [
"singlecellmultiomics.modularDemultiplexer.baseDemultiplexMethods.UmiBarcodeDemuxMethod.__init__"
] | [((274, 539), 'singlecellmultiomics.modularDemultiplexer.baseDemultiplexMethods.UmiBarcodeDemuxMethod.__init__', 'UmiBarcodeDemuxMethod.__init__', (['self'], {'umiRead': '(0)', 'umiStart': '(8)', 'umiLength': '(4)', 'barcodeRead': '(0)', 'barcodeStart': '(0)', 'barcodeLength': '(8)', 'random_primer_read': '(1)', 'rando... |
from wtforms import validators
from wtforms.validators import DataRequired, ValidationError
from wtforms.fields.html5 import EmailField
from wtforms import StringField, PasswordField, SubmitField, BooleanField
from flask import flash
from flask_wtf import FlaskForm
import phonenumbers
class RegisterForm(FlaskForm):
... | [
"wtforms.validators.Email",
"phonenumbers.is_valid_number",
"flask.flash",
"wtforms.validators.ValidationError",
"wtforms.SubmitField",
"wtforms.validators.EqualTo",
"phonenumbers.parse",
"wtforms.validators.DataRequired"
] | [((946, 967), 'wtforms.SubmitField', 'SubmitField', (['"""Submit"""'], {}), "('Submit')\n", (957, 967), False, 'from wtforms import StringField, PasswordField, SubmitField, BooleanField\n'), ((534, 559), 'wtforms.validators.DataRequired', 'validators.DataRequired', ([], {}), '()\n', (557, 559), False, 'from wtforms imp... |
# Generated by Django 2.2.6 on 2021-07-12 11:42
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('posts', '0013_auto_20210... | [
"django.db.models.OneToOneField",
"django.db.models.DateField",
"django.db.models.UniqueConstraint",
"django.db.models.AutoField",
"django.db.models.ImageField",
"django.db.migrations.swappable_dependency"
] | [((227, 284), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (258, 284), False, 'from django.db import migrations, models\n'), ((832, 902), 'django.db.models.UniqueConstraint', 'models.UniqueConstraint', ([], {'fields':... |
from src.utils import distance
class Vehicle(object):
def __init__(self, id):
self.id = id
self.rides = []
self.position= (0,0)
self.time = 0
#position deve essere una lista di 2 interi (x,y)
def move(self, position):
self.time = distance(position, self.position)
... | [
"src.utils.distance"
] | [((285, 318), 'src.utils.distance', 'distance', (['position', 'self.position'], {}), '(position, self.position)\n', (293, 318), False, 'from src.utils import distance\n')] |
import conf
import bottle
import logbook
import hmac
import base64
import hashlib
from decimal import Decimal
from model import db, autocommit, Customer, CustomerCard
from api import post, AdminApi
from api.check_params import check_params
from api.validator import String, Bool, JSON, Money, Integer
from utils.i18n imp... | [
"hmac.new",
"model.Customer.get_by_id",
"utils.i18n._",
"model.CustomerCard.add_card",
"logbook.warning",
"bottle.request.body.read",
"api.post",
"logbook.info",
"api.check_params.check_params",
"bottle.request.headers.get",
"decimal.Decimal"
] | [((4462, 4499), 'api.post', 'post', (['"""payments/cloudpayments/check/"""'], {}), "('payments/cloudpayments/check/')\n", (4466, 4499), False, 'from api import post, AdminApi\n'), ((4505, 5008), 'api.check_params.check_params', 'check_params', ([], {'AccountId': 'String', 'Amount': 'Money', 'AuthCode': 'String', 'CardE... |
# coding=utf-8
# Copyright 2019 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | [
"numpy.eye",
"collections.namedtuple",
"numpy.allclose",
"math.sqrt",
"math.cos",
"numpy.stack",
"numpy.array",
"numpy.zeros",
"numpy.einsum",
"math.atan2",
"collections.Counter",
"collections.defaultdict",
"numpy.linalg.eigh",
"numpy.concatenate",
"numpy.dot",
"math.sin",
"numpy.zer... | [((1503, 1603), 'collections.namedtuple', 'collections.namedtuple', (['"""CanonicalizedSymmetry"""', "['u1s', 'semisimple_part', 'spin3_cartan_gens']"], {}), "('CanonicalizedSymmetry', ['u1s', 'semisimple_part',\n 'spin3_cartan_gens'])\n", (1525, 1603), False, 'import collections\n'), ((1982, 2041), 'collections.nam... |
#!/usr/bin/env python3
import argparse
import png
import numpy as np
import csv
from matplotlib import pyplot as plt
# map a scalar value to a color from a colormap
def map_to_color(scalar, colormap):
if scalar is None:
return None
# search in list to find scalar
lo = int(0)
hi = int(colormap.... | [
"numpy.flip",
"numpy.reshape",
"png.Reader",
"argparse.ArgumentParser",
"numpy.double",
"numpy.linalg.norm",
"numpy.floor",
"numpy.max",
"numpy.dot",
"csv.Sniffer",
"numpy.min",
"csv.reader"
] | [((2140, 2158), 'numpy.min', 'np.min', (['cmap[:, 0]'], {}), '(cmap[:, 0])\n', (2146, 2158), True, 'import numpy as np\n'), ((2174, 2192), 'numpy.max', 'np.max', (['cmap[:, 0]'], {}), '(cmap[:, 0])\n', (2180, 2192), True, 'import numpy as np\n'), ((3308, 3328), 'png.Reader', 'png.Reader', (['filename'], {}), '(filename... |
from tests.utils import W3CTestCase
class TestFlexbox_Flex01N(W3CTestCase):
vars().update(W3CTestCase.find_tests(__file__, 'flexbox_flex-0-1-N'))
| [
"tests.utils.W3CTestCase.find_tests"
] | [((95, 149), 'tests.utils.W3CTestCase.find_tests', 'W3CTestCase.find_tests', (['__file__', '"""flexbox_flex-0-1-N"""'], {}), "(__file__, 'flexbox_flex-0-1-N')\n", (117, 149), False, 'from tests.utils import W3CTestCase\n')] |
# Copyright (c) 2020, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for details.
from __fu... | [
"ansible_collections.oracle.oci.plugins.module_utils.oci_common_utils.convert_input_data_to_model_class",
"ansible_collections.oracle.oci.plugins.module_utils.oci_config_utils.create_service_client"
] | [((2738, 2807), 'ansible_collections.oracle.oci.plugins.module_utils.oci_config_utils.create_service_client', 'oci_config_utils.create_service_client', (['self.module', 'MonitoringClient'], {}), '(self.module, MonitoringClient)\n', (2776, 2807), False, 'from ansible_collections.oracle.oci.plugins.module_utils import oc... |
import numpy as np
from sdia_python.lab2.utils import get_random_number_generator
class BallWindow:
"""Represents a ball in any dimension, defined by a center and a radius"""
def __init__(self, center, radius):
"""Initializes a ball with a center and a radius. The radius must be positive.
A... | [
"numpy.product",
"sdia_python.lab2.utils.get_random_number_generator",
"numpy.array",
"numpy.linalg.norm",
"numpy.all",
"numpy.math.factorial"
] | [((478, 494), 'numpy.array', 'np.array', (['center'], {}), '(center)\n', (486, 494), True, 'import numpy as np\n'), ((1139, 1154), 'numpy.array', 'np.array', (['point'], {}), '(point)\n', (1147, 1154), True, 'import numpy as np\n'), ((2342, 2387), 'numpy.all', 'np.all', (['[(point in self) for point in points]'], {}), ... |
import logging
from functools import partial
from pprint import pprint
from random import randint
from unittest import TestCase
from foxylib.tools.log.foxylib_logger import FoxylibLogger
from foxylib.tools.random.random_tool import RandomTool
class TestRandomTool(TestCase):
@classmethod
def setUpClass(cls):
... | [
"foxylib.tools.log.foxylib_logger.FoxylibLogger.attach_stderr2loggers",
"random.randint",
"foxylib.tools.log.foxylib_logger.FoxylibLogger.func_level2logger",
"pprint.pprint"
] | [((328, 378), 'foxylib.tools.log.foxylib_logger.FoxylibLogger.attach_stderr2loggers', 'FoxylibLogger.attach_stderr2loggers', (['logging.DEBUG'], {}), '(logging.DEBUG)\n', (363, 378), False, 'from foxylib.tools.log.foxylib_logger import FoxylibLogger\n'), ((420, 480), 'foxylib.tools.log.foxylib_logger.FoxylibLogger.func... |
# -*- coding: utf-8 -*-
"""
Built-in predicate checkers.
This is mostly took from repoze.what.precidates
This is module provides the predicate checkers that were present in the
original "identity" framework of TurboGears 1, plus others.
"""
from __future__ import unicode_literals
from tg import request
from tg._com... | [
"tg._compat.unicode_text",
"repoze.what.predicates.NotAuthorizedError"
] | [((1989, 2010), 'tg._compat.unicode_text', 'unicode_text', (['message'], {}), '(message)\n', (2001, 2010), False, 'from tg._compat import unicode_text\n'), ((2201, 2247), 'repoze.what.predicates.NotAuthorizedError', 'NotAuthorizedError', (['(message % all_placeholders)'], {}), '(message % all_placeholders)\n', (2219, 2... |
# -*- coding:utf-8 -*-
# Copyright 2015 NEC Corporation. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# you may not use this file except in compliance with the License... | [
"org.o3project.odenos.remoteobject.message.response.Response",
"mock.patch",
"mock.Mock",
"unittest.main",
"org.o3project.odenos.core.util.remote_object_interface.RemoteObjectInterface"
] | [((17701, 17716), 'unittest.main', 'unittest.main', ([], {}), '()\n', (17714, 17716), False, 'import unittest\n'), ((1442, 1448), 'mock.Mock', 'Mock', ([], {}), '()\n', (1446, 1448), False, 'from mock import Mock, patch\n'), ((1531, 1586), 'org.o3project.odenos.core.util.remote_object_interface.RemoteObjectInterface', ... |
from soccerdepth.data.dataset_loader import get_set
import numpy as np
import utils.files as file_utils
from os.path import join
import argparse
from soccerdepth.models.hourglass import hg8
from soccerdepth.models.utils import weights_init
from soccerdepth.data.data_utils import image_logger_converter_visdom
import to... | [
"torch.from_numpy",
"utils.files.get_platform_datadir",
"torch.cuda.is_available",
"soccerdepth.data.data_utils.image_logger_converter_visdom",
"soccerdepth.models.hourglass.hg8",
"visdom.Visdom",
"argparse.ArgumentParser",
"torch.autograd.Variable",
"numpy.ones",
"torch.Tensor",
"torch.nn.NLLLo... | [((607, 640), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (630, 640), False, 'import warnings\n'), ((652, 708), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Depth AutoEncoder"""'}), "(description='Depth AutoEncoder')\n", (675, 708), Fal... |
import pyautogui
from time import sleep
import wmi
import datetime
from playsound import playsound
import os
state = ["Speaking..."]
chat = []
chat_prev = []
def listToString(query):
# initialize an empty string
str = ""
# traverse in the string
for ele in query:
str += ele
... | [
"pyautogui.press",
"playsound.playsound",
"wmi.WMI",
"time.sleep",
"os.getcwd",
"datetime.datetime.now"
] | [((376, 405), 'pyautogui.press', 'pyautogui.press', (['"""volumemute"""'], {}), "('volumemute')\n", (391, 405), False, 'import pyautogui\n'), ((478, 507), 'pyautogui.press', 'pyautogui.press', (['"""volumemute"""'], {}), "('volumemute')\n", (493, 507), False, 'import pyautogui\n'), ((1113, 1121), 'time.sleep', 'sleep',... |
from __future__ import absolute_import
import logging
import requests
import json
from minemeld.ft.basepoller import BasePollerFT
LOG = logging.getLogger(__name__)
class IPv4(BasePollerFT):
def configure(self):
super(IPv4, self).configure()
self.polling_timeout = self.config.get('polling_timeou... | [
"logging.getLogger",
"json.loads",
"requests.get"
] | [((138, 165), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (155, 165), False, 'import logging\n'), ((1167, 1189), 'requests.get', 'requests.get', (['self.url'], {}), '(self.url)\n', (1179, 1189), False, 'import requests\n'), ((2563, 2585), 'requests.get', 'requests.get', (['self.url'], ... |
# https://leetcode.com/problems/sliding-window-maximum/
#
# algorithms
# Hard (37.06%)
# Total Accepted: 137,871
# Total Submissions: 372,038
# beats 79.21% of python submissions
from collections import deque
class Solution(object):
def maxSlidingWindow(self, nums, k):
"""
:type nums: List[int... | [
"collections.deque"
] | [((397, 404), 'collections.deque', 'deque', ([], {}), '()\n', (402, 404), False, 'from collections import deque\n')] |
import time
def parametrized(dec):
def layer(*args, **kwargs):
def repl(f):
return dec(f, *args, **kwargs)
return repl
return layer
@parametrized
def timer(func, note):
def wrapper(*args, **kwargs):
t1 = time.time()
result = func(*args, **kwargs)
t2 = time.ti... | [
"time.time"
] | [((259, 270), 'time.time', 'time.time', ([], {}), '()\n', (268, 270), False, 'import time\n'), ((313, 324), 'time.time', 'time.time', ([], {}), '()\n', (322, 324), False, 'import time\n')] |
from flask import Blueprint, jsonify, flash
import requests, math
from urllib.parse import urljoin, urlparse
import datetime
import uuid
from flask import current_app, g
from flask_babel import format_number,gettext,format_decimal, format_currency, format_percent
from flask import Flask, render_template, redirect, r... | [
"flask.render_template",
"flask.request.args.get",
"requests.post",
"flask_babel.format_number",
"annotator.description.Description._get_Descriptions",
"website.languages.getLanguagesList",
"annotator.annotation.Annotation._get_by_multiple",
"flask_babel.format_currency",
"annotator.description.Desc... | [((739, 810), 'flask.Blueprint', 'Blueprint', (['"""authInterlink"""', '__name__'], {'template_folder': '"""./gui/templates"""'}), "('authInterlink', __name__, template_folder='./gui/templates')\n", (748, 810), False, 'from flask import Blueprint, jsonify, flash\n'), ((853, 865), 'uuid.uuid4', 'uuid.uuid4', ([], {}), '... |
import traceback
import json
import copy
import sys
from dateutil import parser as datetimeparser
from urllib import parse
from cinp.common import URI, doccstring_prep
from cinp.readers import READER_REGISTRY
__CINP_VERSION__ = '0.9'
__MULTI_URI_MAX__ = 100
FIELD_TYPE_LIST = ( 'String', 'Integer', 'Float', 'Boolean'... | [
"dateutil.parser.parse",
"json.loads",
"traceback.format_exc",
"urllib.parse.urlparse",
"datetime.datetime.utcnow",
"traceback.print_exception",
"cinp.readers.READER_REGISTRY.get",
"cinp.common.URI",
"copy.deepcopy",
"cinp.common.doccstring_prep"
] | [((2250, 2326), 'traceback.print_exception', 'traceback.print_exception', (['None', 'exception', 'exception.__traceback__'], {'file': 'fp'}), '(None, exception, exception.__traceback__, file=fp)\n', (2275, 2326), False, 'import traceback\n'), ((10453, 10473), 'cinp.common.doccstring_prep', 'doccstring_prep', (['doc'], ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for novice submodule.
:license: modified BSD
"""
import os, tempfile
import numpy as np
from image_novice import novice
from numpy.testing import TestCase, assert_equal, assert_raises, assert_allclose
def _array_2d_to_RGB(array):
return np.tile(array[:, :, n... | [
"numpy.tile",
"numpy.testing.assert_equal",
"numpy.testing.assert_allclose",
"numpy.testing.assert_raises",
"os.path.abspath",
"numpy.zeros",
"image_novice.novice.new",
"numpy.linspace",
"tempfile.NamedTemporaryFile",
"image_novice.novice.open",
"image_novice.novice.Picture",
"image_novice.nov... | [((299, 342), 'numpy.tile', 'np.tile', (['array[:, :, np.newaxis]', '(1, 1, 3)'], {}), '(array[:, :, np.newaxis], (1, 1, 3))\n', (306, 342), True, 'import numpy as np\n'), ((483, 512), 'image_novice.novice.open', 'novice.open', (['self.sample_path'], {}), '(self.sample_path)\n', (494, 512), False, 'from image_novice im... |
import sys
import os
import argparse
import unittest
import warnings
import contextlib
import numpy as np
import numpy.testing as nptest
import unittest
import ants
import superiq
def run_tests():
unittest.main()
class TestModule_super_resolution_segmentation_per_label(unittest.TestCase):
def test_super_reso... | [
"ants.threshold_image",
"superiq.super_resolution_segmentation_per_label",
"superiq.sort_library_by_similarity",
"ants.kmeans_segmentation",
"ants.get_ants_data",
"ants.get_data",
"ants.add_noise_to_image",
"ants.iMath",
"ants.registration",
"numpy.floor",
"numpy.zeros",
"unittest.main",
"an... | [((203, 218), 'unittest.main', 'unittest.main', ([], {}), '()\n', (216, 218), False, 'import unittest\n'), ((399, 427), 'numpy.zeros', 'np.zeros', (['(size, size, size)'], {}), '((size, size, size))\n', (407, 427), True, 'import numpy as np\n'), ((858, 877), 'ants.from_numpy', 'ants.from_numpy', (['AA'], {}), '(AA)\n',... |
import numpy as np
import threading
import queue
import time
from common import gtec
import matplotlib.pyplot as plt
from common.config import *
class Recorder:
def __init__(
self,
sample_duration=SAMPLE_DURATION,
num_channels=2,
channel_offset=0,
signal_type="emg",
):
... | [
"common.gtec.GUSBamp",
"matplotlib.pyplot.figure",
"numpy.zeros",
"matplotlib.pyplot.tight_layout",
"threading.Thread",
"queue.Queue",
"time.time",
"matplotlib.pyplot.show"
] | [((3165, 3193), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(12, 10)'}), '(figsize=(12, 10))\n', (3175, 3193), True, 'import matplotlib.pyplot as plt\n'), ((3619, 3637), 'matplotlib.pyplot.tight_layout', 'plt.tight_layout', ([], {}), '()\n', (3635, 3637), True, 'import matplotlib.pyplot as plt\n'), ((36... |
"""
Present or validate a form for getting a username
and password.
"""
import Cookie
import logging
from tiddlyweb.web.challengers import ChallengerInterface
from tiddlyweb.web.util import server_host_url
from tiddlyweb.model.user import User
from tiddlyweb.store import NoUserError
from sha import sha
class Challe... | [
"tiddlyweb.web.util.server_host_url",
"tiddlyweb.model.user.User",
"logging.debug",
"Cookie.SimpleCookie",
"sha.sha"
] | [((2647, 2661), 'tiddlyweb.model.user.User', 'User', (['username'], {}), '(username)\n', (2651, 2661), False, 'from tiddlyweb.model.user import User\n'), ((2836, 2857), 'Cookie.SimpleCookie', 'Cookie.SimpleCookie', ([], {}), '()\n', (2855, 2857), False, 'import Cookie\n'), ((3118, 3150), 'logging.debug', 'logging.debug... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2021 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# Chromium OS Dependencies:
# shred --> sys-apps/coreutils
# mogrify --> media-gfx/imagemagick
#... | [
"logging.getLogger",
"tempfile.TemporaryDirectory",
"os.path.exists",
"logging.StreamHandler",
"argparse.ArgumentParser",
"os.makedirs",
"shutil.which",
"os.path.splitext",
"os.chmod",
"os.path.isfile",
"os.path.isdir",
"os.system",
"gnupg.GPG",
"glob.glob",
"os.remove"
] | [((2203, 2222), 'os.path.isdir', 'os.path.isdir', (['path'], {}), '(path)\n', (2216, 2222), False, 'import os\n'), ((2770, 2793), 'logging.StreamHandler', 'logging.StreamHandler', ([], {}), '()\n', (2791, 2793), False, 'import logging\n'), ((2802, 2828), 'logging.getLogger', 'logging.getLogger', (['"""gnupg"""'], {}), ... |
"""Misc Target passes."""
import cgen
from devito.ir.iet import (Iteration, List, Prodder, FindSymbols, FindNodes,
Transformer, filter_iterations, retrieve_iteration_tree)
from devito.logger import perf_adv
from devito.targets.common.blocking import BlockDimension
from devito.targets.common... | [
"devito.ir.iet.filter_iterations",
"devito.ir.iet.Transformer",
"devito.logger.perf_adv",
"devito.ir.iet.retrieve_iteration_tree",
"cgen.Comment",
"devito.ir.iet.List",
"devito.ir.iet.FindNodes",
"devito.ir.iet.FindSymbols",
"cgen.Statement"
] | [((2645, 2673), 'devito.ir.iet.retrieve_iteration_tree', 'retrieve_iteration_tree', (['iet'], {}), '(iet)\n', (2668, 2673), False, 'from devito.ir.iet import Iteration, List, Prodder, FindSymbols, FindNodes, Transformer, filter_iterations, retrieve_iteration_tree\n'), ((764, 822), 'cgen.Comment', 'cgen.Comment', (['"""... |
"""
版本: 1.8.0+
"""
from datetime import datetime, time
from typing import Any, Container
from nonebot.permission import SenderRoles
from nonebot.typing import PermissionPolicy_T
def simple_allow_list(*, user_ids: Container[int] = ...,
group_ids: Container[int] = ...,
rever... | [
"datetime.datetime.now"
] | [((1991, 2012), 'datetime.datetime.now', 'datetime.now', (['tz_info'], {}), '(tz_info)\n', (2003, 2012), False, 'from datetime import datetime, time\n')] |
"""
Licensed Materials - Property of IBM
Restricted Materials of IBM
20190891
© Copyright IBM Corp. 2021 All Rights Reserved.
"""
import logging
import joblib
import numpy as np
from sklearn.cluster import KMeans
from sklearn.exceptions import NotFittedError
from ibmfl.util import config
from ibmfl.model.sklearn_fl_mo... | [
"logging.getLogger",
"ibmfl.util.config.get_absolute_path",
"ibmfl.exceptions.ModelException",
"ibmfl.exceptions.LocalTrainingException",
"numpy.array",
"joblib.load",
"ibmfl.model.model_update.ModelUpdate"
] | [((509, 536), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (526, 536), False, 'import logging\n'), ((5209, 5246), 'ibmfl.model.model_update.ModelUpdate', 'ModelUpdate', ([], {'weights': 'cluster_centers_'}), '(weights=cluster_centers_)\n', (5220, 5246), False, 'from ibmfl.model.model_up... |
import serverfetch
serverfetch.wsite = "https://crap.com"
print(serverfetch.get()) | [
"serverfetch.get"
] | [((64, 81), 'serverfetch.get', 'serverfetch.get', ([], {}), '()\n', (79, 81), False, 'import serverfetch\n')] |
import csv
import sys
import pandas as pd
import os
import glob
import time
import numpy as np
from datetime import datetime
import statistics
import error
from elaboratedata import *
from sklearn.metrics import confusion_matrix, matthews_corrcoef
from math import ceil
SLEEP=10
#check if attack file exists
def attack... | [
"numpy.tile",
"math.ceil",
"numpy.argmax",
"time.sleep",
"os.path.isfile",
"numpy.sum",
"numpy.array",
"numpy.empty",
"os.system",
"numpy.save",
"sklearn.metrics.matthews_corrcoef",
"numpy.load"
] | [((1515, 1545), 'numpy.argmax', 'np.argmax', (['pred_normal'], {'axis': '(1)'}), '(pred_normal, axis=1)\n', (1524, 1545), True, 'import numpy as np\n'), ((1583, 1613), 'numpy.argmax', 'np.argmax', (['predictions'], {'axis': '(1)'}), '(predictions, axis=1)\n', (1592, 1613), True, 'import numpy as np\n'), ((1649, 1674), ... |
"""
Fabric is used to deploy changes and run tasks on the remote staging and
production environments.
"""
import json
import os
import shutil
import zipfile
import botocore.exceptions
import botocore.session
from fabric import Connection
from fabric import SerialGroup as Group
from fabric import task
from invoke.exce... | [
"os.path.exists",
"fabric.SerialGroup",
"os.path.join",
"patchwork.files.exists",
"invoke.exceptions.Exit",
"fabric.task"
] | [((1326, 1348), 'fabric.task', 'task', ([], {'aliases': "['stag']"}), "(aliases=['stag'])\n", (1330, 1348), False, 'from fabric import task\n'), ((1410, 1432), 'fabric.task', 'task', ([], {'aliases': "['prod']"}), "(aliases=['prod'])\n", (1414, 1432), False, 'from fabric import task\n'), ((6296, 6320), 'fabric.task', '... |
from statistics import median
class Math_Stuff_Class:
def Median(_list):
ret = median(_list)
return ret
def Square(_list):
ret = []
for i in _list:
ret.append(i * i)
return ret
def Times_Table(_num):
for x in range(1, 13):
print(str(_... | [
"statistics.median"
] | [((92, 105), 'statistics.median', 'median', (['_list'], {}), '(_list)\n', (98, 105), False, 'from statistics import median\n')] |
import os
import site
import sys
import sysconfig
from pkg_resources import WorkingSet
from setuptools.command.easy_install import ScriptWriter
def write_script(script_name, content, envbindir):
print(f"Installing {script_name} script to {envbindir}")
target = os.path.join(envbindir, script_name)
with op... | [
"os.path.join",
"sysconfig.get_path",
"pkg_resources.WorkingSet",
"site.getsitepackages",
"setuptools.command.easy_install.ScriptWriter.best",
"os.path.relpath"
] | [((272, 308), 'os.path.join', 'os.path.join', (['envbindir', 'script_name'], {}), '(envbindir, script_name)\n', (284, 308), False, 'import os\n'), ((563, 592), 'sysconfig.get_path', 'sysconfig.get_path', (['"""scripts"""'], {}), "('scripts')\n", (581, 592), False, 'import sysconfig\n'), ((609, 637), 'os.path.relpath', ... |
import numpy as np
from sklearn.pipeline import Pipeline
from sklearn import clone
from sklearn.metrics import accuracy_score
from sklearn.preprocessing import StandardScaler
from boxcox.optimization import Optimizer
from scipy.stats import boxcox
class Gridsearch2D(Optimizer):
"""
Optimization of the lambda ... | [
"numpy.copy",
"scipy.stats.boxcox",
"sklearn.preprocessing.StandardScaler",
"numpy.linspace",
"sklearn.clone",
"sklearn.metrics.accuracy_score"
] | [((1136, 1214), 'numpy.linspace', 'np.linspace', ([], {'start': 'self.lower_bound', 'stop': 'self.upper_bound', 'num': 'self.nr_points'}), '(start=self.lower_bound, stop=self.upper_bound, num=self.nr_points)\n', (1147, 1214), True, 'import numpy as np\n'), ((1233, 1311), 'numpy.linspace', 'np.linspace', ([], {'start': ... |