code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
"""FPS_receive_test.py -- receive (text, image) pairs & print FPS stats
A test program to provide FPS statistics as different imagenode algorithms are
being tested. This program receives images OR images that have been jpg
compressed, depending on the setting of the JPG option.
It computes and prints FPS statistics. ... | [
"time.sleep",
"cv2.imshow",
"threading.Event",
"imutils.video.FPS",
"cv2.destroyAllWindows",
"collections.defaultdict",
"sys.exit",
"numpy.frombuffer",
"traceback.print_exc",
"cv2.waitKey",
"imagezmq.ImageHub",
"threading.Thread"
] | [((2353, 2372), 'imagezmq.ImageHub', 'imagezmq.ImageHub', ([], {}), '()\n', (2370, 2372), False, 'import imagezmq\n'), ((2797, 2813), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (2808, 2813), False, 'from collections import defaultdict\n'), ((3112, 3119), 'threading.Event', 'Event', ([], {}), '(... |
#importando a classe db do objeto app
from app import db
#criando a classe que representa a tabela campaign_set
class Ad(db.Model):
#atributo que se refere ao nome real da tabela no bando de dados
__tablename__ = "ad"
#atributos que se referem ao campos da tabela
ad_id = db.Column(db.Integer, primary_... | [
"app.db.Column",
"app.db.ForeignKey",
"app.db.relationship"
] | [((290, 329), 'app.db.Column', 'db.Column', (['db.Integer'], {'primary_key': '(True)'}), '(db.Integer, primary_key=True)\n', (299, 329), False, 'from app import db\n'), ((341, 361), 'app.db.Column', 'db.Column', (['db.String'], {}), '(db.String)\n', (350, 361), False, 'from app import db\n'), ((459, 479), 'app.db.Colum... |
import zmq
import multiprocessing
import RPi.GPIO as GPIO
import actionHandler
import logging
import configManager
PWM = True
def pid_poller_loop(sub_addr, queue):
'''This is a modified version of the default subscription poller
loop that adds in feedback functionality.
Callbacks must return a processed... | [
"logging.getLogger",
"RPi.GPIO.cleanup",
"logging.StreamHandler",
"actionHandler.PID_Handler",
"logging.Formatter",
"configManager.configManager",
"actionHandler.generic_Handler",
"zmq.Context"
] | [((655, 682), 'logging.getLogger', 'logging.getLogger', (['"""poller"""'], {}), "('poller')\n", (672, 682), False, 'import logging\n'), ((723, 746), 'logging.StreamHandler', 'logging.StreamHandler', ([], {}), '()\n', (744, 746), False, 'import logging\n'), ((793, 866), 'logging.Formatter', 'logging.Formatter', (['"""%(... |
from django.test import TestCase
from geotrek.authent.tests.factories import StructureFactory
from georiviere.proceeding.filters import ProceedingFilterSet
from .factories import ProceedingFactory, EventTypeFactory, EventFactory
class ProceedingFilterTestCase(TestCase):
"""Test filter on parameter tracked"""
... | [
"geotrek.authent.tests.factories.StructureFactory.create",
"georiviere.proceeding.filters.ProceedingFilterSet"
] | [((364, 389), 'geotrek.authent.tests.factories.StructureFactory.create', 'StructureFactory.create', ([], {}), '()\n', (387, 389), False, 'from geotrek.authent.tests.factories import StructureFactory\n'), ((1235, 1290), 'georiviere.proceeding.filters.ProceedingFilterSet', 'ProceedingFilterSet', (["{'event_type': [self.e... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HugginFace Inc. team.
# Copyright (c) 2018, <NAME>PORATION. 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 ... | [
"logging.getLogger",
"numpy.eye",
"torch.ones_like",
"numpy.ones",
"torch.__version__.split",
"torch.sigmoid",
"torch.sqrt",
"math.sqrt",
"torch.tensor",
"torch.is_tensor",
"torch.arange",
"torch.nn.functional.log_softmax",
"torch.logsumexp",
"torch.zeros",
"torch.zeros_like",
"torch.d... | [((903, 930), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (920, 930), False, 'import logging\n'), ((1296, 1312), 'torch.sigmoid', 'torch.sigmoid', (['x'], {}), '(x)\n', (1309, 1312), False, 'import torch\n'), ((7503, 7536), 'torch.nn.functional.log_softmax', 'F.log_softmax', (['sim_mat... |
from greengraph.ggraph import Greengraph
import numpy as np
from mock import Mock
from pytest import raises
graph = Greengraph("London", "Paris")
precision = 1e-3
def test_init():
assert graph.start == "London"
assert graph.end == "Paris"
def test_geolocate():
# test method returns correct latitude & lo... | [
"numpy.shape",
"pytest.raises",
"greengraph.ggraph.Greengraph"
] | [((118, 147), 'greengraph.ggraph.Greengraph', 'Greengraph', (['"""London"""', '"""Paris"""'], {}), "('London', 'Paris')\n", (128, 147), False, 'from greengraph.ggraph import Greengraph\n'), ((1257, 1280), 'numpy.shape', 'np.shape', (['green_between'], {}), '(green_between)\n', (1265, 1280), True, 'import numpy as np\n'... |
"""
# trans-tool
# The translation files checker and syncing tool.
#
# Copyright ©2021 <NAME> <mail [@] <EMAIL>>
# https://github.com/MarcinOrlowski/trans-tool/
#
"""
from transtool.prop.items import Blank
from tests.test_case import TestCase
class TestBlank(TestCase):
def test_blank_constructor(self) -> None:
... | [
"transtool.prop.items.Blank"
] | [((335, 342), 'transtool.prop.items.Blank', 'Blank', ([], {}), '()\n', (340, 342), False, 'from transtool.prop.items import Blank\n'), ((477, 484), 'transtool.prop.items.Blank', 'Blank', ([], {}), '()\n', (482, 484), False, 'from transtool.prop.items import Blank\n')] |
#! /bin/env python3.6
import pypandoc
import sys
import io
import os
def load_version():
with open('VERSION') as fh:
res = fh.read()
return res
version = load_version()
# force tag the repo
rc = os.system(f'git rev-parse -q --verify "refs/tags/{version}"')
if rc == 0:
# tag already exists, del... | [
"os.system",
"pypandoc.convert_file",
"sys.exit",
"os.remove"
] | [((216, 277), 'os.system', 'os.system', (['f"""git rev-parse -q --verify "refs/tags/{version}\\""""'], {}), '(f\'git rev-parse -q --verify "refs/tags/{version}"\')\n', (225, 277), False, 'import os\n'), ((448, 479), 'os.system', 'os.system', (['f"""git tag {version}"""'], {}), "(f'git tag {version}')\n", (457, 479), Fa... |
try:
import unittest2 as unittest
except ImportError:
import unittest
from ropetest import testutils
from rope.contrib.fixmodnames import FixModuleNames
from rope.contrib.generate import create_module, create_package
# HACK: for making this test work on case-insensitive file-systems, it
# uses a name.replac... | [
"rope.contrib.fixmodnames.FixModuleNames",
"rope.contrib.generate.create_module",
"ropetest.testutils.remove_project",
"ropetest.testutils.sample_project",
"rope.contrib.generate.create_package",
"unittest.main"
] | [((2212, 2227), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2225, 2227), False, 'import unittest\n'), ((477, 503), 'ropetest.testutils.sample_project', 'testutils.sample_project', ([], {}), '()\n', (501, 503), False, 'from ropetest import testutils\n'), ((537, 575), 'ropetest.testutils.remove_project', 'testut... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from examples.eval_model import setup_args
import ast
import unittest
import parlai.core.testing_utils as testing_utils
... | [
"unittest.main",
"examples.eval_model.setup_args",
"ast.literal_eval",
"parlai.core.testing_utils.eval_model"
] | [((1371, 1386), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1384, 1386), False, 'import unittest\n'), ((507, 519), 'examples.eval_model.setup_args', 'setup_args', ([], {}), '()\n', (517, 519), False, 'from examples.eval_model import setup_args\n'), ((822, 851), 'parlai.core.testing_utils.eval_model', 'testing_... |
#!/usr/bin/env python3
import json
import urllib.request
import configparser
import sys
import os.path
import argparse
def main():
try:
# Obligatory Variables
ios_neigh_grp_v4 = None
ios_neigh_grp_v6 = None
xr_neigh_grp_v4 = None
xr_neigh_grp_v6 = None
op_sys = No... | [
"json.loads",
"configparser.ConfigParser",
"argparse.ArgumentParser",
"sys.exit"
] | [((640, 686), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Peerpal"""'}), "(description='Peerpal')\n", (663, 686), False, 'import argparse\n'), ((8267, 8291), 'json.loads', 'json.loads', (['str_json_obj'], {}), '(str_json_obj)\n', (8277, 8291), False, 'import json\n'), ((9022, 9046), '... |
import os
import json
from utils import load_datasets, load_target, save_submission
import models
from models.tuning import beyesian_optimization
from models.evaluation import cross_validation_score
from lightgbm.sklearn import LGBMClassifier
from sklearn.ensemble import StackingClassifier, RandomForestClassifier, Extr... | [
"numpy.mean",
"sklearn.linear_model.RidgeClassifier",
"lightgbm.sklearn.LGBMClassifier",
"keras.layers.core.Activation",
"sklearn.ensemble.ExtraTreesClassifier",
"keras.layers.advanced_activations.PReLU",
"utils.load_target",
"sklearn.ensemble.RandomForestClassifier",
"keras.models.Sequential",
"t... | [((1170, 1203), 'utils.load_datasets', 'load_datasets', (["config['features']"], {}), "(config['features'])\n", (1183, 1203), False, 'from utils import load_datasets, load_target, save_submission\n'), ((1214, 1230), 'utils.load_target', 'load_target', (['"""Y"""'], {}), "('Y')\n", (1225, 1230), False, 'from utils impor... |
import tornado.httpserver
import tornado.ioloop
import tornado.options
import tornado.web
import tornado.websocket
from hottubapi import HotTubAPI
from datetime import timedelta
import json
from rx.scheduler.eventloop import AsyncIOScheduler
import asyncio
ioloop = tornado.ioloop.IOLoop.current()
class FancySocketHan... | [
"json.loads",
"rx.scheduler.eventloop.AsyncIOScheduler",
"json.dumps",
"hottubapi.HotTubAPI",
"datetime.timedelta",
"asyncio.get_event_loop"
] | [((1081, 1098), 'json.dumps', 'json.dumps', (['j_msg'], {}), '(j_msg)\n', (1091, 1098), False, 'import json\n'), ((1614, 1633), 'json.loads', 'json.loads', (['message'], {}), '(message)\n', (1624, 1633), False, 'import json\n'), ((2623, 2647), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (2645,... |
#________HEADER FILES_______
import tkinter
from tkinter import*
#from tkvideo import tkvideo
from tkinter import ttk
from tkinter import filedialog
from _cffi_backend import callback
from PIL import ImageTk, Image
import cv2
from cv2 import *
import numpy as np
import sys
import time
import argparse
import imutils
fr... | [
"numpy.clip",
"tkinter.ttk.Scale",
"numpy.ones",
"numpy.array",
"cv2.destroyAllWindows",
"cv2.waitKey",
"numpy.float32",
"tkinter.filedialog.askopenfilename"
] | [((398, 423), 'numpy.ones', 'np.ones', (['(3, 3)', 'np.uint8'], {}), '((3, 3), np.uint8)\n', (405, 423), True, 'import numpy as np\n'), ((434, 459), 'numpy.ones', 'np.ones', (['(3, 3)', 'np.uint8'], {}), '((3, 3), np.uint8)\n', (441, 459), True, 'import numpy as np\n'), ((2645, 2812), 'tkinter.filedialog.askopenfilenam... |
##############################################################################
# Copyright (c) 2016 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.... | [
"traceback.format_stack",
"Helpers.Alias.AliasMgr.GetAlias"
] | [((1130, 1168), 'Helpers.Alias.AliasMgr.GetAlias', 'Alias.AliasMgr.GetAlias', (['"""WORKING_DIR"""'], {}), "('WORKING_DIR')\n", (1153, 1168), False, 'from Helpers import Alias\n'), ((1234, 1258), 'traceback.format_stack', 'traceback.format_stack', ([], {}), '()\n', (1256, 1258), False, 'import traceback\n')] |
import os
from pymongo import MongoClient
DEFAULT_MONGODB_HOST = "mongodb://mongo:password@127.0.0.1:27017"
def create_client() -> MongoClient:
host = os.getenv("MONGODB_HOST", DEFAULT_MONGODB_HOST)
return MongoClient(host)
| [
"pymongo.MongoClient",
"os.getenv"
] | [((159, 206), 'os.getenv', 'os.getenv', (['"""MONGODB_HOST"""', 'DEFAULT_MONGODB_HOST'], {}), "('MONGODB_HOST', DEFAULT_MONGODB_HOST)\n", (168, 206), False, 'import os\n'), ((218, 235), 'pymongo.MongoClient', 'MongoClient', (['host'], {}), '(host)\n', (229, 235), False, 'from pymongo import MongoClient\n')] |
from collections import defaultdict
from django.core.exceptions import ValidationError
from django.db.models import Model
from django.utils.translation import gettext_lazy as _
from django.core.validators import EMPTY_VALUES
# Create your models here.
class ConditionalValidatorMixin(Model):
"""
Checks conditio... | [
"collections.defaultdict",
"django.core.exceptions.ValidationError"
] | [((2138, 2155), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (2149, 2155), False, 'from collections import defaultdict\n'), ((3214, 3238), 'django.core.exceptions.ValidationError', 'ValidationError', (['e_array'], {}), '(e_array)\n', (3229, 3238), False, 'from django.core.exceptions import Vali... |
import numpy as np
import pandas as pd
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import minimum_spanning_tree
# https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.csgraph.minimum_spanning_tree.html
# Euclidean distance
def dist(p1, p2):
return np.sqrt(sum([(a - b) ** 2 for a, b ... | [
"pandas.DataFrame",
"numpy.array",
"numpy.tril_indices_from",
"scipy.sparse.csgraph.minimum_spanning_tree"
] | [((625, 642), 'pandas.DataFrame', 'pd.DataFrame', (['mat'], {}), '(mat)\n', (637, 642), True, 'import pandas as pd\n'), ((869, 893), 'scipy.sparse.csgraph.minimum_spanning_tree', 'minimum_spanning_tree', (['X'], {}), '(X)\n', (890, 893), False, 'from scipy.sparse.csgraph import minimum_spanning_tree\n'), ((653, 680), '... |
from typing import List
import databases
import sqlalchemy
from fastapi import FastAPI, status
from fastapi.middleware.cors import CORSMiddleware
from pydantic import BaseModel, BaseSettings
import os
import urllib
from dotenv_settings_handler import BaseSettingsHandler
from dotenv import load_dotenv
load_dotenv()
#... | [
"fastapi.FastAPI",
"databases.Database",
"os.getenv",
"sqlalchemy.create_engine",
"dotenv.load_dotenv",
"sqlalchemy.MetaData",
"sqlalchemy.Column"
] | [((304, 317), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (315, 317), False, 'from dotenv import load_dotenv\n'), ((1115, 1140), 'os.getenv', 'os.getenv', (['"""DATABASE_URL"""'], {}), "('DATABASE_URL')\n", (1124, 1140), False, 'import os\n'), ((1280, 1306), 'databases.Database', 'databases.Database', (['db_... |
import argparse
import logging
import sys
import yaml
try:
from yaml import CFullLoader as Loader
except ImportError:
from yaml import FullLoader as Loader
from cerberus import Validator
from distutils.util import strtobool
from pathlib import Path
seen_fields = {}
class CustomValidator(Validator):
def... | [
"logging.basicConfig",
"argparse.ArgumentParser",
"pathlib.Path",
"yaml.dump",
"yaml.load",
"sys.exit",
"logging.info",
"logging.error"
] | [((3564, 3651), 'logging.info', 'logging.info', (['f"""😘\tValidating \'{document_path}\' against schema \'{schema_path}\'..."""'], {}), '(\n f"😘\\tValidating \'{document_path}\' against schema \'{schema_path}\'...")\n', (3576, 3651), False, 'import logging\n'), ((4013, 4109), 'logging.basicConfig', 'logging.basicC... |
"""Support for Rainwise IP-100 service."""
import asyncio
import logging
import async_timeout
import aiohttp
import voluptuous as vol
from bs4 import BeautifulSoup
import homeassistant.helpers.config_validation as cv
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.helpers.aiohttp_client... | [
"logging.getLogger",
"voluptuous.Required",
"async_timeout.timeout",
"asyncio.wait",
"bs4.BeautifulSoup",
"voluptuous.Length",
"voluptuous.In",
"homeassistant.helpers.event.async_call_later",
"voluptuous.Optional",
"homeassistant.helpers.aiohttp_client.async_get_clientsession"
] | [((629, 656), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (646, 656), False, 'import logging\n'), ((2068, 2090), 'voluptuous.Required', 'vol.Required', (['CONF_URL'], {}), '(CONF_URL)\n', (2080, 2090), True, 'import voluptuous as vol\n'), ((2111, 2170), 'voluptuous.Optional', 'vol.Opti... |
import re
import time
from selenium import webdriver
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from xml.dom import minidom
from tqdm import tqdm
import datetime
from datetime import datetime
from xml.dom import minidom
from tq... | [
"util.get_config_information",
"xml.dom.minidom.Document"
] | [((451, 469), 'xml.dom.minidom.Document', 'minidom.Document', ([], {}), '()\n', (467, 469), False, 'from xml.dom import minidom\n'), ((417, 441), 'util.get_config_information', 'get_config_information', ([], {}), '()\n', (439, 441), False, 'from util import get_config_information\n')] |
from django.urls import path
from django.urls import re_path
from . import views
app_name = 'events'
urlpatterns = [
path('', views.user_created, name='user_events'),
path('new', views.create_event, name='new_event'),
path('<int:pk>', views.event_detail, name='event_detail'),
path('<int:pk>/edit/', vi... | [
"django.urls.path"
] | [((123, 171), 'django.urls.path', 'path', (['""""""', 'views.user_created'], {'name': '"""user_events"""'}), "('', views.user_created, name='user_events')\n", (127, 171), False, 'from django.urls import path\n'), ((177, 226), 'django.urls.path', 'path', (['"""new"""', 'views.create_event'], {'name': '"""new_event"""'})... |
from django.test import RequestFactory
from test_plus.test import TestCase
from django.urls.base import reverse
from ..views import (
UserRedirectView,
)
class BaseUserTestCase(TestCase):
def setUp(self):
self.user = self.make_user()
self.factory = RequestFactory()
class TestUserRedirectV... | [
"django.test.RequestFactory",
"django.urls.base.reverse"
] | [((278, 294), 'django.test.RequestFactory', 'RequestFactory', ([], {}), '()\n', (292, 294), False, 'from django.test import RequestFactory\n'), ((892, 917), 'django.urls.base.reverse', 'reverse', (['"""borrowing:home"""'], {}), "('borrowing:home')\n", (899, 917), False, 'from django.urls.base import reverse\n')] |
import os
import tempfile
from bibclean import CleanUp
from bibclean.IO import loaders
BIBLIOGRAPHY_TEST_DIR = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
"test_data",
"bibliographies",
)
BIBLIOGRAPHY_GROUNDTRUTH_DIR = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
"tes... | [
"bibclean.IO.loaders.load_bibtex_file",
"os.path.join",
"os.path.realpath",
"tempfile.mkdtemp",
"bibclean.CleanUp.process_bib"
] | [((522, 540), 'tempfile.mkdtemp', 'tempfile.mkdtemp', ([], {}), '()\n', (538, 540), False, 'import tempfile\n'), ((559, 611), 'os.path.join', 'os.path.join', (['CONFIG_TEST_DIR', '"""default_config.yaml"""'], {}), "(CONFIG_TEST_DIR, 'default_config.yaml')\n", (571, 611), False, 'import os\n'), ((627, 678), 'os.path.joi... |
# ----------------------------------------------------------------------------
# cocos2d
# Copyright (c) 2008-2012 <NAME>, <NAME>, <NAME>,
# <NAME>
# Copyright (c) 2009-2019 <NAME>, <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provid... | [
"pyglet.resource.image",
"cocos.actions.RotateTo",
"pyglet.gl.glPushMatrix",
"pyglet.font.load",
"cocos.rect.contains",
"cocos.sprite.Sprite",
"cocos.actions.ScaleTo",
"cocos.director.director.get_window_size",
"pyglet.graphics.draw",
"cocos.actions.Reverse",
"cocos.director.director.get_virtual... | [((3442, 3468), 'cocos.director.director.get_window_size', 'director.get_window_size', ([], {}), '()\n', (3466, 3468), False, 'from cocos.director import director\n'), ((3478, 3545), 'pyglet.font.load', 'font.load', (["menu.font_item['font_name']", "menu.font_item['font_size']"], {}), "(menu.font_item['font_name'], men... |
# -*- coding: utf-8 -*-
import collections
import logging
import threading
import time
from contextlib import closing
from .block import Block, BlockHeader
from .bitcoin import Bitcoin
from .serialize import Serialize
from .script import Script
from .util import bytes_to_hexstring, target_to_bits, bits_to_target
from... | [
"logging.getLogger",
"collections.OrderedDict",
"collections.deque",
"threading.Lock",
"collections.defaultdict",
"time.time"
] | [((358, 386), 'logging.getLogger', 'logging.getLogger', (['"""default"""'], {}), "('default')\n", (375, 386), False, 'import logging\n'), ((885, 901), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (899, 901), False, 'import threading\n'), ((2182, 2210), 'collections.defaultdict', 'collections.defaultdict', (['s... |
from django.shortcuts import render,redirect
from django.http import HttpResponseNotFound
from .models import Cart,Shipment
from product.models import Product
from account.models import Address
from django.contrib.auth.models import User,auth
def cart_data_add(cid):
data = Cart.objects.filter(customer_id=cid,shipm... | [
"django.shortcuts.render",
"product.models.Product.objects.filter",
"account.models.Address.objects.filter",
"django.shortcuts.redirect",
"django.http.HttpResponseNotFound"
] | [((1661, 1674), 'django.shortcuts.redirect', 'redirect', (['"""/"""'], {}), "('/')\n", (1669, 1674), False, 'from django.shortcuts import render, redirect\n'), ((2571, 2587), 'django.shortcuts.redirect', 'redirect', (['"""cart"""'], {}), "('cart')\n", (2579, 2587), False, 'from django.shortcuts import render, redirect\... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import os
import re
import sys
import time
import argparse
import subprocess
try:
import rich, Crypto
except ModuleNotFoundError as e:
print('\n[!] 遇到致命错误!')
print('\n[!] 模块rich, pycryptodome未安装, 请在终端中执行命令`pip3 install rich pycryptodome`进行安装.\n')
print('[!] 程... | [
"time.sleep",
"utils.InjectMsf2App.InjectMsf2App",
"sys.__excepthook__",
"re.search",
"os.path.exists",
"os.listdir",
"argparse.ArgumentParser",
"subprocess.Popen",
"utils.ZipApkFile.ZipApkFile",
"utils.JarCommand.JarCommand",
"os.path.isdir",
"os.mkdir",
"utils.EncryptFile.EncryptFile",
"... | [((1242, 1347), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': 'f"""520ApkHook Apk注入工具 v1.1"""', 'formatter_class': 'RawTextHelpFormatter'}), "(description=f'520ApkHook Apk注入工具 v1.1',\n formatter_class=RawTextHelpFormatter)\n", (1265, 1347), False, 'import argparse\n'), ((2420, 2433), 'ti... |
from raft import Collection, task, call
from package import module
@task
def top_pre(c):
pass
@task(call(top_pre))
def toplevel(c):
pass
ns = Collection(module, toplevel)
| [
"raft.Collection",
"raft.call"
] | [((157, 185), 'raft.Collection', 'Collection', (['module', 'toplevel'], {}), '(module, toplevel)\n', (167, 185), False, 'from raft import Collection, task, call\n'), ((109, 122), 'raft.call', 'call', (['top_pre'], {}), '(top_pre)\n', (113, 122), False, 'from raft import Collection, task, call\n')] |
import logging
import re
import socket
from cloud_info import exceptions
from cloud_info import providers
from cloud_info import utils
import keystoneauth1.exceptions.http
from six.moves.urllib.parse import urljoin
from six.moves.urllib.parse import urlparse
try:
import requests
except ImportError:
msg = 'Ca... | [
"logging.getLogger",
"OpenSSL.SSL.Context",
"requests.packages.urllib3.disable_warnings",
"keystoneauth1.loading.load_auth_from_argparse_arguments",
"cloud_info.providers.static.StaticProvider",
"socket.socket",
"cloud_info.utils.env",
"six.moves.urllib.parse.urlparse",
"keystoneauth1.loading.base.g... | [((360, 402), 'cloud_info.exceptions.OpenStackProviderException', 'exceptions.OpenStackProviderException', (['msg'], {}), '(msg)\n', (397, 402), False, 'from cloud_info import exceptions\n'), ((510, 552), 'cloud_info.exceptions.OpenStackProviderException', 'exceptions.OpenStackProviderException', (['msg'], {}), '(msg)\... |
# Copyright 2020, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | [
"tensorflow_federated.python.learning.model_update_aggregator.robust_aggregator",
"tensorflow_federated.python.learning.model_update_aggregator.compression_aggregator",
"tensorflow_federated.python.core.backends.mapreduce.form_utils.get_map_reduce_form_for_iterative_process",
"tensorflow_federated.python.core... | [((1443, 1483), 'tensorflow_federated.python.core.impl.types.computation_types.TensorType', 'computation_types.TensorType', (['tf.float32'], {}), '(tf.float32)\n', (1471, 1483), False, 'from tensorflow_federated.python.core.impl.types import computation_types\n'), ((1505, 1557), 'tensorflow_federated.python.core.impl.t... |
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 17 13:38:07 2021
@author: zayn
"""
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 17 12:07:50 2021
@author: zayn
"""
"""
Linear regression implementation.
"""
import numpy as np
import matplotlib.pyplot as plt
class lgreg:
""" implementati... | [
"numpy.mean",
"numpy.log",
"numpy.asarray",
"numpy.exp",
"numpy.zeros",
"numpy.std",
"matplotlib.pyplot.subplots",
"numpy.round"
] | [((1122, 1136), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (1134, 1136), True, 'import matplotlib.pyplot as plt\n'), ((1918, 1939), 'numpy.zeros', 'np.zeros', (['theta.shape'], {}), '(theta.shape)\n', (1926, 1939), True, 'import numpy as np\n'), ((2243, 2262), 'numpy.zeros', 'np.zeros', (['num_iter... |
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
# This sc... | [
"azure.keyvault.KeyVaultAuthentication",
"azure.common.credentials.ServicePrincipalCredentials",
"adal.AuthenticationContext",
"azure.keyvault.KeyVaultClient"
] | [((1903, 2032), 'azure.common.credentials.ServicePrincipalCredentials', 'ServicePrincipalCredentials', ([], {'client_id': 'self.config.client_id', 'secret': 'self.config.client_secret', 'tenant': 'self.config.tenant_id'}), '(client_id=self.config.client_id, secret=self.\n config.client_secret, tenant=self.config.ten... |
import unittest
from math import sin
#import window.viewport
from window.viewport import viewport
class TestLoad(unittest.TestCase):
def test_defaults(self):
w2v = viewport( Wb = 0, Wt = 1, Wl = 0, Wr = 1, Vb = 9, Vt = 0, Vl = 0, Vr = 9 )
self.assertEqual( w2v.Dx(.5), 4.5, 'correct Dx()' )
... | [
"unittest.main",
"math.sin",
"window.viewport.viewport"
] | [((1336, 1351), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1349, 1351), False, 'import unittest\n'), ((178, 234), 'window.viewport.viewport', 'viewport', ([], {'Wb': '(0)', 'Wt': '(1)', 'Wl': '(0)', 'Wr': '(1)', 'Vb': '(9)', 'Vt': '(0)', 'Vl': '(0)', 'Vr': '(9)'}), '(Wb=0, Wt=1, Wl=0, Wr=1, Vb=9, Vt=0, Vl=0, ... |
from atexit import register
from copy import Error
import cv2
import os
from detectron2.config import get_cfg
from detectron2.engine import DefaultPredictor
from detectron2.data.datasets import register_coco_instances
from detectron2.data import MetadataCatalog, DatasetCatalog
from detectron2 import model_zoo
from dete... | [
"detectron2.data.datasets.register_coco_instances",
"detectron2.config.get_cfg",
"detectron2.utils.visualizer.Visualizer",
"detectron2.data.MetadataCatalog.get",
"detectron2.engine.DefaultPredictor",
"cv2.imread",
"detectron2.data.DatasetCatalog.get"
] | [((971, 1097), 'detectron2.data.datasets.register_coco_instances', 'register_coco_instances', (['self.valsetname', '{}', "('../dataset/' + setname + '/coco/val.json')", "('../dataset/' + setname + '/val')"], {}), "(self.valsetname, {}, '../dataset/' + setname +\n '/coco/val.json', '../dataset/' + setname + '/val')\n... |
from StaticMethods.Exceptions import exception
from StaticMethods.CalulcateMean import calMean
from StaticMethods.PopulationStandardDeviation import stddev
from StaticMethods.addition import addition
from StaticMethods.division import division
from StaticMethods.multiplication import multiplication
from StaticMethods.r... | [
"StaticMethods.CalulcateMean.calMean",
"StaticMethods.PopulationStandardDeviation.stddev",
"StaticMethods.roundOff.roundOff",
"StaticMethods.division.division",
"StaticMethods.subtraction.subtraction"
] | [((437, 452), 'StaticMethods.CalulcateMean.calMean', 'calMean', (['xArray'], {}), '(xArray)\n', (444, 452), False, 'from StaticMethods.CalulcateMean import calMean\n'), ((465, 480), 'StaticMethods.CalulcateMean.calMean', 'calMean', (['yArray'], {}), '(yArray)\n', (472, 480), False, 'from StaticMethods.CalulcateMean imp... |
import json
import requests
from util.logging import get_logger
from util.util import postpone
logger = get_logger(__name__)
EVENTS_API_URI = "api/v1/events"
class DataDogWrapper:
def __init__(self, base_url: str, api_key: str):
self.base_url = base_url
self.api_key = api_key
self.url ... | [
"json.dumps",
"util.logging.get_logger"
] | [((107, 127), 'util.logging.get_logger', 'get_logger', (['__name__'], {}), '(__name__)\n', (117, 127), False, 'from util.logging import get_logger\n'), ((478, 495), 'json.dumps', 'json.dumps', (['event'], {}), '(event)\n', (488, 495), False, 'import json\n')] |
import numpy as np
import deerlab as dl
#---------------------------------------------------------------------------------------
def assert_bgmodel(model,Bref):
"Check the correct behaviour of the core functionality of a background model"
t = np.linspace(-5,5,500)
# Extract model information
... | [
"numpy.linspace",
"numpy.isnan"
] | [((263, 286), 'numpy.linspace', 'np.linspace', (['(-5)', '(5)', '(500)'], {}), '(-5, 5, 500)\n', (274, 286), True, 'import numpy as np\n'), ((724, 736), 'numpy.isnan', 'np.isnan', (['B1'], {}), '(B1)\n', (732, 736), True, 'import numpy as np\n'), ((747, 759), 'numpy.isnan', 'np.isnan', (['B2'], {}), '(B2)\n', (755, 759... |
import numpy as np
# from scp import SCP
from main_komo import run_komo_standalone
from utils_motion_primitives import sort_primitives, visualize_motion, plot_stats
import robots
import yaml
import msgpack
import multiprocessing as mp
import tqdm
import itertools
import argparse
import subprocess
import tempfile
from p... | [
"tempfile.TemporaryDirectory",
"utils_motion_primitives.sort_primitives",
"msgpack.pack",
"argparse.ArgumentParser",
"pathlib.Path",
"yaml.dump",
"utils_motion_primitives.plot_stats",
"yaml.load",
"numpy.linalg.norm",
"os.getcwd",
"time.sleep",
"numpy.array",
"yaml.safe_load",
"psutil.cpu_... | [((413, 424), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (422, 424), False, 'import sys, os\n'), ((4006, 4023), 'pathlib.Path', 'Path', (['"""../tuning"""'], {}), "('../tuning')\n", (4010, 4023), False, 'from pathlib import Path\n'), ((4196, 4239), 'motionplanningutils.RobotHelper', 'RobotHelper', (['robot_type', "myc... |
"""
file: list_mode_data_decoder.py
brief: Decodes binary data produced by an XIA Pixie16 module
author: <NAME>
date: January 17, 2019
"""
from enum import Enum
from functools import partial
from io import BytesIO
from struct import unpack
from dolosse.constants.data import WORD, HALF_WORD
class HeaderCodes(Enum):
... | [
"struct.unpack",
"functools.partial"
] | [((4427, 4450), 'functools.partial', 'partial', (['buf.read', 'WORD'], {}), '(buf.read, WORD)\n', (4434, 4450), False, 'from functools import partial\n'), ((4797, 4825), 'functools.partial', 'partial', (['buf.read', 'HALF_WORD'], {}), '(buf.read, HALF_WORD)\n', (4804, 4825), False, 'from functools import partial\n'), (... |
from flask.ext.wtf import Form
from wtforms import StringField, TextAreaField, HiddenField, RadioField
from wtforms.validators import DataRequired
class InitForm(Form):
master = HiddenField('마스터키')
vote_name = StringField('투표명', validators=[DataRequired()])
detail = TextAreaField('질문')
response = Stri... | [
"wtforms.HiddenField",
"wtforms.validators.DataRequired",
"wtforms.TextAreaField"
] | [((184, 203), 'wtforms.HiddenField', 'HiddenField', (['"""마스터키"""'], {}), "('마스터키')\n", (195, 203), False, 'from wtforms import StringField, TextAreaField, HiddenField, RadioField\n'), ((281, 300), 'wtforms.TextAreaField', 'TextAreaField', (['"""질문"""'], {}), "('질문')\n", (294, 300), False, 'from wtforms import StringFi... |
import json
import time
from datetime import datetime
import dataset
import requests
import schedule
from voteleader import db
def update_db():
"""uri = "https://holybread.io/leaderboard_api/"
payload = {"type": "leaderboard", "amount": 160}
r = requests.get(uri, data=json.dumps(payload))
json_repso... | [
"voteleader.db.create_table",
"schedule.run_pending",
"time.sleep",
"voteleader.db.commit",
"schedule.every",
"datetime.datetime.now",
"json.load"
] | [((355, 404), 'voteleader.db.create_table', 'db.create_table', (['"""leaderboard"""'], {'primary_id': '"""rank"""'}), "('leaderboard', primary_id='rank')\n", (370, 404), False, 'from voteleader import db\n'), ((724, 735), 'voteleader.db.commit', 'db.commit', ([], {}), '()\n', (733, 735), False, 'from voteleader import ... |
# Feel free to modifiy this file.
# It will only be used to verify the settings are correct
import os
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision import datasets, transforms, models
from dataloader import CustomDataset
from submission import get_model
parser... | [
"submission.get_model",
"argparse.ArgumentParser",
"torch.nn.CrossEntropyLoss",
"os.makedirs",
"dataloader.CustomDataset",
"os.path.join",
"torch.nn.DataParallel",
"torch.utils.data.DataLoader",
"torchvision.transforms.ToTensor"
] | [((323, 348), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (346, 348), False, 'import argparse\n'), ((508, 580), 'dataloader.CustomDataset', 'CustomDataset', ([], {'root': '"""/dataset"""', 'split': '"""train"""', 'transform': 'train_transform'}), "(root='/dataset', split='train', transform=t... |
# -*- coding: utf-8 -*-
"""Dialogo para salvar arquivo.
Para testar está sendo salvo um arquivo vazio do tipo ``txt``.
"""
from pathlib import Path
import gi
gi.require_version(namespace='Gtk', version='3.0')
from gi.repository import Gtk
class MainWindow(Gtk.ApplicationWindow):
def __init__(self):
sup... | [
"gi.repository.Gtk.FileFilter",
"gi.repository.Gtk.Box.new",
"pathlib.Path.home",
"gi.require_version",
"gi.repository.Gtk.Button.new_with_label",
"gi.repository.Gtk.main"
] | [((161, 211), 'gi.require_version', 'gi.require_version', ([], {'namespace': '"""Gtk"""', 'version': '"""3.0"""'}), "(namespace='Gtk', version='3.0')\n", (179, 211), False, 'import gi\n'), ((3074, 3084), 'gi.repository.Gtk.main', 'Gtk.main', ([], {}), '()\n', (3082, 3084), False, 'from gi.repository import Gtk\n'), ((6... |
from boundaries.models import Boundary
from django.contrib.gis.geos import Point
from django.contrib.gis.measure import D
from django.db.models import Sum
from rest_framework import status, viewsets
from rest_framework.decorators import action
from rest_framework.response import Response
from .filters import Hospitals... | [
"django.contrib.gis.measure.D",
"rest_framework.response.Response",
"rest_framework.decorators.action",
"django.db.models.Sum"
] | [((572, 609), 'rest_framework.decorators.action', 'action', ([], {'detail': '(False)', 'methods': "['get']"}), "(detail=False, methods=['get'])\n", (578, 609), False, 'from rest_framework.decorators import action\n'), ((773, 810), 'rest_framework.decorators.action', 'action', ([], {'detail': '(False)', 'methods': "['ge... |
"""
Functions to handle deprecated settings
"""
import logging
from typing import Any, Dict
from freqtrade import OperationalException
logger = logging.getLogger(__name__)
def check_conflicting_settings(config: Dict[str, Any],
section1: str, name1: str,
... | [
"logging.getLogger",
"freqtrade.OperationalException"
] | [((148, 175), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (165, 175), False, 'import logging\n'), ((520, 836), 'freqtrade.OperationalException', 'OperationalException', (['f"""Conflicting settings `{section1}.{name1}` and `{section2}.{name2}` (DEPRECATED) detected in the configuration ... |
# Generated by Django 3.0.2 on 2020-01-14 02:05
import attendees.persons.models.utility
from django.db import migrations, models
import django.utils.timezone
import model_utils.fields
class Migration(migrations.Migration):
dependencies = [
('whereabouts', '0003_address'),
('occasions', '0001_ass... | [
"django.db.models.SET",
"django.db.models.UniqueConstraint",
"django.db.models.ManyToManyField",
"django.db.models.BooleanField",
"django.db.models.BigAutoField",
"django.db.models.CharField"
] | [((1615, 1705), 'django.db.models.ManyToManyField', 'models.ManyToManyField', ([], {'through': '"""occasions.AssemblyAddress"""', 'to': '"""whereabouts.Address"""'}), "(through='occasions.AssemblyAddress', to=\n 'whereabouts.Address')\n", (1637, 1705), False, 'from django.db import migrations, models\n'), ((1812, 18... |
import unittest
import uuid
import requests
SERVICE_URL = 'http://localhost:8080'
class MyTestCase(unittest.TestCase):
def test_status_returns_ok(self):
r = requests.get(f'{SERVICE_URL}/status')
self.assertEqual('OK', r.json()['status'])
def test_version_returns_some_version(self):
... | [
"requests.post",
"requests.get",
"uuid.uuid4",
"requests.put",
"unittest.main"
] | [((2853, 2868), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2866, 2868), False, 'import unittest\n'), ((174, 211), 'requests.get', 'requests.get', (['f"""{SERVICE_URL}/status"""'], {}), "(f'{SERVICE_URL}/status')\n", (186, 211), False, 'import requests\n'), ((325, 363), 'requests.get', 'requests.get', (['f"""{... |
"""
Copyright (C) Microsoft Corporation. All rights reserved.
Microsoft Corporation (“Microsoft”) grants you a nonexclusive, perpetual,
royalty-free right to use, copy, and modify the software code provided by us
("Software Code"). You may not sublicense the Software Code or any use of it
(except to your affiliates... | [
"json.dumps",
"inspect.signature",
"scipy.sparse.issparse",
"types.append",
"types.MethodType",
"json.dump"
] | [((5616, 5646), 'scipy.sparse.issparse', 'issparse', (['df_series_or_ndarray'], {}), '(df_series_or_ndarray)\n', (5624, 5646), False, 'from scipy.sparse import issparse\n'), ((2223, 2246), 'inspect.signature', 'inspect.signature', (['meth'], {}), '(meth)\n', (2240, 2246), False, 'import inspect\n'), ((5438, 5472), 'jso... |
from sense_hat import SenseHat
import random
import time
sense = SenseHat()
while True:
for i in ("N", "M","D"):
c = (random.randint(1,256),random.randint(1,256),random.randint(1,256))
sense.show_letter(str(i),text_colour=c)
time.sleep(1)
time.sleep(2) | [
"sense_hat.SenseHat",
"random.randint",
"time.sleep"
] | [((66, 76), 'sense_hat.SenseHat', 'SenseHat', ([], {}), '()\n', (74, 76), False, 'from sense_hat import SenseHat\n'), ((259, 272), 'time.sleep', 'time.sleep', (['(2)'], {}), '(2)\n', (269, 272), False, 'import time\n'), ((243, 256), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (253, 256), False, 'import time\n')... |
from extensions.db import db
class User(db.Model):
user_id = db.Column(db.String(60), primary_key=True)
token = db.Column(db.String(60), unique=True, index=True)
@staticmethod
def find(user_id: str):
return User.query.filter_by(user_id=user_id).first()
@staticmethod
def find_by_token... | [
"extensions.db.db.String"
] | [((77, 90), 'extensions.db.db.String', 'db.String', (['(60)'], {}), '(60)\n', (86, 90), False, 'from extensions.db import db\n'), ((132, 145), 'extensions.db.db.String', 'db.String', (['(60)'], {}), '(60)\n', (141, 145), False, 'from extensions.db import db\n')] |
from dataclasses import astuple, fields
from pywps import LiteralInput
from ravenpy.models import HBVEC
from raven import config
from raven.processes import RavenProcess
from . import wpsio as wio
# Defaults for this process
params_defaults = HBVEC.Params(
par_x01=0.05984519,
par_x02=4.072232,
par_x03=2... | [
"ravenpy.models.HBVEC.Params",
"dataclasses.astuple",
"dataclasses.fields"
] | [((247, 673), 'ravenpy.models.HBVEC.Params', 'HBVEC.Params', ([], {'par_x01': '(0.05984519)', 'par_x02': '(4.072232)', 'par_x03': '(2.001574)', 'par_x04': '(0.03473693)', 'par_x05': '(0.09985144)', 'par_x06': '(0.506052)', 'par_x07': '(3.438486)', 'par_x08': '(38.32455)', 'par_x09': '(0.4606565)', 'par_x10': '(0.063037... |
# coding: utf-8
"""
UltraCart Rest API V2
UltraCart REST API Version 2 # noqa: E501
OpenAPI spec version: 2.0.0
Contact: <EMAIL>
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class LibraryItem(object):
"""NOTE: This... | [
"six.iteritems"
] | [((37229, 37262), 'six.iteritems', 'six.iteritems', (['self.swagger_types'], {}), '(self.swagger_types)\n', (37242, 37262), False, 'import six\n')] |
from tkinter import *
from tkinter import filedialog
import os
import requests
from dna_get import main as encrypt
from dna_gdt import main as decrypt
import requests
import json
from tkinter import messagebox
root = Tk()
root.geometry("500x500")
root.title("DNA Based Encryption and decryption of confiden... | [
"tkinter.messagebox.showwarning",
"json.loads",
"tkinter.messagebox.showerror",
"requests.get",
"dna_gdt.main",
"dna_get.main",
"tkinter.messagebox.showinfo",
"tkinter.filedialog.askopenfilename"
] | [((694, 758), 'requests.get', 'requests.get', (["('http://localhost/phpfiles/store.php?text=' + text)"], {}), "('http://localhost/phpfiles/store.php?text=' + text)\n", (706, 758), False, 'import requests\n'), ((1013, 1067), 'requests.get', 'requests.get', (['"""http://localhost/phpfiles/retrieve.php"""'], {}), "('http:... |
"""
元 - meta
元数据 - 描述数据的数据 - metadata
元类 - 描述类的类 - metaclass - 继承自type
"""
import threading
class SingletonMeta(type):
"""自定义元类"""
def __init__(cls, *args, **kwargs):
cls.__instance = None
cls.lock = threading.Lock()
super().__init__(*args, **kwargs)
def __call__(cls, *args, **kw... | [
"threading.Lock"
] | [((227, 243), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (241, 243), False, 'import threading\n')] |
"""
this module handles manages race data provider
"""
import asyncio
from autobahn.asyncio.wamp import ApplicationSession
from iracelog_service_manager.manager.registry import Registry
from iracelog_service_manager.model.eventlookup import EventLookup
class ProviderManager(ApplicationSession):
"""
handles ... | [
"asyncio.get_event_loop",
"iracelog_service_manager.manager.registry.Registry",
"iracelog_service_manager.model.eventlookup.EventLookup"
] | [((1276, 1289), 'iracelog_service_manager.model.eventlookup.EventLookup', 'EventLookup', ([], {}), '()\n', (1287, 1289), False, 'from iracelog_service_manager.model.eventlookup import EventLookup\n'), ((1353, 1393), 'iracelog_service_manager.manager.registry.Registry', 'Registry', ([], {'appSession': 'self', 'events': ... |
""" Unit tests for the finite_difference module
"""
import unittest
import numpy as np
from scipy.optimize import rosen, rosen_der, rosen_hess
from polynomials_on_simplices.calculus.finite_difference import (
central_difference, central_difference_jacobian, forward_difference, forward_difference_jacobian,
se... | [
"polynomials_on_simplices.calculus.finite_difference.forward_difference_jacobian",
"numpy.allclose",
"numpy.ones",
"numpy.random.rand",
"numpy.sin",
"numpy.testing.assert_allclose",
"scipy.optimize.rosen_der",
"polynomials_on_simplices.calculus.finite_difference.second_central_difference",
"polynomi... | [((7313, 7328), 'unittest.main', 'unittest.main', ([], {}), '()\n', (7326, 7328), False, 'import unittest\n'), ((487, 555), 'numpy.testing.assert_allclose', 'np.testing.assert_allclose', (['array1', 'array2'], {'atol': '(0.0001)', 'rtol': '(0.0001)'}), '(array1, array2, atol=0.0001, rtol=0.0001)\n', (513, 555), True, '... |
from skfem import *
import numpy as np
import matplotlib.pyplot as plt
m = MeshTri()
m.refine(5)
@bilinear_form
def jacobian(u, du, v, dv, w):
w, dw = w.w, w.dw
return 1.0/np.sqrt(1.0 + dw[0]**2 + dw[1]**2)*(du[0]*dv[0] + du[1]*dv[1])\
-(2.0*du[1]*dw[1] + 2.0*du[0]*dw[0])*(dw[1]*dv[1] + dw[0]*dv[0]... | [
"numpy.sin",
"numpy.zeros",
"numpy.sqrt",
"numpy.linalg.norm"
] | [((556, 573), 'numpy.zeros', 'np.zeros', (['basis.N'], {}), '(basis.N)\n', (564, 573), True, 'import numpy as np\n'), ((628, 653), 'numpy.sin', 'np.sin', (['(np.pi * m.p[0, D])'], {}), '(np.pi * m.p[0, D])\n', (634, 653), True, 'import numpy as np\n'), ((844, 870), 'numpy.linalg.norm', 'np.linalg.norm', (['(x - x_prev)... |
import numpy as np
import SSNMF_torch
import torch
from scipy.optimize import nnls
class SSNMF_Reuters_t:
def __init__(self, train_features, train_labels, test_features, test_labels, k, modelNum, **kwargs):
self.train_features = train_features
self.train_labels = train_labels
self.test_fe... | [
"torch.device",
"torch.argmax",
"SSNMF_torch.SSNMF_torch",
"torch.argsort",
"torch.cuda.is_available",
"torch.t",
"torch.where",
"torch.rand",
"torch.ones"
] | [((3765, 3960), 'SSNMF_torch.SSNMF_torch', 'SSNMF_torch.SSNMF_torch', ([], {'X': 'self.train_features', 'k': 'self.k', 'modelNum': 'self.modelNum', 'Y': 'self.train_labels', 'W': 'self.W_train', 'L': 'self.L', 'A': 'self.A', 'B': 'self.B', 'S': 'self.S', 'lam': 'self.lam', 'tol': 'self.tol'}), '(X=self.train_features, ... |
# -*- coding: utf-8 -*-
import markdown
from django.utils import timezone
from flask import request
from api.caching.tasks import ban_url
from osf.models import Guid
from framework.postcommit_tasks.handlers import enqueue_postcommit_task
from website import settings
from addons.base.signals import file_updated
from o... | [
"markdown.markdown",
"osf.models.Comment.objects.filter",
"website.notifications.emails.notify_mentions",
"osf.models.Node.load",
"website.notifications.emails.notify",
"osf.models.BaseFileNode.resolve_class",
"osf.models.Guid.load",
"django.utils.timezone.now",
"flask.request.get_json",
"osf.mode... | [((5157, 5265), 'markdown.markdown', 'markdown.markdown', (['content', "['del_ins', 'markdown.extensions.tables', 'markdown.extensions.fenced_code']"], {}), "(content, ['del_ins', 'markdown.extensions.tables',\n 'markdown.extensions.fenced_code'])\n", (5174, 5265), False, 'import markdown\n'), ((6050, 6064), 'django... |
#!/usr/bin/env python
# pylint: disable=unexpected-keyword-arg,too-few-public-methods
"""
Test suite for data processing, dummy data and input/output functions.
"""
import os
import sys
import shutil
import unittest
import warnings
import numpy as np
import numpy.testing
import nestcheck.data_processing
import nestchec... | [
"os.path.exists",
"os.makedirs",
"numpy.random.random",
"numpy.asarray",
"warnings.catch_warnings",
"os.path.join",
"numpy.array",
"numpy.zeros",
"numpy.array_equal",
"shutil.rmtree",
"warnings.simplefilter",
"numpy.full",
"numpy.all"
] | [((862, 892), 'os.path.exists', 'os.path.exists', (['TEST_CACHE_DIR'], {}), '(TEST_CACHE_DIR)\n', (876, 892), False, 'import os\n'), ((2339, 2363), 'numpy.asarray', 'np.asarray', (['[1, 1, 3, 5]'], {}), '([1, 1, 3, 5])\n', (2349, 2363), True, 'import numpy as np\n'), ((2385, 2410), 'numpy.asarray', 'np.asarray', (['[-1... |
import typing
from smartcast import is_dict, is_int, is_bool, is_str, is_float, is_union, is_list
def test_is_union():
assert is_union(typing.Optional[int])
assert is_union(typing.Union[int, str])
def test_is_list():
assert is_list(typing.List)
assert is_list(typing.List[int])
assert is_list(list)... | [
"smartcast.is_float",
"smartcast.is_union",
"smartcast.is_dict",
"smartcast.is_list",
"smartcast.is_bool",
"smartcast.is_int",
"smartcast.is_str"
] | [((131, 161), 'smartcast.is_union', 'is_union', (['typing.Optional[int]'], {}), '(typing.Optional[int])\n', (139, 161), False, 'from smartcast import is_dict, is_int, is_bool, is_str, is_float, is_union, is_list\n'), ((173, 205), 'smartcast.is_union', 'is_union', (['typing.Union[int, str]'], {}), '(typing.Union[int, st... |
#!/bin/python
from arroguella import game
def main():
game.run()
if __name__ == '__main__':
main()
| [
"arroguella.game.run"
] | [((60, 70), 'arroguella.game.run', 'game.run', ([], {}), '()\n', (68, 70), False, 'from arroguella import game\n')] |
from datetime import datetime
from server import db
games_genres = db.Table('games_genres', db.Model.metadata,
db.Column('game_id', db.Integer, db.ForeignKey('games.id')),
db.Column('genre_id', db.Integer, db.ForeignKey('genres.id'))
)
class S... | [
"server.db.ForeignKey",
"server.db.Column",
"server.db.relationship",
"datetime.datetime.now",
"server.db.String",
"server.db.backref"
] | [((346, 385), 'server.db.Column', 'db.Column', (['db.Integer'], {'primary_key': '(True)'}), '(db.Integer, primary_key=True)\n', (355, 385), False, 'from server import db\n'), ((400, 440), 'server.db.Column', 'db.Column', (['db.BigInteger'], {'nullable': '(False)'}), '(db.BigInteger, nullable=False)\n', (409, 440), Fals... |
import random
def nums_compressed(nums: list[int]) -> tuple[list[int], list[int]]:
"""Sums up consecutive pairs and returns new list and nums removed
>>> nums_compressed([2, 2, 4, 4, 4, 8])
([4, 8, 4, 8], [2, 4])
"""
# Processes nums as a stack with the first element at the top
stack = nums[:... | [
"random.random",
"random.choice"
] | [((3881, 3901), 'random.choice', 'random.choice', (['empty'], {}), '(empty)\n', (3894, 3901), False, 'import random\n'), ((3999, 4014), 'random.random', 'random.random', ([], {}), '()\n', (4012, 4014), False, 'import random\n')] |
from datetime import datetime
from pytz import common_timezones, timezone, exceptions as pytz_exceptions
def get_gmt_offset(tz_name, now):
try:
offset = timezone(tz_name).utcoffset(now)
except pytz_exceptions.AmbiguousTimeError: # pragma: no cover
offset = timezone(tz_name).utcoffset(now, is_... | [
"pytz.timezone",
"datetime.datetime.utcnow"
] | [((1268, 1285), 'datetime.datetime.utcnow', 'datetime.utcnow', ([], {}), '()\n', (1283, 1285), False, 'from datetime import datetime\n'), ((167, 184), 'pytz.timezone', 'timezone', (['tz_name'], {}), '(tz_name)\n', (175, 184), False, 'from pytz import common_timezones, timezone, exceptions as pytz_exceptions\n'), ((284,... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, division, print_function, absolute_import
import types
import re
import cgi
from functools import wraps
import logging
from decorators import FuncDecorator, property
from ..compat import *
from ..exception import CallError
logger = logging.getLogger(_... | [
"logging.getLogger",
"re.search"
] | [((301, 328), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (318, 328), False, 'import logging\n'), ((10344, 10365), 're.search', 're.search', (['regex', 'val'], {}), '(regex, val)\n', (10353, 10365), False, 'import re\n')] |
# Copyright 2019 <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 required by applicable law or agreed to in writing, softw... | [
"torch.ops.load_library",
"numpy.prod",
"pathlib.Path",
"platform.system",
"torch.zeros"
] | [((1295, 1328), 'torch.ops.load_library', 'torch.ops.load_library', (['_LIB_PATH'], {}), '(_LIB_PATH)\n', (1317, 1328), False, 'import torch\n'), ((1173, 1190), 'platform.system', 'platform.system', ([], {}), '()\n', (1188, 1190), False, 'import platform\n'), ((1601, 1664), 'torch.zeros', 'torch.zeros', (['*shape'], {'... |
import logging
import unittest
import tst.test_kernels
import tst.test_gaussian_process
import tst.test_rescale
import tst.test_hypergrid
import tst.test_random_optimizer
import tst.test_bayesian_optimizer
import tst.test_acquisition
def main():
# initialize
suite = unittest.TestSuite()
loader = unittest.... | [
"unittest.TestSuite",
"unittest.TextTestRunner",
"unittest.TestLoader"
] | [((277, 297), 'unittest.TestSuite', 'unittest.TestSuite', ([], {}), '()\n', (295, 297), False, 'import unittest\n'), ((311, 332), 'unittest.TestLoader', 'unittest.TestLoader', ([], {}), '()\n', (330, 332), False, 'import unittest\n'), ((877, 913), 'unittest.TextTestRunner', 'unittest.TextTestRunner', ([], {'verbosity':... |
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
#classifiers: https://pypi.python.org/pypi?%3Aaction=list_classifiers
setup(
name = "grocerytrends",
version = "0.1",
author = "<NAME>",
author_email = "<EMAIL>",
description = ("A Python application that... | [
"distutils.core.setup"
] | [((166, 632), 'distutils.core.setup', 'setup', ([], {'name': '"""grocerytrends"""', 'version': '"""0.1"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'description': '"""A Python application that takes your grocery receipts and analyses that data to give you trends"""', 'license': '"""BSD"""', 'keywords... |
#! /usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import torch.optim as optimizer
from torch.optim import _functional as F
import torch
from tensorlayerx.optimizers.lr import LRScheduler
__all__ = ['Adadelta', 'Adagrad', 'Adam', 'Adamax', 'Ftrl', 'Nadam', 'RMS... | [
"torch.optim._functional.adamax",
"torch.enable_grad",
"torch.zeros_like",
"torch.optim._functional.adadelta",
"torch.no_grad",
"torch.optim._functional.sgd"
] | [((714, 729), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (727, 729), False, 'import torch\n'), ((3533, 3548), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (3546, 3548), False, 'import torch\n'), ((5969, 5984), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (5982, 5984), False, 'import torch\n'), ((... |
# SPDX-FileCopyrightText: 2019-2021 REFITT Team
# SPDX-License-Identifier: Apache-2.0
"""Authentication and Authorization decorators."""
# type annotations
from __future__ import annotations
from typing import Callable
# standard libs
import logging
import functools
from datetime import datetime
# external libs
fr... | [
"logging.getLogger",
"datetime.datetime.now",
"flask.request.headers.get",
"functools.wraps"
] | [((713, 740), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (730, 740), False, 'import logging\n'), ((1334, 1356), 'functools.wraps', 'functools.wraps', (['route'], {}), '(route)\n', (1349, 1356), False, 'import functools\n'), ((2316, 2338), 'functools.wraps', 'functools.wraps', (['route... |
# -- coding: utf-8 --
import os
from timeit import default_timer as timer
import numpy as np
from PIL import Image
from tensorflow.keras import backend, layers, models
from detection_yolo3.model import yolo_eval, yolo_body
from detection_yolo3.utils import get_anchors, draw_boxes
from util import check_or_makedirs
... | [
"tensorflow.keras.layers.Input",
"PIL.Image.fromarray",
"PIL.Image.open",
"os.path.exists",
"os.listdir",
"detection_yolo3.utils.get_anchors",
"timeit.default_timer",
"os.path.join",
"detection_yolo3.model.yolo_body",
"util.check_or_makedirs",
"numpy.array",
"numpy.empty",
"os.path.basename"... | [((734, 765), 'detection_yolo3.utils.get_anchors', 'get_anchors', (['YOLO3_ANCHORS_FILE'], {}), '(YOLO3_ANCHORS_FILE)\n', (745, 765), False, 'from detection_yolo3.utils import get_anchors, draw_boxes\n'), ((1135, 1187), 'tensorflow.keras.layers.Input', 'layers.Input', ([], {'shape': '(None, None, 1)', 'dtype': '"""floa... |
# Copyright 2014 Rackspace Hosting
# 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... | [
"gettext.install",
"trove.common.cfg.parse_args",
"trove.rpc.init",
"trove.db.get_db_api",
"trove.common.debug_utils.setup",
"eventlet.monkey_patch",
"trove.common.debug_utils.enabled",
"oslo_log.log.setup"
] | [((774, 809), 'gettext.install', 'gettext.install', (['"""trove"""'], {'unicode': '(1)'}), "('trove', unicode=1)\n", (789, 809), False, 'import gettext\n'), ((994, 1039), 'eventlet.monkey_patch', 'eventlet.monkey_patch', ([], {'all': '(True)', 'thread': '(False)'}), '(all=True, thread=False)\n', (1015, 1039), False, 'i... |
from RePoE.parser.util import call_with_default_args, write_json
from RePoE.parser import Parser_Module
class cluster_jewels(Parser_Module):
@staticmethod
def write(file_system, data_path, relational_reader, translation_file_cache, ot_file_cache):
skills = {}
for row in relational_reader["Pass... | [
"RePoE.parser.util.write_json",
"RePoE.parser.util.call_with_default_args"
] | [((1605, 1649), 'RePoE.parser.util.call_with_default_args', 'call_with_default_args', (['cluster_jewels.write'], {}), '(cluster_jewels.write)\n', (1627, 1649), False, 'from RePoE.parser.util import call_with_default_args, write_json\n'), ((1526, 1571), 'RePoE.parser.util.write_json', 'write_json', (['data', 'data_path'... |
"""
Copyright (c) Facebook, Inc. and its affiliates.
This file contains template objects associated with BlockObjects.
"""
import random
from generate_utils import *
from tree_components import *
from .template_object import *
from .location import *
#############################
### BLOCKOBJECT TEMPLATES ###
#####... | [
"random.choice"
] | [((3965, 4106), 'random.choice', 'random.choice', (["['what you built', 'what you just built', 'what you built just now',\n 'what you made', 'what you constructed just now']"], {}), "(['what you built', 'what you just built',\n 'what you built just now', 'what you made',\n 'what you constructed just now'])\n",... |
import os
import pathlib
import random
TEAMS_COUNT = 30
PAINTINGS_DIR = pathlib.Path("paintings")
def next_painting(team_num):
files = []
team_dir = PAINTINGS_DIR / team_num
for x in team_dir.iterdir():
if x.suffix == ".jpg" and not x.stem.endswith("_replica") and not x.stem.endswith("_co... | [
"random.choice",
"pathlib.Path"
] | [((74, 99), 'pathlib.Path', 'pathlib.Path', (['"""paintings"""'], {}), "('paintings')\n", (86, 99), False, 'import pathlib\n'), ((372, 392), 'random.choice', 'random.choice', (['files'], {}), '(files)\n', (385, 392), False, 'import random\n'), ((670, 728), 'pathlib.Path', 'pathlib.Path', (["((team_dir / file_name).stem... |
from robotide.pluginapi import Plugin
class ExamplePlugin1(Plugin):
def __init__(self, application):
Plugin.__init__(self, application)
class ExamplePlugin2(Plugin):
def __init__(self, application):
Plugin.__init__(self, application)
def turn_off(self, name):
se... | [
"robotide.pluginapi.Plugin.__init__"
] | [((122, 156), 'robotide.pluginapi.Plugin.__init__', 'Plugin.__init__', (['self', 'application'], {}), '(self, application)\n', (137, 156), False, 'from robotide.pluginapi import Plugin\n'), ((241, 275), 'robotide.pluginapi.Plugin.__init__', 'Plugin.__init__', (['self', 'application'], {}), '(self, application)\n', (256... |
import cv2
from shutil import *
import os
from PIL import Image
import numpy as np
sampleNum = 0
folder = input("\nEnter your Registration number's numerical part : ")
user = input("\nEnter Your name : ")
folder1 = folder
user1 = user
copy2('C:\\Users\\MY PC\\PycharmProjects\\untitled\\try1.py','C:\\Users\\MY PC\\Pych... | [
"cv2.rectangle",
"os.listdir",
"PIL.Image.open",
"os.path.join",
"cv2.imshow",
"os.path.split",
"numpy.array",
"cv2.destroyAllWindows",
"cv2.VideoCapture",
"cv2.cvtColor",
"cv2.CascadeClassifier",
"cv2.resize",
"cv2.waitKey",
"cv2.face.createLBPHFaceRecognizer",
"os.remove"
] | [((380, 538), 'cv2.CascadeClassifier', 'cv2.CascadeClassifier', (['"""D:\\\\UDAY\\\\SOFTWARES\\\\opencv\\\\sources\\\\OpenCV Master\\\\opencv-master\\\\data\\\\haarcascades\\\\haarcascade_frontalface_default.xml"""'], {}), "(\n 'D:\\\\UDAY\\\\SOFTWARES\\\\opencv\\\\sources\\\\OpenCV Master\\\\opencv-master\\\\data\\... |
from tempfile import NamedTemporaryFile
from genomepy.utils import generate_gap_bed
def test_gaps():
infa = "tests/data/gap.fa"
outbed = "tests/data/gap.bed"
tmp = NamedTemporaryFile().name
generate_gap_bed(infa, tmp)
result = open(tmp).read()
expect = open(outbed).read()
assert result ... | [
"genomepy.utils.generate_gap_bed",
"tempfile.NamedTemporaryFile"
] | [((209, 236), 'genomepy.utils.generate_gap_bed', 'generate_gap_bed', (['infa', 'tmp'], {}), '(infa, tmp)\n', (225, 236), False, 'from genomepy.utils import generate_gap_bed\n'), ((179, 199), 'tempfile.NamedTemporaryFile', 'NamedTemporaryFile', ([], {}), '()\n', (197, 199), False, 'from tempfile import NamedTemporaryFil... |
#!/usr/bin/env python3
# This script replaces the Makefile to provide a convenient cross-platform build tool
import argparse
import glob
import os
from os import path
import shutil
import subprocess
import sys
def fatal_print(msg):
print(msg)
exit(1)
def fs_action(action, sourcefile, destfile = ""):
isfile = pat... | [
"argparse.ArgumentParser",
"shutil.move",
"os.makedirs",
"subprocess.Popen",
"os.path.join",
"os.path.isfile",
"shutil.copytree",
"os.remove",
"os.path.isdir",
"shutil.copy",
"shutil.rmtree",
"os.path.islink",
"sys.argv.insert",
"glob.glob",
"sys.argv.pop"
] | [((377, 399), 'os.path.isdir', 'path.isdir', (['sourcefile'], {}), '(sourcefile)\n', (387, 399), False, 'from os import path\n'), ((1087, 1174), 'subprocess.Popen', 'subprocess.Popen', (['cmd'], {'stdout': 'subprocess.PIPE', 'stderr': 'subprocess.STDOUT', 'shell': '(True)'}), '(cmd, stdout=subprocess.PIPE, stderr=subpr... |
import random
l1 = []
l2 = []
for i in range(20):
l1.append(random.uniform(-1E10, 1E10))
l2.append(random.uniform(-1E10, 1E10))
print(l1)
print(l2)
l = []
l.extend(l1)
l.extend(l2)
print(sorted(l))
'''
[6015943293.071386, -3878285748.0708866, 8674121166.062424, -1528465047.6118088,
7584260716.4948... | [
"random.uniform"
] | [((69, 114), 'random.uniform', 'random.uniform', (['(-10000000000.0)', '(10000000000.0)'], {}), '(-10000000000.0, 10000000000.0)\n', (83, 114), False, 'import random\n'), ((116, 161), 'random.uniform', 'random.uniform', (['(-10000000000.0)', '(10000000000.0)'], {}), '(-10000000000.0, 10000000000.0)\n', (130, 161), Fals... |
import logging
import time
import asab
from ..abc.processor import Processor
###
L = logging.getLogger(__name__)
###
class Analyzer(Processor):
'''
This is general analyzer interface, which can be the basement of different analyzers.
`analyze_on_clock` enables analyzis by timer, which period can be set by `... | [
"logging.getLogger",
"asab.Timer",
"time.perf_counter"
] | [((89, 116), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (106, 116), False, 'import logging\n'), ((2968, 2987), 'time.perf_counter', 'time.perf_counter', ([], {}), '()\n', (2985, 2987), False, 'import time\n'), ((1122, 1175), 'asab.Timer', 'asab.Timer', (['app', 'self.on_clock_tick'], ... |
import json
import boto3
import sagemaker
import wandb
from sagemaker.pytorch import PyTorch
# based on: https://github.com/aletheia/mnist_pl_sagemaker/blob/master/main.py
source_dir = 'code'
wandb.sagemaker_auth(path=source_dir)
sagemaker_session = sagemaker.Session()
# bucket_name = sagemaker_session.default_bucket(... | [
"sagemaker.Session",
"sagemaker.pytorch.PyTorch",
"wandb.sagemaker_auth"
] | [((192, 229), 'wandb.sagemaker_auth', 'wandb.sagemaker_auth', ([], {'path': 'source_dir'}), '(path=source_dir)\n', (212, 229), False, 'import wandb\n'), ((251, 270), 'sagemaker.Session', 'sagemaker.Session', ([], {}), '()\n', (268, 270), False, 'import sagemaker\n'), ((560, 831), 'sagemaker.pytorch.PyTorch', 'PyTorch',... |
from django.db import models
from django.contrib.auth.models import User
MAX_BODY_LENGTH = 1024 ** 2
class BaseModel(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
class Meta:
abstract = True
class Organization(BaseModel):
... | [
"django.db.models.UUIDField",
"django.db.models.UniqueConstraint",
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.BooleanField",
"django.db.models.PositiveIntegerField",
"django.db.models.DateTimeField",
"django.db.models.PositiveSmallIntegerField",
"django.db.models.... | [((152, 191), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'auto_now_add': '(True)'}), '(auto_now_add=True)\n', (172, 191), False, 'from django.db import models\n'), ((209, 244), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'auto_now': '(True)'}), '(auto_now=True)\n', (229, 244), F... |
"""
Authors: <NAME>, <NAME>
"""
# to allow code to work with Python 2 and 3
from __future__ import print_function # print is a function in python3
from __future__ import unicode_literals # avoid adding "u" to each string
from __future__ import division # avoid writing float(x) when dividing by x
import os.path
impor... | [
"logging.debug",
"logging.critical",
"sys.exit"
] | [((1408, 1422), 'logging.debug', 'log.debug', (['cmd'], {}), '(cmd)\n', (1417, 1422), True, 'import logging as log\n'), ((1052, 1068), 'logging.debug', 'log.debug', (['"""msg"""'], {}), "('msg')\n", (1061, 1068), True, 'import logging as log\n'), ((1072, 1083), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (1080, 108... |
# Copyright (C) 2019-2022, Pyronear.
# This program is licensed under the Apache License version 2.
# See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0.txt> for full license details.
from typing import Any, Callable, Dict
from holocron.models.presets import IMAGENET
from holocron.models.utils import ... | [
"holocron.models.utils.load_pretrained_params"
] | [((968, 1034), 'holocron.models.utils.load_pretrained_params', 'load_pretrained_params', (['model', "default_cfgs[arch]['url']", 'progress'], {}), "(model, default_cfgs[arch]['url'], progress)\n", (990, 1034), False, 'from holocron.models.utils import load_pretrained_params\n')] |
from rich.progress import Progress
from rich.table import Table
from googleapiclient.discovery import build
import json
from datetime import date, datetime
# https://googleapis.github.io/google-api-python-client/docs/dyn/oauth2_v2.userinfo.html#get
def do_test(self, args):
"""
Print upcoming latest impo... | [
"googleapiclient.discovery.build",
"rich.progress.Progress"
] | [((403, 443), 'googleapiclient.discovery.build', 'build', (['"""oauth2"""', '"""v2"""'], {'credentials': 'creds'}), "('oauth2', 'v2', credentials=creds)\n", (408, 443), False, 'from googleapiclient.discovery import build\n'), ((459, 499), 'googleapiclient.discovery.build', 'build', (['"""people"""', '"""v1"""'], {'cred... |
from setuptools import setup
with open("README.rst", "r") as fh:
long_description = fh.read()
setup(
name='lazyjson',
version='0.0.1',
license='MIT',
author='<NAME>',
author_email='<EMAIL>',
url='https://github.com/willstott101/lazyjson',
long_description=long_description,
long_des... | [
"setuptools.setup"
] | [((100, 854), 'setuptools.setup', 'setup', ([], {'name': '"""lazyjson"""', 'version': '"""0.0.1"""', 'license': '"""MIT"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'url': '"""https://github.com/willstott101/lazyjson"""', 'long_description': 'long_description', 'long_description_content_type': '"""te... |
from __future__ import absolute_import
from __future__ import unicode_literals
import operator
import random
from bisect import bisect
from itertools import repeat
# Backported from Python 3.2 itertools.accumulate
# cf. https://docs.python.org/3/library/itertools.html#itertools.accumulate
def accumulate(iterable, fu... | [
"itertools.repeat"
] | [((1904, 1919), 'itertools.repeat', 'repeat', (['None', 'k'], {}), '(None, k)\n', (1910, 1919), False, 'from itertools import repeat\n'), ((1459, 1474), 'itertools.repeat', 'repeat', (['None', 'k'], {}), '(None, k)\n', (1465, 1474), False, 'from itertools import repeat\n')] |
#<NAME>
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)
from sklearn.linear_model import LinearRegression, Ridge, Lasso, ElasticNet
from sklearn.model_selection import train_test_split, GridSearchCV, cross_val_predi... | [
"warnings.filterwarnings",
"sklearn.model_selection.GridSearchCV",
"sklearn.linear_model.ElasticNet",
"sklearn.linear_model.Lasso",
"matplotlib.pyplot.ylabel",
"numpy.arange",
"matplotlib.pyplot.xlabel",
"sklearn.linear_model.Ridge",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
... | [((96, 158), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {'category': 'DeprecationWarning'}), "('ignore', category=DeprecationWarning)\n", (119, 158), False, 'import warnings\n'), ((1118, 1136), 'sklearn.linear_model.LinearRegression', 'LinearRegression', ([], {}), '()\n', (1134, 1136), Fal... |
# Generated by Django 2.2.1 on 2019-08-01 16:34
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dojo', '0012_jira_finding_age'),
]
operations = [
migrations.AddField(
model_name='jira_conf',
name='info_mapping_se... | [
"django.db.models.CharField"
] | [((347, 453), 'django.db.models.CharField', 'models.CharField', ([], {'help_text': '"""Maps to the \'Priority\' field in Jira. For example: Info"""', 'max_length': '(200)'}), '(help_text=\n "Maps to the \'Priority\' field in Jira. For example: Info", max_length=200)\n', (363, 453), False, 'from django.db import migr... |
import linecache
import logging
import os
from smiley.commands import listen_cmd
from smiley import output
class Monitor(listen_cmd.ListeningCommand):
"""Listen for running programs and show their progress.
"""
log = logging.getLogger(__name__)
def get_parser(self, prog_name):
parser = supe... | [
"logging.getLogger",
"os.getcwd",
"smiley.output.OutputFormatter"
] | [((233, 260), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (250, 260), False, 'import logging\n'), ((613, 654), 'smiley.output.OutputFormatter', 'output.OutputFormatter', (['linecache.getline'], {}), '(linecache.getline)\n', (635, 654), False, 'from smiley import output\n'), ((971, 982)... |
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/gaogaotiantian/viztracer/blob/master/NOTICE.txt
import json
from viztracer import FlameGraph
import os
from .base_tmpl import BaseTmpl
def depth(tree):
if not tree.children:
return 1
retu... | [
"os.path.dirname",
"os.path.exists",
"viztracer.FlameGraph",
"os.remove"
] | [((585, 608), 'viztracer.FlameGraph', 'FlameGraph', (['sample_data'], {}), '(sample_data)\n', (595, 608), False, 'from viztracer import FlameGraph\n'), ((819, 835), 'os.remove', 'os.remove', (['ofile'], {}), '(ofile)\n', (828, 835), False, 'import os\n'), ((875, 887), 'viztracer.FlameGraph', 'FlameGraph', ([], {}), '()... |
import unittest
import test
class TestMethods(unittest.TestCase):
def test_case_data(self):
#print(test.dataread.data_corl())
el = ['a','b','c']
self.assertEqual(len(test.sklsetups.elements(el)), len(el))
if __name__ == '__main__':
unittest.main() | [
"unittest.main",
"test.sklsetups.elements"
] | [((267, 282), 'unittest.main', 'unittest.main', ([], {}), '()\n', (280, 282), False, 'import unittest\n'), ((196, 223), 'test.sklsetups.elements', 'test.sklsetups.elements', (['el'], {}), '(el)\n', (219, 223), False, 'import test\n')] |
import argparse
import inspect
import os
from io import StringIO
from pathlib import Path
from typing import TypeVar, Callable, Optional, Union
from pangtreebuild.serialization.json import TaskParameters
from pangtreebuild.affinity_tree import parameters as at_params
from pangtreebuild.pangenome import graph
from pang... | [
"pangtreebuild.affinity_tree.parameters.Hbmin",
"pangtreebuild.affinity_tree.parameters.Blosum",
"pangtreebuild.pangenome.parameters.missings.FromFile",
"pangtreebuild.tools.pathtools.create_dir",
"argparse.ArgumentParser",
"pathlib.Path",
"pangtreebuild.tools.pathtools.get_cwd",
"pangtreebuild.pangen... | [((1815, 1827), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (1822, 1827), False, 'from typing import TypeVar, Callable, Optional, Union\n'), ((1469, 1479), 'pathlib.Path', 'Path', (['path'], {}), '(path)\n', (1473, 1479), False, 'from pathlib import Path\n'), ((1696, 1706), 'pathlib.Path', 'Path', (['pat... |
import argparse
import time
import torch
from kruskals import kruskals_pytorch, kruskals_pytorch_batched
from kruskals import kruskals_cpp_pytorch, kruskals_cpp_pytorch2
parser = argparse.ArgumentParser()
parser.add_argument("--n", type=int, default=30, help="Number of nodes.")
parser.add_argument("--batch_size", typ... | [
"argparse.ArgumentParser",
"kruskals.kruskals_cpp_pytorch2",
"torch.cuda.synchronize",
"torch.triu_indices",
"kruskals.kruskals_pytorch_batched",
"time.time",
"torch.randn",
"kruskals.kruskals_cpp_pytorch"
] | [((181, 206), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (204, 206), False, 'import argparse\n'), ((554, 593), 'torch.randn', 'torch.randn', (['args.batch_size', 'num_edges'], {}), '(args.batch_size, num_edges)\n', (565, 593), False, 'import torch\n'), ((605, 653), 'torch.triu_indices', 'to... |
import copy
from django.test import TestCase
from gnosis.eth.tests.ethereum_test_case import EthereumTestCaseMixin
from ..indexers import Erc20EventsIndexerProvider
from ..models import EthereumEvent, EthereumTx
from .factories import SafeContractFactory
class TestErc20EventsIndexer(EthereumTestCaseMixin, TestCase... | [
"copy.deepcopy"
] | [((2086, 2106), 'copy.deepcopy', 'copy.deepcopy', (['event'], {}), '(event)\n', (2099, 2106), False, 'import copy\n')] |
from django.contrib import admin
from models import Plink
from models import PlinkJob
from models import PlinkOption
# Register your models here.
admin.site.register(Plink)
admin.site.register(PlinkJob)
admin.site.register(PlinkOption)
| [
"django.contrib.admin.site.register"
] | [((150, 176), 'django.contrib.admin.site.register', 'admin.site.register', (['Plink'], {}), '(Plink)\n', (169, 176), False, 'from django.contrib import admin\n'), ((177, 206), 'django.contrib.admin.site.register', 'admin.site.register', (['PlinkJob'], {}), '(PlinkJob)\n', (196, 206), False, 'from django.contrib import ... |