code
stringlengths
22
1.05M
apis
listlengths
1
3.31k
extract_api
stringlengths
75
3.25M
from gym.envs.registration import register register( id='OdorEnvA-v0', entry_point='odor_env.odor_env:OdorEnvA' ) register( id='OdorEnvB-v0', entry_point='odor_env.odor_env:OdorEnvB' )
[ "gym.envs.registration.register" ]
[((44, 112), 'gym.envs.registration.register', 'register', ([], {'id': '"""OdorEnvA-v0"""', 'entry_point': '"""odor_env.odor_env:OdorEnvA"""'}), "(id='OdorEnvA-v0', entry_point='odor_env.odor_env:OdorEnvA')\n", (52, 112), False, 'from gym.envs.registration import register\n'), ((118, 186), 'gym.envs.registration.regist...
from py_cgr.py_cgr_lib.py_cgr_lib import * import zmq import time import sys import random import json import re import getopt argumentList = sys.argv[1:] # Options options = "hc" try: # Parsing argument arguments, values = getopt.getopt(argumentList, options) # checking each argument for currentAr...
[ "sys.exit", "getopt.getopt", "zmq.Context", "time.sleep" ]
[((722, 735), 'zmq.Context', 'zmq.Context', ([], {}), '()\n', (733, 735), False, 'import zmq\n'), ((236, 272), 'getopt.getopt', 'getopt.getopt', (['argumentList', 'options'], {}), '(argumentList, options)\n', (249, 272), False, 'import getopt\n'), ((1607, 1620), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (1617...
# -*- coding: iso-8859-1 -*- # ----------------------------------------------------------------------------- # core.py # ----------------------------------------------------------------------------- # $Id$ # # ----------------------------------------------------------------------------- # kaa-Metadata - Media Metadata ...
[ "logging.getLogger" ]
[((2121, 2150), 'logging.getLogger', 'logging.getLogger', (['"""metadata"""'], {}), "('metadata')\n", (2138, 2150), False, 'import logging\n')]
import sys import os import numpy as np import cv2 import json from collections import defaultdict import unittest import torch sys.path.insert(0, os.path.abspath('')) # Test files from current path rather than installed module from pymlutil.jsonutil import * test_config = 'test.yaml' class Test(unittest.TestCase): ...
[ "unittest.main", "os.path.abspath" ]
[((148, 167), 'os.path.abspath', 'os.path.abspath', (['""""""'], {}), "('')\n", (163, 167), False, 'import os\n'), ((774, 789), 'unittest.main', 'unittest.main', ([], {}), '()\n', (787, 789), False, 'import unittest\n')]
# -*- coding: utf-8 -*- """Test proxy digest authentication """ import unittest import requests import requests_toolbelt class TestProxyDigestAuth(unittest.TestCase): def setUp(self): self.username = "username" self.password = "password" self.auth = requests_toolbelt.auth.HTTPProxyDigest...
[ "unittest.main", "requests_toolbelt.auth.HTTPProxyDigestAuth", "requests.Request" ]
[((1210, 1225), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1223, 1225), False, 'import unittest\n'), ((282, 354), 'requests_toolbelt.auth.HTTPProxyDigestAuth', 'requests_toolbelt.auth.HTTPProxyDigestAuth', (['self.username', 'self.password'], {}), '(self.username, self.password)\n', (324, 354), False, 'import...
""" """ import sys import re import shutil import json if len(sys.argv) < 3: print('Not enough input arguments') exit() ################################################################################ # Options comment = {'begin':'<!--', 'end':'-->'} #######################################################...
[ "shutil.copyfile", "re.sub", "json.loads", "re.compile" ]
[((644, 665), 'json.loads', 'json.loads', (['json1_str'], {}), '(json1_str)\n', (654, 665), False, 'import json\n'), ((510, 564), 'shutil.copyfile', 'shutil.copyfile', (['out_file_path', "(out_file_path + '.tpl')"], {}), "(out_file_path, out_file_path + '.tpl')\n", (525, 564), False, 'import shutil\n'), ((930, 969), 'r...
from django.db import connection import numpy as np def getstudentcoursewisePLO(studentID, courseID): with connection.cursor() as cursor: cursor.execute(''' SELECT p.ploNum as plonum,100*(sum(e.obtainedMarks)/sum(a.totalMarks)) as plopercent FROM app_registration_t r, ...
[ "numpy.round", "numpy.array", "django.db.connection.cursor" ]
[((112, 131), 'django.db.connection.cursor', 'connection.cursor', ([], {}), '()\n', (129, 131), False, 'from django.db import connection\n'), ((930, 949), 'django.db.connection.cursor', 'connection.cursor', ([], {}), '()\n', (947, 949), False, 'from django.db import connection\n'), ((1672, 1691), 'django.db.connection....
# -*- coding: utf-8 -*- # Generated by Django 1.11.6 on 2018-05-17 15:50 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('taxonomy', '0009_boardprecinct_precinct_map'), ('da...
[ "django.db.models.ForeignKey" ]
[((512, 854), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'blank': '(True)', 'help_text': '"""<span>Select the primary location for the intity this site represents. This list is managed by the webmaster.</span>"""', 'null': '(True)', 'on_delete': 'django.db.models.deletion.PROTECT', 'related_name': '"""da...
from pathlib import Path from argparse import ArgumentParser from msdsl import MixedSignalModel, VerilogGenerator from msdsl.expr.extras import if_ def main(): print('Running model generator...') # parse command line arguments parser = ArgumentParser() parser.add_argument('-o', '--output', type=str, d...
[ "msdsl.expr.extras.if_", "argparse.ArgumentParser", "msdsl.MixedSignalModel", "pathlib.Path", "msdsl.VerilogGenerator" ]
[((250, 266), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (264, 266), False, 'from argparse import ArgumentParser\n'), ((456, 488), 'msdsl.MixedSignalModel', 'MixedSignalModel', (['"""osc"""'], {'dt': 'a.dt'}), "('osc', dt=a.dt)\n", (472, 488), False, 'from msdsl import MixedSignalModel, VerilogGener...
import random def partition(arr, left, right): l, r, tmp = left, right, arr[left] while l != r: while l < r and arr[r] >= tmp: r -= 1 while l < r and arr[l] <= tmp: l += 1 arr[l], arr[r] = arr[r], arr[l] arr[l], arr[left] = arr[left], arr[l] return l def quick_sort(arr, left, r...
[ "random.randint" ]
[((560, 599), 'random.randint', 'random.randint', (['range_left', 'range_right'], {}), '(range_left, range_right)\n', (574, 599), False, 'import random\n')]
# Scrap all the brick mosaics for PHAT import os from os.path import join as osjoin output = "/home/ekoch/bigdata/ekoch/M31/PHAT/" baseurl = "https://archive.stsci.edu/pub/hlsp/phat/" # This is easier than webscraping right now. brick_dict = {1: 12058, 2: 12073, 3: 12109, ...
[ "os.mkdir", "os.path.join", "os.chdir", "os.path.exists" ]
[((2053, 2080), 'os.path.join', 'osjoin', (['output', 'f"""brick{i}"""'], {}), "(output, f'brick{i}')\n", (2059, 2080), True, 'from os.path import join as osjoin\n'), ((2154, 2174), 'os.chdir', 'os.chdir', (['brick_path'], {}), '(brick_path)\n', (2162, 2174), False, 'import os\n'), ((2092, 2118), 'os.path.exists', 'os....
#Color dict import numpy as np # import wandb import cv2 import torch import os colors = { '0':[(128, 64, 128), (244, 35, 232), (0, 0, 230), (220, 190, 40), (70, 70, 70), (70, 130, 180), (0, 0, 0)], '1':[(128, 64, 128), (250, 170, 160), (244, 35, 232), (230, 150, 140), (220, 20, 60), (255, 0, 0), (0, 0, 230),...
[ "numpy.zeros" ]
[((1692, 1735), 'numpy.zeros', 'np.zeros', (['(mask.shape[0], mask.shape[1], 3)'], {}), '((mask.shape[0], mask.shape[1], 3))\n', (1700, 1735), True, 'import numpy as np\n')]
''' Contains the NetSnmp() class Typical contents of file /proc/net/snmp:: Ip: Forwarding DefaultTTL InReceives InHdrErrors InAddrErrors ForwDatagrams InUnknownProtos InDiscards InDelivers OutRequests OutDiscards OutNoRoutes ReasmTimeout ReasmReqds ReasmOKs ReasmFails FragOKs FragFails FragCreates Ip:...
[ "os.path.join", "logging.getLogger" ]
[((1416, 1435), 'logging.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (1425, 1435), False, 'from logging import getLogger\n'), ((1515, 1549), 'os.path.join', 'ospath.join', (['"""proc"""', '"""net"""', '"""snmp"""'], {}), "('proc', 'net', 'snmp')\n", (1526, 1549), True, 'from os import path as ospath\n'...
""" @author: <NAME>, Energy Information Networks & Systems @ TU Darmstadt """ import numpy as np import tensorflow as tf from models.igc import ImplicitGenerativeCopula, GMMNCopula from models.utils import cdf_interpolator import pyvinecopulib as pv from models import mv_copulas import matplotlib.pyplot as plt class...
[ "models.mv_copulas.GaussianCopula", "numpy.random.uniform", "matplotlib.pyplot.subplot", "numpy.zeros_like", "tensorflow.keras.models.load_model", "models.igc.GMMNCopula", "pyvinecopulib.FitControlsVinecop", "matplotlib.pyplot.suptitle", "models.igc.ImplicitGenerativeCopula", "numpy.sort", "matp...
[((1004, 1020), 'numpy.zeros_like', 'np.zeros_like', (['z'], {}), '(z)\n', (1017, 1020), True, 'import numpy as np\n'), ((1203, 1219), 'numpy.zeros_like', 'np.zeros_like', (['u'], {}), '(u)\n', (1216, 1219), True, 'import numpy as np\n'), ((2538, 2565), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(16, 3...
import socket import Constants # Create a TCP/IP socket socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) socket.bind(('', 1339)) socket.listen(1) while True: connection, client_address = socket.accept() print('connection from', client_address) while True: # noinspection PyBroadException...
[ "socket.bind", "socket.accept", "socket.socket", "socket.listen" ]
[((66, 115), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (79, 115), False, 'import socket\n'), ((116, 139), 'socket.bind', 'socket.bind', (["('', 1339)"], {}), "(('', 1339))\n", (127, 139), False, 'import socket\n'), ((141, 157), 'socket.li...
#! /usr/bin/env python # -*- coding: utf-8 -*- """ Readqc report: record stat key-value in readqc-stats.txt ### JGI_Analysis_Utility_Illumina::illumina_read_level_report Created: Jul 24 2013 sulsj (<EMAIL>) """ import os import sys ## custom libs in "../lib/" srcDir = os.path.dirname(__file__) sys.path.appe...
[ "common.append_rqc_stats", "os.path.dirname", "os.path.isfile", "os_utility.run_sh_command", "os.path.join" ]
[((281, 306), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (296, 306), False, 'import os\n'), ((323, 352), 'os.path.join', 'os.path.join', (['srcDir', '"""tools"""'], {}), "(srcDir, 'tools')\n", (335, 352), False, 'import os\n'), ((385, 415), 'os.path.join', 'os.path.join', (['srcDir', '"""...
# Copyright (C) 2014 Universidad Politecnica de Madrid # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
[ "unittest.skip", "openstack_dashboard.test.helpers.create_stubs", "django.core.urlresolvers.reverse", "mox.IsA" ]
[((984, 1026), 'django.core.urlresolvers.reverse', 'reverse', (['"""horizon:idm:organizations:index"""'], {}), "('horizon:idm:organizations:index')\n", (991, 1026), False, 'from django.core.urlresolvers import reverse\n'), ((1040, 1083), 'django.core.urlresolvers.reverse', 'reverse', (['"""horizon:idm:organizations:cre...
import sys from sys import argv, exit import os from os import linesep from getopt import getopt, GetoptError import re import socks from getpass import getuser ERROR_ILLEGAL_ARGUMENTS = 2 def usage(error_message=None): if error_message: sys.stderr.write('ERROR: ' + error_message + linesep) sys.stdo...
[ "os.path.abspath", "getpass.getuser", "getopt.getopt", "os.path.exists", "os.linesep.join", "sys.stderr.write", "re.search", "sys.exit" ]
[((7751, 7788), 're.search', 're.search', (['pattern', 'connection_string'], {}), '(pattern, connection_string)\n', (7760, 7788), False, 'import re\n'), ((8997, 9027), 're.search', 're.search', (['_SFTP_PATTERN', 'sftp'], {}), '(_SFTP_PATTERN, sftp)\n', (9006, 9027), False, 'import re\n'), ((9060, 9090), 're.search', '...
# -*- coding: utf-8 -*- from flexipy import Faktura from flexipy import config import requests import json class TestFaktura: def setup(self): self.conf = config.TestingConfig() server_settings = self.conf.get_server_config() self.username = str(server_settings['username']) self.password = str(server_settin...
[ "flexipy.Faktura", "flexipy.config.TestingConfig", "requests.get" ]
[((161, 183), 'flexipy.config.TestingConfig', 'config.TestingConfig', ([], {}), '()\n', (181, 183), False, 'from flexipy import config\n'), ((394, 412), 'flexipy.Faktura', 'Faktura', (['self.conf'], {}), '(self.conf)\n', (401, 412), False, 'from flexipy import Faktura\n'), ((460, 562), 'requests.get', 'requests.get', (...
""" This module contains methods/objects that facilitate basic operations. """ # std pkgs import numpy as np import random from typing import Dict, List, Optional, Union from pathlib import Path import pickle # non-std pkgs import matplotlib.pyplot as plt def hamming_dist(k1, k2): val = 0 for ind, char in e...
[ "pickle.load", "random.choice", "numpy.random.choice" ]
[((2668, 2688), 'pickle.load', 'pickle.load', (['hash_tb'], {}), '(hash_tb)\n', (2679, 2688), False, 'import pickle\n'), ((856, 901), 'numpy.random.choice', 'np.random.choice', (["['N', 'D']", '(1)'], {'p': '[0.5, 0.5]'}), "(['N', 'D'], 1, p=[0.5, 0.5])\n", (872, 901), True, 'import numpy as np\n'), ((956, 1001), 'nump...
import asyncio import logging import uuid import ssl from gmqtt import Client as MQTTClient from .exceptions import ConnectionFailed, DestinationNotAvailable from .base import BaseConnector logger = logging.getLogger(__name__) class GMQTTConnector(BaseConnector): """GMQTTConnector uses gmqtt library for conne...
[ "ssl.SSLContext", "uuid.uuid4", "gmqtt.Client", "asyncio.Event", "logging.getLogger" ]
[((203, 230), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (220, 230), False, 'import logging\n'), ((722, 752), 'gmqtt.Client', 'MQTTClient', (['self.connection_id'], {}), '(self.connection_id)\n', (732, 752), True, 'from gmqtt import Client as MQTTClient\n'), ((1000, 1015), 'asyncio.Ev...
import matplotlib.pyplot as plt from hyperion.model import ModelOutput from hyperion.util.constants import pc mo = ModelOutput('pure_scattering.rtout') image_fnu = mo.get_image(inclination=0, units='MJy/sr', distance=300. * pc) image_pol = mo.get_image(inclination=0, stokes='linpol') fig = plt.figure(figsize=(8, 8))...
[ "hyperion.model.ModelOutput", "matplotlib.pyplot.figure", "matplotlib.pyplot.colorbar" ]
[((116, 152), 'hyperion.model.ModelOutput', 'ModelOutput', (['"""pure_scattering.rtout"""'], {}), "('pure_scattering.rtout')\n", (127, 152), False, 'from hyperion.model import ModelOutput\n'), ((294, 320), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(8, 8)'}), '(figsize=(8, 8))\n', (304, 320), True, 'im...
"""Day 4: Giant Squid""" import sys, os, inspect # necessary to import aoc2021/utils.py moudule currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(currentdir) sys.path.insert(1, os.path.join(sys.path[0], '..')) import utils exampledata = ['0,9 -> 5,9'...
[ "os.path.dirname", "os.path.join", "utils.loadinput", "inspect.currentframe" ]
[((199, 226), 'os.path.dirname', 'os.path.dirname', (['currentdir'], {}), '(currentdir)\n', (214, 226), False, 'import sys, os, inspect\n'), ((246, 277), 'os.path.join', 'os.path.join', (['sys.path[0]', '""".."""'], {}), "(sys.path[0], '..')\n", (258, 277), False, 'import sys, os, inspect\n'), ((3679, 3707), 'utils.loa...
import numpy as np import cv2 import os from glob import glob from tqdm import tqdm img_h, img_w = 256, 256 means, stdevs = [], [] img_list = [] TRAIN_DATASET_PATH = 'data/Real/subset/train/B' image_fns = glob(os.path.join(TRAIN_DATASET_PATH, '*.*')) for single_img_path in tqdm(image_fns): img = cv2.imread(sing...
[ "tqdm.tqdm", "numpy.concatenate", "numpy.std", "cv2.imread", "numpy.mean", "os.path.join", "cv2.resize" ]
[((278, 293), 'tqdm.tqdm', 'tqdm', (['image_fns'], {}), '(image_fns)\n', (282, 293), False, 'from tqdm import tqdm\n'), ((444, 476), 'numpy.concatenate', 'np.concatenate', (['img_list'], {'axis': '(3)'}), '(img_list, axis=3)\n', (458, 476), True, 'import numpy as np\n'), ((213, 252), 'os.path.join', 'os.path.join', (['...
# -*- coding: utf-8 -*- import tensorflow as tf # 【该方法测试的时候使用】返回一个方法。这个方法根据输入的值,得到对应的索引,再得到这个词的embedding. def extract_argmax_and_embed(embedding, output_projection=None): """ Get a loop_function that extracts the previous symbol and embeds it. Used by decoder. :param embedding: embedding tensor for symbol ...
[ "tensorflow.nn.softmax", "tensorflow.reduce_sum", "tensorflow.nn.tanh", "tensorflow.argmax", "tensorflow.gather", "tensorflow.reshape", "tensorflow.get_variable_scope", "tensorflow.variable_scope", "tensorflow.matmul", "tensorflow.multiply", "tensorflow.random_normal_initializer", "tensorflow....
[((671, 689), 'tensorflow.argmax', 'tf.argmax', (['prev', '(1)'], {}), '(prev, 1)\n', (680, 689), True, 'import tensorflow as tf\n'), ((721, 754), 'tensorflow.gather', 'tf.gather', (['embedding', 'prev_symbol'], {}), '(embedding, prev_symbol)\n', (730, 754), True, 'import tensorflow as tf\n'), ((2771, 2812), 'tensorflo...
# Generated by Django 2.2.14 on 2020-09-26 06:38 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('users', '0024_auto_20200914_0433'), ] operations = [ migrations.AlterModelOptions( name='profile', options={'permissions': ...
[ "django.db.migrations.AlterModelOptions" ]
[((226, 400), 'django.db.migrations.AlterModelOptions', 'migrations.AlterModelOptions', ([], {'name': '"""profile"""', 'options': "{'permissions': (('view_karma_points', 'Can view karma points'), (\n 'deactivate_users', 'Can deactivate users'))}"}), "(name='profile', options={'permissions': ((\n 'view_karma_point...
# ###################################################################### # Copyright (c) 2014, Brookhaven Science Associates, Brookhaven # # National Laboratory. All rights reserved. # # # # Redistribution and use in ...
[ "numpy.zeros", "logging.getLogger", "six.iterkeys" ]
[((2744, 2771), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (2761, 2771), False, 'import logging\n'), ((4791, 4823), 'numpy.zeros', 'np.zeros', (['(num_keys, num_coords)'], {}), '((num_keys, num_coords))\n', (4799, 4823), True, 'import numpy as np\n'), ((4341, 4365), 'six.iterkeys', 's...
import matplotlib.pyplot as plt import numpy as np import pandas as pd from pathlib import Path import re import io loss = Path.cwd().parent.joinpath('savefiles', 'checkpoints', 'loss.log').read_text() loss = re.sub(r'[\]\[]', '', loss) df = pd.read_csv(io.StringIO(loss), names=['epoch', 'iteration', 'cls_loss', 'box...
[ "io.StringIO", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "pathlib.Path.cwd", "re.sub" ]
[((211, 239), 're.sub', 're.sub', (['"""[\\\\]\\\\[]"""', '""""""', 'loss'], {}), "('[\\\\]\\\\[]', '', loss)\n", (217, 239), False, 'import re\n'), ((256, 273), 'io.StringIO', 'io.StringIO', (['loss'], {}), '(loss)\n', (267, 273), False, 'import io\n'), ((547, 572), 'matplotlib.pyplot.plot', 'plt.plot', (['x', 'y_cls'...
import math import numpy as np from uam_simulator import my_utils from uam_simulator import pathPlanning from uam_simulator import orca import gurobipy as grb from gurobipy import GRB import time as python_time class Flightplan: def __init__(self, t0, dt, positions, times=None): self.start_time = t0 ...
[ "math.asin", "math.atan2", "math.copysign", "numpy.linalg.norm", "uam_simulator.pathPlanning.AStar_8grid", "numpy.copy", "numpy.arcsin", "math.cos", "math.ceil", "uam_simulator.orca.ORCA", "numpy.asarray", "gurobipy.Model", "math.sin", "numpy.dot", "math.floor", "uam_simulator.my_utils...
[((25063, 25086), 'numpy.linalg.norm', 'np.linalg.norm', (['rel_pos'], {}), '(rel_pos)\n', (25077, 25086), True, 'import numpy as np\n'), ((25344, 25379), 'math.asin', 'math.asin', (['(ownship_agent.radius / d)'], {}), '(ownship_agent.radius / d)\n', (25353, 25379), False, 'import math\n'), ((25420, 25454), 'math.atan2...
# %% import os import matplotlib.pyplot as plt # %% 設定 datasets = ['hariko/scripts',] # %% "「" を含む行数をカウントする関数 def count_kakko(f_path): '''行数と "「" を含む行数を取得する parameters ---------- f_path : str 調査するファイルのパス名 returns ------- lines : int ファイルの行数 lines_with_kakko ...
[ "matplotlib.pyplot.scatter", "os.path.isfile", "os.path.join", "os.listdir" ]
[((942, 959), 'matplotlib.pyplot.scatter', 'plt.scatter', (['x', 'y'], {}), '(x, y)\n', (953, 959), True, 'import matplotlib.pyplot as plt\n'), ((1012, 1040), 'matplotlib.pyplot.scatter', 'plt.scatter', (['x', 'y'], {'alpha': '(0.3)'}), '(x, y, alpha=0.3)\n', (1023, 1040), True, 'import matplotlib.pyplot as plt\n'), ((...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Toolset implementation for tpDcc-tools-unittests """ from __future__ import print_function, division, absolute_import from tpDcc.libs.qt.widgets import toolset class UnitTestsToolsetWidget(toolset.ToolsetWidget, object): def __init__(self, *args, **kwargs): ...
[ "tpDcc.tools.unittests.core.model.UnitTestModel", "tpDcc.tools.unittests.core.view.UnitTestView", "tpDcc.tools.unittests.core.controller.UnitTestController" ]
[((659, 680), 'tpDcc.tools.unittests.core.model.UnitTestModel', 'model.UnitTestModel', ([], {}), '()\n', (678, 680), False, 'from tpDcc.tools.unittests.core import model, view, controller\n'), ((712, 785), 'tpDcc.tools.unittests.core.controller.UnitTestController', 'controller.UnitTestController', ([], {'client': 'self...
import random import time import numpy as np import copy from itertools import compress random.seed(123) #remove columns from adj matrix. #TODO needs additional scaling? #Be carefull too not modify the initial complete support matrix def get_sub_sampled_support(complete_support, node_to_keep): index_array = comp...
[ "numpy.isin", "numpy.sum", "numpy.zeros", "random.seed", "numpy.argwhere" ]
[((89, 105), 'random.seed', 'random.seed', (['(123)'], {}), '(123)\n', (100, 105), False, 'import random\n'), ((403, 438), 'numpy.zeros', 'np.zeros', (['complete_support[1].shape'], {}), '(complete_support[1].shape)\n', (411, 438), True, 'import numpy as np\n'), ((1324, 1370), 'numpy.zeros', 'np.zeros', (['initial_trai...
# MIT License # # Copyright (c) 2021 <NAME> and <NAME> and <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy...
[ "openspeech.datasets.librispeech.preprocess.preprocess.collect_transcripts", "os.path.join", "sentencepiece.SentencePieceProcessor", "sentencepiece.SentencePieceTrainer.Train" ]
[((1623, 1857), 'sentencepiece.SentencePieceTrainer.Train', 'spm.SentencePieceTrainer.Train', (['f"""--input={input_file} --model_prefix={SENTENCEPIECE_MODEL_NAME} --vocab_size={vocab_size} --model_type={model_type} --pad_id=0 --bos_id=1 --eos_id=2 --unk_id=3 --user_defined_symbols=<blank>"""'], {}), "(\n f'--input=...
import sys from math import pi from openmdao.api import Problem, Group, Component, IndepVarComp, ExecComp, \ ScipyOptimizer, SubProblem, CaseDriver class MultiMinGroup(Group): """ In the range -pi <= x <= pi function has 2 local minima, one is global global min is: f(x) =...
[ "openmdao.api.IndepVarComp", "openmdao.api.ExecComp", "openmdao.api.ScipyOptimizer", "openmdao.api.CaseDriver", "openmdao.api.Group", "openmdao.api.SubProblem" ]
[((823, 839), 'openmdao.api.ScipyOptimizer', 'ScipyOptimizer', ([], {}), '()\n', (837, 839), False, 'from openmdao.api import Problem, Group, Component, IndepVarComp, ExecComp, ScipyOptimizer, SubProblem, CaseDriver\n'), ((1994, 2029), 'openmdao.api.CaseDriver', 'CaseDriver', ([], {'num_par_doe': 'num_par_doe'}), '(num...
# utilitary functions to create the expert and volunteers oracles from the taskruns dataset import pandas as pd from modules.utils import aux_functions from modules.utils import firefox_dataset_p2 as fd class Br_Feat_Oracle_Creator: def __init__(self, bugreports, features): self.bugreports = bugrepo...
[ "pandas.DataFrame", "modules.utils.firefox_dataset_p2.Feat_BR_Oracles.write_feat_br_expert_2_df", "modules.utils.firefox_dataset_p2.Feat_BR_Oracles.write_feat_br_volunteers_df", "modules.utils.firefox_dataset_p2.Feat_BR_Oracles.write_feat_br_expert_df", "pandas.concat" ]
[((1011, 1102), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': 'self.features.feat_name.values', 'index': 'self.bugreports.Bug_Number'}), '(columns=self.features.feat_name.values, index=self.bugreports.\n Bug_Number)\n', (1023, 1102), True, 'import pandas as pd\n'), ((1678, 1736), 'modules.utils.firefox_datase...
''' precision_and_recall.py Run MATCH with PeTaL data. Last modified on 10 August 2021. DESCRIPTION precision_and_recall.py produces three plots from results in MATCH/PeTaL. These three plots appear in plots/YYYYMMDD_precision_recall and are as follows: - HHMMSS_label...
[ "matplotlib.pyplot.title", "os.mkdir", "numpy.load", "matplotlib.pyplot.clf", "numpy.argmax", "click.option", "logging.getLogger", "numpy.mean", "click.Path", "os.path.join", "os.path.exists", "click.command", "datetime.datetime.now", "tqdm.tqdm", "matplotlib.pyplot.ylim", "matplotlib....
[((1459, 1516), 'collections.namedtuple', 'namedtuple', (['"""Stats"""', '"""threshold topk precision recall f1"""'], {}), "('Stats', 'threshold topk precision recall f1')\n", (1469, 1516), False, 'from collections import namedtuple\n'), ((1519, 1534), 'click.command', 'click.command', ([], {}), '()\n', (1532, 1534), F...
####################데이터프레임의 문자열 컬럼들을 합치는 등의 작업으로 새로운 컬럼 생성####################################### #이용함수 apply import pandas as pd import numpy as np from pandas import DataFrame, Series # df = pd.DataFrame({'id' : [1,2,10,20,100,200], # "name":['aaa','bbb','ccc','ddd','eee','fff']}) # print(df) # ...
[ "numpy.arange", "pandas.Series" ]
[((5890, 5901), 'pandas.Series', 'Series', (['mdr'], {}), '(mdr)\n', (5896, 5901), False, 'from pandas import DataFrame, Series\n'), ((6222, 6233), 'pandas.Series', 'Series', (['mdc'], {}), '(mdc)\n', (6228, 6233), False, 'from pandas import DataFrame, Series\n'), ((4245, 4258), 'numpy.arange', 'np.arange', (['(20)'], ...
# -*- coding: utf-8 -*- # Copyright 2016 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...
[ "tensorflow.app.flags.DEFINE_float", "yaml.load", "click.option", "collections.defaultdict", "numpy.argsort", "matplotlib.pyplot.figure", "numpy.interp", "tensorflow.app.flags.DEFINE_integer", "cv2.cvtColor", "matplotlib.pyplot.imshow", "datasets.dataset_factory.get_dataset", "numpy.max", "t...
[((33480, 33493), 'click.group', 'click.group', ([], {}), '()\n', (33491, 33493), False, 'import click\n'), ((33532, 33561), 'click.argument', 'click.argument', (['"""config_file"""'], {}), "('config_file')\n", (33546, 33561), False, 'import click\n'), ((33563, 33605), 'click.option', 'click.option', (['"""--use_cached...
from app import app with app.test_client() as c: response= c.get('/') assert response.data == b'Hello World!' assert response.status_code==200
[ "app.app.test_client" ]
[((25, 42), 'app.app.test_client', 'app.test_client', ([], {}), '()\n', (40, 42), False, 'from app import app\n')]
"""Module to test assessment_status""" from __future__ import unicode_literals # isort:skip from datetime import datetime from random import choice from string import ascii_letters from dateutil.relativedelta import relativedelta from flask_webtest import SessionScope import pytest from sqlalchemy.orm.exc import NoR...
[ "portal.models.questionnaire_bank.QuestionnaireBank", "datetime.datetime.utcnow", "portal.models.identifier.Identifier", "portal.models.encounter.Encounter", "portal.models.organization.Organization.query.filter", "portal.models.qb_status.QB_Status", "portal.extensions.db.session.merge", "portal.model...
[((1378, 1395), 'datetime.datetime.utcnow', 'datetime.utcnow', ([], {}), '()\n', (1393, 1395), False, 'from datetime import datetime\n'), ((2117, 2221), 'portal.models.encounter.Encounter', 'Encounter', ([], {'status': '"""planned"""', 'auth_method': '"""url_authenticated"""', 'user_id': 'user_id', 'start_time': 'times...
''' File: \resource.py Project: NumberRecongization Created Date: Monday March 26th 2018 Author: Huisama ----- Last Modified: Saturday March 31st 2018 11:08:21 pm Modified By: Huisama ----- Copyright (c) 2018 Hui ''' import os import scipy.misc as scm import random import numpy as np import PIL # STD_WIDTH = 667 # S...
[ "numpy.dstack", "random.shuffle", "os.walk", "random.choice", "numpy.array", "os.path.splitext", "scipy.misc.imresize", "os.path.join", "scipy.misc.imread" ]
[((1508, 1535), 'scipy.misc.imread', 'scm.imread', (['image_file_path'], {}), '(image_file_path)\n', (1518, 1535), True, 'import scipy.misc as scm\n'), ((3505, 3534), 'random.shuffle', 'random.shuffle', (['self.neg_data'], {}), '(self.neg_data)\n', (3519, 3534), False, 'import random\n'), ((3543, 3572), 'random.shuffle...
import os import json import sys from tqdm import tqdm from evaluation.mesh_utils import read_obj, read_ply, calculate_face_area, compute_face_centers, \ nearest_neighbour_of_face_centers from iou_calculations import * # BuildNet directories BUILDNET_BASE_DIR = os.path.join(os.sep, "media", "maria", "BigData1", "M...
[ "json.dump", "tqdm.tqdm", "json.load", "os.makedirs", "os.path.isdir", "evaluation.mesh_utils.nearest_neighbour_of_face_centers", "os.path.isfile", "evaluation.mesh_utils.compute_face_centers", "evaluation.mesh_utils.calculate_face_area", "os.path.join" ]
[((267, 346), 'os.path.join', 'os.path.join', (['os.sep', '"""media"""', '"""maria"""', '"""BigData1"""', '"""Maria"""', '"""buildnet_data_2k"""'], {}), "(os.sep, 'media', 'maria', 'BigData1', 'Maria', 'buildnet_data_2k')\n", (279, 346), False, 'import os\n'), ((355, 387), 'os.path.isdir', 'os.path.isdir', (['BUILDNET_...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ "math.log" ]
[((3163, 3186), 'math.log', 'math.log', (['(range_max + 1)'], {}), '(range_max + 1)\n', (3171, 3186), False, 'import math\n')]
# 1.3: (intended?) Behavior change with empty apply #41997 import pandas as pd print(pd.__version__) df = pd.DataFrame(columns=["a", "b"]) df["a"] = df.apply(lambda x: x["a"], axis=1) print(df)
[ "pandas.DataFrame" ]
[((109, 141), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': "['a', 'b']"}), "(columns=['a', 'b'])\n", (121, 141), True, 'import pandas as pd\n')]
from random import randint from threading import Event from unittest.mock import patch, MagicMock from uuid import uuid4 import pytest from pyzeebe import ZeebeClient, ZeebeWorker, ZeebeTaskRouter, Job from pyzeebe.grpc_internals.zeebe_adapter import ZeebeAdapter from pyzeebe.task.task import Task from pyzeebe.worker...
[ "unittest.mock.patch.object", "uuid.uuid4", "unittest.mock.MagicMock", "random.randint", "pyzeebe.ZeebeTaskRouter", "pytest.fixture", "tests.unit.utils.random_utils.random_job", "tests.unit.utils.gateway_mock.GatewayMock", "pyzeebe.worker.task_handler.ZeebeTaskHandler", "unittest.mock.patch", "t...
[((2206, 2236), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (2220, 2236), False, 'import pytest\n'), ((2381, 2411), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (2395, 2411), False, 'import pytest\n'), ((2461, 2491), 'pytest.fi...
import tensorflow as tf import numpy as np # training set. Contains a row of size 5 per train example. The row is same as a sentence, with words replaced # by its equivalent unique index. The below dataset contains 6 unique words numbered 0-5. Ideally the word vector for # 4 and 5 indexed words should be same. X_trai...
[ "tensorflow.random_uniform", "tensorflow.nn.embedding_lookup", "tensorflow.global_variables_initializer", "tensorflow.Session", "numpy.array", "tensorflow.name_scope", "tensorflow.expand_dims" ]
[((324, 368), 'numpy.array', 'np.array', (['[[0, 1, 4, 2, 3], [0, 1, 5, 2, 3]]'], {}), '([[0, 1, 4, 2, 3], [0, 1, 5, 2, 3]])\n', (332, 368), True, 'import numpy as np\n'), ((406, 422), 'numpy.array', 'np.array', (['[0, 1]'], {}), '([0, 1])\n', (414, 422), True, 'import numpy as np\n'), ((453, 480), 'tensorflow.name_sco...
import matplotlib.pyplot as plt import yfinance as yf #To access the financial data available on Yahoo Finance import numpy as np def get_stock_data(tickerSymbol, start_date, end_date): tickerData = yf.Ticker(tickerSymbol) df_ticker = tickerData.history(period='1d', start=start_date, end=end_date) return...
[ "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.subplots", "matplotlib.pyplot.axis", "yfinance.Ticker" ]
[((206, 229), 'yfinance.Ticker', 'yf.Ticker', (['tickerSymbol'], {}), '(tickerSymbol)\n', (215, 229), True, 'import yfinance as yf\n'), ((824, 838), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (836, 838), True, 'import matplotlib.pyplot as plt\n'), ((992, 1007), 'matplotlib.pyplot.axis', 'plt.axis',...
import cv2 image=cv2.imread(r'md.jpg',flags=1) print(image[0:100,0:100]) #Changes pixel value in the original images #image[0:100,0:100]=255#fully white image[0:100,0:100]=[165,42,42]#RGB format cv2.imshow('New Image',image) cv2.waitKey(0) cv2.destroyAllWindows()
[ "cv2.waitKey", "cv2.imread", "cv2.imshow", "cv2.destroyAllWindows" ]
[((17, 46), 'cv2.imread', 'cv2.imread', (['"""md.jpg"""'], {'flags': '(1)'}), "('md.jpg', flags=1)\n", (27, 46), False, 'import cv2\n'), ((195, 225), 'cv2.imshow', 'cv2.imshow', (['"""New Image"""', 'image'], {}), "('New Image', image)\n", (205, 225), False, 'import cv2\n'), ((225, 239), 'cv2.waitKey', 'cv2.waitKey', (...
# Verified on https://leetcode.com/problems/implement-strstr import string from functools import lru_cache @lru_cache(maxsize=None) def get_char_code(ch, char_set=string.ascii_letters + string.digits): # We could have also used: # return ord(ch) - ord('0') return char_set.index(ch) def rabin_karp(haysta...
[ "functools.lru_cache" ]
[((110, 133), 'functools.lru_cache', 'lru_cache', ([], {'maxsize': 'None'}), '(maxsize=None)\n', (119, 133), False, 'from functools import lru_cache\n')]
from bs4 import BeautifulSoup from black_list.items import BLICEFugitivesListItem from scrapy import Spider, Request import os class BlIcefugitiveslistSpider(Spider): name = 'BL_ICEFugitivesList' allowed_domains = ['www.ice.gov'] start_urls = ['https://www.ice.gov/most-wanted'] header = 'Name|Status|O...
[ "bs4.BeautifulSoup", "os.path.abspath", "black_list.items.BLICEFugitivesListItem", "scrapy.Request" ]
[((615, 651), 'bs4.BeautifulSoup', 'BeautifulSoup', (['response.body', '"""lxml"""'], {}), "(response.body, 'lxml')\n", (628, 651), False, 'from bs4 import BeautifulSoup\n'), ((988, 1024), 'bs4.BeautifulSoup', 'BeautifulSoup', (['response.body', '"""lxml"""'], {}), "(response.body, 'lxml')\n", (1001, 1024), False, 'fro...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # --------------------------------------------------------------------- # Copyright (c) <NAME> [~º/~] and Contributors # All rights reserved. # # This is free software; you can do what the LICENCE file allows you to. # '''The query language core. ''' import ast import t...
[ "xotl.ql.revenge.Uncompyled", "xoutil.objects.import_object", "xoutil.objects.copy_class" ]
[((2590, 2611), 'xotl.ql.revenge.Uncompyled', 'Uncompyled', (['generator'], {}), '(generator)\n', (2600, 2611), False, 'from xotl.ql.revenge import Uncompyled\n'), ((2668, 2693), 'xoutil.objects.import_object', 'import_object', (['query_type'], {}), '(query_type)\n', (2681, 2693), False, 'from xoutil.objects import imp...
# copyright (c) 2018 Larz60+ import ScraperPaths import GetPage import CIA_ScanTools from lxml import html from lxml.cssselect import CSSSelector from lxml import etree from lxml.etree import XPath import re import os import sys class CIA_InternationalOrgnizationsAndGroups: def __init__(self): self.spath...
[ "lxml.html.tostring", "lxml.html.fromstring", "GetPage.GetPage", "ScraperPaths.ScraperPaths", "CIA_ScanTools.CIA_Scan_Tools" ]
[((323, 350), 'ScraperPaths.ScraperPaths', 'ScraperPaths.ScraperPaths', ([], {}), '()\n', (348, 350), False, 'import ScraperPaths\n'), ((369, 386), 'GetPage.GetPage', 'GetPage.GetPage', ([], {}), '()\n', (384, 386), False, 'import GetPage\n'), ((495, 525), 'CIA_ScanTools.CIA_Scan_Tools', 'CIA_ScanTools.CIA_Scan_Tools',...
# Copyright 2017 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
[ "copy.deepcopy" ]
[((4947, 4983), 'copy.deepcopy', 'copy.deepcopy', (['servers247.get_server'], {}), '(servers247.get_server)\n', (4960, 4983), False, 'import copy\n')]
# Generated by Django 2.1.2 on 2018-12-03 10:19 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('oferty', '0011_ofertyest_kto_prowadzi'), ] operations = [ migrations.AlterField( model_name='of...
[ "django.db.models.ForeignKey" ]
[((381, 484), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'null': '(True)', 'on_delete': 'django.db.models.deletion.SET_NULL', 'to': '"""oferty.OfertyUsers"""'}), "(null=True, on_delete=django.db.models.deletion.SET_NULL,\n to='oferty.OfertyUsers')\n", (398, 484), False, 'from django.db import migratio...
from compositecore import Leaf import menu import state __author__ = 'co' def start_accept_reject_prompt(state_stack, game_state, message): prompt = menu.AcceptRejectPrompt(state_stack, message) game_state.start_prompt(state.UIState(prompt)) return prompt.result class PromptPlayer(Leaf): def __init...
[ "state.UIState", "menu.AcceptRejectPrompt" ]
[((156, 201), 'menu.AcceptRejectPrompt', 'menu.AcceptRejectPrompt', (['state_stack', 'message'], {}), '(state_stack, message)\n', (179, 201), False, 'import menu\n'), ((230, 251), 'state.UIState', 'state.UIState', (['prompt'], {}), '(prompt)\n', (243, 251), False, 'import state\n')]
import pytest from insights.core.dr import SkipComponent from insights.parsers.ntp_sources import ChronycSources, NtpqPn, NtpqLeap from insights.tests import context_wrap chrony_output = """ 210 Number of sources = 3 MS Name/IP address Stratum Poll Reach LastRx Last sample =============================================...
[ "insights.tests.context_wrap", "pytest.raises" ]
[((1442, 1469), 'insights.tests.context_wrap', 'context_wrap', (['chrony_output'], {}), '(chrony_output)\n', (1454, 1469), False, 'from insights.tests import context_wrap\n'), ((1691, 1721), 'insights.tests.context_wrap', 'context_wrap', (['ntpq_leap_output'], {}), '(ntpq_leap_output)\n', (1703, 1721), False, 'from ins...
#! /usr/bin/env python -*- coding: utf-8 -*- """ Name: exif_view.py Desscription: Display any EXIF data attached to the image. Version: 1 - Initial release Author: J.MacGrillen <<EMAIL>> Copyright: Copyright (c) <NAME>. All rights reserved. """ import logging ...
[ "src.tools.exif_data.EXIFData" ]
[((538, 562), 'src.tools.exif_data.EXIFData', 'EXIFData', (['self.pil_image'], {}), '(self.pil_image)\n', (546, 562), False, 'from src.tools.exif_data import EXIFData\n')]
from torchvision.datasets import CIFAR100 as C100 import torchvision.transforms as T from .transforms import MultiSample, aug_transform from .base import BaseDataset def base_transform(): return T.Compose( [T.ToTensor(), T.Normalize((0.5071, 0.4867, 0.4408), (0.2675, 0.2565, 0.2761))] ) class CIFAR1...
[ "torchvision.transforms.Normalize", "torchvision.datasets.CIFAR100", "torchvision.transforms.ToTensor" ]
[((499, 558), 'torchvision.datasets.CIFAR100', 'C100', ([], {'root': '"""./data"""', 'train': '(True)', 'download': '(True)', 'transform': 't'}), "(root='./data', train=True, download=True, transform=t)\n", (503, 558), True, 'from torchvision.datasets import CIFAR100 as C100\n'), ((627, 686), 'torchvision.datasets.CIFA...
import time import aws_scatter_gather.util.logger as logger def trace(message, *args): return Trace(message, *args) def traced(f): def wrapper(*args, **kwargs): with trace("{} args={}, kwargs={}", f.__name__, [*args], {**kwargs}): return f(*args, **kwargs) return wrapper class Tr...
[ "time.time_ns" ]
[((465, 479), 'time.time_ns', 'time.time_ns', ([], {}), '()\n', (477, 479), False, 'import time\n'), ((627, 641), 'time.time_ns', 'time.time_ns', ([], {}), '()\n', (639, 641), False, 'import time\n')]
import unittest from slgnn.data_processing.pyg_datasets import JAK1Dude, JAK2Dude, JAK3Dude from slgnn.config import FILTERED_PUBCHEM_FP_LEN class TestDudeDatasets(unittest.TestCase): def test_jak1_jak2_jak3(self): jak = JAK1Dude() data = jak[0] self.assertEqual(data.x.size()[1], 6) ...
[ "slgnn.data_processing.pyg_datasets.JAK2Dude", "slgnn.data_processing.pyg_datasets.JAK1Dude", "slgnn.data_processing.pyg_datasets.JAK3Dude" ]
[((236, 246), 'slgnn.data_processing.pyg_datasets.JAK1Dude', 'JAK1Dude', ([], {}), '()\n', (244, 246), False, 'from slgnn.data_processing.pyg_datasets import JAK1Dude, JAK2Dude, JAK3Dude\n'), ((455, 465), 'slgnn.data_processing.pyg_datasets.JAK3Dude', 'JAK3Dude', ([], {}), '()\n', (463, 465), False, 'from slgnn.data_pr...
import unittest from bobocep.rules.actions.no_action import NoAction from bobocep.rules.nfas.patterns.bobo_pattern import BoboPattern from bobocep.setup.bobo_complex_event import \ BoboComplexEvent class TestBoboComplexEvent(unittest.TestCase): def test_constructor(self): name = "evdef_name" ...
[ "bobocep.rules.nfas.patterns.bobo_pattern.BoboPattern", "bobocep.setup.bobo_complex_event.BoboComplexEvent", "bobocep.rules.actions.no_action.NoAction" ]
[((331, 344), 'bobocep.rules.nfas.patterns.bobo_pattern.BoboPattern', 'BoboPattern', ([], {}), '()\n', (342, 344), False, 'from bobocep.rules.nfas.patterns.bobo_pattern import BoboPattern\n'), ((362, 372), 'bobocep.rules.actions.no_action.NoAction', 'NoAction', ([], {}), '()\n', (370, 372), False, 'from bobocep.rules.a...
import cav as cav import model as model import tcav as tcav import utils as utils import utils_plot as utils_plot # utils_plot requires matplotlib import os import torch import activation_generator as act_gen import tensorflow as tf working_dir = './tcav_class_test' activation_dir = working_dir + '/activations/' cav_...
[ "tcav.TCAV", "utils.make_dir_if_not_exists", "activation_generator.ImageActivationGenerator", "tensorflow.compat.v1.logging.set_verbosity", "model.CNNWrapper", "utils_plot.plot_results" ]
[((397, 441), 'utils.make_dir_if_not_exists', 'utils.make_dir_if_not_exists', (['activation_dir'], {}), '(activation_dir)\n', (425, 441), True, 'import utils as utils\n'), ((442, 483), 'utils.make_dir_if_not_exists', 'utils.make_dir_if_not_exists', (['working_dir'], {}), '(working_dir)\n', (470, 483), True, 'import uti...
from subprocess import check_output, CalledProcessError, STDOUT import sys import re import json import logging from .common import convert_external_variables def scan(signature_path, file_path, external_variables={}, recursive=False): ''' Scan files and return matches :param signature_path: path to sig...
[ "json.loads", "sys.exc_info", "re.compile" ]
[((1254, 1299), 're.compile', 're.compile', (['"""((0x[a-f0-9]*):(\\\\S+):\\\\s(.+))+"""'], {}), "('((0x[a-f0-9]*):(\\\\S+):\\\\s(.+))+')\n", (1264, 1299), False, 'import re\n'), ((1571, 1611), 're.compile', 're.compile', (['"""\\\\n*.*\\\\[.*\\\\]\\\\s\\\\/.+\\\\n*"""'], {}), "('\\\\n*.*\\\\[.*\\\\]\\\\s\\\\/.+\\\\n*'...
from astropy.io import ascii, fits from astropy.table import QTable, Table import arviz as az from astropy.coordinates import SkyCoord from astropy import units as u import os import pymoc from astropy import wcs from astropy.table import vstack, hstack import numpy as np import xidplus # # Applying XID+CIGALE to E...
[ "astropy.convolution.Gaussian2DKernel", "numpy.abs", "numpy.argmin", "numpy.arange", "astropy.table.hstack", "pymoc.util.catalog.catalog_to_moc", "numpy.random.choice", "subprocess.Popen", "astropy.table.QTable", "numpy.min", "astropy.io.fits.open", "pyvo.dal.TAPService", "astropy.table.Tabl...
[((1773, 1791), 'astropy.io.fits.open', 'fits.open', (['pswfits'], {}), '(pswfits)\n', (1782, 1791), False, 'from astropy.io import ascii, fits\n'), ((1965, 1991), 'astropy.wcs.WCS', 'wcs.WCS', (['hdulist[1].header'], {}), '(hdulist[1].header)\n', (1972, 1991), False, 'from astropy import wcs\n'), ((2007, 2042), 'numpy...
import math import random from ..algorithm_common import AlgorithmCommon as AC from ..algorithm_common import IAlgorithm class Harmony(IAlgorithm): def __init__(self, harmony_max, bandwidth=0.1, enable_bandwidth_rate=False, select_rate=0.8, change_rate=0.3, ): s...
[ "random.random", "random.randint" ]
[((1040, 1055), 'random.random', 'random.random', ([], {}), '()\n', (1053, 1055), False, 'import random\n'), ((1309, 1324), 'random.random', 'random.random', ([], {}), '()\n', (1322, 1324), False, 'import random\n'), ((1243, 1282), 'random.randint', 'random.randint', (['(0)', '(self.harmony_max - 1)'], {}), '(0, self.h...
import datetime import unittest import autos.utils.date as date class TestDateRange(unittest.TestCase): def test_returns_today_date_as_default(self): actual = list(date.date_range()) expected = [datetime.date.today()] self.assertEqual(actual, expected) def test_returns_correct_range(...
[ "datetime.date.today", "autos.utils.date.date_range", "autos.utils.date.get_past_date", "datetime.timedelta" ]
[((906, 926), 'autos.utils.date.get_past_date', 'date.get_past_date', ([], {}), '()\n', (924, 926), True, 'import autos.utils.date as date\n'), ((1109, 1135), 'autos.utils.date.get_past_date', 'date.get_past_date', ([], {'days': '(3)'}), '(days=3)\n', (1127, 1135), True, 'import autos.utils.date as date\n'), ((1317, 13...
# -*- coding: utf-8 -*- from typing import Iterator, List, Optional, Tuple from selenium.common.exceptions import ( StaleElementReferenceException, TimeoutException ) from selenium.webdriver.remote.webdriver import WebDriver from selenium.webdriver.remote.webelement import WebElement from selenium.webdriver.su...
[ "selenium.webdriver.support.expected_conditions.visibility_of_all_elements_located", "selenium.webdriver.support.expected_conditions.presence_of_all_elements_located", "selenium.webdriver.support.expected_conditions.visibility_of_any_elements_located", "selenium.webdriver.support.wait.WebDriverWait" ]
[((4533, 4583), 'selenium.webdriver.support.expected_conditions.visibility_of_any_elements_located', 'visibility_of_any_elements_located', (['self._selector'], {}), '(self._selector)\n', (4567, 4583), False, 'from selenium.webdriver.support.expected_conditions import presence_of_all_elements_located, visibility_of_all_...
from .flasher_error import FlasherError import time import flask import requests import tempfile import os import re from threading import Thread class BaseFlasher: def __init__(self, settings, printer, plugin, plugin_manager, identifier, logger): self._settings = settings self._printer = printer self._plugin...
[ "threading.Thread", "os.remove", "tempfile.NamedTemporaryFile", "os.walk", "re.findall", "requests.get", "os.path.join" ]
[((675, 707), 'threading.Thread', 'Thread', ([], {'target': 'target', 'args': 'args'}), '(target=target, args=args)\n', (681, 707), False, 'from threading import Thread\n'), ((2588, 2629), 'requests.get', 'requests.get', (["flask.request.values['url']"], {}), "(flask.request.values['url'])\n", (2600, 2629), False, 'imp...
from OpenGLCffi.GLX import params @params(api='glx', prms=['dpy', 'pbuffer', 'params', 'dmbuffer']) def glXAssociateDMPbufferSGIX(dpy, pbuffer, params, dmbuffer): pass
[ "OpenGLCffi.GLX.params" ]
[((35, 99), 'OpenGLCffi.GLX.params', 'params', ([], {'api': '"""glx"""', 'prms': "['dpy', 'pbuffer', 'params', 'dmbuffer']"}), "(api='glx', prms=['dpy', 'pbuffer', 'params', 'dmbuffer'])\n", (41, 99), False, 'from OpenGLCffi.GLX import params\n')]
# # Copyright (c) 2013-2022 Contributors to the Eclipse Foundation # # See the NOTICE file distributed with this work for additional information regarding copyright # ownership. All rights reserved. This program and the accompanying materials are made available # under the terms of the Apache License, Version 2.0 whic...
[ "pygw.config.geowave_pkg.core.geotime.store.statistics.TimeRangeStatistic" ]
[((1093, 1155), 'pygw.config.geowave_pkg.core.geotime.store.statistics.TimeRangeStatistic', 'geowave_pkg.core.geotime.store.statistics.TimeRangeStatistic', ([], {}), '()\n', (1153, 1155), False, 'from pygw.config import geowave_pkg\n'), ((1201, 1288), 'pygw.config.geowave_pkg.core.geotime.store.statistics.TimeRangeStat...
""" Project: RadarBook File: optimum_binary_example.py Created by: <NAME> On: 10/11/2018 Created with: PyCharm Copyright (C) 2019 Artech House (<EMAIL>) This file is part of Introduction to Radar Using Python and MATLAB and can not be copied and/or distributed without the express permission of Artech House. """ import...
[ "numpy.ceil", "matplotlib.backends.backend_qt5agg.FigureCanvas", "matplotlib.figure.Figure", "numpy.arange", "matplotlib.backends.backend_qt5agg.NavigationToolbar2QT", "PyQt5.QtWidgets.QApplication" ]
[((3146, 3168), 'PyQt5.QtWidgets.QApplication', 'QApplication', (['sys.argv'], {}), '(sys.argv)\n', (3158, 3168), False, 'from PyQt5.QtWidgets import QApplication, QMainWindow\n'), ((1104, 1112), 'matplotlib.figure.Figure', 'Figure', ([], {}), '()\n', (1110, 1112), False, 'from matplotlib.figure import Figure\n'), ((11...
from datetime import datetime as dt from dash.dependencies import Input from dash.dependencies import Output from dash.dependencies import State from flask_login import current_user import pandas_datareader as pdr def register_callbacks(dashapp): @dashapp.callback( Output('my-graph', 'figure'), I...
[ "dash.dependencies.State", "datetime.datetime", "dash.dependencies.Input", "dash.dependencies.Output", "datetime.datetime.now" ]
[((281, 309), 'dash.dependencies.Output', 'Output', (['"""my-graph"""', '"""figure"""'], {}), "('my-graph', 'figure')\n", (287, 309), False, 'from dash.dependencies import Output\n'), ((319, 348), 'dash.dependencies.Input', 'Input', (['"""my-dropdown"""', '"""value"""'], {}), "('my-dropdown', 'value')\n", (324, 348), F...
from collections import defaultdict from decimal import Decimal from _datetime import datetime, timedelta from enum import Enum import math import random import re import requests import time from vnpy.app.algo_trading import AlgoTemplate from vnpy.trader.utility import round_to from vnpy.trader.constant import Direct...
[ "time.sleep", "time.time", "vnpy.trader.utility.round_to", "re.compile" ]
[((3472, 3545), 're.compile', 're.compile', (['"""^(\\\\w+)[-:/]?(BTC|ETH|BNB|XRP|USDT|USDC|USDS|TUSD|PAX|DAI)$"""'], {}), "('^(\\\\w+)[-:/]?(BTC|ETH|BNB|XRP|USDT|USDC|USDS|TUSD|PAX|DAI)$')\n", (3482, 3545), False, 'import re\n'), ((17713, 17726), 'time.sleep', 'time.sleep', (['(5)'], {}), '(5)\n', (17723, 17726), Fals...
# coding: utf-8 import re import six from huaweicloudsdkcore.sdk_response import SdkResponse from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization class ShowCertificateResponse(SdkResponse): """ Attributes: openapi_types (dict): The key is attribute name ...
[ "huaweicloudsdkcore.utils.http_utils.sanitize_for_serialization", "six.iteritems", "sys.setdefaultencoding" ]
[((16545, 16578), 'six.iteritems', 'six.iteritems', (['self.openapi_types'], {}), '(self.openapi_types)\n', (16558, 16578), False, 'import six\n'), ((17563, 17594), 'sys.setdefaultencoding', 'sys.setdefaultencoding', (['"""utf-8"""'], {}), "('utf-8')\n", (17585, 17594), False, 'import sys\n'), ((17621, 17653), 'huaweic...
import asyncio import os import json from winrt.windows.media.control import \ GlobalSystemMediaTransportControlsSessionManager as MediaManager from winrt.windows.storage.streams import \ DataReader, Buffer, InputStreamOptions async def get_media_info(): sessions = await MediaManager.request_async() #...
[ "os.remove", "winrt.windows.media.control.GlobalSystemMediaTransportControlsSessionManager.request_async", "os.makedirs", "os.path.exists", "winrt.windows.storage.streams.Buffer", "winrt.windows.storage.streams.DataReader.from_buffer" ]
[((285, 313), 'winrt.windows.media.control.GlobalSystemMediaTransportControlsSessionManager.request_async', 'MediaManager.request_async', ([], {}), '()\n', (311, 313), True, 'from winrt.windows.media.control import GlobalSystemMediaTransportControlsSessionManager as MediaManager\n'), ((1367, 1391), 'os.path.exists', 'o...
import FWCore.ParameterSet.Config as cms #from ..modules.hltL1TkMuons_cfi import * from ..modules.hltDoubleMuon7DZ1p0_cfi import * from ..modules.hltL1TkDoubleMuFiltered7_cfi import * from ..modules.hltL1TkSingleMuFiltered15_cfi import * from ..sequences.HLTBeginSequence_cfi import * from ..sequences.HLTEndSequence_cf...
[ "FWCore.ParameterSet.Config.Path" ]
[((356, 480), 'FWCore.ParameterSet.Config.Path', 'cms.Path', (['(HLTBeginSequence + hltL1TkDoubleMuFiltered7 + hltL1TkSingleMuFiltered15 +\n hltDoubleMuon7DZ1p0 + HLTEndSequence)'], {}), '(HLTBeginSequence + hltL1TkDoubleMuFiltered7 +\n hltL1TkSingleMuFiltered15 + hltDoubleMuon7DZ1p0 + HLTEndSequence)\n', (364, 4...
from sympy import * from sympy.matrices import * import os import re import argparse # local import pretty_print def sqr(a): return a * a def trunc_acos(x): tmp = Piecewise((0.0, x >= 1.0), (pi, x <= -1.0), (acos(x), True)) return tmp.subs(x, x) def eigs_2d(mat): a = mat[0, 0] + mat[1, 1] del...
[ "os.path.abspath", "argparse.ArgumentParser", "pretty_print.C99_print", "os.path.join", "re.sub" ]
[((1692, 1795), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '__doc__', 'formatter_class': 'argparse.RawDescriptionHelpFormatter'}), '(description=__doc__, formatter_class=argparse.\n RawDescriptionHelpFormatter)\n', (1715, 1795), False, 'import argparse\n'), ((3622, 3650), 'os.path.abs...
from decimal import Decimal from unittest import TestCase from hummingbot.core.data_type.common import TradeType, PositionAction from hummingbot.core.data_type.in_flight_order import TradeUpdate from hummingbot.core.data_type.trade_fee import ( AddedToCostTradeFee, DeductedFromReturnsTradeFee, TokenAmount,...
[ "hummingbot.core.data_type.trade_fee.DeductedFromReturnsTradeFee.type_descriptor_for_json", "hummingbot.core.data_type.trade_fee.AddedToCostTradeFee.type_descriptor_for_json", "decimal.Decimal" ]
[((1081, 1095), 'decimal.Decimal', 'Decimal', (['"""1.1"""'], {}), "('1.1')\n", (1088, 1095), False, 'from decimal import Decimal\n'), ((1917, 1931), 'decimal.Decimal', 'Decimal', (['"""1.1"""'], {}), "('1.1')\n", (1924, 1931), False, 'from decimal import Decimal\n'), ((2765, 2779), 'decimal.Decimal', 'Decimal', (['"""...
import math import tensorflow as tf import cv2 import numpy as np from scipy import signal def image_normalization(image: np.ndarray, new_min=0, new_max=255) -> np.ndarray: """ Normalize the input image to a given range set by min and max parameter Args: image ([type]): [description] new_m...
[ "numpy.math.exp", "numpy.meshgrid", "tensorflow.image.rgb_to_grayscale", "numpy.sum", "scipy.signal.convolve2d", "tensorflow.cast", "cv2.imread", "numpy.min", "numpy.arange", "numpy.max", "numpy.math.ceil", "numpy.round", "cv2.resize" ]
[((640, 666), 'tensorflow.cast', 'tf.cast', (['image', 'np.float32'], {}), '(image, np.float32)\n', (647, 666), True, 'import tensorflow as tf\n'), ((780, 821), 'tensorflow.cast', 'tf.cast', (['normalized_image', 'original_dtype'], {}), '(normalized_image, original_dtype)\n', (787, 821), True, 'import tensorflow as tf\...
from django.utils.translation import ugettext_lazy as _ search = {'text': _(u'search'), 'view': 'search', 'famfam': 'zoom'} search_advanced = {'text': _(u'advanced search'), 'view': 'search_advanced', 'famfam': 'zoom_in'} search_again = {'text': _(u'search again'), 'view': 'search_again', 'famfam': 'arrow_undo'}
[ "django.utils.translation.ugettext_lazy" ]
[((75, 87), 'django.utils.translation.ugettext_lazy', '_', (['u"""search"""'], {}), "(u'search')\n", (76, 87), True, 'from django.utils.translation import ugettext_lazy as _\n'), ((152, 173), 'django.utils.translation.ugettext_lazy', '_', (['u"""advanced search"""'], {}), "(u'advanced search')\n", (153, 173), True, 'fr...
import sys import re from utils.utils import print_writeofd # First argument is whether or not to proceed with manual checking: if sys.argv[1] == '-m': MANUAL_CHECKING = True elif sys.argv[1] == '-a': MANUAL_CHECKING = False else: print("The first argument must be either -m or -a, see README.md for details...
[ "utils.utils.print_writeofd" ]
[((11140, 11188), 'utils.utils.print_writeofd', 'print_writeofd', (['"""BEFORE MANUAL INSPECTION:"""', 'ofd'], {}), "('BEFORE MANUAL INSPECTION:', ofd)\n", (11154, 11188), False, 'from utils.utils import print_writeofd\n'), ((12208, 12231), 'utils.utils.print_writeofd', 'print_writeofd', (['""""""', 'ofd'], {}), "('', ...
import sqlite3 def connect_to_db(db_name="rpg_db.sqlite3"): return sqlite3.connect(db_name) def execute_query(cursor, query): cursor.execute(query) return cursor.fetchall() GET_CHARACTERS = """ SELECT * FROM charactercreator_character """ CHARACTER_COUNT = """ SELECT COUNT(*) FROM charactercreator_c...
[ "sqlite3.connect" ]
[((72, 96), 'sqlite3.connect', 'sqlite3.connect', (['db_name'], {}), '(db_name)\n', (87, 96), False, 'import sqlite3\n')]
import unittest from letter_capitalize import LetterCapitalize class TestWordCapitalize(unittest.TestCase): def test_word_capitalize(self): self.assertEqual(LetterCapitalize("hello world"), "Hello World") if __name__ == '__main__': unittest.main()
[ "unittest.main", "letter_capitalize.LetterCapitalize" ]
[((251, 266), 'unittest.main', 'unittest.main', ([], {}), '()\n', (264, 266), False, 'import unittest\n'), ((171, 202), 'letter_capitalize.LetterCapitalize', 'LetterCapitalize', (['"""hello world"""'], {}), "('hello world')\n", (187, 202), False, 'from letter_capitalize import LetterCapitalize\n')]
#!/usr/bin/env python # Spider and start listening for passive requests import sys from zapv2 import ZAPv2 from zap_common import * #Configuration zap_ip = 'localhost' port = 12345 spiderTimeoutInMin = 2 startupTimeoutInMin=1 target='http://localhost:8080' def main(argv): #Initialize Zap API http_proxy = 'http:/...
[ "zapv2.ZAPv2" ]
[((411, 468), 'zapv2.ZAPv2', 'ZAPv2', ([], {'proxies': "{'http': http_proxy, 'https': https_proxy}"}), "(proxies={'http': http_proxy, 'https': https_proxy})\n", (416, 468), False, 'from zapv2 import ZAPv2\n')]
from sparknlp.annotator import XlmRoBertaSentenceEmbeddings class Sentence_XLM: @staticmethod def get_default_model(): return XlmRoBertaSentenceEmbeddings.pretrained() \ .setInputCols("sentence", "token") \ .setOutputCol("sentence_xlm_roberta") @staticmethod def get_pretrained_...
[ "sparknlp.annotator.XlmRoBertaSentenceEmbeddings.pretrained" ]
[((143, 184), 'sparknlp.annotator.XlmRoBertaSentenceEmbeddings.pretrained', 'XlmRoBertaSentenceEmbeddings.pretrained', ([], {}), '()\n', (182, 184), False, 'from sparknlp.annotator import XlmRoBertaSentenceEmbeddings\n'), ((358, 413), 'sparknlp.annotator.XlmRoBertaSentenceEmbeddings.pretrained', 'XlmRoBertaSentenceEmbe...
import json import pprint def pformat(value): """ Format given object: Try JSON fist and fallback to pformat() (JSON dumps are nicer than pprint.pformat() ;) """ try: value = json.dumps(value, indent=4, sort_keys=True, ensure_ascii=False) except TypeError: # Fallback if values ...
[ "pprint.pformat", "json.dumps" ]
[((205, 268), 'json.dumps', 'json.dumps', (['value'], {'indent': '(4)', 'sort_keys': '(True)', 'ensure_ascii': '(False)'}), '(value, indent=4, sort_keys=True, ensure_ascii=False)\n', (215, 268), False, 'import json\n'), ((368, 400), 'pprint.pformat', 'pprint.pformat', (['value'], {'width': '(120)'}), '(value, width=120...
#---------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. #------------------------------------------------------------------...
[ "mmdnn.conversion.common.utils.download_file" ]
[((1417, 1518), 'mmdnn.conversion.common.utils.download_file', 'download_file', (["cls.architecture_map[architecture]['config']"], {'directory': 'path', 'local_fname': 'cfg_name'}), "(cls.architecture_map[architecture]['config'], directory=path,\n local_fname=cfg_name)\n", (1430, 1518), False, 'from mmdnn.conversion...
import matplotlib from collections import defaultdict, OrderedDict from plots.DotSetPlot import DotSetPlot processToTitle = { "targetMirsECA": "EC activation and\n inflammation", "targetMirsMonocyte": "Monocyte diff. &\nMacrophage act.", "targetMirsFCF": "Foam cell formation", "targetMirsAngi...
[ "matplotlib.pyplot.show", "collections.defaultdict", "plots.DotSetPlot.DotSetPlot", "collections.OrderedDict", "matplotlib.pyplot.savefig" ]
[((1470, 1486), 'collections.defaultdict', 'defaultdict', (['set'], {}), '(set)\n', (1481, 1486), False, 'from collections import defaultdict, OrderedDict\n'), ((1504, 1520), 'collections.defaultdict', 'defaultdict', (['set'], {}), '(set)\n', (1515, 1520), False, 'from collections import defaultdict, OrderedDict\n'), (...
# Libraries from pandas.io.formats.format import DataFrameFormatter from streamlit_folium import folium_static import pandas as pd import numpy as np import seaborn as sns import streamlit as st import sys #! Add folder "src" as a package path project_path = "Put/here/the/path/to/the/project's/root/folder/house_rocke...
[ "sys.path.append", "streamlit.subheader", "streamlit.set_page_config", "streamlit.markdown", "streamlit.dataframe", "visualization.maps.houses_map", "streamlit.cache", "streamlit_folium.folium_static", "pandas.read_csv", "streamlit.header", "streamlit.error", "streamlit.title", "streamlit.si...
[((332, 371), 'sys.path.append', 'sys.path.append', (['f"""{project_path}/src/"""'], {}), "(f'{project_path}/src/')\n", (347, 371), False, 'import sys\n'), ((428, 461), 'streamlit.set_page_config', 'st.set_page_config', ([], {'layout': '"""wide"""'}), "(layout='wide')\n", (446, 461), True, 'import streamlit as st\n'), ...
from typing import Any, Dict, List, Type, TypeVar import attr from ..models.severity_response_body import SeverityResponseBody T = TypeVar("T", bound="SeveritiesListResponseBody") @attr.s(auto_attribs=True) class SeveritiesListResponseBody: """ Example: {'severities': [{'created_at': '2021-08-17T13...
[ "attr.s", "typing.TypeVar", "attr.ib" ]
[((134, 182), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {'bound': '"""SeveritiesListResponseBody"""'}), "('T', bound='SeveritiesListResponseBody')\n", (141, 182), False, 'from typing import Any, Dict, List, Type, TypeVar\n'), ((186, 211), 'attr.s', 'attr.s', ([], {'auto_attribs': '(True)'}), '(auto_attribs=True)\n', (...
import numpy as np from matplotlib import pyplot as plt def loadFile(filename): f = open(filename,'r') text = f.read() f.close() rewards = [] steps = [] for line in text.split('\n'): pieces = line.split(',') if(len(pieces) == 2): rewards.append(float(pieces[0])) steps.append(int(piec...
[ "matplotlib.pyplot.subplot", "matplotlib.pyplot.plot", "numpy.mean", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig" ]
[((559, 579), 'matplotlib.pyplot.subplot', 'plt.subplot', (['(2)', '(1)', '(1)'], {}), '(2, 1, 1)\n', (570, 579), True, 'from matplotlib import pyplot as plt\n'), ((580, 597), 'matplotlib.pyplot.plot', 'plt.plot', (['rewards'], {}), '(rewards)\n', (588, 597), True, 'from matplotlib import pyplot as plt\n'), ((600, 636)...
import pyshark class Audio_Scraper: def __init__(self, pcap, filter, outfile): self.pcap = pcap self.filter = filter self.outfile = outfile def scraper(self): rtp_list =[] pcap_file = self.pcap out_file = self.outfile print("Scraping: " + pcap_file) ...
[ "pyshark.FileCapture" ]
[((364, 422), 'pyshark.FileCapture', 'pyshark.FileCapture', (['pcap_file'], {'display_filter': 'filter_type'}), '(pcap_file, display_filter=filter_type)\n', (383, 422), False, 'import pyshark\n')]
from __future__ import print_function import time import avacloud_client_python from avacloud_client_python.rest import ApiException import requests import os import json client_id = 'use_your_own_value' client_secret = '<PASSWORD>_your_own_value' url = 'https://identity.dangl-it.com/connect/token' payload = {'grant_...
[ "requests.post", "avacloud_client_python.Configuration", "json.loads", "avacloud_client_python.ApiClient" ]
[((381, 446), 'requests.post', 'requests.post', (['url'], {'data': 'payload', 'auth': '(client_id, client_secret)'}), '(url, data=payload, auth=(client_id, client_secret))\n', (394, 446), False, 'import requests\n'), ((577, 615), 'avacloud_client_python.Configuration', 'avacloud_client_python.Configuration', ([], {}), ...
from rapidtest import Test, Case, TreeNode from solutions.binary_tree_preorder_traversal import Solution with Test(Solution) as test: Case(TreeNode.from_string('[1,null,2,3]'), result=[1, 2, 3]) Case(TreeNode.from_string('[]'), result=[]) Case(TreeNode.from_string('[1]'), result=[1]) Case(TreeNode.from...
[ "rapidtest.Test", "rapidtest.TreeNode.from_string" ]
[((111, 125), 'rapidtest.Test', 'Test', (['Solution'], {}), '(Solution)\n', (115, 125), False, 'from rapidtest import Test, Case, TreeNode\n'), ((144, 180), 'rapidtest.TreeNode.from_string', 'TreeNode.from_string', (['"""[1,null,2,3]"""'], {}), "('[1,null,2,3]')\n", (164, 180), False, 'from rapidtest import Test, Case,...
"""create tokens table Revision ID: 1<PASSWORD> Revises: Create Date: 2020-12-12 01:44:28.195736 """ from alembic import op import sqlalchemy as sa from sqlalchemy import Table, Column, Integer, String, Boolean, DateTime, ForeignKey from sqlalchemy.engine.reflection import Inspector from flask_sqlalchemy import SQLA...
[ "alembic.op.alter_column", "sqlalchemy.ForeignKey", "flask_sqlalchemy.SQLAlchemy", "sqlalchemy.engine.reflection.Inspector.from_engine", "alembic.op.execute", "alembic.op.get_bind", "sqlalchemy.Column", "sqlalchemy.String", "alembic.op.batch_alter_table" ]
[((461, 473), 'flask_sqlalchemy.SQLAlchemy', 'SQLAlchemy', ([], {}), '()\n', (471, 473), False, 'from flask_sqlalchemy import SQLAlchemy\n'), ((502, 515), 'alembic.op.get_bind', 'op.get_bind', ([], {}), '()\n', (513, 515), False, 'from alembic import op\n'), ((532, 559), 'sqlalchemy.engine.reflection.Inspector.from_eng...
#!/usr/bin/env python # coding: utf8 # # Copyright (c) 2021 Centre National d'Etudes Spatiales (CNES). # # This file is part of PANDORA_MCCNN # # https://github.com/CNES/Pandora_MCCNN # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Licens...
[ "unittest.main", "numpy.full", "numpy.stack", "numpy.testing.assert_array_equal", "torch.randn", "torch.nn.CosineSimilarity", "mc_cnn.run.computes_cost_volume_mc_cnn_fast", "mc_cnn.dataset_generator.middlebury_generator.MiddleburyGenerator", "numpy.arange", "numpy.testing.assert_allclose", "mc_c...
[((21139, 21154), 'unittest.main', 'unittest.main', ([], {}), '()\n', (21152, 21154), False, 'import unittest\n'), ((1942, 1986), 'torch.randn', 'torch.randn', (['(64, 4, 4)'], {'dtype': 'torch.float64'}), '((64, 4, 4), dtype=torch.float64)\n', (1953, 1986), False, 'import torch\n'), ((2010, 2054), 'torch.randn', 'torc...
import matplotlib.pyplot as plt import numpy as np import pandas as pd import sqlite3 from sklearn.metrics import auc from sklearn.metrics import roc_curve def add_truth(data, database): data = data.sort_values('event_no').reset_index(drop = True) with sqlite3.connect(database) as con: query = 'select ...
[ "matplotlib.pyplot.title", "pandas.read_csv", "matplotlib.pyplot.subplot2grid", "numpy.random.default_rng", "matplotlib.pyplot.figure", "numpy.mean", "numpy.arange", "matplotlib.pyplot.tick_params", "pandas.DataFrame", "numpy.std", "numpy.log10", "matplotlib.pyplot.legend", "matplotlib.pyplo...
[((1250, 1272), 'numpy.log10', 'np.log10', (["df['energy']"], {}), "(df['energy'])\n", (1258, 1272), True, 'import numpy as np\n'), ((1323, 1348), 'numpy.random.default_rng', 'np.random.default_rng', (['(42)'], {}), '(42)\n', (1344, 1348), True, 'import numpy as np\n'), ((1520, 1529), 'numpy.std', 'np.std', (['w'], {})...
""" handle the CLI logic for a unidump call """ import argparse import codecs import gettext from os.path import dirname from shutil import get_terminal_size import sys from textwrap import TextWrapper # pylint: disable=unused-import from typing import List, IO, Any # pylint: enable=unused-import from unicodedata imp...
[ "sys.stdout.detach", "argparse.ArgumentParser", "unidump.env.Env.lineformat.replace", "os.path.dirname", "shutil.get_terminal_size", "codecs.getwriter", "unidump.env.Env", "sys.stdout.flush" ]
[((4000, 4138), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'prog': '"""unidump"""', 'description': 'DESCRIPTION', 'epilog': 'EPILOG', 'formatter_class': 'argparse.RawDescriptionHelpFormatter'}), "(prog='unidump', description=DESCRIPTION, epilog=\n EPILOG, formatter_class=argparse.RawDescriptionHelpF...
from rest_framework import serializers from api.models import * class ParliamentaryGroupSerializer(serializers.ModelSerializer): class Meta: model = ParliamentaryGroup fields = ('id', 'name') class ParliamentarySessionSerializer(serializers.ModelSerializer): class Meta: model = Parli...
[ "rest_framework.serializers.StringRelatedField" ]
[((776, 808), 'rest_framework.serializers.StringRelatedField', 'serializers.StringRelatedField', ([], {}), '()\n', (806, 808), False, 'from rest_framework import serializers\n'), ((1116, 1148), 'rest_framework.serializers.StringRelatedField', 'serializers.StringRelatedField', ([], {}), '()\n', (1146, 1148), False, 'fro...
from django.db import models from pytz import country_names as c from datetime import date dict_choices = dict(c) _choices = [] _keys = list(dict_choices.keys()) _value = list(dict_choices.values()) if len(_keys) == len(_value): for i in range(len(_keys)): a = [_keys[i], _value[i]] _ch...
[ "django.db.models.TextField", "django.db.models.BigIntegerField", "django.db.models.CharField", "django.db.models.ForeignKey", "django.db.models.DurationField", "django.db.models.IntegerField", "django.db.models.DateField" ]
[((396, 428), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(300)'}), '(max_length=300)\n', (412, 428), False, 'from django.db import models\n'), ((455, 479), 'django.db.models.BigIntegerField', 'models.BigIntegerField', ([], {}), '()\n', (477, 479), False, 'from django.db import models\n'), ((...