code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
#!/usr/bin/env python
from __future__ import print_function
import pybullet as p
from pybullet_tools.utils import add_data_path, connect, dump_body, load_model, disconnect, wait_for_user, \
get_movable_joints, get_sample_fn, set_joint_positions, get_joint_name, LockRenderer, link_from_name, get_link_pose, \
... | [
"pybullet_tools.utils.get_movable_joints",
"pybullet_tools.utils.get_joint_name",
"pybullet_tools.ikfast.ikfast.get_ik_joints",
"pybullet_tools.utils.LockRenderer",
"pybullet_tools.utils.disconnect",
"pybullet_tools.utils.Point",
"pybullet_tools.utils.interpolate_poses",
"pybullet_tools.ikfast.ikfast.... | [((618, 655), 'pybullet_tools.ikfast.ikfast.get_ik_joints', 'get_ik_joints', (['robot', 'info', 'tool_link'], {}), '(robot, info, tool_link)\n', (631, 655), False, 'from pybullet_tools.ikfast.ikfast import get_ik_joints, closest_inverse_kinematics\n'), ((673, 704), 'pybullet_tools.utils.get_link_pose', 'get_link_pose',... |
from django.http.response import JsonResponse
from django.shortcuts import redirect, render
from django.views import generic
from .models import Product
from django.contrib.auth.mixins import LoginRequiredMixin
from django.urls import reverse
from .forms import ProductModelForm
import stripe
from django.conf import set... | [
"django.urls.reverse",
"django.http.response.JsonResponse"
] | [((1371, 1441), 'django.urls.reverse', 'reverse', (['"""products:product-detail"""'], {'kwargs': "{'slug': self.product.slug}"}), "('products:product-detail', kwargs={'slug': self.product.slug})\n", (1378, 1441), False, 'from django.urls import reverse\n'), ((2359, 2383), 'django.urls.reverse', 'reverse', (['"""user-pr... |
"""Code for setting up the optimization problem for certification."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
import os
import numpy as np
from scipy.sparse.linalg import eigs, LinearOperator
import tensorflow as tf
from tensorflow.contr... | [
"tensorflow.cond",
"tensorflow.reduce_sum",
"numpy.abs",
"tensorflow.logging.info",
"tensorflow.logging.debug",
"tensorflow.maximum",
"tensorflow.reshape",
"json.dumps",
"tensorflow.multiply",
"tensorflow.argmin",
"tensorflow.Variable",
"tensorflow.divide",
"scipy.sparse.linalg.LinearOperato... | [((1580, 1616), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32'], {'shape': '[]'}), '(tf.float32, shape=[])\n', (1594, 1616), True, 'import tensorflow as tf\n'), ((1808, 1882), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32'], {'shape': '[1 + self.dual_object.dual_index[-1], 1]'}), '(tf.float32, s... |
from pathlib import Path
from fhir.resources.codesystem import CodeSystem
from oops_fhir.utils import CodeSystemConcept
__all__ = ["ExplanationOfBenefitStatus"]
_resource = CodeSystem.parse_file(Path(__file__).with_suffix(".json"))
class ExplanationOfBenefitStatus:
"""
ExplanationOfBenefitStatus
A c... | [
"pathlib.Path",
"oops_fhir.utils.CodeSystemConcept"
] | [((502, 626), 'oops_fhir.utils.CodeSystemConcept', 'CodeSystemConcept', (["{'code': 'active', 'definition':\n 'The resource instance is currently in-force.', 'display': 'Active'}"], {}), "({'code': 'active', 'definition':\n 'The resource instance is currently in-force.', 'display': 'Active'})\n", (519, 626), Fals... |
from aiogram.contrib.fsm_storage.memory import MemoryStorage
from aiogram import Bot, Dispatcher
from config import TOKEN
import logging
# уровень логов
logging.basicConfig(level=logging.INFO)
# место хранения данных FSM
storage = MemoryStorage()
# инициализация бота
bot = Bot(token=TOKEN, parse_... | [
"aiogram.contrib.fsm_storage.memory.MemoryStorage",
"aiogram.Bot",
"aiogram.Dispatcher",
"logging.basicConfig"
] | [((168, 207), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (187, 207), False, 'import logging\n'), ((250, 265), 'aiogram.contrib.fsm_storage.memory.MemoryStorage', 'MemoryStorage', ([], {}), '()\n', (263, 265), False, 'from aiogram.contrib.fsm_storage.memory i... |
# -*- coding:utf-8 -*-
# __author__ = '<NAME>'
# 管理后台入口文件
from flask import Blueprint
admin = Blueprint('admin', __name__, template_folder='./templates', static_folder='./static')
theme = 'default'
from . import views | [
"flask.Blueprint"
] | [((96, 186), 'flask.Blueprint', 'Blueprint', (['"""admin"""', '__name__'], {'template_folder': '"""./templates"""', 'static_folder': '"""./static"""'}), "('admin', __name__, template_folder='./templates', static_folder=\n './static')\n", (105, 186), False, 'from flask import Blueprint\n')] |
from collections import Counter
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
def get_count_except(counter, exception):
keys = []
results = []
for key in counter:
if key == exception:
continue
keys.append(key)
results.append(counter[key])
re... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"pandas.read_csv",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.barh",
"matplotlib.pyplot.figure",
"collections.Counter",
"matplotlib.pyplot.xlabel"
] | [((379, 388), 'collections.Counter', 'Counter', ([], {}), '()\n', (386, 388), False, 'from collections import Counter\n'), ((527, 555), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(20, 10)'}), '(figsize=(20, 10))\n', (537, 555), True, 'import matplotlib.pyplot as plt\n'), ((600, 618), 'matplotlib.pyplot... |
# Copyright 2015 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | [
"openstack_health.test_run_aggregator.Status"
] | [((816, 833), 'openstack_health.test_run_aggregator.Status', 'Status', (['"""success"""'], {}), "('success')\n", (822, 833), False, 'from openstack_health.test_run_aggregator import Status\n'), ((1061, 1076), 'openstack_health.test_run_aggregator.Status', 'Status', (['"""xfail"""'], {}), "('xfail')\n", (1067, 1076), Fa... |
"""Test NMS.
Run the examples described in `ONNX docs`_.
.. _ONNX docs: https://github.com/onnx/onnx/blob/main/docs/Operators.md#NonMaxSuppression
"""
# import pytest
import numpy as np
import box_utils._c.box_nms as box_nms
def test_nms_suppress_by_iou():
"""Test NMS - suppress by IoU."""
# --
boxes =... | [
"box_utils._c.box_nms.ltrb_nms",
"numpy.testing.assert_array_equal",
"box_utils._c.box_nms.xywh_nms",
"numpy.array"
] | [((928, 1032), 'box_utils._c.box_nms.ltrb_nms', 'box_nms.ltrb_nms', (['boxes', 'scores', 'score_threshold[0]', 'iou_threshold[0]', 'max_output_boxes_per_class[0]'], {}), '(boxes, scores, score_threshold[0], iou_threshold[0],\n max_output_boxes_per_class[0])\n', (944, 1032), True, 'import box_utils._c.box_nms as box_... |
from collections import OrderedDict
def genListCombinaison(P4Graph):
""" Generate a set of tuples from graph.
Each tuple represents possible active headers at the same time
"""
combinaison = []
return combinaison
def genListHeaders(P4Graph):
""" Generate the dictionnary of headers.
P4Gra... | [
"collections.OrderedDict"
] | [((381, 394), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (392, 394), False, 'from collections import OrderedDict\n')] |
import pytest
from rut_chile import rut_chile
class TestIsValidRutTests:
@pytest.mark.parametrize("test_input, expected_value", [
(None, ValueError),
("", ValueError),
(" ", ValueError),
("k", ValueError),
("1", ValueError),
("*", ValueError),
("1-", ValueE... | [
"rut_chile.rut_chile.get_capitalized_verification_digit",
"rut_chile.rut_chile.format_capitalized_rut_without_dots",
"rut_chile.rut_chile.format_capitalized_rut_with_dots",
"rut_chile.rut_chile.format_rut_with_dots",
"rut_chile.rut_chile.format_rut_without_dots",
"pytest.raises",
"rut_chile.rut_chile.ge... | [((81, 441), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""test_input, expected_value"""', "[(None, ValueError), ('', ValueError), (' ', ValueError), ('k', ValueError),\n ('1', ValueError), ('*', ValueError), ('1-', ValueError), ('.-',\n ValueError), ('1.', ValueError), ('1.11', ValueError), ('1.111... |
# ------------------------------------------------------------------
# PyTorch implementation of
# "ROAM: Recurrently Optimizing Tracking Model", CVPR, 2020
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME> (<EMAIL>)
# ------------------------------------------------------------------
imp... | [
"numpy.random.seed",
"numpy.floor",
"utils.get_search_patch",
"numpy.random.randint",
"numpy.arange",
"torchvision.transforms.Normalize",
"os.path.join",
"numpy.round",
"cv2.resize",
"numpy.ceil",
"utils.get_search_size",
"utils.gaussian_shaped_labels",
"utils.default_loader",
"numpy.conca... | [((1309, 1330), 'numpy.array', 'np.array', (['config.mean'], {}), '(config.mean)\n', (1317, 1330), True, 'import numpy as np\n'), ((1357, 1413), 'numpy.array', 'np.array', (['[config.base_target_sz, config.base_target_sz]'], {}), '([config.base_target_sz, config.base_target_sz])\n', (1365, 1413), True, 'import numpy as... |
"""Creates a custom kinematics body with two links and one joint
"""
from openravepy import *
from numpy import eye, array, zeros
env = Environment() # create openrave environment
env.SetViewer('qtcoin') # attach viewer (optional)
with env:
robot=RaveCreateRobot(env,'')
robot.SetName('camera')
linkinfo=Ki... | [
"numpy.zeros",
"numpy.eye",
"numpy.array"
] | [((533, 539), 'numpy.eye', 'eye', (['(4)'], {}), '(4)\n', (536, 539), False, 'from numpy import eye, array, zeros\n'), ((780, 786), 'numpy.eye', 'eye', (['(4)'], {}), '(4)\n', (783, 786), False, 'from numpy import eye, array, zeros\n'), ((1020, 1070), 'numpy.array', 'array', (['[[640.0, 0, 320], [0, 640, 240], [0, 0, 1... |
# 检查label是否包含最后时间加1秒,若没有则加一行数据
# 图像列表也加在函数中
# 单个生成一个标签
# 给出一个旧标签的位置(全路径),生成一张新标签
import os
import numpy as np
import json
from create_v3_012 import create_json_record
# from create_v2 import create_json_record
# path_txt_for_check = r'Y:\dataset\inroad_parking_videos\pics\2019_08_12\DDT2G1907ZMY00008SY_label.txt'
# p... | [
"json.dump",
"os.path.basename",
"os.path.dirname",
"os.path.splitext",
"create_v3_012.create_json_record",
"os.listdir"
] | [((757, 792), 'os.path.dirname', 'os.path.dirname', (['path_txt_for_check'], {}), '(path_txt_for_check)\n', (772, 792), False, 'import os\n'), ((1121, 1149), 'os.listdir', 'os.listdir', (['imgs_folder_path'], {}), '(imgs_folder_path)\n', (1131, 1149), False, 'import os\n'), ((2712, 2808), 'create_v3_012.create_json_rec... |
# main imports
import numpy as np
import pandas as pd
import json
import os, sys, argparse, subprocess
# model imports
from keras.models import model_from_json
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import MinMaxScaler
from joblib import dump, load
# image processing imports
f... | [
"ipfml.metrics.coefficient_of_determination",
"json.load",
"argparse.ArgumentParser",
"os.makedirs",
"sklearn.model_selection.train_test_split",
"sklearn.preprocessing.MinMaxScaler",
"os.path.exists",
"sys.path.insert",
"PIL.Image.open",
"keras.models.model_from_json",
"numpy.loadtxt",
"numpy.... | [((423, 445), 'sys.path.insert', 'sys.path.insert', (['(0)', '""""""'], {}), "(0, '')\n", (438, 445), False, 'import os, sys, argparse, subprocess\n'), ((779, 816), 'numpy.loadtxt', 'np.loadtxt', (['_data_file'], {'delimiter': '""";"""'}), "(_data_file, delimiter=';')\n", (789, 816), True, 'import numpy as np\n'), ((86... |
# -*- coding: utf-8 -*-
import tensorflow as tf
from nlp.chatbot.dataset import data_utils
from nltk.translate.bleu_score import sentence_bleu
from tqdm import tqdm
import os,sys
import numpy as np
from nlp.chatbot import model as s2s_model
def test_bleu(count, args):
print('准备数据')
bucket_dbs = data_utils.re... | [
"nlp.chatbot.model.create_model",
"sys.stdout.write",
"numpy.random.random_sample",
"numpy.argmax",
"tensorflow.Session",
"nlp.chatbot.dataset.data_utils.indice_sentence",
"nlp.chatbot.dataset.data_utils.read_bucket_dbs",
"sys.stdout.flush",
"tensorflow.initialize_all_variables",
"os.path.join",
... | [((307, 351), 'nlp.chatbot.dataset.data_utils.read_bucket_dbs', 'data_utils.read_bucket_dbs', (['args.buckets_dir'], {}), '(args.buckets_dir)\n', (333, 351), False, 'from nlp.chatbot.dataset import data_utils\n'), ((833, 845), 'tensorflow.Session', 'tf.Session', ([], {}), '()\n', (843, 845), True, 'import tensorflow as... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-09-14 09:29
from __future__ import unicode_literals
import bluebottle.utils.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('projects', '0036_merge_20170831_1449'),
]
operations... | [
"django.db.models.CharField"
] | [((434, 529), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'help_text': '"""Geographical location"""', 'max_length': '(200)', 'null': '(True)'}), "(blank=True, help_text='Geographical location', max_length=\n 200, null=True)\n", (450, 529), False, 'from django.db import migrations, mode... |
import numpy as np
import pyaudio
from pyaudio import PyAudio
from queue import Queue
import struct
from time import sleep
def get_steinberg_device_idx(pa: PyAudio) -> int:
"""
looks up the steinberg device index
"""
for i in range(pa.get_device_count()):
name = pa.get_device_info_by_index(i)... | [
"struct.Struct",
"time.sleep",
"numpy.array",
"pyaudio.PyAudio",
"queue.Queue"
] | [((2126, 2134), 'time.sleep', 'sleep', (['(2)'], {}), '(2)\n', (2131, 2134), False, 'from time import sleep\n'), ((859, 868), 'pyaudio.PyAudio', 'PyAudio', ([], {}), '()\n', (866, 868), False, 'from pyaudio import PyAudio\n'), ((896, 903), 'queue.Queue', 'Queue', ([], {}), '()\n', (901, 903), False, 'from queue import ... |
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.dates as mdates
from datetime import datetime
import matplotlib.patches as patches
from matplotlib.backends.backend_pdf import PdfPages
import math
import operator
def putval(x1, x2, demand_per_tick, result):
"""
Helper function to calculate ... | [
"matplotlib.pyplot.subplots",
"math.floor",
"matplotlib.pyplot.show"
] | [((2876, 2904), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'figsize': '(8, 3)'}), '(figsize=(8, 3))\n', (2888, 2904), True, 'import matplotlib.pyplot as plt\n'), ((3763, 3773), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (3771, 3773), True, 'import matplotlib.pyplot as plt\n'), ((441, 455), 'math.f... |
# Generated by Django 3.1.13 on 2021-08-14 16:36
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pwas', '0015_auto_20210814_1622'),
]
operations = [
migrations.RemoveField(
model_name='pwa',
name='tags',
... | [
"django.db.migrations.RemoveField",
"django.db.models.ManyToManyField"
] | [((233, 286), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""pwa"""', 'name': '"""tags"""'}), "(model_name='pwa', name='tags')\n", (255, 286), False, 'from django.db import migrations, models\n'), ((425, 483), 'django.db.models.ManyToManyField', 'models.ManyToManyField', ([], {'re... |
import tensorflow as tf
from nets.network import Network
import numpy as np
# !! The default data format used here is NHWC !!
# TODO: scope
def conv_bn(X, inChannel, outChannel, kernel, istrain, stride=1, name=None):
out = tf.layers.conv2d(X, outChannel, kernel, stride, 'same', use_bias=False, name=name)
out =... | [
"numpy.load",
"tensorflow.nn.relu",
"tensorflow.get_collection",
"tensorflow.layers.dense",
"tensorflow.layers.flatten",
"tensorflow.layers.average_pooling2d",
"tensorflow.layers.conv2d",
"tensorflow.layers.max_pooling2d"
] | [((228, 314), 'tensorflow.layers.conv2d', 'tf.layers.conv2d', (['X', 'outChannel', 'kernel', 'stride', '"""same"""'], {'use_bias': '(False)', 'name': 'name'}), "(X, outChannel, kernel, stride, 'same', use_bias=False,\n name=name)\n", (244, 314), True, 'import tensorflow as tf\n'), ((661, 676), 'tensorflow.nn.relu', ... |
# -*- coding: utf-8 -*-
# This is the part of the codes used for the article entitled "A Deep Learning
# Approach for Assessment of Regional Wall Motion Abnormality from
# Echocardiographic Images" for JACC CV imaging.
#
# Before using this code, please prepare image data at "./data_folder" dir.
#
# ./data_folder/trai... | [
"keras.applications.xception.Xception",
"keras.applications.inception_resnet_v2.InceptionResNetV2",
"keras.layers.Activation",
"keras.layers.Dropout",
"keras.optimizers.Adam",
"PIL.Image.open",
"keras.applications.vgg19.VGG19",
"keras.applications.resnet50.ResNet50",
"keras.utils.np_utils.to_categor... | [((2248, 2279), 'os.listdir', 'os.listdir', (['"""data_folder/train"""'], {}), "('data_folder/train')\n", (2258, 2279), False, 'import os, keras\n'), ((2895, 2915), 'numpy.array', 'np.array', (['image_list'], {}), '(image_list)\n', (2903, 2915), True, 'import numpy as np\n'), ((2929, 2955), 'keras.utils.np_utils.to_cat... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Copyright 2016 Twitter. 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... | [
"os.path.abspath",
"os.path.dirname",
"os.path.realpath",
"re.match",
"heron.common.src.python.pex_loader.import_and_get_class",
"os.path.join",
"heron.common.src.python.pex_loader.load_pex"
] | [((2496, 2521), 'heron.common.src.python.pex_loader.load_pex', 'pex_loader.load_pex', (['path'], {}), '(path)\n', (2515, 2521), True, 'import heron.common.src.python.pex_loader as pex_loader\n'), ((2532, 2601), 'heron.common.src.python.pex_loader.import_and_get_class', 'pex_loader.import_and_get_class', (['path', 'cons... |
from cloudinary.models import CloudinaryField
from customers.models import Customer
from django.db import models
from django.utils.translation import gettext as _
from model.common_fields import BaseModel
from product.models import Product
class Review(BaseModel):
""" Review model for products """
... | [
"django.db.models.ForeignKey",
"django.db.models.TextField",
"django.utils.translation.gettext",
"cloudinary.models.CloudinaryField"
] | [((332, 397), 'django.db.models.ForeignKey', 'models.ForeignKey', (['Customer'], {'on_delete': 'models.SET_NULL', 'null': '(True)'}), '(Customer, on_delete=models.SET_NULL, null=True)\n', (349, 397), False, 'from django.db import models\n'), ((413, 477), 'django.db.models.ForeignKey', 'models.ForeignKey', (['Product'],... |
# -*- coding: utf-8 -*-
from pollirio.modules import expose
from pollirio import choose_dest
from pollirio import conf
@expose('mass')
def mass(bot, ievent, msg=None):
if ievent.channel == conf.nickname:
return
modes = bot.userlist[ievent.channel.lower()][ievent.nick]
if '~' in modes or \
'&... | [
"pollirio.modules.expose"
] | [((122, 136), 'pollirio.modules.expose', 'expose', (['"""mass"""'], {}), "('mass')\n", (128, 136), False, 'from pollirio.modules import expose\n'), ((605, 622), 'pollirio.modules.expose', 'expose', (['"""call"""', '(1)'], {}), "('call', 1)\n", (611, 622), False, 'from pollirio.modules import expose\n')] |
import hosts.fleaflicker as site
from hosts.db import overwrite_league
from pandas import DataFrame
import sqlite3
from utilities import DB_PATH
LEAGUE_ID = 34958
TEAM_ID = 217960
LEAGUE_NAME = "Family League"
HOST = 'fleaflicker'
SCORING = {'qb': 'pass6', 'skill': 'ppr', 'dst': 'high'}
# open up our database connec... | [
"hosts.db.overwrite_league",
"sqlite3.connect",
"hosts.fleaflicker.get_league_schedule",
"hosts.fleaflicker.get_teams_in_league"
] | [((332, 356), 'sqlite3.connect', 'sqlite3.connect', (['DB_PATH'], {}), '(DB_PATH)\n', (347, 356), False, 'import sqlite3\n'), ((378, 413), 'hosts.fleaflicker.get_teams_in_league', 'site.get_teams_in_league', (['LEAGUE_ID'], {}), '(LEAGUE_ID)\n', (402, 413), True, 'import hosts.fleaflicker as site\n'), ((414, 463), 'hos... |
# -*- coding: utf-8 -*-
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("users", "0023_auto_20170820_1623")]
operations = [
migrations.AddField(
model_name="userprofile",
name="lang",
field=models.CharField(
... | [
"django.db.models.CharField"
] | [((297, 452), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'max_length': '(128)', 'null': '(True)', 'help_text': '"""Language"""', 'choices': "[(b'en', 'English'), (b'fi', 'Finnish'), (b'fr', 'French')]"}), "(blank=True, max_length=128, null=True, help_text=\n 'Language', choices=[(b'en... |
import os
import numpy as np
import torch
import torch.nn as nn
from .pu_net import PUNet
class SORDefense(nn.Module):
"""Statistical outlier removal as defense.
"""
def __init__(self, k=2, alpha=1.1):
"""SOR defense.
Args:
k (int, optional): kNN. Defaults to 2.
... | [
"torch.mean",
"torch.cat",
"torch.std",
"numpy.random.choice",
"torch.zeros",
"torch.no_grad",
"torch.sum",
"torch.from_numpy"
] | [((938, 977), 'torch.sum', 'torch.sum', (['(pc ** 2)'], {'dim': '(1)', 'keepdim': '(True)'}), '(pc ** 2, dim=1, keepdim=True)\n', (947, 977), False, 'import torch\n'), ((1284, 1309), 'torch.mean', 'torch.mean', (['value'], {'dim': '(-1)'}), '(value, dim=-1)\n', (1294, 1309), False, 'import torch\n'), ((1335, 1360), 'to... |
# Faça um programa que jogue par ou ímpar com o computador. O jogo só será interrompido quando o jogador perder,
# mostrando o total de vitórias consecutivas que ele conquistou no final do jogo.
print(20 * '\033[1;33m=*', 'JOGO PAR & ÍMPAR', '=*' * 20)
print('\033[1;34m~~' * 20, 'MANUAL DE INSTRUÇÕES DO GAME:', '~~' ... | [
"random.choice",
"emoji.emojize",
"random.randint"
] | [((1192, 1208), 'random.randint', 'randint', (['(1)', '(1000)'], {}), '(1, 1000)\n', (1199, 1208), False, 'from random import choice, randint\n'), ((1256, 1274), 'random.choice', 'choice', (['escolha_pc'], {}), '(escolha_pc)\n', (1262, 1274), False, 'from random import choice, randint\n'), ((2739, 2860), 'emoji.emojize... |
from soundcard import pulseaudio as sc
import json
l = []
for mic in sc.all_microphones(exclude_monitors=False):
l.append({'id': mic.id, 'name': mic.name})
s = json.dumps(l)
print(s)
| [
"soundcard.pulseaudio.all_microphones",
"json.dumps"
] | [((70, 112), 'soundcard.pulseaudio.all_microphones', 'sc.all_microphones', ([], {'exclude_monitors': '(False)'}), '(exclude_monitors=False)\n', (88, 112), True, 'from soundcard import pulseaudio as sc\n'), ((165, 178), 'json.dumps', 'json.dumps', (['l'], {}), '(l)\n', (175, 178), False, 'import json\n')] |
import os
import json
import logging
from services.security import Security
from services.agent import AgentFactory
from controllers.controller import routes, Controller
from rasa.core.channels.channel import UserMessage
logger = logging.getLogger(__name__)
class GoogleController(Controller):
def __init__(self, s... | [
"rasa.core.channels.channel.UserMessage",
"json.dumps",
"controllers.controller.routes.get",
"controllers.controller.routes.post",
"services.agent.AgentFactory.load",
"logging.getLogger"
] | [((231, 258), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (248, 258), False, 'import logging\n'), ((404, 419), 'controllers.controller.routes.get', 'routes.get', (['"""/"""'], {}), "('/')\n", (414, 419), False, 'from controllers.controller import routes, Controller\n'), ((645, 674), 'c... |
## @ingroup Methods-Weights-Correlations-FLOPS
# operating_items.py
#
# Created: May 2020, <NAME>
# Modified:
# ----------------------------------------------------------------------
# Imports
# ----------------------------------------------------------------------
from SUAVE.Core import Units, Data
import numpy as ... | [
"numpy.floor",
"numpy.ceil",
"SUAVE.Core.Data"
] | [((4650, 4656), 'SUAVE.Core.Data', 'Data', ([], {}), '()\n', (4654, 4656), False, 'from SUAVE.Core import Units, Data\n'), ((4016, 4078), 'numpy.ceil', 'np.ceil', (['(vehicle.mass_properties.cargo / Units.lbs * 1.0 / 950)'], {}), '(vehicle.mass_properties.cargo / Units.lbs * 1.0 / 950)\n', (4023, 4078), True, 'import n... |
import logging
import json
from flask import request
from data.database import Repository, User
from data import model
from decorators import task_resources
logger = logging.getLogger(__name__)
@task_resources
def process(resources):
response = []
changed = True
for resource in resources:
p_na... | [
"data.model.user.get_user",
"logging.getLogger"
] | [((169, 196), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (186, 196), False, 'import logging\n'), ((490, 517), 'data.model.user.get_user', 'model.user.get_user', (['p_user'], {}), '(p_user)\n', (509, 517), False, 'from data import model\n')] |
from django.conf.urls import url
from . import views
app_name = 'project-admin'
urlpatterns = [
url(r'^$', views.home, name='home'),
url(r'^consent-records/?$',
views.consent_records, name='consent-records'),
url(r'^config-general-settings/?$',
views.config_general_settings, name='config-... | [
"django.conf.urls.url"
] | [((103, 137), 'django.conf.urls.url', 'url', (['"""^$"""', 'views.home'], {'name': '"""home"""'}), "('^$', views.home, name='home')\n", (106, 137), False, 'from django.conf.urls import url\n'), ((144, 217), 'django.conf.urls.url', 'url', (['"""^consent-records/?$"""', 'views.consent_records'], {'name': '"""consent-reco... |
import sys
import source as src
import database as db
def main(argv):
config_filename = argv[1]
config = src.read_config(config_filename)
websocket = src.authentication(config['exchange'])
try:
src.run(websocket,config)
except Exception as e:
print("Bot error: {}".format(e))
finally:
src.terminate(websock... | [
"source.authentication",
"source.terminate",
"source.run",
"database.create_tables",
"source.read_config"
] | [((108, 140), 'source.read_config', 'src.read_config', (['config_filename'], {}), '(config_filename)\n', (123, 140), True, 'import source as src\n'), ((154, 192), 'source.authentication', 'src.authentication', (["config['exchange']"], {}), "(config['exchange'])\n", (172, 192), True, 'import source as src\n'), ((202, 22... |
#######################
##! 1. Importing modules
#######################
from datetime import datetime, timedelta
from airflow import DAG
from airflow.operators.dummy_operator import DummyOperator
from airflow.providers.google.cloud.operators.bigquery import BigQueryCheckOperator, BigQueryExecuteQueryOperator
from air... | [
"airflow.providers.google.cloud.operators.bigquery.BigQueryCheckOperator",
"airflow.providers.google.cloud.transfers.gcs_to_bigquery.GCSToBigQueryOperator",
"airflow.operators.python.PythonOperator",
"datetime.timedelta",
"requests.post",
"datetime.datetime.now",
"airflow.operators.dummy_operator.DummyO... | [((3117, 3165), 'airflow.operators.dummy_operator.DummyOperator', 'DummyOperator', ([], {'task_id': '"""start_pipeline"""', 'dag': 'dag'}), "(task_id='start_pipeline', dag=dag)\n", (3130, 3165), False, 'from airflow.operators.dummy_operator import DummyOperator\n'), ((3284, 3508), 'airflow.operators.python.PythonOperat... |
import logging
import time
from concurrent.futures import ThreadPoolExecutor
import pytest
import stomp
from stomp.listener import TestListener
from .testutils import *
executor = ThreadPoolExecutor()
def create_thread(fc):
f = executor.submit(fc)
print("Created future %s on executor %s" % (f, executor))
... | [
"logging.info",
"concurrent.futures.ThreadPoolExecutor",
"stomp.listener.TestListener.__init__"
] | [((184, 204), 'concurrent.futures.ThreadPoolExecutor', 'ThreadPoolExecutor', ([], {}), '()\n', (202, 204), False, 'from concurrent.futures import ThreadPoolExecutor\n'), ((412, 452), 'stomp.listener.TestListener.__init__', 'TestListener.__init__', (['self', '"""123"""', '(True)'], {}), "(self, '123', True)\n", (433, 45... |
from PyQt5.QtWidgets import QComboBox, QLineEdit, QLabel, QHBoxLayout, QVBoxLayout, QGridLayout, QTabWidget, QFileDialog, QCheckBox, QPushButton
from PyQt5 import QtGui
from PyQt5.QtGui import QIcon
from PyQt5 import QtCore
from niapy.util.factory import _algorithm_options
from niaaml_gui.widgets.list_widget_custom imp... | [
"PyQt5.QtCore.QRegExp",
"PyQt5.QtWidgets.QGridLayout",
"niaaml.preprocessing.imputation.ImputerFactory",
"niaaml.preprocessing.feature_selection.FeatureSelectionAlgorithmFactory",
"PyQt5.QtWidgets.QVBoxLayout",
"niaaml.fitness.FitnessFactory",
"PyQt5.QtWidgets.QTabWidget",
"PyQt5.QtWidgets.QLabel",
... | [((2338, 2363), 'PyQt5.QtWidgets.QHBoxLayout', 'QHBoxLayout', (['self._parent'], {}), '(self._parent)\n', (2349, 2363), False, 'from PyQt5.QtWidgets import QComboBox, QLineEdit, QLabel, QHBoxLayout, QVBoxLayout, QGridLayout, QTabWidget, QFileDialog, QCheckBox, QPushButton\n'), ((2389, 2414), 'PyQt5.QtWidgets.QHBoxLayou... |
import os
import numpy as np
import tensorflow as tf
def save_weights_resnet152_10channel():
# Initialize configuration
required_input_shape = (7, 7, 10, 64)
output_file_prefix = "resnet152_10channel"
# Initialize a model of choice
model_pretrained_conv = tf.keras.applications.ResNet152(weights=... | [
"tensorflow.keras.applications.ResNet152",
"os.getcwd",
"os.path.join",
"numpy.random.normal"
] | [((280, 350), 'tensorflow.keras.applications.ResNet152', 'tf.keras.applications.ResNet152', ([], {'weights': '"""imagenet"""', 'include_top': '(False)'}), "(weights='imagenet', include_top=False)\n", (311, 350), True, 'import tensorflow as tf\n'), ((645, 693), 'numpy.random.normal', 'np.random.normal', (['(0)', '(0.001... |
from .AOpticalComponent import AOpticalComponent
from ..IRadiant import IRadiant
import astropy.units as u
from astropy.modeling.models import BlackBody
from ..Entry import Entry
from typing import Union
class CosmicBackground(AOpticalComponent):
"""
This class models the spectral radiance of the cosmic backg... | [
"astropy.modeling.models.BlackBody",
"astropy.units.quantity_input"
] | [((363, 407), 'astropy.units.quantity_input', 'u.quantity_input', ([], {'temp': '[u.Kelvin, u.Celsius]'}), '(temp=[u.Kelvin, u.Celsius])\n', (379, 407), True, 'import astropy.units as u\n'), ((1041, 1110), 'astropy.modeling.models.BlackBody', 'BlackBody', ([], {'temperature': 'temp', 'scale': '(1 * u.W / (u.m ** 2 * u.... |
'''
=========================================
Inference for Non-Linear Gaussian Systems
=========================================
This module contains the Unscented Kalman Filter (Wan, <NAME> 2000)
for state estimation in systems with non-Gaussian noise and non-linear dynamics
'''
from collections import namedtuple
i... | [
"numpy.diag",
"numpy.concatenate",
"numpy.copy",
"numpy.eye",
"scipy.linalg.block_diag",
"scipy.linalg.cholesky",
"numpy.zeros",
"numpy.ones",
"numpy.ma.atleast_2d",
"numpy.tile",
"collections.namedtuple",
"numpy.ma.getmask",
"numpy.ma.asarray",
"scipy.linalg.pinv",
"numpy.vstack",
"nu... | [((681, 756), 'collections.namedtuple', 'namedtuple', (['"""SigmaPoints"""', "['points', 'weights_mean', 'weights_covariance']"], {}), "('SigmaPoints', ['points', 'weights_mean', 'weights_covariance'])\n", (691, 756), False, 'from collections import namedtuple\n'), ((850, 895), 'collections.namedtuple', 'namedtuple', (... |
# -*- coding: utf-8 -*-
"""Setup file for EspressoDB
"""
from espressodb import __version__
__author__ = "@cchang5, @ckoerber"
from os import path
from setuptools import setup, find_packages
CWD = path.abspath(path.dirname(__file__))
with open(path.join(CWD, "README.md"), encoding="utf-8") as inp:
LONG_DESCRI... | [
"os.path.dirname",
"os.path.join",
"setuptools.find_packages"
] | [((215, 237), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file__)\n', (227, 237), False, 'from os import path\n'), ((250, 277), 'os.path.join', 'path.join', (['CWD', '"""README.md"""'], {}), "(CWD, 'README.md')\n", (259, 277), False, 'from os import path\n'), ((350, 384), 'os.path.join', 'path.join', (['... |
from EasyParser import EasyParser
import re
import time
# FG1K2D-2 # diag hardware sysinfo interrupts
# CPU0 CPU1 CPU2 CPU3 CPU4 CPU5 CPU6 CPU7
# 0: 36 0 0 0 0 0 0 0 IO-APIC-edge tim... | [
"time.time",
"re.compile"
] | [((9054, 9091), 're.compile', 're.compile', (['"""^\\\\s+CPU.*?(\\\\d+)\\\\s+\n"""'], {}), "('^\\\\s+CPU.*?(\\\\d+)\\\\s+\\n')\n", (9064, 9091), False, 'import re\n'), ((10299, 10310), 'time.time', 'time.time', ([], {}), '()\n', (10308, 10310), False, 'import time\n'), ((10603, 10624), 're.compile', 're.compile', (['tm... |
# -*- coding: utf-8 -*-
"""1-Step Advantage Actor-Critic agent for episodic tasks in OpenAI Gym.
- Author: <NAME>
- Contact: <EMAIL>
"""
import argparse
from typing import Tuple
import gym
import numpy as np
import torch
import wandb
from rl_algorithms.common.abstract.agent import Agent
from rl_algorithms.common.he... | [
"wandb.log",
"rl_algorithms.common.abstract.agent.Agent.__init__",
"rl_algorithms.registry.build_learner",
"rl_algorithms.common.helper_functions.numpy2floattensor",
"numpy.array"
] | [((1661, 1711), 'rl_algorithms.common.abstract.agent.Agent.__init__', 'Agent.__init__', (['self', 'env', 'env_info', 'args', 'log_cfg'], {}), '(self, env, env_info, args, log_cfg)\n', (1675, 1711), False, 'from rl_algorithms.common.abstract.agent import Agent\n'), ((2112, 2143), 'rl_algorithms.registry.build_learner', ... |
from typing import NamedTuple
from random import choice, randint, shuffle
__doc___ = '''
This module is used to generate the graph of a game map.
The graph is divided in partition in such way that to any two partitions, there
are at most one edge between this two.
This partitions are linked in a tree structure, inte... | [
"random.shuffle",
"random.randint"
] | [((1455, 1498), 'random.randint', 'randint', (['minimum_sub_size', 'maximum_sub_size'], {}), '(minimum_sub_size, maximum_sub_size)\n', (1462, 1498), False, 'from random import choice, randint, shuffle\n'), ((2153, 2170), 'random.shuffle', 'shuffle', (['previous'], {}), '(previous)\n', (2160, 2170), False, 'from random ... |
from setuptools import setup, find_packages
setup(name='unmix', version='1.0', packages=find_packages()) | [
"setuptools.find_packages"
] | [((89, 104), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (102, 104), False, 'from setuptools import setup, find_packages\n')] |
# BenchExec is a framework for reliable benchmarking.
# This file is part of BenchExec.
#
# Copyright (C) <NAME>
#
# SPDX-License-Identifier: Apache-2.0
# prepare for Python 3
from __future__ import absolute_import, division, print_function, unicode_literals
import collections
import io
import json
import logging
imp... | [
"os.remove",
"os.walk",
"json.dumps",
"os.path.isfile",
"os.path.join",
"os.path.abspath",
"logging.warning",
"os.path.exists",
"os.path.normpath",
"requests.get",
"requests.request",
"io.BytesIO",
"time.sleep",
"os.rmdir",
"os.listdir",
"sys.exit",
"json.load",
"zipfile.ZipFile",
... | [((1343, 1429), 'logging.info', 'logging.info', (['"""Using %s version %s."""', 'benchmark.tool_name', 'benchmark.tool_version'], {}), "('Using %s version %s.', benchmark.tool_name, benchmark.\n tool_version)\n", (1355, 1429), False, 'import logging\n'), ((7164, 7191), 'os.path.abspath', 'os.path.abspath', (['workin... |
from .domain import Domain
from math import factorial
import itertools
import random
class Permutations(Domain):
def __init__(self, domain, name=None):
super(Permutations, self).__init__(name)
self._set_flags_from_domain(domain)
self.step_jumps = False # not implemented yet
self... | [
"itertools.permutations",
"math.factorial"
] | [((382, 409), 'math.factorial', 'factorial', (['self.domain.size'], {}), '(self.domain.size)\n', (391, 409), False, 'from math import factorial\n'), ((553, 582), 'itertools.permutations', 'itertools.permutations', (['items'], {}), '(items)\n', (575, 582), False, 'import itertools\n')] |
#!/usr/bin/env python
u"""
model.py
Written by <NAME> (09/2021)
Retrieves tide model parameters for named tide models and
from model definition files
UPDATE HISTORY:
Written 09/2021
"""
import os
import re
import io
import copy
class model:
"""Retrieves tide model parameters for named models or
from a... | [
"os.path.expanduser",
"re.split",
"os.path.join",
"os.getcwd",
"os.path.dirname",
"copy.copy",
"re.search",
"os.access"
] | [((434, 445), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (443, 445), False, 'import os\n'), ((819, 850), 'copy.copy', 'copy.copy', (["kwargs['compressed']"], {}), "(kwargs['compressed'])\n", (828, 850), False, 'import copy\n'), ((941, 970), 'os.path.expanduser', 'os.path.expanduser', (['directory'], {}), '(directory)\... |
#!/usr/bin/env python3
# coding: utf-8
# SPDX-License-Identifier: Apache-2.0
# Copyright 2021 AntiCompositeNumber
# 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/l... | [
"stdnum.isbn.is_valid",
"flask.flash",
"flask.Blueprint",
"flask.request.form.get",
"time.gmtime",
"mwparserfromhell.parse",
"time.strftime",
"time.sleep",
"flask.url_for",
"flask.render_template",
"requests.get",
"stdnum.isbn.format",
"time.strptime"
] | [((774, 839), 'flask.Blueprint', 'flask.Blueprint', (['"""hyphenator"""', '__name__'], {'url_prefix': '"""/hyphenator"""'}), "('hyphenator', __name__, url_prefix='/hyphenator')\n", (789, 839), False, 'import flask\n'), ((3668, 3700), 'mwparserfromhell.parse', 'mwparserfromhell.parse', (['wikitext'], {}), '(wikitext)\n'... |
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 28 15:53:15 2020
@author: syful
"""
import xml.etree.ElementTree as et
import re
import pandas as pd
from datetime import datetime
start = datetime.now()
from tqdm.auto import tqdm
import numpy as np
from collections import Counter
import os
#Please specify your dataset... | [
"pandas.DataFrame",
"pandas.read_csv",
"re.findall",
"collections.Counter",
"datetime.datetime.now",
"os.chdir"
] | [((188, 202), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (200, 202), False, 'from datetime import datetime\n'), ((333, 367), 'os.chdir', 'os.chdir', (['"""your dataset directory"""'], {}), "('your dataset directory')\n", (341, 367), False, 'import os\n'), ((461, 522), 'pandas.read_csv', 'pd.read_csv', (... |
import numpy as np
import os
from pwtools import num, common
rand = np.random.rand
def equal(a,b):
assert (a == b).all()
def test_extend_array():
arr = rand(3,3)
nrep = 5
a0 = num.extend_array(arr, nrep, axis=0)
a1 = num.extend_array(arr, nrep, axis=1)
a2 = num.extend_array(arr, nrep, axis=2)
... | [
"pwtools.num.slicetake",
"pwtools.num.extend_array"
] | [((194, 229), 'pwtools.num.extend_array', 'num.extend_array', (['arr', 'nrep'], {'axis': '(0)'}), '(arr, nrep, axis=0)\n', (210, 229), False, 'from pwtools import num, common\n'), ((239, 274), 'pwtools.num.extend_array', 'num.extend_array', (['arr', 'nrep'], {'axis': '(1)'}), '(arr, nrep, axis=1)\n', (255, 274), False,... |
import time
for i in range(10, -1, -1):
print(i)
time.sleep(1)
print('FOGOSSSSSSSSS!!!!!!!!! \o/ \o/ \o/ \o/ ') | [
"time.sleep"
] | [((58, 71), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (68, 71), False, 'import time\n')] |
# Day 6: The Central Limit Theorem I
# Enter your code here. Read input from STDIN. Print output to STDOUT
__author__ = "<NAME>"
__email__ = "<EMAIL>"
__copyright__ = "Copyright 2019"
import math
class Day6(object):
e = 2.71829
def __init__(self):
pass
# Define functions
def the_central... | [
"math.erf",
"math.sqrt"
] | [((640, 652), 'math.sqrt', 'math.sqrt', (['n'], {}), '(n)\n', (649, 652), False, 'import math\n'), ((388, 431), 'math.erf', 'math.erf', (['((value - mean) / (std * 2 ** 0.5))'], {}), '((value - mean) / (std * 2 ** 0.5))\n', (396, 431), False, 'import math\n')] |
import logging
import numpy as np
from keras_text_cls.embedding.base_embedder import BaseEmbedder
from keras_text_cls.vocab import Vocabulary, SYMBOL_PADDING, SYMBOL_UNKNOWN
from gensim.models.word2vec import Word2Vec
class Word2vecEmbedder(BaseEmbedder):
"""
Word2vec Embedder is a wrapper of gensim word2vec ... | [
"gensim.models.word2vec.Word2Vec.load",
"logging.info",
"gensim.models.word2vec.Word2Vec"
] | [((2405, 2547), 'gensim.models.word2vec.Word2Vec', 'Word2Vec', (['sentences'], {'size': 'vector_size', 'sg': 'sg', 'window': 'window', 'min_count': 'min_count', 'workers': 'workers', 'iter': 'iter', 'negative': 'negative'}), '(sentences, size=vector_size, sg=sg, window=window, min_count=\n min_count, workers=workers... |
import typing
import torch
import torchvision
import numpy as np
from PIL import Image
from torch.autograd import Variable
from src.final_work.transformer import Transformer
from enum import Enum
class ModelType(Enum):
HOSODA = "hosoda_mamoru"
KON = "kon_satoshi"
MIYAZAKI = "miyazaki_hayao"
SHINKAI = ... | [
"src.final_work.transformer.Transformer",
"torch.autograd.Variable",
"torch.load",
"numpy.asarray",
"torchvision.transforms.ToPILImage",
"torch.cuda.is_available",
"torch.device",
"torchvision.transforms.ToTensor"
] | [((385, 405), 'torch.device', 'torch.device', (['"""cuda"""'], {}), "('cuda')\n", (397, 405), False, 'import torch\n'), ((749, 774), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (772, 774), False, 'import torch\n'), ((1118, 1193), 'torch.load', 'torch.load', (['f"""{self.MODELS_DIRECTORY}/{mo... |
# -*- coding: utf-8 -*-
"""
Created on 2017-6-27
@author: cheng.li
"""
from typing import Dict
from typing import Optional
from typing import Tuple
from typing import Union
import numpy as np
from alphamind.portfolio.optimizers import (
QuadraticOptimizer,
TargetVolOptimizer
)
from alphamind.exceptions.excep... | [
"alphamind.portfolio.optimizers.TargetVolOptimizer",
"numpy.concatenate",
"alphamind.portfolio.optimizers.QuadraticOptimizer"
] | [((2311, 2507), 'alphamind.portfolio.optimizers.QuadraticOptimizer', 'QuadraticOptimizer', ([], {'objective': '(-er)', 'cons_matrix': 'cons_matrix', 'lbound': 'lbound', 'ubound': 'ubound', 'penalty': 'lam', 'cov': 'cov', 'factor_cov': 'risk_cov', 'factor_load': 'risk_exposure', 'factor_special': 'special_risk'}), '(obj... |
import pacman
import autograder
"""
run.py runs things that look like command-line arguments
for Berkeley Python. Leave the 'python pacman.py' part
at the beginning, just like running from the command line.
You should comment out all lines in the file except the one
you wan to run!
"""
#pacman.main('python pacman.py... | [
"pacman.main"
] | [((443, 513), 'pacman.main', 'pacman.main', (['"""python pacman.py -l mediumMaze -p SearchAgent -a fn=dfs"""'], {}), "('python pacman.py -l mediumMaze -p SearchAgent -a fn=dfs')\n", (454, 513), False, 'import pacman\n')] |
# SPDX-FileCopyrightText: Copyright 2021-present Open Networking Foundation.
# SPDX-License-Identifier: Apache-2.0
import ipaddress
import logging
import re
from collections import Counter, defaultdict
import kubernetes as k8s
import requests
from netaddr import IPAddress
log = logging.getLogger("DeepInsightTopoUtil... | [
"ipaddress.ip_network",
"ipaddress.ip_interface",
"netaddr.IPAddress",
"re.match",
"ipaddress.ip_address",
"kubernetes.client.CoreV1Api",
"collections.defaultdict",
"kubernetes.config.load_kube_config",
"kubernetes.client.CustomObjectsApi",
"requests.get",
"collections.Counter",
"requests.auth... | [((282, 325), 'logging.getLogger', 'logging.getLogger', (['"""DeepInsightTopoUtility"""'], {}), "('DeepInsightTopoUtility')\n", (299, 325), False, 'import logging\n'), ((546, 606), 're.match', 're.match', (['"""\\\\[([0-9]+/[0-9]+)\\\\]\\\\(([0-9]+)\\\\)"""', 'port_string'], {}), "('\\\\[([0-9]+/[0-9]+)\\\\]\\\\(([0-9]... |
import json
import datetime, time
from os import path
import dash
import dash_echarts
import dash_html_components as html
import dash_core_components as dcc
import dash_bootstrap_components as dbc
from dash.dependencies import Input, Output, State
from dash.exceptions import PreventUpdate
basepath = path.dirname(__fil... | [
"json.load",
"dash.Dash",
"os.path.dirname",
"datetime.datetime.now",
"dash_bootstrap_components.Button",
"dash.dependencies.Input",
"dash_echarts.DashECharts",
"dash.dependencies.Output",
"os.path.join"
] | [((302, 324), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file__)\n', (314, 324), False, 'from os import path\n'), ((349, 410), 'os.path.join', 'path.join', (["(basepath + '/static')", '"""life-expectancy-table.json"""'], {}), "(basepath + '/static', 'life-expectancy-table.json')\n", (358, 410), False, '... |
import os
import sys
from azureml.core.model import Model
sys.path.append(os.getcwd())
import config as f # noqa: E402
model_name = f.params["registered_model_name"]
if f.params['remote_run'] is True:
model_path = os.environ['MODEL_PATH']
elif f.params['remote_run'] is False:
model_path = os.path.join('mod... | [
"os.getcwd",
"azureml.core.model.Model.register",
"os.path.join"
] | [((535, 719), 'azureml.core.model.Model.register', 'Model.register', ([], {'model_path': 'model_path', 'model_name': 'model_name', 'tags': "{'industry': 'retail', 'type': 'regression'}", 'description': '"""Retail AutoML regression model."""', 'workspace': 'f.ws'}), "(model_path=model_path, model_name=model_name, tags={... |
import sublime
import os
from ..clipboard import clipboard
plat = sublime.platform()
if plat == "osx":
from ..applescript import osascript
RSTUDIOAPPLESCRIPT = os.path.join(os.path.dirname(__file__), "rstudio.applescript")
def send_to_rstudio(cmd):
osascript(RSTUDIOAPPLESCRIPT, cmd)
elif plat =... | [
"sublime.platform",
"os.path.dirname"
] | [((67, 85), 'sublime.platform', 'sublime.platform', ([], {}), '()\n', (83, 85), False, 'import sublime\n'), ((184, 209), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (199, 209), False, 'import os\n')] |
from django.urls import path, include
from rest_framework.urlpatterns import format_suffix_patterns
from webvep_api.views import ping_view, vcf_view, vep_view
urlpatterns = [path("ping/", ping_view), path("vcf/", vcf_view), path("vep/", vep_view)]
urlpatterns = format_suffix_patterns(urlpatterns)
| [
"rest_framework.urlpatterns.format_suffix_patterns",
"django.urls.path"
] | [((264, 299), 'rest_framework.urlpatterns.format_suffix_patterns', 'format_suffix_patterns', (['urlpatterns'], {}), '(urlpatterns)\n', (286, 299), False, 'from rest_framework.urlpatterns import format_suffix_patterns\n'), ((176, 200), 'django.urls.path', 'path', (['"""ping/"""', 'ping_view'], {}), "('ping/', ping_view)... |
import os
from flytekitplugins.papermill import NotebookTask
from flytekitplugins.spark import Spark
from flytekit import kwtypes
from flytekit.types.schema import FlyteSchema
def _get_nb_path(name: str, suffix: str = "", abs: bool = True, ext: str = ".ipynb") -> str:
"""
Creates a correct path no matter wh... | [
"flytekitplugins.spark.Spark",
"os.path.dirname",
"os.path.abspath",
"flytekit.kwtypes"
] | [((371, 396), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (386, 396), False, 'import os\n'), ((465, 486), 'os.path.abspath', 'os.path.abspath', (['path'], {}), '(path)\n', (480, 486), False, 'import os\n'), ((753, 781), 'flytekitplugins.spark.Spark', 'Spark', ([], {'spark_conf': "{'x': 'y'... |
import logging
from six.moves import http_client
from .. import utils
log = logging.getLogger(__name__)
class SwarmApiMixin(object):
def create_swarm_spec(self, *args, **kwargs):
return utils.SwarmSpec(*args, **kwargs)
@utils.minimum_version('1.24')
def init_swarm(self, advertise_addr=None, list... | [
"logging.getLogger"
] | [((76, 103), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (93, 103), False, 'import logging\n')] |
import pytest
import numpy as np
from unpackqa import (unpack_to_array,
unpack_to_dict,
list_products,
list_qa_flags,
list_sensors,
)
from unpackqa.tools.validation import (product_info_has_require... | [
"unpackqa.list_sensors",
"unpackqa.list_qa_flags",
"pytest.raises",
"unpackqa.list_products",
"numpy.array",
"pytest.mark.parametrize"
] | [((1116, 1168), 'numpy.array', 'np.array', (['[[8, 8, 8], [16, 16, 16], [255, 255, 255]]'], {}), '([[8, 8, 8], [16, 16, 16], [255, 255, 255]])\n', (1124, 1168), True, 'import numpy as np\n'), ((1232, 1259), 'unpackqa.list_products', 'list_products', ([], {'sensor': '"""all"""'}), "(sensor='all')\n", (1245, 1259), False... |
# Um programa que resolve a hipotenusa #
from math import hypot
co = float(input('Comprimento do cateto opsoto: '))
ca = float(input('Comprimento do cateto adjacente: '))
print(f'A hipotenusa vai medir: {hypot(co, ca):.2f}')
| [
"math.hypot"
] | [((205, 218), 'math.hypot', 'hypot', (['co', 'ca'], {}), '(co, ca)\n', (210, 218), False, 'from math import hypot\n')] |
import sys
sys.path.append("C:/Users/900143/Desktop/Certo")
from controller.squad_controller import BackController, FrontController,SGBDController , SquadController, BackEnd, FrontEnd, SGBD, Squad
from flask import Flask, render_template, request, redirect
app = Flask(__name__)
bc = BackController()
fc = FrontContro... | [
"sys.path.append",
"controller.squad_controller.BackController",
"flask.redirect",
"controller.squad_controller.FrontEnd",
"controller.squad_controller.SGBDController",
"controller.squad_controller.BackEnd",
"flask.Flask",
"controller.squad_controller.Squad",
"flask.render_template",
"controller.s... | [((11, 59), 'sys.path.append', 'sys.path.append', (['"""C:/Users/900143/Desktop/Certo"""'], {}), "('C:/Users/900143/Desktop/Certo')\n", (26, 59), False, 'import sys\n'), ((265, 280), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (270, 280), False, 'from flask import Flask, render_template, request, redire... |
# main.py
from app import app
import views
if __name__ == '__main__':
app.run(host='0.0.0.0',port='5000') | [
"app.app.run"
] | [((75, 111), 'app.app.run', 'app.run', ([], {'host': '"""0.0.0.0"""', 'port': '"""5000"""'}), "(host='0.0.0.0', port='5000')\n", (82, 111), False, 'from app import app\n')] |
# -*- coding: UTF-8 -*-
# Copyright 2009-2018 <NAME>.
# License: BSD, see LICENSE for more details.
# doctest lino/core/site.py
"""
Defines the :class:`Site` class. For an overview see
:doc:`/dev/site` and :doc:`/dev/plugins`.
.. doctest init:
>>> import lino
>>> lino.startup('lino.projects.std.settings_test... | [
"lino.core.requests.BaseRequest",
"django.core.mail.send_mail",
"lino.core.merge.MergeAction",
"logging.getLogger",
"unipath.Path",
"etgen.html.E.a",
"datetime.time",
"etgen.html.E.span",
"six.moves.urllib.parse.urlencode",
"os.path.join",
"doctest.testmod",
"lino.core.menus.Toolbar",
"os.pa... | [((1576, 1662), 'collections.namedtuple', 'collections.namedtuple', (['"""LanguageInfo"""', "('django_code', 'name', 'index', 'suffix')"], {}), "('LanguageInfo', ('django_code', 'name', 'index',\n 'suffix'))\n", (1598, 1662), False, 'import collections\n'), ((1383, 1394), 'html2text.HTML2Text', 'HTML2Text', ([], {})... |
__author__ = '[<NAME>](https://github.com/adamsqi)'
__date__ = '2020.06.21'
"""
This is a script for auto generation of README.md content. The script parses all .py script files within the repository and creates a README.md file.
Inspired by: [<NAME>](https://github.com/bamos/python-scripts/blob/master/README.md)
""... | [
"os.getcwd",
"ast.parse",
"os.path.join"
] | [((2818, 2836), 'ast.parse', 'ast.parse', (['content'], {}), '(content)\n', (2827, 2836), False, 'import ast\n'), ((2691, 2702), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (2700, 2702), False, 'import os\n'), ((3865, 3876), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (3874, 3876), False, 'import os\n'), ((1142, 1179),... |
# -*- encoding: utf-8 -*-
"""
@Author : zYx.Tom
@Contact : <EMAIL>
@site : https://zhuyuanxiang.github.io
---------------------------
@Software : PyCharm
@Project : deep-learning-with-python-notebooks
@File : ch0602_recurrent_neural_network.py
@Version : v0.1
@Time : ... | [
"keras.optimizers.rmsprop",
"numpy.random.seed",
"keras.preprocessing.sequence.pad_sequences",
"numpy.set_printoptions",
"tools.plot_classes_results",
"matplotlib.pyplot.get_fignums",
"keras.datasets.imdb.load_data",
"numpy.stack",
"keras.layers.SimpleRNN",
"matplotlib.pyplot.show",
"numpy.asarr... | [((1218, 1303), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'precision': '(3)', 'suppress': '(True)', 'threshold': 'np.inf', 'linewidth': '(200)'}), '(precision=3, suppress=True, threshold=np.inf, linewidth=200\n )\n', (1237, 1303), True, 'import numpy as np\n'), ((1369, 1389), 'numpy.random.seed', 'np.ra... |
import numpy as np
from Classes.Uncertainty import Uncertainty
from Classes.QComp import QComp
class QAData(object):
"""Evaluates and stores quality assurance characteristics and messages.
Attributes
----------
q_run_threshold_caution: int
Caution threshold for interpolated discharge for a ru... | [
"numpy.sum",
"numpy.abs",
"numpy.greater",
"numpy.isnan",
"numpy.tile",
"numpy.round",
"numpy.unique",
"numpy.nanmean",
"Classes.Uncertainty.Uncertainty.uncertainty_extrapolation",
"numpy.logical_not",
"numpy.append",
"Classes.QComp.QComp.edge_ensembles",
"numpy.less",
"numpy.nansum",
"C... | [((11642, 11657), 'numpy.any', 'np.any', (['checked'], {}), '(checked)\n', (11648, 11657), True, 'import numpy as np\n'), ((23573, 23585), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (23581, 23585), True, 'import numpy as np\n'), ((24064, 24079), 'numpy.any', 'np.any', (['checked'], {}), '(checked)\n', (24070, 2... |
"""Add CheckConstraints for non-nullable string cols
Revision ID: b7fc1ab24c92
Revises: <PASSWORD>
Create Date: 2020-07-10 13:24:56.007611
"""
from datetime import datetime
from uuid import uuid4
from alembic import op
from geoalchemy2 import Geometry
from sqlalchemy import DATE, Column, DateTime, ForeignKey, Intege... | [
"sqlalchemy.MetaData",
"sqlalchemy.orm.declarative_base",
"sqlalchemy.sql.schema.UniqueConstraint",
"sqlalchemy.ForeignKey",
"geoalchemy2.Geometry",
"sqlalchemy.Column",
"sqlalchemy.String",
"sqlalchemy.sql.schema.CheckConstraint",
"alembic.op.batch_alter_table"
] | [((4668, 4720), 'sqlalchemy.MetaData', 'MetaData', ([], {'naming_convention': 'sqlite_naming_convention'}), '(naming_convention=sqlite_naming_convention)\n', (4676, 4720), False, 'from sqlalchemy import DATE, Column, DateTime, ForeignKey, Integer, MetaData, String, Text\n'), ((4742, 4777), 'sqlalchemy.orm.declarative_b... |
# Copyright (c) 2015 The Johns Hopkins University/Applied Physics Laboratory
# 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/... | [
"six.add_metaclass"
] | [((927, 957), 'six.add_metaclass', 'six.add_metaclass', (['abc.ABCMeta'], {}), '(abc.ABCMeta)\n', (944, 957), False, 'import six\n')] |
from utils import *
from chinese_checkers.TinyChineseCheckersGame import ChineseCheckersGame
from chinese_checkers.tensorflow.ResNet import NNetWrapper as nn
from chinese_checkers.Evaluator import Evaluator
from MCTS import MCTS
from chinese_checkers.InitializeAgent import InitializeAgent
from chinese_checkers.GreedyAg... | [
"chinese_checkers.Evaluator.Evaluator",
"chinese_checkers.GreedyAgent.GreedyAgent",
"chinese_checkers.InitializeAgent.InitializeAgent",
"chinese_checkers.TinyChineseCheckersGame.ChineseCheckersGame",
"numpy.zeros",
"MCTS.MCTS",
"chinese_checkers.tensorflow.ResNet.NNetWrapper",
"chinese_checkers.TinyGU... | [((667, 688), 'chinese_checkers.TinyChineseCheckersGame.ChineseCheckersGame', 'ChineseCheckersGame', ([], {}), '()\n', (686, 688), False, 'from chinese_checkers.TinyChineseCheckersGame import ChineseCheckersGame\n'), ((695, 701), 'chinese_checkers.TinyGUI.GUI', 'GUI', (['(1)'], {}), '(1)\n', (698, 701), False, 'from ch... |
from tensorflow.keras.utils import Sequence
import os
import pandas as pd
import random
import numpy as np
class DataGenerator(Sequence):
def __init__(self,
path_args,
batch_size: int,
shuffle: bool,
mode: str):
self.x_img_path = './train... | [
"numpy.stack",
"os.listdir",
"numpy.random.shuffle"
] | [((425, 452), 'os.listdir', 'os.listdir', (['self.x_img_path'], {}), '(self.x_img_path)\n', (435, 452), False, 'import os\n'), ((476, 505), 'os.listdir', 'os.listdir', (['self.x_label_path'], {}), '(self.x_label_path)\n', (486, 505), False, 'import os\n'), ((1198, 1229), 'numpy.random.shuffle', 'np.random.shuffle', (['... |
from evennia_extensions.object_extensions.storage_wrappers import StorageWrapper
class RosterEntryWrapper(StorageWrapper):
def get_storage(self, instance):
return instance.obj.roster
def create_new_storage(self, instance):
raise AttributeError("This object does not have a RosterEntry to store... | [
"evennia_extensions.character_extensions.models.CharacterMessengerSettings.objects.create",
"evennia_extensions.character_extensions.models.CharacterSheet.objects.create",
"evennia_extensions.character_extensions.models.CharacterCombatSettings.objects.create"
] | [((599, 651), 'evennia_extensions.character_extensions.models.CharacterSheet.objects.create', 'CharacterSheet.objects.create', ([], {'objectdb': 'instance.obj'}), '(objectdb=instance.obj)\n', (628, 651), False, 'from evennia_extensions.character_extensions.models import CharacterSheet\n'), ((965, 1026), 'evennia_extens... |
# coding: utf-8
from flask import Flask,request,session,g,redirect,url_for,Blueprint
from flask import abort,render_template,flash
from helpers import getAvatar
import config
#from .base import BaseHandler
import base
config = config.rec()
user = Blueprint('user', __name__)
#class LoginHandler(BaseHandler):
@user.... | [
"flask.session.pop",
"flask.Blueprint",
"flask.redirect",
"base.currentUserSet",
"config.rec",
"flask.render_template",
"base.userAuth",
"base.isAdmin"
] | [((229, 241), 'config.rec', 'config.rec', ([], {}), '()\n', (239, 241), False, 'import config\n'), ((250, 277), 'flask.Blueprint', 'Blueprint', (['"""user"""', '__name__'], {}), "('user', __name__)\n", (259, 277), False, 'from flask import Flask, request, session, g, redirect, url_for, Blueprint\n'), ((641, 674), 'base... |
import os
default_cf_mapping_files = [os.path.dirname(__file__) + '/default-cloudformation-mapping.yaml']
| [
"os.path.dirname"
] | [((39, 64), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (54, 64), False, 'import os\n')] |
#!/usr/bin/env python
from pwn import *
import os
# Exploiting vulnerable code narnia1.c:
#
# #include <stdio.h>
#
# int main(){
# int (*ret)();
#
# if(getenv("EGG")==NULL){
# printf("Give me something to execute at the env-variable EGG\n");
# exit(1);
# }
#
# printf("Trying to execute EGG!\n");
# ret = geten... | [
"os.system"
] | [((507, 592), 'os.system', 'os.system', (['"""gcc narnia1.c -g -o narnia1_local -fno-stack-protector -z execstack"""'], {}), "('gcc narnia1.c -g -o narnia1_local -fno-stack-protector -z execstack'\n )\n", (516, 592), False, 'import os\n')] |
from geopy.geocoders import ArcGIS
import pyproj
class Georeferencer:
def __init__(self, crs):
self.georeferencer = ArcGIS()
self.transformer = pyproj.Transformer.from_crs("EPSG:4326", f"EPSG:{crs}")
def georeference(self, addresses):
result = {}
for address in addresses:
... | [
"geopy.geocoders.ArcGIS",
"pyproj.Transformer.from_crs"
] | [((130, 138), 'geopy.geocoders.ArcGIS', 'ArcGIS', ([], {}), '()\n', (136, 138), False, 'from geopy.geocoders import ArcGIS\n'), ((166, 221), 'pyproj.Transformer.from_crs', 'pyproj.Transformer.from_crs', (['"""EPSG:4326"""', 'f"""EPSG:{crs}"""'], {}), "('EPSG:4326', f'EPSG:{crs}')\n", (193, 221), False, 'import pyproj\n... |
"""Client is the primary interface for interacting with the Goodreads API. This integration test makes live API
calls and affirms that the correct objects are being returned. For a more comprehensive test that each of the interface
objects is created and functions properly when given the correct inputs, check the unit ... | [
"os.environ.get",
"pytest.raises"
] | [((829, 860), 'os.environ.get', 'os.environ.get', (['"""GOODREADS_KEY"""'], {}), "('GOODREADS_KEY')\n", (843, 860), False, 'import os\n'), ((862, 896), 'os.environ.get', 'os.environ.get', (['"""GOODREADS_SECRET"""'], {}), "('GOODREADS_SECRET')\n", (876, 896), False, 'import os\n'), ((983, 1022), 'pytest.raises', 'pytes... |
# -*- coding: utf-8 -*-
# Time : 2021/12/22 16:15
# Author : QIN2DIM
# Github : https://github.com/QIN2DIM
# Description:
import ast
from datetime import timedelta, datetime
from typing import List, Optional, Union
from redis.exceptions import ConnectionError, ResponseError
from services.middleware.stre... | [
"datetime.timedelta",
"datetime.datetime.now"
] | [((4276, 4305), 'datetime.timedelta', 'timedelta', ([], {'seconds': '_lifecycle'}), '(seconds=_lifecycle)\n', (4285, 4305), False, 'from datetime import timedelta, datetime\n'), ((4329, 4355), 'datetime.datetime.now', 'datetime.now', (['TIME_ZONE_CN'], {}), '(TIME_ZONE_CN)\n', (4341, 4355), False, 'from datetime import... |
from Experiments import test_knapsack_SPO_unit, test_knapsack_SPO
"""
Example SPO-Relax experiments for knapsack benchmarks.
Dependencies:
gcc/8.3.0
openmpi/3.1.4
python/3.7.4
scikit-learn/0.23.1-python-3.7.4
gurobi/9.0.0
numpy/1.17.3-python-3.7.4
matplotlib/3.2.1-python-3.7.4
"""
capacities = [12,24,48,72,96,120,144,... | [
"Experiments.test_knapsack_SPO_unit",
"Experiments.test_knapsack_SPO"
] | [((400, 558), 'Experiments.test_knapsack_SPO', 'test_knapsack_SPO', ([], {'capacities': 'capacities', 'is_shuffle': '(False)', 'NUMBER_OF_RANDOM_TESTS': '(1)', 'kfolds': 'kfolds', 'n_iter': '(5)', 'dest_folder': 'dest_folder', 'noise_level': '(0)'}), '(capacities=capacities, is_shuffle=False,\n NUMBER_OF_RANDOM_TEST... |
root = 'data/'
import numpy as np
from ffjord.datasets.power import POWER
from ffjord.datasets.gas import GAS
from ffjord.datasets.hepmass import HEPMASS
from ffjord.datasets.miniboone import MINIBOONE
from ffjord.datasets.bsds300 import BSDS300
from .synthetic import EightGaussians
from .synthetic import Checkerboard... | [
"ffjord.datasets.gas.GAS",
"ffjord.datasets.miniboone.MINIBOONE",
"numpy.random.RandomState",
"ffjord.datasets.hepmass.HEPMASS",
"ffjord.datasets.power.POWER",
"ffjord.datasets.bsds300.BSDS300",
"utils.order_variables_partial_correlation"
] | [((738, 768), 'numpy.random.RandomState', 'np.random.RandomState', ([], {'seed': '(42)'}), '(seed=42)\n', (759, 768), True, 'import numpy as np\n'), ((899, 953), 'utils.order_variables_partial_correlation', 'order_variables_partial_correlation', (['data.trn.x'], {'tr': 'tr'}), '(data.trn.x, tr=tr)\n', (934, 953), False... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.utils.timezone import utc
import datetime
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL... | [
"django.db.models.TextField",
"django.db.models.OneToOneField",
"django.db.migrations.swappable_dependency",
"django.db.models.BigIntegerField",
"django.db.models.ForeignKey",
"django.db.models.CharField",
"django.db.models.AutoField",
"datetime.datetime",
"django.db.models.IntegerField"
] | [((264, 321), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (295, 321), False, 'from django.db import migrations, models\n'), ((2492, 2530), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'to': '"""webapp.Us... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2017-08-04 19:25
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('data', '0023_auto_20170801_1925'),
]
operations = [
migrations.AddField(
... | [
"django.db.models.CharField"
] | [((401, 535), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'help_text': '"""Name of the volume attached to store data for this job."""', 'max_length': '(255)', 'null': '(True)'}), "(blank=True, help_text=\n 'Name of the volume attached to store data for this job.', max_length=\n 255,... |
from dataclasses import dataclass, field
from logging import getLogger
from typing import Any, Dict, List
import hydra
from hydra.core.config_store import ConfigStore
from hydra.utils import to_absolute_path
from kedro.io import DataCatalog, MemoryDataSet
from kedro.pipeline import Pipeline, node
from kedro.runner imp... | [
"omegaconf.OmegaConf.to_yaml",
"kedro.io.DataCatalog",
"hydra.utils.to_absolute_path",
"arachne.tools.ToolFactory.list",
"arachne.tools.ToolFactory.get",
"kedro.runner.SequentialRunner",
"dataclasses.field",
"kedro.pipeline.node",
"hydra.core.config_store.ConfigStore.instance",
"hydra.main",
"ke... | [((654, 673), 'logging.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (663, 673), False, 'from logging import getLogger\n'), ((2802, 2859), 'hydra.main', 'hydra.main', ([], {'config_path': '"""../config"""', 'config_name': '"""config"""'}), "(config_path='../config', config_name='config')\n", (2812, 2859)... |
import urllib.request as req
import subprocess
s = '侵入者あり'
print(s)
# 読み上げ
subprocess.check_output('./jtalk.sh "' +s + '"', shell=True)
| [
"subprocess.check_output"
] | [((77, 138), 'subprocess.check_output', 'subprocess.check_output', (['(\'./jtalk.sh "\' + s + \'"\')'], {'shell': '(True)'}), '(\'./jtalk.sh "\' + s + \'"\', shell=True)\n', (100, 138), False, 'import subprocess\n')] |
import matplotlib.pyplot as plt
from numpy import *
import os
"""
filename1 = "data_processing/" + "GeneralQuantumFisher1photons"
filename2 = "data_processing/" + "GeneralQuantumFisher2photons"
filename3 = "data_processing/" + "GeneralQuantumFisher3photons"
with open(filename1) as f:
fisher1 = f.readline... | [
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.rcParams.update",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.ylabel",
"... | [((3093, 3121), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(13, 11)'}), '(figsize=(13, 11))\n', (3103, 3121), True, 'import matplotlib.pyplot as plt\n'), ((3752, 3779), 'matplotlib.pyplot.rcParams.update', 'plt.rcParams.update', (['params'], {}), '(params)\n', (3771, 3779), True, 'import matplotlib.pyp... |
# -*- coding: UTF-8 -*-
from flask import g
import sqlite3
import math
database = "project/appart.db"
categ_coef = 17960
coef = 360/6378137
def connect_db():
return sqlite3.connect(database)
def insert_db(street,lat,lon,year,room,all_area,all_floors):
# validating wether coordinates in Kyiv
#calculating distanc... | [
"flask.g.db.cursor",
"flask.g.db.close",
"sqlite3.connect",
"flask.g.db.commit"
] | [((171, 196), 'sqlite3.connect', 'sqlite3.connect', (['database'], {}), '(database)\n', (186, 196), False, 'import sqlite3\n'), ((1352, 1365), 'flask.g.db.cursor', 'g.db.cursor', ([], {}), '()\n', (1363, 1365), False, 'from flask import g\n'), ((1452, 1465), 'flask.g.db.commit', 'g.db.commit', ([], {}), '()\n', (1463, ... |
from django import forms
from django.forms import ModelForm
from .models import Customer, Order
from myapp.models import Name
class NameForm(forms.ModelForm):
name_value = forms.CharField(max_length=100, help_text = "Enter a name")
class Meta:
model = Name
fields = ('name_value',)
clas... | [
"django.forms.CharField"
] | [((177, 234), 'django.forms.CharField', 'forms.CharField', ([], {'max_length': '(100)', 'help_text': '"""Enter a name"""'}), "(max_length=100, help_text='Enter a name')\n", (192, 234), False, 'from django import forms\n')] |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'C:\Users\Freenove\Desktop\树莓派六足机器人\界面UI\face.ui'
#
# Created by: PyQt5 UI code generator 5.15.0
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are do... | [
"PyQt5.QtWidgets.QLabel",
"PyQt5.QtCore.QRect",
"PyQt5.QtWidgets.QLineEdit",
"PyQt5.QtWidgets.QPushButton",
"PyQt5.QtGui.QFont",
"PyQt5.QtCore.QMetaObject.connectSlotsByName"
] | [((1762, 1784), 'PyQt5.QtWidgets.QLabel', 'QtWidgets.QLabel', (['Face'], {}), '(Face)\n', (1778, 1784), False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((1869, 1882), 'PyQt5.QtGui.QFont', 'QtGui.QFont', ([], {}), '()\n', (1880, 1882), False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((2096, 2118), 'PyQt5... |
import os
import ecdsa
import binascii
import hashlib
from typing import Union
from luracoin.config import Config
def bits_to_target(bits: bytes) -> hex:
"""
The first byte is the exponent and the other three bytes are the
coefficient.
Example:
0x1d00ffff => 00000000ffff00000000000000000000000... | [
"hashlib.sha256",
"binascii.unhexlify",
"ecdsa.SigningKey.from_string"
] | [((1812, 1876), 'ecdsa.SigningKey.from_string', 'ecdsa.SigningKey.from_string', (['private_key'], {'curve': 'ecdsa.SECP256k1'}), '(private_key, curve=ecdsa.SECP256k1)\n', (1840, 1876), False, 'import ecdsa\n'), ((1540, 1577), 'binascii.unhexlify', 'binascii.unhexlify', (['little_endian_hex'], {}), '(little_endian_hex)\... |
#!/usr/bin/env python
######################################################################
# Software License Agreement (BSD License)
#
# Copyright (c) 2010, Rice University
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that t... | [
"matplotlib.backends.backend_pdf.PdfPages",
"os.remove",
"matplotlib.pyplot.show",
"optparse.OptionParser",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.boxplot",
"matplotlib.__version__.split",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.setp",
"matplotlib.pyplot.figtext",
"matplotlib.use",
"s... | [((1912, 1933), 'matplotlib.use', 'matplotlib.use', (['"""pdf"""'], {}), "('pdf')\n", (1926, 1933), False, 'import matplotlib\n'), ((2282, 2305), 'sqlite3.connect', 'sqlite3.connect', (['dbname'], {}), '(dbname)\n', (2297, 2305), False, 'import sqlite3\n'), ((7346, 7355), 'matplotlib.pyplot.clf', 'plt.clf', ([], {}), '... |
import xmltodict
import json
from elasticsearch import Elasticsearch
from elasticsearch.connection import create_ssl_context
import sys
##By: <NAME>
def Connect2ES(ip='127.0.0.1',port='9200',user="",password="",https=False,CertPath="",ES_Index='reports',Data=""):
## Connection to Elastic Search (http/https... | [
"elasticsearch.connection.create_ssl_context"
] | [((443, 478), 'elasticsearch.connection.create_ssl_context', 'create_ssl_context', ([], {'cafile': 'CertPath'}), '(cafile=CertPath)\n', (461, 478), False, 'from elasticsearch.connection import create_ssl_context\n')] |
import random
from collections import deque
from typing import Tuple
from game.direction import Directions, GRID_WIDTH, GRID_HEIGHT
class GameState:
apple_pos = (0, 0)
positions = None
direction = 0
def __init__(self, start_pos: Tuple[int, int], length: int = 3) -> None:
self.length = length... | [
"random.randrange",
"game.direction.Directions.apply",
"collections.deque"
] | [((346, 353), 'collections.deque', 'deque', ([], {}), '()\n', (351, 353), False, 'from collections import deque\n'), ((598, 649), 'game.direction.Directions.apply', 'Directions.apply', (['self.direction', 'self.positions[0]'], {}), '(self.direction, self.positions[0])\n', (614, 649), False, 'from game.direction import ... |
import os
from dotenv import load_dotenv, find_dotenv
from sqlalchemy.sql.sqltypes import Integer, REAL, TEXT
from sqlalchemy import (create_engine, MetaData, Column, Table)
from sqlalchemy_utils import database_exists, create_database
load_dotenv(find_dotenv())
engine = create_engine(f"sqlite:///{os.getenv('SQLITE_D... | [
"sqlalchemy.MetaData",
"sqlalchemy_utils.create_database",
"dotenv.find_dotenv",
"sqlalchemy_utils.database_exists",
"sqlalchemy.Column",
"sqlalchemy.sql.sqltypes.REAL",
"os.getenv",
"sqlalchemy.sql.sqltypes.TEXT"
] | [((425, 446), 'sqlalchemy.MetaData', 'MetaData', ([], {'bind': 'engine'}), '(bind=engine)\n', (433, 446), False, 'from sqlalchemy import create_engine, MetaData, Column, Table\n'), ((249, 262), 'dotenv.find_dotenv', 'find_dotenv', ([], {}), '()\n', (260, 262), False, 'from dotenv import load_dotenv, find_dotenv\n'), ((... |
import json
import time
import datetime
from aliyunsdkcore.client import AcsClient
from cachetools import cached, TTLCache
from prometheus_client.metrics_core import GaugeMetricFamily
import aliyunsdkecs.request.v20140526.DescribeInstancesRequest as DescribeECS
import aliyunsdkrds.request.v20140815.DescribeDBInstance... | [
"aliyunsdkrds.request.v20140815.DescribeDBInstancesRequest.DescribeDBInstancesRequest",
"aliyunsdkslb.request.v20140515.DescribeLoadBalancerHTTPSListenerAttributeRequest.DescribeLoadBalancerHTTPSListenerAttributeRequest",
"aliyunsdkdds.request.v20151201.DescribeDBInstancesRequest.DescribeDBInstancesRequest",
... | [((1148, 1179), 'cachetools.TTLCache', 'TTLCache', ([], {'maxsize': '(100)', 'ttl': '(3600)'}), '(maxsize=100, ttl=3600)\n', (1156, 1179), False, 'from cachetools import cached, TTLCache\n'), ((1757, 1770), 'cachetools.cached', 'cached', (['cache'], {}), '(cache)\n', (1763, 1770), False, 'from cachetools import cached,... |