code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
"""Core functions."""
from functools import wraps
def singleton(cls):
"""Ensure singleton instance."""
instances = {}
@wraps(cls)
def instance(*args, **kwargs):
"""Create class instance."""
if cls not in instances:
instances[cls] = cls(*args, **kwargs)
return insta... | [
"functools.wraps"
] | [((134, 144), 'functools.wraps', 'wraps', (['cls'], {}), '(cls)\n', (139, 144), False, 'from functools import wraps\n')] |
import sys
sys.path.insert(0,'..')
import unittest
import sniplink
from helpers.expires import expires
test_id = ""
class TestLinkEndpoint(unittest.TestCase):
client = sniplink.Client()
test_expires_in = expires()
test_url = "https://github.com/billyeatcookies/sniplink.py"
def test_create_link(se... | [
"helpers.expires.expires",
"sniplink.Client",
"sys.path.insert"
] | [((11, 35), 'sys.path.insert', 'sys.path.insert', (['(0)', '""".."""'], {}), "(0, '..')\n", (26, 35), False, 'import sys\n'), ((177, 194), 'sniplink.Client', 'sniplink.Client', ([], {}), '()\n', (192, 194), False, 'import sniplink\n'), ((218, 227), 'helpers.expires.expires', 'expires', ([], {}), '()\n', (225, 227), Fal... |
import matplotlib.pyplot as plt
import matplotlib as mpl
import pandas as pd
import numpy as np
def dntrack(df: pd.DataFrame,
rho: (list,str) = None,
ntr: (list,str) = None,
lims: list = None,
lime: bool = False,
dtick: bool =False,
fill: bool =T... | [
"matplotlib.pyplot.gca",
"numpy.linspace",
"numpy.arange"
] | [((2137, 2146), 'matplotlib.pyplot.gca', 'plt.gca', ([], {}), '()\n', (2144, 2146), True, 'import matplotlib.pyplot as plt\n'), ((3020, 3066), 'numpy.linspace', 'np.linspace', (['lims[0]', 'lims[1]', 'grid_numbers[0]'], {}), '(lims[0], lims[1], grid_numbers[0])\n', (3031, 3066), True, 'import numpy as np\n'), ((3086, 3... |
import numpy
import pylab
import random
n = 100000
x = numpy.zeros(n)
y = numpy.zeros(n)
for i in range(1, n):
ran = random.randint(1, 4)
if ran == 1: # rechts
x[i] = x[i - 1] + 1
y[i] = y[i - 1]
elif ran == 2:
x[i] = x[i - 1] - 1
y[i] = y[i - 1]
elif ran == 3:
x[i] = x[i - 1]
y[i] = y[i - 1] + 1
el... | [
"pylab.title",
"pylab.plot",
"numpy.zeros",
"random.randint",
"pylab.show"
] | [((56, 70), 'numpy.zeros', 'numpy.zeros', (['n'], {}), '(n)\n', (67, 70), False, 'import numpy\n'), ((75, 89), 'numpy.zeros', 'numpy.zeros', (['n'], {}), '(n)\n', (86, 89), False, 'import numpy\n'), ((364, 395), 'pylab.title', 'pylab.title', (['"""2D Random Walker"""'], {}), "('2D Random Walker')\n", (375, 395), False,... |
#!flask/bin/python
import os
import datetime
import logging
import json
from threading import Thread
from typing import Dict
import requests
from dotenv import load_dotenv
from flask import Flask, request, abort, jsonify
from querry_sender import try_send_querry_data
from email_sender import send_mail
from database im... | [
"logging.basicConfig",
"requests.post",
"database.DatabaseHandler",
"email_sender.send_mail",
"flask.Flask",
"os.getenv",
"json.dumps",
"dotenv.load_dotenv",
"datetime.datetime.now",
"querry_sender.try_send_querry_data",
"helper.generate_headers_and_urls",
"flask.abort",
"threading.Thread",
... | [((387, 400), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (398, 400), False, 'from dotenv import load_dotenv\n'), ((408, 423), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (413, 423), False, 'from flask import Flask, request, abort, jsonify\n'), ((424, 463), 'logging.basicConfig', 'logging.bas... |
# Generated by Django 3.1.3 on 2021-05-16 13:27
import datetime
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('Exp_Sub', '0005_auto_20210516_1527'),
('Lab_Dash', '0005_auto_20210516_1527'),
('Exp_Main', ... | [
"datetime.datetime",
"django.db.models.OneToOneField",
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.ManyToManyField"
] | [((522, 572), 'datetime.datetime', 'datetime.datetime', (['(2021)', '(5)', '(16)', '(15)', '(27)', '(22)', '(850169)'], {}), '(2021, 5, 16, 15, 27, 22, 850169)\n', (539, 572), False, 'import datetime\n'), ((746, 796), 'datetime.datetime', 'datetime.datetime', (['(2021)', '(5)', '(16)', '(15)', '(27)', '(22)', '(850169)... |
from app.models import db, ma
class School(db.Model):
"""School
This table stores the configuration for each individual school.
Schools are addressed through their short name.
"""
__tablename__ = 'school'
id = db.Column(db.Integer, primary_key=True, unique=True, nullable=False)
school_n... | [
"app.models.db.String",
"app.models.db.Column"
] | [((238, 306), 'app.models.db.Column', 'db.Column', (['db.Integer'], {'primary_key': '(True)', 'unique': '(True)', 'nullable': '(False)'}), '(db.Integer, primary_key=True, unique=True, nullable=False)\n', (247, 306), False, 'from app.models import db, ma\n'), ((598, 647), 'app.models.db.Column', 'db.Column', (['db.Integ... |
# pylint: disable=missing-docstring
from distutils.core import setup
setup(
name='noticast-iot-core',
version='0.1-dev',
packages=['noticast'],
install_requires=['AWSIoTPythonSDK', 'requests', 'raven'])
| [
"distutils.core.setup"
] | [((70, 206), 'distutils.core.setup', 'setup', ([], {'name': '"""noticast-iot-core"""', 'version': '"""0.1-dev"""', 'packages': "['noticast']", 'install_requires': "['AWSIoTPythonSDK', 'requests', 'raven']"}), "(name='noticast-iot-core', version='0.1-dev', packages=['noticast'],\n install_requires=['AWSIoTPythonSDK',... |
import matplotlib as mpl
from matplotlib import pyplot as plt
from matplotlib.patches import Circle
import matplotlib.patches as patches
from . import field_info as f
def draw_field(axis=plt.gca()):
mpl.rcParams['lines.linewidth'] = 2.33513514 # was 2 before
ax = axis
# draw field background
ax.ad... | [
"matplotlib.pyplot.gca",
"matplotlib.patches.Rectangle",
"matplotlib.patches.Circle"
] | [((190, 199), 'matplotlib.pyplot.gca', 'plt.gca', ([], {}), '()\n', (197, 199), True, 'from matplotlib import pyplot as plt\n'), ((337, 472), 'matplotlib.patches.Rectangle', 'patches.Rectangle', (['(-f.x_field_length / 2, -f.y_field_length / 2)', 'f.x_field_length', 'f.y_field_length'], {'facecolor': '"""green"""', 'zo... |
import numpy as np
import dynet as dy
from xnmt.modelparts.transforms import Linear
from xnmt.persistence import serializable_init, Serializable, Ref
from xnmt.events import register_xnmt_handler, handle_xnmt_event
from xnmt.param_initializers import LeCunUniformInitializer
from xnmt.param_collections import ParamMana... | [
"dynet.parameter",
"xnmt.param_initializers.LeCunUniformInitializer",
"dynet.pickneglogsoftmax_batch",
"dynet.reshape",
"dynet.softmax",
"dynet.layer_norm",
"dynet.dropout",
"dynet.pickrange",
"dynet.inputTensor",
"dynet.transpose",
"numpy.argwhere",
"numpy.concatenate",
"xnmt.param_collecti... | [((507, 562), 'dynet.reshape', 'dy.reshape', (['input', '(model_dim,)'], {'batch_size': 'total_words'}), '(input, (model_dim,), batch_size=total_words)\n', (517, 562), True, 'import dynet as dy\n'), ((757, 819), 'dynet.reshape', 'dy.reshape', (['input', '(model_dim, seq_len)'], {'batch_size': 'batch_size'}), '(input, (... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2022 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | [
"django_filters.filterset.FilterSetMetaclass.get_declared_filters"
] | [((1975, 2028), 'django_filters.filterset.FilterSetMetaclass.get_declared_filters', 'FilterSetMetaclass.get_declared_filters', (['bases', 'attrs'], {}), '(bases, attrs)\n', (2014, 2028), False, 'from django_filters.filterset import BaseFilterSet, FilterSetOptions, FilterSetMetaclass\n')] |
# Generated by Django 2.2.5 on 2020-02-06 14:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("user_handler", "0005_invitation"),
]
operations = [
migrations.AlterField(
model_name="user",
name="name",
... | [
"django.db.models.CharField"
] | [((329, 372), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(128)', 'null': '(True)'}), '(max_length=128, null=True)\n', (345, 372), False, 'from django.db import migrations, models\n')] |
import os
from glue.core.message import (DataCollectionAddMessage,)
from ..core.events import NewProfile1DMessage
from traitlets import (Unicode, List, Bool, Int)
from ipywidgets import IntSlider, Text
import ipyvuetify as v
from ..core.template_mixin import TemplateMixin
with open(os.path.join(os.path.dirname(__fil... | [
"traitlets.Unicode",
"ipyvuetify.CardTitle",
"traitlets.List",
"os.path.dirname",
"traitlets.Int",
"traitlets.Bool"
] | [((873, 886), 'ipyvuetify.CardTitle', 'v.CardTitle', ([], {}), '()\n', (884, 886), True, 'import ipyvuetify as v\n'), ((917, 930), 'ipyvuetify.CardTitle', 'v.CardTitle', ([], {}), '()\n', (928, 930), True, 'import ipyvuetify as v\n'), ((299, 324), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n'... |
# 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
# distributed under th... | [
"unittest.main",
"graphite_datadog.glob_utils._is_valid_glob",
"graphite_datadog.glob_utils._is_graphite_glob",
"graphite_datadog.glob_utils.glob_to_regex"
] | [((3548, 3563), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3561, 3563), False, 'import unittest\n'), ((916, 947), 'graphite_datadog.glob_utils._is_graphite_glob', 'glob_utils._is_graphite_glob', (['x'], {}), '(x)\n', (944, 947), False, 'from graphite_datadog import glob_utils\n'), ((1040, 1071), 'graphite_dat... |
import re
def save_signals_csv(filename, data, delimiter=",", integer=True):
"""Saves SignalsData to a CSV file.
First three lines will be filled with header:
1) the labels
2) the curves units
3) the time unit (only 1 column at this row)
filename -- the full path
signals --... | [
"re.sub"
] | [((1088, 1108), 're.sub', 're.sub', (['"""nan"""', '""""""', 's'], {}), "('nan', '', s)\n", (1094, 1108), False, 'import re\n')] |
from future import standard_library
standard_library.install_aliases()
from datetime import datetime
import logging
from urlauth.models import AuthKey
class InvalidKey(Exception):
pass
def wrap_url(url, **kwargs):
"""
Create new authorization key and append it to the url.
"""
logging.error('ur... | [
"future.standard_library.install_aliases",
"datetime.datetime.now",
"urlauth.models.AuthKey.objects.wrap_url",
"urlauth.models.AuthKey.objects.get",
"logging.error"
] | [((36, 70), 'future.standard_library.install_aliases', 'standard_library.install_aliases', ([], {}), '()\n', (68, 70), False, 'from future import standard_library\n'), ((303, 404), 'logging.error', 'logging.error', (['"""urlauth.util.wrap_url is deprecated. Use AuthKey.objects.wrap_url instead."""'], {}), "(\n 'urla... |
import numpy as np
from numpy import ndarray
from numba import njit, prange
__cache = True
@njit(nogil=True, parallel=True, cache=__cache)
def element_transformation_matrices(Q: ndarray, nNE: int=2):
nE = Q.shape[0]
nEVAB = nNE * 6
res = np.zeros((nE, nEVAB, nEVAB), dtype=Q.dtype)
for iE in prange(nE)... | [
"numba.prange",
"numpy.zeros",
"numba.njit",
"numpy.zeros_like"
] | [((94, 140), 'numba.njit', 'njit', ([], {'nogil': '(True)', 'parallel': '(True)', 'cache': '__cache'}), '(nogil=True, parallel=True, cache=__cache)\n', (98, 140), False, 'from numba import njit, prange\n'), ((430, 476), 'numba.njit', 'njit', ([], {'nogil': '(True)', 'parallel': '(True)', 'cache': '__cache'}), '(nogil=T... |
# -*- coding: utf-8 -*-
# Copyright 2013 Google 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 requir... | [
"gslib.util.Retry",
"gslib.command.CreateGsutilLogger",
"gslib.aclhelpers.AclDel",
"gslib.tests.util.ObjectToURI",
"re.sub",
"gslib.aclhelpers.AclChange"
] | [((1354, 1379), 'gslib.command.CreateGsutilLogger', 'CreateGsutilLogger', (['"""acl"""'], {}), "('acl')\n", (1372, 1379), False, 'from gslib.command import CreateGsutilLogger\n'), ((3299, 3353), 're.sub', 're.sub', (['"""<Permission>"""', '"""<Permission> \\\\n"""', 'acl_string'], {}), "('<Permission>', '<Permission> \... |
# STANDARDLIB
from csv import DictWriter
import logging
import json
from pathlib import Path
from multiprocessing import Pool, cpu_count
from time import sleep
# THIRD-PARTY
import luigi
import pandas as pd
import structlog
from structlog.stdlib import LoggerFactory
# LOCAL-APP
from constains import BENCHPATH
from p... | [
"csv.DictWriter",
"scraper.link_scraper.get_coinmarketcap_links",
"luigi.build",
"json.dumps",
"multiprocessing.cpu_count",
"base_pipe.ParseTwitterJSONtoCSVTask",
"multiprocessing.Pool"
] | [((3158, 3185), 'base_pipe.ParseTwitterJSONtoCSVTask', 'ParseTwitterJSONtoCSVTask', ([], {}), '()\n', (3183, 3185), False, 'from base_pipe import ParseTwitterJSONtoCSVTask\n'), ((3190, 3245), 'luigi.build', 'luigi.build', (['[task_one, task_two]'], {'local_scheduler': '(True)'}), '([task_one, task_two], local_scheduler... |
# Generated by Django 4.0 on 2021-12-28 23:15
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Question',
field... | [
"django.db.models.UUIDField",
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.BooleanField",
"django.db.models.BigAutoField",
"django.db.models.DateTimeField",
"django.db.models.CharField"
] | [((2348, 2435), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'on_delete': 'django.db.models.deletion.CASCADE', 'to': '"""survey.survey"""'}), "(on_delete=django.db.models.deletion.CASCADE, to=\n 'survey.survey')\n", (2365, 2435), False, 'from django.db import migrations, models\n'), ((347, 443), 'django... |
#!/usr/bin/env python3
#
# break_machine.py
#
# Created by <NAME> on 26/08/2019.
# Copyright (c) 2019 <NAME>.
#
# Licensed under the ISC License. See LICENSE file in the project root for
# full license information.
#
#
# Parse a .rules file and construct a simple state machine that implements
# breaking rules. ... | [
"os.path.basename"
] | [((4423, 4452), 'os.path.basename', 'os.path.basename', (['sys.argv[1]'], {}), '(sys.argv[1])\n', (4439, 4452), False, 'import os\n')] |
import requests
import arrow
from espn import espn
from db import connect
@connect
def games(driver):
""" Extract the games for the current week """
game_list = espn()
with driver.session() as session:
session.run(
"""
UNWIND $game AS game
MERGE (w:Week {week: ... | [
"espn.espn"
] | [((172, 178), 'espn.espn', 'espn', ([], {}), '()\n', (176, 178), False, 'from espn import espn\n')] |
from __future__ import annotations
import numpy as np
import scipy.signal
from functools import partial
from typing import Callable
try:
import simpleaudio as sa
except ModuleNotFoundError:
raise ModuleNotFoundError("Please install simpleaudio to use this module.\n"
"pip install ... | [
"numpy.abs",
"numpy.asarray",
"numpy.any",
"numpy.squeeze",
"functools.partial",
"numpy.sin",
"numpy.arange"
] | [((711, 747), 'numpy.sin', 'np.sin', (['(x * 2 * np.pi * freq + phase)'], {}), '(x * 2 * np.pi * freq + phase)\n', (717, 747), True, 'import numpy as np\n'), ((1158, 1170), 'numpy.arange', 'np.arange', (['n'], {}), '(n)\n', (1167, 1170), True, 'import numpy as np\n'), ((3540, 3616), 'functools.partial', 'partial', (['s... |
# -*- coding: utf-8 -*-
import ast
import json
from django.shortcuts import render, redirect, render_to_response, HttpResponse
from django.core.urlresolvers import reverse
from ..enum.FunctionCode import FuncCode
from ..enum.MessageCode import Info
from ..enum.platform import *
from ..enum.StatusCode import Blueprint
f... | [
"django.shortcuts.render",
"json.dumps",
"django.core.urlresolvers.reverse",
"ast.literal_eval",
"django.shortcuts.redirect",
"django.shortcuts.render_to_response"
] | [((13206, 13233), 'ast.literal_eval', 'ast.literal_eval', (['blueprint'], {}), '(blueprint)\n', (13222, 13233), False, 'import ast\n'), ((13544, 13573), 'ast.literal_eval', 'ast.literal_eval', (['environment'], {}), '(environment)\n', (13560, 13573), False, 'import ast\n'), ((13811, 13835), 'ast.literal_eval', 'ast.lit... |
from dotenv import load_dotenv, find_dotenv
from os import environ as env
from . import constants
ENV_FILE = find_dotenv()
if ENV_FILE:
load_dotenv(ENV_FILE)
class BaseConfig:
def __init__(self):
self.DEBUG = False
self.TESTING = False
self.AUTH0_CALLBACK_URL = env.get(constants.AUT... | [
"dotenv.find_dotenv",
"os.environ.get",
"dotenv.load_dotenv"
] | [((111, 124), 'dotenv.find_dotenv', 'find_dotenv', ([], {}), '()\n', (122, 124), False, 'from dotenv import load_dotenv, find_dotenv\n'), ((142, 163), 'dotenv.load_dotenv', 'load_dotenv', (['ENV_FILE'], {}), '(ENV_FILE)\n', (153, 163), False, 'from dotenv import load_dotenv, find_dotenv\n'), ((299, 336), 'os.environ.ge... |
import json
import tempfile
import os
from flask import Blueprint, render_template, request, redirect, url_for
from auth import auth_required
from helpers.hubspot import create_client
module = Blueprint("imports", __name__)
@module.route("/")
@auth_required
def list():
hubspot = create_client()
imports_page... | [
"flask.render_template",
"helpers.hubspot.create_client",
"os.close",
"json.dumps",
"flask.url_for",
"os.unlink",
"os.path.basename",
"flask.Blueprint",
"tempfile.mkstemp"
] | [((195, 225), 'flask.Blueprint', 'Blueprint', (['"""imports"""', '__name__'], {}), "('imports', __name__)\n", (204, 225), False, 'from flask import Blueprint, render_template, request, redirect, url_for\n'), ((288, 303), 'helpers.hubspot.create_client', 'create_client', ([], {}), '()\n', (301, 303), False, 'from helper... |
#!/usr/bin/env python
#
# Author: <NAME> <<EMAIL>>
#
from functools import reduce
import unittest
import numpy
from pyscf import lib
from pyscf import gto
from pyscf import scf
from pyscf import mcscf
from pyscf import ao2mo
from pyscf import fci
from pyscf.tools import molden
from pyscf.grad import rhf as rhf_grad
f... | [
"pyscf.gto.Mole",
"pyscf.lib.fp",
"pyscf.lib.light_speed",
"pyscf.gto.M",
"pyscf.ao2mo.kernel",
"functools.reduce",
"pyscf.grad.rhf.grad_nuc",
"numpy.diag_indices",
"pyscf.mcscf.CASSCF",
"numpy.dot",
"numpy.zeros",
"numpy.einsum",
"pyscf.grad.casscf.Gradients",
"pyscf.lib.einsum",
"unitt... | [((2513, 2523), 'pyscf.gto.Mole', 'gto.Mole', ([], {}), '()\n', (2521, 2523), False, 'from pyscf import gto\n'), ((850, 873), 'numpy.zeros', 'numpy.zeros', (['(nmo, nmo)'], {}), '((nmo, nmo))\n', (861, 873), False, 'import numpy\n'), ((963, 996), 'numpy.zeros', 'numpy.zeros', (['(nmo, nmo, nmo, nmo)'], {}), '((nmo, nmo... |
# Generated by Django 2.2.13 on 2020-12-04 01:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("weedid", "0001_initial"),
]
operations = [
migrations.AlterField(
model_name="dataset",
name="upload_date",
... | [
"django.db.models.DateField"
] | [((331, 377), 'django.db.models.DateField', 'models.DateField', ([], {'auto_now_add': '(True)', 'null': '(True)'}), '(auto_now_add=True, null=True)\n', (347, 377), False, 'from django.db import migrations, models\n')] |
import pytest
from nucleic import SnvSpectrum
from nucleic.cosmic import fetch_cosmic_signatures
from nucleic.util import kmers
class TestUtil(object):
"""Unit tests for ``nucleic.util``."""
def test_kmers(self):
alphabet = ['A', 'C', 'G', 'T']
assert list(kmers(1, alphabet)) == alphabet
... | [
"pytest.mark.xfail",
"nucleic.util.kmers",
"nucleic.cosmic.fetch_cosmic_signatures"
] | [((374, 413), 'pytest.mark.xfail', 'pytest.mark.xfail', ([], {'reason': '"""No internet"""'}), "(reason='No internet')\n", (391, 413), False, 'import pytest\n'), ((486, 511), 'nucleic.cosmic.fetch_cosmic_signatures', 'fetch_cosmic_signatures', ([], {}), '()\n', (509, 511), False, 'from nucleic.cosmic import fetch_cosmi... |
from __future__ import print_function
from hams_admin import HamsConnection, DockerContainerManager
from hams_admin.deployers import python as python_deployer
import json
import requests
from datetime import datetime
import time
import numpy as np
import signal
import sys
def predict(addr, x, batch=False):
url = ... | [
"signal.signal",
"requests.post",
"json.dumps",
"time.sleep",
"datetime.datetime.now",
"hams_admin.DockerContainerManager",
"sys.exit"
] | [((551, 565), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (563, 565), False, 'from datetime import datetime\n'), ((574, 624), 'requests.post', 'requests.post', (['url'], {'headers': 'headers', 'data': 'req_json'}), '(url, headers=headers, data=req_json)\n', (587, 624), False, 'import requests\n'), ((635,... |
# SM.NLMS.py
#
# Implements the Set-membership Normalized LMS algorithm for COMPLEX valued data.
# (Algorithm 6.1 - book: Adaptive Filtering: Algorithms and Practical
# Implementation, Diniz)
#
# Authors:
# . <NAME> - <EMAIL> & <EMAIL>
... | [
"numpy.append",
"numpy.array",
"numpy.zeros",
"time.time"
] | [((3001, 3007), 'time.time', 'time', ([], {}), '()\n', (3005, 3007), False, 'from time import time\n'), ((3063, 3122), 'numpy.zeros', 'np.zeros', (['(Filter.filter_order + 1)'], {'dtype': 'input_signal.dtype'}), '(Filter.filter_order + 1, dtype=input_signal.dtype)\n', (3071, 3122), True, 'import numpy as np\n'), ((3140... |
import inspect
import json
from typing import TYPE_CHECKING, Any, Dict, List, Sequence, Union
import aft_common.aft_utils as utils
import boto3
from boto3.session import Session
if TYPE_CHECKING:
from mypy_boto3_ssm import SSMClient
from mypy_boto3_sts import STSClient
else:
SSMClient = object
STSClie... | [
"aft_common.aft_utils.build_role_arn",
"boto3.session.Session",
"inspect.stack",
"json.dumps",
"optparse.OptionParser",
"aft_common.aft_utils.get_aft_admin_role_session",
"json.load",
"aft_common.aft_utils.get_logger",
"aft_common.aft_utils.get_boto_session"
] | [((438, 456), 'aft_common.aft_utils.get_logger', 'utils.get_logger', ([], {}), '()\n', (454, 456), True, 'import aft_common.aft_utils as utils\n'), ((3984, 3998), 'optparse.OptionParser', 'OptionParser', ([], {}), '()\n', (3996, 3998), False, 'from optparse import OptionParser\n'), ((1722, 1745), 'boto3.session.Session... |
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use ... | [
"elastic_enterprise_search.JSONSerializer",
"datetime.datetime",
"datetime.date"
] | [((936, 952), 'elastic_enterprise_search.JSONSerializer', 'JSONSerializer', ([], {}), '()\n', (950, 952), False, 'from elastic_enterprise_search import JSONSerializer\n'), ((1027, 1121), 'datetime.datetime', 'datetime.datetime', ([], {'year': '(2020)', 'month': '(12)', 'day': '(11)', 'hour': '(10)', 'minute': '(9)', 's... |
import pdb
import copy
import logging
import itertools
from time import sleep
import threading
from multiprocessing import Process
import sklearn.preprocessing
import pytest
from utils import *
from constants import *
uid = "collection_count"
tag = "collection_count_tag"
class TestCollectionCount:
"""
params... | [
"logging.getLogger",
"pytest.raises",
"pytest.mark.level",
"pytest.fixture",
"pytest.skip"
] | [((393, 449), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""', 'params': '[1, 1000, 2001]'}), "(scope='function', params=[1, 1000, 2001])\n", (407, 449), False, 'import pytest\n'), ((7280, 7336), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""', 'params': '[1, 1000, 2001]'}), "(sc... |
from __future__ import annotations
import asyncio
import json
import logging
import os
from typing import Any, Mapping, Optional, Union
import aiohttp
from aiohttp import hdrs
from aiohttp.client import _RequestContextManager
from .auth import Auth
from .request import ClientRequest
from .typedefs import WsBytesHand... | [
"logging.getLogger",
"aiohttp.ClientSession",
"os.getenv",
"asyncio.Event",
"os.getcwd",
"os.path.isfile",
"json.load"
] | [((419, 446), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (436, 446), False, 'import logging\n'), ((2337, 2445), 'aiohttp.ClientSession', 'aiohttp.ClientSession', ([], {'request_class': 'ClientRequest', 'ws_response_class': 'ClientWebSocketResponse'}), '(request_class=ClientRequest, ws... |
import typing
from typing import List
import numpy as np
class Solution:
def minimumDifference(
self,
nums: List[int],
k: int,
) -> int:
a = np.array(nums)
a.sort()
k -= 1
return (a[k:] - a[:a.size - k]).min()
| [
"numpy.array"
] | [((168, 182), 'numpy.array', 'np.array', (['nums'], {}), '(nums)\n', (176, 182), True, 'import numpy as np\n')] |
import math, random, sys, os
import numpy as np
import pandas as pd
import networkx as nx
import func_timeout
import tqdm
from rdkit import RDLogger
from rdkit.Chem import Descriptors
from rdkit.Chem import rdmolops
import rdkit.Chem.QED
import torch
from botorch.models import SingleTaskGP
from botorch.fit import fit_... | [
"numpy.nanpercentile",
"rdkit.Chem.Descriptors.MolLogP",
"torch.max",
"rdkit.Chem.rdmolops.GetAdjacencyMatrix",
"torch.exp",
"torch.min",
"numpy.array",
"numpy.nanmean",
"torch.cuda.is_available",
"botorch.acquisition.qNoisyExpectedImprovement",
"numpy.percentile",
"botorch.models.SingleTaskGP... | [((695, 712), 'rdkit.RDLogger.logger', 'RDLogger.logger', ([], {}), '()\n', (710, 712), False, 'from rdkit import RDLogger\n'), ((753, 778), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (768, 778), False, 'import math, random, sys, os\n'), ((790, 811), 'os.path.dirname', 'os.path.dirname', ... |
from django.contrib import admin
from .models import BusinessPartner, LetProject, PlannedProject, ProjectTeam
# Register your models here.
class LetProjectAdmin(admin.ModelAdmin):
list_display = ("agreement_number", "district", "winner", "let_date")
list_filter = ("district", "let_date")
admin.site.register(Le... | [
"django.contrib.admin.site.register"
] | [((298, 346), 'django.contrib.admin.site.register', 'admin.site.register', (['LetProject', 'LetProjectAdmin'], {}), '(LetProject, LetProjectAdmin)\n', (317, 346), False, 'from django.contrib import admin\n'), ((462, 518), 'django.contrib.admin.site.register', 'admin.site.register', (['PlannedProject', 'PlannedProjectAd... |
from kivymd.app import MDApp
from kivy.lang.builder import Builder
class MyApp(MDApp):
def build(self):
self.screen = Builder.load_file('03_ways_of _using_kivy.kv')
return self.screen
def button_press(self):
print("My buttons pressed")
if __name__=='__main__':
MyApp().run()
| [
"kivy.lang.builder.Builder.load_file"
] | [((125, 171), 'kivy.lang.builder.Builder.load_file', 'Builder.load_file', (['"""03_ways_of _using_kivy.kv"""'], {}), "('03_ways_of _using_kivy.kv')\n", (142, 171), False, 'from kivy.lang.builder import Builder\n')] |
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import os
import unittest
from pathlib import Path
from monty.serialization import dumpfn, loadfn
from pymatgen.core.periodic_table import Element
from pymatgen.entries.computed_entries import ComputedEntry
from pymatgen.en... | [
"pathlib.Path",
"pymatgen.entries.entry_tools.group_entries_by_structure",
"pymatgen.entries.computed_entries.ComputedEntry",
"os.path.join",
"monty.serialization.loadfn",
"pymatgen.entries.entry_tools.EntrySet",
"pymatgen.entries.entry_tools.group_entries_by_composition",
"unittest.main",
"monty.se... | [((2904, 2919), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2917, 2919), False, 'import unittest\n'), ((747, 782), 'pymatgen.entries.entry_tools.group_entries_by_structure', 'group_entries_by_structure', (['entries'], {}), '(entries)\n', (773, 782), False, 'from pymatgen.entries.entry_tools import EntrySet, gr... |
import re
string = input()
# your code here
pattern = r"(?<=<li>)(.*?)(?=</li>)"
entries = re.findall(pattern, string)
for entry in entries:
print(entry)
| [
"re.findall"
] | [((92, 119), 're.findall', 're.findall', (['pattern', 'string'], {}), '(pattern, string)\n', (102, 119), False, 'import re\n')] |
import os
def get_content(fn):
with open(fn, 'r') as f:
source = ""
for line in f:
source += line
return source
def source_gen(path="./engadget_data/", start=None, end=None):
child, folders, files = list(os.walk(path))[0]
for fn in sorted(files, key=lambda fn: os.path.get... | [
"os.path.getsize",
"math.ceil",
"os.walk"
] | [((3324, 3351), 'math.ceil', 'math.ceil', (['(s_l / seq_length)'], {}), '(s_l / seq_length)\n', (3333, 3351), False, 'import math\n'), ((248, 261), 'os.walk', 'os.walk', (['path'], {}), '(path)\n', (255, 261), False, 'import os\n'), ((309, 335), 'os.path.getsize', 'os.path.getsize', (['(path + fn)'], {}), '(path + fn)\... |
import pafy
import vlc
import urllib.parse, urllib.request
import re
from globalVariables import *
class florenceMultimedia:
def __init__(self):
self.instance = vlc.Instance()
self.player = self.instance.media_player_new()
def youtubeSearch(self,query):
try:
... | [
"pafy.new",
"vlc.Instance"
] | [((186, 200), 'vlc.Instance', 'vlc.Instance', ([], {}), '()\n', (198, 200), False, 'import vlc\n'), ((907, 920), 'pafy.new', 'pafy.new', (['url'], {}), '(url)\n', (915, 920), False, 'import pafy\n')] |
from PIL import Image, ImageDraw
from PIL.ImageChops import multiply
import numpy as np
try:
import matplotlib.pyplot as plt
except:
print("### matplotlib.pyplot could not be imported.")
def imshow(image):
plt.imshow(image)
plt.show()
def pilshow(pil_image):
imshow(np.asarray(pil_image))
def ... | [
"matplotlib.pyplot.imshow",
"PIL.Image.open",
"numpy.asarray",
"PIL.ImageDraw.Draw",
"PIL.ImageChops.multiply",
"numpy.full",
"matplotlib.pyplot.show"
] | [((221, 238), 'matplotlib.pyplot.imshow', 'plt.imshow', (['image'], {}), '(image)\n', (231, 238), True, 'import matplotlib.pyplot as plt\n'), ((243, 253), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (251, 253), True, 'import matplotlib.pyplot as plt\n'), ((595, 619), 'PIL.ImageDraw.Draw', 'ImageDraw.Draw', ... |
import sys
from itertools import chain
from argparse import ArgumentParser, Namespace
from typing import Dict, Set
def add_kwargs(argument_parser: ArgumentParser):
default_actions_set = __get_default_actions(argument_parser)
split_kwargs = (arg.split("=")[0] for arg in sys.argv[3:])
kwargs = filter(lamb... | [
"itertools.chain.from_iterable"
] | [((843, 884), 'itertools.chain.from_iterable', 'chain.from_iterable', (['option_strings_lists'], {}), '(option_strings_lists)\n', (862, 884), False, 'from itertools import chain\n')] |
"""Unittest of ActionTree."""
import pytest
import yaml
from Arbie.Actions import Action, ActionTree, Store
class DummyAction(Action):
"""
Dummy description for dummy action.
[Settings]
input:
output:
"""
store = Store()
class TestActionTree(object):
def test_create(self):
t... | [
"yaml.safe_load",
"Arbie.Actions.ActionTree.create",
"Arbie.Actions.Store",
"pytest.raises"
] | [((244, 251), 'Arbie.Actions.Store', 'Store', ([], {}), '()\n', (249, 251), False, 'from Arbie.Actions import Action, ActionTree, Store\n'), ((326, 370), 'Arbie.Actions.ActionTree.create', 'ActionTree.create', (["{'PathFinder': {}}", 'store'], {}), "({'PathFinder': {}}, store)\n", (343, 370), False, 'from Arbie.Actions... |
# -*- encoding: utf-8 -*-
"""
KERI
keri.app.directing module
simple direct mode demo support classes
"""
import os
from hio.base import doing
from hio.core import wiring
from hio.core.tcp import clienting, serving
from .. import kering
from ..db import dbing, basing
from ..core import coring, eventing, parsing
from ... | [
"hio.base.doing.ClientDoer",
"hio.base.doing.doize",
"hio.base.doing.ServerDoer",
"os.path.join",
"hio.core.tcp.clienting.Client",
"os.path.dirname",
"hio.base.doing.Doist",
"hio.core.wiring.WireLog",
"hio.core.wiring.WireLogDoer",
"hio.core.tcp.serving.Server"
] | [((1199, 1224), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (1214, 1224), False, 'import os\n'), ((1236, 1262), 'os.path.join', 'os.path.join', (['path', '"""logs"""'], {}), "(path, 'logs')\n", (1248, 1262), False, 'import os\n'), ((1273, 1373), 'hio.core.wiring.WireLog', 'wiring.WireLog',... |
import numpy as np
import pandas as pd
from mia.estimators import ShadowModelBundle, prepare_attack_data
from sklearn.ensemble import RandomForestClassifier
from sklearn.utils import resample
# depent on tensorflow 1.14
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras.layers import Conv1D, A... | [
"numpy.mean",
"tensorflow.keras.utils.to_categorical",
"mia.estimators.prepare_attack_data",
"pandas.read_csv",
"tensorflow.keras.layers.AveragePooling1D",
"tensorflow.keras.losses.BinaryCrossentropy",
"tensorflow.keras.layers.Dropout",
"mia.estimators.ShadowModelBundle",
"sklearn.ensemble.RandomFor... | [((639, 660), 'numpy.random.seed', 'np.random.seed', (['(19122)'], {}), '(19122)\n', (653, 660), True, 'import numpy as np\n'), ((3887, 3919), 'numpy.random.permutation', 'np.random.permutation', (['total_row'], {}), '(total_row)\n', (3908, 3919), True, 'import numpy as np\n'), ((4400, 4412), 'tensorflow.keras.models.S... |
import command
import module
import util
class ManagerModule(module.Module):
name = 'Manager'
@command.desc('Reload all modules')
@command.alias('ra')
def cmd_reloadall(self, msg):
before = util.time_us()
self.bot.save_config()
self.bot.mresult(msg, 'Unloading all modules...'... | [
"command.alias",
"command.desc",
"util.time_us",
"util.format_duration_us"
] | [((105, 139), 'command.desc', 'command.desc', (['"""Reload all modules"""'], {}), "('Reload all modules')\n", (117, 139), False, 'import command\n'), ((145, 164), 'command.alias', 'command.alias', (['"""ra"""'], {}), "('ra')\n", (158, 164), False, 'import command\n'), ((216, 230), 'util.time_us', 'util.time_us', ([], {... |
from __future__ import print_function
# pyDIA
#
# This software implements the difference-imaging algorithm of Bramich et al. (2010)
# with mixed-resolution delta basis functions. It uses an NVIDIA GPU to do the heavy
# processing.
#
# Subroutines deconvolve3_rows, deconvolve3_columns, resolve_coeffs_2d and
# inte... | [
"c_interface_functions.compute_model_cuda",
"numpy.sqrt",
"io_functions.write_image",
"photometry_functions.compute_psf_image",
"numpy.argsort",
"io_functions.get_date",
"sys.exit",
"data_structures.EmptyBase",
"numpy.genfromtxt",
"itertools.repeat",
"data_structures.Observation",
"os.path.exi... | [((1834, 1845), 'time.time', 'time.time', ([], {}), '()\n', (1843, 1845), False, 'import time\n'), ((3303, 3335), 'numpy.ones', 'np.ones', (['smask.shape'], {'dtype': 'bool'}), '(smask.shape, dtype=bool)\n', (3310, 3335), True, 'import numpy as np\n'), ((3345, 3359), 'data_structures.EmptyBase', 'DS.EmptyBase', ([], {}... |
import psutil
import json
import os
from datetime import datetime
TS_FORMAT = '%Y-%m-%dT%H:%M:%S.%f'
def get_data_file_path():
try:
path = os.environ['DATA_FILE']
except:
path = '/var/opt/disk_io_read.data'
return path
def read_data(path):
try:
with open(path, 'r') as f:
... | [
"os.makedirs",
"datetime.datetime.utcnow",
"psutil.disk_io_counters",
"json.dumps",
"os.path.dirname"
] | [((944, 969), 'psutil.disk_io_counters', 'psutil.disk_io_counters', ([], {}), '()\n', (967, 969), False, 'import psutil\n'), ((980, 997), 'datetime.datetime.utcnow', 'datetime.utcnow', ([], {}), '()\n', (995, 997), False, 'from datetime import datetime\n'), ((1271, 1284), 'json.dumps', 'json.dumps', (['r'], {}), '(r)\n... |
#!/usr/bin/env python
"""
Operations on surface mesh vertices.
Authors:
- <NAME>, 2012 (<EMAIL>)
- <NAME>, 2012-2016 (<EMAIL>) http://binarybottle.com
Copyright 2016, Mindboggle team (http://mindboggle.info), Apache v2.0 License
"""
def find_neighbors_from_file(input_vtk):
"""
Generate the list... | [
"itertools.chain",
"mindboggle.guts.mesh.find_neighbors_from_file",
"mindboggle.guts.mesh.find_neighbors",
"mindboggle.guts.mesh.decimate.SetTargetReduction",
"mindboggle.mio.vtks.rewrite_scalars",
"numpy.sqrt",
"vtk.vtkCellArray",
"vtk.vtkDecimatePro",
"vtk.vtkPoints",
"numpy.array",
"mindboggl... | [((1878, 1906), 'mindboggle.mio.vtks.read_faces_points', 'read_faces_points', (['input_vtk'], {}), '(input_vtk)\n', (1895, 1906), False, 'from mindboggle.mio.vtks import read_faces_points\n'), ((1929, 1959), 'mindboggle.guts.mesh.find_neighbors', 'find_neighbors', (['faces', 'npoints'], {}), '(faces, npoints)\n', (1943... |
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
import agentserver
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.rst'), enco... | [
"os.path.dirname",
"setuptools.find_packages",
"os.path.join"
] | [((202, 224), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file__)\n', (214, 224), False, 'from os import path\n'), ((285, 314), 'os.path.join', 'path.join', (['here', '"""README.rst"""'], {}), "(here, 'README.rst')\n", (294, 314), False, 'from os import path\n'), ((1920, 1935), 'setuptools.find_packages'... |
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField
from wtforms.validators import DataRequired
class Add_clip(FlaskForm):
clip_name = StringField(
'Название клипа',
validators=[DataRequired()],
render_kw={"class": "form-control"}
)
link = StringField(
... | [
"wtforms.validators.DataRequired",
"wtforms.SubmitField"
] | [((571, 633), 'wtforms.SubmitField', 'SubmitField', (['"""Создать"""'], {'render_kw': "{'class': 'btn btn-primary'}"}), "('Создать', render_kw={'class': 'btn btn-primary'})\n", (582, 633), False, 'from wtforms import StringField, SubmitField\n'), ((224, 238), 'wtforms.validators.DataRequired', 'DataRequired', ([], {}),... |
#!/usr/bin/env python3
from pgmpy.base import UndirectedGraph
from pgmpy.tests import help_functions as hf
import unittest
class TestUndirectedGraphCreation(unittest.TestCase):
def setUp(self):
self.graph = UndirectedGraph()
def test_class_init_without_data(self):
self.assertIsInstance(self.... | [
"pgmpy.base.UndirectedGraph",
"pgmpy.tests.help_functions.recursive_sorted"
] | [((222, 239), 'pgmpy.base.UndirectedGraph', 'UndirectedGraph', ([], {}), '()\n', (237, 239), False, 'from pgmpy.base import UndirectedGraph\n'), ((410, 451), 'pgmpy.base.UndirectedGraph', 'UndirectedGraph', (["[('a', 'b'), ('b', 'c')]"], {}), "([('a', 'b'), ('b', 'c')])\n", (425, 451), False, 'from pgmpy.base import Un... |
from django.conf.urls import url
from django.contrib import admin
from django.contrib.auth.views import (
login, logout, password_reset, password_reset_done, password_reset_confirm, password_reset_complete
)
# from FMT.subscriptions.views import subscription_signup, subscription_unsubscribe
from . import views
u... | [
"django.conf.urls.url"
] | [((340, 371), 'django.conf.urls.url', 'url', (['"""^admin/"""', 'admin.site.urls'], {}), "('^admin/', admin.site.urls)\n", (343, 371), False, 'from django.conf.urls import url\n'), ((378, 412), 'django.conf.urls.url', 'url', (['"""^$"""', 'views.home'], {'name': '"""home"""'}), "('^$', views.home, name='home')\n", (381... |
# -*- coding: utf-8 -*-
###############################################################################
# Name: __init__.py #
# Purpose: Simple Calculator Plugin #
# Author: <NAME> <<EMAIL>> ... | [
"noval.util.utils.get_home_dir",
"noval._",
"noval.project.templatemanager.ProjectTemplateManager",
"noval.util.utils.upload_file",
"noval.util.utils.get_logger",
"os.path.exists",
"noval.GetApp",
"noval.NewId",
"noval.python.pyutils.create_python_interpreter_process",
"noval.plugin.Implements",
... | [((2163, 2199), 'noval.plugin.Implements', 'plugin.Implements', (['iface.MainWindowI'], {}), '(iface.MainWindowI)\n', (2180, 2199), True, 'import noval.plugin as plugin\n'), ((2225, 2232), 'noval.NewId', 'NewId', ([], {}), '()\n', (2230, 2232), False, 'from noval import _, GetApp, NewId\n'), ((2257, 2264), 'noval.NewId... |
#!/usr/bin/env python
# Filename: test_scripts
"""
introduction:
authors: <NAME>
email:<EMAIL>
add time: 11 April, 2021
"""
import os, sys
import cv2
import numpy as np
code_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..')
sys.path.insert(0, code_dir)
import datasets.raster_io as raster_io
def ... | [
"cv2.rectangle",
"numpy.mean",
"sys.path.insert",
"os.path.join",
"datasets.raster_io.read_raster_all_bands_np",
"numpy.ascontiguousarray",
"cv2.imshow",
"cv2.waitKey",
"cv2.cvtColor",
"os.path.abspath",
"cv2.imread",
"os.path.expanduser"
] | [((246, 274), 'sys.path.insert', 'sys.path.insert', (['(0)', 'code_dir'], {}), '(0, code_dir)\n', (261, 274), False, 'import os, sys\n'), ((435, 520), 'os.path.expanduser', 'os.path.expanduser', (['"""~/Data/Arctic/canada_arctic/autoMapping/multiArea_yolov4_1"""'], {}), "('~/Data/Arctic/canada_arctic/autoMapping/multiA... |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2017-2019 Met Office.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions a... | [
"numpy.flip",
"numpy.ones",
"iris.coords.AuxCoord",
"numpy.array",
"improver.utilities.cube_manipulation.sort_coord_in_cube",
"unittest.main",
"improver.utilities.warnings_handler.ManageWarnings"
] | [((7954, 7981), 'improver.utilities.warnings_handler.ManageWarnings', 'ManageWarnings', ([], {'record': '(True)'}), '(record=True)\n', (7968, 7981), False, 'from improver.utilities.warnings_handler import ManageWarnings\n'), ((8700, 8715), 'unittest.main', 'unittest.main', ([], {}), '()\n', (8713, 8715), False, 'import... |
"""Environment configurations."""
# pylint: disable=too-few-public-methods,invalid-name
import os
class Config(object):
"""Parent configuration class."""
DEBUG = False
TESTING = False
SQLALCHEMY_TRACK_MODIFICATIONS = False
SECRET_KEY = os.environ.get('SECRET_KEY')
SQLALCHEMY_DATABASE_URI = ... | [
"os.environ.get"
] | [((261, 289), 'os.environ.get', 'os.environ.get', (['"""SECRET_KEY"""'], {}), "('SECRET_KEY')\n", (275, 289), False, 'import os\n'), ((320, 350), 'os.environ.get', 'os.environ.get', (['"""DATABASE_URL"""'], {}), "('DATABASE_URL')\n", (334, 350), False, 'import os\n'), ((370, 400), 'os.environ.get', 'os.environ.get', ([... |
"""Host Model"""
from cbw_api_toolbox.cbw_objects.cbw_package import CBWPackage
from cbw_api_toolbox.cbw_objects.cbw_server import CBWCve
from cbw_api_toolbox.cbw_parser import CBWParser
class CBWHost:
"""Host Model"""
def __init__(self,
id, # pylint: disable=redefined-builtin
... | [
"cbw_api_toolbox.cbw_parser.CBWParser"
] | [((1207, 1218), 'cbw_api_toolbox.cbw_parser.CBWParser', 'CBWParser', ([], {}), '()\n', (1216, 1218), False, 'from cbw_api_toolbox.cbw_parser import CBWParser\n'), ((1415, 1426), 'cbw_api_toolbox.cbw_parser.CBWParser', 'CBWParser', ([], {}), '()\n', (1424, 1426), False, 'from cbw_api_toolbox.cbw_parser import CBWParser\... |
from django.db import models
from Voice_interface_optimization_server import settings
from apps.tts_tests.models import TtsTest
class TtsTestResult(models.Model):
user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.RESTRICT)
tts_test = models.ForeignKey(TtsTest, on_delete=models.RESTRICT)
... | [
"django.db.models.BooleanField",
"django.db.models.ForeignKey"
] | [((177, 247), 'django.db.models.ForeignKey', 'models.ForeignKey', (['settings.AUTH_USER_MODEL'], {'on_delete': 'models.RESTRICT'}), '(settings.AUTH_USER_MODEL, on_delete=models.RESTRICT)\n', (194, 247), False, 'from django.db import models\n'), ((263, 316), 'django.db.models.ForeignKey', 'models.ForeignKey', (['TtsTest... |
# Author - Abhinand --> https://github.com/abhinand5
# =====================================================================
# IMPORTS
# ======================================================================
import torch
import torchvision
from torchvision.models.detection.faster_rcnn import FastRCNNPredictor
import ... | [
"torch.optim.SGD",
"torch.load",
"torchvision.models.detection.faster_rcnn.FastRCNNPredictor",
"torchvision.models.detection.fasterrcnn_resnet50_fpn",
"pkbar.Kbar"
] | [((758, 843), 'torchvision.models.detection.fasterrcnn_resnet50_fpn', 'torchvision.models.detection.fasterrcnn_resnet50_fpn', ([], {'pretrained': 'self.pretrained'}), '(pretrained=self.pretrained\n )\n', (810, 843), False, 'import torchvision\n'), ((975, 1020), 'torchvision.models.detection.faster_rcnn.FastRCNNPredi... |
#!/usr/bin/env python
"""
@package mi.dataset.test.test_single_dir_harvester.py
@file mi/dataset/test/test_single_dir_harvester.py
@author <NAME>
@brief Test code to exercize the single directory harvester
"""
import os
import glob
import gevent
import time
import shutil
import hashlib
from mi.core.log import get_log... | [
"os.path.exists",
"os.path.getsize",
"os.makedirs",
"nose.plugins.attrib.attr",
"os.path.join",
"mi.core.log.get_logger",
"time.sleep",
"mi.dataset.harvester.SingleDirectoryHarvester",
"shutil.copy",
"os.path.getmtime",
"time.time",
"gevent.spawn",
"glob.glob",
"os.remove"
] | [((332, 344), 'mi.core.log.get_logger', 'get_logger', ([], {}), '()\n', (342, 344), False, 'from mi.core.log import get_logger\n'), ((1269, 1293), 'nose.plugins.attrib.attr', 'attr', (['"""INT"""'], {'group': '"""eoi"""'}), "('INT', group='eoi')\n", (1273, 1293), False, 'from nose.plugins.attrib import attr\n'), ((2377... |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | [
"optparse.OptionGroup",
"json.loads",
"optparse.OptionParser.__init__",
"proton.SSLDomain",
"optparse.OptionValueError",
"proton.Url"
] | [((2753, 2789), 'optparse.OptionGroup', 'optparse.OptionGroup', (['options', 'title'], {}), '(options, title)\n', (2773, 2789), False, 'import sys, json, optparse, os\n'), ((6079, 6092), 'proton.Url', 'Url', (['opts.bus'], {}), '(opts.bus)\n', (6082, 6092), False, 'from proton import SSLDomain, Url\n'), ((6292, 6305), ... |
# vim: set fileencoding=utf-8
# Copyright © 2020, 2021 <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 applic... | [
"json.loads",
"argparse.ArgumentParser",
"os.popen",
"json.load",
"parquet.DictReader"
] | [((1130, 1146), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (1144, 1146), False, 'from argparse import ArgumentParser\n'), ((3297, 3313), 'json.loads', 'json.loads', (['line'], {}), '(line)\n', (3307, 3313), False, 'import json\n'), ((2200, 2214), 'json.load', 'json.load', (['fin'], {}), '(fin)\n', (... |
import os
import shutil
from wmt.config import site
from wmt.models.submissions import prepend_to_path
from wmt.utils.hook import find_simulation_input_file
# file_list = ['rti_file',
# 'ET_file',
# 'pixel_file']
file_list = ['ET_file']
def execute(env):
"""Perform pre-stage tasks for... | [
"wmt.utils.hook.find_simulation_input_file",
"os.path.join",
"shutil.copy"
] | [((1328, 1383), 'wmt.utils.hook.find_simulation_input_file', 'find_simulation_input_file', (["(env['site_prefix'] + '.rti')"], {}), "(env['site_prefix'] + '.rti')\n", (1354, 1383), False, 'from wmt.utils.hook import find_simulation_input_file\n'), ((1243, 1281), 'wmt.utils.hook.find_simulation_input_file', 'find_simula... |
## Problem 4: Extracting Data from JSON
# Twitter API
# pull json data from web
import urllib.request, urllib.parse, urllib.error
import twurl
import ssl
# https://apps.twitter.com/
# Create App and get the four strings, put them in hidden.py
TWITTER_URL = 'https://api.twitter.com/1.1/statuses/user_timeline.json'
#... | [
"ssl.create_default_context",
"twurl.augment"
] | [((357, 385), 'ssl.create_default_context', 'ssl.create_default_context', ([], {}), '()\n', (383, 385), False, 'import ssl\n'), ((638, 701), 'twurl.augment', 'twurl.augment', (['TWITTER_URL', "{'screen_name': acct, 'count': '2'}"], {}), "(TWITTER_URL, {'screen_name': acct, 'count': '2'})\n", (651, 701), False, 'import ... |
'''
Tasks which control a plant under pure machine control. Used typically for initializing BMI decoder parameters.
'''
import numpy as np
import time
import os
import pdb
import multiprocessing as mp
import pickle
import tables
import re
import tempfile, traceback, datetime
import riglib.bmi
from riglib.stereo_opengl... | [
"numpy.ceil",
"riglib.bmi.bmi.MachineOnlyFilter",
"riglib.bmi.bmi.Decoder",
"riglib.bmi.extractor.DummyExtractor",
"riglib.bmi.state_space_models.StateSpaceEndptVel2D",
"riglib.experiment.traits.OptionsList"
] | [((965, 1038), 'riglib.experiment.traits.OptionsList', 'traits.OptionsList', (['*bmi_ssm_options'], {'bmi3d_input_options': 'bmi_ssm_options'}), '(*bmi_ssm_options, bmi3d_input_options=bmi_ssm_options)\n', (983, 1038), False, 'from riglib.experiment import traits, experiment\n'), ((1087, 1109), 'riglib.bmi.state_space_... |
# Copyright (c) 2016 The Johns Hopkins University/Applied Physics Laboratory
# 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/LICEN... | [
"kmip.core.exceptions.ConnectionClosed",
"kmip.services.server.auth.get_client_identity_from_certificate",
"kmip.services.server.auth.get_extended_key_usage_from_certificate",
"kmip.core.messages.contents.ProtocolVersion",
"kmip.core.exceptions.PermissionDenied",
"kmip.services.server.auth.get_certificate... | [((3082, 3093), 'time.time', 'time.time', ([], {}), '()\n', (3091, 3093), False, 'import time\n'), ((4101, 4126), 'kmip.core.messages.messages.RequestMessage', 'messages.RequestMessage', ([], {}), '()\n', (4124, 4126), False, 'from kmip.core.messages import messages\n'), ((8567, 8590), 'kmip.core.utils.BytearrayStream'... |
# -*- coding: utf-8 -*-
"""
Microsoft-Windows-MediaFoundation-Performance-Core
GUID : b20e65ac-c905-4014-8f78-1b6a508142eb
"""
from construct import Int8sl, Int8ul, Int16ul, Int16sl, Int32sl, Int32ul, Int64sl, Int64ul, Bytes, Double, Float32l, Struct
from etl.utils import WString, CString, SystemTime, Guid
from etl.dty... | [
"construct.Struct",
"etl.parsers.etw.core.guid"
] | [((551, 628), 'construct.Struct', 'Struct', (["('object' / Int64ul)", "('WorkQueueId' / Int64ul)", "('IsMultithread' / Int8ul)"], {}), "('object' / Int64ul, 'WorkQueueId' / Int64ul, 'IsMultithread' / Int8ul)\n", (557, 628), False, 'from construct import Int8sl, Int8ul, Int16ul, Int16sl, Int32sl, Int32ul, Int64sl, Int64... |
# Generated by Django 2.0 on 2018-02-11 15:45
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('honoradar', '0004_auto_20180211_1516'),
]
operations = [
migrations.AddField(
model_name='datacollection',
name='jobst... | [
"django.db.models.CharField"
] | [((345, 469), 'django.db.models.CharField', 'models.CharField', ([], {'choices': "[('fest', 'fest'), ('pauschal', 'pauschal'), ('frei', 'frei')]", 'default': '"""frei"""', 'max_length': '(10)'}), "(choices=[('fest', 'fest'), ('pauschal', 'pauschal'), (\n 'frei', 'frei')], default='frei', max_length=10)\n", (361, 469... |
from logging import debug
from time import sleep
import pytest
import zmq
from pysomq import SerialClient
from pysomq._utility import connect_socket
from tests._utility import (
listen_feedback_pull,
listen_subscribe,
stream_subscribe,
)
@pytest.fixture
def serial_client() -> SerialClient:
client = ... | [
"pysomq.SerialClient",
"logging.debug",
"time.sleep",
"pysomq._utility.connect_socket"
] | [((320, 407), 'pysomq.SerialClient', 'SerialClient', ([], {'streaming_socket': 'stream_subscribe', 'listening_socket': 'listen_subscribe'}), '(streaming_socket=stream_subscribe, listening_socket=\n listen_subscribe)\n', (332, 407), False, 'from pysomq import SerialClient\n'), ((430, 441), 'time.sleep', 'sleep', (['(... |
"""
### NOTICE ###
You DO NOT need to upload this file
"""
import argparse
from test import test
from environment import Environment
def parse():
parser = argparse.ArgumentParser(description="MLDS 2018 HW4")
parser.add_argument('--env_name', default=None, help='environment name')
parser.add_argument('--... | [
"environment.Environment",
"argparse.ArgumentParser",
"agent_dir.agent_dqn.Agent_DQN",
"agent_dir.agent_pg.Agent_PG",
"test.test",
"argument.add_arguments"
] | [((163, 215), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""MLDS 2018 HW4"""'}), "(description='MLDS 2018 HW4')\n", (186, 215), False, 'import argparse\n'), ((724, 745), 'argument.add_arguments', 'add_arguments', (['parser'], {}), '(parser)\n', (737, 745), False, 'from argument import a... |
from typing import Set
from enum import IntFlag, auto, Enum, IntEnum
class CommandType(Enum):
ProfileList = 'ProfileList'
InstallProfile = 'InstallProfile'
RemoveProfile = 'RemoveProfile'
ProvisioningProfileList = 'ProvisioningProfileList'
InstallProvisioningProfile = 'InstallProvisioningProfile'
... | [
"enum.auto"
] | [((2963, 2969), 'enum.auto', 'auto', ([], {}), '()\n', (2967, 2969), False, 'from enum import IntFlag, auto, Enum, IntEnum\n'), ((2997, 3003), 'enum.auto', 'auto', ([], {}), '()\n', (3001, 3003), False, 'from enum import IntFlag, auto, Enum, IntEnum\n'), ((3036, 3042), 'enum.auto', 'auto', ([], {}), '()\n', (3040, 3042... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from conans import ConanFile, tools
class NinjainstallerConan(ConanFile):
name = 'ninja_installer'
version = '1.8.2'
license = 'MIT'
url = 'https://github.com/kheaactua/conan-ninja-installer'
description = 'Install Nin... | [
"conans.tools.chdir",
"os.path.join",
"os.stat"
] | [((1367, 1407), 'os.path.join', 'os.path.join', (['self.package_folder', '"""bin"""'], {}), "(self.package_folder, 'bin')\n", (1379, 1407), False, 'import os\n'), ((840, 860), 'conans.tools.chdir', 'tools.chdir', (['"""ninja"""'], {}), "('ninja')\n", (851, 860), False, 'from conans import ConanFile, tools\n'), ((1496, ... |
import math
opposite = int(input("Enter the opposite side: "))
adjacent = int(input("Enter the opposite side: "))
hypotenuse = math.sqrt(math.pow(opposite, 2) + math.pow(adjacent, 2))
print(f'hypotenuse = {hypotenuse}') | [
"math.pow"
] | [((138, 159), 'math.pow', 'math.pow', (['opposite', '(2)'], {}), '(opposite, 2)\n', (146, 159), False, 'import math\n'), ((162, 183), 'math.pow', 'math.pow', (['adjacent', '(2)'], {}), '(adjacent, 2)\n', (170, 183), False, 'import math\n')] |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import math
import LPC_rundef
import rundef
import boot
sys.path.append(os.path.abspath(".."))
from gen import LPC_gencore
from gen import LPC_gendef
from ui import LPC_uidef
from ui import uidef
from ui import uivar
from ui import uilang
from mem impo... | [
"os.path.getsize",
"os.path.join",
"boot.target.Target",
"gen.LPC_gencore.secBootLpcGen.__init__",
"boot.bltest.createBootloader",
"os.path.isfile",
"os.path.dirname",
"os.path.isdir",
"utils.misc.align_up",
"os.path.abspath",
"os.remove"
] | [((140, 161), 'os.path.abspath', 'os.path.abspath', (['""".."""'], {}), "('..')\n", (155, 161), False, 'import os\n'), ((1108, 1156), 'os.path.join', 'os.path.join', (['targetBaseDir', '"""bltargetconfig.py"""'], {}), "(targetBaseDir, 'bltargetconfig.py')\n", (1120, 1156), False, 'import os\n'), ((1681, 1710), 'boot.ta... |
import os
import sys
import random
import numpy as np
sys.path.insert(1, os.path.join(sys.path[0], '..'))
from h01_data.parse import get_data as get_raw_data
from h02_learn.model import opt_params
from h02_learn.train import convert_to_loader, _run_language, write_csv, get_data
from utils import argparser
from utils i... | [
"h02_learn.train.get_data",
"random.shuffle",
"h02_learn.train.convert_to_loader",
"h02_learn.train.write_csv",
"os.path.join",
"utils.utils.get_languages",
"h02_learn.model.opt_params.get_opt_params",
"numpy.zeros",
"h02_learn.train._run_language",
"utils.argparser.parse_args",
"h01_data.parse.... | [((74, 105), 'os.path.join', 'os.path.join', (['sys.path[0]', '""".."""'], {}), "(sys.path[0], '..')\n", (86, 105), False, 'import os\n'), ((625, 656), 'h02_learn.train.get_data', 'get_data', (['lang', 'rare_mode', 'args'], {}), '(lang, rare_mode, args)\n', (633, 656), False, 'from h02_learn.train import convert_to_loa... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from rest_framework import serializers
from irekua_database.models import SamplingEvent
from irekua_rest_api.serializers.base import IrekuaModelSerializer
from irekua_rest_api.serializers.base import IrekuaHyperlinkedModelSerializer
from irekua_rest_api... | [
"rest_framework.serializers.PrimaryKeyRelatedField",
"irekua_rest_api.serializers.data_collections.data_collections.SelectSerializer",
"irekua_rest_api.serializers.users.users.SelectSerializer",
"irekua_rest_api.serializers.licences.SelectSerializer",
"irekua_rest_api.serializers.object_types.sampling_event... | [((843, 916), 'rest_framework.serializers.CharField', 'serializers.CharField', ([], {'read_only': '(True)', 'source': '"""collection_site.site.name"""'}), "(read_only=True, source='collection_site.site.name')\n", (864, 916), False, 'from rest_framework import serializers\n'), ((957, 1050), 'rest_framework.serializers.P... |
import matplotlib.pyplot as plt
def plotData(x, y):
"""plots the data points and gives the figure axes labels of
population and profit.
"""
plt.figure() # open a new figure window
# ====================== YOUR CODE HERE ======================
# Instructions: Plot the training data into a fi... | [
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show"
] | [((159, 171), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (169, 171), True, 'import matplotlib.pyplot as plt\n'), ((614, 649), 'matplotlib.pyplot.plot', 'plt.plot', (['x', 'y', '"""rx"""'], {'markersize': '(10)'}), "(x, y, 'rx', markersize=10)\n", (622, 649), True, 'import matplotlib.pyplot as plt\n'), ... |
import functions as f
import itertools
import numpy as np
import plotly.plotly as py
import plotly.graph_objs as go
import random
name = "Peter"
filepath = "C:/Users/Peter/Dropbox/Programming/Python/track-analysis/" + name + "/" + name + ".txt"
count, data = f.getData(filepath)
start, end = f.getDateRange(data)
'''
0... | [
"functions.getDateRange",
"functions.getData"
] | [((260, 279), 'functions.getData', 'f.getData', (['filepath'], {}), '(filepath)\n', (269, 279), True, 'import functions as f\n'), ((293, 313), 'functions.getDateRange', 'f.getDateRange', (['data'], {}), '(data)\n', (307, 313), True, 'import functions as f\n')] |
import json,requests,os,re
json_file = requests.get('https://api-static.mihoyo.com/takumi/misc/api/emoticon_set?gids=2.')
with open('./mhy.json','wb',encoding='utf-8')as f:
f.write(json_file)
with open('./mhy.json','r',encoding='utf-8')as f:
res = json.load(f)
f.close()
d={}
for i in range(1,len... | [
"re.split",
"requests.get",
"json.JSONEncoder",
"os.mkdir",
"json.load"
] | [((42, 129), 'requests.get', 'requests.get', (['"""https://api-static.mihoyo.com/takumi/misc/api/emoticon_set?gids=2."""'], {}), "(\n 'https://api-static.mihoyo.com/takumi/misc/api/emoticon_set?gids=2.')\n", (54, 129), False, 'import json, requests, os, re\n'), ((263, 275), 'json.load', 'json.load', (['f'], {}), '(f... |
import numpy as np
import pytest
from ansys import dpf
from ansys.dpf import core
from ansys.dpf.core import FieldDefinition
from ansys.dpf.core import operators as ops
from ansys.dpf.core.common import locations, shell_layers
@pytest.fixture()
def stress_field(allkindofcomplexity):
model = dpf.core.Model(allkind... | [
"ansys.dpf.core.Model",
"ansys.dpf.core.Field",
"ansys.dpf.core.DataSources",
"numpy.array",
"pytest.fixture",
"ansys.dpf.core.fields_factory.create_3d_vector_field",
"ansys.dpf.core.Operator",
"numpy.arange",
"ansys.dpf.core.Dimensionality.scalar_dim",
"ansys.dpf.core.operators.logic.identical_fi... | [((230, 246), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (244, 246), False, 'import pytest\n'), ((298, 333), 'ansys.dpf.core.Model', 'dpf.core.Model', (['allkindofcomplexity'], {}), '(allkindofcomplexity)\n', (312, 333), False, 'from ansys import dpf\n'), ((457, 473), 'ansys.dpf.core.Field', 'dpf.core.Field'... |
'''
.1111... | Title: ophcrack
.10000000000011. .. | Author: <NAME>
.00 000... | Email: <EMAIL>
1 01.. | Description:
.. | runs ophcrack as a subprocess, parsing stdout.
.. | does not return cracked hashes - ophcrack ... | [
"logging.getLogger",
"threading.Thread.__init__",
"re.compile"
] | [((1873, 1904), 'threading.Thread.__init__', 'threading.Thread.__init__', (['self'], {}), '(self)\n', (1898, 1904), False, 'import threading\n'), ((1924, 1951), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1941, 1951), False, 'import logging\n'), ((2015, 2036), 're.compile', 're.compil... |
import os
from multiprocessing import Pool
import pandas as pd
from scipy.stats import hypergeom
import nltk
from argparse import ArgumentParser
import logging
nltk.download('stopwords')
nltk.download('words')
stop_words = set(nltk.corpus.stopwords.words('english'))
words = set(nltk.corpus.words.words())
def ge... | [
"logging.basicConfig",
"os.listdir",
"nltk.corpus.stopwords.words",
"nltk.download",
"argparse.ArgumentParser",
"pandas.read_csv",
"scipy.stats.hypergeom.sf",
"nltk.corpus.words.words",
"multiprocessing.Pool",
"logging.info"
] | [((165, 191), 'nltk.download', 'nltk.download', (['"""stopwords"""'], {}), "('stopwords')\n", (178, 191), False, 'import nltk\n'), ((192, 214), 'nltk.download', 'nltk.download', (['"""words"""'], {}), "('words')\n", (205, 214), False, 'import nltk\n'), ((232, 270), 'nltk.corpus.stopwords.words', 'nltk.corpus.stopwords.... |
import sys
import importlib
import argparse
import numpy as np
import random
import cmath
import math
from dft import dft, inv_dft
from fft import fft, inv_fft
from rsa import *
#arguments for dft, fft, inverse dft and inverse fft
parameters1 = []
parameters2 = []
i=4
while i<2048:
param1 = list(... | [
"numpy.array_equiv",
"numpy.fft.fft",
"numpy.array",
"numpy.random.randint",
"dft.dft",
"fft.fft"
] | [((320, 363), 'numpy.random.randint', 'np.random.randint', ([], {'low': '(0)', 'high': '(1000)', 'size': 'i'}), '(low=0, high=1000, size=i)\n', (337, 363), True, 'import numpy as np\n'), ((422, 465), 'numpy.random.randint', 'np.random.randint', ([], {'low': '(0)', 'high': '(1000)', 'size': 'i'}), '(low=0, high=1000, si... |
"""Tests for io.py.
"""
import os
import pytest
import tempfile
import unittest.mock as mock
import numpy as np
import pandas as pd
import cytoxnet.dataprep.io
import cytoxnet.data
def test_load_data():
"""Test the load_data function.
Should be able to find files, and package data. Also dropping nans
... | [
"tempfile.TemporaryDirectory",
"pandas.read_csv",
"os.path.join",
"os.path.realpath",
"pytest.raises",
"numpy.array_equal",
"pandas.DataFrame",
"unittest.mock.patch"
] | [((1641, 1678), 'unittest.mock.patch', 'mock.patch', (['"""cytoxnet.dataprep.io.pd"""'], {}), "('cytoxnet.dataprep.io.pd')\n", (1651, 1678), True, 'import unittest.mock as mock\n'), ((1680, 1717), 'unittest.mock.patch', 'mock.patch', (['"""cytoxnet.dataprep.io.os"""'], {}), "('cytoxnet.dataprep.io.os')\n", (1690, 1717)... |
import board
import time
from adafruit_bme280 import basic as adafruit_bme280
import digitalio
import neopixel
i2c = board.I2C()
bme280 = adafruit_bme280.Adafruit_BME280_I2C(i2c)
pixel_pin = board.NEOPIXEL
num_pixels = 1
ORDER = neopixel.GRB
pixels = neopixel.NeoPixel(
pixel_pin, num_pixels, brightness=0.1, auto_... | [
"adafruit_bme280.basic.Adafruit_BME280_I2C",
"neopixel.NeoPixel",
"board.I2C",
"time.sleep"
] | [((118, 129), 'board.I2C', 'board.I2C', ([], {}), '()\n', (127, 129), False, 'import board\n'), ((139, 179), 'adafruit_bme280.basic.Adafruit_BME280_I2C', 'adafruit_bme280.Adafruit_BME280_I2C', (['i2c'], {}), '(i2c)\n', (174, 179), True, 'from adafruit_bme280 import basic as adafruit_bme280\n'), ((253, 350), 'neopixel.N... |
import datetime as dtm
from profile_plot import profile_plot
import matplotlib.pyplot as plt
from matplotlib.font_manager import fontManager, FontProperties
from matplotlib import ticker, cm
import sys
import pandas as pd
import numpy as np
import os
import re
from dateutil import parser
import errno
from shutil import... | [
"re.compile",
"numpy.argsort",
"numpy.array",
"datetime.timedelta",
"os.strerror",
"numpy.arange",
"datetime.datetime",
"os.path.exists",
"textwrap.dedent",
"os.listdir",
"numpy.searchsorted",
"subprocess.Popen",
"matplotlib.pyplot.style.use",
"numpy.round",
"dateutil.parser.parse",
"n... | [((454, 508), 'matplotlib.pyplot.style.use', 'plt.style.use', (["['seaborn-paper', 'seaborn-colorblind']"], {}), "(['seaborn-paper', 'seaborn-colorblind'])\n", (467, 508), True, 'import matplotlib.pyplot as plt\n'), ((3198, 3213), 'numpy.array', 'np.array', (['times'], {}), '(times)\n', (3206, 3213), True, 'import nump... |
from kafka import KafkaConsumer
from kafka.structs import TopicPartition
from msgpack import unpackb
from . import DataSource
class KafkaDataSource(DataSource):
"""Loads data from a Kafka data stream"""
def __init__(self, conf):
super().__init__(conf)
self.require(['bootstrap_servers', 'topic... | [
"kafka.structs.TopicPartition",
"msgpack.unpackb",
"kafka.KafkaConsumer"
] | [((1970, 2026), 'kafka.KafkaConsumer', 'KafkaConsumer', ([], {'bootstrap_servers': 'self._bootstrap_servers'}), '(bootstrap_servers=self._bootstrap_servers)\n', (1983, 2026), False, 'from kafka import KafkaConsumer\n'), ((2163, 2193), 'kafka.structs.TopicPartition', 'TopicPartition', (['self._topic', '(0)'], {}), '(sel... |
# coding: utf-8
"""
Copyright 2019 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://www.apache.org/licenses/LICENSE-2.0
or in ... | [
"six.iteritems"
] | [((22722, 22755), 'six.iteritems', 'six.iteritems', (['self.swagger_types'], {}), '(self.swagger_types)\n', (22735, 22755), False, 'import six\n')] |
from flask import render_template, flash, redirect, session, url_for, request, g
from flask.ext.login import login_user, logout_user, current_user, login_required
from app import app, db, lm, oid
from .forms import LoginForm, EditForm, RegisterForm, CreateC
from .models import User, UserSettings, Character
from datetim... | [
"flask.render_template",
"app.db.session.commit",
"re.compile",
"datetime.datetime.utcnow",
"flask.ext.login.logout_user",
"flask.url_for",
"datetime.datetime.now",
"app.app.route",
"app.db.session.add",
"flask.ext.login.login_user",
"re.sub"
] | [((771, 785), 'app.app.route', 'app.route', (['"""/"""'], {}), "('/')\n", (780, 785), False, 'from app import app, db, lm, oid\n'), ((844, 888), 'app.app.route', 'app.route', (['"""/login"""'], {'methods': "['GET', 'POST']"}), "('/login', methods=['GET', 'POST'])\n", (853, 888), False, 'from app import app, db, lm, oid... |
""" Utilities to make and assert transfers. """
import random
import gevent
from raiden.constants import UINT64_MAX
from raiden.message_handler import MessageHandler
from raiden.messages import LockedTransfer, LockExpired
from raiden.tests.utils.factories import make_address
from raiden.transfer import channel, views... | [
"raiden.transfer.channel.register_offchain_secret",
"raiden.transfer.mediated_transfer.state.lockedtransfersigned_from_message",
"raiden.transfer.channel.handle_receive_lockedtransfer",
"raiden.transfer.channel.get_amount_locked",
"raiden.utils.signer.LocalSigner",
"raiden.transfer.merkle_tree.compute_lay... | [((2694, 2711), 'gevent.sleep', 'gevent.sleep', (['(0.3)'], {}), '(0.3)\n', (2706, 2711), False, 'import gevent\n'), ((3607, 3670), 'raiden.transfer.channel.get_balance', 'channel.get_balance', (['channel0.our_state', 'channel0.partner_state'], {}), '(channel0.our_state, channel0.partner_state)\n', (3626, 3670), False,... |
# -*- coding: utf-8 -*-
import os
import tempfile
from marshmallow import Schema, fields
from ddb.feature.schema import FeatureSchema
class CookiecutterOptions(Schema):
"""
Cookiecutter options
"""
no_input = fields.Boolean(allow_none=True, default=None)
replay = fields.Boolean(allow_none=True, ... | [
"os.path.join",
"marshmallow.fields.Raw",
"tempfile.gettempdir",
"marshmallow.fields.Dict",
"marshmallow.fields.String",
"marshmallow.fields.Boolean"
] | [((229, 274), 'marshmallow.fields.Boolean', 'fields.Boolean', ([], {'allow_none': '(True)', 'default': 'None'}), '(allow_none=True, default=None)\n', (243, 274), False, 'from marshmallow import Schema, fields\n'), ((288, 334), 'marshmallow.fields.Boolean', 'fields.Boolean', ([], {'allow_none': '(True)', 'default': '(Fa... |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2022- <NAME>
#
# Distributed under the terms of the MIT License
# (see wavespin/__init__.py for details)
# -----------------------------------------------------------------------------
from ...fronten... | [
"math.sqrt",
"math.log2",
"numpy.isnan",
"copy.deepcopy",
"warnings.warn",
"numpy.cumsum"
] | [((1377, 1391), 'math.sqrt', 'math.sqrt', (['(0.5)'], {}), '(0.5)\n', (1386, 1391), False, 'import math\n'), ((31725, 31736), 'copy.deepcopy', 'deepcopy', (['I'], {}), '(I)\n', (31733, 31736), False, 'from copy import deepcopy\n'), ((36594, 36645), 'numpy.cumsum', 'np.cumsum', (["[(not p['is_cqt']) for p in self.psi1_f... |
import re
from rest_framework import status
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import permissions
from userapp.models import User, CustomUser
from addressapp.serializers.activity import ActivitySerializer,\
ActivityAreaSerializer
from addressapp.... | [
"addressapp.models.ActivityArea.objects.get",
"addressapp.models.Activity.objects.all",
"addressapp.models.ActivityArea.objects.filter",
"addressapp.serializers.activity.ActivityAreaSerializer",
"addressapp.models.ActivityArea",
"addressapp.serializers.activity.ActivitySerializer",
"rest_framework.respo... | [((884, 906), 'addressapp.models.Activity.objects.all', 'Activity.objects.all', ([], {}), '()\n', (904, 906), False, 'from addressapp.models import Activity, ActivityArea\n'), ((928, 1001), 'addressapp.serializers.activity.ActivitySerializer', 'ActivitySerializer', (['activity_obj'], {'many': '(True)', 'context': "{'re... |
# -*- coding: utf-8 -*-
import datetime
import json
import logging
import werkzeug
from werkzeug.exceptions import BadRequest
from odoo import SUPERUSER_ID, api, http, _
from odoo import registry as registry_get
from odoo.addons.auth_oauth.controllers.main import OAuthController as Controller
from odoo.addons.web.contr... | [
"logging.getLogger",
"odoo.http.request.render",
"odoo.http.request.params.copy",
"odoo.http.db_filter",
"werkzeug.urls.url_parse",
"odoo.api.Environment",
"json.dumps",
"werkzeug.utils.redirect",
"odoo.http.route",
"datetime.datetime.now",
"odoo.http.request.env.user.has_group",
"odoo.registr... | [((453, 480), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (470, 480), False, 'import logging\n'), ((524, 613), 'odoo.http.route', 'http.route', (['"""/web/login/sms"""'], {'type': '"""http"""', 'auth': '"""public"""', 'website': '(True)', 'sitemap': '(False)'}), "('/web/login/sms', typ... |
from os import environ
from subprocess import call
import random
from sys import getsizeof
from pandas import DataFrame
from mann2 import agent_lens_recurrent
from mann2.utils.tail import tail
class AgentLensAttitudeDiffusion(agent_lens_recurrent.AgentLensRecurrent):
num_class_insances = 0
def __init__(sel... | [
"random.sample",
"sys.getsizeof",
"subprocess.call",
"pandas.DataFrame",
"mann2.utils.tail.tail"
] | [((9437, 9473), 'pandas.DataFrame', 'DataFrame', (["{'outfile': output_lines}"], {}), "({'outfile': output_lines})\n", (9446, 9473), False, 'from pandas import DataFrame\n'), ((9886, 9921), 'pandas.DataFrame', 'DataFrame', (["{'pos': pos, 'neg': neg}"], {}), "({'pos': pos, 'neg': neg})\n", (9895, 9921), False, 'from pa... |
from typing import List, Optional
import databases
import sqlalchemy
from fastapi import FastAPI
import ormar
app = FastAPI()
metadata = sqlalchemy.MetaData()
database = databases.Database("sqlite:///test.db")
app.state.database = database
@app.on_event("startup")
async def startup() -> None:
database_ = app.s... | [
"ormar.Integer",
"ormar.ForeignKey",
"fastapi.FastAPI",
"databases.Database",
"sqlalchemy.MetaData",
"ormar.String"
] | [((119, 128), 'fastapi.FastAPI', 'FastAPI', ([], {}), '()\n', (126, 128), False, 'from fastapi import FastAPI\n'), ((140, 161), 'sqlalchemy.MetaData', 'sqlalchemy.MetaData', ([], {}), '()\n', (159, 161), False, 'import sqlalchemy\n'), ((173, 212), 'databases.Database', 'databases.Database', (['"""sqlite:///test.db"""']... |