code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from dataclasses import dataclass, field
from typing import Optional
from xsdata.models.datatype import XmlDateTime
__NAMESPACE__ = "NISTSchema-SV-IV-atomic-dateTime-minInclusive-3-NS"
@dataclass
class NistschemaSvIvAtomicDateTimeMinInclusive3:
class Meta:
name = "NISTSchema-SV-IV-atomic-dateTime-minIncl... | [
"xsdata.models.datatype.XmlDateTime"
] | [((545, 582), 'xsdata.models.datatype.XmlDateTime', 'XmlDateTime', (['(1978)', '(11)', '(30)', '(10)', '(14)', '(33)'], {}), '(1978, 11, 30, 10, 14, 33)\n', (556, 582), False, 'from xsdata.models.datatype import XmlDateTime\n')] |
#! /usr/bin/env python3
import argparse
import os
import sys
from arcadeutils import FileBytes, BinaryDiff
from naomi import NaomiEEPRom, NaomiRom
from naomi.settings import SettingsManager
# The root of the repo.
root = os.path.realpath(os.path.join(os.path.dirname(os.path.realpath(__file__)), ".."))
def main() -... | [
"argparse.ArgumentParser",
"arcadeutils.BinaryDiff.diff",
"os.path.realpath",
"naomi.settings.SettingsManager",
"arcadeutils.FileBytes",
"naomi.NaomiRom",
"os.linesep.join",
"os.path.join"
] | [((373, 497), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Command-Line Utility for patching different game defaults into a Naomi ROM."""'}), "(description=\n 'Command-Line Utility for patching different game defaults into a Naomi ROM.'\n )\n", (396, 497), False, 'import argparse... |
from ops.data import OpsClass, OpsField, DszObject, DszCommandObject, cmd_definitions
import dsz
class AuditingEventData(DszObject, ):
def __init__(self, dszpath='', cmdid=None, opsclass=None, parent=None, debug=False):
DszObject.__init__(self, dszpath, cmdid, dszauditevent, parent, debug)
def __get... | [
"ops.data.OpsField",
"ops.data.DszObject.__init__",
"ops.data.OpsClass"
] | [((1407, 1461), 'ops.data.OpsClass', 'OpsClass', (['"""audit"""', "{'status': audit}", 'DszCommandObject'], {}), "('audit', {'status': audit}, DszCommandObject)\n", (1415, 1461), False, 'from ops.data import OpsClass, OpsField, DszObject, DszCommandObject, cmd_definitions\n'), ((235, 305), 'ops.data.DszObject.__init__'... |
from json import dumps
from werkzeug.security import generate_password_hash, check_password_hash
from . import db
from .utils import timestamp
class User(db.Model):
"""The User model"""
__tablename__ = 'users'
id = db.Column(db.Integer, primary_key=True)
email = db.Column(db.String(256),... | [
"werkzeug.security.check_password_hash",
"werkzeug.security.generate_password_hash"
] | [((532, 581), 'werkzeug.security.check_password_hash', 'check_password_hash', (['self.password_hash', 'password'], {}), '(self.password_hash, password)\n', (551, 581), False, 'from werkzeug.security import generate_password_hash, check_password_hash\n'), ((894, 926), 'werkzeug.security.generate_password_hash', 'generat... |
from __future__ import print_function
import csv
import sys
from django.contrib.auth import authenticate
from django.contrib.auth import get_user_model
from django.core.management.base import BaseCommand
User = get_user_model()
class Command(BaseCommand):
"""
Format CSV: name,email,password
"""
hel... | [
"csv.reader",
"django.contrib.auth.get_user_model",
"django.contrib.auth.authenticate",
"sys.exc_info"
] | [((214, 230), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (228, 230), False, 'from django.contrib.auth import get_user_model\n'), ((646, 663), 'csv.reader', 'csv.reader', (['csv_f'], {}), '(csv_f)\n', (656, 663), False, 'import csv\n'), ((1293, 1337), 'django.contrib.auth.authenticate', 'a... |
from django.conf import settings
from django.db import models
class HouseInfo(models.Model):
class Meta:
db_table = "houseinfo"
houseID = models.CharField(primary_key=True, max_length=50)
community = models.CharField(max_length=50)
decoration = models.CharField(max_length=50)
direction = ... | [
"django.db.models.CharField",
"django.db.models.DateTimeField"
] | [((157, 206), 'django.db.models.CharField', 'models.CharField', ([], {'primary_key': '(True)', 'max_length': '(50)'}), '(primary_key=True, max_length=50)\n', (173, 206), False, 'from django.db import models\n'), ((223, 254), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(50)'}), '(max_length=50... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | [
"singa.tensor.Tensor",
"singa.tensor.zeros_like",
"singa.autograd.clip",
"singa.autograd.backward"
] | [((5797, 5820), 'singa.autograd.backward', 'autograd.backward', (['loss'], {}), '(loss)\n', (5814, 5820), False, 'from singa import autograd\n'), ((8597, 8620), 'singa.autograd.backward', 'autograd.backward', (['loss'], {}), '(loss)\n', (8614, 8620), False, 'from singa import autograd\n'), ((9658, 9681), 'singa.autogra... |
# Copyright 2017-2018 Intel Corporation., Tieto
#
# 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 agree... | [
"tools.tasks.run_task",
"src.dpdk.dpdk.init",
"tools.tasks.Process.kill",
"src.dpdk.dpdk.cleanup",
"tools.tasks.Process.start",
"conf.settings.getValue",
"re.search",
"tools.tasks.terminate_task"
] | [((2684, 2718), 'conf.settings.getValue', 'S.getValue', (['"""VSWITCH_VPP_CLI_SOCK"""'], {}), "('VSWITCH_VPP_CLI_SOCK')\n", (2694, 2718), True, 'from conf import settings as S\n'), ((3119, 3137), 'conf.settings.getValue', 'S.getValue', (['"""NICS"""'], {}), "('NICS')\n", (3129, 3137), True, 'from conf import settings a... |
from typing import List, Optional
from moodle import MoodleWarning, ResponsesFactory
from moodle.attr import dataclass, field
@dataclass
class ActivityCompletion:
"""Activity Completion
Args:
cmid (int): comment ID
modname (str): activity module name
instance (int): instance ID
... | [
"moodle.attr.field"
] | [((1275, 1294), 'moodle.attr.field', 'field', ([], {'factory': 'list'}), '(factory=list)\n', (1280, 1294), False, 'from moodle.attr import dataclass, field\n'), ((1331, 1350), 'moodle.attr.field', 'field', ([], {'factory': 'list'}), '(factory=list)\n', (1336, 1350), False, 'from moodle.attr import dataclass, field\n')] |
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2
from sp... | [
"grpc.method_handlers_generic_handler",
"grpc.unary_unary_rpc_method_handler",
"grpc.experimental.unary_unary"
] | [((7212, 7322), 'grpc.method_handlers_generic_handler', 'grpc.method_handlers_generic_handler', (['"""spaceone.api.power_scheduler.v1.ScheduleRule"""', 'rpc_method_handlers'], {}), "(\n 'spaceone.api.power_scheduler.v1.ScheduleRule', rpc_method_handlers)\n", (7248, 7322), False, 'import grpc\n'), ((4936, 5253), 'grp... |
import sys, os
sys.path.append('yolov3_detector')
from yolov3_custom_helper import yolo_detector
from darknet import Darknet
sys.path.append('pytorch-YOLOv4')
from tool.darknet2pytorch import Darknet as DarknetYolov4
import argparse
import cv2,time
import numpy as np
from tool.plateprocessing import find_coordinates, p... | [
"sys.path.append",
"cv2.resize",
"os.path.join",
"cv2.cvtColor",
"cv2.waitKey",
"cv2.imshow",
"tool.utils.plot_boxes_cv2",
"utility_codes.tsv_converter.ConverterTSV",
"cv2.destroyAllWindows",
"tool.darknet2pytorch.Darknet",
"os.listdir",
"cv2.namedWindow"
] | [((15, 49), 'sys.path.append', 'sys.path.append', (['"""yolov3_detector"""'], {}), "('yolov3_detector')\n", (30, 49), False, 'import sys, os\n'), ((125, 158), 'sys.path.append', 'sys.path.append', (['"""pytorch-YOLOv4"""'], {}), "('pytorch-YOLOv4')\n", (140, 158), False, 'import sys, os\n'), ((709, 734), 'tool.darknet2... |
"""The tests for local file camera component."""
from unittest.mock import mock_open, patch, PropertyMock
import pytest
from homeassistant.components import camera
from homeassistant.components.camera import STATE_STREAMING, STATE_IDLE
from homeassistant.exceptions import HomeAssistantError
from homeassistant.setup i... | [
"homeassistant.components.camera.async_turn_off",
"homeassistant.setup.async_setup_component",
"homeassistant.components.camera.async_get_image",
"unittest.mock.patch",
"homeassistant.components.camera.async_turn_on",
"pytest.raises",
"unittest.mock.mock_open",
"homeassistant.components.camera.enable_... | [((820, 846), 'unittest.mock.mock_open', 'mock_open', ([], {'read_data': "b'ON'"}), "(read_data=b'ON')\n", (829, 846), False, 'from unittest.mock import mock_open, patch, PropertyMock\n'), ((3283, 3341), 'homeassistant.components.camera.enable_motion_detection', 'camera.enable_motion_detection', (['hass', '"""camera.de... |
import os
import subprocess
LIBRARY_DEPENDENCY = "dev-dependencies"
def create_directory(path):
if not os.path.exists(path):
os.makedirs(path)
def create_directories(directory_list: list):
for directory in directory_list:
create_directory(directory)
def execute_command(home, command):
... | [
"subprocess.run",
"os.makedirs",
"os.path.exists",
"os.environ.get",
"os.path.join"
] | [((321, 366), 'subprocess.run', 'subprocess.run', (['command'], {'shell': '(True)', 'cwd': 'home'}), '(command, shell=True, cwd=home)\n', (335, 366), False, 'import subprocess\n'), ((424, 450), 'os.environ.get', 'os.environ.get', (['"""git_path"""'], {}), "('git_path')\n", (438, 450), False, 'import os\n'), ((671, 700)... |
# Импорт математической библиотеки #
import math
from math import log, sin, pi
# Ввод значений а и х #
a = float(input("Введите а: "))
x = float(input("Введите x: "))
# Выбор формулы #
print(" 1 - Вычислить функцию G\n "
" 2 - Вычислить функцию F\n "
" 3 - Вычислить функцию Y\n ")
num1 = float(input('З... | [
"math.log",
"math.sin"
] | [((586, 635), 'math.sin', 'sin', (['(pi * (10 * a ** 2 + 37 * a * x + 7 * x ** 2))'], {}), '(pi * (10 * a ** 2 + 37 * a * x + 7 * x ** 2))\n', (589, 635), False, 'from math import log, sin, pi\n'), ((755, 802), 'math.log', 'log', (['(-5 * a ** 2 - 16 * a * x + 16 * x ** 2 + 1)'], {}), '(-5 * a ** 2 - 16 * a * x + 16 * ... |
import json
import pytest
from builtins import str
from httpretty import httpretty
from rasa_core import utils
from rasa_core.utils import EndpointConfig
def test_is_int():
assert utils.is_int(1)
assert utils.is_int(1.0)
assert not utils.is_int(None)
assert not utils.is_int(1.2)
assert not utils... | [
"rasa_core.utils.subsample_array",
"rasa_core.utils.one_hot",
"rasa_core.utils.is_int",
"httpretty.httpretty.register_uri",
"rasa_core.utils.EndpointConfig",
"rasa_core.utils.cap_length",
"rasa_core.server.create_app",
"httpretty.httpretty.enable",
"rasa_core.utils.list_routes",
"rasa_core.utils.r... | [((188, 203), 'rasa_core.utils.is_int', 'utils.is_int', (['(1)'], {}), '(1)\n', (200, 203), False, 'from rasa_core import utils\n'), ((215, 232), 'rasa_core.utils.is_int', 'utils.is_int', (['(1.0)'], {}), '(1.0)\n', (227, 232), False, 'from rasa_core import utils\n'), ((424, 484), 'rasa_core.utils.subsample_array', 'ut... |
"""Monitor Docker main component."""
import asyncio
import logging
import time
import threading
import voluptuous as vol
from datetime import timedelta
import homeassistant.helpers.config_validation as cv
from .helpers import DockerAPI
from homeassistant.const import (
CONF_MONITORED_CONDITIONS,
CONF_NAME,... | [
"threading.Thread",
"voluptuous.Optional",
"voluptuous.Any",
"asyncio.set_event_loop",
"logging.getLogger",
"time.sleep",
"datetime.timedelta",
"asyncio.new_event_loop"
] | [((951, 978), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (968, 978), False, 'import logging\n'), ((1004, 1025), 'datetime.timedelta', 'timedelta', ([], {'seconds': '(10)'}), '(seconds=10)\n', (1013, 1025), False, 'from datetime import timedelta\n'), ((1069, 1114), 'voluptuous.Optional... |
import os
def get_base_dir():
return os.path.dirname(__file__)
def get_path_to_file_in_assets(*args):
return os.path.join(get_base_dir(), 'assets', *args)
def get_path_to_image_file_in_assets(*args):
return os.path.join(get_base_dir(), 'assets', 'images', *args)
def get_path_to_model_dir_in_assets(*... | [
"os.path.dirname"
] | [((43, 68), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (58, 68), False, 'import os\n')] |
from data_wizard.signals import progress
from data_wizard.settings import get_setting, import_from_string
def create_backend():
backend_path = get_setting('BACKEND')
backend_class = import_from_string(backend_path + '.Backend', 'BACKEND')
backend = backend_class()
progress.connect(backend.progress, we... | [
"data_wizard.signals.progress.connect",
"data_wizard.settings.import_from_string",
"data_wizard.settings.get_setting"
] | [((149, 171), 'data_wizard.settings.get_setting', 'get_setting', (['"""BACKEND"""'], {}), "('BACKEND')\n", (160, 171), False, 'from data_wizard.settings import get_setting, import_from_string\n'), ((192, 248), 'data_wizard.settings.import_from_string', 'import_from_string', (["(backend_path + '.Backend')", '"""BACKEND"... |
import force_connectivity
import thinkstats
import math
def Mean(t):
return float(sum(t) / len(t))
def Var(t, mu=None):
if mu is None:
mu = Mean(t)
dev2 = [(x-mu)**2 for x in t]
var = Mean(dev2)
return var
def std(variance):
return math.sqrt(variance)
def PartitionRecords(table):
accepted_sms = force_co... | [
"force_connectivity.Cases",
"math.sqrt"
] | [((245, 264), 'math.sqrt', 'math.sqrt', (['variance'], {}), '(variance)\n', (254, 264), False, 'import math\n'), ((312, 338), 'force_connectivity.Cases', 'force_connectivity.Cases', ([], {}), '()\n', (336, 338), False, 'import force_connectivity\n'), ((349, 375), 'force_connectivity.Cases', 'force_connectivity.Cases', ... |
#!/usr/bin/env python3
import sys
import re
import json
class CAliasTable:
""" Provides context to alias mapping """
def __init__ (self):
self.current_alias = 0
self.context_to_alias = {}
self.alias_to_context = {}
self.alias_description = {}
def base_add (self, key):
... | [
"json.loads"
] | [((7909, 7925), 'json.loads', 'json.loads', (['text'], {}), '(text)\n', (7919, 7925), False, 'import json\n')] |
"""
Geopoints - Plot Text Labels at Geopoints Locations
"""
# (C) Copyright 2017- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
#
# In applying this licence, ECMWF does not waive the privileges and immunitie... | [
"metview.gallery.load_dataset",
"metview.pdf_output",
"metview.msymb",
"metview.exist",
"metview.plot",
"metview.read",
"metview.mcoast"
] | [((540, 558), 'metview.exist', 'mv.exist', (['filename'], {}), '(filename)\n', (548, 558), True, 'import metview as mv\n'), ((857, 1199), 'metview.msymb', 'mv.msymb', ([], {'legend': '"""off"""', 'symbol_type': '"""text"""', 'symbol_table_mode': '"""advanced"""', 'symbol_advanced_table_selection_type': '"""list"""', 's... |
from skfda.representation.basis import (Basis, FDataBasis, Constant, Monomial,
BSpline, Fourier)
from skfda.representation.grid import FDataGrid
from skfda import concatenate
import unittest
import numpy as np
class TestBasis(unittest.TestCase):
# def setUp(self): could b... | [
"numpy.sin",
"numpy.arange",
"numpy.testing.assert_array_almost_equal",
"numpy.atleast_2d",
"unittest.main",
"skfda.representation.basis.BSpline",
"numpy.testing.assert_almost_equal",
"numpy.identity",
"numpy.linspace",
"numpy.testing.assert_equal",
"numpy.testing.assert_raises",
"skfda.repres... | [((22203, 22218), 'unittest.main', 'unittest.main', ([], {}), '()\n', (22216, 22218), False, 'import unittest\n'), ((409, 429), 'numpy.linspace', 'np.linspace', (['(0)', '(1)', '(5)'], {}), '(0, 1, 5)\n', (420, 429), True, 'import numpy as np\n'), ((504, 530), 'skfda.representation.basis.BSpline', 'BSpline', (['(0, 1)'... |
import board
import bot
class Game:
def __init__(self):
self.width = 7
self.height = 6
self.connect = 4
self.bots = [False, True]
self.score = [0, 0]
self.grid = board.Board(self.width, self.height, self.connect)
def setBoard(self, width, height, connect):
... | [
"board.Board"
] | [((215, 265), 'board.Board', 'board.Board', (['self.width', 'self.height', 'self.connect'], {}), '(self.width, self.height, self.connect)\n', (226, 265), False, 'import board\n'), ((422, 457), 'board.Board', 'board.Board', (['width', 'height', 'connect'], {}), '(width, height, connect)\n', (433, 457), False, 'import bo... |
from paradigm import catalog
from tests.utils import pack
from .utils import (identifiers,
modules,
to_homogeneous_tuples)
objects_paths = to_homogeneous_tuples(identifiers).map(pack(catalog.Path))
non_empty_objects_paths = (to_homogeneous_tuples(identifiers,
... | [
"tests.utils.pack"
] | [((219, 237), 'tests.utils.pack', 'pack', (['catalog.Path'], {}), '(catalog.Path)\n', (223, 237), False, 'from tests.utils import pack\n'), ((394, 412), 'tests.utils.pack', 'pack', (['catalog.Path'], {}), '(catalog.Path)\n', (398, 412), False, 'from tests.utils import pack\n')] |
# coding: utf-8
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# ---------------------------------------------------------------------... | [
"_shared.testcase.BodyReplacerProcessor",
"_shared.communication_service_preparer.CommunicationServicePreparer",
"_shared.helper.URIIdentityReplacer",
"devtools_testutils.ResourceGroupPreparer",
"azure.communication.administration.CommunicationIdentityClient.from_connection_string"
] | [((969, 1016), 'devtools_testutils.ResourceGroupPreparer', 'ResourceGroupPreparer', ([], {'random_name_enabled': '(True)'}), '(random_name_enabled=True)\n', (990, 1016), False, 'from devtools_testutils import ResourceGroupPreparer\n'), ((1022, 1052), '_shared.communication_service_preparer.CommunicationServicePreparer'... |
from django.urls import path
from rest_framework_simplejwt import views as jwt_views
from django_react_template.users.api.views import UserCreate, HelloWorld, LogoutAndBlacklistRefreshTokenForUserView
app_name = "users"
urlpatterns = [
path('create/', UserCreate.as_view(), name="create_user"),
path('token/o... | [
"django_react_template.users.api.views.LogoutAndBlacklistRefreshTokenForUserView.as_view",
"django_react_template.users.api.views.UserCreate.as_view",
"rest_framework_simplejwt.views.TokenRefreshView.as_view",
"django_react_template.users.api.views.HelloWorld.as_view",
"rest_framework_simplejwt.views.TokenO... | [((260, 280), 'django_react_template.users.api.views.UserCreate.as_view', 'UserCreate.as_view', ([], {}), '()\n', (278, 280), False, 'from django_react_template.users.api.views import UserCreate, HelloWorld, LogoutAndBlacklistRefreshTokenForUserView\n'), ((329, 368), 'rest_framework_simplejwt.views.TokenObtainPairView.... |
#!/usr/bin/env python
#-*- coding:utf-8; mode:python; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*-
import time
from bes.testing.unit_test import unit_test
import os, os.path as path, tempfile
from bes.fs.file_checksum_db import file_checksum_db
from bes.fs.file_util import file_util
from bes.fs.temp_file... | [
"bes.fs.temp_file.temp_file.make_temp_file",
"time.sleep",
"bes.fs.file_util.file_util.checksum",
"bes.testing.unit_test.unit_test.main",
"bes.fs.file_checksum_db.file_checksum_db",
"bes.docker.docker.docker.raise_skip_if_running_under_docker"
] | [((2328, 2344), 'bes.testing.unit_test.unit_test.main', 'unit_test.main', ([], {}), '()\n', (2342, 2344), False, 'from bes.testing.unit_test import unit_test\n'), ((461, 504), 'bes.docker.docker.docker.raise_skip_if_running_under_docker', 'docker.raise_skip_if_running_under_docker', ([], {}), '()\n', (502, 504), False,... |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import math
from copy import deepcopy
from compas.geometry import scale_vector
from compas.geometry import normalize_vector
from compas.geometry import subtract_vectors
from compas.geometry import cross_vecto... | [
"compas.geometry.multiply_matrix_vector",
"copy.deepcopy",
"compas.geometry.transpose_matrix",
"compas.geometry.scale_vector",
"math.tan",
"compas.geometry.multiply_matrices",
"compas.geometry.length_vector",
"math.sin",
"compas.geometry.cross_vectors",
"math.acos",
"compas.geometry.subtract_vec... | [((5491, 5518), 'compas.geometry.transpose_matrix', 'transpose_matrix', (['cofactors'], {}), '(cofactors)\n', (5507, 5518), False, 'from compas.geometry import transpose_matrix\n'), ((7541, 7560), 'compas.geometry.transpose_matrix', 'transpose_matrix', (['M'], {}), '(M)\n', (7557, 7560), False, 'from compas.geometry im... |
"""
This is an example how to train SentenceTransformers in a multi-task setup.
The system trains BERT on the AllNLI and on the STSbenchmark dataset.
"""
from torch.utils.data import DataLoader
import math
from sentence_transformers import models, losses
from sentence_transformers import SentencesDataset, LoggingHandl... | [
"sentence_transformers.SentencesDataset",
"sentence_transformers.util.http_get",
"gzip.open",
"torch.utils.data.DataLoader",
"sentence_transformers.models.Transformer",
"csv.DictReader",
"os.path.exists",
"sentence_transformers.LoggingHandler",
"logging.info",
"sentence_transformers.losses.CosineS... | [((1606, 1636), 'sentence_transformers.models.Transformer', 'models.Transformer', (['model_name'], {}), '(model_name)\n', (1624, 1636), False, 'from sentence_transformers import models, losses\n'), ((1976, 2042), 'sentence_transformers.SentenceTransformer', 'SentenceTransformer', ([], {'modules': '[word_embedding_model... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-04-10 08:25
from __future__ import unicode_literals
import area_riservata.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('area_riservata', '0003_auto_20170408_1901'),
]
operati... | [
"django.db.models.FileField"
] | [((435, 524), 'django.db.models.FileField', 'models.FileField', ([], {'blank': '(True)', 'null': '(True)', 'upload_to': 'area_riservata.models.relURI_path'}), '(blank=True, null=True, upload_to=area_riservata.models.\n relURI_path)\n', (451, 524), False, 'from django.db import migrations, models\n')] |
# Copyright 2019 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... | [
"pcf.particle.aws.glacier.glacier_vault.GlacierVault",
"boto3.Session",
"placebo.attach",
"os.path.dirname",
"os.path.join"
] | [((1125, 1140), 'boto3.Session', 'boto3.Session', ([], {}), '()\n', (1138, 1140), False, 'import boto3\n'), ((1159, 1184), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (1174, 1184), False, 'import os\n'), ((1204, 1235), 'os.path.join', 'os.path.join', (['dirname', '"""replay"""'], {}), "(di... |
"""
Global fixtures and functions for pytest
pytest can only share fixtures between modules if they are declared here.
"""
import logging
import os
import pytest
from loguru import logger
import genomepy.providers
from genomepy.providers.base import BaseProvider
from genomepy.providers.ensembl import EnsemblProvider
... | [
"genomepy.providers.url.UrlProvider",
"os.remove",
"genomepy.providers.local.LocalProvider",
"os.path.dirname",
"pytest.fixture",
"os.path.exists",
"genomepy.providers.ucsc.UcscProvider",
"genomepy.providers.ncbi.NcbiProvider",
"genomepy.providers.base.BaseProvider",
"loguru.logger.remove",
"gen... | [((574, 606), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""'}), "(scope='function')\n", (588, 606), False, 'import pytest\n'), ((1458, 1490), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""'}), "(scope='function')\n", (1472, 1490), False, 'import pytest\n'), ((1615, 1647), 'pytes... |
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name='aogl',
version='0.1',
author="<NAME>",
author_email="<EMAIL>",
description="A python package to retrieve the latest 10 blog posts from https://ao.gl",
long_description=long_descripti... | [
"setuptools.setup"
] | [((88, 630), 'setuptools.setup', 'setuptools.setup', ([], {'name': '"""aogl"""', 'version': '"""0.1"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'description': '"""A python package to retrieve the latest 10 blog posts from https://ao.gl"""', 'long_description': 'long_description', 'long_description_c... |
'''
img tools
包含图片处理常见工具.
function:
1. get_img(getpath, gray=False, scale_percent=100) 根据路径返回img/灰度选择/缩放
2. save_img(savepath, img) 保存图片
3. plot_line_chart(y1, y2, y3) 画折线图 暂不完善
4. cut_pic(img,pattern=0, up = 0, down = 0, left = 0, right = 0) 切割图片/比例切割/像素切割
5. plot_3d_line(x, z, y, over, x_max, y_max, z_max) ... | [
"sys.path.append",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"matplotlib.font_manager.FontProperties",
"matplotlib.pyplot.axes",
"cv2.imwrite",
"matplotlib.pyplot.legend",
"cv2.cvtColor",
"matplotlib.pyplot.clf",
"cv2.imread",
"matplotlib.pyplot.figure",
... | [((412, 433), 'sys.path.append', 'sys.path.append', (['"""./"""'], {}), "('./')\n", (427, 433), False, 'import sys\n'), ((699, 718), 'cv2.imread', 'cv2.imread', (['getpath'], {}), '(getpath)\n', (709, 718), False, 'import cv2\n'), ((1227, 1253), 'cv2.imwrite', 'cv2.imwrite', (['savepath', 'img'], {}), '(savepath, img)\... |
from lxml import etree
def write_node_path(path_nodes, tree):
"""Writes nodes to tree starting from root."""
parent = tree.getroot()
path = "."
for node in path_nodes:
path += "/" + node
check_node = tree.find(path)
if check_node is None:
parent.insert(-1, etree.Elem... | [
"lxml.etree.Element"
] | [((534, 553), 'lxml.etree.Element', 'etree.Element', (['node'], {}), '(node)\n', (547, 553), False, 'from lxml import etree\n'), ((310, 329), 'lxml.etree.Element', 'etree.Element', (['node'], {}), '(node)\n', (323, 329), False, 'from lxml import etree\n')] |
import numpy as np
import torch as torch
import random
import copy
__all__ = ['WordDrop','NumericalChange','GaussianNoise','FragmentTransfer','Reverse']
class GaussianNoise():
def __init__(self):
pass
def __call__(self, sequence, mode):
def get_parameter(m, mode):
para = [... | [
"torch.mean",
"torch.flip",
"torch.full_like",
"torch.var",
"random.randint",
"torch.sqrt",
"random.shuffle",
"torch.add",
"random.sample",
"torch.randn",
"torch.cat",
"torch.mul",
"torch.seed",
"torch.max",
"torch.chunk",
"torch.tensor",
"torch.Generator"
] | [((11657, 11698), 'torch.randn', 'torch.randn', (['(4, 20)'], {'dtype': 'torch.float32'}), '((4, 20), dtype=torch.float32)\n', (11668, 11698), True, 'import torch as torch\n'), ((1058, 1092), 'torch.Generator', 'torch.Generator', ([], {'device': 'var.device'}), '(device=var.device)\n', (1073, 1092), True, 'import torch... |
import sys
sys.argv.pop(0)
number = 1
for arg in sys.argv:
print(f"{number}. {arg}")
number += 1 | [
"sys.argv.pop"
] | [((12, 27), 'sys.argv.pop', 'sys.argv.pop', (['(0)'], {}), '(0)\n', (24, 27), False, 'import sys\n')] |
# 3. Use `functools.wraps` to preserve the function attributes
# including the docstring that you wrote.
# 1. Write a function decorator that can be used to measure
# the run time of a functions. Use `timeit.default_timer` to get time stamps.
import functools
from timeit import default_timer as timer
def runtime1(fu... | [
"timeit.default_timer",
"functools.wraps"
] | [((330, 351), 'functools.wraps', 'functools.wraps', (['func'], {}), '(func)\n', (345, 351), False, 'import functools\n'), ((403, 410), 'timeit.default_timer', 'timer', ([], {}), '()\n', (408, 410), True, 'from timeit import default_timer as timer\n'), ((459, 466), 'timeit.default_timer', 'timer', ([], {}), '()\n', (464... |
import numpy as np
import sys as sys
import csv
sys.path.insert(1, './../Tools')
from DispersionRelationDeterminantFullConductivityZeff import VectorFinder_auto_Extensive
#************Start of user block******************
#para= [nu, zeff,eta, shat, beta, ky, mu]
para_min=[0.1, 1., 0.5, 0.001,0.0005, 0.01, 0.... | [
"csv.writer",
"sys.path.insert",
"numpy.imag",
"numpy.array",
"DispersionRelationDeterminantFullConductivityZeff.VectorFinder_auto_Extensive",
"numpy.real",
"numpy.random.rand"
] | [((48, 80), 'sys.path.insert', 'sys.path.insert', (['(1)', '"""./../Tools"""'], {}), "(1, './../Tools')\n", (63, 80), True, 'import sys as sys\n'), ((505, 523), 'numpy.array', 'np.array', (['para_min'], {}), '(para_min)\n', (513, 523), True, 'import numpy as np\n'), ((533, 551), 'numpy.array', 'np.array', (['para_max']... |
from honeygrove.tests.testresources import __path__ as resources
import uuid
# HoneytokenDB configuration:
honeytokendbProbabilities = {"TESTSERVICEA": 0.5, "TESTSERVICEB": 0.1, "LISTEN": 0.1}
HPID = str(uuid.uuid4())
# Path to Filesystem all services are using
path_to_filesys = resources._path[0] + '/test_filesys.x... | [
"uuid.uuid4"
] | [((206, 218), 'uuid.uuid4', 'uuid.uuid4', ([], {}), '()\n', (216, 218), False, 'import uuid\n')] |
from PIL import Image, ImageDraw
MAP_BACKGROUND_FILE='input.png'
width=100;height=100
map_background = Image.open(MAP_BACKGROUND_FILE).convert('RGBA')
map_mesh = Image.new('RGBA', (width, height), (0, 0, 0, 0))
draw = ImageDraw.Draw(map_mesh)
# Create mesh using: draw.line([...], fill=(255, 255, 255, 50), width=1)
m... | [
"ImageDraw.Draw",
"Image.new",
"Image.open",
"Image.composite"
] | [((163, 211), 'Image.new', 'Image.new', (['"""RGBA"""', '(width, height)', '(0, 0, 0, 0)'], {}), "('RGBA', (width, height), (0, 0, 0, 0))\n", (172, 211), False, 'import Image, ImageDraw, random\n'), ((219, 243), 'ImageDraw.Draw', 'ImageDraw.Draw', (['map_mesh'], {}), '(map_mesh)\n', (233, 243), False, 'import Image, Im... |
# -*- coding: utf-8 -*-
# Natural Language Toolkit: Twitter API
#
# Copyright (C) 2001-2015 NLTK Project
# Author: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
This module provides an interface for TweetHandlers, and support for timezone... | [
"datetime.datetime.strptime",
"datetime.timedelta",
"datetime.datetime"
] | [((969, 1003), 'datetime.timedelta', 'timedelta', ([], {'seconds': '(-_time.timezone)'}), '(seconds=-_time.timezone)\n', (978, 1003), False, 'from datetime import tzinfo, timedelta, datetime\n'), ((1051, 1084), 'datetime.timedelta', 'timedelta', ([], {'seconds': '(-_time.altzone)'}), '(seconds=-_time.altzone)\n', (1060... |
#!/usr/bin/env python3
import glob
import regex as re
import os.path
import nltk.data
from nltk.tokenize.nist import NISTTokenizer
def collapse(s):
s = re.sub(r'(http|ftp|https)://([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])?', 'URLTOKEN', s)
s = s.replace('...', 'ELIPSISTOKEN')
return... | [
"regex.sub",
"nltk.tokenize.nist.NISTTokenizer",
"glob.glob"
] | [((159, 282), 'regex.sub', 're.sub', (['"""(http|ftp|https)://([\\\\w_-]+(?:(?:\\\\.[\\\\w_-]+)+))([\\\\w.,@?^=%&:/~+#-]*[\\\\w@?^=%&/~+#-])?"""', '"""URLTOKEN"""', 's'], {}), "(\n '(http|ftp|https)://([\\\\w_-]+(?:(?:\\\\.[\\\\w_-]+)+))([\\\\w.,@?^=%&:/~+#-]*[\\\\w@?^=%&/~+#-])?'\n , 'URLTOKEN', s)\n", (165, 282... |
from spada.methods import method
class GetSwitches(method.Method):
def __init__(self, annotation = 'annotation.pklz'):
method.Method.__init__(self, __name__, annotation)
self._genes.flushSwitches()
def run(self, switchesFile):
self.logger.info("Reading switches.")
self._genes.readSwitches(switchesFile, sel... | [
"spada.methods.method.Method.__init__"
] | [((123, 173), 'spada.methods.method.Method.__init__', 'method.Method.__init__', (['self', '__name__', 'annotation'], {}), '(self, __name__, annotation)\n', (145, 173), False, 'from spada.methods import method\n')] |
# Copyright (C) 2022. Huawei Technologies Co., Ltd. All rights reserved.
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation the rights to use, co... | [
"math.sqrt",
"torch.matmul",
"torch.tensor",
"torch.nn.functional.softmax"
] | [((1772, 1867), 'torch.tensor', 'torch.tensor', (['[[[1.0, 1.0, 2.0, 0.0, 5.0], [-1.0, 2.0, 2.0, 0.0, 5.0]]]'], {'requires_grad': '(True)'}), '([[[1.0, 1.0, 2.0, 0.0, 5.0], [-1.0, 2.0, 2.0, 0.0, 5.0]]],\n requires_grad=True)\n', (1784, 1867), False, 'import torch\n'), ((1878, 1910), 'torch.tensor', 'torch.tensor', (... |
# -*- coding: utf-8 -*-
# BioSTEAM: The Biorefinery Simulation and Techno-Economic Analysis Modules
# Copyright (C) 2020, <NAME> <<EMAIL>>
#
# This module is under the UIUC open-source license. See
# github.com/BioSTEAMDevelopmentGroup/biosteam/blob/master/LICENSE.txt
# for license details.
"""
"""
import biosteam as... | [
"biosteam.Unit.__init__"
] | [((865, 911), 'biosteam.Unit.__init__', 'bst.Unit.__init__', (['self', 'ID', 'ins', 'outs', 'thermo'], {}), '(self, ID, ins, outs, thermo)\n', (882, 911), True, 'import biosteam as bst\n'), ((2808, 2854), 'biosteam.Unit.__init__', 'bst.Unit.__init__', (['self', 'ID', 'ins', 'outs', 'thermo'], {}), '(self, ID, ins, outs... |
from cosmic_ray.operators import zero_iteration_loop
from cosmic_ray.plugins import get_test_runner
from cosmic_ray.work_item import WorkItem
from cosmic_ray.worker import worker, WorkerOutcome
from path_utils import DATA_DIR, excursion, extend_path
def test_no_test_return_value():
with extend_path(DATA_DIR), ex... | [
"path_utils.extend_path",
"cosmic_ray.work_item.WorkItem",
"cosmic_ray.plugins.get_test_runner",
"cosmic_ray.worker.worker",
"path_utils.excursion"
] | [((295, 316), 'path_utils.extend_path', 'extend_path', (['DATA_DIR'], {}), '(DATA_DIR)\n', (306, 316), False, 'from path_utils import DATA_DIR, excursion, extend_path\n'), ((318, 337), 'path_utils.excursion', 'excursion', (['DATA_DIR'], {}), '(DATA_DIR)\n', (327, 337), False, 'from path_utils import DATA_DIR, excursion... |
#!/usr/bin/env python3
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
r"""
Class describing a flow configuration object
"""
import datetime
import logging as log
import pprint
from shutil import which
from .utils impor... | [
"logging.error",
"pprint.pformat",
"logging.debug",
"logging.log",
"shutil.which",
"datetime.datetime.strptime",
"datetime.timedelta",
"datetime.datetime.now"
] | [((415, 444), 'pprint.pformat', 'pprint.pformat', (['self.__dict__'], {}), '(self.__dict__)\n', (429, 444), False, 'import pprint\n'), ((485, 514), 'pprint.pformat', 'pprint.pformat', (['self.__dict__'], {}), '(self.__dict__)\n', (499, 514), False, 'import pprint\n'), ((16648, 16725), 'logging.log', 'log.log', (['VERBO... |
# -*- coding: utf-8 -*-
from openerp import fields, models, api
from openerp.tools.translate import html_translate
class to_affiliate_advertisement(models.Model):
_description = "Store advertisement for affiliate partner to chose installing on their website."
_name = "to.affiliate.advertisement"
imag... | [
"openerp.fields.Html",
"openerp.fields.Binary",
"openerp.fields.Boolean",
"openerp.fields.Char"
] | [((324, 360), 'openerp.fields.Binary', 'fields.Binary', ([], {'string': '"""Banner Image"""'}), "(string='Banner Image')\n", (337, 360), False, 'from openerp import fields, models, api\n'), ((371, 404), 'openerp.fields.Char', 'fields.Char', ([], {'string': '"""Url to Nomi"""'}), "(string='Url to Nomi')\n", (382, 404), ... |
import logging
import torch
from rl_agents.agents.common.memory import Transition
from rl_agents.agents.common.models import model_factory
from rl_agents.agents.common.optimizers import loss_function_factory, optimizer_factory
from rl_agents.agents.common.utils import choose_device
from rl_agents.agents.deep_q_network... | [
"rl_agents.agents.common.memory.Transition",
"rl_agents.agents.common.optimizers.loss_function_factory",
"torch.load",
"torch.save",
"torch.zeros",
"torch.tensor",
"torch.no_grad",
"rl_agents.agents.common.models.model_factory",
"rl_agents.agents.common.utils.choose_device",
"logging.getLogger"
] | [((364, 391), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (381, 391), False, 'import logging\n'), ((547, 582), 'rl_agents.agents.common.models.model_factory', 'model_factory', (["self.config['model']"], {}), "(self.config['model'])\n", (560, 582), False, 'from rl_agents.agents.common.m... |
#!/usr/bin/env python3get_coo
"""
Lattice dynamics model
"""
import h5py
import os
from itertools import product
import numpy as np
from numpy.linalg import norm
import scipy.linalg
import scipy.io
import scipy.sparse
from scipy.sparse import lil_matrix as spmat
from .basic_lattice_model import BasicLatticeModel
f... | [
"numpy.abs",
"numpy.sum",
"f_phonon.f_phonon.get_dm",
"numpy.ones",
"scipy.sparse.lil_matrix",
"os.path.isfile",
"numpy.arange",
"numpy.linalg.norm",
"numpy.mean",
"numpy.exp",
"numpy.full",
"os.path.abspath",
"numpy.zeros_like",
"os.path.dirname",
"numpy.savetxt",
"os.path.exists",
... | [((778, 805), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (795, 805), False, 'import logging\n'), ((6201, 6223), 'numpy.array', 'np.array', (['self.fct_ord'], {}), '(self.fct_ord)\n', (6209, 6223), True, 'import numpy as np\n'), ((11246, 11266), 'numpy.zeros', 'np.zeros', (['self.ncorr... |
from typing import List, Optional, Union
from aiocqhttp import Event as CQEvent
from aiocqhttp.bus import EventBus
from . import NoneBot
from .log import logger
from .exceptions import CQHttpError
from .session import BaseSession
from .typing import NoticeHandler_T, RequestHandler_T
class EventHandler:
"""INTE... | [
"aiocqhttp.bus.EventBus"
] | [((568, 578), 'aiocqhttp.bus.EventBus', 'EventBus', ([], {}), '()\n', (576, 578), False, 'from aiocqhttp.bus import EventBus\n')] |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import json
import multiprocessing
import os
import subprocess
import time
import redis
from utils import get_node_details, set_node_details
INSPECT_CONTAINER_COMMAND = "docker inspect {container}"
GET_CONTAINERS_COMMAND = "docker container l... | [
"redis.Redis",
"subprocess.run",
"json.load",
"json.loads",
"utils.get_node_details",
"time.sleep",
"os.path.expanduser",
"utils.set_node_details"
] | [((1388, 1482), 'redis.Redis', 'redis.Redis', ([], {'host': 'master_hostname', 'port': 'redis_port', 'charset': '"""utf-8"""', 'decode_responses': '(True)'}), "(host=master_hostname, port=redis_port, charset='utf-8',\n decode_responses=True)\n", (1399, 1482), False, 'import redis\n'), ((1800, 1899), 'utils.get_node_... |
# -*- coding: UTF-8 -*-
import flask
import os
import sys
import socket
PACKAGE_PARENT = '../..'
SCRIPT_DIR = os.path.dirname(os.path.realpath(os.path.join(os.getcwd(), os.path.expanduser(__file__))))
sys.path.append(os.path.normpath(os.path.join(SCRIPT_DIR, PACKAGE_PARENT)))
print(sys.path)
from src.log.utils impor... | [
"os.path.expanduser",
"os.getcwd",
"socket.socket",
"flask.Flask",
"os.system",
"os.path.exists",
"os.path.join"
] | [((758, 774), 'os.system', 'os.system', (['"""pwd"""'], {}), "('pwd')\n", (767, 774), False, 'import os\n'), ((808, 849), 'flask.Flask', 'flask.Flask', (['__name__'], {'static_folder': 'path'}), '(__name__, static_folder=path)\n', (819, 849), False, 'import flask\n'), ((237, 277), 'os.path.join', 'os.path.join', (['SCR... |
# -*- coding: utf-8 -*-
# Copyright 2020 Green Valley Belgium NV
#
# 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 appl... | [
"mcfw.serialization.s_long_list",
"mcfw.properties.azzert",
"zlib.decompress",
"StringIO.StringIO",
"mcfw.serialization.ds_long_list"
] | [((1003, 1030), 'mcfw.properties.azzert', 'azzert', (['(model and prop_name)'], {}), '(model and prop_name)\n', (1009, 1030), False, 'from mcfw.properties import azzert\n'), ((1192, 1214), 'zlib.decompress', 'zlib.decompress', (['value'], {}), '(value)\n', (1207, 1214), False, 'import zlib\n'), ((1920, 1945), 'mcfw.ser... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import itertools
import os
import os.path
import sys
import logging
def cartesian_product(dicts):
return (dict(zip(dicts, x)) for x in itertools.product(*dicts.values()))
def summary(configuration):
kvs = sorted([(k, v) for k, v in configuration.items()], key... | [
"os.path.isfile",
"os.path.exists",
"os.makedirs",
"logging.basicConfig"
] | [((1322, 1354), 'os.path.exists', 'os.path.exists', (['"""/home/ucacmin/"""'], {}), "('/home/ucacmin/')\n", (1336, 1354), False, 'import os\n'), ((2482, 2521), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (2501, 2521), False, 'import logging\n'), ((1632, 1655)... |
from unittest.mock import MagicMock, patch
from pydantic_kms_secrets.kms import decrypt, encrypt
ENCRYPTED_BYTES = (
b"\x01\x02\x02\x00x@\xcau^\xa5\x9c\xdd\x1e\xed\xe0\x00w]A\xba-\x83\x89\xb2"
b"N\x98<?\x10vkL\xd3\x87\x03:\xa6\x01X\x12\xc7Y\x1d\x17\xe2a\xef\xa0Pz\xef\x81"
b"\xc2\x04\x00\x00\x00c0a\x06\t*... | [
"unittest.mock.patch",
"pydantic_kms_secrets.kms.encrypt",
"pydantic_kms_secrets.kms.decrypt",
"unittest.mock.MagicMock"
] | [((882, 921), 'unittest.mock.patch', 'patch', (['"""pydantic_kms_secrets.kms.boto3"""'], {}), "('pydantic_kms_secrets.kms.boto3')\n", (887, 921), False, 'from unittest.mock import MagicMock, patch\n'), ((1277, 1316), 'unittest.mock.patch', 'patch', (['"""pydantic_kms_secrets.kms.boto3"""'], {}), "('pydantic_kms_secrets... |
# Copyright (c) 2019-2020, <NAME>
# License: MIT License
from typing import (
TYPE_CHECKING, Union, Iterable, cast, Tuple, Sequence, Optional,
)
from copy import deepcopy
from ezdxf.lldxf.attributes import (
DXFAttr, DXFAttributes, DefSubclass, group_code_mapping,
)
from ezdxf.lldxf.const import DXF12, SUBCLASS... | [
"copy.deepcopy",
"typing.cast",
"ezdxf.lldxf.attributes.DXFAttributes",
"ezdxf.lldxf.tags.Tags",
"ezdxf.lldxf.attributes.DXFAttr",
"ezdxf.tools.complex_ltype.lin_compiler",
"ezdxf.lldxf.types.DXFTag",
"ezdxf.lldxf.attributes.group_code_mapping"
] | [((1110, 1143), 'ezdxf.lldxf.attributes.group_code_mapping', 'group_code_mapping', (['acdb_linetype'], {}), '(acdb_linetype)\n', (1128, 1143), False, 'from ezdxf.lldxf.attributes import DXFAttr, DXFAttributes, DefSubclass, group_code_mapping\n'), ((4404, 4470), 'ezdxf.lldxf.attributes.DXFAttributes', 'DXFAttributes', (... |
import glob
import os
import rawpy
import numpy as np
# Returns a tuble
def getInputImagesList():
# Get all short exposure images
res = glob.glob('./dataset/sony/short/0*.ARW')
res.sort()
return (res, [int(os.path.basename(res)[0:5]) for res in res])
def getGroundtruthImagesList():
# Get all shor... | [
"numpy.maximum",
"os.path.basename",
"numpy.expand_dims",
"glob.glob",
"numpy.concatenate"
] | [((146, 186), 'glob.glob', 'glob.glob', (['"""./dataset/sony/short/0*.ARW"""'], {}), "('./dataset/sony/short/0*.ARW')\n", (155, 186), False, 'import glob\n'), ((348, 387), 'glob.glob', 'glob.glob', (['"""./dataset/sony/long/0*.ARW"""'], {}), "('./dataset/sony/long/0*.ARW')\n", (357, 387), False, 'import glob\n'), ((511... |
import regex
import lib.logger as logging
from lib.functions import wait_until
from lib.game import ui
from lib.game.battle_bot import ManualBattleBot
from lib.game.missions.missions import Missions
logger = logging.get_logger(__name__)
class WorldBossInvasion(Missions):
"""Class for working with World Boss Inv... | [
"lib.logger.get_logger",
"regex.compile",
"lib.functions.wait_until",
"lib.game.battle_bot.ManualBattleBot",
"lib.game.ui.get_by_name"
] | [((210, 238), 'lib.logger.get_logger', 'logging.get_logger', (['__name__'], {}), '(__name__)\n', (228, 238), True, 'import lib.logger as logging\n'), ((7669, 7748), 'lib.functions.wait_until', 'wait_until', (['self.emulator.is_ui_element_on_screen'], {'ui_element': 'ui.INVASION_LABEL'}), '(self.emulator.is_ui_element_o... |
#!/usr/bin/env python3
import sys
import re
import argparse
from collections import Counter
def main():
parser = argparse.ArgumentParser(
"print_phonemes.py",
description="Prints the unique set of phonemes from a pronunciation dictionary",
)
parser.add_argument("dictionary", help="Path to ... | [
"collections.Counter",
"re.split",
"argparse.ArgumentParser"
] | [((119, 249), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['"""print_phonemes.py"""'], {'description': '"""Prints the unique set of phonemes from a pronunciation dictionary"""'}), "('print_phonemes.py', description=\n 'Prints the unique set of phonemes from a pronunciation dictionary')\n", (142, 249), Fal... |
import datetime
import importlib
import sys
# Force CPython to use the pure-Python implementation of the datetime module
# for testing. https://stackoverflow.com/a/62506055/232571
sys.modules["_datetime"] = None
importlib.reload(datetime)
| [
"importlib.reload"
] | [((213, 239), 'importlib.reload', 'importlib.reload', (['datetime'], {}), '(datetime)\n', (229, 239), False, 'import importlib\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# File: example_stream_signal.py
#
# Part of ‘UNICORN Binance WebSocket API’
# Project website: https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api
# Documentation: https://oliver-zehentleitner.github.io/unicorn-binance-websocket-api
# PyPI: https://pyp... | [
"unicorn_binance_websocket_api.unicorn_binance_websocket_api_manager.BinanceWebSocketApiManager",
"threading.Thread",
"os.path.basename",
"time.sleep"
] | [((2026, 2086), 'unicorn_binance_websocket_api.unicorn_binance_websocket_api_manager.BinanceWebSocketApiManager', 'BinanceWebSocketApiManager', ([], {'enable_stream_signal_buffer': '(True)'}), '(enable_stream_signal_buffer=True)\n', (2052, 2086), False, 'from unicorn_binance_websocket_api.unicorn_binance_websocket_api_... |
# -*- coding: utf-8 -*-
"""
.. moduleauthor:: <NAME> <<EMAIL>>
"""
from csv import DictReader
from io import TextIOWrapper
from nose.tools import eq_
from pkg_resources import resource_stream
def full_test():
reader = DictReader(TextIOWrapper(resource_stream('pycaptioner', 'test/data/points.csv')))
for line ... | [
"pkg_resources.resource_stream"
] | [((250, 304), 'pkg_resources.resource_stream', 'resource_stream', (['"""pycaptioner"""', '"""test/data/points.csv"""'], {}), "('pycaptioner', 'test/data/points.csv')\n", (265, 304), False, 'from pkg_resources import resource_stream\n')] |
from redis import Redis
# TODO: 初始化redis实例变量
cache = Redis(host='192.168.184.128', port=6379, password='<PASSWORD>')
# TODO: 1.对字符串操作
print('对字符串操作.....')
cache.set(name='username', value='zhiliao')
print(cache.get('username'))
cache.delete('username')
cache.set(name='read_count', value=1)
cache.incr(name='read_count... | [
"redis.Redis"
] | [((54, 117), 'redis.Redis', 'Redis', ([], {'host': '"""192.168.184.128"""', 'port': '(6379)', 'password': '"""<PASSWORD>"""'}), "(host='192.168.184.128', port=6379, password='<PASSWORD>')\n", (59, 117), False, 'from redis import Redis\n')] |
# Copyright 2014 Intel Corporation, 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 ... | [
"django.utils.translation.ugettext_lazy",
"logging.getLogger",
"horizon.forms.PasswordInput"
] | [((706, 733), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (723, 733), False, 'import logging\n'), ((902, 918), 'django.utils.translation.ugettext_lazy', '_', (['"""Tenant Name"""'], {}), "('Tenant Name')\n", (903, 918), True, 'from django.utils.translation import ugettext_lazy as _\n')... |
# coding=utf-8
import xml.etree.ElementTree as ET
import sys
import os
import glob
import shutil
import cv2
from multiprocessing import Pool
from multiprocessing import Manager
from multiprocessing import Process
import numpy as np
import pickle
def restore_file(path):
df = open(path, 'rb')
file = pickle.load... | [
"xml.etree.ElementTree.parse",
"pickle.dump",
"os.mkdir",
"os.path.basename",
"cv2.imwrite",
"os.path.exists",
"cv2.imread",
"pickle.load",
"numpy.arange",
"glob.glob",
"shutil.copyfile",
"multiprocessing.Process",
"os.listdir",
"cv2.resize"
] | [((309, 324), 'pickle.load', 'pickle.load', (['df'], {}), '(df)\n', (320, 324), False, 'import pickle\n'), ((634, 652), 'xml.etree.ElementTree.parse', 'ET.parse', (['xml_path'], {}), '(xml_path)\n', (642, 652), True, 'import xml.etree.ElementTree as ET\n'), ((1723, 1760), 'glob.glob', 'glob.glob', (['"""cuhk03_annotati... |
# this is a short and simple script
# for taking the total deaths and putting them in a more human readable format
import pandas as pd
countries = ["South Korea", "United States"]
diseases = ["1918h1n1", "coronavirus", "measles", "smallpox"]
files = [cnt + "_" + dis + ".csv" for cnt in countries for dis in diseases]... | [
"pandas.read_csv",
"pandas.DataFrame.from_dict"
] | [((755, 787), 'pandas.DataFrame.from_dict', 'pd.DataFrame.from_dict', (['out_dict'], {}), '(out_dict)\n', (777, 787), True, 'import pandas as pd\n'), ((502, 540), 'pandas.read_csv', 'pd.read_csv', (["('output-data/' + datafile)"], {}), "('output-data/' + datafile)\n", (513, 540), True, 'import pandas as pd\n')] |
# coding: utf-8
import pprint
import re
import six
class RefreshPreheatingBody:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the va... | [
"six.iteritems"
] | [((6835, 6868), 'six.iteritems', 'six.iteritems', (['self.openapi_types'], {}), '(self.openapi_types)\n', (6848, 6868), False, 'import six\n')] |
#!/usr/bin/python
import cv2.cv as cv
import time
cv.NamedWindow("camera", 1)
capture = cv.CaptureFromCAM(0)
while True:
img = cv.QueryFrame(capture)
cv.ShowImage("camera", img)
if cv.WaitKey(10) == 27:
break
cv.DestroyAllWindows()
| [
"cv2.cv.NamedWindow",
"cv2.cv.WaitKey",
"cv2.cv.QueryFrame",
"cv2.cv.CaptureFromCAM",
"cv2.cv.ShowImage",
"cv2.cv.DestroyAllWindows"
] | [((52, 79), 'cv2.cv.NamedWindow', 'cv.NamedWindow', (['"""camera"""', '(1)'], {}), "('camera', 1)\n", (66, 79), True, 'import cv2.cv as cv\n'), ((91, 111), 'cv2.cv.CaptureFromCAM', 'cv.CaptureFromCAM', (['(0)'], {}), '(0)\n', (108, 111), True, 'import cv2.cv as cv\n'), ((233, 255), 'cv2.cv.DestroyAllWindows', 'cv.Destr... |
#pylint: disable=E1101, E0401, E1102, W0621, W0221
import argparse
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import random
import time
from random import SystemRandom
import models
import utils
parser = argparse.ArgumentParser()
parser.add_argument('--niters', type=int, default... | [
"utils.get_activity_data",
"numpy.random.seed",
"argparse.ArgumentParser",
"torch.cat",
"torch.randn",
"torch.exp",
"random.seed",
"torch.nn.Linear",
"torch.manual_seed",
"torch.cuda.manual_seed",
"torch.optim.Adam",
"torch.cuda.is_available",
"utils.count_parameters",
"torch.nn.ReLU",
"... | [((245, 270), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (268, 270), False, 'import argparse\n'), ((1963, 1986), 'torch.manual_seed', 'torch.manual_seed', (['seed'], {}), '(seed)\n', (1980, 1986), False, 'import torch\n'), ((1991, 2011), 'numpy.random.seed', 'np.random.seed', (['seed'], {})... |
from socialauth.models import AuthMeta, OpenidProfile, TwitterUserProfile, \
FacebookUserProfile, LinkedInUserProfile, GithubUserProfile, FoursquareUserProfile
from django.contrib import admin
admin.site.register(AuthMeta)
admin.site.register(OpenidProfile)
admin.site.register(TwitterUserProfile)
admin.site.register(... | [
"django.contrib.admin.site.register"
] | [((195, 224), 'django.contrib.admin.site.register', 'admin.site.register', (['AuthMeta'], {}), '(AuthMeta)\n', (214, 224), False, 'from django.contrib import admin\n'), ((225, 259), 'django.contrib.admin.site.register', 'admin.site.register', (['OpenidProfile'], {}), '(OpenidProfile)\n', (244, 259), False, 'from django... |
__author__ = 'Arseniy'
from model.project import Project
import string
import random
def random_name(prefix, maxlen):
symbols = string.ascii_letters
return prefix + "".join([random.choice(symbols) for i in range(random.randrange(maxlen))])
def test_add_project(app):
app.session.login("administrator", "r... | [
"random.randrange",
"random.choice"
] | [((184, 206), 'random.choice', 'random.choice', (['symbols'], {}), '(symbols)\n', (197, 206), False, 'import random\n'), ((222, 246), 'random.randrange', 'random.randrange', (['maxlen'], {}), '(maxlen)\n', (238, 246), False, 'import random\n')] |
import pytest
from .solution import solve, Vent
INPUT = """0,9 -> 5,9
8,0 -> 0,8
9,4 -> 3,4
2,2 -> 2,1
7,0 -> 7,4
6,4 -> 2,0
0,9 -> 2,9
3,4 -> 1,4
0,0 -> 8,8
5,5 -> 8,2
"""
POINTS = [
(1, 1, 3, 3, [(1,1), (2, 2), (3, 3)]),
(3, 3, 1, 1, [(1,1), (2, 2), (3, 3)]),
(5, 5, 8, 2, [(5,5), (6, 4), (7, 3), (8, 2)... | [
"pytest.mark.parametrize"
] | [((328, 385), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""x1, y1, x2, y2, points"""', 'POINTS'], {}), "('x1, y1, x2, y2, points', POINTS)\n", (351, 385), False, 'import pytest\n')] |
from django import forms
from django.contrib.auth import authenticate
from django.utils.encoding import smart_text
from django.utils.translation import ugettext as _
from .. import scope
from ..constants import RESPONSE_TYPE_CHOICES, SCOPES
from ..forms import OAuthForm, OAuthValidationError
from ..scope import SCOPE_N... | [
"django.forms.BooleanField",
"django.forms.URLField",
"django.utils.translation.ugettext",
"django.forms.CharField",
"django.utils.encoding.smart_text"
] | [((959, 976), 'django.forms.CharField', 'forms.CharField', ([], {}), '()\n', (974, 976), False, 'from django import forms\n'), ((997, 1014), 'django.forms.CharField', 'forms.CharField', ([], {}), '()\n', (1012, 1014), False, 'from django import forms\n'), ((3694, 3725), 'django.forms.CharField', 'forms.CharField', ([],... |
"""Gaussian process-based minimization algorithms."""
import numpy as np
from sklearn.utils import check_random_state
from .base import base_minimize
from ..utils import cook_estimator
from ..utils import normalize_dimensions
def gp_minimize(func, dimensions, base_estimator=None,
n_calls=100, n_ran... | [
"sklearn.utils.check_random_state",
"numpy.iinfo"
] | [((10132, 10164), 'sklearn.utils.check_random_state', 'check_random_state', (['random_state'], {}), '(random_state)\n', (10150, 10164), False, 'from sklearn.utils import check_random_state\n'), ((10342, 10360), 'numpy.iinfo', 'np.iinfo', (['np.int32'], {}), '(np.int32)\n', (10350, 10360), True, 'import numpy as np\n')] |
# Copyright 2020 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | [
"numpy.abs",
"gan.utils.apply_external_world_force_on_local_point",
"torch.no_grad",
"os.path.join",
"collections.deque",
"gym.utils.seeding.np_random",
"gan.utils.push_recent_value",
"gan.utils.perturb",
"gan.utils.load",
"numpy.minimum",
"numpy.tanh",
"pybullet_utils.bullet_client.BulletClie... | [((3675, 3691), 'collections.deque', 'deque', ([], {'maxlen': '(10)'}), '(maxlen=10)\n', (3680, 3691), False, 'from collections import deque\n'), ((3723, 3739), 'collections.deque', 'deque', ([], {'maxlen': '(10)'}), '(maxlen=10)\n', (3728, 3739), False, 'from collections import deque\n'), ((5809, 5873), 'gym.spaces.Bo... |
from .utils import *
from ytmusicapi.helpers import to_int
from .songs import parse_song_runs, parse_like_status
def parse_album_header(response):
header = nav(response, HEADER_DETAIL)
album = {
'title': nav(header, TITLE_TEXT),
'type': nav(header, SUBTITLE),
'thumbnails': nav(header, ... | [
"ytmusicapi.helpers.to_int"
] | [((625, 676), 'ytmusicapi.helpers.to_int', 'to_int', (["header['secondSubtitle']['runs'][0]['text']"], {}), "(header['secondSubtitle']['runs'][0]['text'])\n", (631, 676), False, 'from ytmusicapi.helpers import to_int\n')] |
"""
This script acts as a placeholder to set a threshold for cands >b
and compare those cands with our gold data.
"""
import csv
import logging
import os
import pickle
from enum import Enum
import numpy as np
from tqdm import tqdm
from hack.transistors.transistor_utils import (
Score,
compare_entities,
en... | [
"os.path.abspath",
"hack.transistors.transistor_utils.Score",
"csv.reader",
"csv.writer",
"hack.transistors.transistor_utils.get_implied_parts",
"logging.StreamHandler",
"hack.transistors.transistor_utils.entity_level_scores",
"pickle.load",
"numpy.linspace",
"hack.transistors.transistor_utils.get... | [((747, 774), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (764, 774), False, 'import logging\n'), ((1041, 1091), 'os.path.join', 'os.path.join', (['dirname', '"""data/parts_by_doc_new.pkl"""'], {}), "(dirname, 'data/parts_by_doc_new.pkl')\n", (1053, 1091), False, 'import os\n'), ((4082... |
import tkinter
from tkinter import *
from PIL import ImageTk, Image #PIL -> Pillow
import pymysql
from tkinter import messagebox
from AddBook import *
from DeleteBook import *
from ViewBook import *
from IssueBook import *
# # Connecting to MySql Server
# mypass = "<PASSWORD>" # Use your own password
# mydatabase = "d... | [
"PIL.ImageTk.PhotoImage",
"PIL.Image.open"
] | [((713, 734), 'PIL.Image.open', 'Image.open', (['"""lib.jpg"""'], {}), "('lib.jpg')\n", (723, 734), False, 'from PIL import ImageTk, Image\n'), ((1057, 1093), 'PIL.ImageTk.PhotoImage', 'ImageTk.PhotoImage', (['background_image'], {}), '(background_image)\n', (1075, 1093), False, 'from PIL import ImageTk, Image\n')] |
#!/usr/bin/env nemesis
#
# ----------------------------------------------------------------------
#
# <NAME>, U.S. Geological Survey
# <NAME>, GNS Science
# <NAME>, University at Buffalo
#
# This code was developed as part of the Computational Infrastructure
# for Geodynamics (http://geodynamics.org).
#
# Copyright (c)... | [
"mandel_compaction_soln.AnalyticalSoln",
"unittest.TextTestRunner",
"unittest.TestSuite",
"unittest.makeSuite",
"pylith.testing.FullTestApp.FullTestCase.run_pylith",
"meshes.Quad",
"meshes.Tri",
"pylith.testing.FullTestApp.FullTestCase.parse_args",
"pylith.testing.FullTestApp.Check"
] | [((4067, 4092), 'pylith.testing.FullTestApp.FullTestCase.parse_args', 'FullTestCase.parse_args', ([], {}), '()\n', (4090, 4092), False, 'from pylith.testing.FullTestApp import FullTestCase, Check, check_data\n'), ((4106, 4126), 'unittest.TestSuite', 'unittest.TestSuite', ([], {}), '()\n', (4124, 4126), False, 'import u... |
# Generated by Django 3.2.11 on 2022-03-28 20:03
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('guests', '0029_alter_guest_caboose_farm'),
]
operations = [
migrations.AlterField(
model_name='guest',
... | [
"django.db.models.CharField"
] | [((354, 498), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'choices': "[('beef', 'braised beef shortrib'), ('fish', 'salmon'), ('vegan', 'vegan')]", 'max_length': '(20)', 'null': '(True)'}), "(blank=True, choices=[('beef', 'braised beef shortrib'), (\n 'fish', 'salmon'), ('vegan', 'vega... |
#!/usr/bin/env python
#
# author: dec 2020
# <NAME> - https://cassota.gitlab.io
import sys
import os
import glob
if __name__ == '__main__':
if len(sys.argv) < 3:
print("usage: %s <kaldi-egs-dir> <ctm-in-dir> <pts-out-dir>" % sys.argv[0])
sys.exit(1)
proj_dir = sys.argv[1]
ctm_dir = sys.ar... | [
"os.path.isdir",
"os.path.isfile",
"os.path.join",
"sys.exit"
] | [((851, 903), 'os.path.join', 'os.path.join', (['proj_dir', '"""data"""', '"""lang"""', '"""phones.txt"""'], {}), "(proj_dir, 'data', 'lang', 'phones.txt')\n", (863, 903), False, 'import os\n'), ((260, 271), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (268, 271), False, 'import sys\n'), ((363, 386), 'os.path.isdir'... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | [
"tvm.tir.decl_buffer",
"tvm.te.min",
"tvm.tir.generic.cast",
"tvm.target.Target.current",
"tvm.contrib.thrust.can_use_rocthrust",
"tvm.contrib.thrust.can_use_thrust",
"tvm.te.thread_axis",
"tvm.tir.min",
"tvm.te.create_schedule",
"tvm.tir.ir_builder.create",
"tvm.tir.indexdiv",
"tvm.tir.all"
] | [((2527, 2554), 'tvm.tir.ir_builder.create', 'tvm.tir.ir_builder.create', ([], {}), '()\n', (2552, 2554), False, 'import tvm\n'), ((9959, 10045), 'tvm.tir.decl_buffer', 'tvm.tir.decl_buffer', (['data.shape', 'data.dtype', '"""valid_indices_buf"""'], {'data_alignment': '(8)'}), "(data.shape, data.dtype, 'valid_indices_b... |
#!/usr/bin/env python
# encoding: utf-8
#
# Copyright SAS Institute
#
# 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 b... | [
"swat.utils.testing.runtests",
"pipefitter.model_selection.HyperParameterTuning",
"pipefitter.estimator.DecisionTree"
] | [((3342, 3355), 'swat.utils.testing.runtests', 'tm.runtests', ([], {}), '()\n', (3353, 3355), True, 'import swat.utils.testing as tm\n'), ((1033, 1047), 'pipefitter.estimator.DecisionTree', 'DecisionTree', ([], {}), '()\n', (1045, 1047), False, 'from pipefitter.estimator import DecisionTree\n'), ((1197, 1261), 'pipefit... |
#!/usr/bin/env python3
import numpy as np
import pandas as pd
import random
import os,sys
import shutil
##################################MAIN#####################################
def save_train_val(dir,in_csv):
name_path_save_val = os.path.join(dir,'val/')
if not os.path.isdir(name_path_save_val):
os.mkdir(nam... | [
"os.path.isdir",
"os.mkdir",
"os.path.join"
] | [((238, 263), 'os.path.join', 'os.path.join', (['dir', '"""val/"""'], {}), "(dir, 'val/')\n", (250, 263), False, 'import os, sys\n'), ((361, 388), 'os.path.join', 'os.path.join', (['dir', '"""train/"""'], {}), "(dir, 'train/')\n", (373, 388), False, 'import os, sys\n'), ((271, 304), 'os.path.isdir', 'os.path.isdir', ([... |
# Generated by Django 3.0.7 on 2020-06-22 12:40
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Study_Place',
fields=[
... | [
"django.db.models.TextField",
"django.db.models.CharField",
"django.db.models.ForeignKey",
"django.db.models.PositiveSmallIntegerField",
"django.db.models.AutoField",
"django.db.models.BooleanField",
"django.db.models.IntegerField",
"django.db.models.DateField"
] | [((340, 433), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (356, 433), False, 'from django.db import migrations, models\... |
import bcolz
import numpy as np
def save_array(fname, arr):
c=bcolz.carray(arr, rootdir=fname, mode='w')
c.flush()
def load_array(fname):
return bcolz.open(fname)[:]
probs = np.load('/home/chicm/ml/kgdata/carvana/results/single/UNet_double_1024_5/submit/049/probs-part10.8.npy')
save_array('/home/chicm/... | [
"numpy.load",
"bcolz.open",
"bcolz.carray"
] | [((191, 305), 'numpy.load', 'np.load', (['"""/home/chicm/ml/kgdata/carvana/results/single/UNet_double_1024_5/submit/049/probs-part10.8.npy"""'], {}), "(\n '/home/chicm/ml/kgdata/carvana/results/single/UNet_double_1024_5/submit/049/probs-part10.8.npy'\n )\n", (198, 305), True, 'import numpy as np\n'), ((68, 110), ... |
import json, boto3, base64
def getprocessor(env, name, source='core', scope=None):
return name if ':' in name else '{lambda_namespace}-{source}-{name}'.format(lambda_namespace=env['lambda_namespace'], source=source, name='{}-{}'.format(scope, name) if scope else name)
def main(event, context):
'''
- tr... | [
"boto3.resource",
"boto3.client",
"json.dumps"
] | [((651, 671), 'boto3.resource', 'boto3.resource', (['"""s3"""'], {}), "('s3')\n", (665, 671), False, 'import json, boto3, base64\n'), ((726, 744), 'boto3.client', 'boto3.client', (['"""s3"""'], {}), "('s3')\n", (738, 744), False, 'import json, boto3, base64\n'), ((765, 787), 'boto3.client', 'boto3.client', (['"""lambda... |
"""
Environment setup functions
Try to keep the imports in this file to the python standard libraries.
Otherwise some of the metatlas_repo/kernel validation errors will
not correctly report problems with the notebook configuration
"""
import getpass
import json
import logging
import os
import re
import shutil
import ... | [
"json.dump",
"os.path.abspath",
"json.load",
"getpass.getuser",
"os.makedirs",
"pathlib.Path.home",
"os.path.isdir",
"pathlib.Path",
"shutil.copyfile",
"os.path.join",
"logging.getLogger",
"re.compile"
] | [((378, 405), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (395, 405), False, 'import logging\n'), ((1192, 1228), 'os.makedirs', 'os.makedirs', (['dest_dir'], {'exist_ok': '(True)'}), '(dest_dir, exist_ok=True)\n', (1203, 1228), False, 'import os\n'), ((1233, 1282), 'shutil.copyfile', '... |
# -*- coding: UTF-8
import os
import gui as wegui
from itchat.content import *
import itchat
import sys
from pypinyin import lazy_pinyin
reload(sys)
sys.setdefaultencoding("utf-8")
def get_contact_name(msg):
return msg['User']['RemarkName'] if msg['User']['RemarkName'] else msg['User']['NickName']
def get_group_na... | [
"itchat.get_friends",
"gui.WechatMain",
"itchat.msg_register",
"itchat.get_chatrooms",
"sys.setdefaultencoding",
"itchat.web_init",
"itchat.auto_login",
"itchat.run"
] | [((149, 180), 'sys.setdefaultencoding', 'sys.setdefaultencoding', (['"""utf-8"""'], {}), "('utf-8')\n", (171, 180), False, 'import sys\n'), ((833, 938), 'itchat.msg_register', 'itchat.msg_register', (['[TEXT, MAP, CARD, NOTE, SHARING, PICTURE, RECORDING, ATTACHMENT, VIDEO, FRIENDS\n ]'], {}), '([TEXT, MAP, CARD, NOT... |
# Copyright 2014 OpenStack Foundation.
# 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 req... | [
"neutron.api.v2.resource_helper.build_plural_mappings",
"neutron_lbaas._i18n._",
"neutron.api.v2.resource_helper.build_resource_info"
] | [((1034, 1110), 'neutron_lbaas._i18n._', '_', (['"""The provider does not have the ability to create a load balancer graph."""'], {}), "('The provider does not have the ability to create a load balancer graph.')\n", (1035, 1110), False, 'from neutron_lbaas._i18n import _\n'), ((3598, 3663), 'neutron.api.v2.resource_hel... |
from time import strftime, localtime
from pystatus.plugin import IPlugin, IInstance
class Clock(IPlugin):
def __init__(self):
super().__init__("clock", "0.1", "g0dsCookie", ClockInstance)
class ClockInstance(IInstance):
def __init__(self, *args, **kwargs):
options = {
"text": "%Y... | [
"time.strftime",
"time.localtime"
] | [((478, 489), 'time.localtime', 'localtime', ([], {}), '()\n', (487, 489), False, 'from time import strftime, localtime\n'), ((581, 607), 'time.strftime', 'strftime', (['self._text', 'time'], {}), '(self._text, time)\n', (589, 607), False, 'from time import strftime, localtime\n'), ((676, 703), 'time.strftime', 'strfti... |
# ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... | [
"unittest.main",
"skbio.io.newick._tree_node_to_newick",
"skbio.io.newick._newick_to_tree_node",
"skbio.TreeNode",
"six.StringIO",
"skbio.io.newick._newick_sniffer"
] | [((12650, 12665), 'unittest.main', 'unittest.main', ([], {}), '()\n', (12663, 12665), False, 'import unittest\n'), ((11859, 11889), 'six.StringIO', 'StringIO', (['"""(_:0.1, _a, _b)__;"""'], {}), "('(_:0.1, _a, _b)__;')\n", (11867, 11889), False, 'from six import StringIO\n'), ((11905, 11956), 'skbio.io.newick._newick_... |
"""Driver class for SpaceMouse controller.
This class provides a driver support to SpaceMouse on Mac OS X.
In particular, we assume you are using a SpaceMouse Wireless by default.
To set up a new SpaceMouse controller:
1. Download and install driver from https://www.3dconnexion.com/service/drivers.html
2. Ins... | [
"threading.Thread",
"hid.device",
"spirl.data.block_stacking.src.robosuite.utils.transform_utils.rotation_matrix",
"time.sleep",
"time.time",
"numpy.array",
"collections.namedtuple"
] | [((1320, 1382), 'collections.namedtuple', 'namedtuple', (['"""AxisSpec"""', "['channel', 'byte1', 'byte2', 'scale']"], {}), "('AxisSpec', ['channel', 'byte1', 'byte2', 'scale'])\n", (1330, 1382), False, 'from collections import namedtuple\n'), ((2863, 2875), 'hid.device', 'hid.device', ([], {}), '()\n', (2873, 2875), F... |
import numpy as np
from .combine_data import combination_column_range_map
from .load_dataset import load_dataset_np
def statistics(dataset):
if isinstance(dataset, str):
dataset = load_dataset_np(dataset_name=dataset)
if not isinstance(dataset, np.ndarray):
raise TypeError('dataset must be np... | [
"numpy.nanmedian",
"numpy.nanstd",
"numpy.nanmin",
"numpy.nanvar",
"numpy.nanmax",
"numpy.nanmean"
] | [((373, 391), 'numpy.nanmin', 'np.nanmin', (['dataset'], {}), '(dataset)\n', (382, 391), True, 'import numpy as np\n'), ((402, 420), 'numpy.nanmax', 'np.nanmax', (['dataset'], {}), '(dataset)\n', (411, 420), True, 'import numpy as np\n'), ((434, 455), 'numpy.nanmedian', 'np.nanmedian', (['dataset'], {}), '(dataset)\n',... |
import os
import functools
import numpy as np
from keras.models import Sequential
from keras.layers import Embedding, SimpleRNN, Dense, Dropout
from keras.callbacks import EarlyStopping
from utilnn import accuracy, fscore, coef
def load_data(labels_prefix):
"""
@param labels_prefix: 'classfication' or 'regres... | [
"keras.layers.SimpleRNN",
"functools.partial",
"numpy.load",
"utilnn.coef",
"utilnn.fscore",
"keras.layers.Dropout",
"utilnn.accuracy",
"keras.layers.Dense",
"keras.callbacks.EarlyStopping",
"keras.layers.Embedding",
"keras.models.Sequential",
"os.path.join"
] | [((4815, 4856), 'functools.partial', 'functools.partial', (['rnn'], {'train_embedding': '(0)'}), '(rnn, train_embedding=0)\n', (4832, 4856), False, 'import functools\n'), ((4874, 4915), 'functools.partial', 'functools.partial', (['rnn'], {'train_embedding': '(1)'}), '(rnn, train_embedding=1)\n', (4891, 4915), False, 'i... |
# Generated by Django 2.1 on 2018-08-20 00:34
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('catalogo', '0002_auto_20180820_0017'),
]
operations = [
migrations.AlterField(
... | [
"datetime.datetime"
] | [((422, 483), 'datetime.datetime', 'datetime.datetime', (['(2018)', '(8)', '(20)', '(0)', '(34)', '(22)', '(883116)'], {'tzinfo': 'utc'}), '(2018, 8, 20, 0, 34, 22, 883116, tzinfo=utc)\n', (439, 483), False, 'import datetime\n')] |
import errno
import json
import logging
import os
import random
import shutil
import socket
import typing
import boto3
import jmespath
import pexpect
import pexpect.exceptions
class EcsTunnelException(Exception):
pass
class EcsTunnel:
cluster_id: str
task_id: str
container_name: typing.Optional[str... | [
"boto3.Session",
"socket.socket",
"shutil.which",
"json.dumps",
"jmespath.search",
"random.randrange",
"logging.getLogger"
] | [((1063, 1094), 'logging.getLogger', 'logging.getLogger', (['"""ecs_tunnel"""'], {}), "('ecs_tunnel')\n", (1080, 1094), False, 'import logging\n'), ((1126, 1328), 'boto3.Session', 'boto3.Session', ([], {'aws_access_key_id': 'aws_access_key_id', 'aws_secret_access_key': 'aws_secret_access_key', 'aws_session_token': 'aws... |
#!/usr/bin/env python3.6
import subprocess
import os
import sys
import time
class DependencyCheck(object):
def __init__(self, command):
self.command = command
self.status = self._check()
def _parse_which_resp(self, response):
if os.path.exists(response):
return True
... | [
"os.path.abspath",
"os.path.exists",
"time.sleep",
"os.path.splitext",
"sys.exit"
] | [((264, 288), 'os.path.exists', 'os.path.exists', (['response'], {}), '(response)\n', (278, 288), False, 'import os\n'), ((752, 777), 'os.path.abspath', 'os.path.abspath', (['asm_file'], {}), '(asm_file)\n', (767, 777), False, 'import os\n'), ((808, 839), 'os.path.splitext', 'os.path.splitext', (['self.asm_name'], {}),... |