code
stringlengths
22
1.05M
apis
listlengths
1
3.31k
extract_api
stringlengths
75
3.25M
# -*- coding: utf-8 -*- import sys sys.path.append('../') import argparse import pickle import random from data_split.util import * from data_util.reader import * from data_util.schema import * def ensure_dir(file_path): directory = os.path.dirname(file_path) if not os.path.exists(directory): os.ma...
[ "random.sample", "random.shuffle", "argparse.ArgumentParser", "pickle.load", "sys.path.append" ]
[((36, 58), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (51, 58), False, 'import sys\n'), ((9518, 9557), 'random.sample', 'random.sample', (['all_instances', 'threshold'], {}), '(all_instances, threshold)\n', (9531, 9557), False, 'import random\n'), ((15880, 15915), 'random.sample', 'random....
import numpy as np from keras.layers import * from keras.models import * from keras.activations import * from keras.callbacks import ModelCheckpoint,ReduceLROnPlateau def keras_model(): model=Sequential() model.add(Conv2D(32,(3,3),padding="same")) model.add(Conv2D(32,(3,3),padding="same")) mo...
[ "keras.callbacks.ModelCheckpoint", "sklearn.model_selection.train_test_split", "keras.callbacks.ReduceLROnPlateau", "numpy.append", "numpy.load" ]
[((1030, 1059), 'numpy.load', 'np.load', (['"""features_40x40.npy"""'], {}), "('features_40x40.npy')\n", (1037, 1059), True, 'import numpy as np\n'), ((1068, 1095), 'numpy.load', 'np.load', (['"""labels_40x40.npy"""'], {}), "('labels_40x40.npy')\n", (1075, 1095), True, 'import numpy as np\n'), ((1125, 1174), 'numpy.app...
import os from pathlib import Path from pytest import fixture @fixture(autouse=True, scope='session') def chdir() -> None: os.chdir(Path(__file__).parent)
[ "pytest.fixture", "pathlib.Path" ]
[((66, 104), 'pytest.fixture', 'fixture', ([], {'autouse': '(True)', 'scope': '"""session"""'}), "(autouse=True, scope='session')\n", (73, 104), False, 'from pytest import fixture\n'), ((139, 153), 'pathlib.Path', 'Path', (['__file__'], {}), '(__file__)\n', (143, 153), False, 'from pathlib import Path\n')]
#encoding=utf8 import time import numpy as np import tensorflow as tf from tensorflow.contrib import crf import cws.BiLSTM as modelDef from cws.data import Data tf.app.flags.DEFINE_string('dict_path', 'data/your_dict.pkl', 'dict path') tf.app.flags.DEFINE_string('train_data', 'data/your_train_data.pkl', 'tr...
[ "tensorflow.app.flags.DEFINE_float", "cws.data.Data", "tensorflow.app.flags.DEFINE_integer", "tensorflow.Session", "tensorflow.train.Saver", "tensorflow.app.flags.DEFINE_string", "numpy.equal", "tensorflow.global_variables_initializer", "tensorflow.ConfigProto", "tensorflow.contrib.crf.viterbi_dec...
[((172, 246), 'tensorflow.app.flags.DEFINE_string', 'tf.app.flags.DEFINE_string', (['"""dict_path"""', '"""data/your_dict.pkl"""', '"""dict path"""'], {}), "('dict_path', 'data/your_dict.pkl', 'dict path')\n", (198, 246), True, 'import tensorflow as tf\n'), ((248, 339), 'tensorflow.app.flags.DEFINE_string', 'tf.app.fla...
from stream import Stream from error_handler import none, eof, expected EOL = ';' class Parser: def __init__(self, tokens, end): self.tokens = tokens self.end = end def get_expression(self, prev): if self.error(self.end): return none key, value = self.tokens.next if key in self.end: return prev s...
[ "error_handler.eof", "error_handler.expected", "stream.Stream" ]
[((2279, 2293), 'stream.Stream', 'Stream', (['tokens'], {}), '(tokens)\n', (2285, 2293), False, 'from stream import Stream\n'), ((2195, 2211), 'error_handler.eof', 'eof', (['looking_for'], {}), '(looking_for)\n', (2198, 2211), False, 'from error_handler import none, eof, expected\n'), ((874, 905), 'error_handler.expect...
import os import shutil import subprocess import shlex import logging import jinja2 from .config import Config from .files import file_class_for_path, ErrorFile from .jinja import default_extensions, default_filters from .jinja.exceptions import ReservedVariableError from .exceptions import BuildError from .checks.fa...
[ "logging.getLogger", "os.path.exists", "shlex.split", "os.path.join", "jinja2.ChoiceLoader", "os.getcwd", "jinja2.select_autoescape", "os.mkdir", "os.path.commonpath", "shutil.rmtree", "os.path.abspath", "jinja2.FileSystemLoader", "os.walk", "os.path.relpath" ]
[((391, 418), 'logging.getLogger', 'logging.getLogger', (['__file__'], {}), '(__file__)\n', (408, 418), False, 'import logging\n'), ((1993, 2025), 'os.path.exists', 'os.path.exists', (['self.output_path'], {}), '(self.output_path)\n', (2007, 2025), False, 'import os\n'), ((5402, 5422), 'os.path.exists', 'os.path.exists...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # proto_datetime.py import logging import datetime from DateTime.python.DateTime_pb2 import DateTime def create_proto_datetime(datetime_value: datetime.datetime = None): """ Create a protobuf message filled with the current or given timedate :param datetime_...
[ "datetime.datetime", "datetime.datetime.now", "DateTime.python.DateTime_pb2.DateTime", "logging.exception" ]
[((497, 507), 'DateTime.python.DateTime_pb2.DateTime', 'DateTime', ([], {}), '()\n', (505, 507), False, 'from DateTime.python.DateTime_pb2 import DateTime\n'), ((1318, 1344), 'datetime.datetime', 'datetime.datetime', (['(1)', '(1)', '(1)'], {}), '(1, 1, 1)\n', (1335, 1344), False, 'import datetime\n'), ((1719, 1729), '...
from datetime import datetime, timedelta from auth import * from edit import video_length_seconds, get_total_length, change_fps, is_copyright, merge_videos from upload_video import * from random import randrange import os # if __name__ == '__main__' auth = createAuthObject() def get_clips_by_cat(daysdiff, category)...
[ "edit.merge_videos", "datetime.datetime.utcnow", "random.randrange", "edit.get_total_length", "edit.is_copyright", "os.system", "datetime.timedelta", "os.remove" ]
[((5314, 5339), 'os.system', 'os.system', (['"""shutdown now"""'], {}), "('shutdown now')\n", (5323, 5339), False, 'import os\n'), ((758, 775), 'datetime.datetime.utcnow', 'datetime.utcnow', ([], {}), '()\n', (773, 775), False, 'from datetime import datetime, timedelta\n'), ((2016, 2047), 'os.remove', 'os.remove', (['f...
# Copyright 2017 Google Inc. 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 applicable law or a...
[ "prometheus_client.core.REGISTRY.register", "buildtool.util.add_parser_argument", "prometheus_client.core.CounterMetricFamily", "prometheus_client.exposition.push_to_gateway" ]
[((5200, 5343), 'buildtool.util.add_parser_argument', 'add_parser_argument', (['parser', '"""prometheus_gateway_netloc"""', 'defaults', '"""localhost:9091"""'], {'help': '"""Location of the prometheus gateway to push to."""'}), "(parser, 'prometheus_gateway_netloc', defaults,\n 'localhost:9091', help='Location of th...
import pyvista import vtk import numpy as np # grid = pyvista.UniformGrid() # vtkgrid = vtk.vtkImageData() grid = pyvista.UniformGrid(vtkgrid) # dims = (10, 10, 10) grid = pyvista.UniformGrid(dims) # spacing = (2, 1, 5) grid = pyvista.UniformGrid(dims, spacing) # origin = (10, 35, 50) grid = pyvista.UniformGrid(dims, s...
[ "vtk.vtkImageData", "pyvista.UniformGrid" ]
[((54, 75), 'pyvista.UniformGrid', 'pyvista.UniformGrid', ([], {}), '()\n', (73, 75), False, 'import pyvista\n'), ((88, 106), 'vtk.vtkImageData', 'vtk.vtkImageData', ([], {}), '()\n', (104, 106), False, 'import vtk\n'), ((114, 142), 'pyvista.UniformGrid', 'pyvista.UniformGrid', (['vtkgrid'], {}), '(vtkgrid)\n', (133, 1...
#!/usr/bin/python3 import os from pathlib import Path from pwd import getpwnam from clic import pssh import configparser config = configparser.ConfigParser() config.read('/etc/clic/clic.conf') user = config['Daemon']['user'] def init(host, cpus, disk, mem, user=user): # Copy executables in /etc/clic/ to node and ...
[ "configparser.ConfigParser", "argparse.ArgumentParser", "pathlib.Path" ]
[((131, 158), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (156, 158), False, 'import configparser\n'), ((773, 936), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Intitialize a node for use with clic by configuring its /etc/hosts and nfs. This script is ru...
from flask_wtf import FlaskForm from wtforms import StringField, PasswordField, SubmitField, TextAreaField, IntegerField from wtforms.validators import DataRequired, EqualTo, ValidationError, Length from app.models import Barber class NewBarberForm(FlaskForm): first_name = StringField('First Name', validators=[Da...
[ "app.models.Barber.query.filter_by", "wtforms.validators.ValidationError", "wtforms.SubmitField", "wtforms.validators.EqualTo", "wtforms.validators.Length", "wtforms.validators.DataRequired" ]
[((655, 680), 'wtforms.SubmitField', 'SubmitField', (['"""Add barber"""'], {}), "('Add barber')\n", (666, 680), False, 'from wtforms import StringField, PasswordField, SubmitField, TextAreaField, IntegerField\n'), ((1250, 1276), 'wtforms.SubmitField', 'SubmitField', (['"""Add service"""'], {}), "('Add service')\n", (12...
import os import sys import tkinter as tk from configparser import ConfigParser from tkinter import filedialog # for Python 3 from tkinter import messagebox from config.Dialogs import Dialogs from UI.helpers.open_folder import open_folder # https://stackoverflow.com/questions/31170616/how-to-access-a-method-in-one-...
[ "tkinter.Menu", "os.path.exists", "config.Dialogs.Dialogs", "os.path.isdir", "tkinter.Menu.__init__", "os.mkdir", "sys.exit", "tkinter.messagebox.showinfo" ]
[((443, 473), 'tkinter.Menu.__init__', 'tk.Menu.__init__', (['self', 'parent'], {}), '(self, parent)\n', (459, 473), True, 'import tkinter as tk\n'), ((525, 534), 'config.Dialogs.Dialogs', 'Dialogs', ([], {}), '()\n', (532, 534), False, 'from config.Dialogs import Dialogs\n'), ((556, 586), 'tkinter.Menu', 'tk.Menu', ([...
"""Network serialization configuration.""" from __future__ import annotations from functools import partialmethod from itertools import chain from tsim.core.entity import EntityRef from tsim.core.network.intersection import ConflictPoint, Curve, Intersection from tsim.core.network.lane import Lane, LaneSegment from ...
[ "tsim.core.entity.EntityRef", "tsim.utils.linkedlist.LinkedList", "functools.partialmethod" ]
[((890, 938), 'functools.partialmethod', 'partialmethod', (['pickling.getstate'], {'add_dict': '(False)'}), '(pickling.getstate, add_dict=False)\n', (903, 938), False, 'from functools import partialmethod\n'), ((970, 1018), 'functools.partialmethod', 'partialmethod', (['pickling.setstate'], {'add_dict': '(False)'}), '(...
import time from typing import Dict, List, Optional from urllib.parse import urlencode from requests.utils import dict_from_cookiejar from requests_toolbelt import MultipartEncoder from utils.encrypt_utils import md5_str from utils.logger_utils import LogManager from utils.str_utils import check_is_json from captcha....
[ "utils.time_utils.timestamp_to_datetime_str", "utils.js_utils.compile_js", "utils.str_utils.check_is_json", "utils.encrypt_utils.md5_str", "utils.image_utils.image_base64_to_pillow", "utils.exception_utils.LoginException", "time.sleep", "utils.encrypt_utils.hmac_encrypt_sha1", "utils.time_utils.date...
[((819, 839), 'utils.logger_utils.LogManager', 'LogManager', (['__name__'], {}), '(__name__)\n', (829, 839), False, 'from utils.logger_utils import LogManager\n'), ((11802, 11840), 'utils.js_utils.compile_js', 'compile_js', ([], {'js_str': 'zhihu_zse86_js_code'}), '(js_str=zhihu_zse86_js_code)\n', (11812, 11840), False...
# Generated by Django 2.2.7 on 2020-02-14 10:43 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('komax_app', '0001_initial'), ] operations = [ migrations.AddField( model_name='komax', name='group_of_square', ...
[ "django.db.models.CharField" ]
[((333, 380), 'django.db.models.CharField', 'models.CharField', ([], {'default': '"""1 2 3"""', 'max_length': '(6)'}), "(default='1 2 3', max_length=6)\n", (349, 380), False, 'from django.db import migrations, models\n')]
from django.views.generic import TemplateView import logging log = logging.getLogger(__name__) class Base(TemplateView): template_name = 'base.html'
[ "logging.getLogger" ]
[((69, 96), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (86, 96), False, 'import logging\n')]
import pyowm token = '88983f82566dea8294a9d3e3fb479918' language = 'ru' owm = pyowm.OWM(API_key = token, language = language) def city_temp(): city = input('Введите название города: ') try: observation = owm.weather_at_place(city) except pyowm.exceptions.api_response_error.NotFoundError: p...
[ "pyowm.OWM" ]
[((79, 122), 'pyowm.OWM', 'pyowm.OWM', ([], {'API_key': 'token', 'language': 'language'}), '(API_key=token, language=language)\n', (88, 122), False, 'import pyowm\n')]
DESCRIPTION = """ This script will look at all the csvs in 'inputs' Gets all 'to-read' books Outputs their availability into 'outputs' """ import argparse import os import logging logger = logging.Logger("Main Logger") from pathlib import Path from dotenv import load_dotenv from nlbsg import Client from nlbsg.catalo...
[ "utils.nlb_checker.NlbChecker", "argparse.ArgumentParser", "pathlib.Path", "os.environ.get", "nlbsg.Client", "dotenv.load_dotenv", "logging.Logger" ]
[((191, 220), 'logging.Logger', 'logging.Logger', (['"""Main Logger"""'], {}), "('Main Logger')\n", (205, 220), False, 'import logging\n'), ((429, 477), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': 'DESCRIPTION'}), '(description=DESCRIPTION)\n', (452, 477), False, 'import argparse\n'), ((9...
# Generated by Django 2.2.12 on 2021-02-02 06:53 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('accounts', '0003_auto_20210202_0503'), ] operations = [ migrations.AddField( model_name='account', name='email', ...
[ "django.db.models.CharField" ]
[((336, 399), 'django.db.models.CharField', 'models.CharField', ([], {'default': '"""NEED TO FORMAT EMAIL"""', 'max_length': '(42)'}), "(default='NEED TO FORMAT EMAIL', max_length=42)\n", (352, 399), False, 'from django.db import migrations, models\n'), ((518, 565), 'django.db.models.CharField', 'models.CharField', ([]...
""" Implements MissSVM """ from __future__ import print_function, division import numpy as np import scipy.sparse as sp from random import uniform import inspect from misvm.quadprog import IterativeQP, Objective from misvm.util import BagSplitter, spdiag, slices from misvm.kernel import by_name as kernel_by_name from m...
[ "misvm.quadprog.IterativeQP", "numpy.hstack", "numpy.asmatrix", "numpy.multiply", "misvm.util.spdiag", "misvm.quadprog.Objective", "scipy.sparse.eye", "numpy.vstack", "misvm.mica.MICA", "scipy.sparse.coo_matrix", "misvm.util.slices", "misvm.kernel.by_name", "random.uniform", "numpy.ones", ...
[((2143, 2231), 'numpy.vstack', 'np.vstack', (['[bs.pos_instances, bs.pos_instances, bs.pos_instances, bs.neg_instances]'], {}), '([bs.pos_instances, bs.pos_instances, bs.pos_instances, bs.\n neg_instances])\n', (2152, 2231), True, 'import numpy as np\n'), ((2909, 2924), 'misvm.util.spdiag', 'spdiag', (['self._y'], ...
# -*- coding: utf-8 -*- """ Created on Mon Oct 3 21:28:05 2016 @author: thasegawa """ import logging # ============================================================================ class VehicleCounter(object): def __init__(self, shape, divider): self.log = logging.getLogger("vehicle_counter") ...
[ "logging.getLogger" ]
[((274, 310), 'logging.getLogger', 'logging.getLogger', (['"""vehicle_counter"""'], {}), "('vehicle_counter')\n", (291, 310), False, 'import logging\n')]
import json import datetime import muffin from bson import ObjectId from aiohttp.web import json_response from motor.motor_asyncio import AsyncIOMotorClient from functools import partial from umongo import Instance, Document, fields, ValidationError, set_gettext from umongo.marshmallow_bonus import SchemaFromUmongo i...
[ "logging.basicConfig", "aiohttp.web.run_app", "datetime.datetime", "muffin.Application", "json.JSONEncoder.default", "motor.motor_asyncio.AsyncIOMotorClient", "umongo.set_gettext", "asyncio.get_event_loop", "umongo.Instance", "functools.partial", "aiohttp.web.json_response", "bson.ObjectId", ...
[((334, 374), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG'}), '(level=logging.DEBUG)\n', (353, 374), False, 'import logging\n'), ((383, 480), 'muffin.Application', 'muffin.Application', (['__name__'], {'PLUGINS': "('muffin_babel',)", 'BABEL_LOCALES_DIRS': "['translations']"}), "(__name__...
from bluebed import download from bluebed import storage import xmlrpc.client def connect(): url = "http://deepblue.mpi-inf.mpg.de/xmlrpc" user_key = "anonymous_key" server = xmlrpc.client.Server(url, allow_none=True, encoding='UTF-8') return user_key, server def get_t_cell_dhs(server, user_key): ...
[ "bluebed.download.experiment_metadata", "bluebed.download.experiment", "bluebed.storage.ensure_out_dir", "bluebed.storage.write_bed_and_meta" ]
[((1123, 1177), 'bluebed.download.experiment_metadata', 'download.experiment_metadata', (['exp_id', 'user_key', 'server'], {}), '(exp_id, user_key, server)\n', (1151, 1177), False, 'from bluebed import download\n'), ((1387, 1432), 'bluebed.download.experiment', 'download.experiment', (['exp_id', 'user_key', 'server'], ...
# Copyright 2014 SolidBuilds.com. All rights reserved # # Authors: <NAME> <<EMAIL>> from flask import Blueprint, redirect, render_template from flask import request, url_for from flask_user import current_user, login_required, roles_required from app import db from app.models.user_models import UserProfileForm boo...
[ "flask.render_template", "flask_user.roles_required", "flask.url_for", "app.db.engine.execute", "flask.Blueprint" ]
[((334, 391), 'flask.Blueprint', 'Blueprint', (['"""books"""', '__name__'], {'template_folder': '"""templates"""'}), "('books', __name__, template_folder='templates')\n", (343, 391), False, 'from flask import Blueprint, redirect, render_template\n'), ((993, 1016), 'flask_user.roles_required', 'roles_required', (['"""ad...
import numpy as np def trapezoidal_rule(f, a, b, tol=1e-8): """ The trapezoidal rule is known to be very accurate for oscillatory integrals integrated over their period. See papers on spectral integration (it's just the composite trapezoidal rule....) TODO (aaron): f is memoized to get the alrea...
[ "numpy.real", "numpy.linspace", "numpy.imag" ]
[((599, 617), 'numpy.real', 'np.real', (['delta_res'], {}), '(delta_res)\n', (606, 617), True, 'import numpy as np\n'), ((639, 657), 'numpy.imag', 'np.imag', (['delta_res'], {}), '(delta_res)\n', (646, 657), True, 'import numpy as np\n'), ((778, 804), 'numpy.linspace', 'np.linspace', (['a', 'b'], {'num': 'num'}), '(a, ...
from faunadb import query as q from shop.fauna.client import FaunaClient def get_orders(secret, after=None, before=None, size=5): client = FaunaClient(secret=secret) return client.query( q.map_( lambda ref: q.get(ref), q.paginate(q.documents(q.collection('orders')), size=size, ...
[ "faunadb.query.now", "shop.fauna.client.FaunaClient", "faunadb.query.collection", "faunadb.query.get", "faunadb.query.var" ]
[((145, 171), 'shop.fauna.client.FaunaClient', 'FaunaClient', ([], {'secret': 'secret'}), '(secret=secret)\n', (156, 171), False, 'from shop.fauna.client import FaunaClient\n'), ((413, 439), 'shop.fauna.client.FaunaClient', 'FaunaClient', ([], {'secret': 'secret'}), '(secret=secret)\n', (424, 439), False, 'from shop.fa...
""" January 13th 2020 Author T.Mizumoto """ #! python 3 # ver.x1.00 # Integral-Scale_function.py - this program calculate integral-scale and correlation. import numpy as np from scipy.integrate import simps from scipy.stats import pearsonr import pandas as pd # index_basepoint = 0 (defult) def fun_Cros...
[ "numpy.where", "scipy.integrate.simps", "graph.Graph", "scipy.stats.pearsonr", "pandas.DataFrame", "numpy.loadtxt" ]
[((660, 712), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': "['CrossCorrelation', 'Pvalue']"}), "(columns=['CrossCorrelation', 'Pvalue'])\n", (672, 712), True, 'import pandas as pd\n'), ((906, 931), 'numpy.where', 'np.where', (['(correlation < 0)'], {}), '(correlation < 0)\n', (914, 931), True, 'import numpy as ...
#!/usr/bin/python # encoding: utf-8 import sys from subprocess import call from workflow import Workflow, notify from args import * def main(wf): args = wf.args actions = { START_ARG: start_action, STOP_ARG: stop_action, BREAK_ARG: break_action } action = args[0] actions[...
[ "workflow.Workflow", "workflow.notify.notify", "subprocess.call" ]
[((355, 391), 'workflow.notify.notify', 'notify.notify', (['"""Starting a pomodoro"""'], {}), "('Starting a pomodoro')\n", (368, 391), False, 'from workflow import Workflow, notify\n'), ((465, 507), 'workflow.notify.notify', 'notify.notify', (['"""Stopping a pomodoro/break"""'], {}), "('Stopping a pomodoro/break')\n", ...
# Copyright (C) 2015-2016 Hewlett Packard Enterprise Development LP # # 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 ...
[ "opsrest.patch.apply_patch", "opsrest.exceptions.MethodNotAllowed", "opsrest.patch.create_patch" ]
[((2335, 2353), 'opsrest.patch.create_patch', 'create_patch', (['data'], {}), '(data)\n', (2347, 2353), False, 'from opsrest.patch import create_patch, apply_patch\n'), ((2435, 2468), 'opsrest.patch.apply_patch', 'apply_patch', (['patch', 'resource_json'], {}), '(patch, resource_json)\n', (2446, 2468), False, 'from ops...
import numpy as np import matplotlib.pyplot as plt from utils import get_state_vowel class HopfieldNetwork: """ Creates a Hopfield Network. """ def __init__(self, patterns): """ Initializes the network. Args: patterns (np.array): Group of states to be memorized by ...
[ "numpy.reshape", "numpy.random.choice", "numpy.random.random", "matplotlib.pyplot.plot", "utils.get_state_vowel", "numpy.fill_diagonal", "matplotlib.pyplot.figure", "numpy.zeros", "numpy.dot", "numpy.random.seed", "matplotlib.pyplot.title", "numpy.transpose", "matplotlib.pyplot.subplot", "...
[((1840, 1860), 'numpy.random.seed', 'np.random.seed', (['(1234)'], {}), '(1234)\n', (1854, 1860), True, 'import numpy as np\n'), ((2183, 2228), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(6, 3)', 'tight_layout': '(True)'}), '(figsize=(6, 3), tight_layout=True)\n', (2193, 2228), True, 'import matplotli...
import nltk txt = nltk.data.load('/Users/ewanog/Dropbox/Work/ACAPS/nlp/text.txt') print(txt)
[ "nltk.data.load" ]
[((19, 82), 'nltk.data.load', 'nltk.data.load', (['"""/Users/ewanog/Dropbox/Work/ACAPS/nlp/text.txt"""'], {}), "('/Users/ewanog/Dropbox/Work/ACAPS/nlp/text.txt')\n", (33, 82), False, 'import nltk\n')]
#!/usr/bin/env python # coding: utf-8 # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -----------------------------------------------...
[ "onnx.helper.make_graph", "onnxruntime.quantization.quantize_static", "numpy.random.normal", "onnx.save", "onnx.helper.make_node", "onnx.numpy_helper.from_array", "onnx.helper.make_tensor_value_info", "numpy.random.randint", "numpy.random.seed", "op_test_utils.TestDataFeeds", "unittest.main", ...
[((7923, 7938), 'unittest.main', 'unittest.main', ([], {}), '()\n', (7936, 7938), False, 'import unittest\n'), ((984, 1014), 'op_test_utils.TestDataFeeds', 'TestDataFeeds', (['input_data_list'], {}), '(input_data_list)\n', (997, 1014), False, 'from op_test_utils import TestDataFeeds, check_model_correctness, check_op_t...
from model import * from dataloader import * from utils import * from torch.utils.tensorboard import SummaryWriter import torch.optim as optim import time import gc from tqdm import tqdm import matplotlib.pyplot as plt import torch.nn as nn import numpy as np import warnings as wn wn.filterwarnings('ignore') #load eit...
[ "torch.optim.Adam", "torch.utils.tensorboard.SummaryWriter", "numpy.mean", "torch.nn.CrossEntropyLoss", "matplotlib.pyplot.figure", "time.time", "warnings.filterwarnings" ]
[((282, 309), 'warnings.filterwarnings', 'wn.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (299, 309), True, 'import warnings as wn\n'), ((1375, 1390), 'torch.utils.tensorboard.SummaryWriter', 'SummaryWriter', ([], {}), '()\n', (1388, 1390), False, 'from torch.utils.tensorboard import SummaryWriter\n'), ((17...
import logging import logging.config import os import flask import google.cloud.logging import yaml from flask_cors import CORS from google.auth.credentials import AnonymousCredentials from google.cloud import ndb from bond_app import routes from bond_app.json_exception_handler import JsonExceptionHandler from bond_a...
[ "google.auth.credentials.AnonymousCredentials", "logging.basicConfig", "flask_cors.CORS", "flask.Flask", "logging.config.dictConfig", "os.environ.get", "google.cloud.ndb.Client", "bond_app.json_exception_handler.JsonExceptionHandler" ]
[((392, 433), 'os.environ.get', 'os.environ.get', (['"""DATASTORE_EMULATOR_HOST"""'], {}), "('DATASTORE_EMULATOR_HOST')\n", (406, 433), False, 'import os\n'), ((3343, 3368), 'bond_app.json_exception_handler.JsonExceptionHandler', 'JsonExceptionHandler', (['app'], {}), '(app)\n', (3363, 3368), False, 'from bond_app.json...
import FWCore.ParameterSet.Config as cms pileupVtxDigitizer = cms.PSet( accumulatorType = cms.string("PileupVertexAccumulator"), hitsProducer = cms.string('generator'), vtxTag = cms.InputTag("generatorSmeared"), vtxFallbackTag = cms.InputTag("generator"), makeDigiSimLinks = cms.untracked.bool(False...
[ "FWCore.ParameterSet.Config.string", "FWCore.ParameterSet.Config.untracked.bool", "FWCore.ParameterSet.Config.bool", "FWCore.ParameterSet.Config.InputTag" ]
[((95, 132), 'FWCore.ParameterSet.Config.string', 'cms.string', (['"""PileupVertexAccumulator"""'], {}), "('PileupVertexAccumulator')\n", (105, 132), True, 'import FWCore.ParameterSet.Config as cms\n'), ((153, 176), 'FWCore.ParameterSet.Config.string', 'cms.string', (['"""generator"""'], {}), "('generator')\n", (163, 1...
# -*- coding: utf-8 -*- import pygame import heapq as pq import random def explore(u,vis,adj,q): for v,w in adj[u]: if not vis[v]: pq.heappush(q,[w,u,v]) def prim(adj,return_edj=0): tree=[[] for i in range(len(adj))] tree_edj=[] if not adj: return -1 ...
[ "pygame.draw.circle", "random.sample", "pygame.init", "pygame.draw.line", "pygame.event.get", "pygame.quit", "pygame.display.set_mode", "pygame.mouse.get_pos", "heapq.heappop", "heapq.heappush", "pygame.display.update", "random.randint" ]
[((6739, 6752), 'pygame.init', 'pygame.init', ([], {}), '()\n', (6750, 6752), False, 'import pygame\n'), ((6762, 6802), 'pygame.display.set_mode', 'pygame.display.set_mode', (['(width, height)'], {}), '((width, height))\n', (6785, 6802), False, 'import pygame\n'), ((7810, 7832), 'pygame.mouse.get_pos', 'pygame.mouse.ge...
import os import csv import numpy as np from pathlib import Path from tqdm import tqdm from sklearn.utils import shuffle from sklearn.model_selection import train_test_split seed = 3535999445 def imdb(path=Path("data/aclImdb/")): import pickle try: return pickle.load((path / "train-test.p").open("r...
[ "pathlib.Path", "sklearn.model_selection.train_test_split", "os.path.join", "numpy.asarray", "csv.reader" ]
[((210, 231), 'pathlib.Path', 'Path', (['"""data/aclImdb/"""'], {}), "('data/aclImdb/')\n", (214, 231), False, 'from pathlib import Path\n'), ((1932, 2018), 'sklearn.model_selection.train_test_split', 'train_test_split', (['storys', 'comps1', 'comps2', 'ys'], {'test_size': 'n_valid', 'random_state': 'seed'}), '(storys,...
import logging import textwrap from discord.ext import commands from miyu_bot.bot.bot import D4DJBot from miyu_bot.commands.common.fuzzy_matching import romanize, FuzzyMatcher class Utility(commands.Cog): bot: D4DJBot def __init__(self, bot): self.bot = bot self.logger = logging.getLogger(_...
[ "logging.getLogger", "miyu_bot.commands.common.fuzzy_matching.romanize", "textwrap.indent", "miyu_bot.commands.common.fuzzy_matching.FuzzyMatcher", "discord.ext.commands.is_owner", "discord.ext.commands.command" ]
[((335, 364), 'discord.ext.commands.command', 'commands.command', ([], {'hidden': '(True)'}), '(hidden=True)\n', (351, 364), False, 'from discord.ext import commands\n'), ((370, 389), 'discord.ext.commands.is_owner', 'commands.is_owner', ([], {}), '()\n', (387, 389), False, 'from discord.ext import commands\n'), ((500,...
import gi import ctypes as pyc from ctypes import pythonapi from gi.repository import GObject as GO pyc.cdll.LoadLibrary('libgobject-2.0.so') lego = pyc.CDLL('libgobject-2.0.so') lego.g_type_name.restype = pyc.c_char_p lego.g_type_name.argtypes = (pyc.c_ulonglong,) pythonapi.PyCapsule_GetName.restype = pyc.c_char_p pyt...
[ "ctypes.cdll.LoadLibrary", "gi.repository.GObject.GType.from_name", "ctypes.pythonapi.PyCapsule_GetPointer", "ctypes.pythonapi.PyCapsule_GetName", "ctypes.PYFUNCTYPE", "ctypes.CDLL" ]
[((100, 141), 'ctypes.cdll.LoadLibrary', 'pyc.cdll.LoadLibrary', (['"""libgobject-2.0.so"""'], {}), "('libgobject-2.0.so')\n", (120, 141), True, 'import ctypes as pyc\n'), ((149, 178), 'ctypes.CDLL', 'pyc.CDLL', (['"""libgobject-2.0.so"""'], {}), "('libgobject-2.0.so')\n", (157, 178), True, 'import ctypes as pyc\n'), (...
from dataset.transform import crop, hflip, normalize, resize, blur, cutout import math import os from PIL import Image import random from torch.utils.data import Dataset from torchvision import transforms class SemiDataset(Dataset): def __init__(self, name, root, mode, size, labeled_id_path=None, unlabeled_id_pa...
[ "dataset.transform.hflip", "dataset.transform.resize", "torchvision.transforms.RandomGrayscale", "os.path.join", "dataset.transform.cutout", "random.random", "torchvision.transforms.ColorJitter", "dataset.transform.normalize", "dataset.transform.crop", "dataset.transform.blur" ]
[((2887, 2927), 'dataset.transform.resize', 'resize', (['img', 'mask', 'base_size', '(0.5, 2.0)'], {}), '(img, mask, base_size, (0.5, 2.0))\n', (2893, 2927), False, 'from dataset.transform import crop, hflip, normalize, resize, blur, cutout\n'), ((2948, 2974), 'dataset.transform.crop', 'crop', (['img', 'mask', 'self.si...
#!/usr/bin/env python # encoding: utf-8 from six import with_metaclass from functools import wraps from webob import Request, Response, exc import re from pybald.util import camel_to_underscore from routes import redirect_to from pybald import context import json import random import uuid import logging console = log...
[ "logging.getLogger", "webob.Request", "routes.redirect_to", "random.randrange", "re.compile", "webob.Response", "json.dumps", "functools.wraps", "uuid.uuid4", "pybald.context.render", "six.with_metaclass", "webob.exc.HTTPNotFound" ]
[((317, 344), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (334, 344), False, 'import logging\n'), ((367, 397), 're.compile', 're.compile', (['"""(\\\\w+)Controller"""'], {}), "('(\\\\w+)Controller')\n", (377, 397), False, 'import re\n'), ((10009, 10046), 'six.with_metaclass', 'with_met...
import json import requests from datetime import timedelta from django.http import HttpResponseRedirect from django.utils import timezone from django.utils.http import urlencode from django.views.decorators.csrf import csrf_exempt import jwt from allauth.socialaccount.models import SocialApp, SocialToken from allaut...
[ "jwt.decode", "django.utils.http.urlencode", "json.dumps", "jwt.get_unverified_header", "requests.get", "django.utils.timezone.now", "allauth.socialaccount.models.SocialToken", "allauth.socialaccount.models.SocialApp.objects.get", "allauth.socialaccount.providers.oauth2.client.OAuth2Error" ]
[((1385, 1428), 'allauth.socialaccount.models.SocialApp.objects.get', 'SocialApp.objects.get', ([], {'provider': 'provider.id'}), '(provider=provider.id)\n', (1406, 1428), False, 'from allauth.socialaccount.models import SocialApp, SocialToken\n'), ((995, 1030), 'jwt.get_unverified_header', 'jwt.get_unverified_header',...
#修改为 yolo-fastest #修改 ResidualBlock, 从原来的 ->1x1->3x3-> 变为 ->1x1->3x3->1x1-> #修改 make_residual_block, 增加前面的卷积层 import tensorflow as tf class DarkNetConv2D(tf.keras.layers.Layer): def __init__(self, filters, kernel_size, strides, activation="leaky", groups=1): super(DarkNetConv2D, self).__init__() ...
[ "tensorflow.keras.layers.Conv2D", "tensorflow.keras.layers.UpSampling2D", "tensorflow.keras.Sequential", "tensorflow.keras.layers.Dropout", "tensorflow.nn.leaky_relu", "tensorflow.keras.layers.add", "tensorflow.keras.layers.BatchNormalization", "tensorflow.keras.layers.concatenate", "tensorflow.kera...
[((2250, 2271), 'tensorflow.keras.Sequential', 'tf.keras.Sequential', ([], {}), '()\n', (2269, 2271), True, 'import tensorflow as tf\n'), ((952, 988), 'tensorflow.keras.layers.BatchNormalization', 'tf.keras.layers.BatchNormalization', ([], {}), '()\n', (986, 988), True, 'import tensorflow as tf\n'), ((1242, 1284), 'ten...
from django.db import models from django.contrib.auth.models import User from django.utils.translation import ugettext_lazy as _ from django.db.models.signals import post_save from django.dispatch import receiver # Create your models here. ''' we create a profile class that will help us save information on whether the...
[ "django.db.models.OneToOneField", "django.utils.translation.ugettext_lazy", "django.db.models.ForeignKey", "django.db.models.IntegerField", "django.db.models.ImageField", "django.db.models.DecimalField", "django.dispatch.receiver", "django.db.models.CharField" ]
[((396, 427), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(40)'}), '(max_length=40)\n', (412, 427), False, 'from django.db import models\n'), ((446, 486), 'django.db.models.ImageField', 'models.ImageField', ([], {'upload_to': '"""profiles/"""'}), "(upload_to='profiles/')\n", (463, 486), False...
import functools from flask import g, request from lib.jwt_utils import verify_jwt def LoginRequired(view_func): @functools.wraps(view_func) def check_auth(*args, **kwargs): g.user_id = None auth = request.headers.get('token') payload = verify_jwt(auth) if payload: ...
[ "lib.jwt_utils.verify_jwt", "flask.request.headers.get", "functools.wraps", "utils.response_code.ResponseData" ]
[((120, 146), 'functools.wraps', 'functools.wraps', (['view_func'], {}), '(view_func)\n', (135, 146), False, 'import functools\n'), ((224, 252), 'flask.request.headers.get', 'request.headers.get', (['"""token"""'], {}), "('token')\n", (243, 252), False, 'from flask import g, request\n'), ((271, 287), 'lib.jwt_utils.ver...
import os import subprocess import smtplib from email.mime.text import MIMEText from email.mime.image import MIMEImage from email.mime.multipart import MIMEMultipart EMAIL_HTML_START = '<html><head></head><body><p>' EMAIL_HTML_END = '</p></body></html>' """ Send Email with attachments and text attachments should be ...
[ "subprocess.check_output", "smtplib.SMTP", "os.path.isfile", "email.mime.multipart.MIMEMultipart", "os.system", "email.mime.text.MIMEText" ]
[((555, 570), 'email.mime.multipart.MIMEMultipart', 'MIMEMultipart', ([], {}), '()\n', (568, 570), False, 'from email.mime.multipart import MIMEMultipart\n'), ((2442, 2493), 'subprocess.check_output', 'subprocess.check_output', (['eServerCommand'], {'shell': '(True)'}), '(eServerCommand, shell=True)\n', (2465, 2493), F...
''' @date: 31/03/2015 @author: <NAME> Tests for generator ''' import unittest import numpy as np import scipy.constants as constants from PyHEADTAIL.trackers.longitudinal_tracking import RFSystems import PyHEADTAIL.particles.generators as gf from PyHEADTAIL.general.printers import SilentPrinter class TestParticle...
[ "PyHEADTAIL.trackers.longitudinal_tracking.RFSystems", "PyHEADTAIL.general.printers.SilentPrinter", "PyHEADTAIL.particles.generators.gaussian2D", "PyHEADTAIL.particles.generators.import_distribution2D", "PyHEADTAIL.particles.generators.uniform2D", "numpy.linspace", "numpy.random.seed", "unittest.main"...
[((7430, 7445), 'unittest.main', 'unittest.main', ([], {}), '()\n', (7443, 7445), False, 'import unittest\n'), ((457, 474), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (471, 474), True, 'import numpy as np\n'), ((3136, 3154), 'PyHEADTAIL.particles.generators.gaussian2D', 'gf.gaussian2D', (['(0.1)'], ...
from lib.utils.misc import detect_os MOT_info = { "readme": "The sequences in MOT16 and MOT17 are the same, while the sequences in 2DMOT2015 are " "not all the same with those in MOT17. To handle this, we filter 2DMOT2015 dataset, " "i.e. those sequences that are contained in MOT17 will...
[ "lib.utils.misc.detect_os" ]
[((2883, 2894), 'lib.utils.misc.detect_os', 'detect_os', ([], {}), '()\n', (2892, 2894), False, 'from lib.utils.misc import detect_os\n')]
# -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2017-01-10 20:35 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import django.utils.timezone def populate_new_fields(apps, schema_editor): TillClosure = apps.get_model('cashup', 'TillClosure...
[ "django.db.models.DateTimeField", "django.db.migrations.RunPython", "django.db.models.PositiveIntegerField", "django.db.models.ForeignKey" ]
[((2145, 2213), 'django.db.migrations.RunPython', 'migrations.RunPython', (['populate_new_fields', 'migrations.RunPython.noop'], {}), '(populate_new_fields, migrations.RunPython.noop)\n', (2165, 2213), False, 'from django.db import migrations, models\n'), ((781, 847), 'django.db.models.PositiveIntegerField', 'models.Po...
# Copyright 2020-2021 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
[ "akg.utils.ops_dtype_check", "akg.utils.check_shape", "akg.utils.check_int_list", "akg.utils.check_supported_target" ]
[((1206, 1242), 'akg.utils.check_supported_target', 'utils.check_supported_target', (['target'], {}), '(target)\n', (1234, 1242), True, 'import akg.utils as utils\n'), ((1312, 1336), 'akg.utils.check_shape', 'utils.check_shape', (['shape'], {}), '(shape)\n', (1329, 1336), True, 'import akg.utils as utils\n'), ((1341, 1...
## # File: SchemaDefLoaderDbTests.py # Author: <NAME> # Date: 29-Mar-2018 # Version: 0.001 # # Updates: # 20-Jun-2018 jdw updates for new schema generation and data preparation tools # ## """ Tests for creating and loading rdbms database (mysql) using PDBx/mmCIF data files and external schema definition. """...
[ "logging.basicConfig", "unittest.TestSuite", "logging.getLogger", "time.localtime", "rcsb.db.mysql.MyDbUtil.MyDbQuery", "rcsb.db.utils.SchemaProvider.SchemaProvider", "rcsb.db.mysql.SchemaDefLoader.SchemaDefLoader", "os.path.join", "rcsb.utils.repository.RepositoryProvider.RepositoryProvider", "os...
[((937, 1056), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO', 'format': '"""%(asctime)s [%(levelname)s]-%(module)s.%(funcName)s: %(message)s"""'}), "(level=logging.INFO, format=\n '%(asctime)s [%(levelname)s]-%(module)s.%(funcName)s: %(message)s')\n", (956, 1056), False, 'import logging...
import numpy as np import matplotlib.pyplot as plt def filter_rms_error(filter_object, to_filter_data_lambda, desired_filter_data_lambda, dt=0.01, start_time=0.0, end_time=10.0, skip_initial=0...
[ "numpy.full_like", "numpy.square", "numpy.array", "matplotlib.pyplot.subplots", "numpy.arange", "matplotlib.pyplot.show" ]
[((3339, 3374), 'numpy.arange', 'np.arange', (['start_time', 'end_time', 'dt'], {}), '(start_time, end_time, dt)\n', (3348, 3374), True, 'import numpy as np\n'), ((3477, 3489), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (3485, 3489), True, 'import numpy as np\n'), ((3789, 3803), 'matplotlib.pyplot.subplots', 'p...
import requests from lxml import etree import urllib3 #京东爬虫 class JdSpider: def __init__(self): self.url_temp = "https://search.jd.com/Search?keyword={}" self.headers = {"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safar...
[ "urllib3.disable_warnings", "lxml.etree.HTML", "requests.get" ]
[((388, 414), 'urllib3.disable_warnings', 'urllib3.disable_warnings', ([], {}), '()\n', (412, 414), False, 'import urllib3\n'), ((435, 488), 'requests.get', 'requests.get', (['url'], {'headers': 'self.headers', 'verify': '(False)'}), '(url, headers=self.headers, verify=False)\n', (447, 488), False, 'import requests\n')...
import numpy as np import matplotlib.pyplot as plt from matplotlib import patches from matplotlib.legend_handler import HandlerTuple from scipy.integrate import quad, simps from math import * #lets the user enter complicated functions easily, eg: exp(3*sin(x**2)) import pyinputplus as pyip # makes taking inputs ...
[ "matplotlib.legend_handler.HandlerTuple", "numpy.polyfit", "scipy.integrate.quad", "scipy.integrate.simps", "numpy.linspace", "pyinputplus.inputInt", "numpy.polyval", "matplotlib.patches.Patch", "numpy.concatenate", "matplotlib.pyplot.figure", "matplotlib.pyplot.draw", "warnings.filterwarnings...
[((710, 759), 'warnings.filterwarnings', 'filterwarnings', (['"""ignore"""'], {'category': 'np.RankWarning'}), "('ignore', category=np.RankWarning)\n", (724, 759), False, 'from warnings import filterwarnings\n'), ((1070, 1108), 'numpy.linspace', 'np.linspace', (['xmin', 'xmax', 'lenContinuous'], {}), '(xmin, xmax, lenC...
# coding: utf-8 import smtplib msg = "Line 1\nLine 2\nLine 3" server = smtplib.SMTP('localhost') server.sendmail('<EMAIL>', '<EMAIL>', msg) server.quit()
[ "smtplib.SMTP" ]
[((73, 98), 'smtplib.SMTP', 'smtplib.SMTP', (['"""localhost"""'], {}), "('localhost')\n", (85, 98), False, 'import smtplib\n')]
import os import trimesh import unittest import pocketing import numpy as np def get_model(file_name): """ Load a model from the models directory by expanding paths out. Parameters ------------ file_name : str Name of file in `models` Returns ------------ mesh : trimesh.Geomet...
[ "numpy.allclose", "pocketing.contour.contour_parallel", "numpy.isclose", "os.path.join", "pocketing.spiral.archimedean", "pocketing.trochoidal.toolpath", "unittest.main", "pocketing.spiral.helix", "trimesh.util.is_shape", "os.path.expanduser" ]
[((2261, 2305), 'trimesh.util.is_shape', 'trimesh.util.is_shape', (['arcs', '(-1, 3, (3, 2))'], {}), '(arcs, (-1, 3, (3, 2)))\n', (2282, 2305), False, 'import trimesh\n'), ((2473, 2488), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2486, 2488), False, 'import unittest\n'), ((732, 778), 'pocketing.contour.contou...
# -*- coding: utf-8 -*- """ @File: evaluator.py @Description: This is an application for evaluating clustering performance on 20 newsgroup data. @Author: <NAME> @EMail: <EMAIL> @Created_on: 04/05/2017 @python_version: 3.5 ==============================================...
[ "logging.basicConfig", "logging.getLogger", "os.getcwd" ]
[((401, 504), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO', 'format': '"""%(asctime)s %(name)s [%(levelname)s] %(message)s"""'}), "(level=logging.INFO, format=\n '%(asctime)s %(name)s [%(levelname)s] %(message)s')\n", (420, 504), False, 'import logging\n'), ((527, 568), 'logging.getLog...
import bisect from collections import deque from copy import deepcopy from fractions import Fraction from functools import reduce import heapq as hq import io from itertools import combinations, permutations import math from math import factorial import re import sys sys.setrecursionlimit(10000) #from numba import nji...
[ "sys.setrecursionlimit", "io.StringIO" ]
[((268, 296), 'sys.setrecursionlimit', 'sys.setrecursionlimit', (['(10000)'], {}), '(10000)\n', (289, 296), False, 'import sys\n'), ((696, 717), 'io.StringIO', 'io.StringIO', (['_INPUT_1'], {}), '(_INPUT_1)\n', (707, 717), False, 'import io\n'), ((786, 807), 'io.StringIO', 'io.StringIO', (['_INPUT_2'], {}), '(_INPUT_2)...
# from django.core.cache import cache from django.contrib.auth.models import User from django.db.models.signals import post_delete, post_save, pre_delete from django.dispatch import receiver from . import tasks, models from network.management.commands.update_dendrogram import \ call_update_dendrogram from network....
[ "django.dispatch.receiver", "network.management.commands.update_dendrogram.call_update_dendrogram.si", "network.tasks.analysis.network.update_organism_network.si" ]
[((485, 526), 'django.dispatch.receiver', 'receiver', (['post_save'], {'sender': 'models.Follow'}), '(post_save, sender=models.Follow)\n', (493, 526), False, 'from django.dispatch import receiver\n'), ((1035, 1077), 'django.dispatch.receiver', 'receiver', (['pre_delete'], {'sender': 'models.Follow'}), '(pre_delete, sen...
import torch from torch import nn device = torch.device("cuda" if torch.cuda.is_available() else "cpu") class Attention(nn.Module): """ Attention Network. """ def __init__(self, encoder_dim, decoder_dim, attention_dim): """ :param encoder_dim: feature size of encoded images :p...
[ "torch.nn.Softmax", "torch.nn.ReLU", "torch.cuda.is_available", "torch.nn.Linear" ]
[((67, 92), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (90, 92), False, 'import torch\n'), ((501, 538), 'torch.nn.Linear', 'nn.Linear', (['encoder_dim', 'attention_dim'], {}), '(encoder_dim, attention_dim)\n', (510, 538), False, 'from torch import nn\n'), ((609, 646), 'torch.nn.Linear', 'nn...
import gym import random import numpy as np import tflearn from tflearn.layers.core import input_data, dropout, fully_connected from tflearn.layers.estimator import regression from statistics import median, mean from collections import Counter LR = 1e-3 env = gym.make('CartPole-v0') env.reset() goal_steps = 500 score...
[ "statistics.mean", "tflearn.layers.core.dropout", "tflearn.layers.core.fully_connected", "random.randrange", "tflearn.DNN", "statistics.median", "numpy.array", "collections.Counter", "tflearn.layers.core.input_data", "tflearn.layers.estimator.regression", "gym.make", "numpy.save" ]
[((261, 284), 'gym.make', 'gym.make', (['"""CartPole-v0"""'], {}), "('CartPole-v0')\n", (269, 284), False, 'import gym\n'), ((1632, 1655), 'numpy.array', 'np.array', (['training_data'], {}), '(training_data)\n', (1640, 1655), True, 'import numpy as np\n'), ((1660, 1700), 'numpy.save', 'np.save', (['"""saved.npy"""', 't...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import mptt.fields import tree_app.ltreefield class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.RunSQL( """ CREATE EXTENSION ltree; ...
[ "django.db.models.ForeignKey", "django.db.models.AutoField", "django.db.models.PositiveIntegerField", "django.db.models.CharField", "django.db.migrations.RunSQL" ]
[((249, 323), 'django.db.migrations.RunSQL', 'migrations.RunSQL', (['"""\n CREATE EXTENSION ltree;\n """'], {}), '("""\n CREATE EXTENSION ltree;\n """)\n', (266, 323), False, 'from django.db import migrations, models\n'), ((449, 542), 'django.db.models.AutoField', 'models.Aut...
from application.core.entity.account import Account from application.core.port.create_account_port import CreateAccountPort class AccountFactory(CreateAccountPort): def create_account(self, payload: dict) -> Account: return Account(**payload)
[ "application.core.entity.account.Account" ]
[((239, 257), 'application.core.entity.account.Account', 'Account', ([], {}), '(**payload)\n', (246, 257), False, 'from application.core.entity.account import Account\n')]
# (c) Copyright IBM Corp. 2021 # (c) Copyright Instana Inc. 2021 """ Module to assist in the data collection about the google cloud run service revision instance entity """ import os from ....log import logger from instana.collector.helpers.base import BaseHelper from ....util import DictionaryOfStan class Instance...
[ "os.getenv" ]
[((1518, 1539), 'os.getenv', 'os.getenv', (['"""PORT"""', '""""""'], {}), "('PORT', '')\n", (1527, 1539), False, 'import os\n')]
from django.shortcuts import render, redirect, get_object_or_404 from .forms import UrlForm from .models import Url from django.contrib import messages def index(req): if(req.method == "POST"): form = UrlForm(req.POST) if form.is_valid(): url, created = Url.objects.get_or_create(long_...
[ "django.shortcuts.render", "django.shortcuts.redirect", "django.shortcuts.get_object_or_404", "django.contrib.messages.success" ]
[((587, 633), 'django.shortcuts.render', 'render', (['req', '"""urls/index.html"""', "{'form': form}"], {}), "(req, 'urls/index.html', {'form': form})\n", (593, 633), False, 'from django.shortcuts import render, redirect, get_object_or_404\n'), ((683, 726), 'django.shortcuts.get_object_or_404', 'get_object_or_404', (['...
from django.shortcuts import render def post_login_view(request): user = request.user return render(request, 'users/post-login.html', { 'user': user, })
[ "django.shortcuts.render" ]
[((104, 160), 'django.shortcuts.render', 'render', (['request', '"""users/post-login.html"""', "{'user': user}"], {}), "(request, 'users/post-login.html', {'user': user})\n", (110, 160), False, 'from django.shortcuts import render\n')]
# 3rd party import import tensorflow as tf from tensorflow.python.ops import array_ops from tensorflow.python.ops import math_ops from tensorflow.python.framework import dtypes # stdlib import # module import import model_utils def UQP_nce_loss(model, user_idxs, query_word_idxs, product_idxs, word_idxs): """ Arg...
[ "tensorflow.nn.embedding_lookup", "tensorflow.reduce_sum", "tensorflow.multiply", "tensorflow.nn.l2_loss", "tensorflow.python.ops.array_ops.shape", "model_utils.get_query_embedding", "tensorflow.nn.fixed_unigram_candidate_sampler", "tensorflow.matmul", "tensorflow.reshape", "tensorflow.zeros_like"...
[((1414, 1475), 'model_utils.get_query_embedding', 'model_utils.get_query_embedding', (['model', 'query_word_idxs', 'None'], {}), '(model, query_word_idxs, None)\n', (1445, 1475), False, 'import model_utils\n'), ((2464, 2668), 'tensorflow.nn.fixed_unigram_candidate_sampler', 'tf.nn.fixed_unigram_candidate_sampler', ([]...
import numpy as np import matplotlib.pyplot as plt import matplotlib.dates as mdates import seaborn as sns sns.set(style='ticks', context='paper', palette='colorblind') try: import cmocean.cm as cmo cmocean_flag = True except: cmocean_flag = False class pltClass: def __init__(self): self.__i...
[ "matplotlib.dates.num2date", "seaborn.set", "matplotlib.dates.MonthLocator", "matplotlib.dates.DateFormatter", "matplotlib.pyplot.colorbar", "numpy.nanmean", "matplotlib.pyplot.subplots" ]
[((109, 170), 'seaborn.set', 'sns.set', ([], {'style': '"""ticks"""', 'context': '"""paper"""', 'palette': '"""colorblind"""'}), "(style='ticks', context='paper', palette='colorblind')\n", (116, 170), True, 'import seaborn as sns\n'), ((666, 697), 'matplotlib.dates.MonthLocator', 'mdates.MonthLocator', ([], {'interval'...
# -*- coding: utf-8 -*- """ P-spline versions of Whittaker functions ---------------------------------------- pybaselines contains penalized spline (P-spline) versions of all of the Whittaker-smoothing-based algorithms implemented in pybaselines. The reason for doing so was that P-splines offer additional user flexibi...
[ "itertools.cycle", "numpy.log10", "example_helpers.make_data", "matplotlib.pyplot.plot", "example_helpers.optimize_lam", "matplotlib.pyplot.figure", "numpy.empty_like", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show" ]
[((2171, 2188), 'itertools.cycle', 'cycle', (["['o', 's']"], {}), "(['o', 's'])\n", (2176, 2188), False, 'from itertools import cycle\n'), ((2197, 2211), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (2209, 2211), True, 'import matplotlib.pyplot as plt\n'), ((3388, 3398), 'matplotlib.pyplot.show', 'pl...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ # CODE NAME HERE # CODE DESCRIPTION HERE Created on 2021-07-08 @author: cook """ from astropy.io import fits from astropy.table import Table import matplotlib.pyplot as plt import numpy as np import os import sys # ==================================================...
[ "astropy.io.fits.diff.ImageDataDiff", "os.listdir", "os.path.join", "astropy.io.fits.diff.TableDataDiff", "numpy.argsort", "matplotlib.pyplot.close", "astropy.io.fits.open", "os.path.getmtime", "numpy.nansum", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show" ]
[((2454, 2479), 'numpy.argsort', 'np.argsort', (['last_modified'], {}), '(last_modified)\n', (2464, 2479), True, 'import numpy as np\n'), ((809, 829), 'astropy.io.fits.open', 'fits.open', (['imagename'], {}), '(imagename)\n', (818, 829), False, 'from astropy.io import fits\n'), ((2249, 2264), 'os.listdir', 'os.listdir'...
""" FAILS-- can't grid and pack in same parent container (here, root window) """ from tkinter import * from grid2 import gridbox, packbox root = Tk() frm = Frame(root) frm.pack() # this works gridbox(frm) # gridbox must have its own parent in which to grid packbox(root) Button(root, text='Quit', c...
[ "grid2.gridbox", "grid2.packbox" ]
[((205, 217), 'grid2.gridbox', 'gridbox', (['frm'], {}), '(frm)\n', (212, 217), False, 'from grid2 import gridbox, packbox\n'), ((279, 292), 'grid2.packbox', 'packbox', (['root'], {}), '(root)\n', (286, 292), False, 'from grid2 import gridbox, packbox\n')]
from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import numpy as np from matplotlib.patches import Rectangle,Circle import mpl_toolkits.mplot3d.art3d as art3d fig = plt.figure() # ax = fig.add_subplot(111, projection='3d') ax = plt.axes(projection='3d') x,y,z = 10,0,0 dx,dy,dz = 12,12,10 ...
[ "matplotlib.pyplot.figure", "numpy.linspace", "matplotlib.pyplot.axes", "mpl_toolkits.mplot3d.art3d.pathpatch_2d_to_3d", "numpy.cos", "numpy.sin", "numpy.meshgrid", "matplotlib.patches.Circle", "matplotlib.pyplot.show" ]
[((192, 204), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (202, 204), True, 'import matplotlib.pyplot as plt\n'), ((257, 282), 'matplotlib.pyplot.axes', 'plt.axes', ([], {'projection': '"""3d"""'}), "(projection='3d')\n", (265, 282), True, 'import matplotlib.pyplot as plt\n'), ((325, 365), 'matplotlib.p...
# # Copyright (C) 2015 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
[ "os.path.realpath", "os.path.join", "subprocess.call", "subprocess.check_call" ]
[((727, 753), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (743, 753), False, 'import os\n'), ((786, 817), 'os.path.join', 'os.path.join', (['THIS_DIR', '"""../.."""'], {}), "(THIS_DIR, '../..')\n", (798, 817), False, 'import os\n'), ((1247, 1296), 'os.path.join', 'os.path.join', (['THIS_...
# -*- coding: utf-8 -*- # --author-- lanhua.zhou """ reference文件操作集合 """ import os import shutil import logging import maya.cmds as cmds import maya.mel as mm import pymel.core as pm import zfused_maya.core.filefunc as filefunc logger = logging.getLogger(__name__) def publish_file(files, src, dst): """ uploa...
[ "logging.getLogger", "maya.cmds.ls", "os.makedirs", "pymel.core.namespace", "pymel.core.listReferences", "os.path.join", "pymel.core.namespaceInfo", "os.path.dirname", "maya.cmds.namespaceInfo", "os.path.isdir", "shutil.copy", "maya.cmds.file", "zfused_maya.core.filefunc.publish_file", "ma...
[((243, 270), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (260, 270), False, 'import logging\n'), ((2238, 2263), 'maya.cmds.ls', 'cmds.ls', ([], {'type': '"""reference"""'}), "(type='reference')\n", (2245, 2263), True, 'import maya.cmds as cmds\n'), ((4844, 4930), 'maya.cmds.namespaceI...
import os import ast import sys import math import time import string import hashlib import tempfile import subprocess from operator import itemgetter from contextlib import contextmanager from getpass import getpass import random; random = random.SystemRandom() import sdb.subprocess_compat as subprocess from sdb.util...
[ "os.open", "sdb.subprocess_compat.call", "os.fsync", "sdb.clipboard.set_clipboard_once", "operator.itemgetter", "sdb.util.force_bytes", "sdb.gpg_agent.GpgAgent", "getpass.getpass", "os.path.split", "os.unlink", "tempfile.NamedTemporaryFile", "os.path.getsize", "random.choice", "os.rename",...
[((241, 262), 'random.SystemRandom', 'random.SystemRandom', ([], {}), '()\n', (260, 262), False, 'import random\n'), ((4054, 4154), 'sdb.subprocess_compat.Popen', 'subprocess.Popen', (['command'], {'stdin': 'subprocess.PIPE', 'stdout': 'subprocess.PIPE', 'stderr': 'subprocess.PIPE'}), '(command, stdin=subprocess.PIPE, ...
# Copyright 2021-present, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>. # All rights reserved. # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import torch.nn as nn from torch.optim import SGD import torch import torchvision from argparse import Namespa...
[ "torch.no_grad", "torch.max", "torch.flatten", "utils.conf.get_device" ]
[((603, 622), 'torch.flatten', 'torch.flatten', (['x', '(1)'], {}), '(x, 1)\n', (616, 622), False, 'import torch\n'), ((1143, 1155), 'utils.conf.get_device', 'get_device', ([], {}), '()\n', (1153, 1155), False, 'from utils.conf import get_device\n'), ((3714, 3729), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (3...
import argparse import datetime import sys import threading import time import matplotlib.pyplot as plt import numpy import yaml from .__about__ import __copyright__, __version__ from .main import ( cooldown, measure_temp, measure_core_frequency, measure_ambient_temperature, test, ) def _get_ver...
[ "argparse.FileType", "matplotlib.pyplot.savefig", "argparse.ArgumentParser", "yaml.dump", "matplotlib.pyplot.twinx", "yaml.load", "numpy.subtract", "datetime.datetime.now", "matplotlib.pyplot.figure", "time.time", "matplotlib.pyplot.show" ]
[((665, 741), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Run stress test for the Raspberry Pi."""'}), "(description='Run stress test for the Raspberry Pi.')\n", (688, 741), False, 'import argparse\n'), ((4974, 5103), 'yaml.dump', 'yaml.dump', (["{'name': args.name, 'time': times, 'te...
import random import logging from math import sqrt from rec.dataset.dataset import Dataset from rec.recommender.base import SessionAwareRecommender from collections import defaultdict, Counter import tqdm class SessionKnnRecommender(SessionAwareRecommender): def __init__(self, k=100, sample_size=1000, similarity...
[ "logging.getLogger", "random.sample", "math.sqrt", "collections.Counter", "collections.defaultdict" ]
[((428, 470), 'logging.getLogger', 'logging.getLogger', (['self.__class__.__name__'], {}), '(self.__class__.__name__)\n', (445, 470), False, 'import logging\n'), ((933, 949), 'collections.defaultdict', 'defaultdict', (['set'], {}), '(set)\n', (944, 949), False, 'from collections import defaultdict, Counter\n'), ((4412,...
# Copyright 2014 Google Inc. 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 applicable law or agre...
[ "posixpath.join", "pyaff4.utils.SmartStr", "binascii.hexlify", "functools.wraps", "builtins.str", "future.standard_library.install_aliases", "pyaff4.utils.AssertUnicode", "posixpath.normpath", "pyaff4.utils.AssertStr", "pyaff4.utils.SmartUnicode", "rdflib.URIRef", "binascii.unhexlify" ]
[((723, 757), 'future.standard_library.install_aliases', 'standard_library.install_aliases', ([], {}), '()\n', (755, 757), False, 'from future import standard_library\n'), ((4338, 4384), 'rdflib.URIRef', 'rdflib.URIRef', (['"""http://aff4.org/Schema#SHA512"""'], {}), "('http://aff4.org/Schema#SHA512')\n", (4351, 4384),...
#!/usr/bin/env python3 import json import argparse import os from collections import OrderedDict from utils import normalize from utils import exact_match_score, regex_match_score, get_rank from utils import slugify, aggregate, aggregate_ans from utils import Tokenizer from multiprocessing import Pool as ProcessPool #...
[ "os.path.exists", "json.loads", "numpy.mean", "collections.OrderedDict", "pickle.dump", "utils.slugify", "argparse.ArgumentParser", "utils.normalize", "utils.aggregate", "utils.aggregate_ans", "os.makedirs", "os.path.join", "utils.get_rank", "multiprocessing.Pool", "numpy.std", "sys.st...
[((885, 907), 'json.loads', 'json.loads', (['data_line_'], {}), '(data_line_)\n', (895, 907), False, 'import json\n'), ((951, 968), 'utils.slugify', 'slugify', (['question'], {}), '(question)\n', (958, 968), False, 'from utils import slugify, aggregate, aggregate_ans\n'), ((982, 1026), 'os.path.join', 'os.path.join', (...
# -*- encoding: UTF-8 -*- from naoqi import ALProxy IP = '127.0.0.1' PORT = 49340 motion_proxy = ALProxy("ALMotion",IP,PORT) motion_proxy.openHand('LHand') motion_proxy.openHand('RHand')
[ "naoqi.ALProxy" ]
[((100, 129), 'naoqi.ALProxy', 'ALProxy', (['"""ALMotion"""', 'IP', 'PORT'], {}), "('ALMotion', IP, PORT)\n", (107, 129), False, 'from naoqi import ALProxy\n')]
from usefull import read_db def test_read_csv_db_simple(): ''' page msg parent choice end 1 1. Mi sembra che 0 False False 2 ...se ti trovassi 1 True False ''' assert read_db('db_simple.csv')[0]['page'] == 1 assert read_db('db_simple.csv')[0]['msg'][-3:] == ...
[ "usefull.read_db" ]
[((487, 504), 'usefull.read_db', 'read_db', (['"""db.csv"""'], {}), "('db.csv')\n", (494, 504), False, 'from usefull import read_db\n'), ((225, 249), 'usefull.read_db', 'read_db', (['"""db_simple.csv"""'], {}), "('db_simple.csv')\n", (232, 249), False, 'from usefull import read_db\n'), ((402, 426), 'usefull.read_db', '...
#!/usr/bin/env python3 import layers import cv2 from os.path import join import numpy as np # import tensorflow as tf import Augmentor vw = 320 vh = 320 class Augment: def __init__(self): self.w = 2 * 640 self.h = 2 * 480 self.canvas = np.zeros((self.h, self.w, 3), dtype=np.uint8) d...
[ "os.path.join", "cv2.imshow", "cv2.putText", "numpy.zeros", "cv2.waitKey" ]
[((268, 313), 'numpy.zeros', 'np.zeros', (['(self.h, self.w, 3)'], {'dtype': 'np.uint8'}), '((self.h, self.w, 3), dtype=np.uint8)\n', (276, 313), True, 'import numpy as np\n'), ((576, 673), 'cv2.putText', 'cv2.putText', (['self.canvas', '"""Original"""', '(0, 50)', 'cv2.FONT_HERSHEY_COMPLEX', '(1.0)', '(255, 255, 255)'...
# MIT License # # Copyright (c) 2019 <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,...
[ "supporting.errorcode.Errorcode" ]
[((1341, 1437), 'supporting.errorcode.Errorcode', 'err.Errorcode', (['(0)', '"""0"""', '"""No errors encountered."""', '"""No action needed."""', '"""Result"""', 'logging.INFO'], {}), "(0, '0', 'No errors encountered.', 'No action needed.',\n 'Result', logging.INFO)\n", (1354, 1437), True, 'import supporting.errorco...
""" player.py - the Player class ------------------------ """ import TicTacToe.tictactoe as tictactoe class Player: """" Defines a TicTacToe game with an AI opponent. """ def __init__(self): self._winners = tictactoe.winners() self._state = set() def play_field(self, f...
[ "TicTacToe.tictactoe.reduce_winners", "TicTacToe.tictactoe.winners", "TicTacToe.tictactoe.check_win" ]
[((245, 264), 'TicTacToe.tictactoe.winners', 'tictactoe.winners', ([], {}), '()\n', (262, 264), True, 'import TicTacToe.tictactoe as tictactoe\n'), ((650, 705), 'TicTacToe.tictactoe.reduce_winners', 'tictactoe.reduce_winners', (['self._winners', 'opponent_state'], {}), '(self._winners, opponent_state)\n', (674, 705), T...
from qtpy import QtWidgets, QtCore from pyqtgraph.widgets.SpinBox import SpinBox from pyqtgraph.parametertree.parameterTypes.basetypes import WidgetParameterItem from pymodaq.daq_utils.daq_utils import scroll_log, scroll_linear import numpy as np class SliderSpinBox(QtWidgets.QWidget): def __init__(self, *args, s...
[ "numpy.log10", "qtpy.QtWidgets.QVBoxLayout", "pymodaq.daq_utils.daq_utils.scroll_log", "qtpy.QtCore.QSize", "pymodaq.daq_utils.daq_utils.scroll_linear", "pyqtgraph.widgets.SpinBox.SpinBox", "qtpy.QtWidgets.QSlider" ]
[((1283, 1306), 'qtpy.QtWidgets.QVBoxLayout', 'QtWidgets.QVBoxLayout', ([], {}), '()\n', (1304, 1306), False, 'from qtpy import QtWidgets, QtCore\n'), ((1329, 1368), 'qtpy.QtWidgets.QSlider', 'QtWidgets.QSlider', (['QtCore.Qt.Horizontal'], {}), '(QtCore.Qt.Horizontal)\n', (1346, 1368), False, 'from qtpy import QtWidget...
""" Copyright (c) 2018 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 applicable law or agreed to in wri...
[ "numpy.array", "numpy.zeros", "logging.error", "numpy.squeeze" ]
[((1582, 1626), 'numpy.array', 'np.array', (['output.value.shape'], {'dtype': 'np.int64'}), '(output.value.shape, dtype=np.int64)\n', (1590, 1626), True, 'import numpy as np\n'), ((3177, 3196), 'numpy.array', 'np.array', (['slice_idx'], {}), '(slice_idx)\n', (3185, 3196), True, 'import numpy as np\n'), ((3228, 3254), '...
#!/usr/bin/python3 """Starts a Flask web application. The application listens on 0.0.0.0, port 5000. Routes: /hbnb_filters: HBnB HTML filters page. """ from models import storage from flask import Flask from flask import render_template app = Flask(__name__) @app.route("/hbnb_filters", strict_slashes=False) def ...
[ "models.storage.all", "flask.render_template", "models.storage.close", "flask.Flask" ]
[((248, 263), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (253, 263), False, 'from flask import Flask\n'), ((401, 421), 'models.storage.all', 'storage.all', (['"""State"""'], {}), "('State')\n", (412, 421), False, 'from models import storage\n'), ((438, 460), 'models.storage.all', 'storage.all', (['"""A...
# -*- coding: utf-8 -*- """setup.py: setuptools control.""" import re from setuptools import find_packages, setup version = re.search(r"^__version__\s*=\s*'(.*)'", open('src/tav/cmd.py').read(), re.M).group(1) setup( name='tav', version=version, description='TBD', long_descriptio...
[ "setuptools.find_packages" ]
[((459, 479), 'setuptools.find_packages', 'find_packages', (['"""src"""'], {}), "('src')\n", (472, 479), False, 'from setuptools import find_packages, setup\n')]
#!/usr/bin/python; import sys import ast import json import math as m import numpy as np # from scipy.interpolate import interp1d # from scipy.optimize import fsolve # Version Controller sTitle = 'DNVGL RP F103 Cathodic protection of submarine pipelines' sVersion = 'Version 1.0.0' # Define constants pi = m.pi e = m....
[ "numpy.array", "json.dumps" ]
[((402, 508), 'numpy.array', 'np.array', (['[[25, 0.05, 0.02], [50, 0.06, 0.03], [80, 0.075, 0.04], [120, 0.1, 0.06], [\n 200, 0.13, 0.08]]'], {}), '([[25, 0.05, 0.02], [50, 0.06, 0.03], [80, 0.075, 0.04], [120, 0.1,\n 0.06], [200, 0.13, 0.08]])\n', (410, 508), True, 'import numpy as np\n'), ((550, 767), 'numpy.a...
from django.db import models from djangae import patches # noqa class DeferIterationMarker(models.Model): """ Marker to keep track of sharded defer iteration tasks """ # Set to True when all shards have been deferred is_ready = models.BooleanField(default=False) shard_count = m...
[ "django.db.models.DateTimeField", "django.db.models.CharField", "django.db.models.PositiveIntegerField", "django.db.models.BooleanField" ]
[((265, 299), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'default': '(False)'}), '(default=False)\n', (284, 299), False, 'from django.db import models\n'), ((319, 357), 'django.db.models.PositiveIntegerField', 'models.PositiveIntegerField', ([], {'default': '(0)'}), '(default=0)\n', (346, 357), False...
from setuptools import setup from setuptools import find_packages setup(name='darwin', version='0.1', description='Machine Learning with Genetic Algorithms', author='<NAME>', author_email='<EMAIL>', url='https://github.com/WillBux/darwin', license='MIT', install_requires=['tqd...
[ "setuptools.find_packages" ]
[((656, 671), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (669, 671), False, 'from setuptools import find_packages\n')]
""" Utilities for bounding box manipulation and GIoU. """ from x2paddle import torch2paddle import paddle def box_area(boxes): """ Computes the area of a set of bounding boxes, which are specified by its (x1, y1, x2, y2) coordinates. Arguments: boxes (Tensor[N, 4]): boxes for which the area w...
[ "x2paddle.torch2paddle.max", "paddle.stacks", "x2paddle.torch2paddle.min", "paddle.meshgrid", "paddle.arange", "paddle.zeros" ]
[((678, 703), 'paddle.stacks', 'paddle.stacks', (['b'], {'axis': '(-1)'}), '(b, axis=-1)\n', (691, 703), False, 'import paddle\n'), ((835, 860), 'paddle.stacks', 'paddle.stacks', (['b'], {'axis': '(-1)'}), '(b, axis=-1)\n', (848, 860), False, 'import paddle\n'), ((959, 1011), 'x2paddle.torch2paddle.max', 'torch2paddle....
# !/usr/bin/env python3 # -*- coding: utf-8 -*- import re import typing import discord from discord.ext import commands import libs as lib class NijiruAlter(commands.Cog, name='煮汁代替定例会予約'): def __init__(self, bot): self.bot = bot self.SB_URL = ( "http://scp-jp-sandbox3.wikidot.com/...
[ "discord.ext.commands.command" ]
[((380, 431), 'discord.ext.commands.command', 'commands.command', ([], {'aliases': "['reserv']", 'enabled': '(False)'}), "(aliases=['reserv'], enabled=False)\n", (396, 431), False, 'from discord.ext import commands\n')]
import logging import os import errno def make_sure_path_exists(path): try: os.makedirs(path) except OSError as exception: if exception.errno != errno.EEXIST: raise def initialize_logger(output_dir, console_log_level, info_log="info.log", warn_err_log="warn_error.log", all_log="a...
[ "logging.getLogger", "logging.StreamHandler", "os.makedirs", "logging.Formatter", "os.path.join" ]
[((746, 765), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (763, 765), False, 'import logging\n'), ((90, 107), 'os.makedirs', 'os.makedirs', (['path'], {}), '(path)\n', (101, 107), False, 'import os\n'), ((897, 920), 'logging.StreamHandler', 'logging.StreamHandler', ([], {}), '()\n', (918, 920), False, '...
import sys import can import logging import struct import re import paho.mqtt.client as mqtt from binascii import unhexlify, hexlify from flask import Flask, render_template, send_from_directory from werkzeug.serving import run_simple from logging.handlers import TimedRotatingFileHandler from config import Config htt...
[ "flask.render_template", "logging.getLogger", "logging.debug", "flask.Flask", "can.interface.Bus", "can.Message", "binascii.hexlify", "werkzeug.serving.run_simple", "sys.exit", "logging.info", "logging.error", "re.search", "flask.send_from_directory", "paho.mqtt.client.Client", "logging....
[((327, 342), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (332, 342), False, 'from flask import Flask, render_template, send_from_directory\n'), ((411, 446), 'flask.send_from_directory', 'send_from_directory', (['"""static"""', 'path'], {}), "('static', path)\n", (430, 446), False, 'from flask import Fl...
# <NAME> # 2017A7PS0112P from gui import Gui Gui().loop()
[ "gui.Gui" ]
[((47, 52), 'gui.Gui', 'Gui', ([], {}), '()\n', (50, 52), False, 'from gui import Gui\n')]
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals from conda.common.io import attach_stderr_handler, captured from logging import DEBUG, NOTSET, WARN, getLogger def test_attach_stderr_handler(): name = 'abbacadabba' logr = getLogger(name) assert le...
[ "logging.getLogger", "conda.common.io.attach_stderr_handler", "conda.common.io.captured" ]
[((291, 306), 'logging.getLogger', 'getLogger', (['name'], {}), '(name)\n', (300, 306), False, 'from logging import DEBUG, NOTSET, WARN, getLogger\n'), ((430, 440), 'conda.common.io.captured', 'captured', ([], {}), '()\n', (438, 440), False, 'from conda.common.io import attach_stderr_handler, captured\n'), ((455, 488),...
#!/usr/bin/env python3 import argparse import sys import csv import pickle from common import ( read_comments, read_comments_csv, cv_score, text_preprocess, print_scores, ) from nltk.corpus import stopwords from sklearn.svm import LinearSVC from sklearn.feature_selection import SelectKBest from s...
[ "sklearn.naive_bayes.ComplementNB", "nltk.corpus.stopwords.words", "argparse.ArgumentParser", "common.cv_score", "sklearn.svm.LinearSVC", "common.text_preprocess", "common.print_scores", "sklearn.feature_selection.SelectKBest", "sklearn.pipeline.make_pipeline", "common.read_comments", "common.re...
[((508, 672), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Classify comments sentiments about Brexit. All comments should be categorized as positive/neutral/negative (1/0/-1)"""'}), "(description=\n 'Classify comments sentiments about Brexit. All comments should be categorized as po...