code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import tensorflow as tf
from ..fastspeech.model import (
TFFastSpeechEncoder,
TFTacotronPostnet,
TFFastSpeechLayer,
)
from ..speechsplit.model import InterpLnr
import numpy as np
import copy
class Encoder_6(tf.keras.layers.Layer):
def __init__(self, config, hparams, **kwargs):
super(Encoder_6,... | [
"tensorflow.shape",
"tensorflow.reduce_max",
"tensorflow.concat",
"tensorflow.keras.layers.Dense",
"copy.deepcopy",
"tensorflow.expand_dims",
"tensorflow.sequence_mask"
] | [((639, 728), 'tensorflow.keras.layers.Dense', 'tf.keras.layers.Dense', ([], {'units': 'self.dim_enc_3', 'dtype': 'tf.float32', 'name': '"""before_dense_1"""'}), "(units=self.dim_enc_3, dtype=tf.float32, name=\n 'before_dense_1')\n", (660, 728), True, 'import tensorflow as tf\n'), ((766, 787), 'copy.deepcopy', 'copy... |
#!/usr/bin/env python
#
# $Id$
#
"""
Note: this is targeted for python 2.x.
To run it under python 3.x you need to use 2to3 tool first:
$ 2to3 -w test/test_memory_leaks.py
"""
import os
import gc
import sys
import unittest
import psutil
from test_psutil import reap_children, skipUnless, skipIf, \
... | [
"unittest.TestSuite",
"unittest.makeSuite",
"test_psutil.skipUnless",
"test_psutil.skipIf",
"gc.collect",
"os.getpid",
"test_psutil.reap_children",
"unittest.TextTestRunner"
] | [((1864, 1877), 'test_psutil.skipIf', 'skipIf', (['POSIX'], {}), '(POSIX)\n', (1870, 1877), False, 'from test_psutil import reap_children, skipUnless, skipIf, POSIX, LINUX, WINDOWS, OSX, BSD\n'), ((2382, 2401), 'test_psutil.skipUnless', 'skipUnless', (['WINDOWS'], {}), '(WINDOWS)\n', (2392, 2401), False, 'from test_psu... |
import csv
import pandas as pd
import numpy as np
import networkx as nx
class RouteFinder():
def __init__(self):
G = nx.Graph()
with open('data/node_pairs.csv') as csvfile:
readCSV = csv.reader(csvfile, delimiter=',')
for row in readCSV:
# add edges
... | [
"networkx.shortest_path",
"networkx.Graph",
"csv.reader"
] | [((132, 142), 'networkx.Graph', 'nx.Graph', ([], {}), '()\n', (140, 142), True, 'import networkx as nx\n'), ((417, 427), 'networkx.Graph', 'nx.Graph', ([], {}), '()\n', (425, 427), True, 'import networkx as nx\n'), ((796, 836), 'networkx.shortest_path', 'nx.shortest_path', (['self.G', 'source', 'target'], {}), '(self.G... |
#!/usr/bin/env python
# <NAME>, 2013 (zougloub)
"""
reStructuredText support (experimental)
Example::
def configure(conf):
conf.load('rst')
if not conf.env.RST2HTML:
conf.fatal('The program rst2html is required')
def build(bld):
bld(
features = 'rst',
type = 'rst2html', # rst2html, rst2pdf, ...
... | [
"waflib.Errors.WafError",
"re.compile",
"waflib.TaskGen.feature",
"waflib.Logs.debug",
"waflib.TaskGen.before_method",
"waflib.Logs.warn"
] | [((5482, 5496), 'waflib.TaskGen.feature', 'feature', (['"""rst"""'], {}), "('rst')\n", (5489, 5496), False, 'from waflib.TaskGen import feature\n'), ((5498, 5529), 'waflib.TaskGen.before_method', 'before_method', (['"""process_source"""'], {}), "('process_source')\n", (5511, 5529), False, 'from waflib.TaskGen import be... |
# from utils import Sample_main
import gradcam_main
import numpy as np
import tensorflow as tf
import argparse
import os
tf.logging.set_verbosity(tf.logging.ERROR) # disable to see tensorflow warnings
def cam(in_path='sample.bmp', out_path = 'sample.png',):
gradcam_main.cam_vis(in_path, out_path)
def main():
... | [
"gradcam_main.cam_vis",
"tensorflow.logging.set_verbosity",
"argparse.ArgumentParser"
] | [((122, 164), 'tensorflow.logging.set_verbosity', 'tf.logging.set_verbosity', (['tf.logging.ERROR'], {}), '(tf.logging.ERROR)\n', (146, 164), True, 'import tensorflow as tf\n'), ((266, 305), 'gradcam_main.cam_vis', 'gradcam_main.cam_vis', (['in_path', 'out_path'], {}), '(in_path, out_path)\n', (286, 305), False, 'impor... |
'''
Part of the dibase.rpi.gpio.test package.
GPIO pin id support classes' platform tests.
Underlying GPIO pin ids are those used by the Linux gpiolib and used
to identify a device's GPIO pins in the Linux sys filesystem GPIO
sub-tree.
Developed by <NAME> / Dibase Limited.
Copyrig... | [
"unittest.main",
"sys.path.insert",
"dibase.rpi.gpio.pinid.PinId.p1_sda",
"dibase.rpi.gpio.pinid.PinId._get_rpi_major_revision_index"
] | [((515, 550), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""./../../../.."""'], {}), "(0, './../../../..')\n", (530, 550), False, 'import sys\n'), ((1230, 1245), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1243, 1245), False, 'import unittest\n'), ((757, 800), 'dibase.rpi.gpio.pinid.PinId._get_rpi_major_r... |
"""
Analysis code for plotting vertical flux transport and/or a gif of temperature,
velocity and KE from the merged output of a Dedalus Rayleigh-Bérnard code.
Author: <NAME>
"""
# ====================
# IMPORTS
# ====================
import numpy as np
import h5py
import argparse
import matplotlib.pyplot as plt
import ... | [
"numpy.array",
"imageio.get_writer",
"argparse.ArgumentParser",
"numpy.max",
"os.path.normpath",
"matplotlib.pyplot.close",
"matplotlib.gridspec.GridSpec",
"numpy.linspace",
"numpy.min",
"numpy.meshgrid",
"dedalus.public.Fourier",
"numpy.abs",
"matplotlib.pyplot.savefig",
"h5py.File",
"n... | [((553, 578), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (576, 578), False, 'import argparse\n'), ((1187, 1239), 'dedalus.public.Fourier', 'de.Fourier', (['"""y"""', '(256)'], {'interval': '(0, a)', 'dealias': '(3 / 2)'}), "('y', 256, interval=(0, a), dealias=3 / 2)\n", (1197, 1239), True, ... |
from plumbum import local
from benchbuild import project
from benchbuild.utils import compiler, download, run, wrapping
from benchbuild.utils.cmd import make, mkdir
@download.with_git("https://github.com/bsc-pm/bots", limit=5)
class BOTSGroup(project.Project):
"""
Barcelona OpenMP Task Suite.
Barcelona ... | [
"benchbuild.utils.compiler.cc",
"benchbuild.utils.wrapping.wrap",
"benchbuild.utils.download.with_git",
"plumbum.local.path",
"plumbum.local.cwd",
"benchbuild.utils.run.run"
] | [((169, 229), 'benchbuild.utils.download.with_git', 'download.with_git', (['"""https://github.com/bsc-pm/bots"""'], {'limit': '(5)'}), "('https://github.com/bsc-pm/bots', limit=5)\n", (186, 229), False, 'from benchbuild.utils import compiler, download, run, wrapping\n'), ((2385, 2402), 'benchbuild.utils.compiler.cc', '... |
# Copyright (c) 2020 Graphcore Ltd. 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 la... | [
"pytest.mark.ipus",
"numpy.ones",
"numpy.float32",
"tensorflow.compat.v1.Session",
"pathlib.Path",
"tensorflow.placeholder",
"din.din_model.DIN.build_fcn_net",
"tensorflow.global_variables_initializer",
"tensorflow.set_random_seed",
"common.utils.din_attention"
] | [((977, 1001), 'tensorflow.set_random_seed', 'tf.set_random_seed', (['seed'], {}), '(seed)\n', (995, 1001), True, 'import tensorflow as tf\n'), ((1028, 1047), 'pytest.mark.ipus', 'pytest.mark.ipus', (['(1)'], {}), '(1)\n', (1044, 1047), False, 'import pytest\n'), ((1319, 1346), 'numpy.ones', 'np.ones', (['[4, 2]', 'np.... |
# -*- coding: utf-8 -*-
"""
Deterimines the reflectance based on r and mua.
"""
import math
import helpers.analyticalvalues as av
def reflectance(mua, r):
"""
mua: the absorption coefficient used.
r: the radial distance used.
"""
values = av.analyticalValues(r, mua)
# the value of th... | [
"math.exp",
"helpers.analyticalvalues.analyticalValues"
] | [((266, 293), 'helpers.analyticalvalues.analyticalValues', 'av.analyticalValues', (['r', 'mua'], {}), '(r, mua)\n', (285, 293), True, 'import helpers.analyticalvalues as av\n'), ((408, 444), 'math.exp', 'math.exp', (['(-values.ueff * values.rho1)'], {}), '(-values.ueff * values.rho1)\n', (416, 444), False, 'import math... |
from contextlib import contextmanager
from functools import partial
from inspect import Parameter
from random import choice, randint, uniform
import string
from typing import Any
from i2 import Sig
from numbers import Number
from sys import platform
from selenium.common.exceptions import NoSuchElementException
from sel... | [
"selenium.webdriver.ChromeOptions",
"i2.Sig",
"webdriver_manager.chrome.ChromeDriverManager",
"pickle.dumps",
"time.sleep",
"strand.run_process",
"dill.dumps"
] | [((2734, 2744), 'time.sleep', 'sleep', (['(0.5)'], {}), '(0.5)\n', (2739, 2744), False, 'from time import sleep\n'), ((1014, 1033), 'pickle.dumps', 'pickle.dumps', (['funcs'], {}), '(funcs)\n', (1026, 1033), False, 'import pickle\n'), ((1090, 1107), 'dill.dumps', 'dill.dumps', (['funcs'], {}), '(funcs)\n', (1100, 1107)... |
import requests, json, bs4, urllib.parse, math
from . import Course, Platform
class Edx(Platform):
name = 'edX'
def _urls(self):
res = requests.get(make_url())
count = json.loads(res.text)['objects']['count']
num_pages = math.ceil(count / 20)
urls = [make_url(pag... | [
"bs4.BeautifulSoup",
"json.loads",
"math.ceil",
"requests.get"
] | [((3918, 3949), 'bs4.BeautifulSoup', 'bs4.BeautifulSoup', (['html', '"""lxml"""'], {}), "(html, 'lxml')\n", (3935, 3949), False, 'import requests, json, bs4, urllib.parse, math\n'), ((269, 290), 'math.ceil', 'math.ceil', (['(count / 20)'], {}), '(count / 20)\n', (278, 290), False, 'import requests, json, bs4, urllib.pa... |
# Generated by Django 2.2.5 on 2019-09-09 21:21
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),
('relations', '0001_initia... | [
"django.db.models.DateField",
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.BooleanField",
"django.db.models.AutoField",
"django.db.models.DateTimeField",
"django.db.migrations.swappable_dependency",
"django.db.models.CharField"
] | [((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'), ((456, 549), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)... |
#!/usr/bin/env python
import pytest
"""
Test 268. Missing Number
"""
@pytest.fixture(scope="session")
def init_variables_268():
from src.leetcode_268_missing_number import Solution
solution = Solution()
def _init_variables_268():
return solution
yield _init_variables_268
class TestClass... | [
"pytest.fixture",
"src.leetcode_268_missing_number.Solution"
] | [((74, 105), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (88, 105), False, 'import pytest\n'), ((205, 215), 'src.leetcode_268_missing_number.Solution', 'Solution', ([], {}), '()\n', (213, 215), False, 'from src.leetcode_268_missing_number import Solution\n')] |
import unittest
import os
import json
from functions.db.connector import *
from functions.db.models import *
from functions.authentication import *
sample_search = {
"search_groups": [
{
"search_terms": ["blockchain", "distributed ledger"],
"match": "OR"
},
{
... | [
"unittest.main",
"json.load",
"os.path.dirname"
] | [((5653, 5668), 'unittest.main', 'unittest.main', ([], {}), '()\n', (5666, 5668), False, 'import unittest\n'), ((781, 796), 'json.load', 'json.load', (['file'], {}), '(file)\n', (790, 796), False, 'import json\n'), ((1378, 1393), 'json.load', 'json.load', (['file'], {}), '(file)\n', (1387, 1393), False, 'import json\n'... |
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | [
"numpy.random.random",
"numpy.zeros_like",
"paddle.enable_static",
"numpy.array",
"numpy.random.randint",
"paddle.fluid.core.globals",
"unittest.main",
"paddle.NPUPlace",
"sys.path.append"
] | [((670, 691), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (685, 691), False, 'import sys\n'), ((895, 917), 'paddle.enable_static', 'paddle.enable_static', ([], {}), '()\n', (915, 917), False, 'import paddle\n'), ((2536, 2551), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2549, 2551), F... |
import aspose.email as ae
import datetime
def run():
# The path to the File directory.
dataDir = "Data/"
#ExStart: SetEmailHeaders
# Create an instance of MailMessage class
eml = ae.MailMessage()
# Specify ReplyTo, From, To field, Cc and Bcc Addresses
eml.reply_to_list.Add("<EMAIL>")
... | [
"datetime.datetime",
"aspose.email.MailAddress",
"aspose.email.MailMessage"
] | [((201, 217), 'aspose.email.MailMessage', 'ae.MailMessage', ([], {}), '()\n', (215, 217), True, 'import aspose.email as ae\n'), ((722, 758), 'datetime.datetime', 'datetime.datetime', (['(2006)', '(3)', '(6)', '(12)', '(0)'], {}), '(2006, 3, 6, 12, 0)\n', (739, 758), False, 'import datetime\n'), ((371, 411), 'aspose.ema... |
import math
import numpy as np
import pandas as pd
class PenmanMonteithDaily(object):
r"""The class *PenmanMonteithDaily* calculates daily potential evapotranspiration according to the Penman-Monteith
method as described in
`FAO 56 <http://www.fao.org/tempref/SD/Reserved/Agromet/PET/FAO_Irrigation_Drainag... | [
"numpy.radians",
"numpy.mean",
"numpy.sqrt",
"numpy.tan",
"numpy.where",
"numpy.log",
"math.log",
"numpy.exp",
"numpy.array",
"numpy.cos",
"numpy.sin",
"math.exp",
"pandas.to_datetime"
] | [((15037, 15055), 'numpy.mean', 'np.mean', (['t'], {'axis': '(0)'}), '(t, axis=0)\n', (15044, 15055), True, 'import numpy as np\n'), ((15924, 15943), 'numpy.mean', 'np.mean', (['sl'], {'axis': '(0)'}), '(sl, axis=0)\n', (15931, 15943), True, 'import numpy as np\n'), ((40204, 40241), 'numpy.where', 'np.where', (['(self.... |
from pathlib import Path
import logging
from .logger import Logger
from .log_formatter import LogFormatter
class FileLogger(Logger):
fmt = LogFormatter(use_colour=False, output_ts=False)
logger = None
def __init__(self, folder, format=None):
if format is None:
format = ("%(asctime)s|... | [
"logging.getLogger",
"logging.Formatter",
"logging.FileHandler",
"pathlib.Path"
] | [((370, 395), 'logging.Formatter', 'logging.Formatter', (['format'], {}), '(format)\n', (387, 395), False, 'import logging\n'), ((416, 440), 'pathlib.Path', 'Path', (['folder', '"""sayn.log"""'], {}), "(folder, 'sayn.log')\n", (420, 440), False, 'from pathlib import Path\n'), ((549, 578), 'logging.FileHandler', 'loggin... |
from pygsuite import DefaultFonts, TextStyle, Color
from pygsuite.docs.doc_elements.paragraph import Paragraph
BRIGHT_GREEN_HEX = "#72FF33"
def test_text(test_document):
document = test_document
docbody = document.body
docbody.delete()
docbody.add_text(
"TEST_CUSTOM\n",
style=TextStyl... | [
"pygsuite.Color"
] | [((1325, 1352), 'pygsuite.Color', 'Color', ([], {'hex': 'BRIGHT_GREEN_HEX'}), '(hex=BRIGHT_GREEN_HEX)\n', (1330, 1352), False, 'from pygsuite import DefaultFonts, TextStyle, Color\n'), ((359, 386), 'pygsuite.Color', 'Color', ([], {'hex': 'BRIGHT_GREEN_HEX'}), '(hex=BRIGHT_GREEN_HEX)\n', (364, 386), False, 'from pygsuit... |
# 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... | [
"tensorflow.tile",
"neutra.utils.LogAndSaveHParams",
"tensorflow.matrix_diag_part",
"tensorflow.group",
"tensorflow.nn.softplus",
"neutra.utils.LogAndSummarizeMetrics",
"absl.flags.DEFINE_float",
"numpy.arange",
"tensorflow.image.resize_nearest_neighbor",
"tensorflow.gfile.Exists",
"tensorflow.S... | [((7472, 7509), 'gin.configurable', 'gin.configurable', (['"""conv_hier_encoder"""'], {}), "('conv_hier_encoder')\n", (7488, 7509), False, 'import gin\n'), ((8570, 8610), 'gin.configurable', 'gin.configurable', (['"""conv_hier_prior_post"""'], {}), "('conv_hier_prior_post')\n", (8586, 8610), False, 'import gin\n'), ((1... |
from flask import request, session, url_for
from requests_oauthlib import OAuth2Session
class OAuth2Login(object):
def __init__(self, app=None):
if app:
self.init_app(app)
self.app = app
def get_config(self, app, name, default_value=None):
return app.config.get(self.config_prefix + name, def... | [
"requests_oauthlib.OAuth2Session",
"flask.url_for"
] | [((832, 909), 'flask.url_for', 'url_for', (['self.redirect_endpoint'], {'_external': '(True)', '_scheme': 'self.redirect_scheme'}), '(self.redirect_endpoint, _external=True, _scheme=self.redirect_scheme)\n', (839, 909), False, 'from flask import request, session, url_for\n'), ((968, 1047), 'requests_oauthlib.OAuth2Sess... |
# coding: utf-8
import socketserver
import re
import socket
import datetime
import os
import mimetypes as MT
import sys
# Copyright 2013 <NAME>, <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 ... | [
"re.split",
"socketserver.TCPServer",
"mimetypes.guess_type",
"os.getcwd",
"datetime.datetime.now",
"sys.exit",
"os.path.abspath"
] | [((8002, 8013), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (8011, 8013), False, 'import os\n'), ((8136, 8162), 'os.path.abspath', 'os.path.abspath', (['file.name'], {}), '(file.name)\n', (8151, 8162), False, 'import os\n'), ((8629, 8678), 'socketserver.TCPServer', 'socketserver.TCPServer', (['(HOST, PORT)', 'MyWebServ... |
# -*- coding: utf-8 -*-
# Copyright 2015 <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 appli... | [
"cloudkitty.rating.hash.controllers.group.HashMapGroupsController",
"cloudkitty.rating.hash.controllers.threshold.HashMapThresholdsController",
"cloudkitty.rating.hash.controllers.field.HashMapFieldsController",
"cloudkitty.rating.hash.controllers.mapping.HashMapMappingsController",
"cloudkitty.rating.hash.... | [((1341, 1380), 'cloudkitty.rating.hash.controllers.service.HashMapServicesController', 'service_api.HashMapServicesController', ([], {}), '()\n', (1378, 1380), True, 'from cloudkitty.rating.hash.controllers import service as service_api\n'), ((1394, 1429), 'cloudkitty.rating.hash.controllers.field.HashMapFieldsControl... |
import os, re, errno
import markdown
import cgi
from cuddlefish import packaging
from cuddlefish.docs import apirenderer
from cuddlefish._version import get_versions
INDEX_PAGE = '/doc/static-files/base.html'
BASE_URL_INSERTION_POINT = '<base '
VERSION_INSERTION_POINT = '<div id="version">'
THIRD_PARTY_PACKAGE_SUMMAR... | [
"markdown.markdown",
"cuddlefish.packaging.build_pkg_index",
"cuddlefish._version.get_versions",
"cuddlefish.packaging.build_pkg_cfg",
"os.path.splitext",
"cuddlefish.docs.apirenderer.md_to_div",
"cgi.escape",
"os.walk",
"re.search"
] | [((732, 749), 'os.walk', 'os.walk', (['doc_path'], {}), '(doc_path)\n', (739, 749), False, 'import os, re, errno\n'), ((1978, 2007), 'cuddlefish.packaging.build_pkg_cfg', 'packaging.build_pkg_cfg', (['root'], {}), '(root)\n', (2001, 2007), False, 'from cuddlefish import packaging\n'), ((2037, 2076), 'cuddlefish.packagi... |
# ------------------------------------------------------------------------------------------------ #
# MIT License #
# #
# Copyright (c) 2... | [
"numpy.abs",
"numpy.isclose",
"chex.assert_rank",
"numpy.arange",
"numpy.asarray",
"chex.assert_equal_shape",
"numpy.concatenate",
"numpy.full",
"numpy.maximum",
"numpy.random.RandomState"
] | [((4815, 4850), 'numpy.random.RandomState', 'onp.random.RandomState', (['random_seed'], {}), '(random_seed)\n', (4837, 4850), True, 'import numpy as onp\n'), ((5253, 5299), 'numpy.isclose', 'onp.isclose', (['new_alpha', 'self._alpha'], {'rtol': '(0.01)'}), '(new_alpha, self._alpha, rtol=0.01)\n', (5264, 5299), True, 'i... |
"""
@author: ludvigolsen
"""
from typing import Union
import numpy as np
import pandas as pd
from utipy.utils.check_instance import check_instance
from utipy.utils.convert_to_type import convert_to_type
def blend(x1: Union[list, np.ndarray, pd.Series], x2: Union[list, np.ndarray, pd.Series], amount: float = 0.5) -> ... | [
"utipy.utils.check_instance.check_instance",
"numpy.multiply",
"utipy.utils.convert_to_type.convert_to_type"
] | [((1154, 1172), 'utipy.utils.check_instance.check_instance', 'check_instance', (['x1'], {}), '(x1)\n', (1168, 1172), False, 'from utipy.utils.check_instance import check_instance\n'), ((1192, 1219), 'numpy.multiply', 'np.multiply', (['x1', '(1 - amount)'], {}), '(x1, 1 - amount)\n', (1203, 1219), True, 'import numpy as... |
from typing import List
from pydantic import BaseModel
from icolos.core.containers.compound import Conformer, unroll_conformers
from icolos.utils.enums.step_enums import StepRMSDEnum, StepDataManipulationEnum
from icolos.core.workflow_steps.step import _LE
from icolos.core.workflow_steps.calculation.base import StepCa... | [
"icolos.utils.enums.step_enums.StepRMSDEnum",
"icolos.utils.enums.step_enums.StepDataManipulationEnum"
] | [((341, 355), 'icolos.utils.enums.step_enums.StepRMSDEnum', 'StepRMSDEnum', ([], {}), '()\n', (353, 355), False, 'from icolos.utils.enums.step_enums import StepRMSDEnum, StepDataManipulationEnum\n'), ((363, 389), 'icolos.utils.enums.step_enums.StepDataManipulationEnum', 'StepDataManipulationEnum', ([], {}), '()\n', (38... |
# -*- coding: utf-8 -*-
# Copyright (c) 2017, <NAME> and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe.website.utils import delete_page_cache
class IOTHomepage(Document):
def validate(self):
... | [
"frappe._",
"frappe.website.utils.delete_page_cache"
] | [((434, 463), 'frappe.website.utils.delete_page_cache', 'delete_page_cache', (['"""iot_home"""'], {}), "('iot_home')\n", (451, 463), False, 'from frappe.website.utils import delete_page_cache\n'), ((369, 431), 'frappe._', 'frappe._', (['"""This is an example website auto-generated from IOT"""'], {}), "('This is an exam... |
from __future__ import annotations
from typing import Callable, Sequence, TYPE_CHECKING
import functools
if TYPE_CHECKING:
from .build import BuildStepCallable
def split_step_name(name: str, new = ' ', old='_'):
return name.replace(old, new).capitalize()
def print_step_name(formatter=split_step_name, args: Se... | [
"functools.wraps"
] | [((484, 505), 'functools.wraps', 'functools.wraps', (['func'], {}), '(func)\n', (499, 505), False, 'import functools\n'), ((766, 787), 'functools.wraps', 'functools.wraps', (['func'], {}), '(func)\n', (781, 787), False, 'import functools\n')] |
"""
metrics application instance
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2021 <NAME>
:License: Revised BSD (see `LICENSE` file for details)
"""
import os
from byceps.config import ConfigurationError
from byceps.metrics.application import create_app
ENV_VAR_NAME_DATABASE_URI = 'DATABASE_URI'
database_uri = ... | [
"byceps.metrics.application.create_app",
"os.environ.get",
"byceps.config.ConfigurationError"
] | [((320, 361), 'os.environ.get', 'os.environ.get', (['ENV_VAR_NAME_DATABASE_URI'], {}), '(ENV_VAR_NAME_DATABASE_URI)\n', (334, 361), False, 'import os\n'), ((539, 563), 'byceps.metrics.application.create_app', 'create_app', (['database_uri'], {}), '(database_uri)\n', (549, 563), False, 'from byceps.metrics.application i... |
from enum import Enum
import pytest
import gino
from gino.dialects.aiomysql import AsyncEnum
pytestmark = pytest.mark.asyncio
db = gino.Gino()
class MyEnum(Enum):
ONE = "one"
TWO = "two"
class Blog(db.Model):
__tablename__ = "s_blog"
id = db.Column(db.BigInteger(), primary_key=True)
title = ... | [
"gino.Gino",
"gino.dialects.aiomysql.AsyncEnum"
] | [((134, 145), 'gino.Gino', 'gino.Gino', ([], {}), '()\n', (143, 145), False, 'import gino\n'), ((593, 610), 'gino.dialects.aiomysql.AsyncEnum', 'AsyncEnum', (['MyEnum'], {}), '(MyEnum)\n', (602, 610), False, 'from gino.dialects.aiomysql import AsyncEnum\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import re
from gdcmdtools.base import BASE_INFO
from gdcmdtools.base import DEBUG_LEVEL
from gdcmdtools.get import GDGet
from gdcmdtools.get import export_format
import argparse
from argparse import RawTextHelpFormatter
from pprint import pprint
import logg... | [
"logging.getLogger",
"gdcmdtools.get.export_format.iterkeys",
"argparse.ArgumentParser",
"gdcmdtools.get.GDGet",
"sys.exit",
"re.search"
] | [((333, 352), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (350, 352), False, 'import logging\n'), ((552, 754), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': "('%s v%s - %s - %s (%s)' % (__THIS_APP, __THIS_VERSION, __THIS_DESCRIPTION,\n BASE_INFO['app'], BASE_INFO['descrip... |
# -*- coding: utf-8 -*-
from Lotus.app import app
from flask import render_template
@app.route('/')
def index():
return 'welcome'
@app.errorhandler(404)
def page_not_found(error):
return render_template('404.html')
@app.errorhandler(405)
def request_method_error(error):
return render_template('405.htm... | [
"flask.render_template",
"Lotus.app.app.errorhandler",
"Lotus.app.app.route"
] | [((87, 101), 'Lotus.app.app.route', 'app.route', (['"""/"""'], {}), "('/')\n", (96, 101), False, 'from Lotus.app import app\n'), ((139, 160), 'Lotus.app.app.errorhandler', 'app.errorhandler', (['(404)'], {}), '(404)\n', (155, 160), False, 'from Lotus.app import app\n'), ((230, 251), 'Lotus.app.app.errorhandler', 'app.e... |
"""Git interface."""
from __future__ import annotations
import contextlib
import functools
import operator
import re
import subprocess # noqa: S404
from dataclasses import dataclass
from dataclasses import field
from pathlib import Path
from typing import Any
from typing import cast
from typing import Iterator
from t... | [
"re.compile",
"functools.reduce",
"pathlib.Path",
"retrocookie.utils.removeprefix",
"subprocess.run",
"dataclasses.dataclass",
"pathlib.Path.cwd",
"typing.cast",
"pygit2.init_repository",
"contextlib.suppress",
"pygit2.Repository",
"dataclasses.field"
] | [((697, 811), 're.compile', 're.compile', (['"""\n (?P<major>\\\\d+)\\\\.\n (?P<minor>\\\\d+)\n (\\\\.(?P<patch>\\\\d+))?\n """', 're.VERBOSE'], {}), '(\n """\n (?P<major>\\\\d+)\\\\.\n (?P<minor>\\\\d+)\n (\\\\.(?P<patch>\\\\d+))?\n """\n , re.VERBOSE)\n', (707, 811), False, 'import re\n'... |
from datetime import datetime
from enum import Enum
from json.encoder import ESCAPE_ASCII, ESCAPE_DCT # type: ignore
from typing import List, Optional, Tuple, TypedDict
class JsonTruncText:
def __init__(self, text="", truncated=False, added_bytes=0):
self.text = text
self.truncated = truncated
... | [
"json.encoder.ESCAPE_ASCII.finditer"
] | [((1126, 1150), 'json.encoder.ESCAPE_ASCII.finditer', 'ESCAPE_ASCII.finditer', (['s'], {}), '(s)\n', (1147, 1150), False, 'from json.encoder import ESCAPE_ASCII, ESCAPE_DCT\n')] |
# (c) 2013 <NAME> and contributors; written to work with Django and Paste (http://pythonpaste.org)
# Paste CGI "middleware" for Django by <NAME> <<EMAIL>>
# Open Technology Group, Inc <http://www.otg-nc.com>
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
import os
import sys
import... | [
"logging.getLogger",
"django.http.HttpResponse",
"os.environ.copy",
"os.path.dirname",
"paste.cgiapp.proc_communicate"
] | [((761, 788), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (778, 788), False, 'import logging\n'), ((1546, 1563), 'os.environ.copy', 'os.environ.copy', ([], {}), '()\n', (1561, 1563), False, 'import os\n'), ((2430, 2502), 'paste.cgiapp.proc_communicate', 'proc_communicate', (['proc'], {... |
#
# This file is part of pysnmp software.
#
# Copyright (c) 2005-2019, <NAME> <<EMAIL>>
# License: http://snmplabs.com/pysnmp/license.html
#
import socket
import errno
import sys
from pysnmp.carrier.asyncore.base import AbstractSocketTransport
from pysnmp.carrier import sockfix, sockmsg, error
from pysnmp import debug
... | [
"pysnmp.carrier.error.CarrierError",
"pysnmp.debug.logger",
"pysnmp.carrier.asyncore.base.AbstractSocketTransport.__init__",
"pysnmp.carrier.sockmsg.getSendTo",
"sys.exc_info",
"pysnmp.carrier.sockmsg.getRecvFrom",
"pysnmp.debug.hexdump"
] | [((1151, 1204), 'pysnmp.carrier.asyncore.base.AbstractSocketTransport.__init__', 'AbstractSocketTransport.__init__', (['self', 'sock', 'sockMap'], {}), '(self, sock, sockMap)\n', (1183, 1204), False, 'from pysnmp.carrier.asyncore.base import AbstractSocketTransport\n'), ((3034, 3069), 'pysnmp.carrier.sockmsg.getSendTo'... |
#!/usr/bin/env python3
#
# Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the MIT license.
#
##
# Title : superpmi_setup.py
#
# Notes:
#
# Script to run "superpmi replay" for various collections under various COMPlus_JitStressRegs value.... | [
"os.linesep.join",
"os.listdir",
"argparse.ArgumentParser",
"os.path.join",
"os.path.realpath",
"os.path.isdir"
] | [((635, 685), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""description"""'}), "(description='description')\n", (658, 685), False, 'import argparse\n'), ((2594, 2629), 'os.path.join', 'path.join', (['cwd', '"""artifacts"""', '"""spmi"""'], {}), "(cwd, 'artifacts', 'spmi')\n", (2603, 262... |
from django.conf.urls import url
from .views import serve_all
urlpatterns = (
url(r'^.*$', serve_all, name="localsrv:serve_all"),
) | [
"django.conf.urls.url"
] | [((83, 132), 'django.conf.urls.url', 'url', (['"""^.*$"""', 'serve_all'], {'name': '"""localsrv:serve_all"""'}), "('^.*$', serve_all, name='localsrv:serve_all')\n", (86, 132), False, 'from django.conf.urls import url\n')] |
from transformer import Encoder
from torch import nn,optim
from torch.nn.functional import cross_entropy,softmax, relu
from torch.utils.data import DataLoader
from torch.utils.data.dataloader import default_collate
import torch
import utils
import os
import pickle
class GPT(nn.Module):
def __init__(self, model_d... | [
"torch.ones",
"pickle.dump",
"os.makedirs",
"torch.load",
"torch.nn.init.kaiming_normal_",
"torch.from_numpy",
"torch.eq",
"utils.MRPCData",
"os.path.dirname",
"torch.cuda.is_available",
"torch.nn.Parameter",
"torch.nn.Linear",
"torch.utils.data.DataLoader",
"transformer.Encoder",
"torch... | [((3123, 3153), 'utils.MRPCData', 'utils.MRPCData', (['"""./MRPC"""', '(2000)'], {}), "('./MRPC', 2000)\n", (3137, 3153), False, 'import utils\n'), ((3430, 3455), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (3453, 3455), False, 'import torch\n'), ((3653, 3701), 'torch.utils.data.DataLoader',... |
import numpy as np
import pandas as pd
from bokeh.core.json_encoder import serialize_json
from bokeh.core.properties import List, String
from bokeh.document import Document
from bokeh.layouts import row, column
from bokeh.models import CustomJS, HoverTool, Range1d, Slider, Button
from bokeh.models.widgets import Check... | [
"bokeh.layouts.column",
"bokeh.models.widgets.TextInput",
"numpy.log10",
"bokeh.util.compiler.bundle_all_models",
"bokeh.plotting.figure",
"bokeh.layouts.row",
"skyportal.models.Group.id.in_",
"skyportal.models.Telescope.nickname.label",
"numpy.log",
"bokeh.util.serialization.make_id",
"numpy.is... | [((4916, 4936), 'matplotlib.cm.get_cmap', 'cm.get_cmap', (['"""jet_r"""'], {}), "('jet_r')\n", (4927, 4936), False, 'from matplotlib import cm\n'), ((2656, 2698), 'bokeh.core.properties.List', 'List', (['String'], {'help': '"""List of legend colors"""'}), "(String, help='List of legend colors')\n", (2660, 2698), False,... |
# coding:utf-8
import uuid
import string
import hashlib
import logging
from lib.errors import SessionExpiredError, SessionConsumedError
from datetime import datetime as dt
from random import SystemRandom
LOG = logging.getLogger("errbot.plugin.st2.session")
def generate_password(length=8):
rnd = SystemRandom()
... | [
"logging.getLogger",
"hashlib.sha256",
"datetime.datetime.fromtimestamp",
"uuid.uuid4",
"datetime.datetime.now",
"random.SystemRandom"
] | [((211, 257), 'logging.getLogger', 'logging.getLogger', (['"""errbot.plugin.st2.session"""'], {}), "('errbot.plugin.st2.session')\n", (228, 257), False, 'import logging\n'), ((303, 317), 'random.SystemRandom', 'SystemRandom', ([], {}), '()\n', (315, 317), False, 'from random import SystemRandom\n'), ((642, 654), 'uuid.... |
# _*_ coding:utf-8 _*_
# author:ls
# time:2020/3/19 0019
import sys
from PyQt5.QtWidgets import QApplication,QAction,QMainWindow
from PyQt5.QtGui import QIcon
class Example(QMainWindow):
def __init__(self):
super().__init__()
self.setui()
def setui(self):
self.statusbar = self.statusB... | [
"PyQt5.QtWidgets.QAction",
"PyQt5.QtWidgets.QApplication"
] | [((972, 994), 'PyQt5.QtWidgets.QApplication', 'QApplication', (['sys.argv'], {}), '(sys.argv)\n', (984, 994), False, 'from PyQt5.QtWidgets import QApplication, QAction, QMainWindow\n'), ((391, 429), 'PyQt5.QtWidgets.QAction', 'QAction', (['"""check"""', 'self'], {'checkable': '(True)'}), "('check', self, checkable=True... |
# Standard library imports
import logging
import os
# Third party imports
import dash
import dash_bootstrap_components as dbc
from flask_caching import Cache
import plotly.io as pio
# Local application imports
from modules.gitlab import GitLab
import settings
# Initialize logging mechanism
logging.bas... | [
"logging.basicConfig",
"logging.getLogger",
"modules.gitlab.GitLab",
"flask_caching.Cache",
"dash.Dash"
] | [((309, 380), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'settings.LOGLEVEL', 'format': 'settings.LOGFORMAT'}), '(level=settings.LOGLEVEL, format=settings.LOGFORMAT)\n', (328, 380), False, 'import logging\n'), ((391, 418), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (... |
import socket
import requests
import json
import xml.etree.ElementTree as ET
class Camera(object):
def __init__(self):
"""
create camera object
"""
self.xml_url = self.discover()
self.name, self.api_version, self.services = self.connect(self.xml_url)
self.camera_end... | [
"json.loads",
"socket.socket",
"json.dumps",
"requests.get",
"xml.etree.ElementTree.fromstring"
] | [((1094, 1162), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_DGRAM', 'socket.IPPROTO_UDP'], {}), '(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)\n', (1107, 1162), False, 'import socket\n'), ((1952, 1973), 'requests.get', 'requests.get', (['xml_url'], {}), '(xml_url)\n', (1964, 1973), Fals... |
from asyncio import get_event_loop
from dataclasses import dataclass, field
from typing import Dict, List, Optional, Union
from aiohttp import ClientSession
from pydantic import BaseModel
from sgqlc.endpoint.base import BaseEndpoint
from sgqlc.operation import Operation
from sgqlc_schemas.github.schema import (
Ad... | [
"aiohttp.ClientSession",
"sgqlc_schemas.github.schema.MergePullRequestInput",
"sgqlc_schemas.github.schema.AddLabelsToLabelableInput",
"asyncio.get_event_loop",
"dataclasses.field",
"sgqlc.operation.Operation"
] | [((879, 906), 'dataclasses.field', 'field', ([], {'default_factory': 'dict'}), '(default_factory=dict)\n', (884, 906), False, 'from dataclasses import dataclass, field\n'), ((1874, 1890), 'sgqlc.operation.Operation', 'Operation', (['Query'], {}), '(Query)\n', (1883, 1890), False, 'from sgqlc.operation import Operation\... |
#Exercício046
from time import sleep
import emoji
print('\033[32mCONTAGEM REGRESSIVA PARA O ANO NOVO:\033[m')
sleep(1)
for c in range(10, 0 - 1, -1):#repete os números de 10 até o 0
print(c)
sleep(1)
print(emoji.emojize("\033[31m:boom::boom::boom:KABUM:boom::boom::boom:", use_aliases=True))
print(emoji.emojize(... | [
"emoji.emojize",
"time.sleep"
] | [((110, 118), 'time.sleep', 'sleep', (['(1)'], {}), '(1)\n', (115, 118), False, 'from time import sleep\n'), ((199, 207), 'time.sleep', 'sleep', (['(1)'], {}), '(1)\n', (204, 207), False, 'from time import sleep\n'), ((214, 302), 'emoji.emojize', 'emoji.emojize', (['"""\x1b[31m:boom::boom::boom:KABUM:boom::boom::boom:"... |
import abc
import math
from ... import constants
class Rule(abc.ABC):
def __init__(self, failure_bin, **kwargs):
self.failure_bin = failure_bin
self.enabled = kwargs.get("enabled", True)
self.threshold = kwargs.get("threshold", float("nan"))
self.rule_name = kwargs.get("rule_name"... | [
"math.isnan"
] | [((476, 502), 'math.isnan', 'math.isnan', (['self.threshold'], {}), '(self.threshold)\n', (486, 502), False, 'import math\n')] |
import pandas as pd
import smartplots3_setup
def createSetup(name,expansion_factor,percapita_factor,plot_size,settings):
plt_setup_smart={
'name': name,
'expansion_factor':expansion_factor,
'percapita_factor':percapita_factor,
'scenarios_itr': [],
'scenarios_id':[],
... | [
"smartplots3_setup.pltRealizedModeSplitByTrips",
"smartplots3_setup.pltAveragePersonSpeed_allModes",
"smartplots3_setup.pltAveragePersonSpeed_car",
"smartplots3_setup.pltModeSplitInVMT",
"smartplots3_setup.pltRHEmptyPooled",
"smartplots3_setup.tableSummary",
"smartplots3_setup.pltLdvTechnologySplitInVMT... | [((4138, 4212), 'smartplots3_setup.pltEnergyPerCapita', 'smartplots3_setup.pltEnergyPerCapita', (['plt_setup_smart3_base', 'output_folder'], {}), '(plt_setup_smart3_base, output_folder)\n', (4174, 4212), False, 'import smartplots3_setup\n'), ((4213, 4300), 'smartplots3_setup.pltRealizedModeSplitByTrips', 'smartplots3_s... |
# python
# import warnings
# Third party imports
import numpy as np
# grAdapt
from .base import Initial
from grAdapt.utils.sampling import sample_corner_bounds
class Vertices(Initial):
"""
Samples vertices if n_evals >= 2 ** len(bounds).
Else low discrepancy sequences are sampled.
"""
def __ini... | [
"numpy.vstack",
"grAdapt.utils.sampling.sample_corner_bounds"
] | [((1391, 1424), 'grAdapt.utils.sampling.sample_corner_bounds', 'sample_corner_bounds', (['self.bounds'], {}), '(self.bounds)\n', (1411, 1424), False, 'from grAdapt.utils.sampling import sample_corner_bounds\n'), ((1819, 1860), 'numpy.vstack', 'np.vstack', (['(corner_points, random_points)'], {}), '((corner_points, rand... |
# Copyright 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 applicable law or agreed to in writing, software
#... | [
"numpy.ones",
"numpy.where",
"tqdm.tqdm",
"torch.Tensor",
"h5py.File",
"numpy.zeros"
] | [((6574, 6603), 'h5py.File', 'h5py.File', (['fragment_file', '"""r"""'], {}), "(fragment_file, 'r')\n", (6583, 6603), False, 'import h5py\n'), ((7665, 7694), 'h5py.File', 'h5py.File', (['fragment_file', '"""r"""'], {}), "(fragment_file, 'r')\n", (7674, 7694), False, 'import h5py\n'), ((16271, 16303), 'h5py.File', 'h5py... |
import numpy as np
np.random.seed(123) # for reproducibility
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Flatten
from keras.layers import Convolution2D, MaxPooling2D
from keras.utils import np_utils
from dataset_pothole import pothole
from keras.models import model_from_j... | [
"keras.layers.Convolution2D",
"keras.layers.Flatten",
"keras.layers.MaxPooling2D",
"keras.models.Sequential",
"keras.layers.Dense",
"keras.utils.np_utils.to_categorical",
"numpy.random.seed",
"keras.layers.Activation",
"dataset_pothole.pothole.load_data",
"keras.layers.Dropout"
] | [((19, 38), 'numpy.random.seed', 'np.random.seed', (['(123)'], {}), '(123)\n', (33, 38), True, 'import numpy as np\n'), ((423, 442), 'dataset_pothole.pothole.load_data', 'pothole.load_data', ([], {}), '()\n', (440, 442), False, 'from dataset_pothole import pothole\n'), ((785, 820), 'keras.utils.np_utils.to_categorical'... |
import hashlib
import random
import string
import logging
from django.db import models
LOG = logging.getLogger(__name__)
class Device(models.Model):
name = models.CharField(max_length=50, unique=True)
customer = models.CharField(max_length=50)
agent_status = models.CharField(max_length=10, default="off... | [
"logging.getLogger",
"random.choice",
"django.db.models.ForeignKey",
"django.db.models.JSONField",
"django.db.models.BooleanField",
"django.db.models.SmallIntegerField",
"django.db.models.DateTimeField",
"django.db.models.CharField"
] | [((96, 123), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (113, 123), False, 'import logging\n'), ((165, 209), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(50)', 'unique': '(True)'}), '(max_length=50, unique=True)\n', (181, 209), False, 'from django.db import ... |
from django.contrib.auth import SESSION_KEY
from django.core.cache import cache
from django.conf import settings
from django.http import HttpResponse, HttpResponseServerError
from proxy_server.response import AJAX_REQUEST
import httplib, json, proxy_server
def invoke_backend_service(method, function_path, json_data=di... | [
"httplib.HTTPConnection",
"json.loads",
"httplib.HTTPSConnection",
"django.core.cache.cache.delete",
"django.http.HttpResponse",
"json.dumps",
"django.core.cache.cache.set",
"django.core.cache.cache.get"
] | [((1575, 1604), 'django.core.cache.cache.get', 'cache.get', (['AJAX_REQUEST', 'None'], {}), '(AJAX_REQUEST, None)\n', (1584, 1604), False, 'from django.core.cache import cache\n'), ((5989, 6049), 'django.http.HttpResponse', 'HttpResponse', ([], {'status': 'response.status', 'reason': 'response.reason'}), '(status=respo... |
import transitions
from functools import partial
# from transitions import transitions.Machine
# TODO: whenever there is a state chage store the following
# (DAY,function_called) -> Stored for every person for agent status, state and Testing state
class AgentStatusA(object):
"""The Statemachine of the agent"""
stat... | [
"functools.partial",
"transitions.Machine"
] | [((7619, 8201), 'transitions.Machine', 'transitions.Machine', ([], {'model': 'None', 'states': "['Not_tested', 'Awaiting_Testing', 'Tested_Positive', 'Tested_Negative']", 'initial': '"""Not_tested"""', 'transitions': "[{'trigger': 'awaiting_test', 'source': ['Not_tested', 'Awaiting_Testing',\n 'Tested_Negative'], 'd... |
"""Config flow for Eva Calor."""
from collections import OrderedDict
import logging
import uuid
from pyevacalor import ( # pylint: disable=redefined-builtin
ConnectionError,
Error as EvaCalorError,
UnauthorizedError,
evacalor,
)
import voluptuous as vol
from homeassistant import config_entries
from h... | [
"logging.getLogger",
"collections.OrderedDict",
"voluptuous.Schema",
"uuid.uuid1",
"pyevacalor.evacalor"
] | [((421, 448), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (438, 448), False, 'import logging\n'), ((2267, 2280), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (2278, 2280), False, 'from collections import OrderedDict\n'), ((1584, 1619), 'pyevacalor.evacalor', 'evacalor', ... |
from os import path
from telethon import Client
from telethon.types import Message, Voice
from callsmusic import callsmusic, queues
import converter
from downloaders import youtube
from config import BOT_NAME as bn, DURATION_LIMIT
from helpers.filters import command, other_filters
from helpers.decorators import err... | [
"helpers.gets.get_url",
"callsmusic.queues.put",
"downloaders.youtube.download",
"os.path.join",
"helpers.filters.command",
"helpers.gets.get_file_name",
"helpers.errors.DurationLimitError",
"telethon.types.InlineKeyboardButton",
"callsmusic.callsmusic.pytgcalls.join_group_call"
] | [((1140, 1156), 'helpers.gets.get_url', 'get_url', (['message'], {}), '(message)\n', (1147, 1156), False, 'from helpers.gets import get_url, get_file_name\n'), ((1392, 1412), 'helpers.gets.get_file_name', 'get_file_name', (['audio'], {}), '(audio)\n', (1405, 1412), False, 'from helpers.gets import get_url, get_file_nam... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
:Brief: Produces rand disjoint communities (clusters) for the given network with sizes similar in the ground truth.
:Description:
Takes number of the resulting communities and their sizes from the specified groundtruth (actually any sample
of the community structure, ... | [
"os.path.exists",
"random.sample",
"os.makedirs",
"os.urandom",
"os.path.splitext",
"random.seed",
"os.path.split",
"random.random",
"utils.parser_nsl.loadNsl"
] | [((4524, 4556), 'utils.parser_nsl.loadNsl', 'loadNsl', (['prm.network', 'prm.dirnet'], {}), '(prm.network, prm.dirnet)\n', (4531, 4556), False, 'from utils.parser_nsl import asymnet, loadNsl\n'), ((5029, 5052), 'random.seed', 'rand.seed', (['prm.randseed'], {}), '(prm.randseed)\n', (5038, 5052), True, 'import random as... |
import onnx
import onnxruntime
import torch
import onnx.numpy_helper
# added by huxi, load rpn config
from pcdet.pointpillar_quantize_config import load_rpn_config_json
# ========================================
config_dict = load_rpn_config_json.get_config()
onnx_model_file = config_dict["vfe_onnx_file"]
onnx_mode... | [
"pcdet.pointpillar_quantize_config.load_rpn_config_json.get_config",
"onnx.checker.check_model",
"onnx.load",
"onnx.numpy_helper.to_array"
] | [((229, 262), 'pcdet.pointpillar_quantize_config.load_rpn_config_json.get_config', 'load_rpn_config_json.get_config', ([], {}), '()\n', (260, 262), False, 'from pcdet.pointpillar_quantize_config import load_rpn_config_json\n'), ((324, 350), 'onnx.load', 'onnx.load', (['onnx_model_file'], {}), '(onnx_model_file)\n', (33... |
#! /usr/bin/python
import requests
import re
from bs4 import BeautifulSoup
import colors
class FindingComments(object):
def __init__(self, url):
self.url = url
self.comment_list = ['<!--(.*)-->']
self.found_comments = {}
def get_soure_code(self):
resp_text = requests.get(sel... | [
"re.findall",
"colors.error",
"requests.get"
] | [((304, 326), 'requests.get', 'requests.get', (['self.url'], {}), '(self.url)\n', (316, 326), False, 'import requests\n'), ((495, 527), 're.findall', 're.findall', (['comment', 'source_code'], {}), '(comment, source_code)\n', (505, 527), False, 'import re\n'), ((969, 1001), 'colors.error', 'colors.error', (['"""No comm... |
#!/usr/bin/python
# This program revises the existing overview file.
# If a keyword is found in an Abstract of an accession of a gene, the url of the abstract is added to the overview file
# The revised overview.txt is created in the same directory of the old one and named overview_new.txt
"""
Usage: link_assignment.py... | [
"csv.DictReader",
"csv.reader",
"docopt.docopt",
"os.path.splitext"
] | [((1913, 1938), 'docopt.docopt', 'docopt', (['__doc__', 'argv[1:]'], {}), '(__doc__, argv[1:])\n', (1919, 1938), False, 'from docopt import docopt\n'), ((620, 660), 'csv.reader', 'csv.reader', (['pubhits_file'], {'delimiter': '"""\t"""'}), "(pubhits_file, delimiter='\\t')\n", (630, 660), False, 'import csv\n'), ((2250,... |
# --------------
import pandas as pd
from sklearn.model_selection import train_test_split
#path - Path of file
# Code starts here
df = pd.read_csv(path)
df.head(5)
X = df.drop(['customerID','Churn'],1)
y = df['Churn']
X_train,X_test,y_train,y_test = train_test_split(X, y, test_size = 0.3, random_state = 0)
# --... | [
"sklearn.model_selection.GridSearchCV",
"sklearn.preprocessing.LabelEncoder",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"sklearn.metrics.classification_report",
"sklearn.ensemble.AdaBoostClassifier",
"sklearn.metrics.accuracy_score",
"xgboost.XGBClassifier",
"sklearn.metrics.con... | [((137, 154), 'pandas.read_csv', 'pd.read_csv', (['path'], {}), '(path)\n', (148, 154), True, 'import pandas as pd\n'), ((255, 308), 'sklearn.model_selection.train_test_split', 'train_test_split', (['X', 'y'], {'test_size': '(0.3)', 'random_state': '(0)'}), '(X, y, test_size=0.3, random_state=0)\n', (271, 308), False, ... |
import argparse, time, logging, os, math, random
os.environ["MXNET_USE_OPERATOR_TUNING"] = "0"
import numpy as np
from scipy import stats
import mxnet as mx
from mxnet import gluon, nd
from mxnet import autograd as ag
from mxnet.gluon import nn
from mxnet.gluon.data.vision import transforms
from gluoncv.model_zoo im... | [
"logging.getLogger",
"logging.StreamHandler",
"mxnet.autograd.record",
"mxnet.gluon.nn.Conv2D",
"mxnet.gluon.nn.BatchNorm",
"mxnet.init.Xavier",
"numpy.array",
"mxnet.gluon.nn.MaxPool2D",
"mxnet.gluon.nn.Sequential",
"mxnet.gluon.data.dataset.ArrayDataset",
"mxnet.gluon.nn.Flatten",
"mxnet.glu... | [((622, 647), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (645, 647), False, 'import argparse\n'), ((2619, 2648), 'logging.FileHandler', 'logging.FileHandler', (['args.log'], {}), '(args.log)\n', (2638, 2648), False, 'import argparse, time, logging, os, math, random\n'), ((2665, 2688), 'logg... |
#!/usr/bin/env python
# Copyright 2019 Division of Medical Image Computing, German Cancer Research Center (DKFZ).
#
# 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... | [
"numpy.sqrt",
"numpy.array",
"numpy.arange",
"numpy.mean",
"numpy.flip",
"os.listdir",
"numpy.where",
"numpy.delete",
"numpy.max",
"numpy.stack",
"numpy.concatenate",
"numpy.min",
"numpy.maximum",
"collections.OrderedDict",
"numpy.ceil",
"pickle.load",
"numpy.argmax",
"numpy.floor"... | [((10050, 10078), 'numpy.maximum', 'np.maximum', (['y1[i]', 'y1[order]'], {}), '(y1[i], y1[order])\n', (10060, 10078), True, 'import numpy as np\n'), ((10093, 10121), 'numpy.maximum', 'np.maximum', (['x1[i]', 'x1[order]'], {}), '(x1[i], x1[order])\n', (10103, 10121), True, 'import numpy as np\n'), ((10136, 10164), 'num... |
from setuptools import find_packages
from setuptools import setup
REQUIRED_PACKAGES = ['tensorflow==1.8.0','pandas==0.23.1','setuptools==38.7.0','numpy==1.14.1','Keras==2.1.4','scikit_learn==0.19.1','h5py']
setup(
name='classifier',
version='0.1',
install_requires=REQUIRED_PACKAGES,
packages=find_pack... | [
"setuptools.find_packages"
] | [((311, 326), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (324, 326), False, 'from setuptools import find_packages\n')] |
import os
from contextlib import contextmanager
from tempfile import NamedTemporaryFile
from typing import Optional, Sequence
from pydantic import BaseModel, Field, FilePath
@contextmanager
def temp_config(**kwargs):
"""A context manager that creates a temporary config file for SIMReconstructor.
`**kwargs` ... | [
"pydantic.Field",
"os.unlink",
"tempfile.NamedTemporaryFile"
] | [((433, 465), 'tempfile.NamedTemporaryFile', 'NamedTemporaryFile', ([], {'delete': '(False)'}), '(delete=False)\n', (451, 465), False, 'from tempfile import NamedTemporaryFile\n'), ((677, 712), 'pydantic.Field', 'Field', (['None'], {'description': '"""OTF file"""'}), "(None, description='OTF file')\n", (682, 712), Fals... |
import math
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from scipy.stats import ttest_ind
from sklearn.preprocessing import LabelEncoder
def load_data():
questionnaire = pd.read_excel('XAutoML.xlsx')
encoder = LabelEncoder()
encoder.classes_ = np.array([... | [
"sklearn.preprocessing.LabelEncoder",
"seaborn.despine",
"matplotlib.pyplot.xticks",
"seaborn.set_theme",
"pandas.option_context",
"numpy.array",
"scipy.stats.ttest_ind",
"seaborn.violinplot",
"pandas.read_excel",
"pandas.DataFrame",
"matplotlib.pyplot.subplots"
] | [((227, 256), 'pandas.read_excel', 'pd.read_excel', (['"""XAutoML.xlsx"""'], {}), "('XAutoML.xlsx')\n", (240, 256), True, 'import pandas as pd\n'), ((272, 286), 'sklearn.preprocessing.LabelEncoder', 'LabelEncoder', ([], {}), '()\n', (284, 286), False, 'from sklearn.preprocessing import LabelEncoder\n'), ((310, 395), 'n... |
"""
*****************
Specifying Colors
*****************
Matplotlib recognizes the following formats to specify a color:
* an RGB or RGBA (red, green, blue, alpha) tuple of float values in closed
interval ``[0, 1]`` (e.g., ``(0.1, 0.2, 0.5)`` or ``(0.1, 0.2, 0.5, 0.3)``);
* a hex RGB or RGBA string (e.g., ``'#0f0f... | [
"matplotlib.patches.Rectangle",
"numpy.linspace",
"matplotlib.style.use",
"matplotlib.pyplot.figure",
"numpy.cos",
"numpy.sin",
"matplotlib.pyplot.subplots"
] | [((2661, 2691), 'numpy.linspace', 'np.linspace', (['(0)', '(2 * np.pi)', '(128)'], {}), '(0, 2 * np.pi, 128)\n', (2672, 2691), True, 'import numpy as np\n'), ((4251, 4280), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '[4.8, 16]'}), '(figsize=[4.8, 16])\n', (4261, 4280), True, 'import matplotlib.pyplot as... |
# -*- coding: utf-8 -*-
"""CLI for Chemical Roles exporters."""
import os
import click
from ..constants import DATA
@click.group()
def export():
"""Export the database."""
@export.command(name='all')
@click.pass_context
def export_all(ctx):
"""Export all."""
ctx.invoke(summary)
ctx.invoke(obo)
... | [
"click.group",
"click.option",
"os.path.join",
"seaborn.set"
] | [((123, 136), 'click.group', 'click.group', ([], {}), '()\n', (134, 136), False, 'import click\n'), ((382, 423), 'click.option', 'click.option', (['"""--directory"""'], {'default': 'DATA'}), "('--directory', default=DATA)\n", (394, 423), False, 'import click\n'), ((596, 638), 'seaborn.set', 'sns.set', ([], {'font_scale... |
# Generated by Django 2.0.4 on 2018-04-17 19:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0003_auto_20180417_1613'),
]
operations = [
migrations.CreateModel(
name='Item',
fields=[
('... | [
"django.db.models.IntegerField",
"django.db.migrations.AlterModelOptions",
"django.db.models.AutoField",
"django.db.models.DecimalField",
"django.db.models.CharField"
] | [((1071, 1213), 'django.db.migrations.AlterModelOptions', 'migrations.AlterModelOptions', ([], {'name': '"""cliente"""', 'options': "{'ordering': ['nome'], 'verbose_name': 'Cliente', 'verbose_name_plural':\n 'Clientes'}"}), "(name='cliente', options={'ordering': ['nome'],\n 'verbose_name': 'Cliente', 'verbose_nam... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Taskmaster-2 implementation for ParlAI.
No official train/valid/test splits are available as of 2020-05-18, so we m... | [
"parlai.core.metrics.F1Metric.compute",
"parlai.core.metrics.BleuMetric.compute",
"os.path.join",
"collections.Counter",
"parlai.utils.logging.debug",
"parlai.utils.misc.warn_once",
"parlai.core.metrics.AverageMetric",
"parlai.utils.io.PathManager.open",
"json.load",
"parlai.tasks.taskmaster2.buil... | [((1619, 1664), 'os.path.join', 'os.path.join', (["opt['datapath']", '"""taskmaster-2"""'], {}), "(opt['datapath'], 'taskmaster-2')\n", (1631, 1664), False, 'import os\n'), ((3126, 3151), 'pandas.concat', 'pd.concat', (['chunks'], {'axis': '(0)'}), '(chunks, axis=0)\n', (3135, 3151), True, 'import pandas as pd\n'), ((7... |
import numpy as np
nparr = np.array([i for i in range(10)])
a = np.zeros(10)
f = np.zeros(10,dtype=float)
n = np.full((3,5),44)
r = np.random.randint(0,100,size=(3,5))
r2 = np.random.random((3,5))
x = np.linspace(0,100,50)
print(nparr,a,f,n,r,r2,x) | [
"numpy.random.random",
"numpy.zeros",
"numpy.linspace",
"numpy.random.randint",
"numpy.full"
] | [((66, 78), 'numpy.zeros', 'np.zeros', (['(10)'], {}), '(10)\n', (74, 78), True, 'import numpy as np\n'), ((83, 108), 'numpy.zeros', 'np.zeros', (['(10)'], {'dtype': 'float'}), '(10, dtype=float)\n', (91, 108), True, 'import numpy as np\n'), ((112, 131), 'numpy.full', 'np.full', (['(3, 5)', '(44)'], {}), '((3, 5), 44)\... |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
#!/usr/bin/env python3
import abc
import math
from collections import defaultdict, dequ... | [
"torch.ones_like",
"torch.any",
"math.ceil",
"collections.deque",
"torch.nn.ModuleList",
"torchrec.metrics.metrics_namespace.compose_metric_key",
"dataclasses.dataclass",
"torch.zeros_like",
"typing.cast",
"torch.numel",
"collections.defaultdict",
"torch.no_grad",
"torch.count_nonzero",
"t... | [((943, 965), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (952, 965), False, 'from dataclasses import dataclass\n'), ((1096, 1120), 'typing.TypeVar', 'TypeVar', (['"""DefaultValueT"""'], {}), "('DefaultValueT')\n", (1103, 1120), False, 'from typing import Any, Callable, cast, De... |
import cv2 as cv
from deskew import determine_skew
import numpy as np
from PIL import Image, ImageFilter, ImageOps
from pytesseract import image_to_string
from skimage import io
from skimage.color import rgb2gray
from skimage.transform import rotate
from spellchecker import SpellChecker
import traceback
# On Windows, ... | [
"PIL.Image.fromarray",
"skimage.color.rgb2gray",
"PIL.Image.open",
"cv2.fastNlMeansDenoising",
"skimage.transform.rotate",
"spellchecker.SpellChecker",
"deskew.determine_skew",
"PIL.ImageFilter.MinFilter",
"skimage.io.imread",
"cv2.adaptiveThreshold",
"pytesseract.image_to_string",
"PIL.ImageF... | [((1162, 1182), 'pytesseract.image_to_string', 'image_to_string', (['img'], {}), '(img)\n', (1177, 1182), False, 'from pytesseract import image_to_string\n'), ((2320, 2406), 'spellchecker.SpellChecker', 'SpellChecker', ([], {'language': 'language', 'distance': 'distance', 'case_sensitive': 'case_sensitive'}), '(languag... |
# Copyright (c) 2019-2021, <NAME>, <NAME>, <NAME>, and <NAME>.
#
# Distributed under the 3-clause BSD license, see accompanying file LICENSE
# or https://github.com/scikit-hep/vector for details.
import numpy
import pytest
import vector.backends.numpy_
import vector.backends.object_
def test_xy():
vec = vector.... | [
"pytest.approx",
"numpy.allclose"
] | [((853, 921), 'numpy.allclose', 'numpy.allclose', (['out.x', '[0, 0.9950041652780258, -0.09983341664682815]'], {}), '(out.x, [0, 0.9950041652780258, -0.09983341664682815])\n', (867, 921), False, 'import numpy\n'), ((933, 1000), 'numpy.allclose', 'numpy.allclose', (['out.y', '[0, 0.09983341664682815, 0.9950041652780258]... |
# This python script handles stock api request from yfinance
# Last Updated: 4/7/2020
# Credits:nóto
#Import yfinance api lib
import yfinance as yf
#Import pandas lib
import pandas as pd
#Import json to manipulate api data
import json
#Import math
import math
class StockApi():
def __init__(self):
self.pan... | [
"json.dumps",
"yfinance.Ticker"
] | [((443, 455), 'yfinance.Ticker', 'yf.Ticker', (['t'], {}), '(t)\n', (452, 455), True, 'import yfinance as yf\n'), ((2017, 2052), 'json.dumps', 'json.dumps', (['self.new_data'], {'indent': '(2)'}), '(self.new_data, indent=2)\n', (2027, 2052), False, 'import json\n')] |
from datetime import date
from random import randrange
import factory
import factory.fuzzy
from hth.core.tests.utils import from_today
class VenueFactory(factory.django.DjangoModelFactory):
class Meta:
model = 'shows.Venue'
name = factory.Sequence(lambda n: 'Venue %d' % n)
city = factory.Sequ... | [
"factory.SubFactory",
"factory.fuzzy.FuzzyText",
"random.randrange",
"datetime.date",
"factory.Sequence"
] | [((254, 296), 'factory.Sequence', 'factory.Sequence', (["(lambda n: 'Venue %d' % n)"], {}), "(lambda n: 'Venue %d' % n)\n", (270, 296), False, 'import factory\n'), ((308, 349), 'factory.Sequence', 'factory.Sequence', (["(lambda n: 'City %d' % n)"], {}), "(lambda n: 'City %d' % n)\n", (324, 349), False, 'import factory\... |
#!/usr/bin/env python3
#
# Copyright 2021 Graviti. Licensed under MIT License.
#
# pylint: disable=invalid-name
# pylint: disable=missing-module-docstring
import os
from typing import Any, Dict, Iterator, Tuple
from tensorbay.dataset import Data, Dataset
from tensorbay.exception import ModuleImportError
from tensorba... | [
"tensorbay.dataset.Dataset",
"tensorbay.exception.ModuleImportError",
"os.path.join",
"os.path.dirname",
"tensorbay.label.Classification",
"os.path.expanduser"
] | [((1253, 1274), 'tensorbay.dataset.Dataset', 'Dataset', (['DATASET_NAME'], {}), '(DATASET_NAME)\n', (1260, 1274), False, 'from tensorbay.dataset import Data, Dataset\n'), ((1212, 1236), 'os.path.expanduser', 'os.path.expanduser', (['path'], {}), '(path)\n', (1230, 1236), False, 'import os\n'), ((1126, 1167), 'tensorbay... |
# coding: utf-8
"""
Copyright 2018 OSIsoft, LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
<http://www.apache.org/licenses/LICENSE-2.0>
Unless required by applicable law or agreed t... | [
"six.iteritems"
] | [((2603, 2632), 'six.iteritems', 'iteritems', (['self.swagger_types'], {}), '(self.swagger_types)\n', (2612, 2632), False, 'from six import iteritems\n')] |
# Copyright (c) AIRBUS and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import annotations
from typing import Dict, Tuple
from skdecide.discrete_optimization.rcpsp_multiskill.rcpsp_multiskill import (
E... | [
"skdecide.discrete_optimization.rcpsp_multiskill.rcpsp_multiskill.SkillDetail"
] | [((6434, 6526), 'skdecide.discrete_optimization.rcpsp_multiskill.rcpsp_multiskill.SkillDetail', 'SkillDetail', ([], {'skill_value': 'resource_dict[res][skill]', 'efficiency_ratio': '(1.0)', 'experience': '(1.0)'}), '(skill_value=resource_dict[res][skill], efficiency_ratio=1.0,\n experience=1.0)\n', (6445, 6526), Fal... |
import logging
# monkey patch to suppress the annoying warning you get when you import apache_beam
#
# No handlers could be found for logger "oauth2client.contrib.multistore_file"
#
# This warning is harmless, but annooying when you are using beam from a command line app
# see: https://issues.apache.org/jira/browse/BE... | [
"logging.getLogger",
"logging.NullHandler"
] | [((412, 469), 'logging.getLogger', 'logging.getLogger', (['"""oauth2client.contrib.multistore_file"""'], {}), "('oauth2client.contrib.multistore_file')\n", (429, 469), False, 'import logging\n'), ((480, 501), 'logging.NullHandler', 'logging.NullHandler', ([], {}), '()\n', (499, 501), False, 'import logging\n')] |
# Copyright 2022 NREL
# 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
# distri... | [
"numpy.array",
"numpy.zeros",
"floris.tools.FlorisInterface",
"matplotlib.pyplot.subplots",
"numpy.arange",
"matplotlib.pyplot.show"
] | [((1151, 1185), 'floris.tools.FlorisInterface', 'FlorisInterface', (['"""inputs/gch.yaml"""'], {}), "('inputs/gch.yaml')\n", (1166, 1185), False, 'from floris.tools import FlorisInterface\n'), ((1359, 1379), 'numpy.array', 'np.array', (['[0, D * 6]'], {}), '([0, D * 6])\n', (1367, 1379), True, 'import numpy as np\n'), ... |
"A Console-Based Email Client"
#!/usr/local/bin/python
"""
##########################################################################
pymail - a simple console email interface client in Python; uses Python
poplib module to view POP email messages, smtplib to send new mails, and
the email package to extract mail header... | [
"smtplib.SMTP",
"email.parser.Parser",
"getpass.getpass",
"email.message.Message",
"sys.stdin.readline",
"poplib.POP3"
] | [((1836, 1845), 'email.message.Message', 'Message', ([], {}), '()\n', (1843, 1845), False, 'from email.message import Message\n'), ((2097, 2136), 'smtplib.SMTP', 'smtplib.SMTP', (['mailconfig.smtpservername'], {}), '(mailconfig.smtpservername)\n', (2109, 2136), False, 'import poplib, smtplib, email.utils, mailconfig\n'... |
import io
import os
from flask import Flask, request, jsonify
from PIL import Image
from resnet_model import MyResnetModel
app = Flask(__name__)
# max filesize 2mb
app.config['MAX_CONTENT_LENGTH'] = 2 * 1024 * 1024
# setup resnet model
model = MyResnetModel(os.path.dirname(os.path.abspath(__file__)))
@app.route("/... | [
"flask.jsonify",
"os.path.abspath",
"flask.Flask"
] | [((130, 145), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (135, 145), False, 'from flask import Flask, request, jsonify\n'), ((347, 389), 'flask.jsonify', 'jsonify', (["{'message': 'Hello from the API'}"], {}), "({'message': 'Hello from the API'})\n", (354, 389), False, 'from flask import Flask, request... |
from django.urls import reverse
from rest_framework import status
from .base import BaseTestCase
class FollowTestCase(BaseTestCase):
"""Testcases for following a user."""
def test_follow_user_post(self):
"""Test start following a user."""
url = reverse('follow', kwargs={'username': 'test2'})
... | [
"django.urls.reverse"
] | [((272, 319), 'django.urls.reverse', 'reverse', (['"""follow"""'], {'kwargs': "{'username': 'test2'}"}), "('follow', kwargs={'username': 'test2'})\n", (279, 319), False, 'from django.urls import reverse\n'), ((596, 643), 'django.urls.reverse', 'reverse', (['"""follow"""'], {'kwargs': "{'username': 'test2'}"}), "('follo... |
# -*- coding: utf-8 -*-
from django.contrib import admin
from .models import Mail
class MailAdmin(admin.ModelAdmin):
list_display = ['subject', 'sent_time', 'recipients_total', 'successful_mails', 'failed_mails', 'done_sending']
ordering = ['-sent_time']
# Prevent creation
def has_add_permission(s... | [
"django.contrib.admin.site.register"
] | [((559, 595), 'django.contrib.admin.site.register', 'admin.site.register', (['Mail', 'MailAdmin'], {}), '(Mail, MailAdmin)\n', (578, 595), False, 'from django.contrib import admin\n')] |
from uuid import uuid4
from fastapi.testclient import TestClient
from ..main import app
client = TestClient(app)
class Test_Event:
record = {
"name": "<NAME>",
"description": "It is a coding event held in the month of Decemeber by Programming Club",
"created_on": "2022-01-28T21:33:50.79... | [
"fastapi.testclient.TestClient",
"uuid.uuid4"
] | [((100, 115), 'fastapi.testclient.TestClient', 'TestClient', (['app'], {}), '(app)\n', (110, 115), False, 'from fastapi.testclient import TestClient\n'), ((1929, 1936), 'uuid.uuid4', 'uuid4', ([], {}), '()\n', (1934, 1936), False, 'from uuid import uuid4\n'), ((2755, 2762), 'uuid.uuid4', 'uuid4', ([], {}), '()\n', (276... |
from setuptools import setup
setup(
name='uam_simulator',
version='1.0',
description='A tool to simulate different architectures for UAM traffic management',
author='<NAME>',
author_email='<EMAIL>',
packages=['uam_simulator'],
install_requires=['numpy', 'scikit-learn', 'gurobipy']
)
# If in... | [
"setuptools.setup"
] | [((30, 295), 'setuptools.setup', 'setup', ([], {'name': '"""uam_simulator"""', 'version': '"""1.0"""', 'description': '"""A tool to simulate different architectures for UAM traffic management"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'packages': "['uam_simulator']", 'install_requires': "['numpy', ... |
import time
from os import system, walk
from config import CONFIG
from encry import ENCRY
from decry import DECRY
# Функция настройки конфигурации
def conf_setting():
system('CLS')
print("Enter key elements: ")
# Выбор алфавита
alphabet = input("Select the used alphabet [EN]GLISH | [RU]SSIAN: ")
#... | [
"os.system",
"time.sleep",
"os.walk",
"config.CONFIG"
] | [((173, 186), 'os.system', 'system', (['"""CLS"""'], {}), "('CLS')\n", (179, 186), False, 'from os import system, walk\n'), ((473, 511), 'config.CONFIG', 'CONFIG', (['alphabet', 'numberKey', 'stringKey'], {}), '(alphabet, numberKey, stringKey)\n', (479, 511), False, 'from config import CONFIG\n'), ((706, 715), 'os.walk... |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies and contributors
# License: MIT. See LICENSE
import frappe
from frappe.model.document import Document
class EmailQueueRecipient(Document):
DOCTYPE = "Email Queue Recipient"
def is_mail_to_be_sent(self):
return self.status == "Not Sent"
def is_m... | [
"frappe.db.commit",
"frappe.db.set_value"
] | [((416, 468), 'frappe.db.set_value', 'frappe.db.set_value', (['self.DOCTYPE', 'self.name', 'kwargs'], {}), '(self.DOCTYPE, self.name, kwargs)\n', (435, 468), False, 'import frappe\n'), ((485, 503), 'frappe.db.commit', 'frappe.db.commit', ([], {}), '()\n', (501, 503), False, 'import frappe\n')] |
# -*- coding: utf-8 -*-
# pylint: disable=unused-argument,pointless-statement
"""Tests for the `PseudoDojoFamily` class."""
import pytest
from aiida_pseudo.data.pseudo import UpfData, Psp8Data, PsmlData, JthXmlData
from aiida_pseudo.groups.family import PseudoDojoConfiguration, PseudoDojoFamily
def test_type_string(... | [
"aiida_pseudo.groups.family.PseudoDojoFamily",
"aiida_pseudo.groups.family.PseudoDojoFamily.get_valid_labels",
"pytest.raises",
"pytest.mark.usefixtures",
"aiida_pseudo.groups.family.PseudoDojoFamily.format_configuration_label",
"aiida_pseudo.groups.family.PseudoDojoConfiguration"
] | [((2423, 2458), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""clear_db"""'], {}), "('clear_db')\n", (2446, 2458), False, 'import pytest\n'), ((2776, 2811), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""clear_db"""'], {}), "('clear_db')\n", (2799, 2811), False, 'import pytest\n'), ((1363, 139... |
import sys
import json
import plotly
from flask import Flask
from flask import render_template, request
from plotly.graph_objects import Heatmap, Bar
from sklearn.externals import joblib
from sqlalchemy import create_engine
sys.path.append("common")
from common.nlp_common_utils import *
if len(sys.argv) == 1:
s... | [
"plotly.graph_objects.Bar",
"flask.render_template",
"flask.request.args.get",
"flask.Flask",
"sys.argv.append",
"sklearn.externals.joblib.load",
"json.dumps",
"sys.path.append"
] | [((226, 251), 'sys.path.append', 'sys.path.append', (['"""common"""'], {}), "('common')\n", (241, 251), False, 'import sys\n'), ((727, 775), 'flask.Flask', 'Flask', (['__name__'], {'template_folder': '"""app/templates"""'}), "(__name__, template_folder='app/templates')\n", (732, 775), False, 'from flask import Flask\n'... |
# coding: utf-8
import re
import utility
from commands import Command
def google_pages(string):
url = 'http://www.google.se/search?q=' + utility.escape(string) + '&ie=UTF-8&oe=UTF-8'
response = utility.read_url(url)
data = response["data"]
search = re.search('swrnum=(\d+)">', data)
if search:
result = searc... | [
"utility.escape",
"utility.read_url",
"re.search"
] | [((199, 220), 'utility.read_url', 'utility.read_url', (['url'], {}), '(url)\n', (215, 220), False, 'import utility\n'), ((257, 291), 're.search', 're.search', (['"""swrnum=(\\\\d+)">"""', 'data'], {}), '(\'swrnum=(\\\\d+)">\', data)\n', (266, 291), False, 'import re\n'), ((140, 162), 'utility.escape', 'utility.escape',... |
import copy
import numpy as np
from scipy.special import wofz
from scipy.integrate import quad
from typing import List, Tuple
import autoarray as aa
from autogalaxy.profiles.mass_profiles import MassProfile
from autogalaxy.profiles.mass_profiles.mass_profiles import (
MassProfileMGE,
MassProfileCSE... | [
"numpy.log10",
"numpy.sqrt",
"autogalaxy.profiles.mass_profiles.mass_profiles.psi_from",
"numpy.add",
"numpy.power",
"scipy.integrate.quad",
"numpy.subtract",
"copy.copy",
"numpy.exp",
"numpy.real",
"numpy.zeros",
"numpy.square",
"numpy.vstack",
"scipy.special.wofz",
"numpy.shape",
"nu... | [((5818, 5847), 'numpy.zeros', 'np.zeros', ([], {'shape': 'grid.shape[0]'}), '(shape=grid.shape[0])\n', (5826, 5847), True, 'import numpy as np\n'), ((6793, 6807), 'numpy.shape', 'np.shape', (['grid'], {}), '(grid)\n', (6801, 6807), True, 'import numpy as np\n'), ((6831, 6875), 'numpy.zeros', 'np.zeros', (['shape_grid[... |
"""Connection object for Network Manager."""
from ipaddress import ip_address, ip_interface
from typing import Optional
from ...const import ATTR_ADDRESS, ATTR_PREFIX
from ...utils.gdbus import DBus
from ..const import (
DBUS_ATTR_ADDRESS_DATA,
DBUS_ATTR_CONNECTION,
DBUS_ATTR_GATEWAY,
DBUS_ATTR_ID,
... | [
"ipaddress.ip_address",
"ipaddress.ip_interface"
] | [((2635, 2674), 'ipaddress.ip_address', 'ip_address', (['ip4_data[DBUS_ATTR_GATEWAY]'], {}), '(ip4_data[DBUS_ATTR_GATEWAY])\n', (2645, 2674), False, 'from ipaddress import ip_address, ip_interface\n'), ((2791, 2827), 'ipaddress.ip_address', 'ip_address', (['nameserver[ATTR_ADDRESS]'], {}), '(nameserver[ATTR_ADDRESS])\n... |
from __future__ import print_function, absolute_import
from .beats import Beat
from StringIO import StringIO
import sys
import os
import json
import urllib
import webbrowser
try:
import pycurl
except:
print("Need pycurl dependency to use qubole as the deployment platform. Run pip install pycurl in your virtuale... | [
"StringIO.StringIO",
"os.path.exists",
"json.loads",
"pycurl.Curl",
"os.path.join",
"urllib.urlencode",
"sys.exit"
] | [((349, 360), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (357, 360), False, 'import sys\n'), ((574, 610), 'os.path.join', 'os.path.join', (['projectsDir', '"""schemas"""'], {}), "(projectsDir, 'schemas')\n", (586, 610), False, 'import os\n'), ((633, 678), 'os.path.join', 'os.path.join', (['schemasDir', '"""beats.s... |
# -*- coding: utf-8 *-*
import logging
from unittest import TestCase
from nicepy import assert_equal_struct, multi_assert_equal_struct, pretty_repr, permuteflat
log = logging.getLogger(__name__)
class Foo(object):
def __init__(self, **kwargs):
for k, v in kwargs.iteritems():
self[k] = v
... | [
"logging.getLogger",
"nicepy.permuteflat",
"nicepy.pretty_repr",
"nicepy.assert_equal_struct",
"nicepy.multi_assert_equal_struct"
] | [((169, 196), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (186, 196), False, 'import logging\n'), ((512, 551), 'nicepy.pretty_repr', 'pretty_repr', (['self'], {'ignore_own_repr': '(True)'}), '(self, ignore_own_repr=True)\n', (523, 551), False, 'from nicepy import assert_equal_struct, m... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2017-03-20 16:07
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('awards', '0073_auto_20170320_1455'),
]
operations = [
migrations.AlterField... | [
"django.db.models.DecimalField",
"django.db.models.DateField",
"django.db.models.CharField"
] | [((397, 890), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'db_index': '(True)', 'help_text': '"""An identification code assigned to each financial assistance award tracking purposes. The FAIN is tied to that award (and all future modifications to that award) throughout the award’s life. E... |
#!/usr/bin/env python
# coding: utf-8
# <a id='top'></a>
#
#
# # $\texttt{GiRaFFEfood}$: Initial data for $\texttt{GiRaFFE}$
#
# ## Aligned Rotator
#
# $$\label{top}$$
#
# This module provides another initial data option for $\texttt{GiRaFFE}$. This is a flat-spacetime test with initial data $$A_{\phi} = \frac{\mu \va... | [
"NRPy_param_funcs.Cparameters",
"Min_Max_and_Piecewise_Expressions.coord_leq_bound",
"sympy.sqrt",
"sympy.sympify",
"indexedexp.LeviCivitaSymbol_dim3_rank3",
"reference_metric.reference_metric",
"sympy.diff",
"NRPy_param_funcs.set_parval_from_str",
"indexedexp.zerorank1"
] | [((1427, 1496), 'NRPy_param_funcs.set_parval_from_str', 'par.set_parval_from_str', (['"""reference_metric::CoordSystem"""', '"""Cartesian"""'], {}), "('reference_metric::CoordSystem', 'Cartesian')\n", (1450, 1496), True, 'import NRPy_param_funcs as par\n'), ((1496, 1518), 'reference_metric.reference_metric', 'rfm.refer... |