code
stringlengths
22
1.05M
apis
listlengths
1
3.31k
extract_api
stringlengths
75
3.25M
from django.test import TestCase from billing.utils.credit_card import CreditCard from billing import get_gateway, GatewayNotConfigured, get_integration, IntegrationNotConfigured from django.conf import settings from django.template import Template, Context, TemplateSyntaxError class MerchantTestCase(TestCase): d...
[ "billing.get_gateway", "django.template.Template", "billing.get_integration", "django.template.Context" ]
[((372, 400), 'billing.get_gateway', 'get_gateway', (['"""authorize_net"""'], {}), "('authorize_net')\n", (383, 400), False, 'from billing import get_gateway, GatewayNotConfigured, get_integration, IntegrationNotConfigured\n'), ((1693, 1790), 'django.template.Template', 'Template', (['"""{% load render_integration from...
#!/usr/bin/env python # -*- encode: utf-8 -*- #Copyright 2015 RAPP #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 applicabl...
[ "rospy.logerr", "rapp_utilities.RappUtilities.rapp_print", "rospy.logerror", "rospy.init_node", "rospy.get_param", "rospy.Service", "rospy.has_param", "rospkg.RosPack", "rapp_platform_ros_communications.srv.SpeechRecognitionSphinx4TotalSrvResponse", "rospy.spin", "threading.Condition", "hashli...
[((7395, 7438), 'rospy.init_node', 'rospy.init_node', (['"""SpeechRecognitionSphinx4"""'], {}), "('SpeechRecognitionSphinx4')\n", (7410, 7438), False, 'import rospy\n'), ((7454, 7470), 'rospkg.RosPack', 'rospkg.RosPack', ([], {}), '()\n', (7468, 7470), False, 'import rospkg\n'), ((1566, 1622), 'rospy.get_param', 'rospy...
# coding=utf-8 # Copyright 2020 Microsoft and the HuggingFace Inc. team. # # 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...
[ "os.path.abspath", "shutil.copyfile", "os.path.isdir", "os.path.join" ]
[((10642, 10760), 'os.path.join', 'os.path.join', (['save_directory', "((filename_prefix + '-' if filename_prefix else '') + VOCAB_FILES_NAMES[\n 'vocab_file'])"], {}), "(save_directory, (filename_prefix + '-' if filename_prefix else\n '') + VOCAB_FILES_NAMES['vocab_file'])\n", (10654, 10760), False, 'import os\n...
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-07-03 13:36 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import mptt.fields class Migration(migrations.Migration): dependencies = [ ('users', '0005_auto_20170703_1614'), ...
[ "django.db.migrations.AlterModelOptions", "django.db.models.ForeignKey" ]
[((350, 504), 'django.db.migrations.AlterModelOptions', 'migrations.AlterModelOptions', ([], {'name': '"""position"""', 'options': "{'ordering': ['name'], 'verbose_name': 'Job Positions',\n 'verbose_name_plural': 'Job Positions'}"}), "(name='position', options={'ordering': ['name'],\n 'verbose_name': 'Job Positio...
from PPPForgivenessSDK.client import Client # to run file 'list_forgiveness_messages.py', use valid token (page parameter can be changed ) client = Client( access_token='{{YOUR_TOKEN_HERE}}', vendor_key='{{YOUR_VENDOR_KEY}}', environment='sandbox' ) lookup_api = client.validations result = lookup_api.lis...
[ "PPPForgivenessSDK.client.Client" ]
[((149, 252), 'PPPForgivenessSDK.client.Client', 'Client', ([], {'access_token': '"""{{YOUR_TOKEN_HERE}}"""', 'vendor_key': '"""{{YOUR_VENDOR_KEY}}"""', 'environment': '"""sandbox"""'}), "(access_token='{{YOUR_TOKEN_HERE}}', vendor_key='{{YOUR_VENDOR_KEY}}',\n environment='sandbox')\n", (155, 252), False, 'from PPPF...
"""Test cases for STEREO Map subclasses. This particular test file pertains to EUVIMap. @Author: <NAME>. (VaticanCameos) """ import os import glob from sunpy.map.sources.stereo import EUVIMap from sunpy.map import Map from sunpy.sun import sun import sunpy.data.test path = sunpy.data.test.rootdir fitspath = glob.glo...
[ "sunpy.sun.sun.solar_semidiameter_angular_size", "os.path.join", "sunpy.map.Map" ]
[((385, 398), 'sunpy.map.Map', 'Map', (['fitspath'], {}), '(fitspath)\n', (388, 398), False, 'from sunpy.map import Map\n'), ((322, 376), 'os.path.join', 'os.path.join', (['path', '"""euvi_20090615_000900_n4euA_s.fts"""'], {}), "(path, 'euvi_20090615_000900_n4euA_s.fts')\n", (334, 376), False, 'import os\n'), ((1215, 1...
"""show_spanning_tree.py supported commands: * show spanning-tree detail * show spanning-tree mst detail * show spanning-tree summary * show errdisable recovery * show spanning-tree * show spanning-tree mst <WORD> * show spanning-tree vlan <WORD> * show spanning-tree m...
[ "genie.metaparser.util.schemaengine.Any", "genie.metaparser.util.schemaengine.Optional", "re.compile" ]
[((938, 978), 'genie.metaparser.util.schemaengine.Optional', 'Optional', (['"""etherchannel_misconfig_guard"""'], {}), "('etherchannel_misconfig_guard')\n", (946, 978), False, 'from genie.metaparser.util.schemaengine import Schema, Any, Optional, Or, And, Default, Use\n'), ((994, 1024), 'genie.metaparser.util.schemaeng...
# Copyright 2021 The Cirq Developers # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
[ "cirq.SWAP", "cirq.CNOT", "cirq.IdentityGate", "cirq.LineQubit.range", "cirq.reset", "cirq.measure", "cirq.ActOnArgsContainer", "cirq.CX" ]
[((2262, 2285), 'cirq.LineQubit.range', 'cirq.LineQubit.range', (['(2)'], {}), '(2)\n', (2282, 2285), False, 'import cirq\n'), ((2889, 2959), 'cirq.ActOnArgsContainer', 'cirq.ActOnArgsContainer', (['args_map', 'qubits', 'split_untangled_states', 'log'], {}), '(args_map, qubits, split_untangled_states, log)\n', (2912, 2...
# PRIVATE/ADMIN file!!! # DO NOT share to participants import base64, string, random from typing import Dict FLAG = 'sdctf{OBscUr1ty_a1nt_s3CURITy}' SEED = 0x1337face B64_ALPHABET = string.ascii_uppercase + string.ascii_lowercase + string.digits + '+/' # print(B64_ALPHABET) assert len(B64_ALPHABET) == 64 PAD_CHAR = ...
[ "random.randint", "random.seed" ]
[((436, 453), 'random.seed', 'random.seed', (['SEED'], {}), '(SEED)\n', (447, 453), False, 'import base64, string, random\n'), ((463, 484), 'random.randint', 'random.randint', (['(1)', '(63)'], {}), '(1, 63)\n', (477, 484), False, 'import base64, string, random\n')]
# -*- coding: utf-8 -*- """ :math:`IC_TC_P` Colour Encoding =============================== Defines the :math:`IC_TC_P` colour encoding related transformations: - :func:`colour.RGB_to_ICtCp` - :func:`colour.ICtCp_to_RGB` - :func:`colour.XYZ_to_ICtCp` - :func:`colour.ICtCp_to_XYZ` References ---------- - :c...
[ "colour.algebra.vector_dot", "colour.utilities.to_domain_1", "colour.utilities.from_range_1", "colour.models.rgb.RGB_to_XYZ", "colour.models.rgb.transfer_functions.oetf_HLG_BT2100", "colour.models.rgb.XYZ_to_RGB", "colour.utilities.domain_range_scale", "colour.models.rgb.transfer_functions.eotf_invers...
[((2348, 2386), 'numpy.linalg.inv', 'np.linalg.inv', (['MATRIX_ICTCP_RGB_TO_LMS'], {}), '(MATRIX_ICTCP_RGB_TO_LMS)\n', (2361, 2386), True, 'import numpy as np\n'), ((2861, 2903), 'numpy.linalg.inv', 'np.linalg.inv', (['MATRIX_ICTCP_LMS_P_TO_ICTCP'], {}), '(MATRIX_ICTCP_LMS_P_TO_ICTCP)\n', (2874, 2903), True, 'import nu...
from django.shortcuts import render, get_object_or_404, redirect from django.contrib.auth.decorators import login_required from .forms import ContactForms from django.contrib.auth import authenticate from .models import BlogPage from .forms import BlogForm, BlogModelForm from django.contrib.admin.views.decorators impor...
[ "django.shortcuts.render", "django.shortcuts.redirect", "django.shortcuts.get_object_or_404" ]
[((613, 656), 'django.shortcuts.render', 'render', (['request', '"""blog/index.html"""', 'context'], {}), "(request, 'blog/index.html', context)\n", (619, 656), False, 'from django.shortcuts import render, get_object_or_404, redirect\n'), ((769, 812), 'django.shortcuts.render', 'render', (['request', '"""blog/index.htm...
import dataclasses @dataclasses.dataclass(frozen=True) class Sd: height: int = 480 width: int = 640 @dataclasses.dataclass(frozen=True) class Hd: height: int = 720 width: int = 1280 @dataclasses.dataclass(frozen=True) class Fhd: height: int = 1080 width: int = 1920 @dataclasses.dataclass...
[ "dataclasses.dataclass" ]
[((22, 56), 'dataclasses.dataclass', 'dataclasses.dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (43, 56), False, 'import dataclasses\n'), ((113, 147), 'dataclasses.dataclass', 'dataclasses.dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (134, 147), False, 'import dataclasses\n'), ((205, 239), 'd...
from __future__ import print_function from flask import Flask, Response from pyzbar import pyzbar from picamera.array import PiRGBArray from picamera import PiCamera from datetime import datetime import numpy as np import cv2 import time camera = PiCamera() camera.resolution = (640, 480) camera.framerate = 32 rawCap...
[ "cv2.rectangle", "cv2.imencode", "flask.Flask", "picamera.PiCamera", "time.sleep", "pyzbar.pyzbar.decode", "datetime.datetime.now", "picamera.array.PiRGBArray" ]
[((250, 260), 'picamera.PiCamera', 'PiCamera', ([], {}), '()\n', (258, 260), False, 'from picamera import PiCamera\n'), ((327, 362), 'picamera.array.PiRGBArray', 'PiRGBArray', (['camera'], {'size': '(640, 480)'}), '(camera, size=(640, 480))\n', (337, 362), False, 'from picamera.array import PiRGBArray\n'), ((363, 378),...
from godity.engine import getMonitorSize MONITOR_SIZE = getMonitorSize() PIXEL_SIZE = 5 SCREEN_WIDTH = int(MONITOR_SIZE[0] / PIXEL_SIZE) SCREEN_HEIGHT = int(MONITOR_SIZE[1] / PIXEL_SIZE)
[ "godity.engine.getMonitorSize" ]
[((59, 75), 'godity.engine.getMonitorSize', 'getMonitorSize', ([], {}), '()\n', (73, 75), False, 'from godity.engine import getMonitorSize\n')]
# XXX TypeErrors on calling handlers, or on bad return values from a # handler, are obscure and unhelpful. from io import BytesIO import os import platform import sys import sysconfig import unittest import traceback from xml.parsers import expat from xml.parsers.expat import errors from test.support i...
[ "xml.parsers.expat.ParserCreate", "sysconfig.is_python_build", "xml.parsers.expat.ErrorString", "io.BytesIO", "test.support.sortdict", "os.path.basename", "unittest.main", "platform.machine", "traceback.extract_tb" ]
[((28048, 28063), 'unittest.main', 'unittest.main', ([], {}), '()\n', (28061, 28063), False, 'import unittest\n'), ((428, 471), 'xml.parsers.expat.ParserCreate', 'expat.ParserCreate', ([], {'namespace_separator': '"""!"""'}), "(namespace_separator='!')\n", (446, 471), False, 'from xml.parsers import expat\n'), ((8673, ...
from concurrent import futures import logging import os import grpc from PIL import Image, ImageOps import helloworld_pb2 import helloworld_pb2_grpc from minio import Minio minioEnvKey = "MINIO_ADDRESS" image_name = 'img2.jpeg' image2_name = 'img3.jpeg' image_path = '/pulled_' + image_name image_path2 = '/pulled_' ...
[ "logging.basicConfig", "PIL.Image.open", "os.getenv", "minio.Minio", "concurrent.futures.ThreadPoolExecutor", "helloworld_pb2.HelloReply" ]
[((401, 423), 'os.getenv', 'os.getenv', (['minioEnvKey'], {}), '(minioEnvKey)\n', (410, 423), False, 'import os\n'), ((1803, 1824), 'logging.basicConfig', 'logging.basicConfig', ([], {}), '()\n', (1822, 1824), False, 'import logging\n'), ((600, 687), 'minio.Minio', 'Minio', (['minioAddress'], {'access_key': '"""minioad...
import sys from PyQt5.QtWidgets import QApplication from client.mainWindow import MainWindow def main(): app = QApplication(sys.argv) win = MainWindow() win.show() sys.exit(app.exec_()) if __name__ == "__main__": main()
[ "client.mainWindow.MainWindow", "PyQt5.QtWidgets.QApplication" ]
[((117, 139), 'PyQt5.QtWidgets.QApplication', 'QApplication', (['sys.argv'], {}), '(sys.argv)\n', (129, 139), False, 'from PyQt5.QtWidgets import QApplication\n'), ((150, 162), 'client.mainWindow.MainWindow', 'MainWindow', ([], {}), '()\n', (160, 162), False, 'from client.mainWindow import MainWindow\n')]
''' @Date: 2019-11-26 19:58:17 @Author: ywyz @LastModifiedBy: ywyz @Github: https://github.com/ywyz @LastEditors: ywyz @LastEditTime: 2019-11-26 19:59:27 ''' import turtle from math import pi, sin, cos from UsefulTurtleFunctions import drawLine, writeText drawLine(-200, 0, 200, 0) drawLine(175, 15, 200, 0) drawLine(2...
[ "turtle.pendown", "turtle.penup", "turtle.done", "UsefulTurtleFunctions.writeText", "turtle.color", "math.cos", "math.sin", "UsefulTurtleFunctions.drawLine" ]
[((258, 283), 'UsefulTurtleFunctions.drawLine', 'drawLine', (['(-200)', '(0)', '(200)', '(0)'], {}), '(-200, 0, 200, 0)\n', (266, 283), False, 'from UsefulTurtleFunctions import drawLine, writeText\n'), ((284, 309), 'UsefulTurtleFunctions.drawLine', 'drawLine', (['(175)', '(15)', '(200)', '(0)'], {}), '(175, 15, 200, 0...
from django.shortcuts import render from models import Camp, Resource, AuditLog, Reservation from datetime import datetime, timedelta def index(request): today = datetime.now().date() tomorrow = today + timedelta(1) reservations = Reservation.objects.filter(start_time__gte=today) \ ...
[ "django.shortcuts.render", "datetime.datetime", "models.Reservation.objects.filter", "datetime.datetime.now", "models.Camp.objects.all", "models.AuditLog.objects.filter", "models.Resource.objects.all", "models.AuditLog.objects.all", "datetime.timedelta" ]
[((869, 904), 'django.shortcuts.render', 'render', (['request', '"""index.html"""', 'data'], {}), "(request, 'index.html', data)\n", (875, 904), False, 'from django.shortcuts import render\n'), ((1884, 1918), 'django.shortcuts.render', 'render', (['request', '"""logs.html"""', 'data'], {}), "(request, 'logs.html', data...
import os BOT_TOKEN = os.getenv('BOT_TOKEN') if not BOT_TOKEN: print('Environment variable BOT_TOKEN must be set') quit() WEBHOOK_ENABLED = os.getenv('WEBHOOK_ENABLED') WEBHOOK_ENABLED = WEBHOOK_ENABLED and int(WEBHOOK_ENABLED) == 1 if WEBHOOK_ENABLED: HEROKU_APP_NAME = os.getenv('HEROKU_APP_NAME') W...
[ "os.getenv" ]
[((23, 45), 'os.getenv', 'os.getenv', (['"""BOT_TOKEN"""'], {}), "('BOT_TOKEN')\n", (32, 45), False, 'import os\n'), ((150, 178), 'os.getenv', 'os.getenv', (['"""WEBHOOK_ENABLED"""'], {}), "('WEBHOOK_ENABLED')\n", (159, 178), False, 'import os\n'), ((286, 314), 'os.getenv', 'os.getenv', (['"""HEROKU_APP_NAME"""'], {}),...
from PIL import Image import resources def readlevel(file): # level-loading procedure with input of gamesize^2 bitmap level file level = [[resources.constants.leveldef['nothing'] for i in range(resources.constants.gamesize)] for j in range(resources.constants.gamesize)] im = Image.open(resources.paths.lev...
[ "PIL.Image.open" ]
[((290, 331), 'PIL.Image.open', 'Image.open', (['(resources.paths.levels + file)'], {}), '(resources.paths.levels + file)\n', (300, 331), False, 'from PIL import Image\n')]
# Generated by Django 1.11.20 on 2019-06-12 06:41 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ("zerver", "0229_stream_message_retention_days"), ] operations = [ migrations.RenameField( model_name="userprofile", old_nam...
[ "django.db.migrations.RenameField" ]
[((239, 373), 'django.db.migrations.RenameField', 'migrations.RenameField', ([], {'model_name': '"""userprofile"""', 'old_name': '"""enable_stream_sounds"""', 'new_name': '"""enable_stream_audible_notifications"""'}), "(model_name='userprofile', old_name=\n 'enable_stream_sounds', new_name='enable_stream_audible_not...
import csv from flask_wtf import FlaskForm as Form from flask_wtf.file import FileField, FileRequired, FileAllowed from wtforms import StringField, SubmitField from wtforms.validators import DataRequired from wtforms import ValidationError # noinspection PyMethodMayBeStatic class HostForm(Form): fqdn = StringFiel...
[ "flask_wtf.file.FileAllowed", "wtforms.ValidationError", "wtforms.SubmitField", "wtforms.StringField", "flask_wtf.file.FileRequired", "wtforms.validators.DataRequired" ]
[((376, 399), 'wtforms.StringField', 'StringField', (['"""TCP Port"""'], {}), "('TCP Port')\n", (387, 399), False, 'from wtforms import StringField, SubmitField\n'), ((420, 448), 'wtforms.StringField', 'StringField', (['"""Friendly Name"""'], {}), "('Friendly Name')\n", (431, 448), False, 'from wtforms import StringFie...
# -*- coding: utf-8 -*- """Test driver for the outcomes package.""" import sys, os path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, path) import pandas as pd import outcomes.outcomes as outcomes def test_chg_analysis(src_file=None, src_sheet='Sheet1', src_col_dt='date', ...
[ "sys.path.insert", "outcomes.outcomes.Measures", "pandas.ExcelFile", "pandas.read_excel", "os.path.abspath", "pandas.ExcelWriter", "outcomes.outcomes.change_analysis" ]
[((152, 176), 'sys.path.insert', 'sys.path.insert', (['(0)', 'path'], {}), '(0, path)\n', (167, 176), False, 'import sys, os\n'), ((642, 671), 'pandas.ExcelFile', 'pd.ExcelFile', (['(path + src_file)'], {}), '(path + src_file)\n', (654, 671), True, 'import pandas as pd\n'), ((685, 715), 'pandas.read_excel', 'pd.read_ex...
import re import logging import tarfile import tempfile import zipfile from pathlib import Path from typing import Callable, Dict, List, Optional, Tuple, Union import json from farm.data_handler.utils import http_get from haystack.file_converter.base import BaseConverter from haystack.file_converter.docx import DocxT...
[ "logging.getLogger", "haystack.file_converter.tika.TikaConverter", "tarfile.open", "haystack.Label", "zipfile.ZipFile", "pathlib.Path", "haystack.file_converter.txt.TextConverter", "farm.data_handler.utils.http_get", "haystack.file_converter.pdf.PDFToTextConverter", "haystack.Document", "tempfil...
[((550, 577), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (567, 577), False, 'import logging\n'), ((6278, 6318), 'haystack.file_converter.tika.TikaConverter', 'TikaConverter', ([], {'remove_header_footer': '(True)'}), '(remove_header_footer=True)\n', (6291, 6318), False, 'from haystack...
""" Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this ...
[ "resource_management.libraries.functions.format_jvm_option", "resource_management.libraries.script.Script.get_config", "resource_management.libraries.functions.stack_features.check_stack_feature", "re.search", "resource_management.libraries.functions.conf_select.get_hadoop_conf_dir", "resource_management....
[((1936, 1955), 'resource_management.libraries.script.Script.get_config', 'Script.get_config', ([], {}), '()\n', (1953, 1955), False, 'from resource_management.libraries.script import Script\n'), ((1966, 1986), 'resource_management.libraries.script.Script.get_tmp_dir', 'Script.get_tmp_dir', ([], {}), '()\n', (1984, 198...
#!/usr/bin/env python3 import csv import numpy thr_sig=5.0 def sigmoid(x): return 1.0/(1.0+numpy.exp(-(x-thr_sig))) if __name__=="__main__": #parameters time_pitch=1.0 #ms save_pitch=10 save_pitch_weight=1000 simlen_sec=900.0 simlen=int(simlen_sec*1000.0/time_pitch) tauL=10.0 #ms ...
[ "numpy.sqrt", "numpy.random.rand", "numpy.hstack", "csv.writer", "numpy.exp", "numpy.zeros", "numpy.random.randn" ]
[((917, 943), 'numpy.zeros', 'numpy.zeros', (['input_src_num'], {}), '(input_src_num)\n', (928, 943), False, 'import numpy\n'), ((966, 992), 'numpy.zeros', 'numpy.zeros', (['som_input_num'], {}), '(som_input_num)\n', (977, 992), False, 'import numpy\n'), ((1015, 1041), 'numpy.zeros', 'numpy.zeros', (['dnd_input_num'], ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ No need to create a list of fishes and add new one to the end of the list """ from collections import defaultdict def main(): # XXX: COPY/PASTED input_file = './input.txt' X = defaultdict(int) with open(input_file, 'r') as ftr: for n in map(int, ftr.read...
[ "collections.defaultdict" ]
[((236, 252), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (247, 252), False, 'from collections import defaultdict\n'), ((442, 458), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (453, 458), False, 'from collections import defaultdict\n')]
# Copyright 2021 EnICS Labs, Bar-Ilan University. # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 import sys, os sys.path.append(os.path.abspath('..')) from salamandra import * def main(): test(is_metatest=False) def test(is_metatest): and_ =...
[ "os.path.abspath" ]
[((195, 216), 'os.path.abspath', 'os.path.abspath', (['""".."""'], {}), "('..')\n", (210, 216), False, 'import sys, os\n')]
# Copyright 2020 Makani Technologies LLC # # 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...
[ "logging.Error", "re.compile", "makani.lib.python.debug_util.FormatTraceback", "makani.gs.monitor2.apps.layout.autogen.GenerateScenario", "django.core.urlresolvers.reverse", "makani.analysis.checks.log_util.GetOrderedDedupDataAndTimeByField", "makani.lib.python.c_helpers.EnumHelper", "os.listdir", "...
[((1826, 1879), 'makani.lib.python.c_helpers.EnumHelper', 'c_helpers.EnumHelper', (['"""MessageType"""', 'aio_message_type'], {}), "('MessageType', aio_message_type)\n", (1846, 1879), False, 'from makani.lib.python import c_helpers\n'), ((1915, 1976), 'os.path.join', 'os.path.join', (['settings.MONITOR_PATH', '"""confi...
""" This module contains pure functions to parse and craft packets. """ from ryu.ofproto import ofproto_v1_4 as ofp from ryu.lib.packet import packet from ryu.lib.packet import ethernet from ryu.lib.packet import arp from ryu.lib.packet import lldp from ryu.ofproto import ether as ethertypes import fabric.flows as flo...
[ "ryu.lib.packet.packet.Packet", "ryu.lib.packet.lldp.lldp", "ryu.lib.packet.lldp.End", "ryu.lib.packet.lldp.TTL", "fabric.flows.int_to_mac", "ryu.lib.packet.arp.arp", "ryu.lib.packet.ethernet.ethernet" ]
[((622, 637), 'ryu.lib.packet.packet.Packet', 'packet.Packet', ([], {}), '()\n', (635, 637), False, 'from ryu.lib.packet import packet\n'), ((737, 759), 'fabric.flows.int_to_mac', 'flows.int_to_mac', (['dpid'], {}), '(dpid)\n', (753, 759), True, 'import fabric.flows as flows\n'), ((815, 853), 'ryu.lib.packet.ethernet.e...
# coding=utf-8 # Copyright 2018 The TF-Agents 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...
[ "tensorflow.train.Checkpoint", "tensorflow.shape", "tensorflow.compat.v1.train.AdamOptimizer", "tf_agents.specs.tensor_spec.BoundedTensorSpec", "numpy.array", "tf_agents.trajectories.time_step.time_step_spec", "tensorflow.cast", "tensorflow.compat.v1.global_variables_initializer", "tensorflow.eye", ...
[((2541, 2735), 'absl.testing.parameterized.named_parameters', 'parameterized.named_parameters', (["{'testcase_name': '_batch1_contextdim10', 'batch_size': 1, 'context_dim': 10}", "{'testcase_name': '_batch4_contextdim5', 'batch_size': 4, 'context_dim': 5}"], {}), "({'testcase_name': '_batch1_contextdim10',\n 'batch...
# -*- coding: utf-8 -*- from operator import attrgetter import pyangbind.lib.xpathhelper as xpathhelper from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBoo...
[ "__builtin__.property", "collections.OrderedDict", "pyangbind.lib.yangtypes.RestrictedClassType" ]
[((17074, 17115), '__builtin__.property', '__builtin__.property', (['_get_interface_mode'], {}), '(_get_interface_mode)\n', (17094, 17115), False, 'import __builtin__\n'), ((17132, 17170), '__builtin__.property', '__builtin__.property', (['_get_native_vlan'], {}), '(_get_native_vlan)\n', (17152, 17170), False, 'import ...
import logging from typing import Dict, List, Optional from src.consensus.blockchain import Blockchain from src.consensus.sub_block_record import SubBlockRecord from src.full_node.block_store import BlockStore from src.types.full_block import FullBlock from src.types.header_block import HeaderBlock from src.types.size...
[ "src.util.ints.uint32", "logging.getLogger" ]
[((3767, 3776), 'src.util.ints.uint32', 'uint32', (['(0)'], {}), '(0)\n', (3773, 3776), False, 'from src.util.ints import uint32\n'), ((3793, 3802), 'src.util.ints.uint32', 'uint32', (['(0)'], {}), '(0)\n', (3799, 3802), False, 'from src.util.ints import uint32\n'), ((5151, 5160), 'src.util.ints.uint32', 'uint32', (['(...
""" Wrap Paragraph by <NAME>. A Pydev script for rewrapping the current paragraph to fit inside the print margin preference in Eclipse (defaults to 80 columns). A paragraph is a block of lines with a common leading string such as '# ' or a number of spaces. The lines in the newly wrapped paragraph will all have the s...
[ "re.compile" ]
[((3925, 3949), 're.compile', 're.compile', (['self.pattern'], {}), '(self.pattern)\n', (3935, 3949), False, 'import re\n')]
#!/usr/bin/python # coding=UTF-8 ''' @Author: recar @Date: 2019-09-03 18:00:12 @LastEditTime: 2019-09-05 16:51:31 ''' # 对域名的curd from flask import request, jsonify, current_app from app.models import Domain, db from . import domain_blueprint from app.utils.response_util import success_response, faild_response, error_r...
[ "app.utils.response_util.success_response", "traceback.format_exc", "app.utils.response_util.faild_response", "flask.request.get_data", "sqlalchemy.desc", "app.models.Domain.query.filter", "app.models.db.session.commit", "app.models.db.session.add", "app.models.Domain", "app.models.Domain.query.co...
[((724, 744), 'app.models.Domain.query.count', 'Domain.query.count', ([], {}), '()\n', (742, 744), False, 'from app.models import Domain, db\n'), ((995, 1024), 'app.utils.response_util.success_response', 'success_response', (['return_data'], {}), '(return_data)\n', (1011, 1024), False, 'from app.utils.response_util imp...
# Author of Aqsa: <NAME> from django.contrib.auth.mixins import LoginRequiredMixin from aqsa_apps import mixins as mix from . import models as m from django.utils.translation import ugettext_lazy as _ from django.views.generic.edit import FormView from . import forms as f from django.conf import settings import zipfi...
[ "django.utils.translation.ugettext_lazy", "zipfile.is_zipfile", "zipfile.ZipFile", "os.remove" ]
[((677, 699), 'django.utils.translation.ugettext_lazy', '_', (['"""My Uploaded Files"""'], {}), "('My Uploaded Files')\n", (678, 699), True, 'from django.utils.translation import ugettext_lazy as _\n'), ((850, 965), 'django.utils.translation.ugettext_lazy', '_', (['"""You did not import any file. Click to "Upload Bank ...
""" input """ import sys import time import random import builtins import linecache import termcolor def getSettings(setting): """ gets settings """ if setting == "print": PRINT_SPEED = float(linecache.getline("settings.txt", 1).rstrip("\n")) return PRINT_SPEED elif setting == "names": ...
[ "termcolor.colored", "time.sleep", "linecache.getline", "sys.stdout.flush", "random.randint", "sys.stdout.write" ]
[((711, 732), 'random.randint', 'random.randint', (['(1)', '(20)'], {}), '(1, 20)\n', (725, 732), False, 'import random\n'), ((2705, 2725), 'random.randint', 'random.randint', (['(0)', '(1)'], {}), '(0, 1)\n', (2719, 2725), False, 'import random\n'), ((3677, 3695), 'sys.stdout.flush', 'sys.stdout.flush', ([], {}), '()\...
# coding: utf-8 """ Kubernetes No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 The version of the OpenAPI document: v1.20.7 Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import six fr...
[ "kubernetes.client.configuration.Configuration", "six.iteritems" ]
[((5703, 5736), 'six.iteritems', 'six.iteritems', (['self.openapi_types'], {}), '(self.openapi_types)\n', (5716, 5736), False, 'import six\n'), ((1467, 1482), 'kubernetes.client.configuration.Configuration', 'Configuration', ([], {}), '()\n', (1480, 1482), False, 'from kubernetes.client.configuration import Configurati...
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
[ "os_apply_config.apply_config.main", "os.remove", "os.path.exists", "mock.patch", "json.dumps", "os.chmod", "tempfile.NamedTemporaryFile", "fixtures.MonkeyPatch", "fixtures.FakeLogger", "os_apply_config.apply_config.strip_hash", "os.path.dirname", "fixtures.TempDir", "tempfile.mkdtemp", "o...
[((890, 915), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (905, 915), False, 'import os\n'), ((1393, 1418), 'os_apply_config.oac_file.OacFile', 'oac_file.OacFile', (['"""foo\n"""'], {}), "('foo\\n')\n", (1409, 1418), False, 'from os_apply_config import oac_file\n'), ((1464, 1520), 'os_appl...
import tensorflow as tf from tensorflow.contrib import slim def head(endpoints, embedding_dim, is_training): batch_norm_params = { 'decay': 0.9, 'epsilon': 1e-5, 'scale': True, 'updates_collections': tf.GraphKeys.UPDATE_OPS, 'fused': None, } ...
[ "tensorflow.orthogonal_initializer", "tensorflow.contrib.slim.l2_regularizer", "tensorflow.contrib.slim.arg_scope", "tensorflow.contrib.slim.variance_scaling_initializer", "tensorflow.sigmoid", "tensorflow.contrib.slim.fully_connected", "tensorflow.reduce_mean", "tensorflow.contrib.slim.conv2d" ]
[((1554, 1617), 'tensorflow.reduce_mean', 'tf.reduce_mean', (['_masked', '[1, 2]'], {'name': '"""_pool5"""', 'keep_dims': '(False)'}), "(_masked, [1, 2], name='_pool5', keep_dims=False)\n", (1568, 1617), True, 'import tensorflow as tf\n'), ((1663, 1904), 'tensorflow.contrib.slim.fully_connected', 'slim.fully_connected'...
import random DAY_COUNT = 10 MOVIE_COUNT = 4 def create_movie(): return sorted([random.randint(0, DAY_COUNT - 1), random.randint(0, DAY_COUNT - 1)]) def create_movies(): return [create_movie() for _ in range(MOVIE_COUNT)] def visualize_movie(movie): print("", "-" * movie[0] + "#" * (movie[1] - movie[0] + 1) + "-...
[ "random.randint" ]
[((83, 115), 'random.randint', 'random.randint', (['(0)', '(DAY_COUNT - 1)'], {}), '(0, DAY_COUNT - 1)\n', (97, 115), False, 'import random\n'), ((117, 149), 'random.randint', 'random.randint', (['(0)', '(DAY_COUNT - 1)'], {}), '(0, DAY_COUNT - 1)\n', (131, 149), False, 'import random\n')]
import os import urllib import requests import time from bs4 import BeautifulSoup from time import sleep, strftime, gmtime from random import randint from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import ...
[ "requests.session", "requests.post", "time.sleep", "requests.get", "bs4.BeautifulSoup", "time.text.strip", "os.system", "random.randint" ]
[((473, 491), 'requests.session', 'requests.session', ([], {}), '()\n', (489, 491), False, 'import requests\n'), ((896, 935), 'bs4.BeautifulSoup', 'BeautifulSoup', (['html.text', '"""html.parser"""'], {}), "(html.text, 'html.parser')\n", (909, 935), False, 'from bs4 import BeautifulSoup\n'), ((1485, 1503), 'requests.se...
import b3 import unittest class TestCondition(unittest.TestCase): def test_category(self): self.assertEqual(b3.Condition.category, b3.CONDITION) if __name__ == '__main__': unittest.main()
[ "unittest.main" ]
[((192, 207), 'unittest.main', 'unittest.main', ([], {}), '()\n', (205, 207), False, 'import unittest\n')]
from __future__ import print_function, absolute_import from distutils import sysconfig from distutils import version from distutils.core import Extension import glob import io import multiprocessing import os import re import subprocess import sys import warnings from textwrap import fill PY3 = (sys.version_info[0] ...
[ "io.BytesIO", "sys.platform.startswith", "gi.repository.Gtk.get_micro_version", "re.search", "os.path.exists", "os.listdir", "sys.getfilesystemencoding", "pyparsing.Forward", "CXX", "subprocess.Popen", "subprocess.CalledProcessError", "os.path.split", "os.path.isdir", "os.popen", "numpy....
[((1564, 1606), 'os.environ.get', 'os.environ.get', (['"""MPLSETUPCFG"""', '"""setup.cfg"""'], {}), "('MPLSETUPCFG', 'setup.cfg')\n", (1578, 1606), False, 'import os\n'), ((1610, 1635), 'os.path.exists', 'os.path.exists', (['setup_cfg'], {}), '(setup_cfg)\n', (1624, 1635), False, 'import os\n'), ((1650, 1681), 'ConfigP...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('izi_accounts', '0002_core_accounts'), ] operations = [ migrations.AlterField( model_name='ipaddressrecord', ...
[ "django.db.models.GenericIPAddressField" ]
[((365, 433), 'django.db.models.GenericIPAddressField', 'models.GenericIPAddressField', ([], {'unique': '(True)', 'verbose_name': '"""IP address"""'}), "(unique=True, verbose_name='IP address')\n", (393, 433), False, 'from django.db import migrations, models\n')]
import os import os test_list = [line. rstrip('\n') for line in open('./food-101/meta/test.txt')] os.mkdir('./food-101/test') source_base = './food-101/images/' target_base = './food-101/test/' for item in test_list: c = item.split('/')[0] if not os.path.exists(os.path.join(base, c)): os.mkdir(os.path...
[ "os.path.join", "os.mkdir" ]
[((100, 127), 'os.mkdir', 'os.mkdir', (['"""./food-101/test"""'], {}), "('./food-101/test')\n", (108, 127), False, 'import os\n'), ((272, 293), 'os.path.join', 'os.path.join', (['base', 'c'], {}), '(base, c)\n', (284, 293), False, 'import os\n'), ((313, 334), 'os.path.join', 'os.path.join', (['base', 'c'], {}), '(base,...
# vim:ts=4:sw=4:et: # Copyright 2012-present Facebook, Inc. # Licensed under the Apache License, Version 2.0 from __future__ import absolute_import from __future__ import division from __future__ import print_function # no unicode literals import functools import inspect import errno try: import unittest2 as unit...
[ "WatchmanInstance.getSharedInstance", "os.close", "inspect.currentframe", "os.path.join", "functools.wraps", "os.utime", "time.sleep", "tempfile.mkdtemp", "os.mkdir", "time.time", "tempfile.mkstemp", "TempDir.get_temp_dir", "os.remove" ]
[((3540, 3589), 'tempfile.mkstemp', 'tempfile.mkstemp', ([], {'prefix': 'prefix', 'dir': 'self.tempdir'}), '(prefix=prefix, dir=self.tempdir)\n', (3556, 3589), False, 'import tempfile\n'), ((3598, 3609), 'os.close', 'os.close', (['f'], {}), '(f)\n', (3606, 3609), False, 'import os\n'), ((4858, 4894), 'WatchmanInstance....
import hikari from motor.motor_asyncio import AsyncIOMotorClient from os import environ MONGOTOKEN = environ["MONGOTOKEN"] cluster = AsyncIOMotorClient(MONGOTOKEN) database = cluster.discordlocale class helper: "Helper, simplifier for webhooks and embeds" def embed_builder( embed: hikari.Embed, aut...
[ "motor.motor_asyncio.AsyncIOMotorClient" ]
[((135, 165), 'motor.motor_asyncio.AsyncIOMotorClient', 'AsyncIOMotorClient', (['MONGOTOKEN'], {}), '(MONGOTOKEN)\n', (153, 165), False, 'from motor.motor_asyncio import AsyncIOMotorClient\n')]
import requests import datetime #Latitude and Longitudes # https://www.latlong.net/ now = int(datetime.datetime.now().strftime("%H:%M:%S").split(":")[0]) SEATTLE = {"lat": 47.606209, "lng": -122.332069, 'formatted':0} PITTSBURGH = {"lat": 40.442169, "lng": -79.994957, 'formatted':0} #CHOOSE A CITY VARIABLE FR...
[ "datetime.datetime.now", "requests.get" ]
[((358, 417), 'requests.get', 'requests.get', ([], {'url': '"""http://api.open-notify.org/iss-now.json"""'}), "(url='http://api.open-notify.org/iss-now.json')\n", (370, 417), False, 'import requests\n'), ((597, 661), 'requests.get', 'requests.get', (['"""https://api.sunrise-sunset.org/json"""'], {'params': 'CITY'}), "(...
"""Text transitions used for segment displays.""" import abc from typing import Optional, List from mpf.core.placeholder_manager import TextTemplate from mpf.core.rgb_color import RGBColor from mpf.devices.segment_display.segment_display_text import SegmentDisplayText, UncoloredSegmentDisplayText STEP_OUT_OF_RANGE_ER...
[ "mpf.devices.segment_display.segment_display_text.SegmentDisplayText.from_str", "mpf.core.placeholder_manager.TextTemplate", "mpf.devices.segment_display.segment_display_text.UncoloredSegmentDisplayText" ]
[((2243, 2278), 'mpf.core.placeholder_manager.TextTemplate', 'TextTemplate', (['machine', 'current_text'], {}), '(machine, current_text)\n', (2255, 2278), False, 'from mpf.core.placeholder_manager import TextTemplate\n'), ((2311, 2342), 'mpf.core.placeholder_manager.TextTemplate', 'TextTemplate', (['machine', 'new_text...
""" pypi setup """ import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="qclib", version="0.0.8", author="<NAME>", author_email="<EMAIL>", description="A quantum computing library using qiskit", long_description=long_description, lon...
[ "setuptools.find_packages" ]
[((419, 445), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (443, 445), False, 'import setuptools\n')]
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
[ "heat.common.i18n._LW", "heat.engine.constraints.CustomConstraint", "heat.engine.constraints.AllowedValues", "six.itervalues", "heat.engine.resource.Resource.load", "heat.common.exception.UpdateReplace", "heat.engine.support.SupportStatus", "heat.engine.properties.TranslationRule", "heat.common.i18n...
[((1059, 1086), 'oslo_log.log.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1076, 1086), True, 'from oslo_log import log as logging\n'), ((13416, 13442), 'six.itervalues', 'six.itervalues', (['self.stack'], {}), '(self.stack)\n', (13430, 13442), False, 'import six\n'), ((2662, 2697), 'heat.commo...
# Copyright 2021 Sony Group Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
[ "numpy.flip", "random.uniform", "random.choice", "numpy.arange", "random.seed", "numpy.stack", "musdb.DB", "numpy.sum", "random.random", "numpy.random.RandomState" ]
[((1174, 1199), 'random.uniform', 'random.uniform', (['low', 'high'], {}), '(low, high)\n', (1188, 1199), False, 'import random\n'), ((1395, 1412), 'numpy.flip', 'np.flip', (['audio', '(0)'], {}), '(audio, 0)\n', (1402, 1412), True, 'import numpy as np\n'), ((3811, 3828), 'random.seed', 'random.seed', (['seed'], {}), '...
# -*- coding: utf-8 -*- # 使用两个算法模型并行识别 import os, sys import concurrent.futures from datetime import datetime from settings import ALGORITHM, algorithm_settings import knn def predict_thread(face_algorithm, model_name, image_file): # https://discuss.streamlit.io/t/attributeerror-thread-local-object-has-no-attri...
[ "os.listdir", "os.path.join", "knn.predict", "datetime.datetime.now", "os.path.isdir", "sys.exit" ]
[((434, 584), 'knn.predict', 'knn.predict', (['image_file'], {'model_path': 'model_name', 'distance_threshold': "ALGORITHM[face_algorithm]['distance_threshold']", 'face_algorithm': 'face_algorithm'}), "(image_file, model_path=model_name, distance_threshold=ALGORITHM\n [face_algorithm]['distance_threshold'], face_alg...
import datetime import re from collections import Sequence, OrderedDict from html import escape from django.contrib.auth import get_user_model from django.contrib.auth.models import Group from django.contrib.postgres.fields import ArrayField from django.core.serializers.json import DjangoJSONEncoder from django.core.e...
[ "django.contrib.auth.get_user_model", "django.db.models.TextField", "django.db.models.ForeignKey", "datetime.datetime.strptime", "projects.helpers.get_ad_user", "django.utils.translation.gettext_lazy", "django.db.models.ManyToManyField", "django.core.exceptions.ValidationError", "django.db.models.Bo...
[((8497, 8666), 'django.db.models.ManyToManyField', 'models.ManyToManyField', (['"""self"""'], {'symmetrical': '(False)', 'related_name': '"""fieldsets"""', 'through': '"""FieldSetAttribute"""', 'through_fields': "('attribute_source', 'attribute_target')"}), "('self', symmetrical=False, related_name='fieldsets',\n t...
from typing import Any, Callable, Dict, List, Optional, Type, TypeVar, Union import attr from ..models.billing_invoice import BillingInvoice from ..types import UNSET, Unset from ..util.serialization import is_not_none T = TypeVar("T", bound="ListAccountBillingInvoicesResponse") @attr.s(auto_attribs=True) class Li...
[ "attr.s", "attr.ib", "typing.TypeVar" ]
[((226, 282), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {'bound': '"""ListAccountBillingInvoicesResponse"""'}), "('T', bound='ListAccountBillingInvoicesResponse')\n", (233, 282), False, 'from typing import Any, Callable, Dict, List, Optional, Type, TypeVar, Union\n'), ((286, 311), 'attr.s', 'attr.s', ([], {'auto_attri...
import requests from npt import log # from npt import query from npt import datasets API_URL = 'https://oderest.rsl.wustl.edu/live2' DESCRIPTORS = { 'ctx': { 'product_image': ('Description','PRODUCT DATA FILE WITH LABEL'), 'browse_image': ('Description','BROWSE IMAGE'), 'browse_thumbnail'...
[ "requests.get", "npt.log.info" ]
[((5526, 5568), 'requests.get', 'requests.get', (['api_endpoint'], {'params': 'payload'}), '(api_endpoint, params=payload)\n', (5538, 5568), False, 'import requests\n'), ((8060, 8102), 'requests.get', 'requests.get', (['api_endpoint'], {'params': 'payload'}), '(api_endpoint, params=payload)\n', (8072, 8102), False, 'im...
from typing import (List, Tuple) from hypothesis import given from tests.port_tests.hints import (PortedOperation, PortedSweepEvent) from . import strategies @given(strategies.non_empty_sweep_events_lists_with_indices_and_booleans_lists) def test_basic(events_...
[ "hypothesis.given", "tests.port_tests.hints.PortedOperation.to_next_position" ]
[((219, 297), 'hypothesis.given', 'given', (['strategies.non_empty_sweep_events_lists_with_indices_and_booleans_lists'], {}), '(strategies.non_empty_sweep_events_lists_with_indices_and_booleans_lists)\n', (224, 297), False, 'from hypothesis import given\n'), ((606, 684), 'hypothesis.given', 'given', (['strategies.non_e...
import unittest import numpy as np from revpy import fare_transformation class FareTransformationTest(unittest.TestCase): def setUp(self): # example data from page 13 of research paper # "Optimization of Mixed Fare Structures: Theory and Applications" # by <NAME> al. (2010) self...
[ "revpy.fare_transformation.calc_fare_transformation", "revpy.fare_transformation.efficient_strategies", "numpy.testing.assert_equal", "numpy.array", "numpy.zeros", "numpy.testing.assert_almost_equal" ]
[((329, 371), 'numpy.array', 'np.array', (['[1200, 1000, 800, 600, 400, 200]'], {}), '([1200, 1000, 800, 600, 400, 200])\n', (337, 371), True, 'import numpy as np\n'), ((395, 441), 'numpy.array', 'np.array', (['[31.2, 10.9, 14.8, 19.9, 26.9, 36.3]'], {}), '([31.2, 10.9, 14.8, 19.9, 26.9, 36.3])\n', (403, 441), True, 'i...
# # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy of this # software and associated documentation files (the "Software"), to deal in the Software # without restriction, including without limitation the rights to u...
[ "logging.getLogger", "logging.basicConfig", "boto3.client", "os.path.join", "demjson.jsonlint", "ConfigParser.ConfigParser", "os.path.realpath", "os.path.dirname", "unittest.main" ]
[((1220, 1244), 'os.path.dirname', 'os.path.dirname', (['DOC_DIR'], {}), '(DOC_DIR)\n', (1235, 1244), False, 'import os\n'), ((1443, 1470), 'ConfigParser.ConfigParser', 'ConfigParser.ConfigParser', ([], {}), '()\n', (1468, 1470), False, 'import ConfigParser\n'), ((2197, 2224), 'logging.getLogger', 'logging.getLogger', ...
#!/usr/bin/env python """ Example of nested autocompletion. """ from prompt_toolkit.completion import NestedCompleter from prompt_toolkit.shortcuts import PromptSession as Prompt completer = NestedCompleter.from_nested_dict( { "show": { "version": None, "clock": None, ...
[ "prompt_toolkit.shortcuts.PromptSession", "prompt_toolkit.completion.NestedCompleter.from_nested_dict" ]
[((192, 324), 'prompt_toolkit.completion.NestedCompleter.from_nested_dict', 'NestedCompleter.from_nested_dict', (["{'show': {'version': None, 'clock': None, 'ip': {'interface': {'brief':\n None}}}, 'exit': None}"], {}), "({'show': {'version': None, 'clock': None,\n 'ip': {'interface': {'brief': None}}}, 'exit': N...
from __future__ import (absolute_import, division, print_function, unicode_literals) from matplotlib.externals import six from matplotlib.tri import Triangulation import _tri as _tri import numpy as np class TriFinder(object): """ Abstract base class for classes used to find the tria...
[ "numpy.asarray" ]
[((2063, 2094), 'numpy.asarray', 'np.asarray', (['x'], {'dtype': 'np.float64'}), '(x, dtype=np.float64)\n', (2073, 2094), True, 'import numpy as np\n'), ((2107, 2138), 'numpy.asarray', 'np.asarray', (['y'], {'dtype': 'np.float64'}), '(y, dtype=np.float64)\n', (2117, 2138), True, 'import numpy as np\n')]
#!/usr/bin/env python3 """Check a font family using Google Fonts QA tools. Examples: Check a local family against the same family hosted on Google Fonts: `gftools qa -f [fonts.ttf] -gfb -a -o qa` Check a local family against another local family and generate reports for Font Diffenator only: `gftools qa -f [fonts_a.t...
[ "logging.getLogger", "requests.post", "diffenator.font.DFont", "diffenator.diff.DiffFonts", "gftools.utils.download_family_from_Google_Fonts", "re.compile", "gftools.utils.download_files_in_github_dir", "gftools.utils.download_files_in_github_pr", "diffbrowsers.diffbrowsers.DiffBrowsers", "fontToo...
[((1825, 1852), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1842, 1852), False, 'import logging\n'), ((1993, 2007), 'diffbrowsers.utils.load_browserstack_credentials', 'bstack_creds', ([], {}), '()\n', (2005, 2007), True, 'from diffbrowsers.utils import load_browserstack_credentials a...
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2019-07-16 13:27 from __future__ import unicode_literals import datetime from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ...
[ "datetime.datetime", "django.db.models.FloatField", "django.db.models.TextField", "django.db.models.IntegerField", "django.db.models.ForeignKey", "django.db.models.BooleanField", "django.db.models.AutoField", "django.db.models.DateTimeField", "django.db.migrations.swappable_dependency", "django.db...
[((384, 441), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (415, 441), False, 'from django.db import migrations, models\n'), ((755, 848), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)...
# coding: utf-8 import json import requests from sentry.plugins.bases.notify import NotificationPlugin import sentry_dingding from .forms import DingDingOptionsForm DingTalk_API = "https://oapi.dingtalk.com/robot/send?access_token={token}" class DingDingPlugin(NotificationPlugin): """ Sentry plugin to send...
[ "json.dumps" ]
[((2256, 2272), 'json.dumps', 'json.dumps', (['data'], {}), '(data)\n', (2266, 2272), False, 'import json\n')]
""" Generate BpForms for all of the proteins in PRO, verify them, and calculate their properties :Author: <NAME> <<EMAIL>> :Date: 2019-06-24 :Copyright: 2019, Karr Lab :License: MIT """ from Bio import SeqIO from Bio.Seq import Seq from Bio.SeqRecord import SeqRecord from matplotlib import pyplot from xml.etree impor...
[ "csv.DictReader", "Bio.Seq.Seq", "numpy.array", "bpforms.protein_alphabet.monomers.values", "copy.deepcopy", "requests_cache.core.CachedSession", "matplotlib.pyplot.style.use", "bpforms.protein_alphabet.monomers.items", "matplotlib.pyplot.close", "os.path.isdir", "os.mkdir", "Bio.SeqIO.write",...
[((568, 615), 'os.path.join', 'os.path.join', (['"""examples"""', '"""pro_nonreasoned.obo"""'], {}), "('examples', 'pro_nonreasoned.obo')\n", (580, 615), False, 'import os\n'), ((634, 681), 'os.path.join', 'os.path.join', (['"""examples"""', '"""pro_nonreasoned.pkl"""'], {}), "('examples', 'pro_nonreasoned.pkl')\n", (6...
from obspy.core.event import Event from obspy.geodetics import gps2dist_azimuth from obspy.geodetics import kilometer2degrees from obspy import UTCDateTime as utct from obspy.taup import TauPyModel import obspy import instaseis from SS_MTI import PhaseTracer from SS_MTI import GreensFunctions class EventObj: @st...
[ "obspy.read", "obspy.Stream", "obspy.geodetics.gps2dist_azimuth", "instaseis.open_db", "instaseis.Receiver", "SS_MTI.PhaseTracer.get_traveltime", "instaseis.Source", "obspy.UTCDateTime", "SS_MTI.GreensFunctions.convert_SDR", "obspy.core.event.Event", "obspy.geodetics.kilometer2degrees" ]
[((430, 519), 'obspy.geodetics.gps2dist_azimuth', 'gps2dist_azimuth', ([], {'lat1': 'la_s', 'lon1': 'lo_s', 'lat2': 'la_r', 'lon2': 'lo_r', 'a': 'radius', 'f': 'flattening'}), '(lat1=la_s, lon1=lo_s, lat2=la_r, lon2=lo_r, a=radius, f=\n flattening)\n', (446, 519), False, 'from obspy.geodetics import gps2dist_azimuth...
from collections import defaultdict import inspect from typing import Callable def api_overload(fn: Callable) -> Callable: """ Creates an overload that's visible to the api generate scripts. use this decorator instead of `typing.overload` when exposing overloads from `_impl`. You will need to suppress myp...
[ "inspect.getmodule", "collections.defaultdict" ]
[((397, 418), 'inspect.getmodule', 'inspect.getmodule', (['fn'], {}), '(fn)\n', (414, 418), False, 'import inspect\n'), ((546, 563), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (557, 563), False, 'from collections import defaultdict\n')]
import argparse import contextlib import csv import logging import os import random import subprocess import tempfile from typing import Callable, Dict, Iterable, List import numpy as np import ray from ray.experimental.raysort import constants from ray.experimental.raysort import logging_utils from ray.experimental....
[ "numpy.fromfile", "numpy.random.bytes", "ray.cluster_resources", "ray.experimental.raysort.types.PartInfo", "os.cpu_count", "ray.init", "logging.info", "os.path.exists", "os.listdir", "argparse.ArgumentParser", "ray.experimental.raysort.logging_utils.init", "subprocess.run", "ray.util.remove...
[((6260, 6287), 'ray.experimental.raysort.tracing_utils.timeit', 'tracing_utils.timeit', (['"""map"""'], {}), "('map')\n", (6280, 6287), False, 'from ray.experimental.raysort import tracing_utils\n'), ((7656, 7703), 'ray.remote', 'ray.remote', ([], {'num_cpus': '(0)', 'resources': "{'worker': 1}"}), "(num_cpus=0, resou...
# Generated by Django 3.2.12 on 2022-02-24 09:00 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('publications', '0027_fill_platform_name'), ] operations = [ migrations.AddField( model_name='title', name='proprietary_ids', fi...
[ "django.db.models.JSONField" ]
[((324, 354), 'django.db.models.JSONField', 'models.JSONField', ([], {'default': 'list'}), '(default=list)\n', (340, 354), False, 'from django.db import migrations, models\n'), ((434, 464), 'django.db.models.JSONField', 'models.JSONField', ([], {'default': 'list'}), '(default=list)\n', (450, 464), False, 'from django.d...
""" A simple webhook event handler for Sendgrid """ import os import json import flask from flask import request, jsonify import flask_sqlalchemy from sqlalchemy.ext.hybrid import hybrid_property app = flask.Flask(__name__) app.config['BASE_URL'] = os.environ['BASE_URL'] app.config['SQLALCHEMY_DATABASE_URI'] = os...
[ "json.loads", "flask_sqlalchemy.inspect", "flask.Flask", "json.dumps", "flask_sqlalchemy.SQLAlchemy", "flask.jsonify" ]
[((207, 228), 'flask.Flask', 'flask.Flask', (['__name__'], {}), '(__name__)\n', (218, 228), False, 'import flask\n'), ((519, 548), 'flask_sqlalchemy.SQLAlchemy', 'flask_sqlalchemy.SQLAlchemy', ([], {}), '()\n', (546, 548), False, 'import flask_sqlalchemy\n'), ((1687, 1710), 'json.loads', 'json.loads', (['self._other'],...
#!/usr/bin/env python """ zumoco worker Called by AWS Lambda to discover service instances which are then added to AWS CloudWatch and monitored. Copyright 2019 zulily, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. ...
[ "logging.getLogger", "json.loads", "boto3.client", "time.strftime", "json.dumps", "parsedatetime.Calendar", "json.load", "parsedatetime.Constants" ]
[((892, 911), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (909, 911), False, 'import logging\n'), ((950, 976), 'boto3.client', 'boto3.client', (['"""cloudwatch"""'], {}), "('cloudwatch')\n", (962, 976), False, 'import boto3\n'), ((985, 1004), 'boto3.client', 'boto3.client', (['"""sns"""'], {}), "('sns')...
# -*- coding: utf-8 -*- # Copyright 2015-2019 grafana-dashboard-builder contributors # # 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 ...
[ "mock.patch", "grafana_dashboards.exporter.ProjectProcessor", "grafana_dashboards.exporter.FileExporter", "pytest.raises", "mock.MagicMock" ]
[((1642, 1696), 'mock.patch', 'patch', (['"""grafana_dashboards.exporter.open"""'], {'create': '(True)'}), "('grafana_dashboards.exporter.open', create=True)\n", (1647, 1696), False, 'from mock import patch, MagicMock\n'), ((1698, 1716), 'mock.patch', 'patch', (['"""json.dump"""'], {}), "('json.dump')\n", (1703, 1716),...
# Copyright 2012 Cisco Systems, 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 requir...
[ "neutron._i18n._", "oslo_config.cfg.CONF.register_opts" ]
[((4152, 4195), 'oslo_config.cfg.CONF.register_opts', 'cfg.CONF.register_opts', (['vxlan_opts', '"""VXLAN"""'], {}), "(vxlan_opts, 'VXLAN')\n", (4174, 4195), False, 'from oslo_config import cfg\n'), ((4196, 4247), 'oslo_config.cfg.CONF.register_opts', 'cfg.CONF.register_opts', (['bridge_opts', '"""LINUX_BRIDGE"""'], {}...
#!/usr/bin/python # Copyright: (c) 2018, Pluribus Networks # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['...
[ "ansible_collections.community.general.plugins.module_utils.network.netvisor.pn_nvos.run_cli", "ansible_collections.community.general.plugins.module_utils.network.netvisor.pn_nvos.pn_cli" ]
[((5153, 5178), 'ansible_collections.community.general.plugins.module_utils.network.netvisor.pn_nvos.pn_cli', 'pn_cli', (['module', 'cliswitch'], {}), '(module, cliswitch)\n', (5159, 5178), False, 'from ansible_collections.community.general.plugins.module_utils.network.netvisor.pn_nvos import pn_cli, run_cli\n'), ((585...
#!/usr/bin/python # -*- coding: UTF-8 -*- import os import json import time import pdb import platform import string import random # 此脚本与create_script.sh由算法同事 # 帮忙维护,当代码变更时需更新此版本号 code_version="1.0" def create_hccl_mindspore(): done = 0 rank_id = 0 hccl_data = {} # for test only #os.environ['...
[ "os.path.exists", "random.choice", "string.Template", "os.access", "time.sleep", "os.environ.items", "os.path.isfile", "platform.machine", "os.system", "json.dump" ]
[((9460, 9478), 'os.environ.items', 'os.environ.items', ([], {}), '()\n', (9476, 9478), False, 'import os\n'), ((12144, 12158), 'os.system', 'os.system', (['cmd'], {}), '(cmd)\n', (12153, 12158), False, 'import os\n'), ((12163, 12201), 'os.system', 'os.system', (["('chmod 777 ' + npu_info_dir)"], {}), "('chmod 777 ' + ...
from typing import List import torch from torch.utils.data.dataset import Dataset def noise(outlier_classes: List[int], generated_noise: torch.Tensor, norm: torch.Tensor, nom_class: int, train_set: Dataset, gt: bool = False) -> Dataset: """ Creates a dataset based on the nominal classes of a given ...
[ "torch.zeros_like", "torch.cat" ]
[((1057, 1080), 'torch.cat', 'torch.cat', (['(norm, anom)'], {}), '((norm, anom))\n', (1066, 1080), False, 'import torch\n'), ((3371, 3394), 'torch.cat', 'torch.cat', (['(norm, anom)'], {}), '((norm, anom))\n', (3380, 3394), False, 'import torch\n'), ((3692, 3714), 'torch.zeros_like', 'torch.zeros_like', (['norm'], {})...
from collections import deque from typing import List class AtCoderBase: def __init__(self, all_input: List[str]): self.all_input = deque(all_input) self.ret_str = "" self.msg = list() def input(self): def _input() -> str: line = self.all_input.pop() yi...
[ "collections.deque" ]
[((146, 162), 'collections.deque', 'deque', (['all_input'], {}), '(all_input)\n', (151, 162), False, 'from collections import deque\n')]
import pandas as pd import pyproj from preprocess.load_data.data_loader import load_hotel_reserve customer_tb, hotel_tb, reserve_tb = load_hotel_reserve() # 분,초를 도로 변환하는 함수 정의 def convert_to_continuous(x): # 아래의 식으로 실행하면 약간의 오차가 발생, # 정확한 값으로 계산하고 싶을 땐, 문자열로 변환한 후 도,분,초의 값을 숫자로 변환하여 계산 x_min = (x * 100 - in...
[ "pyproj.Geod", "pandas.merge", "math.sqrt", "pyproj.transform", "math.cos", "geopy.distance.great_circle", "geopy.distance.vincenty", "pyproj.Proj", "preprocess.load_data.data_loader.load_hotel_reserve", "math.sin" ]
[((134, 154), 'preprocess.load_data.data_loader.load_hotel_reserve', 'load_hotel_reserve', ([], {}), '()\n', (152, 154), False, 'from preprocess.load_data.data_loader import load_hotel_reserve\n'), ((717, 747), 'pyproj.Proj', 'pyproj.Proj', (['"""+init=EPSG:4326"""'], {}), "('+init=EPSG:4326')\n", (728, 747), False, 'i...
"""Management command to attempt to add an HLS video to edX via API call""" from django.contrib.auth import get_user_model from django.core.management.base import BaseCommand, CommandError from ui.api import post_hls_to_edx from ui.models import VideoFile from ui.encodings import EncodingNames from ui.utils import get...
[ "django.contrib.auth.get_user_model", "ui.api.post_hls_to_edx", "ui.models.VideoFile.objects.filter", "ui.utils.get_error_response_summary_dict", "django.core.management.base.CommandError" ]
[((357, 373), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (371, 373), False, 'from django.contrib.auth import get_user_model\n'), ((1277, 1386), 'django.core.management.base.CommandError', 'CommandError', (['"""Please provide --video-file-id or at least one of --edx-course-id and --video-t...
__author__ = 'sibirrer' from lenstronomy.LensModel.Profiles.flexion import Flexion from lenstronomy.LensModel.lens_model import LensModel import numpy as np import numpy.testing as npt import pytest class TestExternalShear(object): """ tests the Gaussian methods """ def setup(self): self.fl...
[ "lenstronomy.LensModel.lens_model.LensModel", "pytest.main", "numpy.testing.assert_almost_equal", "numpy.array", "lenstronomy.LensModel.Profiles.flexion.Flexion" ]
[((3229, 3242), 'pytest.main', 'pytest.main', ([], {}), '()\n', (3240, 3242), False, 'import pytest\n'), ((325, 334), 'lenstronomy.LensModel.Profiles.flexion.Flexion', 'Flexion', ([], {}), '()\n', (332, 334), False, 'from lenstronomy.LensModel.Profiles.flexion import Flexion\n'), ((494, 507), 'numpy.array', 'np.array',...
from unittest.mock import Mock, PropertyMock, MagicMock, patch import numpy as np import gym_connect4 from test_fixtures import Connect4Task import regym from regym.environments import EnvType from regym.rl_algorithms import build_MCTS_Agent from regym.rl_algorithms.agents import Agent, build_Deterministic_Agent, De...
[ "unittest.mock.Mock", "regym.rl_algorithms.build_Deterministic_Agent", "regym.rl_loops.Trajectory", "test_fixtures.Connect4Task.run_episodes", "regym.rl_loops.multiagent_loops.sequential_action_rl_loop.propagate_last_experience", "regym.rl_loops.multiagent_loops.sequential_action_rl_loop.propagate_experie...
[((771, 857), 'regym.rl_algorithms.build_Deterministic_Agent', 'build_Deterministic_Agent', (['Connect4Task', "{'action': 0}", '"""Col-0-DeterministicAgent"""'], {}), "(Connect4Task, {'action': 0},\n 'Col-0-DeterministicAgent')\n", (796, 857), False, 'from regym.rl_algorithms import build_Deterministic_Agent, build_...
from sympy.core.function import expand_func from sympy.core import EulerGamma from sympy.core.numbers import (I, Rational, nan, oo, pi, zoo) from sympy.core.singleton import S from sympy.core.symbol import (Dummy, Symbol) from sympy.functions.combinatorial.factorials import factorial from sympy.functions.combinatorial....
[ "sympy.functions.special.gamma_functions.digamma", "sympy.functions.elementary.miscellaneous.sqrt", "sympy.functions.special.gamma_functions.uppergamma", "sympy.core.symbol.Symbol", "sympy.functions.special.error_functions.expint", "sympy.core.function.expand_func", "sympy.functions.elementary.trigonome...
[((1299, 1310), 'sympy.core.symbol.Symbol', 'Symbol', (['"""x"""'], {}), "('x')\n", (1305, 1310), False, 'from sympy.core.symbol import Dummy, Symbol\n'), ((1315, 1326), 'sympy.core.symbol.Symbol', 'Symbol', (['"""y"""'], {}), "('y')\n", (1321, 1326), False, 'from sympy.core.symbol import Dummy, Symbol\n'), ((1331, 135...
import importlib def cli(): for experiments_file in ( "larq_zoo.training.basic_experiments", "larq_zoo.training.multi_stage_experiments", ): importlib.import_module(experiments_file) from zookeeper import cli cli() if __name__ == "__main__": cli()
[ "zookeeper.cli", "importlib.import_module" ]
[((253, 258), 'zookeeper.cli', 'cli', ([], {}), '()\n', (256, 258), False, 'from zookeeper import cli\n'), ((292, 297), 'zookeeper.cli', 'cli', ([], {}), '()\n', (295, 297), False, 'from zookeeper import cli\n'), ((175, 216), 'importlib.import_module', 'importlib.import_module', (['experiments_file'], {}), '(experiment...
""" Module responsible for translating g2p data into GA4GH native objects. """ import re import bisect import rdflib from rdflib import RDF import candig.server.exceptions as exceptions import candig.server.datamodel.sequence_annotations as sequence_annotations import candig.server.datamodel.genotype_phenotype as g2p...
[ "candig.server.exceptions.BadFeatureSetSearchRequestRegularExpression", "candig.schemas.protocol.Attributes", "candig.schemas.protocol.Feature", "rdflib.ConjunctiveGraph", "candig.schemas.protocol.OntologyTerm", "rdflib.URIRef" ]
[((2298, 2323), 'rdflib.ConjunctiveGraph', 'rdflib.ConjunctiveGraph', ([], {}), '()\n', (2321, 2323), False, 'import rdflib\n'), ((2478, 2540), 'rdflib.URIRef', 'rdflib.URIRef', (['"""http://data.monarchinitiative.org/ttl/cgd.ttl"""'], {}), "('http://data.monarchinitiative.org/ttl/cgd.ttl')\n", (2491, 2540), False, 'im...
import numpy as np # import os # current_directory = os.path.dirname(os.path.abspath(__file__)).replace('\\','/') # from ctypes import * # bro = cdll.LoadLibrary(current_directory+"/broken.so") # bro.broken_frame.argtypes = [np.ctypeslib.ndpointer(dtype=np.int16, ndim=1, flags="C_CONTIGUOUS"), # c_int, # ...
[ "numpy.abs", "numpy.log10" ]
[((1532, 1564), 'numpy.abs', 'np.abs', (['wdata[i * w:(i + 1) * w]'], {}), '(wdata[i * w:(i + 1) * w])\n', (1538, 1564), True, 'import numpy as np\n'), ((1584, 1597), 'numpy.log10', 'np.log10', (['tem'], {}), '(tem)\n', (1592, 1597), True, 'import numpy as np\n')]
import torch from typing import Sequence from torch.utils.data import (DataLoader, RandomSampler, SequentialSampler, TensorDataset) import utils from utils import CQAExample, SMExample, NLIExample from utils import truncate_seq_pair, detok_batch class T5Input: def __init__(self, encoder_inputs, encoder_masks, d...
[ "torch.nn.functional.softmax", "utils.truncate_seq_pair", "torch.ones", "torch.multinomial", "torch.utils.data.SequentialSampler", "torch.utils.data.TensorDataset", "torch.utils.data.RandomSampler", "torch.tensor", "utils.detok_batch", "torch.sum", "torch.utils.data.DataLoader", "torch.no_grad...
[((2358, 2387), 'torch.utils.data.TensorDataset', 'TensorDataset', (['*train_tensors'], {}), '(*train_tensors)\n', (2371, 2387), False, 'from torch.utils.data import DataLoader, RandomSampler, SequentialSampler, TensorDataset\n'), ((2510, 2626), 'torch.utils.data.DataLoader', 'DataLoader', (['train_data'], {'sampler': ...
## ## @cond ___LICENSE___ ## ## Copyright (c) 2016-2018 Zefiros Software. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to deal ## in the Software without restriction, including without limitation the rights ##...
[ "os.listdir", "glob.iglob", "yaml.dump", "re.compile", "subprocess.Popen" ]
[((1747, 1766), 'os.listdir', 'os.listdir', (['"""libs/"""'], {}), "('libs/')\n", (1757, 1766), False, 'import os\n'), ((1849, 1881), 're.compile', 're.compile', (['"""libs\\\\\\\\(\\\\w*)\\\\\\\\"""'], {}), "('libs\\\\\\\\(\\\\w*)\\\\\\\\')\n", (1859, 1881), False, 'import re\n'), ((2569, 2610), 'yaml.dump', 'yaml.dum...
# -*- coding: utf-8 -*- # Copyright © 2021 <NAME>. All rights reserved. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COP...
[ "json.loads", "requests_cache.clear", "json.dumps", "requests_cache.install_cache", "requests.get" ]
[((1214, 1237), 'json.loads', 'json.loads', (['json_string'], {}), '(json_string)\n', (1224, 1237), False, 'import json\n'), ((1806, 1866), 'requests.get', 'requests.get', (['"""https://api.datamuse.com/words?rel_rhy=Funny"""'], {}), "('https://api.datamuse.com/words?rel_rhy=Funny')\n", (1818, 1866), False, 'import req...
#!/usr/bin/python import RPi.GPIO as GPIO class MAX31855(object): '''Python driver for [MAX38155 Cold-Junction Compensated Thermocouple-to-Digital Converter](http://www.maximintegrated.com/datasheet/index.mvp/id/7273) Requires: - The [GPIO Library](https://code.google.com/p/raspberry-gpio-python/) (Alrea...
[ "RPi.GPIO.setup", "RPi.GPIO.output", "time.sleep", "RPi.GPIO.input", "RPi.GPIO.setmode" ]
[((1189, 1213), 'RPi.GPIO.setmode', 'GPIO.setmode', (['self.board'], {}), '(self.board)\n', (1201, 1213), True, 'import RPi.GPIO as GPIO\n'), ((1222, 1255), 'RPi.GPIO.setup', 'GPIO.setup', (['self.cs_pin', 'GPIO.OUT'], {}), '(self.cs_pin, GPIO.OUT)\n', (1232, 1255), True, 'import RPi.GPIO as GPIO\n'), ((1264, 1300), 'R...
from os import listdir from os.path import isfile from PIL import Image from tqdm import tqdm import numpy as np import imgaug.augmenters as iaa import os import random from os.path import join import matplotlib.pyplot as plt DATA_DIR = 'DATA DIR' os.chdir(DATA_DIR) IMAGE_DIR = join(DATA_DIR, 'dat...
[ "matplotlib.pyplot.imshow", "PIL.Image.fromarray", "os.listdir", "tqdm.tqdm", "os.path.join", "numpy.asarray", "numpy.squeeze", "os.chdir", "numpy.expand_dims", "imgaug.augmenters.JpegCompression", "matplotlib.pyplot.subplot", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show" ]
[((265, 283), 'os.chdir', 'os.chdir', (['DATA_DIR'], {}), '(DATA_DIR)\n', (273, 283), False, 'import os\n'), ((301, 360), 'os.path.join', 'join', (['DATA_DIR', '"""dataset\\\\PascalVOC-OG-flipped\\\\JPEGImages"""'], {}), "(DATA_DIR, 'dataset\\\\PascalVOC-OG-flipped\\\\JPEGImages')\n", (305, 360), False, 'from os.path i...
"""Command line interface for chalice. Contains commands for deploying chalice. """ import logging import os import platform import sys import tempfile import shutil import traceback import functools import json import botocore.exceptions import click from typing import Dict, Any, Optional # noqa from chalice impo...
[ "logging.getLogger", "click.Choice", "logging.StreamHandler", "platform.release", "click.echo", "chalice.pipeline.PipelineParameters", "click.ClickException", "chalice.utils.serialize_to_json", "sys.exit", "chalice.cli.factory.CLIFactory", "chalice.pipeline.CreatePipelineTemplate", "chalice.aw...
[((3150, 3163), 'click.group', 'click.group', ([], {}), '()\n', (3161, 3163), False, 'import click\n'), ((3319, 3427), 'click.option', 'click.option', (['"""--project-dir"""'], {'help': '"""The project directory path (absolute or relative).Defaults to CWD"""'}), "('--project-dir', help=\n 'The project directory path...
from typing import Dict import numpy as np def buffer_from_example(example: Dict[str, np.ndarray], leading_dims) -> Dict[str, np.ndarray]: buf = {} for key, value in example.items(): buf[key] = np.zeros(leading_dims + value.shape, dtype=value.dtype) return buf def get_l...
[ "numpy.zeros" ]
[((237, 292), 'numpy.zeros', 'np.zeros', (['(leading_dims + value.shape)'], {'dtype': 'value.dtype'}), '(leading_dims + value.shape, dtype=value.dtype)\n', (245, 292), True, 'import numpy as np\n')]
import numpy as np import cv2 image = cv2.imread('images/unsharp_bird.jpg') kernel = np.array([ [0, -1, 0], [-1, 5, -1], [0, -1, 0] ]) sharpen_iamge = cv2.filter2D(image, -1, kernel) cv2.imshow("original image", image) cv2.imshow("sharpen image", sharpen_iamge) cv2.wait...
[ "cv2.filter2D", "cv2.imshow", "numpy.array", "cv2.destroyAllWindows", "cv2.waitKey", "cv2.imread" ]
[((39, 76), 'cv2.imread', 'cv2.imread', (['"""images/unsharp_bird.jpg"""'], {}), "('images/unsharp_bird.jpg')\n", (49, 76), False, 'import cv2\n'), ((87, 134), 'numpy.array', 'np.array', (['[[0, -1, 0], [-1, 5, -1], [0, -1, 0]]'], {}), '([[0, -1, 0], [-1, 5, -1], [0, -1, 0]])\n', (95, 134), True, 'import numpy as np\n'...
#!/usr/bin/env python3 import pkg_resources extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx_autodoc_typehints' ] templates_path = ['_templates'] source_suffix = '.rst' master_doc = 'index' project = 'AnyIO' author = '<NAME>' copyright = '2018, ' + author v = pkg_resources.get_distr...
[ "pkg_resources.get_distribution" ]
[((297, 336), 'pkg_resources.get_distribution', 'pkg_resources.get_distribution', (['"""anyio"""'], {}), "('anyio')\n", (327, 336), False, 'import pkg_resources\n')]
from django import urls import pytest from surveys.tests.test_views.helpers import create_user def get_login_url(): return urls.reverse("user_login") @pytest.mark.django_db def test_login_only_post(client): response = client.get(get_login_url()) print(response.content) assert response.status_code =...
[ "surveys.tests.test_views.helpers.create_user", "django.urls.reverse" ]
[((130, 156), 'django.urls.reverse', 'urls.reverse', (['"""user_login"""'], {}), "('user_login')\n", (142, 156), False, 'from django import urls\n'), ((390, 442), 'surveys.tests.test_views.helpers.create_user', 'create_user', ([], {'login': '"""TestUser"""', 'password': '"""<PASSWORD>"""'}), "(login='TestUser', passwor...
import tensorflow as tf y=1. n=-1. bias=1.0 x=[[y,y,bias], [y,n,bias], [n,y,bias], [n,n,bias]] out=[[n],[n],[n],[y]] w=tf.Variable(tf.random_normal([3,1])) def step(x): is_greater=tf.greater(x,0) as_float=tf.to_float(is_greater) doubled=tf.multiply(as_float,2) return tf.s...
[ "tensorflow.initialize_all_variables", "tensorflow.random_normal", "tensorflow.to_float", "tensorflow.Session", "tensorflow.multiply", "tensorflow.add", "tensorflow.matmul", "tensorflow.greater", "tensorflow.subtract", "tensorflow.square" ]
[((375, 399), 'tensorflow.subtract', 'tf.subtract', (['out', 'output'], {}), '(out, output)\n', (386, 399), True, 'import tensorflow as tf\n'), ((446, 483), 'tensorflow.matmul', 'tf.matmul', (['x', 'error'], {'transpose_a': '(True)'}), '(x, error, transpose_a=True)\n', (455, 483), True, 'import tensorflow as tf\n'), ((...
# script to count chars, tokens, paragraphs of the corpus files import nltk as k r=open("../corpora/corpora.txt","r") t=r.readlines() tt=[] npars = 0 for line in t: if line =="\n": pass else: tt.append(line[:-1]) npars += 1 ts=" ".join(tt) nchars = len(ts) nsents = len(k.tokenize.sent_...
[ "nltk.tokenize.sent_tokenize", "nltk.tokenize.wordpunct_tokenize" ]
[((304, 332), 'nltk.tokenize.sent_tokenize', 'k.tokenize.sent_tokenize', (['ts'], {}), '(ts)\n', (328, 332), True, 'import nltk as k\n'), ((346, 379), 'nltk.tokenize.wordpunct_tokenize', 'k.tokenize.wordpunct_tokenize', (['ts'], {}), '(ts)\n', (375, 379), True, 'import nltk as k\n'), ((618, 647), 'nltk.tokenize.sent_to...
#!/usr/bin/python import argparse import distutils.version import json import os import plistlib import subprocess import sys import tempfile import urllib import webbrowser def export_bundle(bundle_path): toplevel_path = subprocess.check_output( ['git', 'rev-parse', '--show-toplevel']).rstrip() git =...
[ "webbrowser.open", "plistlib.readPlist", "urllib.urlencode", "pip.main", "os.path.exists", "argparse.ArgumentParser", "subprocess.Popen", "json.dumps", "os.path.split", "plistlib.writePlist", "virtualenv.make_environment_relocatable", "subprocess.check_output", "json.loads", "subprocess.ch...
[((366, 384), 'tempfile.mkdtemp', 'tempfile.mkdtemp', ([], {}), '()\n', (382, 384), False, 'import tempfile\n'), ((400, 485), 'subprocess.Popen', 'subprocess.Popen', (["(git + ['ls-files', '-cz', bundle_path])"], {'stdout': 'subprocess.PIPE'}), "(git + ['ls-files', '-cz', bundle_path], stdout=subprocess.PIPE\n )\n",...