code
stringlengths
22
1.05M
apis
listlengths
1
3.31k
extract_api
stringlengths
75
3.25M
import logging from typing import Any, List from absl import flags from injector import Module, inject, singleton from rep0st.framework import app from rep0st.framework.scheduler import Scheduler from rep0st.service.tag_service import TagService, TagServiceModule log = logging.getLogger(__name__) FLAGS = flags.FLAGS...
[ "logging.getLogger", "absl.flags.DEFINE_string", "rep0st.framework.app.run" ]
[((273, 300), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (290, 300), False, 'import logging\n'), ((321, 456), 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""rep0st_update_tags_job_schedule"""', '"""*/1 * * * *"""', '"""Schedule in crontab format for running the tag update jo...
from abc import ABC, abstractmethod from contextlib import contextmanager from queue import Empty, Full, LifoQueue, Queue from typing import Callable, Generic, List, Optional, TypeVar from .errors import Invalid, UnableToCreateValidObject, Unmanaged from .factory import Factory T = TypeVar("T") class Pool(Generic[T...
[ "queue.Full", "typing.TypeVar" ]
[((285, 297), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (292, 297), False, 'from typing import Callable, Generic, List, Optional, TypeVar\n'), ((2620, 2626), 'queue.Full', 'Full', ([], {}), '()\n', (2624, 2626), False, 'from queue import Empty, Full, LifoQueue, Queue\n')]
""" Various types used in the library. """ from typing import TYPE_CHECKING, Callable, Dict, List, Tuple, TypeVar, Union if TYPE_CHECKING: from pysimgame.model import Policy from pysimgame.regions_display import RegionComponent RegionName = str RegionsDict = Dict[RegionName, RegionComponent] At...
[ "typing.TypeVar" ]
[((355, 375), 'typing.TypeVar', 'TypeVar', (['"""ModelType"""'], {}), "('ModelType')\n", (362, 375), False, 'from typing import TYPE_CHECKING, Callable, Dict, List, Tuple, TypeVar, Union\n')]
import redis class Defaults: redis = None redis_url = 'redis://127.0.0.1:6379' @classmethod def get_redis(cls): if cls.redis is not None: return cls.redis return redis.StrictRedis.from_url(cls.redis_url)
[ "redis.StrictRedis.from_url" ]
[((209, 250), 'redis.StrictRedis.from_url', 'redis.StrictRedis.from_url', (['cls.redis_url'], {}), '(cls.redis_url)\n', (235, 250), False, 'import redis\n')]
from distutils.core import setup setup( name='customassert', version='1.0.0.0', packages=['customassert'], install_requires=[] )
[ "distutils.core.setup" ]
[((33, 130), 'distutils.core.setup', 'setup', ([], {'name': '"""customassert"""', 'version': '"""1.0.0.0"""', 'packages': "['customassert']", 'install_requires': '[]'}), "(name='customassert', version='1.0.0.0', packages=['customassert'],\n install_requires=[])\n", (38, 130), False, 'from distutils.core import setup...
# Copyright 2019 The Sonnet 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 applicable l...
[ "tensorflow.shape", "sonnet.Conv1DTranspose", "sonnet.optimizers.Adam", "sonnet.Conv1D", "sonnet.LSTM", "sonnet.UnrolledLSTM", "sonnet.Sequential", "sonnet.optimizers.RMSProp", "sonnet.optimizers.SGD", "sonnet.Linear", "sonnet.Conv2DLSTM", "sonnet.LayerNorm", "sonnet.Conv1DLSTM", "sonnet.C...
[((1867, 1952), 'collections.namedtuple', 'collections.namedtuple', (['"""ModuleDescriptor"""', "['name', 'create', 'shape', 'dtype']"], {}), "('ModuleDescriptor', ['name', 'create', 'shape', 'dtype']\n )\n", (1889, 1952), False, 'import collections\n'), ((2337, 2347), 'sonnet.Bias', 'snt.Bias', ([], {}), '()\n', (2...
from flask_migrate import Migrate from flask_session import Session from flask_sqlalchemy import SQLAlchemy from flask_bootstraps import Bootstrap from flask_debugtoolbar import DebugToolbarExtension from flask_caching import Cache from myapp.settings import CACHE db = SQLAlchemy() bootstrap = Bootstrap() ...
[ "flask_bootstraps.Bootstrap", "flask_session.Session", "flask_debugtoolbar.DebugToolbarExtension", "flask_caching.Cache", "flask_migrate.Migrate", "flask_sqlalchemy.SQLAlchemy", "myapp.settings.CACHE.get" ]
[((281, 293), 'flask_sqlalchemy.SQLAlchemy', 'SQLAlchemy', ([], {}), '()\n', (291, 293), False, 'from flask_sqlalchemy import SQLAlchemy\n'), ((307, 318), 'flask_bootstraps.Bootstrap', 'Bootstrap', ([], {}), '()\n', (316, 318), False, 'from flask_bootstraps import Bootstrap\n'), ((328, 335), 'flask_caching.Cache', 'Cac...
from django.conf import settings from django.core.exceptions import ImproperlyConfigured SAASU_ERRORS = { 'no_key': 'Please set your SAASU_WSACCESS_KEY setting.', 'no_uid': 'Please set your SAASU_FILE_UID setting.', 'disabled': 'Disabled in demo mode' } SAASU_WSACCESS_KEY = getattr(settings, 'SAASU_WSACCE...
[ "django.core.exceptions.ImproperlyConfigured" ]
[((376, 420), 'django.core.exceptions.ImproperlyConfigured', 'ImproperlyConfigured', (["SAASU_ERRORS['no_key']"], {}), "(SAASU_ERRORS['no_key'])\n", (396, 420), False, 'from django.core.exceptions import ImproperlyConfigured\n'), ((518, 562), 'django.core.exceptions.ImproperlyConfigured', 'ImproperlyConfigured', (["SAA...
import traceback def error_str(func_name, exception): return func_name + " failed with exception: " + str(exception) + "\n" + str(traceback.print_exc()) def print_dict(dictn): for elem in dictn: print(elem, repr(dictn[elem])) def dump_attrs(obj): for attr in dir(obj): print("obj.%s" % ...
[ "traceback.print_exc" ]
[((136, 157), 'traceback.print_exc', 'traceback.print_exc', ([], {}), '()\n', (155, 157), False, 'import traceback\n')]
import sys import tty import re import os def syntax_highlight(input, keywords: dict): i = 0 splitted = input.split(" ") for f in splitted: for keyword in keywords.keys(): if re.match(keyword, f): splitted[i] = keywords.get( keyword) + re.findall(key...
[ "re.match", "sys.stdin.read", "re.findall", "os.system", "sys.stdout.flush", "tty.setraw", "sys.stdout.write" ]
[((432, 453), 'tty.setraw', 'tty.setraw', (['sys.stdin'], {}), '(sys.stdin)\n', (442, 453), False, 'import tty\n'), ((487, 509), 'sys.stdout.write', 'sys.stdout.write', (['"""\n"""'], {}), "('\\n')\n", (503, 509), False, 'import sys\n'), ((514, 545), 'sys.stdout.write', 'sys.stdout.write', (['u"""\x1b[1000D"""'], {}), ...
"""Mutual information using binnings. All the functions inside this file can be compiled using Numba. """ import numpy as np import logging from frites.utils import jit logger = logging.getLogger('frites') ############################################################################### #############################...
[ "logging.getLogger", "numpy.histogram", "numpy.int64", "numpy.unique", "numpy.sum", "numpy.zeros", "numpy.nonzero", "frites.utils.jit", "numpy.log2", "numpy.float32" ]
[((181, 208), 'logging.getLogger', 'logging.getLogger', (['"""frites"""'], {}), "('frites')\n", (198, 208), False, 'import logging\n'), ((787, 803), 'frites.utils.jit', 'jit', (['"""f4(f4[:])"""'], {}), "('f4(f4[:])')\n", (790, 803), False, 'from frites.utils import jit\n'), ((1364, 1387), 'frites.utils.jit', 'jit', ([...
#!/usr/bin/python # The contents of this file are in the public domain. See LICENSE_FOR_EXAMPLE_PROGRAMS.txt # # This example program shows how to use dlib's implementation of the paper: # One Millisecond Face Alignment with an Ensemble of Regression Trees by # <NAME> and <NAME>, CVPR 2014 # # In particular, we...
[ "matplotlib.pyplot.imshow", "os.path.exists", "contextlib.redirect_stdout", "os.makedirs", "matplotlib.use", "dlib.rectangle", "os.path.join", "dlib.shape_predictor", "matplotlib.pyplot.close", "skimage.io.imread", "numpy.zeros", "matplotlib.pyplot.figure", "matplotlib.pyplot.scatter", "nu...
[((1469, 1490), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (1483, 1490), False, 'import matplotlib\n'), ((2457, 2515), 'dlib.shape_predictor', 'dlib.shape_predictor', (["(checkpoint_folder + '/predictor.dat')"], {}), "(checkpoint_folder + '/predictor.dat')\n", (2477, 2515), False, 'import dli...
from django_messages.api import ReceivedMessageResource, SentMessageResource, TrashMessageResource from friendship.api import FollowerResource, FollowingResource from tastypie.api import Api from plan.api import PlanResource from traveller.api import TravellerResource from notifications.api import AllNotificationResour...
[ "friendship.api.FollowerResource", "friendship.api.FollowingResource", "notifications.api.UnreadNotificationResource", "django_messages.api.ReceivedMessageResource", "tastypie.api.Api", "plan.api.PlanResource", "django.conf.urls.include", "django_messages.api.SentMessageResource", "django_messages.a...
[((478, 496), 'tastypie.api.Api', 'Api', ([], {'api_name': '"""v1"""'}), "(api_name='v1')\n", (481, 496), False, 'from tastypie.api import Api\n'), ((513, 527), 'plan.api.PlanResource', 'PlanResource', ([], {}), '()\n', (525, 527), False, 'from plan.api import PlanResource\n'), ((545, 564), 'traveller.api.TravellerReso...
# Generated by Django 3.0.6 on 2020-05-24 01:18 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('drf_firebase_auth', '0001_initial'), ('cor', '0016_auto_20200524_0303'), ] operations = [ migration...
[ "django.db.migrations.DeleteModel", "django.db.models.ForeignKey" ]
[((557, 594), 'django.db.migrations.DeleteModel', 'migrations.DeleteModel', ([], {'name': '"""FBUser"""'}), "(name='FBUser')\n", (579, 594), False, 'from django.db import migrations, models\n'), ((415, 540), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'null': '(True)', 'on_delete': 'django.db.models.delet...
#!/usr/bin/env python3 """Run TriFinger back-end using multi-process robot data.""" import argparse import logging import math import pathlib import sys import robot_interfaces import robot_fingers def main(): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument( "--max-number-of...
[ "logging.basicConfig", "logging.StreamHandler", "robot_fingers.create_trifinger_backend", "logging.debug", "argparse.ArgumentParser", "pathlib.Path", "trifinger_object_tracking.py_tricamera_types.MultiProcessData", "trifinger_object_tracking.py_tricamera_types.Backend", "robot_interfaces.trifinger.L...
[((226, 270), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '__doc__'}), '(description=__doc__)\n', (249, 270), False, 'import argparse\n'), ((1934, 1967), 'logging.StreamHandler', 'logging.StreamHandler', (['sys.stdout'], {}), '(sys.stdout)\n', (1955, 1967), False, 'import logging\n'), ((1...
import tkinter as tk from tkinter import ttk from collections import deque class Timer(ttk.Frame): """parent is the frame which contains the timer frame self is the object whose properties are being created and controller is the class whose properties are inherited....tk.Frame properties are also inher...
[ "collections.deque", "tkinter.ttk.Button", "tkinter.ttk.Frame", "tkinter.ttk.Label", "tkinter.StringVar" ]
[((706, 751), 'tkinter.StringVar', 'tk.StringVar', ([], {'value': 'f"""{pomodoro_time:02d}:00"""'}), "(value=f'{pomodoro_time:02d}:00')\n", (718, 751), True, 'import tkinter as tk\n'), ((858, 906), 'tkinter.StringVar', 'tk.StringVar', ([], {'value': 'controller.timer_schedule[0]'}), '(value=controller.timer_schedule[0]...
# Copyright (c) 2019 UAVCAN Consortium # This software is distributed under the terms of the MIT License. # Author: <NAME> <<EMAIL>> """ Publishes ``uavcan.node.Heartbeat`` periodically and provides a couple of basic auxiliary services; see :class:`HeartbeatPublisher`. """ import enum import time import typing import...
[ "logging.getLogger", "pyuavcan.util.broadcast", "pyuavcan.dsdl.get_model", "time.monotonic", "pyuavcan.transport.Priority" ]
[((1414, 1441), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1431, 1441), False, 'import logging\n'), ((2232, 2248), 'time.monotonic', 'time.monotonic', ([], {}), '()\n', (2246, 2248), False, 'import time\n'), ((5411, 5445), 'pyuavcan.transport.Priority', 'pyuavcan.transport.Priority',...
from speedtest import Speedtest obj = Speedtest() print(f'Download Speed : {obj.download()}') print(f'Upload Speed : {obj.upload()}')
[ "speedtest.Speedtest" ]
[((41, 52), 'speedtest.Speedtest', 'Speedtest', ([], {}), '()\n', (50, 52), False, 'from speedtest import Speedtest\n')]
# Course: EE551 Python for Engineer # Author: <NAME> # Date: 2021/05/04 # Version: 1.0 # Defines routes for the front-end from flask import render_template, url_for, flash, redirect, request, send_from_directory, send_file from image_processor.forms import ImageProcessForm from image_processor import app from image_pro...
[ "flask.render_template", "image_processor.algorithms.edge_detection.gaussian", "image_processor.algorithms.line_detection.RANSAC", "os.listdir", "os.path.join", "flask.url_for", "image_processor.app.route", "image_processor.forms.ImageProcessForm", "os.path.isfile", "image_processor.algorithms.edg...
[((3029, 3068), 'image_processor.app.route', 'app.route', (['"""/"""'], {'methods': "['GET', 'POST']"}), "('/', methods=['GET', 'POST'])\n", (3038, 3068), False, 'from image_processor import app\n'), ((4633, 4666), 'image_processor.app.route', 'app.route', (['"""/download/<filename>"""'], {}), "('/download/<filename>')...
"""Tests for the GogoGate2 component.""" from unittest.mock import MagicMock, patch from gogogate2_api import GogoGate2Api import pytest from homeassistant.components.gogogate2 import DEVICE_TYPE_GOGOGATE2, async_setup_entry from homeassistant.components.gogogate2.common import DeviceDataUpdateCoordinator from homeas...
[ "unittest.mock.MagicMock", "tests.common.MockConfigEntry", "pytest.raises", "unittest.mock.patch", "homeassistant.components.gogogate2.async_setup_entry" ]
[((705, 768), 'unittest.mock.patch', 'patch', (['"""homeassistant.components.gogogate2.common.GogoGate2Api"""'], {}), "('homeassistant.components.gogogate2.common.GogoGate2Api')\n", (710, 768), False, 'from unittest.mock import MagicMock, patch\n'), ((1615, 1679), 'unittest.mock.patch', 'patch', (['"""homeassistant.com...
import os import sys import glob import subprocess from functools import partial import concurrent.futures import filecmp import helpers WHERE_AM_I = os.path.dirname(os.path.realpath(__file__)) # Absolute Path to *THIS* Script BENCH_INPUT_HOME = WHERE_AM_I + '/inputs/' BENCH_BIN_HOME = WHERE_AM_I + '/tests/test-pro...
[ "helpers.getBenchGoldenOut", "helpers.get_binary_options", "helpers.write_results", "helpers.removeDirectories", "subprocess.check_call", "helpers.getBenchFaultyOut", "helpers.mergeResults", "subprocess.Popen", "helpers.makeDirectories", "helpers.getSimOutDir", "os.path.realpath", "helpers.cre...
[((377, 428), 'os.path.abspath', 'os.path.abspath', (["(WHERE_AM_I + '/build/X86/gem5.opt')"], {}), "(WHERE_AM_I + '/build/X86/gem5.opt')\n", (392, 428), False, 'import os\n'), ((443, 500), 'os.path.abspath', 'os.path.abspath', (["(WHERE_AM_I + '/configs/fi_config/run.py')"], {}), "(WHERE_AM_I + '/configs/fi_config/run...
import gpiozero from flask import Flask, render_template, request RELAY_PIN1 = 12 RELAY_PIN2 = 16 RELAY_PIN3 = 20 RELAY_PIN4 = 21 app = Flask(__name__) relay1 = gpiozero.OutputDevice(RELAY_PIN1, active_high=False, initial_value=False) relay2 = gpiozero.OutputDevice(RELAY_PIN2, active_high=False, initial_value=False)...
[ "gpiozero.OutputDevice", "flask.render_template", "flask.Flask" ]
[((139, 154), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (144, 154), False, 'from flask import Flask, render_template, request\n'), ((164, 237), 'gpiozero.OutputDevice', 'gpiozero.OutputDevice', (['RELAY_PIN1'], {'active_high': '(False)', 'initial_value': '(False)'}), '(RELAY_PIN1, active_high=False, i...
""" Module defines the utilities for fetching the music from the Spotify API. """ import json import random import spotipy from spotipy.oauth2 import SpotifyClientCredentials class spotify_api: """ Class that uses that spotify api to get a random song depending on the mood of the user. """ def ...
[ "spotipy.Spotify", "spotipy.oauth2.SpotifyClientCredentials" ]
[((733, 810), 'spotipy.oauth2.SpotifyClientCredentials', 'SpotifyClientCredentials', ([], {'client_id': 'self.__clientID', 'client_secret': 'self.__key'}), '(client_id=self.__clientID, client_secret=self.__key)\n', (757, 810), False, 'from spotipy.oauth2 import SpotifyClientCredentials\n'), ((882, 952), 'spotipy.Spotif...
# SPDX-FileCopyrightText: 2020 Splunk Inc. # # SPDX-License-Identifier: Apache-2.0 from builtins import object import splunktalib.common.xml_dom_parser as xdp import splunktalib.conf_manager.request as req class KnowledgeObjectManager(object): def __init__(self, splunkd_uri, session_key): self.splunkd_ur...
[ "splunktalib.conf_manager.request.content_request", "splunktalib.common.xml_dom_parser.parse_conf_xml_dom" ]
[((1117, 1185), 'splunktalib.conf_manager.request.content_request', 'req.content_request', (['uri', 'self.session_key', 'method', 'payload', 'err_msg'], {}), '(uri, self.session_key, method, payload, err_msg)\n', (1136, 1185), True, 'import splunktalib.conf_manager.request as req\n'), ((1223, 1254), 'splunktalib.common...
import torch import numpy as np from .._ext import cam_bp_lib from cffi import FFI ffi = FFI() def get_vox_surface_cnt(depth_t, fl, cam_dist, res=128): assert depth_t.dim() == 4 assert fl.dim() == 2 and fl.size(1) == depth_t.size(1) assert cam_dist.dim() == 2 and cam_dist.size(1) == depth_t.size(1) as...
[ "cffi.FFI", "torch.FloatTensor", "torch.clamp" ]
[((89, 94), 'cffi.FFI', 'FFI', ([], {}), '()\n', (92, 94), False, 'from cffi import FFI\n'), ((1331, 1365), 'torch.clamp', 'torch.clamp', (['cnt'], {'min': '(0.0)', 'max': '(1.0)'}), '(cnt, min=0.0, max=1.0)\n', (1342, 1365), False, 'import torch\n'), ((947, 971), 'torch.FloatTensor', 'torch.FloatTensor', (['n', 'nc'],...
import os import pygame import pygame.freetype class Settings(object): """class to manage app settings""" def __init__(self): """initialise app settings""" self.game_title = "Kanacode" # **** DISPLAY SETTINGS **** # window settings self.full_screen = False ...
[ "pygame.Color", "pygame.freetype.SysFont", "os.path.join" ]
[((683, 706), 'pygame.Color', 'pygame.Color', (['"""#F2F4F0"""'], {}), "('#F2F4F0')\n", (695, 706), False, 'import pygame\n'), ((731, 754), 'pygame.Color', 'pygame.Color', (['"""#16ACEF"""'], {}), "('#16ACEF')\n", (743, 754), False, 'import pygame\n'), ((780, 803), 'pygame.Color', 'pygame.Color', (['"""#2C81C1"""'], {}...
# coding = utf-8 # @time : 2019/6/4 3:15 PM # @author : alchemistlee # @fileName: Spear.py # @abstract: import sys sys.path.append('../') import modeling import os import tensorflow as tf import numpy as np import utils import collections import tokenization import config import time class MultiLabelSpear(ob...
[ "tensorflow.truncated_normal_initializer", "tensorflow.zeros_initializer", "tensorflow.cast", "sys.path.append", "os.path.exists", "tensorflow.placeholder", "tensorflow.Session", "tensorflow.nn.sigmoid", "modeling.BertModel", "tensorflow.matmul", "tensorflow.ConfigProto", "tokenization.FullTok...
[((123, 145), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (138, 145), False, 'import sys\n'), ((371, 468), 'tokenization.FullTokenizer', 'tokenization.FullTokenizer', ([], {'vocab_file': 'config.VOCAB_FILE', 'do_lower_case': 'config.DO_LOWER_CASE'}), '(vocab_file=config.VOCAB_FILE, do_lower_...
# Generated by Django 2.2.5 on 2020-11-12 01:58 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('users', '0011_auto_20201024_1533'), ] operations = [ migrations.RemoveField( model_name='costcenter', name='active', ...
[ "django.db.migrations.RemoveField" ]
[((225, 287), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""costcenter"""', 'name': '"""active"""'}), "(model_name='costcenter', name='active')\n", (247, 287), False, 'from django.db import migrations\n'), ((332, 395), 'django.db.migrations.RemoveField', 'migrations.RemoveField',...
import datetime import json import logging import os logger = logging.getLogger(__name__) logger.setLevel(os.getenv('LOG_LEVEL', 'WARNING')) def lambda_handler(event, context): logger.debug(f"event: {event}") return { 'statusCode': 200, 'body': json.dumps({ 'invokedAt': datetime....
[ "logging.getLogger", "datetime.datetime.now", "os.getenv" ]
[((63, 90), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (80, 90), False, 'import logging\n'), ((107, 140), 'os.getenv', 'os.getenv', (['"""LOG_LEVEL"""', '"""WARNING"""'], {}), "('LOG_LEVEL', 'WARNING')\n", (116, 140), False, 'import os\n'), ((311, 334), 'datetime.datetime.now', 'datet...
# ***** BEGIN GPL LICENSE BLOCK ***** # # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distribute...
[ "bpy.utils.unregister_class", "bpy.ops.object.parent_set", "bpy.ops.object.mode_set", "queue.Queue", "os.path.dirname", "platform.system", "platform.machine", "threading.Thread", "bpy.utils.register_class", "time.time" ]
[((13939, 14003), 'bpy.utils.register_class', 'bpy.utils.register_class', (['SFC_PT_SurfaceHeatDiffuseSkinningPanel'], {}), '(SFC_PT_SurfaceHeatDiffuseSkinningPanel)\n', (13963, 14003), False, 'import bpy\n'), ((14008, 14059), 'bpy.utils.register_class', 'bpy.utils.register_class', (['SFC_OT_ModalTimerOperator'], {}), ...
import pickle from typing import TypeVar T = TypeVar("T") def deepcopy(data: T) -> T: """ Profiling `deepcopy.deepcopy` show that this function is very slow for largish objects (around 1MB of data). Since most of our objects don't use nested classes, this can be circumvented by using pickle to serialize ...
[ "pickle.dumps", "typing.TypeVar" ]
[((46, 58), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (53, 58), False, 'from typing import TypeVar\n'), ((399, 442), 'pickle.dumps', 'pickle.dumps', (['data', 'pickle.HIGHEST_PROTOCOL'], {}), '(data, pickle.HIGHEST_PROTOCOL)\n', (411, 442), False, 'import pickle\n')]
# Copyright 2021 Zuva Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, softwa...
[ "recognition_results_pb2.Document", "recognition_results_pb2.CharacterRange", "recognition_results_pb2.BoundingBox", "recognition_results_pb2.Page", "hashlib.sha1" ]
[((1096, 1121), 'recognition_results_pb2.Document', 'Document', ([], {'version': 'version'}), '(version=version)\n', (1104, 1121), False, 'from recognition_results_pb2 import BoundingBox, Character, Document, CharacterRange, Page\n'), ((1598, 1611), 'recognition_results_pb2.BoundingBox', 'BoundingBox', ([], {}), '()\n'...
import numpy as np class Problem: """ General linear programming optimization problem. Requires a vector to define the objective function. Accepts box and linear constraints. """ def __init__( self, N, Nconslin=0 ): """ linear programming optimization problem Argument...
[ "numpy.asfortranarray", "numpy.zeros", "numpy.ones" ]
[((1651, 1672), 'numpy.asfortranarray', 'np.asfortranarray', (['lb'], {}), '(lb)\n', (1668, 1672), True, 'import numpy as np\n'), ((1693, 1714), 'numpy.asfortranarray', 'np.asfortranarray', (['ub'], {}), '(ub)\n', (1710, 1714), True, 'import numpy as np\n'), ((2367, 2387), 'numpy.asfortranarray', 'np.asfortranarray', (...
import numpy as np import matplotlib.pyplot as plt import matplotlib.patches as mpatches from scipy import linalg as la from matplotlib import cm from matplotlib.ticker import LinearLocator, FormatStrFormatter from cycler import cycler #FUNCAO CONTINUA def potv(xa,multi,lw): x=abs(xa)/lw return mu...
[ "numpy.sort", "numpy.tanh", "scipy.linalg.eig", "numpy.zeros", "numpy.linspace", "numpy.array", "matplotlib.patches.Patch", "matplotlib.pyplot.subplots", "matplotlib.pyplot.legend", "matplotlib.pyplot.show" ]
[((748, 779), 'numpy.zeros', 'np.zeros', (['(n + 1, n + 1)', 'float'], {}), '((n + 1, n + 1), float)\n', (756, 779), True, 'import numpy as np\n'), ((1044, 1054), 'scipy.linalg.eig', 'la.eig', (['vp'], {}), '(vp)\n', (1050, 1054), True, 'from scipy import linalg as la\n'), ((1067, 1102), 'numpy.sort', 'np.sort', (['(Av...
from distanceclosure.distance import pairwise_proximity, _jaccard_coef_scipy, _jaccard_coef_binary, _jaccard_coef_set, _jaccard_coef_weighted_numpy import numpy as np from scipy.sparse import csr_matrix B = np.array([ [1, 1, 1, 1], [1, 1, 1, 0], [1, 1, 0, 0], [1, 0, 0, 0], ]) N = np.array([ [2, 3,...
[ "distanceclosure.distance._jaccard_coef_set", "distanceclosure.distance._jaccard_coef_weighted_numpy", "numpy.isclose", "distanceclosure.distance.pairwise_proximity", "numpy.array", "distanceclosure.distance._jaccard_coef_scipy", "distanceclosure.distance._jaccard_coef_binary", "scipy.sparse.csr_matri...
[((208, 274), 'numpy.array', 'np.array', (['[[1, 1, 1, 1], [1, 1, 1, 0], [1, 1, 0, 0], [1, 0, 0, 0]]'], {}), '([[1, 1, 1, 1], [1, 1, 1, 0], [1, 1, 0, 0], [1, 0, 0, 0]])\n', (216, 274), True, 'import numpy as np\n'), ((299, 365), 'numpy.array', 'np.array', (['[[2, 3, 4, 2], [2, 3, 4, 2], [2, 3, 3, 2], [2, 1, 3, 4]]'], {...
from ..util import cached, search, llist, WeakRefProperty, SourceError from ..containers.basereader import Track import threading import numpy from collections import OrderedDict from itertools import count from copy import deepcopy import weakref def notifyIterate(iterator, func): for item in iterator: f...
[ "collections.OrderedDict", "numpy.ones", "numpy.int0", "threading.RLock", "itertools.count", "copy.deepcopy", "weakref.ref", "numpy.arange" ]
[((1703, 1720), 'threading.RLock', 'threading.RLock', ([], {}), '()\n', (1718, 1720), False, 'import threading\n'), ((1787, 1803), 'weakref.ref', 'weakref.ref', (['mon'], {}), '(mon)\n', (1798, 1803), False, 'import weakref\n'), ((4184, 4197), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (4195, 4197), Fa...
import json import getpass import sys from commands import * from configuration import * from system_configuration import * account = getpass.getuser() if sys.argv.__len__() >= 2: account = sys.argv[1] print("Account passed as parameter: " + account) system_configuration = get_system_configuration() schedu...
[ "getpass.getuser", "sys.argv.__len__" ]
[((136, 153), 'getpass.getuser', 'getpass.getuser', ([], {}), '()\n', (151, 153), False, 'import getpass\n'), ((158, 176), 'sys.argv.__len__', 'sys.argv.__len__', ([], {}), '()\n', (174, 176), False, 'import sys\n')]
from api import games, modules from pages import views urls = ( ('GET', '/', views.HomePage.as_view()), ('GET', '/api/games/', games.GamesList.as_view()), ('GET', '/api/modules/', modules.ModulesList.as_view()), ('POST', '/api/modules/import/', modules.ModulesImport.as_view()), )
[ "pages.views.HomePage.as_view", "api.modules.ModulesList.as_view", "api.games.GamesList.as_view", "api.modules.ModulesImport.as_view" ]
[((80, 104), 'pages.views.HomePage.as_view', 'views.HomePage.as_view', ([], {}), '()\n', (102, 104), False, 'from pages import views\n'), ((132, 157), 'api.games.GamesList.as_view', 'games.GamesList.as_view', ([], {}), '()\n', (155, 157), False, 'from api import games, modules\n'), ((186, 215), 'api.modules.ModulesList...
import h5py import numpy as np from tensorflow.keras.utils import to_categorical import os # to test generator, values = next(generator) in code def ensureDir(filePath): ''' This function checks if the folder at filePath exists. If not, it creates it. ''' if not os.path.exists(filePath): os.makedirs(filePath...
[ "os.path.exists", "tensorflow.keras.utils.to_categorical", "os.makedirs", "numpy.asarray", "numpy.expand_dims" ]
[((272, 296), 'os.path.exists', 'os.path.exists', (['filePath'], {}), '(filePath)\n', (286, 296), False, 'import os\n'), ((300, 321), 'os.makedirs', 'os.makedirs', (['filePath'], {}), '(filePath)\n', (311, 321), False, 'import os\n'), ((465, 513), 'numpy.expand_dims', 'np.expand_dims', (["h5file['RNASeq'][index]"], {'a...
from django.urls import path from . import views urlpatterns = [ path('', views.home, name='home'), path('blog_upload', views.blog_upload, name='uploading_blogs'), path('blogs/<slug:the_slug>', views.blog_details, name='blog_details'), path('blog-delete/<slug:the_slug>', views.blog_delete, name='bl...
[ "django.urls.path" ]
[((70, 103), 'django.urls.path', 'path', (['""""""', 'views.home'], {'name': '"""home"""'}), "('', views.home, name='home')\n", (74, 103), False, 'from django.urls import path\n'), ((109, 171), 'django.urls.path', 'path', (['"""blog_upload"""', 'views.blog_upload'], {'name': '"""uploading_blogs"""'}), "('blog_upload', ...
import ctypes import functools import random import struct from fcntl import ioctl from trio import socket from wrath.bpf import create_filter IP_VERSION = 4 IP_IHL = 5 IP_DSCP = 0 IP_ECN = 0 IP_TOTAL_LEN = 40 IP_ID = 0x1337 IP_FLAGS = 0x2 # DF IP_FRAGMENT_OFFSET = 0 IP_TTL = 255 IP_PROTOCOL = 6 # TCP IP_CHECKSUM...
[ "struct.calcsize", "trio.socket.inet_aton", "ctypes.create_string_buffer", "wrath.bpf.create_filter", "struct.pack_into", "struct.unpack", "trio.socket.socket", "random.randint" ]
[((819, 867), 'trio.socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_DGRAM'], {}), '(socket.AF_INET, socket.SOCK_DGRAM)\n', (832, 867), False, 'from trio import socket\n'), ((1248, 1314), 'trio.socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_RAW', 'socket.IPPROTO_RAW'], {}), '(socket....
from PIL import Image import tensorflow as tf from config import MODEL_META_DATA as model_meta from maxfw.model import MAXModelWrapper import io import numpy as np import logging from config import PATH_TO_CKPT, PATH_TO_LABELS, NUM_CLASSES # TODO maybe a better way to import this? import sys sys.path.insert(0, '../') ...
[ "logging.getLogger", "tensorflow.Graph", "utils.label_map_util.load_labelmap", "sys.path.insert", "tensorflow.slice", "tensorflow.Session", "io.BytesIO", "tensorflow.GraphDef", "utils.label_map_util.convert_label_map_to_categories", "utils.label_map_util.create_category_index", "tensorflow.impor...
[((294, 319), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""../"""'], {}), "(0, '../')\n", (309, 319), False, 'import sys\n'), ((363, 382), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (380, 382), False, 'import logging\n'), ((627, 637), 'tensorflow.Graph', 'tf.Graph', ([], {}), '()\n', (635, 637), ...
#!/usr/bin/env python from __future__ import print_function import unittest, sys from bindings import TestSE3 # TODO: probably remove and move/split its contents from bindings_SE3 import TestSE3Bindings from bindings_force import TestForceBindings from bindings_motion import TestMotionBindings from bindings_inertia...
[ "unittest.main" ]
[((884, 899), 'unittest.main', 'unittest.main', ([], {}), '()\n', (897, 899), False, 'import unittest, sys\n')]
""" # Sample code to perform I/O: name = input() # Reading input from STDIN print('Hi, %s.' % name) # Writing output to STDOUT # Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail """ # Write your code here from math import gcd t = int(input()) for ...
[ "math.gcd" ]
[((402, 411), 'math.gcd', 'gcd', (['a', 'b'], {}), '(a, b)\n', (405, 411), False, 'from math import gcd\n')]
from pyrr import Matrix44 import json from PyFlow.Core import PinBase from PyFlow.Core.Common import * class M44Encoder(json.JSONEncoder): def default(self, m44): if isinstance(m44, Matrix44): return {Matrix44.__name__: m44.tolist()} json.JSONEncoder.default(self, m44) class M44Deco...
[ "json.JSONEncoder.default", "pyrr.Matrix44" ]
[((269, 304), 'json.JSONEncoder.default', 'json.JSONEncoder.default', (['self', 'm44'], {}), '(self, m44)\n', (293, 304), False, 'import json\n'), ((524, 560), 'pyrr.Matrix44', 'Matrix44', (['m44Dict[Matrix44.__name__]'], {}), '(m44Dict[Matrix44.__name__])\n', (532, 560), False, 'from pyrr import Matrix44\n'), ((793, 8...
# -*- coding: utf-8 -*- """ Created on 2018-01-09 @author: joschi <<EMAIL>> I/O for stramable sparse matrices. """ from setuptools import setup from codecs import open from os import path here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'README.rst'), encoding='utf-8') as f: long_descripti...
[ "os.path.join", "os.path.dirname", "setuptools.setup" ]
[((455, 1060), 'setuptools.setup', 'setup', ([], {'name': '"""matrix_io"""', 'version': '"""0.0.2"""', 'description': '"""I/O for stramable sparse matrices."""', 'long_description': 'long_description', 'url': '"""https://github.com/JosuaKrause/matrix_io"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'l...
import sys import numpy as np import random from keras.models import Sequential, load_model from keras.layers.core import Dense, Activation, Dropout from keras.layers.recurrent import LSTM, SimpleRNN from keras.layers.wrappers import TimeDistributed import os import re #generate_length = int(sys.argv[1]) #Number of cha...
[ "os.get_terminal_size", "keras.layers.core.Activation", "keras.models.Sequential", "numpy.zeros", "keras.layers.core.Dense", "re.sub", "keras.layers.recurrent.LSTM" ]
[((503, 536), 'numpy.zeros', 'np.zeros', (['(1, length, vocab_size)'], {}), '((1, length, vocab_size))\n', (511, 536), True, 'import numpy as np\n'), ((1615, 1627), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (1625, 1627), False, 'from keras.models import Sequential, load_model\n'), ((2532, 2557), 're.su...
#!/usr/bin/env python3 import cgi, cgitb import secret from templates import secret_page # instance of FieldStorage form = cgi.FieldStorage() # get data from fields username = form.getvalue('username') password = form.getvalue('password') if(username == secret.username and password == secret.password): print("Se...
[ "cgi.FieldStorage", "templates.secret_page" ]
[((124, 142), 'cgi.FieldStorage', 'cgi.FieldStorage', ([], {}), '()\n', (140, 142), False, 'import cgi, cgitb\n'), ((439, 470), 'templates.secret_page', 'secret_page', (['username', 'password'], {}), '(username, password)\n', (450, 470), False, 'from templates import secret_page\n')]
import hashlib from flask import request from assemblyline.common.isotime import now_as_iso from assemblyline.remote.datatypes.lock import Lock from assemblyline_ui.api.base import api_login, make_api_response, make_subapi_blueprint from assemblyline_ui.config import CLASSIFICATION, STORAGE SUB_API = 'safelist' safe...
[ "assemblyline_ui.api.base.make_subapi_blueprint", "hashlib.sha256", "hashlib.md5", "assemblyline_ui.config.CLASSIFICATION.max_classification", "assemblyline_ui.config.STORAGE.safelist.delete", "assemblyline_ui.config.STORAGE.safelist.get_if_exists", "assemblyline.remote.datatypes.lock.Lock", "assembly...
[((331, 376), 'assemblyline_ui.api.base.make_subapi_blueprint', 'make_subapi_blueprint', (['SUB_API'], {'api_version': '(4)'}), '(SUB_API, api_version=4)\n', (352, 376), False, 'from assemblyline_ui.api.base import api_login, make_api_response, make_subapi_blueprint\n'), ((2671, 2772), 'assemblyline_ui.api.base.api_log...
# coding=utf-8 import sys import numpy as np import random import math import torch import tensorflow as tf #梯度裁剪功能 def clip_func(clip_bound,clip_type,input): if(clip_bound<=0): return input if(clip_type=="norm1"): return tf.clip_by_value(input,-1*clip_bound,clip_bound) elif(clip_type=="no...
[ "tensorflow.nn.moments", "math.sqrt", "math.log", "tensorflow.gather", "tensorflow.clip_by_value", "numpy.random.laplace", "tensorflow.reshape", "random.gauss", "tensorflow.norm" ]
[((548, 585), 'numpy.random.laplace', 'np.random.laplace', (['(0)', 'beta'], {'size': 'size'}), '(0, beta, size=size)\n', (565, 585), True, 'import numpy as np\n'), ((623, 645), 'random.gauss', 'random.gauss', (['(0)', 'sigma'], {}), '(0, sigma)\n', (635, 645), False, 'import random\n'), ((1021, 1048), 'tensorflow.resh...
import time import gex # pwm frequency sweep with gex.Client(gex.TrxRawUSB()) as client: pwm = gex.PWMDim(client, 'dim') pwm.start() pwm.set_duty_single(1, 500) for i in range(2000, 200, -15): pwm.set_frequency(i) time.sleep(0.05) pwm.stop()
[ "gex.TrxRawUSB", "gex.PWMDim", "time.sleep" ]
[((102, 127), 'gex.PWMDim', 'gex.PWMDim', (['client', '"""dim"""'], {}), "(client, 'dim')\n", (112, 127), False, 'import gex\n'), ((64, 79), 'gex.TrxRawUSB', 'gex.TrxRawUSB', ([], {}), '()\n', (77, 79), False, 'import gex\n'), ((250, 266), 'time.sleep', 'time.sleep', (['(0.05)'], {}), '(0.05)\n', (260, 266), False, 'im...
# -*- coding: utf-8 -*- # 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 require...
[ "gslib.tests.util.ObjectToURI", "os.path.join", "gslib.tests.testcase.integration_testcase.SkipForS3" ]
[((4959, 5017), 'gslib.tests.testcase.integration_testcase.SkipForS3', 'SkipForS3', (['"""No composite object or crc32c support for S3."""'], {}), "('No composite object or crc32c support for S3.')\n", (4968, 5017), False, 'from gslib.tests.testcase.integration_testcase import SkipForS3\n'), ((4222, 4232), 'gslib.tests...
import asyncio from twitch_client import TwitchClient from streamer import StreamerPipe, Streamer from follower_network import FollowNetPipe, FollowerNetwork from live_stream_info import LiveStreamPipe, LiveStreams class RecommendationPipeline: # TODO: want this to take instantiated objects as params instead of ...
[ "follower_network.FollowNetPipe", "asyncio.Queue", "time.perf_counter", "live_stream_info.LiveStreams", "datetime.datetime.now", "streamer.StreamerPipe", "follower_network.FollowerNetwork", "twitch_client.TwitchClient", "live_stream_info.LiveStreamPipe", "streamer.Streamer" ]
[((2103, 2117), 'time.perf_counter', 'perf_counter', ([], {}), '()\n', (2115, 2117), False, 'from time import perf_counter\n'), ((556, 599), 'streamer.StreamerPipe', 'StreamerPipe', (['streamer'], {'sample_sz': 'sample_sz'}), '(streamer, sample_sz=sample_sz)\n', (568, 599), False, 'from streamer import StreamerPipe, St...
from pprint import pprint # noqa from ftmstore.memorious import EntityEmitter from opensanctions import constants from opensanctions.util import jointext GENDERS = {"M": constants.MALE, "F": constants.FEMALE} def parse_entry(emitter, entry): reg_date = entry.get("reg_date") entity = emitter.make("LegalEnti...
[ "ftmstore.memorious.EntityEmitter" ]
[((2809, 2831), 'ftmstore.memorious.EntityEmitter', 'EntityEmitter', (['context'], {}), '(context)\n', (2822, 2831), False, 'from ftmstore.memorious import EntityEmitter\n')]
from typing import Any, Dict, Type, Optional import orjson from starlette.responses import JSONResponse class ORJSONResponse(JSONResponse): media_type = "application/json" def render(self, content: Any) -> bytes: return orjson.dumps(content) class HTTPException(Exception): def __init__( ...
[ "orjson.dumps" ]
[((240, 261), 'orjson.dumps', 'orjson.dumps', (['content'], {}), '(content)\n', (252, 261), False, 'import orjson\n')]
""" Extension name: admin commands Author: <NAME> Created: 18.03.19 - Europe """ # import discord py library import discord # Imports commands from discord.ext import commands # import permissions from discord.ext.commands import has_permissions import asyncio import json from data.functions.MySQL_Connector import MyDB...
[ "discord.ext.commands.has_permissions", "data.functions.MySQL_Connector.MyDB", "discord.ext.commands.guild_only", "asyncio.sleep", "json.load", "discord.Embed", "discord.ext.commands.command" ]
[((749, 798), 'discord.ext.commands.command', 'commands.command', ([], {'name': '"""clear"""', 'aliases': "['purge']"}), "(name='clear', aliases=['purge'])\n", (765, 798), False, 'from discord.ext import commands\n'), ((857, 878), 'discord.ext.commands.guild_only', 'commands.guild_only', ([], {}), '()\n', (876, 878), F...
#!/usr/bin/env python3 import requests import hashlib import time import json import sys #from yolink_mqtt_clientV2 import YoLinkMQTTClientV2 import paho.mqtt.client as mqtt client_id = '60dd7fa7960d177187c82039' client_secret = '3f68536b695a435d8a1a376fc8254e70' yolinkURL = 'https://api.yosmart.com/openApi' yoli...
[ "requests.post", "paho.mqtt.client.Client", "json.dumps", "time.sleep", "sys.exit", "time.time", "json.dump" ]
[((3244, 3262), 'json.dump', 'json.dump', (['info', 'f'], {}), '(info, f)\n', (3253, 3262), False, 'import json\n'), ((4554, 4656), 'paho.mqtt.client.Client', 'mqtt.Client', (['uniqueID'], {'clean_session': '(True)', 'userdata': 'None', 'protocol': 'mqtt.MQTTv311', 'transport': '"""tcp"""'}), "(uniqueID, clean_session=...
import unittest import paramak class test_CenterColumnShieldHyperbola(unittest.TestCase): def test_CenterColumnShieldHyperbola_creation(self): """Creates a center column shield using the CenterColumnShieldHyperbola parametric component and checks that a cadquery solid is created.""" ...
[ "paramak.CenterColumnShieldHyperbola" ]
[((338, 440), 'paramak.CenterColumnShieldHyperbola', 'paramak.CenterColumnShieldHyperbola', ([], {'height': '(100)', 'inner_radius': '(50)', 'mid_radius': '(80)', 'outer_radius': '(100)'}), '(height=100, inner_radius=50, mid_radius\n =80, outer_radius=100)\n', (373, 440), False, 'import paramak\n'), ((1432, 1534), '...
# Generated by Django 2.0.5 on 2018-09-13 16:41 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('bns', '0045_wbi_livelihood'), ] operations = [ migrations.CreateModel( name='WBIPerDistrictEthnicity', fields=[ ...
[ "django.db.models.DecimalField", "django.db.models.TextField", "django.db.models.BigIntegerField", "django.db.models.IntegerField" ]
[((339, 396), 'django.db.models.BigIntegerField', 'models.BigIntegerField', ([], {'primary_key': '(True)', 'serialize': '(False)'}), '(primary_key=True, serialize=False)\n', (361, 396), False, 'from django.db import migrations, models\n'), ((432, 474), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'blan...
# -*- coding: utf-8 -*- # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "Lic...
[ "logging.getLogger", "time.sleep", "uuid.uuid1" ]
[((851, 885), 'logging.getLogger', 'logging.getLogger', (['"""MemcachedLock"""'], {}), "('MemcachedLock')\n", (868, 885), False, 'import logging\n'), ((1608, 1620), 'uuid.uuid1', 'uuid.uuid1', ([], {}), '()\n', (1618, 1620), False, 'import uuid\n'), ((2327, 2340), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (23...
import os.path as path import json import numpy as np import tensorflow as tf from .tool_generate_data import GenerateData from .hmm import HMM thisdir = path.dirname(path.realpath(__file__)) generator = GenerateData(num_time=7) # Make data states, emissions = generator.data() # Check reference hmm = HMM(generator...
[ "os.path.realpath", "numpy.transpose", "os.path.join" ]
[((169, 192), 'os.path.realpath', 'path.realpath', (['__file__'], {}), '(__file__)\n', (182, 192), True, 'import os.path as path\n'), ((581, 615), 'numpy.transpose', 'np.transpose', (['emissions', '[1, 0, 2]'], {}), '(emissions, [1, 0, 2])\n', (593, 615), True, 'import numpy as np\n'), ((652, 693), 'os.path.join', 'pat...
from datetime import datetime import pytz def convert_to_utc_date_time(date): """Convert date into utc date time.""" if date is None: return return datetime.combine(date, datetime.min.time(), tzinfo=pytz.UTC)
[ "datetime.datetime.min.time" ]
[((194, 213), 'datetime.datetime.min.time', 'datetime.min.time', ([], {}), '()\n', (211, 213), False, 'from datetime import datetime\n')]
#!/usr/bin/python3 """ DHT_publish_AWS ##Copyright 2016 <NAME> ## ## Licensed under the Apache License, Version 2.0 (the "License"); ## you may not use this file except in compliance with the License. ## You may obtain a copy of the License at ## ## http://www.apache.org/licenses/LICENSE-2.0 ## ## Unless...
[ "argparse.ArgumentParser", "Sensors.Sensor_PIR", "json.dumps", "time.sleep", "time.gmtime", "os.path.realpath", "os.path.basename", "sys.argv.extend", "time.time", "Configuration.Configuration", "Sensors.SensorState" ]
[((6463, 6476), 'time.gmtime', 'time.gmtime', ([], {}), '()\n', (6474, 6476), False, 'import time\n'), ((6873, 6886), 'time.gmtime', 'time.gmtime', ([], {}), '()\n', (6884, 6886), False, 'import time\n'), ((7296, 7309), 'time.gmtime', 'time.gmtime', ([], {}), '()\n', (7307, 7309), False, 'import time\n'), ((7748, 7801)...
import numpy as np import tensorflow as tf import copy np.random.seed(1) tf.set_random_seed(1) class PolicyGradient: def __init__( self, n_actions=2, n_features=87, learning_rate=0.01, reward_decay=0.95, prob_clip=0.06, output_grap...
[ "tensorflow.train.RMSPropOptimizer", "tensorflow.nn.rnn_cell.BasicLSTMCell", "tensorflow.Session", "tensorflow.contrib.layers.fully_connected", "tensorflow.placeholder", "tensorflow.reduce_sum", "tensorflow.nn.dynamic_rnn", "tensorflow.global_variables_initializer", "numpy.array", "tensorflow.name...
[((55, 72), 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), '(1)\n', (69, 72), True, 'import numpy as np\n'), ((73, 94), 'tensorflow.set_random_seed', 'tf.set_random_seed', (['(1)'], {}), '(1)\n', (91, 94), True, 'import tensorflow as tf\n'), ((764, 776), 'tensorflow.Session', 'tf.Session', ([], {}), '()\n', (774...
import os import numpy as np import pyedflib def test_generator(): """ Get an sample EDF-file Parameters ---------- None Returns ------- f : EdfReader object object containing the handle to the file Examples -------- >>> import pyedflib.data >>> f = pyedflib....
[ "os.path.dirname", "pyedflib.EdfReader" ]
[((507, 532), 'pyedflib.EdfReader', 'pyedflib.EdfReader', (['fname'], {}), '(fname)\n', (525, 532), False, 'import pyedflib\n'), ((450, 475), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (465, 475), False, 'import os\n')]
#'Importa pacote Numpy e renomeia com NP' import numpy as np #'Importa módulo base.funcoes e renomeia para FN' import base.funcoes as fn from base.grafo import Aresta #'De Pillow importar Image, ImageDraw' from PIL import Image, ImageDraw #'De queue=fila importar Queue, LifoQueue' from queue import Queue, LifoQueue, ...
[ "queue.LifoQueue", "base.funcoes.list_state", "queue.PriorityQueue", "queue.Queue", "base.funcoes.save_image" ]
[((1516, 1545), 'base.funcoes.list_state', 'fn.list_state', (['estado_pai', '[]'], {}), '(estado_pai, [])\n', (1529, 1545), True, 'import base.funcoes as fn\n'), ((2017, 2024), 'queue.Queue', 'Queue', ([], {}), '()\n', (2022, 2024), False, 'from queue import Queue, LifoQueue, PriorityQueue\n'), ((3111, 3155), 'base.fun...
from unittest import mock from django.conf.urls import url from django.test import TestCase from django.views.generic import View from tests._site.apps.myapp.app import application class ApplicationTestCase(TestCase): def test_get_permissions_required_uses_map(self): perms = application.get_permissions...
[ "unittest.mock.Mock", "django.views.generic.View.as_view", "tests._site.apps.myapp.app.application.get_permissions", "tests._site.apps.myapp.app.application.post_process_urls", "tests._site.apps.myapp.app.application.get_url_decorator", "tests._site.apps.myapp.app.application.get_url_decorator.assert_call...
[((548, 605), 'unittest.mock.patch', 'mock.patch', (['"""oscar.core.application.permissions_required"""'], {}), "('oscar.core.application.permissions_required')\n", (558, 605), False, 'from unittest import mock\n'), ((293, 329), 'tests._site.apps.myapp.app.application.get_permissions', 'application.get_permissions', ([...
import pytest import numpy as np from sklearn.datasets import make_blobs from sklearn.datasets import load_diabetes from tests.utils import resample_data from deeprob.spn.structure.node import Sum, Product from deeprob.spn.structure.leaf import Bernoulli, Gaussian from deeprob.spn.learning.wrappers import learn_estim...
[ "deeprob.spn.structure.node.Sum", "numpy.isclose", "deeprob.spn.structure.leaf.Gaussian", "numpy.median", "deeprob.spn.structure.node.Product", "sklearn.datasets.make_blobs", "deeprob.spn.learning.em.expectation_maximization", "deeprob.spn.learning.wrappers.learn_estimator", "sklearn.datasets.load_d...
[((491, 521), 'sklearn.datasets.load_diabetes', 'load_diabetes', ([], {'return_X_y': '(True)'}), '(return_X_y=True)\n', (504, 521), False, 'from sklearn.datasets import load_diabetes\n'), ((743, 860), 'sklearn.datasets.make_blobs', 'make_blobs', ([], {'n_samples': '(1000)', 'n_features': '(2)', 'random_state': '(1337)'...
# Generated by Django 3.1.8 on 2021-08-24 10:13 from typing import TYPE_CHECKING, Type from django.db import migrations from django.db.models.query_utils import Q from apps.permissions.constants import PRIMARY_GROUP_NAME, HR_GROUP_NAME if TYPE_CHECKING: from apps.organizations import models from apps.permiss...
[ "django.db.models.query_utils.Q", "django.db.migrations.RunPython" ]
[((2425, 2500), 'django.db.migrations.RunPython', 'migrations.RunPython', (['improve_group_legibility', 'reverse_legible_group_names'], {}), '(improve_group_legibility, reverse_legible_group_names)\n', (2445, 2500), False, 'from django.db import migrations\n'), ((777, 811), 'django.db.models.query_utils.Q', 'Q', ([], {...
from os.path import join, dirname from dotenv import load_dotenv # Get .env file path path = join(dirname(__file__), ".env") # Load .env vars and delete path variable load_dotenv(path) del path
[ "os.path.dirname", "dotenv.load_dotenv" ]
[((169, 186), 'dotenv.load_dotenv', 'load_dotenv', (['path'], {}), '(path)\n', (180, 186), False, 'from dotenv import load_dotenv\n'), ((99, 116), 'os.path.dirname', 'dirname', (['__file__'], {}), '(__file__)\n', (106, 116), False, 'from os.path import join, dirname\n')]
# Visualizations for debugging and Tensorboard import matplotlib import socket if socket.gethostname() != 'arch': matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np import io import tensorflow as tf from matplotlib.patches import Circle from matplotlib.patches import Patch # Keep colors consi...
[ "matplotlib.pyplot.ylabel", "io.BytesIO", "numpy.imag", "tensorflow.summary.image", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "numpy.real", "matplotlib.pyplot.scatter", "socket.gethostname", "matplotlib.use", "matplotlib.pyplot.gca", "matplotlib.pyplot.axes", "matplotlib.patches....
[((82, 102), 'socket.gethostname', 'socket.gethostname', ([], {}), '()\n', (100, 102), False, 'import socket\n'), ((118, 139), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (132, 139), False, 'import matplotlib\n'), ((936, 948), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (946, 9...
import dir_ops as do import py_starter as ps import pypi_builder def get_template( *args, template = None, **kwargs ): #list_contents_Paths() module_Dirs = pypi_builder.templates_Dir.list_contents_Paths( block_paths=True,block_dirs=False ) if template == None: module_Dir = ps.get_selection_from_l...
[ "py_starter.get_selection_from_list", "pypi_builder.templates_Dir.list_contents_Paths", "pypi_builder.templates_Dir.join_Dir" ]
[((166, 253), 'pypi_builder.templates_Dir.list_contents_Paths', 'pypi_builder.templates_Dir.list_contents_Paths', ([], {'block_paths': '(True)', 'block_dirs': '(False)'}), '(block_paths=True, block_dirs\n =False)\n', (212, 253), False, 'import pypi_builder\n'), ((297, 336), 'py_starter.get_selection_from_list', 'ps....
import os import doodad as pd import doodad.ssh as ssh import doodad.mount as mount from doodad.easy_sweep import hyper_sweep import os.path as osp import glob instance_types = { 'c4.large': dict(instance_type='c4.large',spot_price=0.20), 'c4.xlarge': dict(instance_type='c4.xlarge',spot_price=0.20), 'c4.2...
[ "doodad.mode.Local", "os.path.join", "os.path.realpath", "doodad.mount.MountS3", "doodad.mode.LocalDocker", "os.path.isdir", "doodad.mode.EC2AutoconfigDocker", "doodad.easy_sweep.hyper_sweep.run_sweep_doodad", "doodad.mount.MountLocal", "os.path.expanduser" ]
[((1900, 1925), 'os.path.realpath', 'osp.realpath', (['project_dir'], {}), '(project_dir)\n', (1912, 1925), True, 'import os.path as osp\n'), ((1949, 1978), 'os.path.join', 'osp.join', (['PROJECT_DIR', '"""data"""'], {}), "(PROJECT_DIR, 'data')\n", (1957, 1978), True, 'import os.path as osp\n'), ((2157, 2266), 'doodad....
#!/usr/bin/env python # -*-coding: utf-8 -*- #views.py #<NAME> #LAST UPDATED: 01-09-2020 from flask import Blueprint, url_for, render_template mod = Blueprint('site', __name__, template_folder='templates') # Routes to the homepage: @mod.route('/') def index(): return render_template('index.html') # Routes to ...
[ "flask.render_template", "flask.Blueprint" ]
[((153, 209), 'flask.Blueprint', 'Blueprint', (['"""site"""', '__name__'], {'template_folder': '"""templates"""'}), "('site', __name__, template_folder='templates')\n", (162, 209), False, 'from flask import Blueprint, url_for, render_template\n'), ((277, 306), 'flask.render_template', 'render_template', (['"""index.htm...
import flask from flask import redirect, url_for, request, session, flash from infrastructure.view_modifiers import response import services.post_service as post_svc import services.user_service as user_svc blueprint = flask.Blueprint('update', __name__, template_folder='templates') @blueprint.route('/create', meth...
[ "services.post_service.update_publish", "flask.session.get", "flask.flash", "flask.url_for", "flask.request.form.get", "services.post_service.update_post", "flask.Blueprint", "infrastructure.view_modifiers.response", "services.post_service.create_post" ]
[((221, 285), 'flask.Blueprint', 'flask.Blueprint', (['"""update"""', '__name__'], {'template_folder': '"""templates"""'}), "('update', __name__, template_folder='templates')\n", (236, 285), False, 'import flask\n'), ((335, 379), 'infrastructure.view_modifiers.response', 'response', ([], {'template_file': '"""update/cr...
from typing import TYPE_CHECKING, Dict, List, Tuple, Optional, Any, Iterator from time import sleep from logging import getLogger, Logger import re import unicodedata from datetime import datetime, date from boto3 import client # type: ignore from awswrangler.data_types import athena2python from awswrangler.exceptio...
[ "logging.getLogger", "datetime.datetime.strptime", "time.sleep", "unicodedata.category", "unicodedata.normalize", "re.sub", "awswrangler.data_types.athena2python" ]
[((439, 458), 'logging.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (448, 458), False, 'from logging import getLogger, Logger\n'), ((11728, 11771), 're.sub', 're.sub', (['"""(.)([A-Z][a-z]+)"""', '"""\\\\1_\\\\2"""', 'name'], {}), "('(.)([A-Z][a-z]+)', '\\\\1_\\\\2', name)\n", (11734, 11771), False, 'im...
import importlib import sys from pathlib import Path from urls import UrlPattern # Make sure we're able to import dependencies in 'pyre-check' repo, since they # are not currently in the PyPI package for pyre-check current_file = Path(__file__).absolute() sys.path.append(str(current_file.parents[3])) # Work around ...
[ "importlib.import_module", "pathlib.Path" ]
[((376, 441), 'importlib.import_module', 'importlib.import_module', (['"""pyre-check.tools.generate_taint_models"""'], {}), "('pyre-check.tools.generate_taint_models')\n", (399, 441), False, 'import importlib\n'), ((465, 550), 'importlib.import_module', 'importlib.import_module', (['"""pyre-check.tools.generate_taint_m...
# Copyright © 2019 Province of British Columbia # # 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 agr...
[ "flask.request.args.get", "reports_api.utils.util.cors_preflight", "flask_restx.Namespace", "reports_api.services.StaffService.find_all_active_staff", "reports_api.services.StaffService.find_by_position_id", "flask_restx.cors.crossdomain", "reports_api.services.StaffService.find_by_id" ]
[((840, 881), 'flask_restx.Namespace', 'Namespace', (['"""staffs"""'], {'description': '"""Staffs"""'}), "('staffs', description='Staffs')\n", (849, 881), False, 'from flask_restx import Namespace, Resource, cors\n'), ((885, 906), 'reports_api.utils.util.cors_preflight', 'cors_preflight', (['"""GET"""'], {}), "('GET')\...
import logging from Remote.agent import serve from Agents.ExpectedSarsaLambda import ExpectedSarsaTileCodingContinuing logging.basicConfig() serve(ExpectedSarsaTileCodingContinuing())
[ "logging.basicConfig", "Agents.ExpectedSarsaLambda.ExpectedSarsaTileCodingContinuing" ]
[((121, 142), 'logging.basicConfig', 'logging.basicConfig', ([], {}), '()\n', (140, 142), False, 'import logging\n'), ((149, 184), 'Agents.ExpectedSarsaLambda.ExpectedSarsaTileCodingContinuing', 'ExpectedSarsaTileCodingContinuing', ([], {}), '()\n', (182, 184), False, 'from Agents.ExpectedSarsaLambda import ExpectedSar...
from Beam import Beam from OpticalElement import Optical_element from Shape import BoundaryRectangle import numpy as np from SurfaceConic import SurfaceConic import matplotlib.pyplot as plt from CompoundOpticalElement import CompoundOpticalElement from Vector import Vector from numpy.testing import assert_almost_equal ...
[ "Beam.Beam", "numpy.where", "CompoundOpticalElement.CompoundOpticalElement.initialize_as_kirkpatrick_baez", "Shadow.Beam", "numpy.testing.assert_almost_equal", "Shadow.Source", "Shape.BoundaryRectangle", "matplotlib.pyplot.show" ]
[((664, 677), 'Shadow.Beam', 'Shadow.Beam', ([], {}), '()\n', (675, 677), False, 'import Shadow\n'), ((688, 703), 'Shadow.Source', 'Shadow.Source', ([], {}), '()\n', (701, 703), False, 'import Shadow\n'), ((1628, 1634), 'Beam.Beam', 'Beam', ([], {}), '()\n', (1632, 1634), False, 'from Beam import Beam\n'), ((1953, 2012...
from scipy.optimize import minimize import numpy as np import glog as log def get_objective_function(ball_center, normal_vector): func = lambda x: -np.dot(x-ball_center, normal_vector) # minimize (negative sign) jac = lambda x: -normal_vector # jac是梯度/导数公式 return func, jac def get_constraints(x_origina...
[ "numpy.random.rand", "scipy.optimize.minimize", "numpy.square", "numpy.dot", "glog.info" ]
[((1043, 1075), 'numpy.random.rand', 'np.random.rand', (['ball_center.size'], {}), '(ball_center.size)\n', (1057, 1075), True, 'import numpy as np\n'), ((1312, 1451), 'scipy.optimize.minimize', 'minimize', (['objective_func', 'initial_x'], {'jac': 'objective_func_deriv', 'method': '"""SLSQP"""', 'bounds': 'bounds', 'co...
import click import re from lztools import zlick from lztools import pytools @zlick.command_matching_group() def main(): """Tools to make python development more convenient""" @main.command() def clean_build_files(): """Removes temporary files leftover after build""" pytools.cleanup_build_files() @main....
[ "click.argument", "lztools.zlick.command_matching_group", "lztools.pytools.cleanup_build_files", "click.Path", "lztools.pytools.local_install", "re.search" ]
[((80, 110), 'lztools.zlick.command_matching_group', 'zlick.command_matching_group', ([], {}), '()\n', (108, 110), False, 'from lztools import zlick\n'), ((512, 559), 'click.argument', 'click.argument', (['"""EXPRESSION"""'], {'type': 'click.STRING'}), "('EXPRESSION', type=click.STRING)\n", (526, 559), False, 'import c...
from sklearn.gaussian_process.kernels import Kernel, Hyperparameter from sklearn.gaussian_process.kernels import GenericKernelMixin from sklearn.gaussian_process.kernels import StationaryKernelMixin import numpy as np from sklearn.base import clone class MiniSeqKernel(GenericKernelMixin, StationaryKernelMixin, Kernel...
[ "sklearn.base.clone", "sklearn.gaussian_process.kernels.Hyperparameter" ]
[((716, 802), 'sklearn.gaussian_process.kernels.Hyperparameter', 'Hyperparameter', (['"""baseline_similarity"""', '"""numeric"""', 'self.baseline_similarity_bounds'], {}), "('baseline_similarity', 'numeric', self.\n baseline_similarity_bounds)\n", (730, 802), False, 'from sklearn.gaussian_process.kernels import Kern...
import json import requests import logging import threading API_KEY = "YOUR_EDGE_IMPULSE_API_KEY" projectId = "YOUR_EDGE_IMPULSE_PROJECT_ID" headers = { "Accept": "application/json", "x-api-key": API_KEY } def get_sample_len(sampleId): url = f'https://studio.edgeimpulse.com/v1/api/{projectId}/raw-data/{...
[ "logging.basicConfig", "json.loads", "requests.request", "threading.Thread", "logging.info", "logging.error" ]
[((346, 391), 'requests.request', 'requests.request', (['"""GET"""', 'url'], {'headers': 'headers'}), "('GET', url, headers=headers)\n", (362, 391), False, 'import requests\n'), ((404, 429), 'json.loads', 'json.loads', (['response.text'], {}), '(response.text)\n', (414, 429), False, 'import json\n'), ((700, 760), 'requ...
import requests import discord import util def get_astropod(api_key): url = "https://api.nasa.gov/planetary/apod?api_key=" + api_key result = requests.get(url) if result.status_code != 200: return ("SPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACE isn't working right now. Please check your sky, and try again...
[ "util.escape", "discord.Embed", "requests.get" ]
[((152, 169), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (164, 169), False, 'import requests\n'), ((392, 418), 'util.escape', 'util.escape', (["data['title']"], {}), "(data['title'])\n", (403, 418), False, 'import util\n'), ((437, 469), 'util.escape', 'util.escape', (["data['explanation']"], {}), "(data[...
# @PydevCodeAnalysisIgnore ''' Created on Aug 1, 2015 @author: Itai ''' import pytest from allure.constants import AttachmentType from selenium.webdriver.support.abstract_event_listener\ import AbstractEventListener class WebdriverReporterListener(AbstractEventListener): @pytest.allure.step("About to find ...
[ "pytest.allure.step" ]
[((286, 377), 'pytest.allure.step', 'pytest.allure.step', (['"""About to find element with locator \'{1}\'\' and value \'{2}\'"""'], {}), '(\n "About to find element with locator \'{1}\'\' and value \'{2}\'")\n', (304, 377), False, 'import pytest\n')]
# # Created by <NAME> on 05/02/2019. # from typing import List import numpy as np from numpy.random import RandomState from sklearn.utils import resample from phenotrex.util.logging import get_logger from phenotrex.structure.records import TrainingRecord class TrainingRecordResampler: """ Instantiates an ob...
[ "phenotrex.util.logging.get_logger", "numpy.array", "sklearn.utils.resample", "phenotrex.structure.records.TrainingRecord", "numpy.random.RandomState" ]
[((781, 836), 'phenotrex.util.logging.get_logger', 'get_logger', ([], {'initname': 'self.__class__.__name__', 'verb': 'verb'}), '(initname=self.__class__.__name__, verb=verb)\n', (791, 836), False, 'from phenotrex.util.logging import get_logger\n'), ((2064, 2094), 'numpy.array', 'np.array', (['total_pos_featureset'], {...
import argparse import logging from concurrent import futures from importlib import import_module from time import sleep import grpc from gate_grpc.api import service_pb2_grpc as api_grpc from . import InstanceServicer, RootServicer default_addr = "localhost:12345" service_instance_types = {} def main(): parse...
[ "logging.basicConfig", "importlib.import_module", "argparse.ArgumentParser", "concurrent.futures.ThreadPoolExecutor", "time.sleep" ]
[((324, 360), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['__package__'], {}), '(__package__)\n', (347, 360), False, 'import argparse\n'), ((616, 717), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s %(name)s.%(funcName)s: %(message)s"""', 'level': 'logging.DEBUG'}), "(format='...
from threading import Thread from random import randint import pymysql.cursors import configparser import time class DatabaseThread(Thread): def __init__(self, parent, cfg_file): Thread.__init__(self) self.cfg_file = cfg_file self.stop = True self.gpsTime = "" self.gpsDate = "" self.latDeg = "" self.l...
[ "threading.Thread.__init__", "time.time", "configparser.ConfigParser", "time.sleep" ]
[((185, 206), 'threading.Thread.__init__', 'Thread.__init__', (['self'], {}), '(self)\n', (200, 206), False, 'from threading import Thread\n'), ((850, 863), 'time.sleep', 'time.sleep', (['(5)'], {}), '(5)\n', (860, 863), False, 'import time\n'), ((933, 960), 'configparser.ConfigParser', 'configparser.ConfigParser', ([]...
from api import app as application if __name__ == '__main__': application.run(host='0.0.0.0', port=777, debug=True)
[ "api.app.run" ]
[((70, 123), 'api.app.run', 'application.run', ([], {'host': '"""0.0.0.0"""', 'port': '(777)', 'debug': '(True)'}), "(host='0.0.0.0', port=777, debug=True)\n", (85, 123), True, 'from api import app as application\n')]
from app.main.util.heuristicMeasures import MINIMAL_UPPER_CHAR_DENSITY import spacy from spacy.pipeline import EntityRuler from spacy.matcher import Matcher class Singleton(type): _instances = {} def __call__(cls, *args, **kwargs): if cls not in cls._instances: cls._instances[cls] = sup...
[ "spacy.load", "spacy.pipeline.EntityRuler", "spacy.matcher.Matcher" ]
[((534, 551), 'spacy.load', 'spacy.load', (['model'], {}), '(model)\n', (544, 551), False, 'import spacy\n'), ((582, 626), 'spacy.load', 'spacy.load', (['model'], {'disable': "['parser', 'ner']"}), "(model, disable=['parser', 'ner'])\n", (592, 626), False, 'import spacy\n'), ((656, 722), 'spacy.load', 'spacy.load', (['...
# The MIT License (MIT) # # Copyright (c) 2017 <NAME> for Adafruit Industries. # # 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 #...
[ "os.path.abspath", "time.sleep", "adafruit_bus_device.i2c_device.I2CDevice", "micropython.const" ]
[((1860, 1870), 'micropython.const', 'const', (['(160)'], {}), '(160)\n', (1865, 1870), False, 'from micropython import const\n'), ((1887, 1895), 'micropython.const', 'const', (['(0)'], {}), '(0)\n', (1892, 1895), False, 'from micropython import const\n'), ((1914, 1922), 'micropython.const', 'const', (['(1)'], {}), '(1...
from flask_restful import Resource from amais.presentation.helpers.http_helper import not_found, ok from flask_restful import Resource, reqparse from amais.data.usecases.user.update_user import UpdateUser class UpdateUserController(Resource): @classmethod def put(self, user_id: int): parser = reqpars...
[ "amais.presentation.helpers.http_helper.not_found", "amais.data.usecases.user.update_user.UpdateUser", "flask_restful.reqparse.RequestParser", "amais.presentation.helpers.http_helper.ok" ]
[((313, 337), 'flask_restful.reqparse.RequestParser', 'reqparse.RequestParser', ([], {}), '()\n', (335, 337), False, 'from flask_restful import Resource, reqparse\n'), ((690, 747), 'amais.presentation.helpers.http_helper.ok', 'ok', ([], {'message': '"""Usuário atualizado com sucesso!"""', 'payload': '{}'}), "(message='...
#!/usr/bin/env python # # Copyright (C) 2019 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 req...
[ "logging.getLogger", "zipfile.ZipFile", "re.compile", "common.LoadListFromFile", "img_from_target_files.main", "sys.exit", "common.LoadDictionaryFromFile", "os.path.islink", "os.walk", "os.path.exists", "os.readlink", "ota_from_target_files.main", "common.MergeDynamicPartitionInfoDicts", "...
[((3293, 3320), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (3310, 3320), False, 'import logging\n'), ((4131, 4160), 're.compile', 're.compile', (['"""^([A-Z_]+)/\\\\*$"""'], {}), "('^([A-Z_]+)/\\\\*$')\n", (4141, 4160), False, 'import re\n'), ((4671, 4702), 're.compile', 're.compile',...
import torch import torch.nn as nn import sys sys.path.append("/Users/xingzhaohu/Downloads/code/python/ml/ml_code/bert/bert_seq2seq") from torch.optim import Adam import pandas as pd import numpy as np import os import json import time import bert_seq2seq from bert_seq2seq.tokenizer import Tokenizer, load_chinese_bas...
[ "bert_seq2seq.tokenizer.load_chinese_base_vocab", "torch.cuda.is_available", "bert_seq2seq.utils.load_recent_model", "sys.path.append", "bert_seq2seq.utils.load_bert" ]
[((48, 140), 'sys.path.append', 'sys.path.append', (['"""/Users/xingzhaohu/Downloads/code/python/ml/ml_code/bert/bert_seq2seq"""'], {}), "(\n '/Users/xingzhaohu/Downloads/code/python/ml/ml_code/bert/bert_seq2seq')\n", (63, 140), False, 'import sys\n'), ((798, 849), 'bert_seq2seq.tokenizer.load_chinese_base_vocab', '...
import datetime from typing import Dict from . import models, rates, categories def build_simple_question(data: dict, category_provider: categories.Categories) -> models.SimpleQuestion: category = category_provider.by_id(int(data['cid'])) question = models.SimpleQuestion( id=int(data['id']), ...
[ "datetime.datetime.fromtimestamp" ]
[((15927, 15972), 'datetime.datetime.fromtimestamp', 'datetime.datetime.fromtimestamp', (["data['time']"], {}), "(data['time'])\n", (15958, 15972), False, 'import datetime\n'), ((10637, 10687), 'datetime.datetime.fromtimestamp', 'datetime.datetime.fromtimestamp', (["data['ban_until']"], {}), "(data['ban_until'])\n", (1...
import json import os from multiprocessing import Process from threading import Thread from airrun.common.helper import time_now_format from airrun.utils.adb import AdbTool from airrun.config import DefaultConfig import logging, time logger = logging.getLogger(__name__) class RecordAndroidInfo(Process)...
[ "logging.getLogger", "os.path.exists", "airrun.utils.adb.AdbTool", "json.dumps", "time.sleep", "airrun.common.helper.time_now_format", "os.mkdir" ]
[((255, 282), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (272, 282), False, 'import logging, time\n'), ((705, 725), 'airrun.utils.adb.AdbTool', 'AdbTool', (['device_name'], {}), '(device_name)\n', (712, 725), False, 'from airrun.utils.adb import AdbTool\n'), ((1086, 1115), 'os.path.ex...
#!/usr/bin/env python import analyse_phylome as ap import argparse from ete3 import Tree import json import sys # Parse data parser = argparse.ArgumentParser( description="Script to concatenate PhylomeDB alignments." ) parser.add_argument( "-p", "--phylomeID", dest="phyID", action="store", def...
[ "analyse_phylome.create_folder", "sys.exit", "argparse.ArgumentParser", "analyse_phylome.build_extra_concatenated_alg2", "ete3.Tree", "analyse_phylome.obtain_121_trees", "analyse_phylome.get_all_species", "analyse_phylome.build_concatenated_alg", "analyse_phylome.build_extra_concatenated_alg3", "a...
[((136, 223), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Script to concatenate PhylomeDB alignments."""'}), "(description=\n 'Script to concatenate PhylomeDB alignments.')\n", (159, 223), False, 'import argparse\n'), ((2756, 2785), 'analyse_phylome.create_folder', 'ap.create_folde...
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2020: TelelBirds # # ######################################################################### from __future__ import unicode_literals import os import datetime from django.core.validators import MaxValu...
[ "django.db.models.EmailField", "django.db.models.FloatField", "django.db.models.ForeignKey", "django.db.models.IntegerField", "imagekit.processors.ResizeToFit", "django.db.models.BooleanField", "django.db.models.AutoField", "django.db.models.DateTimeField", "django.contrib.gis.db.models.PointField",...
[((857, 891), 'django.db.models.AutoField', 'models.AutoField', ([], {'primary_key': '(True)'}), '(primary_key=True)\n', (873, 891), False, 'from django.db import models\n'), ((907, 961), 'django.db.models.CharField', 'models.CharField', ([], {'null': '(True)', 'blank': '(True)', 'max_length': '(50)'}), '(null=True, bl...
import jpype from jpype.types import * from jpype import JPackage, java import common class ReprTestCase(common.JPypeTestCase): def setUp(self): common.JPypeTestCase.setUp(self) def testClass(self): cls = JClass("java.lang.String") self.assertIsInstance(str(cls), str) self.as...
[ "common.JPypeTestCase.setUp", "jpype.synchronized" ]
[((160, 192), 'common.JPypeTestCase.setUp', 'common.JPypeTestCase.setUp', (['self'], {}), '(self)\n', (186, 192), False, 'import common\n'), ((856, 878), 'jpype.synchronized', 'jpype.synchronized', (['JI'], {}), '(JI)\n', (874, 878), False, 'import jpype\n')]