code
stringlengths
22
1.05M
apis
listlengths
1
3.31k
extract_api
stringlengths
75
3.25M
# PYTHON_ARGCOMPLETE_OK from signal import signal, SIGPIPE, SIG_DFL #Ignore SIG_PIPE and don't throw exceptions on it... (http://docs.python.org/library/signal.html) signal(SIGPIPE,SIG_DFL) from projectdb_api import projectdb_api, PROJECTDB_DEFAULT_URL, POSITIONAL_ARG_REGISTRY from projectdb_models import * import a...
[ "ConfigParser.SafeConfigParser", "signal.signal", "os.path.expanduser", "pyclist.pyclist.pyclist" ]
[((168, 192), 'signal.signal', 'signal', (['SIGPIPE', 'SIG_DFL'], {}), '(SIGPIPE, SIG_DFL)\n', (174, 192), False, 'from signal import signal, SIGPIPE, SIG_DFL\n'), ((535, 576), 'os.path.expanduser', 'os.path.expanduser', (["('~/.' + CONF_FILENAME)"], {}), "('~/.' + CONF_FILENAME)\n", (553, 576), False, 'import os\n'), ...
#!/usr/bin/env python3 import face_recognition import yaml from buzz.logger import log with open("/home/pi/buzz-rpi/buzz/config.yml", "r") as config_file: CONFIG = yaml.load(config_file, Loader=yaml.FullLoader) def process_visitor_images(visitor_info): known_face_encodings = [] known_face_names = [] ...
[ "face_recognition.face_encodings", "buzz.logger.log", "yaml.load", "face_recognition.load_image_file" ]
[((171, 217), 'yaml.load', 'yaml.load', (['config_file'], {'Loader': 'yaml.FullLoader'}), '(config_file, Loader=yaml.FullLoader)\n', (180, 217), False, 'import yaml\n'), ((378, 466), 'face_recognition.load_image_file', 'face_recognition.load_image_file', (["(CONFIG['visitors']['photos_target'] + key + '.jpg')"], {}), "...
import os from setuptools import setup, find_packages MODULE_DIR = os.path.dirname(os.path.abspath(__file__)) with open(os.path.join(MODULE_DIR, "requirements.txt"), "r") as f: requirements = f.read().replace(" ", "").split("\n") # source of version is in the constants file VERSION_FILE = os.path.join(MODULE_DIR,...
[ "os.path.abspath", "os.path.join", "setuptools.find_packages" ]
[((296, 345), 'os.path.join', 'os.path.join', (['MODULE_DIR', '"""matbench/constants.py"""'], {}), "(MODULE_DIR, 'matbench/constants.py')\n", (308, 345), False, 'import os\n'), ((84, 109), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (99, 109), False, 'import os\n'), ((121, 165), 'os.path.j...
"""Collection of tests for sorting functions.""" # global from hypothesis import given, strategies as st import numpy as np # local import ivy_tests.test_ivy.helpers as helpers import ivy.functional.backends.numpy as ivy_np # argsort @given( array_shape=helpers.lists( st.integers(1, 5), min_size="num_di...
[ "hypothesis.strategies.data", "ivy_tests.test_ivy.helpers.num_positional_args", "ivy_tests.test_ivy.helpers.test_array_function", "hypothesis.strategies.sampled_from", "numpy.isnan", "hypothesis.strategies.booleans", "hypothesis.strategies.integers", "ivy_tests.test_ivy.helpers.nph.arrays" ]
[((1313, 1516), 'ivy_tests.test_ivy.helpers.test_array_function', 'helpers.test_array_function', (['input_dtype', 'as_variable', 'with_out', 'num_positional_args', 'native_array', 'container', 'instance_method', 'fw', '"""argsort"""'], {'x': 'x', 'axis': 'axis', 'descending': 'descending', 'stable': 'stable'}), "(input...
from tango import mixxx_main # # Use a playlist named 'Timer' for timing purposes. Fill it with tandas you want timed. # if __name__ == '__main__': mixxx_main(query='Timer', timer=True, embed=False)
[ "tango.mixxx_main" ]
[((154, 204), 'tango.mixxx_main', 'mixxx_main', ([], {'query': '"""Timer"""', 'timer': '(True)', 'embed': '(False)'}), "(query='Timer', timer=True, embed=False)\n", (164, 204), False, 'from tango import mixxx_main\n')]
from misc import save_pickle_data, distance_diff data = [ (0, 45.8242, 15.906), (1, 45.8135, 15.949), (2, 45.8129, 15.9594), (3, 45.8123, 15.9808), (4, 45.8161, 16.0105), (5, 45.819, 16.0505), (6, 45.7999, 15.9201), (7, 45.801, 15.9324), (8, 45.7982, 15.9642), (9, 45.7963, 15.98...
[ "misc.save_pickle_data", "misc.distance_diff" ]
[((1290, 1352), 'misc.save_pickle_data', 'save_pickle_data', (['"""small_distance_matrix.pkl"""', 'distance_matrix'], {}), "('small_distance_matrix.pkl', distance_matrix)\n", (1306, 1352), False, 'from misc import save_pickle_data, distance_diff\n'), ((1143, 1210), 'misc.distance_diff', 'distance_diff', (["curr['lat']"...
#!/usr/bin/env python3 import psycopg2 import psycopg2.errorcodes import time import sys, os import gzip import html import re import fileinput # # Set the following environment variables, or use the PostgreSQL defaults: # PGHOST, PGPORT, PGUSER, PGPASSWORD, PGDATABASE # # curl -s -k http://localhost:8000/osm_1m_eu.t...
[ "html.unescape", "fileinput.input", "time.time", "time.sleep", "re.sub", "os.getenv", "sys.exit", "re.compile" ]
[((455, 491), 'os.getenv', 'os.getenv', (['"""PGDATABASE"""', '"""defaultdb"""'], {}), "('PGDATABASE', 'defaultdb')\n", (464, 491), False, 'import sys, os\n'), ((3727, 3756), 're.compile', 're.compile', (['"""^-?\\\\d+\\\\.\\\\d+$"""'], {}), "('^-?\\\\d+\\\\.\\\\d+$')\n", (3737, 3756), False, 'import re\n'), ((3764, 37...
import serial import struct import time import sys import os import tty import select def init_Serial(serial_port): print("Opening Serial Port ",serial_port) ser = serial.Serial( port=serial_port, baudrate=115200, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, ...
[ "serial.Serial", "os.system", "struct.pack", "time.time", "select.select", "sys.exit" ]
[((175, 311), 'serial.Serial', 'serial.Serial', ([], {'port': 'serial_port', 'baudrate': '(115200)', 'parity': 'serial.PARITY_NONE', 'stopbits': 'serial.STOPBITS_ONE', 'bytesize': 'serial.EIGHTBITS'}), '(port=serial_port, baudrate=115200, parity=serial.PARITY_NONE,\n stopbits=serial.STOPBITS_ONE, bytesize=serial.EIG...
#!/usr/bin/env python import Queue import thread import time from dronekit import connect from pymavlink import mavutil #from sensor_msgs.msg import NavSatFix, BatteryState #from std_msgs.msg import Float64 from models.message import Message from config.config import Config class VehicleBase(object): ''' Abs...
[ "config.config.Config.get", "models.message.Message", "Queue.Queue", "thread.start_new_thread", "dronekit.connect", "time.sleep" ]
[((549, 562), 'Queue.Queue', 'Queue.Queue', ([], {}), '()\n', (560, 562), False, 'import Queue\n'), ((817, 874), 'dronekit.connect', 'connect', (['self.addr'], {'wait_ready': '(True)', 'heartbeat_timeout': '(15)'}), '(self.addr, wait_ready=True, heartbeat_timeout=15)\n', (824, 874), False, 'from dronekit import connect...
# -*- coding: utf-8 -*- """ This module provides the XMLTestRunner class, which is heavily based on the default TextTestRunner. """ import os import sys import time import codecs try: from unittest2.runner import TextTestRunner from unittest2.runner import TextTestResult as _TextTestResult from unittest2....
[ "xml.dom.minidom.Document", "io.StringIO", "unittest.TestResult.startTest", "codecs.open", "os.makedirs", "unittest.TextTestRunner.__init__", "sys.stderr.getvalue", "os.path.exists", "time.strftime", "unittest._TextTestResult.__init__", "time.time", "unittest._TextTestResult.stopTest", "sys....
[((791, 801), 'io.StringIO', 'StringIO', ([], {}), '()\n', (799, 801), False, 'from io import StringIO\n'), ((2955, 3018), 'unittest._TextTestResult.__init__', '_TextTestResult.__init__', (['self', 'stream', 'descriptions', 'verbosity'], {}), '(self, stream, descriptions, verbosity)\n', (2979, 3018), False, 'from unitt...
# coding=utf-8 # Copyright 2020 The TensorFlow Datasets Authors and the HuggingFace Datasets Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LI...
[ "json.load", "datasets.SplitGenerator", "datasets.Value", "logging.info", "datasets.Version" ]
[((3975, 4030), 'logging.info', 'logging.info', (['"""generating examples from = %s"""', 'filepath'], {}), "('generating examples from = %s', filepath)\n", (3987, 4030), False, 'import logging\n'), ((3735, 3841), 'datasets.SplitGenerator', 'datasets.SplitGenerator', ([], {'name': 'datasets.Split.TRAIN', 'gen_kwargs': "...
#!/usr/bin/env python3 import json import yaml try: from urllib import request except ImportError: import urllib2 as request with request.urlopen("https://framagit.org/framasoft/framapad/-/raw/master/app/data/project.yml?inline=false") as stream: #with open("project.yml", 'r') as stream: data_loaded =...
[ "json.dump", "yaml.safe_load", "urllib2.urlopen" ]
[((140, 255), 'urllib2.urlopen', 'request.urlopen', (['"""https://framagit.org/framasoft/framapad/-/raw/master/app/data/project.yml?inline=false"""'], {}), "(\n 'https://framagit.org/framasoft/framapad/-/raw/master/app/data/project.yml?inline=false'\n )\n", (155, 255), True, 'import urllib2 as request\n'), ((321,...
# -*- coding: utf-8 -*- # # ramstk.models.programdb.cause.table.py is part of The RAMSTK Project # # All rights reserved. # Copyright since 2007 Doyle "weibullguy" Rowland doyle.rowland <AT> reliaqual <DOT> com """Failure Cause Package Data Controller.""" # Standard Library Imports from typing import Any, Dict, ...
[ "ramstk.analyses.criticality.calculate_rpn", "pubsub.pub.subscribe", "pubsub.pub.sendMessage" ]
[((1789, 1856), 'pubsub.pub.subscribe', 'pub.subscribe', (['self.do_calculate_rpn', '"""request_calculate_cause_rpn"""'], {}), "(self.do_calculate_rpn, 'request_calculate_cause_rpn')\n", (1802, 1856), False, 'from pubsub import pub\n'), ((3759, 3821), 'pubsub.pub.sendMessage', 'pub.sendMessage', (['"""succeed_calculate...
import torch from torch.utils._pytree import tree_map, tree_flatten from functools import partial from torch.fx.operator_schemas import normalize_function from torch.utils._mode_utils import no_dispatch from torch._subclasses.meta_utils import MetaConverter from typing import Union, Callable from torch._ops import OpO...
[ "torch.nn.Parameter", "functools.partial", "torch.zeros_like", "torch._subclasses.meta_utils.MetaConverter", "torch.utils._python_dispatch.enable_torch_dispatch_mode", "torch.ops.aten._to_copy", "torch.utils._pytree.tree_flatten", "torch.Tensor._make_subclass", "torch.utils._mode_utils.no_dispatch",...
[((1770, 1795), 'functools.lru_cache', 'functools.lru_cache', (['None'], {}), '(None)\n', (1789, 1795), False, 'import functools\n'), ((1178, 1203), 'torch._C.TensorType.get', 'torch._C.TensorType.get', ([], {}), '()\n', (1201, 1203), False, 'import torch\n'), ((5101, 5190), 'torch.fx.operator_schemas.normalize_functio...
import configparser import getpass import glob import os import pathlib import platform import re import socket import sys import threading import time import loguru import psutil import requests from cursor import cursor class CFG: def __init__(self): self.i18n = None self.cfg_gen = None ...
[ "sys.stdout.write", "getpass.getuser", "pathlib.Path.home", "pathlib.Path", "sys.stdout.flush", "os.path.join", "psutil.process_iter", "platform.architecture", "loguru.logger.warning", "socket.gethostname", "requests.get", "configparser.ConfigParser", "cursor.cursor.hide", "re.search", "...
[((878, 895), 'platform.system', 'platform.system', ([], {}), '()\n', (893, 895), False, 'import platform\n'), ((923, 940), 'getpass.getuser', 'getpass.getuser', ([], {}), '()\n', (938, 940), False, 'import getpass\n'), ((968, 988), 'socket.gethostname', 'socket.gethostname', ([], {}), '()\n', (986, 988), False, 'impor...
""" Modified version of the PyTorch DatasetFolder class to make custom dataloading possible """ import os import os.path from torchvision.datasets import VisionDataset def has_file_allowed_extension(filename, extensions): """Checks if a file is an allowed extension. Args: filename (string): path t...
[ "os.path.expanduser" ]
[((1932, 1961), 'os.path.expanduser', 'os.path.expanduser', (['directory'], {}), '(directory)\n', (1950, 1961), False, 'import os\n')]
import os import sys class AwsSmsProvider(object): def __init__(self, **kargs): if 'boto3' not in sys.modules: import boto3 if 'region_name' not in kargs: kargs['region_name'] = os.environ.get('AWS_SNS_REGION_NAME', 'us-eas...
[ "os.environ.get", "boto3.client" ]
[((348, 376), 'boto3.client', 'boto3.client', (['"""sns"""'], {}), "('sns', **kargs)\n", (360, 376), False, 'import boto3\n'), ((225, 275), 'os.environ.get', 'os.environ.get', (['"""AWS_SNS_REGION_NAME"""', '"""us-east-1"""'], {}), "('AWS_SNS_REGION_NAME', 'us-east-1')\n", (239, 275), False, 'import os\n')]
import hydra from omegaconf import DictConfig, OmegaConf @hydra.main(config_path="config", config_name="train") def my_app(cfg: DictConfig) -> None: print(OmegaConf.to_yaml(cfg)) if __name__ == "__main__": my_app()
[ "omegaconf.OmegaConf.to_yaml", "hydra.main" ]
[((60, 113), 'hydra.main', 'hydra.main', ([], {'config_path': '"""config"""', 'config_name': '"""train"""'}), "(config_path='config', config_name='train')\n", (70, 113), False, 'import hydra\n'), ((161, 183), 'omegaconf.OmegaConf.to_yaml', 'OmegaConf.to_yaml', (['cfg'], {}), '(cfg)\n', (178, 183), False, 'from omegacon...
#!/usr/bin/python # -*- coding: utf-8 -*- """ This module is part of the opsi PackageBuilder see: https://forum.opsi.org/viewforum.php?f=22 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 ...
[ "ctypes.FormatError", "ctypes.byref", "ctypes.POINTER" ]
[((2095, 2123), 'ctypes.POINTER', 'ctypes.POINTER', (['NETRESOURCEW'], {}), '(NETRESOURCEW)\n', (2109, 2123), False, 'import ctypes\n'), ((2894, 2910), 'ctypes.byref', 'ctypes.byref', (['nr'], {}), '(nr)\n', (2906, 2910), False, 'import ctypes\n'), ((2998, 3024), 'ctypes.FormatError', 'ctypes.FormatError', (['retVal'],...
import matplotlib.pyplot as plt import numpy as np import copy from zonesafe import * from adaptevitesserelat import * from trouvecible import * orientation=0 orientationm1=0 N=720 lidar1=[] lidar2=[] rv=20 m=5 i=0 r1=50 r2=41 epsilon=0.15 alpha=15 #angle cone correction v=100 deltat=0.1 rmax=10...
[ "matplotlib.pyplot.show", "matplotlib.pyplot.axis", "matplotlib.pyplot.plot" ]
[((748, 783), 'matplotlib.pyplot.plot', 'plt.plot', (['cible[0]', 'cible[1]', '"""y:o"""'], {}), "(cible[0], cible[1], 'y:o')\n", (756, 783), True, 'import matplotlib.pyplot as plt\n'), ((783, 800), 'matplotlib.pyplot.axis', 'plt.axis', (['"""equal"""'], {}), "('equal')\n", (791, 800), True, 'import matplotlib.pyplot a...
#!/usr/bin/env python # -*- coding: utf-8 -*- from os.path import join as pjoin import shutil from setuptools import setup, find_packages import distutils.cmd import distutils.log import subprocess from os import path as P try: execfile except NameError: def execfile(fname, globs, locs=None): locs = l...
[ "os.path.abspath", "os.path.exists", "subprocess.call", "shutil.copytree", "os.path.join", "setuptools.find_packages" ]
[((422, 441), 'os.path.abspath', 'P.abspath', (['__file__'], {}), '(__file__)\n', (431, 441), True, 'from os import path as P\n'), ((470, 506), 'os.path.join', 'P.join', (['HERE', '"""cooka"""', '"""_version.py"""'], {}), "(HERE, 'cooka', '_version.py')\n", (476, 506), True, 'from os import path as P\n'), ((600, 625), ...
from sqlalchemy import select from sqlalchemy.sql import func from sqlalchemy.orm import Session from sqlalchemy import create_engine, MetaData, Table, Integer, String, \ Column, DateTime, ForeignKey, Numeric, CheckConstraint, cast, Date, distinct, union from datetime import datetime engine = create_engine('sqlit...
[ "sqlalchemy.MetaData", "sqlalchemy.DateTime", "sqlalchemy.sql.func.count", "sqlalchemy.select", "sqlalchemy.String", "sqlalchemy.ForeignKey", "sqlalchemy.orm.Session", "sqlalchemy.CheckConstraint", "sqlalchemy.Numeric", "sqlalchemy.create_engine", "sqlalchemy.Integer" ]
[((300, 349), 'sqlalchemy.create_engine', 'create_engine', (['"""sqlite:///Sqlite-Data/sqlite3.db"""'], {}), "('sqlite:///Sqlite-Data/sqlite3.db')\n", (313, 349), False, 'from sqlalchemy import create_engine, MetaData, Table, Integer, String, Column, DateTime, ForeignKey, Numeric, CheckConstraint, cast, Date, distinct,...
# coding: utf-8 # # Copyright 2017 The Oppia 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 requi...
[ "copy.deepcopy", "core.platform.models.Registry.import_models", "random.randint", "time.time" ]
[((1048, 1099), 'core.platform.models.Registry.import_models', 'models.Registry.import_models', (['[models.NAMES.audit]'], {}), '([models.NAMES.audit])\n', (1077, 1099), False, 'from core.platform import models\n'), ((10115, 10143), 'copy.deepcopy', 'copy.deepcopy', (['_ROLE_ACTIONS'], {}), '(_ROLE_ACTIONS)\n', (10128,...
#!/usr/bin/env python # -*- coding: utf-8; mode: python; py-indent-offset: 4; py-continuation-offset: 4 -*- #=============================================================================== # Copyright Notice # ---------------- # Copyright 2021 National Technology & Engineering Solutions of Sandia, # LLC (NTESS). Under ...
[ "os.path.abspath", "io.StringIO" ]
[((2417, 2442), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (2432, 2442), False, 'import os\n'), ((4817, 4827), 'io.StringIO', 'StringIO', ([], {}), '()\n', (4825, 4827), False, 'from io import StringIO\n'), ((5006, 5016), 'io.StringIO', 'StringIO', ([], {}), '()\n', (5014, 5016), False, '...
import csv import numpy as np import pandas as pd datapath = './data/Per capita GDP at current prices - US Dollars.csv' df = pd.read_csv(datapath, header=0) df = df.sort_values('Year', ascending=True) df = df[df['Country or Area']=='Venezuela (Bolivarian Republic of)'] df = df[['Year', 'Value']] # Prints summary stat...
[ "pandas.read_csv", "pandas.DataFrame" ]
[((126, 157), 'pandas.read_csv', 'pd.read_csv', (['datapath'], {'header': '(0)'}), '(datapath, header=0)\n', (137, 157), True, 'import pandas as pd\n'), ((1154, 1185), 'pandas.read_csv', 'pd.read_csv', (['datapath'], {'header': '(0)'}), '(datapath, header=0)\n', (1165, 1185), True, 'import pandas as pd\n'), ((1619, 170...
import os import pickle from shutil import copyfile from pathlib import Path from google_auth_oauthlib.flow import InstalledAppFlow from googleapiclient.discovery import build import googleapiclient.errors from config import FOLDER_CHANNELS class Authentication: def __init__(self, first_time: ...
[ "pickle.dump", "os.rename", "pathlib.Path", "pickle.load", "shutil.copyfile", "google_auth_oauthlib.flow.InstalledAppFlow.from_client_secrets_file", "googleapiclient.discovery.build" ]
[((2064, 2149), 'google_auth_oauthlib.flow.InstalledAppFlow.from_client_secrets_file', 'InstalledAppFlow.from_client_secrets_file', (['self.client_secrets_file', 'self.scopes'], {}), '(self.client_secrets_file, self.scopes\n )\n', (2105, 2149), False, 'from google_auth_oauthlib.flow import InstalledAppFlow\n'), ((39...
""" Tests for Minimax algorithm """ import math from pyai.search.minimax import ( minimax, init_game, to_string, ) def setup_game(): """Set up a game for tests.""" red_discs = { (0, 1), (1, 0), (1, 1), (1, 3), (2, 3), (3, 0), (3, 1), ...
[ "pyai.search.minimax.minimax", "pyai.search.minimax.init_game", "pyai.search.minimax.to_string" ]
[((679, 764), 'pyai.search.minimax.init_game', 'init_game', ([], {'n_rows': '(6)', 'n_columns': '(7)', 'red_discs': 'red_discs', 'yellow_discs': 'yellow_discs'}), '(n_rows=6, n_columns=7, red_discs=red_discs, yellow_discs=yellow_discs\n )\n', (688, 764), False, 'from pyai.search.minimax import minimax, init_game, to...
""" Module handles all the configuration stuff. """ from dataclasses import dataclass, field from typing import List, ClassVar, Type from marshmallow import Schema import marshmallow_dataclass import yaml @dataclass class Config: """Config describes the configuration-file for the CLI application.""" url: str...
[ "marshmallow_dataclass.class_schema", "yaml.load", "yaml.dump" ]
[((1903, 1941), 'yaml.load', 'yaml.load', (['raw'], {'Loader': 'yaml.FullLoader'}), '(raw, Loader=yaml.FullLoader)\n', (1912, 1941), False, 'import yaml\n'), ((2678, 2692), 'yaml.dump', 'yaml.dump', (['cfg'], {}), '(cfg)\n', (2687, 2692), False, 'import yaml\n'), ((1843, 1885), 'marshmallow_dataclass.class_schema', 'ma...
#! /usr/bin/env python # -*- coding: utf-8 -*- ''' This script assembles a standalone LaTeX file with bibliography and list of figures incorporated into the main document (JASA requires single standalone documents for article submission). It also replaces proper unicode en-dashes (–) with LaTeX-style double-hyphens (--...
[ "os.path.splitext" ]
[((606, 625), 'os.path.splitext', 'op.splitext', (['infile'], {}), '(infile)\n', (617, 625), True, 'import os.path as op\n'), ((651, 670), 'os.path.splitext', 'op.splitext', (['infile'], {}), '(infile)\n', (662, 670), True, 'import os.path as op\n')]
import urllib.request,json from .models import Article, Source # Getting api key api_key = None # Getting the base and sources url base_url = None sources_url = None def configure_request(app): global api_key,base_url,sources_url api_key = app.config['NEWS_API_KEY'] base_url = app.config['NEWS_API_BASE_U...
[ "json.loads" ]
[((657, 682), 'json.loads', 'json.loads', (['get_news_data'], {}), '(get_news_data)\n', (667, 682), False, 'import urllib.request, json\n'), ((1218, 1246), 'json.loads', 'json.loads', (['get_sources_data'], {}), '(get_sources_data)\n', (1228, 1246), False, 'import urllib.request, json\n')]
import numpy as np from random import random from noneq_settings import BETA def hamming(s1, s2): """Calculate the Hamming distance between two bit lists""" assert len(s1) == len(s2) return sum(c1 != c2 for c1, c2 in zip(s1, s2)) def hamiltonian(state_vec, intxn_matrix): return -0.5 * reduce(np.dot...
[ "numpy.zeros", "random.random", "numpy.array", "numpy.exp", "numpy.dot" ]
[((514, 560), 'numpy.dot', 'np.dot', (['intxn_matrix[spin_idx, :]', 'state[:, t]'], {}), '(intxn_matrix[spin_idx, :], state[:, t])\n', (520, 560), True, 'import numpy as np\n'), ((686, 694), 'random.random', 'random', ([], {}), '()\n', (692, 694), False, 'from random import random\n'), ((2226, 2248), 'numpy.zeros', 'np...
# Copyright 2020 The Magenta Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
[ "numpy.random.seed", "magenta.models.arbitrary_image_stylization.arbitrary_image_stylization_build_model.build_model", "magenta.models.image_stylization.image_utils.load_np_image_uint8", "tensorflow.compat.v1.gfile.Exists", "magenta.models.image_stylization.image_utils.resize_image", "tensorflow.compat.v1...
[((2656, 2697), 'tensorflow.compat.v1.logging.set_verbosity', 'tf.logging.set_verbosity', (['tf.logging.INFO'], {}), '(tf.logging.INFO)\n', (2680, 2697), True, 'import tensorflow.compat.v1 as tf\n'), ((7755, 7779), 'tensorflow.compat.v1.disable_v2_behavior', 'tf.disable_v2_behavior', ([], {}), '()\n', (7777, 7779), Tru...
"""Style tests.""" # pylint: disable=no-member from textwrap import dedent from typing import TYPE_CHECKING from unittest import mock from unittest.mock import PropertyMock import pytest import responses from nitpick.constants import DOT_SLASH, PYPROJECT_TOML, READ_THE_DOCS_URL, SETUP_CFG, TOML_EXTENSION, TOX_INI fro...
[ "textwrap.dedent", "nitpick.violations.Fuss", "unittest.mock.PropertyMock", "tests.helpers.assert_conditions", "responses.add", "pytest.mark.parametrize", "tests.helpers.ProjectMock" ]
[((513, 562), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""offline"""', '[False, True]'], {}), "('offline', [False, True])\n", (536, 562), False, 'import pytest\n'), ((2396, 2445), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""offline"""', '[False, True]'], {}), "('offline', [False, True])\...
#!/usr/bin/env python """ @package ion_functions.data.adcp_functions @file ion_functions/data/adcp_functions.py @author <NAME>, <NAME>, <NAME> @brief Module containing ADCP related data-calculations. """ import numpy as np from ion_functions.data.generic_functions import magnetic_declination from ion_functions...
[ "numpy.radians", "ion_functions.data.generic_functions.magnetic_declination", "ion_functions.data.generic_functions.replace_fill_with_nan", "numpy.isscalar", "numpy.deg2rad", "numpy.zeros", "numpy.ones", "numpy.einsum", "numpy.sin", "numpy.array", "numpy.fabs", "numpy.cos", "numpy.rollaxis",...
[((5640, 5658), 'numpy.atleast_1d', 'np.atleast_1d', (['lat'], {}), '(lat)\n', (5653, 5658), True, 'import numpy as np\n'), ((5670, 5688), 'numpy.atleast_1d', 'np.atleast_1d', (['lon'], {}), '(lon)\n', (5683, 5688), True, 'import numpy as np\n'), ((5699, 5716), 'numpy.atleast_1d', 'np.atleast_1d', (['dt'], {}), '(dt)\n...
import argparse import logging LOG_FORMAT = "%(asctime)s %(name)10s %(levelname)s: %(message)s" logging.basicConfig(level=logging.INFO, format=LOG_FORMAT) class Command: """Base class for a command""" NAME = "<not_implemented>" HELP = "" DESCRIPTION = "" def create_subparser(self, subparsers): ...
[ "argparse.ArgumentParser", "logging.basicConfig" ]
[((97, 155), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO', 'format': 'LOG_FORMAT'}), '(level=logging.INFO, format=LOG_FORMAT)\n', (116, 155), False, 'import logging\n'), ((753, 801), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': 'description'}), '(description=...
from .. import core from .._version import __version__ # noqa: F401 from ..data_model import Simulator import functools import brian2 __all__ = [ '__version__', 'get_simulator_version', 'exec_sed_task', 'preprocess_sed_task', 'exec_sed_doc', 'exec_sedml_docs_in_combine_archive', ] def get_si...
[ "functools.partial" ]
[((474, 539), 'functools.partial', 'functools.partial', (['core.exec_sed_task'], {'simulator': 'Simulator.brian2'}), '(core.exec_sed_task, simulator=Simulator.brian2)\n', (491, 539), False, 'import functools\n'), ((562, 633), 'functools.partial', 'functools.partial', (['core.preprocess_sed_task'], {'simulator': 'Simula...
# Copyright 2014 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. """HTTP Handlers.""" import datetime import itertools import json import time import webapp2 from google.appengine.api import app_identity from...
[ "itertools.chain.from_iterable", "components.template.render", "google.appengine.api.app_identity.get_application_id", "json.loads", "components.utils.utcnow", "components.auth.require", "time.time", "components.utils.encode_to_json", "datetime.datetime.strptime", "google.appengine.ext.ndb.delete_...
[((874, 912), 'components.auth.require', 'auth.require', (['acl.is_ereporter2_viewer'], {}), '(acl.is_ereporter2_viewer)\n', (886, 912), False, 'from components import auth\n'), ((2640, 2678), 'components.auth.require', 'auth.require', (['acl.is_ereporter2_viewer'], {}), '(acl.is_ereporter2_viewer)\n', (2652, 2678), Fa...
#!/usr/bin/env python """ Autocompletion example that shows meta-information alongside the completions. """ from quo.completion import WordCompleter from quo.prompt import Prompt animal_completer = WordCompleter( [ "alligator", "ant", "ape", "bat", "bear", "beaver"...
[ "quo.completion.WordCompleter", "quo.prompt.Prompt" ]
[((201, 738), 'quo.completion.WordCompleter', 'WordCompleter', (["['alligator', 'ant', 'ape', 'bat', 'bear', 'beaver', 'bee', 'bison',\n 'butterfly', 'cat', 'chicken', 'crocodile', 'dinosaur', 'dog',\n 'dolphin', 'dove', 'duck', 'eagle', 'elephant']"], {'meta_dict': "{'alligator':\n 'An alligator is a crocodil...
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import print_function from importlib.util import find_spec from importlib import import_module from silvaengine_utility import Utility from jose import jwk, jwt from .types import ( RoleType as OutputRoleType, RolesType, CertificateType, UserRela...
[ "silvaengine_utility.Utility.json_dumps", "boto3.client", "importlib.import_module", "importlib.util.find_spec", "silvaengine_utility.Utility.import_dynamically", "base64.b64encode", "os.getenv" ]
[((14608, 14747), 'boto3.client', 'boto3.client', (['"""cognito-idp"""'], {'region_name': 'region_name', 'aws_access_key_id': 'aws_access_key_id', 'aws_secret_access_key': 'aws_secret_access_key'}), "('cognito-idp', region_name=region_name, aws_access_key_id=\n aws_access_key_id, aws_secret_access_key=aws_secret_acc...
import numpy as np import os from scipy.io.wavfile import write as audio_write ### Generate data data = np.random.uniform(size=(10000)) # single example DATA = np.random.uniform(size=(10,10000)) # multi example wavfiles, numpyfiles = [], [] datafolder = 'data_intro/data' os.makedirs(datafolder,exist_ok=True) os.makedi...
[ "numpy.random.uniform", "numpy.save", "os.makedirs", "scipy.io.wavfile.write", "dabstract.abstract.abstract.DataAbstract", "numpy.mean", "dabstract.abstract.abstract.MapAbstract", "os.path.join", "dabstract.dataprocessor.ProcessingChain" ]
[((105, 134), 'numpy.random.uniform', 'np.random.uniform', ([], {'size': '(10000)'}), '(size=10000)\n', (122, 134), True, 'import numpy as np\n'), ((161, 196), 'numpy.random.uniform', 'np.random.uniform', ([], {'size': '(10, 10000)'}), '(size=(10, 10000))\n', (178, 196), True, 'import numpy as np\n'), ((273, 311), 'os....
from django.shortcuts import render from django.http import HttpResponse, HttpResponseRedirect, JsonResponse from .models import Location # ... from django.contrib.auth.models import User from django.core.urlresolvers import reverse # Other views not displayed. def detail(request, location_id): location = Locatio...
[ "django.shortcuts.render", "django.http.JsonResponse" ]
[((361, 415), 'django.shortcuts.render', 'render', (['request', '"""detail.html"""', "{'location': location}"], {}), "(request, 'detail.html', {'location': location})\n", (367, 415), False, 'from django.shortcuts import render\n'), ((813, 847), 'django.http.JsonResponse', 'JsonResponse', (["{'results': results}"], {}),...
# -*- coding: utf-8 -*- ''' :codeauthor: :email:`<NAME> (<EMAIL>)` :copyright: © 2013 by the SaltStack Team, see AUTHORS for more details. :license: Apache 2.0, see LICENSE for more details. =================== PEP-8 PyLint Plugin =================== A bridge between the `pep8`_ library a...
[ "pep8.StyleGuide", "warnings.warn", "pylint.checkers.BaseChecker.__init__", "logging.getLogger" ]
[((1090, 1191), 'warnings.warn', 'warnings.warn', (['"""No pep8 library could be imported. No PEP8 check\'s will be done"""', 'RuntimeWarning'], {}), '("No pep8 library could be imported. No PEP8 check\'s will be done"\n , RuntimeWarning)\n', (1103, 1191), False, 'import warnings\n'), ((2464, 2505), 'pylint.checkers...
import tensorflow as tf from tensorflow import keras def compute_his_average(his_embedding, mask): """ :param his_embedding: None,his_len,embedding_size :param mask: None,his_len :return:his_embedding_average """ mask = tf.expand_dims(mask, axis=-1) mask = tf.cast(mask, dtype=his_embedding...
[ "tensorflow.nn.softmax", "tensorflow.reduce_sum", "tensorflow.keras.layers.BatchNormalization", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.GRU", "tensorflow.concat", "tensorflow.zeros_like", "tensorflow.ones_like", "tensorflow.nn.sigmoid_cross_entropy_with_logits", "tensorflow.cast"...
[((246, 275), 'tensorflow.expand_dims', 'tf.expand_dims', (['mask'], {'axis': '(-1)'}), '(mask, axis=-1)\n', (260, 275), True, 'import tensorflow as tf\n'), ((287, 327), 'tensorflow.cast', 'tf.cast', (['mask'], {'dtype': 'his_embedding.dtype'}), '(mask, dtype=his_embedding.dtype)\n', (294, 327), True, 'import tensorflo...
# Copyright (c) 2013 Red Hat, 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 agreed to in writ...
[ "setuptools.find_packages" ]
[((844, 882), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "['test', 'bin']"}), "(exclude=['test', 'bin'])\n", (857, 882), False, 'from setuptools import setup, find_packages\n')]
#!/usr/bin/env python3 """ Agregar nodos de bitcointrust manualmente obteniendo la información desde el explorador de bloques Manually add bitcointrust nodes to daemon (python 3.x) """ import json import requests from config import * try: # Get las 24 hours nodes from blockchain explorer data = requests.get(...
[ "json.loads", "requests.get" ]
[((307, 333), 'requests.get', 'requests.get', (['URL_EXPLORER'], {}), '(URL_EXPLORER)\n', (319, 333), False, 'import requests\n'), ((547, 568), 'json.loads', 'json.loads', (['data.text'], {}), '(data.text)\n', (557, 568), False, 'import json\n')]
# Copyright (C) 2014,2015 VA Linux Systems Japan K.K. # Copyright (C) 2014,2015 <NAME> <yamamoto at valinux co jp> # 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...
[ "os_ken.app.ofctl.api.send_msg", "os_ken.lib.ofctl_string.ofp_instruction_from_str", "oslo_log.log.getLogger", "os_ken.ofproto.ofproto_parser.ofp_instruction_from_jsondict", "neutron._i18n._", "oslo_utils.excutils.save_and_reraise_exception", "random.randrange", "os_ken.app.ofctl.api.get_datapath", ...
[((1185, 1212), 'oslo_log.log.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1202, 1212), True, 'from oslo_log import log as logging\n'), ((1338, 1391), 'neutron._i18n._', '_', (['"""Another active bundle 0x%(bundle_id)x is running"""'], {}), "('Another active bundle 0x%(bundle_id)x is running')\...
""" Build a TOC-tree; Sphinx requires it and this makes it easy to just add/build/link new files without needing to explicitly add it to a toctree directive somewhere. """ import re from collections import defaultdict from sphinx.errors import DocumentError from pathlib import Path from os.path import abspath, dirnam...
[ "os.path.abspath", "os.path.dirname", "sphinx.errors.DocumentError", "collections.defaultdict", "pathlib.Path", "os.path.join", "re.compile" ]
[((490, 521), 'os.path.join', 'pathjoin', (['_SOURCE_DIR', '"""toc.md"""'], {}), "(_SOURCE_DIR, 'toc.md')\n", (498, 521), True, 'from os.path import abspath, dirname, join as pathjoin, sep, relpath\n'), ((1503, 1520), 'collections.defaultdict', 'defaultdict', (['dict'], {}), '(dict)\n', (1514, 1520), False, 'from colle...
import FWCore.ParameterSet.Config as cms l1MetFilterRecoTree = cms.EDAnalyzer("L1MetFilterRecoTreeProducer", triggerResultsToken = cms.untracked.InputTag("TriggerResults::RECO"), hbheNoiseFilterResultToken = cms.untracked.InputTag("HBHENoiseFilterResultProducer:HBHENoiseFilterResult") )
[ "FWCore.ParameterSet.Config.untracked.InputTag" ]
[((149, 195), 'FWCore.ParameterSet.Config.untracked.InputTag', 'cms.untracked.InputTag', (['"""TriggerResults::RECO"""'], {}), "('TriggerResults::RECO')\n", (171, 195), True, 'import FWCore.ParameterSet.Config as cms\n'), ((235, 312), 'FWCore.ParameterSet.Config.untracked.InputTag', 'cms.untracked.InputTag', (['"""HBHE...
#!/usr/bin/env python # -*- coding: iso-8859-1 -*- # Copyright (C) 2004-2005 <NAME> and <NAME> # Copyright (C) 2012-2014 <NAME> """ Setup file for the distuils module. It includes the following features: - py2exe support (including InnoScript installer generation) - Microsoft Visual C++ DLL installation for py2exe - c...
[ "os.path.isfile", "distutils.util.get_platform", "glob.glob", "os.path.join", "subprocess.check_call", "shutil.copy", "os.path.abspath", "os.path.splitdrive", "codecs.open", "py2exe.build_exe.py2exe.run", "os.path.dirname", "os.path.normpath", "distutils.core.setup", "os.path.basename", ...
[((1480, 1544), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""', '"""Unknown distribution option"""'], {}), "('ignore', 'Unknown distribution option')\n", (1503, 1544), False, 'import warnings\n'), ((2014, 2047), 're.compile', 're.compile', (['"""\\\\(released (.+)\\\\)"""'], {}), "('\\\\(release...
import appdirs import subprocess import os #import mypy import pathlib import re import glob import json # This is a script for using circuitpython's repo to make pyi files for each board type. # These need to be bundled with the extension, which means that adding new boards is still # a new release of the extension. ...
[ "json.dump", "re.search", "glob.glob", "os.path.split", "os.path.join" ]
[((1118, 1161), 'glob.glob', 'glob.glob', (['"""circuitpython/ports/*/boards/*"""'], {}), "('circuitpython/ports/*/boards/*')\n", (1127, 1161), False, 'import glob\n'), ((512, 557), 'os.path.join', 'os.path.join', (['"""./stubs/board"""', '"""__init__.pyi"""'], {}), "('./stubs/board', '__init__.pyi')\n", (524, 557), Fa...
# Copyright (c) 2014 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...
[ "semantic_version.Version.coerce" ]
[((1420, 1474), 'semantic_version.Version.coerce', 'semantic_version.Version.coerce', (['LATEST_FORMAT_VERSION'], {}), '(LATEST_FORMAT_VERSION)\n', (1451, 1474), False, 'import semantic_version\n')]
from typing import List, Optional from huoguoml.schema.experiment import Experiment from huoguoml.server.entity.experiment import ExperimentORM from huoguoml.server.entity.run import RunORM from huoguoml.server.repository.experiment import ExperimentRepository from huoguoml.server.service import Service class Experi...
[ "huoguoml.server.repository.experiment.ExperimentRepository" ]
[((488, 577), 'huoguoml.server.repository.experiment.ExperimentRepository', 'ExperimentRepository', ([], {'database_url': 'self.database_url', 'connect_args': 'self.connect_args'}), '(database_url=self.database_url, connect_args=self.\n connect_args)\n', (508, 577), False, 'from huoguoml.server.repository.experiment...
import sys import os.path import time import re print("STALINIUM V1 PAR ALEXDIEU") if len(sys.argv) > 1: file = sys.argv[1] if os.path.isfile(file): pass else: print("Error , File doesn't exist !") else: file = input(">>>") variables = {} lignes = [] try: with open(file, "r") as...
[ "time.sleep" ]
[((9553, 9568), 'time.sleep', 'time.sleep', (['bon'], {}), '(bon)\n', (9563, 9568), False, 'import time\n')]
# coding=utf-8 # Copyright 2020 The TensorFlow Datasets Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
[ "tensorflow_datasets.scripts.cli.main._parse_flags", "absl.logging.warning", "absl.flags.DEFINE_string", "absl.app.run", "absl.flags.DEFINE_integer", "tensorflow_datasets.scripts.cli.main.main" ]
[((838, 900), 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""module_import"""', 'None', '"""`--imports` flag"""'], {}), "('module_import', None, '`--imports` flag')\n", (857, 900), False, 'from absl import flags\n'), ((927, 997), 'absl.flags.DEFINE_integer', 'flags.DEFINE_integer', (['"""builder_config_id"""'...
from operator import mul try: reduce except NameError: from functools import reduce import numpy as np def logit(x): return np.log(x) - np.log(1 - x) def logitsum(xs): total = 0 for x in xs: total += logit(x) return total def prod(*x): return reduce(mul, x, 1)
[ "functools.reduce", "numpy.log" ]
[((286, 303), 'functools.reduce', 'reduce', (['mul', 'x', '(1)'], {}), '(mul, x, 1)\n', (292, 303), False, 'from functools import reduce\n'), ((139, 148), 'numpy.log', 'np.log', (['x'], {}), '(x)\n', (145, 148), True, 'import numpy as np\n'), ((151, 164), 'numpy.log', 'np.log', (['(1 - x)'], {}), '(1 - x)\n', (157, 164...
''' Created on June 6, 2018 Filer Guidelines: esma32-60-254_esef_reporting_manual.pdf Taxonomy Architecture: Taxonomy package expected to be installed: @author: Mark V Systems Limited (c) Copyright 2018 Mark V Systems Limited, All rights reserved. ''' import re from arelle import ModelDocument, XbrlConst from ar...
[ "re.findall", "re.sub" ]
[((2994, 3061), 're.findall', 're.findall', (['"""((\\\\w+\')+\\\\w+)|(A[.-])|([.-]A(?=\\\\W|$))|(\\\\w+)"""', 'label'], {}), '("((\\\\w+\')+\\\\w+)|(A[.-])|([.-]A(?=\\\\W|$))|(\\\\w+)", label)\n', (3004, 3061), False, 'import re\n'), ((2882, 2931), 're.sub', 're.sub', (['"""[\'.-]"""', '""""""', '(w[0] or w[2] or w[3]...
import argparse import os from multiprocessing import Process import tensorflow as tf from tqdm import tqdm class Converter: ''' Converter class for scanning input directory for classes and automatic conversion to TFRecords. The resultant TFRecord stores the height, width, channels, associated label (inf...
[ "tensorflow.train.BytesList", "tensorflow.image.rgb_to_grayscale", "argparse.ArgumentParser", "tensorflow.train.Int64List", "os.path.basename", "os.path.isdir", "tensorflow.io.TFRecordWriter", "tensorflow.train.Features", "tensorflow.constant", "tensorflow.cast", "tensorflow.image.decode_image",...
[((5766, 5791), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (5789, 5791), False, 'import argparse\n'), ((848, 869), 'tensorflow.io.read_file', 'tf.io.read_file', (['path'], {}), '(path)\n', (863, 869), True, 'import tensorflow as tf\n'), ((893, 933), 'tensorflow.image.decode_image', 'tf.imag...
#!/usr/bin/env python #----------------------------------------------------------------------------- # Title : PyRogue Gtpe2Common #----------------------------------------------------------------------------- # File : Gtpe2Common.py # Created : 2017-04-12 #------------------------------------------------...
[ "pyrogue.RemoteVariable" ]
[((1356, 1480), 'pyrogue.RemoteVariable', 'pr.RemoteVariable', ([], {'name': '"""PLL0_CFG_WRD0"""', 'description': '""""""', 'offset': '(2 << 2)', 'bitSize': '(16)', 'bitOffset': '(0)', 'base': 'pr.UInt', 'mode': '"""RW"""'}), "(name='PLL0_CFG_WRD0', description='', offset=2 << 2,\n bitSize=16, bitOffset=0, base=pr....
import pytest import json from ..embedding.model import EmbeddingModel from ..feature_extraction import FeatureExtraction import numpy as np class TestFeatureExtraction(): @classmethod def setup_class(self): self.embedder_DE = EmbeddingModel(lang="de") self.embedder_EN = EmbeddingModel(lang="en...
[ "numpy.array" ]
[((518, 578), 'numpy.array', 'np.array', (['[[-1, 1, 1], [-11, 3, 9], [22, 0, 8]]'], {'dtype': 'float'}), '([[-1, 1, 1], [-11, 3, 9], [22, 0, 8]], dtype=float)\n', (526, 578), True, 'import numpy as np\n')]
import config import mailer import datetime import dbcon from dateutil.relativedelta import * personen = dbcon.personen() abteilungsconfig = dbcon.abteilungsconfig() for p in dbcon.persons_fuehr(): person = {} person["id"] = str(p[0]) person["abteilung"] = str(p[1]) person["anrede"] = str(p[2]) person["name...
[ "dbcon.persons_fuehr", "dbcon.abteilungsconfig", "mailer.send_mail_fuehr", "dbcon.pruefokdat_fuehr", "datetime.date.today", "dbcon.pruefnextdat_fuehr", "dbcon.personen" ]
[((106, 122), 'dbcon.personen', 'dbcon.personen', ([], {}), '()\n', (120, 122), False, 'import dbcon\n'), ((142, 166), 'dbcon.abteilungsconfig', 'dbcon.abteilungsconfig', ([], {}), '()\n', (164, 166), False, 'import dbcon\n'), ((177, 198), 'dbcon.persons_fuehr', 'dbcon.persons_fuehr', ([], {}), '()\n', (196, 198), Fals...
import git class RemotePackage: def __init__(self, url: str, name: str, download: bool = True): self.repo = git.Repo.clone_from(url, to_path=name) class LocalPackage: def __init__(self, path): self.path = path
[ "git.Repo.clone_from" ]
[((122, 160), 'git.Repo.clone_from', 'git.Repo.clone_from', (['url'], {'to_path': 'name'}), '(url, to_path=name)\n', (141, 160), False, 'import git\n')]
""" Apply cluster correction for independent-samples T-test based on spatial proximity and cluster size. Inspired by MNE tutorial. Created on Fri Feb 22 13:21:40 2019 @author: <NAME> <<EMAIL>> """ import numpy as np from scipy import stats from scipy.io import loadmat import matplotlib.pyplot as plt import os from ...
[ "permutation_cluster_test_AT._permutation_cluster_test_AT", "numpy.load", "numpy.save", "matplotlib.pyplot.hist", "matplotlib.pyplot.plot", "scipy.io.loadmat", "scipy.stats.gaussian_kde", "os.path.isfile", "matplotlib.pyplot.figure", "numpy.max", "numpy.where", "numpy.int", "matplotlib.pyplo...
[((700, 713), 'numpy.load', 'np.load', (['conn'], {}), '(conn)\n', (707, 713), True, 'import numpy as np\n'), ((1462, 1535), 'os.path.isfile', 'os.path.isfile', (["(read_dir + 'fake_t_vals_' + freq + window + cons + '.mat')"], {}), "(read_dir + 'fake_t_vals_' + freq + window + cons + '.mat')\n", (1476, 1535), False, 'i...
"""Apply Perl::Critic tool and gather results.""" from __future__ import print_function import subprocess from statick_tool.issue import Issue from statick_tool.tool_plugin import ToolPlugin class PerlCriticToolPlugin(ToolPlugin): """Apply Perl::Critic tool and gather results.""" def get_name(self): ...
[ "subprocess.check_output" ]
[((1189, 1302), 'subprocess.check_output', 'subprocess.check_output', (['([perlcritic_bin] + flags + files)'], {'stderr': 'subprocess.STDOUT', 'universal_newlines': '(True)'}), '([perlcritic_bin] + flags + files, stderr=subprocess\n .STDOUT, universal_newlines=True)\n', (1212, 1302), False, 'import subprocess\n')]
#! /usr/bin/python3 import gspread import json import os import re from oauth2client.service_account import ServiceAccountCredentials from util import author_to_file_path, get_excerpt_from_page, get_valid_author_slug, title_to_file_path scope = ['https://spreadsheets.google.com/feeds', 'https://www.googleapi...
[ "oauth2client.service_account.ServiceAccountCredentials.from_json_keyfile_name", "gspread.authorize", "util.title_to_file_path" ]
[((347, 424), 'oauth2client.service_account.ServiceAccountCredentials.from_json_keyfile_name', 'ServiceAccountCredentials.from_json_keyfile_name', (['"""client_secret.json"""', 'scope'], {}), "('client_secret.json', scope)\n", (395, 424), False, 'from oauth2client.service_account import ServiceAccountCredentials\n'), (...
"""Plotting function for birdsonganalysis.""" import numpy as np import seaborn as sns import matplotlib.patches as p import matplotlib.pyplot as plt from .songfeatures import spectral_derivs from .constants import FREQ_RANGE def spectral_derivs_plot(spec_der, contrast=0.1, ax=None, freq_range=None, ...
[ "numpy.flip", "seaborn.heatmap", "matplotlib.patches.Rectangle", "numpy.nanmin", "matplotlib.pyplot.subplots", "numpy.nanmax" ]
[((1018, 1141), 'seaborn.heatmap', 'sns.heatmap', (['spec_der.T'], {'yticklabels': '(50)', 'xticklabels': '(50)', 'vmin': '(-contrast)', 'vmax': 'contrast', 'ax': 'ax', 'cmap': '"""Greys"""', 'cbar': '(False)'}), "(spec_der.T, yticklabels=50, xticklabels=50, vmin=-contrast,\n vmax=contrast, ax=ax, cmap='Greys', cbar...
#!/usr/bin/python3 # -*- coding: utf-8 -*- # This is a part of CMSeeK, check the LICENSE file for more information # Copyright (c) 2018 Tuhinshubhra import cmseekdb.basic as cmseek # I know there is no reason at all to create a separate module for this.. there's something that's going to be added here so.. trust me! d...
[ "cmseekdb.basic.success" ]
[((452, 484), 'cmseekdb.basic.success', 'cmseek.success', (['"""Debug mode on!"""'], {}), "('Debug mode on!')\n", (466, 484), True, 'import cmseekdb.basic as cmseek\n')]
# -*- coding: utf-8 -*- # Authors: <NAME>; <NAME>; <NAME> <<EMAIL>> # # # License: BSD (3-clause) import numpy as np import mnefun import os #import glob os.chdir('/home/sjjoo/git/BrainTools/projects/NLR_MEG') from score import score from nlr_organizeMEG_mnefun import nlr_organizeMEG_mnefun import mne import time #im...
[ "os.mkdir", "os.path.isdir", "mnefun.do_processing", "time.time", "mne.set_config", "mnefun.Params", "os.chdir" ]
[((156, 211), 'os.chdir', 'os.chdir', (['"""/home/sjjoo/git/BrainTools/projects/NLR_MEG"""'], {}), "('/home/sjjoo/git/BrainTools/projects/NLR_MEG')\n", (164, 211), False, 'import os\n'), ((369, 380), 'time.time', 'time.time', ([], {}), '()\n', (378, 380), False, 'import time\n'), ((382, 420), 'mne.set_config', 'mne.set...
import bag_of_wording import argparse from collections import Iterable, OrderedDict def find_most_similar(bags_of_words): biggest_overlap = [0, (0, 0)] keys = list(bags_of_words) for i in range(len(keys) - 1): for j in range(i + 1, len(keys)): seq1 = bags_of_words[...
[ "bag_of_wording.extract_queries", "bag_of_wording.extract_bow_treetagger", "argparse.ArgumentParser", "bag_of_wording.extract_bow" ]
[((2498, 2577), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter'}), '(formatter_class=argparse.ArgumentDefaultsHelpFormatter)\n', (2521, 2577), False, 'import argparse\n'), ((3247, 3309), 'bag_of_wording.extract_queries', 'bag_of_wording.extract_que...
# Copyright 2020 Curtin University # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
[ "observatory.platform.utils.workflow_utils.make_dag_id", "observatory.platform.utils.file_utils.list_to_jsonl_gz", "os.path.join", "airflow.hooks.base.BaseHook.get_connection", "pendulum.datetime", "logging.info", "datetime.timedelta", "airflow.exceptions.AirflowException", "airflow.exceptions.Airfl...
[((8880, 8939), 'airflow.hooks.base.BaseHook.get_connection', 'BaseHook.get_connection', (['AirflowConns.OAEBU_SERVICE_ACCOUNT'], {}), '(AirflowConns.OAEBU_SERVICE_ACCOUNT)\n', (8903, 8939), False, 'from airflow.hooks.base import BaseHook\n'), ((9021, 9122), 'oauth2client.service_account.ServiceAccountCredentials.from_...
import numpy as np test=np.load('/home/ubuntu/hzy/pythia/data/m4c_textvqa_ocr_en_frcn_features/train_images/f441f29812b385ad_info.npy',encoding = "latin1",allow_pickle=True) #加载文件 doc = open('contrast9.txt', 'a') #打开一个存储文件,并依次写入 print(test, file=doc) #将打印内容写入文件中
[ "numpy.load" ]
[((24, 183), 'numpy.load', 'np.load', (['"""/home/ubuntu/hzy/pythia/data/m4c_textvqa_ocr_en_frcn_features/train_images/f441f29812b385ad_info.npy"""'], {'encoding': '"""latin1"""', 'allow_pickle': '(True)'}), "(\n '/home/ubuntu/hzy/pythia/data/m4c_textvqa_ocr_en_frcn_features/train_images/f441f29812b385ad_info.npy'\n...
#!/usr/bin/python # # Copyright 2018-2021 Polyaxon, 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 ...
[ "polyaxon.utils.tz_utils.now", "polyaxon.polyflow.V1Operation", "polyaxon.polyaxonfile.OperationSpecification.compile_operation", "polyaxon.config_reader.utils.deep_update", "polyaxon.polyaxonfile.OperationSpecification.apply_preset", "polyaxon.polyflow.V1Component.from_dict", "polyaxon.polyaxonfile.Ope...
[((1356, 1434), 'polyaxon.polyaxonfile.OperationSpecification.read', 'OperationSpecification.read', (["{'version': pkg.SCHEMA_VERSION, 'hubRef': 'test'}"], {}), "({'version': pkg.SCHEMA_VERSION, 'hubRef': 'test'})\n", (1383, 1434), False, 'from polyaxon.polyaxonfile import OperationSpecification\n'), ((7432, 7466), 'po...
#! /usr/bin/env python ########################### # Copyrights Please # ########################### ########################### # My Original Code # ########################### # WhoAmi : #https://www.facebook.com/Gods.nd.kings #https://www.facebook.com/clayteamwhoami """ Examples: -) Make a single Re...
[ "argparse.ArgumentParser", "math.pow", "urllib.quote", "socket.socket", "math.floor", "random.choice", "time.time", "urlparse.urlparse", "ssl.wrap_socket", "itertools.product", "sys.exit", "string.partition" ]
[((1149, 1346), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""| Take down a remote PHP Host || Coder Name : WhoAmi || Team Name : <NAME> |"""', 'prog': '"""PHP Hashtable Exploit3r v1.0"""'}), "(description=\n '| Take down a remote PHP Host ||...
from Robinhood import Robinhood from pprint import pprint class Usage(Robinhood): async def main(self): await self.login() options_dict = await self.get_option_positions_from_account() pprint(options_dict) if __name__ == '__main__': instance = Usage()
[ "pprint.pprint" ]
[((216, 236), 'pprint.pprint', 'pprint', (['options_dict'], {}), '(options_dict)\n', (222, 236), False, 'from pprint import pprint\n')]
# use click # specify environment and agent # tell it to explore # once it is done, you can inspect it's mind # you can reset it's location in env # you can tell it to move to new location def demo(): ''' demo mode is highly limited, made for demo ''' from sensorimotor.lib import MetaEnvironment MetaEnvir...
[ "sensorimotor.lib.MetaEnvironment" ]
[((311, 328), 'sensorimotor.lib.MetaEnvironment', 'MetaEnvironment', ([], {}), '()\n', (326, 328), False, 'from sensorimotor.lib import MetaEnvironment\n')]
from django.core.validators import RegexValidator from django.utils.translation import gettext_lazy as _ """ Algerian phone numbers validator. """ phone_validator = RegexValidator('^\\+?[0-9]{,12}$', _('The phone number you entered is not valid ' 'it must be of th...
[ "django.utils.translation.gettext_lazy" ]
[((201, 315), 'django.utils.translation.gettext_lazy', '_', (['"""The phone number you entered is not valid it must be of the international format.example \'+213799136332\'"""'], {}), '("The phone number you entered is not valid it must be of the international format.example \'+213799136332\'"\n )\n', (202, 315), Tr...
import os import shutil import zipfile import networkx as nx import numpy as np import pandas as pd import requests from sklearn.preprocessing import OneHotEncoder, StandardScaler from spektral.utils import nx_to_numpy DATASET_URL = 'https://ls11-www.cs.tu-dortmund.de/people/morris/graphkerneldatasets' DATASET_CLEAN...
[ "os.remove", "numpy.sum", "sklearn.preprocessing.StandardScaler", "shutil.rmtree", "os.path.join", "os.path.exists", "requests.get", "networkx.clustering", "spektral.utils.nx_to_numpy", "sklearn.preprocessing.OneHotEncoder", "os.listdir", "numpy.vstack", "numpy.concatenate", "pandas.read_h...
[((413, 456), 'os.path.expanduser', 'os.path.expanduser', (['"""~/.spektral/datasets/"""'], {}), "('~/.spektral/datasets/')\n", (431, 456), False, 'import os\n'), ((3310, 3321), 'numpy.array', 'np.array', (['X'], {}), '(X)\n', (3318, 3321), True, 'import numpy as np\n'), ((4619, 4667), 'os.path.exists', 'os.path.exists...
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
[ "tensorboard.plugin_util.experiment_id", "tensorboard.plugins.debugger_v2.debug_data_provider.execution_data_run_tag_filter", "tensorboard.plugins.debugger_v2.debug_data_provider.stack_frames_run_tag_filter", "tensorboard.plugins.base_plugin.FrontendMetadata", "tensorboard.plugins.debugger_v2.debug_data_pro...
[((1114, 1218), 'tensorboard.backend.http_util.Respond', 'http_util.Respond', (['request', "{'error': 'run parameter is not provided'}", '"""application/json"""'], {'code': '(400)'}), "(request, {'error': 'run parameter is not provided'},\n 'application/json', code=400)\n", (1131, 1218), False, 'from tensorboard.bac...
import sys from os.path import join,dirname sys.path.insert(0,dirname(__file__)) import pyronn_layers_dev
[ "os.path.dirname" ]
[((62, 79), 'os.path.dirname', 'dirname', (['__file__'], {}), '(__file__)\n', (69, 79), False, 'from os.path import join, dirname\n')]
#!/usr/bin/env python import sys from cryptolib import RollingKey, cryptolib as cl from itertools import izip from optparse import OptionParser parser = OptionParser() parser.add_option("-f", "--file", dest="input_filename", default="samples/binary_elf", help="Input file filename") parser.add_option("-o", "--output",...
[ "cryptolib.cryptolib.str2int", "itertools.izip", "optparse.OptionParser" ]
[((155, 169), 'optparse.OptionParser', 'OptionParser', ([], {}), '()\n', (167, 169), False, 'from optparse import OptionParser\n'), ((667, 686), 'itertools.izip', 'izip', (['plaintext', 'rk'], {}), '(plaintext, rk)\n', (671, 686), False, 'from itertools import izip\n'), ((556, 579), 'cryptolib.cryptolib.str2int', 'cl.s...
import os import errno import copy import json import numpy as np from scipy.optimize import curve_fit import matplotlib.pyplot as plt from .ccd import CCD from Stele.processing.processing_hsg.helper_functions import gauss from .helper_functions import calc_laser_frequencies np.set_printoptions(linewidth=500) class ...
[ "os.mkdir", "numpy.sum", "numpy.argmax", "numpy.array_str", "json.dumps", "numpy.argsort", "numpy.isclose", "numpy.mean", "matplotlib.pyplot.figure", "numpy.arange", "matplotlib.pyplot.gca", "numpy.diag", "os.path.join", "numpy.set_printoptions", "numpy.std", "numpy.append", "numpy.l...
[((277, 311), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'linewidth': '(500)'}), '(linewidth=500)\n', (296, 311), True, 'import numpy as np\n'), ((3686, 3709), 'numpy.array', 'np.array', (['self.ccd_data'], {}), '(self.ccd_data)\n', (3694, 3709), True, 'import numpy as np\n'), ((4968, 4980), 'numpy.array', ...
import requests import os import cv2 import shutil def main(): mainUrl = "https://portal.aut.ac.ir/aportal/index.jsp" img_url = 'https://portal.aut.ac.ir/aportal/PassImageServlet' pics_src = '/home/mahdi/Desktop/pics/' if not os.path.isdir(pics_src): os.makedirs(pics_src) num = len(os.lis...
[ "os.makedirs", "os.path.isdir", "cv2.imwrite", "cv2.waitKey", "cv2.imshow", "cv2.imread", "requests.get", "shutil.copyfileobj", "os.listdir", "cv2.namedWindow" ]
[((245, 268), 'os.path.isdir', 'os.path.isdir', (['pics_src'], {}), '(pics_src)\n', (258, 268), False, 'import os\n'), ((278, 299), 'os.makedirs', 'os.makedirs', (['pics_src'], {}), '(pics_src)\n', (289, 299), False, 'import os\n'), ((314, 334), 'os.listdir', 'os.listdir', (['pics_src'], {}), '(pics_src)\n', (324, 334)...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import sys import os import os.path as osp import argparse import time import numpy as np from tqdm import tqdm import json import torch import torch.backends.cudnn as cudnn import cv2 import _init_paths from ...
[ "sys.path.pop", "argparse.ArgumentParser", "utils.utilitys.plot_keypoint", "config.update_config", "cv2.imshow", "detector.load_model", "torch.no_grad", "detector.yolo_human_det", "torch.load", "json.dump", "cv2.waitKey", "numpy.asarray", "torch.cuda.is_available", "track.sort.Sort", "ut...
[((546, 561), 'sys.path.pop', 'sys.path.pop', (['(0)'], {}), '(0)\n', (558, 561), False, 'import sys\n'), ((626, 644), '_init_paths.get_path', 'get_path', (['__file__'], {}), '(__file__)\n', (634, 644), False, 'from _init_paths import get_path\n'), ((766, 794), 'sys.path.insert', 'sys.path.insert', (['(0)', 'lib_root']...
import os import unittest import pandas as pd from diabetes.scoring.batch.run import batch_scoring from diabetes.training.evaluate import split_data from diabetes.training.train import train_model class TestScoringBatchMethods(unittest.TestCase): def test_batch_scoring(self): ridge_args = {"alpha": 0.5} ...
[ "diabetes.training.evaluate.split_data", "diabetes.scoring.batch.run.batch_scoring", "pandas.read_csv", "diabetes.training.train.train_model", "os.path.join" ]
[((340, 401), 'os.path.join', 'os.path.join', (['"""tests/diabetes/data"""', '"""diabetes_unit_test.csv"""'], {}), "('tests/diabetes/data', 'diabetes_unit_test.csv')\n", (352, 401), False, 'import os\n'), ((481, 501), 'diabetes.training.evaluate.split_data', 'split_data', (['train_df'], {}), '(train_df)\n', (491, 501),...
import tensorflow as tf import numpy as np import gpflow from gpflow.base import Parameter from gpflow.utilities import positive class ReLUKernel(gpflow.kernels.Kernel): """ Kernel such that the mean 0 GP with the corresponding covariance function is equal in distribution to an infinitely wide BNN prior w...
[ "tensorflow.sin", "gpflow.utilities.positive", "numpy.ones", "tensorflow.acos", "tensorflow.matmul", "tensorflow.square", "tensorflow.sqrt", "tensorflow.cos" ]
[((2614, 2651), 'tensorflow.sqrt', 'tf.sqrt', (['(KiX[:, None] * KiX2[None, :])'], {}), '(KiX[:, None] * KiX2[None, :])\n', (2621, 2651), True, 'import tensorflow as tf\n'), ((2698, 2749), 'tensorflow.acos', 'tf.acos', (['(jitter + (1 - 2 * jitter) * Ki / sqrt_term)'], {}), '(jitter + (1 - 2 * jitter) * Ki / sqrt_term)...
import json import pathlib def save_json(obj, path: str): with open(path, 'w') as f: json.dump(obj, f) def load_json(path: str): with open(path, 'r') as f: obj = json.load(f) return obj def mkdirs_if_not_exist(path, verbose: bool = False): path = pathlib.Path(path) if not path....
[ "json.dump", "pathlib.Path", "json.load" ]
[((285, 303), 'pathlib.Path', 'pathlib.Path', (['path'], {}), '(path)\n', (297, 303), False, 'import pathlib\n'), ((99, 116), 'json.dump', 'json.dump', (['obj', 'f'], {}), '(obj, f)\n', (108, 116), False, 'import json\n'), ((190, 202), 'json.load', 'json.load', (['f'], {}), '(f)\n', (199, 202), False, 'import json\n')]
import subprocess if __name__ == '__main__': subprocess.call("python3 index.py -p /Users/zhouwei/Desktop/python/pythonLearn/gif/test.jpg -t 16 -s 1.25", shell=True)
[ "subprocess.call" ]
[((50, 179), 'subprocess.call', 'subprocess.call', (['"""python3 index.py -p /Users/zhouwei/Desktop/python/pythonLearn/gif/test.jpg -t 16 -s 1.25"""'], {'shell': '(True)'}), "(\n 'python3 index.py -p /Users/zhouwei/Desktop/python/pythonLearn/gif/test.jpg -t 16 -s 1.25'\n , shell=True)\n", (65, 179), False, 'impor...
import pytest from os.path import join import io from logic.obfuscatefile import source_statement_gen def test_get_source_statements(tmpdir): # # Create a short source file # dir_name = str(tmpdir.mkdir('source')) source_file = 'app.py' with io.open(join(dir_name, source_file), 'w') as source:...
[ "pytest.raises", "os.path.join", "logic.obfuscatefile.source_statement_gen" ]
[((3041, 3100), 'logic.obfuscatefile.source_statement_gen', 'source_statement_gen', (['source_file', 'dir_name'], {'platform': '"""iOS"""'}), "(source_file, dir_name, platform='iOS')\n", (3061, 3100), False, 'from logic.obfuscatefile import source_statement_gen\n'), ((5146, 5209), 'logic.obfuscatefile.source_statement_...
# coding: utf-8 from __future__ import print_function from .__init__ import EP, PY2, COLORS, IRONPY, unicode from . import util as Util from . import chat as Chat from . import user as User import os import re import time import zlib import socket import threading import binascii from datetime import datetime import o...
[ "threading.Thread", "socket.socket", "time.strftime", "time.time", "time.sleep", "datetime.datetime.utcnow", "os.path.isfile", "datetime.datetime.utcfromtimestamp", "binascii.unhexlify", "socket.getpeername", "operator.itemgetter", "queue.Queue", "re.compile" ]
[((746, 1323), 're.compile', 're.compile', (["('root|Admin|admin|default|support|user|password|telnet|' +\n 'guest|operator|supervisor|daemon|service|enable|system|' +\n 'manager|baby|netman|telecom|volition|davox|sysadm|busybox|' +\n 'tech|888888|666666|mg3500|merlin|nmspw|super|setup|vizxv|' +\n 'HTTP/1|2...
#!BPY """ Name: 'GMDC (.gmdc)' Blender: 249 Group: 'Export' Tooltip: 'Export to TS2 GMDC file' """ # ------------------------------------------------------------------------------- # Copyright (C) 2016 DjAlex88 (https://github.com/djalex88/) # # Permission is hereby granted, free of charge, to any person obtaining a...
[ "bpy.app.Menu", "os.path.isfile", "bpy.app.Register", "bpy.app.BeginAlign", "bpy.app.Label", "bpy.app.EndAlign", "struct.pack", "bpy.app.Window.EditMode", "bpy.app.Exit", "os.path.basename", "bpy.app.Create", "itertools.count", "bpy.app.Toggle", "itertools.repeat", "bpy.sys.makename", ...
[((29053, 29071), 'bpy.app.Create', 'bpy.app.Create', (['""""""'], {}), "('')\n", (29067, 29071), False, 'import bpy\n'), ((29092, 29110), 'bpy.app.Create', 'bpy.app.Create', (['""""""'], {}), "('')\n", (29106, 29110), False, 'import bpy\n'), ((29129, 29146), 'bpy.app.Create', 'bpy.app.Create', (['(1)'], {}), '(1)\n', ...
# Generated by Django 2.0.1 on 2018-01-12 12:04 from django.db import migrations, models def populate_function_allowed(apps, schema_editor): Classification = apps.get_model('metarecord', 'Classification') for classification in Classification.objects.all(): classification.function_allowed = not class...
[ "django.db.migrations.RunPython", "django.db.models.BooleanField" ]
[((762, 836), 'django.db.migrations.RunPython', 'migrations.RunPython', (['populate_function_allowed', 'migrations.RunPython.noop'], {}), '(populate_function_allowed, migrations.RunPython.noop)\n', (782, 836), False, 'from django.db import migrations, models\n'), ((674, 741), 'django.db.models.BooleanField', 'models.Bo...
from pathlib import Path from typing import Set from django.http import JsonResponse from django.views.decorators.csrf import csrf_exempt from diplomova_praca_lib.position_similarity.models import PositionMethod from diplomova_praca_lib.position_similarity.position_similarity_request import available_images f...
[ "diplomova_praca_lib.position_similarity.position_similarity_request.available_images", "django.http.JsonResponse", "pathlib.Path" ]
[((555, 597), 'django.http.JsonResponse', 'JsonResponse', (["{'files': files}"], {'status': '(200)'}), "({'files': files}, status=200)\n", (567, 597), False, 'from django.http import JsonResponse\n'), ((692, 716), 'diplomova_praca_lib.position_similarity.position_similarity_request.available_images', 'available_images'...
def dir_name(config, method): if config.game.kind == "Breakthrough": return "{}-breakthrough-{}".format(method, config.game.size) elif config.game.kind == "Gym": return "{}-gym-{}".format(method, config.game.name) else: print("Unknown game in config file.") exit(-1) def get...
[ "numpy.abs", "numpy.floor", "numpy.zeros", "numpy.clip", "tensorflow.keras.losses.categorical_crossentropy", "numpy.sign" ]
[((1394, 1438), 'numpy.clip', 'np.clip', (['scaled', '(-support_size)', 'support_size'], {}), '(scaled, -support_size, support_size)\n', (1401, 1438), True, 'import numpy as np\n'), ((1449, 1466), 'numpy.floor', 'np.floor', (['clamped'], {}), '(clamped)\n', (1457, 1466), True, 'import numpy as np\n'), ((1541, 1580), 'n...
from octopus.platforms.BTC.explorer import BitcoinExplorerRPC from octopus.platforms.BTC.explorer import RPC_USER, RPC_PASSWORD, RPC_HOST import unittest class BitcoinExplorerTestCase(unittest.TestCase): explorer = BitcoinExplorerRPC(host=('%s:%s@%s' % (RPC_USER, RPC_PASSWORD, RPC_HOST))) blockhash = '0000...
[ "unittest.TextTestRunner", "octopus.platforms.BTC.explorer.BitcoinExplorerRPC", "unittest.TestLoader" ]
[((223, 295), 'octopus.platforms.BTC.explorer.BitcoinExplorerRPC', 'BitcoinExplorerRPC', ([], {'host': "('%s:%s@%s' % (RPC_USER, RPC_PASSWORD, RPC_HOST))"}), "(host='%s:%s@%s' % (RPC_USER, RPC_PASSWORD, RPC_HOST))\n", (241, 295), False, 'from octopus.platforms.BTC.explorer import BitcoinExplorerRPC\n'), ((5295, 5316), ...
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Name: common.py # Purpose: Commonly used tools across Daseki # # Authors: <NAME> # # Copyright: Copyright © 2014-16 <NAME> / cuthbertLab # License: BSD, see license.txt # -----------------...
[ "time.asctime", "os.mkdir", "os.stat", "daseki.mainTest", "daseki.exceptionsDS.DasekiException", "tempfile.gettempdir", "os.path.exists", "time.time", "inspect.getfile", "sys.stderr.write", "weakref.ref", "os.listdir", "time.localtime", "re.compile" ]
[((3001, 3077), 're.compile', 're.compile', (['"""([A-Za-z][A-Za-z][A-Za-z])(\\\\d\\\\d\\\\d\\\\d)(\\\\d\\\\d)(\\\\d\\\\d)(\\\\d?)"""'], {}), "('([A-Za-z][A-Za-z][A-Za-z])(\\\\d\\\\d\\\\d\\\\d)(\\\\d\\\\d)(\\\\d\\\\d)(\\\\d?)')\n", (3011, 3077), False, 'import re\n'), ((1293, 1324), 'inspect.getfile', 'inspect.getfile'...
#!/usr/bin/env python3 """ Python3 class to work with Aravis/GenICam cameras, subclass of sdss-basecam. .. module:: araviscam .. moduleauthor:: <NAME> <<EMAIL>> """ import sys import math import asyncio import numpy import astropy from basecam.mixins import ImageAreaMixIn from basecam import ( CameraSystem, ...
[ "basecam.CameraConnectionError", "math.radians", "lvmcam.araviscam.aravis.Aravis.update_device_list", "lvmcam.araviscam.aravis.Aravis.get_device_id", "math.sin", "math.cos", "lvmcam.araviscam.aravis.Aravis.get_n_devices", "astropy.io.fits.Card", "numpy.ndarray", "lvmcam.araviscam.aravis.Aravis.Cam...
[((4241, 4268), 'lvmcam.araviscam.aravis.Aravis.update_device_list', 'Aravis.update_device_list', ([], {}), '()\n', (4266, 4268), False, 'from lvmcam.araviscam.aravis import Aravis\n'), ((4284, 4306), 'lvmcam.araviscam.aravis.Aravis.get_n_devices', 'Aravis.get_n_devices', ([], {}), '()\n', (4304, 4306), False, 'from lv...
import unittest from troposphere import Parameter, Ref class TestInitArguments(unittest.TestCase): def test_title_max_length(self): title = "i" * 256 with self.assertRaises(ValueError): Parameter(title, Type="String") def test_ref_can_be_requested(self): param = Parameter...
[ "unittest.main", "troposphere.Parameter" ]
[((520, 535), 'unittest.main', 'unittest.main', ([], {}), '()\n', (533, 535), False, 'import unittest\n'), ((311, 344), 'troposphere.Parameter', 'Parameter', (['"""title"""'], {'Type': '"""String"""'}), "('title', Type='String')\n", (320, 344), False, 'from troposphere import Parameter, Ref\n'), ((221, 252), 'troposphe...
from django.db import models from .Auditable import Auditable from .Credential import Credential class Name(Auditable): reindex_related = ['credential'] credential = models.ForeignKey(Credential, related_name="names", on_delete=models.CASCADE) text = models.TextField(null=True) language = models.Te...
[ "django.db.models.ForeignKey", "django.db.models.TextField" ]
[((179, 256), 'django.db.models.ForeignKey', 'models.ForeignKey', (['Credential'], {'related_name': '"""names"""', 'on_delete': 'models.CASCADE'}), "(Credential, related_name='names', on_delete=models.CASCADE)\n", (196, 256), False, 'from django.db import models\n'), ((268, 295), 'django.db.models.TextField', 'models.T...
from fastapi import FastAPI, Request from fastapi.middleware.cors import CORSMiddleware from pydantic import BaseModel class Input(BaseModel): method: str params: dict = {} locale: str = 'en' token: str = None app = FastAPI(title='Web app API') app.add_middleware( CORSMiddleware, allow_origins=["*"], ...
[ "uvicorn.run", "fastapi.FastAPI" ]
[((224, 252), 'fastapi.FastAPI', 'FastAPI', ([], {'title': '"""Web app API"""'}), "(title='Web app API')\n", (231, 252), False, 'from fastapi import FastAPI, Request\n'), ((620, 682), 'uvicorn.run', 'uvicorn.run', (['"""app:app"""'], {'host': '"""0.0.0.0"""', 'port': '(5000)', 'reload': '(True)'}), "('app:app', host='0...
import json from collections import Counter import re from VQA.PythonHelperTools.vqaTools.vqa import VQA import random import numpy as np from keras.preprocessing.image import load_img, img_to_array, ImageDataGenerator from matplotlib import pyplot as plt import os import VQAModel from keras.applications.xception impor...
[ "os.fsdecode", "keras.applications.xception.preprocess_input", "numpy.expand_dims", "keras.preprocessing.image.img_to_array", "keras.preprocessing.image.load_img", "os.fsencode", "os.path.join", "os.listdir", "VQAModel.createModelXception" ]
[((1165, 1184), 'os.fsencode', 'os.fsencode', (['imgDir'], {}), '(imgDir)\n', (1176, 1184), False, 'import os\n'), ((1248, 1295), 'VQAModel.createModelXception', 'VQAModel.createModelXception', (['(size1, size2, 3)'], {}), '((size1, size2, 3))\n', (1276, 1295), False, 'import VQAModel\n'), ((1324, 1345), 'os.listdir', ...
""" JSON based serializer. """ import simplejson from base64 import b64encode, b64decode from tiddlyweb.serializations import SerializationInterface from tiddlyweb.model.bag import Bag from tiddlyweb.model.policy import Policy class Serialization(SerializationInterface): """ Turn various entities to and fr...
[ "simplejson.dumps", "tiddlyweb.model.bag.Bag", "base64.b64decode", "tiddlyweb.model.policy.Policy", "base64.b64encode", "simplejson.loads" ]
[((492, 545), 'simplejson.dumps', 'simplejson.dumps', (['[recipe.name for recipe in recipes]'], {}), '([recipe.name for recipe in recipes])\n', (508, 545), False, 'import simplejson\n'), ((689, 733), 'simplejson.dumps', 'simplejson.dumps', (['[bag.name for bag in bags]'], {}), '([bag.name for bag in bags])\n', (705, 73...