code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from tkinter import *
from tkinter import ttk
GUI = Tk()
GUI.geometry('600x700')
F1 = Frame(GUI)
F1.place(x=15,y=600)
FONT1 = ('Angsana New',25)
v_msg = StringVar()
E1 = ttk.Entry(F1,textvariable=v_msg,font=FONT1,width=40)
E1.grid(row=0,column=0)
global allmsg
allmsg = []
def SendMessage(event=N... | [
"tkinter.ttk.Label",
"tkinter.ttk.Entry",
"tkinter.ttk.Button"
] | [((186, 241), 'tkinter.ttk.Entry', 'ttk.Entry', (['F1'], {'textvariable': 'v_msg', 'font': 'FONT1', 'width': '(40)'}), '(F1, textvariable=v_msg, font=FONT1, width=40)\n', (195, 241), False, 'from tkinter import ttk\n'), ((563, 611), 'tkinter.ttk.Button', 'ttk.Button', (['F1'], {'text': '"""Send"""', 'command': 'SendMes... |
"""
Train on images split into directories. This assumes we've split
our videos into frames and moved them to their respective folders.
Based on:
https://keras.io/preprocessing/image/
and
https://keras.io/applications/
"""
import argparse
import numpy as np
import os
from keras.applications.inception_v3 import Incepti... | [
"settings.Experiment",
"keras.preprocessing.image.ImageDataGenerator",
"os.path.join",
"keras.optimizers.SGD",
"keras.models.Model",
"keras.layers.GlobalAveragePooling2D",
"keras.layers.Dense",
"keras.applications.inception_v3.InceptionV3",
"data.DataSet"
] | [((758, 779), 'settings.Experiment', 'settings.Experiment', ([], {}), '()\n', (777, 779), False, 'import settings\n'), ((789, 798), 'data.DataSet', 'DataSet', ([], {}), '()\n', (796, 798), False, 'from data import DataSet\n'), ((813, 852), 'os.path.join', 'os.path.join', (['cg.oct_main_dir', '"""UCF101"""'], {}), "(cg.... |
# -*- coding: utf-8 -*-
# @Time : 23.03.21 14:42
# @Author : sing_sd
import numpy as np
import matplotlib.pyplot as plt
import numpy as np
from rdp import rdp
import pickle
import src.clustering.COStransforms as ct
from frechetdist import frdist
ref = {'lon': 12.0, 'lat': 54.35, 'ECEF': ct.WGS84toECEF(12.0, 54.35... | [
"src.clustering.COStransforms.WGS84toECEF",
"frechetdist.frdist",
"numpy.multiply",
"numpy.subtract",
"numpy.sum",
"numpy.argmax",
"numpy.abs",
"src.clustering.COStransforms.WGS84toENU",
"numpy.transpose",
"rdp.rdp",
"numpy.argmin",
"pickle.load",
"numpy.array",
"numpy.linalg.norm",
"num... | [((294, 321), 'src.clustering.COStransforms.WGS84toECEF', 'ct.WGS84toECEF', (['(12.0)', '(54.35)'], {}), '(12.0, 54.35)\n', (308, 321), True, 'import src.clustering.COStransforms as ct\n'), ((813, 840), 'rdp.rdp', 'rdp', (['ENUcoord_mmsi', 'EPSILON'], {}), '(ENUcoord_mmsi, EPSILON)\n', (816, 840), False, 'from rdp impo... |
import math
from typing import Tuple
import numpy as np
import open3d as o3d
import open3d.core as o3c
import pytest
from dq3d import quat, dualquat
import nnrt
import nnrt.geometry as nnrt_geom
from image_processing import compute_normals
from image_processing.numba_cuda.preprocessing import cuda_compute_normal
fro... | [
"numpy.allclose",
"numpy.ones",
"numpy.round",
"numpy.ndarray",
"open3d.core.Device",
"open3d.geometry.Image",
"image_processing.compute_normals",
"dq3d.quat",
"numpy.linspace",
"nnrt.backproject_depth_ushort",
"open3d.core.Tensor.eye",
"open3d.core.Tensor",
"dq3d.quat.identity",
"numpy.co... | [((676, 737), 'numpy.ndarray', 'np.ndarray', (['(resolution[0], resolution[1], 3)'], {'dtype': 'np.uint8'}), '((resolution[0], resolution[1], 3), dtype=np.uint8)\n', (686, 737), True, 'import numpy as np\n'), ((837, 864), 'numpy.eye', 'np.eye', (['(3)'], {'dtype': 'np.float32'}), '(3, dtype=np.float32)\n', (843, 864), ... |
##############################################################################
#
# Copyright (c) 2016, <NAME>
#
# This file is part of arlpy which is released under Simplified BSD License.
# See file LICENSE or go to http://www.opensource.org/licenses/BSD-3-Clause
# for full license details.
#
#########################... | [
"os.stat",
"numpy.fromfile",
"numpy.take",
"numpy.reshape",
"scipy.signal.detrend"
] | [((645, 663), 'os.stat', '_os.stat', (['filename'], {}), '(filename)\n', (653, 663), True, 'import os as _os\n'), ((1210, 1228), 'os.stat', '_os.stat', (['filename'], {}), '(filename)\n', (1218, 1228), True, 'import os as _os\n'), ((2181, 2224), 'numpy.reshape', '_np.reshape', (['data', '[length, _framelen // 2]'], {})... |
# -*- coding: utf-8 -*-
import unittest
import os
import pickle
import pandas as pd
import numpy as np
from td_query import ROOT_PATH
from td_query.data_manipulate import data_manipulate_instance as instance
from teradata import UdaExec
class TestDataManipulate(unittest.TestCase):
@classmethod
def setUpClass... | [
"td_query.data_manipulate.data_manipulate_instance.update_custom_weight_col_in_table",
"td_query.data_manipulate.data_manipulate_instance.query",
"td_query.data_manipulate.data_manipulate_instance.init",
"td_query.data_manipulate.data_manipulate_instance.generate_hl_job_json",
"td_query.data_manipulate.data... | [((445, 460), 'td_query.data_manipulate.data_manipulate_instance.init', 'instance.init', ([], {}), '()\n', (458, 460), True, 'from td_query.data_manipulate import data_manipulate_instance as instance\n'), ((811, 834), 'td_query.data_manipulate.data_manipulate_instance.query_sample', 'instance.query_sample', ([], {}), '... |
#!/usr/bin/env python
# This script needs to control its startup sequence to interface with ParaView's
# `pvpython`.
#
# 1. The user launches `gwrender.py` in a Python environment of their choice.
# They have `gwpv` and its dependencies installed in this environment.
# The `pvpython` executable is available in t... | [
"argparse.ArgumentParser",
"json.dumps",
"os.path.join",
"os.path.exists",
"itertools.chain",
"functools.partial",
"h5py.File",
"tqdm.tqdm.get_lock",
"gwpv.render.frames.render_frames",
"gwpv.swsh_cache.precompute_cached_swsh_grid",
"subprocess.call",
"gwpv.render.waveform.render_waveform",
... | [((1520, 1624), 'gwpv.render.frames.render_frames', 'render_frames', ([], {'job_id': 'job_id_and_frame_window[0]', 'frame_window': 'job_id_and_frame_window[1]'}), '(job_id=job_id_and_frame_window[0], frame_window=\n job_id_and_frame_window[1], **kwargs)\n', (1533, 1624), False, 'from gwpv.render.frames import render... |
import sys
from magma import *
from mantle import *
from loam.boards.papilio import Papilio
papilio = Papilio()
papilio.Clock.on()
papilio.Timer.on()
papilio.C[8].rename('LED').output().on()
main = papilio.main()
wire( main.systimer.O[24], main.LED )
compile(sys.argv[1], main)
| [
"loam.boards.papilio.Papilio"
] | [((103, 112), 'loam.boards.papilio.Papilio', 'Papilio', ([], {}), '()\n', (110, 112), False, 'from loam.boards.papilio import Papilio\n')] |
from copy import deepcopy
import mushroom_rl.environments
class EnvironmentBuilder:
"""
Class to spawn instances of a MushroomRL environment
"""
def __init__(self, env_name, env_params):
"""
Constructor
Args:
env_name: name of the environment to build
e... | [
"copy.deepcopy"
] | [((806, 820), 'copy.deepcopy', 'deepcopy', (['self'], {}), '(self)\n', (814, 820), False, 'from copy import deepcopy\n')] |
#! -*- encoding:utf-8 -*-
import logging
from lib.file_util import read_csv_to_list
from task_def import VarifyProxyTask
logger = logging.getLogger()
handler = logging.StreamHandler()
formatter = logging.Formatter(
'%(asctime)s %(name)-12s %(levelname)-8s %(message)s')
handler.setFormatter(formatter)
logger.addHa... | [
"lib.file_util.read_csv_to_list",
"logging.StreamHandler",
"task_def.VarifyProxyTask",
"logging.Formatter",
"logging.getLogger"
] | [((132, 151), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (149, 151), False, 'import logging\n'), ((162, 185), 'logging.StreamHandler', 'logging.StreamHandler', ([], {}), '()\n', (183, 185), False, 'import logging\n'), ((198, 270), 'logging.Formatter', 'logging.Formatter', (['"""%(asctime)s %(name)-12s ... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-01-16 16:15
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Creat... | [
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.CharField",
"django.db.models.BooleanField",
"django.db.models.AutoField",
"django.db.models.IntegerField",
"django.db.models.DateTimeField"
] | [((4324, 4432), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'null': '(True)', 'on_delete': 'django.db.models.deletion.SET_NULL', 'to': '"""stylemuzeapp.VoteOption"""'}), "(null=True, on_delete=django.db.models.deletion.SET_NULL,\n to='stylemuzeapp.VoteOption')\n", (4341, 4432), False, 'from django.db i... |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | [
"pyangbind.lib.yangtypes.RestrictedClassType",
"pyangbind.lib.yangtypes.YANGDynClass",
"__builtin__.property"
] | [((19635, 19709), '__builtin__.property', '__builtin__.property', (['_get_principal_switch_wwn', '_set_principal_switch_wwn'], {}), '(_get_principal_switch_wwn, _set_principal_switch_wwn)\n', (19655, 19709), False, 'import __builtin__\n'), ((19731, 19797), '__builtin__.property', '__builtin__.property', (['_get_co_ordi... |
from typing import Collection, Dict, List, Sequence, Type, TypeVar
import numpy as np
import pandas as pd
from athenian.api.controllers.features.metric import Metric, MetricInt
from athenian.api.controllers.features.metric_calculator import AnyMetricCalculator, \
BinnedMetricCalculator, \
MetricCalculator, Me... | [
"typing.TypeVar",
"numpy.broadcast_to",
"numpy.array",
"numpy.unique"
] | [((808, 820), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (815, 820), False, 'from typing import Collection, Dict, List, Sequence, Type, TypeVar\n'), ((7516, 7566), 'numpy.broadcast_to', 'np.broadcast_to', (['duplicated[None, :]', 'result.shape'], {}), '(duplicated[None, :], result.shape)\n', (7531, 7566... |
#!/usr/bin/env python3
import socket
import uuid
import paho.mqtt.client as mqtt
from select import select
from time import time
client_id = 'paho-mqtt-python/issue72/' + str(uuid.uuid4())
topic = client_id
print("Using client_id / topic: " + client_id)
class SelectMqttExample:
def __init__(self):
pass
... | [
"paho.mqtt.client.Client",
"uuid.uuid4",
"time.time"
] | [((177, 189), 'uuid.uuid4', 'uuid.uuid4', ([], {}), '()\n', (187, 189), False, 'import uuid\n'), ((723, 729), 'time.time', 'time', ([], {}), '()\n', (727, 729), False, 'from time import time\n'), ((1536, 1542), 'time.time', 'time', ([], {}), '()\n', (1540, 1542), False, 'from time import time\n'), ((1589, 1621), 'paho.... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# recorder.py
#
# Copyright 2019 <<EMAIL>>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at ... | [
"AWSIoTPythonSDK.MQTTLib.AWSIoTMQTTClient",
"json.loads",
"random.randint",
"logging.StreamHandler",
"os.system",
"time.sleep",
"logging.Formatter",
"logging.getLogger"
] | [((1019, 1060), 'logging.getLogger', 'logging.getLogger', (['"""AWSIoTPythonSDK.core"""'], {}), "('AWSIoTPythonSDK.core')\n", (1036, 1060), False, 'import logging\n'), ((1108, 1131), 'logging.StreamHandler', 'logging.StreamHandler', ([], {}), '()\n', (1129, 1131), False, 'import logging\n'), ((1144, 1217), 'logging.For... |
'''
Test the FFT functions
'''
import numpy as np
from .. import LombScargle as LS
import matplotlib.pyplot as plt
import matplotlib.colors as colors
from mpl_toolkits.axes_grid1 import make_axes_locatable
from ..Tools.mode import mode
from ..Tools.DetectGaps import DetectGaps
from ..Spectrogram.SpectrogramPlotter imp... | [
"numpy.meshgrid",
"matplotlib.colors.Normalize",
"matplotlib.pyplot.axes",
"numpy.float32",
"numpy.zeros",
"numpy.isfinite",
"numpy.nanmin",
"numpy.append",
"numpy.max",
"numpy.arange",
"numpy.cos",
"numpy.random.rand",
"matplotlib.pyplot.cm.get_cmap",
"numpy.nanmax"
] | [((502, 519), 'numpy.arange', 'np.arange', (['(1000.0)'], {}), '(1000.0)\n', (511, 519), True, 'import numpy as np\n'), ((1455, 1473), 'numpy.arange', 'np.arange', (['(10800.0)'], {}), '(10800.0)\n', (1464, 1473), True, 'import numpy as np\n'), ((2364, 2382), 'numpy.arange', 'np.arange', (['(10800.0)'], {}), '(10800.0)... |
from unittest import TestCase
from contentful_management.content_type_field_validation import ContentTypeFieldValidation
class ContentTypeFieldValidationTest(TestCase):
def test_content_type_field_validation(self):
validation = ContentTypeFieldValidation({
'size': {'min': 3}
})
... | [
"contentful_management.content_type_field_validation.ContentTypeFieldValidation"
] | [((242, 290), 'contentful_management.content_type_field_validation.ContentTypeFieldValidation', 'ContentTypeFieldValidation', (["{'size': {'min': 3}}"], {}), "({'size': {'min': 3}})\n", (268, 290), False, 'from contentful_management.content_type_field_validation import ContentTypeFieldValidation\n')] |
# AAAAA
from parsing.item_parser import ItemParser
from parsing.list_parser import ListParser
import csv
import threading
import time
class Manager:
"""Manage data provided by parsers and to parsers"""
order = [
'bodyType', 'brand', 'color', 'fuelType', 'modelDate', 'name', 'numberOfDoors', 'produ... | [
"threading.Thread",
"csv.writer",
"parsing.list_parser.ListParser",
"time.sleep",
"parsing.item_parser.ItemParser"
] | [((671, 700), 'parsing.list_parser.ListParser', 'ListParser', ([], {'pages': '(600, 5000)'}), '(pages=(600, 5000))\n', (681, 700), False, 'from parsing.list_parser import ListParser\n'), ((723, 735), 'parsing.item_parser.ItemParser', 'ItemParser', ([], {}), '()\n', (733, 735), False, 'from parsing.item_parser import It... |
from AI import trie
import itertools
def test_trie():
target_trie = trie.Trie()
letters = "ABCDEFG"
words = []
for i in range(7, 1, -1):
permutations = list(itertools.permutations(letters, i))
for p in permutations:
word = ''.join(p)
if target_trie.search(word):... | [
"AI.trie.Trie",
"itertools.permutations"
] | [((74, 85), 'AI.trie.Trie', 'trie.Trie', ([], {}), '()\n', (83, 85), False, 'from AI import trie\n'), ((183, 217), 'itertools.permutations', 'itertools.permutations', (['letters', 'i'], {}), '(letters, i)\n', (205, 217), False, 'import itertools\n')] |
# (C) Datadog, Inc. 2010-present
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
import ipaddress
from collections import defaultdict
from pyasn1.type.univ import OctetString
from pysnmp import hlapi
from pysnmp.smi import builder, view
from datadog_checks.base import ConfigurationError, i... | [
"ipaddress.ip_network",
"pysnmp.hlapi.UsmUserData",
"pysnmp.smi.view.MibViewController",
"pyasn1.type.univ.OctetString",
"pysnmp.hlapi.ObjectType",
"collections.defaultdict",
"pysnmp.hlapi.SnmpEngine",
"pysnmp.hlapi.CommunityData",
"pysnmp.hlapi.UdpTransportTarget",
"pysnmp.smi.builder.DirMibSourc... | [((2369, 2385), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (2380, 2385), False, 'from collections import defaultdict\n'), ((4740, 4758), 'pysnmp.hlapi.SnmpEngine', 'hlapi.SnmpEngine', ([], {}), '()\n', (4756, 4758), False, 'from pysnmp import hlapi\n'), ((4946, 4981), 'pysnmp.smi.view.MibViewCo... |
import bot
if __name__ == "__main__":
print('Refreshing all...')
links = bot.db.getLinksList()
for link in links:
bot.refreshMatch(link)
print('Refreshed succesfully')
| [
"bot.db.getLinksList",
"bot.refreshMatch"
] | [((76, 97), 'bot.db.getLinksList', 'bot.db.getLinksList', ([], {}), '()\n', (95, 97), False, 'import bot\n'), ((120, 142), 'bot.refreshMatch', 'bot.refreshMatch', (['link'], {}), '(link)\n', (136, 142), False, 'import bot\n')] |
import asyncio
from tests.fixtures import auth_data, media_data
from wpclient.client import Client
from wpclient.models.media import MediaModel
async def create(auth_data, media_data):
async with Client(**auth_data) as client:
media = MediaModel.parse_obj(media_data)
coro = client.media.create(m... | [
"wpclient.client.Client",
"wpclient.models.media.MediaModel.parse_obj",
"tests.fixtures.media_data.copy"
] | [((1338, 1355), 'tests.fixtures.media_data.copy', 'media_data.copy', ([], {}), '()\n', (1353, 1355), False, 'from tests.fixtures import auth_data, media_data\n'), ((204, 223), 'wpclient.client.Client', 'Client', ([], {}), '(**auth_data)\n', (210, 223), False, 'from wpclient.client import Client\n'), ((251, 283), 'wpcli... |
import constants.cdr_cleaner.clean_cdr as cdr_consts
CLEAN_PPI_NUMERIC_FIELDS = """
UPDATE
`{project}.{dataset}.observation` u1
SET
u1.value_as_number = NULL,
u1.value_as_concept_id = 2000000010
FROM
(
SELECT
*
FROM
`{project}.{dataset}.observation`
WHERE
observation_concept_id = 1585889 AND (value_as_... | [
"cdr_cleaner.clean_cdr_engine.add_console_logging",
"cdr_cleaner.args_parser.parse_args",
"cdr_cleaner.clean_cdr_engine.clean_dataset"
] | [((2527, 2546), 'cdr_cleaner.args_parser.parse_args', 'parser.parse_args', ([], {}), '()\n', (2544, 2546), True, 'import cdr_cleaner.args_parser as parser\n'), ((2551, 2601), 'cdr_cleaner.clean_cdr_engine.add_console_logging', 'clean_engine.add_console_logging', (['ARGS.console_log'], {}), '(ARGS.console_log)\n', (2583... |
from ...exceptions.tardisexceptions import TardisError
from ...interfaces.siteadapter import ResourceStatus
from ...interfaces.siteadapter import SiteAdapter
from ...utilities.attributedict import AttributeDict
from ...utilities.staticmapping import StaticMapping
from contextlib import contextmanager
from datetime imp... | [
"uuid.uuid4",
"datetime.datetime.now",
"datetime.timedelta"
] | [((1446, 1460), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (1458, 1460), False, 'from datetime import datetime\n'), ((2952, 2989), 'datetime.timedelta', 'timedelta', ([], {'seconds': 'resource_boot_time'}), '(seconds=resource_boot_time)\n', (2961, 2989), False, 'from datetime import timedelta\n'), ((291... |
# import required libraries
import sounddevice as sd
from .recognize import *
from .record import *
from .ml import *
def speech(using,freq = 44100,duration = 5,key=None, language="en-US", show_all=False):
# Start recorder with the given values of
# duration and sample frequency
recording = sd.... | [
"sounddevice.wait"
] | [((456, 465), 'sounddevice.wait', 'sd.wait', ([], {}), '()\n', (463, 465), True, 'import sounddevice as sd\n'), ((1299, 1308), 'sounddevice.wait', 'sd.wait', ([], {}), '()\n', (1306, 1308), True, 'import sounddevice as sd\n')] |
from pycordia import errors, utils
import typing
import enum
class ComponentType(enum.Enum):
action_row = 1
button = 2
select_menu = 3
class ButtonStyles(enum.Enum):
primary = 1
secondary = 2
success = 3
danger = 4
link = 5
class SelectMenuOption:
def __init__(self, *, label: s... | [
"pycordia.utils.obj_to_dict",
"pycordia.errors.ComponentError",
"pycordia.utils.obj_from_dict"
] | [((656, 686), 'pycordia.utils.obj_from_dict', 'utils.obj_from_dict', (['data', 'cls'], {}), '(data, cls)\n', (675, 686), False, 'from pycordia import errors, utils\n'), ((726, 749), 'pycordia.utils.obj_to_dict', 'utils.obj_to_dict', (['self'], {}), '(self)\n', (743, 749), False, 'from pycordia import errors, utils\n'),... |
import sre_parse
import re
import pytest
def extract_literals(r):
ops = sre_parse.parse(r.pattern)
results = []
extract_literals_from_ops(ops, results)
return results
def extract_literals_from_ops(ops, results):
i = 0
while i < len(ops):
op, val = ops[i]
if op == sre_parse.L... | [
"pytest.mark.parametrize",
"sre_parse.parse",
"re.compile"
] | [((1146, 1420), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (["('r', 'expected')", "[('^abc$', ['abc']), ('abc|def', ['abc', 'def']), ('(abc|\\\\d+)', ['abc']),\n ('(?:abc){3,}', ['abc']), ('(?:abc){,3}', ['abc']), ('(?=abc)', ['abc']\n ), ('(?!abc)', ['abc']), ('(?<=abc)', ['abc']), ('(?<!abc)', ['abc'... |
import json
from entries.fcd import FCD
from entries.models import Nutrient, Recipe
def calculate_consumption(ndbno, measure, quantity):
nutrients = FCD.get_nutrients(ndbno)
intake = []
for nutrient in nutrients:
for i_measure in nutrient["measures"]:
if i_measure["label"] == measure ... | [
"entries.fcd.FCD.get_nutrients",
"entries.models.Recipe.objects.get",
"entries.models.Nutrient",
"json.dumps"
] | [((156, 180), 'entries.fcd.FCD.get_nutrients', 'FCD.get_nutrients', (['ndbno'], {}), '(ndbno)\n', (173, 180), False, 'from entries.fcd import FCD\n'), ((742, 778), 'json.dumps', 'json.dumps', (["{'ndbno': data['ndbno']}"], {}), "({'ndbno': data['ndbno']})\n", (752, 778), False, 'import json\n'), ((1146, 1179), 'entries... |
import random
letters = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L",
"M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]
numbers = ["1", "2", "3", "4", "5", "6", "7", "8", "9",]
symbols = ["@", "#", "%", "&", "*", "?", "-", "_"]
print("Welcome to PyPasswordGenerator")
nr_letters... | [
"random.shuffle",
"random.choice"
] | [((795, 823), 'random.shuffle', 'random.shuffle', (['chosen_chars'], {}), '(chosen_chars)\n', (809, 823), False, 'import random\n'), ((618, 640), 'random.choice', 'random.choice', (['letters'], {}), '(letters)\n', (631, 640), False, 'import random\n'), ((694, 716), 'random.choice', 'random.choice', (['numbers'], {}), '... |
# -*- coding: utf-8 -*-
"""
Copyright (c) 2017 Sightengine
http://sightengine.com/
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 us... | [
"requests.utils.default_headers",
"json.loads",
"requests.get"
] | [((1225, 1257), 'requests.utils.default_headers', 'requests.utils.default_headers', ([], {}), '()\n', (1255, 1257), False, 'import requests, json, os\n'), ((2283, 2301), 'json.loads', 'json.loads', (['r.text'], {}), '(r.text)\n', (2293, 2301), False, 'import requests, json, os\n'), ((1853, 2009), 'requests.get', 'reque... |
from os import listdir
from os.path import isdir, exists
from shutil import copyfile, copytree, rmtree
from tkinter import Tk, filedialog
done = False
ip = ""
packs = listdir("./datapacks")
target = ""
Tk().withdraw()
print("Welcome to Matt's Minecraft Datapack install utility")
print("First, choose the 'datapacks' f... | [
"os.listdir",
"shutil.rmtree",
"os.path.isdir",
"os.path.exists",
"tkinter.filedialog.askdirectory",
"shutil.copytree",
"tkinter.Tk"
] | [((168, 190), 'os.listdir', 'listdir', (['"""./datapacks"""'], {}), "('./datapacks')\n", (175, 190), False, 'from os import listdir\n'), ((203, 207), 'tkinter.Tk', 'Tk', ([], {}), '()\n', (205, 207), False, 'from tkinter import Tk, filedialog\n'), ((927, 952), 'tkinter.filedialog.askdirectory', 'filedialog.askdirectory... |
#!/usr/bin/env python
import logging
import os
class ProtocolsFlavor(object):
"""Base class for protocols"""
def binlog_player_protocol_flags(self):
"""Returns the flags to pass to process to set the binlog player protocol."""
return []
def vtctl_client_protocol(self):
"""Returns the protocol to u... | [
"logging.error",
"logging.debug"
] | [((1826, 1876), 'logging.debug', 'logging.debug', (['"""Using protocols flavor %s"""', 'flavor'], {}), "('Using protocols flavor %s', flavor)\n", (1839, 1876), False, 'import logging\n'), ((1727, 1779), 'logging.error', 'logging.error', (['"""Unknown protocols flavor %s"""', 'flavor'], {}), "('Unknown protocols flavor ... |
import unittest
from kattis import k_everywhere
###############################################################################
class SampleInput(unittest.TestCase):
'''Problem statement sample inputs and outputs'''
def test_sample_input_1(self):
'''Run and assert problem statement sample 1 input and... | [
"unittest.main",
"kattis.k_everywhere.uniques"
] | [((1053, 1068), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1066, 1068), False, 'import unittest\n'), ((616, 644), 'kattis.k_everywhere.uniques', 'k_everywhere.uniques', (['input1'], {}), '(input1)\n', (636, 644), False, 'from kattis import k_everywhere\n'), ((907, 935), 'kattis.k_everywhere.uniques', 'k_every... |
#!/usr/bin/env python3
# This variable defines all the external programs that this module
# relies on. lxbuildenv reads this variable in order to ensure
# the build will finish without exiting due to missing third-party
# programs.
LX_DEPENDENCIES = ["riscv", "icestorm", "yosys", "nextpnr-ice40"]
# Import lxbuildenv ... | [
"argparse.ArgumentParser",
"rtl.messible.Messible",
"migen.fhdl.specials.TSTriple",
"rtl.romgen.FirmwareROMHex",
"os.path.join",
"valentyusb.usbcore.io.IoBuf",
"litex.soc.doc.generate_docs",
"rtl.platform.fomu.add_platform_args",
"os.path.dirname",
"litex.soc.integration.builder.Builder",
"spibo... | [((10355, 10418), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Build Fomu Main Gateware"""'}), "(description='Build Fomu Main Gateware')\n", (10378, 10418), False, 'import argparse\n'), ((12329, 12354), 'rtl.platform.fomu.add_platform_args', 'add_platform_args', (['parser'], {}), '(par... |
import unittest
from code.permutation import load
class TestLoadData(unittest.TestCase):
features, box_office = load()
def test_load_returns_not_None(self):
self.assertIsNotNone(load())
def test_load_features_shape(self):
self.assertEquals((39360, 2), self.features.shape)
def test... | [
"code.permutation.load"
] | [((120, 126), 'code.permutation.load', 'load', ([], {}), '()\n', (124, 126), False, 'from code.permutation import load\n'), ((199, 205), 'code.permutation.load', 'load', ([], {}), '()\n', (203, 205), False, 'from code.permutation import load\n')] |
# -*- coding: utf-8 -*-
# Copyright 2015-2016 Telefónica Investigación y Desarrollo, S.A.U
#
# This file is part of FIWARE 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:
#
# htt... | [
"qautils.remote.fabric_utils.FabricUtils",
"subprocess.Popen"
] | [((1775, 1853), 'qautils.remote.fabric_utils.FabricUtils', 'FabricUtils', (['master_hostname', 'master_username', 'master_password', 'master_keyfile'], {}), '(master_hostname, master_username, master_password, master_keyfile)\n', (1786, 1853), False, 'from qautils.remote.fabric_utils import FabricUtils\n'), ((6067, 610... |
#!/usr/bin/env python
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2012,2013,2014,2015,2016,2017 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
#... | [
"unittest.TextTestRunner",
"unittest.TestLoader",
"utils.import_depends"
] | [((851, 873), 'utils.import_depends', 'utils.import_depends', ([], {}), '()\n', (871, 873), False, 'import utils\n'), ((11466, 11487), 'unittest.TestLoader', 'unittest.TestLoader', ([], {}), '()\n', (11485, 11487), False, 'import unittest\n'), ((11528, 11564), 'unittest.TextTestRunner', 'unittest.TextTestRunner', ([], ... |
# 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 use t... | [
"submarine.client.models.environment_spec.EnvironmentSpec",
"submarine.client.models.kernel_spec.KernelSpec",
"submarine.client.api.environment_client.EnvironmentClient"
] | [((1059, 1106), 'submarine.client.api.environment_client.EnvironmentClient', 'EnvironmentClient', ([], {'host': '"""http://localhost:8080"""'}), "(host='http://localhost:8080')\n", (1076, 1106), False, 'from submarine.client.api.environment_client import EnvironmentClient\n'), ((1125, 1236), 'submarine.client.models.ke... |
from . import base
import logging
logger = logging.getLogger(__name__)
class Team(base.Base):
pass
| [
"logging.getLogger"
] | [((45, 72), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (62, 72), False, 'import logging\n')] |
from .proxy import get_proxy
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
class Driver:
def __init__(self, *, ad_block: bool = False, use_proxy: bool = False, proxy: str = None):
self.ad_block = ad_block
self.use_proxy = use_proxy
self.proxy = proxy
... | [
"selenium.webdriver.chrome.options.Options",
"selenium.webdriver.Chrome"
] | [((728, 737), 'selenium.webdriver.chrome.options.Options', 'Options', ([], {}), '()\n', (735, 737), False, 'from selenium.webdriver.chrome.options import Options\n'), ((1048, 1117), 'selenium.webdriver.Chrome', 'webdriver.Chrome', (['"""/home/ubuntu/chromedriver"""'], {'options': 'chrome_options'}), "('/home/ubuntu/chr... |
import sys
from PyQt5.QtWidgets import QApplication
from PyQt5.QtWidgets import QStyle
from PyQt5.QtCore import Qt
import MainWindow
if __name__ == '__main__':
app = QApplication(sys.argv)
# Got a lot of errors related to Gtk on Linux:
# Gtk-CRITICAL **: IA__gtk_widget_style_get: assertion 'GTK_IS_WIDGE... | [
"PyQt5.QtWidgets.QApplication",
"MainWindow.MainWindow"
] | [((173, 195), 'PyQt5.QtWidgets.QApplication', 'QApplication', (['sys.argv'], {}), '(sys.argv)\n', (185, 195), False, 'from PyQt5.QtWidgets import QApplication\n'), ((639, 671), 'MainWindow.MainWindow', 'MainWindow.MainWindow', (['"""Alertor"""'], {}), "('Alertor')\n", (660, 671), False, 'import MainWindow\n')] |
import numpy as np
from unittest import TestCase
from diffprivlib.mechanisms import Exponential
from diffprivlib.utils import global_seed
class TestExponential(TestCase):
def setup_method(self, method):
if method.__name__ .endswith("prob"):
global_seed(314159)
self.mech = Exponential... | [
"diffprivlib.utils.global_seed",
"numpy.exp",
"diffprivlib.mechanisms.Exponential",
"numpy.log"
] | [((309, 322), 'diffprivlib.mechanisms.Exponential', 'Exponential', ([], {}), '()\n', (320, 322), False, 'from diffprivlib.mechanisms import Exponential\n'), ((4765, 4774), 'numpy.log', 'np.log', (['(2)'], {}), '(2)\n', (4771, 4774), True, 'import numpy as np\n'), ((268, 287), 'diffprivlib.utils.global_seed', 'global_se... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 14 10:53:06 2018
@author: anonymous
"""
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
import sys
sys.path.append('..')
if __name__ == '__main__':
from distributions import Categorical
from ego_map import Ego... | [
"torch.nn.LSTMCell",
"torch.randn",
"distributions.Categorical",
"torch.cat",
"torch.cos",
"torch.nn.init.calculate_gain",
"torch.no_grad",
"doom_a2c.arguments.parse_game_args",
"sys.path.append",
"torch.load",
"torch.diag",
"torch.Tensor",
"torch.nn.functional.relu",
"torch.nn.Linear",
... | [((201, 222), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (216, 222), False, 'import sys\n'), ((966, 985), 'torch.qr', 'torch.qr', (['flattened'], {}), '(flattened)\n', (974, 985), False, 'import torch\n'), ((1070, 1086), 'torch.diag', 'torch.diag', (['r', '(0)'], {}), '(r, 0)\n', (1080, 1086)... |
#!/usr/bin/env python
from collections import namedtuple
from typing import (
Dict,
List,
Optional,
)
from hummingbot.core.data_type.order_book_row import OrderBookRow
from hummingbot.core.data_type.order_book_message import (
OrderBookMessage,
OrderBookMessageType,
)
NdaxOrderBookEntry = namedtu... | [
"collections.namedtuple",
"hummingbot.core.data_type.order_book_row.OrderBookRow"
] | [((313, 463), 'collections.namedtuple', 'namedtuple', (['"""NdaxOrderBookEntry"""', '"""mdUpdateId accountId actionDateTime actionType lastTradePrice orderId price productPairCode quantity side"""'], {}), "('NdaxOrderBookEntry',\n 'mdUpdateId accountId actionDateTime actionType lastTradePrice orderId price productPa... |
from bing_image_downloader import downloader
downloader.download("people from drone view", limit=1000, output_dir='images', adult_filter_off=False)
# First one is the query for search
# Second one is the limit of images to download
# Third one is the output directory
# Fourth one is the adult filter off (which is cl... | [
"bing_image_downloader.downloader.download"
] | [((46, 153), 'bing_image_downloader.downloader.download', 'downloader.download', (['"""people from drone view"""'], {'limit': '(1000)', 'output_dir': '"""images"""', 'adult_filter_off': '(False)'}), "('people from drone view', limit=1000, output_dir=\n 'images', adult_filter_off=False)\n", (65, 153), False, 'from bi... |
# Copyright (c) 2019-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import pytest
from codegen_sources.preprocessing.lang_processors.java_processor import JavaProcessor
from pathlib import Path
... | [
"pathlib.Path",
"pytest.mark.skip"
] | [((13180, 13215), 'pytest.mark.skip', 'pytest.mark.skip', (['"""Helper function"""'], {}), "('Helper function')\n", (13196, 13215), False, 'import pytest\n'), ((359, 373), 'pathlib.Path', 'Path', (['__file__'], {}), '(__file__)\n', (363, 373), False, 'from pathlib import Path\n')] |
"""
Script to find all contrast curve .csv files,
read them, and re-write them in the TRICERATOPS
contrast folder using the required data format.
"""
# CDD
# Created: 5/28/22
# Updated: 5/28/22
import numpy as np
import pandas as pd
import os as os
import glob as glob
#Defaults
verbose = False
#Files and directori... | [
"pandas.read_csv",
"glob.glob"
] | [((533, 551), 'glob.glob', 'glob.glob', (['namestr'], {}), '(namestr)\n', (542, 551), True, 'import glob as glob\n'), ((1703, 1720), 'pandas.read_csv', 'pd.read_csv', (['file'], {}), '(file)\n', (1714, 1720), True, 'import pandas as pd\n')] |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS
Community Edition) available.
Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | [
"bklogin.bkauth.actions.login_failed_response",
"bklogin.common.log.logger.debug",
"bklogin.bkauth.actions.login_success_response",
"django.contrib.auth.authenticate",
"bklogin.bkauth.actions.login_redirect_response"
] | [((2659, 2682), 'django.contrib.auth.authenticate', 'authenticate', ([], {'code': 'code'}), '(code=code)\n', (2671, 2682), False, 'from django.contrib.auth import authenticate\n'), ((2935, 3028), 'bklogin.common.log.logger.debug', 'logger.debug', (['"""custom_login:oauth.google login success, will redirect_to=%s"""', '... |
"""
ShakeDrop-ResNet for CIFAR/SVHN, implemented in Gluon.
Original paper: 'ShakeDrop Regularization for Deep Residual Learning,' https://arxiv.org/abs/1802.02375.
"""
__all__ = ['CIFARShakeDropResNet', 'shakedropresnet20_cifar10', 'shakedropresnet20_cifar100', 'shakedropresnet20_svhn']
import os
import numpy... | [
"numpy.random.binomial",
"mxnet.autograd.is_training",
"mxnet.autograd.record",
"mxnet.gluon.nn.HybridSequential",
"mxnet.gluon.nn.Dense",
"mxnet.gluon.nn.Activation",
"mxnet.nd.zeros",
"mxnet.nd.broadcast_mul",
"mxnet.cpu",
"mxnet.gluon.nn.AvgPool2D",
"os.path.join",
"mxnet.gluon.nn.Flatten",... | [((6743, 6748), 'mxnet.cpu', 'cpu', ([], {}), '()\n', (6746, 6748), False, 'from mxnet import cpu\n'), ((6785, 6822), 'os.path.join', 'os.path.join', (['"""~"""', '""".mxnet"""', '"""models"""'], {}), "('~', '.mxnet', 'models')\n", (6797, 6822), False, 'import os\n'), ((834, 859), 'mxnet.autograd.is_training', 'mx.auto... |
# Bare ``settings.py`` for running tests for url_filter
import os
from sqlalchemy import create_engine
DEBUG = True
INTERNAL_IPS = ['127.0.0.1']
if os.environ.get('USE_POSTGRES') == 'True':
SQLALCHEMY_ENGINE = create_engine('postgresql://postgres:test@localhost:5432', echo=True)
DATABASES = {
'defau... | [
"os.environ.get",
"sqlalchemy.create_engine"
] | [((152, 182), 'os.environ.get', 'os.environ.get', (['"""USE_POSTGRES"""'], {}), "('USE_POSTGRES')\n", (166, 182), False, 'import os\n'), ((218, 287), 'sqlalchemy.create_engine', 'create_engine', (['"""postgresql://postgres:test@localhost:5432"""'], {'echo': '(True)'}), "('postgresql://postgres:test@localhost:5432', ech... |
from django.db import models
from django.conf import settings
from django.contrib.auth.models import User
from ckeditor.fields import RichTextField
from ckeditor_uploader.fields import RichTextUploadingField
from django.urls import reverse
import django.db.models.deletion
def upload_location(instance,filename):
return... | [
"django.db.models.FileField",
"django.db.models.TextField",
"django.db.models.CharField",
"django.db.models.ForeignKey",
"ckeditor_uploader.fields.RichTextUploadingField",
"django.db.models.SlugField",
"django.db.models.BooleanField",
"django.db.models.ImageField",
"django.urls.reverse",
"django.d... | [((411, 443), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)'}), '(max_length=100)\n', (427, 443), False, 'from django.db import models\n'), ((452, 497), 'django.db.models.SlugField', 'models.SlugField', ([], {'max_length': '(100)', 'unique': '(True)'}), '(max_length=100, unique=True)\n', ... |
import numpy as np
import pandas as pd
import pulp
from laptimize.curve_approximation import CurveApproximator
from laptimize.log import LogFactory
class LAPModel(object):
"""solve the linear approximated LP problem and sub problems"""
def __init__(self, name='nlp_problem'):
self.logger = LogFactory... | [
"pandas.DataFrame",
"pulp.lpSum",
"laptimize.curve_approximation.CurveApproximator",
"pulp.LpVariable.dict",
"numpy.arange",
"pulp.LpProblem",
"pulp.PULP_CBC_CMD",
"pandas.concat",
"laptimize.log.LogFactory.get_logger"
] | [((310, 333), 'laptimize.log.LogFactory.get_logger', 'LogFactory.get_logger', ([], {}), '()\n', (331, 333), False, 'from laptimize.log import LogFactory\n'), ((392, 406), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (404, 406), True, 'import pandas as pd\n'), ((428, 442), 'pandas.DataFrame', 'pd.DataFrame', ([... |
# Generated by Django 3.2.7 on 2021-10-17 07:36
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('x509_pki', '0009_auto_20211017_0921'),
]
operations = [
migrations.RemoveField(
model_name='key... | [
"django.db.migrations.RemoveField",
"django.db.models.TextField",
"django.db.models.OneToOneField",
"django.db.models.AutoField"
] | [((269, 326), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""keystore"""', 'name': '"""crl"""'}), "(model_name='keystore', name='crl')\n", (291, 326), False, 'from django.db import migrations, models\n'), ((468, 561), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_c... |
import websockets
import asyncio
import time
import json
from normalise.phemex_normalisation import NormalisePhemex
from helpers.read_config import get_symbols
from sink_connector.kafka_producer import KafkaProducer
from sink_connector.ws_to_kafka import produce_messages
from source_connector.websocket_connec... | [
"sink_connector.kafka_producer.KafkaProducer",
"helpers.read_config.get_symbols",
"json.dumps",
"source_connector.websocket_connector.connect",
"normalise.phemex_normalisation.NormalisePhemex"
] | [((411, 438), 'sink_connector.kafka_producer.KafkaProducer', 'KafkaProducer', (['"""phemex-raw"""'], {}), "('phemex-raw')\n", (424, 438), False, 'from sink_connector.kafka_producer import KafkaProducer\n'), ((466, 500), 'sink_connector.kafka_producer.KafkaProducer', 'KafkaProducer', (['"""phemex-normalised"""'], {}), "... |
# Copyright (C) 2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
from mpa.utils.logger import get_logger
logger = get_logger()
class CDLIterator:
def __init__(self, cdl):
self._cdl = cdl
self._index = 0
self._cdl_iter = [iter(dl) for dl in self._cdl.loaders]
def __next... | [
"mpa.utils.logger.get_logger"
] | [((130, 142), 'mpa.utils.logger.get_logger', 'get_logger', ([], {}), '()\n', (140, 142), False, 'from mpa.utils.logger import get_logger\n')] |
#!/usr/bin/env python
"""
Command line tool for distance 2 self calculation
"""
import sys
import argparse
import csv
import logging
import os
import pandas
import itertools as itr
from Distance2SelfBinding import Distance2Self
from DistanceMatrix import DistanceMatrix
from Fred2.Core import Allele
def read_hla_i... | [
"argparse.ArgumentParser",
"pandas.DataFrame.from_csv",
"pandas.merge",
"Distance2SelfBinding.Distance2Self",
"os.path.isfile",
"os.path.splitext",
"itertools.groupby"
] | [((1036, 1103), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Distance to self calculation"""'}), "(description='Distance to self calculation')\n", (1059, 1103), False, 'import argparse\n'), ((4702, 4740), 'Distance2SelfBinding.Distance2Self', 'Distance2Self', (['blos'], {'saveTrieFile'... |
"""
index.py
Copyright 2015 <NAME>
This file is part of w3af, http://w3af.org/ .
w3af is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation version 2 of the License.
w3af is distributed in the hope that it will be us... | [
"flask.jsonify",
"w3af.core.ui.api.app.route"
] | [((811, 842), 'w3af.core.ui.api.app.route', 'app.route', (['"""/"""'], {'methods': "['GET']"}), "('/', methods=['GET'])\n", (820, 842), False, 'from w3af.core.ui.api import app\n'), ((882, 948), 'flask.jsonify', 'jsonify', (["{'docs': 'http://docs.w3af.org/en/latest/api/index.html'}"], {}), "({'docs': 'http://docs.w3af... |
# coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | [
"oci.util.formatted_flat_dict"
] | [((8403, 8428), 'oci.util.formatted_flat_dict', 'formatted_flat_dict', (['self'], {}), '(self)\n', (8422, 8428), False, 'from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel\n')] |
import re
import decimal
import datetime
import collections
from . import processors
from . import _compat
import mt940
class Model(object):
pass
class Date(datetime.date, Model):
'''Just a regular date object which supports dates given as strings
Args:
year (str): The year (0-100), will autom... | [
"datetime.date.__new__",
"re.compile"
] | [((5605, 5691), 're.compile', 're.compile', (['"""^:(?P<full_tag>(?P<tag>[0-9]{2})(?P<sub_tag>[A-Z])?):"""', 're.MULTILINE'], {}), "('^:(?P<full_tag>(?P<tag>[0-9]{2})(?P<sub_tag>[A-Z])?):', re.\n MULTILINE)\n", (5615, 5691), False, 'import re\n'), ((764, 808), 'datetime.date.__new__', 'datetime.date.__new__', (['cls... |
#!/usr/bin/env python
# Name: testManager.py
# Abstract:
# A python tool to launch and manage EPICS CA and PVA stress tests
# Uses threading and paramiko ssh transport to run needed clients and servers on
# each host machine which will be used in the test.
#
# Example:
# stressTest/testManager.py --testDir /path/to/t... | [
"textwrap.dedent",
"subprocess.Popen",
"subprocess.check_status",
"os.path.join",
"argparse.ArgumentParser",
"os.path.dirname",
"time.sleep",
"datetime.datetime.strptime",
"datetime.timedelta",
"pprint.pprint",
"string.printable.replace",
"signal.signal",
"os.path.split",
"datetime.datetim... | [((4487, 4541), 're.compile', 're.compile', (['"""^\\\\s*([a-zA-Z0-9_]*)\\\\s*=\\\\s*(\\\\S*)\\\\s*$"""'], {}), "('^\\\\s*([a-zA-Z0-9_]*)\\\\s*=\\\\s*(\\\\S*)\\\\s*$')\n", (4497, 4541), False, 'import re\n'), ((4564, 4621), 're.compile', 're.compile', (['"""^\\\\s*([a-zA-Z0-9_]*)\\\\s*=\\\\s*\'([^\']*)\'\\\\s*$"""'], {... |
import boto3
import click
elbList = boto3.client('elbv2')
rgapi = boto3.client('resourcegroupstaggingapi')
"""
def lst_targets(lbar):
tgs = []
tgroups = elbList.describe_target_groups(LoadBalancerArn=lbar)
for tg in tgroups['TargetGroups']:
targetgps = tg['TargetGroupArn']
print(targetgps)
... | [
"click.group",
"click.option",
"boto3.client"
] | [((36, 57), 'boto3.client', 'boto3.client', (['"""elbv2"""'], {}), "('elbv2')\n", (48, 57), False, 'import boto3\n'), ((66, 106), 'boto3.client', 'boto3.client', (['"""resourcegroupstaggingapi"""'], {}), "('resourcegroupstaggingapi')\n", (78, 106), False, 'import boto3\n'), ((1504, 1525), 'boto3.client', 'boto3.client'... |
import uuid
import pytest
from circle_core.message import ModuleMessage
from circle_core.serialize import serialize
from circle_core.types import BlobMetadata
from circle_core.workers.blobstore import StoredBlob
@pytest.mark.parametrize( # noqa: F811
('payload', 'expected'),
[
(
{'data'... | [
"circle_core.types.BlobMetadata",
"circle_core.serialize.serialize",
"uuid.UUID",
"circle_core.workers.blobstore.StoredBlob"
] | [((1139, 1157), 'circle_core.serialize.serialize', 'serialize', (['message'], {}), '(message)\n', (1148, 1157), False, 'from circle_core.serialize import serialize\n'), ((1041, 1090), 'uuid.UUID', 'uuid.UUID', (['"""539CE356-A7CB-4BFC-853E-C1A8147F021F"""'], {}), "('539CE356-A7CB-4BFC-853E-C1A8147F021F')\n", (1050, 109... |
"""
Testcases for the pytest plugin of Yagot.
Note: 'testdir' is a fixture provided by the pytester plugin of pytest.
See https://docs.pytest.org/en/latest/reference.html#testdir for details.
"""
import pytest
def test_help_message(testdir):
"""
Test that the Yagot plugin's options appear in the pytest help... | [
"pytest.mark.xfail"
] | [((3019, 3088), 'pytest.mark.xfail', 'pytest.mark.xfail', ([], {'reason': '"""Increased reference count is not detected"""'}), "(reason='Increased reference count is not detected')\n", (3036, 3088), False, 'import pytest\n')] |
#!/usr/bin/env python3
"""
Author : fleide <<EMAIL>>
Date : 2020-12-04
Purpose: Picnic
"""
import argparse
# --------------------------------------------------
def get_args():
"""Get command-line arguments"""
parser = argparse.ArgumentParser(
description='Rock the Casbah',
formatter_class=... | [
"argparse.ArgumentParser"
] | [((232, 347), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Rock the Casbah"""', 'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter'}), "(description='Rock the Casbah', formatter_class=\n argparse.ArgumentDefaultsHelpFormatter)\n", (255, 347), False, 'import argparse\n')] |
"""Cross-reference object definition.
"""
import typing
import fastobo
from .utils.meta import roundrepr, typechecked
__all__ = ["Xref"]
@roundrepr
class Xref(object):
"""A cross-reference to another document or resource.
Cross-references (xrefs for short) can be used to back-up definitions of
entit... | [
"fastobo.id.is_valid"
] | [((2457, 2480), 'fastobo.id.is_valid', 'fastobo.id.is_valid', (['id'], {}), '(id)\n', (2476, 2480), False, 'import fastobo\n')] |
from blesuite.pybt.roles import LECentral, LEPeripheral
from blesuite.pybt.core import Connection
from blesuite.pybt.gatt import UUID, AttributeDatabase, Server
from blesuite.pybt.gap import GAP
from blesuite.gatt_procedures import gatt_procedure_write_handle, gatt_procedure_write_handle_async, \
... | [
"blesuite.entities.gatt_device.BLEDevice",
"blesuite.gatt_procedures.gatt_procedure_execute_write",
"blesuite.smart_scan.blesuite_smart_scan",
"blesuite.pybt.gatt.AttributeDatabase",
"blesuite.gatt_procedures.gatt_procedure_read_multiple_handles",
"blesuite.pybt.roles.LEPeripheral",
"blesuite.utils.vali... | [((1647, 1674), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1664, 1674), False, 'import logging\n'), ((1693, 1714), 'logging.NullHandler', 'logging.NullHandler', ([], {}), '()\n', (1712, 1714), False, 'import logging\n'), ((9844, 9896), 'blesuite.pybt.core.Connection', 'Connection', (... |
#!/usr/bin/env python
import itertools
from cloud.clouds import get_region, Cloud, get_regions
from test_steps.do_test import do_batch
from util.utils import set_cwd, random_id, Timer, init_logger
init_logger()
def test1():
run_id = random_id()
t1 = (get_region(Cloud.GCP, "us-east1"), {})
t2 = (get_regi... | [
"util.utils.Timer",
"util.utils.random_id",
"util.utils.init_logger",
"test_steps.do_test.do_batch",
"cloud.clouds.get_region",
"util.utils.set_cwd",
"itertools.product",
"cloud.clouds.get_regions"
] | [((199, 212), 'util.utils.init_logger', 'init_logger', ([], {}), '()\n', (210, 212), False, 'from util.utils import set_cwd, random_id, Timer, init_logger\n'), ((241, 252), 'util.utils.random_id', 'random_id', ([], {}), '()\n', (250, 252), False, 'from util.utils import set_cwd, random_id, Timer, init_logger\n'), ((556... |
# Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed
# under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licens... | [
"concourse.model.resources.ResourceIdentifier",
"util.not_none",
"toposort.toposort",
"concourse.model.base.select_attr"
] | [((1117, 1144), 'util.not_none', 'not_none', (['resource_registry'], {}), '(resource_registry)\n', (1125, 1144), False, 'from util import not_none\n'), ((1967, 2032), 'concourse.model.resources.ResourceIdentifier', 'ResourceIdentifier', ([], {'type_name': '"""meta"""', 'base_name': 'self.variant_name'}), "(type_name='m... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `simu_linear` package."""
import pytest
import numpy as np
from thermo.chemical import Chemical
from pandangas import simu_linear as sim
from pandangas import topology as top
from fixtures import simple_network
def test_solve():
# 3 * x0 + x1 = 9 and ... | [
"pandangas.simu_linear.create_b",
"pandangas.simu_linear.solve",
"pandangas.simu_linear.create_a",
"pandangas.simu_linear.run_one_level",
"pandangas.simu_linear._operating_pressures_as_dict",
"numpy.array",
"pandangas.topology.graphs_by_level_as_dict",
"thermo.chemical.Chemical",
"pandangas.simu_lin... | [((363, 389), 'numpy.array', 'np.array', (['[[3, 1], [1, 2]]'], {}), '([[3, 1], [1, 2]])\n', (371, 389), True, 'import numpy as np\n'), ((398, 414), 'numpy.array', 'np.array', (['[9, 8]'], {}), '([9, 8])\n', (406, 414), True, 'import numpy as np\n'), ((508, 536), 'numpy.array', 'np.array', (['[1, 0, 0, 1, 0, 1]'], {}),... |
from django.urls import path, include
from .views import BookViewSet, LoanViewSet, UserViewSet, SelfView, AllBooksView
from rest_framework import routers
router = routers.DefaultRouter()
router.register(r'books', BookViewSet)
router.register(r'loans', LoanViewSet)
router.register(r'users', UserViewSet)
urlpatterns = ... | [
"rest_framework.routers.DefaultRouter",
"django.urls.include"
] | [((164, 187), 'rest_framework.routers.DefaultRouter', 'routers.DefaultRouter', ([], {}), '()\n', (185, 187), False, 'from rest_framework import routers\n'), ((421, 441), 'django.urls.include', 'include', (['router.urls'], {}), '(router.urls)\n', (428, 441), False, 'from django.urls import path, include\n')] |
# Copyright 2019 NeuroData (http://neurodata.io)
#
# 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 ag... | [
"numpy.min",
"numpy.sqrt",
"numpy.max",
"numpy.hstack"
] | [((5492, 5538), 'numpy.hstack', 'np.hstack', (['[U[:, :best_dimension] for U in Us]'], {}), '([U[:, :best_dimension] for U in Us])\n', (5501, 5538), True, 'import numpy as np\n'), ((5556, 5604), 'numpy.hstack', 'np.hstack', (['[V.T[:, :best_dimension] for V in Vs]'], {}), '([V.T[:, :best_dimension] for V in Vs])\n', (5... |
import logging
import sys
import traceback
from cliff import show
import pkg_resources
LOG = logging.getLogger(__name__)
class EntryPointShow(show.ShowOne):
"""Shows the details for a single entry point.
"""
def get_parser(self, prog_name):
p = super(EntryPointShow, self).get_parser(prog_name)... | [
"pkg_resources.get_distribution",
"sys.exc_info",
"pkg_resources.get_entry_info",
"pkg_resources.iter_entry_points",
"logging.getLogger"
] | [((96, 123), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (113, 123), False, 'import logging\n'), ((1019, 1075), 'pkg_resources.get_distribution', 'pkg_resources.get_distribution', (['parsed_args.distribution'], {}), '(parsed_args.distribution)\n', (1049, 1075), False, 'import pkg_resou... |
from flask import Flask, request, redirect, render_template, session
from flask.json import jsonify
import os
app = Flask(__name__)
# convert transaction Hach to a 6 base
def reVal(num):
if (num >= 0 and num <= 9):
return chr(num + ord('0'))
else:
return chr(num - 10 + ord('A'))
# Ut... | [
"flask.json.jsonify",
"flask.Flask",
"flask.request.get_json"
] | [((117, 132), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (122, 132), False, 'from flask import Flask, request, redirect, render_template, session\n'), ((1912, 1930), 'flask.request.get_json', 'request.get_json', ([], {}), '()\n', (1928, 1930), False, 'from flask import Flask, request, redirect, render_... |
from indy_node.server.upgrade_log import UpgradeLog
from indy_node.test import waits
from indy_node.test.upgrade.helper import checkUpgradeScheduled, sdk_ensure_upgrade_sent
from plenum.common.constants import VERSION
from plenum.common.messages.node_messages import Propagate
from plenum.common.request import Request
f... | [
"indy_node.test.waits.expectedUpgradeScheduled",
"plenum.test.delayers.ppgDelay",
"plenum.test.delayers.req_delay",
"indy_node.test.upgrade.helper.sdk_ensure_upgrade_sent",
"indy_node.test.upgrade.helper.checkUpgradeScheduled",
"plenum.test.test_node.getNonPrimaryReplicas"
] | [((1983, 2081), 'indy_node.test.upgrade.helper.sdk_ensure_upgrade_sent', 'sdk_ensure_upgrade_sent', (['looper', 'sdk_pool_handle', 'sdk_wallet_trustee', 'validUpgradeExpForceTrue'], {}), '(looper, sdk_pool_handle, sdk_wallet_trustee,\n validUpgradeExpForceTrue)\n', (2006, 2081), False, 'from indy_node.test.upgrade.h... |
# Copyright (C) 2021, Pyronear contributors.
# This program is licensed under the Apache License version 2.
# See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0.txt> for full license details.
from typing import List
from fastapi import APIRouter, Path, Security
from app.api import crud
from app.db impo... | [
"app.api.crud.get_entry",
"fastapi.Path",
"fastapi.Security",
"app.api.crud.fetch_all",
"fastapi.APIRouter"
] | [((438, 449), 'fastapi.APIRouter', 'APIRouter', ([], {}), '()\n', (447, 449), False, 'from fastapi import APIRouter, Path, Security\n'), ((597, 612), 'fastapi.Path', 'Path', (['...'], {'gt': '(0)'}), '(..., gt=0)\n', (601, 612), False, 'from fastapi import APIRouter, Path, Security\n'), ((616, 671), 'fastapi.Security',... |
#############################################################################
#
# A test for the PyroNS_NTService program
# Author: <NAME> <EMAIL>
#
# This is part of "Pyro" - Python Remote Objects
# Which is (c) <NAME> - <EMAIL>
#
#############################################################################
import... | [
"unittest.main",
"win32serviceutil.StartService",
"win32serviceutil.StopService",
"time.sleep",
"win32serviceutil.QueryServiceStatus"
] | [((2653, 2668), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2666, 2668), False, 'import unittest\n'), ((478, 520), 'win32serviceutil.StartService', 'win32serviceutil.StartService', (['ServiceName'], {}), '(ServiceName)\n', (507, 520), False, 'import win32serviceutil\n'), ((622, 670), 'win32serviceutil.QuerySer... |
#!/usr/bin/python3
if __name__=="__main__":
# executable in ubuntu: https://stackoverflow.com/a/64641595/2351696
import models
from forms import home
models.create_tables_if_not_exist()
root=home.Tk()
root['bg']='black'
root.resizable(0,0)
frmmenu=home.FormMenu(root)
root.mainloop()
| [
"models.create_tables_if_not_exist",
"forms.home.Tk",
"forms.home.FormMenu"
] | [((159, 194), 'models.create_tables_if_not_exist', 'models.create_tables_if_not_exist', ([], {}), '()\n', (192, 194), False, 'import models\n'), ((201, 210), 'forms.home.Tk', 'home.Tk', ([], {}), '()\n', (208, 210), False, 'from forms import home\n'), ((261, 280), 'forms.home.FormMenu', 'home.FormMenu', (['root'], {}),... |
# -*- coding: utf-8 -*-
'''
Manage Data Pipelines
.. versionadded:: 2016.3.0
Be aware that this interacts with Amazon's services, and so may incur charges.
This module uses ``boto3``, which can be installed via package, or pip.
This module accepts explicit AWS credentials but can also utilize
IAM roles assigned to ... | [
"salt.ext.six.moves.zip",
"copy.deepcopy",
"datetime.datetime.strptime",
"salt.ext.six.iteritems"
] | [((11166, 11198), 'copy.deepcopy', 'copy.deepcopy', (['_pipeline_objects'], {}), '(_pipeline_objects)\n', (11179, 11198), False, 'import copy\n'), ((14023, 14047), 'copy.deepcopy', 'copy.deepcopy', (['structure'], {}), '(structure)\n', (14036, 14047), False, 'import copy\n'), ((16449, 16471), 'salt.ext.six.iteritems', ... |
import numpy as np
from numpy.core.function_base import linspace
EPS = 1e-9
class CameraSensor:
"""
Defines the camera sensor properties
"""
def __init__(self, image_size, pitch, RGB=False, name=None, bayer_pattern=None):
self.img_size = np.array([image_size[0], image_size[1]]) # image heig... | [
"numpy.meshgrid",
"numpy.array",
"numpy.float",
"numpy.linspace"
] | [((264, 304), 'numpy.array', 'np.array', (['[image_size[0], image_size[1]]'], {}), '([image_size[0], image_size[1]])\n', (272, 304), True, 'import numpy as np\n'), ((1217, 1286), 'numpy.linspace', 'np.linspace', (['(-w / 2 + dw / 2)', '(+w / 2 - dw / 2 + EPS)', 'self.img_size[1]'], {}), '(-w / 2 + dw / 2, +w / 2 - dw /... |
###############################################################################
# WordTokenizer
from nimbusml import Pipeline, FileDataStream
from nimbusml.datasets import get_dataset
from nimbusml.preprocessing.text import WordTokenizer
# data input (as a FileDataStream)
path = get_dataset("wiki_detox_train").as_fi... | [
"nimbusml.FileDataStream.read_csv",
"nimbusml.Pipeline",
"nimbusml.datasets.get_dataset",
"nimbusml.preprocessing.text.WordTokenizer"
] | [((337, 376), 'nimbusml.FileDataStream.read_csv', 'FileDataStream.read_csv', (['path'], {'sep': '"""\t"""'}), "(path, sep='\\t')\n", (360, 376), False, 'from nimbusml import Pipeline, FileDataStream\n'), ((889, 909), 'nimbusml.Pipeline', 'Pipeline', (['[tokenize]'], {}), '([tokenize])\n', (897, 909), False, 'from nimbu... |
import argparse
import sys
import json
from zsearch_definitions import protocols
from ztag.stream import Stream, Incoming, Outgoing, InputFile, OutputFile
from ztag.transform import Transform, Decoder, Encoder
from ztag.decoders import JSONDecoder
from ztag.encoders import JSONEncoder
from ztag.annotation import Anno... | [
"zsearch_definitions.protocols.Subprotocol._by_pretty_name.keys",
"argparse.ArgumentParser",
"ztag.annotator.Annotator",
"json.dumps",
"datetime.datetime.utcnow",
"ztag.annotator.AnnotationTesting",
"zsearch_definitions.protocols.Protocol._by_pretty_name.keys",
"argparse.ArgumentTypeError",
"zsearch... | [((1122, 1147), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1145, 1147), False, 'import argparse\n'), ((3244, 3289), 'ztag.annotation.Annotation.load_annotations', 'Annotation.load_annotations', (['args.safe_import'], {}), '(args.safe_import)\n', (3271, 3289), False, 'from ztag.annotation i... |
import os
import sys
import argparse
import logging
# import project modules
# Add base project path (two directories up)
currPath = os.path.dirname(os.path.realpath(__file__))
rootPath = os.path.dirname(os.path.dirname(currPath))
sys.path.append(rootPath)
from rtCommon.utils import loadConfigFile, installLoggers
from ... | [
"sys.path.append",
"argparse.ArgumentParser",
"os.path.realpath",
"os.path.dirname",
"rtCommon.projectInterface.Web",
"rtCommon.structDict.StructDict",
"os.path.join",
"rtCommon.utils.loadConfigFile"
] | [((231, 256), 'sys.path.append', 'sys.path.append', (['rootPath'], {}), '(rootPath)\n', (246, 256), False, 'import sys\n'), ((417, 467), 'os.path.join', 'os.path.join', (['currPath', '"""conf/amygActivation.toml"""'], {}), "(currPath, 'conf/amygActivation.toml')\n", (429, 467), False, 'import os\n'), ((480, 523), 'os.p... |
from cosalib.cmdlib import run_verbose
def remove_azure_image(image, resource_group, auth, profile):
print(f"Azure: removing image {image}")
try:
run_verbose(['ore', 'azure',
'--azure-auth', auth,
'--azure-profile', profile,
'delete-image-arm... | [
"cosalib.cmdlib.run_verbose"
] | [((164, 330), 'cosalib.cmdlib.run_verbose', 'run_verbose', (["['ore', 'azure', '--azure-auth', auth, '--azure-profile', profile,\n 'delete-image-arm', '--image-name', image, '--resource-group',\n resource_group]"], {}), "(['ore', 'azure', '--azure-auth', auth, '--azure-profile',\n profile, 'delete-image-arm', ... |
#!/usr/bin/env python
"""
Segmentation methods to find regions of interest in the time and frequency domain.
"""
#
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
#
# License: New BSD License
# =============================================================================
# Load the modules
# ... | [
"pandas.DataFrame",
"numpy.isin",
"numpy.asarray",
"numpy.zeros",
"maad.util.plot2d",
"skimage.measure.label",
"numpy.where",
"skimage.measure.regionprops"
] | [((12272, 12292), 'skimage.measure.label', 'measure.label', (['im_t2'], {}), '(im_t2)\n', (12285, 12292), False, 'from skimage import measure\n'), ((12354, 12393), 'skimage.measure.regionprops', 'measure.regionprops', (['conncomp_t2', 'im_t3'], {}), '(conncomp_t2, im_t3)\n', (12373, 12393), False, 'from skimage import ... |
# -*- coding: utf-8 -*-
from django.http import HttpResponseRedirect
from django.utils.timezone import now
class AccountAlertMiddleware(object):
def process_request(self, request):
if getattr(request, 'user', None) and request.user.is_authenticated():
alerts = request.user.accountalert_set.fi... | [
"django.utils.timezone.now",
"django.http.HttpResponseRedirect"
] | [((507, 542), 'django.http.HttpResponseRedirect', 'HttpResponseRedirect', (['alerts[0].url'], {}), '(alerts[0].url)\n', (527, 542), False, 'from django.http import HttpResponseRedirect\n'), ((415, 420), 'django.utils.timezone.now', 'now', ([], {}), '()\n', (418, 420), False, 'from django.utils.timezone import now\n')] |
# Generated by Django 2.2.10 on 2020-05-18 10:48
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('events', '0008_alter_field_classification_on_event'),
('core', '0031_delete_item'),
]
operations = [
migrations.DeleteModel(
na... | [
"django.db.migrations.DeleteModel"
] | [((282, 321), 'django.db.migrations.DeleteModel', 'migrations.DeleteModel', ([], {'name': '"""Instance"""'}), "(name='Instance')\n", (304, 321), False, 'from django.db import migrations\n')] |
from channels import Group
def ws_add(message):
print('Connection Recieved')
message.reply_channel.send({'accept':True})
Group('chat').add(message.reply_channel)
def ws_message(message):
print('Message received:{}'.format(message.content['text']))
Group('chat').send({'text': message.content['text']})
def ws_dis... | [
"channels.Group"
] | [((125, 138), 'channels.Group', 'Group', (['"""chat"""'], {}), "('chat')\n", (130, 138), False, 'from channels import Group\n'), ((255, 268), 'channels.Group', 'Group', (['"""chat"""'], {}), "('chat')\n", (260, 268), False, 'from channels import Group\n'), ((367, 380), 'channels.Group', 'Group', (['"""chat"""'], {}), "... |
# Copyright (c) 2010-2011 Lazy 8 Studios, LLC.
# All rights reserved.
from front.lib import db, utils
from front.tools import dump_user_routes, replay_game
from front.tests import base
from front.tests.base import points
class TestDumpUserRoutes(base.TestCase):
def setUp(self):
super(TestDumpUserRoutes, s... | [
"front.lib.db.conn",
"front.tools.dump_user_routes.targets_as_route_for_user_id",
"front.lib.utils.in_seconds"
] | [((652, 677), 'front.lib.utils.in_seconds', 'utils.in_seconds', ([], {'hours': '(4)'}), '(hours=4)\n', (668, 677), False, 'from front.lib import db, utils\n'), ((702, 728), 'front.lib.utils.in_seconds', 'utils.in_seconds', ([], {'hours': '(10)'}), '(hours=10)\n', (718, 728), False, 'from front.lib import db, utils\n'),... |
"""
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES O... | [
"magma.magmad.check.subprocess_workflow.exec_and_parse_subprocesses_async",
"magma.magmad.check.subprocess_workflow.exec_and_parse_subprocesses",
"collections.namedtuple"
] | [((708, 786), 'collections.namedtuple', 'namedtuple', (['"""TracerouteParams"""', "['host_or_ip', 'max_hops', 'bytes_per_packet']"], {}), "('TracerouteParams', ['host_or_ip', 'max_hops', 'bytes_per_packet'])\n", (718, 786), False, 'from collections import namedtuple\n'), ((837, 901), 'collections.namedtuple', 'namedtup... |
import tensorflow as tf
from tensorflow import keras
from models.layers import recurrent_dense
def lstm_guide_only_nolin_hp2_model(args,lstm_units=64, dense_units=16, recurrent_layers=1, dropout=0.0):
seq = keras.Input(shape=(None, 4)) # 4
x = keras.layers.Bidirectional(keras.layers.LSTM(lstm_units, dropou... | [
"tensorflow.keras.layers.Dense",
"tensorflow.keras.Input",
"models.layers.recurrent_dense",
"tensorflow.keras.Model",
"tensorflow.keras.layers.LSTM"
] | [((214, 242), 'tensorflow.keras.Input', 'keras.Input', ([], {'shape': '(None, 4)'}), '(shape=(None, 4))\n', (225, 242), False, 'from tensorflow import keras\n'), ((514, 556), 'tensorflow.keras.Model', 'keras.Model', ([], {'inputs': '[seq]', 'outputs': 'outputs'}), '(inputs=[seq], outputs=outputs)\n', (525, 556), False,... |
#! /usr/bin/python3
'''
Python script to pull through terminal the fileTree
'''
import sys
from src.CanvasBackend import semester_board as bk
if __name__ == '__main__':
bk.Profile(sys.argv[1]) | [
"src.CanvasBackend.semester_board.Profile"
] | [((175, 198), 'src.CanvasBackend.semester_board.Profile', 'bk.Profile', (['sys.argv[1]'], {}), '(sys.argv[1])\n', (185, 198), True, 'from src.CanvasBackend import semester_board as bk\n')] |
import logging
import os
import numpy as np
import argparse
import open3d as o3d
from urllib.request import urlretrieve
from util.visualization import get_colored_point_cloud_feature
from util.misc import extract_features
from model.resunet import ResUNetBN2C
import torch
if not os.path.isfile('ResUNetBN2C-16feat-3c... | [
"argparse.ArgumentParser",
"torch.load",
"open3d.io.read_point_cloud",
"open3d.geometry.PointCloud",
"model.resunet.ResUNetBN2C",
"urllib.request.urlretrieve",
"os.path.isfile",
"torch.cuda.is_available",
"numpy.array",
"open3d.utility.Vector3dVector"
] | [((283, 329), 'os.path.isfile', 'os.path.isfile', (['"""ResUNetBN2C-16feat-3conv.pth"""'], {}), "('ResUNetBN2C-16feat-3conv.pth')\n", (297, 329), False, 'import os\n'), ((367, 498), 'urllib.request.urlretrieve', 'urlretrieve', (['"""https://node1.chrischoy.org/data/publications/fcgf/2019-09-18_14-15-59.pth"""', '"""Res... |
import numpy as np
import sys
import os, psutil
from collections import deque
def mem() :
process = psutil.Process(os.getpid())
print(process.memory_info().rss / 1000000, "Mb", file=sys.stderr)
class Graph:
def neighbors(self, node):
return self.neighbors_array[self.index[node]:self.index[node]+self.... | [
"os.getpid",
"numpy.concatenate",
"numpy.copy",
"numpy.zeros",
"numpy.max",
"collections.deque"
] | [((1543, 1582), 'numpy.zeros', 'np.zeros', (['estimNbAretes'], {'dtype': 'np.int32'}), '(estimNbAretes, dtype=np.int32)\n', (1551, 1582), True, 'import numpy as np\n'), ((1592, 1631), 'numpy.zeros', 'np.zeros', (['estimNbAretes'], {'dtype': 'np.int32'}), '(estimNbAretes, dtype=np.int32)\n', (1600, 1631), True, 'import ... |
#!/bin/env python
""" Part of weight_app
:copyright: (c) 2012 by <NAME>.
:license: BSD, see LICENSE for more details.
"""
# testsuite
# run: python main.py
import unittest
import os
import sys
def suite():
from base import BaseTest
from test_importer import ImportTest
from test_forms import For... | [
"unittest.main",
"os.path.dirname",
"unittest.makeSuite",
"unittest.TestSuite"
] | [((339, 359), 'unittest.TestSuite', 'unittest.TestSuite', ([], {}), '()\n', (357, 359), False, 'import unittest\n'), ((788, 822), 'unittest.main', 'unittest.main', ([], {'defaultTest': '"""suite"""'}), "(defaultTest='suite')\n", (801, 822), False, 'import unittest\n'), ((396, 424), 'unittest.makeSuite', 'unittest.makeS... |
#!/usr/bin/python3
from MessageConverters.MessageConverter import MessageConverter
import logging
from datetime import datetime
from datetime import timezone
class MCF(MessageConverter):
msg_types = {
0x01: "time_sync_request",
0x04: "t_p_rh",
0x05: "uart",
0x09: "... | [
"datetime.datetime.utcnow",
"datetime.datetime.timestamp",
"datetime.datetime"
] | [((1558, 1609), 'datetime.datetime', 'datetime', (['year', 'month', 'day', 'hours', 'minutes', 'seconds'], {}), '(year, month, day, hours, minutes, seconds)\n', (1566, 1609), False, 'from datetime import datetime\n'), ((11266, 11283), 'datetime.datetime.utcnow', 'datetime.utcnow', ([], {}), '()\n', (11281, 11283), Fals... |
import hmac
from http import cookies
import json
from typing import Callable, TYPE_CHECKING
from urllib.parse import urlencode
import thor
from thor.http import HttpClient, get_header
from thor.http.error import HttpError
from redbot.resource import HttpResource
from redbot.type import RawHeaderListType
token_client... | [
"thor.http.get_header",
"json.loads",
"urllib.parse.urlencode",
"thor.time",
"thor.http.HttpClient",
"thor.events.on"
] | [((323, 335), 'thor.http.HttpClient', 'HttpClient', ([], {}), '()\n', (333, 335), False, 'from thor.http import HttpClient, get_header\n'), ((2693, 2717), 'thor.events.on', 'thor.events.on', (['exchange'], {}), '(exchange)\n', (2707, 2717), False, 'import thor\n'), ((3009, 3033), 'thor.events.on', 'thor.events.on', (['... |
from contextlib import contextmanager
from devpi_common.metadata import parse_requirement
from operator import itemgetter
from pluggy import HookimplMarker
from tempfile import NamedTemporaryFile
from subprocess import call
import appdirs
import attr
import json
import os
import textwrap
import traceback
client_hooki... | [
"textwrap.dedent",
"tempfile.NamedTemporaryFile",
"os.mkdir",
"appdirs.user_data_dir",
"os.remove",
"json.loads",
"devpi_common.metadata.parse_requirement",
"traceback.format_exception",
"pluggy.HookimplMarker",
"attr.ib",
"os.path.exists",
"textwrap.indent",
"json.dumps",
"os.environ.get"... | [((326, 355), 'pluggy.HookimplMarker', 'HookimplMarker', (['"""devpiclient"""'], {}), "('devpiclient')\n", (340, 355), False, 'from pluggy import HookimplMarker\n'), ((376, 418), 'appdirs.user_data_dir', 'appdirs.user_data_dir', (['"""devpi-pr"""', '"""devpi"""'], {}), "('devpi-pr', 'devpi')\n", (397, 418), False, 'imp... |
import gc
import time
import logging
import aiohttp
import asyncio
import socket
import pytest
from aiohttp.test_utils import TestServer
import aioamqp
import aioamqp.channel
import aioamqp.protocol
import aiohttp.web
import asyncpg
from docker.client import DockerClient
from docker.utils import kwargs_from_env
from as... | [
"aiohttp.web.Response",
"aioapp.app.Application",
"asyncpg.connect",
"logging.basicConfig",
"asyncio.DefaultEventLoopPolicy",
"socket.socket",
"pytest.fixture",
"aiohttp.test_utils.TestServer",
"asyncio.get_event_loop_policy",
"time.time",
"aiohttp.ClientSession",
"gc.collect",
"docker.utils... | [((495, 593), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)-15s %(message)s %(filename)s %(lineno)s %(funcName)s"""'}), "(format=\n '%(asctime)-15s %(message)s %(filename)s %(lineno)s %(funcName)s')\n", (514, 593), False, 'import logging\n'), ((694, 725), 'pytest.fixture', 'pytest.fixt... |
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.shortcuts import render
from django.views.decorators.http import require_POST
from django.views.defaults import page_not_found, server_error
import basket
import commonw... | [
"affiliates.base.forms.NewsletterSubscriptionForm",
"django.contrib.auth.models.User.objects.prefetch_related",
"affiliates.base.http.JSONResponse",
"django.contrib.messages.error",
"tower.ugettext",
"django.views.defaults.server_error",
"commonware.log.getLogger",
"affiliates.base.utils.redirect",
... | [((708, 746), 'commonware.log.getLogger', 'commonware.log.getLogger', (['"""a.facebook"""'], {}), "('a.facebook')\n", (732, 746), False, 'import commonware\n'), ((1116, 1150), 'django.shortcuts.render', 'render', (['request', '"""base/about.html"""'], {}), "(request, 'base/about.html')\n", (1122, 1150), False, 'from dj... |
from os import path
from rinoh.font import Typeface
from rinoh.font.style import REGULAR, BOLD, ITALIC, CONDENSED
from rinoh.font.opentype import OpenTypeFont
__all__ = ['typeface']
def otf(style, variant=''):
filename = 'texgyreheros{}-{}.otf'.format(variant, style)
return path.join(path.dirname(__file__)... | [
"os.path.dirname"
] | [((298, 320), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file__)\n', (310, 320), False, 'from os import path\n')] |