code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
# Generated by Django 2.0.4 on 2018-10-26 16:09
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('common', '0003_lab_member_position'),
]
operations = [
migrations.AddField(
model_name='lab_member',
name='trainees'... | [
"django.db.models.BooleanField"
] | [((340, 405), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'default': '(False)', 'verbose_name': '"""Other Trainees"""'}), "(default=False, verbose_name='Other Trainees')\n", (359, 405), False, 'from django.db import migrations, models\n')] |
import collections, gzip, unittest
from six.moves import cStringIO as StringIO
def assertEqualToFile(
tc, objs, filename, update=False, checker=unittest.TestCase.assertEqual
):
'''
Compare an object or objects against a golden file.
Parameters:
-----------
``objs``
An object or sequence of obj... | [
"six.moves.cStringIO"
] | [((608, 618), 'six.moves.cStringIO', 'StringIO', ([], {}), '()\n', (616, 618), True, 'from six.moves import cStringIO as StringIO\n')] |
"""Gene to MPO Features V0.2
=== TCAG Summer Project 2018 ===
<NAME>
BCB330Y1
University of Toronto
=== Module Description ===
Given a certain human entrez ID, this module will return MPO features
This module also supports lookups with multiple human entrez IDs
"""
from typing import Dict, Tuple, List, Optional
impo... | [
"csv.reader",
"linecache.getline"
] | [((1573, 1610), 'csv.reader', 'csv.reader', (['file'], {'delimiter': 'delimiter'}), '(file, delimiter=delimiter)\n', (1583, 1610), False, 'import csv\n'), ((4063, 4105), 'linecache.getline', 'linecache.getline', (['self.filename', 'line_num'], {}), '(self.filename, line_num)\n', (4080, 4105), False, 'import linecache\n... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import asyncio
from pixivpy_async import *
# change _USERNAME,_PASSWORD first!
_USERNAME = "userbay"
_PASSWORD = "<PASSWORD>"
async def _cmain(aapi):
# set API proxy to pixivlite.com
aapi.set_api_proxy("http://app-api.pixivlite.com")
json_result = await aa... | [
"asyncio.get_event_loop"
] | [((682, 706), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (704, 706), False, 'import asyncio\n')] |
from __future__ import absolute_import
import logging
from io import StringIO
import argparse
import apache_beam as beam
from apache_beam.options.pipeline_options import PipelineOptions, StandardOptions, GoogleCloudOptions, SetupOptions
from apache_beam.io.gcp.internal.clients import bigquery
from dotenv import load_do... | [
"logging.getLogger",
"apache_beam.io.WriteToBigQuery",
"argparse.ArgumentParser",
"apache_beam.options.pipeline_options.PipelineOptions",
"dotenv.load_dotenv",
"apache_beam.io.ReadFromText",
"re.sub",
"apache_beam.Pipeline"
] | [((325, 338), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (336, 338), False, 'from dotenv import load_dotenv\n'), ((1324, 1349), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1347, 1349), False, 'import argparse\n'), ((1692, 1709), 'apache_beam.options.pipeline_options.PipelineOpti... |
#!/usr/bin/python3
from os import listdir
from os.path import isdir, isfile, join
import csv
dataset_dir = "../raw/"
all_recordings = [r for r in listdir(dataset_dir) if isdir(join(dataset_dir, r))]
recordings = [ r for r in all_recordings if "record20180113" in r]
time_sum = 0
for r in recordings:
accelerome... | [
"os.path.isfile",
"os.listdir",
"os.path.join",
"csv.reader"
] | [((390, 416), 'os.path.isfile', 'isfile', (['accelerometer_path'], {}), '(accelerometer_path)\n', (396, 416), False, 'from os.path import isdir, isfile, join\n'), ((150, 170), 'os.listdir', 'listdir', (['dataset_dir'], {}), '(dataset_dir)\n', (157, 170), False, 'from os import listdir\n'), ((336, 356), 'os.path.join', ... |
import os
from arggo.environment.workdir import DirectoryStrategy
class FakeDirectoryStrategy(DirectoryStrategy):
def __init__(self) -> None:
super().__init__()
self.dir = os.getcwd()
def makedirs(self, path):
pass
def chdir(self, path):
self.dir = path
def getcwd(s... | [
"os.getcwd"
] | [((195, 206), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (204, 206), False, 'import os\n')] |
# Copyright 2020 <NAME> <<EMAIL>>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
"""reject_merge_commits is a hook to check new changesets for merge commits.
Merge commits are allowed only between different branches, i.e. merging... | [
"mercurial.pycompat.bytestr",
"mercurial.i18n._"
] | [((810, 840), 'mercurial.i18n._', '_', (["b'Unsupported hook type %r'"], {}), "(b'Unsupported hook type %r')\n", (811, 840), False, 'from mercurial.i18n import _\n'), ((843, 869), 'mercurial.pycompat.bytestr', 'pycompat.bytestr', (['hooktype'], {}), '(hooktype)\n', (859, 869), False, 'from mercurial import error, pycom... |
"""
Created by <NAME> at 05.02.21
J<NAME> University of Linz
"""
import os
def check_dir(directory):
if not os.path.exists(directory):
print('{} not exist. calling mkdir!'.format(directory))
os.makedirs(directory)
| [
"os.path.exists",
"os.makedirs"
] | [((114, 139), 'os.path.exists', 'os.path.exists', (['directory'], {}), '(directory)\n', (128, 139), False, 'import os\n'), ((213, 235), 'os.makedirs', 'os.makedirs', (['directory'], {}), '(directory)\n', (224, 235), False, 'import os\n')] |
import random
import h5py
import numpy as np
with h5py.File('./plant_train.h5', 'r') as f:
data_full = f['data'][()]
print(np.max(np.sqrt(np.sum(abs(data_full[20])**2, axis=-1))))
for key in f.keys():
print(f[key])
| [
"h5py.File"
] | [((51, 85), 'h5py.File', 'h5py.File', (['"""./plant_train.h5"""', '"""r"""'], {}), "('./plant_train.h5', 'r')\n", (60, 85), False, 'import h5py\n')] |
# -*- coding: utf-8 -*-
# Copyright (c) 2020, Internet Freedom Foundation and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.website.website_generator import WebsiteGenerator
from panoptic.panoptic.api import get_state_route_map, get_st... | [
"panoptic.panoptic.api.get_state_route_map",
"frappe._dict",
"frappe.db.get_all",
"panoptic.panoptic.api.get_state_wise_frt",
"frappe.db.count",
"frappe.get_all"
] | [((434, 500), 'frappe._dict', 'frappe._dict', ([], {'page_title_field': '"""state_name"""', 'no_cache': '(1)', 'sitemap': '(1)'}), "(page_title_field='state_name', no_cache=1, sitemap=1)\n", (446, 500), False, 'import frappe\n'), ((1609, 1629), 'panoptic.panoptic.api.get_state_wise_frt', 'get_state_wise_frt', ([], {}),... |
from contextlib import contextmanager
import os
from math import sqrt
from fontTools.pens.basePen import BasePen
from fontTools.pens.recordingPen import RecordingPen
from fontTools.ttLib.tables.otTables import CompositeMode, ExtendMode
import cairo
from .base import Canvas, Surface
from .sweepGradient import buildSweep... | [
"cairo.ImageSurface",
"cairo.RecordingSurface",
"cairo.Context",
"cairo.SVGSurface",
"fontTools.pens.recordingPen.RecordingPen",
"math.sqrt",
"cairo.MeshPattern",
"cairo.Matrix",
"cairo.LinearGradient",
"cairo.PDFSurface",
"os.fspath",
"cairo.RadialGradient"
] | [((2555, 2569), 'fontTools.pens.recordingPen.RecordingPen', 'RecordingPen', ([], {}), '()\n', (2567, 2569), False, 'from fontTools.pens.recordingPen import RecordingPen\n'), ((2992, 3006), 'cairo.Matrix', 'cairo.Matrix', ([], {}), '()\n', (3004, 3006), False, 'import cairo\n'), ((3521, 3573), 'cairo.LinearGradient', 'c... |
import json
from anlogger import Logger
logger_obj = Logger(name="virtualmail", default_loglevel="INFO", fmt=None, syslog=None)
logger = logger_obj.get()
def lambda_handler(event, context):
logger.warn("Default handler in virtualmail app container called - please configure Lambda to call the correct handler!")
log... | [
"anlogger.Logger",
"json.dumps"
] | [((53, 127), 'anlogger.Logger', 'Logger', ([], {'name': '"""virtualmail"""', 'default_loglevel': '"""INFO"""', 'fmt': 'None', 'syslog': 'None'}), "(name='virtualmail', default_loglevel='INFO', fmt=None, syslog=None)\n", (59, 127), False, 'from anlogger import Logger\n'), ((329, 346), 'json.dumps', 'json.dumps', (['even... |
from torch import nn
import torch
from model.Swin import SwinTransformer3D
import copy
class swin_encoder(nn.Module):
def __init__(self , device , drop , checkpoint_encoder):
super().__init__()
checkpoint = checkpoint_encoder
self.device=device
self.label= 'demo/label_map_k400.txt'
... | [
"model.Swin.SwinTransformer3D",
"torch.load",
"torch.nn.AdaptiveAvgPool2d",
"copy.deepcopy"
] | [((339, 595), 'model.Swin.SwinTransformer3D', 'SwinTransformer3D', ([], {'embed_dim': '(128)', 'depths': '[2, 2, 18, 2]', 'num_heads': '[4, 8, 16, 32]', 'window_size': '(8, 7, 7)', 'patch_size': '(2, 4, 4)', 'drop_path_rate': '(0.1)', 'mlp_ratio': '(4.0)', 'qkv_bias': '(True)', 'qk_scale': 'None', 'drop_rate': 'drop', ... |
# MIT License
#
# Copyright (c) 2017
#
# 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, di... | [
"sklearn.preprocessing.label_binarize",
"scipy.stats.rankdata",
"time.clock",
"os.path.join",
"sklearn.metrics.roc_auc_score",
"sys.exit",
"time.time",
"sklearn.metrics.confusion_matrix"
] | [((5848, 5894), 'scipy.stats.rankdata', 'st.rankdata', (['inv_probability'], {'method': '"""average"""'}), "(inv_probability, method='average')\n", (5859, 5894), True, 'import scipy.stats as st\n'), ((5920, 5956), 'sklearn.preprocessing.label_binarize', 'label_binarize', (['actual_text', 'classes'], {}), '(actual_text,... |
#!/usr/bin/env python
import rospy
import math
from sensor_msgs.msg import JointState
from geometry_msgs.msg import Pose
from tr5_kinematics.srv import DoForwardKinematics, DoForwardKinematicsResponse
# load private parameters
svc_fk = rospy.get_param("~for_kin_service", "/do_fk")
# DH Parameters for ROB3/TR5
d1 ... | [
"tr5_kinematics.srv.DoForwardKinematicsResponse",
"rospy.is_shutdown",
"rospy.get_param",
"rospy.init_node",
"rospy.Service",
"math.cos",
"rospy.spin",
"geometry_msgs.msg.Pose",
"math.sin"
] | [((240, 285), 'rospy.get_param', 'rospy.get_param', (['"""~for_kin_service"""', '"""/do_fk"""'], {}), "('~for_kin_service', '/do_fk')\n", (255, 285), False, 'import rospy\n'), ((659, 681), 'math.cos', 'math.cos', (['shoulder_pan'], {}), '(shoulder_pan)\n', (667, 681), False, 'import math\n'), ((691, 714), 'math.cos', '... |
import pandas as pd
import numpy as np
import sys
import glob
import os
import re
import Bio.PDB.PDBParser
import warnings
import math
warnings.filterwarnings("ignore", message="Used element '.' for Atom")
levels = ["class", "arch", "topo", "superfam"]
import argparse
parser = argparse.ArgumentParser()
parser.add_arg... | [
"numpy.mean",
"argparse.ArgumentParser",
"re.compile",
"pandas.read_csv",
"numpy.logical_and",
"os.path.join",
"numpy.linalg.norm",
"numpy.array",
"os.path.basename",
"sys.exit",
"pandas.concat",
"warnings.filterwarnings"
] | [((135, 205), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {'message': '"""Used element \'.\' for Atom"""'}), '(\'ignore\', message="Used element \'.\' for Atom")\n', (158, 205), False, 'import warnings\n'), ((280, 305), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n',... |
import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='media',
version='1.0.3',
description='A simple webpage generator for movies',
long_description=read("README.rst"),
url='https://github.com/walchko/media_html_page_g... | [
"os.path.dirname"
] | [((83, 108), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (98, 108), False, 'import os\n')] |
import numpy as np
def get_user_purchase_matrix(shoppers,numshoppers, brands,num_brands):
# numpy zeros is sparse, so size is ok.
shopper_brand_matrix = np.zeros((numshoppers,num_brands),dtype = np.int8)
for i in range(len(shoppers)):
shopper_brand_matrix[shoppers[i],brands[i]]+=1
return shoppe... | [
"numpy.zeros"
] | [((162, 212), 'numpy.zeros', 'np.zeros', (['(numshoppers, num_brands)'], {'dtype': 'np.int8'}), '((numshoppers, num_brands), dtype=np.int8)\n', (170, 212), True, 'import numpy as np\n')] |
from datetime import datetime
import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from database.database import db, ma
from sqlalchemy import desc, and_, func
from flask import current_app
class ItemTransaction(db.Model):
__tablename__ = 'item_transaction'
... | [
"database.database.db.ForeignKey",
"database.database.db.relationship",
"database.database.db.session.commit",
"sqlalchemy.func.sum",
"database.database.db.session.refresh",
"database.database.db.Column",
"database.database.db.session.add",
"os.path.abspath",
"sqlalchemy.and_"
] | [((327, 386), 'database.database.db.Column', 'db.Column', (['db.Integer'], {'primary_key': '(True)', 'autoincrement': '(True)'}), '(db.Integer, primary_key=True, autoincrement=True)\n', (336, 386), False, 'from database.database import db, ma\n'), ((743, 780), 'database.database.db.Column', 'db.Column', (['db.Integer']... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Dict, List, Mapping, Optional, Tuple, Union
from . import _... | [
"pulumi.getter",
"warnings.warn",
"pulumi.ResourceOptions",
"pulumi.get"
] | [((7025, 7065), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""datastoreClusterId"""'}), "(name='datastoreClusterId')\n", (7038, 7065), False, 'import pulumi\n'), ((7363, 7404), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""sdrsAutomationLevel"""'}), "(name='sdrsAutomationLevel')\n", (7376, 7404), False, 'im... |
from subprocess import check_call
import time
PYTHON = '/home/developers/Libraries/Python/envs/gpu/bin/python3.5'
learning_rates = [0.0001]
batch_sizes = [64]
i = 0
m = len(learning_rates) * len(batch_sizes)
start_time = time.time()
for lr in learning_rates:
for batch in batch_sizes:
print("{}/{}".format... | [
"time.time",
"time.gmtime",
"subprocess.check_call"
] | [((224, 235), 'time.time', 'time.time', ([], {}), '()\n', (233, 235), False, 'import time\n'), ((504, 515), 'time.time', 'time.time', ([], {}), '()\n', (513, 515), False, 'import time\n'), ((446, 473), 'subprocess.check_call', 'check_call', (['cmd'], {'shell': '(True)'}), '(cmd, shell=True)\n', (456, 473), False, 'from... |
from setuptools import setup
with open("README.md", 'r', encoding="utf8") as f:
long_description = f.read()
setup(
name='mpiyango',
version='0.0.9',
description='A module to get various lottery data from National Lottery Administration of Turkey (in Turkish)',
license="MIT",
long_descript... | [
"setuptools.setup"
] | [((119, 619), 'setuptools.setup', 'setup', ([], {'name': '"""mpiyango"""', 'version': '"""0.0.9"""', 'description': '"""A module to get various lottery data from National Lottery Administration of Turkey (in Turkish)"""', 'license': '"""MIT"""', 'long_description': 'long_description', 'long_description_content_type': '... |
# Generated by Django 2.1.7 on 2019-03-27 18:01
from django.db import migrations
def populate_observables(apps, schema_editor):
Observable = apps.get_model('ARNN', 'Observable')
Observable.objects.filter(name="Normalized Root-Mean-Squarred Error"). delete()
new = Observable(name='Rmse')
new.save()
... | [
"django.db.migrations.RunPython"
] | [((851, 893), 'django.db.migrations.RunPython', 'migrations.RunPython', (['populate_observables'], {}), '(populate_observables)\n', (871, 893), False, 'from django.db import migrations\n')] |
from app import app
app.run(port=8000, host='0.0.0.0') | [
"app.app.run"
] | [((21, 55), 'app.app.run', 'app.run', ([], {'port': '(8000)', 'host': '"""0.0.0.0"""'}), "(port=8000, host='0.0.0.0')\n", (28, 55), False, 'from app import app\n')] |
import bl_
import lighton
if __name__ == '__main__':
bl_.init()
lighton.main()
| [
"lighton.main",
"bl_.init"
] | [((58, 68), 'bl_.init', 'bl_.init', ([], {}), '()\n', (66, 68), False, 'import bl_\n'), ((73, 87), 'lighton.main', 'lighton.main', ([], {}), '()\n', (85, 87), False, 'import lighton\n')] |
import unittest
import numpy as np
from spn.algorithms.Inference import log_likelihood
from spn.algorithms.MPE import mpe
from spn.io.CPP import get_cpp_function, setup_cpp_bridge, get_cpp_mpe_function
from spn.io.Graphics import plot_spn
from spn.structure.Base import get_nodes_by_type
from spn.structure.leaves.para... | [
"numpy.allclose",
"spn.algorithms.Inference.log_likelihood",
"spn.algorithms.MPE.mpe",
"spn.io.CPP.get_cpp_mpe_function",
"spn.io.CPP.setup_cpp_bridge",
"spn.io.CPP.get_cpp_function",
"spn.structure.leaves.parametric.Inference.add_parametric_inference_support",
"numpy.zeros",
"numpy.array",
"spn.s... | [((2146, 2161), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2159, 2161), False, 'import unittest\n'), ((517, 551), 'spn.structure.leaves.parametric.Inference.add_parametric_inference_support', 'add_parametric_inference_support', ([], {}), '()\n', (549, 551), False, 'from spn.structure.leaves.parametric.Inferen... |
import sqlparse
def _patch():
from sqlalchemy.dialects.mysql.base import RESERVED_WORDS
for key in list(sqlparse.keywords.KEYWORDS.keys()):
if key.lower() not in RESERVED_WORDS:
del sqlparse.keywords.KEYWORDS[key]
_patch()
| [
"sqlparse.keywords.KEYWORDS.keys"
] | [((115, 148), 'sqlparse.keywords.KEYWORDS.keys', 'sqlparse.keywords.KEYWORDS.keys', ([], {}), '()\n', (146, 148), False, 'import sqlparse\n')] |
# -*- coding: utf-8 -*-
# Copyright (c) 2019, <EMAIL> and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
import json
import datetime
from frappe.model.document import Document
from frappe import _
from six.moves.urllib.parse import urlencode
from fra... | [
"json.loads",
"frappe.db.get_value",
"moneris_payment.MonerisPaymentGateway.mpgHttpsPost",
"moneris_payment.MonerisPaymentGateway.PurchaseWithVault",
"frappe.db.get_all",
"frappe._",
"moneris_payment.MonerisPaymentGateway.BillingInfo",
"six.moves.urllib.parse.urlencode",
"moneris_payment.MonerisPaym... | [((12096, 12128), 'frappe.get_doc', 'frappe.get_doc', (['doctype', 'docname'], {}), '(doctype, docname)\n', (12110, 12128), False, 'import frappe\n'), ((12151, 12246), 'frappe.db.get_value', 'frappe.db.get_value', (['"""Payment Gateway"""', 'reference_doc.payment_gateway', '"""gateway_controller"""'], {}), "('Payment G... |
from django.db import models
from app.models import *
class User(models.Model):
"""
This class is the base class for any user of the app. It should not be instanciated at any
moment. Use CEO, AisleManager or StoreManager instead.
Attributes:
id (int): The ID of the user that is incremented a... | [
"django.db.models.Manager",
"django.db.models.AutoField",
"django.db.models.CharField"
] | [((678, 712), 'django.db.models.AutoField', 'models.AutoField', ([], {'primary_key': '(True)'}), '(primary_key=True)\n', (694, 712), False, 'from django.db import models\n'), ((730, 761), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(50)'}), '(max_length=50)\n', (746, 761), False, 'from django... |
#!/usr/bin/python3
from numpy import array
from numpy.linalg import eig
from scipy.sparse import diags
import numpy as np
import sys
import ast
# define matrix
args = sys.argv
maind = ast.literal_eval(args[3])
second = ast.literal_eval(args[4])
k = array([
second, maind, second
])
offset = [-1, 0, 1]
A = diags(k, ... | [
"ast.literal_eval",
"numpy.array",
"numpy.linalg.eig",
"scipy.sparse.diags"
] | [((185, 210), 'ast.literal_eval', 'ast.literal_eval', (['args[3]'], {}), '(args[3])\n', (201, 210), False, 'import ast\n'), ((220, 245), 'ast.literal_eval', 'ast.literal_eval', (['args[4]'], {}), '(args[4])\n', (236, 245), False, 'import ast\n'), ((250, 280), 'numpy.array', 'array', (['[second, maind, second]'], {}), '... |
import os
import FusionBotMODULES
from vk_api.bot_longpoll import VkBotEvent
from FusionBotMODULES import ModuleManager, Fusion
from vk_api.utils import get_random_id
logger = FusionBotMODULES.Logger(app="Adisman")
load_module = False
model_files = {
"weights_path": "NeuroNetworks/Adisman/adisman_weights.hdf5"... | [
"os.path.isfile",
"FusionBotMODULES.Logger",
"textgenrnn.textgenrnn",
"vk_api.utils.get_random_id"
] | [((179, 217), 'FusionBotMODULES.Logger', 'FusionBotMODULES.Logger', ([], {'app': '"""Adisman"""'}), "(app='Adisman')\n", (202, 217), False, 'import FusionBotMODULES\n'), ((1056, 1191), 'textgenrnn.textgenrnn', 'textgenrnn', ([], {'weights_path': "model_files['weights_path']", 'vocab_path': "model_files['vocab_path']", ... |
import automox_console_sdk as automox
from automox_console_sdk.api import DevicesApi
from automox_console_sdk.api import GroupsApi
from automox_console_sdk.models import ServersIdBody, ServerGroupCreateOrUpdateRequest
from getpass import getpass
import ldap
from ldap.controls import SimplePagedResultsControl
import re
... | [
"ldap.dn.explode_dn",
"automox_console_sdk.ApiClient",
"os.getenv",
"ldap.initialize",
"automox_console_sdk.api.GroupsApi",
"getpass.getpass",
"ldap.controls.SimplePagedResultsControl",
"automox_console_sdk.Configuration",
"automox_console_sdk.api.DevicesApi",
"automox_console_sdk.models.ServerGro... | [((1313, 1364), 'ldap.dn.explode_dn', 'ldap.dn.explode_dn', (['dn'], {'flags': 'ldap.DN_FORMAT_LDAPV2'}), '(dn, flags=ldap.DN_FORMAT_LDAPV2)\n', (1331, 1364), False, 'import ldap\n'), ((3074, 3097), 'automox_console_sdk.Configuration', 'automox.Configuration', ([], {}), '()\n', (3095, 3097), True, 'import automox_conso... |
# **********************************************************************
# Copyright 2020 Advanced Micro Devices, 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.o... | [
"bpy.props.PointerProperty",
"bpy.props.EnumProperty"
] | [((982, 1152), 'bpy.props.EnumProperty', 'bpy.props.EnumProperty', ([], {'name': '"""Type"""', 'items': "(('REFERENCE', 'Reference', 'Load Data as Reference'), ('COPY', 'Copy',\n 'Copy data into Blender'))", 'default': '"""REFERENCE"""'}), "(name='Type', items=(('REFERENCE', 'Reference',\n 'Load Data as Reference... |
# Copyright 2019 Cohesity Inc.
# Author : <NAME> <<EMAIL>>
# This script is run by Get-PBCohesityProtectionRunGraph.ps1
# creates a graph
import matplotlib
matplotlib.use('Agg')
import sys
import matplotlib.pyplot as plt; plt.rcdefaults()
import numpy as np
def graph(stat, hour, current, path):
hour = hour.split("... | [
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.ylabel",
"matplotlib.use",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.title",
"matplotlib.pyplot.rcdefaults",
"matplotlib.pyplot.legend"
] | [((156, 177), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (170, 177), False, 'import matplotlib\n'), ((222, 238), 'matplotlib.pyplot.rcdefaults', 'plt.rcdefaults', ([], {}), '()\n', (236, 238), True, 'import matplotlib.pyplot as plt\n'), ((2005, 2080), 'matplotlib.pyplot.bar', 'plt.bar', (['ti... |
import os
import schedule, time
import logging
from bot_logics.bot_logic import send_message_to_slack
logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(levelname)s %(name)s:%(lineno)d - %(message)s")
logger = logging.getLogger(__name__)
SLACK_TOKEN = os.environ["SLACK_TOKEN"]
def send_turn_on_sauna_m... | [
"logging.basicConfig",
"logging.getLogger",
"bot_logics.bot_logic.send_message_to_slack",
"schedule.run_pending",
"time.sleep",
"schedule.every"
] | [((104, 220), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO', 'format': '"""%(asctime)s - %(levelname)s %(name)s:%(lineno)d - %(message)s"""'}), "(level=logging.INFO, format=\n '%(asctime)s - %(levelname)s %(name)s:%(lineno)d - %(message)s')\n", (123, 220), False, 'import logging\n'), ((... |
# Copyright © 2019 Province of British Columbia
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | [
"tests.unit.services.utils.create_header_account_report",
"pytest.mark.parametrize",
"copy.deepcopy",
"tests.unit.services.utils.create_header_account",
"tests.unit.services.utils.create_header"
] | [((1227, 1258), 'copy.deepcopy', 'copy.deepcopy', (['CHANGE_STATEMENT'], {}), '(CHANGE_STATEMENT)\n', (1240, 1258), False, 'import copy\n'), ((6626, 6727), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""desc,roles,status,has_account,reg_num,base_reg_num"""', 'TEST_GET_STATEMENT'], {}), "('desc,roles,status... |
"""Samjin button device."""
import logging
from zigpy.profiles import zha
from zigpy.quirks import CustomCluster, CustomDevice
from zigpy.zcl.clusters.general import (
Basic,
Identify,
Ota,
PollControl,
PowerConfiguration,
)
from zigpy.zcl.clusters.measurement import TemperatureMeasurement
from zig... | [
"logging.getLogger"
] | [((753, 780), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (770, 780), False, 'import logging\n')] |
import time
import grpc
from concurrent import futures
from peewee import *
from playhouse.cockroachdb import CockroachDatabase
from peeweebuf import Proto, peewee_to_proto, proto_to_dict
from user_pb2 import User as UserProto
from user_pb2_grpc import UserServiceServicer as UserService, \
add_UserServiceServicer... | [
"peeweebuf.peewee_to_proto",
"peeweebuf.proto_to_dict",
"concurrent.futures.ThreadPoolExecutor",
"time.sleep",
"playhouse.cockroachdb.CockroachDatabase",
"peeweebuf.Proto"
] | [((358, 425), 'playhouse.cockroachdb.CockroachDatabase', 'CockroachDatabase', (['"""dev"""'], {'user': '"""root"""', 'port': '(26257)', 'host': '"""127.0.0.1"""'}), "('dev', user='root', port=26257, host='127.0.0.1')\n", (375, 425), False, 'from playhouse.cockroachdb import CockroachDatabase\n'), ((429, 463), 'peeweebu... |
import pytest
from awesome_sso.store.minio import MinioStore
from tests.datastore import generate_fake_dataframe
@pytest.fixture()
def test_string():
return b"to grasp how wide and long and high and deep is the love of Christ"
@pytest.fixture()
def test_dataframe():
return generate_fake_dataframe(size=100,... | [
"pytest.fixture",
"tests.datastore.generate_fake_dataframe",
"awesome_sso.store.minio.MinioStore"
] | [((117, 133), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (131, 133), False, 'import pytest\n'), ((237, 253), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (251, 253), False, 'import pytest\n'), ((338, 354), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (352, 354), False, 'import pytest\n'), (... |
import os
import re
from django.conf import settings
from statsd.defaults.django import statsd
DATADOG_METRICS = False
DATADOG_TAGS = None
if settings.DATADOG_API_KEY:
from datadog import initialize
options = {
'api_key': settings.DATADOG_API_KEY,
'app_key': settings.DATADOG_APP_KEY
}
... | [
"datadog.initialize",
"os.environ.get",
"datadog.statsd.timing",
"datadog.statsd.increment",
"statsd.defaults.django.statsd.incr",
"re.sub",
"statsd.defaults.django.statsd.timer"
] | [((322, 343), 'datadog.initialize', 'initialize', ([], {}), '(**options)\n', (332, 343), False, 'from datadog import initialize\n'), ((859, 892), 'statsd.defaults.django.statsd.incr', 'statsd.incr', (['f"""platform.{metric}"""'], {}), "(f'platform.{metric}')\n", (870, 892), False, 'from statsd.defaults.django import st... |
import time
t =time.time()
def find_primes(limit):
nums = [True] * (limit + 1)
nums[0] = nums[1] = False
for (i, is_prime) in enumerate(nums):
if is_prime:
for n in range(i * i, limit + 1, i):
nums[n] = False
return nums
primes = find_primes(10**8+1)
def is_pri... | [
"time.time"
] | [((16, 27), 'time.time', 'time.time', ([], {}), '()\n', (25, 27), False, 'import time\n'), ((771, 782), 'time.time', 'time.time', ([], {}), '()\n', (780, 782), False, 'import time\n')] |
# Copyright (c) <NAME>. All Rights Reserved
import pickle
import torch
import torch.nn as nn
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
from torch.utils.data import DataLoader, Dataset
UNK_TOKEN = "<UNK>" # 0
PAD_TOKEN = "<PAD>" # 1
class P2gM(object):
def __init__(self, pinyin... | [
"torch.nn.ReLU",
"torch.nn.LSTM",
"torch.load",
"torch.tensor",
"torch.nn.utils.rnn.pack_padded_sequence",
"torch.nn.Linear",
"torch.utils.data.DataLoader",
"torch.no_grad",
"torch.nn.utils.rnn.pad_packed_sequence",
"torch.nn.Embedding",
"torch.argmax"
] | [((5232, 5317), 'torch.utils.data.DataLoader', 'DataLoader', (['dataset'], {'batch_size': 'batch_size', 'shuffle': '(False)', 'collate_fn': 'collate_fn'}), '(dataset, batch_size=batch_size, shuffle=False, collate_fn=collate_fn\n )\n', (5242, 5317), False, 'from torch.utils.data import DataLoader, Dataset\n'), ((2766... |
import datetime
import os
import subprocess
import logging
import gin
import tensorflow as tf
def project_revision():
"""
Returns git short sha256 or current datetime if we can't execute git
"""
try:
return (
subprocess.check_output(["git", "rev-parse", "--short", "HEAD"])
... | [
"subprocess.check_output",
"logging.warn",
"tensorflow.io.gfile.GFile",
"gin.operative_config_str",
"os.path.join",
"datetime.datetime.now",
"tensorflow.io.gfile.isdir"
] | [((667, 693), 'tensorflow.io.gfile.isdir', 'tf.io.gfile.isdir', (['log_dir'], {}), '(log_dir)\n', (684, 693), True, 'import tensorflow as tf\n'), ((714, 752), 'os.path.join', 'os.path.join', (['log_dir', "('%s.gin' % slug)"], {}), "(log_dir, '%s.gin' % slug)\n", (726, 752), False, 'import os\n'), ((928, 974), 'logging.... |
from JumpScale import j
class Avahi():
# def __init__(self):
# raise RuntimeError("should not init auto")
# j.system.platform.ubuntu.checkInstall(["avahi-utils"],"avahi-browse")
def _servicePath(self, servicename):
path = "/etc/avahi/services"
if not j.system.fs.exists(path=p... | [
"JumpScale.j.system.fs.writeFile",
"JumpScale.j.system.fs.remove",
"JumpScale.j.codetools.regex.extractBlocks",
"JumpScale.j.system.fs.exists",
"JumpScale.j.system.fs.joinPaths",
"JumpScale.j.system.process.execute",
"JumpScale.j.codetools.regex.getINIAlikeVariableFromText",
"JumpScale.j.system.fs.cre... | [((426, 462), 'JumpScale.j.system.fs.joinPaths', 'j.system.fs.joinPaths', (['path', 'service'], {}), '(path, service)\n', (447, 462), False, 'from JumpScale import j\n'), ((1071, 1107), 'JumpScale.j.system.fs.writeFile', 'j.system.fs.writeFile', (['path', 'content'], {}), '(path, content)\n', (1092, 1107), False, 'from... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-10-06 10:44
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('accounts', '0001_initial'),
]
operations = [
migrations.RemoveField(
mo... | [
"django.db.migrations.RemoveField"
] | [((282, 352), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""userprofile"""', 'name': '"""access_key_id"""'}), "(model_name='userprofile', name='access_key_id')\n", (304, 352), False, 'from django.db import migrations\n'), ((397, 470), 'django.db.migrations.RemoveField', 'migratio... |
"""Conversion data fixtures
"""
import numpy as np
from pytest import fixture
@fixture(scope='module')
def year_to_month_coefficients():
"""From one year to 12 months
(apportions)
"""
return np.array([[31, 28, 31, 30, 31, 31, 30, 30, 31, 31, 30, 31]], dtype=np.float).T / 365
@fixture(scope='module'... | [
"pytest.fixture",
"numpy.array",
"numpy.transpose",
"numpy.ones"
] | [((81, 104), 'pytest.fixture', 'fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (88, 104), False, 'from pytest import fixture\n'), ((298, 321), 'pytest.fixture', 'fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (305, 321), False, 'from pytest import fixture\n'), ((445, 468), 'pytest.fi... |
from django.shortcuts import render, redirect, get_object_or_404
from django.contrib import messages
from django.contrib.auth.decorators import login_required, permission_required
from scrumate.general.decorators import project_owner
from scrumate.core.project.models import Project
from scrumate.core.member.models imp... | [
"django.shortcuts.render",
"django.contrib.messages.warning",
"django.shortcuts.get_object_or_404",
"scrumate.core.member.models.ProjectMember.objects.filter",
"django.contrib.auth.decorators.permission_required",
"django.shortcuts.redirect",
"django.contrib.auth.decorators.login_required",
"django.co... | [((398, 433), 'django.contrib.auth.decorators.login_required', 'login_required', ([], {'login_url': '"""/login/"""'}), "(login_url='/login/')\n", (412, 433), False, 'from django.contrib.auth.decorators import login_required, permission_required\n'), ((435, 500), 'django.contrib.auth.decorators.permission_required', 'pe... |
# Copyright 2021 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | [
"pandas.DataFrame.from_records",
"pandas.Int32Dtype",
"rdflib.plugins.sparql.prepareQuery"
] | [((1313, 1333), 'rdflib.plugins.sparql.prepareQuery', 'prepareQuery', (['sparql'], {}), '(sparql)\n', (1325, 1333), False, 'from rdflib.plugins.sparql import prepareQuery\n'), ((3025, 3083), 'pandas.DataFrame.from_records', 'pd.DataFrame.from_records', (["res_dict['results']['bindings']"], {}), "(res_dict['results']['b... |
from django.urls import path
from . import views
app_name = 'vmapp'
urlpatterns = [
path('', views.index),
path('login/', views.login),
path('logout/', views.logout),
path('detail/<str:section>/<str:vm_type>/<str:vm_id>', views.detail),
path('state/<str:section>/<str:vm_type>/<str:vm_id>', views.s... | [
"django.urls.path"
] | [((90, 111), 'django.urls.path', 'path', (['""""""', 'views.index'], {}), "('', views.index)\n", (94, 111), False, 'from django.urls import path\n'), ((117, 144), 'django.urls.path', 'path', (['"""login/"""', 'views.login'], {}), "('login/', views.login)\n", (121, 144), False, 'from django.urls import path\n'), ((150, ... |
import re
import itertools
EXAMPLES1 = (
('19-exemple1.txt', 79),
)
EXAMPLES2 = (
('19-exemple1.txt', 3621),
)
INPUT = '19.txt'
def read_list(fn):
beacons = list()
with open(fn) as f:
while match := re.match(r'--- scanner (\d+) ---', f.readline()):
num = int(... | [
"itertools.combinations"
] | [((4995, 5033), 'itertools.combinations', 'itertools.combinations', (['all_beacons', '(2)'], {}), '(all_beacons, 2)\n', (5017, 5033), False, 'import itertools\n')] |
"""
Class that plays the Reinforcement Learning agent
"""
# !/usr/bin/python
import csv
import pprint
import threading
import numpy as np
import json
import random
import pathlib
from datetime import datetime
import time
import copy
from time import sleep
import logging
import sys
from formatter_for_output import... | [
"logging.getLogger",
"logging.debug",
"time.sleep",
"copy.deepcopy",
"numpy.genfromtxt",
"logging.info",
"logging.error",
"state_machine.state_machine_yeelight.get_optimal_path",
"formatter_for_output.format_console_output",
"pathlib.Path",
"state_machine.state_machine_yeelight.get_optimal_polic... | [((29168, 29191), 'formatter_for_output.format_console_output', 'format_console_output', ([], {}), '()\n', (29189, 29191), False, 'from formatter_for_output import format_console_output\n'), ((2470, 2484), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (2482, 2484), False, 'from datetime import datetime\n')... |
import torch
import torch.nn.functional as F
import argparse
import cv2
import numpy as np
from glob import glob
import copy
num_classes = 2
img_height, img_width = 96, 96
channel = 3
GPU = False
torch.manual_seed(0)
class MobileNet_v1(torch.nn.Module):
def __init__(self):
class MobileNetBlock(torch.nn.... | [
"torch.nn.ReLU",
"numpy.sqrt",
"torch.nn.Sequential",
"torch.nn.CNLLLoss",
"numpy.array",
"copy.copy",
"torch.nn.functional.softmax",
"torch.nn.BatchNorm2d",
"argparse.ArgumentParser",
"numpy.random.seed",
"torch.nn.AdaptiveAvgPool2d",
"glob.glob",
"numpy.ceil",
"cv2.warpAffine",
"cv2.ge... | [((197, 217), 'torch.manual_seed', 'torch.manual_seed', (['(0)'], {}), '(0)\n', (214, 217), False, 'import torch\n'), ((2898, 2915), 'glob.glob', 'glob', (["(path + '/*')"], {}), "(path + '/*')\n", (2902, 2915), False, 'from glob import glob\n'), ((5086, 5116), 'numpy.array', 'np.array', (['xs'], {'dtype': 'np.float32'... |
import pytest
from optconstruct.types.composed import BasicComposed
@pytest.mark.parametrize("data, expected", [
({'msg-property': ''}, True),
({}, False),
])
def test_satisfied(data, expected):
obj = BasicComposed('msg-property', '--msg-property')
assert obj.satisfied(data) is expected
def test_ge... | [
"pytest.mark.parametrize",
"optconstruct.types.composed.BasicComposed",
"pytest.raises"
] | [((72, 163), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""data, expected"""', "[({'msg-property': ''}, True), ({}, False)]"], {}), "('data, expected', [({'msg-property': ''}, True), ({\n }, False)])\n", (95, 163), False, 'import pytest\n'), ((216, 263), 'optconstruct.types.composed.BasicComposed', 'Ba... |
import os
SECRET_KEY = '1234'
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',... | [
"os.path.dirname",
"os.environ.get"
] | [((944, 973), 'os.environ.get', 'os.environ.get', (['"""WQDB"""', '(False)'], {}), "('WQDB', False)\n", (958, 973), False, 'import os\n'), ((1105, 1139), 'os.environ.get', 'os.environ.get', (['"""REVERSION"""', '(False)'], {}), "('REVERSION', False)\n", (1119, 1139), False, 'import os\n'), ((1835, 1866), 'os.environ.ge... |
import argparse
import numpy as np
from pathlib import Path
import cv2
from model import get_model
from noise_model import get_noise_model
import sys
import tensorflow as tf
from tensorflow.python.framework.convert_to_constants import convert_variables_to_constants_v2
import tensorflow_datasets as tfds
def get_args()... | [
"numpy.clip",
"sys.exit",
"argparse.ArgumentParser",
"pathlib.Path",
"tensorflow.image.resize",
"tensorflow_datasets.load",
"noise_model.get_noise_model",
"cv2.imshow",
"tensorflow.TensorSpec",
"numpy.zeros",
"tensorflow.lite.TFLiteConverter.from_keras_model",
"tensorflow.python.framework.conv... | [((335, 453), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Test trained model"""', 'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter'}), "(description='Test trained model', formatter_class=\n argparse.ArgumentDefaultsHelpFormatter)\n", (358, 453), False, 'import argparse\n'... |
import asyncio
import time
import sys
import sentry_sdk
from fastapi import FastAPI
from sentry_sdk.integrations.asgi import SentryAsgiMiddleware
from starlette.middleware.cors import CORSMiddleware
from starlette.requests import Request
from tortoise import Tortoise
from Utils.Configuration import DB_URL, DSN
from U... | [
"fastapi.FastAPI",
"Utils.Redis.get_redis",
"sentry_sdk.init",
"uvicorn.run",
"Utils.Redis.initialize",
"tortoise.Tortoise.close_connections",
"Utils.Prometheus.session_monitor",
"Utils.Redis.cache",
"asyncio.get_running_loop",
"tortoise.Tortoise.init"
] | [((440, 449), 'fastapi.FastAPI', 'FastAPI', ([], {}), '()\n', (447, 449), False, 'from fastapi import FastAPI\n'), ((469, 493), 'sentry_sdk.init', 'sentry_sdk.init', ([], {'dsn': 'DSN'}), '(dsn=DSN)\n', (484, 493), False, 'import sentry_sdk\n'), ((675, 701), 'asyncio.get_running_loop', 'asyncio.get_running_loop', ([], ... |
#!/usr/bin/env python3
from docgen import DocumentationGenerator
import os, subprocess, tempfile
# The output directory and the relative path to the directory containing our .proto files
docsDir = os.path.dirname(os.path.abspath(__file__))
protoDir = os.path.join('..', 'server', 'proto')
# Generate our API documentat... | [
"os.path.abspath",
"docgen.DocumentationGenerator",
"os.path.join"
] | [((252, 289), 'os.path.join', 'os.path.join', (['""".."""', '"""server"""', '"""proto"""'], {}), "('..', 'server', 'proto')\n", (264, 289), False, 'import os, subprocess, tempfile\n'), ((331, 372), 'docgen.DocumentationGenerator', 'DocumentationGenerator', (['docsDir', 'protoDir'], {}), '(docsDir, protoDir)\n', (353, 3... |
"""
A module of parallel lists and associated skeletons
class PList: parallel lists.
"""
import functools
from collections import defaultdict
from operator import add, concat
from typing import Optional, Tuple, Sequence, Generic # pylint: disable=unused-import
from typing import TypeVar, Callable # pylint: disable=u... | [
"pyske.core.support.list.scan",
"pyske.core.util.par.procs",
"pyske.core.list.slist.SList",
"pyske.core.list.distribution.Distribution",
"pyske.core.support.interval.intersection",
"functools.reduce",
"pyske.core.list.distribution.Distribution.is_valid",
"pyske.core.support.parallel.local_size",
"co... | [((697, 709), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (704, 709), False, 'from typing import TypeVar, Callable\n'), ((746, 758), 'typing.TypeVar', 'TypeVar', (['"""U"""'], {}), "('U')\n", (753, 758), False, 'from typing import TypeVar, Callable\n'), ((795, 807), 'typing.TypeVar', 'TypeVar', (['"""V""... |
# -*- coding: utf-8 -*-
# Copyright 2013 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | [
"os.path.exists",
"mock.patch",
"nailgun.utils.extract_env_version",
"nailgun.utils.migration.upgrade_release_wizard_metadata_50_to_51",
"nailgun.utils.dict_merge",
"os.path.dirname",
"os.path.basename",
"tempfile.NamedTemporaryFile",
"mock.mock_open",
"nailgun.utils.get_fuel_release_versions"
] | [((2791, 2851), 'mock.patch', 'patch', (['"""nailgun.utils.glob.glob"""'], {'return_value': "['test.yaml']"}), "('nailgun.utils.glob.glob', return_value=['test.yaml'])\n", (2796, 2851), False, 'from mock import patch\n'), ((1384, 1410), 'nailgun.utils.dict_merge', 'dict_merge', (['custom', 'common'], {}), '(custom, com... |
from numpy import *
import matplotlib.pyplot as plt
# Load the distance matrix
D = loadtxt('distanceMatrix.csv', delimiter=',')
cities = ['Atl','Chi','Den','Hou','LA','Mia','NYC','SF','Sea','WDC']
nCities = D.shape[0] # Get the size of the matrix
k = 2 # e.g. we want to keep 2 dimensions
#================= ADD YOU... | [
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.text",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.imread",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show"
] | [((1044, 1057), 'matplotlib.pyplot.figure', 'plt.figure', (['(1)'], {}), '(1)\n', (1054, 1057), True, 'import matplotlib.pyplot as plt\n'), ((1085, 1101), 'matplotlib.pyplot.subplot', 'plt.subplot', (['(121)'], {}), '(121)\n', (1096, 1101), True, 'import matplotlib.pyplot as plt\n'), ((1102, 1135), 'matplotlib.pyplot.p... |
from SitePinger import SitePinger
google_site = SitePinger("www.google.com")
google_site.run() | [
"SitePinger.SitePinger"
] | [((49, 77), 'SitePinger.SitePinger', 'SitePinger', (['"""www.google.com"""'], {}), "('www.google.com')\n", (59, 77), False, 'from SitePinger import SitePinger\n')] |
#!/usr/local/blender -P
import bpy
from scene.blender_object import BlenderObject
class ShadowCatcher(BlenderObject):
def __init__(self):
bpy.ops.mesh.primitive_plane_add()
self.obj = bpy.data.objects["Plane"]
self.obj.name = "SC_Plane"
self.obj.cycles.is_shadow_catcher = True
... | [
"bpy.ops.mesh.primitive_plane_add"
] | [((154, 188), 'bpy.ops.mesh.primitive_plane_add', 'bpy.ops.mesh.primitive_plane_add', ([], {}), '()\n', (186, 188), False, 'import bpy\n')] |
# Copyright 2018 Otis Elevator Company. All rights reserved.
# Use of this source code is govered by the MIT license which
# can be found in the LICENSE file.
# Author: <NAME>: <EMAIL>
# Otis udp_rx software has been designed to utilize information
# security technology described Part 774 of the EAR Category 5 Part 2... | [
"struct.pack",
"socket.socket"
] | [((1252, 1300), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_DGRAM'], {}), '(socket.AF_INET, socket.SOCK_DGRAM)\n', (1265, 1300), False, 'import socket\n'), ((1007, 1031), 'struct.pack', 'struct.pack', (['""">I"""', '(50300)'], {}), "('>I', 50300)\n", (1018, 1031), False, 'import struct\n')] |
import re
import json
'''
解析配置参数,接受三种参数:
1. 类对象
2. json 文件
3. dict 参数字典
返回包含参数属性的对象
'''
class Config:
config_name = 'default'
pass
def get_attrs(obj):
attr_dict = {}
for name in dir(obj):
if callable(getattr(obj, name)): continue
if re.match('__.*__', name): continue
if re.matc... | [
"json.load",
"re.match"
] | [((267, 291), 're.match', 're.match', (['"""__.*__"""', 'name'], {}), "('__.*__', name)\n", (275, 291), False, 'import re\n'), ((313, 335), 're.match', 're.match', (['"""__.*"""', 'name'], {}), "('__.*', name)\n", (321, 335), False, 'import re\n'), ((357, 379), 're.match', 're.match', (['""".*__"""', 'name'], {}), "('.... |
import sys
sys.path.append('.')
import unittest
import main
from nose.plugins.attrib import attr
from service_api import ServiceApi
@attr('UNIT')
class SearchUnitTest(unittest.TestCase):
def setUp(self):
self.app_client = main.app.test_client()
self.app_context = main.app.test_request_context()
... | [
"service_api.ServiceApi",
"nose.plugins.attrib.attr",
"main.app.test_client",
"unittest.main",
"sys.path.append",
"main.app.test_request_context"
] | [((11, 31), 'sys.path.append', 'sys.path.append', (['"""."""'], {}), "('.')\n", (26, 31), False, 'import sys\n'), ((135, 147), 'nose.plugins.attrib.attr', 'attr', (['"""UNIT"""'], {}), "('UNIT')\n", (139, 147), False, 'from nose.plugins.attrib import attr\n'), ((1500, 1511), 'nose.plugins.attrib.attr', 'attr', (['"""IN... |
# -*- coding: utf-8 -*-
import os
import MySQLdb
from sqlalchemy import create_engine
from sqlalchemy.exc import IntegrityError
import pandas as pd
import traceback
import logging
from tools.settings import *
from tools.utility import datetime2str
MYSQL_CONF = PROJECT_CONFIG['mysql_rule360_alert']
class MysqlQuery... | [
"pandas.read_sql",
"MySQLdb.connect",
"traceback.print_exc"
] | [((481, 613), 'MySQLdb.connect', 'MySQLdb.connect', ([], {'host': "MYSQL_CONF['host']", 'user': "MYSQL_CONF['username']", 'passwd': "MYSQL_CONF['password']", 'db': "MYSQL_CONF['defaultdb']"}), "(host=MYSQL_CONF['host'], user=MYSQL_CONF['username'],\n passwd=MYSQL_CONF['password'], db=MYSQL_CONF['defaultdb'])\n", (49... |
from time import sleep
import gevent
from pitop import LED, Button, Pitop, UltrasonicSensor
from pitop.labs import WebController
robot = Pitop()
robot.add_component(Button("D1"))
robot.add_component(LED("D2"))
robot.add_component(UltrasonicSensor("D3"))
dashboard_server = WebController()
def broadcast_state():
... | [
"pitop.Button",
"pitop.labs.WebController",
"time.sleep",
"pitop.LED",
"gevent.get_hub",
"pitop.Pitop",
"pitop.UltrasonicSensor"
] | [((140, 147), 'pitop.Pitop', 'Pitop', ([], {}), '()\n', (145, 147), False, 'from pitop import LED, Button, Pitop, UltrasonicSensor\n'), ((277, 292), 'pitop.labs.WebController', 'WebController', ([], {}), '()\n', (290, 292), False, 'from pitop.labs import WebController\n'), ((409, 425), 'gevent.get_hub', 'gevent.get_hub... |
# Copyright 2021 ETH Zurich and the NPBench authors. All rights reserved.
import numpy as np
def initialize(C_in, C_out, H, K, N, W):
from numpy.random import default_rng
rng = default_rng(42)
# NHWC data layout
input = rng.random((N, H, W, C_in), dtype=np.float32)
# Weights
weights = rng.ran... | [
"numpy.random.default_rng"
] | [((188, 203), 'numpy.random.default_rng', 'default_rng', (['(42)'], {}), '(42)\n', (199, 203), False, 'from numpy.random import default_rng\n')] |
import sys
import os
import time
import json
from collections import Counter
import nltk
class Sentiment_Analysizer:
'''
Uses classifier to determine a text's sentiment
'''
def __init__(self):
try:
from nltk.sentiment.vader import SentimentIntensityAnalyzer
self.sentim... | [
"nltk.sentiment.vader.SentimentIntensityAnalyzer",
"json.dump",
"nltk.download"
] | [((335, 363), 'nltk.sentiment.vader.SentimentIntensityAnalyzer', 'SentimentIntensityAnalyzer', ([], {}), '()\n', (361, 363), False, 'from nltk.sentiment.vader import SentimentIntensityAnalyzer\n'), ((1127, 1144), 'json.dump', 'json.dump', (['obj', 'f'], {}), '(obj, f)\n', (1136, 1144), False, 'import json\n'), ((405, 4... |
"""Learning how to access an API using Python."""
import numpy as np
import requests
import json
# convert lat/lon/zoom to x/y
def convert_to_xy(lat, lon, zoom):
lat_rad = np.radians(lat)
n = 2.0 ** zoom
x = int((lon + 180.0) / 360.0 * n)
y = int((1.0 - np.arcsinh(np.tan(lat_rad)) / np.pi) / 2.0 * n)... | [
"numpy.radians",
"numpy.tan",
"numpy.arange",
"requests.get",
"json.dump"
] | [((1163, 1186), 'numpy.arange', 'np.arange', (['x_min', 'x_max'], {}), '(x_min, x_max)\n', (1172, 1186), True, 'import numpy as np\n'), ((1198, 1221), 'numpy.arange', 'np.arange', (['y_min', 'y_max'], {}), '(y_min, y_max)\n', (1207, 1221), True, 'import numpy as np\n'), ((2512, 2530), 'json.dump', 'json.dump', (['data'... |
import numpy as np
import matplotlib.pyplot as plt
from datetime import datetime
# q3. a
# (1)
def cal_log(x, y, sigma):
return (-1/(np.pi * np.power(sigma, 4)))\
* (1-(np.power(x, 2)+np.power(y, 2))/(2*np.power(sigma, 2)))\
* np.exp(-(np.power(x, 2)+np.power(y, 2))/(2*np.power(sigma, 2)))
... | [
"numpy.abs",
"numpy.mean",
"matplotlib.pyplot.ylabel",
"numpy.power",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"datetime.datetime.now",
"numpy.zeros",
"matplotlib.pyplot.figure",
"numpy.array",
"matplotlib.pyplot.tight_layout",
"numpy.nonzero",
"num... | [((404, 420), 'numpy.abs', 'np.abs', (['(max * tp)'], {}), '(max * tp)\n', (410, 420), True, 'import numpy as np\n'), ((568, 593), 'numpy.zeros', 'np.zeros', (['(height, width)'], {}), '((height, width))\n', (576, 593), True, 'import numpy as np\n'), ((919, 935), 'numpy.linalg.svd', 'np.linalg.svd', (['M'], {}), '(M)\n... |
# Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn
from mmselfsup.models.necks import DenseCLNeck
def test_densecl_neck():
neck = DenseCLNeck(16, 32, 16)
assert isinstance(neck.mlp, nn.Sequential)
assert isinstance(neck.mlp2, nn.Sequential)
assert neck.mlp[0].in_featur... | [
"torch.Size",
"mmselfsup.models.necks.DenseCLNeck",
"torch.rand"
] | [((169, 192), 'mmselfsup.models.necks.DenseCLNeck', 'DenseCLNeck', (['(16)', '(32)', '(16)'], {}), '(16, 32, 16)\n', (180, 192), False, 'from mmselfsup.models.necks import DenseCLNeck\n'), ((592, 618), 'torch.rand', 'torch.rand', (['(32, 16, 5, 5)'], {}), '((32, 16, 5, 5))\n', (602, 618), False, 'import torch\n'), ((87... |
import os
from pkg_resources import resource_filename
results_path = resource_filename('second_level', 'results')
raw_data_path = os.path.join(results_path, 'raw_data')
img_path = os.path.join(results_path, 'img')
spiketimes_path = os.path.join(results_path, 'spiketimes.txt')
topologies_path = 'second_level.src.topolo... | [
"os.path.join",
"pkg_resources.resource_filename"
] | [((70, 114), 'pkg_resources.resource_filename', 'resource_filename', (['"""second_level"""', '"""results"""'], {}), "('second_level', 'results')\n", (87, 114), False, 'from pkg_resources import resource_filename\n'), ((131, 169), 'os.path.join', 'os.path.join', (['results_path', '"""raw_data"""'], {}), "(results_path, ... |
from flask import Blueprint
from flask_restx import Api
from .ep_hello import api as ns_ep_hello
from .ep_hfc import api as ns_ep_hfc
blueprint = Blueprint('Dev Ops Training', __name__, url_prefix='/api/v1')
api = Api(blueprint, title='Dev Ops Training Test3', version='V1.0', description='Dev Ops Training V1', )
api... | [
"flask.Blueprint",
"flask_restx.Api"
] | [((149, 210), 'flask.Blueprint', 'Blueprint', (['"""Dev Ops Training"""', '__name__'], {'url_prefix': '"""/api/v1"""'}), "('Dev Ops Training', __name__, url_prefix='/api/v1')\n", (158, 210), False, 'from flask import Blueprint\n'), ((217, 319), 'flask_restx.Api', 'Api', (['blueprint'], {'title': '"""Dev Ops Training Te... |
from Crypto.Util.number import *
from math import gcd
import json
ct = 17320751473362084127402636657144071375427833219607663443601124449781249403644322557541872089652267070211212915903557690040206709235417332498271540915493529128300376560226137139676145984352993170584208658625255938806836396696141456961179529532070976... | [
"math.gcd"
] | [((1126, 1139), 'math.gcd', 'gcd', (['p', 'pmuli'], {}), '(p, pmuli)\n', (1129, 1139), False, 'from math import gcd\n')] |
"""
Configurations.
"""
import os
class Config(object):
datetime_format = "%Y-%m-%dT%H:%M:%S.%fZ" # example datetime string "2019-10-14T09:46:49.606Z"
host = "api.gateway.equinor.com"
base_url = "plant"
idp_base_url = "login.microsoftonline.com"
idp_tenant = os.getenv("EquinorAzureADTenantId", "3... | [
"os.getenv"
] | [((282, 357), 'os.getenv', 'os.getenv', (['"""EquinorAzureADTenantId"""', '"""3aa4a235-b6e2-48d5-9195-7fcf05b459b0"""'], {}), "('EquinorAzureADTenantId', '3aa4a235-b6e2-48d5-9195-7fcf05b459b0')\n", (291, 357), False, 'import os\n')] |
'''
Module : pca
Description : Principal Components Analysis (PCA)
Copyright : (c) <NAME>, 22 September 2021
License : MIT
Maintainer : <EMAIL>
Portability : POSIX
'''
import sys
import logging
import pandas as pd
from sklearn.preprocessing import StandardScaler
import sklearn.decomposition as sk_decom... | [
"argparse.ArgumentParser",
"sklearn.decomposition.PCA",
"sklearn.preprocessing.StandardScaler",
"pandas.DataFrame",
"hatch.utils.validate_columns_error"
] | [((730, 823), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'usage': 'f"""{self.name} -h | {self.name} <arguments>"""', 'add_help': '(True)'}), "(usage=f'{self.name} -h | {self.name} <arguments>',\n add_help=True)\n", (753, 823), False, 'import argparse\n'), ((1993, 2009), 'sklearn.preprocessing.Standa... |
from hashlib import blake2s
from django.utils import timezone
def today():
return timezone.localtime(timezone.now())
def generalCode(length):
code = blake2s(digest_size=length // 2)
code.update(bytes(f"{today()}", "utf-8"))
return f"MT{code.hexdigest()}".upper()
| [
"hashlib.blake2s",
"django.utils.timezone.now"
] | [((161, 193), 'hashlib.blake2s', 'blake2s', ([], {'digest_size': '(length // 2)'}), '(digest_size=length // 2)\n', (168, 193), False, 'from hashlib import blake2s\n'), ((107, 121), 'django.utils.timezone.now', 'timezone.now', ([], {}), '()\n', (119, 121), False, 'from django.utils import timezone\n')] |
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.db import models
from gdstorage.storage import GoogleDriveStorage, GoogleDrivePermissionType, GoogleDrivePermissionRole, GoogleDriveFilePermission
import os
gd_storage = GoogleDriveStorage()
permission = GoogleD... | [
"django.db.models.OneToOneField",
"django.db.models.FloatField",
"django.db.models.DateField",
"django.db.models.TextField",
"django.db.models.TimeField",
"django.db.models.ForeignKey",
"django.db.models.ManyToManyField",
"os.path.splitext",
"django.db.models.DateTimeField",
"django.db.models.Bool... | [((278, 298), 'gdstorage.storage.GoogleDriveStorage', 'GoogleDriveStorage', ([], {}), '()\n', (296, 298), False, 'from gdstorage.storage import GoogleDriveStorage, GoogleDrivePermissionType, GoogleDrivePermissionRole, GoogleDriveFilePermission\n'), ((313, 419), 'gdstorage.storage.GoogleDriveFilePermission', 'GoogleDriv... |
from django.contrib import admin
from django.urls import path
from django.conf.urls import include
from web import urls as web_urls
urlpatterns = [
path("admin/", admin.site.urls),
path("", include(web_urls)),
]
| [
"django.conf.urls.include",
"django.urls.path"
] | [((154, 185), 'django.urls.path', 'path', (['"""admin/"""', 'admin.site.urls'], {}), "('admin/', admin.site.urls)\n", (158, 185), False, 'from django.urls import path\n'), ((200, 217), 'django.conf.urls.include', 'include', (['web_urls'], {}), '(web_urls)\n', (207, 217), False, 'from django.conf.urls import include\n')... |
import sox
import os
from pprint import pprint
numbers_map = {
'0':'không',
'1': 'một',
'2': 'hai',
'3': 'ba',
'4': 'bốn',
'5': 'năm',
'6': 'sáu',
'7': 'bảy',
'8': 'tám',
'9': 'chín'
}
def segment_data(path):
# id = [1 2 3 4
starts = [0.5, 2.9, 4.9, 6.9]
ends... | [
"os.listdir",
"sox.Transformer"
] | [((445, 461), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n', (455, 461), False, 'import os\n'), ((1707, 1728), 'os.listdir', 'os.listdir', ([], {'path': 'path'}), '(path=path)\n', (1717, 1728), False, 'import os\n'), ((736, 756), 'os.listdir', 'os.listdir', (['p_folder'], {}), '(p_folder)\n', (746, 756), False... |
import json
from typing import Dict, Union
from django.forms import ClearableFileInput
from django.http import QueryDict
from django.utils.datastructures import MultiValueDict
from django.utils.translation import gettext as _
from django_file_form.util import compact
from .uploaded_file import PlaceholderUploadedFile,... | [
"json.loads",
"json.dumps",
"django.utils.translation.gettext"
] | [((375, 386), 'django.utils.translation.gettext', '_', (['"""Cancel"""'], {}), "('Cancel')\n", (376, 386), True, 'from django.utils.translation import gettext as _\n'), ((402, 413), 'django.utils.translation.gettext', '_', (['"""Delete"""'], {}), "('Delete')\n", (403, 413), True, 'from django.utils.translation import g... |
"""Test the hyparviewpy.util module."""
import asyncio
import inspect
import io
import random
import unittest
from hyparviewpy import util
from .tools import async_test
class Test_Util(unittest.TestCase):
def test_log(self):
"""Test the debug logger."""
f = io.StringIO('')
log = util.Log... | [
"hyparviewpy.util.Log",
"inspect.isawaitable",
"asyncio.sleep",
"hyparviewpy.util.unpack_nid",
"hyparviewpy.util.sample_set",
"hyparviewpy.util.run_callback",
"hyparviewpy.util.unpack_data",
"io.StringIO",
"random.randint"
] | [((282, 297), 'io.StringIO', 'io.StringIO', (['""""""'], {}), "('')\n", (293, 297), False, 'import io\n'), ((312, 330), 'hyparviewpy.util.Log', 'util.Log', (['f', '(False)'], {}), '(f, False)\n', (320, 330), False, 'from hyparviewpy import util\n'), ((446, 463), 'hyparviewpy.util.Log', 'util.Log', (['f', '(True)'], {})... |
#!/usr/bin/env python
from setuptools import setup, find_packages
setup(name='paramparser',
version='0.1',
description='Read parameters from file',
author='<NAME>',
py_modules=['paramparser']
)
| [
"setuptools.setup"
] | [((68, 199), 'setuptools.setup', 'setup', ([], {'name': '"""paramparser"""', 'version': '"""0.1"""', 'description': '"""Read parameters from file"""', 'author': '"""<NAME>"""', 'py_modules': "['paramparser']"}), "(name='paramparser', version='0.1', description=\n 'Read parameters from file', author='<NAME>', py_modu... |
from __future__ import print_function
import pytest
from hashlib import sha256
import json
import re
import sys
import numpy as np
import flowpipe.utilities as util
class WeirdObject(object):
"""An object that is not json serializable and has no bytes() interface."""
foo = "bar"
def test_node_encoder()... | [
"hashlib.sha256",
"json.loads",
"json.dumps",
"flowpipe.utilities.get_hash",
"numpy.arange"
] | [((439, 463), 'json.dumps', 'json.dumps', (['valid_object'], {}), '(valid_object)\n', (449, 463), False, 'import json\n'), ((485, 508), 'json.loads', 'json.loads', (['json_string'], {}), '(json_string)\n', (495, 508), False, 'import json\n'), ((664, 710), 'json.dumps', 'json.dumps', (['bytes_object'], {'cls': 'util.Nod... |
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in th... | [
"numpy.mean",
"collections.OrderedDict",
"numpy.allclose",
"unittest.mock.Mock",
"numpy.unique",
"numpy.isclose",
"numpy.ones",
"pickle.load",
"numpy.argmax",
"os.path.isfile",
"numpy.array",
"mxnet.module.Module.load",
"numpy.sum",
"numpy.array_equal",
"xfer.load",
"xfer.BnnRepurposer... | [((1017, 1085), 'unittest.mock.patch', 'patch', (['RepurposerTestUtils.META_MODEL_REPURPOSER_MODEL_HANDLER_CLASS'], {}), '(RepurposerTestUtils.META_MODEL_REPURPOSER_MODEL_HANDLER_CLASS)\n', (1022, 1085), False, 'from unittest.mock import Mock, patch\n'), ((1639, 1692), 'numpy.loadtxt', 'np.loadtxt', (["(self._test_data... |
import FWCore.ParameterSet.Config as cms
from Configuration.Eras.Era_Phase2C11M9_cff import Phase2C11M9
process = cms.Process('HGCAL',Phase2C11M9)
# import of standard configurations
process.load('Configuration.StandardSequences.Services_cff')
process.load('FWCore.MessageService.MessageLogger_cfi')
process.load('Conf... | [
"FWCore.ParameterSet.Config.Schedule",
"FWCore.ParameterSet.Config.untracked.string",
"Configuration.AlCa.GlobalTag.GlobalTag",
"FWCore.ParameterSet.Config.EndPath",
"FWCore.ParameterSet.Config.untracked.int32",
"FWCore.ParameterSet.Config.untracked.uint32",
"FWCore.ParameterSet.Config.Process",
"FWCo... | [((115, 148), 'FWCore.ParameterSet.Config.Process', 'cms.Process', (['"""HGCAL"""', 'Phase2C11M9'], {}), "('HGCAL', Phase2C11M9)\n", (126, 148), True, 'import FWCore.ParameterSet.Config as cms\n'), ((1560, 1621), 'Configuration.AlCa.GlobalTag.GlobalTag', 'GlobalTag', (['process.GlobalTag', '"""auto:phase2_realistic_T21... |
import tensorrt as trt
import pycuda.driver as cuda
import pycuda.autoinit
import numpy as np
import cv2
class pose:
# constructor
def __init__(self):
self.TRT_LOGGER = trt.Logger(trt.Logger.WARNING)
self.trt_runtime = trt.Runtime(self.TRT_LOGGER)
self.load_engine('donModel.plan')
... | [
"numpy.copyto",
"tensorrt.nptype",
"pycuda.driver.mem_alloc",
"tensorrt.Profiler",
"pycuda.driver.Stream",
"numpy.asarray",
"pycuda.driver.memcpy_htod_async",
"tensorrt.Logger",
"tensorrt.Runtime",
"numpy.load",
"pycuda.driver.memcpy_dtoh_async"
] | [((2420, 2444), 'numpy.load', 'np.load', (['input_file_path'], {}), '(input_file_path)\n', (2427, 2444), True, 'import numpy as np\n'), ((188, 218), 'tensorrt.Logger', 'trt.Logger', (['trt.Logger.WARNING'], {}), '(trt.Logger.WARNING)\n', (198, 218), True, 'import tensorrt as trt\n'), ((246, 274), 'tensorrt.Runtime', 't... |
import time
import board
import digitalio
from adafruit_hid.mouse import Mouse
mouse = Mouse()
# define buttons. these can be any physical switches/buttons, but the values
# here work out-of-the-box with a CircuitPlayground Express' A and B buttons.
up = digitalio.DigitalInOut(board.D4)
up.direction = digit... | [
"adafruit_hid.mouse.Mouse",
"digitalio.DigitalInOut",
"time.sleep"
] | [((93, 100), 'adafruit_hid.mouse.Mouse', 'Mouse', ([], {}), '()\n', (98, 100), False, 'from adafruit_hid.mouse import Mouse\n'), ((266, 298), 'digitalio.DigitalInOut', 'digitalio.DigitalInOut', (['board.D4'], {}), '(board.D4)\n', (288, 298), False, 'import digitalio\n'), ((382, 414), 'digitalio.DigitalInOut', 'digitali... |
import unittest
from tests.test_utils import get_sample_pdf_with_labels, get_sample_pdf, get_sample_sdf, get_sample_pdf_with_extra_cols, get_sample_pdf_with_no_text_col ,get_sample_spark_dataframe
from nlu import *
class TestYake(unittest.TestCase):
def test_yake_model(self):
#setting meta to true will ou... | [
"unittest.main"
] | [((1579, 1594), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1592, 1594), False, 'import unittest\n')] |
from decimal import Decimal
from oscar.apps.basket.abstract_models import AbstractBasket, AbstractLine
from oscarbluelight.mixins import BluelightBasketMixin, BluelightBasketLineMixin
from oscarbluelight.offer.groups import (
register_system_offer_group,
pre_offer_group_apply_receiver,
)
class Basket(Blueligh... | [
"oscarbluelight.offer.groups.register_system_offer_group",
"oscarbluelight.offer.groups.pre_offer_group_apply_receiver",
"decimal.Decimal"
] | [((607, 653), 'oscarbluelight.offer.groups.register_system_offer_group', 'register_system_offer_group', (['"""post-tax-offers"""'], {}), "('post-tax-offers')\n", (634, 653), False, 'from oscarbluelight.offer.groups import register_system_offer_group, pre_offer_group_apply_receiver\n'), ((657, 750), 'oscarbluelight.offe... |
# Lint as: python3
# Copyright 2021 The TensorFlow 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 ... | [
"numpy.prod",
"lingvo.jax.tasks.lm.input_generator.SyntheticLmData.Params",
"jax.local_device_count",
"lingvo.jax.optimizers.Adam.Params",
"math.sqrt",
"lingvo.jax.layers.StackedTransformer.Params",
"lingvo.jax.model.LanguageModel.Params",
"lingvo.jax.schedules.LinearRampupExponentialDecay.Params",
... | [((1429, 1453), 'jax.local_device_count', 'jax.local_device_count', ([], {}), '()\n', (1451, 1453), False, 'import jax\n'), ((1529, 1569), 'lingvo.jax.tasks.lm.input_generator.SyntheticLmData.Params', 'input_generator.SyntheticLmData.Params', ([], {}), '()\n', (1567, 1569), False, 'from lingvo.jax.tasks.lm import input... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('trees', '0005_auto_20150505_1217'),
]
operations = [
migrations.AlterModelOptions(
name='treephoto',
... | [
"django.db.migrations.AlterModelOptions",
"django.db.models.IntegerField"
] | [((249, 360), 'django.db.migrations.AlterModelOptions', 'migrations.AlterModelOptions', ([], {'name': '"""treephoto"""', 'options': "{'ordering': ['-display_order', 'submitted_date']}"}), "(name='treephoto', options={'ordering': [\n '-display_order', 'submitted_date']})\n", (277, 360), False, 'from django.db import ... |
import matplotlib.pyplot as plt
import numpy as np
'''
plt.figure()
plt.subplot(1,2,1)
linear_data = np.array([1,2,3,4,5,6,7,8])
plt.plot(linear_data, '-o')
exponential_data = linear_data**2
plt.subplot(1,2,2)
plt.plot(exponential_data, '-o')
plt.subplot(1,2,1)
plt.plot(exponential_data,'-x')
... | [
"numpy.random.normal",
"matplotlib.pyplot.hist2d",
"numpy.random.random",
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.figure"
] | [((3724, 3736), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (3734, 3736), True, 'import matplotlib.pyplot as plt\n'), ((3743, 3791), 'numpy.random.normal', 'np.random.normal', ([], {'loc': '(0.0)', 'scale': '(1.0)', 'size': '(10000)'}), '(loc=0.0, scale=1.0, size=10000)\n', (3759, 3791), True, 'import n... |
import os
import urllib.request
import urllib.error
import json
import hashlib
class Scraper:
def __init__(self, log_file):
self._errors = {}
# Set default log path
self.log_file = log_file
def download(self, url, file_path, header={}):
self.log("Starting download: " + url)
... | [
"os.path.dirname",
"os.path.splitext",
"json.dump"
] | [((1030, 1051), 'os.path.splitext', 'os.path.splitext', (['url'], {}), '(url)\n', (1046, 1051), False, 'import os\n'), ((2987, 3037), 'json.dump', 'json.dump', (['data', 'outfile'], {'sort_keys': '(True)', 'indent': '(4)'}), '(data, outfile, sort_keys=True, indent=4)\n', (2996, 3037), False, 'import json\n'), ((348, 37... |
# Keypirinha launcher (keypirinha.com)
import re
import os
import keypirinha as kp
import keypirinha_util as kpu
import keypirinha_net as kpnet
from todoist.api import TodoistAPI
class Todoist(kp.Plugin):
DEFAULT_ADD_TASK_LABEL = "atodoist"
DEFAULT_LIST_ALL_TASKS = "todoist"
DEFAULT_PROJECT_NAME = "Inbox"... | [
"todoist.api.TodoistAPI"
] | [((1037, 1064), 'todoist.api.TodoistAPI', 'TodoistAPI', (['self.user_token'], {}), '(self.user_token)\n', (1047, 1064), False, 'from todoist.api import TodoistAPI\n')] |
# Player
import pygame
import math
import Color
import Ship
import Creature
import DrawINFO
from Vex import Vex
from RPGStats import RPGStats
from ParticleEngine import Emitter
from Planets import Planets
from Asteroid import Asteroid
class Player:
sensorPoints = []
sensorEdges = []
... | [
"Ship.Ship.add_unoccupied",
"Ship.Ship.remove_unoccupied",
"Creature.Creature",
"Ship.Ship",
"Vex.Vex",
"math.cos",
"Planets.Planets.inAtmosphere",
"pygame.mouse.get_rel",
"math.sin",
"RPGStats.RPGStats"
] | [((431, 454), 'Creature.Creature', 'Creature.Creature', (['self'], {}), '(self)\n', (448, 454), False, 'import Creature\n'), ((534, 549), 'Ship.Ship', 'Ship.Ship', (['self'], {}), '(self)\n', (543, 549), False, 'import Ship\n'), ((684, 711), 'Vex.Vex', 'Vex', (['pos[0]', 'pos[1]', 'pos[2]'], {}), '(pos[0], pos[1], pos[... |
#
# Copyright (c), 2018-2021, SISSA (International School for Advanced Studies).
# All rights reserved.
# This file is distributed under the terms of the MIT License.
# See the file 'LICENSE' in the root directory of the present
# distribution, or http://opensource.org/licenses/MIT.
#
# @author <NAME> <<EMAIL>>
#
"""
H... | [
"collections.Counter",
"urllib.parse.urlparse"
] | [((10031, 10061), 'collections.Counter', 'Counter', (['[e.tag for e in elem]'], {}), '([e.tag for e in elem])\n', (10038, 10061), False, 'from collections import Counter\n'), ((10078, 10137), 'collections.Counter', 'Counter', (['[t for t in children_tags if children_tags[t] > 1]'], {}), '([t for t in children_tags if c... |
# Copyright 2019 Google LLC
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd
import sys
import numpy as np
import dex_binary_object as dbo
sys.path.append("../jax")
from examples import datasets
def on... | [
"numpy.max",
"dex_binary_object.dump",
"examples.datasets.mnist",
"sys.path.append",
"numpy.arange"
] | [((257, 282), 'sys.path.append', 'sys.path.append', (['"""../jax"""'], {}), "('../jax')\n", (272, 282), False, 'import sys\n'), ((949, 970), 'dex_binary_object.dump', 'dbo.dump', (['data_out', 'f'], {}), '(data_out, f)\n', (957, 970), True, 'import dex_binary_object as dbo\n'), ((435, 448), 'numpy.max', 'np.max', (['xs... |