code
stringlengths
22
1.05M
apis
listlengths
1
3.31k
extract_api
stringlengths
75
3.25M
from django.http import HttpResponseRedirect from django.views import View from ..core import app_settings class AppLoginView(View): def get(self, request, *args, **kwargs): next = request.GET.get('next', '') return HttpResponseRedirect(app_settings.REMOTE_LOGIN_URL + next) class AppSignupView...
[ "django.http.HttpResponseRedirect" ]
[((240, 298), 'django.http.HttpResponseRedirect', 'HttpResponseRedirect', (['(app_settings.REMOTE_LOGIN_URL + next)'], {}), '(app_settings.REMOTE_LOGIN_URL + next)\n', (260, 298), False, 'from django.http import HttpResponseRedirect\n'), ((432, 491), 'django.http.HttpResponseRedirect', 'HttpResponseRedirect', (['(app_s...
from scenarios import helper from scenarios.builder import Builder from model.enumerations import e_ExperienceFactor, e_MentalOrEmotionalFactor, e_PhyOrPhyFactor, e_EntityType, e_Relation, e_CausalFactorType from model.knowledge_base import kb from model.entities import Entity, CausalFactor from model.utils import Boun...
[ "model.enumerations.e_PhyOrPhyFactor.all", "scenarios.helper.get_scenarios", "model.knowledge_base.kb.get_current_action", "model.enumerations.e_MentalOrEmotionalFactor.all", "scenarios.builder.Builder", "model.entities.CausalFactor", "os.path.join", "scenarios.helper.run_scenario", "model.utils.Bou...
[((1119, 1143), 'model.enumerations.e_ExperienceFactor.all', 'e_ExperienceFactor.all', ([], {}), '()\n', (1141, 1143), False, 'from model.enumerations import e_ExperienceFactor, e_MentalOrEmotionalFactor, e_PhyOrPhyFactor, e_EntityType, e_Relation, e_CausalFactorType\n'), ((1332, 1363), 'model.enumerations.e_MentalOrEm...
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse from Bio import AlignIO def concat_msa(msas, output): """concatenate msas together""" alignments = [] for msa in msas: align = AlignIO.read(msa, "fasta") # shorten id so the concatenated alignment keeps it for record i...
[ "Bio.AlignIO.read", "Bio.AlignIO.write", "argparse.ArgumentParser" ]
[((733, 778), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'prog': '"""concat_msa.py"""'}), "(prog='concat_msa.py')\n", (756, 778), False, 'import argparse\n'), ((213, 239), 'Bio.AlignIO.read', 'AlignIO.read', (['msa', '"""fasta"""'], {}), "(msa, 'fasta')\n", (225, 239), False, 'from Bio import AlignIO\n...
from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.keys import Keys...
[ "selenium.webdriver.chrome.options.Options", "webdriver_manager.chrome.ChromeDriverManager", "selenium.webdriver.support.wait.WebDriverWait", "json.dump", "time.sleep", "selenium.webdriver.common.action_chains.ActionChains", "datetime.datetime.now", "json.load", "datetime.date.today", "selenium.we...
[((570, 579), 'selenium.webdriver.chrome.options.Options', 'Options', ([], {}), '()\n', (577, 579), False, 'from selenium.webdriver.chrome.options import Options\n'), ((3372, 3392), 'selenium.webdriver.common.action_chains.ActionChains', 'ActionChains', (['driver'], {}), '(driver)\n', (3384, 3392), False, 'from seleniu...
import re from django.db import models unacceptable_chars = "[^a-z0-9\._]" duplicate_spaces_and_dots = "[\ .]+" class ShortCodeField(models.CharField): description = "A short string representing a glyph name" def pre_save(self, model_instance, add): model_instance.short_code = sanitize_short_code(mo...
[ "re.sub" ]
[((759, 807), 're.sub', 're.sub', (['duplicate_spaces_and_dots', '"""."""', 'new_code'], {}), "(duplicate_spaces_and_dots, '.', new_code)\n", (765, 807), False, 'import re\n'), ((679, 719), 're.sub', 're.sub', (['unacceptable_chars', '""""""', 'new_code'], {}), "(unacceptable_chars, '', new_code)\n", (685, 719), False,...
# coding=utf-8 # date: 2019/1/1, 19:38 # name: smz import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from sklearn.utils import shuffle from LinearModel.modules.model3 import ModelThreeClasses from LinearModel.configuration.options import opts from LinearModel.scripts.gen_data import generate_d...
[ "LinearModel.modules.model3.ModelThreeClasses", "numpy.eye", "sklearn.utils.shuffle", "tensorflow.Session", "numpy.argmax", "tensorflow.global_variables_initializer", "matplotlib.pyplot.figure", "LinearModel.scripts.gen_data.generate_data", "numpy.random.seed", "numpy.load", "numpy.random.randn"...
[((352, 370), 'numpy.random.seed', 'np.random.seed', (['(10)'], {}), '(10)\n', (366, 370), True, 'import numpy as np\n'), ((444, 471), 'numpy.random.randn', 'np.random.randn', (['fields_num'], {}), '(fields_num)\n', (459, 471), True, 'import numpy as np\n'), ((482, 500), 'numpy.eye', 'np.eye', (['fields_num'], {}), '(f...
########################################################################## # Copyright (c) 2009, ETH Zurich. # All rights reserved. # # This file is distributed under the terms in the attached LICENSE file. # If you do not find this file, copies can be found by writing to: # ETH Zurich D-INFK, Universitaetstrasse 6, CH...
[ "results.PassFailResult" ]
[((1154, 1176), 'results.PassFailResult', 'PassFailResult', (['passed'], {}), '(passed)\n', (1168, 1176), False, 'from results import PassFailResult\n')]
import argparse import os import sys import numpy as np from scipy import misc import cv2 import torch import torch.nn as nn from torch.autograd import Variable from torchvision.models import vgg16, vgg19 from torchvision.utils import save_image from lib.gradients import GradCam, GuidedBackpropGrad from lib.image_uti...
[ "os.path.exists", "numpy.multiply", "lib.gradients.GradCam", "argparse.ArgumentParser", "torchvision.models.vgg19", "lib.gradients.GuidedBackpropGrad", "os.makedirs", "lib.image_utils.preprocess_image", "os.path.join", "numpy.zeros", "torch.cuda.is_available", "cv2.resize", "cv2.imread", "...
[((455, 480), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (478, 480), False, 'import argparse\n'), ((1634, 1666), 'lib.image_utils.preprocess_image', 'preprocess_image', (['img', 'args.cuda'], {}), '(img, args.cuda)\n', (1650, 1666), False, 'from lib.image_utils import preprocess_image, save...
from floodsystem import stationdata, datafetcher, station stations = stationdata.build_station_list() stationdata.update_water_levels(stations) #Empty lists for each of the risk categories severe_level_station = [] high_level_station = [] moderate_level_station = [] low_level_station = [] for station in stations: #S...
[ "floodsystem.stationdata.build_station_list", "floodsystem.station.relative_water_level", "floodsystem.stationdata.update_water_levels" ]
[((70, 102), 'floodsystem.stationdata.build_station_list', 'stationdata.build_station_list', ([], {}), '()\n', (100, 102), False, 'from floodsystem import stationdata, datafetcher, station\n'), ((103, 144), 'floodsystem.stationdata.update_water_levels', 'stationdata.update_water_levels', (['stations'], {}), '(stations)...
#//------------------------------------------------------------------- #/*/{Protheus.doc} ACDA035 - # #@author <NAME> #@since 23/09/2019 #@version P12 # # CT001 - Inclusão de Lançamento de Inventário # CT002 - Visão de um lançamento de inventário # CT003 - Visualização das legendas # CT004 - Alteração de...
[ "unittest.main", "tir.Webapp", "time.sleep" ]
[((3423, 3438), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3436, 3438), False, 'import unittest\n'), ((685, 693), 'tir.Webapp', 'Webapp', ([], {}), '()\n', (691, 693), False, 'from tir import Webapp\n'), ((3097, 3110), 'time.sleep', 'time.sleep', (['(3)'], {}), '(3)\n', (3107, 3110), False, 'import time\n')]
from pathlib import Path from jina import Flow, Document from jina.executors import BaseExecutor from jina.parsers import set_pea_parser from jina.peapods.peas import BasePea cur_dir = Path(__file__).parent def test_load_executor_with_custom_driver(): with BaseExecutor.load_config(str(cur_dir / 'yaml/test-execu...
[ "pathlib.Path", "jina.Flow", "jina.Document", "jina.parsers.set_pea_parser", "jina.peapods.peas.BasePea" ]
[((187, 201), 'pathlib.Path', 'Path', (['__file__'], {}), '(__file__)\n', (191, 201), False, 'from pathlib import Path\n'), ((607, 620), 'jina.peapods.peas.BasePea', 'BasePea', (['args'], {}), '(args)\n', (614, 620), False, 'from jina.peapods.peas import BasePea\n'), ((498, 514), 'jina.parsers.set_pea_parser', 'set_pea...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import cgi from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer import tensorflow as tf from ricga import configuration from ricga import inference_wrapper from ricga.inference_utils import caption_g...
[ "tensorflow.flags.DEFINE_string", "tensorflow.Graph", "cgi.FieldStorage", "ricga.inference_wrapper.InferenceWrapper", "tensorflow.Session", "tensorflow.logging.set_verbosity", "BaseHTTPServer.HTTPServer", "tensorflow.flags.DEFINE_integer", "ricga.configuration.ModelConfig", "ricga.inference_utils....
[((399, 571), 'tensorflow.flags.DEFINE_string', 'tf.flags.DEFINE_string', (['"""checkpoint_path"""', '"""/home/meteorshub/code/RICGA/ricga/model/train"""', '"""Model checkpoint file or directory containing a model checkpoint file."""'], {}), "('checkpoint_path',\n '/home/meteorshub/code/RICGA/ricga/model/train',\n ...
import os import sys if sys.platform.startswith('linux'): from OpenGL import GL from PyQt5.QtQml import QQmlApplicationEngine from PyQt5.QtWidgets import QApplication from analysis.probe.gui.backend_classes import PythonBackendClass1, Logger from analysis.probe.gui.image_providers import PyplotImagePro...
[ "analysis.probe.gui.backend_classes.Logger", "PyQt5.QtQml.QQmlApplicationEngine", "analysis.probe.gui.backend_classes.PythonBackendClass1", "os.path.join", "sys.platform.startswith", "os.path.isfile", "PyQt5.QtWidgets.QApplication", "analysis.probe.gui.image_providers.PyplotImageProvider" ]
[((28, 60), 'sys.platform.startswith', 'sys.platform.startswith', (['"""linux"""'], {}), "('linux')\n", (51, 60), False, 'import sys\n'), ((386, 408), 'PyQt5.QtWidgets.QApplication', 'QApplication', (['sys.argv'], {}), '(sys.argv)\n', (398, 408), False, 'from PyQt5.QtWidgets import QApplication\n'), ((426, 449), 'PyQt5...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('HMBBF', '0014_theme'), ] operations = [ migrations.AddField( model_name='theme', name='time', ...
[ "django.db.models.DateTimeField", "django.db.models.DateField", "django.db.models.CharField" ]
[((332, 402), 'django.db.models.CharField', 'models.CharField', ([], {'default': '"""不必填写"""', 'max_length': '(256)', 'verbose_name': '"""具体时间段"""'}), "(default='不必填写', max_length=256, verbose_name='具体时间段')\n", (348, 402), False, 'from django.db import migrations, models\n'), ((566, 606), 'django.db.models.DateField', ...
from rb.core.lang import Lang from rb.core.document import Document from rb.complexity.complexity_index import ComplexityIndex, compute_indices from rb.similarity.word2vec import Word2Vec from rb.similarity.vector_model import VectorModelType, CorporaEnum, VectorModel from rb.similarity.vector_model_factory import VECT...
[ "sklearn.svm.SVC", "rb.cna.cna_graph.CnaGraph", "random.shuffle", "rb.utils.rblogger.Logger.get_logger", "os.path.join", "collections.Counter", "rb.similarity.vector_model.VectorModelType.from_str", "rb.complexity.complexity_index.compute_indices", "rb.core.document.Document", "random.random", "...
[((749, 768), 'rb.utils.rblogger.Logger.get_logger', 'Logger.get_logger', ([], {}), '()\n', (766, 768), False, 'from rb.utils.rblogger import Logger\n'), ((2569, 2592), 'random.shuffle', 'random.shuffle', (['results'], {}), '(results)\n', (2583, 2592), False, 'import random\n'), ((3279, 3379), 'sklearn.metrics.plot_con...
""" enclosure_tags ~~~~~~~~~~~~~~ Fix tags for MP3 enclosures (e.g. podcasts). Adds a "with tags" link to a version of the file with tags set as follows: * the entry title as title * the feed title as album * the entry/feed author as author This plugin needs additional dependencies, use the ``unstable-plugins`` ext...
[ "flask.request.args.get", "urllib.parse.urlparse", "requests.get", "flask.url_for", "tempfile.TemporaryFile", "flask.Blueprint" ]
[((881, 918), 'flask.Blueprint', 'Blueprint', (['"""enclosure_tags"""', '__name__'], {}), "('enclosure_tags', __name__)\n", (890, 918), False, 'from flask import Blueprint\n'), ((2164, 2194), 'requests.get', 'requests.get', (['url'], {'stream': '(True)'}), '(url, stream=True)\n', (2176, 2194), False, 'import requests\n...
# -*- coding: utf-8 -*- import os import sys import types import unittest import inspect from lxml import etree from . import XSL, XML, VERSION_LIST from .core import get_module, get_stylesheet, get_source_version, get_migration_path, list_versions from .main import parse_args from .migrate import migrate_by_styleshe...
[ "lxml.etree.Element", "os.path.exists", "lxml.etree.XML", "lxml.etree.parse", "os.path.join", "inspect.signature", "sys.stderr.write", "os.path.basename", "lxml.etree.tostring", "os.remove" ]
[((3640, 3673), 'os.path.join', 'os.path.join', (['XML', '"""original.xml"""'], {}), "(XML, 'original.xml')\n", (3652, 3673), False, 'import os\n'), ((4315, 4345), 'os.path.join', 'os.path.join', (['XML', '"""test2.sff"""'], {}), "(XML, 'test2.sff')\n", (4327, 4345), False, 'import os\n'), ((4478, 4520), 'os.path.join'...
"""Shaft element module for STOCHASTIC ROSS. This module creates an instance of random shaft element for stochastic analysis. """ from ross.shaft_element import ShaftElement from ross.stochastic.st_materials import ST_Material from ross.stochastic.st_results_elements import plot_histogram from ross.units import Q_, ch...
[ "ross.shaft_element.ShaftElement", "ross.stochastic.st_results_elements.plot_histogram" ]
[((10531, 10624), 'ross.stochastic.st_results_elements.plot_histogram', 'plot_histogram', (['self.attribute_dict', 'label', 'var_list'], {'histogram_kwargs': '{}', 'plot_kwargs': '{}'}), '(self.attribute_dict, label, var_list, histogram_kwargs={},\n plot_kwargs={})\n', (10545, 10624), False, 'from ross.stochastic.st...
# Copyright 2015 Tesora Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
[ "proboscis.test" ]
[((1044, 1167), 'proboscis.test', 'test', ([], {'depends_on_groups': "['services.initialize']", 'runs_after_groups': '[PRE_INSTANCES]', 'groups': '[GROUP, groups.INST_CREATE]'}), "(depends_on_groups=['services.initialize'], runs_after_groups=[\n PRE_INSTANCES], groups=[GROUP, groups.INST_CREATE])\n", (1048, 1167), F...
import tensorflow as tf from tensorflow.keras import datasets, layers, optimizers, Sequential, metrics, losses # 1.数据集准备 (x, y), (x_val, y_val) = datasets.mnist.load_data() # 加载数据集,返回的是两个元组,分别表示训练集和测试集 x = tf.convert_to_tensor(x, dtype=tf.float32) / 255. # 转换为张量,并缩放到0~1 y = tf.convert_to_tensor(y, dtype=tf.int32) #...
[ "tensorflow.one_hot", "tensorflow.keras.metrics.Accuracy", "tensorflow.keras.layers.Conv2D", "tensorflow.data.Dataset.from_tensor_slices", "tensorflow.keras.datasets.mnist.load_data", "tensorflow.keras.layers.MaxPooling2D", "tensorflow.keras.layers.ReLU", "tensorflow.reduce_sum", "tensorflow.keras.o...
[((147, 173), 'tensorflow.keras.datasets.mnist.load_data', 'datasets.mnist.load_data', ([], {}), '()\n', (171, 173), False, 'from tensorflow.keras import datasets, layers, optimizers, Sequential, metrics, losses\n'), ((278, 317), 'tensorflow.convert_to_tensor', 'tf.convert_to_tensor', (['y'], {'dtype': 'tf.int32'}), '(...
try: import tkinter as tk except ImportError: import Tkinter as tk class DialogueEntry(tk.Toplevel): """ DialogueEntry : tkinter.Toplevel Dialogue box that allow the user to input a text in a field. kwargs : title : title of the dialogue box text : text di...
[ "Tkinter.Entry", "Tkinter.Label", "Tkinter.Button", "Tkinter.StringVar" ]
[((1748, 1803), 'Tkinter.Entry', 'tk.Entry', (['self'], {'textvariable': 'self.textvar', 'width': '(w // 6)'}), '(self, textvariable=self.textvar, width=w // 6)\n', (1756, 1803), True, 'import Tkinter as tk\n'), ((1826, 1876), 'Tkinter.Button', 'tk.Button', (['self'], {'text': '"""Ok"""', 'command': 'self.on_ok_btn'}),...
# Copyright (C) 2022 Intel Corporation # SPDX-License-Identifier: BSD-3-Clause import sys import os import unittest import numpy as np import matplotlib.pyplot as plt import torch import torch.nn.functional as F from lava.lib.dl.slayer.neuron import alif verbose = True if (('-v' in sys.argv) or ('--verbose' in sys....
[ "lava.lib.dl.slayer.neuron.alif.Neuron", "torch.nn.functional.mse_loss", "matplotlib.pyplot.show", "numpy.random.random", "matplotlib.pyplot.legend", "matplotlib.pyplot.xlabel", "torch.floor", "os.environ.get", "numpy.random.randint", "torch.cuda.is_available", "matplotlib.pyplot.figure", "num...
[((346, 369), 'numpy.random.randint', 'np.random.randint', (['(1000)'], {}), '(1000)\n', (363, 369), True, 'import numpy as np\n'), ((383, 403), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (397, 403), True, 'import numpy as np\n'), ((442, 467), 'torch.cuda.is_available', 'torch.cuda.is_available'...
import decimal import pytest from amount import Amount as A def test_basic(): a = A(("0.30", "$")) assert '$ 0.30' == str(a) a = A({"$": decimal.Decimal(4)}) assert '$ 4', str(a) def test_add(): a = A(("2.34", "$")) b = A(("5.97", "$")) assert "$ 8.31" == str(a+b) c = A(("9.01", "CA...
[ "decimal.Decimal", "amount.Amount" ]
[((88, 104), 'amount.Amount', 'A', (["('0.30', '$')"], {}), "(('0.30', '$'))\n", (89, 104), True, 'from amount import Amount as A\n'), ((223, 239), 'amount.Amount', 'A', (["('2.34', '$')"], {}), "(('2.34', '$'))\n", (224, 239), True, 'from amount import Amount as A\n'), ((248, 264), 'amount.Amount', 'A', (["('5.97', '$...
from django.views.generic import TemplateView from django_tables2.config import RequestConfig from django_tables2_column_shifter.tables import ( ColumnShiftTableBootstrap2, ColumnShiftTableBootstrap3, ColumnShiftTableBootstrap4, ColumnShiftTableBootstrap5, ) from .models import Author, Book from .tabl...
[ "django_tables2.config.RequestConfig" ]
[((1252, 1305), 'django_tables2.config.RequestConfig', 'RequestConfig', (['self.request'], {'paginate': "{'per_page': 2}"}), "(self.request, paginate={'per_page': 2})\n", (1265, 1305), False, 'from django_tables2.config import RequestConfig\n'), ((1339, 1392), 'django_tables2.config.RequestConfig', 'RequestConfig', (['...
import numpy as np EXPERIMENT_NAME = 'EXP_12' CORPUS_PATH = '/home/dddhiraj/Documents/stuff/data/wiki_en.txt' TRAINING_WINDOW = 5 CONTEXT_DIMENSION = 64 LEANING_RATE = 1 DROPOUT = 0.05 CONTEXT_DECAY = 1 - TRAINING_WINDOW ** -0.5 CONTRASTIVE_WEIGHT = 1#0.1 NEGATIVE_SAMPLE_SIZE ...
[ "pymongo.MongoClient", "numpy.sqrt", "redis.Redis" ]
[((367, 391), 'numpy.sqrt', 'np.sqrt', (['TRAINING_WINDOW'], {}), '(TRAINING_WINDOW)\n', (374, 391), True, 'import numpy as np\n'), ((496, 544), 'pymongo.MongoClient', 'pymongo.MongoClient', (['"""mongodb://localhost:27017"""'], {}), "('mongodb://localhost:27017')\n", (515, 544), False, 'import pymongo\n'), ((721, 738)...
#!/usr/bin/env python # coding: utf-8 """ yasi Date: 20th November 2013 Author: nkmathew <<EMAIL>> Dialect aware s-expression indenter """ from __future__ import print_function import argparse import hashlib import os import re import shutil import sys import time import collections import json import difflib tr...
[ "re.compile", "multiprocessing.cpu_count", "difflib.unified_diff", "sys.stdin.read", "colorama.init", "re.search", "os.path.exists", "argparse.ArgumentParser", "os.path.split", "time.localtime", "os.path.expanduser", "json.loads", "hashlib.md5", "re.match", "sys.stderr.write", "shutil....
[((528, 551), 'backports.functools_lru_cache.lru_cache', 'lru_cache', ([], {'maxsize': 'None'}), '(maxsize=None)\n', (537, 551), False, 'from backports.functools_lru_cache import lru_cache\n'), ((7924, 7947), 'backports.functools_lru_cache.lru_cache', 'lru_cache', ([], {'maxsize': 'None'}), '(maxsize=None)\n', (7933, 7...
import re SMS_CHAR_COUNT_LIMIT = 612 # 153 * 4 # regexes for use in recipients.validate_email_address. # Valid characters taken from https://en.wikipedia.org/wiki/Email_address#Local-part # Note: Normal apostrophe eg `Firstname-o'surname@domain.com` is allowed. hostname_part = re.compile(r"^(xn-|[a-z0-9]+)(-[a-z0-9]...
[ "re.compile" ]
[((281, 340), 're.compile', 're.compile', (['"""^(xn-|[a-z0-9]+)(-[a-z0-9]+)*$"""', 're.IGNORECASE'], {}), "('^(xn-|[a-z0-9]+)(-[a-z0-9]+)*$', re.IGNORECASE)\n", (291, 340), False, 'import re\n'), ((353, 424), 're.compile', 're.compile', (['"""^([a-z]{2,63}|xn--([a-z0-9]+-)*[a-z0-9]+)$"""', 're.IGNORECASE'], {}), "('^(...
import time class Cache(object): globalCache = {} localCace = {} timeout = 0 now = time.time() @staticmethod def setTimeout(timeout): Cache.timeout = timeout @staticmethod def updateTime(): Cache.now = time.time() @staticmethod def _isValid(timestamp): return True if Cache.now - Cache.timeout <= tim...
[ "time.time" ]
[((88, 99), 'time.time', 'time.time', ([], {}), '()\n', (97, 99), False, 'import time\n'), ((217, 228), 'time.time', 'time.time', ([], {}), '()\n', (226, 228), False, 'import time\n')]
import zeep import asyncio, sys from onvif import ONVIFCamera import cv2 import numpy as np import urllib from urllib.request import urlopen IP="192.168.2.22" # Camera IP address PORT=80 # Port USER="admin" # Username PASS="<PASSWORD>" # Password XMAX = 1 XMIN = -1 YMAX = 1 YMIN = -1 movere...
[ "cv2.imwrite", "onvif.ONVIFCamera", "cv2.imshow", "requests.auth.HTTPDigestAuth", "cv2.imdecode" ]
[((510, 543), 'onvif.ONVIFCamera', 'ONVIFCamera', (['IP', 'PORT', 'USER', 'PASS'], {}), '(IP, PORT, USER, PASS)\n', (521, 543), False, 'from onvif import ONVIFCamera\n'), ((3575, 3612), 'cv2.imdecode', 'cv2.imdecode', (['image', 'cv2.IMREAD_COLOR'], {}), '(image, cv2.IMREAD_COLOR)\n', (3587, 3612), False, 'import cv2\n...
from django.contrib import admin from .models import Comment @admin.register(Comment) class CommentAdmin(admin.ModelAdmin): list_display = ('id', 'content_object', 'text', 'comment_time', 'user', 'root', 'parent', 'reply_to')
[ "django.contrib.admin.register" ]
[((64, 87), 'django.contrib.admin.register', 'admin.register', (['Comment'], {}), '(Comment)\n', (78, 87), False, 'from django.contrib import admin\n')]
from datetime import date, timedelta from allocation.domain import events from allocation.domain.model import Product, OrderLine, Batch today = date.today() tomorrow = today + timedelta(days=1) later = tomorrow + timedelta(days=10) def test_prefers_warehouse_batches_to_shipments(): in_stock_batch = Batch("in-stoc...
[ "allocation.domain.model.Product", "datetime.timedelta", "allocation.domain.model.OrderLine", "allocation.domain.events.OutOfStock", "datetime.date.today", "allocation.domain.model.Batch" ]
[((145, 157), 'datetime.date.today', 'date.today', ([], {}), '()\n', (155, 157), False, 'from datetime import date, timedelta\n'), ((177, 194), 'datetime.timedelta', 'timedelta', ([], {'days': '(1)'}), '(days=1)\n', (186, 194), False, 'from datetime import date, timedelta\n'), ((214, 232), 'datetime.timedelta', 'timede...
# -*- coding: utf-8 -*- ''' :codeauthor: <NAME> <<EMAIL>> ''' # Import Python libs from __future__ import absolute_import, print_function, unicode_literals # Import Salt Testing Libs from tests.support.mixins import LoaderModuleMockMixin from tests.support.unit import TestCase from tests.support.mock import ( ...
[ "tests.support.mock.MagicMock", "tests.support.mock.patch.object", "tests.support.mock.patch.dict", "salt.states.grafana.dashboard_absent", "salt.states.grafana.dashboard_present" ]
[((1500, 1760), 'tests.support.mock.MagicMock', 'MagicMock', ([], {'side_effect': "[{'hosts': True, 'index': False}, {'hosts': True, 'index': True}, {'hosts':\n True, 'index': True}, {'hosts': True, 'index': True}, {'hosts': True,\n 'index': True}, {'hosts': True, 'index': True}, {'hosts': True, 'index':\n Tru...
def pprint(arr): for line in arr: print(line) # 5 7 # 0 1 1 # 0 2 3 # 1 2 3 # 1 3 6 # 2 3 4 # 2 4 2 # 3 4 5 import sys import heapq as hq N, M = map(int, sys.stdin.readline().split(" ")) W = [[float('inf')] * N for _ in range(N)] h = [] for _ in range(M): i, j, w = map(int, sys.stdin.readline().split(...
[ "sys.stdin.readline", "heapq.heappush", "heapq.heappop" ]
[((330, 355), 'heapq.heappush', 'hq.heappush', (['h', '(w, i, j)'], {}), '(h, (w, i, j))\n', (341, 355), True, 'import heapq as hq\n'), ((460, 476), 'heapq.heappop', 'hq.heappop', (['heap'], {}), '(heap)\n', (470, 476), True, 'import heapq as hq\n'), ((167, 187), 'sys.stdin.readline', 'sys.stdin.readline', ([], {}), '(...
"""common parser argument """ # pylint: disable=missing-docstring # pylint: disable=too-few-public-methods import argparse from enum import Enum import logging from sys import exit as sys_exit from . import archivist from .logger import set_logger from .proof_mechanism import ProofMechanism LOGGER = logging.getL...
[ "logging.getLogger", "argparse.ArgumentParser", "sys.exit" ]
[((308, 335), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (325, 335), False, 'import logging\n'), ((1412, 1460), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': 'description'}), '(description=description)\n', (1435, 1460), False, 'import argparse\n'), ((3147,...
import argparse, pdb import gym import numpy as np import os import pickle import random import torch import scipy.misc from gym.envs.registration import register parser = argparse.ArgumentParser() parser.add_argument('-display', type=int, default=0) parser.add_argument('-seed', type=int, default=1) parser.add_argumen...
[ "torch.manual_seed", "argparse.ArgumentParser", "random.seed", "gym.envs.registration.register", "numpy.random.seed", "os.system", "gym.make" ]
[((173, 198), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (196, 198), False, 'import argparse, pdb\n'), ((1027, 1048), 'random.seed', 'random.seed', (['opt.seed'], {}), '(opt.seed)\n', (1038, 1048), False, 'import random\n'), ((1049, 1073), 'numpy.random.seed', 'np.random.seed', (['opt.seed'...
import matplotlib.pylab as plt import numpy as np import random from scipy.ndimage import gaussian_filter mu =9 N = 50 k = 10 eta =10 sigma = 2 p0 = 0.5 inverse_random = False L = range(N*N) Q = np.zeros((N*mu,N*mu)) for o in range(mu*mu): print(o) F = 1000*k a = np.ones((N,N)) for k_ in range(1000): ...
[ "matplotlib.pylab.axis", "matplotlib.pylab.subplots", "numpy.ones", "numpy.where", "numpy.random.random", "numpy.zeros", "matplotlib.pylab.imshow", "numpy.random.randint", "numpy.unravel_index", "scipy.ndimage.gaussian_filter" ]
[((197, 223), 'numpy.zeros', 'np.zeros', (['(N * mu, N * mu)'], {}), '((N * mu, N * mu))\n', (205, 223), True, 'import numpy as np\n'), ((908, 944), 'matplotlib.pylab.subplots', 'plt.subplots', (['(1)', '(1)'], {'figsize': '(20, 20)'}), '(1, 1, figsize=(20, 20))\n', (920, 944), True, 'import matplotlib.pylab as plt\n')...
from django.db import models # from cms.models.fields import PlaceholderField from cms.models import CMSPlugin # from filer.fields.image import FilerImageField from arkestra_utilities.output_libraries.dates import nice_date # from arkestra_utilities.models import ArkestraGenericModel from arkestra_utilities.generic_...
[ "managers.StudentshipManager", "django.db.models.DateField", "django.db.models.TextField", "arkestra_utilities.output_libraries.dates.nice_date", "django.db.models.ManyToManyField", "managers.VacancyManager", "django.db.models.CharField" ]
[((886, 904), 'django.db.models.DateField', 'models.DateField', ([], {}), '()\n', (902, 904), False, 'from django.db import models\n'), ((928, 995), 'django.db.models.TextField', 'models.TextField', ([], {'null': '(True)', 'blank': '(True)', 'help_text': '"""No longer used"""'}), "(null=True, blank=True, help_text='No ...
import json from django.utils.http import urlencode import mock import requests from olympia.amo.tests import AMOPaths, TestCase from olympia.amo.urlresolvers import reverse from olympia.files.models import FileUpload from olympia.github.tests.test_github import ( GithubBaseTestCase, example_pull_request) clas...
[ "json.loads", "olympia.files.models.FileUpload.objects.get", "mock.Mock", "json.dumps", "requests.HTTPError", "olympia.amo.urlresolvers.reverse" ]
[((463, 489), 'olympia.amo.urlresolvers.reverse', 'reverse', (['"""github.validate"""'], {}), "('github.validate')\n", (470, 489), False, 'from olympia.amo.urlresolvers import reverse\n'), ((1419, 1443), 'olympia.files.models.FileUpload.objects.get', 'FileUpload.objects.get', ([], {}), '()\n', (1441, 1443), False, 'fro...
import requests import logging from .auth import Auth domain = "https://ptx.transportdata.tw/MOTC/v2/Rail/THSR/" default_limit_count = 20 logger = logging.getLogger('flask.app') auth = Auth() def get_station(): """GET /v2/Rail/THSR/Station 取得車站基本資料 Returns: [dict] -- 車站基本資料 """ action = "...
[ "logging.getLogger", "requests.get" ]
[((149, 179), 'logging.getLogger', 'logging.getLogger', (['"""flask.app"""'], {}), "('flask.app')\n", (166, 179), False, 'import logging\n'), ((459, 493), 'requests.get', 'requests.get', (['url'], {'headers': 'headers'}), '(url, headers=headers)\n', (471, 493), False, 'import requests\n'), ((1704, 1738), 'requests.get'...
import torch import torch.nn as nn import torch.nn.functional as F from .bayes_layers import VariationalLinearCertainActivations, VariationalLinearReLU from .variables import GaussianVar class MLP(nn.Module): def __init__(self, x_dim, y_dim, hidden_size=None): super(MLP, self).__init__() self.siz...
[ "torch.nn.Sequential", "torch.tensor", "torch.nn.functional.relu", "torch.device" ]
[((1149, 1171), 'torch.nn.Sequential', 'nn.Sequential', (['*layers'], {}), '(*layers)\n', (1162, 1171), True, 'import torch.nn as nn\n'), ((2273, 2292), 'torch.device', 'torch.device', (['"""cpu"""'], {}), "('cpu')\n", (2285, 2292), False, 'import torch\n'), ((2149, 2158), 'torch.nn.functional.relu', 'F.relu', (['h'], ...
from demos.setup import np, plt from compecon import BasisChebyshev, BasisSpline from compecon.tools import nodeunif __author__ = 'Randall' # DEMAPP06 Chebychev and cubic spline derivative approximation errors # Function to be approximated def f(x): g = np.zeros((3, x.size)) g[0], g[1], g[2] = np.exp(-x),...
[ "demos.setup.plt.plot", "compecon.BasisChebyshev", "demos.setup.np.zeros", "demos.setup.plt.xlabel", "demos.setup.plt.title", "compecon.BasisSpline", "demos.setup.plt.subplot", "demos.setup.plt.ylabel", "demos.setup.plt.figure", "demos.setup.plt.show", "compecon.tools.nodeunif", "demos.setup.n...
[((649, 669), 'compecon.tools.nodeunif', 'nodeunif', (['(1001)', 'a', 'b'], {}), '(1001, a, b)\n', (657, 669), False, 'from compecon.tools import nodeunif\n'), ((810, 838), 'compecon.BasisChebyshev', 'BasisChebyshev', (['n', 'a', 'b'], {'f': 'f'}), '(n, a, b, f=f)\n', (824, 838), False, 'from compecon import BasisCheby...
import random import gym import numpy as np from collections import deque from keras.models import Sequential from keras.layers import Dense, Dropout from keras.optimizers import Adam import tensorflow as tf import os import logging os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' logging.getLogger('tensorflow').disabled = Tr...
[ "logging.getLogger", "tensorflow.device", "random.sample", "keras.optimizers.Adam", "collections.deque", "numpy.random.rand", "numpy.reshape", "random.randrange", "numpy.amax", "numpy.argmax", "keras.models.Sequential", "keras.layers.Dense", "keras.layers.Dropout", "gym.make" ]
[((275, 306), 'logging.getLogger', 'logging.getLogger', (['"""tensorflow"""'], {}), "('tensorflow')\n", (292, 306), False, 'import logging\n'), ((903, 921), 'collections.deque', 'deque', ([], {'maxlen': '(4096)'}), '(maxlen=4096)\n', (908, 921), False, 'from collections import deque\n'), ((1141, 1153), 'keras.models.Se...
from .core import ACSDataset import collections __all__ = ["PerCapitaIncome"] class PerCapitaIncome(ACSDataset): """ PER CAPITA INCOME IN THE PAST 12 MONTHS (IN 2018 INFLATION-ADJUSTED DOLLARS) """ AGGREGATION = None UNIVERSE = "total population" TABLE_NAME = "B19301" RAW_FIELDS = coll...
[ "collections.OrderedDict" ]
[((316, 369), 'collections.OrderedDict', 'collections.OrderedDict', (["{'001': 'per_capita_income'}"], {}), "({'001': 'per_capita_income'})\n", (339, 369), False, 'import collections\n')]
""" Path to CNS-related files. Most paths are defined by dictionaries that gather several related paths. Here, instead of defining the dictionaries with static paths, we have functions that create those dict-containing paths dynamically. The default values are defined by: - axis - tensors - translation_vectors - wate...
[ "pathlib.Path" ]
[((837, 871), 'pathlib.Path', 'Path', (['toppar_path', 'PARAMETERS_FILE'], {}), '(toppar_path, PARAMETERS_FILE)\n', (841, 871), False, 'from pathlib import Path\n'), ((888, 920), 'pathlib.Path', 'Path', (['toppar_path', 'TOPOLOGY_FILE'], {}), '(toppar_path, TOPOLOGY_FILE)\n', (892, 920), False, 'from pathlib import Pat...
#!/usr/bin/python2.7 # Copyright 2012 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 requi...
[ "json.load", "string.Template", "json.dump" ]
[((2243, 2261), 'json.load', 'json.load', (['json_in'], {}), '(json_in)\n', (2252, 2261), False, 'import json\n'), ((2302, 2343), 'json.dump', 'json.dump', (['expanded', 'sys.stdout'], {'indent': '(2)'}), '(expanded, sys.stdout, indent=2)\n', (2311, 2343), False, 'import json\n'), ((2014, 2027), 'string.Template', 'Tem...
# Generated by Django 4.0 on 2021-12-15 09:04 from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('book', '0005_alter_book_rented_count'), ] operations = [ migrations.AlterField( model_name='book', ...
[ "django.db.models.ImageField" ]
[((366, 461), 'django.db.models.ImageField', 'models.ImageField', ([], {'default': 'django.utils.timezone.now', 'upload_to': '"""static/media/book/covers"""'}), "(default=django.utils.timezone.now, upload_to=\n 'static/media/book/covers')\n", (383, 461), False, 'from django.db import migrations, models\n')]
from __future__ import absolute_import from __future__ import division from __future__ import print_function import _thread import sys import time from math import exp from random import random from typing import List, Tuple, Set from scipy import spatial import numpy as np import torch from torch import nn from torc...
[ "logging.getLogger", "numpy.log10", "torch.LongTensor", "torch.optim.optimizer.step", "torch.sin", "numpy.array", "torch.cos", "math.exp", "dataloader.TrainDataset", "torch.random.manual_seed", "torch.utils.tensorboard.SummaryWriter", "numpy.where", "torch.optim.optimizer.zero_grad", "logg...
[((691, 723), 'torch.random.manual_seed', 'torch.random.manual_seed', (['(123456)'], {}), '(123456)\n', (715, 723), False, 'import torch\n'), ((7415, 7442), 'logging.getLogger', 'logging.getLogger', (['"""logger"""'], {}), "('logger')\n", (7432, 7442), False, 'import logging\n'), ((7481, 7542), 'logging.basicConfig', '...
import discord import time import random import datetime import asyncio import json import config from discord.ext import commands from data.data_handler import data_handler from itertools import chain from collections import OrderedDict def gainedRP(player, gained_rp): if player['Level']['timeOfNextEarn'] > time...
[ "discord.ext.commands.Cog.listener", "datetime.datetime.utcfromtimestamp", "collections.OrderedDict.fromkeys", "discord.Colour", "data.data_handler.data_handler.load", "discord.Embed", "discord.ext.commands.is_owner", "discord.ext.commands.group", "data.data_handler.data_handler.dump", "time.time"...
[((1201, 1227), 'data.data_handler.data_handler.load', 'data_handler.load', (['"""clans"""'], {}), "('clans')\n", (1218, 1227), False, 'from data.data_handler import data_handler\n'), ((1243, 1272), 'data.data_handler.data_handler.load', 'data_handler.load', (['"""profiles"""'], {}), "('profiles')\n", (1260, 1272), Fal...
# Copyright 2021 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
[ "argparse.ArgumentParser", "mindspore.context.set_context", "mindspore.Tensor", "numpy.random.uniform", "src.models.ADNet.adnet" ]
[((832, 881), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""ADNet test"""'}), "(description='ADNet test')\n", (855, 881), False, 'import argparse\n'), ((1169, 1285), 'mindspore.context.set_context', 'context.set_context', ([], {'device_target': 'args.device_target', 'mode': 'context.PYN...
# Licensed under a 3-clause BSD style license - see LICENSE.rst import os def get_package_data(): paths_test = [os.path.join('data', '*.out')] return {'pyradex.tests': paths_test}
[ "os.path.join" ]
[((117, 146), 'os.path.join', 'os.path.join', (['"""data"""', '"""*.out"""'], {}), "('data', '*.out')\n", (129, 146), False, 'import os\n')]
"""Finds Guids that do not have referents or that point to referents that no longer exist. E.g. a node was created and given a guid but an error caused the node to get deleted, leaving behind a guid that points to nothing. """ import sys from modularodm import Q from framework.guid.model import Guid from website.app ...
[ "logging.getLogger", "modularodm.Q", "scripts.utils.add_file_logger", "website.app.init_app" ]
[((404, 431), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (421, 431), False, 'import logging\n'), ((566, 588), 'website.app.init_app', 'init_app', ([], {'routes': '(False)'}), '(routes=False)\n', (574, 588), False, 'from website.app import init_app\n'), ((484, 531), 'scripts.utils.add_...
""" This script is for testing/calling in several different ways functions from QRColorChecker modules. @author: <NAME> @mail: <EMAIL> """ import unittest import hashlib import dateutil from chalicelib.server import Server import sys import json from datetime import datetime sys.path.append('../chalicelib') clas...
[ "dateutil.parser.parse", "json.loads", "chalicelib.server.Server.parse_payload", "chalicelib.server.Server.parse_lora_json", "json.dumps", "chalicelib.server.Server.parse_sigfox_dic", "chalicelib.server.Server", "sys.path.append" ]
[((281, 313), 'sys.path.append', 'sys.path.append', (['"""../chalicelib"""'], {}), "('../chalicelib')\n", (296, 313), False, 'import sys\n'), ((1581, 1606), 'json.loads', 'json.loads', (['self.str_data'], {}), '(self.str_data)\n', (1591, 1606), False, 'import json\n'), ((1629, 1666), 'chalicelib.server.Server.parse_lor...
#!/usr/bin/env python import os import json import unittest from collections import OrderedDict from spdown.config import Config TEST_CONFIG_PATHS = OrderedDict([ ('local', 'config.json'), ('home', os.path.join( os.path.expanduser('~'), '.config', 'spdown', 'config' )) ]) TEST_CONFIG = { ...
[ "os.path.expanduser", "os.path.exists", "spdown.config.Config", "os.rename", "unittest.main", "json.dump" ]
[((3481, 3496), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3494, 3496), False, 'import unittest\n'), ((694, 744), 'os.path.exists', 'os.path.exists', (['TEST_CONFIG_PATHS[config_location]'], {}), '(TEST_CONFIG_PATHS[config_location])\n', (708, 744), False, 'import os\n'), ((1008, 1035), 'os.path.exists', 'os....
from emulation._emulate.microphysics import TimeMask from emulation.config import ( EmulationConfig, ModelConfig, StorageConfig, _load_nml, _get_timestep, _get_storage_hook, get_hooks, ) import emulation.zhao_carr import datetime def test_EmulationConfig_from_dict(): seconds = 60 m...
[ "datetime.datetime", "emulation.config.get_hooks", "emulation.config.ModelConfig", "emulation.config._get_timestep", "emulation.config._load_nml", "datetime.timedelta", "emulation.config.StorageConfig", "emulation.config._get_storage_hook" ]
[((840, 860), 'emulation.config.ModelConfig', 'ModelConfig', ([], {'path': '""""""'}), "(path='')\n", (851, 860), False, 'from emulation.config import EmulationConfig, ModelConfig, StorageConfig, _load_nml, _get_timestep, _get_storage_hook, get_hooks\n'), ((1007, 1053), 'emulation.config.ModelConfig', 'ModelConfig', ([...
from os import path import numpy as np import pytest import autofit as af import autolens as al from autolens.mock import mock pytestmark = pytest.mark.filterwarnings( "ignore:Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of " "`arr[seq]`. In...
[ "autolens.mock.mock.MockResults", "pytest.mark.filterwarnings", "autolens.mock.mock.MockPositionsSolver", "autolens.SettingsPhasePositions", "os.path.join", "os.path.realpath", "autolens.mock.mock.MockSearch" ]
[((152, 457), 'pytest.mark.filterwarnings', 'pytest.mark.filterwarnings', (['"""ignore:Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an arrays index, `arr[np.arrays(seq)]`, which will result either in an err...
from .pressureprofile import PressureProfile import numpy as np class ArrayPressureProfile(PressureProfile): def __init__(self, array, reverse=False): super().__init__(self.__class__.__name__, array.shape[-1]) if reverse: self.pressure_profile = array[::-1] else: ...
[ "numpy.append", "numpy.log10", "numpy.gradient" ]
[((503, 534), 'numpy.log10', 'np.log10', (['self.pressure_profile'], {}), '(self.pressure_profile)\n', (511, 534), True, 'import numpy as np\n'), ((551, 568), 'numpy.gradient', 'np.gradient', (['logp'], {}), '(logp)\n', (562, 568), True, 'import numpy as np\n'), ((627, 680), 'numpy.append', 'np.append', (['(logp - grad...
from datadog import initialize, api options = { 'api_key': '16ff05c7af6ed4652a20f5a8d0c609ce', 'app_key': 'e6a169b9b337355eef90002878fbf9a565e9ee77' } initialize(**options) title = "Mymetric timeboard" description = "Mymetric Timeboard" graphs = [ { "definition": { "events": [], ...
[ "datadog.api.Timeboard.create", "datadog.initialize" ]
[((161, 182), 'datadog.initialize', 'initialize', ([], {}), '(**options)\n', (171, 182), False, 'from datadog import initialize, api\n'), ((1191, 1307), 'datadog.api.Timeboard.create', 'api.Timeboard.create', ([], {'title': 'title', 'description': 'description', 'graphs': 'graphs', 'template_variables': 'template_varia...
#! /usr/bin/env python3 from subprocess import call r = call(["python3", "-m", "korali.rlview", "--help"]) if r!=0: exit(r) r = call(["python3", "-m", "korali.rlview", "--dir", "abf2d_vracer1", "--test"]) if r!=0: exit(r) r = call(["python3", "-m", "korali.rlview", "--dir", "abf2d_vracer1", "--maxObservations", ...
[ "subprocess.call" ]
[((57, 107), 'subprocess.call', 'call', (["['python3', '-m', 'korali.rlview', '--help']"], {}), "(['python3', '-m', 'korali.rlview', '--help'])\n", (61, 107), False, 'from subprocess import call\n'), ((132, 208), 'subprocess.call', 'call', (["['python3', '-m', 'korali.rlview', '--dir', 'abf2d_vracer1', '--test']"], {})...
from assets.lambdas.transform_findings.index import TransformFindings import boto3 from moto import mock_s3 def __make_bucket(bucket_name: str): bucket = boto3.resource('s3').Bucket(bucket_name) bucket.create() return bucket @mock_s3 def test_fix_dictionary(): bucket = __make_bucket('tester') tr...
[ "boto3.resource", "assets.lambdas.transform_findings.index.TransformFindings" ]
[((339, 369), 'assets.lambdas.transform_findings.index.TransformFindings', 'TransformFindings', (['bucket.name'], {}), '(bucket.name)\n', (356, 369), False, 'from assets.lambdas.transform_findings.index import TransformFindings\n'), ((160, 180), 'boto3.resource', 'boto3.resource', (['"""s3"""'], {}), "('s3')\n", (174, ...
# -*- coding: utf-8 -*- ################################################################################ # | # # | ______________________________________________________________ # # | :~8a.`~888a:::::::::::::::88......88:::::::::...
[ "re.compile", "resources.lib.modules.control.makeFile", "resources.lib.modules.sources.sources", "sys.exit", "datetime.timedelta", "ftplib.FTP", "urllib.quote_plus", "resources.lib.modules.control.version", "resources.lib.modules.control.lang", "resources.lib.modules.control.idle", "resources.li...
[((5709, 5745), 're.sub', 're.sub', (['"""[^\\\\w\\\\-_\\\\. ]"""', '"""_"""', 'title'], {}), "('[^\\\\w\\\\-_\\\\. ]', '_', title)\n", (5715, 5745), False, 'import re\n'), ((5838, 5874), 'os.path.join', 'os.path.join', (['base_path', 'show_folder'], {}), '(base_path, show_folder)\n', (5850, 5874), False, 'import os\n'...
# Copyright 2015 - Mirantis, Inc. # Copyright 2015 - StackStorm, 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 # # Unl...
[ "sqlalchemy.Text", "mistral.db.sqlalchemy.types.MediumText", "sqlalchemy.String", "sqlalchemy.Column", "oslo_log.log.getLogger", "mistral.db.sqlalchemy.types.JsonMediumDictType", "sqlalchemy.orm.backref", "sqlalchemy.CHAR", "mistral.utils.datetime_to_str_in_dict", "mistral.db.sqlalchemy.model_base...
[((1106, 1133), 'oslo_log.log.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1123, 1133), True, 'from oslo_log import log as logging\n'), ((8116, 8148), 'mistral.utils.iter_subclasses', 'utils.iter_subclasses', (['Execution'], {}), '(Execution)\n', (8137, 8148), False, 'from mistral import utils\...
"""EESG.py Created by <NAME>, <NAME>. Copyright (c) NREL. All rights reserved. Electromagnetic design based on conventional magnetic circuit laws Structural design based on McDonald's thesis """ from openmdao.api import Group, Problem, Component,ExecComp,IndepVarComp,ScipyOptimizer,pyOptSparseDriver from openmd...
[ "openmdao.api.ExecComp", "math.tan", "openmdao.api.IndepVarComp", "math.sqrt", "math.cos", "numpy.array", "openmdao.drivers.pyoptsparse_driver.pyOptSparseDriver", "math.sin", "math.atan" ]
[((30236, 30255), 'openmdao.drivers.pyoptsparse_driver.pyOptSparseDriver', 'pyOptSparseDriver', ([], {}), '()\n', (30253, 30255), False, 'from openmdao.drivers.pyoptsparse_driver import pyOptSparseDriver\n'), ((35050, 35075), 'numpy.array', 'np.array', (['[0.0, 0.0, 0.0]'], {}), '([0.0, 0.0, 0.0])\n', (35058, 35075), T...
#!/usr/bin/env python """A more advanced Reducer, using Python iterators and generators.""" from itertools import groupby from operator import itemgetter import sys def read_mapper_output(file, separator='\t'): for line in file: yield line.rstrip().split(separator, 1) def main(separator='\t'): data...
[ "operator.itemgetter" ]
[((410, 423), 'operator.itemgetter', 'itemgetter', (['(0)'], {}), '(0)\n', (420, 423), False, 'from operator import itemgetter\n')]
import copy import logging import os from typing import Dict, List, Tuple import checksumdir import imageio import numpy as np import torch from torch.utils.data import DataLoader, Dataset from tqdm import tqdm from ..adapter import download_object logger = logging.getLogger("fastface.dataset") class _IdentitiyTra...
[ "logging.getLogger", "numpy.mean", "os.path.exists", "copy.deepcopy", "numpy.sqrt", "os.path.join", "torch.from_numpy", "numpy.ascontiguousarray", "numpy.array", "numpy.stack", "numpy.zeros", "numpy.concatenate", "torch.utils.data.DataLoader", "imageio.imread", "checksumdir.dirhash" ]
[((261, 298), 'logging.getLogger', 'logging.getLogger', (['"""fastface.dataset"""'], {}), "('fastface.dataset')\n", (278, 298), False, 'import logging\n'), ((1663, 1695), 'copy.deepcopy', 'copy.deepcopy', (['self.targets[idx]'], {}), '(self.targets[idx])\n', (1676, 1695), False, 'import copy\n'), ((2914, 2943), 'imagei...
import pygame import math coef_turn = 0.3 coef_drift = 0.07 # adhérence au sol coef_vel = 10 class Car: def __init__(self): self.dir_target = -1 self.dir = -1 self.posx = 0 self.velx = -1 self.w = 50 self.h = 100 def update(self, dt): self.dir += dt * ...
[ "math.cos", "math.sin", "pygame.draw.polygon", "math.atan2" ]
[((595, 618), 'math.atan2', 'math.atan2', (['self.dir', '(1)'], {}), '(self.dir, 1)\n', (605, 618), False, 'import math\n'), ((941, 989), 'pygame.draw.polygon', 'pygame.draw.polygon', (['screen', '(255, 0, 0)', 'points'], {}), '(screen, (255, 0, 0), points)\n', (960, 989), False, 'import pygame\n'), ((785, 800), 'math....
import os import sys import string def is_active(): return True def get_name(): return "WinRT" def can_build(): if (os.name=="nt"): #building natively on windows! if (os.getenv("VSINSTALLDIR")): return True return False def get_opts(): return [] def get_flags(): return [] def configure(env): ...
[ "string.split", "os.getenv" ]
[((182, 207), 'os.getenv', 'os.getenv', (['"""VSINSTALLDIR"""'], {}), "('VSINSTALLDIR')\n", (191, 207), False, 'import os\n'), ((404, 425), 'os.getenv', 'os.getenv', (['"""PLATFORM"""'], {}), "('PLATFORM')\n", (413, 425), False, 'import os\n'), ((3899, 4234), 'string.split', 'string.split', (['"""/MP /GS /wd"4453" /wd"...
# Copyright 2015-2017 FUJITSU LIMITED # # 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...
[ "mock.Mock", "monasca_log_api.middleware.role_middleware._intersect", "monasca_log_api.middleware.role_middleware.RoleMiddleware", "monasca_log_api.middleware.role_middleware._ensure_lower_roles" ]
[((2362, 2385), 'monasca_log_api.middleware.role_middleware.RoleMiddleware', 'rm.RoleMiddleware', (['None'], {}), '(None)\n', (2379, 2385), True, 'from monasca_log_api.middleware import role_middleware as rm\n'), ((2716, 2739), 'monasca_log_api.middleware.role_middleware.RoleMiddleware', 'rm.RoleMiddleware', (['None'],...
import logging class NewLogger: def __init__(self, log_abs_path:str): self.logger = logging.getLogger() handler = logging.FileHandler(log_abs_path) handler.setLevel(logging.ERROR) self.logger.addHandler(handler) def log(self, msg:str): self.logger.log(logging.ERROR, m...
[ "logging.getLogger", "logging.FileHandler" ]
[((99, 118), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (116, 118), False, 'import logging\n'), ((137, 170), 'logging.FileHandler', 'logging.FileHandler', (['log_abs_path'], {}), '(log_abs_path)\n', (156, 170), False, 'import logging\n')]
from bast import Route route = Route() route.get('/', 'HelloController.index')
[ "bast.Route" ]
[((32, 39), 'bast.Route', 'Route', ([], {}), '()\n', (37, 39), False, 'from bast import Route\n')]
import inspect from fnmatch import fnmatchcase from ..sched import meta from .base import BaseFactory class ModuleFactory(BaseFactory): """ Takes an imported module object and extracts callable objects from it. A valid callable is any object that can be called and has pexen.sched metadata. Argum...
[ "fnmatch.fnmatchcase", "inspect.getmembers" ]
[((885, 908), 'inspect.getmembers', 'inspect.getmembers', (['mod'], {}), '(mod)\n', (903, 908), False, 'import inspect\n'), ((686, 718), 'fnmatch.fnmatchcase', 'fnmatchcase', (['objname', 'self.match'], {}), '(objname, self.match)\n', (697, 718), False, 'from fnmatch import fnmatchcase\n')]
import vstruct from vstruct.primitives import * EI_NIDENT = 4 EI_PADLEN = 7 class Elf32(vstruct.VStruct): def __init__(self, bigend=False): vstruct.VStruct.__init__(self) self.e_ident = v_bytes(EI_NIDENT) self.e_class = v_uint8() self.e_data = v_uint8() s...
[ "vstruct.VArray", "vstruct.VStruct.__init__" ]
[((154, 184), 'vstruct.VStruct.__init__', 'vstruct.VStruct.__init__', (['self'], {}), '(self)\n', (178, 184), False, 'import vstruct\n'), ((1249, 1279), 'vstruct.VStruct.__init__', 'vstruct.VStruct.__init__', (['self'], {}), '(self)\n', (1273, 1279), False, 'import vstruct\n'), ((1884, 1914), 'vstruct.VStruct.__init__'...
# Copyright (c) 2013 Mirantis 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 writ...
[ "saharaclient.api.base.get_query_string" ]
[((1660, 1761), 'saharaclient.api.base.get_query_string', 'base.get_query_string', (['search_opts'], {'limit': 'limit', 'marker': 'marker', 'sort_by': 'sort_by', 'reverse': 'reverse'}), '(search_opts, limit=limit, marker=marker, sort_by=\n sort_by, reverse=reverse)\n', (1681, 1761), False, 'from saharaclient.api imp...
# -*- coding: utf-8 -*- import pytest def test_translator(): def translator(string): translations = {'String value is too long.': 'Tamanho de texto muito grande.'} return translations.get(string, string) from schematics.translator import register_translator register_translator(translator...
[ "schematics.types.StringType", "schematics.translator.register_translator", "pytest.raises" ]
[((290, 321), 'schematics.translator.register_translator', 'register_translator', (['translator'], {}), '(translator)\n', (309, 321), False, 'from schematics.translator import register_translator\n'), ((430, 460), 'pytest.raises', 'pytest.raises', (['ValidationError'], {}), '(ValidationError)\n', (443, 460), False, 'im...
""" Module for managing enemies. """ import random import constants as const import pygame import random import platforms from spritesheet_functions import SpriteSheet class Enemy(pygame.sprite.Sprite): # -- Methods def __init__(self, x_cord, y_cord,level, x_speed=2, char_type=0): """ Constructor ...
[ "pygame.transform.flip", "random.uniform", "pygame.time.get_ticks", "pygame.sprite.spritecollide", "spritesheet_functions.SpriteSheet", "pygame.mask.from_surface", "pygame.Surface", "pygame.image.load", "pygame.Surface.blit" ]
[((1378, 1416), 'spritesheet_functions.SpriteSheet', 'SpriteSheet', (['"""spritesheet_players.png"""'], {}), "('spritesheet_players.png')\n", (1389, 1416), False, 'from spritesheet_functions import SpriteSheet\n'), ((2212, 2235), 'pygame.time.get_ticks', 'pygame.time.get_ticks', ([], {}), '()\n', (2233, 2235), False, '...
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 import boto3 import botocore import os import logging import time import json import datetime log = logging.getLogger() log.setLevel('INFO') bucket = os.environ['BUCKET'] region = os.environ['AWS_REGION'] solu...
[ "logging.getLogger", "boto3.client", "datetime.datetime.utcnow", "botocore.config.Config", "json.dumps", "os.environ.get", "time.sleep" ]
[((209, 228), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (226, 228), False, 'import logging\n'), ((335, 379), 'os.environ.get', 'os.environ.get', (['"""SOLUTION_VERSION"""', '"""v1.0.0"""'], {}), "('SOLUTION_VERSION', 'v1.0.0')\n", (349, 379), False, 'import os\n'), ((394, 423), 'os.environ.get', 'os.e...
import json import logging from django.core.management.base import BaseCommand from django.db import transaction from osf.models import AbstractProvider, PreprintProvider, Preprint, Subject from osf.models.provider import rules_to_subjects from scripts import utils as script_utils from osf.models.validators import va...
[ "logging.getLogger", "osf.models.provider.rules_to_subjects", "json.loads", "django.db.transaction.atomic", "osf.models.validators.validate_subject_hierarchy", "osf.models.Preprint.objects.filter", "osf.models.Subject", "osf.models.Subject.objects.filter", "website.preprints.tasks.on_preprint_update...
[((411, 438), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (428, 438), False, 'import logging\n'), ((4490, 4552), 'osf.models.Subject.objects.get', 'Subject.objects.get', ([], {'provider': 'BEPRESS_PROVIDER', 'text': 'root_text'}), '(provider=BEPRESS_PROVIDER, text=root_text)\n', (4509,...
import torch.utils.data as data import os import os.path import numpy as np from numpy.random import randint import torch from colorama import init from colorama import Fore, Back, Style import random from os import listdir from os.path import join, splitext import numpy as np import torch import torch.nn.functiona...
[ "torchvision.transforms.CenterCrop", "torch.utils.data.append", "os.listdir", "PIL.Image.open", "numpy.ones", "torch.load", "torch.stack", "os.path.join", "numpy.append", "numpy.zeros", "numpy.random.randint", "torchvision.transforms.Normalize", "torchvision.transforms.Resize", "torchvisio...
[((505, 525), 'colorama.init', 'init', ([], {'autoreset': '(True)'}), '(autoreset=True)\n', (509, 525), False, 'from colorama import init\n'), ((5481, 5500), 'torch.stack', 'torch.stack', (['frames'], {}), '(frames)\n', (5492, 5500), False, 'import torch\n'), ((8333, 8350), 'torch.stack', 'torch.stack', (['data'], {}),...
# -*- coding: utf-8 -*- from django.http import HttpResponseForbidden from django.template import loader from django.utils.translation import ugettext_lazy as _ # 普通用户 def _requred_forbid(msg): t = loader.get_template('limit_ip.html') content = t.render({'message': msg }) return HttpResponseForbidden(cont...
[ "django.http.HttpResponseForbidden", "django.utils.translation.ugettext_lazy", "django.template.loader.get_template" ]
[((333, 374), 'django.utils.translation.ugettext_lazy', '_', (['u"""请求太频繁,请等待30s后重试(Request too often)。"""'], {}), "(u'请求太频繁,请等待30s后重试(Request too often)。')\n", (334, 374), True, 'from django.utils.translation import ugettext_lazy as _\n'), ((204, 240), 'django.template.loader.get_template', 'loader.get_template', (['"...
import math import aerospike from aerospike import predicates as p from aerospike import exception as ex from flask import current_app aerospike_host = current_app.config['AEROSPIKE_HOST'] aerospike_port = current_app.config['AEROSPIKE_PORT'] namespace = current_app.config['AEROSPIKE_NAMESPACE'] set_name = current_...
[ "aerospike.client", "aerospike.predicates.equals" ]
[((520, 544), 'aerospike.client', 'aerospike.client', (['config'], {}), '(config)\n', (536, 544), False, 'import aerospike\n'), ((1928, 1960), 'aerospike.predicates.equals', 'p.equals', (['"""createdById"""', 'user_id'], {}), "('createdById', user_id)\n", (1936, 1960), True, 'from aerospike import predicates as p\n')]
""" author: @nimrobotics description: calculates the effective connectivity between regions and plots them """ import numpy as np import scipy.io import glob import sys sys.path.append('../utils') from plots import plotData dir = "./process3/" #directory of the data outdir = 'process3/' #directory to save the plots r...
[ "numpy.multiply", "plots.plotData", "sys.path.append", "glob.glob" ]
[((170, 197), 'sys.path.append', 'sys.path.append', (['"""../utils"""'], {}), "('../utils')\n", (185, 197), False, 'import sys\n'), ((358, 384), 'glob.glob', 'glob.glob', (["(dir + '/*_.mat')"], {}), "(dir + '/*_.mat')\n", (367, 384), False, 'import glob\n'), ((909, 931), 'numpy.multiply', 'np.multiply', (['fval', 'sig...
from django.db import models from sorl.thumbnail import ImageField # Create your models here. class Post(models.Model): text = models.CharField(max_length=140, blank=False, null=False) image = ImageField() def __str__(self): return self.text
[ "sorl.thumbnail.ImageField", "django.db.models.CharField" ]
[((132, 189), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(140)', 'blank': '(False)', 'null': '(False)'}), '(max_length=140, blank=False, null=False)\n', (148, 189), False, 'from django.db import models\n'), ((202, 214), 'sorl.thumbnail.ImageField', 'ImageField', ([], {}), '()\n', (212, 214),...
#!/usr/bin/env python3 import pyglet import glooey import autoprop import datetime from pyglet.gl import * from vecrec import Vector, Rect @autoprop class LineClock(glooey.Widget): custom_radius = 50 custom_color = 'green' custom_hour_hand_width = 3 custom_minute_hand_width = 2 custom_second_hand_...
[ "pyglet.clock.unschedule", "pyglet.clock.schedule_interval", "pyglet.app.run", "glooey.Gui", "vecrec.Vector.from_degrees", "glooey.drawing.Rectangle", "datetime.datetime.now", "glooey.drawing.Color.from_anything", "pyglet.window.Window", "vecrec.Rect.from_size" ]
[((4923, 4945), 'pyglet.window.Window', 'pyglet.window.Window', ([], {}), '()\n', (4943, 4945), False, 'import pyglet\n'), ((4952, 4970), 'glooey.Gui', 'glooey.Gui', (['window'], {}), '(window)\n', (4962, 4970), False, 'import glooey\n'), ((4992, 5008), 'pyglet.app.run', 'pyglet.app.run', ([], {}), '()\n', (5006, 5008)...
# coding=utf-8 # Generated by Django 2.0.7 on 2018-07-27 10:56 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('forms', '0003_auto_20180522_0820'), ] operations = [ migrations.AlterField( model_name='field', name=...
[ "django.db.models.SlugField", "django.db.models.CharField" ]
[((351, 422), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'max_length': '(2000)', 'verbose_name': '"""Help text"""'}), "(blank=True, max_length=2000, verbose_name='Help text')\n", (367, 422), False, 'from django.db import migrations, models\n'), ((540, 606), 'django.db.models.SlugField', ...
import os import re import sys import json #upper import sys.path.append("../../") from utils import levenshtein from utils.io import load_json, write_to def strQ2B(ustring): """全角转半角""" rstring = "" for uchar in ustring: inside_code=ord(uchar) if inside_code == 12288: ...
[ "utils.io.load_json", "os.path.join", "re.findall", "utils.levenshtein.convert_from_sentpair_through", "sys.path.append" ]
[((59, 84), 'sys.path.append', 'sys.path.append', (['"""../../"""'], {}), "('../../')\n", (74, 84), False, 'import sys\n'), ((780, 820), 'os.path.join', 'os.path.join', (['data_dir', '"""train_dev.json"""'], {}), "(data_dir, 'train_dev.json')\n", (792, 820), False, 'import os\n'), ((839, 881), 'os.path.join', 'os.path....
from __future__ import with_statement from nose.tools import assert_true from os.path import exists import numpy as np from nibabel import Nifti1Image from numpy.testing import assert_equal from ...utils.simul_multisubject_fmri_dataset import surrogate_3d_dataset from ..bsa_io import make_bsa_image from nibabel.tmpdirs...
[ "os.path.exists", "numpy.eye", "numpy.ones", "numpy.testing.assert_equal", "nibabel.tmpdirs.InTemporaryDirectory", "nose.run" ]
[((1505, 1534), 'nose.run', 'nose.run', ([], {'argv': "['', __file__]"}), "(argv=['', __file__])\n", (1513, 1534), False, 'import nose\n'), ((584, 598), 'numpy.ones', 'np.ones', (['shape'], {}), '(shape)\n', (591, 598), True, 'import numpy as np\n'), ((600, 609), 'numpy.eye', 'np.eye', (['(4)'], {}), '(4)\n', (606, 609...
"""Utilities for working with Doxygen tag files. """ __all__ = ["get_tag_entity_names"] import xml.etree.ElementTree as ET from pathlib import Path from typing import List, Optional, Sequence, Union try: from sphinxcontrib.doxylink import doxylink except ImportError: print( "sphinxcontrib.doxylink is...
[ "sphinxcontrib.doxylink.doxylink.SymbolMap" ]
[((1176, 1199), 'sphinxcontrib.doxylink.doxylink.SymbolMap', 'doxylink.SymbolMap', (['doc'], {}), '(doc)\n', (1194, 1199), False, 'from sphinxcontrib.doxylink import doxylink\n')]
# Shell Game, by <NAME> <EMAIL> # A random gambling game. import random, time, sys print('''SHELL GAME By <NAME> <EMAIL> Try to find the diamond! Press Enter to continue...''') input() CUPS = ['diamond', 'pocket lint', 'nothing'] while True: print() print('Shuffling the cups', end='') random.shuffle(CU...
[ "random.shuffle", "time.sleep", "sys.exit" ]
[((303, 323), 'random.shuffle', 'random.shuffle', (['CUPS'], {}), '(CUPS)\n', (317, 323), False, 'import random, time, sys\n'), ((414, 429), 'time.sleep', 'time.sleep', (['(0.3)'], {}), '(0.3)\n', (424, 429), False, 'import random, time, sys\n'), ((457, 472), 'time.sleep', 'time.sleep', (['(0.3)'], {}), '(0.3)\n', (467...
import pyttsx3 import speech_recognition as sr import openai as op import os op.api_key = os.getenv("OPENAI_API_KEY") engine = pyttsx3.init() engine.setProperty('rate', 150) engine.setProperty('volume', 1.0) voices = engine.getProperty('voices') engine.setProperty('voice', voices[1].id) def tell(text): engine.s...
[ "os.getenv", "pyttsx3.init", "speech_recognition.Recognizer", "speech_recognition.Microphone", "openai.Completion.create" ]
[((92, 119), 'os.getenv', 'os.getenv', (['"""OPENAI_API_KEY"""'], {}), "('OPENAI_API_KEY')\n", (101, 119), False, 'import os\n'), ((130, 144), 'pyttsx3.init', 'pyttsx3.init', ([], {}), '()\n', (142, 144), False, 'import pyttsx3\n'), ((381, 396), 'speech_recognition.Recognizer', 'sr.Recognizer', ([], {}), '()\n', (394, ...
# To run the job: # pyats run job BGP_check_job.py --testbed-file <testbed_file.yaml> # Description: This job file checks that all BGP neighbors are in Established state import os # All run() must be inside a main function def main(runtime): # Find the location of the script in relation to the job file bgp_tes...
[ "os.path.dirname" ]
[((338, 363), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (353, 363), False, 'import os\n')]
import os def get_dirs(): cwd = os.path.dirname(os.path.realpath(__file__)) local_savedir = cwd local_datadir = cwd local_wandbdir = cwd return local_savedir, local_datadir, local_wandbdir def configure_logging(config, name, model): if config['wandb_on']: import wandb wandb...
[ "wandb.log", "os.path.join", "wandb.init", "os.path.realpath", "wandb.watch" ]
[((53, 79), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (69, 79), False, 'import os\n'), ((315, 437), 'wandb.init', 'wandb.init', ([], {'name': 'name', 'project': '"""YOUR_PROJECT_NAME"""', 'entity': '"""YOUR_ENTITY_NAME"""', 'dir': "config['wandb_dir']", 'config': 'config'}), "(name=nam...
import torch from torch import nn from transformers import BertTokenizer, VisualBertModel, VisualBertConfig import numpy as np class VisualBertClassifier(nn.Module): def __init__(self, visual_bert_model, num_classes: int = 8, initial_visual_embedding_dim: int = 9...
[ "torch.nn.Dropout", "torch.unsqueeze", "transformers.BertTokenizer.from_pretrained", "torch.from_numpy", "torch.nn.Linear", "numpy.load", "torch.ones" ]
[((2161, 2211), 'transformers.BertTokenizer.from_pretrained', 'BertTokenizer.from_pretrained', (['"""bert-base-uncased"""'], {}), "('bert-base-uncased')\n", (2190, 2211), False, 'from transformers import BertTokenizer, VisualBertModel, VisualBertConfig\n'), ((2689, 2729), 'numpy.load', 'np.load', (['sample_face_body_em...
from narrative2vec.logging_instance.logging_instance import LoggingInstance, _get_first_rdf_query_result from narrative2vec.logging_instance.reasoning_task import ReasoningTask from narrative2vec.ontology.neemNarrativeDefinitions import QUATERNION from narrative2vec.ontology.ontologyHandler import get_knowrob_uri cla...
[ "narrative2vec.logging_instance.logging_instance._get_first_rdf_query_result", "narrative2vec.logging_instance.reasoning_task.ReasoningTask", "narrative2vec.ontology.ontologyHandler.get_knowrob_uri" ]
[((790, 842), 'narrative2vec.logging_instance.logging_instance._get_first_rdf_query_result', '_get_first_rdf_query_result', (['reasoning_task_property'], {}), '(reasoning_task_property)\n', (817, 842), False, 'from narrative2vec.logging_instance.logging_instance import LoggingInstance, _get_first_rdf_query_result\n'), ...
# -*- coding: utf-8 -*- """ (SHORT NAME EXPLANATION) >>>DOCTEST COMMANDS (THE TEST ANSWER) @author: <NAME>. Created on Mon Jul 10 20:12:27 2017 Department of Aerodynamics Faculty of Aerospace Engineering TU Delft #SUMMARY---------------- #INPUTS----------------- #ESSENTI...
[ "inner_product.inner", "forms.Form", "function_space.FunctionSpace", "numpy.cos", "numpy.sin", "mesh.CrazyMesh" ]
[((1661, 1707), 'mesh.CrazyMesh', 'CrazyMesh', (['(2)', '(2, 2)', '((-1, 1), (-1, 1))', '(0.05)'], {}), '(2, (2, 2), ((-1, 1), (-1, 1)), 0.05)\n', (1670, 1707), False, 'from mesh import CrazyMesh\n'), ((1732, 1786), 'function_space.FunctionSpace', 'FunctionSpace', (['mesh', '"""1-gauss"""', '(5, 5)'], {'is_inner': '(Fa...
from allennlp.common.testing import AllenNlpTestCase from allennlp.data.tokenizers import PretrainedTransformerTokenizer class TestPretrainedTransformerTokenizer(AllenNlpTestCase): def test_splits_roberta(self): tokenizer = PretrainedTransformerTokenizer("roberta-base") sentence = "A, <mask> Alle...
[ "allennlp.data.tokenizers.PretrainedTransformerTokenizer" ]
[((238, 284), 'allennlp.data.tokenizers.PretrainedTransformerTokenizer', 'PretrainedTransformerTokenizer', (['"""roberta-base"""'], {}), "('roberta-base')\n", (268, 284), False, 'from allennlp.data.tokenizers import PretrainedTransformerTokenizer\n'), ((1175, 1224), 'allennlp.data.tokenizers.PretrainedTransformerTokeni...
# -*- coding: UTF-8 -*- """ collector.xhn - 新华网数据采集 官网:http://www.xinhuanet.com/ 接口分析: 1. 获取文章列表 http://qc.wa.news.cn/nodeart/list?nid=115093&pgnum=1&cnt=10000 新华全媒体头条 http://www.xinhuanet.com/politics/qmtt/index.htm ==================================================================== """ import requests import re...
[ "re.compile", "tqdm.tqdm", "requests.get", "datetime.datetime.now", "pandas.DataFrame", "traceback.print_exc", "zb.crawlers.utils.get_header" ]
[((986, 1003), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (998, 1003), False, 'import requests\n'), ((2738, 2777), 're.compile', 're.compile', (['"""(\\\\d{4}-\\\\d{2}[/-]\\\\d{2})"""'], {}), "('(\\\\d{4}-\\\\d{2}[/-]\\\\d{2})')\n", (2748, 2777), False, 'import re\n'), ((3967, 4021), 'pandas.DataFrame', ...
import unittest from plugins.onetv import OneTV class TestPluginPerviyKanal(unittest.TestCase): def test_can_handle_url(self): regex_test_list = [ "https://media.1tv.ru/embed/ctcmedia/ctc-che.html?start=auto", "https://media.1tv.ru/embed/ctcmedia/ctc-dom.html?start=auto", ...
[ "plugins.onetv.OneTV.can_handle_url" ]
[((968, 993), 'plugins.onetv.OneTV.can_handle_url', 'OneTV.can_handle_url', (['url'], {}), '(url)\n', (988, 993), False, 'from plugins.onetv import OneTV\n')]
from __future__ import print_function from __future__ import absolute_import from __future__ import division from random import uniform from compas.geometry import transform_points from compas.geometry import centroid_points from compas.geometry import bounding_box from compas.geometry import Primitive from compas.geo...
[ "compas.geometry.Point.from_data", "compas.geometry.centroid_points", "compas.geometry.Point", "random.uniform", "compas.geometry.bounding_box", "compas.data.is_float3", "compas.geometry.transform_points" ]
[((1972, 2000), 'compas.geometry.centroid_points', 'centroid_points', (['self.points'], {}), '(self.points)\n', (1987, 2000), False, 'from compas.geometry import centroid_points\n'), ((2059, 2084), 'compas.geometry.bounding_box', 'bounding_box', (['self.points'], {}), '(self.points)\n', (2071, 2084), False, 'from compa...
"""Handle regex conversions.""" from builtins import object import re import operator from functools import reduce import oa.errors # Map of perl flags and the corresponding re ones. FLAGS = { "i": re.IGNORECASE, "s": re.DOTALL, "m": re.MULTILINE, "x": re.VERBOSE, } DELIMS = { "/": "/", "{"...
[ "re.compile" ]
[((501, 874), 're.compile', 're.compile', (['"""\n # Python does not support local extensions so remove those. For example:\n # (?i:test) becomes (?:test)\n\n (?<=\\\\(\\\\?) # Look-behind and match (?\n (([adlupimsx-]*?)|(\\\\^[?^alupimsx]*?)) # Capture the extension\n ...
import numpy as np import matplotlib.pyplot as plt from matplotlib.widgets import Slider from kalman_filter import KalmanFilter raw_data = np.loadtxt("barometer_data.txt") # Truncate raw data (it's super long) raw_data = raw_data[:raw_data.size//4] raw_data_step = np.loadtxt("barometer_data_step.txt") t1 = np.arange(0...
[ "kalman_filter.KalmanFilter", "matplotlib.pyplot.figure", "numpy.zeros", "matplotlib.widgets.Slider", "numpy.loadtxt", "numpy.arange", "matplotlib.pyplot.show" ]
[((140, 172), 'numpy.loadtxt', 'np.loadtxt', (['"""barometer_data.txt"""'], {}), "('barometer_data.txt')\n", (150, 172), True, 'import numpy as np\n'), ((266, 303), 'numpy.loadtxt', 'np.loadtxt', (['"""barometer_data_step.txt"""'], {}), "('barometer_data_step.txt')\n", (276, 303), True, 'import numpy as np\n'), ((309, ...
import heapq from typing import List class Solution: def get_number_of_backlog_orders(self, orders: List[List[int]]) -> int: sell_backlog = [] buy_backlog = [] for price, amount, order_type in orders: if order_type == 0: while amount > 0: if ...
[ "heapq.heappop", "heapq.heappush" ]
[((416, 443), 'heapq.heappop', 'heapq.heappop', (['sell_backlog'], {}), '(sell_backlog)\n', (429, 443), False, 'import heapq\n'), ((798, 843), 'heapq.heappush', 'heapq.heappush', (['buy_backlog', '(-price, amount)'], {}), '(buy_backlog, (-price, amount))\n', (812, 843), False, 'import heapq\n'), ((1047, 1073), 'heapq.h...