code
stringlengths
22
1.05M
apis
listlengths
1
3.31k
extract_api
stringlengths
75
3.25M
import cv2 import retinex import os import glob if __name__ == '__main__': DATA_ROOT = './train/0000045' for name in os.listdir(DATA_ROOT): img_path = os.path.join(DATA_ROOT, name) sigma = [15, 80, 200] print(img_path) img = cv2.imread(img_path) img_en = retinex.automate...
[ "cv2.moveWindow", "os.listdir", "cv2.resizeWindow", "os.path.join", "retinex.automatedMSRCR", "cv2.imshow", "cv2.waitKey", "cv2.destroyAllWindows", "cv2.imread", "cv2.namedWindow" ]
[((126, 147), 'os.listdir', 'os.listdir', (['DATA_ROOT'], {}), '(DATA_ROOT)\n', (136, 147), False, 'import os\n'), ((168, 197), 'os.path.join', 'os.path.join', (['DATA_ROOT', 'name'], {}), '(DATA_ROOT, name)\n', (180, 197), False, 'import os\n'), ((266, 286), 'cv2.imread', 'cv2.imread', (['img_path'], {}), '(img_path)\...
import argparse import subprocess import logging import time import re import os from datetime import datetime from contextlib import closing, contextmanager import pymysql import pymysql.cursors import boto3 import botocore.exceptions logger = logging.getLogger(__name__) def main(): parser = argparse.ArgumentP...
[ "logging.getLogger", "logging.StreamHandler", "boto3.client", "argparse.ArgumentParser", "subprocess.check_call", "datetime.datetime.utcnow", "logging.Formatter", "subprocess.Popen", "re.match", "pymysql.connect", "time.sleep", "contextlib.closing" ]
[((247, 274), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (264, 274), False, 'import logging\n'), ((302, 327), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (325, 327), False, 'import argparse\n'), ((2521, 2621), 'logging.Formatter', 'logging.Formatter', (['""...
import datetime import requests import json from bitcoin import ecdsa_verify, ecdsa_recover, ecdsa_sign, pubtoaddr, privtoaddr from .exceptions import InvalidSignature from .consensus import validate_timestamp from .network import SEED_NODES import dateutil.parser def make_peer_registration(pk, domain): timestamp...
[ "bitcoin.ecdsa_recover", "json.dumps", "bitcoin.pubtoaddr", "requests.get", "datetime.datetime.now", "bitcoin.privtoaddr", "bitcoin.ecdsa_verify", "bitcoin.ecdsa_sign" ]
[((373, 387), 'bitcoin.privtoaddr', 'privtoaddr', (['pk'], {}), '(pk)\n', (383, 387), False, 'from bitcoin import ecdsa_verify, ecdsa_recover, ecdsa_sign, pubtoaddr, privtoaddr\n'), ((1028, 1075), 'bitcoin.ecdsa_verify', 'ecdsa_verify', (['to_sign', "reg['signature']", 'pubkey'], {}), "(to_sign, reg['signature'], pubke...
from pathlib import Path from ontopy import get_ontology, World from ontopy.utils import write_catalog # Setup dlite paths thisdir = Path(__file__).parent.absolute() rootdir = thisdir.parent.parent # Load ontologies into a common world world = World() mapsTo_onto = world.get_ontology(f'{rootdir}/ontology/mapsTo.t...
[ "ontopy.utils.write_catalog", "ontopy.World", "pathlib.Path" ]
[((249, 256), 'ontopy.World', 'World', ([], {}), '()\n', (254, 256), False, 'from ontopy import get_ontology, World\n'), ((2323, 2376), 'ontopy.utils.write_catalog', 'write_catalog', (['catalog', 'f"""{thisdir}/catalog-v001.xml"""'], {}), "(catalog, f'{thisdir}/catalog-v001.xml')\n", (2336, 2376), False, 'from ontopy.u...
import torch import numpy as np from torch import nn from torch import optim from torch.utils.data import TensorDataset, DataLoader from forPython.datasets.uci import load_mhealth from forPython.models.torch.cnn import SimpleCNN from forPython.utility.trainer import TorchSimpleTrainer np.random.seed(0) torch.random.m...
[ "torch.random.manual_seed", "forPython.utility.trainer.TorchSimpleTrainer", "forPython.models.torch.cnn.SimpleCNN", "torch.nn.CrossEntropyLoss", "torch.utils.data.TensorDataset", "torch.tensor", "numpy.random.seed", "torch.utils.data.DataLoader", "forPython.datasets.uci.load_mhealth" ]
[((288, 305), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (302, 305), True, 'import numpy as np\n'), ((306, 333), 'torch.random.manual_seed', 'torch.random.manual_seed', (['(0)'], {}), '(0)\n', (330, 333), False, 'import torch\n'), ((375, 389), 'forPython.datasets.uci.load_mhealth', 'load_mhealth', (...
import pytest from marshmallow import Schema, fields from lambda_handlers import validators from lambda_handlers.handlers import http_handler from lambda_handlers.response import cors class TestHTTPHandlerDefaults: @pytest.fixture def handler(self): @http_handler() def handler(event, context...
[ "lambda_handlers.handlers.http_handler", "marshmallow.fields.Nested", "pytest.mark.parametrize", "lambda_handlers.response.cors", "marshmallow.fields.Dict", "marshmallow.fields.Integer" ]
[((3768, 3892), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""body,expected"""', '[(\'{"user_id": 1}\', \'{"user_id": 1}\'), (\'{"user_id": "1"}\', \'{"user_id": 1}\')]'], {}), '(\'body,expected\', [(\'{"user_id": 1}\',\n \'{"user_id": 1}\'), (\'{"user_id": "1"}\', \'{"user_id": 1}\')])\n', (3791, 3892...
# Copyright 2008 Nokia Siemens Networks Oyj # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
[ "unittest.main", "robotide.validators.ArgumentsValidator" ]
[((2159, 2174), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2172, 2174), False, 'import unittest\n'), ((783, 803), 'robotide.validators.ArgumentsValidator', 'ArgumentsValidator', ([], {}), '()\n', (801, 803), False, 'from robotide.validators import ArgumentsValidator\n')]
from socket import * import json import JsonParser import DBHelper conn = socket(AF_INET, SOCK_STREAM) conn.bind(('',4687)) conn.listen(40) while True: new_conn, addr = conn.accept() msg = new_conn.recv(1024).decode() obj = json.loads(msg) if obj['instruction'] == 'reg': result = DBHelper.reg...
[ "json.loads", "DBHelper.update_folder", "JsonParser.dump_single_note", "DBHelper.select_all_notes", "DBHelper.insert_folder", "DBHelper.insert_note", "DBHelper.select_single_note", "DBHelper.select_all_folders", "DBHelper.registry", "DBHelper.update_note", "DBHelper.delete_folder", "JsonParser...
[((239, 254), 'json.loads', 'json.loads', (['msg'], {}), '(msg)\n', (249, 254), False, 'import json\n'), ((308, 372), 'DBHelper.registry', 'DBHelper.registry', (["obj['userid']", "obj['passwd']", "obj['nickname']"], {}), "(obj['userid'], obj['passwd'], obj['nickname'])\n", (325, 372), False, 'import DBHelper\n'), ((472...
#!/usr/bin/env python3 """ ** * @file convertFASTQ2SAM.py * @brief Convert SimCT FASTQ to SAM * @copyright © 2019 Novocraft Technologies Sdn Bhd. All rights reserved. * @author <NAME>. * @license This script is released under MIT License * @date 26/04/201...
[ "argparse.ArgumentParser", "gzip.open" ]
[((3499, 3564), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Convert SimCT FASTQ to SAM"""'}), "(description='Convert SimCT FASTQ to SAM')\n", (3522, 3564), False, 'import argparse\n'), ((699, 727), 'gzip.open', 'gzip.open', (['_path2Reads1', '"""r"""'], {}), "(_path2Reads1, 'r')\n", (...
import json import websocket def get_uri(game=""): uri = f"ws://127.0.0.1:8000/{game}/" return uri def connect(uri): connection = websocket.WebSocketApp(uri, on_error=on_error, on_close=on_close) return connection def on_error(connection, error): print(error) def on_close(connection): p...
[ "json.dumps", "websocket.WebSocketApp" ]
[((146, 211), 'websocket.WebSocketApp', 'websocket.WebSocketApp', (['uri'], {'on_error': 'on_error', 'on_close': 'on_close'}), '(uri, on_error=on_error, on_close=on_close)\n', (168, 211), False, 'import websocket\n'), ((484, 520), 'json.dumps', 'json.dumps', (["{'direction': direction}"], {}), "({'direction': direction...
""" Copyright (c) Facebook, Inc. and its affiliates. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. Changes made: window is now 3D with size (1, 1, win_size, win_size, win_si`ze) All convolutions for mean and variance comp. are 3D Conv """ impo...
[ "SimpleITK.ReadImage", "torch.Tensor", "SimpleITK.GetArrayFromImage", "torch.ones" ]
[((2382, 2453), 'SimpleITK.ReadImage', 'sitk.ReadImage', (['"""/repos/Maastro/nki_cervix/train/21403922/CT/0/CT.nrrd"""'], {}), "('/repos/Maastro/nki_cervix/train/21403922/CT/0/CT.nrrd')\n", (2396, 2453), True, 'import SimpleITK as sitk\n'), ((2466, 2537), 'SimpleITK.ReadImage', 'sitk.ReadImage', (['"""/repos/Maastro/n...
import os import subprocess from audio_length import escape_characters import argparse filetypes_to_convert=[".mp3",".m4a", ".webm"] def convert(filename): filename_extensionless, extension = os.path.splitext(filename) new_filename = "".join([filename_extensionless, ".wav"]) if not os.path.exists(new_filename):...
[ "os.path.exists", "argparse.ArgumentParser", "os.path.splitext", "os.path.join", "audio_length.escape_characters", "subprocess.call", "os.walk" ]
[((196, 222), 'os.path.splitext', 'os.path.splitext', (['filename'], {}), '(filename)\n', (212, 222), False, 'import os\n'), ((527, 540), 'os.walk', 'os.walk', (['path'], {}), '(path)\n', (534, 540), False, 'import os\n'), ((803, 828), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (826, 828), ...
###------------------------------------------------------### ### Replay and Remember Memory Class ### ###------------------------------------------------------### import numpy as np from hyperparameters import * # expand dimensions to (1, 84, 84, 5) from (84, 84, 5) # normalize 0-255 -> 0-1 to re...
[ "numpy.random.choice", "numpy.zeros" ]
[((1868, 1907), 'numpy.zeros', 'np.zeros', (['[memory_size]'], {'dtype': 'np.uint8'}), '([memory_size], dtype=np.uint8)\n', (1876, 1907), True, 'import numpy as np\n'), ((1338, 1437), 'numpy.zeros', 'np.zeros', (['[memory_size, self.state_height, self.state_width, self.state_depth]'], {'dtype': 'np.uint8'}), '([memory_...
import numpy as np import scipy.stats as stat from utils import dichotomic_search """ Implementation of last particle variant """ def ImportanceSplittingLp(gen,kernel,h,tau=0,N=100,s=0.1,decay=0.9,T = 20, accept_ratio = 0.9, alpha_est = 0.95, alpha_test=0.99,verbose=1, gain_thresh=0.01, check_every=3, p_c = 10**(-2...
[ "numpy.abs", "numpy.sqrt", "numpy.ones", "numpy.where", "numpy.delete", "numpy.log", "scipy.stats.norm.ppf", "utils.dichotomic_search", "numpy.array", "numpy.zeros", "numpy.argsort", "numpy.argmin", "numpy.arange" ]
[((2177, 2251), 'utils.dichotomic_search', 'dichotomic_search', ([], {'f': 'confidence_level_m', 'a': '(100)', 'b': 'n_max', 'thresh': 'alpha_test'}), '(f=confidence_level_m, a=100, b=n_max, thresh=alpha_test)\n', (2194, 2251), False, 'from utils import dichotomic_search\n'), ((2611, 2622), 'numpy.zeros', 'np.zeros', (...
# -*- coding: utf-8 -*- # Database Connection variables DBN='mysql' HOST='localhost' DB='equinecl_db' USER='equinecl_usr' MODE='fastcgi' # mod_python, fastcgi, mod_wsgi ENV='production' # production or development PWD='<PASSWORD>' # Generic configuration website variables WEBSITE_URL='http://www.equineclinic.com.br'...
[ "model.get_active_oper_modules", "model.get_active_admin_modules", "model.get_active_moderate_modules" ]
[((724, 750), 'model.get_active_admin_modules', 'get_active_admin_modules', ([], {}), '()\n', (748, 750), False, 'from model import get_active_admin_modules, get_active_oper_modules, get_active_moderate_modules\n'), ((766, 791), 'model.get_active_oper_modules', 'get_active_oper_modules', ([], {}), '()\n', (789, 791), F...
""" this is a stripped down version of the SWHear class. It's designed to hold only a single audio sample in memory. check my githib for a more complete version: http://github.com/swharden """ import serial, os, pty import time import numpy as np from threading import Thread import random class Spo...
[ "random.uniform", "time.sleep", "numpy.append", "numpy.sin", "threading.Thread", "numpy.arange" ]
[((714, 749), 'numpy.arange', 'np.arange', (['(0)', 'time_interval', 'period'], {}), '(0, time_interval, period)\n', (723, 749), True, 'import numpy as np\n'), ((768, 801), 'numpy.sin', 'np.sin', (['(2 * np.pi * self.x * freq)'], {}), '(2 * np.pi * self.x * freq)\n', (774, 801), True, 'import numpy as np\n'), ((889, 91...
""" Intialize the Pygate application """ from flask import Flask from flask_sqlalchemy import SQLAlchemy app = Flask(__name__) app.config.from_object("config") db = SQLAlchemy(app) from pygate import routes, models
[ "flask_sqlalchemy.SQLAlchemy", "flask.Flask" ]
[((113, 128), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (118, 128), False, 'from flask import Flask\n'), ((167, 182), 'flask_sqlalchemy.SQLAlchemy', 'SQLAlchemy', (['app'], {}), '(app)\n', (177, 182), False, 'from flask_sqlalchemy import SQLAlchemy\n')]
import pytest from time import sleep from datetime import ( date, timedelta ) from utilities import XLUtility from pageObjects.common_functions.common_methods import CommonMethods # This test checks the functionality of creating a session with fee discount @pytest.mark.usefixtures("one_time_setup") class Test_TC101...
[ "time.sleep", "datetime.timedelta", "pytest.mark.usefixtures", "pageObjects.common_functions.common_methods.CommonMethods", "pytest.fixture", "datetime.date.today", "utilities.XLUtility.readData" ]
[((262, 303), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""one_time_setup"""'], {}), "('one_time_setup')\n", (285, 303), False, 'import pytest\n'), ((353, 381), 'pytest.fixture', 'pytest.fixture', ([], {'autouse': '(True)'}), '(autouse=True)\n', (367, 381), False, 'import pytest\n'), ((489, 515), 'pageOb...
import numpy as np import matplotlib.pyplot as plt import matplotlib.cm as cm from matplotlib import animation # thermal conductivity c = 1.0 # define the discretization grid xmin = -5.0 # left/bottom bound xmax = 5.0 # right/top bound dx = 0.1 # space increment (default 0.1) nx = int((xmax-xmin)/dx) # ...
[ "matplotlib.pyplot.imshow", "matplotlib.animation.FuncAnimation", "numpy.zeros", "matplotlib.pyplot.figure", "matplotlib.pyplot.title", "matplotlib.pyplot.xlim", "matplotlib.pyplot.ylim", "matplotlib.pyplot.show" ]
[((440, 458), 'numpy.zeros', 'np.zeros', (['(nx, nx)'], {}), '((nx, nx))\n', (448, 458), True, 'import numpy as np\n'), ((1263, 1275), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (1273, 1275), True, 'import matplotlib.pyplot as plt\n'), ((1282, 1370), 'matplotlib.pyplot.imshow', 'plt.imshow', (['u0'], {...
import socket host = '192.168.4.254' port = 12345 addr = (host, port) c = socket.socket(type=socket.SOCK_DGRAM) c.sendto(b'hello world!\r\n', addr) data = c.recvfrom(1024)[0] print(data.decode(), end='') c.close()
[ "socket.socket" ]
[((76, 113), 'socket.socket', 'socket.socket', ([], {'type': 'socket.SOCK_DGRAM'}), '(type=socket.SOCK_DGRAM)\n', (89, 113), False, 'import socket\n')]
import os, re, argparse from dotenv import load_dotenv from instabot import Bot from pprint import pprint def get_usernames(text): # Code: Regex for Instagram Username and Hashtags # https://blog.jstassen.com/2016/03/code-regex-for-instagram-username-and-hashtags/ pattern = re.compile('(?:@)([A-Za-z0-9...
[ "argparse.ArgumentParser", "os.getenv", "re.compile", "dotenv.load_dotenv", "instabot.Bot" ]
[((292, 393), 're.compile', 're.compile', (['"""(?:@)([A-Za-z0-9_](?:(?:[A-Za-z0-9_]|(?:\\\\.(?!\\\\.))){0,28}(?:[A-Za-z0-9_]))?)"""'], {}), "(\n '(?:@)([A-Za-z0-9_](?:(?:[A-Za-z0-9_]|(?:\\\\.(?!\\\\.))){0,28}(?:[A-Za-z0-9_]))?)'\n )\n", (302, 393), False, 'import os, re, argparse\n'), ((1202, 1207), 'instabot.Bo...
# -*- coding: utf-8 -*- # vi:si:et:sw=4:sts=4:ts=4 """This is helper module that contains functions to easeup communication with seaweed-fs """ import requests from pyseaweed.version import __version__ class Connection(object): def __init__(self, use_session=False): if use_session: self._c...
[ "requests.Session" ]
[((326, 344), 'requests.Session', 'requests.Session', ([], {}), '()\n', (342, 344), False, 'import requests\n')]
import networkx as nx from nptyping import NDArray from typing import List, Tuple from .. import utils from .Objective import Objective class BudgetAllocation(Objective): def __init__(self, G: nx.Graph, B: NDArray[int], B_range: Tuple[int, int]): """ Optimal budget allocation is a special case of the ...
[ "networkx.adjacency_matrix" ]
[((1578, 1600), 'networkx.adjacency_matrix', 'nx.adjacency_matrix', (['G'], {}), '(G)\n', (1597, 1600), True, 'import networkx as nx\n')]
from synthesis.synthesizer.decider import * from synthesis.synthesizer.dplyr_to_pd.pd_result import * from synthesis.search_structure import * from utils.logger import get_logger import pandas import copy from io import StringIO logger = get_logger('synthesizer.decider') class PDDecider(Decider): def __init__(s...
[ "utils.logger.get_logger", "copy.deepcopy" ]
[((239, 272), 'utils.logger.get_logger', 'get_logger', (['"""synthesizer.decider"""'], {}), "('synthesizer.decider')\n", (249, 272), False, 'from utils.logger import get_logger\n'), ((2181, 2198), 'copy.deepcopy', 'copy.deepcopy', (['df'], {}), '(df)\n', (2194, 2198), False, 'import copy\n'), ((1221, 1242), 'copy.deepc...
import pulpcore.client.pulp_rpm as pulp_rpm import pulpcore.client.pulpcore as pulpcore import yaml import sys import json import colorama from colorama import Fore from colorama import Style from time import sleep from datetime import date, datetime class RpmCherryPick: """Class used for cherry picking rpm packa...
[ "pulpcore.client.pulp_rpm.PaginatedrpmModulemdResponseList", "pulpcore.client.pulpcore.ApiClient", "pulpcore.client.pulp_rpm.PaginatedrpmPackageResponseList", "pulpcore.client.pulp_rpm.RepositoriesRpmApi", "pulpcore.client.pulp_rpm.ApiClient", "pulpcore.client.pulp_rpm.RpmCopyApi", "json.JSONEncoder.def...
[((640, 711), 'pulpcore.client.pulp_rpm.Configuration', 'pulp_rpm.Configuration', ([], {'host': 'host', 'username': 'username', 'password': 'password'}), '(host=host, username=username, password=password)\n', (662, 711), True, 'import pulpcore.client.pulp_rpm as pulp_rpm\n'), ((791, 848), 'pulpcore.client.pulp_rpm.ApiC...
from distutils.core import setup setup(name='VisualRecognitionTooling', version='1.0', description='Tooling Library for IBM Watson Visual Recognition', author='<NAME>', author_email='', packages=['vrtool'], )
[ "distutils.core.setup" ]
[((34, 216), 'distutils.core.setup', 'setup', ([], {'name': '"""VisualRecognitionTooling"""', 'version': '"""1.0"""', 'description': '"""Tooling Library for IBM Watson Visual Recognition"""', 'author': '"""<NAME>"""', 'author_email': '""""""', 'packages': "['vrtool']"}), "(name='VisualRecognitionTooling', version='1.0'...
import sys import json import time import random import datetime from pytz import timezone import requests # Settings url = 'https://hooks.slack.com/services/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' exercises = { 'Plank': {'range': (20, 50), 'unit': 'second'}, 'Wall Sit': {'range': (40...
[ "pytz.timezone", "time.strftime", "json.dumps", "time.sleep", "datetime.timedelta", "random.randint", "sys.stdout.write" ]
[((1091, 1121), 'random.randint', 'random.randint', (["*data['range']"], {}), "(*data['range'])\n", (1105, 1121), False, 'import random\n'), ((1818, 1880), 'random.randint', 'random.randint', (["properties['range'][0]", "properties['range'][1]"], {}), "(properties['range'][0], properties['range'][1])\n", (1832, 1880), ...
from ..utils import log from .status import get_status_text import json class Response: def __init__(self, status=200, data={}): self.status_code = int(status) self.status_text = str(get_status_text[self.status_code]) self.status_msg = str(self.status_code) + " " + self.status_text ...
[ "json.dumps" ]
[((333, 349), 'json.dumps', 'json.dumps', (['data'], {}), '(data)\n', (343, 349), False, 'import json\n')]
""" This script is the scraping controller """ # Standard library imports from datetime import date import logging from typing import List, Dict, Sequence, Type, Tuple, Union # Third party imports import click from sqlalchemy.engine.base import Connection # Local imports from naccbis.Scraping import ( BaseScraper...
[ "click.Choice", "click.argument", "naccbis.Scraping.GameLogScraper", "click.IntRange", "click.group", "click.option", "naccbis.Common.splits.Split", "naccbis.Common.settings.Settings", "naccbis.Common.utils.season_to_year", "naccbis.Common.utils.init_logging", "datetime.date.today", "logging.i...
[((1336, 1383), 'click.group', 'click.group', ([], {'help': '__doc__', 'epilog': 'PARSER_EPILOG'}), '(help=__doc__, epilog=PARSER_EPILOG)\n', (1347, 1383), False, 'import click\n'), ((2925, 2970), 'click.argument', 'click.argument', (['"""year"""'], {'type': 'utils.parse_year'}), "('year', type=utils.parse_year)\n", (2...
from django.conf.urls import url from django.urls import path, include from rest_framework_swagger.views import get_swagger_view from rest_framework import permissions from drf_yasg.views import get_schema_view from drf_yasg import openapi from rest_framework_jwt.authentication import JSONWebTokenAuthentication from re...
[ "django.urls.include", "drf_yasg.openapi.Info" ]
[((411, 503), 'drf_yasg.openapi.Info', 'openapi.Info', ([], {'title': '"""MUCTODO API"""', 'default_version': '"""v1"""', 'description': '"""MUCTodo REST API"""'}), "(title='MUCTODO API', default_version='v1', description=\n 'MUCTodo REST API')\n", (423, 503), False, 'from drf_yasg import openapi\n'), ((907, 930), '...
#!/usr/bin/env python # coding: utf-8 """ Copy-pasted from 'Informative git prompt for zsh' with small changes Original: https://github.com/olivierverdier/zsh-git-prompt """ from __future__ import print_function from subprocess import Popen, PIPE def git_commit(): """ Get git HEAD commit hash. """ git...
[ "subprocess.Popen" ]
[((1753, 1780), 'subprocess.Popen', 'Popen', (['git_cmd'], {'stdout': 'PIPE'}), '(git_cmd, stdout=PIPE)\n', (1758, 1780), False, 'from subprocess import Popen, PIPE\n'), ((378, 405), 'subprocess.Popen', 'Popen', (['git_cmd'], {'stdout': 'PIPE'}), '(git_cmd, stdout=PIPE)\n', (383, 405), False, 'from subprocess import Po...
#!/usr/bin/env python3 from typing import List from os import environ, path from json import dump import argparse import logging import logging.config from . import CONFIG from .ldap import LDAPConnector from .process import Processor LDAP: LDAPConnector = None class EnvDefault(argparse.Action): """Argparse a...
[ "logging.getLogger", "argparse.ArgumentParser", "os.path.join", "os.path.dirname", "logging.getLevelName", "logging.config.fileConfig", "os.path.abspath", "json.dump" ]
[((992, 1017), 'os.path.abspath', 'path.abspath', (['config_file'], {}), '(config_file)\n', (1004, 1017), False, 'from os import environ, path\n'), ((1033, 1062), 'os.path.dirname', 'path.dirname', (['config_file_abs'], {}), '(config_file_abs)\n', (1045, 1062), False, 'from os import environ, path\n'), ((1340, 1365), '...
# imports from aficionado.route import Route from aficionado.defaults import not_found_handler, internal_error_handler class Router: def __init__(self): ''' Constructor ''' # create route for not found not_found = Route( path=None, handler=not_found_handler, allowed_methods=['A...
[ "aficionado.route.Route" ]
[((238, 306), 'aficionado.route.Route', 'Route', ([], {'path': 'None', 'handler': 'not_found_handler', 'allowed_methods': "['ALL']"}), "(path=None, handler=not_found_handler, allowed_methods=['ALL'])\n", (243, 306), False, 'from aficionado.route import Route\n'), ((1281, 1339), 'aficionado.route.Route', 'Route', ([], {...
import logging import torch import torch.nn as nn import torch.utils.checkpoint as cp from mmcv.cnn import constant_init, kaiming_init, normal_init from mmcv.runner import load_checkpoint from torch.nn.modules.batchnorm import _BatchNorm import torch.nn.functional as F from mmdet.models.plugins import GeneralizedAtte...
[ "logging.getLogger", "torch.nn.functional.conv2d", "torch.nn.ReLU", "mmcv.cnn.kaiming_init", "torch.nn.Sequential", "torch.nn.functional.interpolate", "mmcv.cnn.constant_init", "torch.nn.ModuleList", "torch.unsqueeze", "mmcv.runner.load_checkpoint", "torch.nn.Conv3d", "mmdet.ops.ContextBlock",...
[((10271, 10293), 'torch.nn.Sequential', 'nn.Sequential', (['*layers'], {}), '(*layers)\n', (10284, 10293), True, 'import torch.nn as nn\n'), ((1830, 1851), 'torch.nn.ReLU', 'nn.ReLU', ([], {'inplace': '(True)'}), '(inplace=True)\n', (1837, 1851), True, 'import torch.nn as nn\n'), ((6405, 6426), 'torch.nn.ReLU', 'nn.Re...
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc from yandex.cloud.mdb.clickhouse.v1 import versions_service_pb2 as yandex_dot_cloud_dot_mdb_dot_clickhouse_dot_v1_dot_versions__service__pb2 class VersionsServ...
[ "grpc.method_handlers_generic_handler", "grpc.experimental.unary_unary", "grpc.unary_unary_rpc_method_handler" ]
[((1864, 1976), 'grpc.method_handlers_generic_handler', 'grpc.method_handlers_generic_handler', (['"""yandex.cloud.mdb.clickhouse.v1.VersionsService"""', 'rpc_method_handlers'], {}), "(\n 'yandex.cloud.mdb.clickhouse.v1.VersionsService', rpc_method_handlers)\n", (1900, 1976), False, 'import grpc\n'), ((1448, 1779), ...
from .sql_io import SQLio from sql_tools.utils import refetch_filter, listify, kwgs, bin2str from .keymap import ( ADD_USER, DROP_USER, LOCK_USER, UNLOCK_USER, GRANT_POWER, REVOKE_POWER, USER_GRANTS ) try: SQ = SQLio('mysql') except: SQ = None ##@@ USERS def create_user(user, ho...
[ "sql_tools.utils.listify", "sql_tools.utils.kwgs", "sql_tools.utils.bin2str", "sql_tools.utils.refetch_filter" ]
[((1869, 1888), 'sql_tools.utils.refetch_filter', 'refetch_filter', (['[0]'], {}), '([0])\n', (1883, 1888), False, 'from sql_tools.utils import refetch_filter, listify, kwgs, bin2str\n'), ((782, 800), 'sql_tools.utils.listify', 'listify', (['filter_by'], {}), '(filter_by)\n', (789, 800), False, 'from sql_tools.utils im...
import discord from discord.ext import commands class Admin(commands.Cog): def __init__(self, bot): self.bot = bot @commands.is_owner() @commands.command() async def reload(self, ctx, extension): #try: self.bot.reload_extension(f"cogs.{extension}") await ctx...
[ "discord.ext.commands.command", "discord.ext.commands.is_owner" ]
[((141, 160), 'discord.ext.commands.is_owner', 'commands.is_owner', ([], {}), '()\n', (158, 160), False, 'from discord.ext import commands\n'), ((167, 185), 'discord.ext.commands.command', 'commands.command', ([], {}), '()\n', (183, 185), False, 'from discord.ext import commands\n'), ((465, 484), 'discord.ext.commands....
# Copyright 2010 <NAME> ('kripken'). All rights reserved. # This file is part of Syntensity/the Intensity Engine, an open source project. See COPYING.txt for licensing. """ Provides a thread-safe queue of actions. A SafeActionQueue is a queue of actions that multiple threads can add actions to. The queued actions ca...
[ "threading.Lock", "thread.start", "thread.interrupt_main", "intensity.base.side_actionqueue.add_action", "time.sleep", "thread.setDaemon", "threading.Event", "threading.Thread", "time.time" ]
[((668, 684), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (682, 684), False, 'import threading, time, thread\n'), ((714, 731), 'threading.Event', 'threading.Event', ([], {}), '()\n', (729, 731), False, 'import threading, time, thread\n'), ((1993, 2040), 'threading.Thread', 'threading.Thread', ([], {'target': ...
import ast import os import warnings def set_optimization_level(level, bits=8, recalc_interval=100, **unused): level = level.lower() if level == 'exact': pass elif level == 'swap': config.swap = True config.compress_activation = False elif level == 'actnn-l0': # D...
[ "warnings.warn", "os.environ.get" ]
[((4807, 4843), 'os.environ.get', 'os.environ.get', (['"""DEBUG_MEM"""', '"""False"""'], {}), "('DEBUG_MEM', 'False')\n", (4821, 4843), False, 'import os\n'), ((4889, 4927), 'os.environ.get', 'os.environ.get', (['"""DEBUG_SPEED"""', '"""False"""'], {}), "('DEBUG_SPEED', 'False')\n", (4903, 4927), False, 'import os\n'),...
# Generated by Django 2.0.3 on 2018-09-30 23:09 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('perftracker', '0037_auto_20181001_0118'), ] operations = [ migrations.AddField( model_name='artifactmetamodel', name...
[ "django.db.models.CharField", "django.db.models.BooleanField" ]
[((354, 429), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'default': '(False)', 'help_text': '"""Decompress on download/view"""'}), "(default=False, help_text='Decompress on download/view')\n", (373, 429), False, 'from django.db import migrations, models\n'), ((560, 655), 'django.db.models.BooleanFiel...
"""Module for adding visual media in Jupyter Notebook.""" def load_image_from_url(url): """Loads an image from the specified URL. Args: url (str): URL of the image. Returns: [type]: Image object. """ from PIL import Image import requests from io import BytesIO # ...
[ "IPython.display.display", "ipywidgets.Output", "io.BytesIO", "requests.get", "IPython.display.YouTubeVideo" ]
[((383, 400), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (395, 400), False, 'import requests\n'), ((867, 911), 'ipywidgets.Output', 'ipywidgets.Output', ([], {'layout': "{'width': '815px'}"}), "(layout={'width': '815px'})\n", (884, 911), False, 'import ipywidgets\n'), ((1022, 1034), 'IPython.display.disp...
import json from bokeh.client import push_session from bokeh.driving import repeat from bokeh.io import curdoc from bokeh.models import GeoJSONDataSource from bokeh.plotting import figure from bokeh.sampledata.sample_geojson import geojson as original updated = json.dumps({ 'type': 'FeatureCollection', 'featu...
[ "bokeh.plotting.figure", "bokeh.client.push_session", "json.dumps", "bokeh.io.curdoc", "bokeh.models.GeoJSONDataSource", "bokeh.driving.repeat" ]
[((264, 479), 'json.dumps', 'json.dumps', (["{'type': 'FeatureCollection', 'features': [{'type': 'Feature', 'geometry':\n {'type': 'Point', 'coordinates': [-2.1208465099334717, 51.4613151550293\n ]}, 'properties': {'OrganisationCode': 'Q64'}}]}"], {}), "({'type': 'FeatureCollection', 'features': [{'type': 'Featur...
import torch torch.randperm(159826, device='cpu')
[ "torch.randperm" ]
[((13, 49), 'torch.randperm', 'torch.randperm', (['(159826)'], {'device': '"""cpu"""'}), "(159826, device='cpu')\n", (27, 49), False, 'import torch\n')]
######################################################################################################################## # |||||||||||||||||||||||||||||||||||||||||||||||||| AQUITANIA ||||||||||||||||||||||||||||||||||||||||||||||||||||||| # # ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||...
[ "collections.deque" ]
[((2415, 2435), 'collections.deque', 'deque', ([], {'maxlen': 'period'}), '(maxlen=period)\n', (2420, 2435), False, 'from collections import deque\n'), ((2455, 2475), 'collections.deque', 'deque', ([], {'maxlen': 'period'}), '(maxlen=period)\n', (2460, 2475), False, 'from collections import deque\n')]
from PyQt5 import QtCore, QtGui, QtWidgets from hwentry import Ui_MainWindow7 import sqlite3 class Ui_MainWindow5(object): def hw_entry(self): self.window = QtWidgets.QMainWindow() self.ui = Ui_MainWindow7() self.ui.setupUi(self.window) self.window.show() def s...
[ "PyQt5.QtWidgets.QWidget", "PyQt5.QtWidgets.QMainWindow", "PyQt5.QtWidgets.QMenu", "PyQt5.QtGui.QFont", "hwentry.Ui_MainWindow7", "PyQt5.QtCore.QMetaObject.connectSlotsByName", "PyQt5.QtCore.QRect", "PyQt5.QtWidgets.QStatusBar", "PyQt5.QtWidgets.QLabel", "PyQt5.QtWidgets.QApplication", "PyQt5.Qt...
[((3703, 3735), 'PyQt5.QtWidgets.QApplication', 'QtWidgets.QApplication', (['sys.argv'], {}), '(sys.argv)\n', (3725, 3735), False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((3755, 3778), 'PyQt5.QtWidgets.QMainWindow', 'QtWidgets.QMainWindow', ([], {}), '()\n', (3776, 3778), False, 'from PyQt5 import QtCore, QtG...
import unittest import CheckName class Check(unittest.TestCase): def test_check_name_function(self): full_name = CheckName.get_name() self.assertEqual(full_name, '<NAME>')
[ "CheckName.get_name" ]
[((133, 153), 'CheckName.get_name', 'CheckName.get_name', ([], {}), '()\n', (151, 153), False, 'import CheckName\n')]
import os import json def translate(key, lang='fr'): ''' Traduire un mot clé dans données. ''' if not lang: # mettre une langue par defaut lang = 'fr' if not os.path.isfile("langs.json"): print("Attention, fichier langs.json n'existe pas") return key with ...
[ "os.path.isfile", "json.load" ]
[((201, 229), 'os.path.isfile', 'os.path.isfile', (['"""langs.json"""'], {}), "('langs.json')\n", (215, 229), False, 'import os\n'), ((367, 385), 'json.load', 'json.load', (['fichier'], {}), '(fichier)\n', (376, 385), False, 'import json\n')]
import requests class Authentication_service: def sendMessage( Adress, body): file = open("./Authentication.setup") FinalAdress = (file.readlines[0] + Adress) sended = requests.get(FinalAdress, data=body) return sended
[ "requests.get" ]
[((197, 233), 'requests.get', 'requests.get', (['FinalAdress'], {'data': 'body'}), '(FinalAdress, data=body)\n', (209, 233), False, 'import requests\n')]
import os from nltk.parse.corenlp import CoreNLPServer # The server needs to know the location of the following files: # - stanford-corenlp-X.X.X.jar # - stanford-corenlp-X.X.X-models.jar STANFORD = os.path.join("models", "stanford-corenlp-4.2.0") # Create the server server = CoreNLPServer( os.path.join(STANFO...
[ "os.path.join" ]
[((204, 252), 'os.path.join', 'os.path.join', (['"""models"""', '"""stanford-corenlp-4.2.0"""'], {}), "('models', 'stanford-corenlp-4.2.0')\n", (216, 252), False, 'import os\n'), ((301, 353), 'os.path.join', 'os.path.join', (['STANFORD', '"""stanford-corenlp-4.2.0.jar"""'], {}), "(STANFORD, 'stanford-corenlp-4.2.0.jar'...
import numpy as np class DataLoader(object): def __init__(self, fpath1, fpath2, maxlen1, maxlen2, vocab_fpath): self.sents1, self.sents2 = self.load_data(fpath1, fpath2, maxlen1, maxlen2) self.token2idx, self.idx2token = self.load_vocab(vocab_fpath) self.maxlen1 = maxlen1 self.maxle...
[ "random.shuffle", "copy.deepcopy" ]
[((2367, 2393), 'copy.deepcopy', 'copy.deepcopy', (['self.sents1'], {}), '(self.sents1)\n', (2380, 2393), False, 'import copy\n'), ((2415, 2441), 'copy.deepcopy', 'copy.deepcopy', (['self.sents2'], {}), '(self.sents2)\n', (2428, 2441), False, 'import copy\n'), ((2500, 2526), 'random.shuffle', 'random.shuffle', (['new_s...
import os import sys from mininet.node import RemoteController from mininet.net import Mininet import dc_gym.utils as dc_utils import logging log = logging.getLogger(__name__) cwd = os.getcwd() FILE_DIR = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, FILE_DIR) def get_congestion_control(): prev_...
[ "logging.getLogger", "dc_gym.utils.exec_process", "sys.path.insert", "os.getcwd", "os.popen", "os.path.abspath", "mininet.net.Mininet", "mininet.node.RemoteController" ]
[((149, 176), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (166, 176), False, 'import logging\n'), ((184, 195), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (193, 195), False, 'import os\n'), ((250, 278), 'sys.path.insert', 'sys.path.insert', (['(0)', 'FILE_DIR'], {}), '(0, FILE_DIR)\n',...
from django.shortcuts import render from django.http import HttpResponse from django.http import Http404 from django.views.decorators.csrf import csrf_exempt from .models import Player from django.core.paginator import Paginator @csrf_exempt def basic_view(request): if request.method == 'POST': p...
[ "django.shortcuts.render" ]
[((2983, 3023), 'django.shortcuts.render', 'render', (['request', '"""players.html"""', 'context'], {}), "(request, 'players.html', context)\n", (2989, 3023), False, 'from django.shortcuts import render\n'), ((3051, 3082), 'django.shortcuts.render', 'render', (['request', '"""players.html"""'], {}), "(request, 'players...
# -*- coding: utf-8 -*- import logging import os import time import click import requests from unsync import unsync @unsync def setup_repos(git_url: str): """ Run git clone command for repo """ try: os.system(f"git clone {git_url}") return 1 # os.system("git fetch") except Exc...
[ "click.option", "logging.warning", "logging.info", "requests.get", "os.system", "click.command", "time.time" ]
[((380, 395), 'click.command', 'click.command', ([], {}), '()\n', (393, 395), False, 'import click\n'), ((397, 486), 'click.option', 'click.option', (['"""--github_profile"""'], {'prompt': '"""github profile name"""', 'help': '"""e.g. devsetgo"""'}), "('--github_profile', prompt='github profile name', help=\n 'e.g. ...
import requests #type: ignore class WittyFlowSms: def __init__(self, app_id, app_secret): self.app_id = app_id self.app_secret = app_secret def app_id(self): return self.app_id def app_secret(self): return self.app_secret def send_sms(self, phone, to, message, is...
[ "requests.post", "requests.get" ]
[((674, 752), 'requests.post', 'requests.post', (['"""https://api.wittyflow.com/v1/messages/send"""'], {'data': 'body_to_send'}), "('https://api.wittyflow.com/v1/messages/send', data=body_to_send)\n", (687, 752), False, 'import requests\n'), ((839, 960), 'requests.get', 'requests.get', (['f"""https://api.wittyflow.com/...
from __future__ import print_function from __future__ import absolute_import from __future__ import division import better.marketdata.globaldatamatrix as gdm import numpy as np import pandas as pd import logging from better.tools.configprocess import parse_time from better.tools.data import get_volume_forward, get_type...
[ "better.tools.data.get_volume_forward", "better.tools.data.get_type_list", "numpy.arange", "numpy.array", "numpy.split", "better.marketdata.replaybuffer.ReplayBuffer", "pandas.DataFrame", "better.marketdata.globaldatamatrix.HistoryManager", "logging.info", "better.tools.configprocess.parse_time" ]
[((1773, 1802), 'better.tools.data.get_type_list', 'get_type_list', (['feature_number'], {}), '(feature_number)\n', (1786, 1802), False, 'from better.tools.data import get_volume_forward, get_type_list\n'), ((1909, 1979), 'better.tools.data.get_volume_forward', 'get_volume_forward', (['(self.__end - start)', 'test_port...
# How to Do Linear Regression using Gradient Descent - Live session from 3/29/17 # https://www.youtube.com/watch?v=XdM6ER7zTLk # https://github.com/llSourcell/linear_regression_live # My modification, that uses Numpy to the full extent, which can be faster. import numpy as np def computeErrorForGivenPoints(m...
[ "numpy.genfromtxt", "numpy.square" ]
[((391, 417), 'numpy.square', 'np.square', (['(y - (m * x + b))'], {}), '(y - (m * x + b))\n', (400, 417), True, 'import numpy as np\n'), ((1139, 1179), 'numpy.genfromtxt', 'np.genfromtxt', (['"""data.csv"""'], {'delimiter': '""","""'}), "('data.csv', delimiter=',')\n", (1152, 1179), True, 'import numpy as np\n')]
import yaml def read_config(filename): with open(filename) as f: return yaml.load(f, yaml.Loader)
[ "yaml.load" ]
[((86, 111), 'yaml.load', 'yaml.load', (['f', 'yaml.Loader'], {}), '(f, yaml.Loader)\n', (95, 111), False, 'import yaml\n')]
import copy import pytest from icupy import U_ICU_VERSION_MAJOR_NUM if U_ICU_VERSION_MAJOR_NUM < 50: pytest.skip("ICU4C<50", allow_module_level=True) from icupy import ( Locale, StringEnumeration, TimeZoneNames, UTimeZoneNameType, UnicodeString, ) def test_api(): # static TimeZoneNames *icu::TimeZo...
[ "icupy.Locale", "copy.deepcopy", "icupy.UnicodeString", "icupy.TimeZoneNames.create_instance", "copy.copy", "icupy.TimeZoneNames.create_tzdb_instance", "pytest.mark.skipif", "pytest.skip" ]
[((6136, 6203), 'pytest.mark.skipif', 'pytest.mark.skipif', (['(U_ICU_VERSION_MAJOR_NUM < 54)'], {'reason': '"""ICU4C<54"""'}), "(U_ICU_VERSION_MAJOR_NUM < 54, reason='ICU4C<54')\n", (6154, 6203), False, 'import pytest\n'), ((107, 155), 'pytest.skip', 'pytest.skip', (['"""ICU4C<50"""'], {'allow_module_level': '(True)'}...
from __future__ import unicode_literals from future.builtins import int from collections import defaultdict from django.core.urlresolvers import reverse from django.template.defaultfilters import linebreaksbr, urlize from mezzanine import template from mezzanine.conf import settings from mezzanine.generic.forms impo...
[ "mezzanine.pages.models.RichTextPage.objects.all", "mezzanine.template.Library" ]
[((519, 537), 'mezzanine.template.Library', 'template.Library', ([], {}), '()\n', (535, 537), False, 'from mezzanine import template\n'), ((853, 879), 'mezzanine.pages.models.RichTextPage.objects.all', 'RichTextPage.objects.all', ([], {}), '()\n', (877, 879), False, 'from mezzanine.pages.models import Page, RichTextPag...
from __future__ import unicode_literals from SourceFile import SourceFile class ProjectSizeCheckerBlock: def __init__(self, cursor, minClasses, nextBlock): self.cursor = cursor self.minClasses = minClasses self.nextBlock = nextBlock def process(self, project): sql = "...
[ "SourceFile.SourceFile" ]
[((593, 629), 'SourceFile.SourceFile', 'SourceFile', (["file['id']", "file['name']"], {}), "(file['id'], file['name'])\n", (603, 629), False, 'from SourceFile import SourceFile\n')]
import unittest from descriptastorus import MolFileIndex import os, shutil import logging import datahook TEST_DIR = "test1" class TestCase(unittest.TestCase): def setUp(self): if os.path.exists(TEST_DIR): shutil.rmtree(TEST_DIR, ignore_errors=True) index = self.index = MolFileIndex.M...
[ "logging.getLogger", "os.path.exists", "os.path.join", "shutil.rmtree", "unittest.main", "logging.info" ]
[((999, 1014), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1012, 1014), False, 'import unittest\n'), ((195, 219), 'os.path.exists', 'os.path.exists', (['TEST_DIR'], {}), '(TEST_DIR)\n', (209, 219), False, 'import os, shutil\n'), ((525, 549), 'os.path.exists', 'os.path.exists', (['TEST_DIR'], {}), '(TEST_DIR)\n...
from django.shortcuts import render from .forms import YouTubeLinks import pytube,sys from pytube import YouTube # Create your views here. def indexView(request): video_url = "" video_title = "" form = YouTubeLinks() if request.method == "POST": form = YouTubeLinks(request.POST) if form....
[ "django.shortcuts.render", "pytube.YouTube" ]
[((483, 501), 'pytube.YouTube', 'YouTube', (['video_url'], {}), '(video_url)\n', (490, 501), False, 'from pytube import YouTube\n'), ((936, 974), 'django.shortcuts.render', 'render', (['request', '"""index.html"""', 'context'], {}), "(request, 'index.html', context)\n", (942, 974), False, 'from django.shortcuts import ...
# -*- coding: utf-8 -*- """ Created on Fri Jan 24 14:38:33 2020 @author: Administrator """ """ 数字1-1000放在一个含有1001个元素的数组中,其中只有唯一的一个元素值重复,其他数字均只出现过一次. 设计一个算法,将重复元素找出来,要求每个元素只能访问一次.如果不使用辅助存储空间,能否设计一个算法实现. """ import copy def Method1(array): if array == None: return -1 length = len(array)...
[ "copy.deepcopy" ]
[((1283, 1303), 'copy.deepcopy', 'copy.deepcopy', (['array'], {}), '(array)\n', (1296, 1303), False, 'import copy\n')]
import numpy as np from pyNN.random import NumpyRNG from sklearn.linear_model import LinearRegression import math def gaussian_convolution(spikes,dt): #---- takes a spiketrain and the simulation time constant # and computes the smoothed spike rate #-----works only after the simulation has run; not onli...
[ "numpy.identity", "numpy.mean", "pyNN.random.NumpyRNG", "numpy.convolve", "math.ceil", "math.floor", "numpy.size", "numpy.sum", "sklearn.linear_model.LinearRegression" ]
[((558, 577), 'numpy.mean', 'np.mean', (['gauss_rate'], {}), '(gauss_rate)\n', (565, 577), True, 'import numpy as np\n'), ((1862, 1880), 'sklearn.linear_model.LinearRegression', 'LinearRegression', ([], {}), '()\n', (1878, 1880), False, 'from sklearn.linear_model import LinearRegression\n'), ((1975, 1993), 'sklearn.lin...
# -*- coding: utf-8 -*- """Flask app models.""" import os.path import datetime from flask import url_for from flask_login import UserMixin from sqlalchemy.sql.expression import and_ from werkzeug.security import generate_password_hash, check_password_hash import hashlib import qrcode from app import db, login, whooshee...
[ "datetime.datetime", "qrcode.QRCode", "hashlib.md5", "datetime.datetime.utcnow", "app.db.String", "flask.url_for", "datetime.timedelta", "werkzeug.security.generate_password_hash", "app.db.Column", "datetime.datetime.today", "app.whooshee.register_model", "app.db.ForeignKey", "app.db.relatio...
[((324, 398), 'app.whooshee.register_model', 'whooshee.register_model', (['"""username"""', '"""first_name"""', '"""last_name"""', '"""nickname"""'], {}), "('username', 'first_name', 'last_name', 'nickname')\n", (347, 398), False, 'from app import db, login, whooshee\n'), ((464, 503), 'app.db.Column', 'db.Column', (['d...
# """ Base class for encoders. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from texar.module_base import ModuleBase __all__ = [ "EncoderBase" ] class EncoderBase(ModuleBase): """Base class inherited by all encoder classes. """ def...
[ "texar.module_base.ModuleBase.__init__" ]
[((359, 393), 'texar.module_base.ModuleBase.__init__', 'ModuleBase.__init__', (['self', 'hparams'], {}), '(self, hparams)\n', (378, 393), False, 'from texar.module_base import ModuleBase\n')]
""" NOTICE: A Custom Dataset SHOULD BE PROVIDED Created: May 02,2019 - <NAME> Revised: May 07,2019 - <NAME> """ import os import numpy as np from PIL import Image import torchvision.transforms as transforms import inception_preprocessing from torch.utils.data import Dataset __all__ = ['CustomDataset'] config = { ...
[ "torchvision.transforms.CenterCrop", "os.listdir", "os.path.join", "torchvision.transforms.RandomHorizontalFlip", "torchvision.transforms.RandomCrop", "torchvision.transforms.ColorJitter", "torchvision.transforms.ToTensor" ]
[((1405, 1444), 'os.path.join', 'os.path.join', (["config['datapath']", 'phase'], {}), "(config['datapath'], phase)\n", (1417, 1444), False, 'import os\n'), ((1470, 1496), 'os.listdir', 'os.listdir', (['self.data_path'], {}), '(self.data_path)\n', (1480, 1496), False, 'import os\n'), ((1755, 1808), 'torchvision.transfo...
import os import sys import argparse import time parser = argparse.ArgumentParser() parser.add_argument('-gpu', default='0', type=str) args = parser.parse_args() os.environ["CUDA_VISIBLE_DEVICES"]=args.gpu import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.optim ...
[ "torch.optim.lr_scheduler.ReduceLROnPlateau", "pkbar.Pbar", "argparse.ArgumentParser", "transforms.spatial_transforms.Normalize", "torch.load", "os.path.join", "torch.nn.DataParallel", "torch.autograd.set_grad_enabled", "apmeter.APMeter", "charades_fine.Charades", "torch.sum", "torch.utils.dat...
[((59, 84), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (82, 84), False, 'import argparse\n'), ((974, 1007), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (997, 1007), False, 'import warnings\n'), ((2699, 2841), 'charades_fine.Charades', 'Chara...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'MainWindow.ui' # # Created by: PyQt5 UI code generator 5.11.3 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_MainWindow(object): def setupUi(self, MainWindow): MainW...
[ "PyQt5.QtWidgets.QWidget", "PyQt5.QtWidgets.QMenu", "PyQt5.QtGui.QFont", "PyQt5.QtWidgets.QComboBox", "PyQt5.QtCore.QMetaObject.connectSlotsByName", "PyQt5.QtCore.QRect", "PyQt5.QtWidgets.QStatusBar", "PyQt5.QtWidgets.QLabel", "PyQt5.QtWidgets.QPushButton", "PyQt5.QtCore.QSize", "PyQt5.QtWidgets...
[((521, 534), 'PyQt5.QtGui.QFont', 'QtGui.QFont', ([], {}), '()\n', (532, 534), False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((904, 933), 'PyQt5.QtWidgets.QWidget', 'QtWidgets.QWidget', (['MainWindow'], {}), '(MainWindow)\n', (921, 933), False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((1016, 1055), ...
""" This file contains code to measure the performance of the system (c) 2015 Massachusetts Institute of Technology """ # Native import logging LOGGER = logging.getLogger(__name__) import time import re # CATAN import catan.db import catan.globals as G def log_database_counts(node_dict): """ ...
[ "logging.getLogger", "re.findall", "time.time" ]
[((168, 195), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (185, 195), False, 'import logging\n'), ((2068, 2096), 're.findall', 're.findall', (['"""<<(.*)>>"""', 'text'], {}), "('<<(.*)>>', text)\n", (2078, 2096), False, 'import re\n'), ((2183, 2194), 'time.time', 'time.time', ([], {}),...
from django.views.generic import TemplateView from dejaviewer.models import Programme, Course, CourseTeacher class CourseView(TemplateView): template_name = 'course.html' def get_context_data(self, **kwargs): ctx = super().get_context_data(**kwargs) user = self.request.user programm...
[ "dejaviewer.models.Programme.objects.get", "dejaviewer.models.CourseTeacher.objects.filter", "dejaviewer.models.Programme.objects.all", "dejaviewer.models.Course.objects.get", "dejaviewer.models.CourseTeacher.objects.get" ]
[((325, 348), 'dejaviewer.models.Programme.objects.all', 'Programme.objects.all', ([], {}), '()\n', (346, 348), False, 'from dejaviewer.models import Programme, Course, CourseTeacher\n'), ((515, 554), 'dejaviewer.models.Course.objects.get', 'Course.objects.get', ([], {'pk': "kwargs['course']"}), "(pk=kwargs['course'])\...
import os from py.path import local import pypy from pypy.tool.udir import udir from pypy.translator.c.test.test_genc import compile from pypy.rpython import extregistry import errno import sys import py def getllimpl(fn): return extregistry.lookup(fn).lltypeimpl def test_access(): filename = str(udir.join(...
[ "py.test.raises", "os.getenv", "os.times", "os.access", "os.ttyname", "py.path.local", "os.getcwd", "pypy.tool.udir.udir.join", "pypy.rpython.extregistry.lookup", "pypy.rpython.test.test_llinterp.interpret", "os.WEXITSTATUS", "os.WIFEXITED", "os.unlink", "os.popen", "os.system", "os.st...
[((1132, 1162), 'os.getenv', 'os.getenv', (['"""SystemDrive"""', '"""C:"""'], {}), "('SystemDrive', 'C:')\n", (1141, 1162), False, 'import os\n'), ((1812, 1831), 'os.unlink', 'os.unlink', (['filename'], {}), '(filename)\n', (1821, 1831), False, 'import os\n'), ((2218, 2249), 'os.system', 'os.system', (["(base + 'execve...
import numpy as np from PIL import Image from scipy.ndimage import gaussian_filter, sobel from scipy.ndimage.filters import laplace def calc_gradients_test(test_dir): for i in range(24): calc_gradients(test_dir + '/test{}'.format(i)) def calc_gradients(dir): g_noisy_dir = dir + '/g_noisy.png' p_no...
[ "PIL.Image.fromarray", "PIL.Image.open", "numpy.asarray", "scipy.ndimage.gaussian_filter" ]
[((365, 388), 'PIL.Image.open', 'Image.open', (['g_noisy_dir'], {}), '(g_noisy_dir)\n', (375, 388), False, 'from PIL import Image\n'), ((403, 422), 'numpy.asarray', 'np.asarray', (['g_noisy'], {}), '(g_noisy)\n', (413, 422), True, 'import numpy as np\n'), ((437, 460), 'PIL.Image.open', 'Image.open', (['p_noisy_dir'], {...
# -*- coding: utf-8 -*- """ Created on Sun Apr 21 13:52:07 2019 @author: Administrator train.py: 训练模型 """ from Unet import Unet import LoadBatches1D import tensorflow as tf import keras from keras import optimizers import warnings import matplotlib.pyplot as plt gpu_options = tf.GPUOptions(allow_growth=True) sess ...
[ "keras.callbacks.LearningRateScheduler", "matplotlib.pyplot.grid", "tensorflow.ConfigProto", "keras.callbacks.ModelCheckpoint", "matplotlib.pyplot.ylabel", "Unet.Unet", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "LoadBatches1D.SigSegmentationGenerator", "matplotlib.pyplot.figure", "ma...
[((282, 314), 'tensorflow.GPUOptions', 'tf.GPUOptions', ([], {'allow_growth': '(True)'}), '(allow_growth=True)\n', (295, 314), True, 'import tensorflow as tf\n'), ((381, 414), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (404, 414), False, 'import warnings\n'), ((829, 87...
# coding=utf-8 # # Copyright (c) 2013-2015 First Flamingo Enterprise B.V. # # 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...
[ "TASeries.TASeries.get", "webapp2.WSGIApplication", "logging.info", "google.appengine.ext.db.put" ]
[((2949, 3020), 'webapp2.WSGIApplication', 'webapp2.WSGIApplication', (["[('/forms/series', SeriesHandler)]"], {'debug': '(True)'}), "([('/forms/series', SeriesHandler)], debug=True)\n", (2972, 3020), False, 'import webapp2, logging\n'), ((1034, 1105), 'logging.info', 'logging.info', (["('Handle form for series %s (%s)...
import requests from flask import Blueprint, render_template, abort, session, current_app bp = Blueprint("item", __name__) @bp.route("/item/<int:item_id>", methods=("GET", "POST")) def index(item_id): res = requests.get( url="http://api:8000/recommend/item/{0}".format(item_id), params={ ...
[ "flask.render_template", "flask.abort", "flask.Blueprint", "flask.session.get" ]
[((96, 123), 'flask.Blueprint', 'Blueprint', (['"""item"""', '__name__'], {}), "('item', __name__)\n", (105, 123), False, 'from flask import Blueprint, render_template, abort, session, current_app\n'), ((774, 871), 'flask.render_template', 'render_template', (['"""item/index.html"""'], {'active_item': 'active_item', 'r...
# -*- coding: utf-8 -*- """Adapting the general reegis power plants to the de21 model. SPDX-FileCopyrightText: 2016-2019 <NAME> <<EMAIL>> SPDX-License-Identifier: MIT """ __copyright__ = "<NAME> <<EMAIL>>" __license__ = "MIT" import pandas as pd import os import logging import datetime from xml.etree import Eleme...
[ "datetime.datetime", "xml.etree.ElementTree.parse", "pandas.read_csv", "logging.warning", "oemof.tools.logger.define_logging", "os.path.isfile", "pandas.concat", "pandas.DateOffset", "pandas.DataFrame", "logging.info", "reegis.config.get", "pandas.to_datetime" ]
[((455, 515), 'logging.info', 'logging.info', (['"""Fill the gaps and resample to hourly values."""'], {}), "('Fill the gaps and resample to hourly values.')\n", (467, 515), False, 'import logging\n'), ((918, 945), 'xml.etree.ElementTree.parse', 'ElementTree.parse', (['filename'], {}), '(filename)\n', (935, 945), False...
''' Created on Dec 5, 2016 @author: wjadams ''' import numpy as np class AhpNode(object): def __init__(self, parent_tree, name, nalts, pw=None): self.children = [] self.name = name self.alt_scores = np.zeros([nalts]) self.nalts = nalts self.parent_tree = parent_tree ...
[ "numpy.append", "numpy.array", "numpy.zeros", "numpy.max" ]
[((234, 251), 'numpy.zeros', 'np.zeros', (['[nalts]'], {}), '([nalts])\n', (242, 251), True, 'import numpy as np\n'), ((702, 731), 'numpy.append', 'np.append', (['self.alt_scores', '(0)'], {}), '(self.alt_scores, 0)\n', (711, 731), True, 'import numpy as np\n'), ((1010, 1030), 'numpy.array', 'np.array', (['new_scores']...
import unittest import yaml from jnpr.jsnapy.check import Comparator from mock import patch import os from nose.plugins.attrib import attr @attr('unit') class TestStringOperators(unittest.TestCase): def setUp(self): self.diff = False self.hostname = "10.216.193.114" self.db = dict() ...
[ "mock.patch", "jnpr.jsnapy.check.Comparator", "nose.plugins.attrib.attr", "yaml.load", "os.path.dirname", "unittest.TextTestRunner", "unittest.TestLoader" ]
[((141, 153), 'nose.plugins.attrib.attr', 'attr', (['"""unit"""'], {}), "('unit')\n", (145, 153), False, 'from nose.plugins.attrib import attr\n'), ((470, 505), 'mock.patch', 'patch', (['"""jnpr.jsnapy.check.get_path"""'], {}), "('jnpr.jsnapy.check.get_path')\n", (475, 505), False, 'from mock import patch\n'), ((1205, ...
# Import the library from czml import czml # Initialize a document doc = czml.CZML() # Create and append the document packet packet1 = czml.CZMLPacket(id='document', name="czml", version='1.0') doc.packets.append(packet1) # Create and append a billboard packet packet2 = czml.CZMLPacket(id='rect', name="visibility") ...
[ "czml.czml.Billboard", "czml.czml.CZMLPacket", "czml.czml.CZML" ]
[((74, 85), 'czml.czml.CZML', 'czml.CZML', ([], {}), '()\n', (83, 85), False, 'from czml import czml\n'), ((137, 195), 'czml.czml.CZMLPacket', 'czml.CZMLPacket', ([], {'id': '"""document"""', 'name': '"""czml"""', 'version': '"""1.0"""'}), "(id='document', name='czml', version='1.0')\n", (152, 195), False, 'from czml i...
import time import math import random def gcd_naive(a, b): mx = max(a, b) gcd = 1 for i in range(2, mx): if a % i == 0 and b % i == 0: gcd = i return gcd def gcd_naive_2(a, b): gcd = 1 for i in range(2, max(a, b) // 2): if a % i == 0 and a % b == 0: g...
[ "time.time", "random.randint" ]
[((788, 812), 'random.randint', 'random.randint', (['(1)', '(10000)'], {}), '(1, 10000)\n', (802, 812), False, 'import random\n'), ((825, 849), 'random.randint', 'random.randint', (['(1)', '(10000)'], {}), '(1, 10000)\n', (839, 849), False, 'import random\n'), ((871, 882), 'time.time', 'time.time', ([], {}), '()\n', (8...
#!/usr/bin/env python """ Bevington & Robinson's model of dual exponential decay References:: [5] Bevington & Robinson (1992). Data Reduction and Error Analysis for the Physical Sciences, Second Edition, McGraw-Hill, Inc., New York. """ from numpy import exp, sqrt, vstack, array, asarray def dual_expone...
[ "numpy.exp", "numpy.array", "numpy.sqrt", "numpy.asarray" ]
[((557, 1255), 'numpy.array', 'array', (['[[15, 775], [30, 479], [45, 380], [60, 302], [75, 185], [90, 157], [105, \n 137], [120, 119], [135, 110], [150, 89], [165, 74], [180, 61], [195, 66\n ], [210, 68], [225, 48], [240, 54], [255, 51], [270, 46], [285, 55], [\n 300, 29], [315, 28], [330, 37], [345, 49], [36...
from flask import abort, jsonify, render_template, request from app import app from models.names import Names import random import os @app.route('/names/<total>', methods=['GET']) def homepage(total=10): count = int(total) names = dict() tiefling = True human = True elf = True if tiefling: ...
[ "random.sample", "app.app.route" ]
[((138, 182), 'app.app.route', 'app.route', (['"""/names/<total>"""'], {'methods': "['GET']"}), "('/names/<total>', methods=['GET'])\n", (147, 182), False, 'from app import app\n'), ((1214, 1259), 'random.sample', 'random.sample', (['names[tiefling]', 'race_count[0]'], {}), '(names[tiefling], race_count[0])\n', (1227, ...
import cv2 import numpy as np import face_recognition import os from datetime import datetime path = 'ImageAttendance' images = [] classNames = [] myList = os.listdir(path) print(myList) for cl in myList: curImg = cv2.imread(f'{path}/{cl}') images.append(curImg) classNames.append(os.path.splitext(cl)[0]) ...
[ "cv2.rectangle", "face_recognition.face_locations", "os.listdir", "os.path.splitext", "cv2.imshow", "cv2.putText", "datetime.datetime.now", "face_recognition.face_distance", "cv2.waitKey", "cv2.VideoCapture", "cv2.cvtColor", "face_recognition.face_encodings", "face_recognition.compare_faces"...
[((157, 173), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n', (167, 173), False, 'import os\n'), ((1066, 1085), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (1082, 1085), False, 'import cv2\n'), ((220, 246), 'cv2.imread', 'cv2.imread', (['f"""{path}/{cl}"""'], {}), "(f'{path}/{cl}')\n", (230,...
import os import random import shutil # We need to change the dataset so that it is split into train/validation/test # portions, and labelled with a single attribute (e.g. 'color'). attributes = ('color', 'number', 'shape', 'shading', 'all') attribute_label_extraction_fns = { 'number': lambda dir: dir.split('-')...
[ "os.path.exists", "os.listdir", "random.shuffle", "os.makedirs", "os.path.join", "os.walk" ]
[((932, 952), 'os.walk', 'os.walk', (['dataset_dir'], {}), '(dataset_dir)\n', (939, 952), False, 'import os\n'), ((1022, 1055), 'os.path.join', 'os.path.join', (['target_dir', '"""train"""'], {}), "(target_dir, 'train')\n", (1034, 1055), False, 'import os\n'), ((1084, 1122), 'os.path.join', 'os.path.join', (['target_di...
#!/usr/bin/env python # encoding: utf-8 # <NAME>, 2006-2008 (ita) """ Native compilation using gcj highly experimental, and gcj sucks anyway """ import os, re from waflib.Configure import conf from waflib import TaskGen, Task, Utils, Node from waflib.TaskGen import feature, before, after from waflib.Tools import ccr...
[ "waflib.TaskGen.after", "waflib.TaskGen.feature", "os.pathsep.join", "waflib.TaskGen.before", "waflib.Utils.to_list", "waflib.Configure.conf.find_program" ]
[((1120, 1134), 'waflib.TaskGen.feature', 'feature', (['"""gcj"""'], {}), "('gcj')\n", (1127, 1134), False, 'from waflib.TaskGen import feature, before, after\n'), ((1136, 1179), 'waflib.TaskGen.after', 'after', (['"""propagate_uselib_vars"""', '"""apply_gcj"""'], {}), "('propagate_uselib_vars', 'apply_gcj')\n", (1141,...
import tensorflow as tf import os #LABEL_PATH = "/home/neo/projects/deepLearning/data/labelTest/" #IMAGE_PATH = "/home/neo/projects/deepLearning/data/imageTest/" LABEL_PATH = "/home/neo/projects/deepLearning/data/label/" IMAGE_PATH = "/home/neo/projects/deepLearning/data/image/" LABEL_SUFIX = "_emotion" LABEL_FORMAT =...
[ "tensorflow.cast", "tensorflow.train.shuffle_batch", "os.walk", "tensorflow.train.Coordinator", "tensorflow.Session", "tensorflow.random_crop", "tensorflow.app.flags.DEFINE_boolean", "tensorflow.initialize_all_variables", "tensorflow.app.flags.DEFINE_integer", "tensorflow.train.start_queue_runners...
[((793, 885), 'tensorflow.app.flags.DEFINE_integer', 'tf.app.flags.DEFINE_integer', (['"""batch_size"""', '(48)', '"""Number of images to process in a batch."""'], {}), "('batch_size', 48,\n 'Number of images to process in a batch.')\n", (820, 885), True, 'import tensorflow as tf\n'), ((886, 984), 'tensorflow.app.fl...
""" This module contains the transformer class, that turns a given parse tree into a dice pool. """ from operator import add, sub, mul, truediv from lark.visitors import Transformer, v_args from .pools import BinaryOperatorPool, DiceTypePool, DiceDropPool, ConstPool def keep_sum(rolls, keep, lowest=False): "A sm...
[ "lark.visitors.v_args" ]
[((447, 466), 'lark.visitors.v_args', 'v_args', ([], {'inline': '(True)'}), '(inline=True)\n', (453, 466), False, 'from lark.visitors import Transformer, v_args\n')]
import matplotlib.pyplot as plt import numpy as np import os from federatedscope.core.message import Message import logging logger = logging.getLogger(__name__) def plot_target_loss(loss_list, outdir): ''' Args: loss_list: the list of loss regrading the target data outdir: the directory to s...
[ "logging.getLogger", "matplotlib.pyplot.plot", "os.path.join", "matplotlib.pyplot.close", "numpy.vstack" ]
[((134, 161), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (151, 161), False, 'import logging\n'), ((367, 387), 'numpy.vstack', 'np.vstack', (['loss_list'], {}), '(loss_list)\n', (376, 387), True, 'import numpy as np\n'), ((432, 458), 'matplotlib.pyplot.plot', 'plt.plot', (['target_data...
# #!/usr/bin python # Copyright (c) 2021. <NAME> # # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
[ "rich.console.Console", "dg_config.settingsfile.get_settings" ]
[((743, 752), 'rich.console.Console', 'Console', ([], {}), '()\n', (750, 752), False, 'from rich.console import Console\n'), ((764, 791), 'dg_config.settingsfile.get_settings', 'settingsfile.get_settings', ([], {}), '()\n', (789, 791), False, 'from dg_config import settingsfile\n')]
#!/usr/bin/env python # -*- coding: utf-8 -*- import os from slackpy import SlackLogger, LogLv, LOG_LEVELS from argparse import ArgumentParser __author__ = '<NAME>' def main(): parser = ArgumentParser(description='slackpy command line tool') parser.add_argument('-m', '--message', ...
[ "slackpy.SlackLogger", "slackpy.LOG_LEVELS.append", "argparse.ArgumentParser" ]
[((194, 249), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'description': '"""slackpy command line tool"""'}), "(description='slackpy command line tool')\n", (208, 249), False, 'from argparse import ArgumentParser\n'), ((1749, 1799), 'slackpy.SlackLogger', 'SlackLogger', (['web_hook_url', 'args.channel', 'args.na...
#!/usr/bin/python3 import sys import random value=random.randint(0, 3) print("Returning: " + str(value)) sys.exit(value)
[ "random.randint", "sys.exit" ]
[((52, 72), 'random.randint', 'random.randint', (['(0)', '(3)'], {}), '(0, 3)\n', (66, 72), False, 'import random\n'), ((107, 122), 'sys.exit', 'sys.exit', (['value'], {}), '(value)\n', (115, 122), False, 'import sys\n')]
import requests, time import math from selenium import webdriver from selenium.webdriver.chrome.options import Options from music_db import * from concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutor # 创建请求头和requests会话对象session headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleW...
[ "selenium.webdriver.chrome.options.Options", "requests.session", "concurrent.futures.ThreadPoolExecutor", "selenium.webdriver.Chrome", "time.sleep", "requests.get", "concurrent.futures.ProcessPoolExecutor" ]
[((412, 430), 'requests.session', 'requests.session', ([], {}), '()\n', (428, 430), False, 'import requests, time\n'), ((1739, 1748), 'selenium.webdriver.chrome.options.Options', 'Options', ([], {}), '()\n', (1746, 1748), False, 'from selenium.webdriver.chrome.options import Options\n'), ((1902, 1971), 'selenium.webdri...
# Copyright 2017 AT&T Intellectual Property. All other 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...
[ "logging.getLogger", "drydock_provisioner.error.ClientError", "drydock_provisioner.error.ClientUnauthorizedError", "drydock_provisioner.error.ClientForbiddenError" ]
[((978, 1005), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (995, 1005), False, 'import logging\n'), ((5756, 5853), 'drydock_provisioner.error.ClientUnauthorizedError', 'errors.ClientUnauthorizedError', (["('Unauthorized access to %s, include valid token.' % resp.url)"], {}), "(\n 'U...
import remote.libraries.LCD_1in44 as LCD_1in44 import remote.libraries.LCD_Config as LCD_Config from PIL import Image, ImageDraw, ImageFont, ImageColor class Display: def __init__(self, remote_id): self.LCD = LCD_1in44.LCD() Lcd_ScanDir = LCD_1in44.SCAN_DIR_DFT # SCAN_DIR_DFT = D2U_L2R s...
[ "PIL.Image.new", "PIL.ImageDraw.Draw", "remote.libraries.LCD_1in44.LCD", "PIL.ImageFont.truetype" ]
[((224, 239), 'remote.libraries.LCD_1in44.LCD', 'LCD_1in44.LCD', ([], {}), '()\n', (237, 239), True, 'import remote.libraries.LCD_1in44 as LCD_1in44\n'), ((451, 484), 'PIL.ImageFont.truetype', 'ImageFont.truetype', (['font_path', '(20)'], {}), '(font_path, 20)\n', (469, 484), False, 'from PIL import Image, ImageDraw, I...
import numpy as np import os, sys, re import mpi4py import time from mpi4py import MPI # Paths MACHINE_NAME = 'tmp' TUNER_NAME = 'tmp' ROOTDIR = os.path.abspath(os.path.join(os.path.realpath(__file__), os.pardir, os.pardir)) EXPDIR = os.path.abspath(os.path.join(ROOTDIR, "hypre-driver/exp", MACHINE_NAME + '/' + TUNER_...
[ "numpy.mean", "os.makedirs", "os.path.join", "time.sleep", "mpi4py.MPI.Info.Create", "os.path.realpath", "numpy.array", "mpi4py.MPI.COMM_SELF.Spawn", "os.getpid", "os.system", "re.findall" ]
[((251, 325), 'os.path.join', 'os.path.join', (['ROOTDIR', '"""hypre-driver/exp"""', "(MACHINE_NAME + '/' + TUNER_NAME)"], {}), "(ROOTDIR, 'hypre-driver/exp', MACHINE_NAME + '/' + TUNER_NAME)\n", (263, 325), False, 'import os, sys, re\n'), ((353, 395), 'os.path.join', 'os.path.join', (['ROOTDIR', '"""hypre/src/test/ij"...
import logging import os from django.conf import settings from django.core.management.base import BaseCommand from core.management.commands import configure_logging from core.models import Batch, OcrDump configure_logging("dump_ocr_logging.config", "dump_ocr.log") _logger = logging.getLogger(__name__) class Comma...
[ "logging.getLogger", "os.makedirs", "core.models.Batch.objects.filter", "core.models.OcrDump.new_from_batch", "os.path.isdir", "core.management.commands.configure_logging" ]
[((208, 268), 'core.management.commands.configure_logging', 'configure_logging', (['"""dump_ocr_logging.config"""', '"""dump_ocr.log"""'], {}), "('dump_ocr_logging.config', 'dump_ocr.log')\n", (225, 268), False, 'from core.management.commands import configure_logging\n'), ((279, 306), 'logging.getLogger', 'logging.getL...
import os import codecs from setuptools import setup, find_packages PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__)) def read(*path): full_path = os.path.join(PROJECT_ROOT, *path) with codecs.open(full_path, 'r', encoding='utf-8') as f: return f.read() setup( name='django-envsettings', ...
[ "os.path.dirname", "codecs.open", "setuptools.find_packages", "os.path.join" ]
[((101, 126), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (116, 126), False, 'import os\n'), ((162, 195), 'os.path.join', 'os.path.join', (['PROJECT_ROOT', '*path'], {}), '(PROJECT_ROOT, *path)\n', (174, 195), False, 'import os\n'), ((205, 250), 'codecs.open', 'codecs.open', (['full_path',...
#!/usr/bin/env python """A simple command line web client. I know curl is the best, but doing it in python has much more fun! Synopsis: web_client.py [--method METHOD] url Copyright 2017 <NAME> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance...
[ "logging.getLogger", "logging.StreamHandler", "argparse.ArgumentParser", "subprocess.check_call", "logging.Formatter", "pprint.pprint" ]
[((1008, 1027), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (1025, 1027), False, 'import logging\n'), ((2499, 2529), 'logging.getLogger', 'logging.getLogger', (['logger_name'], {}), '(logger_name)\n', (2516, 2529), False, 'import logging\n'), ((2696, 2729), 'logging.StreamHandler', 'logging.StreamHandle...
# -*- coding: utf-8 -*- from abc import ABCMeta, abstractmethod from typing import Dict, List from langml.tensor_typing import Models from langml.tokenizer import Tokenizer from langml.plm import load_albert, load_bert from langml.log import info class Template: def __init__(self, template: List[str], label_tok...
[ "langml.log.info", "langml.plm.load_bert", "langml.plm.load_albert" ]
[((659, 701), 'langml.log.info', 'info', (['f"""template ids: {self.template_ids}"""'], {}), "(f'template ids: {self.template_ids}')\n", (663, 701), False, 'from langml.log import info\n'), ((2652, 2795), 'langml.plm.load_albert', 'load_albert', ([], {'config_path': 'plm_config_path', 'checkpoint_path': 'plm_ckpt_path'...