code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
# Generated by Django 3.1.6 on 2021-02-10 22:20
import django.core.files.storage
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Create... | [
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.IntegerField",
"django.db.models.BooleanField",
"django.db.models.AutoField",
"django.db.models.CharField"
] | [((398, 491), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (414, 491), False, 'from django.db import migrations, models\... |
import os
def get_random_seed() -> int:
return int(os.getenv("SEED", "0"))
| [
"os.getenv"
] | [((57, 79), 'os.getenv', 'os.getenv', (['"""SEED"""', '"""0"""'], {}), "('SEED', '0')\n", (66, 79), False, 'import os\n')] |
import asyncio
import importlib
import sys
import traceback
import warnings
from fastapi import FastAPI, Request
from fastapi.exceptions import RequestValidationError
from fastapi.middleware.cors import CORSMiddleware
from fastapi.middleware.gzip import GZipMiddleware
from fastapi.staticfiles import StaticFiles
from f... | [
"traceback.format_exc",
"fastapi.FastAPI",
"importlib.import_module",
"traceback.print_exception",
"sys.exc_info",
"asyncio.sleep",
"fastapi.staticfiles.StaticFiles",
"warnings.warn",
"asyncio.get_event_loop",
"lnbits.core.tasks.register_task_listeners"
] | [((1158, 1167), 'fastapi.FastAPI', 'FastAPI', ([], {}), '()\n', (1165, 1167), False, 'from fastapi import FastAPI, Request\n'), ((1193, 1231), 'fastapi.staticfiles.StaticFiles', 'StaticFiles', ([], {'directory': '"""lnbits/static"""'}), "(directory='lnbits/static')\n", (1204, 1231), False, 'from fastapi.staticfiles imp... |
from aurora.autodiff.autodiff import Op
from aurora.nn.pyx.fast_pooling import max_pool_forward, max_pool_backward
try:
from aurora.ndarray import gpu_op
except ImportError:
pass
class MaxPoolOp(Op):
def __call__(self, input, filter=(2, 2), strides=(2, 2)):
new_node = Op.__call__(self)
ne... | [
"aurora.nn.pyx.fast_pooling.max_pool_forward",
"aurora.ndarray.gpu_op.cudnn_pool_backward",
"aurora.ndarray.gpu_op.cudnn_pool_forward",
"aurora.nn.pyx.fast_pooling.max_pool_backward",
"aurora.autodiff.autodiff.Op.__call__"
] | [((292, 309), 'aurora.autodiff.autodiff.Op.__call__', 'Op.__call__', (['self'], {}), '(self)\n', (303, 309), False, 'from aurora.autodiff.autodiff import Op\n'), ((2402, 2419), 'aurora.autodiff.autodiff.Op.__call__', 'Op.__call__', (['self'], {}), '(self)\n', (2413, 2419), False, 'from aurora.autodiff.autodiff import O... |
"""
Purpose
-------
A Portfolio represents a collection of Aggregate objects. Applications include
* Model a book of insurance
* Model a large account with several sub lines
* Model a reinsurance portfolio or large treaty
"""
import collections
import json
import logging
from copy import deepcopy
import matplotl... | [
"logging.getLogger",
"numpy.alltrue",
"matplotlib.ticker.LogLocator",
"numpy.sqrt",
"IPython.core.display.display",
"numpy.hstack",
"pathlib.Path.home",
"numpy.log",
"scipy.interpolate.interp1d",
"pandas.Index",
"numpy.array",
"matplotlib.ticker.MaxNLocator",
"copy.deepcopy",
"pandas.read_... | [((1265, 1295), 'logging.getLogger', 'logging.getLogger', (['"""aggregate"""'], {}), "('aggregate')\n", (1282, 1295), False, 'import logging\n'), ((4456, 4512), 'pandas.concat', 'pd.concat', (['[a.report_ser for a in self.agg_list]'], {'axis': '(1)'}), '([a.report_ser for a in self.agg_list], axis=1)\n', (4465, 4512), ... |
from qtpy.QtCore import QThread
from gui.models.Algorithm import QAlgorithm
import copy
import logging
import operator
import collections
class FCFS(QAlgorithm):
def __init__(self, que, start_pos, disk_size):
super(FCFS, self).__init__()
self.que = que
self.start_pos = start_pos
def... | [
"logging.getLogger",
"operator.attrgetter",
"collections.deque",
"copy.deepcopy",
"qtpy.QtCore.QThread.msleep"
] | [((349, 374), 'logging.getLogger', 'logging.getLogger', (['"""FCFS"""'], {}), "('FCFS')\n", (366, 374), False, 'import logging\n'), ((454, 473), 'collections.deque', 'collections.deque', ([], {}), '()\n', (471, 473), False, 'import collections\n'), ((494, 513), 'collections.deque', 'collections.deque', ([], {}), '()\n'... |
from simtk import openmm as mm
from simtk.openmm import app
from simtk import unit
import torch
import numpy as np
# Gas constant in kJ / mol / K
R = 8.314e-3
class OpenMMEnergyInterface(torch.autograd.Function):
@staticmethod
def forward(ctx, input, openmm_context, temperature):
device = input.devi... | [
"torch.log",
"simtk.openmm.Platform.getPlatformByName",
"torch.isfinite",
"torch.from_numpy",
"numpy.array",
"torch.tensor",
"simtk.openmm.LangevinIntegrator",
"numpy.isnan",
"torch.zeros_like",
"numpy.isinf",
"numpy.zeros_like",
"torch.zeros",
"torch.where"
] | [((4686, 4708), 'torch.isfinite', 'torch.isfinite', (['energy'], {}), '(energy)\n', (4700, 4708), False, 'import torch\n'), ((4757, 4809), 'torch.where', 'torch.where', (['(energy < energy_max)', 'energy', 'energy_max'], {}), '(energy < energy_max, energy, energy_max)\n', (4768, 4809), False, 'import torch\n'), ((449, ... |
from django.shortcuts import render, redirect
from django.utils.html import escape
from . import forms
from django.views.generic import TemplateView
from django.contrib.auth import logout, authenticate, login
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse, JsonResponse
im... | [
"django.shortcuts.render",
"django.contrib.auth.authenticate",
"docx.shared.Inches",
"docx.shared.Pt",
"django.http.JsonResponse",
"django.http.HttpResponse",
"csv.writer",
"django.contrib.auth.login",
"rest_framework.authtoken.models.Token.objects.get_or_create",
"django.shortcuts.redirect",
"d... | [((1602, 1650), 'django.shortcuts.render', 'render', (['request', '"""Attendance/login_success.html"""'], {}), "(request, 'Attendance/login_success.html')\n", (1608, 1650), False, 'from django.shortcuts import render, redirect\n'), ((1259, 1309), 'django.contrib.auth.authenticate', 'authenticate', ([], {'username': 'us... |
"""The main parsing routine."""
import logging
import argparse
import sys
import re
from .common import (
PARAM_KEYWORDS,
RETURN_KEYWORDS,
Docblock,
DocblockParam,
DocblockReturns,
ParseError,
)
from .generator import Generator
# Set up the logger
logger = logging.getLogger("jdp")
# Use a consol... | [
"logging.getLogger",
"logging.StreamHandler",
"argparse.ArgumentParser",
"re.compile",
"logging.Formatter",
"sys.exit",
"re.sub",
"re.findall"
] | [((281, 305), 'logging.getLogger', 'logging.getLogger', (['"""jdp"""'], {}), "('jdp')\n", (298, 305), False, 'import logging\n'), ((370, 393), 'logging.StreamHandler', 'logging.StreamHandler', ([], {}), '()\n', (391, 393), False, 'import logging\n'), ((440, 591), 'logging.Formatter', 'logging.Formatter', (['"""%(leveln... |
import unittest
import trollius as asyncio
from trollius import From, Return
import sys
sys.path.append('../../')
from yieldfrom_t.urllib3.poolmanager import PoolManager
from yieldfrom_t.urllib3 import connection_from_url
from yieldfrom_t.urllib3.exceptions import (
ClosedPoolError,
LocationValueError,
)
cla... | [
"unittest.main",
"yieldfrom_t.urllib3.connection_from_url",
"yieldfrom_t.urllib3.poolmanager.PoolManager",
"sys.path.append"
] | [((88, 113), 'sys.path.append', 'sys.path.append', (['"""../../"""'], {}), "('../../')\n", (103, 113), False, 'import sys\n'), ((2510, 2525), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2523, 2525), False, 'import unittest\n'), ((806, 854), 'yieldfrom_t.urllib3.connection_from_url', 'connection_from_url', (['"... |
import sys
import re
'''
Applies to one tsv file at a time, output is a txt file of the same name
'''
if len(sys.argv) < 4:
print("Usage: python recurrent_formatting.py input.tsv datatype rnnlm_model")
filename = sys.argv[1]
#outputdest = "recurrent/data/"+sys.argv[2]+"/"
if sys.argv[3] == 'ptb':
vocabfile... | [
"re.sub"
] | [((1260, 1292), 're.sub', 're.sub', (['"""(\\\\p)"""', '""" \\\\1 """', 'prefix'], {}), "('(\\\\p)', ' \\\\1 ', prefix)\n", (1266, 1292), False, 'import re\n'), ((1306, 1336), 're.sub', 're.sub', (['"""\\\\s{2,}"""', '""" """', 'prefix'], {}), "('\\\\s{2,}', ' ', prefix)\n", (1312, 1336), False, 'import re\n')] |
from ctypes import windll
while True:
windll.user32.BlockInput(True) | [
"ctypes.windll.user32.BlockInput"
] | [((46, 76), 'ctypes.windll.user32.BlockInput', 'windll.user32.BlockInput', (['(True)'], {}), '(True)\n', (70, 76), False, 'from ctypes import windll\n')] |
"""Defines the database models for a batch"""
from __future__ import unicode_literals
import logging
from collections import namedtuple
import django.contrib.postgres.fields
from django.db import connection, models, transaction
from django.db.models import F, Q
from django.utils.timezone import now
from batch.config... | [
"logging.getLogger",
"batch.serializers.BatchBaseSerializerV6",
"django.db.models.TextField",
"django.db.models.IntegerField",
"recipe.models.RecipeTypeSubLink.objects.count_subrecipes",
"batch.configuration.json.configuration_v6.convert_configuration_to_v6",
"data.models.DataSetFile.objects.get_files",... | [((1247, 1274), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1264, 1274), False, 'import logging\n'), ((1295, 1369), 'collections.namedtuple', 'namedtuple', (['"""BatchValidation"""', "['is_valid', 'errors', 'warnings', 'batch']"], {}), "('BatchValidation', ['is_valid', 'errors', 'warn... |
import subprocess
import functools
@functools.lru_cache(maxsize=1)
def git_available():
"""
Indicates whether ``git`` is available on the system.
Result is cached by functools.lru_cache
"""
return (
subprocess.call(
["git", "--version"], stdout=subprocess.DEVNULL, stderr=subp... | [
"functools.lru_cache",
"subprocess.call"
] | [((38, 68), 'functools.lru_cache', 'functools.lru_cache', ([], {'maxsize': '(1)'}), '(maxsize=1)\n', (57, 68), False, 'import functools\n'), ((521, 552), 'subprocess.call', 'subprocess.call', (['args'], {}), '(args, **kwargs)\n', (536, 552), False, 'import subprocess\n'), ((231, 327), 'subprocess.call', 'subprocess.cal... |
"""Template callable unit test module.
Use this module as an example/template to write unit tests for general (see: non-core),
callable (e.g., functions, basic classes) features of Iron Onyx (IRON).
If you decide to separate your test class and Test Cases into separate modules within this
package, ensure the Test Case... | [
"test.unit_tests.unittestbase.execute_test_cases"
] | [((6353, 6373), 'test.unit_tests.unittestbase.execute_test_cases', 'execute_test_cases', ([], {}), '()\n', (6371, 6373), False, 'from test.unit_tests.unittestbase import execute_test_cases\n')] |
import json
from ibm_watson import LanguageTranslatorV3
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
apikey = os.environ['apikey']
url = os.environ['url']
authenticator = IAMAuthenticator('apikey')
language_translator = LanguageTranslatorV3(
version='2018-05-01',
authenticator=authenticator
... | [
"ibm_watson.LanguageTranslatorV3",
"ibm_cloud_sdk_core.authenticators.IAMAuthenticator"
] | [((191, 217), 'ibm_cloud_sdk_core.authenticators.IAMAuthenticator', 'IAMAuthenticator', (['"""apikey"""'], {}), "('apikey')\n", (207, 217), False, 'from ibm_cloud_sdk_core.authenticators import IAMAuthenticator\n'), ((240, 311), 'ibm_watson.LanguageTranslatorV3', 'LanguageTranslatorV3', ([], {'version': '"""2018-05-01"... |
# Copyright 2020, The TensorFlow Federated 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 applicable law o... | [
"tensorflow_federated.python.core.backends.xla.compiler.XlaComputationFactory",
"tensorflow_federated.python.core.impl.context_stack.context_stack_impl.context_stack.set_default_context",
"tensorflow_federated.python.core.impl.execution_contexts.sync_execution_context.ExecutionContext"
] | [((1635, 1695), 'tensorflow_federated.python.core.impl.execution_contexts.sync_execution_context.ExecutionContext', 'sync_execution_context.ExecutionContext', ([], {'executor_fn': 'factory'}), '(executor_fn=factory)\n', (1674, 1695), False, 'from tensorflow_federated.python.core.impl.execution_contexts import sync_exec... |
#!/usr/bin/python3
# *****************************************************************************
#
# 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 ... | [
"boto3.client",
"argparse.ArgumentParser",
"datalab.logger.logging.info",
"json.dumps",
"boto3.resource",
"sys.exit",
"ipaddress.ip_address",
"datalab.logger.logging.error"
] | [((1182, 1207), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1205, 1207), False, 'import argparse\n'), ((2017, 2038), 'boto3.resource', 'boto3.resource', (['"""ec2"""'], {}), "('ec2')\n", (2031, 2038), False, 'import boto3\n'), ((4871, 4890), 'boto3.client', 'boto3.client', (['"""ec2"""'], {... |
"""
Test to test truncation error and
"""
import numpy as np
import time
import matplotlib.pyplot as plt
from HAPILite import CalcCrossSection, CalcCrossSectionWithError
from lib.ReadComputeFunc import ReadData
from lib.PartitionFunction import BD_TIPS_2017_PYTHON
from matplotlib.backends.backend_pdf import PdfPages
... | [
"numpy.trapz",
"numpy.logical_and",
"HAPILite.CalcCrossSection",
"numpy.exp",
"lib.ReadComputeFunc.ReadData",
"numpy.sum",
"numpy.savetxt",
"lib.PartitionFunction.BD_TIPS_2017_PYTHON",
"numpy.arange"
] | [((514, 577), 'numpy.arange', 'np.arange', (['OmegaRangeValue[0]', '(OmegaRangeValue[1] + 0.01)', '(0.001)'], {}), '(OmegaRangeValue[0], OmegaRangeValue[1] + 0.01, 0.001)\n', (523, 577), True, 'import numpy as np\n'), ((589, 625), 'lib.ReadComputeFunc.ReadData', 'ReadData', (['Molecule'], {'Location': '"""data/"""'}), ... |
# -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from numpy import ma
from .qctests import QCCheckVar
def constant_cluster_size(x, tol=0):
"""Estimate the cluster size with (nearly) constant value
Returns how many consecutive neighbor values are ... | [
"numpy.ma.getmaskarray",
"numpy.ma.fix_invalid",
"numpy.ndim",
"numpy.zeros",
"numpy.ma.compressed",
"numpy.nonzero",
"numpy.shape",
"numpy.atleast_1d"
] | [((429, 439), 'numpy.ndim', 'np.ndim', (['x'], {}), '(x)\n', (436, 439), True, 'import numpy as np\n'), ((726, 737), 'numpy.shape', 'np.shape', (['x'], {}), '(x)\n', (734, 737), True, 'import numpy as np\n'), ((2173, 2224), 'numpy.zeros', 'np.zeros', (['self.data[self.varname].shape'], {'dtype': '"""i1"""'}), "(self.da... |
#!/usr/bin/env python
"""
_WMWorkload_t_
Unittest for WMWorkload class
"""
from future.utils import viewitems
import os
import unittest
import WMCore_t.WMSpec_t.TestWorkloads as TestSpecs
from copy import copy
from WMCore.WMSpec.WMSpecErrors import WMSpecFactoryException
from WMCore.WMSpec.WMTask import WMTask, WMT... | [
"os.path.exists",
"WMCore.WMSpec.Steps.Templates.CMSSW.CMSSW",
"WMCore.WMSpec.WMWorkloadTools.validatePhEDExSubscription",
"WMCore.WMSpec.WMWorkload.WMWorkload",
"WMCore.WMSpec.WMTask.WMTask",
"os.getcwd",
"WMCore.WMSpec.WMWorkloadTools.validateSiteLists",
"future.utils.viewitems",
"unittest.main",
... | [((110255, 110270), 'unittest.main', 'unittest.main', ([], {}), '()\n', (110268, 110270), False, 'import unittest\n'), ((742, 774), 'os.path.exists', 'os.path.exists', (['self.persistFile'], {}), '(self.persistFile)\n', (756, 774), False, 'import os\n'), ((7054, 7069), 'WMCore.WMSpec.Steps.Templates.CMSSW.CMSSW', 'CMSS... |
import os
import numpy as np
import tensorflow as tf
import Inference.Inference as infer
flags = tf.app.flags
flags.DEFINE_string("dataset", "prostate", "The name of dataset [mnist, prostate]")
flags.DEFINE_string("data_dir", "samples", "Directory name that saved the sampled tf record")
flags.DEFINE_string("GPU", "0",... | [
"Inference.Inference._main_inference_prostate",
"Inference.Inference._main_inference_mnist",
"tensorflow.app.run"
] | [((785, 797), 'tensorflow.app.run', 'tf.app.run', ([], {}), '()\n', (795, 797), True, 'import tensorflow as tf\n'), ((555, 589), 'Inference.Inference._main_inference_mnist', 'infer._main_inference_mnist', (['FLAGS'], {}), '(FLAGS)\n', (582, 589), True, 'import Inference.Inference as infer\n'), ((636, 673), 'Inference.I... |
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseBadRequest, HttpResponseServerError, HttpResponseForbidden
from django.template import RequestContext
from django.shortcuts import get_object_or_404, render_to_response
from lingcod.common import default_mimetypes as mimetypes
from lingcod.comm... | [
"django.template.RequestContext",
"lingcod.studyregion.models.StudyRegion.objects.current",
"django.shortcuts.get_object_or_404",
"django.views.decorators.cache.cache_page"
] | [((1217, 1241), 'django.views.decorators.cache.cache_page', 'cache_page', (['(60 * 60 * 24)'], {}), '(60 * 60 * 24)\n', (1227, 1241), False, 'from django.views.decorators.cache import cache_page\n'), ((1062, 1106), 'django.shortcuts.get_object_or_404', 'get_object_or_404', (['models.StudyRegion'], {'pk': 'pk'}), '(mode... |
# Copyright 2021 The TensorFlow 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 applica... | [
"tensorflow.keras.backend.set_image_data_format",
"official.vision.beta.modeling.decoders.aspp.ASPP",
"absl.testing.parameterized.parameters",
"tensorflow.test.main",
"tensorflow.keras.Input",
"official.vision.beta.modeling.backbones.resnet.ResNet"
] | [((913, 1083), 'absl.testing.parameterized.parameters', 'parameterized.parameters', (['(3, [6, 12, 18, 24], 128)', '(3, [6, 12, 18], 128)', '(3, [6, 12], 256)', '(4, [6, 12, 18, 24], 128)', '(4, [6, 12, 18], 128)', '(4, [6, 12], 256)'], {}), '((3, [6, 12, 18, 24], 128), (3, [6, 12, 18], 128),\n (3, [6, 12], 256), (4... |
from __future__ import print_function, division
import os,unittest,numpy as np
def run_tddft_iter(calculator, label, freq):
from pyscf.nao import system_vars_c, prod_basis_c, tddft_iter_c
if label == "siesta":
sv = system_vars_c().init_siesta_xml()
elif label == "gpaw":
sv = system_vars_c()... | [
"numpy.eye",
"gpaw.PoissonSolver",
"gpaw.GPAW",
"numpy.argmax",
"numpy.array",
"numpy.zeros",
"numpy.linspace",
"pyscf.nao.prod_basis_c",
"pyscf.nao.system_vars_c",
"unittest.main",
"pyscf.nao.tddft_iter_c",
"numpy.transpose",
"ase.calculators.siesta.Siesta"
] | [((486, 537), 'pyscf.nao.tddft_iter_c', 'tddft_iter_c', (['pb.sv', 'pb'], {'tddft_iter_broadening': '(0.01)'}), '(pb.sv, pb, tddft_iter_broadening=0.01)\n', (498, 537), False, 'from pyscf.nao import system_vars_c, prod_basis_c, tddft_iter_c\n'), ((639, 677), 'numpy.zeros', 'np.zeros', (['omegas.shape[0]'], {'dtype': 'f... |
def stt():
import os
import glob
from os import listdir
import librosa
import speech_recognition as sr
import re
from scipy.io import wavfile
import numpy as np
import soundfile as sf
path = 'speakers/'
text_files = [f for f in os.listdir(path) if f.endswith('.wav')]
tex... | [
"speech_recognition.Recognizer",
"speech_recognition.AudioFile",
"re.sub",
"os.listdir"
] | [((455, 470), 'speech_recognition.Recognizer', 'sr.Recognizer', ([], {}), '()\n', (468, 470), True, 'import speech_recognition as sr\n'), ((273, 289), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n', (283, 289), False, 'import os\n'), ((690, 712), 'speech_recognition.AudioFile', 'sr.AudioFile', (['filename'], {}... |
# -*- coding: utf-8 -*-
# Copyright 2021 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | [
"kubernetes.client.V1ObjectMeta",
"unittest.mock.Mock",
"kubernetes.client.V1NetworkPolicyList",
"kubernetes.client.V1PodSpec",
"kubernetes.client.V1NodeList",
"kubernetes.client.V1PodList",
"kubernetes.client.V1LabelSelector",
"kubernetes.client.V1ServiceSpec"
] | [((768, 779), 'unittest.mock.Mock', 'mock.Mock', ([], {}), '()\n', (777, 779), False, 'from unittest import mock\n'), ((1155, 1221), 'kubernetes.client.V1ObjectMeta', 'client.V1ObjectMeta', ([], {'name': 'name', 'namespace': 'namespace', 'labels': 'labels'}), '(name=name, namespace=namespace, labels=labels)\n', (1174, ... |
import importlib
import pathlib
__all__ = [
f.stem
for f in pathlib.Path(__file__).parent.glob("*.py")
if f.is_file() and not f.name == "__init__.py"
]
for _ in __all__:
importlib.import_module("." + _, "cooltools.api")
del pathlib
del importlib
| [
"importlib.import_module",
"pathlib.Path"
] | [((188, 237), 'importlib.import_module', 'importlib.import_module', (["('.' + _)", '"""cooltools.api"""'], {}), "('.' + _, 'cooltools.api')\n", (211, 237), False, 'import importlib\n'), ((69, 91), 'pathlib.Path', 'pathlib.Path', (['__file__'], {}), '(__file__)\n', (81, 91), False, 'import pathlib\n')] |
"""
Problem:
Goat latin, much like pig latin, is a simple way of encoding words to
disguise their meaning. It works like so:
* For small words (3 characters or less), repeat it twice.
eg: "and" -> "andand"
* For longer words beginning with a vowel, remove the first letter and
append ... | [
"doctest.testmod"
] | [((897, 926), 'doctest.testmod', 'doctest.testmod', ([], {'verbose': '(True)'}), '(verbose=True)\n', (912, 926), False, 'import doctest\n')] |
import re
class OrList(list):
pass
def parse_input(fh):
# parse rules
rules_dict = {}
for line in fh:
if not re.match(r"\d",line):
break
index, rule = line.split(":")
rule = rule.strip()
# if rule contains |s, split on them and then split subrules... | [
"re.match"
] | [((136, 157), 're.match', 're.match', (['"""\\\\d"""', 'line'], {}), "('\\\\d', line)\n", (144, 157), False, 'import re\n'), ((611, 640), 're.match', 're.match', (['"""\\\\"[a-z]\\\\\\""""', 'rule'], {}), '(\'\\\\"[a-z]\\\\"\', rule)\n', (619, 640), False, 'import re\n')] |
import traceback
from functools import wraps
from types import MethodType
from django.db import DEFAULT_DB_ALIAS, connections
from django_perf_rec.operation import AllSourceRecorder, Operation
from django_perf_rec.orm import patch_ORM_to_be_deterministic
from django_perf_rec.settings import perf_rec_settings
from dja... | [
"django_perf_rec.orm.patch_ORM_to_be_deterministic",
"django_perf_rec.sql.sql_fingerprint",
"traceback.extract_stack",
"functools.wraps"
] | [((1091, 1122), 'django_perf_rec.orm.patch_ORM_to_be_deterministic', 'patch_ORM_to_be_deterministic', ([], {}), '()\n', (1120, 1122), False, 'from django_perf_rec.orm import patch_ORM_to_be_deterministic\n'), ((1399, 1410), 'functools.wraps', 'wraps', (['func'], {}), '(func)\n', (1404, 1410), False, 'from functools imp... |
# -*- coding: future_fstrings -*-
import logging
from Yandex import Translate
from .. import loader, utils
logger = logging.getLogger(__name__)
def register(cb):
cb(TranslateMod())
class TranslateMod(loader.Module):
"""Translator"""
def __init__(self):
self.commands = {"translate":self.translat... | [
"logging.getLogger",
"Yandex.Translate",
"logging.error"
] | [((119, 146), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (136, 146), False, 'import logging\n'), ((467, 500), 'Yandex.Translate', 'Translate', (["self.config['API_KEY']"], {}), "(self.config['API_KEY'])\n", (476, 500), False, 'from Yandex import Translate\n'), ((1250, 1336), 'logging.... |
import sqlalchemy as sa
from enum import Enum
from typing import List, Optional
from dataclasses import dataclass, field
from sqlalchemy.orm import relationship
from origin.serialize import Serializable
from origin.models.tech import TechnologyType
from origin.models.common import ResultOrdering
from origin.models.met... | [
"sqlalchemy.orm.relationship",
"sqlalchemy.PrimaryKeyConstraint",
"sqlalchemy.UniqueConstraint",
"sqlalchemy.String",
"sqlalchemy.Enum",
"dataclasses.field"
] | [((602, 621), 'dataclasses.field', 'field', ([], {'default': 'None'}), '(default=None)\n', (607, 621), False, 'from dataclasses import dataclass, field\n'), ((662, 681), 'dataclasses.field', 'field', ([], {'default': 'None'}), '(default=None)\n', (667, 681), False, 'from dataclasses import dataclass, field\n'), ((716, ... |
import os
import unittest
from unittest.mock import patch
import json
import uuid
import numpy as np
from pytest import raises
from kb_RDP_Classifier.util.debug import dprint, where_am_i
from kb_RDP_Classifier.impl.globals import Var
from kb_RDP_Classifier.impl.params import Params
from kb_RDP_Classifier.impl.kbase_ob... | [
"uuid.uuid4",
"json.dumps",
"unittest.mock.patch.dict",
"kb_RDP_Classifier.impl.kbase_obj.AmpliconMatrix"
] | [((489, 585), 'unittest.mock.patch.dict', 'patch.dict', (['"""kb_RDP_Classifier.impl.kbase_obj.Var"""'], {'values': "{'dfu': mock_dfu, 'warnings': []}"}), "('kb_RDP_Classifier.impl.kbase_obj.Var', values={'dfu': mock_dfu,\n 'warnings': []})\n", (499, 585), False, 'from unittest.mock import patch\n'), ((2957, 3033), ... |
import pytest
from flex.error_messages import MESSAGES
from flex.exceptions import ValidationError
from flex.validation.response import (
validate_response,
)
from tests.factories import (
SchemaFactory,
ResponseFactory,
)
from tests.utils import assert_message_in_errors
def test_response_content_type_... | [
"tests.factories.SchemaFactory",
"flex.validation.response.validate_response",
"tests.factories.ResponseFactory"
] | [((347, 473), 'tests.factories.SchemaFactory', 'SchemaFactory', ([], {'produces': "['application/json']", 'paths': "{'/get': {'get': {'responses': {'200': {'description': 'Success'}}}}}"}), "(produces=['application/json'], paths={'/get': {'get': {\n 'responses': {'200': {'description': 'Success'}}}}})\n", (360, 473)... |
from django.shortcuts import render
# Create your views here
def redirector(request):
"""
View used to get browser language && redirect to good website
"""
return render(request, 'pages/redirector.html')
def index(request, lang='en'):
"""
index page of the website
"""
data = {'lang':... | [
"django.shortcuts.render"
] | [((181, 221), 'django.shortcuts.render', 'render', (['request', '"""pages/redirector.html"""'], {}), "(request, 'pages/redirector.html')\n", (187, 221), False, 'from django.shortcuts import render\n'), ((513, 566), 'django.shortcuts.render', 'render', (['request', '"""pages/common/page_canvas.html"""', 'env'], {}), "(r... |
# Authors: <NAME>
# License: BSD 3 Clause
"""
PyMF Simplex Volume Maximization for CUR [1]
SIVMCUR: class for SiVM-CUR
[1] <NAME>, <NAME>, and <NAME>. Yes We Can - Simplex Volume
Maximization for Descriptive Web-Scale Matrix Factorization. In Proc. Int.
Conf. on Information and Knowledge Management. ACM. 2010... | [
"doctest.testmod"
] | [((3039, 3056), 'doctest.testmod', 'doctest.testmod', ([], {}), '()\n', (3054, 3056), False, 'import doctest\n')] |
import Functions
import pandas as pd
import matplotlib.pyplot as plt
def group_sentiment(dfSentiment):
dfSentiment['datetime'] = pd.to_datetime(dfSentiment['created_utc'], unit='s')
dfSentiment['date'] = pd.DatetimeIndex(dfSentiment['datetime']).date
dfSentiment = dfSentiment[
['created_utc', 'ne... | [
"datetime.datetime",
"pandas.read_csv",
"Functions.get_sentiment",
"pandas.DatetimeIndex",
"Functions.collect_big_query",
"Functions.PortfolioSort",
"pandas.DataFrame",
"re.sub",
"matplotlib.pyplot.subplots",
"pandas.to_datetime"
] | [((1998, 2012), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (2010, 2012), True, 'import pandas as pd\n'), ((2621, 2635), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (2633, 2635), True, 'import pandas as pd\n'), ((3093, 3138), 'pandas.read_csv', 'pd.read_csv', (['"""EOS_sentiment.csv"""'], {'index_co... |
from django.db import models
from django.contrib.auth.models import User
from django.dispatch import receiver
from django.db.models.signals import post_save
class Project(models.Model):
title = models.TextField(max_length=100, null=True,
blank=True, default="title")
project_image =... | [
"django.db.models.OneToOneField",
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.IntegerField",
"django.db.models.DateTimeField",
"django.db.models.ImageField",
"django.dispatch.receiver",
"django.db.models.URLField",
"django.db.models.CharField"
] | [((199, 271), 'django.db.models.TextField', 'models.TextField', ([], {'max_length': '(100)', 'null': '(True)', 'blank': '(True)', 'default': '"""title"""'}), "(max_length=100, null=True, blank=True, default='title')\n", (215, 271), False, 'from django.db import models\n'), ((321, 390), 'django.db.models.ImageField', 'm... |
#!/usr/bin/env python
#SBATCH --job-name=worldline
#SBATCH --partition=largemem
## Stampede node has 16 processors & 32 GB
## Except largemem nodes, which have 32 processors & 1 TB
#SBATCH --nodes=1
#SBATCH --ntasks=16
#SBATCH --time=12:00:00
#SBATCH --output=worldline_jobs/%j.out
#SBATCH --error=worldline_jobs/%j.err... | [
"worldline.select.IDSampler",
"worldline.select.IDSelector"
] | [((2011, 2038), 'worldline.select.IDSelector', 'select.IDSelector', ([], {}), '(**kwargs)\n', (2028, 2038), True, 'import worldline.select as select\n'), ((2286, 2320), 'worldline.select.IDSampler', 'select.IDSampler', ([], {}), '(**sampler_kwargs)\n', (2302, 2320), True, 'import worldline.select as select\n')] |
# Copyright (c) 2019 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""Tools for versioning."""
def get_version():
"""Get MetPy's version.
Either get it from package metadata, or get it using version control information if
a developmen... | [
"setuptools_scm.get_version",
"importlib_metadata.version"
] | [((410, 519), 'setuptools_scm.get_version', 'get_version', ([], {'root': '"""../.."""', 'relative_to': '__file__', 'version_scheme': '"""post-release"""', 'local_scheme': '"""dirty-tag"""'}), "(root='../..', relative_to=__file__, version_scheme=\n 'post-release', local_scheme='dirty-tag')\n", (421, 519), False, 'fro... |
# -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import unittest, time
class TestCaseUserAddRemoveProduct(unittest.TestCase):
def setUp(self):
... | [
"selenium.webdriver.support.ui.WebDriverWait",
"selenium.webdriver.Chrome",
"time.sleep",
"selenium.webdriver.support.expected_conditions.presence_of_element_located",
"unittest.main"
] | [((4238, 4253), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4251, 4253), False, 'import unittest, time\n'), ((338, 402), 'selenium.webdriver.Chrome', 'webdriver.Chrome', ([], {'executable_path': '"""D:/Python36/chromedriver.exe"""'}), "(executable_path='D:/Python36/chromedriver.exe')\n", (354, 402), False, 'fr... |
"""spin-weight harmonic transform module
This module has benefited from pre-existing work by <NAME>
"""
from __future__ import print_function
import os
import numpy as np
import pyfftw
from lenspyx.shts import fsht
from lenspyx import utils
def vtm2map(spin, vtm, Nphi, pfftwthreads=None, bicubic_prefilt=False, ... | [
"numpy.sqrt",
"numpy.where",
"lenspyx.shts.fsht.glm2vtm_s0sym",
"numpy.fft.fftfreq",
"os.environ.get",
"numpy.array",
"numpy.zeros",
"pyfftw.empty_aligned",
"numpy.outer",
"numpy.fft.ifft",
"lenspyx.shts.fsht.vlm2vtm_sym",
"numpy.sum",
"pyfftw.FFTW",
"lenspyx.utils.alm2vlm",
"numpy.arang... | [((4154, 4167), 'numpy.array', 'np.array', (['tht'], {}), '(tht)\n', (4162, 4167), True, 'import numpy as np\n'), ((5674, 5711), 'numpy.zeros', 'np.zeros', (['(2 * lmax + 1)'], {'dtype': 'complex'}), '(2 * lmax + 1, dtype=complex)\n', (5682, 5711), True, 'import numpy as np\n'), ((5720, 5739), 'numpy.arange', 'np.arang... |
import dash
import dash_html_components as html
import dash_bootstrap_components as dbc
sofifa_logo = "https://uptime.com/media/website_profiles/sofifa.com.png"
navbar = dbc.NavbarSimple(
brand='Soccer Players Dashboard',
children=[
html.Img(src=sofifa_logo, height=20),
html.A('Data ... | [
"dash_html_components.A",
"dash_html_components.Div",
"dash.Dash",
"dash_html_components.Img"
] | [((514, 568), 'dash.Dash', 'dash.Dash', ([], {'external_stylesheets': '[dbc.themes.BOOTSTRAP]'}), '(external_stylesheets=[dbc.themes.BOOTSTRAP])\n', (523, 568), False, 'import dash\n'), ((585, 601), 'dash_html_components.Div', 'html.Div', (['navbar'], {}), '(navbar)\n', (593, 601), True, 'import dash_html_components as... |
# -*- coding: utf-8 -*-
import sys
import tempfile
from .task_reset import task_reset_at_exit, task_reset
from jug.jug import init
from jug.options import parse
from jug.subcommands.execute import execute
import json
from six import StringIO
class catch_stdout:
def __enter__(self):
sys.stdout = StringIO(... | [
"json.loads",
"jug.jug.init",
"jug.options.parse",
"six.StringIO",
"tempfile.NamedTemporaryFile",
"jug.subcommands.execute.execute.run",
"sys.stdout.seek"
] | [((603, 644), 'tempfile.NamedTemporaryFile', 'tempfile.NamedTemporaryFile', ([], {'suffix': '""".py"""'}), "(suffix='.py')\n", (630, 644), False, 'import tempfile\n'), ((722, 779), 'jug.options.parse', 'parse', (["['execute', jugfile.name, '--', '--noarg', 'here']"], {}), "(['execute', jugfile.name, '--', '--noarg', 'h... |
from collections import defaultdict
class FrontierSet(object):
"""
A set that also maintains a partial topological ordering
The current set of "non-blocked" items can be obtained as
.frontier
"""
def __init__(self, data=None):
self._inhibiting_set = defaultdict(set)
self._bloc... | [
"collections.defaultdict"
] | [((285, 301), 'collections.defaultdict', 'defaultdict', (['set'], {}), '(set)\n', (296, 301), False, 'from collections import defaultdict\n'), ((331, 347), 'collections.defaultdict', 'defaultdict', (['set'], {}), '(set)\n', (342, 347), False, 'from collections import defaultdict\n')] |
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 8 12:52:08 2018
@author: jd2383
"""
import requests, csv
from bs4 import BeautifulSoup
url = "http://web.library.yale.edu"
r = requests.get(url)
#print(r.text)
soup = BeautifulSoup(r.text, 'html.parser')
#print(soup)
tableData = soup.find_all('td', class_='hours-col-... | [
"bs4.BeautifulSoup",
"csv.writer",
"requests.get"
] | [((178, 195), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (190, 195), False, 'import requests, csv\n'), ((219, 255), 'bs4.BeautifulSoup', 'BeautifulSoup', (['r.text', '"""html.parser"""'], {}), "(r.text, 'html.parser')\n", (232, 255), False, 'from bs4 import BeautifulSoup\n'), ((416, 435), 'csv.writer', '... |
from js9 import j
try:
# import boto3
from minio import Minio
from minio.error import (
ResponseError,
BucketAlreadyOwnedByYou,
BucketAlreadyExists
)
except:
print("WARNING: s3 pip client (minio) not found please install do j.clients.s3.install()")
TEMPLATE = """
address =... | [
"minio.Minio",
"js9.j.sal.fs.exists"
] | [((1234, 1350), 'minio.Minio', 'Minio', (["('%s:%s' % (c['address'], c['port']))"], {'access_key': "c['accesskey_']", 'secret_key': "c['secretkey_']", 'secure': '(False)'}), "('%s:%s' % (c['address'], c['port']), access_key=c['accesskey_'],\n secret_key=c['secretkey_'], secure=False)\n", (1239, 1350), False, 'from m... |
"""
Copyright (C) 2018-2020 Intel Corporation
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 i... | [
"mo.ops.result.Result",
"mo.ops.memoryoffset.MemoryOffset"
] | [((1415, 1582), 'mo.ops.memoryoffset.MemoryOffset', 'MemoryOffset', (['graph', "{'name': offset_node.pair_name, 'splitted': True, 'pair_name': offset_node.\n id, 't': offset_node.t, 'has_default': offset_node.has_default}"], {}), "(graph, {'name': offset_node.pair_name, 'splitted': True,\n 'pair_name': offset_nod... |
# ----------------------------------------------------------------------------
# Copyright (c) 2017-2020, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | [
"versioneer.get_cmdclass",
"setuptools.find_packages",
"versioneer.get_version"
] | [((462, 486), 'versioneer.get_version', 'versioneer.get_version', ([], {}), '()\n', (484, 486), False, 'import versioneer\n'), ((501, 526), 'versioneer.get_cmdclass', 'versioneer.get_cmdclass', ([], {}), '()\n', (524, 526), False, 'import versioneer\n'), ((541, 556), 'setuptools.find_packages', 'find_packages', ([], {}... |
"""Convert Hindawi library html to OpenITI mARkdown.
This script subclasses the generic MarkdownConverter class
from the html2md module (based on python-markdownify,
https://github.com/matthewwithanm/python-markdownify),
which uses BeautifulSoup to create a flexible converter.
The subclass in this module, HindawiConve... | [
"re.compile",
"os.sys.path.append",
"os.path.dirname",
"doctest.testmod",
"os.path.abspath",
"re.sub",
"re.findall"
] | [((5964, 5992), 'os.sys.path.append', 'sys.path.append', (['root_folder'], {}), '(root_folder)\n', (5979, 5992), False, 'from os import sys, path\n'), ((16983, 17000), 'doctest.testmod', 'doctest.testmod', ([], {}), '()\n', (16998, 17000), False, 'import doctest\n'), ((5933, 5958), 'os.path.dirname', 'path.dirname', ([... |
import os
import logging
from argparse import ArgumentParser
from concurrent.futures import ThreadPoolExecutor, as_completed
from .lib.saj import StreamAnalyticsJobs
from .lib.utils import chkpath, mklog
def get_args():
parser = ArgumentParser(description="Start or stop Stream Analytics Jobs")
parser.add_arg... | [
"concurrent.futures.as_completed",
"os.path.expanduser",
"logging.error",
"argparse.ArgumentParser"
] | [((236, 301), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'description': '"""Start or stop Stream Analytics Jobs"""'}), "(description='Start or stop Stream Analytics Jobs')\n", (250, 301), False, 'from argparse import ArgumentParser\n'), ((1545, 1569), 'concurrent.futures.as_completed', 'as_completed', (['future... |
import random
from sklearn.metrics import r2_score
from sklearn.neighbors import KNeighborsRegressor
from helpers.data_manipulation import filter_database
class Chromossome:
def __init__(self, genes: str, X_train, X_test, y_train, y_test):
self.genes = genes
self.fit = self.fitness(
fi... | [
"sklearn.neighbors.KNeighborsRegressor",
"random.random",
"helpers.data_manipulation.filter_database"
] | [((1237, 1273), 'helpers.data_manipulation.filter_database', 'filter_database', (['X_train', 'self.genes'], {}), '(X_train, self.genes)\n', (1252, 1273), False, 'from helpers.data_manipulation import filter_database\n'), ((1291, 1326), 'helpers.data_manipulation.filter_database', 'filter_database', (['X_test', 'self.ge... |
# Third-party
import astropy.units as u
import numpy as np
from scipy.signal import argrelmin
# Project
from . import PhaseSpacePosition, Orbit
__all__ = ['fast_lyapunov_max', 'lyapunov_max', 'surface_of_section']
def fast_lyapunov_max(w0, hamiltonian, dt, n_steps, d0=1e-5,
n_steps_per_pullbac... | [
"numpy.hstack",
"numpy.log",
"numpy.asarray",
"numpy.rollaxis",
"numpy.linalg.norm",
"numpy.zeros",
"scipy.signal.argrelmin",
"numpy.random.uniform",
"numpy.zeros_like"
] | [((5368, 5414), 'numpy.random.uniform', 'np.random.uniform', ([], {'size': '(ndim, noffset_orbits)'}), '(size=(ndim, noffset_orbits))\n', (5385, 5414), True, 'import numpy as np\n'), ((5531, 5557), 'numpy.hstack', 'np.hstack', (['(_w0, w_offset)'], {}), '((_w0, w_offset))\n', (5540, 5557), True, 'import numpy as np\n')... |
from __future__ import division, print_function
import os, types
import numpy as np
import vtk
from vtk.util.numpy_support import numpy_to_vtk
from vtk.util.numpy_support import vtk_to_numpy
import vtkplotter.colors as colors
##############################################################################
vtkMV = vtk.v... | [
"vtk.vtkSelectEnclosedPoints",
"vtk.vtkBoxWidget",
"numpy.ascontiguousarray",
"numpy.sin",
"vtk.vtkButterflySubdivisionFilter",
"numpy.arange",
"vtkplotter.colors.getColor",
"vtk.vtkShrinkPolyData",
"vtk.vtkCleanPolyData",
"vtk.vtkTextureMapToPlane",
"vtk.vtkCellCenters",
"vtkplotter.colors.ge... | [((979, 1007), 'numpy.arange', 'np.arange', (['start', 'stop', 'step'], {}), '(start, stop, step)\n', (988, 1007), True, 'import numpy as np\n'), ((1141, 1178), 'numpy.array', 'np.array', (['[x, y, z]'], {'dtype': 'np.float64'}), '([x, y, z], dtype=np.float64)\n', (1149, 1178), True, 'import numpy as np\n'), ((1351, 13... |
# import csv
# import PyPDF2
# import nltk
# from tika import parser
# from spacy.en import English
#
# #nltk.download('punkt')
# #nltk.download('averaged_perceptron_tagger')
# #from nltk.corpus import brown
# #nltk.download('brown')
#
# raw = parser.from_file('C://Users//bvjan//Documents//data.pdf')
# my =... | [
"re.compile"
] | [((434, 453), 're.compile', 're.compile', (['""".*cat"""'], {}), "('.*cat')\n", (444, 453), False, 'import re\n')] |
'''
pass_conv2d_tuple02.py
Copyright (c) Seoul National University
Licensed under the MIT license.
Author: <NAME>
Tuple parameters in nn.Conv2d.
'''
import torch
import torch.nn as nn
import torch.nn.functional as F
a = torch.rand(10, 32, 28, 28)
conv = nn.Conv2d(32, 64, (3, 5), (2, 2))
b = conv(a)
# shape asserti... | [
"torch.rand",
"torch.nn.Conv2d"
] | [((223, 249), 'torch.rand', 'torch.rand', (['(10)', '(32)', '(28)', '(28)'], {}), '(10, 32, 28, 28)\n', (233, 249), False, 'import torch\n'), ((257, 290), 'torch.nn.Conv2d', 'nn.Conv2d', (['(32)', '(64)', '(3, 5)', '(2, 2)'], {}), '(32, 64, (3, 5), (2, 2))\n', (266, 290), True, 'import torch.nn as nn\n'), ((327, 353), ... |
"""Test pydeCONZ config.
pytest --cov-report term-missing --cov=pydeconz.config tests/test_config.py
"""
from pydeconz.config import DeconzConfig
async def test_create_config():
"""Verify that creating a config works."""
config = DeconzConfig(FIXTURE_CONFIG)
assert config.apiversion == "1.0.4"
asse... | [
"pydeconz.config.DeconzConfig"
] | [((242, 270), 'pydeconz.config.DeconzConfig', 'DeconzConfig', (['FIXTURE_CONFIG'], {}), '(FIXTURE_CONFIG)\n', (254, 270), False, 'from pydeconz.config import DeconzConfig\n')] |
from itertools import count
def time_stable(r, x=0.01):
stable = 1 - 1 / r
for t in count():
if abs(x - stable) < 0.01:
return t
elif t >= 10000000:
return 'Не стабилизируется'
x *= r * (1 - x)
if __name__ == '__main__':
n = int(input())
for r in (n, 3... | [
"itertools.count"
] | [((94, 101), 'itertools.count', 'count', ([], {}), '()\n', (99, 101), False, 'from itertools import count\n')] |
from re import search
import botocore.exceptions
from functools import lru_cache
from workdocs_dr.aws_clients import AwsClients
from workdocs_dr.document import DocumentHelper
class WdFilter:
def __init__(self, userquery=None, foldernames=[], folderpattern=None) -> None:
self.userquery = userquery
... | [
"functools.lru_cache",
"workdocs_dr.document.DocumentHelper.folder_metadata_s32dict",
"re.search"
] | [((9381, 9404), 'functools.lru_cache', 'lru_cache', ([], {'maxsize': '(1024)'}), '(maxsize=1024)\n', (9390, 9404), False, 'from functools import lru_cache\n'), ((9777, 9800), 'functools.lru_cache', 'lru_cache', ([], {'maxsize': '(1024)'}), '(maxsize=1024)\n', (9786, 9800), False, 'from functools import lru_cache\n'), (... |
from bs4 import BeautifulSoup
import requests
import pandas as pd
import numpy as np
import csv
import tmdbsimple as tmdb
import time
import numpy as np
import datetime
import copy
from unidecode import unidecode
import calendar
from ast import literal_eval
from sklearn.feature_extraction.text import TfidfVectorizer,... | [
"pandas.Series",
"hybrid.get_svd",
"csv.DictWriter",
"sklearn.metrics.pairwise.cosine_similarity",
"pandas.read_csv",
"sklearn.feature_extraction.text.CountVectorizer",
"time.sleep",
"requests.get",
"bs4.BeautifulSoup",
"nltk.stem.snowball.SnowballStemmer",
"tmdbsimple.Search",
"datetime.datet... | [((860, 873), 'tmdbsimple.Search', 'tmdb.Search', ([], {}), '()\n', (871, 873), True, 'import tmdbsimple as tmdb\n'), ((4518, 4557), 'pandas.read_csv', 'pd.read_csv', (["(path_dest + 'metadata.csv')"], {}), "(path_dest + 'metadata.csv')\n", (4529, 4557), True, 'import pandas as pd\n'), ((4570, 4606), 'pandas.read_csv',... |
import logging
import os
from pathlib import Path
from uvicorn.supervisors.basereload import BaseReload
logger = logging.getLogger("uvicorn.error")
class StatReload(BaseReload):
def __init__(self, config, target, sockets):
super().__init__(config, target, sockets)
self.reloader_name = "statreloa... | [
"logging.getLogger",
"pathlib.Path",
"pathlib.Path.cwd",
"os.path.normpath",
"os.path.getmtime",
"os.walk",
"os.path.relpath"
] | [((115, 149), 'logging.getLogger', 'logging.getLogger', (['"""uvicorn.error"""'], {}), "('uvicorn.error')\n", (132, 149), False, 'import logging\n'), ((1253, 1272), 'os.walk', 'os.walk', (['reload_dir'], {}), '(reload_dir)\n', (1260, 1272), False, 'import os\n'), ((466, 492), 'os.path.getmtime', 'os.path.getmtime', (['... |
# python3 pdf_to_para_wfm.py --input "/Users/TIMAC044/Downloads/SUVAS_FILES_UNICODE/1/cfa100_2004_pc_en.docx" --output "/Users/TIMAC044/Downloads/SUVAS_FILES_UNICODE/1/cfa100_2004_pc_en.docx.txt" --locale "en"
# -*- coding: utf-8 -*-
######################################################
# PROJECT : PDF Sentence Tok... | [
"requests.request",
"time.sleep",
"argparse.ArgumentParser",
"sys.exit"
] | [((898, 938), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': 'msg'}), '(description=msg)\n', (921, 938), False, 'import argparse\n'), ((3026, 3111), 'requests.request', 'requests.request', (['"""POST"""', 'upload_url'], {'headers': 'headers', 'data': 'payload', 'files': 'files'}), "('POST', ... |
import io
import os
import pickle
import tarfile
from functools import lru_cache
from typing import Dict, Tuple
import arrayfiles
import gdown
from lineflow import download
from lineflow.core import ZipDataset
def get_cnn_dailymail() -> Dict[str, Tuple[arrayfiles.TextFile]]:
url = 'https://s3.amazonaws.com/ope... | [
"tarfile.open",
"pickle.dump",
"os.path.join",
"pickle.load",
"io.open",
"lineflow.download.cache_or_load_file",
"functools.lru_cache",
"gdown.cached_download"
] | [((1331, 1362), 'os.path.join', 'os.path.join', (['root', '"""cnndm.pkl"""'], {}), "(root, 'cnndm.pkl')\n", (1343, 1362), False, 'import os\n'), ((1374, 1428), 'lineflow.download.cache_or_load_file', 'download.cache_or_load_file', (['pkl_path', 'creator', 'loader'], {}), '(pkl_path, creator, loader)\n', (1401, 1428), F... |
import time
input("엔터를 누르고 마음속으로 20초를 세세요.")
start=time.time()
input("20초를 다 세셨으면, 다시 엔터를 눌러주세요.")
end=time.time()
et=end-start
print ('실제시간 :',et,'초')
print ('차이 :',abs(et-20),'초')
| [
"time.time"
] | [((53, 64), 'time.time', 'time.time', ([], {}), '()\n', (62, 64), False, 'import time\n'), ((107, 118), 'time.time', 'time.time', ([], {}), '()\n', (116, 118), False, 'import time\n')] |
import pytest
from os import path
@pytest.fixture
def dir_fixtures(request):
return path.join(path.dirname(path.abspath(request.module.__file__)), 'fixtures')
@pytest.fixture
def read_fixture(dir_fixtures):
from pycbrf.utils import BytesIO
def read_fixture_(name):
with open(path.join(dir_fixt... | [
"os.path.abspath",
"os.path.join",
"pycbrf.utils.BytesIO"
] | [((389, 402), 'pycbrf.utils.BytesIO', 'BytesIO', (['data'], {}), '(data)\n', (396, 402), False, 'from pycbrf.utils import BytesIO\n'), ((113, 150), 'os.path.abspath', 'path.abspath', (['request.module.__file__'], {}), '(request.module.__file__)\n', (125, 150), False, 'from os import path\n'), ((302, 331), 'os.path.join... |
# Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import subprocess
import tarfile
from datetime import datetime
from shutil import copyfile, copytree, rmtree
major_version = 0
minor_version = 3
class Automation:
@staticmethod
def parse_bom(bom_path):
files ... | [
"subprocess.check_output",
"os.path.exists",
"tarfile.open",
"os.makedirs",
"os.path.join",
"shutil.copytree",
"os.path.dirname",
"shutil.copyfile",
"os.path.isdir",
"datetime.datetime.now",
"os.path.basename",
"shutil.rmtree",
"os.remove"
] | [((566, 592), 'os.path.exists', 'os.path.exists', (['target_dir'], {}), '(target_dir)\n', (580, 592), False, 'import os\n'), ((633, 656), 'os.makedirs', 'os.makedirs', (['target_dir'], {}), '(target_dir)\n', (644, 656), False, 'import os\n'), ((1941, 1969), 'os.path.exists', 'os.path.exists', (['archive_path'], {}), '(... |
"""
Render static website based on the load data.
"""
import os
import time
import jinja2
import pandas as pd
if __name__ == '__main__':
PATH = os.path.dirname(os.path.abspath(__file__))
PATH_OUTPUT = 'output'
PATH_DATA = 'load_data.csv'
if not os.path.exists(PATH_OUTPUT):
os.makedirs(PAT... | [
"os.path.exists",
"pandas.read_csv",
"os.makedirs",
"os.path.join",
"os.path.abspath",
"os.path.getmtime"
] | [((347, 369), 'pandas.read_csv', 'pd.read_csv', (['PATH_DATA'], {}), '(PATH_DATA)\n', (358, 369), True, 'import pandas as pd\n'), ((170, 195), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (185, 195), False, 'import os\n'), ((268, 295), 'os.path.exists', 'os.path.exists', (['PATH_OUTPUT'], {... |
from bs4 import BeautifulSoup as bs
import requests
import pandas as pd
# OSCARS BEST PICTURES WINNERS
w_url = "https://www.imdb.com/list/ls009480135/"
w_request = requests.get(w_url)
w_page = bs(w_request.content, 'html.parser')
w_title_divs = w_page.find_all(class_='lister-item-header')
w_age_divs = w_page.find_all... | [
"bs4.BeautifulSoup",
"requests.get"
] | [((165, 184), 'requests.get', 'requests.get', (['w_url'], {}), '(w_url)\n', (177, 184), False, 'import requests\n'), ((194, 230), 'bs4.BeautifulSoup', 'bs', (['w_request.content', '"""html.parser"""'], {}), "(w_request.content, 'html.parser')\n", (196, 230), True, 'from bs4 import BeautifulSoup as bs\n'), ((630, 649), ... |
from django.http import HttpResponse
from channels.handler import AsgiHandler
import pulse.model as model
import json
#routed via ^/echo$
def ws_message(message):
# ASGI WebSocket packet-received and send-packet message types
# both have a "text" key for their textual data.
# message.content = {'text': 'hello world... | [
"json.loads",
"pulse.model.parse_RGB"
] | [((412, 447), 'json.loads', 'json.loads', (["message.content['text']"], {}), "(message.content['text'])\n", (422, 447), False, 'import json\n'), ((556, 584), 'pulse.model.parse_RGB', 'model.parse_RGB', (['msg_content'], {}), '(msg_content)\n', (571, 584), True, 'import pulse.model as model\n')] |
from typing import List, TypeVar
from future.moves import itertools
_S = TypeVar('_S')
def flatten(l: List[List[_S]]) -> List[_S]:
return list(itertools.chain.from_iterable([(i if isinstance(i, list) else [i]) for i in l]))
| [
"typing.TypeVar"
] | [((74, 87), 'typing.TypeVar', 'TypeVar', (['"""_S"""'], {}), "('_S')\n", (81, 87), False, 'from typing import List, TypeVar\n')] |
import concat.level0.execute
import unittest
import ast
class TestExecute(unittest.TestCase):
def setUp(self) -> None:
pass
def test_execute_function(self) -> None:
module = ast.Module(body=[])
concat.level0.execute.execute('<test>', module, {})
# we passed if we get here
| [
"ast.Module"
] | [((202, 221), 'ast.Module', 'ast.Module', ([], {'body': '[]'}), '(body=[])\n', (212, 221), False, 'import ast\n')] |
#!/usr/bin/env python3
"""
Author : <NAME> <<EMAIL>>
Date : 2021-10-04
Purpose: Rock the Casbah
"""
import argparse
import sys
# --------------------------------------------------
def get_args():
"""Get command-line arguments"""
parser = argparse.ArgumentParser(
description='Emulate wc (word cound... | [
"argparse.FileType",
"argparse.ArgumentParser"
] | [((252, 374), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Emulate wc (word cound)"""', 'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter'}), "(description='Emulate wc (word cound)',\n formatter_class=argparse.ArgumentDefaultsHelpFormatter)\n", (275, 374), False, 'import ar... |
import random
from random import randint
import networkx as nx
import math
import matplotlib.pyplot as plt
import Evaluation as eval
#This is local search heuristic Simulated Annealing.
def anneal_DS(old_solution, allocated_network_topology):
#This is algortihm 9 - Optimize DDS placement
#print('----------SA-----... | [
"random.choice",
"random.shuffle",
"networkx.shortest_path_length",
"Evaluation.eval_topology_DS",
"random.random",
"Evaluation.eval_annealing_DS",
"math.exp"
] | [((1504, 1529), 'Evaluation.eval_annealing_DS', 'eval.eval_annealing_DS', (['T'], {}), '(T)\n', (1526, 1529), True, 'import Evaluation as eval\n'), ((2737, 2764), 'random.choice', 'random.choice', (['new_solution'], {}), '(new_solution)\n', (2750, 2764), False, 'import random\n'), ((3036, 3068), 'random.shuffle', 'rand... |
from flask import Flask, request, jsonify
from flask_cors import CORS, cross_origin
# declare constants
HOST = '0.0.0.0'
PORT = 5000
# initialize flask application
app = Flask(__name__)
app.config['CORS_SUPPORTS_CREDENTIALS'] = True
app.config['CORS_ORIGINS'] = '*'
app.config['CORS_HEADERS'] = 'Content-Type'
CORS(app... | [
"flask_cors.CORS",
"flask.Flask",
"flask_cors.cross_origin",
"flask.request.get_json",
"flask.jsonify"
] | [((172, 187), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (177, 187), False, 'from flask import Flask, request, jsonify\n'), ((312, 321), 'flask_cors.CORS', 'CORS', (['app'], {}), '(app)\n', (316, 321), False, 'from flask_cors import CORS, cross_origin\n'), ((366, 380), 'flask_cors.cross_origin', 'cross... |
#! /usr/bin/env python
#
# example1_tk.py -- Simple, configurable FITS viewer.
#
# <NAME> (<EMAIL>)
#
# Copyright (c) <NAME>. All rights reserved.
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import sys, os
import logging
import Tkinter
from tkFileDialog... | [
"logging.getLogger",
"logging.StreamHandler",
"logging.Formatter",
"Tkinter.Tk",
"Tkinter.Button",
"Tkinter.Canvas",
"ginga.tkw.ImageViewTk.ImageViewZoom",
"tkFileDialog.askopenfilename",
"Tkinter.Frame",
"ginga.AstroImage.AstroImage"
] | [((2496, 2525), 'logging.getLogger', 'logging.getLogger', (['"""example1"""'], {}), "('example1')\n", (2513, 2525), False, 'import logging\n'), ((2570, 2599), 'logging.Formatter', 'logging.Formatter', (['STD_FORMAT'], {}), '(STD_FORMAT)\n', (2587, 2599), False, 'import logging\n'), ((2617, 2640), 'logging.StreamHandler... |
from flask_login import UserMixin
from project import login_manager, db
@login_manager.user_loader
def load_user(user_id):
return User.query.get(int(user_id))
class User(db.Model,UserMixin):
__tablename__ = 'user'
id = db.Column(db.Integer, primary_key = True)
email = db.Column(db.String(30),unique=True,nullable ... | [
"project.db.relationship",
"project.db.String",
"project.db.ForeignKey",
"project.db.Column"
] | [((224, 263), 'project.db.Column', 'db.Column', (['db.Integer'], {'primary_key': '(True)'}), '(db.Integer, primary_key=True)\n', (233, 263), False, 'from project import login_manager, db\n'), ((538, 594), 'project.db.relationship', 'db.relationship', (['"""Posts"""'], {'backref': '"""user"""', 'lazy': '"""dynamic"""'})... |
from unittest import TestCase
from unittest.mock import Mock
from netCDF4 import Dataset, Group
import podaac.merger.path_utils as path_utils
class PathUtilsTest(TestCase):
def test_group_path(self):
mock_1 = Mock(
spec=Group,
path='/'
)
mock_2 = Mock(
... | [
"unittest.mock.Mock",
"podaac.merger.path_utils.get_group_path",
"netCDF4.Dataset",
"podaac.merger.path_utils.resolve_group",
"podaac.merger.path_utils.resolve_dim"
] | [((224, 250), 'unittest.mock.Mock', 'Mock', ([], {'spec': 'Group', 'path': '"""/"""'}), "(spec=Group, path='/')\n", (228, 250), False, 'from unittest.mock import Mock\n'), ((303, 334), 'unittest.mock.Mock', 'Mock', ([], {'spec': 'Group', 'path': '"""/group"""'}), "(spec=Group, path='/group')\n", (307, 334), False, 'fro... |
import cmdprod as cp
def main():
pk = cp.Param('k', ['gauss', 'imq'])
pkparams = cp.Param('kparams', [1, 2, 3.2])
formatter = cp.IAFArgparse(pv_sep=' ')
args = cp.Args([pk, pkparams])
for ar in args:
print(formatter(ar))
if __name__ == '__main__':
main()
| [
"cmdprod.IAFArgparse",
"cmdprod.Args",
"cmdprod.Param"
] | [((43, 74), 'cmdprod.Param', 'cp.Param', (['"""k"""', "['gauss', 'imq']"], {}), "('k', ['gauss', 'imq'])\n", (51, 74), True, 'import cmdprod as cp\n'), ((90, 122), 'cmdprod.Param', 'cp.Param', (['"""kparams"""', '[1, 2, 3.2]'], {}), "('kparams', [1, 2, 3.2])\n", (98, 122), True, 'import cmdprod as cp\n'), ((140, 166), ... |
import komand
import time
import json
import certstream
import re
import Levenshtein
from komand_typo_squatter.util import utils
from .schema import SearchCertstreamInput, SearchCertstreamOutput
class SearchCertstream(komand.Trigger):
def __init__(self):
super(self.__class__, self).__init__(
n... | [
"certstream.listen_for_events",
"re.search"
] | [((1642, 1685), 'certstream.listen_for_events', 'certstream.listen_for_events', (['self.callback'], {}), '(self.callback)\n', (1670, 1685), False, 'import certstream\n'), ((1160, 1189), 're.search', 're.search', (['self.query', 'domain'], {}), '(self.query, domain)\n', (1169, 1189), False, 'import re\n')] |
from time import sleep
from stoppable_thread import StoppableThread, get_stop_flag
from privacy_resource_client import PrivacyResourceClient
class Snapshot:
def __init__(self, client: PrivacyResourceClient):
self.client = client
pass
def get_all_data_blocks(self, namespace):
return s... | [
"stoppable_thread.StoppableThread",
"privacy_resource_client.PrivacyResourceClient",
"stoppable_thread.get_stop_flag",
"time.sleep"
] | [((1470, 1479), 'time.sleep', 'sleep', (['(15)'], {}), '(15)\n', (1475, 1479), False, 'from time import sleep\n'), ((656, 671), 'stoppable_thread.get_stop_flag', 'get_stop_flag', ([], {}), '()\n', (669, 671), False, 'from stoppable_thread import StoppableThread, get_stop_flag\n'), ((998, 1090), 'stoppable_thread.Stoppa... |
import os
# toolchains options
ARCH='arm'
CPU='cortex-m4'
CROSS_TOOL='gcc'
# bsp lib config
BSP_LIBRARY_TYPE = None
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
if os.getenv('RTT_ROOT'):
RTT_ROOT = os.getenv('RTT_ROOT')
RTT_ROOT = os.path.normpath(os.getcwd() + '../../rt-thread')
# cross_tool p... | [
"os.getenv",
"os.getcwd"
] | [((122, 141), 'os.getenv', 'os.getenv', (['"""RTT_CC"""'], {}), "('RTT_CC')\n", (131, 141), False, 'import os\n'), ((183, 204), 'os.getenv', 'os.getenv', (['"""RTT_ROOT"""'], {}), "('RTT_ROOT')\n", (192, 204), False, 'import os\n'), ((727, 753), 'os.getenv', 'os.getenv', (['"""RTT_EXEC_PATH"""'], {}), "('RTT_EXEC_PATH'... |
from django.shortcuts import render
# Create your views here.
def home(request):
name = 'Prabind'
cname = 'Java'
price = 52
course_details = {'nm':name,'cn':cname, 'pr':price}
return render(request,'coursename/home.html',course_details)
def define(request):
emp_name = 'hari'
branch ... | [
"django.shortcuts.render"
] | [((210, 265), 'django.shortcuts.render', 'render', (['request', '"""coursename/home.html"""', 'course_details'], {}), "(request, 'coursename/home.html', course_details)\n", (216, 265), False, 'from django.shortcuts import render\n'), ((419, 463), 'django.shortcuts.render', 'render', (['request', '"""Employee/define.htm... |
"""
Exports various resources as data maps.
"""
import csv
from datetime import datetime
from typing import Dict, List, Tuple, Set
from fidesctl.core.api_helpers import get_server_resources
from fidesctl.core.utils import echo_green, get_all_level_fields
def export_to_csv(
list_to_export: List, resource_exporte... | [
"fidesctl.core.utils.get_all_level_fields",
"datetime.datetime.utcnow",
"csv.writer",
"fidesctl.core.utils.echo_green",
"fidesctl.core.api_helpers.get_server_resources"
] | [((3950, 4014), 'fidesctl.core.api_helpers.get_server_resources', 'get_server_resources', (['url', 'resource_type', 'existing_keys', 'headers'], {}), '(url, resource_type, existing_keys, headers)\n', (3970, 4014), False, 'from fidesctl.core.api_helpers import get_server_resources\n'), ((6564, 6628), 'fidesctl.core.api_... |
import zmq
host = '127.0.0.1'
port = 6789
context = zmq.Context()
client = context.socket(zmq.REQ)
client.connect("tcp://%s:%s" % (host, port))
for num in range(1,10):
request_str = "message #%s " % num
request_bytes = request_str.encode('utf-8')
client.send(request_bytes)
reply_bytes = client.recv()
... | [
"zmq.Context"
] | [((52, 65), 'zmq.Context', 'zmq.Context', ([], {}), '()\n', (63, 65), False, 'import zmq\n')] |
#!/usr/bin/env python3
"""Locale manage.
This file get locale information forn the file locale-list.
"""
from re import compile
class Locale:
"""Locale class."""
locales = {}
language = []
types_keyboard = {}
lang_keyboard = []
timezones = []
def get_locale(self):
"""Get loc... | [
"re.compile"
] | [((381, 405), 're.compile', 'compile', (['"""(\\\\w+_\\\\w{2})"""'], {}), "('(\\\\w+_\\\\w{2})')\n", (388, 405), False, 'from re import compile\n')] |
import json
from django.http import JsonResponse
from django.views import View
from telegrambot.handlers.dispatcher import dispatch_telegram_update
from telegrambot.models import TelegramBot
class TelegramBotWebhookView(View):
@staticmethod
def post(request, *args, **kwargs):
token = request.GET.get... | [
"json.loads",
"telegrambot.models.TelegramBot.objects.get",
"django.http.JsonResponse"
] | [((743, 769), 'django.http.JsonResponse', 'JsonResponse', (["{'ok': True}"], {}), "({'ok': True})\n", (755, 769), False, 'from django.http import JsonResponse\n'), ((843, 913), 'django.http.JsonResponse', 'JsonResponse', (["{'ok': False, 'error': 'Method not allowed'}"], {'status': '(405)'}), "({'ok': False, 'error': '... |
from sqlalchemy.orm import Session
from fastapi import APIRouter
from fastapi import Depends
from fastapi import status
from fastapi import Response
from fastapi import Security
from fastapi_okta import OktaUser
from literature import database
from literature.user import set_global_user_id
from literature.schemas ... | [
"fastapi.Security",
"literature.crud.reference_manual_term_tag_crud.create",
"fastapi.Response",
"literature.crud.reference_manual_term_tag_crud.show",
"literature.user.set_global_user_id",
"literature.crud.reference_manual_term_tag_crud.destroy",
"literature.crud.reference_manual_term_tag_crud.show_cha... | [((664, 751), 'fastapi.APIRouter', 'APIRouter', ([], {'prefix': '"""/reference_manual_term_tag"""', 'tags': "['Reference Manual Term Tag']"}), "(prefix='/reference_manual_term_tag', tags=[\n 'Reference Manual Term Tag'])\n", (673, 751), False, 'from fastapi import APIRouter\n'), ((969, 992), 'fastapi.Security', 'Sec... |
# class Chain(object):
#
# def __init__(self, path=''):
# self._path = path
#
# def __getattr__(self, path):
# return Chain('%s/%s' % (self._path, path))
#
# def __str__(self):
# return self._path
#
# __repr__ = __str__
#
# print(Chain().status.user.timeline.list)
#
# from enum i... | [
"datetime.datetime.now"
] | [((853, 867), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (865, 867), False, 'from datetime import datetime\n')] |
import os
import util
# EPSG 4269
url = "https://prd-tnm.s3.amazonaws.com/StagedProducts/Hydrography/NHDPlusHR/Beta/GDB/NHDPLUS_H_2001_HU4_GDB.zip" # noqa: E501
dir_name = "NHDPLUS_H_2001_HU4_GDB"
gdb_name = "NHDPLUS_H_2001_HU4_GDB.gdb"
util.process_nhdplus_hr_source(
os.path.realpath(__file__),
url,
dir_name,... | [
"os.path.realpath"
] | [((274, 300), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (290, 300), False, 'import os\n')] |
# -*- coding: utf-8 -*-}
import json
import logging
import urllib
import jwt
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
from thorn.app_auth import requires_auth, requires_permission
from flask import request, current_app, Response
from flask_restfu... | [
"logging.getLogger",
"jwt.decode",
"json.loads",
"thorn.util.ldap_authentication",
"json.dumps",
"thorn.util.encrypt_password",
"flask.request.form.get",
"thorn.models.User.query.filter",
"urllib.parse.parse_qs",
"cryptography.hazmat.backends.default_backend",
"thorn.models.db.session.add",
"t... | [((561, 588), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (578, 588), False, 'import logging\n'), ((720, 771), 'jwt.encode', 'jwt.encode', (["{'id': user.id}", 'current_app.secret_key'], {}), "({'id': user.id}, current_app.secret_key)\n", (730, 771), False, 'import jwt\n'), ((2525, 254... |
import scipy.stats as st
import numpy as np
def getchannel(emplacement = 'trunku',intersection = 1):
""" get channel
Parameters
----------
emplacement : 'trunku' | 'thighr' | 'forearm' | 'calfr'
intersection : 1 = LOS 0 : NLOS
Returns
-------
alphak : np.array
tauk : np.array... | [
"numpy.sqrt",
"scipy.stats.norm",
"numpy.exp",
"scipy.stats.expon",
"numpy.cumsum"
] | [((1997, 2016), 'scipy.stats.expon', 'st.expon', (['(0)', 'Lambda'], {}), '(0, Lambda)\n', (2005, 2016), True, 'import scipy.stats as st\n'), ((2052, 2071), 'numpy.cumsum', 'np.cumsum', (['sampleTk'], {}), '(sampleTk)\n', (2061, 2071), True, 'import numpy as np\n'), ((2367, 2396), 'scipy.stats.norm', 'st.norm', (['alph... |
# -*- encoding: utf-8 -*-
"""
License: MIT
Copyright (c) 2019 - present AppSeed.us
"""
import os
import dateutil.parser
import math, json, re, itertools
import collections
from datetime import datetime, date, timedelta
from multiprocessing.pool import ThreadPool as threadpool
import random
import time
import numpy as ... | [
"flask.render_template",
"app.db.session.commit",
"flask.request.args.get",
"app.main.patients.models.Patient",
"flask_babelex._",
"app.main.flights_trains.models.FlightTravel",
"app.main.models.AddressLocationType.query.all",
"app.main.models.Address",
"app.main.patients.forms.PatientsSearchForm",
... | [((18253, 18308), 'app.main.blueprint.route', 'blueprint.route', (['"""/add_person"""'], {'methods': "['GET', 'POST']"}), "('/add_person', methods=['GET', 'POST'])\n", (18268, 18308), False, 'from app.main import blueprint\n'), ((20511, 20571), 'app.main.blueprint.route', 'blueprint.route', (['"""/patient_profile"""'],... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is subject to the terms and conditions defined in
# file 'LICENSE.md', which is part of this source code package.
#
from kubernetes.models.v1.NodeSelectorTerm import NodeSelectorTerm
from kubernetes.utils import is_valid_list
class NodeSelector(object):
... | [
"kubernetes.utils.is_valid_list",
"kubernetes.models.v1.NodeSelectorTerm.NodeSelectorTerm"
] | [((1176, 1210), 'kubernetes.utils.is_valid_list', 'is_valid_list', (['t', 'NodeSelectorTerm'], {}), '(t, NodeSelectorTerm)\n', (1189, 1210), False, 'from kubernetes.utils import is_valid_list\n'), ((783, 802), 'kubernetes.models.v1.NodeSelectorTerm.NodeSelectorTerm', 'NodeSelectorTerm', (['t'], {}), '(t)\n', (799, 802)... |
# -*- coding: utf-8 -*-
"""
Module for sending data to OpsGenie
.. versionadded:: 2017.7.2
:configuration: This module can be used in Reactor System for
posting data to OpsGenie as a remote-execution function.
For example:
.. code-block:: yaml
opsgenie_event_poster:
local.opsgenie.post_... | [
"logging.getLogger",
"json.dumps"
] | [((778, 805), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (795, 805), False, 'import logging\n'), ((1938, 1954), 'json.dumps', 'json.dumps', (['data'], {}), '(data)\n', (1948, 1954), False, 'import json\n')] |
"""
Package rawspec_testing
Common definitions and functions.
"""
import os
import sys
from time import strftime, localtime, time
MY_VERSION = "1.2"
TS_SNR_THRESHOLD = 10 # for turbo_seti
FMT_LOGGER_TIMESTAMP = "%H:%M:%S "
PANDAS_SEPARATOR = "\s+"
PANDAS_ENGINE = "python"
# Tolerance of the Relative TO Largest (R... | [
"os.path.getsize",
"os.path.dirname",
"sys.exit",
"os.system",
"time.localtime",
"time.time"
] | [((728, 740), 'sys.exit', 'sys.exit', (['(86)'], {}), '(86)\n', (736, 740), False, 'import sys\n'), ((1115, 1140), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (1130, 1140), False, 'import os\n'), ((1325, 1331), 'time.time', 'time', ([], {}), '()\n', (1329, 1331), False, 'from time import s... |
#!/usr/bin/env python3
import os
import re
home = '/home/michael'
books_dir = home + '/books'
def extract_title(title_and_id):
pattern = r"(?P<name>[^\(]+) \((?P<id>\d+)\)"
m = re.compile(pattern).match(title_and_id)
return m.group('name'), m.group('id')
if __name__ == '__main__':
current = os.getcw... | [
"os.system",
"re.compile",
"os.path.basename",
"os.getcwd"
] | [((312, 323), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (321, 323), False, 'import os\n'), ((335, 360), 'os.path.basename', 'os.path.basename', (['current'], {}), '(current)\n', (351, 360), False, 'import os\n'), ((566, 584), 'os.system', 'os.system', (['command'], {}), '(command)\n', (575, 584), False, 'import os\n'... |
import os
import subprocess
import sys
from unittest import TestCase
class TestImportCycles(TestCase):
"""
Ensures that every module can be imported in isolation. Sometimes due to import cycles or
delayed imports, a module import will succeed if it comes after a dependency has already been
imported, b... | [
"os.listdir",
"os.path.join",
"os.path.dirname",
"os.path.isdir",
"subprocess.call",
"os.walk"
] | [((1136, 1174), 'os.walk', 'os.walk', (['(base_path + self.package_name)'], {}), '(base_path + self.package_name)\n', (1143, 1174), False, 'import os\n'), ((895, 921), 'os.path.dirname', 'os.path.dirname', (['base_path'], {}), '(base_path)\n', (910, 921), False, 'import os\n'), ((999, 1020), 'os.listdir', 'os.listdir',... |
# -*- coding: utf-8 -*-
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils import cint, cstr, date_diff, flt, forma... | [
"frappe.db.get_value",
"frappe.utils.formatdate",
"frappe.throw",
"frappe.whitelist",
"frappe._",
"frappe.desk.reportview.get_filters_cond",
"frappe.db.sql",
"frappe.utils.cstr"
] | [((1297, 1315), 'frappe.whitelist', 'frappe.whitelist', ([], {}), '()\n', (1313, 1315), False, 'import frappe\n'), ((1384, 1488), 'frappe.db.get_value', 'frappe.db.get_value', (['"""Employee"""', "{'user_id': frappe.session.user}", "['name', 'company']"], {'as_dict': '(True)'}), "('Employee', {'user_id': frappe.session... |
import math
import cv2
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
def grayscale(img):
"""Applies the Grayscale transform
This will return an image with only one color channel
but NOTE: to see the returned image as grayscale
(assuming your grayscaled image is cal... | [
"numpy.polyfit",
"numpy.array",
"cv2.bitwise_or",
"matplotlib.pyplot.imshow",
"cv2.line",
"numpy.zeros_like",
"cv2.addWeighted",
"cv2.fillPoly",
"numpy.average",
"cv2.cvtColor",
"matplotlib.pyplot.title",
"cv2.Canny",
"cv2.GaussianBlur",
"matplotlib.pyplot.show",
"cv2.bitwise_and",
"nu... | [((396, 433), 'cv2.cvtColor', 'cv2.cvtColor', (['img', 'cv2.COLOR_RGB2GRAY'], {}), '(img, cv2.COLOR_RGB2GRAY)\n', (408, 433), False, 'import cv2\n'), ((644, 689), 'cv2.Canny', 'cv2.Canny', (['img', 'low_threshold', 'high_threshold'], {}), '(img, low_threshold, high_threshold)\n', (653, 689), False, 'import cv2\n'), ((7... |