code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from schmetterling.core.log import log_config, log_params_return
from schmetterling.log.state import LogState
@log_params_return('info')
def execute(state, log_dir, name, level):
log_handlers = log_config(log_dir, name, level)
return LogState(__name__, log_handlers['file_handler'].baseFilename)
| [
"schmetterling.core.log.log_params_return",
"schmetterling.log.state.LogState",
"schmetterling.core.log.log_config"
] | [((113, 138), 'schmetterling.core.log.log_params_return', 'log_params_return', (['"""info"""'], {}), "('info')\n", (130, 138), False, 'from schmetterling.core.log import log_config, log_params_return\n'), ((200, 232), 'schmetterling.core.log.log_config', 'log_config', (['log_dir', 'name', 'level'], {}), '(log_dir, name... |
import tensorflowjs as tfjs
import tensorflow as tf
model = tf.keras.models.load_model("model.h5")
tfjs.converters.save_keras_model(model, "tfjs")
| [
"tensorflowjs.converters.save_keras_model",
"tensorflow.keras.models.load_model"
] | [((61, 99), 'tensorflow.keras.models.load_model', 'tf.keras.models.load_model', (['"""model.h5"""'], {}), "('model.h5')\n", (87, 99), True, 'import tensorflow as tf\n'), ((100, 147), 'tensorflowjs.converters.save_keras_model', 'tfjs.converters.save_keras_model', (['model', '"""tfjs"""'], {}), "(model, 'tfjs')\n", (132,... |
import unittest
from src.api import Settings
class SettingsTestCase(unittest.TestCase):
"""Tests the Settings class."""
def setUp(self):
self.settings = Settings(800, 600, 60, "3D Engine", use_antialiasing=False)
def test_keyword_arguments(self):
"""Check that the keyword arguments are being parsed correctl... | [
"unittest.main",
"src.api.Settings"
] | [((616, 631), 'unittest.main', 'unittest.main', ([], {}), '()\n', (629, 631), False, 'import unittest\n'), ((161, 220), 'src.api.Settings', 'Settings', (['(800)', '(600)', '(60)', '"""3D Engine"""'], {'use_antialiasing': '(False)'}), "(800, 600, 60, '3D Engine', use_antialiasing=False)\n", (169, 220), False, 'from src.... |
# -*- coding: utf-8 -*-
import os
import sys
import numpy as np
IMAGE_SIZE = 64
#按照指定图像大小调整尺寸
def resize_image(image, height = IMAGE_SIZE, width = IMAGE_SIZE):
top, bottom, left, right = (0, 0, 0, 0)
#获取图像尺寸
h, w, _ = image.shape
#对于长宽不相等的图片,找到最长的一边
longest_edge = max(h, w)
#计算短边需要增加多上像素宽度使其与长边等长
if h < long... | [
"os.path.isdir",
"numpy.array",
"os.listdir",
"os.path.join"
] | [((798, 819), 'os.listdir', 'os.listdir', (['path_name'], {}), '(path_name)\n', (808, 819), False, 'import os\n'), ((1350, 1366), 'numpy.array', 'np.array', (['images'], {}), '(images)\n', (1358, 1366), True, 'import numpy as np\n'), ((891, 915), 'os.path.isdir', 'os.path.isdir', (['full_path'], {}), '(full_path)\n', (... |
"""
Regularizer class for that also supports GPU code
<NAME> <EMAIL>
<NAME> <EMAIL>
March 04, 2018
"""
import arrayfire as af
import numpy as np
from opticaltomography import settings
np_complex_datatype = settings.np_complex_datatype
np_float_datatype = settings.np_float_datatype
af_float_datatype = sett... | [
"arrayfire.to_array",
"arrayfire.abs",
"numpy.abs",
"arrayfire.sum",
"arrayfire.shift",
"arrayfire.imag",
"numpy.roll",
"numpy.zeros",
"numpy.prod",
"numpy.imag",
"numpy.array",
"numpy.real",
"numpy.sign",
"arrayfire.sign",
"arrayfire.real",
"arrayfire.constant"
] | [((8794, 8879), 'arrayfire.constant', 'af.constant', (['(0.0)', 'x.shape[0]', 'x.shape[1]', 'x.shape[2]', '(3)'], {'dtype': 'af_float_datatype'}), '(0.0, x.shape[0], x.shape[1], x.shape[2], 3, dtype=af_float_datatype\n )\n', (8805, 8879), True, 'import arrayfire as af\n'), ((8892, 8977), 'arrayfire.constant', 'af.co... |
import os, tempfile, subprocess
from string import Template
from PuzzleLib import Config
from PuzzleLib.Compiler.JIT import getCacheDir, computeHash, FileLock
from PuzzleLib.Cuda.SourceModule import SourceModule, ElementwiseKernel, ElementHalf2Kernel, ReductionKernel
from PuzzleLib.Cuda.SourceModule import eltwiseTes... | [
"PuzzleLib.Hip.Backend.getDeviceCount",
"tempfile.NamedTemporaryFile",
"os.remove",
"os.path.join",
"PuzzleLib.Cuda.SourceModule.eltwiseTest",
"PuzzleLib.Cuda.SourceModule.reductionTest",
"PuzzleLib.Compiler.JIT.FileLock",
"os.makedirs",
"subprocess.check_output",
"os.path.exists",
"PuzzleLib.Co... | [((3838, 4759), 'string.Template', 'Template', (['"""\n\n#undef READ_AND_MAP\n#undef REDUCE\n\n#define READ_AND_MAP(i) ($mapExpr)\n#define REDUCE(a, b) ($reduceExpr)\n\n\nextern "C" __global__ void $name($arguments, $T *partials, int size)\n{\n\t__shared__ $T sdata[$warpSize];\n\n\tint tid = threadIdx.x;\n\tint gid = t... |
"""FindDockerStackFiles
Crawls the fetched application registry directory (from FetchAppRegistry)
and locates all docker-stack.yml files"""
__author__ = '<EMAIL>'
import os
from modules.steps.base_pipeline_step import BasePipelineStep
from modules.util import environment, data_defs
class FindDockerStackFiles(BasePi... | [
"modules.steps.base_pipeline_step.BasePipelineStep.__init__",
"os.walk",
"os.path.join",
"modules.util.environment.get_registry_path"
] | [((366, 397), 'modules.steps.base_pipeline_step.BasePipelineStep.__init__', 'BasePipelineStep.__init__', (['self'], {}), '(self)\n', (391, 397), False, 'from modules.steps.base_pipeline_step import BasePipelineStep\n'), ((653, 684), 'modules.util.environment.get_registry_path', 'environment.get_registry_path', ([], {})... |
# <NAME>
# PandS project 2020
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
# Import data as pandas dataframe
iris_data = pd.read_csv('iris.data', header=None)
# assign column headers
iris_data.columns = ['sepal_length', 'sepal_width', 'petal_length', 'petal_width', 'sp... | [
"pandas.DataFrame",
"matplotlib.pyplot.title",
"seaborn.set",
"seaborn.lmplot",
"matplotlib.pyplot.show",
"matplotlib.pyplot.hist",
"pandas.read_csv",
"matplotlib.pyplot.close",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.figure",
"numpy.arange",
"seaborn.pairplot",
"matplotlib.pyplot.yl... | [((171, 208), 'pandas.read_csv', 'pd.read_csv', (['"""iris.data"""'], {'header': 'None'}), "('iris.data', header=None)\n", (182, 208), True, 'import pandas as pd\n'), ((849, 893), 'pandas.DataFrame', 'pd.DataFrame', (["{'Species': str_summary[:, 0]}"], {}), "({'Species': str_summary[:, 0]})\n", (861, 893), True, 'impor... |
# <NAME> - github.com/2b-t (2022)
# @file utilities_test.py
# @brief Different testing routines for utility functions for accuracy calculation and file import and export
import numpy as np
from parameterized import parameterized
from typing import Tuple
import unittest
from src.utilities import AccX, IO
class Test... | [
"unittest.main",
"src.utilities.IO._str_comma",
"src.utilities.AccX.compute",
"numpy.zeros",
"numpy.ones",
"src.utilities.IO.normalise_image",
"parameterized.parameterized.expand",
"numpy.min",
"numpy.max"
] | [((509, 543), 'parameterized.parameterized.expand', 'parameterized.expand', (['_disparities'], {}), '(_disparities)\n', (529, 543), False, 'from parameterized import parameterized\n'), ((1222, 1256), 'parameterized.parameterized.expand', 'parameterized.expand', (['_disparities'], {}), '(_disparities)\n', (1242, 1256), ... |
###
# Copyright Notice:
# Copyright 2016 Distributed Management Task Force, Inc. All rights reserved.
# License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/python-redfish-utility/blob/master/LICENSE.md
###
""" List Command for RDMC """
import redfish.ris
from optparse import Opti... | [
"rdmc_helper.InvalidCommandLineErrorOPTS",
"optparse.OptionParser",
"rdmc_helper.NoContentsFoundForOperationError"
] | [((1272, 1286), 'optparse.OptionParser', 'OptionParser', ([], {}), '()\n', (1284, 1286), False, 'from optparse import OptionParser\n'), ((2748, 2802), 'rdmc_helper.NoContentsFoundForOperationError', 'NoContentsFoundForOperationError', (['"""No contents found."""'], {}), "('No contents found.')\n", (2780, 2802), False, ... |
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="covid19_dashboard",
version="0.0.1",
author="<NAME>",
author_email="<EMAIL>",
description="A personalized dashboard which maps up to date covid data to a web template",
long... | [
"setuptools.find_packages"
] | [((901, 938), 'setuptools.find_packages', 'setuptools.find_packages', ([], {'where': '"""src"""'}), "(where='src')\n", (925, 938), False, 'import setuptools\n')] |
import Bio.SeqUtils.ProtParam
import os
import ASAP.FeatureExtraction as extract
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
# Chothia numbering definition for CDR regions
CHOTHIA_CDR = {'L': {'1': [24, 34], '2': [50, 56], '3': [89, 97]}, 'H':{'1': [26, 32], '2': [52, 56], '3': [95, 102]}}
c... | [
"pandas.DataFrame",
"ASAP.FeatureExtraction.MultiHotMotif",
"ASAP.FeatureExtraction.GetOneHotGerm",
"ASAP.FeatureExtraction.GetOneHotCanon",
"ASAP.FeatureExtraction.GetFeatureVectors",
"numpy.array",
"ASAP.FeatureExtraction.GetCDRH3",
"collections.Counter",
"ASAP.FeatureExtraction.GetOneHotPI",
"A... | [((728, 788), 'ASAP.FeatureExtraction.ReadAminoNumGerm', 'extract.ReadAminoNumGerm', (['targeting_direct', 'reference_direct'], {}), '(targeting_direct, reference_direct)\n', (752, 788), True, 'import ASAP.FeatureExtraction as extract\n'), ((7133, 7189), 'pandas.DataFrame', 'pd.DataFrame', (['AllFeatureVectors'], {'col... |
'''
name: E#01
author: <NAME>
email: <EMAIL>
link: https://www.youtube.com/channel/UCNN3bpPlWWUkUMB7gjcUFlw
MIT License https://github.com/repen/E-parsers/blob/master/License
'''
import requests
from bs4 import BeautifulSoup
url = "http://light-science.ru/kosmos/vselennaya/top-10-samyh-bolshih-zvezd-vo-vselennoj.htm... | [
"bs4.BeautifulSoup",
"requests.get"
] | [((475, 508), 'requests.get', 'requests.get', (['url'], {'headers': 'header'}), '(url, headers=header)\n', (487, 508), False, 'import requests\n'), ((539, 573), 'bs4.BeautifulSoup', 'BeautifulSoup', (['html', '"""html.parser"""'], {}), "(html, 'html.parser')\n", (552, 573), False, 'from bs4 import BeautifulSoup\n')] |
#!/usr/bin/env python3
from ontobio.sparql2ontology import *
from networkx.algorithms.dag import ancestors
import time
def r():
t1 = time.process_time()
get_edges('pato')
t2 = time.process_time()
print(t2-t1)
r()
r()
r()
"""
LRU is much faster, but does not persist. However, should be fast enough
... | [
"time.process_time"
] | [((140, 159), 'time.process_time', 'time.process_time', ([], {}), '()\n', (157, 159), False, 'import time\n'), ((191, 210), 'time.process_time', 'time.process_time', ([], {}), '()\n', (208, 210), False, 'import time\n')] |
import os
from distutils.dir_util import copy_tree
# import PyInstaller.__main__
pyinst_args = [
'-c',
'serve_up.py',
'--name=ServeUp',
'--onefile',
'--hidden-import=whitenoise',
'--hidden-import=whitenoise.middleware',
'--hidden-import=visitors.admin',
'--hidden-import=tabl... | [
"os.mkdir",
"os.path.join",
"os.path.exists",
"distutils.dir_util.copy_tree"
] | [((652, 682), 'os.path.join', 'os.path.join', (['"""dist"""', '"""static"""'], {}), "('dist', 'static')\n", (664, 682), False, 'import os\n'), ((758, 795), 'distutils.dir_util.copy_tree', 'copy_tree', (['"""static"""', 'dist_static_path'], {}), "('static', dist_static_path)\n", (767, 795), False, 'from distutils.dir_ut... |
"""
Platform independent ssh port forwarding
Much code stolen from the paramiko example
"""
import select
try:
import SocketServer
except ImportError:
import socketserver as SocketServer
import paramiko
SSH_PORT = 22
DEFAULT_PORT = 5432
class ForwardServer (SocketServer.ThreadingTCPServer):
daemon_thre... | [
"select.select",
"paramiko.WarningPolicy",
"paramiko.SSHClient"
] | [((2552, 2572), 'paramiko.SSHClient', 'paramiko.SSHClient', ([], {}), '()\n', (2570, 2572), False, 'import paramiko\n'), ((2647, 2671), 'paramiko.WarningPolicy', 'paramiko.WarningPolicy', ([], {}), '()\n', (2669, 2671), False, 'import paramiko\n'), ((1401, 1444), 'select.select', 'select.select', (['[self.request, chan... |
import numpy as np
import tensorflow as tf
from rl.losses import QLearningLoss
from rl.algorithms import OnlineRLAlgorithm
from rl.runner import *
from rl.replay_buffer import ReplayBuffer, PrioritizedReplayBuffer
from rl import util
from deeplearning.layers import Adam, RunningNorm
from deeplearning.schedules import L... | [
"numpy.abs",
"numpy.asarray",
"deeplearning.logger.dumpkvs",
"deeplearning.schedules.LinearSchedule",
"time.time",
"deeplearning.logger.logkv",
"deeplearning.layers.Adam",
"tensorflow.assign",
"numpy.array",
"rl.replay_buffer.PrioritizedReplayBuffer",
"rl.replay_buffer.ReplayBuffer",
"collecti... | [((2065, 2082), 'collections.deque', 'deque', ([], {'maxlen': '(100)'}), '(maxlen=100)\n', (2070, 2082), False, 'from collections import deque\n'), ((2240, 2304), 'deeplearning.schedules.LinearSchedule', 'LinearSchedule', (['self.args.t_beta_max', '(1.0)', 'self.args.replay_beta'], {}), '(self.args.t_beta_max, 1.0, sel... |
from pprint import pprint
import httpretty
from httpretty import httprettified
import unittest
from checks import load_favicons
from checks.config import Config
@httprettified
class TestFavicons(unittest.TestCase):
def test_favicons(self):
# This site has a favicon
url1 = 'http://example1.com/fa... | [
"checks.load_favicons.Checker",
"httpretty.register_uri",
"checks.config.Config",
"pprint.pprint"
] | [((339, 445), 'httpretty.register_uri', 'httpretty.register_uri', (['httpretty.HEAD', 'url1'], {'body': '""""""', 'adding_headers': "{'Content-type': 'image/x-ico'}"}), "(httpretty.HEAD, url1, body='', adding_headers={\n 'Content-type': 'image/x-ico'})\n", (361, 445), False, 'import httpretty\n'), ((673, 798), 'http... |
import gi
import numpy.testing
import pint
import pyRestTable
import pytest
gi.require_version("Hkl", "5.0")
# NOTE: MUST call gi.require_version() BEFORE import hkl
from hkl.calc import A_KEV
from hkl.diffract import Constraint
from hkl import SimulatedE4CV
class Fourc(SimulatedE4CV):
...
@pytest.fixture(scop... | [
"gi.require_version",
"pytest.fixture",
"numpy.arcsin",
"ophyd.Component",
"hkl.diffract.Constraint",
"pytest.approx",
"pint.Quantity"
] | [((77, 109), 'gi.require_version', 'gi.require_version', (['"""Hkl"""', '"""5.0"""'], {}), "('Hkl', '5.0')\n", (95, 109), False, 'import gi\n'), ((301, 333), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""'}), "(scope='function')\n", (315, 333), False, 'import pytest\n'), ((5226, 5257), 'pytest.appro... |
import zipfile
from utils import download_from_url
# =================================
# Script purpose:
# Download and unzip all raw files
# =================================
# Word frequency calculations from Beijing Language and Culture University
download_from_url(
"http://bcc.blcu.edu.cn/downloads/resources... | [
"zipfile.ZipFile",
"utils.download_from_url"
] | [((254, 382), 'utils.download_from_url', 'download_from_url', (['"""http://bcc.blcu.edu.cn/downloads/resources/BCC_LEX_Zh.zip"""', '"""./data/raw/BCC_LEX_Zh.zip"""'], {'overwrite': '(False)'}), "('http://bcc.blcu.edu.cn/downloads/resources/BCC_LEX_Zh.zip',\n './data/raw/BCC_LEX_Zh.zip', overwrite=False)\n", (271, 38... |
import os
import json
from copy import deepcopy
from collections import defaultdict
import ir_datasets
from capreolus import ModuleBase
from capreolus.utils.caching import cached_file, TargetFileExists
from capreolus.utils.trec import write_qrels, load_qrels, load_trec_topics
from capreolus.utils.loginit import get_l... | [
"capreolus.utils.trec.write_qrels",
"copy.deepcopy",
"capreolus.utils.loginit.get_logger",
"os.rename",
"collections.defaultdict",
"ir_datasets.load",
"os.path.splitext",
"capreolus.utils.trec.load_trec_topics",
"capreolus.utils.caching.cached_file",
"capreolus.utils.trec.load_qrels",
"profane.i... | [((337, 357), 'capreolus.utils.loginit.get_logger', 'get_logger', (['__name__'], {}), '(__name__)\n', (347, 357), False, 'from capreolus.utils.loginit import get_logger\n'), ((9714, 9755), 'profane.import_all_modules', 'import_all_modules', (['__file__', '__package__'], {}), '(__file__, __package__)\n', (9732, 9755), F... |
import numpy as np
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
"""
论文中指出了,先使用CA,后使用SA
定义了:
channel attention output.shape: [b, 1, 1, filters]
spatial attention output.shape: [b, h, w, 1]
"""
def regularized_padded_conv(*args, **kwargs):
""" 定义... | [
"tensorflow.reduce_sum",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layers.Reshape",
"tensorflow.keras.layers.Concatenate",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.GlobalMaxPooling2D",
"tensorflow.reduce_mean",
"tensorflow.stack",
"tensorflow.keras.Model",
"tensorflow.ke... | [((390, 488), 'tensorflow.keras.layers.Conv2D', 'layers.Conv2D', (['*args'], {'padding': '"""same"""', 'use_bias': '(False)', 'kernel_initializer': '"""he_normal"""'}), "(*args, **kwargs, padding='same', use_bias=False,\n kernel_initializer='he_normal')\n", (403, 488), False, 'from tensorflow.keras import layers\n')... |
#! /usr/bin/env python
from __future__ import print_function
import rospy
import actionlib
import time
from std_msgs.msg import Float32
from selfie_msgs.msg import PolygonArray
import selfie_msgs.msg
def intersection_client():
client = actionlib.SimpleActionClient('intersection', selfie_msgs.msg.intersectionAct... | [
"actionlib.SimpleActionClient",
"rospy.Publisher",
"time.sleep",
"rospy.init_node",
"selfie_msgs.msg.PolygonArray",
"std_msgs.msg.Float32"
] | [((244, 329), 'actionlib.SimpleActionClient', 'actionlib.SimpleActionClient', (['"""intersection"""', 'selfie_msgs.msg.intersectionAction'], {}), "('intersection', selfie_msgs.msg.intersectionAction\n )\n", (272, 329), False, 'import actionlib\n'), ((470, 535), 'rospy.Publisher', 'rospy.Publisher', (['"""/intersecti... |
from itertools import groupby
import numpy as np
def best_path(mat: np.ndarray, labels: str) -> str:
"""Best path (greedy) decoder.
Take best-scoring character per time-step, then remove repeated characters and CTC blank characters.
See dissertation of Graves, p63.
Args:
mat: Output of neur... | [
"itertools.groupby",
"numpy.argmax"
] | [((554, 576), 'numpy.argmax', 'np.argmax', (['mat'], {'axis': '(1)'}), '(mat, axis=1)\n', (563, 576), True, 'import numpy as np\n'), ((747, 773), 'itertools.groupby', 'groupby', (['best_path_indices'], {}), '(best_path_indices)\n', (754, 773), False, 'from itertools import groupby\n')] |
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.md') as f:
readme = f.read()
setup(
name="event-reminder",
version="1.0.0",
description="Show messages at a specific date with crontab-like scheduling expressions.",
author="ukitinu",
... | [
"distutils.core.setup"
] | [((148, 596), 'distutils.core.setup', 'setup', ([], {'name': '"""event-reminder"""', 'version': '"""1.0.0"""', 'description': '"""Show messages at a specific date with crontab-like scheduling expressions."""', 'author': '"""ukitinu"""', 'author_email': '"""<EMAIL>"""', 'url': '"""https://github.com/ukitinu/event-remind... |
import smtplib
import json
import keyring
from datetime import date
from email.message import EmailMessage
def send_emails(posts):
# get login and service from cfg
# then get pass from keyring
with open('config.json', 'r') as f:
config = json.load(f)
service = config["MAIL"]["service"]
lo... | [
"json.load",
"smtplib.SMTP_SSL",
"email.message.EmailMessage",
"datetime.date.today",
"keyring.get_password"
] | [((365, 401), 'keyring.get_password', 'keyring.get_password', (['service', 'login'], {}), '(service, login)\n', (385, 401), False, 'import keyring\n'), ((461, 473), 'datetime.date.today', 'date.today', ([], {}), '()\n', (471, 473), False, 'from datetime import date\n'), ((609, 623), 'email.message.EmailMessage', 'Email... |
import argparse
import sys
from pygments import highlight
from pygments.formatters import Terminal256Formatter
from fluent.pygments.lexer import FluentLexer
def main():
parser = argparse.ArgumentParser()
parser.add_argument('path')
args = parser.parse_args()
with open(args.path) as fh:
code =... | [
"fluent.pygments.lexer.FluentLexer",
"argparse.ArgumentParser",
"pygments.formatters.Terminal256Formatter"
] | [((185, 210), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (208, 210), False, 'import argparse\n'), ((351, 364), 'fluent.pygments.lexer.FluentLexer', 'FluentLexer', ([], {}), '()\n', (362, 364), False, 'from fluent.pygments.lexer import FluentLexer\n'), ((366, 388), 'pygments.formatters.Termi... |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# sources: dota_match_metadata.proto
# plugin: python-betterproto
from dataclasses import dataclass
from typing import List
import betterproto
from .base_gcmessages import CsoEconItem
from .dota_gcmessages_common import CMsgDotaMatch, CMsgMatchTips
from .dot... | [
"betterproto.int32_field",
"betterproto.float_field",
"betterproto.bool_field",
"betterproto.string_field",
"betterproto.uint64_field",
"betterproto.message_field",
"betterproto.uint32_field",
"betterproto.fixed64_field",
"betterproto.bytes_field",
"dataclasses.dataclass",
"betterproto.enum_fiel... | [((486, 517), 'dataclasses.dataclass', 'dataclass', ([], {'eq': '(False)', 'repr': '(False)'}), '(eq=False, repr=False)\n', (495, 517), False, 'from dataclasses import dataclass\n'), ((789, 820), 'dataclasses.dataclass', 'dataclass', ([], {'eq': '(False)', 'repr': '(False)'}), '(eq=False, repr=False)\n', (798, 820), Fa... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2017-11-05 16:19
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('users', '0002_auto_2017110... | [
"django.db.models.CharField",
"django.db.models.IntegerField",
"django.db.models.ForeignKey",
"django.db.models.AutoField"
] | [((464, 557), '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", (480, 557), False, 'from django.db import migrations, models\... |
# Copyright 2015 Internap.
#
# 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, so... | [
"MockSSH.SSHCommand.__init__",
"time.sleep"
] | [((859, 912), 'MockSSH.SSHCommand.__init__', 'SSHCommand.__init__', (['self', 'protocol', 'self.name', '*args'], {}), '(self, protocol, self.name, *args)\n', (878, 912), False, 'from MockSSH import SSHCommand\n'), ((963, 989), 'time.sleep', 'time.sleep', (['self.hang_time'], {}), '(self.hang_time)\n', (973, 989), False... |
#!/usr/bin/env python3
import time
import argparse
from biobb_common.configuration import settings
from biobb_common.tools import file_utils as fu
from biobb_chemistry.ambertools.reduce_remove_hydrogens import reduce_remove_hydrogens
from biobb_structure_utils.utils.extract_molecule import extract_molecule
from biobb_... | [
"biobb_analysis.gromacs.gmx_rgyr.gmx_rgyr",
"biobb_structure_utils.utils.extract_molecule.extract_molecule",
"biobb_model.model.mutate.mutate",
"argparse.ArgumentParser",
"biobb_md.gromacs.solvate.solvate",
"biobb_md.gromacs.editconf.editconf",
"biobb_analysis.gromacs.gmx_image.gmx_image",
"biobb_md.g... | [((1112, 1123), 'time.time', 'time.time', ([], {}), '()\n', (1121, 1123), False, 'import time\n'), ((1135, 1170), 'biobb_common.configuration.settings.ConfReader', 'settings.ConfReader', (['config', 'system'], {}), '(config, system)\n', (1154, 1170), False, 'from biobb_common.configuration import settings\n'), ((1433, ... |
__author__ = ["<NAME>"]
__description__ = "Text cleaner functions that deal with casing."
__email__ = ["<EMAIL>"]
__status__ = "Prototype"
import re
def clean_cases(text: str) -> str:
"""Makes text all lowercase.
Arguments:
text:
The text to be converted to all lowercase.
Returns:
... | [
"re.sub"
] | [((942, 984), 're.sub', 're.sub', (['"""(?!^)([A-Z][a-z]+)"""', '""" \\\\1"""', 'text'], {}), "('(?!^)([A-Z][a-z]+)', ' \\\\1', text)\n", (948, 984), False, 'import re\n')] |
import unittest
from pycozmo.image_encoder import ImageEncoder, str_to_image, ImageDecoder, image_to_str
from pycozmo.util import hex_dump, hex_load
from pycozmo.tests.image_encoder_fixtures import FIXTURES
class TestImageEncoder(unittest.TestCase):
@staticmethod
def _encode(sim: str) -> str:
im = ... | [
"pycozmo.image_encoder.ImageEncoder",
"pycozmo.image_encoder.ImageDecoder",
"pycozmo.util.hex_dump",
"pycozmo.image_encoder.str_to_image",
"pycozmo.util.hex_load",
"pycozmo.image_encoder.image_to_str"
] | [((320, 337), 'pycozmo.image_encoder.str_to_image', 'str_to_image', (['sim'], {}), '(sim)\n', (332, 337), False, 'from pycozmo.image_encoder import ImageEncoder, str_to_image, ImageDecoder, image_to_str\n'), ((356, 372), 'pycozmo.image_encoder.ImageEncoder', 'ImageEncoder', (['im'], {}), '(im)\n', (368, 372), False, 'f... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# use all cores
#import os
#os.system("taskset -p 0xff %d" % os.getpid())
pd.options.mode.chained_assignment = None # deactivating slicing warns
def load_seattle_speed_matrix():
""" Loads the whole Seattle `speed_matrix_2015` into memory.
... | [
"pandas.DataFrame",
"matplotlib.pyplot.show",
"numpy.abs",
"numpy.power",
"numpy.append",
"numpy.mean",
"pandas.to_datetime",
"pandas.read_pickle",
"pandas.concat"
] | [((580, 608), 'pandas.read_pickle', 'pd.read_pickle', (['speed_matrix'], {}), '(speed_matrix)\n', (594, 608), True, 'import pandas as pd\n'), ((624, 673), 'pandas.to_datetime', 'pd.to_datetime', (['df.index'], {'format': '"""%Y-%m-%d %H:%M"""'}), "(df.index, format='%Y-%m-%d %H:%M')\n", (638, 673), True, 'import pandas... |
from itsdangerous import URLSafeTimedSerializer
from . import app
ts = URLSafeTimedSerializer(app.config['SECRET_KEY']) | [
"itsdangerous.URLSafeTimedSerializer"
] | [((72, 120), 'itsdangerous.URLSafeTimedSerializer', 'URLSafeTimedSerializer', (["app.config['SECRET_KEY']"], {}), "(app.config['SECRET_KEY'])\n", (94, 120), False, 'from itsdangerous import URLSafeTimedSerializer\n')] |
from django.conf import settings
from django.conf.urls.static import static
from django.urls import path,include
from django.conf.urls import url
from django.contrib.auth import views as auth_views
from . import views
from .forms import LoginForm
urlpatterns = [
path('', views.index, name="home"),
path('register... | [
"django.contrib.auth.views.LoginView.as_view",
"django.urls.path"
] | [((267, 301), 'django.urls.path', 'path', (['""""""', 'views.index'], {'name': '"""home"""'}), "('', views.index, name='home')\n", (271, 301), False, 'from django.urls import path, include\n'), ((306, 355), 'django.urls.path', 'path', (['"""register"""', 'views.register'], {'name': '"""register"""'}), "('register', vie... |
""" This module contains a class that describes an object in the world. """
import numpy as np
class Object:
"""
Object is a simple wireframe composed of multiple points connected by
lines that can be drawn in the viewport.
"""
TOTAL_OBJECTS = -1
def __init__(self, points=None, name=... | [
"numpy.divide",
"numpy.multiply",
"numpy.abs",
"numpy.average",
"numpy.subtract",
"numpy.sin",
"numpy.array",
"numpy.linalg.inv",
"numpy.arange",
"numpy.cos",
"numpy.dot",
"numpy.add"
] | [((1601, 1698), 'numpy.array', 'np.array', (['[[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [-center[0], -center[1], -center\n [2], 1]]'], {}), '([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [-center[0], -center[1],\n -center[2], 1]])\n', (1609, 1698), True, 'import numpy as np\n'), ((6089, 6117), 'numpy.divide', 'np.... |
#!/usr/bin/env python3.5
# 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
#... | [
"asyncio.get_event_loop"
] | [((701, 725), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (723, 725), False, 'import asyncio\n')] |
"""Utils functions."""
from copy import deepcopy
import mne
import numpy as np
from ._logs import logger
# TODO: Add test for this. Also compare speed with latest version of numpy.
# Also compared speed with a numba implementation.
def _corr_vectors(A, B, axis=0):
# based on:
# https://github.com/wmvanvlie... | [
"copy.deepcopy",
"numpy.sum",
"numpy.nan_to_num",
"numpy.seterr",
"numpy.allclose",
"mne.channel_type",
"mne.create_info",
"numpy.mean",
"numpy.linalg.norm"
] | [((1399, 1443), 'numpy.seterr', 'np.seterr', ([], {'divide': '"""ignore"""', 'invalid': '"""ignore"""'}), "(divide='ignore', invalid='ignore')\n", (1408, 1443), True, 'import numpy as np\n'), ((1524, 1553), 'numpy.linalg.norm', 'np.linalg.norm', (['An'], {'axis': 'axis'}), '(An, axis=axis)\n', (1538, 1553), True, 'impo... |
from django.db import models
from django.utils import timezone
STATE_CHOICES = [
("Good", "Good"),
("Needs repair", "Needs repair"),
("In repair", "In repair"),
]
class Equipment(models.Model):
name = models.CharField(max_length=200)
def __str__(self):
return self.name
class Item(model... | [
"django.db.models.CharField",
"django.db.models.TextField",
"django.db.models.DateTimeField",
"django.db.models.ForeignKey"
] | [((220, 252), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(200)'}), '(max_length=200)\n', (236, 252), False, 'from django.db import models\n'), ((341, 429), 'django.db.models.ForeignKey', 'models.ForeignKey', (['"""equipment.Equipment"""'], {'on_delete': 'models.CASCADE', 'related_name': '"""... |
import numpy as numpy
a = numpy.arange(150)
# a[0::2] *= numpy.sqrt(2)/2.0 * (numpy.cos(2) - numpy.sin(2))
a[0::2] *= 2
print(a) | [
"numpy.arange"
] | [((26, 43), 'numpy.arange', 'numpy.arange', (['(150)'], {}), '(150)\n', (38, 43), True, 'import numpy as numpy\n')] |
import shodan
import requests
SHODAN_API_KEY = ""
api = shodan.Shodan(SHODAN_API_KEY)
domain = 'www.python.org'
dnsResolve = 'https://api.shodan.io/dns/resolve?hostnames=' + domain + '&key=' + SHODAN_API_KEY
try:
resolved = requests.get(dnsResolve)
hostIP = resolved.json()[domain]
host = api.host(... | [
"requests.get",
"shodan.Shodan"
] | [((58, 87), 'shodan.Shodan', 'shodan.Shodan', (['SHODAN_API_KEY'], {}), '(SHODAN_API_KEY)\n', (71, 87), False, 'import shodan\n'), ((234, 258), 'requests.get', 'requests.get', (['dnsResolve'], {}), '(dnsResolve)\n', (246, 258), False, 'import requests\n')] |
from actors.actions.hit_and_run_action import HitAndRunAction
from actors.actions.input_driven_action import InputDrivenAction
from actors.actions.shoot_at_action import ShootAtAction
from actors.actor_target import ActorTarget
from actors.components.components import Components
from actors.components.health import Hea... | [
"views.pyxel.shaders.perlin_noise_shader.PerlinNoiseShader",
"utilities.countdown.Countdown",
"actors.actions.use_action.UseAction",
"actors.actions.move_action.MoveAction",
"world.area_builder.AreaBuilder",
"views.json_environment.JsonEnvironment",
"actors.actor_target.ActorTarget",
"views.pyxel.shad... | [((1647, 1670), 'actors.actor_target.ActorTarget', 'ActorTarget', (['player_key'], {}), '(player_key)\n', (1658, 1670), False, 'from actors.actor_target import ActorTarget\n'), ((1522, 1537), 'input.keyboard_input.KeyboardInput', 'KeyboardInput', ([], {}), '()\n', (1535, 1537), False, 'from input.keyboard_input import ... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2020-08-11 01:50
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
m... | [
"django.db.models.ForeignKey",
"django.db.models.DateTimeField",
"django.db.migrations.swappable_dependency"
] | [((319, 376), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (350, 376), False, 'from django.db import migrations, models\n'), ((563, 618), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'default': 'dja... |
import os
import PySimpleGUI as sg
sg.change_look_and_feel('DarkAmber') # colour
# layout of window
layout = [
[sg.Frame(layout=[
[sg.Radio('1. Estadao', 1, default=False, key='estadao'),
sg.Radio('2. Folha', 1,
default=False, key='folha'),
sg.Radio('3. Uol Notícias... | [
"PySimpleGUI.Button",
"PySimpleGUI.InputText",
"PySimpleGUI.Submit",
"PySimpleGUI.Text",
"PySimpleGUI.Radio",
"PySimpleGUI.Window",
"PySimpleGUI.change_look_and_feel"
] | [((36, 72), 'PySimpleGUI.change_look_and_feel', 'sg.change_look_and_feel', (['"""DarkAmber"""'], {}), "('DarkAmber')\n", (59, 72), True, 'import PySimpleGUI as sg\n'), ((773, 820), 'PySimpleGUI.Window', 'sg.Window', (['"""Mudanças Climáticas Search"""', 'layout'], {}), "('Mudanças Climáticas Search', layout)\n", (782, ... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-09-25 16:11
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('boards', '0028_auto_20160925_1809'),
('members', '0008_auto_20160923_2056'),
('dev_env... | [
"django.db.migrations.AlterModelOptions"
] | [((393, 528), 'django.db.migrations.AlterModelOptions', 'migrations.AlterModelOptions', ([], {'name': '"""interruption"""', 'options': "{'verbose_name': 'Interruption', 'verbose_name_plural': 'Interruptions'}"}), "(name='interruption', options={'verbose_name':\n 'Interruption', 'verbose_name_plural': 'Interruptions'... |
import pytest
import sh
def test_invalid():
try:
sh.python(["-m", "zuul_lint", "tests/data/zuul-config-invalid.yaml"])
except sh.ErrorReturnCode_1:
return
except sh.ErrorReturnCode as e:
pytest.fail(e)
pytest.fail("Expected to fail")
def test_valid():
try:
sh.pyth... | [
"pytest.fail",
"sh.python"
] | [((244, 275), 'pytest.fail', 'pytest.fail', (['"""Expected to fail"""'], {}), "('Expected to fail')\n", (255, 275), False, 'import pytest\n'), ((63, 132), 'sh.python', 'sh.python', (["['-m', 'zuul_lint', 'tests/data/zuul-config-invalid.yaml']"], {}), "(['-m', 'zuul_lint', 'tests/data/zuul-config-invalid.yaml'])\n", (72... |
import os
import sys
input_path = sys.argv[1].rstrip(os.sep)
output_path = sys.argv[2]
filenames = os.listdir(input_path)
with open(output_path, 'w') as f:
for i, filename in enumerate(filenames):
filepath = os.sep.join([input_path, filename])
label = filename[:filename.rfind('.')].split('_')[1]
... | [
"os.listdir",
"os.sep.join"
] | [((101, 123), 'os.listdir', 'os.listdir', (['input_path'], {}), '(input_path)\n', (111, 123), False, 'import os\n'), ((223, 258), 'os.sep.join', 'os.sep.join', (['[input_path, filename]'], {}), '([input_path, filename])\n', (234, 258), False, 'import os\n')] |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
#
# Documents
#
"""
Documents
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import os
import re
import sublime
import sublime_plugin
st_version = int(sublime.versi... | [
"stino.main.show_items_panel",
"stino.main.create_menus",
"stino.i18n.change_lang",
"stino.main.open_sketch",
"sublime.windows",
"os.path.isfile",
"stino.main.get_url",
"stino.main.toggle_serial_monitor",
"stino.main.find_in_ref",
"sublime.run_command",
"stino.main.new_sketch",
"os.path.dirnam... | [((307, 324), 'sublime.version', 'sublime.version', ([], {}), '()\n', (322, 324), False, 'import sublime\n'), ((658, 695), 're.compile', 're.compile', (['pattern_text', '(re.M | re.S)'], {}), '(pattern_text, re.M | re.S)\n', (668, 695), False, 'import re\n'), ((739, 766), 'stino.main.set_status', 'stino.main.set_status... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This is pytest for twinpy.properties.hexagonal.
"""
from copy import deepcopy
import numpy as np
from twinpy.properties import hexagonal
a = 2.93
c = 4.65
def test_check_hexagonal_lattice(ti_cell_wyckoff_c):
"""
Check check_hexagonal_lattice.
"""
he... | [
"twinpy.properties.hexagonal.HexagonalPlane",
"twinpy.properties.hexagonal.convert_direction_from_three_to_four",
"copy.deepcopy",
"twinpy.properties.hexagonal.convert_direction_from_four_to_three",
"twinpy.properties.hexagonal.check_cell_is_hcp",
"twinpy.properties.hexagonal.HexagonalDirection",
"twinp... | [((363, 423), 'twinpy.properties.hexagonal.check_hexagonal_lattice', 'hexagonal.check_hexagonal_lattice', ([], {'lattice': 'hexagonal_lattice'}), '(lattice=hexagonal_lattice)\n', (396, 423), False, 'from twinpy.properties import hexagonal\n'), ((1366, 1391), 'numpy.array', 'np.array', (['[1.0, 0.0, 0.0]'], {}), '([1.0,... |
import json
INSTITUTION_TEMPLATE = '''
{
"Institution":{
"Students":{
},
"Teachers":{
},
"Quizzes":{
"DataStructures":{
},
"Algorithms":{
},
"MachineLearning":{
}
}
}
}
'''
class DatabaseHandler:
def __init__(self):
# add a try catch block if the... | [
"json.dump",
"json.load"
] | [((417, 429), 'json.load', 'json.load', (['f'], {}), '(f)\n', (426, 429), False, 'import json\n'), ((884, 927), 'json.dump', 'json.dump', (['self.institute_data', 'f'], {'indent': '(2)'}), '(self.institute_data, f, indent=2)\n', (893, 927), False, 'import json\n'), ((1194, 1237), 'json.dump', 'json.dump', (['self.insti... |
from __future__ import print_function
import os
from pprint import pprint
try:
input = raw_input
except NameError:
pass
import argparse
import pc_lib_api
import pc_lib_general
import json
import pandas
from datetime import datetime, date, time
from pathlib import Path
# --Execution Block-- #
# --Parse comman... | [
"pc_lib_general.pc_exit_error",
"pc_lib_general.pc_login_get",
"argparse.ArgumentParser",
"pathlib.Path.home",
"pc_lib_api.pc_jwt_get",
"datetime.datetime.now",
"pc_lib_api.api_containers_get",
"pc_lib_general.pc_file_write_csv",
"os.path.join"
] | [((350, 391), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'prog': '"""rltoolbox"""'}), "(prog='rltoolbox')\n", (373, 391), False, 'import argparse\n'), ((1687, 1781), 'pc_lib_general.pc_login_get', 'pc_lib_general.pc_login_get', (['args.username', 'args.password', 'args.uiurl', 'args.uiurl_compute'], {}... |
import sys
from xml.etree.ElementInclude import include
from cx_Freeze import setup, Executable
# Dependencies are automatically detected, but it might need fine tuning.
# "packages": ["os"] is used as example only
# build_exe_options = {"packages": ["os"], "excludes": ["tkinter"]}
# base="Win32GUI" should be used on... | [
"cx_Freeze.Executable",
"cx_Freeze.setup"
] | [((513, 552), 'cx_Freeze.Executable', 'Executable', ([], {'script': '"""main.py"""', 'base': 'base'}), "(script='main.py', base=base)\n", (523, 552), False, 'from cx_Freeze import setup, Executable\n'), ((804, 964), 'cx_Freeze.setup', 'setup', ([], {'name': '"""Flask App"""', 'version': '"""0.1"""', 'description': '"""... |
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
from future.builtins.disabled import *
import sys
import fnmatch
import re
import os
import argparse
from argparse import ArgumentTypeError
import traceback
from . import comman... | [
"traceback.print_exc",
"argparse.ArgumentParser",
"fnmatch.translate",
"re.sub",
"re.compile"
] | [((4208, 4233), 're.compile', 're.compile', (['pattern', 're.I'], {}), '(pattern, re.I)\n', (4218, 4233), False, 'import re\n'), ((4704, 4774), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'formatter_class': 'argparse.RawTextHelpFormatter'}), '(formatter_class=argparse.RawTextHelpFormatter)\n', (4727, 47... |
"""
Helper functions used by multiple parts of LAtools.
(c) <NAME> : https://github.com/oscarbranson
"""
import os
import shutil
import re
import configparser
import datetime as dt
import numpy as np
import dateutil as du
import pkg_resources as pkgrs
import uncertainties.unumpy as un
import scipy.interpolate as inter... | [
"os.mkdir",
"numpy.polyfit",
"numpy.empty",
"os.walk",
"numpy.ones",
"pkg_resources.resource_filename",
"numpy.isnan",
"numpy.mean",
"numpy.arange",
"shutil.rmtree",
"numpy.convolve",
"shutil.copy",
"numpy.full",
"numpy.ndim",
"numpy.reshape",
"re.search",
"dateutil.parser.parse",
... | [((4364, 4379), 'os.walk', 'os.walk', (['in_dir'], {}), '(in_dir)\n', (4371, 4379), False, 'import os\n'), ((5523, 5566), 'numpy.full', 'np.full', (['bool_array.size', 'nstart'], {'dtype': 'int'}), '(bool_array.size, nstart, dtype=int)\n', (5530, 5566), True, 'import numpy as np\n'), ((6100, 6128), 'numpy.zeros', 'np.z... |
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.11.2
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
import numpy as np
# %%
import pandas as pd
from t... | [
"tasrif.processing_pipeline.pandas.FillNAOperator",
"pandas.Timestamp"
] | [((584, 622), 'tasrif.processing_pipeline.pandas.FillNAOperator', 'FillNAOperator', ([], {'axis': '(0)', 'value': '"""laptop"""'}), "(axis=0, value='laptop')\n", (598, 622), False, 'from tasrif.processing_pipeline.pandas import FillNAOperator\n'), ((519, 545), 'pandas.Timestamp', 'pd.Timestamp', (['"""2010-04-25"""'], ... |
# coding=utf8
import re
def tokenize_prolog(logical_form):
# Tokenize Prolog
normalized_lf = logical_form.replace(" ", "::")
replacements = [
('(', ' ( '),
(')', ' ) '),
(',', ' , '),
("\\+", " \\+ "),
]
for a, b in replacements:
normalized_lf = normalized_... | [
"re.sub",
"re.match"
] | [((1201, 1246), 're.sub', 're.sub', (['"""\\\\s*\\\\(\\\\s*"""', '"""("""', 'normalized_prolog'], {}), "('\\\\s*\\\\(\\\\s*', '(', normalized_prolog)\n", (1207, 1246), False, 'import re\n'), ((1269, 1314), 're.sub', 're.sub', (['"""\\\\s*\\\\)\\\\s*"""', '""")"""', 'normalized_prolog'], {}), "('\\\\s*\\\\)\\\\s*', ')',... |
from datetime import datetime
from shutil import copy2, copytree
import os
import errno
import subprocess
import re
from soteria.exceptions import BoogieParseError, BoogieTypeError, BoogieVerificationError, BoogieUnknownError
from soteria.debug_support.debugger import Debugger
##TODO : refactor this class
class Execu... | [
"subprocess.Popen",
"soteria.exceptions.BoogieTypeError",
"soteria.exceptions.BoogieUnknownError",
"soteria.debug_support.debugger.Debugger",
"soteria.exceptions.BoogieParseError",
"soteria.exceptions.BoogieVerificationError",
"re.compile"
] | [((611, 718), 'subprocess.Popen', 'subprocess.Popen', (["['mono', path_to_boogie, '-mv:' + model_file_path, spec_file]"], {'stdout': 'subprocess.PIPE'}), "(['mono', path_to_boogie, '-mv:' + model_file_path,\n spec_file], stdout=subprocess.PIPE)\n", (627, 718), False, 'import subprocess\n'), ((1892, 1918), 'soteria.e... |
'''
ilf - compiler
'''
import os
import json
from .parse import parse
from .core import Ip4Filter, Ival
# -- GLOBALS
# (re)initialized by compile_file
GROUPS = {} # grp-name -> set([networks,.. , services, ..])
# -- AST = [(pos, [type, id, value]), ..]
def ast_iter(ast, types=None):
'iterate across statemen... | [
"os.path.relpath",
"io.StringIO",
"os.path.dirname",
"json.loads"
] | [((11909, 11925), 'io.StringIO', 'io.StringIO', (['src'], {}), '(src)\n', (11920, 11925), False, 'import io\n'), ((4226, 4246), 'json.loads', 'json.loads', (['stmt[-1]'], {}), '(stmt[-1])\n', (4236, 4246), False, 'import json\n'), ((11579, 11602), 'os.path.relpath', 'os.path.relpath', (['pos[0]'], {}), '(pos[0])\n', (1... |
# Copyright 2021 Alibaba Group Holding Limited. 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 ... | [
"tensorflow.python.platform.test.main",
"tensorflow.train.MonitoredTrainingSession",
"tensorflow.losses.sparse_softmax_cross_entropy",
"epl.add_to_collection",
"distutils.version.LooseVersion",
"tensorflow.layers.dense",
"tensorflow.train.get_or_create_global_step",
"epl.replicate",
"tensorflow.add_... | [((10439, 10450), 'tensorflow.python.platform.test.main', 'test.main', ([], {}), '()\n', (10448, 10450), False, 'from tensorflow.python.platform import test\n'), ((8955, 9000), 'epl.parallel.hooks._append_replicated_fetches', '_append_replicated_fetches', (['fetches', 'replicas'], {}), '(fetches, replicas)\n', (8981, 9... |
from collections import deque # Implement Mathematiques Stacks
# from main_terminalFunctions import
from os import get_terminal_size
from main_terminalGetKey import getKey
def readfile(file):
# Gras, Italique, Strike, code, Mcode, Hilight
# 0** 1* 2__ 3_ 4~~ 5` 6``... | [
"os.get_terminal_size",
"main_terminalGetKey.getKey"
] | [((3204, 3222), 'main_terminalGetKey.getKey', 'getKey', ([], {'debug': '(True)'}), '(debug=True)\n', (3210, 3222), False, 'from main_terminalGetKey import getKey\n'), ((656, 675), 'os.get_terminal_size', 'get_terminal_size', ([], {}), '()\n', (673, 675), False, 'from os import get_terminal_size\n'), ((1219, 1238), 'os.... |
from active_learning.oracles import UserOracle, FunctionalOracle
from active_learning.evaluation import Evaluator
from active_learning.active_learner import RandomSelectionAlgorithm, GPSelect_Algorithm, UncertaintySamplingAlgorithm
from active_learning.rating import length_based
import unittest
class ActiveLearningEx... | [
"unittest.main",
"active_learning.oracles.FunctionalOracle",
"active_learning.evaluation.Evaluator"
] | [((1171, 1186), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1184, 1186), False, 'import unittest\n'), ((886, 934), 'active_learning.oracles.FunctionalOracle', 'FunctionalOracle', ([], {}), "(**{'rating_func': rating_func})\n", (902, 934), False, 'from active_learning.oracles import UserOracle, FunctionalOracle... |
import six
import numpy as np
import nutszebra_utility as nz
import sys
import pickle
def unpickle(file_name):
fp = open(file_name, 'rb')
if sys.version_info.major == 2:
data = pickle.load(fp)
elif sys.version_info.major == 3:
data = pickle.load(fp, encoding='latin-1')
fp.close()
r... | [
"six.moves.range",
"numpy.zeros",
"numpy.any",
"nutszebra_utility.Utility",
"pickle.load",
"numpy.array",
"numpy.all"
] | [((195, 210), 'pickle.load', 'pickle.load', (['fp'], {}), '(fp)\n', (206, 210), False, 'import pickle\n'), ((404, 416), 'nutszebra_utility.Utility', 'nz.Utility', ([], {}), '()\n', (414, 416), True, 'import nutszebra_utility as nz\n'), ((1644, 1690), 'numpy.zeros', 'np.zeros', (['(50000, 3, 32, 32)'], {'dtype': 'np.flo... |
#coding:utf-8
#
# id: bugs.core_5676
# title: Consider equivalence classes for index navigation
# decription:
# Confirmed inefficiense on:
# 3.0.3.32837
# 4.0.0.800
# Checked on:
# 3.0.3.32852: OK, ... | [
"pytest.mark.version",
"firebird.qa.isql_act",
"firebird.qa.db_factory"
] | [((646, 691), 'firebird.qa.db_factory', 'db_factory', ([], {'sql_dialect': '(3)', 'init': 'init_script_1'}), '(sql_dialect=3, init=init_script_1)\n', (656, 691), False, 'from firebird.qa import db_factory, isql_act, Action\n'), ((1953, 2015), 'firebird.qa.isql_act', 'isql_act', (['"""db_1"""', 'test_script_1'], {'subst... |
from tqdm import tqdm
from MCTS import MCTS
from BinaryTree import BinaryTree
import numpy as np
import matplotlib.pyplot as plt
np.random.seed(15)
def run_experiment(max_iterations, dynamic_c=False):
"""
Run a single experiment of a sequence of MCTS searches to find the optimal path.
:param max_iterati... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.xscale",
"tqdm.tqdm",
"numpy.random.seed",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"numpy.logspace",
"matplotlib.pyplot.legend",
"MCTS.MCTS",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.ylabel",
"BinaryT... | [((131, 149), 'numpy.random.seed', 'np.random.seed', (['(15)'], {}), '(15)\n', (145, 149), True, 'import numpy as np\n'), ((519, 552), 'BinaryTree.BinaryTree', 'BinaryTree', ([], {'depth': '(12)', 'b': '(20)', 'tau': '(3)'}), '(depth=12, b=20, tau=3)\n', (529, 552), False, 'from BinaryTree import BinaryTree\n'), ((597,... |
import argparse
from utils.data_loader import DataLoader
from algorithms.OFDClean import OFDClean
if __name__ == '__main__':
threshold = 20
sense_dir = ['sense2/', 'sense4/', 'sense6/', 'sense8/', 'sense10/']
sense_path = 'clinical' # sense_dir[1]
err_data_path = ['data_err3', 'data_err6', 'data_er... | [
"algorithms.OFDClean.OFDClean",
"utils.data_loader.DataLoader"
] | [((795, 813), 'utils.data_loader.DataLoader', 'DataLoader', (['config'], {}), '(config)\n', (805, 813), False, 'from utils.data_loader import DataLoader\n'), ((1115, 1174), 'algorithms.OFDClean.OFDClean', 'OFDClean', (['data', 'ofds', 'senses', 'right_attrs', 'ssets', 'threshold'], {}), '(data, ofds, senses, right_attr... |
######################################################################
# Author: <NAME>
# Username: rakhimovb
# Assignment: A03: A Pair of Fully Functional Gitty Psychedelic Robotic Turtles
######################################################################
import turtle
def draw_rectangle(t, h, c):
"""
T... | [
"turtle.Screen",
"turtle.Turtle"
] | [((2112, 2127), 'turtle.Screen', 'turtle.Screen', ([], {}), '()\n', (2125, 2127), False, 'import turtle\n'), ((2181, 2196), 'turtle.Turtle', 'turtle.Turtle', ([], {}), '()\n', (2194, 2196), False, 'import turtle\n')] |
import numpy as np
import time
import keyboard
import math
import threading
def attack_mob(boxes,classes):
"""
recevies in the player box and the mob box and then will move the player towards the mob and then attack it
"""
#midpoints X1 and X2
player, closestmob = calculate_distance(boxes,classes)
... | [
"math.hypot",
"numpy.zeros",
"keyboard.moveRight",
"numpy.argmin",
"time.time",
"keyboard.teledown",
"keyboard.loot",
"keyboard.moveLeft",
"numpy.where",
"numpy.array",
"keyboard.cc",
"keyboard.teleup",
"keyboard.buff",
"numpy.shape",
"keyboard.attackFiveTimes"
] | [((1979, 2001), 'numpy.where', 'np.where', (['(classes == 2)'], {}), '(classes == 2)\n', (1987, 2001), True, 'import numpy as np\n'), ((2228, 2257), 'numpy.zeros', 'np.zeros', (['(5)'], {'dtype': 'np.float32'}), '(5, dtype=np.float32)\n', (2236, 2257), True, 'import numpy as np\n'), ((2546, 2565), 'numpy.argmin', 'np.a... |
import os
import io
import httpretty
class APIMock():
"""
Responses should be a {method: filename} map
"""
def __init__(self, mock_url, mock_dir, responses):
self.mock_url = mock_url
self.responses = responses
self.mock_dir = mock_dir
def request_callback(self, request, ur... | [
"httpretty.register_uri",
"httpretty.disable",
"httpretty.reset",
"httpretty.enable",
"os.path.join"
] | [((603, 621), 'httpretty.enable', 'httpretty.enable', ([], {}), '()\n', (619, 621), False, 'import httpretty\n'), ((630, 716), 'httpretty.register_uri', 'httpretty.register_uri', (['httpretty.POST', 'self.mock_url'], {'body': 'self.request_callback'}), '(httpretty.POST, self.mock_url, body=self.\n request_callback)\... |
## Copyright (c) 2020 AT&T Intellectual Property. All rights reserved.
import sys
from load_db import load_graph
from load_db import intermediate
from load_db import svr_pkgs
from load_db import svr_cve_pkgs
from load_db import pkg_cve_supr
from load_db import pkg_cve_cvss_threshold
from load_db import pkgs_with_no_cv... | [
"load_db.pkg_cve_cvss_threshold",
"load_db.svr_cve_pkgs",
"load_db.pkg_cve_supr",
"load_db.intermediate",
"sbom_helpers.mypprint",
"sbom_helpers.validate_file_access",
"load_db.svr_pkgs",
"load_db.pkgs_with_no_cve",
"load_db.load_graph",
"sbom_helpers.get_gdbpath"
] | [((736, 765), 'sbom_helpers.validate_file_access', 'validate_file_access', (['[gfile]'], {}), '([gfile])\n', (756, 765), False, 'from sbom_helpers import validate_file_access\n'), ((779, 796), 'load_db.load_graph', 'load_graph', (['gfile'], {}), '(gfile)\n', (789, 796), False, 'from load_db import load_graph\n'), ((880... |
# -*- coding: utf-8 -*-
# Created on Sat Jun 05 2021
# Last modified on Mon Jun 07 2021
# Copyright (c) CaMOS Development Team. All Rights Reserved.
# Distributed under a MIT License. See LICENSE for more info.
import numpy as np
from camos.tasks.analysis import Analysis
from camos.utils.generategui import NumericInp... | [
"camos.utils.generategui.DatasetInput",
"numpy.isin",
"numpy.where",
"camos.utils.units.get_time",
"numpy.unique"
] | [((1324, 1372), 'numpy.unique', 'np.unique', (["data[:]['CellID']"], {'return_counts': '(True)'}), "(data[:]['CellID'], return_counts=True)\n", (1333, 1372), True, 'import numpy as np\n'), ((1618, 1643), 'numpy.isin', 'np.isin', (['IDs', 'IDs_include'], {}), '(IDs, IDs_include)\n', (1625, 1643), True, 'import numpy as ... |
from __future__ import print_function
import mxnet as mx
from mxnet.gluon import nn
from mxnet.gluon.model_zoo.custom_layers import HybridConcurrent, Identity
from mxnet.gluon.model_zoo.vision import get_model
def test_concurrent():
model = HybridConcurrent(concat_dim=1)
model.add(nn.Dense(128, activation='ta... | [
"mxnet.gluon.nn.Dense",
"nose.runmodule",
"mxnet.gluon.model_zoo.custom_layers.Identity",
"mxnet.nd.random_uniform",
"mxnet.nd.zeros",
"mxnet.sym.var",
"mxnet.gluon.model_zoo.custom_layers.HybridConcurrent",
"mxnet.gluon.model_zoo.vision.get_model",
"mxnet.init.Xavier"
] | [((247, 277), 'mxnet.gluon.model_zoo.custom_layers.HybridConcurrent', 'HybridConcurrent', ([], {'concat_dim': '(1)'}), '(concat_dim=1)\n', (263, 277), False, 'from mxnet.gluon.model_zoo.custom_layers import HybridConcurrent, Identity\n'), ((462, 480), 'mxnet.sym.var', 'mx.sym.var', (['"""data"""'], {}), "('data')\n", (... |
"""
Created on April 13, 2018
Edited on July 05, 2019
@author: <NAME> & <NAME>
Sony CSL Paris, France
Institute for Computational Perception, Johannes Kepler University, Linz
Austrian Research Institute for Artificial Intelligence, Vienna
"""
import numpy as np
import librosa
import torch.utils.data as data
import t... | [
"complex_auto.util.cached",
"numpy.concatenate",
"scipy.signal.get_window",
"torch.FloatTensor",
"torchvision.transforms.ToPILImage",
"torchvision.transforms.ToTensor",
"complex_auto.util.to_numpy",
"numpy.random.randint",
"librosa.load",
"numpy.random.choice",
"numpy.random.rand",
"torchvisio... | [((541, 568), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (558, 568), False, 'import logging\n'), ((7686, 7718), 'numpy.random.randint', 'np.random.randint', (['(0)', 'count_data'], {}), '(0, count_data)\n', (7703, 7718), True, 'import numpy as np\n'), ((7784, 7856), 'numpy.random.rand... |
import os
import errno
import itertools
directory = 'C:/Users/Jan/Dropbox/Bachelorarbeit/Programm/Testdaten/Raw DataSet/'
# listdir = [file for file in os.listdir(directory) if file not in ['capa.txt', 'capb.txt', 'capc.txt']]
# for d in listdir:
# print('Opening dir: ', directory+'/'+d)
# with open(directory... | [
"os.listdir"
] | [((2396, 2417), 'os.listdir', 'os.listdir', (['directory'], {}), '(directory)\n', (2406, 2417), False, 'import os\n')] |
import schedule
import time
from gql import Main
import configparser
import json
from jsondiff import diff
from writedb import writedb
import pandas as pd
from pandas import DataFrame
config = configparser.RawConfigParser()
config.read('refresh_time.cfg')
interval = config.getint('Main','time')
t = int(interval)
res... | [
"pandas.DataFrame",
"jsondiff.diff",
"gql.Main.git_activities",
"configparser.RawConfigParser",
"writedb.writedb.write_repo",
"time.sleep",
"writedb.writedb.update_repo",
"writedb.writedb.insert_new",
"writedb.writedb.write_commit"
] | [((195, 225), 'configparser.RawConfigParser', 'configparser.RawConfigParser', ([], {}), '()\n', (223, 225), False, 'import configparser\n'), ((328, 349), 'gql.Main.git_activities', 'Main.git_activities', ([], {}), '()\n', (347, 349), False, 'from gql import Main\n'), ((628, 698), 'writedb.writedb.write_repo', 'writedb.... |
from dataclasses import dataclass
from typing import Any, Dict
from urllib.error import HTTPError
from urllib.request import urlopen
import requests
import srsly
from huggingface_hub import cached_download, hf_hub_url
from embeddings.utils.loggers import get_logger
_logger = get_logger(__name__)
@dataclass
class S... | [
"embeddings.utils.loggers.get_logger",
"huggingface_hub.cached_download",
"srsly.read_json",
"huggingface_hub.hf_hub_url"
] | [((279, 299), 'embeddings.utils.loggers.get_logger', 'get_logger', (['__name__'], {}), '(__name__)\n', (289, 299), False, 'from embeddings.utils.loggers import get_logger\n'), ((1267, 1288), 'srsly.read_json', 'srsly.read_json', (['path'], {}), '(path)\n', (1282, 1288), False, 'import srsly\n'), ((1367, 1410), 'hugging... |
from dataprovider import Date, Validator, RSSReader, StoryRSS
from models import ModelRSS
from threading import Thread
import logging
import schedule
import time
import json
import os
logging.basicConfig(filename=os.getenv("BIASIMPACTER_OUTPUT"),
level=logging.INFO,
format='%... | [
"logging.error",
"os.path.dirname",
"logging.StreamHandler",
"logging.info",
"dataprovider.StoryRSS",
"models.ModelRSS",
"os.getenv",
"logging.getLogger"
] | [((404, 427), 'logging.StreamHandler', 'logging.StreamHandler', ([], {}), '()\n', (425, 427), False, 'import logging\n'), ((1187, 1200), 'models.ModelRSS', 'ModelRSS', (['uri'], {}), '(uri)\n', (1195, 1200), False, 'from models import ModelRSS\n'), ((215, 247), 'os.getenv', 'os.getenv', (['"""BIASIMPACTER_OUTPUT"""'], ... |
import json
from math import ceil, floor
import requests
from .packet import PacketList
from .packet.base import Packet
from .transaction import Transaction
from .usage import (UsageMessage, UsageRecord, UsageResponse, UsageResponseError,
FailedUsageResponse, UsageStatus)
"""AMIE client and Usa... | [
"requests.Session",
"json.loads",
"math.ceil"
] | [((1429, 1447), 'requests.Session', 'requests.Session', ([], {}), '()\n', (1445, 1447), False, 'import requests\n'), ((13415, 13433), 'requests.Session', 'requests.Session', ([], {}), '()\n', (13431, 13433), False, 'import requests\n'), ((11161, 11184), 'json.loads', 'json.loads', (['client_json'], {}), '(client_json)\... |
"""Xetra ETL Component"""
import logging
from datetime import datetime
from typing import NamedTuple
import pandas as pd
from xetra.common.s3 import S3BucketConnector
from xetra.common.meta_process import MetaProcess
class XetraSourceConfig(NamedTuple):
"""
Class for source configuration data
src_first_... | [
"pandas.DataFrame",
"datetime.datetime.today",
"xetra.common.meta_process.MetaProcess.update_meta_file",
"xetra.common.meta_process.MetaProcess.return_date_list",
"logging.getLogger"
] | [((2825, 2852), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (2842, 2852), False, 'import logging\n'), ((3090, 3196), 'xetra.common.meta_process.MetaProcess.return_date_list', 'MetaProcess.return_date_list', (['self.src_args.src_first_extract_date', 'self.meta_key', 'self.s3_bucket_trg'... |
"""
Implementation using CuPy acceleration.
.. moduleauthor:: <NAME> <<EMAIL>>
"""
import numpy as np
from time import time
import cupy as cp
from cupyx.scipy import fft as cufft
def powerspectrum(*u, average=True, diagnostics=False,
kmin=None, kmax=None, npts=None,
compute_fft=... | [
"numpy.abs",
"cupy.empty",
"cupy.zeros_like",
"numpy.polyfit",
"cupy.get_default_memory_pool",
"numpy.add.outer",
"cupy.fuse",
"cupy.std",
"numpy.fft.fftfreq",
"pyFC.LogNormalFractalCube",
"numpy.log10",
"matplotlib.pyplot.errorbar",
"matplotlib.pyplot.show",
"cupy.zeros",
"cupy.real",
... | [((6522, 6556), 'cupy.fuse', 'cp.fuse', ([], {'kernel_name': '"""mod_squared"""'}), "(kernel_name='mod_squared')\n", (6529, 6556), True, 'import cupy as cp\n'), ((2898, 2936), 'numpy.issubdtype', 'np.issubdtype', (['u[0].dtype', 'np.floating'], {}), '(u[0].dtype, np.floating)\n', (2911, 2936), True, 'import numpy as np... |
from __future__ import absolute_import, division, print_function
from dials.algorithms.refinement.parameterisation.model_parameters import (
Parameter,
ModelParameterisation,
)
import abc
from scitbx.array_family import flex
from dials_refinement_helpers_ext import GaussianSmoother as GS
# reusable PHIL string... | [
"dials.algorithms.refinement.parameterisation.model_parameters.Parameter.__init__",
"dials.algorithms.refinement.parameterisation.model_parameters.ModelParameterisation.__init__",
"scitbx.array_family.flex.double"
] | [((1665, 1715), 'dials.algorithms.refinement.parameterisation.model_parameters.Parameter.__init__', 'Parameter.__init__', (['self', 'value', 'axis', 'ptype', 'name'], {}), '(self, value, axis, ptype, name)\n', (1683, 1715), False, 'from dials.algorithms.refinement.parameterisation.model_parameters import Parameter, Mod... |
import json
import zipfile
import importlib
from functools import partial
import numpy as np
import torch
from torch import nn
from torch.utils.data import DataLoader, Dataset
import torchero
from torchero.utils.mixins import DeviceMixin
from torchero import meters
from torchero import SupervisedTrainer
class Input... | [
"json.dumps",
"torch.no_grad",
"torch.utils.data.DataLoader",
"torchero.meters.Precision",
"torchero.meters.RMSE",
"torch.load",
"torchero.meters.BalancedAccuracy",
"torch.softmax",
"torchero.meters.Recall",
"torchero.SupervisedTrainer",
"torchero.meters.F1Score",
"torchero.meters.CategoricalA... | [((1330, 1380), 'torch.stack', 'torch.stack', (['[pred.tensor for pred in self._preds]'], {}), '([pred.tensor for pred in self._preds])\n', (1341, 1380), False, 'import torch\n'), ((2845, 2890), 'importlib.import_module', 'importlib.import_module', (["model_type['module']"], {}), "(model_type['module'])\n", (2868, 2890... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import torch
from itertools import permutations
def loss_calc(est, ref, loss_type):
"""
time-domain loss: sisdr
"""
# time domain (wav input)
if loss_type == "sisdr":
loss = batch_SDR_torch(est, ref)
if loss_type == "mse"... | [
"torch.mean",
"torch.stack",
"torch.cat",
"torch.log10",
"torch.pow",
"torch.max",
"numpy.arange",
"torch.rand",
"torch.zeros",
"torch.sum"
] | [((3031, 3053), 'torch.cat', 'torch.cat', (['SDR_perm', '(1)'], {}), '(SDR_perm, 1)\n', (3040, 3053), False, 'import torch\n'), ((3071, 3097), 'torch.max', 'torch.max', (['SDR_perm'], {'dim': '(1)'}), '(SDR_perm, dim=1)\n', (3080, 3097), False, 'import torch\n'), ((4405, 4432), 'torch.rand', 'torch.rand', (['(10)', '(2... |
import sys
import os
sys.path.append(os.path.abspath("."))
sys.dont_write_bytecode = True
__author__ = "bigfatnoob"
from store import base_store, mongo_driver
from utils import logger, lib
import properties
import re
LOGGER = logger.get_logger(os.path.basename(__file__.split(".")[0]))
class InputStore(base_store... | [
"os.path.abspath",
"store.base_store.ClusterStore.__init__",
"store.base_store.PyFileMetaStore.__init__",
"store.mongo_driver.contains_document",
"store.base_store.InputStore.__init__",
"store.base_store.ExecutionStore.__init__",
"re.finditer",
"store.mongo_driver.get_collection",
"store.base_store.... | [((38, 58), 'os.path.abspath', 'os.path.abspath', (['"""."""'], {}), "('.')\n", (53, 58), False, 'import os\n'), ((379, 434), 'store.base_store.InputStore.__init__', 'base_store.InputStore.__init__', (['self', 'dataset'], {}), '(self, dataset, **kwargs)\n', (409, 434), False, 'from store import base_store, mongo_driver... |
from __future__ import absolute_import, division
import numpy as np
from numpy.testing import assert_array_almost_equal, assert_allclose
from pytest import raises
from fatiando.seismic import conv
def test_impulse_response():
"""
conv.convolutional_model raises the source wavelet as result when the model
... | [
"numpy.zeros",
"numpy.ones",
"fatiando.seismic.conv.rickerwave",
"pytest.raises",
"fatiando.seismic.conv.convolutional_model",
"numpy.testing.assert_array_almost_equal"
] | [((428, 456), 'fatiando.seismic.conv.rickerwave', 'conv.rickerwave', (['(30.0)', '(0.002)'], {}), '(30.0, 0.002)\n', (443, 456), False, 'from fatiando.seismic import conv\n'), ((470, 496), 'numpy.zeros', 'np.zeros', (['(w.shape[0], 20)'], {}), '((w.shape[0], 20))\n', (478, 496), True, 'import numpy as np\n'), ((544, 61... |
#!/usr/bin/env python
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# @Author: <NAME>
# @Lab of Machine Learning and Data Mining, TianJin University
# @Email: <EMAIL>
# @Date: 2018-10-26 15:32:34
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
from __future__ i... | [
"subprocess.Popen"
] | [((2192, 2307), 'subprocess.Popen', 'subprocess.Popen', (["('ps -u -p ' + pid)"], {'shell': '(True)', 'stdout': 'subprocess.PIPE', 'stderr': 'subprocess.PIPE', 'close_fds': '(True)'}), "('ps -u -p ' + pid, shell=True, stdout=subprocess.PIPE,\n stderr=subprocess.PIPE, close_fds=True)\n", (2208, 2307), False, 'import ... |
#!/usr/bin/env python3
import sys
import numpy as np
from keras.layers import Input, Dense, Reshape, Flatten, Dropout, BatchNormalization
from keras.layers.convolutional import Conv3D, Deconv3D
from keras.layers.core import Activation
from keras.layers.advanced_activations import LeakyReLU
from keras.models import Sequ... | [
"keras.optimizers.Adam",
"keras.layers.Flatten",
"keras.layers.convolutional.Conv3D",
"keras.models.Model",
"keras.utils.plot_model",
"keras.layers.Dense",
"keras.layers.advanced_activations.LeakyReLU",
"keras.layers.Input",
"keras.layers.BatchNormalization"
] | [((538, 564), 'keras.optimizers.Adam', 'Adam', ([], {'lr': '(1e-06)', 'beta_1': '(0.5)'}), '(lr=1e-06, beta_1=0.5)\n', (542, 564), False, 'from keras.optimizers import Adam\n'), ((1150, 1179), 'keras.layers.Input', 'Input', ([], {'shape': 'self.INPUT_SHAPE'}), '(shape=self.INPUT_SHAPE)\n', (1155, 1179), False, 'from ke... |
import numpy as np
def L2Loss(y_predicted, y_ground_truth, reduction="None"):
"""returns l2 loss between two arrays
:param y_predicted: array of predicted values
:type y_predicted: ndarray
:param y_ground_truth: array of ground truth values
:type y_ground_truth: ndarray
:param reduction: redu... | [
"numpy.array",
"numpy.mean",
"numpy.multiply",
"numpy.sum"
] | [((637, 672), 'numpy.multiply', 'np.multiply', (['difference', 'difference'], {}), '(difference, difference)\n', (648, 672), True, 'import numpy as np\n'), ((1941, 1962), 'numpy.array', 'np.array', (['y_predicted'], {}), '(y_predicted)\n', (1949, 1962), True, 'import numpy as np\n'), ((1984, 2008), 'numpy.array', 'np.a... |
#!/usr/bin/env python3
# Copyright © 2018 Broadcom. All Rights Reserved. The term “Broadcom” refers to
# Broadcom Inc. and/or its subsidiaries.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may also obtain a copy of the Lice... | [
"pyfos.utils.brcd_util.getsession",
"pyfos.utils.brcd_util.parse",
"pyfos.pyfos_brocade_gigabitethernet.gigabitethernet",
"pyfos.pyfos_auth.logout",
"pyfos.pyfos_util.response_print"
] | [((2824, 2841), 'pyfos.pyfos_brocade_gigabitethernet.gigabitethernet', 'gigabitethernet', ([], {}), '()\n', (2839, 2841), False, 'from pyfos.pyfos_brocade_gigabitethernet import gigabitethernet\n'), ((3427, 3484), 'pyfos.utils.brcd_util.parse', 'brcd_util.parse', (['argv', 'gigabitethernet', 'filters', 'validate'], {})... |
# Copyright 2020-2022 OpenDR European Project
#
# 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 agree... | [
"os.remove",
"tqdm.tqdm",
"zipfile.ZipFile",
"os.makedirs",
"opendr.perception.object_detection_2d.ssd.ssd_learner.SingleShotDetectorLearner",
"pickle.dump",
"numpy.asarray",
"os.path.exists",
"time.time",
"opendr.perception.object_detection_2d.datasets.transforms.BoundingBoxListToNumpyArray",
"... | [((2050, 2082), 'os.path.join', 'os.path.join', (['path', 'dataset_name'], {}), '(path, dataset_name)\n', (2062, 2082), False, 'import os\n'), ((5035, 5140), 'os.path.join', 'os.path.join', (['self.path', "('data_' + self.detector + '_' + self.dataset_sets[self.split] + '_pets.pkl')"], {}), "(self.path, 'data_' + self.... |
import json
from types import MappingProxyType
from typing import Any, Dict, Mapping, Type, TypeVar, Union
from typing_extensions import Protocol
from mashumaro.serializer.base import DataClassDictMixin
DEFAULT_DICT_PARAMS = {
"use_bytes": False,
"use_enum": False,
"use_datetime": False,
}
EncodedData = ... | [
"typing.TypeVar",
"types.MappingProxyType"
] | [((353, 393), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {'bound': '"""DataClassJSONMixin"""'}), "('T', bound='DataClassJSONMixin')\n", (360, 393), False, 'from typing import Any, Dict, Mapping, Type, TypeVar, Union\n'), ((784, 804), 'types.MappingProxyType', 'MappingProxyType', (['{}'], {}), '({})\n', (800, 804), Fals... |
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("-V", "--version", help="show program version", action="store_true")
args = parser.parse_args()
if args.version:
print("Version 0.1")
| [
"argparse.ArgumentParser"
] | [((26, 51), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (49, 51), False, 'import argparse\n')] |
import glob
import json
import pandas as pd
from crypto_balancer.dummy_exchange import DummyExchange
LIMITS = {'BNB/BTC': {'amount': {'max': 90000000.0, 'min': 0.01},
'cost': {'max': None, 'min': 0.001},
'price': {'max': None, 'min': None}},
'BNB/ETH': {'amount':... | [
"pandas.DataFrame",
"pandas.to_datetime",
"glob.glob"
] | [((2520, 2534), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (2532, 2534), True, 'import pandas as pd\n'), ((2555, 2575), 'glob.glob', 'glob.glob', (['filenames'], {}), '(filenames)\n', (2564, 2575), False, 'import glob\n'), ((2811, 2829), 'pandas.DataFrame', 'pd.DataFrame', (['data'], {}), '(data)\n', (2823, ... |
import subprocess
from distutils.version import StrictVersion
from platform import mac_ver
try:
from munkicon import plist
from munkicon import worker
except ImportError:
from .munkicon import plist
from .munkicon import worker
# Keys: 'user_home_path'
# 'secure_token'
# 'volume_owners'
... | [
"subprocess.run",
"subprocess.Popen",
"distutils.version.StrictVersion",
"munkicon.worker.MunkiConWorker",
"munkicon.plist.readPlistFromString",
"platform.mac_ver"
] | [((4991, 5052), 'munkicon.worker.MunkiConWorker', 'worker.MunkiConWorker', ([], {'conditions_file': 'dest', 'log_src': '__file__'}), '(conditions_file=dest, log_src=__file__)\n', (5012, 5052), False, 'from munkicon import worker\n'), ((658, 728), 'subprocess.Popen', 'subprocess.Popen', (['_cmd'], {'stdout': 'subprocess... |
#!/usr/bin/env python3
import os
from itertools import chain
from collections import Counter
import argparse
import gatenlphiltlab
relators = [
"because",
"cuz",
"since",
"after",
"when",
"whenever",
"once",
"therefore",
"so",
"if",
"soon",
"result",
"results",
... | [
"argparse.ArgumentParser",
"gatenlphiltlab.AnnotationFile"
] | [((1023, 1124), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Annotates causal connectives within GATE annotation files"""'}), "(description=\n 'Annotates causal connectives within GATE annotation files')\n", (1046, 1124), False, 'import argparse\n'), ((1383, 1434), 'gatenlphiltlab.A... |
import sys
import os
sys.path.append(snakemake.config['paths']['mcc_path'])
import scripts.mccutils as mccutils
def main():
download_success = mccutils.download(snakemake.params.url, snakemake.output[0], md5=snakemake.params.md5, max_attempts=3)
if not download_success:
print("popoolationTE2 download f... | [
"sys.path.append",
"scripts.mccutils.download",
"sys.exit"
] | [((21, 75), 'sys.path.append', 'sys.path.append', (["snakemake.config['paths']['mcc_path']"], {}), "(snakemake.config['paths']['mcc_path'])\n", (36, 75), False, 'import sys\n'), ((148, 255), 'scripts.mccutils.download', 'mccutils.download', (['snakemake.params.url', 'snakemake.output[0]'], {'md5': 'snakemake.params.md5... |
import flask
import random
import sys
import os
import glob
import re
from pathlib import Path
import pickle
import numpy as np
# Import fast.ai Library
from fastai import *
from fastai.vision import *
# Flask utils
from flask import Flask, redirect, url_for, request, render_template,jsonify
from werkzeug.utils impo... | [
"random.randint",
"flask.Flask",
"pathlib.Path",
"pickle.load",
"numpy.array",
"flask.request.get_json"
] | [((346, 367), 'flask.Flask', 'flask.Flask', (['__name__'], {}), '(__name__)\n', (357, 367), False, 'import flask\n'), ((409, 421), 'pathlib.Path', 'Path', (['"""path"""'], {}), "('path')\n", (413, 421), False, 'from pathlib import Path\n'), ((544, 558), 'pickle.load', 'pickle.load', (['f'], {}), '(f)\n', (555, 558), Fa... |
from __future__ import absolute_import, print_function, unicode_literals
from gripql.graph import Graph
from gripql.util import BaseConnection, raise_for_status
class Connection(BaseConnection):
def __init__(self, url, user=None, password=None, token=None, credential_file=None):
super(Connection, self)._... | [
"gripql.graph.Graph",
"gripql.util.raise_for_status"
] | [((568, 594), 'gripql.util.raise_for_status', 'raise_for_status', (['response'], {}), '(response)\n', (584, 594), False, 'from gripql.util import BaseConnection, raise_for_status\n'), ((825, 851), 'gripql.util.raise_for_status', 'raise_for_status', (['response'], {}), '(response)\n', (841, 851), False, 'from gripql.uti... |
#!/usr/bin/python3
"""This module defines a class to manage file storage for hbnb clone"""
import json
class FileStorage:
"""This class manages storage of hbnb models in JSON format"""
__file_path = 'file.json'
__objects = {}
def all(self, cls=None):
"""Returns a dictionary of models currentl... | [
"json.dump",
"json.load"
] | [((1198, 1216), 'json.dump', 'json.dump', (['temp', 'f'], {}), '(temp, f)\n', (1207, 1216), False, 'import json\n'), ((1911, 1923), 'json.load', 'json.load', (['f'], {}), '(f)\n', (1920, 1923), False, 'import json\n')] |
import time
from collections import defaultdict
from datetime import timedelta
import cvxpy as cp
import empiricalutilities as eu
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from tqdm import tqdm
from transfer_entropy import TransferEntropy
plt.style.use('fivethirtyei... | [
"pandas.read_csv",
"collections.defaultdict",
"cvxpy.sum",
"matplotlib.pyplot.style.use",
"empiricalutilities.save_fig",
"matplotlib.pyplot.tight_layout",
"cvxpy.Maximize",
"cvxpy.quad_form",
"pandas.DataFrame",
"datetime.timedelta",
"cvxpy.Problem",
"empiricalutilities.latex_figure",
"panda... | [((293, 325), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""fivethirtyeight"""'], {}), "('fivethirtyeight')\n", (306, 325), True, 'import matplotlib.pyplot as plt\n'), ((959, 989), 'transfer_entropy.TransferEntropy', 'TransferEntropy', ([], {'assets': 'assets'}), '(assets=assets)\n', (974, 989), False, 'from tr... |