code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
"""
utility for project 9
:author: <NAME> <<EMAIL>>
:license: CC0
"""
def clear():
"""
clear cmd/term
:return: void
"""
import os
import sys
if sys.platform == 'win32':
os.system('cls') # on windows
else:
os.system('clear') # on linux / os x
if __name__ == '__mai... | [
"os.system"
] | [((210, 226), 'os.system', 'os.system', (['"""cls"""'], {}), "('cls')\n", (219, 226), False, 'import os\n'), ((259, 277), 'os.system', 'os.system', (['"""clear"""'], {}), "('clear')\n", (268, 277), False, 'import os\n')] |
import os
import argparse
import subprocess
from workflow import Workflow
def get_kubectl_cmd_path():
wf = Workflow()
return wf.settings.get("KUBECTL_CMD_PATH") or os.environ.get("KUBECTL_CMD_PATH", '/usr/local/bin/kubectl')
class KService:
def __init__(self, type, name, age, status):
self.type =... | [
"workflow.Workflow",
"os.environ.get",
"argparse.ArgumentParser"
] | [((113, 123), 'workflow.Workflow', 'Workflow', ([], {}), '()\n', (121, 123), False, 'from workflow import Workflow\n'), ((438, 463), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (461, 463), False, 'import argparse\n'), ((2703, 2732), 'os.environ.get', 'os.environ.get', (['"""set_path_to"""'],... |
# -*- coding: utf-8 -*-
import os
import numpy as np
import sys
import logging
import csv
# Setup logging
logger = logging.getLogger(__name__)
console_handle = logging.StreamHandler()
console_handle.setLevel(logging.INFO)
formatter = logging.Formatter('%(asctime)s: %(message)s', datefmt='%m-%d %H:%M')
cons... | [
"logging.getLogger",
"logging.StreamHandler",
"csv.DictReader",
"logging.Formatter",
"numpy.array"
] | [((124, 151), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (141, 151), False, 'import logging\n'), ((170, 193), 'logging.StreamHandler', 'logging.StreamHandler', ([], {}), '()\n', (191, 193), False, 'import logging\n'), ((246, 314), 'logging.Formatter', 'logging.Formatter', (['"""%(asct... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
module: bigip_device_group_memb... | [
"datetime.datetime.now",
"ansible.module_utils.basic.AnsibleModule"
] | [((8085, 8183), 'ansible.module_utils.basic.AnsibleModule', 'AnsibleModule', ([], {'argument_spec': 'spec.argument_spec', 'supports_check_mode': 'spec.supports_check_mode'}), '(argument_spec=spec.argument_spec, supports_check_mode=spec.\n supports_check_mode)\n', (8098, 8183), False, 'from ansible.module_utils.basic... |
from elasticsearch import TransportError
from sanic import Blueprint
from sanic.request import Request
from sanic.response import HTTPResponse, json
from ..connections import get_client
rest_bp = Blueprint('rest')
def format_es_exception(e: TransportError):
return json({"status_code": e.status_code,
... | [
"sanic.response.json",
"sanic.Blueprint"
] | [((198, 215), 'sanic.Blueprint', 'Blueprint', (['"""rest"""'], {}), "('rest')\n", (207, 215), False, 'from sanic import Blueprint\n'), ((273, 343), 'sanic.response.json', 'json', (["{'status_code': e.status_code, 'error': e.error, 'info': e.info}"], {}), "({'status_code': e.status_code, 'error': e.error, 'info': e.info... |
from argo_dataflow import pipeline, kafka
def handler(msg, context):
return ("hi! " + msg.decode("UTF-8")).encode("UTF-8")
if __name__ == '__main__':
(pipeline("104-python3-9")
.owner('argoproj-labs')
.describe("""This example is of the Python 3.9 handler.
[Learn about handlers](../docs/HANDLERS.... | [
"argo_dataflow.kafka",
"argo_dataflow.pipeline"
] | [((349, 369), 'argo_dataflow.kafka', 'kafka', (['"""input-topic"""'], {}), "('input-topic')\n", (354, 369), False, 'from argo_dataflow import pipeline, kafka\n'), ((163, 188), 'argo_dataflow.pipeline', 'pipeline', (['"""104-python3-9"""'], {}), "('104-python3-9')\n", (171, 188), False, 'from argo_dataflow import pipeli... |
import asyncio
import discord
from commands import Commands, Guild_Instance, leave, play_search
import os
from pymongo import MongoClient
from dotenv import load_dotenv
load_dotenv()
CONNECTION_STRING = f"mongodb+srv://{os.environ['mongo_user']}:{os.environ['mongo_pass']}@dj<EMAIL>.mongodb.net/djangur?retryWrites=tru... | [
"commands.Guild_Instance.by_id",
"commands.play_search",
"dotenv.load_dotenv",
"asyncio.sleep",
"discord.Client",
"pymongo.MongoClient"
] | [((170, 183), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (181, 183), False, 'from dotenv import load_dotenv\n'), ((347, 377), 'pymongo.MongoClient', 'MongoClient', (['CONNECTION_STRING'], {}), '(CONNECTION_STRING)\n', (358, 377), False, 'from pymongo import MongoClient\n'), ((414, 430), 'discord.Client', 'd... |
# coding=utf-8
"""
Script to generate city object.
"""
from __future__ import division
import os
import numpy as np
import pickle
import warnings
import random
import datetime
import shapely.geometry.point as point
import pycity_base.classes.Weather as weath
import pycity_base.classes.demand.SpaceHeating as SpaceHeati... | [
"pycity_calc.environments.environment.EnvironmentExtended",
"pycity_calc.toolbox.teaser_usage.teaser_use.create_teaser_typecity",
"pycity_base.classes.demand.Occupancy.Occupancy",
"pycity_calc.toolbox.mc_helpers.user.user_unc_sampling.calc_sampling_dhw_per_apartment",
"pycity_calc.toolbox.modifiers.slp_th_m... | [((2465, 2541), 'os.path.join', 'os.path.join', (['src_path', '"""data"""', '"""BaseData"""', '"""Specific_Demand_Data"""', 'filename'], {}), "(src_path, 'data', 'BaseData', 'Specific_Demand_Data', filename)\n", (2477, 2541), False, 'import os\n'), ((2592, 2653), 'numpy.genfromtxt', 'np.genfromtxt', (['input_data_path'... |
# <NAME>, March 2020
# Common code for PyTorch implementation of Copy-Pasting GAN
import copy
import itertools
import matplotlib.pyplot as plt
import numpy as np
import os, platform, time
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision
import torchvision.transforms as transforms
f... | [
"torchvision.transforms.CenterCrop",
"os.listdir",
"PIL.Image.open",
"numpy.random.rand",
"torchvision.transforms.ToPILImage",
"numpy.random.choice",
"PIL.Image.new",
"numpy.sin",
"os.path.join",
"os.path.isfile",
"numpy.array",
"numpy.random.randint",
"numpy.zeros",
"PIL.ImageDraw.Draw",
... | [((1671, 1694), 'numpy.random.randint', 'np.random.randint', (['(1)', '(5)'], {}), '(1, 5)\n', (1688, 1694), True, 'import numpy as np\n'), ((1726, 1777), 'numpy.zeros', 'np.zeros', (['(height, width, channels)'], {'dtype': 'np.uint8'}), '((height, width, channels), dtype=np.uint8)\n', (1734, 1777), True, 'import numpy... |
# -*- coding: utf-8 -*-
"""Richardson-Extrapolation.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1oNlSL2Vztk9Fc7tMBgPcL82WGaUuCY-A
Before you turn this problem in, make sure everything runs as expected. First, **restart the kernel** (in the me... | [
"numpy.array",
"numpy.linspace",
"numpy.polynomial.Polynomial",
"pandas.DataFrame",
"matplotlib.pyplot.subplots"
] | [((6212, 6226), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (6224, 6226), True, 'import matplotlib.pyplot as plt\n'), ((6259, 6303), 'numpy.polynomial.Polynomial', 'Polynomial', (['[2.0, 1.0, -6.0, -2.0, 2.5, 1.0]'], {}), '([2.0, 1.0, -6.0, -2.0, 2.5, 1.0])\n', (6269, 6303), False, 'from numpy.polyn... |
"""The :mod:`mlshell.pipeline.steps` contains unified pipeline steps."""
import inspect
import mlshell
import numpy as np
import pandas as pd
import sklearn
import sklearn.impute
import sklearn.compose
__all__ = ['Steps']
class Steps(object):
"""Unified pipeline steps.
Parameters
----------
estim... | [
"sklearn.preprocessing.PolynomialFeatures",
"mlshell.decomposition.PCA",
"mlshell.preprocessing.FunctionTransformer",
"sklearn.base.is_classifier",
"inspect.stack",
"mlshell.preprocessing.OneHotEncoder",
"sklearn.preprocessing.KBinsDiscretizer",
"mlshell.model_selection.ThresholdClassifier",
"mlshel... | [((8958, 8991), 'numpy.full', 'np.full', (['x.shape[1]'], {'fill_value': '(1)'}), '(x.shape[1], fill_value=1)\n', (8965, 8991), True, 'import numpy as np\n'), ((5627, 5690), 'sklearn.compose.TransformedTargetRegressor', 'sklearn.compose.TransformedTargetRegressor', ([], {'regressor': 'estimator'}), '(regressor=estimato... |
from datetime import datetime
import peewee
from paste import domain
from . import db
class AbstractRepository(domain.IRepository):
_model = NotImplemented
_entity = NotImplemented
def count(self):
return self._model.count()
def save(self, entity):
model = _entity_to_model(entity... | [
"paste.domain.DoesNotExist",
"datetime.datetime.utcnow"
] | [((429, 446), 'datetime.datetime.utcnow', 'datetime.utcnow', ([], {}), '()\n', (444, 446), False, 'from datetime import datetime\n'), ((383, 400), 'datetime.datetime.utcnow', 'datetime.utcnow', ([], {}), '()\n', (398, 400), False, 'from datetime import datetime\n'), ((660, 710), 'paste.domain.DoesNotExist', 'domain.Doe... |
# Dataset https://archive.ics.uci.edu/ml/datasets/Nursery
import numpy as np
import pandas as pd
from collections import Counter
from sklearn.model_selection import train_test_split, GridSearchCV, StratifiedKFold
from imblearn.metrics import geometric_mean_score
from sklearn.metrics import mean_squared_error, make_s... | [
"racog.RACOG",
"sklearn.preprocessing.LabelEncoder",
"pandas.read_csv",
"imblearn.over_sampling.SMOTE",
"sklearn.metrics.make_scorer",
"sklearn.ensemble.RandomForestClassifier",
"sklearn.model_selection.StratifiedKFold",
"imblearn.metrics.geometric_mean_score",
"imblearn.over_sampling.RandomOverSamp... | [((870, 928), 'pandas.read_csv', 'pd.read_csv', (['nurseryurl'], {'header': 'None', 'names': 'attribute_list'}), '(nurseryurl, header=None, names=attribute_list)\n', (881, 928), True, 'import pandas as pd\n'), ((935, 949), 'sklearn.preprocessing.LabelEncoder', 'LabelEncoder', ([], {}), '()\n', (947, 949), False, 'from ... |
import json
from datetime import datetime
import time
from functools import reduce
import boto3
from celery import shared_task
from celery.bin.control import inspect
from django.conf import settings
from comic.container_exec.backends.k8s import K8sJob
from comic.eyra.models import Job, Submission, DataFile, JobInput
... | [
"json.loads",
"celery.bin.control.inspect",
"boto3.client",
"functools.reduce",
"time.sleep",
"datetime.datetime.now",
"comic.eyra.models.Job.objects.create",
"comic.eyra.models.Job.objects.get",
"comic.eyra.models.DataFile.objects.create",
"comic.eyra.models.JobInput.objects.create",
"comic.eyr... | [((504, 530), 'comic.eyra.models.Job.objects.get', 'Job.objects.get', ([], {'pk': 'job_pk'}), '(pk=job_pk)\n', (519, 530), False, 'from comic.eyra.models import Job, Submission, DataFile, JobInput\n'), ((707, 721), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (719, 721), False, 'from datetime import datet... |
import telnetlib
def print_logo(logo=''):
LOGO_DAFAULT = """\033[93m
/\ /\\
/ \\'._ (\_/) _.'/ \\
/_.''._'--('.')--'_.''._\\
| \_ / `;=/ " \=;` \ _/ |
\/ `\__|`\___/`|__/` \/
` \(/|\)/ `
" ` "
DAW_Start_By_VLDZ
\033[0m
"""
if logo != '':
pri... | [
"telnetlib.Telnet"
] | [((455, 483), 'telnetlib.Telnet', 'telnetlib.Telnet', (['ip_1', 'port'], {}), '(ip_1, port)\n', (471, 483), False, 'import telnetlib\n'), ((527, 555), 'telnetlib.Telnet', 'telnetlib.Telnet', (['ip_2', 'port'], {}), '(ip_2, port)\n', (543, 555), False, 'import telnetlib\n')] |
#!/usr/bin/python3
import requests
import sys
if __name__ == '__main__':
if len(sys.argv) != 3:
print("Error: you should pass 2 arguments: [link_to_download_from] [path_to_save_downloaded_file]")
exit(1)
url = sys.argv[1]
r = requests.get(url, allow_redirects=True)
open(sys.argv[2], '... | [
"requests.get"
] | [((256, 295), 'requests.get', 'requests.get', (['url'], {'allow_redirects': '(True)'}), '(url, allow_redirects=True)\n', (268, 295), False, 'import requests\n')] |
# Generated by Django 3.1.14 on 2021-12-14 08:25
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0066_collection_management_permissions'),
('profiles', '0001_initial'),
]
operations = [
... | [
"django.db.models.ForeignKey"
] | [((450, 635), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'blank': '(True)', 'help_text': '"""Choose a Terms and Conditions page"""', 'null': '(True)', 'on_delete': 'django.db.models.deletion.SET_NULL', 'related_name': '"""+"""', 'to': '"""wagtailcore.page"""'}), "(blank=True, help_text=\n 'Choose a Te... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import struct
import socket
from netlink import *
NETLINK_ROUTE = 0
NETLINK_UNUSED = 1
NETLINK_USERSOCK = 2
NETLINK_FIREWALL = 3
NETLINK_SOCK_DIAG = 4
NETLINK_NFLOG = 5
NETLINK_XFRM = 6
NETLINK_SELINUX ... | [
"struct.calcsize",
"struct.unpack",
"struct.pack",
"socket.socket"
] | [((1686, 1709), 'struct.calcsize', 'struct.calcsize', (['"""BBxx"""'], {}), "('BBxx')\n", (1701, 1709), False, 'import struct\n'), ((932, 989), 'socket.socket', 'socket.socket', (['socket.AF_NETLINK', 'socket.SOCK_RAW', 'family'], {}), '(socket.AF_NETLINK, socket.SOCK_RAW, family)\n', (945, 989), False, 'import socket\... |
# Version: 2022.03.23
"""
**********************************************************************************************************************
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved *
* ... | [
"logging.getLogger",
"boto3.client",
"os.getenv"
] | [((1769, 1788), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (1786, 1788), False, 'import logging\n'), ((1826, 1867), 'os.getenv', 'os.getenv', (['"""lambda_logging_level"""', '"""INFO"""'], {}), "('lambda_logging_level', 'INFO')\n", (1835, 1867), False, 'import os\n'), ((2737, 2755), 'boto3.client', 'bo... |
from __future__ import print_function
import numpy as np
import argparse
import glob
import os
import errno
import math
import cv2
from random import shuffle
from shutil import copyfile
parser = argparse.ArgumentParser(
description="create training/test/validation sets from video list"
)
parser.add_argument("--vi... | [
"math.floor",
"glob.glob",
"argparse.ArgumentParser",
"os.remove"
] | [((196, 292), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""create training/test/validation sets from video list"""'}), "(description=\n 'create training/test/validation sets from video list')\n", (219, 292), False, 'import argparse\n'), ((4822, 4858), 'glob.glob', 'glob.glob', (["(a... |
import json
import importlib
import os
import unittest
from unittest.mock import Mock
from moto import mock_dynamodb2
import boto3
from lambda_local.context import Context
os.environ['ENVIRONMENT'] = 'TEST'
os.environ['LOG_LEVEL'] = 'CRITICAL'
os.environ['DSA_KEY'] = 'TESTKEY'
class TestLapsed(unittest.TestCase):
... | [
"unittest.mock.Mock",
"json.dumps",
"actionnetwork_activist_sync.state_model.State.create_table",
"lambda_local.context.Context",
"importlib.reload"
] | [((555, 605), 'actionnetwork_activist_sync.state_model.State.create_table', 'State.create_table', ([], {'billing_mode': '"""PAY_PER_REQUEST"""'}), "(billing_mode='PAY_PER_REQUEST')\n", (573, 605), False, 'from actionnetwork_activist_sync.state_model import State\n'), ((624, 697), 'json.dumps', 'json.dumps', (["{'Email'... |
"""
This script tests the classes and functions from motif_finder.py.
Parameters
----------
None
Returns
-------
Assertion errors if tests fail
"""
import sys
import random
import pickle
import networkx as nx
from github_analysis.big_cloud_scratch import git_graph
from github_analysis.data_layer import getCommitsBy... | [
"github_analysis.big_cloud_scratch.git_graph",
"github_analysis.data_layer.getCommitsByProjectIds",
"github_analysis.cluster.get_embedding_clusters"
] | [((445, 483), 'github_analysis.cluster.get_embedding_clusters', 'get_embedding_clusters', ([], {'random_state': '(0)'}), '(random_state=0)\n', (467, 483), False, 'from github_analysis.cluster import get_embedding_clusters\n'), ((503, 538), 'github_analysis.data_layer.getCommitsByProjectIds', 'getCommitsByProjectIds', (... |
import sys
import psutil
from pyinjector import inject
if len(sys.argv) != 3:
print("Usage: python inject.py <process-name> <shared-library>")
exit()
_, process_name, shared_library = sys.argv
for process in psutil.process_iter():
if process.name() == process_name:
print(f"Found {process_name} - ... | [
"pyinjector.inject",
"psutil.process_iter"
] | [((219, 240), 'psutil.process_iter', 'psutil.process_iter', ([], {}), '()\n', (238, 240), False, 'import psutil\n'), ((380, 415), 'pyinjector.inject', 'inject', (['process.pid', 'shared_library'], {}), '(process.pid, shared_library)\n', (386, 415), False, 'from pyinjector import inject\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jul 1 15:10:45 2019
@author: r17935avinash
"""
################################ IMPORT LIBRARIES ###############################################################
import torch
import numpy as np
import pykp.io
import torch.nn as nn
from utils.statistics... | [
"utils.string_helper.convert_list_to_kphs",
"sequence_generator.SequenceGenerator",
"hierarchal_attention_Discriminator.Discriminator",
"math.floor",
"torch.load",
"torch.Tensor",
"logging.info",
"torch.cuda.is_available",
"pykp.model.Seq2SeqModel",
"utils.time_log.time_since",
"torch.nn.functio... | [((2551, 2576), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (2574, 2576), False, 'import torch\n'), ((3352, 3363), 'time.time', 'time.time', ([], {}), '()\n', (3361, 3363), False, 'import time\n'), ((4134, 4159), 'utils.string_helper.convert_list_to_kphs', 'convert_list_to_kphs', (['trg'], {... |
import os
import sys
import json
import argparse
import numpy as np
sys.path.append('Camera_Intrinsics_API/')
from get_camera_intrinsics import CameraIntrinsicsHelper
if __name__=='__main__':
parser = argparse.ArgumentParser()
parser.add_argument(
"--input_dir",
type=str,
default='dat... | [
"os.listdir",
"argparse.ArgumentParser",
"os.path.join",
"os.path.isfile",
"get_camera_intrinsics.CameraIntrinsicsHelper",
"sys.path.append"
] | [((69, 110), 'sys.path.append', 'sys.path.append', (['"""Camera_Intrinsics_API/"""'], {}), "('Camera_Intrinsics_API/')\n", (84, 110), False, 'import sys\n'), ((208, 233), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (231, 233), False, 'import argparse\n'), ((1273, 1297), 'get_camera_intrinsic... |
import codecs
import os
from setuptools import find_packages, setup
def long_description():
if not (os.path.isfile('README.md') and os.access('README.md', os.R_OK)):
return ''
with codecs.open('README.md', encoding='utf8') as f:
return f.read()
linting_deps = [
'mypy==0.761',
'pycod... | [
"os.path.isfile",
"codecs.open",
"setuptools.find_packages",
"os.access"
] | [((200, 241), 'codecs.open', 'codecs.open', (['"""README.md"""'], {'encoding': '"""utf8"""'}), "('README.md', encoding='utf8')\n", (211, 241), False, 'import codecs\n'), ((1213, 1228), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (1226, 1228), False, 'from setuptools import find_packages, setup\n'), (... |
from decimal import Decimal
import torch
from torch.nn import Module
import os
from deeplodocus.utils.notification import Notification
from deeplodocus.utils.flags.save import *
from deeplodocus.utils.flags.event import *
from deeplodocus.utils.flags.notif import *
from deeplodocus.utils.flags.ext import DEEP... | [
"os.makedirs",
"deeplodocus.brain.signal.Signal",
"os.path.isfile",
"deeplodocus.utils.notification.Notification",
"deeplodocus.utils.generic_utils.get_corresponding_flag",
"deeplodocus.brain.thalamus.Thalamus"
] | [((1373, 1431), 'deeplodocus.utils.generic_utils.get_corresponding_flag', 'get_corresponding_flag', (['DEEP_LIST_SAVE_SIGNAL', 'save_signal'], {}), '(DEEP_LIST_SAVE_SIGNAL, save_signal)\n', (1395, 1431), False, 'from deeplodocus.utils.generic_utils import get_corresponding_flag\n'), ((1455, 1509), 'deeplodocus.utils.ge... |
from typing import NamedTuple, cast, List as PyList, Dict, Any, BinaryIO, Optional, TypeVar, Type, Protocol, \
runtime_checkable
from types import GeneratorType
from textwrap import indent
from collections.abc import Sequence as ColSequence
from itertools import chain
import io
from remerkleable.core import View, B... | [
"itertools.chain",
"remerkleable.core.ObjParseException",
"remerkleable.basic.uint256.view_from_backing",
"remerkleable.tree.zero_node",
"textwrap.indent",
"remerkleable.basic.uint32",
"io.BytesIO",
"remerkleable.tree.get_depth",
"remerkleable.basic.uint256",
"remerkleable.readonly_iters.ComplexEl... | [((758, 782), 'typing.TypeVar', 'TypeVar', (['"""V"""'], {'bound': 'View'}), "('V', bound=View)\n", (765, 782), False, 'from typing import NamedTuple, cast, List as PyList, Dict, Any, BinaryIO, Optional, TypeVar, Type, Protocol, runtime_checkable\n'), ((1395, 1432), 'typing.TypeVar', 'TypeVar', (['"""M"""'], {'bound': ... |
'''Faça um programa que gere números aleatórios entre 0 e 50 até o número 32 ser
gerado. Quando isso ocorrer, informar:
a. A soma de todos os números gerados
b. A quantidade de números gerados que é impar
c. O menor número gerado'''
import random
x = random.randint(0,50)
cont = 32
somaNumeros = 0
qqntImpares = 0
meno... | [
"random.randint"
] | [((253, 274), 'random.randint', 'random.randint', (['(0)', '(50)'], {}), '(0, 50)\n', (267, 274), False, 'import random\n'), ((358, 379), 'random.randint', 'random.randint', (['(0)', '(50)'], {}), '(0, 50)\n', (372, 379), False, 'import random\n')] |
# encoding=utf8
import HttpUtils
class YibaiApiError(Exception):
def __init__(self, code, message):
super(YibaiApiError, self).__init__(message)
self.code = code
class YibaiClient(object):
def __init__(self, server_url, apikey):
self.serverUrl = server_url
self... | [
"HttpUtils.post_json"
] | [((874, 911), 'HttpUtils.post_json', 'HttpUtils.post_json', (['req_url', 'request'], {}), '(req_url, request)\n', (893, 911), False, 'import HttpUtils\n')] |
# Generated by Django 3.1.3 on 2020-11-15 16:01
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('network', '0004_auto_20201111_2224'),
]
operations = [
migrations.RemoveField(
model_name='post',
name='likers',
),
... | [
"django.db.migrations.RemoveField"
] | [((227, 283), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""post"""', 'name': '"""likers"""'}), "(model_name='post', name='likers')\n", (249, 283), False, 'from django.db import migrations\n')] |
#!/usr/bin/env python3
from gcal_helpers import helpers
helpers.write_transformation("newsletter")
| [
"gcal_helpers.helpers.write_transformation"
] | [((58, 100), 'gcal_helpers.helpers.write_transformation', 'helpers.write_transformation', (['"""newsletter"""'], {}), "('newsletter')\n", (86, 100), False, 'from gcal_helpers import helpers\n')] |
"""
Sliding Window Matching
=======================
Find recurring patterns in neural signals using Sliding Window Matching.
This tutorial primarily covers the :func:`~.sliding_window_matching` function.
"""
###################################################################################################
# Overvie... | [
"numpy.mean",
"neurodsp.utils.set_random_seed",
"neurodsp.rhythm.sliding_window_matching",
"neurodsp.plts.time_series.plot_time_series",
"neurodsp.plts.rhythm.plot_swm_pattern",
"neurodsp.utils.download.load_ndsp_data",
"neurodsp.utils.norm.normalize_sig"
] | [((2026, 2044), 'neurodsp.utils.set_random_seed', 'set_random_seed', (['(0)'], {}), '(0)\n', (2041, 2044), False, 'from neurodsp.utils import set_random_seed, create_times\n'), ((2424, 2474), 'neurodsp.utils.download.load_ndsp_data', 'load_ndsp_data', (['"""sample_data_1.npy"""'], {'folder': '"""data"""'}), "('sample_d... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
-------------------------------------------------
@ Author : pengj
@ date : 2018/11/1 19:03
@ IDE : PyCharm
@ GitHub : https://github.com/JackyPJB
@ Contact : <EMAIL>
---------------------------------... | [
"time.time"
] | [((808, 819), 'time.time', 'time.time', ([], {}), '()\n', (817, 819), False, 'import time\n'), ((1349, 1360), 'time.time', 'time.time', ([], {}), '()\n', (1358, 1360), False, 'import time\n')] |
# Generated by Django 2.0.2 on 2018-03-03 13:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ved', '0009_auto_20180302_1839'),
]
operations = [
migrations.AlterField(
model_name='order',
name='firewood_choice'... | [
"django.db.models.CharField"
] | [((340, 391), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(50)', 'verbose_name': '"""Val"""'}), "(max_length=50, verbose_name='Val')\n", (356, 391), False, 'from django.db import migrations, models\n'), ((518, 708), 'django.db.models.CharField', 'models.CharField', ([], {'choices': "[('Ej påb... |
from apistar import App, Route, TestClient
from apistar.settings import Setting, Settings
def get_settings(settings: Settings):
return settings
def get_setting(ABC: Setting):
return {'ABC': ABC}
routes = [
Route('/settings/', 'GET', get_settings),
Route('/setting/', 'GET', get_setting),
]
setting... | [
"apistar.settings.Settings",
"apistar.App",
"apistar.settings.Setting",
"apistar.Route",
"apistar.TestClient"
] | [((366, 403), 'apistar.App', 'App', ([], {'routes': 'routes', 'settings': 'settings'}), '(routes=routes, settings=settings)\n', (369, 403), False, 'from apistar import App, Route, TestClient\n'), ((414, 429), 'apistar.TestClient', 'TestClient', (['app'], {}), '(app)\n', (424, 429), False, 'from apistar import App, Rout... |
# -*- coding: utf-8 -*-
from django.shortcuts import get_object_or_404
from rest_framework import status
from rest_framework.decorators import api_view
from rest_framework.response import Response
from ..serializers.request_serializers import GetReminderRequest, UpdateReminderRequest
from ..utils import invalid_data... | [
"rest_framework.response.Response",
"rest_framework.decorators.api_view"
] | [((510, 528), 'rest_framework.decorators.api_view', 'api_view', (["['POST']"], {}), "(['POST'])\n", (518, 528), False, 'from rest_framework.decorators import api_view\n'), ((1212, 1230), 'rest_framework.decorators.api_view', 'api_view', (["['POST']"], {}), "(['POST'])\n", (1220, 1230), False, 'from rest_framework.decor... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import anaf.documents.models
import anaf.documents.files
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.CreateModel(
... | [
"django.db.models.OneToOneField",
"django.db.models.TextField",
"django.db.models.CharField",
"django.db.models.ForeignKey"
] | [((2524, 2564), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'to': '"""documents.Folder"""'}), "(to='documents.Folder')\n", (2541, 2564), False, 'from django.db import models, migrations\n'), ((2721, 2761), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'to': '"""documents.Folder"""'}), "(to='do... |
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
import tensorflow as tf
import numpy as np
EPS = 1e-10
def get_required_argument(dotmap, key, message, default=None):
val = dotmap.get(key, default)
if val is default:
raise ValueError(message)... | [
"numpy.clip",
"numpy.mean",
"numpy.median",
"tensorflow.variable_scope",
"numpy.ones",
"numpy.log",
"numpy.square",
"numpy.exp",
"numpy.zeros",
"tensorflow.sqrt",
"tensorflow.constant_initializer",
"numpy.var"
] | [((724, 752), 'numpy.clip', 'np.clip', (['all_kls', '(0)', '(1 / EPS)'], {}), '(all_kls, 0, 1 / EPS)\n', (731, 752), True, 'import numpy as np\n'), ((1366, 1377), 'numpy.log', 'np.log', (['std'], {}), '(std)\n', (1372, 1377), True, 'import numpy as np\n'), ((1392, 1427), 'numpy.clip', 'np.clip', (['log_std', '(-100)', ... |
#!/usr/bin/env python
"""
<NAME>
Nov 2019
"""
import rospy
from sensor_msgs.msg import Image
from sensor_msgs.msg import Imu
from cv_bridge import CvBridge, CvBridgeError
import numpy as np
import cv2
class Image_Processor(object):
def __init__(self):
rospy.Subscriber("/r200/depth/image_raw", Image, self.... | [
"rospy.init_node",
"cv_bridge.CvBridge",
"rospy.spin",
"rospy.sleep",
"rospy.Subscriber"
] | [((968, 1018), 'rospy.init_node', 'rospy.init_node', (['"""image_processor"""'], {'anonymous': '(True)'}), "('image_processor', anonymous=True)\n", (983, 1018), False, 'import rospy\n'), ((266, 336), 'rospy.Subscriber', 'rospy.Subscriber', (['"""/r200/depth/image_raw"""', 'Image', 'self.record_callback'], {}), "('/r200... |
from os.path import join
from math import ceil
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
plt.rcParams["font.size"] = 14
plt.rcParams["figure.figsize"] = [15, 8]
class reporter:
def __init__(self, name, folder, counts, interactive=True):
plt.subplot(221)
plt.title(... | [
"matplotlib.pyplot.boxplot",
"matplotlib.pyplot.grid",
"math.ceil",
"pygal.Line",
"seaborn.distplot",
"pygal.Bar",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.clf",
"os.path.join",
"pygal.Box",
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.suptitle"
] | [((285, 301), 'matplotlib.pyplot.subplot', 'plt.subplot', (['(221)'], {}), '(221)\n', (296, 301), True, 'import matplotlib.pyplot as plt\n'), ((310, 332), 'matplotlib.pyplot.title', 'plt.title', (['"""Histogram"""'], {}), "('Histogram')\n", (319, 332), True, 'import matplotlib.pyplot as plt\n'), ((341, 361), 'seaborn.d... |
"""Tests the translate_* files."""
from __future__ import absolute_import
import cPickle
import os
import shutil
from shared.testutil import testsize
from third_party import polib
from kake import compile_all_pot
from kake import compile_small_mo
from kake import translate_handlebars
from kake import translate_java... | [
"kake.translate_handlebars.TranslateHandlebars",
"os.path.join",
"third_party.polib.POFile",
"kake.translate_javascript.TranslateJavascript",
"kake.compile_small_mo.SplitPOFile",
"third_party.polib.POEntry",
"cPickle.load"
] | [((6174, 6266), 'third_party.polib.POEntry', 'polib.POEntry', ([], {'msgid': '"""Hello %(where)s"""', 'msgstr': '"""HELLO %(where)s"""', 'occurrences': "[('a', 1)]"}), "(msgid='Hello %(where)s', msgstr='HELLO %(where)s',\n occurrences=[('a', 1)])\n", (6187, 6266), False, 'from third_party import polib\n'), ((6330, 6... |
from django.conf.urls import url
from django.urls import include
urlpatterns = [url("api/", include("api.urls"))]
| [
"django.urls.include"
] | [((93, 112), 'django.urls.include', 'include', (['"""api.urls"""'], {}), "('api.urls')\n", (100, 112), False, 'from django.urls import include\n')] |
from .ccfsReg import CanonicalCorrelationForestsRegressionPrimitive
__all__ = ['CanonicalCorrelationForestsRegressionPrimitive']
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__) # type: ignore
| [
"pkgutil.extend_path"
] | [((175, 206), 'pkgutil.extend_path', 'extend_path', (['__path__', '__name__'], {}), '(__path__, __name__)\n', (186, 206), False, 'from pkgutil import extend_path\n')] |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from numpy import array
from numpy import isnan
from numpy import isinf
from numpy import ones
from numpy import zeros
from scipy.linalg import norm
from scipy.sparse import diags
from compas.numerical import ... | [
"numpy.ones",
"numpy.array",
"numpy.zeros",
"compas.numerical.connectivity_matrix",
"scipy.linalg.norm",
"numpy.isnan",
"scipy.sparse.diags",
"numpy.isinf",
"compas.numerical.normrow"
] | [((4682, 4715), 'compas.numerical.connectivity_matrix', 'connectivity_matrix', (['edges', '"""csr"""'], {}), "(edges, 'csr')\n", (4701, 4715), False, 'from compas.numerical import connectivity_matrix\n'), ((5333, 5362), 'numpy.ones', 'ones', (['(num_e, 1)'], {'dtype': 'float'}), '((num_e, 1), dtype=float)\n', (5337, 53... |
# Lint as: python3
#
# Copyright 2020 The XLS Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | [
"xls.dslx.python.cpp_concrete_type.BitsType",
"xls.dslx.python.cpp_concrete_type.ArrayType",
"xls.dslx.interpreter.value.Value.make_enum",
"xls.dslx.bit_helpers.to_mask",
"absl.logging.vlog",
"xls.dslx.python.cpp_concrete_type.is_ubits"
] | [((2151, 2178), 'xls.dslx.python.cpp_concrete_type.BitsType', 'BitsType', (['signed', 'bit_count'], {}), '(signed, bit_count)\n', (2159, 2178), False, 'from xls.dslx.python.cpp_concrete_type import BitsType\n'), ((4585, 4640), 'absl.logging.vlog', 'logging.vlog', (['(4)', '"""%r %r => %r"""', 'primitive', 'dims', 'resu... |
from libpysal.weights.contiguity import Queen
import libpysal
from libpysal import examples
import matplotlib.pyplot as plt
import geopandas as gpd
from splot.libpysal import plot_spatial_weights
def test_plot_spatial_weights():
# get data
gdf = gpd.read_file(examples.get_path('43MUE250GC_SIR.shp'))
gdf.h... | [
"libpysal.examples.get_path",
"splot.libpysal.plot_spatial_weights",
"libpysal.weights.contiguity.Queen.from_dataframe",
"matplotlib.pyplot.close",
"libpysal.weights.util.nonplanar_neighbors"
] | [((364, 389), 'libpysal.weights.contiguity.Queen.from_dataframe', 'Queen.from_dataframe', (['gdf'], {}), '(gdf)\n', (384, 389), False, 'from libpysal.weights.contiguity import Queen\n'), ((422, 456), 'splot.libpysal.plot_spatial_weights', 'plot_spatial_weights', (['weights', 'gdf'], {}), '(weights, gdf)\n', (442, 456),... |
#!/usr/bin/env python
# encoding: utf-8
# The MIT License (MIT)
# Copyright (c) 2017 CNRS
# 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 ... | [
"tensorboardX.SummaryWriter",
"pyannote.database.get_protocol",
"torch.load",
"tqdm.tqdm",
"yaml.load",
"time.sleep",
"os.path.dirname",
"pyannote.audio.util.mkdir_p",
"functools.partial",
"pyannote.database.FileFinder",
"os.path.basename",
"sortedcontainers.SortedDict",
"glob.glob"
] | [((3614, 3652), 'functools.partial', 'partial', (['Scheduler'], {}), '(Scheduler, **scheduler_params)\n', (3621, 3652), False, 'from functools import partial\n'), ((4295, 4333), 'functools.partial', 'partial', (['Optimizer'], {}), '(Optimizer, **optimizer_params)\n', (4302, 4333), False, 'from functools import partial\... |
from setuptools import setup, find_packages
with open("README.md") as f:
long_description = f.read()
setup(
name="yente",
version="1.3.5",
url="https://opensanctions.org/docs/api/",
long_description=long_description,
long_description_content_type="text/markdown",
license="MIT",
author... | [
"setuptools.find_packages"
] | [((379, 422), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "['examples', 'test']"}), "(exclude=['examples', 'test'])\n", (392, 422), False, 'from setuptools import setup, find_packages\n')] |
# Built-in
import os
from glob import glob
# Libs
import numpy as np
from tqdm import tqdm
from natsort import natsorted
# Own modules
from data import data_utils
from mrs_utils import misc_utils, process_block
# Settings
DS_NAME = 'spca'
def get_images(data_dir, valid_percent=0.5, split=False):
rgb_files = na... | [
"mrs_utils.misc_utils.float2str",
"mrs_utils.misc_utils.make_dir_if_not_exist",
"data.data_utils.patch_tile",
"tqdm.tqdm",
"os.path.join",
"mrs_utils.vis_utils.compare_figures",
"numpy.stack",
"os.path.dirname",
"numpy.random.seed",
"os.path.basename",
"data.data_utils.get_ds_stats"
] | [((1428, 1461), 'os.path.join', 'os.path.join', (['save_dir', '"""patches"""'], {}), "(save_dir, 'patches')\n", (1440, 1461), False, 'import os\n'), ((1466, 1509), 'mrs_utils.misc_utils.make_dir_if_not_exist', 'misc_utils.make_dir_if_not_exist', (['patch_dir'], {}), '(patch_dir)\n', (1498, 1509), False, 'from mrs_utils... |
import dateutil
import pytest
from testsuite.plugins import mockserver
from testsuite.utils import json_util
NOW = dateutil.parser.parse('2019-09-19-13:04:00.000000')
MOCKSERVER_INFO = mockserver.MockserverInfo(
'localhost', 123, 'http://localhost:123/', None,
)
MOCKSERVER_SSL_INFO = mockserver.MockserverInfo(
... | [
"dateutil.parser.parse",
"testsuite.utils.json_util.substitute",
"testsuite.plugins.mockserver.MockserverInfo",
"testsuite.plugins.mockserver.SslInfo",
"pytest.mark.parametrize"
] | [((117, 168), 'dateutil.parser.parse', 'dateutil.parser.parse', (['"""2019-09-19-13:04:00.000000"""'], {}), "('2019-09-19-13:04:00.000000')\n", (138, 168), False, 'import dateutil\n'), ((187, 261), 'testsuite.plugins.mockserver.MockserverInfo', 'mockserver.MockserverInfo', (['"""localhost"""', '(123)', '"""http://local... |
from Level.Render import Render
from Level.Data import Data
from Constants import *
import os
class Level:
def __init__(self, folder, main):
self.main = main
self.name = folder
self.folder = LEVEL_PATH + "/" + folder
self.dataFiles = []
files = os.listdir(self.folder)
... | [
"os.rename",
"os.listdir",
"Level.Data.Data",
"Level.Render.Render"
] | [((291, 314), 'os.listdir', 'os.listdir', (['self.folder'], {}), '(self.folder)\n', (301, 314), False, 'import os\n'), ((444, 462), 'Level.Render.Render', 'Render', (['self', 'main'], {}), '(self, main)\n', (450, 462), False, 'from Level.Render import Render\n'), ((483, 493), 'Level.Data.Data', 'Data', (['self'], {}), ... |
"""Solution of the exercises of Optimization of compute bound Python code"""
import math
import cmath
import numpy as np
import numexpr as ne
import numba as nb
# Needed here since it is used as global variables
# Maximum strain at surface
e0 = 0.01
# Width of the strain profile below the surface
w = 5.0
# Python: C... | [
"numpy.sqrt",
"math.sqrt",
"numpy.tanh",
"numpy.exp",
"numpy.zeros",
"numba.jit",
"cmath.exp",
"math.tanh",
"numexpr.evaluate",
"numba.prange",
"numpy.arange"
] | [((4845, 4866), 'numba.jit', 'nb.jit', ([], {'parallel': '(True)'}), '(parallel=True)\n', (4851, 4866), True, 'import numba as nb\n'), ((517, 543), 'numpy.zeros', 'np.zeros', (['(h.size, k.size)'], {}), '((h.size, k.size))\n', (525, 543), True, 'import numpy as np\n'), ((1293, 1319), 'numpy.zeros', 'np.zeros', (['(h.si... |
#!/usr/bin/python3
from pmapi.config import Config, get_logger
import os
import logging
import requests
import connexion
from flask import Flask, request
logger = get_logger()
# if not Config.TOKEN:
# data = {
# "hostname": Config.HOSTNAME,
# "ip": Config.IP,
# "state": Config.STATE,
# ... | [
"pmapi.config.get_logger",
"connexion.FlaskApp"
] | [((166, 178), 'pmapi.config.get_logger', 'get_logger', ([], {}), '()\n', (176, 178), False, 'from pmapi.config import Config, get_logger\n'), ((705, 733), 'connexion.FlaskApp', 'connexion.FlaskApp', (['__name__'], {}), '(__name__)\n', (723, 733), False, 'import connexion\n')] |
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
__all__ = ['build_feature_head']
import torch
import torch.nn as nn
from rekognition_online_action_detection.utils.registry import Registry
FEATURE_HEADS = Registry()
FEATURE_SIZES = {
'rgb_anet_resnet50':... | [
"rekognition_online_action_detection.utils.registry.Registry",
"torch.nn.ReLU",
"torch.nn.Linear",
"torch.nn.Identity",
"torch.cat"
] | [((267, 277), 'rekognition_online_action_detection.utils.registry.Registry', 'Registry', ([], {}), '()\n', (275, 277), False, 'from rekognition_online_action_detection.utils.registry import Registry\n'), ((1847, 1860), 'torch.nn.Identity', 'nn.Identity', ([], {}), '()\n', (1858, 1860), True, 'import torch.nn as nn\n'),... |
import sys, os
external_libs = {'Cleverhans v1.0.0': "externals/cleverhans",
'Tensorflow-Model-Resnet': "externals/tensorflow-models",
}
project_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
for lib_name, lib_path in external_libs.iteritems():
lib_path = os... | [
"os.listdir",
"os.path.join",
"os.path.realpath",
"os.path.isfile",
"os.system",
"sys.path.append"
] | [((318, 354), 'os.path.join', 'os.path.join', (['project_path', 'lib_path'], {}), '(project_path, lib_path)\n', (330, 354), False, 'import sys, os\n'), ((742, 767), 'sys.path.append', 'sys.path.append', (['lib_path'], {}), '(lib_path)\n', (757, 767), False, 'import sys, os\n'), ((220, 246), 'os.path.realpath', 'os.path... |
# Copyright 2020 The TensorFlow Authors All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | [
"tensorflow.math.cumsum",
"tensorflow.equal",
"tensorflow.shape",
"tensorflow.strings.split",
"tensorflow.reduce_max",
"tensorflow.RaggedTensor.from_row_splits",
"tensorflow.reduce_any",
"tensorflow.concat",
"tensorflow.strings.reduce_join",
"tensorflow.math.floormod",
"tensorflow.dynamic_partit... | [((922, 950), 'tensorflow.strings.split', 'tf.strings.split', (['str_tensor'], {}), '(str_tensor)\n', (938, 950), True, 'import tensorflow as tf\n'), ((1134, 1155), 'tensorflow.ones_like', 'tf.ones_like', (['end_idx'], {}), '(end_idx)\n', (1146, 1155), True, 'import tensorflow as tf\n'), ((1169, 1216), 'tensorflow.maxi... |
## 백준 13910번
## 개업
## 다이나믹 프로그래밍
## (짜장면 데이)
'''
##! ex) N = 4, 5그릇 이상 요리 X, 4사이즈 윅에 3그릇 이하 요리 X => 4윅에 4개
##* ex) N = 5, 윅 사이즈 1,3 / first : 1+3 = 4 그릇, second : 1 => 5 그릇 --> 2번의 요리로 주문 처리
##* 주문 받은 짜장면의 수, 가지고 있는 윅의 크기 => 주문 처리
# In1 ) N M : (주문 받은 짜장면의 수) N | (가지고 있는 윅의 수) M
# In2 ) S : 윅의 크기 S가 M개 만큼 주어... | [
"sys.stdin.readline"
] | [((2245, 2265), 'sys.stdin.readline', 'sys.stdin.readline', ([], {}), '()\n', (2263, 2265), False, 'import sys\n'), ((2299, 2319), 'sys.stdin.readline', 'sys.stdin.readline', ([], {}), '()\n', (2317, 2319), False, 'import sys\n')] |
from __future__ import absolute_import
from .blockcipher import *
import Crypto.Cipher.ARC2
import Crypto
from pkg_resources import parse_version
def new(key,mode=MODE_ECB,IV=None,counter=None,segment_size=None,effective_keylen=None):
"""Create a new cipher object
ARC2 using pycrypto for algo and pycryptoplus... | [
"pkg_resources.parse_version",
"doctest.testmod"
] | [((2317, 2334), 'doctest.testmod', 'doctest.testmod', ([], {}), '()\n', (2332, 2334), False, 'import doctest\n'), ((1910, 1943), 'pkg_resources.parse_version', 'parse_version', (['Crypto.__version__'], {}), '(Crypto.__version__)\n', (1923, 1943), False, 'from pkg_resources import parse_version\n'), ((1947, 1969), 'pkg_... |
# Utilities
import json
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
# Imports
from discord.ext import commands
from discord import Guild, Role
# Loading config file...
with open("./config.json", "r", encoding="utf-8") as config:
configFile = json.load(config)
class Roles(command... | [
"sqlalchemy.orm.sessionmaker",
"sqlalchemy.create_engine",
"discord.Guild.fetch_roles",
"json.load",
"discord.ext.commands.command"
] | [((281, 298), 'json.load', 'json.load', (['config'], {}), '(config)\n', (290, 298), False, 'import json\n'), ((867, 928), 'discord.ext.commands.command', 'commands.command', ([], {'name': '"""Get channel roles"""', 'pass_context': '(True)'}), "(name='Get channel roles', pass_context=True)\n", (883, 928), False, 'from d... |
"""
In this module, we implement the accuracy measures to evaluate the effect of differential privacy injection.
In this module, we support the following measures:
* F1-score.
* Earth Mover's distance.
"""
from scipy.stats import wasserstein_distance
from pm4py.algo.discovery.inductive import factory as induct... | [
"pandas.Series",
"pm4py.algo.discovery.inductive.factory.apply",
"scipy.stats.wasserstein_distance",
"math.fabs",
"pandas.DataFrame",
"pm4py.evaluation.replay_fitness.factory.apply"
] | [((746, 774), 'scipy.stats.wasserstein_distance', 'wasserstein_distance', (['v1', 'v2'], {}), '(v1, v2)\n', (766, 774), False, 'from scipy.stats import wasserstein_distance\n'), ((2343, 2370), 'pm4py.algo.discovery.inductive.factory.apply', 'inductive_miner.apply', (['dfg1'], {}), '(dfg1)\n', (2364, 2370), True, 'from ... |
import collections
from itertools import groupby
from django.db import connections, models, router
from django.db.models.deletion import Collector
from django.utils import encoding
import bleach
import commonware.log
from mkt.site.models import ManagerBase, ModelBase
from mkt.site.utils import linkify_with_outgoing
... | [
"bleach.clean",
"django.db.models.TextField",
"django.db.models.IntegerField",
"django.db.models.deletion.Collector",
"mkt.site.utils.linkify_with_outgoing",
"django.db.models.AutoField",
"collections.defaultdict",
"bleach.linkify",
"django.db.models.CharField",
"django.db.router.db_for_write"
] | [((982, 1016), 'django.db.models.AutoField', 'models.AutoField', ([], {'primary_key': '(True)'}), '(primary_key=True)\n', (998, 1016), False, 'from django.db import connections, models, router\n'), ((1026, 1047), 'django.db.models.IntegerField', 'models.IntegerField', ([], {}), '()\n', (1045, 1047), False, 'from django... |
import torch
from torch import nn
class FlowSequential(nn.Sequential):
"""Forward pass with log determinant of the Jacobian."""
def forward(self, input, context=None):
total_log_prob = torch.zeros(input.size(0), device=input.device)
for block in self._modules.values():
input, log_prob = block(input,... | [
"torch.cuda.synchronize",
"torch.cuda.memory_allocated",
"torch.cuda.max_memory_allocated"
] | [((701, 725), 'torch.cuda.synchronize', 'torch.cuda.synchronize', ([], {}), '()\n', (723, 725), False, 'import torch\n'), ((741, 774), 'torch.cuda.max_memory_allocated', 'torch.cuda.max_memory_allocated', ([], {}), '()\n', (772, 774), False, 'import torch\n'), ((786, 815), 'torch.cuda.memory_allocated', 'torch.cuda.mem... |
import time
from os.path import join, dirname
import sys
whereami = dirname(__file__)
scripts_dir= join(whereami, "../scripts/")
sys.path.append(scripts_dir)
from json_parsing import read_json
import Inmoov
filename_pose = join(whereami, '../json/pose.json')
filename_animation = join(whereami, '../json/animations.jso... | [
"os.path.join",
"Inmoov.Inmoov",
"time.sleep",
"os.path.dirname",
"json_parsing.read_json",
"sys.path.append"
] | [((69, 86), 'os.path.dirname', 'dirname', (['__file__'], {}), '(__file__)\n', (76, 86), False, 'from os.path import join, dirname\n'), ((100, 129), 'os.path.join', 'join', (['whereami', '"""../scripts/"""'], {}), "(whereami, '../scripts/')\n", (104, 129), False, 'from os.path import join, dirname\n'), ((130, 158), 'sys... |
from distutils.core import setup, Extension
srclist = ['sgglobal.c','sgcb.c','sgcharmx.c','sgfile.c',
'sggen.c','sghall.c','sghkl.c','sgltr.c','sgmath.c','sgmetric.c',
'sgnorm.c','sgprop.c','sgss.c','sgstr.c','sgsymbols.c',
'sgtidy.c','sgtype.c','sgutil.c','runtests.c','sglitemodule.c'... | [
"distutils.core.Extension",
"distutils.core.setup"
] | [((332, 404), 'distutils.core.Extension', 'Extension', (['"""sglite"""'], {'sources': 'srclist', 'define_macros': "[('PythonTypes', 1)]"}), "('sglite', sources=srclist, define_macros=[('PythonTypes', 1)])\n", (341, 404), False, 'from distutils.core import setup, Extension\n'), ((427, 501), 'distutils.core.setup', 'setu... |
from app.blogging import bp
from datetime import datetime
from flask import flash, redirect, url_for
from flask_login import current_user
@bp.before_request
def protect():
'''
Registers new function to Flask-Blogging Blueprint that protects
updates to make them only viewable by paid subscribers.
'''
... | [
"datetime.datetime.today",
"flask.flash",
"flask.url_for"
] | [((628, 677), 'flask.flash', 'flash', (['"""Please login to view updates."""', '"""warning"""'], {}), "('Please login to view updates.', 'warning')\n", (633, 677), False, 'from flask import flash, redirect, url_for\n'), ((368, 384), 'datetime.datetime.today', 'datetime.today', ([], {}), '()\n', (382, 384), False, 'from... |
# -*- coding: utf-8 -*-
from bs4 import BeautifulSoup
from src.lib.jianshu_parser.base import BaseParser
from src.lib.jianshu_parser.content.JianshuAuthor import JianshuAuthorInfo
from src.lib.jianshu_parser.content.JianshuArticle import JianshuArticle
class JianshuParser(BaseParser):
u"""
获得jianshu_info表中所... | [
"bs4.BeautifulSoup",
"src.lib.jianshu_parser.content.JianshuArticle.JianshuArticle",
"src.lib.jianshu_parser.content.JianshuAuthor.JianshuAuthorInfo"
] | [((385, 415), 'bs4.BeautifulSoup', 'BeautifulSoup', (['content', '"""lxml"""'], {}), "(content, 'lxml')\n", (398, 415), False, 'from bs4 import BeautifulSoup\n'), ((446, 470), 'src.lib.jianshu_parser.content.JianshuArticle.JianshuArticle', 'JianshuArticle', (['self.dom'], {}), '(self.dom)\n', (460, 470), False, 'from s... |
"""List of operations"""
from collections import namedtuple
Genotype = namedtuple('Genotype', 'encoder decoder')
OP_NAMES = [
'conv1x1',
'conv3x3',
'sep_conv_3x3',
'sep_conv_5x5',
'global_average_pool',
'conv3x3_dil3',
'conv3x3_dil12',
'sep_conv_3x3_dil3',
'sep_conv_5x5_dil6',
... | [
"collections.namedtuple"
] | [((73, 114), 'collections.namedtuple', 'namedtuple', (['"""Genotype"""', '"""encoder decoder"""'], {}), "('Genotype', 'encoder decoder')\n", (83, 114), False, 'from collections import namedtuple\n')] |
#!/usr/bin/env python3
# Hacky script to download linux and windows typed_ast wheels from appveyor and gcloud
import os
import os.path
import json
import sys
from urllib.request import urlopen
# Appveyor download for windows wheels
api_url = 'https://ci.appveyor.com/api/'
def get_json(path):
url = api_url + path... | [
"json.loads",
"os.makedirs",
"os.path.split",
"sys.exit",
"urllib.request.urlopen"
] | [((329, 341), 'urllib.request.urlopen', 'urlopen', (['url'], {}), '(url)\n', (336, 341), False, 'from urllib.request import urlopen\n'), ((373, 389), 'json.loads', 'json.loads', (['data'], {}), '(data)\n', (383, 389), False, 'import json\n'), ((1978, 2012), 'os.makedirs', 'os.makedirs', (['"""dist"""'], {'exist_ok': '(... |
#!/usr/bin/env python
# @author <NAME> <<EMAIL>>, Interactive Robotics Lab, Arizona State University
from __future__ import absolute_import, division, print_function, unicode_literals
import sys
import rclpy
from policy_translation.srv import NetworkPT, TuneNetwork
from model_src.model import PolicyTranslationModel
... | [
"cv2.rectangle",
"re.compile",
"rclpy.spin_once",
"rclpy.init",
"rclpy.create_node",
"numpy.save",
"matplotlib.pyplot.imshow",
"rclpy.ok",
"cv_bridge.CvBridgeError",
"model_src.model.PolicyTranslationModel",
"numpy.asarray",
"cv_bridge.boost.cv_bridge_boost.cvtColor2",
"cv_bridge.CvBridge",
... | [((1287, 1366), 'model_src.model.PolicyTranslationModel', 'PolicyTranslationModel', ([], {'od_path': 'FRCNN_PATH', 'glove_path': 'GLOVE_PATH', 'special': 'None'}), '(od_path=FRCNN_PATH, glove_path=GLOVE_PATH, special=None)\n', (1309, 1366), False, 'from model_src.model import PolicyTranslationModel\n'), ((1196, 1208), ... |
from collections import defaultdict
def defaultdicttree():
return defaultdict(defaultdicttree)
def defaultdict_to_dict(d):
if isinstance(d, defaultdict):
new_d = {}
for k, v in d.items():
new_d[k] = defaultdict_to_dict(v)
d = new_d
return d
| [
"collections.defaultdict"
] | [((71, 99), 'collections.defaultdict', 'defaultdict', (['defaultdicttree'], {}), '(defaultdicttree)\n', (82, 99), False, 'from collections import defaultdict\n')] |
import time
import queue
import sys
import numpy as np
from scipy import optimize as sci_opt
from .node import Node
from .utilities import branch, is_integral
class BNBTree:
def __init__(self, x, y, inttol=1e-4, reltol=1e-4):
"""
Initiate a BnB Tree to solve the least squares regression problem ... | [
"numpy.sqrt",
"numpy.ones",
"numpy.sum",
"queue.LifoQueue",
"numpy.zeros",
"scipy.optimize.lsq_linear",
"numpy.concatenate",
"numpy.nonzero",
"queue.Queue",
"time.time"
] | [((776, 797), 'numpy.sum', 'np.sum', (['(x * x)'], {'axis': '(0)'}), '(x * x, axis=0)\n', (782, 797), True, 'import numpy as np\n'), ((919, 932), 'queue.Queue', 'queue.Queue', ([], {}), '()\n', (930, 932), False, 'import queue\n'), ((963, 980), 'queue.LifoQueue', 'queue.LifoQueue', ([], {}), '()\n', (978, 980), False, ... |
# Generated by Django 3.0.2 on 2020-01-19 09:55
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('miniGithub', '0002_proje... | [
"django.db.models.OneToOneField",
"django.db.models.ForeignKey",
"django.db.models.AutoField",
"django.db.migrations.swappable_dependency",
"django.db.models.CharField"
] | [((227, 284), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (258, 284), False, 'from django.db import migrations, models\n'), ((903, 1009), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'null': '(True)', 'o... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_elasticstack
------------
Tests for `elasticstack` forms module.
"""
from django import forms
from django.test import TestCase
from elasticstack.forms import SearchForm
class TestForms(TestCase):
def test_named_search_field(self):
"""Ensure that ... | [
"django.forms.CharField"
] | [((411, 442), 'django.forms.CharField', 'forms.CharField', ([], {'label': '"""Search"""'}), "(label='Search')\n", (426, 442), False, 'from django import forms\n'), ((459, 495), 'django.forms.CharField', 'forms.CharField', ([], {'label': '"""More search"""'}), "(label='More search')\n", (474, 495), False, 'from django i... |
from flask import render_template, Flask, flash, redirect, url_for, abort, request
from flask_login import login_user, logout_user, login_required
from werkzeug.urls import url_parse
from app import app, db
from app.forms import *
from app.models import *
@app.route('/')
@app.route('/landing')
def landing():
ret... | [
"flask.render_template",
"app.db.session.commit",
"flask.flash",
"flask_login.login_user",
"flask_login.logout_user",
"flask.url_for",
"app.db.session.add_all",
"app.app.route",
"app.db.session.add",
"flask.abort"
] | [((260, 274), 'app.app.route', 'app.route', (['"""/"""'], {}), "('/')\n", (269, 274), False, 'from app import app, db\n'), ((276, 297), 'app.app.route', 'app.route', (['"""/landing"""'], {}), "('/landing')\n", (285, 297), False, 'from app import app, db\n'), ((376, 400), 'app.app.route', 'app.route', (['"""/artistlist"... |
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from devices.v1beta1 import DevicesService_Beta1_pb2 as devices_dot_v1beta1_dot_DevicesService__Beta1__pb2
class DevicesStub(object):
"""Specifies the devices service, which enables managed devices to check-in, authorize themselves, ... | [
"grpc.method_handlers_generic_handler",
"grpc.unary_unary_rpc_method_handler"
] | [((2690, 2804), 'grpc.method_handlers_generic_handler', 'grpc.method_handlers_generic_handler', (['"""bloombox.schema.services.devices.v1beta1.Devices"""', 'rpc_method_handlers'], {}), "(\n 'bloombox.schema.services.devices.v1beta1.Devices', rpc_method_handlers)\n", (2726, 2804), False, 'import grpc\n'), ((2048, 231... |
#!/bin/python3
import datetime
import itertools
import sys
from heading import *
days = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
def priority_key():
weights = {}
sep = KEYWORDS.index('|')
for keyword in KEYWORDS[sep+1:]:
weights[keyword] = len(KEYWORDS)
idx = 1
while idx <= sep:... | [
"datetime.date.today",
"itertools.groupby",
"datetime.date"
] | [((1050, 1088), 'itertools.groupby', 'itertools.groupby', (['todos'], {'key': 'date_key'}), '(todos, key=date_key)\n', (1067, 1088), False, 'import itertools\n'), ((1101, 1122), 'datetime.date.today', 'datetime.date.today', ([], {}), '()\n', (1120, 1122), False, 'import datetime\n'), ((560, 597), 'datetime.date', 'date... |
# encoding: latin2
"""Algorithm utilities
G{packagetree core}
"""
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from builtins import range
from builtins import object
from past.utils import old_div
__author__ = "<NAME>"
__credits__ = "Copyright (c) 2009-11 ... | [
"builtins.range"
] | [((1897, 1905), 'builtins.range', 'range', (['n'], {}), '(n)\n', (1902, 1905), False, 'from builtins import range\n'), ((4802, 4810), 'builtins.range', 'range', (['n'], {}), '(n)\n', (4807, 4810), False, 'from builtins import range\n'), ((5021, 5029), 'builtins.range', 'range', (['r'], {}), '(r)\n', (5026, 5029), False... |
import argparse
import cv2
import time
import numpy as np
from tf_pose.estimator import TfPoseEstimator
from tf_pose.networks import get_graph_path, model_wh
"""
封装并调用tf-openpose项目所提供的骨架信息识别接口
"""
class TFPOSE:
def __init__(self):
# 0. 参数
self.fps_time = 0
self.frame_count = 0
# 1.... | [
"argparse.ArgumentParser",
"tf_pose.networks.get_graph_path",
"tf_pose.estimator.TfPoseEstimator.draw_humans",
"cv2.VideoWriter",
"numpy.array",
"numpy.zeros",
"cv2.VideoCapture",
"cv2.VideoWriter_fourcc",
"tf_pose.networks.model_wh",
"time.time"
] | [((443, 469), 'tf_pose.networks.model_wh', 'model_wh', (['self.args.resize'], {}), '(self.args.resize)\n', (451, 469), False, 'from tf_pose.networks import get_graph_path, model_wh\n'), ((628, 701), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""tf-pose-estimation realtime webcam"""'}), ... |
from kivy.app import App
from kivy.uix.label import Label
from kivy.core.window import Window
class DrivingApp(App):
def build(self):
Window.fullscreen = False
# Need to set the size, otherwise very pixalated
# wonders about pixel mapping?
Window.size(1920, 1080)
b = Label... | [
"kivy.uix.label.Label",
"kivy.core.window.Window.size"
] | [((279, 302), 'kivy.core.window.Window.size', 'Window.size', (['(1920)', '(1080)'], {}), '(1920, 1080)\n', (290, 302), False, 'from kivy.core.window import Window\n'), ((315, 345), 'kivy.uix.label.Label', 'Label', ([], {'text': '"""Launch Child App"""'}), "(text='Launch Child App')\n", (320, 345), False, 'from kivy.uix... |
import openpyxl
from robot.api.deco import keyword, library
from robot.api import logger
@library
class OpenRobotPyxl:
def __init__(self):
self.active_sheet = None
self.active_book = None
self.path = None
self.bookname = None
@keyword("Create New Workbook")
def create_new... | [
"robot.api.deco.keyword",
"openpyxl.load_workbook",
"openpyxl.Workbook"
] | [((271, 301), 'robot.api.deco.keyword', 'keyword', (['"""Create New Workbook"""'], {}), "('Create New Workbook')\n", (278, 301), False, 'from robot.api.deco import keyword, library\n'), ((622, 647), 'robot.api.deco.keyword', 'keyword', (['"""Close Workbook"""'], {}), "('Close Workbook')\n", (629, 647), False, 'from rob... |
from django.urls import path
from . import views
app_name = 'club'
urlpatterns = [
path('create/', views.create_club, name='create_club'),
path('update/<int:club_pk>', views.update_club, name='update_club'),
path('read_admin_club/<str:club>/<int:ctg_pk>/', views.read_admin_club, name='read_admin_club_ctg... | [
"django.urls.path"
] | [((89, 143), 'django.urls.path', 'path', (['"""create/"""', 'views.create_club'], {'name': '"""create_club"""'}), "('create/', views.create_club, name='create_club')\n", (93, 143), False, 'from django.urls import path\n'), ((149, 216), 'django.urls.path', 'path', (['"""update/<int:club_pk>"""', 'views.update_club'], {'... |
from random import randint
from typing import List
class Solution:
def findKthLargest(self, nums: List[int], k: int) -> int:
jthSmallest = len(nums) - k
return self.quickSelect(nums, 0, len(nums) - 1, jthSmallest)
def quickSelect(self, nums: List[int], start: int, end: int, jthSmallest: int)... | [
"random.randint"
] | [((734, 753), 'random.randint', 'randint', (['start', 'end'], {}), '(start, end)\n', (741, 753), False, 'from random import randint\n')] |
import json
'''
READ THE DATABASE README before operating
'''
File = r'''YOUR FILE'''
with open(File,'a') as fileObj:
data = json.load()
'''
YOUR DATA LOGIC GOES IN HERE
Once the data is changed, to write it to your JSON file use the following command.
'''
json.dump(object,File) | [
"json.load",
"json.dump"
] | [((129, 140), 'json.load', 'json.load', ([], {}), '()\n', (138, 140), False, 'import json\n'), ((281, 304), 'json.dump', 'json.dump', (['object', 'File'], {}), '(object, File)\n', (290, 304), False, 'import json\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Description: Choose a set of data points as weights and calculate RBF nodes for the
first layer. Those are then used as inputs for a one-layer perceptron, which gives the
output
"""
import numpy as np
import pcn
class rbf:
""" radial basic function """
d... | [
"numpy.sqrt",
"pcn.pcn",
"numpy.array",
"numpy.shape",
"numpy.transpose",
"numpy.random.shuffle"
] | [((1237, 1263), 'numpy.random.shuffle', 'np.random.shuffle', (['indices'], {}), '(indices)\n', (1254, 1263), True, 'import numpy as np\n'), ((1552, 1627), 'pcn.pcn', 'pcn.pcn', (['self.hidden', 'self.targets', 'self.eta', 'self.functype', 'self.traintype'], {}), '(self.hidden, self.targets, self.eta, self.functype, sel... |
import datetime
import os
# General
Token = open('../Token.txt', 'r') # The token of the bot
Token = Token.read()
prefix = '*' # the command prefix
lang = 'en-us' # 'en-us' or 'pt-br'
memes = os.listdir('../Assets/monsters_memes') # memes db load
banchannel = None # the channel that will be used to ban messages
# Min... | [
"os.listdir"
] | [((193, 231), 'os.listdir', 'os.listdir', (['"""../Assets/monsters_memes"""'], {}), "('../Assets/monsters_memes')\n", (203, 231), False, 'import os\n')] |
"""
Convert data and then visualize
Data Manupulation
1. Save metrics for validation and test data
Save figures
1. Loss curve
2. plume dispersion and errors
3. metrics
"""
import pathlib
import numpy as np
import xarray as xr
from numpy import ma
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplo... | [
"matplotlib.style.use",
"numpy.arange",
"matplotlib.colors.LogNorm",
"pathlib.Path",
"numpy.where",
"numpy.asarray",
"numpy.ma.masked_where",
"matplotlib.pyplot.close",
"numpy.linspace",
"numpy.abs",
"matplotlib.pyplot.savefig",
"xarray.Dataset",
"numpy.squeeze",
"xarray.open_dataset",
"... | [((1179, 1203), 'matplotlib.style.use', 'mpl.style.use', (['"""classic"""'], {}), "('classic')\n", (1192, 1203), True, 'import matplotlib as mpl\n'), ((1304, 1339), 'matplotlib.pyplot.rc', 'plt.rc', (['"""xtick"""'], {'labelsize': 'fontsize'}), "('xtick', labelsize=fontsize)\n", (1310, 1339), True, 'import matplotlib.p... |
"""
The primary frame containing the content for the entire game
"""
import tkinter as tk
import random as random
from quince.utility import is_valid_pickup
from quince.ronda import Ronda
from quince.ui.components.opponents.opponent_frame \
import OpponentFrameHorizontal, OpponentFrameVertical
from quince.ui.compon... | [
"tkinter.Frame.__init__",
"quince.utility.is_valid_pickup",
"random.randrange",
"quince.ronda.Ronda.start",
"quince.ui.components.table.table.Table",
"quince.ui.components.player.player_frame.PlayerFrame"
] | [((1032, 1063), 'tkinter.Frame.__init__', 'tk.Frame.__init__', (['self', 'parent'], {}), '(self, parent)\n', (1049, 1063), True, 'import tkinter as tk\n'), ((1579, 1649), 'quince.ronda.Ronda.start', 'Ronda.start', (['[self.player, self.npc1, self.npc2, self.npc3]', 'self.npc3'], {}), '([self.player, self.npc1, self.npc... |
from src.main.common.model import endpoint
class TableEndpoint(endpoint.Endpoint):
@classmethod
def do_get(cls, *args, **kwargs):
from src.main.admin_api.utils.descriptor_utils import DescriptorUtils
db_system_name = kwargs.get("db_system_name")
tb_system_name = kwargs.get(... | [
"src.main.admin_api.utils.descriptor_utils.DescriptorUtils.get_tbs_descriptor",
"src.main.admin_api.utils.descriptor_utils.DescriptorUtils.does_tb_descriptor_exist",
"src.main.admin_api.utils.descriptor_utils.DescriptorUtils.get_tb_descriptor_by_system_name",
"src.main.admin_api.model.table.Table.from_json"
] | [((2901, 2986), 'src.main.admin_api.utils.descriptor_utils.DescriptorUtils.get_tb_descriptor_by_system_name', 'DescriptorUtils.get_tb_descriptor_by_system_name', (['db_system_name', 'tb_system_name'], {}), '(db_system_name, tb_system_name\n )\n', (2949, 2986), False, 'from src.main.admin_api.utils.descriptor_utils i... |
import tensorflow as tf
from data.BaseReader import BaseReader
import numpy as np
class Base2DReader(BaseReader):
# inherit from BaseReader, implement different 2D cropping (cropping from 2D)
def __init__(self, objtype=0, shuffle=True, batch_size=1, crop_noise=False):
super(Base2DReader, self).__init... | [
"tensorflow.image.resize_images",
"tensorflow.sin",
"tensorflow.cast",
"tensorflow.reduce_min",
"utils.PAF.createPAF",
"tensorflow.concat",
"tensorflow.matmul",
"tensorflow.contrib.image.rotate",
"tensorflow.less",
"tensorflow.train.batch_join",
"tensorflow.cos",
"tensorflow.stack",
"tensorf... | [((2238, 2273), 'tensorflow.read_file', 'tf.read_file', (["flow_dict['img_dirs']"], {}), "(flow_dict['img_dirs'])\n", (2250, 2273), True, 'import tensorflow as tf\n'), ((2294, 2337), 'tensorflow.image.decode_image', 'tf.image.decode_image', (['img_file'], {'channels': '(3)'}), '(img_file, channels=3)\n', (2315, 2337), ... |
from tortoise import Model, fields
class TZProfile(Model):
account = fields.CharField(36, pk=True)
contract = fields.CharField(36)
valid_claims = fields.JSONField()
invalid_claims = fields.JSONField()
errored = fields.BooleanField()
class Meta:
table = "tzprofiles"
| [
"tortoise.fields.CharField",
"tortoise.fields.JSONField",
"tortoise.fields.BooleanField"
] | [((75, 104), 'tortoise.fields.CharField', 'fields.CharField', (['(36)'], {'pk': '(True)'}), '(36, pk=True)\n', (91, 104), False, 'from tortoise import Model, fields\n'), ((120, 140), 'tortoise.fields.CharField', 'fields.CharField', (['(36)'], {}), '(36)\n', (136, 140), False, 'from tortoise import Model, fields\n'), ((... |
"""
Copyright (c) 2018, <NAME>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disc... | [
"numpy.sqrt",
"actionlib.SimpleActionServer",
"rospy.Service",
"time.sleep",
"cflib.positioning.motion_commander.MotionCommander",
"pickle.loads",
"rospy.Publisher"
] | [((2066, 2091), 'cflib.positioning.motion_commander.MotionCommander', 'MotionCommander', (['self._cf'], {}), '(self._cf)\n', (2081, 2091), False, 'from cflib.positioning.motion_commander import MotionCommander\n'), ((2158, 2232), 'rospy.Publisher', 'rospy.Publisher', (["(self._name + '/velocity_setpoint')", 'Vector3'],... |
"""evaluation function for chromosome
"""
import subprocess
from subprocess import PIPE, STDOUT
from autoprover.evaluation.coqstate import CoqState
def preprocess(theorem, chromosome):
"""
convert chromosome to complete Coq script
Args:
theorem (list): a list of string contains theorem or some pr... | [
"autoprover.evaluation.coqstate.CoqState",
"subprocess.Popen"
] | [((865, 944), 'subprocess.Popen', 'subprocess.Popen', (['"""coqtop"""'], {'shell': '(False)', 'stdin': 'PIPE', 'stdout': 'PIPE', 'stderr': 'STDOUT'}), "('coqtop', shell=False, stdin=PIPE, stdout=PIPE, stderr=STDOUT)\n", (881, 944), False, 'import subprocess\n'), ((2354, 2376), 'autoprover.evaluation.coqstate.CoqState',... |
import os
import numpy
from numpy import *
import math
from scipy import integrate, linalg
from matplotlib import pyplot
from pylab import *
from .integral import *
def get_velocity_field(panels, freestream, X, Y):
"""
Computes the velocity field on a given 2D mesh.
Parameters
---------
panel... | [
"math.cos",
"numpy.ones_like",
"math.sin",
"numpy.vectorize"
] | [((1089, 1114), 'numpy.vectorize', 'numpy.vectorize', (['integral'], {}), '(integral)\n', (1104, 1114), False, 'import numpy\n'), ((879, 910), 'numpy.ones_like', 'numpy.ones_like', (['X'], {'dtype': 'float'}), '(X, dtype=float)\n', (894, 910), False, 'import numpy\n'), ((967, 998), 'numpy.ones_like', 'numpy.ones_like',... |
"""Main module."""
import copy
import io
import logging
import re
from typing import Dict, List
import yaml
log = logging.getLogger(__name__)
TEKTON_TYPE = ("pipeline", "pipelinerun", "task", "taskrun", "condition")
class TektonBundleError(Exception):
pass
def tpl_apply(yaml_obj, parameters):
def _apply... | [
"logging.getLogger",
"yaml.dump_all",
"yaml.dump",
"copy.deepcopy"
] | [((117, 144), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (134, 144), False, 'import logging\n'), ((3346, 3404), 'copy.deepcopy', 'copy.deepcopy', (["yaml_documents['pipelinerun'][pipeline_run]"], {}), "(yaml_documents['pipelinerun'][pipeline_run])\n", (3359, 3404), False, 'import copy... |
"""
The Sims 4 Community Library is licensed under the Creative Commons Attribution 4.0 International public license (CC BY 4.0).
https://creativecommons.org/licenses/by/4.0/
https://creativecommons.org/licenses/by/4.0/legalcode
Copyright (c) COLONOLNUTTY
"""
import os
from sims4.commands import Command, CommandType, ... | [
"sims4.commands.Command",
"sims4.commands.CheatOutput",
"os.environ.get",
"sims4communitylib.utils.common_time_utils.CommonTimeUtils.get_current_date_and_time"
] | [((446, 481), 'os.environ.get', 'os.environ.get', (['"""READTHEDOCS"""', 'None'], {}), "('READTHEDOCS', None)\n", (460, 481), False, 'import os\n'), ((1859, 1926), 'sims4.commands.Command', 'Command', (['"""s4clib.print_current_time"""'], {'command_type': 'CommandType.Live'}), "('s4clib.print_current_time', command_typ... |
# Generated by Django 3.1.4 on 2021-01-22 22:56
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('blackbook', '0021_update_account_categories'),
]
operations = [
migrations.RemoveField(
model_name='budgetperiod',
name='bud... | [
"django.db.migrations.DeleteModel",
"django.db.migrations.RemoveField"
] | [((236, 300), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""budgetperiod"""', 'name': '"""budget"""'}), "(model_name='budgetperiod', name='budget')\n", (258, 300), False, 'from django.db import migrations\n'), ((345, 409), 'django.db.migrations.RemoveField', 'migrations.RemoveFie... |
import base64
import rsa
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from ticketing.models import BalanceTicket, RideTicket
class VerifyFailedError(Exception):
pass
class QRCode:
"""
QRCode creator is used to create a user ticket/balance ID,
which is then... | [
"ticketing.models.RideTicket.objects.get",
"base64.b64decode",
"ticketing.models.BalanceTicket.objects.get"
] | [((2214, 2240), 'base64.b64decode', 'base64.b64decode', (['parts[1]'], {}), '(parts[1])\n', (2230, 2240), False, 'import base64\n'), ((2528, 2570), 'ticketing.models.BalanceTicket.objects.get', 'BalanceTicket.objects.get', ([], {'qr_code_id': 'uuid'}), '(qr_code_id=uuid)\n', (2553, 2570), False, 'from ticketing.models ... |
from rest_framework.views import APIView
from rest_framework import status
from eva.serializers import WorkSerializer, PageSerializer, WordSerializer, RadicalSerializer
from eva.models import Work, Page, Word, Radical
from rest_framework.response import Response
from django.http import Http404
class WorkView(APIView)... | [
"eva.models.Page.objects.get",
"eva.models.Word.objects.get",
"eva.models.Word.objects.filter",
"eva.models.Page.objects.filter",
"eva.models.Radical.objects.filter",
"eva.models.Radical.objects.get",
"eva.models.Word.objects.all",
"eva.models.Radical.objects.all",
"eva.serializers.WordSerializer",
... | [((410, 428), 'eva.models.Work.objects.all', 'Work.objects.all', ([], {}), '()\n', (426, 428), False, 'from eva.models import Work, Page, Word, Radical\n'), ((471, 503), 'eva.serializers.WorkSerializer', 'WorkSerializer', (['works'], {'many': '(True)'}), '(works, many=True)\n', (485, 503), False, 'from eva.serializers ... |
from django.shortcuts import render
from django.http import HttpResponse
from App.models import *
# Create your views here.
def search(seq):
myclass=Myclass.objects.all()
return render(seq,'test.html',context={'myclass':myclass})
def students(req):
students_id=req.GET.get('classid')
studentt=Student.ob... | [
"django.shortcuts.render"
] | [((186, 240), 'django.shortcuts.render', 'render', (['seq', '"""test.html"""'], {'context': "{'myclass': myclass}"}), "(seq, 'test.html', context={'myclass': myclass})\n", (192, 240), False, 'from django.shortcuts import render\n'), ((392, 451), 'django.shortcuts.render', 'render', (['req', '"""student.html"""'], {'con... |