code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
# -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | [
"unittest.mock.MagicMock",
"airflow.contrib.hooks.aws_sqs_hook.SQSHook",
"airflow.contrib.operators.aws_sqs_publish_operator.SQSPublishOperator",
"airflow.DAG",
"unittest.main",
"airflow.utils.timezone.datetime"
] | [((1103, 1132), 'airflow.utils.timezone.datetime', 'timezone.datetime', (['(2019)', '(1)', '(1)'], {}), '(2019, 1, 1)\n', (1120, 1132), False, 'from airflow.utils import timezone\n'), ((2363, 2378), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2376, 2378), False, 'import unittest\n'), ((1324, 1361), 'airflow.DA... |
from tkinter import *
from tkinter.messagebox import showwarning,showerror
from tkinter.filedialog import askopenfile
import cv2
from PIL import Image, ImageTk
from threading import Thread
from tesseract import ProcessImage
def stop_():
camera.destroy()
cap.release()
#display result
def extract... | [
"PIL.Image.fromarray",
"cv2.flip",
"cv2.VideoCapture",
"tkinter.filedialog.askopenfile",
"cv2.cvtColor",
"threading.Thread",
"tesseract.ProcessImage",
"PIL.ImageTk.PhotoImage"
] | [((625, 643), 'cv2.flip', 'cv2.flip', (['frame', '(1)'], {}), '(frame, 1)\n', (633, 643), False, 'import cv2\n'), ((657, 696), 'cv2.cvtColor', 'cv2.cvtColor', (['frame', 'cv2.COLOR_BGR2GRAY'], {}), '(frame, cv2.COLOR_BGR2GRAY)\n', (669, 696), False, 'import cv2\n'), ((707, 730), 'PIL.Image.fromarray', 'Image.fromarray'... |
import main
crew_mitglied_1 = main.CrewMitglied()
crew_mitglied_1.nachname = "Quirk"
print(crew_mitglied_1.nachname)
crew_mitglied_4 = main.CrewMitglied()
crew_mitglied_4.nachname = "Quirky"
print(crew_mitglied_4.nachname)
print(main.CrewMitglied)
print(id(crew_mitglied_4.nachname))
print(crew_mitglied_4==crew_mitgli... | [
"main.CrewMitglied"
] | [((31, 50), 'main.CrewMitglied', 'main.CrewMitglied', ([], {}), '()\n', (48, 50), False, 'import main\n'), ((137, 156), 'main.CrewMitglied', 'main.CrewMitglied', ([], {}), '()\n', (154, 156), False, 'import main\n')] |
import geopandas as gpd
import requests
from vt2geojson.tools import vt_bytes_to_geojson
MAPBOX_ACCESS_TOKEN = "<KEY>"
x = 150
y = 194
z = 9
url = f"https://api.mapbox.com/v4/mapbox.mapbox-streets-v6/{z}/{x}/{y}.vector.pbf?access_token={MAPBOX_ACCESS_TOKEN}"
r = requests.get(url)
assert r.status_code == 200, r.cont... | [
"vt2geojson.tools.vt_bytes_to_geojson",
"geopandas.GeoDataFrame.from_features",
"requests.get"
] | [((267, 284), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (279, 284), False, 'import requests\n'), ((359, 399), 'vt2geojson.tools.vt_bytes_to_geojson', 'vt_bytes_to_geojson', (['vt_content', 'x', 'y', 'z'], {}), '(vt_content, x, y, z)\n', (378, 399), False, 'from vt2geojson.tools import vt_bytes_to_geojso... |
from tensorflow.python.ops import init_ops
from tensorflow.python.util import nest
import tensorflow as tf
def stack_bidirectional_dynamic_rnn(cells_fw, cells_bw, inputs, initial_states_fw=None, initial_states_bw=None,
dtype=None, sequence_length=None, parallel_iterations=None, sco... | [
"tensorflow.div",
"tensorflow.shape",
"tensorflow.get_variable",
"tensorflow.pad",
"tensorflow.nn.bidirectional_dynamic_rnn",
"tensorflow.reduce_sum",
"tensorflow.split",
"tensorflow.get_variable_scope",
"tensorflow.nn.dropout",
"tensorflow.contrib.layers.layer_norm",
"tensorflow.concat",
"ten... | [((682, 760), 'tensorflow.variable_scope', 'tf.variable_scope', (["(scope or 'stack_bidirectional_rnn')"], {'initializer': 'initializer'}), "(scope or 'stack_bidirectional_rnn', initializer=initializer)\n", (699, 760), True, 'import tensorflow as tf\n'), ((4062, 4089), 'tensorflow.orthogonal_initializer', 'tf.orthogona... |
#-*- coding:utf-8 -*-
#
# 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, softwar... | [
"tensorflow.keras.layers.Masking",
"tensorflow.keras.layers.Reshape",
"tensorflow.shape",
"tensorflow.keras.layers.MaxPooling2D",
"tensorflow.keras.layers.Lambda",
"tensorflow.keras.layers.Dropout",
"tensorflow.math.maximum",
"tensorflow.expand_dims",
"tfsr.helper.model_helper.get_init",
"tensorfl... | [((1596, 1635), 'tensorflow.keras.layers.Masking', 'tf.keras.layers.Masking', ([], {'mask_value': '(0.0)'}), '(mask_value=0.0)\n', (1619, 1635), True, 'import tensorflow as tf\n'), ((1729, 1783), 'tensorflow.keras.layers.Lambda', 'tf.keras.layers.Lambda', (['mh.feat_mask'], {'name': '"""pad_mask1"""'}), "(mh.feat_mask,... |
'''
Project: Farnsworth
Author: <NAME>
Search indexes for the managers app.
'''
from datetime import datetime
from haystack import indexes
from managers.models import Manager, Request, Response, Announcement
class ManagerIndex(indexes.SearchIndex, indexes.Indexable):
''' Index for Managers. '''
text = index... | [
"haystack.indexes.CharField",
"haystack.indexes.EdgeNgramField",
"haystack.indexes.DateTimeField"
] | [((315, 371), 'haystack.indexes.EdgeNgramField', 'indexes.EdgeNgramField', ([], {'document': '(True)', 'use_template': '(True)'}), '(document=True, use_template=True)\n', (337, 371), False, 'from haystack import indexes\n'), ((384, 435), 'haystack.indexes.EdgeNgramField', 'indexes.EdgeNgramField', ([], {'model_attr': '... |
"""
tcp async io (nonblocking) module
"""
from __future__ import absolute_import, division, print_function
import sys
import os
import socket
import errno
import platform
from collections import deque
from binascii import hexlify
try:
import ssl
except ImportError:
pass
# Import ioflo libs
from ...aid.sixin... | [
"collections.deque",
"socket.socket",
"ssl.SSLContext",
"ssl.create_default_context",
"binascii.hexlify",
"sys.platform.startswith"
] | [((4573, 4580), 'collections.deque', 'deque', ([], {}), '()\n', (4578, 4580), False, 'from collections import deque\n'), ((21231, 21238), 'collections.deque', 'deque', ([], {}), '()\n', (21236, 21238), False, 'from collections import deque\n'), ((21954, 22003), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'soc... |
import socket
import sys
import threading
from datetime import datetime
from helper import MessageParser
from helper import const
from model import Message
HOST = const.HOST
PORT = const.PORT
CURSOR_UP_ONE = '\x1b[1A'
ERASE_LINE = '\x1b[2K'
def message_listener(s: socket):
try:
while True:
d... | [
"socket.socket",
"helper.MessageParser.byte_array_to_message",
"datetime.datetime.now",
"helper.MessageParser.message_to_byte_array",
"threading.Thread",
"sys.stdout.write"
] | [((673, 722), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (686, 722), False, 'import socket\n'), ((778, 829), 'threading.Thread', 'threading.Thread', ([], {'target': 'message_listener', 'args': '[s]'}), '(target=message_listener, args=[s])\... |
import urllib.parse
from datetime import datetime
from unittest.mock import patch
from django.contrib.auth.models import User
from django.contrib.messages import get_messages
from django.test import TestCase
from django.utils import timezone
from dfirtrack_main.models import (
System,
Systemstatus,
Task,
... | [
"datetime.datetime",
"dfirtrack_main.models.Taskpriority.objects.create",
"dfirtrack_main.models.Taskpriority.objects.get",
"dfirtrack_main.models.System.objects.get",
"dfirtrack_main.models.System.objects.create",
"dfirtrack_main.models.Taskname.objects.get",
"django.utils.timezone.now",
"dfirtrack_m... | [((536, 622), 'django.contrib.auth.models.User.objects.create_user', 'User.objects.create_user', ([], {'username': '"""testuser_task_creator"""', 'password': '"""<PASSWORD>"""'}), "(username='testuser_task_creator', password=\n '<PASSWORD>')\n", (560, 622), False, 'from django.contrib.auth.models import User\n'), ((... |
# Examine Data with Fiona
# https://github.com/GeospatialPython/Learning/raw/master/GIS_CensusTract.zip
import fiona
from pprint import pprint
# Open a shapefile
f = fiona.open("GIS_CensusTract_poly.shp")
# Check the type of driver
print(f.driver)
# Get the crs
print(f.crs)
# Get the boudning box
print... | [
"pprint.pprint",
"fiona.open"
] | [((177, 215), 'fiona.open', 'fiona.open', (['"""GIS_CensusTract_poly.shp"""'], {}), "('GIS_CensusTract_poly.shp')\n", (187, 215), False, 'import fiona\n'), ((363, 379), 'pprint.pprint', 'pprint', (['f.schema'], {}), '(f.schema)\n', (369, 379), False, 'from pprint import pprint\n'), ((471, 483), 'pprint.pprint', 'pprint... |
from math import sin, cos, tanh, pi, sqrt
def u(x):
return cos(x[1])*sin(x[0])
def v(x):
return -cos(x[0])*sin(x[1])
def h(x):
return sin(x[0])*sin(x[1])
def forcing_u(x):
return cos(x[0])*cos(x[1])**2*sin(x[0]) + cos(x[0])*sin(x[0])*sin(x[1])**2 + 1.20*cos(x[1])*sin(x[0]) + 9.80*cos(x[0])*sin(x[1])... | [
"math.cos",
"math.sin"
] | [((64, 73), 'math.cos', 'cos', (['x[1]'], {}), '(x[1])\n', (67, 73), False, 'from math import sin, cos, tanh, pi, sqrt\n'), ((74, 83), 'math.sin', 'sin', (['x[0]'], {}), '(x[0])\n', (77, 83), False, 'from math import sin, cos, tanh, pi, sqrt\n'), ((117, 126), 'math.sin', 'sin', (['x[1]'], {}), '(x[1])\n', (120, 126), F... |
import json
import metrics
class Example(object):
def __init__(self, file_idx, gcs, pcs, top_m_units=None, top_antecedents_index=None, top_antecedents_score=None):
self.file_idx = file_idx
self.gcs = [tuple(tuple([m[0], m[1]]) for m in gc) for gc in gcs]
self.pcs = [tuple(tuple([m[0], m[1... | [
"metrics.CorefEvaluator"
] | [((2579, 2603), 'metrics.CorefEvaluator', 'metrics.CorefEvaluator', ([], {}), '()\n', (2601, 2603), False, 'import metrics\n')] |
import numpy as np
import pytorch_lightning as pl
import torch
from pytorch_lightning.callbacks.early_stopping import EarlyStopping
from sklearn.model_selection import train_test_split
from torch import nn
from torch.nn import functional as F
from transformers import BertTokenizer, BertConfig, BertModel
class BertTex... | [
"torch.nn.Dropout",
"torch.as_tensor",
"numpy.ones",
"sklearn.model_selection.train_test_split",
"pytorch_lightning.callbacks.early_stopping.EarlyStopping",
"transformers.BertTokenizer.from_pretrained",
"transformers.BertModel.from_pretrained",
"numpy.argsort",
"numpy.array",
"torch.nn.functional.... | [((4739, 4789), 'sklearn.model_selection.train_test_split', 'train_test_split', (['X'], {'test_size': '(0.2)', 'random_state': '(1)'}), '(X, test_size=0.2, random_state=1)\n', (4755, 4789), False, 'from sklearn.model_selection import train_test_split\n'), ((4812, 4871), 'sklearn.model_selection.train_test_split', 'trai... |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------
# Filename: core.py
# Purpose: plugin for reading and writing Site object into various format
# Author: microquake development team
# Email: <EMAIL>
#
# Copyright (C) 2016 microquake development team
# -------------------... | [
"pickle.dump",
"microquake.core.data.station.Site",
"microquake.core.logger.error",
"microquake.core.data.station.Network",
"microquake.core.data.station.Station",
"microquake.core.data.station.Channel"
] | [((3511, 3550), 'microquake.core.data.station.Site', 'Site', ([], {'code': 'site_code', 'networks': 'networks'}), '(code=site_code, networks=networks)\n', (3515, 3550), False, 'from microquake.core.data.station import Site\n'), ((3951, 4044), 'microquake.core.logger.error', 'logger.error', (['"""The pickle file does no... |
"""
A tool to parse xmind file into testlink xml file, which will help
you generate a testlink recognized xml file, then you can import it
into testlink as test suites.
Usage:
xmind2testlink [path_to_xmind_file] [-json]
Example:
xmind2testlink C:\\tests\\testcase.xmind => output xml
xmind2testlink C:\\tests\... | [
"web.testlink_parser.to_testlink_xml_file",
"web.xmind_parser.xmind_to_suite",
"web.xmind_parser.xmind_to_flat_dict"
] | [((581, 602), 'web.xmind_parser.xmind_to_suite', 'xmind_to_suite', (['xmind'], {}), '(xmind)\n', (595, 602), False, 'from web.xmind_parser import xmind_to_suite, xmind_to_flat_dict\n'), ((607, 643), 'web.testlink_parser.to_testlink_xml_file', 'to_testlink_xml_file', (['suite', 'xml_out'], {}), '(suite, xml_out)\n', (62... |
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 26 18:17:56 2021
@author: rringuet
Convert data in CTIPe output files to wrapped versions
"""
#import numpy as np
from numpy import transpose, zeros, array, append
from time import perf_counter
from netCDF4 import Dataset
from astropy.constants import R_earth
... | [
"netCDF4.Dataset",
"time.perf_counter",
"numpy.append",
"numpy.array",
"numpy.zeros",
"numpy.transpose"
] | [((5938, 5952), 'time.perf_counter', 'perf_counter', ([], {}), '()\n', (5950, 5952), False, 'from time import perf_counter\n'), ((6240, 6265), 'netCDF4.Dataset', 'Dataset', (['filename_density'], {}), '(filename_density)\n', (6247, 6265), False, 'from netCDF4 import Dataset\n'), ((6286, 6310), 'netCDF4.Dataset', 'Datas... |
import sys
sys.path.append('../../../')
import pytest
import pySRUPLib
keyfile = "private_key.pem"
pubkeyfile = "public_key.pem"
# The main test script for pySRUPLib's SRUP_Syndicated_C2_Request() class...
def test_c2_req_type():
x = pySRUPLib.SRUP_Syndicated_C2_Request()
assert x.msg_type == pySRUPLib.__s... | [
"pySRUPLib.SRUP_Generic",
"pySRUPLib.SRUP_Syndicated_C2_Request",
"pySRUPLib.__syndicated_c2_request_message_type",
"pytest.raises",
"sys.path.append"
] | [((11, 39), 'sys.path.append', 'sys.path.append', (['"""../../../"""'], {}), "('../../../')\n", (26, 39), False, 'import sys\n'), ((243, 281), 'pySRUPLib.SRUP_Syndicated_C2_Request', 'pySRUPLib.SRUP_Syndicated_C2_Request', ([], {}), '()\n', (279, 281), False, 'import pySRUPLib\n'), ((474, 512), 'pySRUPLib.SRUP_Syndicat... |
import os
import numpy as np
SPEECH_DATA_PATH = './../Data_Clean'
DUMP_DATA_PATH = './../Data_Clean/Filtered_Dev'
train_y = np.load(os.path.join(SPEECH_DATA_PATH, 'train_transcripts.npy'),
encoding='bytes')
dev_y = np.load(os.path.join(SPEECH_DATA_PATH, 'dev_transcripts.npy'),
encod... | [
"numpy.array_equal",
"numpy.delete",
"os.path.join"
] | [((597, 623), 'numpy.delete', 'np.delete', (['dev_y', 'dup_list'], {}), '(dev_y, dup_list)\n', (606, 623), True, 'import numpy as np\n'), ((636, 662), 'numpy.delete', 'np.delete', (['dev_x', 'dup_list'], {}), '(dev_x, dup_list)\n', (645, 662), True, 'import numpy as np\n'), ((135, 190), 'os.path.join', 'os.path.join', ... |
#
# Copyright 2021 Red Hat Inc.
# SPDX-License-Identifier: Apache-2.0
#
"""Serializer to capture server status."""
from rest_framework import serializers
from .models import Status
class ConfigSerializer(serializers.Serializer):
"""Serializer for the Config class"""
debug = serializers.BooleanField(source="... | [
"rest_framework.serializers.CharField",
"rest_framework.serializers.IntegerField",
"rest_framework.serializers.BooleanField",
"rest_framework.serializers.DictField"
] | [((287, 343), 'rest_framework.serializers.BooleanField', 'serializers.BooleanField', ([], {'source': '"""DEBUG"""', 'read_only': '(True)'}), "(source='DEBUG', read_only=True)\n", (311, 343), False, 'from rest_framework import serializers\n'), ((370, 437), 'rest_framework.serializers.CharField', 'serializers.CharField',... |
import torch
from build_model import build_fairmot, load_model
with torch.no_grad():
input_data = torch.randn(1, 3, 608, 1088, dtype=torch.float32, device='cuda')
net = build_fairmot()
model = load_model(net, "../../weights/fairmot_dla34.pth")
model = model.to(torch.device('cuda'))
model.eval()
... | [
"torch.device",
"build_model.load_model",
"build_model.build_fairmot",
"torch.no_grad",
"torch.randn",
"torch.onnx.export"
] | [((70, 85), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (83, 85), False, 'import torch\n'), ((104, 168), 'torch.randn', 'torch.randn', (['(1)', '(3)', '(608)', '(1088)'], {'dtype': 'torch.float32', 'device': '"""cuda"""'}), "(1, 3, 608, 1088, dtype=torch.float32, device='cuda')\n", (115, 168), False, 'import to... |
from time import sleep
from json import dumps
from kafka import KafkaProducer
producer = KafkaProducer(bootstrap_servers=['10.177.17.31:9092'],
value_serializer=lambda x:
dumps(x).encode('utf-8'))
for e in range(1000):
data = {'number': e}
producer.s... | [
"json.dumps",
"time.sleep"
] | [((355, 363), 'time.sleep', 'sleep', (['(5)'], {}), '(5)\n', (360, 363), False, 'from time import sleep\n'), ((228, 236), 'json.dumps', 'dumps', (['x'], {}), '(x)\n', (233, 236), False, 'from json import dumps\n')] |
from nose.tools import assert_equal
class TestGridPath(object):
def test_grid_path(self):
grid = Grid()
assert_equal(grid.find_path(None), None)
assert_equal(grid.find_path([[]]), None)
max_rows = 8
max_cols = 4
matrix = [[1] * max_cols for _ in range(max_rows)]
... | [
"nose.tools.assert_equal"
] | [((735, 765), 'nose.tools.assert_equal', 'assert_equal', (['result', 'expected'], {}), '(result, expected)\n', (747, 765), False, 'from nose.tools import assert_equal\n'), ((839, 865), 'nose.tools.assert_equal', 'assert_equal', (['result', 'None'], {}), '(result, None)\n', (851, 865), False, 'from nose.tools import ass... |
# This file is part of the Indico plugins.
# Copyright (C) 2002 - 2020 CERN
#
# The Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License;
# see the LICENSE file for more details.
from __future__ import unicode_literals
from flask import flash, redirect, r... | [
"indico.web.util.jsonify_data",
"indico.web.util.jsonify_template",
"indico.core.db.db.session.delete",
"indico.web.forms.base.FormDefaults",
"indico.web.flask.util.url_for",
"indico_livesync.models.agents.LiveSyncAgent.find",
"indico_livesync._",
"indico.core.db.db.session.add",
"indico_livesync.mo... | [((878, 990), 'flask_pluginengine.render_plugin_template', 'render_plugin_template', (['"""plugin_details_extra.html"""'], {'agents': 'agents', 'backends': 'current_plugin.backend_classes'}), "('plugin_details_extra.html', agents=agents, backends\n =current_plugin.backend_classes)\n", (900, 990), False, 'from flask_... |
# Fix for older setuptools
import re
import os
try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup, find_packages
def fpath(name):
return os.path.join(os.path.dirname(__file__), name)
def read(fname):
try:
return open(fpath(fname), encoding=... | [
"os.path.dirname",
"re.findall",
"distutils.core.find_packages"
] | [((732, 762), 're.findall', 're.findall', (['pattern', 'file_text'], {}), '(pattern, file_text)\n', (742, 762), False, 'import re\n'), ((216, 241), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (231, 241), False, 'import os\n'), ((1104, 1119), 'distutils.core.find_packages', 'find_packages',... |
from flask import Flask, render_template, request,redirect, url_for,session
from flask_mysqldb import MySQL
app = Flask(__name__)
app.secret_key = "<KEY>"
app.config['MYSQL_HOST'] = 'localhost'
app.config['MYSQL_USER'] = 'root'
app.config['MYSQL_PASSWORD'] = '<PASSWORD>'
app.config['MYSQL_DB'] = 'retailbankin... | [
"flask.render_template",
"flask_mysqldb.MySQL",
"flask.Flask",
"flask.request.form.get",
"flask.url_for",
"flask.session.pop"
] | [((119, 134), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (124, 134), False, 'from flask import Flask, render_template, request, redirect, url_for, session\n'), ((332, 342), 'flask_mysqldb.MySQL', 'MySQL', (['app'], {}), '(app)\n', (337, 342), False, 'from flask_mysqldb import MySQL\n'), ((1016, 1062), ... |
from panda3d.core import *
from panda3d.direct import *
from direct.task import Task
from direct.showbase.DirectObject import DirectObject
from direct.directnotify.DirectNotifyGlobal import directNotify
def remove_task ( ):
if (MotionTrail.task_added):
total_motion_trails = len (MotionTrail.motion_trail... | [
"direct.directnotify.DirectNotifyGlobal.directNotify.newCategory",
"direct.showbase.DirectObject.DirectObject.__init__"
] | [((1274, 1313), 'direct.directnotify.DirectNotifyGlobal.directNotify.newCategory', 'directNotify.newCategory', (['"""MotionTrail"""'], {}), "('MotionTrail')\n", (1298, 1313), False, 'from direct.directnotify.DirectNotifyGlobal import directNotify\n'), ((1600, 1627), 'direct.showbase.DirectObject.DirectObject.__init__',... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-07-09 12:42
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('distances', '0019_auto_20170709_1514'),
]
operations = [
migr... | [
"datetime.datetime"
] | [((444, 492), 'datetime.datetime', 'datetime.datetime', (['(2017)', '(7)', '(2)', '(12)', '(42)', '(9)', '(816676)'], {}), '(2017, 7, 2, 12, 42, 9, 816676)\n', (461, 492), False, 'import datetime\n')] |
# Copyright (c) 2016-present, Facebook, 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... | [
"numpy.random.choice",
"numpy.random.random",
"hypothesis.strategies.integers",
"caffe2.python.core.CreateOperator"
] | [((1118, 1197), 'caffe2.python.core.CreateOperator', 'core.CreateOperator', (['"""Conditional"""', "['condition', 'data_t', 'data_f']", '"""output"""'], {}), "('Conditional', ['condition', 'data_t', 'data_f'], 'output')\n", (1137, 1197), False, 'from caffe2.python import core\n'), ((1386, 1434), 'numpy.random.choice', ... |
from functools import wraps
from copy import copy
from collections import OrderedDict
from ..commands import InterfaceObj
from ..core.objects.memory import StackObj, RegObj
def BeforeParse(f):
@wraps(f)
def wrapper(inst, *args, **kwargs):
# noinspection PyProtectedMember
if inst._parsed is Tr... | [
"collections.OrderedDict",
"functools.wraps",
"copy.copy"
] | [((201, 209), 'functools.wraps', 'wraps', (['f'], {}), '(f)\n', (206, 209), False, 'from functools import wraps\n'), ((503, 511), 'functools.wraps', 'wraps', (['f'], {}), '(f)\n', (508, 511), False, 'from functools import wraps\n'), ((812, 820), 'functools.wraps', 'wraps', (['f'], {}), '(f)\n', (817, 820), False, 'from... |
#!/usr/bin/python3
#
# Send SOC temperature using LoRaWAN module
#
import subprocess
import time
from lora4click import MipotGpio, MipotSerial, MipotCmd
from typing import Optional
def get_soc_temperature() -> Optional[float]:
result = subprocess.run(['/usr/bin/vcgencmd', 'measure_temp'], capture_output=True, t... | [
"lora4click.MipotSerial",
"lora4click.MipotCmd",
"lora4click.MipotGpio",
"subprocess.run",
"time.clock_gettime"
] | [((244, 333), 'subprocess.run', 'subprocess.run', (["['/usr/bin/vcgencmd', 'measure_temp']"], {'capture_output': '(True)', 'text': '(True)'}), "(['/usr/bin/vcgencmd', 'measure_temp'], capture_output=True,\n text=True)\n", (258, 333), False, 'import subprocess\n'), ((1440, 1480), 'time.clock_gettime', 'time.clock_get... |
from schema import Schema, Optional, Or
_default = {
Optional('num'): int,
Optional('tags-like'): [str],
Optional('keep-tags'): [str],
Optional('keep-tags-like'): [str],
Optional('delete-by-hours'): [str],
Optional('keep-by-hours'): int,
Optional('dry-run'): bool,
}
_default2 = _default.co... | [
"schema.Optional",
"schema.Schema",
"schema.Or"
] | [((381, 421), 'schema.Schema', 'Schema', (['_default'], {'ignore_extra_keys': '(True)'}), '(_default, ignore_extra_keys=True)\n', (387, 421), False, 'from schema import Schema, Optional, Or\n'), ((447, 488), 'schema.Schema', 'Schema', (['_default2'], {'ignore_extra_keys': '(True)'}), '(_default2, ignore_extra_keys=True... |
#! /usr/bin/env python3
#
"""
Program to get the list of status aliases used by an instrument in SOSS
compatibility mode. Run like this:
$ ./get_statusAliases.py --ins=SPCAM
You can further restrict the scan by judicious use of --mode and --file
flags. These work the same as for testfunc_sk_parser (whose classe... | [
"g2base.ssdlog.make_logger",
"g2base.ssdlog.addlogopts",
"argparse.ArgumentParser"
] | [((2775, 2844), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'description': '"""Extract status aliases used by a script"""'}), "(description='Extract status aliases used by a script')\n", (2789, 2844), False, 'from argparse import ArgumentParser\n'), ((3371, 3396), 'g2base.ssdlog.addlogopts', 'ssdlog.addlogopts',... |
from django.contrib import admin
from django.contrib.auth import get_user_model
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import Group
User = get_user_model()
@admin.register(User)
class CustomUserAdmin(UserAdmin):
add_fieldsets = (
(None, {
'classes': ('... | [
"django.contrib.admin.site.unregister",
"django.contrib.auth.get_user_model",
"django.contrib.admin.register"
] | [((181, 197), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (195, 197), False, 'from django.contrib.auth import get_user_model\n'), ((201, 221), 'django.contrib.admin.register', 'admin.register', (['User'], {}), '(User)\n', (215, 221), False, 'from django.contrib import admin\n'), ((838, 866... |
"""
The following is adapted from Dask release 2021.03.1:
https://github.com/dask/dask/blob/2021.03.1/dask/local.py
"""
import os
from queue import Queue, Empty
from dask import config
from dask.callbacks import local_callbacks, unpack_callbacks
from dask.core import (_execute_task, flatten, get_dependencies, has... | [
"dask.core.flatten",
"dask.core.has_tasks",
"dask.callbacks.local_callbacks",
"dask.core._execute_task",
"dask.callbacks.unpack_callbacks",
"dask.core.reverse_dict",
"queue.Queue",
"dask.order.order",
"dask.config.get",
"dask.core.get_dependencies"
] | [((2142, 2168), 'dask.core.reverse_dict', 'reverse_dict', (['dependencies'], {}), '(dependencies)\n', (2154, 2168), False, 'from dask.core import _execute_task, flatten, get_dependencies, has_tasks, reverse_dict\n'), ((8031, 8038), 'queue.Queue', 'Queue', ([], {}), '()\n', (8036, 8038), False, 'from queue import Queue,... |
from __future__ import absolute_import
# Copyright (c) 2010-2019 openpyxl
import pytest
from openpyxl.xml.functions import fromstring, tostring
from openpyxl.tests.helper import compare_xml
@pytest.fixture
def PictureOptions():
from ..picture import PictureOptions
return PictureOptions
class TestPictureOpt... | [
"openpyxl.tests.helper.compare_xml",
"openpyxl.xml.functions.fromstring"
] | [((523, 549), 'openpyxl.tests.helper.compare_xml', 'compare_xml', (['xml', 'expected'], {}), '(xml, expected)\n', (534, 549), False, 'from openpyxl.tests.helper import compare_xml\n'), ((704, 719), 'openpyxl.xml.functions.fromstring', 'fromstring', (['src'], {}), '(src)\n', (714, 719), False, 'from openpyxl.xml.functio... |
'''OpenGL extension ARB.shader_texture_image_samples
This module customises the behaviour of the
OpenGL.raw.GL.ARB.shader_texture_image_samples to provide a more
Python-friendly API
Overview (from the spec)
This extension provides GLSL built-in functions allowing shaders to query
the number of samples ... | [
"OpenGL.extensions.hasGLExtension"
] | [((926, 968), 'OpenGL.extensions.hasGLExtension', 'extensions.hasGLExtension', (['_EXTENSION_NAME'], {}), '(_EXTENSION_NAME)\n', (951, 968), False, 'from OpenGL import extensions\n')] |
# Copyright 2016 Capital One Services, 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 in... | [
"logging.getLogger",
"boto3.client",
"sys.exc_info",
"argparse.ArgumentParser",
"botocore.vendored.requests.post",
"json.dumps",
"concurrent.futures.as_completed",
"c7n.mu.CloudWatchLogSubscription",
"traceback.print_exc",
"dateutil.parser.parse",
"c7n.credentials.SessionFactory",
"c7n.mu.Lamb... | [((2133, 2164), 'logging.getLogger', 'logging.getLogger', (['"""c7n-sentry"""'], {}), "('c7n-sentry')\n", (2150, 2164), False, 'import logging\n'), ((3354, 3424), 'c7n.credentials.SessionFactory', 'SessionFactory', (['config.region', 'config.profile'], {'assume_role': 'config.role'}), '(config.region, config.profile, a... |
#!/usr/bin/env python3
from jinja2 import Template
from weasyprint import HTML, CSS
from PIL import Image
import glob
import sys
import os
import argparse
import random
base_path = os.path.dirname(os.path.realpath(__file__))
def remove_rotated():
rotated = glob.glob("rotated*")
for i in rotated:
os.r... | [
"PIL.Image.open",
"argparse.ArgumentParser",
"os.getcwd",
"os.path.realpath",
"sys.exit",
"glob.glob",
"os.remove"
] | [((339, 364), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (362, 364), False, 'import argparse\n'), ((599, 617), 'glob.glob', 'glob.glob', (['"""*.jpg"""'], {}), "('*.jpg')\n", (608, 617), False, 'import glob\n'), ((199, 225), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__fi... |
# Copyright (c) 2016 <NAME> <<EMAIL>>
# Copyright (c) 2016 <NAME> <<EMAIL>>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
... | [
"pytanque.Matrix",
"six.moves.range",
"pytanque.esf_vector",
"pytanque.symbol",
"pytanque.imm",
"pytanque.Matrix.identity",
"pytanque.expand_esf",
"pytanque.subs_exprs_inplace",
"pytanque.Vector",
"pytanque.analyses.vectorial_decomp",
"six.iterbytes",
"pytanque.simplify_inplace",
"six.iterit... | [((1894, 1907), 'pytanque.Vector', 'Vector', (['nbits'], {}), '(nbits)\n', (1900, 1907), False, 'from pytanque import symbol, imm, Vector, Matrix, simplify, simplify_inplace, expand_esf_inplace, subs_vectors, subs_exprs, subs_exprs_inplace, analyses, esf_vector, esf, expand_esf, or_to_esf_inplace, Expr\n'), ((2453, 247... |
# _________________________________________________________________________________________________________
# Part 5
# _________________________________________________________________________________________________________
# Format Results
# @Khom
import sqlite3
# conn = sqlite3.connect(':memory')
# creating datab... | [
"sqlite3.connect"
] | [((331, 361), 'sqlite3.connect', 'sqlite3.connect', (['"""customer.db"""'], {}), "('customer.db')\n", (346, 361), False, 'import sqlite3\n')] |
# Copyright 2020 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
"create_job_from_template.create_job_from_template",
"google.cloud.storage.Client",
"delete_job.delete_job",
"create_job_template.create_job_template",
"create_job_from_preset.create_job_from_preset",
"create_job_from_ad_hoc.create_job_from_ad_hoc",
"os.path.join",
"delete_job_template.delete_job_temp... | [((1681, 1726), 'os.path.join', 'os.path.join', (['test_data', 'test_video_file_name'], {}), '(test_data, test_video_file_name)\n', (1693, 1726), False, 'import os\n'), ((1730, 1760), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (1744, 1760), False, 'import pytest\n'), ((52... |
import argparse
from typing import Optional, Tuple, cast
from opentrons.hardware_control import API, Controller
from opentrons.drivers.smoothie_drivers import SmoothieDriver
def root_argparser(description: Optional[str] = None) -> argparse.ArgumentParser:
parse = argparse.ArgumentParser(description=description)
... | [
"opentrons.hardware_control.API.build_hardware_controller",
"typing.cast",
"argparse.ArgumentParser"
] | [((271, 319), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': 'description'}), '(description=description)\n', (294, 319), False, 'import argparse\n'), ((620, 655), 'typing.cast', 'cast', (['Controller', 'hardware._backend'], {}), '(Controller, hardware._backend)\n', (624, 655), False, 'from t... |
import contextlib
import errno
import logging
import os
import os.path
import sqlite3
import edera.helpers
from edera.exceptions import LockAcquisitionError
from edera.locker import Locker
class DirectoryLocker(Locker):
"""
A directory-level locker.
A directory-level lock works as an inter-process mute... | [
"edera.exceptions.LockAcquisitionError",
"logging.getLogger",
"sqlite3.connect",
"os.makedirs",
"os.path.isdir",
"os.path.abspath",
"os.remove"
] | [((892, 913), 'os.path.abspath', 'os.path.abspath', (['path'], {}), '(path)\n', (907, 913), False, 'import os\n'), ((1106, 1128), 'os.makedirs', 'os.makedirs', (['self.path'], {}), '(self.path)\n', (1117, 1128), False, 'import os\n'), ((1483, 1527), 'sqlite3.connect', 'sqlite3.connect', (['lock_file_path'], {'timeout':... |
from nalp.corpus import TextCorpus
from nalp.encoders import IntegerEncoder
from nalp.models import SeqGAN
# When generating artificial text, make sure
# to use the same data, classes and parameters
# as the pre-trained network
# Creating a character TextCorpus from file
corpus = TextCorpus(from_file='data/text/chapt... | [
"nalp.models.SeqGAN",
"nalp.encoders.IntegerEncoder",
"nalp.corpus.TextCorpus"
] | [((283, 355), 'nalp.corpus.TextCorpus', 'TextCorpus', ([], {'from_file': '"""data/text/chapter1_harry.txt"""', 'corpus_type': '"""word"""'}), "(from_file='data/text/chapter1_harry.txt', corpus_type='word')\n", (293, 355), False, 'from nalp.corpus import TextCorpus\n'), ((418, 434), 'nalp.encoders.IntegerEncoder', 'Inte... |
import os
import time
from terminal_utils import getTerminalSize
def print_progress_bar(counter):
"""print `#` progress bars over ``counter`` seconds
Usage:
from progress_bar import print_progress_bar
print_progress_bar(10)
"""
width = getTerminalSize()[1] / counter
for i in range(... | [
"os.system",
"terminal_utils.getTerminalSize",
"time.sleep"
] | [((345, 363), 'os.system', 'os.system', (['"""clear"""'], {}), "('clear')\n", (354, 363), False, 'import os\n'), ((405, 418), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (415, 418), False, 'import time\n'), ((270, 287), 'terminal_utils.getTerminalSize', 'getTerminalSize', ([], {}), '()\n', (285, 287), False, 'f... |
from random import randint, random, choice
from algorithm.parameters import params
from algorithm.mapper import map_tree_from_genome
from representation import individual
from representation.derivation import generate_tree
from representation.latent_tree import latent_tree_mutate, latent_tree_repair
from utilit... | [
"random.choice",
"algorithm.mapper.map_tree_from_genome",
"representation.derivation.generate_tree",
"representation.latent_tree.latent_tree_mutate",
"representation.individual.Individual",
"random.random",
"utilities.representation.check_methods.check_ind",
"random.randint"
] | [((3716, 3755), 'representation.individual.Individual', 'individual.Individual', (['ind.genome', 'None'], {}), '(ind.genome, None)\n', (3737, 3755), False, 'from representation import individual\n'), ((4691, 4730), 'representation.individual.Individual', 'individual.Individual', (['ind.genome', 'None'], {}), '(ind.geno... |
# biblioteca padrão do terminal.
from os import get_terminal_size
# própria biblioteca ...
from biblioteca import NE
escreva_por_extenso = NE.escreva_por_extenso
# para simular o macro 'assert_eq' do Rust.
def assert_eq(a, b):
print("direito:\"{}\"\nesquerdo:\"{}\"\n".format(b, a))
assert a == b
# separador de... | [
"os.get_terminal_size"
] | [((389, 408), 'os.get_terminal_size', 'get_terminal_size', ([], {}), '()\n', (406, 408), False, 'from os import get_terminal_size\n')] |
# -*- coding: utf-8 -*-
import scrapy
from scrapy.linkextractors import LinkExtractor
from scrapy.spiders import CrawlSpider, Rule
from example.items import CountryOrDistrictItem
class CountryOrDistrictSpider(CrawlSpider):
name = 'country_or_district'
allowed_domains = ['example.python-scraping.com']
star... | [
"example.items.CountryOrDistrictItem",
"scrapy.linkextractors.LinkExtractor"
] | [((629, 652), 'example.items.CountryOrDistrictItem', 'CountryOrDistrictItem', ([], {}), '()\n', (650, 652), False, 'from example.items import CountryOrDistrictItem\n'), ((397, 442), 'scrapy.linkextractors.LinkExtractor', 'LinkExtractor', ([], {'allow': '"""/index/"""', 'deny': '"""/user/"""'}), "(allow='/index/', deny=... |
# This file is generated by wxPython's SIP generator. Do not edit by hand.
#
# Copyright: (c) 2018 by Total Control Software
# License: wxWindows License
"""
The ``wx.media`` module provides a widget class that allows displaying various
types of media, such as video and audio files and streaming, using nativ... | [
"wx.PyEventBinder"
] | [((532, 568), 'wx.PyEventBinder', 'wx.PyEventBinder', (['wxEVT_MEDIA_LOADED'], {}), '(wxEVT_MEDIA_LOADED)\n', (548, 568), False, 'import wx\n'), ((589, 623), 'wx.PyEventBinder', 'wx.PyEventBinder', (['wxEVT_MEDIA_STOP'], {}), '(wxEVT_MEDIA_STOP)\n', (605, 623), False, 'import wx\n'), ((648, 686), 'wx.PyEventBinder', 'w... |
from unittest import TestCase
from io import StringIO
import numpy as np
import pandas as pd
from skbio import TreeNode
from moonstone.analysis.diversity.beta import (
BrayCurtis, WeightedUniFrac, UnweightedUniFrac
)
class TestBrayCurtis(TestCase):
def setUp(self):
self.tested_object = pd.DataFrame... | [
"pandas.Series",
"moonstone.analysis.diversity.beta.WeightedUniFrac",
"moonstone.analysis.diversity.beta.UnweightedUniFrac",
"io.StringIO",
"pandas.DataFrame.from_dict",
"pandas.testing.assert_frame_equal",
"pandas.MultiIndex.from_tuples",
"moonstone.analysis.diversity.beta.BrayCurtis",
"pandas.test... | [((308, 492), 'pandas.DataFrame.from_dict', 'pd.DataFrame.from_dict', (["{'species1': [4, 4, 0], 'species2': [1, 0, 2], 'species3': [0, 0, 0],\n 'species4': [0, 3, 0]}"], {'orient': '"""index"""', 'columns': "['sample1', 'sample2', 'sample3']"}), "({'species1': [4, 4, 0], 'species2': [1, 0, 2],\n 'species3': [0, ... |
"""
Build service item action for AWS Elastic File System blueprint.
"""
from common.methods import set_progress
from infrastructure.models import CustomField
from infrastructure.models import Environment
from django.db import IntegrityError
import boto3
import uuid
def generate_options_for_env_id(server=None, **kwar... | [
"boto3.client",
"infrastructure.models.CustomField.objects.get_or_create",
"common.methods.set_progress",
"uuid.uuid4",
"infrastructure.models.Environment.objects.filter",
"infrastructure.models.Environment.objects.get"
] | [((336, 434), 'infrastructure.models.Environment.objects.filter', 'Environment.objects.filter', ([], {'resource_handler__resource_technology__name': '"""Amazon Web Services"""'}), "(resource_handler__resource_technology__name=\n 'Amazon Web Services')\n", (362, 434), False, 'from infrastructure.models import Environ... |
import machine
import tinkerlib
led = machine.Pin(5, machine.Pin.OUT)
led_state = 0
def toggle_led():
global led_state
if led_state == 0:
led.on()
print("Blink")
led_state = 1
else:
led.off()
led_state = 0
def main():
print("Hello world")
def infrequent():
... | [
"tinkerlib.repeat",
"tinkerlib.run",
"tinkerlib.repeat_every",
"machine.Pin",
"tinkerlib.initialize"
] | [((39, 70), 'machine.Pin', 'machine.Pin', (['(5)', 'machine.Pin.OUT'], {}), '(5, machine.Pin.OUT)\n', (50, 70), False, 'import machine\n'), ((375, 397), 'tinkerlib.initialize', 'tinkerlib.initialize', ([], {}), '()\n', (395, 397), False, 'import tinkerlib\n'), ((398, 423), 'tinkerlib.repeat', 'tinkerlib.repeat', (['mai... |
import fnmatch
import os
import datetime
import sys
from subprocess import Popen, PIPE
import zipfile
import skimage.io
import scipy.io.wavfile
import jsonlines
import torch
from setka.pipes.Pipe import Pipe
def get_process_output(command):
if not isinstance(command, (list, tuple)):
command = command.sp... | [
"os.path.exists",
"os.listdir",
"os.makedirs",
"subprocess.Popen",
"os.path.join",
"os.getcwd",
"fnmatch.fnmatch",
"os.path.relpath"
] | [((343, 382), 'subprocess.Popen', 'Popen', (['command'], {'stdout': 'PIPE', 'shell': '(True)'}), '(command, stdout=PIPE, shell=True)\n', (348, 382), False, 'from subprocess import Popen, PIPE\n'), ((736, 764), 'os.listdir', 'os.listdir', (['command_root_dir'], {}), '(command_root_dir)\n', (746, 764), False, 'import os\... |
# coding: utf-8
# In[175]:
#get_ipython().run_line_magic('matplotlib', 'inline')
import fragmenter
import json
import cmiles
import glob
# In[2]:
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(description="calculate OE WBO")
parser.add_argument('-i', '--infile', type=str, ... | [
"cmiles.utils.mol_to_map_ordered_qcschema",
"argparse.ArgumentParser",
"cmiles.utils.load_molecule",
"json.load",
"fragmenter.chemi.generate_conformers",
"json.dump"
] | [((212, 267), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""calculate OE WBO"""'}), "(description='calculate OE WBO')\n", (235, 267), False, 'import argparse\n'), ((708, 720), 'json.load', 'json.load', (['f'], {}), '(f)\n', (717, 720), False, 'import json\n'), ((1303, 1363), 'cmiles.uti... |
# -*- coding:UTF-8 -*-
import requests
import json
import time
import base64
import logging
import datetime
from kafka import KafkaConsumer, KafkaProducer
from kafka.errors import KafkaError
from apscheduler.schedulers.background import BlockingScheduler
from requests_toolbelt import MultipartEncoder
# pro... | [
"json.loads",
"kafka.KafkaProducer",
"json.dumps",
"time.localtime",
"logging.error"
] | [((547, 603), 'kafka.KafkaProducer', 'KafkaProducer', ([], {'bootstrap_servers': "['192.168.10.212:9092']"}), "(bootstrap_servers=['192.168.10.212:9092'])\n", (560, 603), False, 'from kafka import KafkaConsumer, KafkaProducer\n'), ((1136, 1161), 'json.loads', 'json.loads', (['response.text'], {}), '(response.text)\n', ... |
from nintendo.nex import backend, authentication, friends, nintendo_notification
from nintendo import account
#Device id can be retrieved with a call to MCP_GetDeviceId on the Wii U
#Serial number can be found on the back of the Wii U
DEVICE_ID = 12345678
SERIAL_NUMBER = "..."
SYSTEM_VERSION = 0x220
REGION = 4 #EUR
C... | [
"nintendo.nex.authentication.NintendoLoginData",
"nintendo.nex.backend.Settings",
"nintendo.nex.backend.connect",
"nintendo.account.AccountAPI",
"nintendo.nex.backend.close"
] | [((1564, 1584), 'nintendo.account.AccountAPI', 'account.AccountAPI', ([], {}), '()\n', (1582, 1584), False, 'from nintendo import account\n'), ((1980, 2027), 'nintendo.nex.backend.connect', 'backend.connect', (['nex_token.host', 'nex_token.port'], {}), '(nex_token.host, nex_token.port)\n', (1995, 2027), False, 'from ni... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2013-2014 Telefónica Investigación y Desarrollo S.A.U.
#
# 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... | [
"mock.patch",
"cosmos.cli.tests.mock_home_dir.mock_home",
"cosmos.common.tests.util.mock_response",
"cosmos.common.tests.util.collect_outputs",
"cosmos.cli.ssh.ssh_cluster",
"mock.MagicMock",
"os.path.expanduser"
] | [((1271, 1282), 'mock.MagicMock', 'MagicMock', ([], {}), '()\n', (1280, 1282), False, 'from mock import MagicMock, patch\n'), ((1949, 1979), 'cosmos.common.tests.util.mock_response', 'mock_response', ([], {'status_code': '(404)'}), '(status_code=404)\n', (1962, 1979), False, 'from cosmos.common.tests.util import collec... |
import asyncio
import os
import typing
from cgi import parse_header
from collections import namedtuple
from tempfile import SpooledTemporaryFile
from urllib.parse import SplitResult, parse_qsl, urlencode, urlsplit
from .typing import Environ, Scope
__all__ = [
"Address",
"MediaType",
"ContentType",
"U... | [
"collections.namedtuple",
"urllib.parse.urlsplit",
"cgi.parse_header",
"tempfile.SpooledTemporaryFile",
"urllib.parse.urlencode",
"urllib.parse.parse_qsl",
"asyncio.get_event_loop",
"typing.TypeVar"
] | [((470, 489), 'typing.TypeVar', 'typing.TypeVar', (['"""T"""'], {}), "('T')\n", (484, 489), False, 'import typing\n'), ((508, 528), 'typing.TypeVar', 'typing.TypeVar', (['"""KT"""'], {}), "('KT')\n", (522, 528), False, 'import typing\n'), ((547, 567), 'typing.TypeVar', 'typing.TypeVar', (['"""VT"""'], {}), "('VT')\n", ... |
# Copyright 2019 The Texar Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | [
"torch.utils.data.dataloader.pin_memory_batch",
"texar.torch.utils.utils.map_structure",
"torch.randperm",
"torch.randint",
"pkg_resources.parse_version",
"torch.utils.data.sampler.RandomSampler",
"texar.torch.utils.utils.ceildiv",
"typing.TypeVar"
] | [((1243, 1286), 'pkg_resources.parse_version', 'pkg_resources.parse_version', (['_torch_version'], {}), '(_torch_version)\n', (1270, 1286), False, 'import pkg_resources\n'), ((1532, 1550), 'typing.TypeVar', 'TypeVar', (['"""Example"""'], {}), "('Example')\n", (1539, 1550), False, 'from typing import Any, Callable, Dict... |
from django import forms
from tally_ho.libs.permissions import groups
from tally_ho.apps.tally.models.tally import Tally
from tally_ho.apps.tally.models.user_profile import UserProfile
from tally_ho.libs.utils.form import lower_case_form_data
disable_copy_input = {
'onCopy': 'return false;',
'onDrag': 'retur... | [
"tally_ho.apps.tally.models.user_profile.UserProfile.objects.filter",
"django.forms.ModelForm.save",
"tally_ho.libs.utils.form.lower_case_form_data",
"django.forms.CheckboxSelectMultiple"
] | [((1325, 1351), 'django.forms.ModelForm.save', 'forms.ModelForm.save', (['self'], {}), '(self)\n', (1345, 1351), False, 'from django import forms\n'), ((631, 705), 'tally_ho.apps.tally.models.user_profile.UserProfile.objects.filter', 'UserProfile.objects.filter', ([], {'groups__name__exact': 'groups.SUPER_ADMINISTRATOR... |
# -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
import xlrd
import xlwt
output=xlwt.Workbook()
data =xlrd.open_workbook(r'smd_hourly_ME_2014-16.xlsx')
names=data.sheet_names()
for index in range(0,len(names)):
outputsheet=output.add_sheet('%s1'%names[index])
table =data.shee... | [
"xlrd.open_workbook",
"xlwt.Workbook"
] | [((114, 129), 'xlwt.Workbook', 'xlwt.Workbook', ([], {}), '()\n', (127, 129), False, 'import xlwt\n'), ((138, 186), 'xlrd.open_workbook', 'xlrd.open_workbook', (['"""smd_hourly_ME_2014-16.xlsx"""'], {}), "('smd_hourly_ME_2014-16.xlsx')\n", (156, 186), False, 'import xlrd\n')] |
import psycopg2
import sqlite3
import pandas as pd
conn = sqlite3.connect('titanic.sqlite3')
curs = conn.cursor()
curs.execute('CREATE TABLE titanic (Survived, Pclass, Name, Sex, Age, Siblings_Spouses_Aboard, Parents_Children_Aboard, Fare)')
conn.commit()
df = pd.read_csv('/Users/bradbrauser/unit3/DS-Unit-3-Sprin... | [
"sqlite3.connect",
"pandas.read_csv"
] | [((60, 94), 'sqlite3.connect', 'sqlite3.connect', (['"""titanic.sqlite3"""'], {}), "('titanic.sqlite3')\n", (75, 94), False, 'import sqlite3\n'), ((267, 390), 'pandas.read_csv', 'pd.read_csv', (['"""/Users/bradbrauser/unit3/DS-Unit-3-Sprint-2-SQL-and-Databases/module2-sql-for-analysis/titanic.csv"""'], {}), "(\n '/U... |
# HDF5DatasetGenerator.py
import h5py
import numpy as np
from tensorflow.keras.utils import to_categorical
class HDF5DatasetGenerator:
'''
Use to generate a dataset for use withing keras framework
form a HDF5 file.
'''
def __init__(self, dbPath, batchSize, preprocessors = None,
aug = None... | [
"numpy.array",
"tensorflow.keras.utils.to_categorical",
"numpy.arange",
"h5py.File"
] | [((848, 865), 'h5py.File', 'h5py.File', (['dbPath'], {}), '(dbPath)\n', (857, 865), False, 'import h5py\n'), ((1233, 1277), 'numpy.arange', 'np.arange', (['(0)', 'self.numImages', 'self.batchSize'], {}), '(0, self.numImages, self.batchSize)\n', (1242, 1277), True, 'import numpy as np\n'), ((1610, 1646), 'tensorflow.ker... |
from ometa.interp import decomposeGrammar
from twisted.trial.unittest import TestCase
from ometa.grammar import OMeta
from parsley import makeGrammar
from interp2.compiler import Compiler, successExits
from interp2.matchers import anything, exact, Node, setRule, backtrack, setName, digit, noop, many
from interp2.inter... | [
"interp2.compiler.successExits",
"interp2.matchers.Node",
"interp2.interp.Interp",
"interp2.compiler.Compiler",
"interp2.matchers.setRule"
] | [((436, 452), 'interp2.compiler.Compiler', 'Compiler', (['source'], {}), '(source)\n', (444, 452), False, 'from interp2.compiler import Compiler, successExits\n'), ((1471, 1494), 'interp2.interp.Interp', 'Interp', (['parseTree', 'None'], {}), '(parseTree, None)\n', (1477, 1494), False, 'from interp2.interp import Inter... |
from django.db import models
class GlobalSetting(models.Model):
"""
A global setting is a key-value setting which can be set for a
pretix instance. It will be inherited by all events and organizers.
It is filled via the register_global_settings signal.
"""
key = models.CharField(max_length=255... | [
"django.db.models.TextField",
"django.db.models.CharField",
"django.db.models.ForeignKey"
] | [((289, 339), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(255)', 'primary_key': '(True)'}), '(max_length=255, primary_key=True)\n', (305, 339), False, 'from django.db import models\n'), ((352, 370), 'django.db.models.TextField', 'models.TextField', ([], {}), '()\n', (368, 370), False, 'from ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: vgg_model.py
import tensorflow as tf
from tensorflow.contrib.layers import variance_scaling_initializer
from tensorpack.models import *
from tensorpack.tfutils.argscope import argscope, get_arg_scope
from learned_quantization import Conv2DQuant, getBNReLUQuant, ge... | [
"tensorflow.contrib.layers.variance_scaling_initializer",
"tensorpack.tfutils.argscope.get_arg_scope"
] | [((469, 512), 'tensorflow.contrib.layers.variance_scaling_initializer', 'variance_scaling_initializer', ([], {'mode': '"""FAN_IN"""'}), "(mode='FAN_IN')\n", (497, 512), False, 'from tensorflow.contrib.layers import variance_scaling_initializer\n'), ((2144, 2187), 'tensorflow.contrib.layers.variance_scaling_initializer'... |
import sys
import traceback
from nextcord import logging
from nextcord.ext.commands import errors
from modules.error_logging import error_constants
from datetime import datetime
# Big thanks to denvercoder1 and his professor-vector-discord-bot repo
# https://github.com/DenverCoder1/professor-vector-discord-bot
class ... | [
"traceback.format_exc",
"datetime.datetime.now",
"nextcord.logging.warning"
] | [((639, 661), 'traceback.format_exc', 'traceback.format_exc', ([], {}), '()\n', (659, 661), False, 'import traceback\n'), ((1004, 1034), 'nextcord.logging.warning', 'logging.warning', (['error_details'], {}), '(error_details)\n', (1019, 1034), False, 'from nextcord import logging\n'), ((4378, 4392), 'datetime.datetime.... |
# -*- coding: utf-8 -*-
"""
Created on Sun May 10 09:59:15 2020
@author: <NAME>
"""
import os
import pandas as pd
import numpy as np
out = open("./res.txt", 'w+')
#%% 读取生成式 @表示为空
generator = {}
start = None #开始符号
ter_set = set() #终结符集合
non_set = set() #非终结符集合
all_set = set()
#grammar2
f = open('./tiny.txt')
for ... | [
"pandas.DataFrame",
"numpy.isnan"
] | [((4096, 4142), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': 'ter_list', 'index': 'non_list'}), '(columns=ter_list, index=non_list)\n', (4108, 4142), True, 'import pandas as pd\n'), ((5743, 5788), 'numpy.isnan', 'np.isnan', (['ll1_table.loc[stack[-1], tokens[0]]'], {}), '(ll1_table.loc[stack[-1], tokens[0]])\n'... |
from ..common.trex_api_annotators import client_api, plugin_api
from ..common.trex_ctx import TRexCtx
from ..common.trex_exceptions import *
from ..common.trex_logger import ScreenLogger
from ..common.trex_types import *
from ..utils import parsing_opts, text_tables
from ..utils.common import *
from ..utils.text_opts i... | [
"yaml.safe_dump",
"inspect.getmembers",
"inspect.ismethod",
"imp.load_source",
"os.path.join",
"time.sleep",
"os.path.dirname",
"os.path.basename",
"sys.stdout.flush",
"time.time",
"sys.stdout.write"
] | [((1269, 1280), 'time.time', 'time.time', ([], {}), '()\n', (1278, 1280), False, 'import time\n'), ((45149, 45160), 'time.time', 'time.time', ([], {}), '()\n', (45158, 45160), False, 'import time\n'), ((46519, 46530), 'time.time', 'time.time', ([], {}), '()\n', (46528, 46530), False, 'import time\n'), ((64096, 64121), ... |
# coding=utf-8
# Copyright 2022 DataLab Authors and the current dataset script contributor.
#
# 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
#
# Unless required by applicable law or agreed to ... | [
"datalabs.Value",
"datalabs.SplitGenerator",
"datalabs.get_task",
"datalabs.features.ClassLabel",
"csv.reader"
] | [((2851, 2942), 'datalabs.SplitGenerator', 'datalabs.SplitGenerator', ([], {'name': 'datalabs.Split.TRAIN', 'gen_kwargs': "{'filepath': train_path}"}), "(name=datalabs.Split.TRAIN, gen_kwargs={'filepath':\n train_path})\n", (2874, 2942), False, 'import datalabs\n'), ((2952, 3041), 'datalabs.SplitGenerator', 'datalab... |
#!/usr/bin/env python3
import io
import pwncat.manager
def test_config_fileobj():
configuration = io.StringIO(
"""
set -g db "memory://"
set -g prefix c-k
set -g on_load { }
set -g backdoor_user "config_test"
"""
)
with pwncat.manager.Manager(config=configuration) as manager:
asser... | [
"os.chdir",
"io.StringIO",
"os.environ.get"
] | [((106, 235), 'io.StringIO', 'io.StringIO', (['"""\nset -g db "memory://"\nset -g prefix c-k\nset -g on_load { }\nset -g backdoor_user "config_test"\n """'], {}), '(\n """\nset -g db "memory://"\nset -g prefix c-k\nset -g on_load { }\nset -g backdoor_user "config_test"\n """\n )\n', (117, 235), False, 'im... |
# Copyright 2019 DeepMind Technologies 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 agr... | [
"numpy.prod",
"tensorflow.compat.v1.ones_like",
"horovod.tensorflow.rank",
"horovod.tensorflow.broadcast_global_variables",
"numpy.array",
"tensorflow.compat.v1.losses.mean_squared_error",
"tensorflow.compat.v1.device",
"tensorflow.compat.v1.nn.l2_loss",
"horovod.tensorflow.local_rank",
"tensorflo... | [((917, 963), 'functools.partial', 'functools.partial', (['tfkl.Conv2D'], {'padding': '"""same"""'}), "(tfkl.Conv2D, padding='same')\n", (934, 963), False, 'import functools\n'), ((2057, 2133), 'collections.namedtuple', 'collections.namedtuple', (['"""TrainInput"""', '"""observation legals_mask policy value"""'], {}), ... |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (C) 2019 <NAME> @ The University of Texas at Austin.
# All rights reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# ----------------------------------------------------... | [
"vispy.scene.SceneCanvas.__init__",
"vispy.gloo.util._screenshot",
"vispy.io.write_png",
"vispy.scene.cameras.TurntableCamera"
] | [((1237, 1334), 'vispy.scene.SceneCanvas.__init__', 'scene.SceneCanvas.__init__', (['self'], {'title': 'title', 'keys': '"""interactive"""', 'size': 'size', 'bgcolor': 'bgcolor'}), "(self, title=title, keys='interactive', size=size,\n bgcolor=bgcolor)\n", (1263, 1334), False, 'from vispy import scene, io\n'), ((1869... |
from __future__ import print_function
import sys
import os
from glob import glob
import shutil
try:
import setuptools
except ImportError:
sys.stderr.write(
"Please install setuptools before running this script. Exiting.")
sys.exit(1)
from setuptools import setup, find_packages
# --------------------... | [
"setuptools.find_packages",
"setuptools.setup",
"os.path.join",
"shutil.rmtree",
"sys.stderr.write",
"sys.exit"
] | [((1536, 1587), 'shutil.rmtree', 'shutil.rmtree', (['"""BGWpy.egg-info"""'], {'ignore_errors': '(True)'}), "('BGWpy.egg-info', ignore_errors=True)\n", (1549, 1587), False, 'import shutil\n'), ((1592, 1634), 'shutil.rmtree', 'shutil.rmtree', (['"""build"""'], {'ignore_errors': '(True)'}), "('build', ignore_errors=True)\... |
import pytest
# from django.urls import reverse
from pages.models import Carousel, Contact, Subscribe
@pytest.mark.django_db
def test_subscribe_create():
subscribe = Subscribe.objects.create(
email_id="<EMAIL>",
)
assert subscribe.email_id == "<EMAIL>"
@pytest.mark.django_db
def test_carousel_c... | [
"pages.models.Subscribe.objects.create",
"pages.models.Carousel.objects.create",
"pages.models.Contact.objects.create"
] | [((173, 217), 'pages.models.Subscribe.objects.create', 'Subscribe.objects.create', ([], {'email_id': '"""<EMAIL>"""'}), "(email_id='<EMAIL>')\n", (197, 217), False, 'from pages.models import Carousel, Contact, Subscribe\n'), ((344, 387), 'pages.models.Carousel.objects.create', 'Carousel.objects.create', ([], {'title': ... |
#!/usr/bin/env python
"""
Test module for level set transport
"""
from __future__ import print_function
from builtins import range
from builtins import object
from proteus.iproteus import *
import os
import numpy as np
import tables
class TestRotation2D(object):
@classmethod
def setup_class(cls):
pass... | [
"os.path.exists",
"os.path.join",
"tables.open_file",
"numpy.array",
"os.path.abspath",
"os.remove"
] | [((2853, 2906), 'tables.open_file', 'tables.open_file', (["(ls_rotation_2d_so.name + '.h5')", '"""r"""'], {}), "(ls_rotation_2d_so.name + '.h5', 'r')\n", (2869, 2906), False, 'import tables\n'), ((484, 509), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (499, 509), False, 'import os\n'), ((5... |
import pandas as pd
import requests
import re
import os
from yaml import safe_load, dump
from bs4 import BeautifulSoup as bs
import random
import numpy as np
def get_mapping_dicts(path_to_yaml, url):
"""
Loads dictionaries for the gap filling and mapping of column names
from locally stored .yaml files. Re... | [
"os.path.exists",
"pandas.read_csv",
"re.compile",
"os.makedirs",
"os.path.join",
"requests.get",
"bs4.BeautifulSoup",
"yaml.safe_load",
"re.sub",
"random.random",
"random.randint"
] | [((1585, 1602), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (1597, 1602), False, 'import requests\n'), ((1614, 1642), 'bs4.BeautifulSoup', 'bs', (['page.text', '"""html.parser"""'], {}), "(page.text, 'html.parser')\n", (1616, 1642), True, 'from bs4 import BeautifulSoup as bs\n'), ((932, 947), 'yaml.safe_l... |
import re
from collections import namedtuple
from copy import copy
from difflib import SequenceMatcher
from pprint import pformat
from bs4 import BeautifulSoup
from bs4 import NavigableString
from bs4 import Tag
logger = None
def restore_refs(old_content: str,
new_content: str,
re... | [
"collections.namedtuple",
"re.compile",
"difflib.SequenceMatcher",
"pprint.pformat",
"bs4.BeautifulSoup",
"bs4.NavigableString",
"copy.copy",
"bs4.Tag"
] | [((722, 763), 'bs4.BeautifulSoup', 'BeautifulSoup', (['old_content', '"""html.parser"""'], {}), "(old_content, 'html.parser')\n", (735, 763), False, 'from bs4 import BeautifulSoup\n'), ((777, 818), 'bs4.BeautifulSoup', 'BeautifulSoup', (['new_content', '"""html.parser"""'], {}), "(new_content, 'html.parser')\n", (790, ... |
#!/usr/bin/env python
# Copyright (c) 2019 Computer Vision Center (CVC) at the Universitat Autonoma de
# Barcelona (UAB).
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
"""
Configure and inspect an instance of CARLA Simulator.
For further detail... | [
"os.path.exists",
"socket.socket",
"argparse.ArgumentParser",
"re.match",
"carla.Client",
"os.path.basename",
"textwrap.wrap",
"sys.exit",
"carla.OpendriveGenerationParameters",
"glob.glob"
] | [((3611, 3655), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '__doc__'}), '(description=__doc__)\n', (3634, 3655), False, 'import argparse\n'), ((5894, 5946), 'carla.Client', 'carla.Client', (['args.host', 'args.port'], {'worker_threads': '(1)'}), '(args.host, args.port, worker_threads=1)\... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache Licens... | [
"logging.getLogger",
"logging.basicConfig",
"collections.OrderedDict",
"json.loads",
"json.dumps",
"os.environ.get",
"uuid.uuid1",
"os.path.realpath",
"os.path.isfile"
] | [((1084, 1111), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1101, 1111), False, 'import logging\n'), ((5663, 5698), 'os.environ.get', 'os.environ.get', (['"""SERVICE_DIR"""', 'None'], {}), "('SERVICE_DIR', None)\n", (5677, 5698), False, 'import os\n'), ((5718, 5784), 'os.environ.get',... |
import collections
import functools
from typing import Any, Dict, Callable, Sequence, Tuple, Optional
import numpy as np
import jax
from jax import numpy as jnp
from flax import struct
import optax
from daves_rl_lib import networks
def rollout_scan_body(learner, step, step_fn):
(_, learner, diagnostics) = ste... | [
"jax.numpy.where",
"jax.numpy.arange",
"jax.tree_util.tree_map",
"jax.numpy.ones_like",
"functools.partial"
] | [((509, 562), 'functools.partial', 'functools.partial', (['rollout_scan_body'], {'step_fn': 'step_fn'}), '(rollout_scan_body, step_fn=step_fn)\n', (526, 562), False, 'import functools\n'), ((676, 711), 'jax.numpy.arange', 'jnp.arange', (['rollout.reward.shape[0]'], {}), '(rollout.reward.shape[0])\n', (686, 711), True, ... |
from sys import stderr
from os.path import join, curdir
import parser
import globals
import application
reload(parser)
reload(application)
def main(app_name):
app_path = join(curdir, app_name)
xml_path = join(app_path, 'view.xml')
views = parser.parse_xml(xml_path)
try:
globals.app = __import... | [
"application.Application",
"parser.parse_xml",
"os.path.join",
"sys.stderr.write"
] | [((176, 198), 'os.path.join', 'join', (['curdir', 'app_name'], {}), '(curdir, app_name)\n', (180, 198), False, 'from os.path import join, curdir\n'), ((214, 240), 'os.path.join', 'join', (['app_path', '"""view.xml"""'], {}), "(app_path, 'view.xml')\n", (218, 240), False, 'from os.path import join, curdir\n'), ((254, 28... |
#!/usr/bin/env python
# coding: utf-8
from setuptools import setup, Command, find_packages
from pip._internal.req import parse_requirements
import os
install_reqs = parse_requirements('requirements.txt', session='hack')
requires = [str(ir.req) for ir in install_reqs]
class PublishCommand(Command):
user_options:... | [
"pip._internal.req.parse_requirements",
"os.system"
] | [((167, 221), 'pip._internal.req.parse_requirements', 'parse_requirements', (['"""requirements.txt"""'], {'session': '"""hack"""'}), "('requirements.txt', session='hack')\n", (185, 221), False, 'from pip._internal.req import parse_requirements\n'), ((453, 478), 'os.system', 'os.system', (['"""rm -rf dist/"""'], {}), "(... |
import random
import math
from DataGenUtil import *
from faker import Faker
GENDER = ['Male','Female']
BOOLEAN = [True, False]
SCHOOL_YEARS = ['2021','2022','2023','2024','2025']
CITIES = ['Seattle','San Francisco','San Diego','Philadelphia','Chicago','Houston','New York','Los Angeles']
GRADE_LEVEL = ['01','02','03','... | [
"faker.Faker",
"faker.Faker.seed",
"random.choice",
"random.choices"
] | [((1393, 1407), 'faker.Faker', 'Faker', (['"""en_US"""'], {}), "('en_US')\n", (1398, 1407), False, 'from faker import Faker\n'), ((1416, 1429), 'faker.Faker.seed', 'Faker.seed', (['(1)'], {}), '(1)\n', (1426, 1429), False, 'from faker import Faker\n'), ((4916, 4937), 'random.choice', 'random.choice', (['GENDER'], {}), ... |
"""
Component to retrieve uptime for Home Assistant.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.uptime/
"""
import asyncio
import logging
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
import homeassistant.util... | [
"logging.getLogger",
"voluptuous.Optional",
"homeassistant.util.dt.now",
"voluptuous.In"
] | [((529, 556), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (546, 556), False, 'import logging\n'), ((630, 675), 'voluptuous.Optional', 'vol.Optional', (['CONF_NAME'], {'default': 'DEFAULT_NAME'}), '(CONF_NAME, default=DEFAULT_NAME)\n', (642, 675), True, 'import voluptuous as vol\n'), ((... |
import pytest
from redis.exceptions import RedisError
from rq.exceptions import NoSuchJobError
from busy_beaver.models import Task, PostGitHubSummaryTask, PostTweetTask
MODULE_TO_TEST = "busy_beaver.models.task"
###########
# Base Task
###########
def test_create_task(session):
# Arrange
task = Task(
... | [
"pytest.mark.parametrize",
"busy_beaver.models.PostTweetTask",
"busy_beaver.models.PostGitHubSummaryTask",
"busy_beaver.models.Task"
] | [((1532, 1598), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""raise_exc"""', '[RedisError, NoSuchJobError]'], {}), "('raise_exc', [RedisError, NoSuchJobError])\n", (1555, 1598), False, 'import pytest\n'), ((308, 411), 'busy_beaver.models.Task', 'Task', ([], {'job_id': '"""abcd"""', 'name': '"""task_create... |
from django.urls import reverse
from netaddr import IPNetwork
from rest_framework import status
from dcim.constants import IFACE_FF_VIRTUAL, IFACE_MODE_TAGGED
from dcim.models import Interface
from ipam.models import IPAddress, VLAN
from utilities.testing import APITestCase
from virtualization.models import Cluster, C... | [
"dcim.models.Interface.objects.create",
"virtualization.models.VirtualMachine.objects.create",
"virtualization.models.Cluster.objects.get",
"virtualization.models.ClusterGroup.objects.first",
"django.urls.reverse",
"virtualization.models.ClusterGroup.objects.count",
"netaddr.IPNetwork",
"virtualizatio... | [((475, 562), 'virtualization.models.ClusterType.objects.create', 'ClusterType.objects.create', ([], {'name': '"""Test Cluster Type 1"""', 'slug': '"""test-cluster-type-1"""'}), "(name='Test Cluster Type 1', slug=\n 'test-cluster-type-1')\n", (501, 562), False, 'from virtualization.models import Cluster, ClusterGrou... |
import pytest
from iexfinance.base import _IEXBase
from iexfinance.stocks import Stock
from iexfinance.utils.exceptions import (IEXAuthenticationError)
class TestAuth(object):
def test_cloud_fails_no_token(self, block_keys):
with pytest.raises(IEXAuthenticationError):
_IEXBase()
def tes... | [
"pytest.raises",
"iexfinance.stocks.Stock",
"iexfinance.base._IEXBase"
] | [((361, 371), 'iexfinance.base._IEXBase', '_IEXBase', ([], {}), '()\n', (369, 371), False, 'from iexfinance.base import _IEXBase\n'), ((465, 493), 'iexfinance.base._IEXBase', '_IEXBase', ([], {'token': '"""<PASSWORD>"""'}), "(token='<PASSWORD>')\n", (473, 493), False, 'from iexfinance.base import _IEXBase\n'), ((246, 2... |
# License MIT
# Copyright 2019 <NAME>
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribu... | [
"qrcode.QRCode"
] | [((3286, 3424), 'qrcode.QRCode', 'qrcode.QRCode', ([], {'version': 'version', 'error_correction': 'qrcode.constants.ERROR_CORRECT_H', 'box_size': 'box_size', 'border': '(4)', 'image_factory': 'factory'}), '(version=version, error_correction=qrcode.constants.\n ERROR_CORRECT_H, box_size=box_size, border=4, image_fact... |
# -*- coding: utf-8 -*-
# Copyright 2015 Cray Inc.
# (C) Copyright 2015,2017 Hewlett Packard Enterprise Development LP
# Copyright 2016-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 t... | [
"mock.Mock",
"monasca_api.v2.reference.alarms.AlarmsCount",
"monasca_api.common.repositories.model.sub_alarm_definition.SubAlarmDefinition",
"copy.deepcopy",
"monasca_api.v2.reference.alarms.AlarmsStateHistory",
"datetime.datetime",
"monasca_api.v2.reference.alarm_definitions.get_query_alarm_definition_... | [((1290, 2123), 'collections.OrderedDict', 'OrderedDict', (["((u'time', u'2015-01-01T00:00:00.000Z'), (u'timestamp',\n u'2015-01-01T00:00:00.000Z'), (u'alarm_id',\n u'10000000-1000-1000-1000-10000000000'), (u'metrics', [{u'id': None,\n u'name': u'test.metric', u'dimensions': {u'dim1': u'dval1', u'dim2':\n u... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# http://ginstrom.com/scribbles/2007/10/08/design-patterns-python-style/
"""Implementation of the abstract factory pattern"""
import random
class PetShop:
"""A pet shop"""
def __init__(self, animal_factory=None):
"""pet_factory is our abstract factory... | [
"random.choice"
] | [((1274, 1313), 'random.choice', 'random.choice', (['[DogFactory, CatFactory]'], {}), '([DogFactory, CatFactory])\n', (1287, 1313), False, 'import random\n')] |
# ----------------------------------------------------------------------
# |
# | StreamDecorator.py
# |
# | <NAME> <<EMAIL>>
# | 2018-05-05 11:46:08
# |
# ----------------------------------------------------------------------
# |
# | Copyright <NAME> 2018-22.
# | Distributed under the Boost Software ... | [
"CommonEnvironment.Nonlocals",
"traceback.format_exc",
"colorama.initialise.reinit",
"re.compile",
"CommonEnvironment.CallOnExit.CallOnExit",
"colorama.ansitowin32.AnsiToWin32",
"os.path.split",
"datetime.timedelta",
"sys.exc_info",
"colorama.initialise.wrap_stream",
"CommonEnvironment.ThisFullp... | [((930, 962), 'CommonEnvironment.ThisFullpath', 'CommonEnvironment.ThisFullpath', ([], {}), '()\n', (960, 962), False, 'import CommonEnvironment\n'), ((992, 1023), 'os.path.split', 'os.path.split', (['_script_fullpath'], {}), '(_script_fullpath)\n', (1005, 1023), False, 'import os\n'), ((29781, 29811), 're.compile', 'r... |
# 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
# distrib... | [
"logging.getLogger",
"osc_lib.exceptions.CommandError",
"openstackclient.identity.common.find_project",
"openstackclient.identity.common.add_project_domain_option_to_parser",
"osc_lib.utils.get_item_properties",
"openstackclient.i18n._",
"osc_lib.utils.get_osc_show_columns_for_sdk_resource"
] | [((868, 895), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (885, 895), False, 'import logging\n'), ((1058, 1135), 'osc_lib.utils.get_osc_show_columns_for_sdk_resource', 'utils.get_osc_show_columns_for_sdk_resource', (['item', 'column_map', 'hidden_columns'], {}), '(item, column_map, hid... |
import pathlib
from setuptools import setup
HERE = pathlib.Path(__file__).parent
README = (HERE / "README.md").read_text()
setup(
name="easyTX",
version="2.0",
description="Module to exchange data in any form (video or string) from one PC to another over the same network.",
long_description=README,
... | [
"setuptools.setup",
"pathlib.Path"
] | [((126, 714), 'setuptools.setup', 'setup', ([], {'name': '"""easyTX"""', 'version': '"""2.0"""', 'description': '"""Module to exchange data in any form (video or string) from one PC to another over the same network."""', 'long_description': 'README', 'long_description_content_type': '"""text/markdown"""', 'url': '"""ht... |
# This file is MACHINE GENERATED! Do not edit.
# Generated by: tensorflow/python/tools/api/generator/create_python_api.py script.
"""Public API for tf.saved_model.experimental namespace.
"""
from __future__ import print_function as _print_function
from tensorflow.python.saved_model.save import save
del _print_functi... | [
"tensorflow.python.util.deprecation_wrapper.DeprecationWrapper"
] | [((534, 629), 'tensorflow.python.util.deprecation_wrapper.DeprecationWrapper', '_deprecation_wrapper.DeprecationWrapper', (['_sys.modules[__name__]', '"""saved_model.experimental"""'], {}), "(_sys.modules[__name__],\n 'saved_model.experimental')\n", (573, 629), True, 'from tensorflow.python.util import deprecation_w... |
__all__ = ['PythonInfoPanel']
from kivy.uix.tabbedpanel import TabbedPanelItem
from kivy.properties import StringProperty, ObjectProperty
from kivy.clock import Clock
from kivy.lang import Builder
from ncis_inspector.controller import ctl
import json
Builder.load_string('''
<PythonInfoPanel>:
text: 'python info'... | [
"kivy.lang.Builder.load_string",
"ncis_inspector.controller.ctl.request",
"json.dumps",
"kivy.clock.Clock.schedule_interval",
"kivy.properties.StringProperty",
"kivy.properties.ObjectProperty"
] | [((254, 397), 'kivy.lang.Builder.load_string', 'Builder.load_string', (['"""\n<PythonInfoPanel>:\n text: \'python info\'\n TextInput:\n readonly: True\n text: root.info\n"""'], {}), '(\n """\n<PythonInfoPanel>:\n text: \'python info\'\n TextInput:\n readonly: True\n text: root... |
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 12 00:00:00 2021
@author: <NAME>
contact: athouvenin [at] outlook.com
"""
import requests
import json
import re
# api_url = "https://www.vinted.fr/api/v2/items?search_text=&catalog_ids=&color_ids=&brand_ids=&size_ids=&material_ids=&status_ids=&country_ids=&city_ids=&is_... | [
"re.findall",
"json.dump",
"json.loads",
"requests.get"
] | [((20678, 20721), 'requests.get', 'requests.get', (['url_search'], {'params': 'url_params'}), '(url_search, params=url_params)\n', (20690, 20721), False, 'import requests\n'), ((7738, 7823), 're.findall', 're.findall', (['"""({\\\\"id\\\\":[0-9]+,\\\\"title\\\\":\\\\"[^\\\\"]+\\\\",\\\\"slug\\\\":[^}]+})"""', 'req'], {... |
from functools import cached_property
from loguru import logger
from .filecollection import FileCollection
from .trackercollection import TrackerCollection
class Torrent(object):
def __init__(self, host, dictionary, *args, **kwargs):
super().__init__(*args, **kwargs)
self.host = host
sel... | [
"loguru.logger.info"
] | [((1412, 1442), 'loguru.logger.info', 'logger.info', (['"""Forcing Recheck"""'], {}), "('Forcing Recheck')\n", (1423, 1442), False, 'from loguru import logger\n')] |
"""
Provide implementation of transaction.
"""
import os
from eosiopy.eosioparams import EosioParams
from eosiopy.nodenetwork import NodeNetwork
from eosiopy.rawinputparams import RawinputParams
from eosiopy import eosio_config
MASTER_WALLET_PRIVATE_KEY = os.environ.get('MASTER_WALLET_PRIVATE_KEY')
NODEOS_HOST = os.e... | [
"eosiopy.nodenetwork.NodeNetwork.push_transaction",
"eosiopy.rawinputparams.RawinputParams",
"os.environ.get",
"eosiopy.eosioparams.EosioParams"
] | [((258, 301), 'os.environ.get', 'os.environ.get', (['"""MASTER_WALLET_PRIVATE_KEY"""'], {}), "('MASTER_WALLET_PRIVATE_KEY')\n", (272, 301), False, 'import os\n'), ((316, 345), 'os.environ.get', 'os.environ.get', (['"""NODEOS_HOST"""'], {}), "('NODEOS_HOST')\n", (330, 345), False, 'import os\n'), ((360, 389), 'os.enviro... |