code
stringlengths
22
1.05M
apis
listlengths
1
3.31k
extract_api
stringlengths
75
3.25M
import pyttsx3 import speech_recognition as sr import webbrowser import datetime import wikipedia import time # this method is for taking the commands # and recognizing the command from the # speech_Recognition module we will use # the recongizer method for recognizing def takeCommand(): r = sr.Recogniz...
[ "pyttsx3.init", "webbrowser.open", "time.sleep", "speech_recognition.Recognizer", "datetime.datetime.now", "speech_recognition.Microphone", "datetime.datetime.today", "wikipedia.summary" ]
[((309, 324), 'speech_recognition.Recognizer', 'sr.Recognizer', ([], {}), '()\n', (322, 324), True, 'import speech_recognition as sr\n'), ((1128, 1142), 'pyttsx3.init', 'pyttsx3.init', ([], {}), '()\n', (1140, 1142), False, 'import pyttsx3\n'), ((2490, 2503), 'time.sleep', 'time.sleep', (['(2)'], {}), '(2)\n', (2500, 2...
''' Symbol table read from the binary. Encapsulates much of the information described in the ELF specification. ''' import bisect from elftools.elf.elffile import ELFFile from elftools.elf.sections import SymbolTableSection class Symbol: ''' A symbol read from the binary's symbol table. Translates ELF-speci...
[ "bisect.bisect_right", "elftools.elf.elffile.ELFFile" ]
[((5323, 5366), 'bisect.bisect_right', 'bisect.bisect_right', (['self.sortedaddrs', 'addr'], {}), '(self.sortedaddrs, addr)\n', (5342, 5366), False, 'import bisect\n'), ((3289, 3303), 'elftools.elf.elffile.ELFFile', 'ELFFile', (['binfp'], {}), '(binfp)\n', (3296, 3303), False, 'from elftools.elf.elffile import ELFFile\...
from datetime import datetime import re from bravado.exception import HTTPBadGateway, HTTPGatewayTimeout, HTTPServiceUnavailable from celery import shared_task import feedparser from ics import Calendar import requests import pytz from django.utils.html import strip_tags from allianceauth.services.hooks import get_ext...
[ "datetime.datetime.utcfromtimestamp", "django.utils.html.strip_tags", "feedparser.parse", "datetime.datetime.strptime", "requests.get", "allianceauth.services.hooks.get_extension_logger", "ics.Calendar", "celery.shared_task", "re.sub" ]
[((837, 867), 'allianceauth.services.hooks.get_extension_logger', 'get_extension_logger', (['__name__'], {}), '(__name__)\n', (857, 867), False, 'from allianceauth.services.hooks import get_extension_logger\n'), ((13608, 13741), 'celery.shared_task', 'shared_task', ([], {}), "(**{**TASK_ESI_KWARGS, **{'base': QueueOnce...
# Copyright 2021 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...
[ "tensorflow.core.function.trace_type.serialization.deserialize", "tensorflow.core.function.trace_type.default_types_pb2.SerializedLiteral", "tensorflow.core.function.trace_type.serialization.serialize" ]
[((2263, 2321), 'tensorflow.core.function.trace_type.default_types_pb2.SerializedLiteral', 'default_types_pb2.SerializedLiteral', ([], {'bool_value': 'self.value'}), '(bool_value=self.value)\n', (2298, 2321), False, 'from tensorflow.core.function.trace_type import default_types_pb2\n'), ((2372, 2429), 'tensorflow.core....
import functools import random import bisect import math class Zipf: def __init__(self, arr, alpha): n = len(arr) tmp = [1. / math.pow(float(i), alpha) for i in range(1, n+1)] zeta = functools.reduce(lambda sums, x: sums + [sums[-1] + x], tmp, [0]) self.arr = arr self.distM...
[ "functools.reduce", "random.random", "bisect.bisect", "random.choice" ]
[((212, 277), 'functools.reduce', 'functools.reduce', (['(lambda sums, x: sums + [sums[-1] + x])', 'tmp', '[0]'], {}), '(lambda sums, x: sums + [sums[-1] + x], tmp, [0])\n', (228, 277), False, 'import functools\n'), ((387, 402), 'random.random', 'random.random', ([], {}), '()\n', (400, 402), False, 'import random\n'), ...
import bots bots.move( token='<KEY>', ship=4, systems=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13], )
[ "bots.move" ]
[((13, 102), 'bots.move', 'bots.move', ([], {'token': '"""<KEY>"""', 'ship': '(4)', 'systems': '[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]'}), "(token='<KEY>', ship=4, systems=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,\n 12, 13])\n", (22, 102), False, 'import bots\n')]
import math # Import the math module (for the sqrt function) a = float(input("Entre com o coeficiente a\n: ")) # input recebe um valor do teclado b = float(input("Entre com o coeficiente b\n: ")) # O valor retornado e uma string c = float(input("Entre com o coeficiente c\n: ")) # Usamos float para converter para um...
[ "math.sqrt" ]
[((428, 444), 'math.sqrt', 'math.sqrt', (['delta'], {}), '(delta)\n', (437, 444), False, 'import math\n'), ((467, 483), 'math.sqrt', 'math.sqrt', (['delta'], {}), '(delta)\n', (476, 483), False, 'import math\n')]
# flake8: noqa from construct import * from xbox.sg.utils.struct import XStruct from xbox.sg.utils.adapters import XEnum, PrefixedBytes from xbox.nano.enum import AudioCodec from xbox.nano.adapters import ReferenceTimestampAdapter fmt = XStruct( 'channels' / Int32ul, 'sample_rate' / Int32ul, 'codec' / XEnu...
[ "xbox.sg.utils.adapters.XEnum", "xbox.sg.utils.struct.XStruct", "xbox.nano.adapters.ReferenceTimestampAdapter", "xbox.sg.utils.adapters.PrefixedBytes" ]
[((670, 733), 'xbox.sg.utils.struct.XStruct', 'XStruct', (["('initial_frame_id' / Int32ul)", "('requested_format' / fmt)"], {}), "('initial_frame_id' / Int32ul, 'requested_format' / fmt)\n", (677, 733), False, 'from xbox.sg.utils.struct import XStruct\n'), ((316, 342), 'xbox.sg.utils.adapters.XEnum', 'XEnum', (['Int32u...
from db.user import (get_user, get_user_score, get_users_name_img_by_score_and_course_done, insert_user) def is_existed_user(uid): user = get_user(uid) if user: return True return False def add_user(uid, name, img_url): insert_user(uid, name, img_url) def get_user_list...
[ "db.user.insert_user", "db.user.get_user", "db.user.get_users_name_img_by_score_and_course_done" ]
[((165, 178), 'db.user.get_user', 'get_user', (['uid'], {}), '(uid)\n', (173, 178), False, 'from db.user import get_user, get_user_score, get_users_name_img_by_score_and_course_done, insert_user\n'), ((269, 300), 'db.user.insert_user', 'insert_user', (['uid', 'name', 'img_url'], {}), '(uid, name, img_url)\n', (280, 300...
from modules.lexer.position import Position from .ast_node import ASTNode class SequentialOperationNode(ASTNode): def __init__(self, left, right): self.left = left self.right = right super().__init__(Position(left.position.start, right.position.end)) def __repr__(self): return...
[ "modules.lexer.position.Position" ]
[((230, 279), 'modules.lexer.position.Position', 'Position', (['left.position.start', 'right.position.end'], {}), '(left.position.start, right.position.end)\n', (238, 279), False, 'from modules.lexer.position import Position\n')]
import os import yaml import time import shutil import torch import random import argparse import numpy as np import copy import timeit import statistics import datetime from torch.utils import data from tqdm import tqdm import cv2 from ptsemseg.process_img import generate_noise from ptsemseg.models import get_model f...
[ "ptsemseg.metrics.averageMeter", "ptsemseg.metrics.runningScore", "torch.load", "os.path.isfile", "torch.save", "torch.squeeze", "torch.no_grad", "time.time" ]
[((1313, 1341), 'ptsemseg.metrics.runningScore', 'runningScore', (['self.n_classes'], {}), '(self.n_classes)\n', (1325, 1341), False, 'from ptsemseg.metrics import runningScore, averageMeter\n'), ((2597, 2611), 'ptsemseg.metrics.averageMeter', 'averageMeter', ([], {}), '()\n', (2609, 2611), False, 'from ptsemseg.metric...
from django.db import DataError from django.test import TestCase from Emailer.authentication.models import CustomUserModel from Emailer.main.models import Receiver, CustomTemplate, Email class TestEmail(TestCase): def setUp(self) -> None: user = CustomUserModel(email="<EMAIL>") use...
[ "Emailer.authentication.models.CustomUserModel", "Emailer.main.models.Email", "Emailer.main.models.Receiver", "datetime.datetime.now", "Emailer.main.models.CustomTemplate" ]
[((275, 307), 'Emailer.authentication.models.CustomUserModel', 'CustomUserModel', ([], {'email': '"""<EMAIL>"""'}), "(email='<EMAIL>')\n", (290, 307), False, 'from Emailer.authentication.models import CustomUserModel\n'), ((349, 385), 'Emailer.main.models.Receiver', 'Receiver', ([], {'email': '"""<EMAIL>"""', 'user': '...
""" This is the start page for the application and includes all the different application modules listed in the PAGES variable. Renders the login page as well as the index page. """ from collections import defaultdict from flask import escape from flask.ext.login import current_user from page import Page from pages...
[ "flask.ext.login.current_user.get_config", "pages.shared.Navigation", "flask.escape", "pages.shared.Header", "pg.query", "page.Page", "pages.shared.Footer", "collections.defaultdict", "pg.pg_log_err" ]
[((1126, 1132), 'page.Page', 'Page', ([], {}), '()\n', (1130, 1132), False, 'from page import Page\n'), ((3720, 3726), 'page.Page', 'Page', ([], {}), '()\n', (3724, 3726), False, 'from page import Page\n'), ((3756, 3777), 'pages.shared.Header', 'Header', ([], {'title': '"""Index"""'}), "(title='Index')\n", (3762, 3777)...
import json, random, string, os, math, time, datetime, dateutil.parser import boto3 from datetime import datetime, timedelta, timezone import logging from FHIRClient import FHIRClient logger = logging.getLogger() logger.setLevel(logging.INFO) ## Establish the connection to SMART on FHIR backend services fhirclient = ...
[ "logging.getLogger", "time.tzset", "FHIRClient.FHIRClient" ]
[((194, 213), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (211, 213), False, 'import logging\n'), ((320, 445), 'FHIRClient.FHIRClient', 'FHIRClient', (["os.environ['client_id']", "os.environ['endpoint_token']", "os.environ['endpoint_stu3']", "os.environ['kms_key_id']"], {}), "(os.environ['client_id'], o...
#!/usr/bin/python # -*- coding: utf-8 -*- # @Date : 2016-05-23 18:29:57 # @Author : Yunyu2019 (<EMAIL>) # @Link : http://www.pythonchallenge.com/pc/ring/grandpa.html #user:'kohsamui' #password:'<PASSWORD>' import Image import requests """ req=requests.get('http://www.pythonchallenge.com/pc/rock/man...
[ "Image.open", "Image.new" ]
[((448, 476), 'Image.open', 'Image.open', (['"""mandelbrot.gif"""'], {}), "('mandelbrot.gif')\n", (458, 476), False, 'import Image\n'), ((1024, 1048), 'Image.new', 'Image.new', (['"""1"""', '(23, 73)'], {}), "('1', (23, 73))\n", (1033, 1048), False, 'import Image\n')]
import datetime import requests from flask import Flask from flask_restful import Resource, Api from requests.compat import urljoin, quote_plus app = Flask(__name__) api = Api(app) base_url = 'https://api.wmata.com/StationPrediction.svc/json/GetPrediction/' class Train(Resource): def get(self): # Reques...
[ "flask_restful.Api", "requests.compat.quote_plus", "flask.Flask", "requests.get", "datetime.datetime.now" ]
[((151, 166), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (156, 166), False, 'from flask import Flask\n'), ((173, 181), 'flask_restful.Api', 'Api', (['app'], {}), '(app)\n', (176, 181), False, 'from flask_restful import Resource, Api\n'), ((663, 699), 'requests.get', 'requests.get', (['url_1'], {'header...
import numpy as np from .. import inf from ... import blm from . import learning from .prior import prior class model: def __init__(self, lik, mean, cov, inf='exact'): self.lik = lik self.prior = prior(mean=mean, cov=cov) self.inf = inf self.num_params = self.lik.num_params + self....
[ "numpy.copy", "numpy.random.multivariate_normal", "numpy.append", "numpy.zeros", "numpy.random.permutation" ]
[((569, 604), 'numpy.append', 'np.append', (['lik_params', 'prior_params'], {}), '(lik_params, prior_params)\n', (578, 604), True, 'import numpy as np\n'), ((3818, 3876), 'numpy.random.multivariate_normal', 'np.random.multivariate_normal', (['fmean', '(fcov * alpha ** 2)', 'N'], {}), '(fmean, fcov * alpha ** 2, N)\n', ...
import numpy as np import labels as L import sys import tensorflow.contrib.keras as keras import tensorflow as tf from keras import backend as K K.set_learning_phase(0) from keras.preprocessing.text import Tokenizer from keras.preprocessing.sequence import pad_sequences from keras.utils import to_categorical from...
[ "labels.LABELS.items", "pickle.load", "numpy.asarray", "numpy.argmax", "keras.metrics.top_k_categorical_accuracy", "keras.preprocessing.sequence.pad_sequences", "keras.backend.set_learning_phase" ]
[((149, 172), 'keras.backend.set_learning_phase', 'K.set_learning_phase', (['(0)'], {}), '(0)\n', (169, 172), True, 'from keras import backend as K\n'), ((2058, 2110), 'keras.preprocessing.sequence.pad_sequences', 'pad_sequences', (['sequences'], {'maxlen': 'MAX_SEQUENCE_LENGTH'}), '(sequences, maxlen=MAX_SEQUENCE_LENG...
# -*- coding: utf-8 -*- """ This is the module for normalizing the frequency of membrane potential. You normalize the frequency of burst firings (1st~6th burst firing) and plot normalized membrane potential, Ca, and so on. """ __author__ = '<NAME>' __status__ = 'Prepared' __version__ = '1.0.0' __date__ = '24 Aug ...
[ "numpy.sqrt", "anmodel.models.Xmodel", "numpy.array_split", "copy.copy", "sys.path.append", "numpy.arange", "numpy.mean", "numpy.linspace", "pandas.DataFrame", "anmodel.models.SANmodel", "matplotlib.pyplot.savefig", "pathlib.Path.cwd", "analysistools.norm_fre_mp.Normalization", "pickle.loa...
[((549, 571), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (564, 571), False, 'import sys\n'), ((572, 601), 'sys.path.append', 'sys.path.append', (['"""../anmodel"""'], {}), "('../anmodel')\n", (587, 601), False, 'import sys\n'), ((6301, 6329), 'anmodel.analysis.FreqSpike', 'anmodel.analysis....
import insightconnect_plugin_runtime import time from .schema import UserActivityEventInput, UserActivityEventOutput, Input, Output, Component # Custom imports below from datetime import datetime class UserActivityEvent(insightconnect_plugin_runtime.Trigger): def __init__(self): super(self.__class__, sel...
[ "time.sleep", "datetime.datetime.utcnow" ]
[((761, 778), 'datetime.datetime.utcnow', 'datetime.utcnow', ([], {}), '()\n', (776, 778), False, 'from datetime import datetime\n'), ((2099, 2134), 'time.sleep', 'time.sleep', (['(sleep_interval_min * 60)'], {}), '(sleep_interval_min * 60)\n', (2109, 2134), False, 'import time\n')]
# -*- coding: utf-8 -*- import tensorflow as tf from bert_serving.client import BertClient from nltk import tokenize from pprint import pprint class rnn_clf(object): """" LSTM and Bi-LSTM classifiers for text classification """ def __init__(self, config): self.num_classes = config.num_classes ...
[ "tensorflow.equal", "tensorflow.nn.bidirectional_dynamic_rnn", "tensorflow.get_variable", "tensorflow.nn.sparse_softmax_cross_entropy_with_logits", "tensorflow.get_variable_scope", "tensorflow.nn.dropout", "tensorflow.nn.softmax", "tensorflow.reduce_mean", "tensorflow.cast", "tensorflow.placeholde...
[((553, 612), 'tensorflow.placeholder', 'tf.placeholder', ([], {'dtype': 'tf.int32', 'shape': '[]', 'name': '"""batch_size"""'}), "(dtype=tf.int32, shape=[], name='batch_size')\n", (567, 612), True, 'import tensorflow as tf\n'), ((636, 704), 'tensorflow.placeholder', 'tf.placeholder', ([], {'dtype': 'tf.float32', 'shap...
#!/usr/bin/python3 # This example loads an exported JSON map, finds different buildings, and # generates a simple travel demand model. # # 1) cargo run --bin dump_map data/system/us/seattle/maps/montlake.bin > montlake.json # 2) ./headless/examples/generate_traffic.py --map=montlake.json --out=traffic.json # 3) cargo r...
[ "json.load", "json.dumps", "random.choice", "argparse.ArgumentParser" ]
[((624, 649), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (647, 649), False, 'import argparse\n'), ((968, 980), 'json.load', 'json.load', (['f'], {}), '(f)\n', (977, 980), False, 'import json\n'), ((1561, 1600), 'random.choice', 'random.choice', (['residential_building_ids'], {}), '(resident...
# Copyright 2019 the gRPC 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 wri...
[ "logging.getLogger", "logging.basicConfig", "examples.helloworld_pb2.HelloReply", "argparse.ArgumentParser", "concurrent.futures.ThreadPoolExecutor", "threading.RLock", "time.sleep" ]
[((1143, 1170), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1160, 1170), False, 'import logging\n'), ((2705, 2754), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '_DESCRIPTION'}), '(description=_DESCRIPTION)\n', (2728, 2754), False, 'import argparse\n'), (...
from django.conf.urls import url from django.urls import path,re_path from first_app import views app_name = 'first_app' urlpatterns=[ path('',views.display_movie,name='display_movie'), path('fav/',views.fav,name='fav'), path('unfav/',views.unfav,name='unfav'), path('upload_movie/',views.upload_movie...
[ "django.urls.re_path", "django.urls.path" ]
[((142, 193), 'django.urls.path', 'path', (['""""""', 'views.display_movie'], {'name': '"""display_movie"""'}), "('', views.display_movie, name='display_movie')\n", (146, 193), False, 'from django.urls import path, re_path\n'), ((197, 232), 'django.urls.path', 'path', (['"""fav/"""', 'views.fav'], {'name': '"""fav"""'}...
# -*- coding: utf-8 -*- # ---------------------------------------------------------------------------- # Author: <NAME> (<EMAIL>) # # Copyright: (c) 2021 ff. <NAME> # License: This program is part of a larger application. For license # details please read the file LICENSE.txt provided together #...
[ "quantity.predefined.Length.units", "quantity.predefined.Duration.units", "fractions.Fraction", "decimalfp.Decimal", "pytest.raises" ]
[((2483, 2497), 'quantity.predefined.Length.units', 'Length.units', ([], {}), '()\n', (2495, 2497), False, 'from quantity.predefined import CENTIMETRE, CUBIC_CENTIMETRE, Duration, FAHRENHEIT, GRAM, HECTARE, HOUR, JOULE, KILOMETRE, KILOMETRE_PER_HOUR, LITRE, Length, METRE, METRE_PER_SECOND_SQUARED, MICROSECOND, MILLIGRA...
import configparser import requests import json import os ABS_PATH = os.path.dirname(__file__) class Slackbot: def __init__(self, bot_name='trainingbot', channel_name='training'): self.bot_name = bot_name self.channel_name = channel_name config = configparser.ConfigParser() config...
[ "os.path.dirname", "requests.post", "configparser.ConfigParser" ]
[((70, 95), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (85, 95), False, 'import os\n'), ((278, 305), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (303, 305), False, 'import configparser\n'), ((441, 590), 'requests.post', 'requests.post', (['"""https://slack....
#!/usr/bin/env python3 import logging import sys from lib.input.udp_server import UdpServer from lib.parse.payload_bin_parse import PayloadBinParser from lib.output.mqtt_broker import MqttBroker logging.basicConfig(level=logging.DEBUG, format="%(asctime)-15s %(levelname)s %(message)s") def main(): parser = Payl...
[ "logging.basicConfig", "lib.parse.payload_bin_parse.PayloadBinParser", "lib.input.udp_server.UdpServer", "logging.info", "lib.output.mqtt_broker.MqttBroker" ]
[((197, 293), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG', 'format': '"""%(asctime)-15s %(levelname)s %(message)s"""'}), "(level=logging.DEBUG, format=\n '%(asctime)-15s %(levelname)s %(message)s')\n", (216, 293), False, 'import logging\n'), ((316, 334), 'lib.parse.payload_bin_parse....
import os from codecs import open from setuptools import find_packages, setup BASE_DIR = os.path.abspath(os.path.dirname(__file__)) VERSION = __import__('didadata').__version__ with open(os.path.join(BASE_DIR, 'README.rst'), encoding='utf-8') as f: long_description = f.read() prod_require = [ 'Django>=2....
[ "os.path.dirname", "setuptools.find_packages", "os.path.join" ]
[((108, 133), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (123, 133), False, 'import os\n'), ((192, 228), 'os.path.join', 'os.path.join', (['BASE_DIR', '"""README.rst"""'], {}), "(BASE_DIR, 'README.rst')\n", (204, 228), False, 'import os\n'), ((1030, 1073), 'setuptools.find_packages', 'fin...
#!/usr/bin/python3 # Copyright (c) 2019 <NAME> (kekeho) # # This software is released under the MIT License. # https://opensource.org/licenses/MIT from flask import Flask, render_template, Response, redirect from flask_socketio import SocketIO, emit, send import uuid import zipfile from datetime import datetime import...
[ "flask.render_template", "zipfile.ZipFile", "flask.Flask", "flask_socketio.emit", "subprocess.run", "os.path.join", "lib.video.CamThread", "flask_socketio.SocketIO", "uuid.uuid4", "flask.redirect", "datetime.datetime.now", "os.path.abspath", "os.remove" ]
[((394, 409), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (399, 409), False, 'from flask import Flask, render_template, Response, redirect\n'), ((505, 542), 'flask_socketio.SocketIO', 'SocketIO', (['app'], {'async_mode': '"""threading"""'}), "(app, async_mode='threading')\n", (513, 542), False, 'from fl...
import glob import os from os import path, DirEntry from progressbar import Counter, Timer, ProgressBar import time from PIL import Image from enum import Enum import shutil class Orientation(Enum): UNDEFINED = 0 HORIZONTAL = 1 VERTICAL = 2 SQUARE = 3 class ImageAndOrientation(object): file = ob...
[ "os.path.exists", "PIL.Image.open", "os.scandir", "os.path.join", "progressbar.Counter", "progressbar.Timer", "os.path.isdir", "progressbar.ProgressBar" ]
[((638, 653), 'os.scandir', 'os.scandir', (['dir'], {}), '(dir)\n', (648, 653), False, 'import os\n'), ((666, 681), 'os.scandir', 'os.scandir', (['dir'], {}), '(dir)\n', (676, 681), False, 'import os\n'), ((1018, 1046), 'progressbar.ProgressBar', 'ProgressBar', ([], {'widgets': 'widgets'}), '(widgets=widgets)\n', (1029...
from app.models import * from flask import request import logging import traceback class SQLAlchemyHandler(logging.Handler): """ Handler to log into db """ def emit(self, record): trace = None exc = record.__dict__['exc_info'] if exc: trace = traceback.format_exc(ex...
[ "traceback.format_exc" ]
[((297, 322), 'traceback.format_exc', 'traceback.format_exc', (['exc'], {}), '(exc)\n', (317, 322), False, 'import traceback\n')]
#!/usr/bin/python # -*- coding: utf-8 -*- ''' @AUTHOR:<NAME> @CONTACT:<EMAIL> @HOME_PAGE:joselynzhao.top @SOFTWERE:PyCharm @FILE:3.py @TIME:2020/5/13 20:13 @DES: ''' # # num_book = int(input()) # num_reader = int(input()) # requeir_list = [] # for n in range(num_reader): # info = list(map(int,input().strip().split(...
[ "numpy.array", "numpy.ones" ]
[((1026, 1048), 'numpy.array', 'np.array', (['requeir_list'], {}), '(requeir_list)\n', (1034, 1048), True, 'import numpy as np\n'), ((1115, 1134), 'numpy.ones', 'np.ones', (['num_reader'], {}), '(num_reader)\n', (1122, 1134), True, 'import numpy as np\n')]
# # Copyright (c) 2017, Massachusetts Institute of Technology All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # Redistributions of source code must retain the above copyright notice, this # list ...
[ "gtk.Label", "gtk.Table", "gtk.Entry", "gtk.ScrolledWindow.__init__", "gtk.CheckButton", "MDSplus.TreeNode", "glade.get_adaptor_for_type", "sys.exc_info", "mdspluswidget.MDSplusWidget.__init__", "gobject.type_register", "MDSplus.Data.compile" ]
[((8549, 8593), 'gobject.type_register', 'gobject.type_register', (['MDSplusDigChansWidget'], {}), '(MDSplusDigChansWidget)\n', (8570, 8593), False, 'import gobject\n'), ((8650, 8688), 'glade.get_adaptor_for_type', 'glade.get_adaptor_for_type', (['"""GtkTable"""'], {}), "('GtkTable')\n", (8676, 8688), False, 'import gl...
#!/usr/bin/env python '''Tests for algocli''' import os import unittest from algocli import algocli from algocli import util class TestAlgocli(unittest.TestCase): #def setUp(self): # self.args = { # 'input': None, # 'version': False, # 'list_colors': False, # '...
[ "unittest.main", "os.system", "algocli.util.ALGORITHMS.keys" ]
[((2714, 2740), 'unittest.main', 'unittest.main', ([], {'verbosity': '(2)'}), '(verbosity=2)\n', (2727, 2740), False, 'import unittest\n'), ((2389, 2411), 'algocli.util.ALGORITHMS.keys', 'util.ALGORITHMS.keys', ([], {}), '()\n', (2409, 2411), False, 'from algocli import util\n'), ((2566, 2589), 'os.system', 'os.system'...
from unittest import TestCase import numpy as np from source.analysis.performance.curve_performance import ROCPerformance, PrecisionRecallPerformance class TestROCPerformance(TestCase): def test_properties(self): true_positive_rates = np.array([1, 2]) false_positive_rates = np.array([3, 4]) ...
[ "numpy.array", "source.analysis.performance.curve_performance.PrecisionRecallPerformance", "source.analysis.performance.curve_performance.ROCPerformance" ]
[((252, 268), 'numpy.array', 'np.array', (['[1, 2]'], {}), '([1, 2])\n', (260, 268), True, 'import numpy as np\n'), ((300, 316), 'numpy.array', 'np.array', (['[3, 4]'], {}), '([3, 4])\n', (308, 316), True, 'import numpy as np\n'), ((343, 445), 'source.analysis.performance.curve_performance.ROCPerformance', 'ROCPerforma...
# coding: utf-8 # Copyright 2015 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 req...
[ "numpy.array", "six.moves.xrange", "uh_sensor_values.loss", "tensorflow.app.run", "tensorflow.Graph", "numpy.reshape", "argparse.ArgumentParser", "tensorflow.placeholder", "tensorflow.Session", "glob.glob", "tensorflow.summary.merge_all", "uh_sensor_values.inference", "random.shuffle", "te...
[((1981, 2011), 'numpy.array', 'np.array', (['[]'], {'dtype': 'np.float32'}), '([], dtype=np.float32)\n', (1989, 2011), True, 'import numpy as np\n'), ((2039, 2069), 'numpy.array', 'np.array', (['[]'], {'dtype': 'np.float32'}), '([], dtype=np.float32)\n', (2047, 2069), True, 'import numpy as np\n'), ((4184, 4253), 'ten...
#!python """ Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved. This program and the accompanying materials are made available under the terms of the 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 Lic...
[ "os.path.dirname", "mpp.lib.PgHba.Entry", "os.path.join" ]
[((1080, 1105), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (1095, 1105), False, 'import os\n'), ((1977, 2075), 'mpp.lib.PgHba.Entry', 'PgHba.Entry', ([], {'entry_type': '"""local"""', 'database': '"""test_database"""', 'user': '"""test_user"""', 'authmethod': '"""sspi"""'}), "(entry_type=...
# Generated by Django 2.2.2 on 2019-06-22 18:23 import django.contrib.gis.db.models.fields import django.contrib.postgres.fields from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( ...
[ "django.db.models.FloatField", "django.db.models.CharField", "django.db.models.BooleanField", "django.db.models.IntegerField" ]
[((382, 436), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'primary_key': '(True)', 'serialize': '(False)'}), '(primary_key=True, serialize=False)\n', (401, 436), False, 'from django.db import migrations, models\n'), ((464, 507), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(2...
import torch from models.deep_mix_net import DeepSeqNet from torch import nn from torch.nn import functional as F class RCNN(DeepSeqNet): def __init__(self, vocab_size, embeddings, embedding_size, rcnn_num_hidden_layers, rcnn_hidden_size, rcnn_linear_size, output_dim, dropout_...
[ "torch.nn.ReLU", "torch.nn.Dropout", "torch.nn.Tanh", "torch.nn.Softmax", "torch.nn.LSTM", "torch.nn.ModuleList", "torch.nn.functional.max_pool1d", "torch.cat", "torch.nn.Parameter", "torch.cuda.is_available", "torch.nn.Linear", "torch.nn.Embedding" ]
[((882, 927), 'torch.nn.Embedding', 'nn.Embedding', (['vocab_size', 'self.embedding_size'], {}), '(vocab_size, self.embedding_size)\n', (894, 927), False, 'from torch import nn\n'), ((961, 1006), 'torch.nn.Parameter', 'nn.Parameter', (['embeddings'], {'requires_grad': '(False)'}), '(embeddings, requires_grad=False)\n',...
""" .. codeauthor:: <NAME> <<EMAIL>> """ from typing import Callable, Optional from ._null_logger import NullLogger MODULE_NAME = "subprocrunner" DEFAULT_ERROR_LOG_LEVEL = "WARNING" try: from loguru import logger LOGURU_INSTALLED = True logger.disable(MODULE_NAME) except ImportError: LOGURU_INST...
[ "loguru.logger.enable", "loguru.logger.disable" ]
[((257, 284), 'loguru.logger.disable', 'logger.disable', (['MODULE_NAME'], {}), '(MODULE_NAME)\n', (271, 284), False, 'from loguru import logger\n'), ((1141, 1167), 'loguru.logger.enable', 'logger.enable', (['MODULE_NAME'], {}), '(MODULE_NAME)\n', (1154, 1167), False, 'from loguru import logger\n'), ((1186, 1213), 'log...
__author__ = '<NAME>' __email__ = "<EMAIL>" __license__ = "MIT" __version__ = "July 2021" import json import os import pprint import sys import time import uuid import arrow import jinja2 from operator import itemgetter from pysrc.config import Config # This class generates the similar "manifest" csv and json fi...
[ "json.dumps", "pysrc.config.Config", "os.path.basename", "json.load", "operator.itemgetter" ]
[((748, 756), 'pysrc.config.Config', 'Config', ([], {}), '()\n', (754, 756), False, 'from pysrc.config import Config\n'), ((7971, 8013), 'json.dumps', 'json.dumps', (['obj'], {'sort_keys': '(False)', 'indent': '(2)'}), '(obj, sort_keys=False, indent=2)\n', (7981, 8013), False, 'import json\n'), ((7431, 7451), 'json.loa...
from datetime import datetime, timedelta import pytest from greenbudget.app.jwt import serializers from greenbudget.app.jwt.utils import verify_token from greenbudget.app.jwt.tokens import GreenbudgetSlidingToken from greenbudget.app.jwt.exceptions import TokenInvalidError, TokenExpiredError def test_verify_token_b...
[ "greenbudget.app.jwt.tokens.GreenbudgetSlidingToken", "greenbudget.app.jwt.utils.verify_token", "datetime.datetime", "pytest.mark.freeze_time", "pytest.mark.skip", "pytest.raises", "datetime.timedelta", "greenbudget.app.jwt.serializers.TokenRefreshSlidingSerializer" ]
[((678, 715), 'pytest.mark.freeze_time', 'pytest.mark.freeze_time', (['"""2021-01-01"""'], {}), "('2021-01-01')\n", (701, 715), False, 'import pytest\n'), ((1074, 1129), 'pytest.mark.skip', 'pytest.mark.skip', (['"""Figure out why this is not passing!"""'], {}), "('Figure out why this is not passing!')\n", (1090, 1129)...
# can use request module import requests api = "http://localhost:5000/api/ocr" files = {'image': open('../ocr_using_video/test.png', 'rb')} # preprocess = blur or thresh params = {"preprocess" : "blur"} print(requests.post(api,params,files=files ).text) # For Linux and mac users # curl -i -X POST -F files=@test.png ...
[ "requests.post" ]
[((210, 249), 'requests.post', 'requests.post', (['api', 'params'], {'files': 'files'}), '(api, params, files=files)\n', (223, 249), False, 'import requests\n')]
from typing import Any, Union import aiml import os from kivy.app import App from kivy.uix.label import Label from kivy.uix.gridlayout import GridLayout from kivy.uix.textinput import TextInput from kivy.uix.button import Button class MyGrid(GridLayout): name1: TextInput def __init__(self, **k...
[ "kivy.uix.button.Button", "kivy.uix.label.Label", "aiml.Kernel", "kivy.uix.textinput.TextInput" ]
[((421, 446), 'kivy.uix.textinput.TextInput', 'TextInput', ([], {'multiline': '(True)'}), '(multiline=True)\n', (430, 446), False, 'from kivy.uix.textinput import TextInput\n'), ((504, 559), 'kivy.uix.label.Label', 'Label', ([], {'text': '"""Hi there ,it\'s me tezz ur personal AI bot"""'}), '(text="Hi there ,it\'s me t...
from __future__ import print_function import numpy as np import pandas as pd import inspect import os import time from . import Model from . import Utils as U #------------------------------ #FINDING NEAREST NEIGHBOR #------------------------------ def mindistance(x,xma,Nx): distx = 0 mindist = 1000000 * U.P...
[ "numpy.ones", "inspect.stack", "numpy.where", "numpy.zeros", "os.popen", "numpy.loadtxt", "time.time", "numpy.arange" ]
[((834, 845), 'time.time', 'time.time', ([], {}), '()\n', (843, 845), False, 'import time\n'), ((1781, 1797), 'numpy.zeros', 'np.zeros', (['NTotal'], {}), '(NTotal)\n', (1789, 1797), True, 'import numpy as np\n'), ((1853, 1869), 'numpy.zeros', 'np.zeros', (['NTotal'], {}), '(NTotal)\n', (1861, 1869), True, 'import nump...
import argparse import glob import os import re from enum import Enum from math import ceil, sqrt from pathlib import Path from PIL import Image from fonts.ttf import SourceSansProSemibold as DefaultFont try: from importlib import metadata except ImportError: # on Python <3.8 use importlib-metadata package ...
[ "PIL.Image.open", "argparse.ArgumentParser", "math.sqrt", "re.match", "argparse.ArgumentTypeError", "os.path.basename", "importlib_metadata.version", "glob.glob" ]
[((5214, 5313), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'prog': '"""photomatrix"""', 'description': '"""Concat photos together in a matrix."""'}), "(prog='photomatrix', description=\n 'Concat photos together in a matrix.')\n", (5237, 5313), False, 'import argparse\n'), ((2267, 2290), 'glob.glob',...
#rocket-nozzle-tools __author__ = "<NAME>" __email__ = "<EMAIL>","<EMAIL>" __copyright__ = "Copyright 2019, <NAME>" import math """Common thermodynamics functions""" def x_function(mach,gamma): gp1 = gamma+1 gm1 = gamma-1 return mach*math.sqrt(gamma)*(1+(gm1/2)*mach**2)**(-gp1/(2*gm1)) def pratio(mach,g...
[ "math.sqrt" ]
[((1276, 1328), 'math.sqrt', 'math.sqrt', (['(gamma * specificgasconstant * temperature)'], {}), '(gamma * specificgasconstant * temperature)\n', (1285, 1328), False, 'import math\n'), ((249, 265), 'math.sqrt', 'math.sqrt', (['gamma'], {}), '(gamma)\n', (258, 265), False, 'import math\n'), ((1074, 1106), 'math.sqrt', '...
import sys, json, requests, wget #import urllib2 import urlopen, URLError, HTTPError def clientbundle(): pass url="https://ec2-54-183-194-88.us-west-1.compute.amazonaws.com/auth/login" data = dict(username='docker', password='<PASSWORD>') r = requests.post(url, json=data, verify=False) auth_token = json.loads(r.c...
[ "json.loads", "requests.post", "requests.get" ]
[((248, 291), 'requests.post', 'requests.post', (['url'], {'json': 'data', 'verify': '(False)'}), '(url, json=data, verify=False)\n', (261, 291), False, 'import sys, json, requests, wget\n'), ((558, 623), 'requests.get', 'requests.get', (['ucp_api'], {'headers': 'headers', 'stream': '(True)', 'verify': '(False)'}), '(u...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distrib...
[ "logging.getLogger", "osc_lib.exceptions.CommandError", "otcextensions.i18n._", "osc_lib.utils.get_item_properties" ]
[((751, 778), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (768, 778), False, 'import logging\n'), ((989, 1025), 'otcextensions.i18n._', '_', (['"""List Customer Master Keys (CMK)"""'], {}), "('List Customer Master Keys (CMK)')\n", (990, 1025), False, 'from otcextensions.i18n import _\n...
""" Tests of Tax-Calculator using puf.csv input. Note that the puf.csv file that is required to run this program has been constructed by the Tax-Calculator development team by merging information from the most recent publicly available IRS SOI PUF file and from the Census CPS file for the corresponding year. If you h...
[ "taxcalc.Records", "taxcalc.Calculator", "numpy.allclose", "pandas.read_csv", "os.path.join", "numpy.sum", "json.load", "taxcalc.Policy" ]
[((1187, 1195), 'taxcalc.Policy', 'Policy', ([], {}), '()\n', (1193, 1195), False, 'from taxcalc import Policy, Records, Calculator\n'), ((1280, 1308), 'taxcalc.Records', 'Records', ([], {'data': 'puf_fullsample'}), '(data=puf_fullsample)\n', (1287, 1308), False, 'from taxcalc import Policy, Records, Calculator\n'), ((...
import sys import traceback import numpy as np from shapely import geometry as g import multiprocessing as mp from . import abCellSize from . import abUtils class abLongBreakWaterLocAlphaAdjust: def __init__(self, cell, neighbors, coastPolygons, directions, alphas, betas): self.cell = cell self.neigh...
[ "numpy.ones", "numpy.array", "shapely.geometry.Polygon", "sys.exc_info", "multiprocessing.Pool", "sys.stdout.flush" ]
[((783, 799), 'numpy.array', 'np.array', (['alphas'], {}), '(alphas)\n', (791, 799), True, 'import numpy as np\n'), ((817, 832), 'numpy.array', 'np.array', (['betas'], {}), '(betas)\n', (825, 832), True, 'import numpy as np\n'), ((4959, 4988), 'multiprocessing.Pool', 'mp.Pool', (['self.nParallelWorker'], {}), '(self.nP...
import gym import numpy as np import tensorflow as tf import time from actor_critic import RandomActorCritic from common.multiprocessing_env import SubprocVecEnv from common.model import NetworkBase, model_play_games from environment_model.network import EMBuilder from tqdm import tqdm class EnvironmentModel(Networ...
[ "environment_model.network.EMBuilder", "tensorflow.gradients", "common.model.model_play_games", "tensorflow.placeholder", "common.multiprocessing_env.SubprocVecEnv", "tensorflow.Session", "numpy.concatenate", "tensorflow.square", "tensorflow.ConfigProto", "tensorflow.summary.scalar", "tensorflow...
[((3561, 3580), 'common.multiprocessing_env.SubprocVecEnv', 'SubprocVecEnv', (['envs'], {}), '(envs)\n', (3574, 3580), False, 'from common.multiprocessing_env import SubprocVecEnv\n'), ((3837, 3935), 'tensorflow.ConfigProto', 'tf.ConfigProto', ([], {'inter_op_parallelism_threads': 'cpu_cores', 'intra_op_parallelism_thr...
#!/usr/bin/python ''' (C) Copyright 2018-2019 Intel Corporation. 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 applic...
[ "traceback.format_exc", "avocado.utils.process.system", "os.geteuid", "avocado.utils.process.system_output", "os.getegid" ]
[((2677, 2689), 'os.geteuid', 'os.geteuid', ([], {}), '()\n', (2687, 2689), False, 'import os\n'), ((2704, 2716), 'os.getegid', 'os.getegid', ([], {}), '()\n', (2714, 2716), False, 'import os\n'), ((1734, 1746), 'os.geteuid', 'os.geteuid', ([], {}), '()\n', (1744, 1746), False, 'import os\n'), ((1765, 1777), 'os.getegi...
from django.test import TestCase from datetime import date from courier.models import Courier from trip.models import Trip from salary.models import DailySalary, RewardDeduction class DailySalaryTestCase(TestCase): def setUp(self): self.courier = Courier.objects.create(first_name='<NAME>', last_name='<NAM...
[ "courier.models.Courier.objects.create", "salary.models.RewardDeduction.objects.create", "salary.models.DailySalary.objects.get", "datetime.date.today", "trip.models.Trip.objects.create" ]
[((261, 324), 'courier.models.Courier.objects.create', 'Courier.objects.create', ([], {'first_name': '"""<NAME>"""', 'last_name': '"""<NAME>"""'}), "(first_name='<NAME>', last_name='<NAME>')\n", (283, 324), False, 'from courier.models import Courier\n'), ((346, 358), 'datetime.date.today', 'date.today', ([], {}), '()\n...
import unittest from user import User class UserTest(unittest.TestCase): """ Test class that defines test cases for the contact class behaviours. Args: unittest.TestCase : Inherits the testCase class that helps in creating test cases """ def setUp(self): """ Set up method ...
[ "unittest.main", "user.User" ]
[((1088, 1103), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1101, 1103), False, 'import unittest\n'), ((387, 407), 'user.User', 'User', (['"""user100,1100"""'], {}), "('user100,1100')\n", (391, 407), False, 'from user import User\n')]
from rest_framework import serializers from battles.models import Battle, Team, TeamPokemon from battles.services.api_integration import ( check_pokemons_exists_in_pokeapi, get_or_create_pokemon, get_pokemon_info, ) from battles.services.email import email_invite from battles.services.logic_team import ( ...
[ "rest_framework.serializers.IntegerField", "rest_framework.serializers.CharField", "rest_framework.serializers.CurrentUserDefault", "battles.services.logic_team_pokemon.check_position_unique", "battles.models.TeamPokemon.objects.create", "battles.services.api_integration.check_pokemons_exists_in_pokeapi",...
[((1552, 1575), 'rest_framework.serializers.CharField', 'serializers.CharField', ([], {}), '()\n', (1573, 1575), False, 'from rest_framework import serializers\n'), ((3015, 3053), 'rest_framework.serializers.CharField', 'serializers.CharField', ([], {'write_only': '(True)'}), '(write_only=True)\n', (3036, 3053), False,...
from django.conf.urls import url, include urlpatterns = [ url(r'^inventory/', include('tsadmapi.inventory.urls', namespace='inventory')), url(r'^slave/', include('tsadmapi.slave.urls', namespace='slave')), ]
[ "django.conf.urls.include" ]
[((83, 140), 'django.conf.urls.include', 'include', (['"""tsadmapi.inventory.urls"""'], {'namespace': '"""inventory"""'}), "('tsadmapi.inventory.urls', namespace='inventory')\n", (90, 140), False, 'from django.conf.urls import url, include\n'), ((163, 212), 'django.conf.urls.include', 'include', (['"""tsadmapi.slave.ur...
from contextlib import contextmanager import allure_commons import mock import pytest from allure_commons.logger import AllureFileLogger from allure_commons_test.report import AllureReport from pytest_bdd import given, when, parsers from .py_file_builder import PyFileBuilder from .steps import * # noqa F401 F403 py...
[ "mock.patch", "allure_commons_test.report.AllureReport", "allure_commons.plugin_manager.register", "pytest_bdd.when", "allure_commons.logger.AllureFileLogger", "pytest_bdd.given", "pytest.fixture", "pytest_bdd.parsers.parse", "allure_commons.plugin_manager.unregister", "pytest_bdd.parsers.re", "...
[((1855, 1889), 'pytest_bdd.when', 'when', (['"""run pytest-bdd with allure"""'], {}), "('run pytest-bdd with allure')\n", (1859, 1889), False, 'from pytest_bdd import given, when, parsers\n'), ((1957, 1973), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (1971, 1973), False, 'import pytest\n'), ((2502, 2528), '...
from cmd import Cmd from os import urandom from base64 import b64encode, b64decode from getpass import getpass from hashlib import pbkdf2_hmac from pymongo import MongoClient def get_database(): client = MongoClient("mongodb://localhost:27017/") return client["testdb"] def hash_password(password_input, salt...
[ "os.urandom", "pymongo.MongoClient", "base64.b64encode", "getpass.getpass" ]
[((210, 251), 'pymongo.MongoClient', 'MongoClient', (['"""mongodb://localhost:27017/"""'], {}), "('mongodb://localhost:27017/')\n", (221, 251), False, 'from pymongo import MongoClient\n'), ((926, 947), 'getpass.getpass', 'getpass', (['"""Password: """'], {}), "('Password: ')\n", (933, 947), False, 'from getpass import ...
from asgiref.sync import async_to_sync from channels.generic.websocket import JsonWebsocketConsumer from django.apps import apps from django.core.signing import Signer, BadSignature from django.template.loader import render_to_string from turbo import REMOVE signer = Signer() class TurboStreamException(Exception): ...
[ "asgiref.sync.async_to_sync", "django.core.signing.Signer", "django.apps.apps.get_model" ]
[((270, 278), 'django.core.signing.Signer', 'Signer', ([], {}), '()\n', (276, 278), False, 'from django.core.signing import Signer, BadSignature\n'), ((515, 542), 'django.apps.apps.get_model', 'apps.get_model', (['model_label'], {}), '(model_label)\n', (529, 542), False, 'from django.apps import apps\n'), ((1525, 1568)...
# Generated by Django 2.1.7 on 2019-07-05 23:04 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('home', '0003_job'), ] operations = [ migrations.AlterField( model_name='home', name='Jumbotron_Text', fi...
[ "django.db.models.IntegerField", "django.db.models.TextField", "django.db.models.CharField" ]
[((324, 387), 'django.db.models.TextField', 'models.TextField', ([], {'max_length': '(200)', 'verbose_name': '"""Jumbotron Text"""'}), "(max_length=200, verbose_name='Jumbotron Text')\n", (340, 387), False, 'from django.db import migrations, models\n'), ((508, 564), 'django.db.models.CharField', 'models.CharField', ([]...
import sys, csv import numpy as np from keras import models from keras import layers from keras.utils.np_utils import to_categorical # import matplotlib.pyplot as plt # from keras.datasets import boston_housing Train_Data_List = [] Train_Target_List = [] with open('train.txt', 'r') as f: reader = csv.DictReader(f...
[ "csv.DictReader", "keras.models.Sequential", "numpy.array", "keras.utils.np_utils.to_categorical", "keras.layers.Dense" ]
[((1463, 1488), 'numpy.array', 'np.array', (['Train_Data_List'], {}), '(Train_Data_List)\n', (1471, 1488), True, 'import numpy as np\n'), ((1514, 1541), 'numpy.array', 'np.array', (['Train_Target_List'], {}), '(Train_Target_List)\n', (1522, 1541), True, 'import numpy as np\n'), ((1559, 1596), 'keras.utils.np_utils.to_c...
import numpy as np import pandas as pd import math import math import matplotlib.pyplot as plt import networkx as nx from sklearn.cluster import KMeans as KMeans from scipy import sparse from numpy import linalg # picture has been attached in the mail df1 = pd.read_csv("./../data/11_twoCirclesData.csv") # rea...
[ "sklearn.cluster.KMeans", "pandas.read_csv", "numpy.linalg.norm", "numpy.argsort", "numpy.exp", "numpy.zeros", "networkx.normalized_laplacian_matrix", "numpy.vstack", "matplotlib.pyplot.scatter", "networkx.from_numpy_matrix", "matplotlib.pyplot.show" ]
[((263, 309), 'pandas.read_csv', 'pd.read_csv', (['"""./../data/11_twoCirclesData.csv"""'], {}), "('./../data/11_twoCirclesData.csv')\n", (274, 309), True, 'import pandas as pd\n'), ((468, 484), 'numpy.zeros', 'np.zeros', (['(m, m)'], {}), '((m, m))\n', (476, 484), True, 'import numpy as np\n'), ((681, 704), 'networkx....
import numpy as np import matplotlib.pyplot as plt def QR_fact(A): """ I spent 4 hours on this. This still does not work properly. Ultimately I just cries and left this as is in remembrance. """ if A is None: raise RuntimeError("A cannot be NoneType") ncols = A.shape[1] nrows = A.shape[0] Q = np....
[ "numpy.ones", "numpy.random.random", "numpy.dot", "numpy.zeros", "numpy.linalg.norm" ]
[((317, 334), 'numpy.zeros', 'np.zeros', (['A.shape'], {}), '(A.shape)\n', (325, 334), True, 'import numpy as np\n'), ((340, 364), 'numpy.zeros', 'np.zeros', (['(ncols, ncols)'], {}), '((ncols, ncols))\n', (348, 364), True, 'import numpy as np\n'), ((728, 745), 'numpy.zeros', 'np.zeros', (['A.shape'], {}), '(A.shape)\n...
from pytube import Playlist from utils.config import path import os def downloadAudio(link: str): playlist = Playlist(link) print("Converting Playlist...") for video in playlist.videos: title = video.title audio = video.streams.filter(only_audio=True).first() output = audio.download...
[ "os.rename", "os.path.splitext", "pytube.Playlist" ]
[((114, 128), 'pytube.Playlist', 'Playlist', (['link'], {}), '(link)\n', (122, 128), False, 'from pytube import Playlist\n'), ((517, 531), 'pytube.Playlist', 'Playlist', (['link'], {}), '(link)\n', (525, 531), False, 'from pytube import Playlist\n'), ((347, 371), 'os.path.splitext', 'os.path.splitext', (['output'], {})...
#!/usr/bin/python3 # -*- coding: UTF-8 -*- import threading import time def foo(n): print("args is %s" %(n)) x = 0 while x < 10: print("child thread running", x) time.sleep(1) x += 1 def fun(): print("other child thread is runing") if __name__ == '__main__': # 启动一个线程,这里...
[ "threading.Thread", "time.sleep" ]
[((333, 389), 'threading.Thread', 'threading.Thread', ([], {'target': 'foo', 'args': '(1,)', 'name': '"""thread-0"""'}), "(target=foo, args=(1,), name='thread-0')\n", (349, 389), False, 'import threading\n'), ((487, 532), 'threading.Thread', 'threading.Thread', ([], {'target': 'fun', 'name': '"""thread-1"""'}), "(targe...
from airflow.providers.postgres.hooks.postgres import PostgresHook from airflow.models import BaseOperator from airflow.utils.decorators import apply_defaults class DataQualityOperator(BaseOperator): ui_color = '#89DA59' @apply_defaults def __init__(self, dq_checks=[], r...
[ "airflow.providers.postgres.hooks.postgres.PostgresHook" ]
[((710, 745), 'airflow.providers.postgres.hooks.postgres.PostgresHook', 'PostgresHook', (['self.redshift_conn_id'], {}), '(self.redshift_conn_id)\n', (722, 745), False, 'from airflow.providers.postgres.hooks.postgres import PostgresHook\n')]
# # This file made available under CC0 1.0 Universal (https://creativecommons.org/publicdomain/zero/1.0/legalcode) # # Ensure VPC Flow Logs is enabled. # Description: Checks that VPC Flow Logs is enabled at specific VPC # # Trigger Type: Change Triggered # Scope of Changes: EC2:VPC # Required Resource Identifier: VPC I...
[ "json.loads", "boto3.client" ]
[((667, 686), 'boto3.client', 'boto3.client', (['"""ec2"""'], {}), "('ec2')\n", (679, 686), False, 'import boto3\n'), ((1012, 1046), 'json.loads', 'json.loads', (["event['invokingEvent']"], {}), "(event['invokingEvent'])\n", (1022, 1046), False, 'import json\n'), ((1263, 1285), 'boto3.client', 'boto3.client', (['"""con...
from sklearn.manifold import TSNE from sklearn.decomposition import PCA from sklearn.datasets import load_iris, load_digits import matplotlib.pyplot as plt import os digits = load_digits() X_tsne = TSNE(n_components=2, random_state=33).fit_transform(digits.data) X_pca = PCA(n_components=2).fit_transform(digits.data) ...
[ "os.path.exists", "matplotlib.pyplot.savefig", "os.makedirs", "sklearn.decomposition.PCA", "sklearn.datasets.load_digits", "sklearn.manifold.TSNE", "matplotlib.pyplot.figure", "matplotlib.pyplot.scatter", "matplotlib.pyplot.subplot", "matplotlib.pyplot.legend", "matplotlib.pyplot.show" ]
[((176, 189), 'sklearn.datasets.load_digits', 'load_digits', ([], {}), '()\n', (187, 189), False, 'from sklearn.datasets import load_iris, load_digits\n'), ((400, 427), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(10, 5)'}), '(figsize=(10, 5))\n', (410, 427), True, 'import matplotlib.pyplot as plt\n'), ...
import enum from typing import Union @enum.unique class PriorityStatus(enum.Enum): HIGHEST = 0 HIGHER = 10 HIGH = 20 NORMAL = 30 LOW = 40 LOWER = 50 LOWEST = 60 class HookBase: """HookBase is the base class of all hook and is registered in EngineBase class. The subclasses of Hook...
[ "logging.getLogger" ]
[((1676, 1703), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1693, 1703), False, 'import logging\n')]
from typing import * import pprint from onmt.utils.report_manager import ReportMgrBase from onmt.utils.statistics import Statistics from seutil import LoggingUtils class CustomReportMgr(ReportMgrBase): logger = LoggingUtils.get_logger(__name__) def __init__(self, report_every, start_time=-1.): su...
[ "seutil.LoggingUtils.get_logger", "seutil.LoggingUtils.log_and_raise", "pprint.pformat" ]
[((221, 254), 'seutil.LoggingUtils.get_logger', 'LoggingUtils.get_logger', (['__name__'], {}), '(__name__)\n', (244, 254), False, 'from seutil import LoggingUtils\n'), ((1760, 1852), 'seutil.LoggingUtils.log_and_raise', 'LoggingUtils.log_and_raise', (['self.logger', 'f"""Cannot join two mismatch history!"""', 'Exceptio...
# MIT License # Copyright (c) 2018 <NAME> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish,...
[ "statistics.mean", "statistics.stdev", "collections.Counter", "statistics.variance" ]
[((1616, 1632), 'statistics.mean', 's.mean', (['branches'], {}), '(branches)\n', (1622, 1632), True, 'import statistics as s\n'), ((1685, 1702), 'statistics.stdev', 's.stdev', (['branches'], {}), '(branches)\n', (1692, 1702), True, 'import statistics as s\n'), ((1745, 1765), 'statistics.variance', 's.variance', (['bran...
# Generated by Django 3.0.10 on 2020-09-27 07:40 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('app', '0003_filefieldobject_name'), ] operations = [ migrations.AddField( model_name='imagefieldobject', name='name...
[ "django.db.models.CharField" ]
[((341, 406), 'django.db.models.CharField', 'models.CharField', ([], {'default': '""""""', 'max_length': '(128)', 'verbose_name': '"""name"""'}), "(default='', max_length=128, verbose_name='name')\n", (357, 406), False, 'from django.db import migrations, models\n')]
# Generated by Django 3.2.10 on 2022-01-11 14:16 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('rental', '0020_rental_listing_pets_allowed'), ] operations = [ migrations.CreateModel( name='PaymentMode', fields=[...
[ "django.db.models.DateTimeField", "django.db.models.FloatField", "django.db.models.CharField", "django.db.models.BigAutoField" ]
[((344, 440), 'django.db.models.BigAutoField', 'models.BigAutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (363, 440), False, 'from django.db import migrations, m...
# Copyright 2017 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...
[ "tensorflow.nn.bidirectional_dynamic_rnn", "tensorflow.pad", "tensorflow.shape", "tensorflow.transpose", "tensorflow.keras.backend.ctc_label_dense_to_sparse", "tensorflow.keras.backend.epsilon", "tensorflow.multiply", "six.moves.xrange", "tensorflow.nn.softmax", "tensorflow.reduce_mean", "tensor...
[((3526, 3700), 'tensorflow.layers.batch_normalization', 'tf.layers.batch_normalization', ([], {'inputs': 'inputs', 'momentum': 'DeepSpeech2Model.BATCH_NORM_DECAY', 'epsilon': 'DeepSpeech2Model.BATCH_NORM_EPSILON', 'fused': '(True)', 'training': 'training'}), '(inputs=inputs, momentum=DeepSpeech2Model.\n BATCH_NORM_...
"""Simple usage example of ask_first. <NAME> <<EMAIL>> Research School of Astronomy and Astrophysics The Australian National University 2018 """ import argparse import logging import ask_first parser = argparse.ArgumentParser() parser.add_argument('first_path', help='Path to FIRST data') parser.add_argument('-v', h...
[ "logging.basicConfig", "ask_first.read_paths", "argparse.ArgumentParser" ]
[((206, 231), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (229, 231), False, 'import argparse\n'), ((384, 517), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': '(logging.DEBUG if args.v else logging.WARNING)', 'format': '"""%(asctime)s-%(name)s-%(levelname)s: %(message)s"""'}), ...
#!/usr/bin/env python #-*- coding:utf-8 -*- #info:http://www.wooyun.org/bugs/wooyun-2015-0140998 import urlparse def assign(service, arg): if service == "netoray_nsg": arr = urlparse.urlparse(arg) return True, '%s://%s/' % (arr.scheme, arr.netloc) def audit(arg): url = arg + "...
[ "urlparse.urlparse" ]
[((192, 214), 'urlparse.urlparse', 'urlparse.urlparse', (['arg'], {}), '(arg)\n', (209, 214), False, 'import urlparse\n')]
import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from sklearn.pipeline import Pipeline from sklearn.ensemble import ExtraTreesClassifier from sklearn.preprocessing import StandardScaler, Imputer from wakeful import log_munger, pipelining, preprocessing def get_feature_impor...
[ "matplotlib.pyplot.grid", "sklearn.ensemble.ExtraTreesClassifier", "matplotlib.pyplot.ylabel", "numpy.argsort", "matplotlib.pyplot.style.context", "wakeful.preprocessing.split_X_y", "seaborn.despine", "seaborn.color_palette", "wakeful.log_munger.hdf5_to_df", "matplotlib.pyplot.barh", "matplotlib...
[((346, 368), 'sklearn.ensemble.ExtraTreesClassifier', 'ExtraTreesClassifier', ([], {}), '()\n', (366, 368), False, 'from sklearn.ensemble import ExtraTreesClassifier\n'), ((593, 626), 'wakeful.preprocessing.split_X_y', 'preprocessing.split_X_y', (['train_df'], {}), '(train_df)\n', (616, 626), False, 'from wakeful impo...
# Copyright (c) 2015, Dataent Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals import dataent from dataent.website.utils import get_full_index def get_context(context): context.full_index = get_full_index()
[ "dataent.website.utils.get_full_index" ]
[((242, 258), 'dataent.website.utils.get_full_index', 'get_full_index', ([], {}), '()\n', (256, 258), False, 'from dataent.website.utils import get_full_index\n')]
#!/usr/bin/env python """Test the use of flags when from __future__ import unicode_literals is on.""" from __future__ import unicode_literals import unittest import gflags gflags.DEFINE_string('seen_in_crittenden', 'alleged mountain lion', 'This tests if unicode input to these functions works.')...
[ "unittest.main", "gflags.DEFINE_string" ]
[((176, 304), 'gflags.DEFINE_string', 'gflags.DEFINE_string', (['"""seen_in_crittenden"""', '"""alleged mountain lion"""', '"""This tests if unicode input to these functions works."""'], {}), "('seen_in_crittenden', 'alleged mountain lion',\n 'This tests if unicode input to these functions works.')\n", (196, 304), F...
# Generated by Django 4.0.2 on 2022-03-27 10:02 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('tracker', '0004_alter_me...
[ "django.db.models.ForeignKey", "django.db.migrations.swappable_dependency", "django.db.models.BigAutoField", "django.db.models.BooleanField" ]
[((227, 284), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (258, 284), False, 'from django.db import migrations, models\n'), ((529, 625), 'django.db.models.BigAutoField', 'models.BigAutoField', ([], {'auto_created': '...
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import unittest from telemetry.internal.platform.tracing_agent import chrome_tracing_agent class FakePlatformBackend(object): pass class FakeDevtoolsC...
[ "telemetry.internal.platform.tracing_agent.chrome_tracing_agent.ChromeTracingAgent.IsSupported", "telemetry.internal.platform.tracing_agent.chrome_tracing_agent.ChromeTracingAgent.RegisterDevToolsClient", "telemetry.internal.platform.tracing_agent.chrome_tracing_agent.ChromeTracingAgent" ]
[((1353, 1422), 'telemetry.internal.platform.tracing_agent.chrome_tracing_agent.ChromeTracingAgent.IsSupported', 'chrome_tracing_agent.ChromeTracingAgent.IsSupported', (['platform_backend'], {}), '(platform_backend)\n', (1404, 1422), False, 'from telemetry.internal.platform.tracing_agent import chrome_tracing_agent\n')...
from RecoTauTag.RecoTau.pfRecoTauProducerDef_cfi import pfRecoTauProducerDef pfRecoTauProducer = pfRecoTauProducerDef.clone()
[ "RecoTauTag.RecoTau.pfRecoTauProducerDef_cfi.pfRecoTauProducerDef.clone" ]
[((98, 126), 'RecoTauTag.RecoTau.pfRecoTauProducerDef_cfi.pfRecoTauProducerDef.clone', 'pfRecoTauProducerDef.clone', ([], {}), '()\n', (124, 126), False, 'from RecoTauTag.RecoTau.pfRecoTauProducerDef_cfi import pfRecoTauProducerDef\n')]
import unittest from core_lib.data_layers.data.data_helpers import build_url class TestBuildUrl(unittest.TestCase): def test_build_url(self): self.assertEqual(build_url(host="some_domain.com"), "some_domain.com") self.assertEqual(build_url(protocol="http", host="some_domain.com"), "http://some_d...
[ "core_lib.data_layers.data.data_helpers.build_url" ]
[((175, 208), 'core_lib.data_layers.data.data_helpers.build_url', 'build_url', ([], {'host': '"""some_domain.com"""'}), "(host='some_domain.com')\n", (184, 208), False, 'from core_lib.data_layers.data.data_helpers import build_url\n'), ((254, 304), 'core_lib.data_layers.data.data_helpers.build_url', 'build_url', ([], {...
import sys # for sys.argv import numpy # NumPy math library # Sigmoid function (S-curve), and its derivative def sigmoid(x, deriv): if(deriv == True): return x * (1 - x) return 1 / (1 + numpy.exp(-x)) # Implementation of a simple neural network with configurable input size, output size, number of lay...
[ "numpy.random.random", "numpy.exp", "numpy.array", "numpy.dot", "numpy.random.seed" ]
[((3244, 3301), 'numpy.array', 'numpy.array', (['[[0, 0, 1], [0, 1, 1], [1, 0, 1], [1, 1, 1]]'], {}), '([[0, 0, 1], [0, 1, 1], [1, 0, 1], [1, 1, 1]])\n', (3255, 3301), False, 'import numpy\n'), ((3462, 3495), 'numpy.array', 'numpy.array', (['[[0], [1], [1], [0]]'], {}), '([[0], [1], [1], [0]])\n', (3473, 3495), False, ...
#!/usr/bin/python3 # -*- coding: utf-8 -*- import sys from os import sep import asyncio from http.client import HTTPConnection from contextlib import closing from urllib.parse import urlparse from bs4 import BeautifulSoup from timeit import timeit class FileSystemWriter: def __init__(self, filename): ...
[ "urllib.parse.urlparse", "asyncio.coroutine", "http.client.HTTPConnection", "bs4.BeautifulSoup", "timeit.timeit", "asyncio.get_event_loop" ]
[((1009, 1022), 'urllib.parse.urlparse', 'urlparse', (['uri'], {}), '(uri)\n', (1017, 1022), False, 'from urllib.parse import urlparse\n'), ((2218, 2256), 'bs4.BeautifulSoup', 'BeautifulSoup', (['html_doc', '"""html.parser"""'], {}), "(html_doc, 'html.parser')\n", (2231, 2256), False, 'from bs4 import BeautifulSoup\n')...
#!/usr/bin/env python # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo # Copyright (C) 2015-2020 German Aerospace Center (DLR) and others. # This program and the accompanying materials are made available under the # terms of the Eclipse Public License 2.0 which is available at # https://www.ec...
[ "os.path.getmtime", "os.path.dirname", "os.path.exists", "os.path.join" ]
[((1588, 1605), 'os.path.dirname', 'dirname', (['__file__'], {}), '(__file__)\n', (1595, 1605), False, 'from os.path import dirname, exists, getmtime, join\n'), ((1724, 1761), 'os.path.join', 'join', (['typemapDataDir', '(format + suffix)'], {}), '(typemapDataDir, format + suffix)\n', (1728, 1761), False, 'from os.path...
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- import sys import unittest def thresh(value): return (6 * (value + 100) / 50) class Box: def __init__(self): ''' Box: ''' self.ls = [] def add(self, value, tm=None): ''' Box: Dodaj kolejną wartość do...
[ "unittest.main" ]
[((3229, 3261), 'unittest.main', 'unittest.main', ([], {'argv': 'sys.argv[:1]'}), '(argv=sys.argv[:1])\n', (3242, 3261), False, 'import unittest\n')]
import asyncio import pytest @pytest.fixture(scope="module") def loop(): loop = asyncio.get_event_loop() yield loop loop.close()
[ "pytest.fixture", "asyncio.get_event_loop" ]
[((32, 62), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (46, 62), False, 'import pytest\n'), ((86, 110), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (108, 110), False, 'import asyncio\n')]
from django.dispatch import Signal task_cleanup_signal = Signal(providing_args=['apiview', 'result', 'task_id', 'status', 'obj'])
[ "django.dispatch.Signal" ]
[((58, 130), 'django.dispatch.Signal', 'Signal', ([], {'providing_args': "['apiview', 'result', 'task_id', 'status', 'obj']"}), "(providing_args=['apiview', 'result', 'task_id', 'status', 'obj'])\n", (64, 130), False, 'from django.dispatch import Signal\n')]
import requests import socket from urllib.parse import unquote_plus as urllib_unquote_plus from urllib.error import HTTPError, URLError HEADERS = { 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36' } def get_content_from_url...
[ "urllib.parse.unquote_plus", "requests.get" ]
[((409, 454), 'requests.get', 'requests.get', (['url'], {'headers': 'headers', 'timeout': '(5)'}), '(url, headers=headers, timeout=5)\n', (421, 454), False, 'import requests\n'), ((337, 361), 'urllib.parse.unquote_plus', 'urllib_unquote_plus', (['url'], {}), '(url)\n', (356, 361), True, 'from urllib.parse import unquot...
import os import shutil import tests class TestGithubApp(tests.GithubMix, tests.AgileTest): async def test_bad_task(self): agile = await self.executor(["badtask"]) self.assertEqual(agile.cfg.tasks, ["badtask"]) self.assertEqual(await agile.run(), 2) async def __test_release_notes(se...
[ "os.path.isfile", "os.remove", "os.path.isdir", "shutil.rmtree" ]
[((777, 807), 'os.path.isdir', 'os.path.isdir', (['"""tests/history"""'], {}), "('tests/history')\n", (790, 807), False, 'import os\n'), ((871, 909), 'os.path.isfile', 'os.path.isfile', (['"""test_release_note.md"""'], {}), "('test_release_note.md')\n", (885, 909), False, 'import os\n'), ((533, 571), 'os.path.isfile', ...
from datetime import date from decimal import Decimal from openroboadvisor.ledger import Ledger from openroboadvisor.ledger.account import AccountType from openroboadvisor.ledger.asset import Currency, Security from openroboadvisor.ledger.entry import OpenAccount from openroboadvisor.portfolio.account import Account, E...
[ "openroboadvisor.portfolio.account.Account", "openroboadvisor.ledger.asset.Security", "openroboadvisor.ledger.asset.Currency", "openroboadvisor.ledger.Ledger", "pytest.raises", "datetime.date", "decimal.Decimal" ]
[((454, 462), 'openroboadvisor.ledger.Ledger', 'Ledger', ([], {}), '()\n', (460, 462), False, 'from openroboadvisor.ledger import Ledger\n'), ((477, 522), 'openroboadvisor.portfolio.account.Account', 'Account', ([], {'account_id': 'account_id', 'ledger': 'ledger'}), '(account_id=account_id, ledger=ledger)\n', (484, 522...
from datetime import datetime from django.test import TestCase from reports.models import Report from reports.runtests.example.models import Organization class ReportModelTestCase(TestCase): def test_generate_document(self): start = datetime(2017, 1, 1, 12, 33) end = datetime(2017, 1, 2, 12, 33)...
[ "datetime.datetime", "reports.models.Report.objects.get", "reports.models.Report.objects.create", "reports.runtests.example.models.Organization.objects.create" ]
[((249, 277), 'datetime.datetime', 'datetime', (['(2017)', '(1)', '(1)', '(12)', '(33)'], {}), '(2017, 1, 1, 12, 33)\n', (257, 277), False, 'from datetime import datetime\n'), ((292, 320), 'datetime.datetime', 'datetime', (['(2017)', '(1)', '(2)', '(12)', '(33)'], {}), '(2017, 1, 2, 12, 33)\n', (300, 320), False, 'from...
import time import sys class ProductCrawler(): def __get_proxy__(self): from selenium import webdriver co = webdriver.ChromeOptions() co.add_argument("log-level=3") co.add_argument("--headless") driver = webdriver.Chrome('./chromedriver', options=co) driver.get...
[ "selenium.webdriver.ChromeOptions", "scrapy.http.TextResponse", "selenium.webdriver.Chrome", "pickle.load", "requests.get", "time.sleep", "fake_useragent.UserAgent" ]
[((135, 160), 'selenium.webdriver.ChromeOptions', 'webdriver.ChromeOptions', ([], {}), '()\n', (158, 160), False, 'from selenium import webdriver\n'), ((255, 301), 'selenium.webdriver.Chrome', 'webdriver.Chrome', (['"""./chromedriver"""'], {'options': 'co'}), "('./chromedriver', options=co)\n", (271, 301), False, 'from...
''' Aggregate experiment data - Experiment: AvidaGP L9 SUMMARY FILES - experiment - config + summary(evaluation) + systematics + summary(world summary) - world - task ''' import argparse, os, sys, errno, csv, json from scipy.stats import entropy run_identifier = "RUN_" # String that identifies a run directory d...
[ "os.path.exists", "json.loads", "os.listdir", "scipy.stats.entropy", "os.makedirs", "argparse.ArgumentParser", "os.path.join", "csv.reader" ]
[((1287, 1348), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Run submission script."""'}), "(description='Run submission script.')\n", (1310, 1348), False, 'import argparse, os, sys, errno, csv, json\n'), ((2300, 2341), 'os.makedirs', 'os.makedirs', ([], {'name': 'dump_dir', 'exist_ok'...
import logging import numpy as np from plunc.exceptions import InsufficientPrecisionError, OutsideDomainError class WaryInterpolator(object): """Interpolate (and optionally extrapolation) between points, raising exception if error larger than desired precision """ def __init__(self, ...
[ "logging.getLogger", "plunc.exceptions.InsufficientPrecisionError", "numpy.log10", "numpy.searchsorted", "matplotlib.pyplot.plot", "numpy.max", "numpy.argsort", "numpy.array", "numpy.concatenate", "numpy.min", "numpy.nonzero", "numpy.logspace" ]
[((1013, 1050), 'logging.getLogger', 'logging.getLogger', (['"""WaryInterpolator"""'], {}), "('WaryInterpolator')\n", (1030, 1050), False, 'import logging\n'), ((1074, 1090), 'numpy.array', 'np.array', (['points'], {}), '(points)\n', (1082, 1090), True, 'import numpy as np\n'), ((1113, 1129), 'numpy.array', 'np.array',...
#!/usr/bin/env python3 import numpy as np import tensorflow as tf import cart_pole_evaluator class Network: def __init__(self, env, args): inputs = tf.keras.layers.Input(shape=env.state_shape) for i in range(args.hidden_layers): if i == 0: x_common = tf.keras.layers.D...
[ "tensorflow.keras.layers.Input", "tensorflow.config.threading.set_intra_op_parallelism_threads", "tensorflow.random.set_seed", "argparse.ArgumentParser", "tensorflow.keras.losses.MeanSquaredError", "tensorflow.keras.losses.SparseCategoricalCrossentropy", "numpy.argmax", "tensorflow.keras.optimizers.Ad...
[((3147, 3172), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (3170, 3172), False, 'import argparse\n'), ((4101, 4119), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (4115, 4119), True, 'import numpy as np\n'), ((4124, 4146), 'tensorflow.random.set_seed', 'tf.random.set_seed...
import logging import numpy as np logger = logging.getLogger("FederatedAveraging") class DefaultFederatedAveraging: def __init__(self, buflength=5): self.buflength = buflength def __call__(self, metadata, weights, weight_buffer): logger.debug("Federated avg: call with buffer length %s", len...
[ "logging.getLogger", "numpy.array" ]
[((45, 84), 'logging.getLogger', 'logging.getLogger', (['"""FederatedAveraging"""'], {}), "('FederatedAveraging')\n", (62, 84), False, 'import logging\n'), ((651, 662), 'numpy.array', 'np.array', (['w'], {}), '(w)\n', (659, 662), True, 'import numpy as np\n'), ((1043, 1054), 'numpy.array', 'np.array', (['w'], {}), '(w)...
from django.contrib.auth import get_user_model from rest_framework import filters from rest_framework.viewsets import ModelViewSet from pastebin.users.permissions import IsAuthenticatedOrCreate from pastebin.users.serializers import UserSerializer User = get_user_model() class UsersViewSet(ModelViewSet): querys...
[ "django.contrib.auth.get_user_model" ]
[((257, 273), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (271, 273), False, 'from django.contrib.auth import get_user_model\n')]