code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from ..type import SimpleType
from asn1PERser.classes.templates.creator import template_filler
from asn1PERser.classes.module import already_filled_template
class BooleanType(SimpleType):
def __init__(self):
super(BooleanType, self).__init__()
self.typereference = self.__class__.__name__
def ... | [
"asn1PERser.classes.module.already_filled_template.add",
"asn1PERser.classes.templates.creator.template_filler.fill"
] | [((694, 847), 'asn1PERser.classes.templates.creator.template_filler.fill', 'template_filler.fill', ([], {'asn_type': 'self.__class__.__name__', 'type_or_value': '"""type"""', 'class_name': 'self.template_class_name', 'class_type': 'self.__class__.__name__'}), "(asn_type=self.__class__.__name__, type_or_value='type',\n ... |
import warnings
from dask.array import PerformanceWarning
from importlib_metadata import version
warnings.filterwarnings("ignore", category=DeprecationWarning)
warnings.filterwarnings("ignore", category=PerformanceWarning)
try:
__version__ = version('scarf-toolkit')
except ImportError:
print("Scarf is not ins... | [
"warnings.filterwarnings",
"importlib_metadata.version"
] | [((98, 160), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {'category': 'DeprecationWarning'}), "('ignore', category=DeprecationWarning)\n", (121, 160), False, 'import warnings\n'), ((161, 223), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {'category': 'Performance... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Get continent data oincluding bounding boxes and centroids for and store it
# in json file keyed by continentCode.
import os
import json
import requests
# see http://download.geonames.org/export/dump/readme.txt
continent_ids = [6255146, 6255147, 6255148, 6255149, 6255151... | [
"json.dump",
"json.loads",
"requests.get"
] | [((700, 732), 'requests.get', 'requests.get', (['url'], {'params': 'params'}), '(url, params=params)\n', (712, 732), False, 'import requests\n'), ((919, 943), 'json.dump', 'json.dump', (['continents', 'f'], {}), '(continents, f)\n', (928, 943), False, 'import json\n'), ((764, 785), 'json.loads', 'json.loads', (['resp.t... |
import typing
from typing import Any
from rasa.nlu.components import Component
from rasa.nlu.config import RasaNLUModelConfig
from rasa.nlu.tokenizers import Token, Tokenizer
from rasa.nlu.training_data import Message, TrainingData
if typing.TYPE_CHECKING:
from spacy.tokens.doc import Doc
class SpacyTokenizer(T... | [
"rasa.nlu.tokenizers.Token"
] | [((860, 880), 'rasa.nlu.tokenizers.Token', 'Token', (['t.text', 't.idx'], {}), '(t.text, t.idx)\n', (865, 880), False, 'from rasa.nlu.tokenizers import Token, Tokenizer\n')] |
# Copyright (c) 2019 PaddlePaddle 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 app... | [
"logging.getLogger",
"utils.tokenization.FullTokenizer",
"numpy.ones_like",
"collections.namedtuple",
"utils.tokenization.convert_to_unicode",
"numpy.where",
"dataclasses.dataclass",
"os.path.join",
"io.open",
"numpy.zeros",
"io.TextIOWrapper",
"numpy.random.seed",
"numpy.expand_dims",
"js... | [((988, 1015), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1005, 1015), False, 'import logging\n'), ((4158, 4181), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(False)'}), '(frozen=False)\n', (4167, 4181), False, 'from dataclasses import dataclass\n'), ((1060, 1113), 'io.Tex... |
import numpy as np
import cv2
def softmax(x, axis=-1):
numerator = np.exp(x - np.max(x, axis=axis, keepdims=True))
return numerator / np.sum(numerator, axis=axis, keepdims=True)
def resize(image, width=None, height=None, inter=cv2.INTER_AREA):
# initialize the dimensions of the image to be resized and
... | [
"numpy.mean",
"numpy.fabs",
"numpy.sqrt",
"numpy.minimum",
"numpy.hstack",
"numpy.where",
"numpy.polyfit",
"numpy.argmax",
"numpy.max",
"numpy.exp",
"numpy.array",
"numpy.sum",
"numpy.zeros",
"numpy.vstack",
"numpy.min",
"numpy.maximum",
"cv2.resize",
"numpy.arange"
] | [((975, 1018), 'cv2.resize', 'cv2.resize', (['image', 'dim'], {'interpolation': 'inter'}), '(image, dim, interpolation=inter)\n', (985, 1018), False, 'import cv2\n'), ((1495, 1519), 'numpy.array', 'np.array', (['[0, 0, 15, 15]'], {}), '([0, 0, 15, 15])\n', (1503, 1519), True, 'import numpy as np\n'), ((1782, 1809), 'nu... |
from os.path import exists
def leer_tabla_multiplicar():
n = int(input('Introduce un número entero entre 1 y 10: '))
file_name = 'tabla-' + str(n) + '.txt'
try:
f = open(file_name, 'r')
except FileNotFoundError:
print('No existe el fichero con la tabla del', n)
else:
print(f.read())
f.... | [
"os.path.exists"
] | [((370, 393), 'os.path.exists', 'exists', (['"""./tabla-5.txt"""'], {}), "('./tabla-5.txt')\n", (376, 393), False, 'from os.path import exists\n')] |
from django.conf import settings
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('zerver', '0001_initial'),
]
database_setting = settings.DATABASES["default"]
if "postgres" in database_setting["ENGINE"]:
operations = [
migrations.... | [
"django.db.migrations.RunSQL"
] | [((309, 1150), 'django.db.migrations.RunSQL', 'migrations.RunSQL', (['("""\nALTER ROLE %(USER)s SET search_path TO %(SCHEMA)s,public,pgroonga,pg_catalog;\n\nSET search_path = %(SCHEMA)s,public,pgroonga,pg_catalog;\n\nALTER TABLE zerver_message ADD COLUMN search_pgroonga text;\n\n-- TODO: We want to use CREATE INDEX CON... |
"""Support for the Mediaroom Set-up-box."""
import logging
from pymediaroom import (
COMMANDS,
PyMediaroomError,
Remote,
State,
install_mediaroom_protocol,
)
import voluptuous as vol
from homeassistant.components.media_player import PLATFORM_SCHEMA, MediaPlayerEntity
from homeassistant.components.... | [
"logging.getLogger",
"pymediaroom.install_mediaroom_protocol",
"homeassistant.helpers.dispatcher.dispatcher_send",
"voluptuous.Optional",
"homeassistant.helpers.dispatcher.async_dispatcher_connect",
"pymediaroom.Remote"
] | [((1018, 1045), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1035, 1045), False, 'import logging\n'), ((1588, 1611), 'voluptuous.Optional', 'vol.Optional', (['CONF_HOST'], {}), '(CONF_HOST)\n', (1600, 1611), True, 'import voluptuous as vol\n'), ((1632, 1677), 'voluptuous.Optional', 'vo... |
import socket
TCP_IP = '192.168.127.12'
TCP_PORT = 5005
BUFFER_SIZE = 100
while 1:
MESSAGE = input('Enter text')
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((TCP_IP, TCP_PORT))
s.send(MESSAGE.encode('utf-8'))
data = s.recv(BUFFER_SIZE)
s.close()
print("received data:", d... | [
"socket.socket"
] | [((126, 175), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (139, 175), False, 'import socket\n')] |
import iam_floyd as statement
import importlib
import os
import sys
import inspect
currentdir = os.path.dirname(os.path.abspath(
inspect.getfile(inspect.currentframe())))
helperDir = '%s/../../helper/python' % currentdir
sys.path.insert(0, helperDir)
test = importlib.import_module('python_test')
out = getattr(tes... | [
"iam_floyd.Ec2",
"inspect.currentframe",
"sys.path.insert",
"importlib.import_module"
] | [((226, 255), 'sys.path.insert', 'sys.path.insert', (['(0)', 'helperDir'], {}), '(0, helperDir)\n', (241, 255), False, 'import sys\n'), ((264, 302), 'importlib.import_module', 'importlib.import_module', (['"""python_test"""'], {}), "('python_test')\n", (287, 302), False, 'import importlib\n'), ((150, 172), 'inspect.cur... |
#!/usr/bin/env python
import sys
import __builtin__
import os
# python puts the program's directory path in sys.path[0]. In other words,
# the user ordinarily has no way to override python's choice of a module from
# its own dir. We want to have that ability in our environment. However, we
# don't want to break an... | [
"sys.path.insert"
] | [((646, 677), 'sys.path.insert', 'sys.path.insert', (['(0)', 'save_path_0'], {}), '(0, save_path_0)\n', (661, 677), False, 'import sys\n')] |
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
"tflite_support.metadata.MetadataDisplayer.with_model_file"
] | [((1339, 1388), 'tflite_support.metadata.MetadataDisplayer.with_model_file', 'metadata.MetadataDisplayer.with_model_file', (['model'], {}), '(model)\n', (1381, 1388), False, 'from tflite_support import metadata\n')] |
import os
import shutil
from zipfile import ZipFile
from flask import flash
import webapp.auth.user_data as user_data
from webapp.home.load_data_table import get_md5_hash
from webapp.home.metapype_client import list_files_in_dir
def check_ezeml_manifest(zipfile_name):
zip_object = ZipFile(zipfile_name, 'r')
... | [
"os.listdir",
"webapp.home.metapype_client.list_files_in_dir",
"zipfile.ZipFile",
"shutil.move",
"os.path.join",
"shutil.copyfile",
"os.path.basename",
"webapp.auth.user_data.get_user_folder_name",
"shutil.rmtree",
"os.mkdir",
"webapp.home.load_data_table.get_md5_hash"
] | [((293, 319), 'zipfile.ZipFile', 'ZipFile', (['zipfile_name', '"""r"""'], {}), "(zipfile_name, 'r')\n", (300, 319), False, 'from zipfile import ZipFile\n'), ((461, 493), 'webapp.auth.user_data.get_user_folder_name', 'user_data.get_user_folder_name', ([], {}), '()\n', (491, 493), True, 'import webapp.auth.user_data as u... |
import functools
import hashlib
import logging
import os
import shutil
import sys
from io import BytesIO
from shutil import copy, rmtree
from tempfile import mkdtemp
import pytest
from mock import Mock, patch
import pip
from pip._internal.download import (
CI_ENVIRONMENT_VARIABLES,
MultiDomainBasicAuth,
P... | [
"pip._internal.models.link.Link",
"mock.Mock",
"io.BytesIO",
"pip._internal.download.MultiDomainBasicAuth",
"pytest.fixture",
"pip._internal.utils.hashes.Hashes",
"mock.patch",
"os.listdir",
"tests.lib.filesystem.make_socket_file",
"pip._internal.download.unpack_file_url",
"pip._internal.downloa... | [((901, 933), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""'}), "(scope='function')\n", (915, 933), False, 'import pytest\n'), ((2095, 2248), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""name, expected_like_ci"""', "[('BUILD_BUILDID', True), ('BUILD_ID', True), ('CI', True), ('PIP_IS... |
#!/usr/bin/env python3
""" Infer mRNA from Protein """
import argparse
import os
import math
from typing import NamedTuple
class Args(NamedTuple):
""" Command-line arguments """
protein: str
modulo: int
# --------------------------------------------------
def get_args() -> Args:
""" Get command-lin... | [
"os.path.isfile",
"argparse.ArgumentParser",
"math.prod"
] | [((350, 472), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Infer mRNA from Protein"""', 'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter'}), "(description='Infer mRNA from Protein',\n formatter_class=argparse.ArgumentDefaultsHelpFormatter)\n", (373, 472), False, 'import ar... |
from django.db import models
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from django.dispatch import receiver
from rest_framework.authtoken.models import Token
from bakery.models import BakeryItems
class Orders(models.Model):
user = models.ForeignKey(User, on_delet... | [
"django.db.models.FloatField",
"django.db.models.ForeignKey",
"django.db.models.DateTimeField",
"django.dispatch.receiver",
"rest_framework.authtoken.models.Token.objects.create"
] | [((703, 735), 'django.dispatch.receiver', 'receiver', (['post_save'], {'sender': 'User'}), '(post_save, sender=User)\n', (711, 735), False, 'from django.dispatch import receiver\n'), ((288, 340), 'django.db.models.ForeignKey', 'models.ForeignKey', (['User'], {'on_delete': 'models.DO_NOTHING'}), '(User, on_delete=models... |
# coding=utf-8
# Copyright 2020 TF.Text 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 or ag... | [
"os.path.join",
"setuptools.find_packages",
"setuptools.command.install.install.finalize_options"
] | [((1660, 1690), 'setuptools.command.install.install.finalize_options', 'install.finalize_options', (['self'], {}), '(self)\n', (1684, 1690), False, 'from setuptools.command.install import install\n'), ((1802, 1849), 'os.path.join', 'os.path.join', (['self.install_lib', 'self.extra_dirs'], {}), '(self.install_lib, self.... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Test components of foremanlite.machine
The tests in here are pretty basic and non-exhaustive.
Could use more work to get truly full coverage.
"""
import re
import typing as t
import pytest
from hypothesis import given
from hypothesis import strategies as st
from for... | [
"hypothesis.strategies.sampled_from",
"re.escape",
"foremanlite.machine.get_uuid",
"re.compile",
"foremanlite.machine.Arch",
"foremanlite.machine.MachineSelector",
"foremanlite.machine.MachineGroupSet",
"hypothesis.strategies.characters",
"pytest.raises",
"hypothesis.strategies.booleans",
"forem... | [((657, 697), 'hypothesis.strategies.sampled_from', 'st.sampled_from', (['[a.value for a in Arch]'], {}), '([a.value for a in Arch])\n', (672, 697), True, 'from hypothesis import strategies as st\n'), ((2096, 2125), 'foremanlite.machine.get_uuid', 'get_uuid', ([], {'machine': 'machine_one'}), '(machine=machine_one)\n',... |
# -*- coding: utf-8 -*-
"""Test suite for the deepreload module."""
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
import os
import nose.tools as nt
from IPython.testing import decorators as dec
... | [
"IPython.utils.syspathcontext.prepended_to_syspath",
"A.Object",
"IPython.utils.tempdir.TemporaryDirectory",
"IPython.lib.deepreload.reload",
"os.path.join"
] | [((1020, 1051), 'IPython.lib.deepreload.reload', 'dreload', (['numpy'], {'exclude': 'exclude'}), '(numpy, exclude=exclude)\n', (1027, 1051), True, 'from IPython.lib.deepreload import reload as dreload\n'), ((1155, 1175), 'IPython.utils.tempdir.TemporaryDirectory', 'TemporaryDirectory', ([], {}), '()\n', (1173, 1175), F... |
import hashlib
import json
import logging
import os
import paho.mqtt.client as mqtt
import threading
import time
from lib.globals import (EXTERNAL_BROKER_HOST, EXTERNAL_BROKER_PORT, LOGGER_TAG,
AUTH_INFO_PATH, KEEP_STREAM_TIME, MQTT_TOPIC_LISTING_PATH)
from lib.secrets import token_hex
class... | [
"logging.getLogger",
"os.path.exists",
"paho.mqtt.client.Client",
"json.dumps",
"time.sleep",
"json.load",
"lib.secrets.token_hex",
"time.time"
] | [((529, 558), 'logging.getLogger', 'logging.getLogger', (['LOGGER_TAG'], {}), '(LOGGER_TAG)\n', (546, 558), False, 'import logging\n'), ((581, 605), 'paho.mqtt.client.Client', 'mqtt.Client', ([], {'userdata': '{}'}), '(userdata={})\n', (592, 605), True, 'import paho.mqtt.client as mqtt\n'), ((1335, 1374), 'os.path.exis... |
# Copyright 2013-2014 The Meson development team
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agree... | [
"ctypes.byref",
"ctypes.wintypes.DWORD",
"pathlib.Path",
"time.monotonic",
"os.path.join",
"os.environ.get",
"os.getcwd",
"platform.system",
"io.StringIO",
"sys.stdout.fileno",
"typing.cast"
] | [((1159, 1166), 'ctypes.wintypes.DWORD', 'DWORD', ([], {}), '()\n', (1164, 1166), False, 'from ctypes.wintypes import DWORD\n'), ((6160, 6173), 'io.StringIO', 'io.StringIO', ([], {}), '()\n', (6171, 6173), False, 'import io\n'), ((3509, 3540), 'os.path.join', 'os.path.join', (['logdir', 'log_fname'], {}), '(logdir, log... |
# -*- coding: utf-8 -*-
# Copyright (c) 2020. Distributed under the terms of the MIT License.
from pydefect.analyzer.calc_results import CalcResults
from pydefect.defaults import defaults
from pymatgen.io.vasp import Vasprun, Outcar
from vise.analyzer.vasp.band_edge_properties import VaspBandEdgeProperties
from vise.u... | [
"pydefect.analyzer.calc_results.CalcResults",
"vise.analyzer.vasp.band_edge_properties.VaspBandEdgeProperties"
] | [((837, 904), 'vise.analyzer.vasp.band_edge_properties.VaspBandEdgeProperties', 'VaspBandEdgeProperties', (['vasprun', 'outcar', 'defaults.integer_criterion'], {}), '(vasprun, outcar, defaults.integer_criterion)\n', (859, 904), False, 'from vise.analyzer.vasp.band_edge_properties import VaspBandEdgeProperties\n'), ((92... |
# Copyright 2018 REMME
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softwa... | [
"logging.getLogger",
"functools.lru_cache",
"sawtooth_sdk.protobuf.setting_pb2.Setting"
] | [((1036, 1063), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1053, 1063), False, 'import logging\n'), ((2447, 2469), 'functools.lru_cache', 'lru_cache', ([], {'maxsize': '(128)'}), '(maxsize=128)\n', (2456, 2469), False, 'from functools import lru_cache\n'), ((1575, 1584), 'sawtooth_sd... |
from pathlib import Path
from django.core.exceptions import ValidationError
from django.db import models
from django.db.models.signals import post_save, pre_save
from django.dispatch import receiver
from computedfields.models import ComputedFieldsModel, computed
from safedelete.managers import SafeDeleteDeletedManage... | [
"safedelete.managers.SafeDeleteDeletedManager",
"django.db.models.EmailField",
"resources_portal.utils.pretty_date",
"django.db.models.TextField",
"django.db.models.ForeignKey",
"pathlib.Path",
"safedelete.managers.SafeDeleteManager",
"django.core.exceptions.ValidationError",
"django.db.models.DateT... | [((1151, 1185), 'resources_portal.config.logging.get_and_configure_logger', 'get_and_configure_logger', (['__name__'], {}), '(__name__)\n', (1175, 1185), False, 'from resources_portal.config.logging import get_and_configure_logger\n'), ((8725, 8783), 'django.dispatch.receiver', 'receiver', (['pre_save'], {'sender': '""... |
import os
import sys
sys.path.append(os.getcwd())
#from __future__ import print_function
import torch
import torch.nn.functional as F
from torch.autograd import Variable
import torch.nn as nn
import torch.optim as optim
from workspace.workspace_intent import SENT_WORDID, SENT_LABELID, SENT_WORD_MASK, SENT_ORIGINAL_TXT
... | [
"numpy.mean",
"os.path.join",
"numpy.argmax",
"os.getcwd",
"numpy.max",
"numpy.array",
"torch.no_grad"
] | [((37, 48), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (46, 48), False, 'import os\n'), ((4884, 4902), 'numpy.array', 'numpy.array', (['probs'], {}), '(probs)\n', (4895, 4902), False, 'import numpy\n'), ((4917, 4933), 'numpy.array', 'numpy.array', (['gts'], {}), '(gts)\n', (4928, 4933), False, 'import numpy\n'), ((495... |
"""OpenPecha Work
This module contains OpenPecha Work data model and utils for
creating work objects.
"""
import json
from datetime import datetime
from pathlib import Path
from typing import Dict, List, Union
from pydantic import BaseModel, validator
from pydantic.networks import AnyHttpUrl
from .. import config
fr... | [
"pathlib.Path",
"pydantic.validator"
] | [((1346, 1384), 'pydantic.validator', 'validator', (['"""id"""'], {'pre': '(True)', 'always': '(True)'}), "('id', pre=True, always=True)\n", (1355, 1384), False, 'from pydantic import BaseModel, validator\n'), ((2549, 2557), 'pathlib.Path', 'Path', (['fn'], {}), '(fn)\n', (2553, 2557), False, 'from pathlib import Path\... |
from pathlib import Path
import pytest
from pyinstrument.__main__ import main
from pyinstrument.renderers.base import FrameRenderer
from .util import BUSY_WAIT_SCRIPT
fake_renderer_instance = None
class FakeRenderer(FrameRenderer):
def __init__(self, time=None, **kwargs):
self.time = time
supe... | [
"pyinstrument.__main__.main"
] | [((1153, 1159), 'pyinstrument.__main__.main', 'main', ([], {}), '()\n', (1157, 1159), False, 'from pyinstrument.__main__ import main\n'), ((1791, 1797), 'pyinstrument.__main__.main', 'main', ([], {}), '()\n', (1795, 1797), False, 'from pyinstrument.__main__ import main\n'), ((2439, 2445), 'pyinstrument.__main__.main', ... |
import unittest
import os
import sys
sys.path.append('../../../../source/code/tools/scx_prune_repository')
from moffile import MofFile
class MofFileTestCase(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
try:
os.remove('EmptyFile.mof')
os.remove('File... | [
"os.remove",
"sys.path.append",
"moffile.MofFile"
] | [((37, 106), 'sys.path.append', 'sys.path.append', (['"""../../../../source/code/tools/scx_prune_repository"""'], {}), "('../../../../source/code/tools/scx_prune_repository')\n", (52, 106), False, 'import sys\n'), ((589, 626), 'moffile.MofFile', 'MofFile', (['"""ThisFileShouldNotExist.mof"""'], {}), "('ThisFileShouldNo... |
#DELETE
from mongoengine.errors import DoesNotExist
from Arquivo1 import Produto
try:
produto = Produto.objects(Nome="Tilápia").get()
produto.delete()
print("Produto deletado")
except DoesNotExist:
print("Produto não encontrado")
| [
"Arquivo1.Produto.objects"
] | [((106, 137), 'Arquivo1.Produto.objects', 'Produto.objects', ([], {'Nome': '"""Tilápia"""'}), "(Nome='Tilápia')\n", (121, 137), False, 'from Arquivo1 import Produto\n')] |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... | [
"keystone.i18n._",
"keystone.exception.PasswordValidationError",
"re.match",
"jsonschema.validators.extend",
"keystone.exception.PasswordRequirementsValidationError",
"keystone.exception.SchemaValidationError",
"jsonschema.FormatChecker",
"six.text_type",
"oslo_log.log.getLogger"
] | [((787, 810), 'oslo_log.log.getLogger', 'log.getLogger', (['__name__'], {}), '(__name__)\n', (800, 810), False, 'from oslo_log import log\n'), ((2494, 2554), 'jsonschema.validators.extend', 'jsonschema.validators.extend', (['self.validator_org', 'validators'], {}), '(self.validator_org, validators)\n', (2522, 2554), Fa... |
import six, json
from .logclient_operator import list_more
from .logexception import LogException
from .pluralize import pluralize
from .common_response import *
DEFAULT_MAX_LIST_PAGING_SIZE = 500
def create_entity(entity_name, root_resource=None):
def fn(self, project, detail):
""" Create {en... | [
"json.loads",
"json.dumps"
] | [((942, 960), 'json.dumps', 'json.dumps', (['detail'], {}), '(detail)\n', (952, 960), False, 'import six, json\n'), ((5315, 5333), 'json.dumps', 'json.dumps', (['detail'], {}), '(detail)\n', (5325, 5333), False, 'import six, json\n'), ((5747, 5767), 'json.loads', 'json.loads', (['body_str'], {}), '(body_str)\n', (5757,... |
#! /usr/bin/env python
import numpy as np
from .order_parameters import potential_M_N, centroid_m
def is_discrete_pattern_formed(states, params):
K = params['K']
M = params['M']
potential = potential_M_N(K, M, states.values())
velocities = np.array([s.velocity for s in states.values()])
speeds = ... | [
"numpy.linalg.norm"
] | [((320, 354), 'numpy.linalg.norm', 'np.linalg.norm', (['velocities'], {'axis': '(1)'}), '(velocities, axis=1)\n', (334, 354), True, 'import numpy as np\n'), ((646, 680), 'numpy.linalg.norm', 'np.linalg.norm', (['velocities'], {'axis': '(1)'}), '(velocities, axis=1)\n', (660, 680), True, 'import numpy as np\n')] |
import os
import struct
import numpy as np
import torch
import torch.utils.data
from functools import lru_cache
def read_longs(f, n):
a = np.empty(n, dtype=np.int64)
f.readinto(a)
return a
def write_longs(f, a):
f.write(np.array(a, dtype=np.int64))
dtypes = {
1: np.uint8,
2: np.int8,
3... | [
"numpy.frombuffer",
"numpy.memmap",
"torch.from_numpy",
"struct.pack",
"numpy.array",
"numpy.empty",
"functools.lru_cache"
] | [((144, 171), 'numpy.empty', 'np.empty', (['n'], {'dtype': 'np.int64'}), '(n, dtype=np.int64)\n', (152, 171), True, 'import numpy as np\n'), ((4783, 4803), 'functools.lru_cache', 'lru_cache', ([], {'maxsize': '(8)'}), '(maxsize=8)\n', (4792, 4803), False, 'from functools import lru_cache\n'), ((240, 267), 'numpy.array'... |
###
# Copyright 2016-2021 <NAME>, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | [
"rdmc_helper.LOGGER.setLevel",
"rdmc_base_classes.RdmcCommandBase",
"shlex.split",
"cliutils.CommandNotFoundException",
"os.getuid",
"builtins.str",
"rdmc_helper.Encryption.encode_credentials",
"sys.stdout.write",
"prompt_toolkit.output.Output.disable_bracketed_paste",
"sys.exit",
"copy.copy",
... | [((3282, 3296), 'cliutils.CLI', 'cliutils.CLI', ([], {}), '()\n', (3294, 3296), False, 'import cliutils\n'), ((40881, 40903), 'sys.exit', 'sys.exit', (['RDMC.retcode'], {}), '(RDMC.retcode)\n', (40889, 40903), False, 'import sys\n'), ((3350, 3397), 'rdmc_helper.RdmcError', 'RdmcError', (['"""Unable to allocate more res... |
'''
Write a python script that can be used to convert a pdf into an audiobook
'''
import pyttsx3,PyPDF2
pdfreader = PyPDF2.pdfFileReader(open('file.pdf','rb'))
speaker = pyttsx3.init()
for page_num in range(pdfreader.numPages):
text = pdfreader.getPage(page_num).extractText()
speaker.say(text)
spea... | [
"pyttsx3.init"
] | [((175, 189), 'pyttsx3.init', 'pyttsx3.init', ([], {}), '()\n', (187, 189), False, 'import pyttsx3, PyPDF2\n')] |
import argparse
import datasets
from transformers import BertTokenizer
from transformers import EvaluationStrategy
from transformers import BertForSequenceClassification, BertTokenizerFast, Trainer, TrainingArguments
from bs4 import BeautifulSoup
from sklearn.metrics import accuracy_score, precision_recall_fscore... | [
"argparse.ArgumentParser",
"pandas.read_csv"
] | [((403, 428), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (426, 428), False, 'import argparse\n'), ((780, 797), 'pandas.read_csv', 'pd.read_csv', (['path'], {}), '(path)\n', (791, 797), True, 'import pandas as pd\n')] |
from django.contrib import admin
from .models import Company, News
admin.site.register(Company)
admin.site.register(News) | [
"django.contrib.admin.site.register"
] | [((68, 96), 'django.contrib.admin.site.register', 'admin.site.register', (['Company'], {}), '(Company)\n', (87, 96), False, 'from django.contrib import admin\n'), ((97, 122), 'django.contrib.admin.site.register', 'admin.site.register', (['News'], {}), '(News)\n', (116, 122), False, 'from django.contrib import admin\n')... |
# *SymmetryFinder*: platform-independent symmetry finder, wrapping Spglib code
# *SymmetryHandler*: symmetry inferences for 0D-, 1D-, 2D- and 3D-systems
# Author: <NAME>
from numpy.linalg import det
from ase.atoms import Atoms
from ase.geometry import cell_to_cellpar
import spglib as spg
class SymmetryFinder:
... | [
"numpy.linalg.det",
"spglib.refine_cell",
"ase.geometry.cell_to_cellpar",
"spglib.get_spacegroup"
] | [((588, 700), 'spglib.get_spacegroup', 'spg.get_spacegroup', (["tilde_obj['structures'][-1]"], {'symprec': 'self.accuracy', 'angle_tolerance': 'self.angle_tolerance'}), "(tilde_obj['structures'][-1], symprec=self.accuracy,\n angle_tolerance=self.angle_tolerance)\n", (606, 700), True, 'import spglib as spg\n'), ((124... |
""" Management command to create an ApiAccessRequest for given users """
import logging
from contextlib import contextmanager
from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user
from django.contrib.sites.models import Site
from django.core.management.base import BaseComman... | [
"logging.getLogger",
"django.db.models.signals.post_save.disconnect",
"openedx.core.djangoapps.api_admin.models.ApiAccessConfig.objects.get_or_create",
"django.db.models.signals.post_save.connect",
"django.db.models.signals.pre_save.connect",
"django.core.management.base.CommandError",
"django.db.models... | [((552, 579), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (569, 579), False, 'import logging\n'), ((840, 960), 'django.db.models.signals.post_save.disconnect', 'post_save.disconnect', (['send_request_email'], {'sender': 'ApiAccessRequest', 'dispatch_uid': '"""api_access_request_post_sa... |
#!/usr/bin/env python
from __future__ import division
from past.utils import old_div
import unittest
import os.path
import sys
import numpy
import anuga
from anuga.abstract_2d_finite_volumes.mesh_factory import rectangular_cross
from anuga.shallow_water.shallow_water_domain import Domain
from anuga.abstract_2d_fini... | [
"numpy.allclose",
"unittest.makeSuite",
"anuga.Reflective_boundary",
"os.path.join",
"anuga.utilities.system_tools.get_pathname_from_package",
"os.getcwd",
"os.chdir",
"os.remove",
"numpy.zeros",
"past.utils.old_div",
"anuga.shallow_water.shallow_water_domain.Domain",
"warnings.simplefilter",
... | [((9849, 9896), 'unittest.makeSuite', 'unittest.makeSuite', (['Test_inlet_operator', '"""test"""'], {}), "(Test_inlet_operator, 'test')\n", (9867, 9896), False, 'import unittest\n'), ((9910, 9935), 'unittest.TextTestRunner', 'unittest.TextTestRunner', ([], {}), '()\n', (9933, 9935), False, 'import unittest\n'), ((1302,... |
# -*- coding: utf-8 -*-
#
# Copyright 2020 Osia 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 la... | [
"boto3.client"
] | [((761, 784), 'boto3.client', 'boto3.client', (['"""route53"""'], {}), "('route53')\n", (773, 784), False, 'import boto3\n')] |
import sys
import os
PROJECT_ROOT = os.path.abspath(os.path.join(
os.path.dirname(__file__),
os.pardir)
)
sys.path.append(PROJECT_ROOT)
from RFEM.Loads.freeLoad import FreeLoad
from RFEM.enums import *
from RFEM.initModel import Model
from RFEM.BasicObjects.material import Material
... | [
"RFEM.TypesForNodes.nodalSupport.NodalSupport",
"RFEM.BasicObjects.line.Line",
"sys.path.append",
"RFEM.Loads.freeLoad.FreeLoad.ConcentratedLoad",
"RFEM.Loads.freeLoad.FreeLoad.CircularLoad",
"RFEM.BasicObjects.node.Node",
"RFEM.Loads.freeLoad.FreeLoad.LineLoad",
"RFEM.initModel.Model.clientModel.serv... | [((142, 171), 'sys.path.append', 'sys.path.append', (['PROJECT_ROOT'], {}), '(PROJECT_ROOT)\n', (157, 171), False, 'import sys\n'), ((736, 743), 'RFEM.initModel.Model', 'Model', ([], {}), '()\n', (741, 743), False, 'from RFEM.initModel import Model\n'), ((772, 810), 'RFEM.initModel.Model.clientModel.service.delete_all'... |
# coding: utf-8
# In[ ]:
import random
import operator
import copy
import file_writer_FMnist as fm
import subprocess
import datetime
import os
import shutil
import time
"""
fitness = gene[0]
lr = gene[1]
initW = gene[2]
optim = gene[3]
actF = gene[4]
kernel_size = gene[5]
depth = gene[6]... | [
"subprocess.check_output",
"random.sample",
"random.choice",
"random.uniform",
"os.listdir",
"time.clock",
"os.path.join",
"datetime.datetime.now",
"os.path.isdir",
"copy.deepcopy",
"file_writer_FMnist.fileMaker",
"operator.itemgetter",
"time.time",
"random.randint",
"os.remove"
] | [((424, 435), 'time.time', 'time.time', ([], {}), '()\n', (433, 435), False, 'import time\n'), ((450, 462), 'time.clock', 'time.clock', ([], {}), '()\n', (460, 462), False, 'import time\n'), ((4711, 4734), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (4732, 4734), False, 'import datetime\n'), ((5... |
import random
import numpy as np
def add_noise_new(data, labels, params):
# new refactoring of the noise injection methods
# noise_mode sets the pattern of the noise injection
# cluster: apply to the samples and features defined by noise_samples and noise_features
# conditional : apply to feature... | [
"numpy.random.normal",
"random.random",
"numpy.random.uniform"
] | [((5437, 5484), 'numpy.random.normal', 'np.random.normal', (['loc', 'scale'], {'size': 'x_data.shape'}), '(loc, scale, size=x_data.shape)\n', (5453, 5484), True, 'import numpy as np\n'), ((3589, 3604), 'random.random', 'random.random', ([], {}), '()\n', (3602, 3604), False, 'import random\n'), ((5895, 5945), 'numpy.ran... |
#!/usr/bin/env python
__author__ = "<EMAIL>"
"""
Reporter for junction summary for one or more samples.
Recommended to run before scrubbing sample GFFs prior to chaining.
Suggested process is:
1. run collapse to get GFF for each sample
2. run this report script on all sample GFFs
3. run scrubber on all sample GFFs
4.... | [
"csv.DictWriter",
"cupcake.cupcake_logger.info",
"pathlib.Path",
"typer.Option",
"typer.Typer",
"numpy.array",
"collections.defaultdict",
"sys.exit",
"cupcake.cupcake_logger.error",
"typer.run",
"sklearn.cluster.Birch",
"typer.Argument"
] | [((742, 814), 'typer.Typer', 'typer.Typer', ([], {'name': '"""cupcake.tofu.counting.summarize_sample_GFF_junctions"""'}), "(name='cupcake.tofu.counting.summarize_sample_GFF_junctions')\n", (753, 814), False, 'import typer\n'), ((4085, 4102), 'collections.defaultdict', 'defaultdict', (['dict'], {}), '(dict)\n', (4096, 4... |
#!/usr/bin/python
#
# Copyright (c) 2016 <NAME>, <<EMAIL>>
#
# 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ... | [
"msrestazure.tools.parse_resource_id",
"ansible.module_utils.azure_rm_common.azure_id_to_dict",
"ansible.module_utils.azure_rm_common.format_resource_id"
] | [((33896, 33917), 'msrestazure.tools.parse_resource_id', 'parse_resource_id', (['id'], {}), '(id)\n', (33913, 33917), False, 'from msrestazure.tools import parse_resource_id\n'), ((38623, 38791), 'ansible.module_utils.azure_rm_common.format_resource_id', 'format_resource_id', ([], {'val': 'nsg', 'subscription_id': 'sel... |
import sys
sys.path.append('../')
from scgen.main.DefaultGeneratorFactory import DefaultGeneratorFactory
gen = DefaultGeneratorFactory.getDefaultGenerator()
exampleSettings = {
"elements": [
{
"type": "suppliers",
"count": 4
},
{
"type": "plants",
... | [
"scgen.main.DefaultGeneratorFactory.DefaultGeneratorFactory.getDefaultGenerator",
"sys.path.append"
] | [((12, 34), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (27, 34), False, 'import sys\n'), ((114, 159), 'scgen.main.DefaultGeneratorFactory.DefaultGeneratorFactory.getDefaultGenerator', 'DefaultGeneratorFactory.getDefaultGenerator', ([], {}), '()\n', (157, 159), False, 'from scgen.main.Defaul... |
import asyncio
import discord
from discord.ext import commands
import prawcore # because praw exceptions inherit from here
import random
import re as regex
# pylint: disable=import-error
from CatLampPY import reddit
from cogs.misc.isAdmin import isAdmin
import datetime
from hastebin import get_key
async def sendPost... | [
"datetime.datetime.fromtimestamp",
"random.randint",
"discord.AllowedMentions",
"CatLampPY.reddit.subreddit",
"datetime.datetime.utcnow",
"hastebin.get_key",
"discord.ext.commands.check",
"CatLampPY.reddit.submission",
"re.findall",
"discord.Embed",
"discord.ext.commands.command"
] | [((366, 488), 'discord.Embed', 'discord.Embed', ([], {'title': 'randPost.title', 'description': 'randPost.selftext', 'url': 'f"""https://www.reddit.com{randPost.permalink}"""'}), "(title=randPost.title, description=randPost.selftext, url=\n f'https://www.reddit.com{randPost.permalink}')\n", (379, 488), False, 'impor... |
# automatically generated by the FlatBuffers compiler, do not modify
# namespace: proto
import flatbuffers
class CalleeFeatures(object):
__slots__ = ['_tab']
@classmethod
def GetRootAsCalleeFeatures(cls, buf, offset):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x ... | [
"flatbuffers.encode.Get",
"flatbuffers.table.Table"
] | [((246, 309), 'flatbuffers.encode.Get', 'flatbuffers.encode.Get', (['flatbuffers.packer.uoffset', 'buf', 'offset'], {}), '(flatbuffers.packer.uoffset, buf, offset)\n', (268, 309), False, 'import flatbuffers\n'), ((460, 493), 'flatbuffers.table.Table', 'flatbuffers.table.Table', (['buf', 'pos'], {}), '(buf, pos)\n', (48... |
from flask import Blueprint
course = Blueprint('course', __name__, url_prefix='/courses')
| [
"flask.Blueprint"
] | [((38, 90), 'flask.Blueprint', 'Blueprint', (['"""course"""', '__name__'], {'url_prefix': '"""/courses"""'}), "('course', __name__, url_prefix='/courses')\n", (47, 90), False, 'from flask import Blueprint\n')] |
import ast
import sys
import web3
from celo_sdk.celo_account import Account
from hexbytes import HexBytes
from web3 import Web3
from celo_sdk.utils import hash_utils
class Wallet:
"""
Wallet class requires for transaction building, signing and sending to the blockchain.
Also you can configure Wallet as y... | [
"sys.exc_info",
"celo_sdk.celo_account.Account"
] | [((778, 787), 'celo_sdk.celo_account.Account', 'Account', ([], {}), '()\n', (785, 787), False, 'from celo_sdk.celo_account import Account\n'), ((3883, 3892), 'celo_sdk.celo_account.Account', 'Account', ([], {}), '()\n', (3890, 3892), False, 'from celo_sdk.celo_account import Account\n'), ((5869, 5883), 'sys.exc_info', ... |
# -*- coding: utf-8 -*-
'''
:codeauthor: <NAME> (<EMAIL>)
tests.unit.utils.immutabletypes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Test hubblestack.utils.immutabletypes
'''
from tests.support.unit import TestCase
import hubblestack.utils.immutabletypes as immutabletypes
class ImmutableTypesTestCase(TestCa... | [
"hubblestack.utils.immutabletypes.ImmutableList",
"hubblestack.utils.immutabletypes.freeze"
] | [((402, 441), 'hubblestack.utils.immutabletypes.ImmutableList', 'immutabletypes.ImmutableList', (['[1, 2, 3]'], {}), '([1, 2, 3])\n', (430, 441), True, 'import hubblestack.utils.immutabletypes as immutabletypes\n'), ((683, 715), 'hubblestack.utils.immutabletypes.freeze', 'immutabletypes.freeze', (['[1, 2, 3]'], {}), '(... |
# Copyright 2018 Canonical Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | [
"subprocess.check_output",
"subprocess.check_call",
"charms.reactive.is_flag_set",
"charms.reactive.endpoint_from_flag",
"socket.gethostname"
] | [((2814, 2929), 'subprocess.check_output', 'subprocess.check_output', (["['rbd', '--id', self.ceph_id, 'mirror', 'pool', 'info', pool]"], {'universal_newlines': '(True)'}), "(['rbd', '--id', self.ceph_id, 'mirror', 'pool',\n 'info', pool], universal_newlines=True)\n", (2837, 2929), False, 'import subprocess\n'), ((3... |
from collections import OrderedDict, namedtuple
from typing import Tuple
import numpy as np
import torch
import torch.optim as optim
from rlkit.core.loss import LossFunction, LossStatistics
from torch import nn as nn
import rlkit.torch.pytorch_util as ptu
from rlkit.core.eval_util import create_stats_ordered_dict
fro... | [
"numpy.prod",
"collections.OrderedDict",
"collections.namedtuple",
"random.sample",
"torch.ones",
"torch.nn.MSELoss",
"gtimer.blank_stamp",
"numpy.loadtxt",
"rlkit.torch.pytorch_util.get_numpy",
"numpy.zeros",
"torch.tensor",
"torch.zeros",
"rlkit.torch.pytorch_util.soft_update_from_to",
"... | [((472, 564), 'collections.namedtuple', 'namedtuple', (['"""SACLosses"""', '"""policy_loss qf1_loss qf2_loss alpha_loss state_estimator_loss"""'], {}), "('SACLosses',\n 'policy_loss qf1_loss qf2_loss alpha_loss state_estimator_loss')\n", (482, 564), False, 'from collections import OrderedDict, namedtuple\n'), ((2425... |
from __future__ import unicode_literals, absolute_import
from mock import MagicMock
from re import sub
from ....unittest import TestCase
from oauthlib.common import safe_string_equals
from oauthlib.oauth1 import Client, RequestValidator
from oauthlib.oauth1.rfc5849 import errors, SIGNATURE_RSA, SIGNATURE_HMAC
from oa... | [
"oauthlib.oauth1.rfc5849.endpoints.RequestTokenEndpoint",
"oauthlib.oauth1.RequestValidator",
"oauthlib.oauth1.Client",
"re.sub",
"mock.MagicMock",
"oauthlib.oauth1.rfc5849.endpoints.BaseEndpoint"
] | [((602, 634), 'mock.MagicMock', 'MagicMock', ([], {'spec': 'RequestValidator'}), '(spec=RequestValidator)\n', (611, 634), False, 'from mock import MagicMock\n'), ((772, 808), 'oauthlib.oauth1.rfc5849.endpoints.RequestTokenEndpoint', 'RequestTokenEndpoint', (['self.validator'], {}), '(self.validator)\n', (792, 808), Fal... |
"""
Тесты для команды "алиас"
"""
from time import sleep
from discord.ext.test import message, get_embed
from pytest import fixture, mark
from discord import Color
class TestAlias:
"""Класс для тестов и фикстур"""
@fixture(scope="class")
async def alias_added_not_owner(self, event_loop, bot, database, mo... | [
"time.sleep",
"discord.Color.orange",
"discord.Color.green",
"pytest.fixture",
"discord.ext.test.get_embed",
"discord.ext.test.message",
"discord.Color.red"
] | [((226, 248), 'pytest.fixture', 'fixture', ([], {'scope': '"""class"""'}), "(scope='class')\n", (233, 248), False, 'from pytest import fixture, mark\n'), ((759, 781), 'pytest.fixture', 'fixture', ([], {'scope': '"""class"""'}), "(scope='class')\n", (766, 781), False, 'from pytest import fixture, mark\n'), ((1406, 1428)... |
"""
Copyright 2021 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES O... | [
"os.environ.get",
"utils.common.run_command",
"boto3.client",
"cli.style.print_error_msg"
] | [((1842, 1861), 'boto3.client', 'boto3.client', (['"""iam"""'], {}), "('iam')\n", (1854, 1861), False, 'import boto3\n'), ((2069, 2088), 'boto3.client', 'boto3.client', (['"""ec2"""'], {}), "('ec2')\n", (2081, 2088), False, 'import boto3\n'), ((3060, 3079), 'boto3.client', 'boto3.client', (['"""ec2"""'], {}), "('ec2')\... |
import logging
from datetime import timedelta
from airflow import DAG
from airflow.operators.python_operator import PythonOperator
from airflow.utils.dates import days_ago
from airmaps.instruments import settings
from airmaps.instruments import storage
from airmaps.instruments.utils import make_rm_build_task
from air... | [
"logging.getLogger",
"maps_generator.generator.stages_declaration.StageCoastline",
"airmaps.instruments.storage.wd_publish",
"maps_generator.generator.stages_declaration.StageCleanup",
"maps_generator.generator.stages_declaration.StageDownloadDescriptions",
"datetime.timedelta",
"maps_generator.generato... | [((674, 702), 'logging.getLogger', 'logging.getLogger', (['"""airmaps"""'], {}), "('airmaps')\n", (691, 702), False, 'import logging\n'), ((903, 1030), 'airflow.operators.python_operator.PythonOperator', 'PythonOperator', ([], {'task_id': '"""Build_prolog_task"""', 'provide_context': '(True)', 'python_callable': 'MapsG... |
# -*- coding: utf-8 -*-
from socket import socket, SOCK_STREAM, AF_INET
from base64 import b64encode
from json import dumps
from threading import Thread
def main():
# 自定义线程类
class FileTransferHandler(Thread):
def __init__(self, cclient, image_name):
super().__init__()
self.ccl... | [
"json.dumps",
"socket.socket"
] | [((807, 815), 'socket.socket', 'socket', ([], {}), '()\n', (813, 815), False, 'from socket import socket, SOCK_STREAM, AF_INET\n'), ((638, 652), 'json.dumps', 'dumps', (['my_dict'], {}), '(my_dict)\n', (643, 652), False, 'from json import dumps\n')] |
"""
CS4RSA Helpful Function
~~~~~~~~~~~~~~~~~
Module này chứa những hàm đơn giản phục vụ cho việc làm sạch dữ liệu, xử lý dữ liệu trong những context thường gặp như
làm sạch text sau khi lấy được từ một Tag trong BeautifulSoup, suy cụm data thành một nhóm data duy nhất.
"""
import re
from typing import Dict, List
de... | [
"re.compile"
] | [((1137, 1160), 're.compile', 're.compile', (['regexString'], {}), '(regexString)\n', (1147, 1160), False, 'import re\n')] |
# Copyright 2014 Kylincloud
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | [
"logging.getLogger",
"openstack_dashboard.api.neutron.remove_network_from_dhcp_agent",
"django.utils.translation.ngettext_lazy",
"django.utils.translation.gettext_lazy",
"django.urls.reverse"
] | [((935, 962), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (952, 962), False, 'import logging\n'), ((1658, 1677), 'django.utils.translation.gettext_lazy', '_', (['"""Add DHCP Agent"""'], {}), "('Add DHCP Agent')\n", (1659, 1677), True, 'from django.utils.translation import gettext_lazy ... |
from ...objects import dp, MySignalEvent
from ... import utils
from vkapi import VkApi
@dp.my_signal_event_handle('проверить')
def check(event: MySignalEvent) -> str:
def check_token(t: str) -> str:
if t == "" or t == None:
return "Токен не задан"
api = VkApi(t)
user = api('u... | [
"vkapi.VkApi"
] | [((289, 297), 'vkapi.VkApi', 'VkApi', (['t'], {}), '(t)\n', (294, 297), False, 'from vkapi import VkApi\n')] |
# -*- coding: utf-8 -*-
import re
from bs4 import Tag
from helper import get_heading_level, get_heading_text, get_html_tree_from_url, remove_parenthesis
tested_url = [
"https://ru.wiktionary.org/wiki/blood",
"https://ru.wiktionary.org/wiki/flower",
"https://ru.wiktionary.org/wiki/house",
"https://ru.... | [
"re.split",
"helper.get_heading_level",
"re.compile",
"helper.remove_parenthesis",
"helper.get_html_tree_from_url",
"helper.get_heading_text"
] | [((493, 512), 're.compile', 're.compile', (['"""[,;.]"""'], {}), "('[,;.]')\n", (503, 512), False, 'import re\n'), ((534, 552), 're.compile', 're.compile', (['"""[,;]"""'], {}), "('[,;]')\n", (544, 552), False, 'import re\n'), ((1149, 1176), 'helper.remove_parenthesis', 'remove_parenthesis', (['text[1]'], {}), '(text[1... |
# (c) @AbirHasan2005
import os
from dotenv import load_dotenv
load_dotenv("configs.env")
class Config(object):
API_ID = int(os.environ.get("API_ID", "123"))
API_HASH = os.environ.get("API_HASH", "")
BOT_TOKEN = os.environ.get("BOT_TOKEN", "")
STATUS_UPDATE_CHANNEL_ID = int(os.environ.get("STATUS_UPD... | [
"os.environ.get",
"dotenv.load_dotenv"
] | [((64, 90), 'dotenv.load_dotenv', 'load_dotenv', (['"""configs.env"""'], {}), "('configs.env')\n", (75, 90), False, 'from dotenv import load_dotenv\n'), ((180, 210), 'os.environ.get', 'os.environ.get', (['"""API_HASH"""', '""""""'], {}), "('API_HASH', '')\n", (194, 210), False, 'import os\n'), ((227, 258), 'os.environ.... |
import numpy as np
import torch
import ptan
def unpack_batch_a2c(batch, net, last_val_gamma, device="cpu"):
"""
Convert batch into training tensors
:param batch:
:param net:
:return: states variable, actions tensor, reference values variable
"""
states = []
actions = []
rewards = ... | [
"numpy.array",
"ptan.agent.float32_preprocessor",
"torch.FloatTensor"
] | [((789, 824), 'numpy.array', 'np.array', (['rewards'], {'dtype': 'np.float32'}), '(rewards, dtype=np.float32)\n', (797, 824), True, 'import numpy as np\n'), ((645, 684), 'ptan.agent.float32_preprocessor', 'ptan.agent.float32_preprocessor', (['states'], {}), '(states)\n', (676, 684), False, 'import ptan\n'), ((712, 738)... |
# Create Phantom container via REST
import requests
import json
def create_artifact(h, t, c_id, a_name, auto):
ep = '/rest/artifact'
# Example cef fields. Can be modified as needed.
artifact_json = {
"cef": {
"shortDescription": "Short Description from Phantom!",
"descrip... | [
"json.dumps",
"requests.packages.urllib3.disable_warnings"
] | [((840, 865), 'json.dumps', 'json.dumps', (['artifact_json'], {}), '(artifact_json)\n', (850, 865), False, 'import json\n'), ((970, 1014), 'requests.packages.urllib3.disable_warnings', 'requests.packages.urllib3.disable_warnings', ([], {}), '()\n', (1012, 1014), False, 'import requests\n')] |
import requests as req
from ndj_toolbox.fetch import (xml_df, save_files)
url_base = 'https://www.al.sp.gov.br/repositorioDados/'
url_file = 'deputados/deputados.xml'
url = url_base + url_file
def main():
xml_data = req.get(url).content
dataset = xml_df(xml_data).process_data()
dataset = dataset[[
... | [
"ndj_toolbox.fetch.xml_df",
"ndj_toolbox.fetch.save_files",
"requests.get"
] | [((994, 1026), 'ndj_toolbox.fetch.save_files', 'save_files', (['dataset', '"""deputados"""'], {}), "(dataset, 'deputados')\n", (1004, 1026), False, 'from ndj_toolbox.fetch import xml_df, save_files\n'), ((224, 236), 'requests.get', 'req.get', (['url'], {}), '(url)\n', (231, 236), True, 'import requests as req\n'), ((25... |
#!/usr/bin/env python
#
# svnshell.py : a Python-based shell interface for cruising 'round in
# the filesystem.
#
######################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOT... | [
"svn.fs.open_txn",
"sys.exc_info",
"sys.exit",
"svn.fs.youngest_rev",
"svn.fs.file_length",
"svn.fs.node_created_rev",
"svn.core.svn_time_from_cstring",
"time.localtime",
"svn.core.svn_stream_read",
"cmd.Cmd.__init__",
"traceback.print_tb",
"svn.fs.is_dir",
"sys.stderr.write",
"svn.fs.clos... | [((11301, 11315), 'sys.exit', 'sys.exit', (['exit'], {}), '(exit)\n', (11309, 11315), False, 'import sys\n'), ((1307, 1325), 'cmd.Cmd.__init__', 'Cmd.__init__', (['self'], {}), '(self)\n', (1319, 1325), False, 'from cmd import Cmd\n'), ((1337, 1369), 'svn.core.svn_path_canonicalize', 'core.svn_path_canonicalize', (['pa... |
import os
import glob
import importlib
import logging
from six import string_types
from jinja2 import DictLoader
import jsonschema
import nbconvert # noqa: F401
from ipypublish.utils import (
pathlib,
handle_error,
get_module_path,
read_file_from_directory,
read_file_from_module,
)
from ipypublis... | [
"logging.getLogger",
"importlib.import_module",
"os.path.join",
"ipypublish.utils.get_module_path",
"jinja2.DictLoader",
"jsonschema.validate",
"ipypublish.templates.create_template.create_template",
"os.path.basename",
"ipypublish.utils.pathlib.Path",
"ipypublish.utils.read_file_from_module",
"... | [((553, 587), 'logging.getLogger', 'logging.getLogger', (['"""configuration"""'], {}), "('configuration')\n", (570, 587), False, 'import logging\n'), ((1410, 1441), 'ipypublish.utils.get_module_path', 'get_module_path', (['export_plugins'], {}), '(export_plugins)\n', (1425, 1441), False, 'from ipypublish.utils import p... |
#!/usr/bin/env python3
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | [
"logging.getLogger",
"logging.basicConfig",
"aiohttp.web.run_app",
"tempfile.TemporaryDirectory",
"json.loads",
"argparse.ArgumentParser",
"subprocess.Popen",
"base64.b64encode",
"weakref.WeakSet",
"aiohttp.web.Application",
"collections.ChainMap",
"asyncio.wait",
"os.path.join",
"jsonsche... | [((1228, 1255), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1245, 1255), False, 'import logging\n'), ((1516, 1533), 'weakref.WeakSet', 'weakref.WeakSet', ([], {}), '()\n', (1531, 1533), False, 'import weakref\n'), ((6038, 6061), 'aiohttp.web.WebSocketResponse', 'web.WebSocketResponse'... |
import pathlib
from setuptools import find_packages, setup
here = pathlib.Path(__file__).parent.resolve()
# Get the long description from the README file
long_description = (here / "README.md").read_text(encoding="utf-8")
# Arguments marked as "Required" below must be included for upload to PyPI.
# Fields marked a... | [
"setuptools.find_packages",
"pathlib.Path"
] | [((1262, 1277), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (1275, 1277), False, 'from setuptools import find_packages, setup\n'), ((68, 90), 'pathlib.Path', 'pathlib.Path', (['__file__'], {}), '(__file__)\n', (80, 90), False, 'import pathlib\n')] |
# -*- coding: utf-8 -*-
"""
Create Synthetic data.
"""
import numpy.random as rd
import numpy as np
import time
class CreateData(object):
def __init__(self, users, arms, dims, seed=int(time.time())):
self.users = users
self.arms = arms
self.dims = dims
self.data_rand = rd.RandomSta... | [
"numpy.ones",
"time.time",
"numpy.array",
"numpy.sum",
"numpy.linalg.norm",
"numpy.random.randn",
"numpy.random.RandomState"
] | [((308, 328), 'numpy.random.RandomState', 'rd.RandomState', (['seed'], {}), '(seed)\n', (322, 328), True, 'import numpy.random as rd\n'), ((353, 412), 'numpy.ones', 'np.ones', (['(self.users, self.arms, self.dims)'], {'dtype': 'np.float'}), '((self.users, self.arms, self.dims), dtype=np.float)\n', (360, 412), True, 'im... |
#! coding: utf-8
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from datetime import datetime
from django.db import models
from django.db.models.signals import post_save
import simplejson
class Profile(models.Model):
class Meta:
verbose_name = _("profil... | [
"django.db.models.signals.post_save.connect",
"simplejson.loads",
"django.utils.translation.ugettext_lazy",
"django.db.models.OneToOneField"
] | [((1081, 1170), 'django.db.models.signals.post_save.connect', 'post_save.connect', (['create_profile'], {'sender': 'User', 'dispatch_uid': '"""some.unique.string.id"""'}), "(create_profile, sender=User, dispatch_uid=\n 'some.unique.string.id')\n", (1098, 1170), False, 'from django.db.models.signals import post_save\... |
#!/usr/bin/env python
import rospy
import cv2
from std_msgs.msg import String
from sensor_msgs.msg import Image, CompressedImage,LaserScan
from cv_bridge import CvBridge, CvBridgeError
from message_filters import ApproximateTimeSynchronizer, Subscriber
from ackermann_msgs.msg import AckermannDriveStamped
import imutils... | [
"cv2.imwrite",
"os.path.exists",
"os.makedirs",
"numpy.where",
"rospy.init_node",
"numpy.asarray",
"preprocessing.utils.ImageUtils",
"cv_bridge.CvBridge",
"os.path.split",
"rospy.Time.now",
"rospy.myargv",
"rospkg.RosPack",
"rospy.spin",
"message_filters.Subscriber",
"message_filters.App... | [((4426, 4463), 'rospy.init_node', 'rospy.init_node', (['"""image_command_sync"""'], {}), "('image_command_sync')\n", (4441, 4463), False, 'import rospy\n'), ((4871, 4883), 'rospy.spin', 'rospy.spin', ([], {}), '()\n', (4881, 4883), False, 'import rospy\n'), ((1342, 1377), 'message_filters.Subscriber', 'Subscriber', ([... |
"""Tests for PEP-593 typing.Annotated types."""
from pytype import file_utils
from pytype.tests import test_base
class AnnotatedTest(test_base.TargetPython3FeatureTest):
"""Tests for typing.Annotated types."""
def test_basic(self):
ty = self.Infer("""
from typing_extensions import Annotated
i = ... | [
"pytype.file_utils.Tempdir"
] | [((1885, 1905), 'pytype.file_utils.Tempdir', 'file_utils.Tempdir', ([], {}), '()\n', (1903, 1905), False, 'from pytype import file_utils\n'), ((2280, 2300), 'pytype.file_utils.Tempdir', 'file_utils.Tempdir', ([], {}), '()\n', (2298, 2300), False, 'from pytype import file_utils\n'), ((2717, 2737), 'pytype.file_utils.Tem... |
# GPU performance tests extracted from py-videocorevi Python library.
# Testing for Raspberry Pi 4 Benchmarking and device identification.
# TREASURE PROJECT 2021
import time
from time import clock_gettime,CLOCK_MONOTONIC
from time import monotonic
import fcntl
import socket
import struct
import numpy as np
from vid... | [
"time.sleep",
"bench_helper.BenchHelper",
"time.perf_counter_ns",
"numpy.arange",
"os.popen",
"numpy.random.seed",
"os.urandom",
"time.monotonic",
"numpy.random.randn",
"numpy.set_printoptions",
"numpy.array_equiv",
"videocore6.driver.Driver",
"socket.socket",
"videocore6.pack_unpack",
"... | [((563, 593), 'time.clock_gettime', 'clock_gettime', (['CLOCK_MONOTONIC'], {}), '(CLOCK_MONOTONIC)\n', (576, 593), False, 'from time import clock_gettime, CLOCK_MONOTONIC\n'), ((7391, 7413), 'time.perf_counter_ns', 'time.perf_counter_ns', ([], {}), '()\n', (7411, 7413), False, 'import time\n'), ((19278, 19313), 'bench_... |
import os
import wsgiref.handlers
import logging
import time
import webapp2 as webapp
import json
from google.appengine.api import memcache
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.api.labs.taskqueue import Task
from google.appengine.runtime import DeadlineExceededError
from api... | [
"logging.getLogger",
"logging.debug",
"api.v1.api_utils.inthepast",
"google.appengine.ext.webapp.util.run_wsgi_app",
"google.appengine.api.memcache.get",
"api.v1.api_utils.getLocalTimestamp",
"logging.error",
"api.asynch.aggregateBusesAsynch",
"json.dumps",
"stats.stathat.apiStatCount",
"google.... | [((10771, 10841), 'webapp2.WSGIApplication', 'webapp.WSGIApplication', (["[('/v1/getarrivals', MainHandler)]"], {'debug': '(True)'}), "([('/v1/getarrivals', MainHandler)], debug=True)\n", (10793, 10841), True, 'import webapp2 as webapp\n'), ((9022, 9065), 'logging.debug', 'logging.debug', (['"""Stop/Route Request start... |
# -*- coding: utf-8 -*-
# (c) 2015, <NAME> <<EMAIL>>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any late... | [
"jmespath.search",
"ansible.errors.AnsibleFilterError",
"ansible.errors.AnsibleError"
] | [((1214, 1300), 'ansible.errors.AnsibleError', 'AnsibleError', (['"""You need to install "jmespath" prior to running json_query filter"""'], {}), '(\n \'You need to install "jmespath" prior to running json_query filter\')\n', (1226, 1300), False, 'from ansible.errors import AnsibleError, AnsibleFilterError\n'), ((19... |
# Copyright (c) 2019 Gunakar Pvt Ltd
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted (subject to the limitations in the disclaimer
# below) provided that the following conditions are met:
# * Redistributions of source code must retain the ... | [
"plezmo.utils.logger.Logger",
"utils.extract_element_name",
"time.sleep"
] | [((2237, 2245), 'plezmo.utils.logger.Logger', 'Logger', ([], {}), '()\n', (2243, 2245), False, 'from plezmo.utils.logger import Logger\n'), ((6707, 6735), 'utils.extract_element_name', 'utils.extract_element_name', ([], {}), '()\n', (6733, 6735), False, 'import utils\n'), ((4004, 4018), 'time.sleep', 'time.sleep', (['(... |
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
import matplotlib.animation as anim
import math
import numpy as np
import os
import glob
import sys
import gaussianFit as gF
import RL
import Accelerated as ac
import projections as proj
import GMM_sample as GMMs
import scipy
from scipy.stats import entropy
clas... | [
"numpy.random.rand",
"GMM_sample.GMM_sample",
"numpy.array",
"numpy.rot90",
"numpy.reshape",
"GMM_sample.data_normalized_likelihood",
"numpy.max",
"Accelerated.AcceleratedMethod",
"projections.SimplexProjectionExpSort",
"numpy.identity",
"numpy.tile",
"scipy.stats.entropy",
"numpy.add",
"n... | [((573, 615), 'numpy.zeros', 'np.zeros', (['(reps, dimension, timeStep, rfs)'], {}), '((reps, dimension, timeStep, rfs))\n', (581, 615), True, 'import numpy as np\n'), ((640, 671), 'numpy.zeros', 'np.zeros', (['(reps, timeStep, rfs)'], {}), '((reps, timeStep, rfs))\n', (648, 671), True, 'import numpy as np\n'), ((872, ... |
import numpy as np
from collections import Counter
from termcolor import colored
from pyfiglet import *
print(colored("Advent of Code - Day 19", "yellow").center(80, "-"))
print(colored(figlet_format("Beacon Scanner",font="small",justify="center"), 'green'))
print(colored("Output","yellow").center(80, "-"))
r = []
r.ap... | [
"collections.Counter",
"numpy.array",
"termcolor.colored",
"numpy.subtract"
] | [((340, 359), 'numpy.array', 'np.array', (['[x, y, z]'], {}), '([x, y, z])\n', (348, 359), True, 'import numpy as np\n'), ((383, 403), 'numpy.array', 'np.array', (['[x, -z, y]'], {}), '([x, -z, y])\n', (391, 403), True, 'import numpy as np\n'), ((427, 448), 'numpy.array', 'np.array', (['[x, -y, -z]'], {}), '([x, -y, -z... |
# http://flask.pocoo.org/docs/0.11/patterns/fileuploads/
import os
import subprocess
import time
import datetime
import uuid
from flask import Flask, request, redirect, url_for, render_template, flash
from werkzeug.utils import secure_filename
from simple_print_server.database import db_session
from simple_print_serv... | [
"logging.getLogger",
"flask.render_template",
"os.path.exists",
"simple_print_server.database.db_session.remove",
"simple_print_server.database.db_session.add",
"flask.flash",
"simple_print_server.app.route",
"subprocess.Popen",
"os.path.join",
"os.path.splitext",
"uuid.uuid4",
"flask.redirect... | [((410, 437), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (427, 437), False, 'import logging\n'), ((1409, 1441), 'simple_print_server.app.route', 'app.route', (['"""/"""'], {'methods': "['POST']"}), "('/', methods=['POST'])\n", (1418, 1441), False, 'from simple_print_server import app\... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from keras import backend as K
from keras import initializers
from keras import regularizers, constraints
from keras.engine import Layer, InputSpec
if K._BACKEND == 'tensorflow':
import tensorflow as tf
... | [
"keras.engine.InputSpec",
"keras.backend.shape",
"keras.backend.sum",
"keras.backend.reshape",
"keras.backend.floatx",
"keras.backend.squeeze",
"keras.layers.Dense",
"keras.backend.greater",
"keras.backend.max",
"theano.tensor.arange",
"keras.layers.concatenate",
"keras.backend.rnn",
"keras.... | [((2677, 2700), 'keras.backend.one_hot', 'K.one_hot', (['y', 'n_classes'], {}), '(y, n_classes)\n', (2686, 2700), True, 'from keras import backend as K\n'), ((2737, 2760), 'keras.backend.sum', 'K.sum', (['(x * y_one_hot)', '(2)'], {}), '(x * y_one_hot, 2)\n', (2742, 2760), True, 'from keras import backend as K\n'), ((2... |
from django.shortcuts import render, redirect
from django.contrib.auth.decorators import login_required
from .forms import DictionaryForm
from django.http import HttpResponse
from django.conf import settings
import requests
from json import dumps
from .models import Dictionary
from django.views.decorators.csrf import c... | [
"django.shortcuts.render",
"json.dumps",
"requests.request",
"django.shortcuts.redirect",
"django.contrib.auth.decorators.login_required"
] | [((1205, 1221), 'django.contrib.auth.decorators.login_required', 'login_required', ([], {}), '()\n', (1219, 1221), False, 'from django.contrib.auth.decorators import login_required\n'), ((1360, 1465), 'django.shortcuts.render', 'render', (['request', '"""core/home.html"""', "{'form': form, 'search_result': search_resul... |
import tempfile
from src.script_handler import *
from src.cyk import cyk
def run_script(s):
temp = tempfile.NamedTemporaryFile()
f = open(temp.name, 'w')
f.write(s)
f.close()
return handle_script_from_file(temp.name)
def test_list_all_graphs(capsys):
path = os.path.dirname(__file__) + '/res... | [
"src.cyk.cyk",
"tempfile.NamedTemporaryFile"
] | [((106, 135), 'tempfile.NamedTemporaryFile', 'tempfile.NamedTemporaryFile', ([], {}), '()\n', (133, 135), False, 'import tempfile\n'), ((870, 885), 'src.cyk.cyk', 'cyk', (['h.g', '"""a b"""'], {}), "(h.g, 'a b')\n", (873, 885), False, 'from src.cyk import cyk\n'), ((897, 918), 'src.cyk.cyk', 'cyk', (['h.g', '"""a b b b... |
from time import time
import os
from typing import Union
from pathlib import Path
import click
import csv
from elasticsearch import helpers, Elasticsearch
from .conf import Conf
@click.command()
@click.option(
'-d',
'--directory',
help="The location of the csv file(s) to be indexed. Can be a single file or... | [
"csv.DictReader",
"pathlib.Path",
"click.option",
"elasticsearch.helpers.bulk",
"click.command",
"time.time"
] | [((180, 195), 'click.command', 'click.command', ([], {}), '()\n', (193, 195), False, 'import click\n'), ((197, 356), 'click.option', 'click.option', (['"""-d"""', '"""--directory"""'], {'help': '"""The location of the csv file(s) to be indexed. Can be a single file or a directory"""', 'required': '(True)', 'type': 'str... |
import datetime
import json
import time
from typing import List, Tuple, Optional, Any, Callable, Awaitable, TypeVar, Generic
from dataclasses import dataclass
from . import scheduler
from . import log
from . import parser as p
from . import commands as c
from .control import Control, CommandContext
from .commands impo... | [
"json.loads",
"datetime.datetime.now",
"datetime.datetime.fromisoformat",
"datetime.timedelta",
"time.time",
"typing.TypeVar"
] | [((418, 430), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (425, 430), False, 'from typing import List, Tuple, Optional, Any, Callable, Awaitable, TypeVar, Generic\n'), ((12119, 12149), 'datetime.timedelta', 'datetime.timedelta', ([], {'minutes': '(10)'}), '(minutes=10)\n', (12137, 12149), False, 'import ... |
import pandas as pd
import numpy as np
import sys
sys.path.append('./')
from data_layer.phoible import PhoibleInfo
from data_layer.parse import read_src_data, get_languages, separate_train, separate_per_language
from util import argparser
def get_symbols(df, field='IPA'):
symbols = set([])
for i, (index, x) ... | [
"numpy.mean",
"data_layer.parse.read_src_data",
"data_layer.parse.get_languages",
"util.argparser.parse_args",
"pandas.concat",
"data_layer.parse.separate_train",
"pandas.DataFrame",
"data_layer.phoible.PhoibleInfo",
"sys.path.append",
"data_layer.parse.separate_per_language"
] | [((51, 72), 'sys.path.append', 'sys.path.append', (['"""./"""'], {}), "('./')\n", (66, 72), False, 'import sys\n'), ((603, 616), 'numpy.mean', 'np.mean', (['lens'], {}), '(lens)\n', (610, 616), True, 'import numpy as np\n'), ((693, 706), 'data_layer.phoible.PhoibleInfo', 'PhoibleInfo', ([], {}), '()\n', (704, 706), Fal... |
import cegis
import examples.consensus_no_test_and_set
def test_complete_consensus_prefer0read0prefer1read1_with_wait_freedom():
consensus = examples.consensus_no_test_and_set.consensus_prefer0read0prefer1read1()
solution, _ = cegis.synthesize(consensus, wait_freedom=True, check_local_deadlocks=True)
asse... | [
"cegis.synthesize"
] | [((237, 311), 'cegis.synthesize', 'cegis.synthesize', (['consensus'], {'wait_freedom': '(True)', 'check_local_deadlocks': '(True)'}), '(consensus, wait_freedom=True, check_local_deadlocks=True)\n', (253, 311), False, 'import cegis\n'), ((521, 620), 'cegis.synthesize', 'cegis.synthesize', (['consensus'], {'fairness': '"... |
# %%
import sys
sys.path.append("./")
sys.path.append(r"C:\Users\Federico\Documents\GitHub\pysical_locomotion")
import matplotlib.pyplot as plt
import pandas as pd
from loguru import logger
from pathlib import Path
import numpy as np
from tpd import recorder
import draw
from data.dbase import db_tables
from fcutils... | [
"fcutils.progress.track",
"loguru.logger.info",
"data.data_utils.select_by_indices",
"pathlib.Path",
"loguru.logger.warning",
"matplotlib.pyplot.figure",
"data.dbase.db_tables.Tracking.get_session_tracking",
"data.dbase.db_tables.Unit.get_session_units",
"draw.Tracking.heatmap",
"tpd.recorder.star... | [((17, 38), 'sys.path.append', 'sys.path.append', (['"""./"""'], {}), "('./')\n", (32, 38), False, 'import sys\n'), ((39, 116), 'sys.path.append', 'sys.path.append', (['"""C:\\\\Users\\\\Federico\\\\Documents\\\\GitHub\\\\pysical_locomotion"""'], {}), "('C:\\\\Users\\\\Federico\\\\Documents\\\\GitHub\\\\pysical_locomot... |
from json import dumps
from typing import Callable, Dict, Final, List
from uuid import uuid4
import sqlalchemy as sa
from databases.core import Database
from oaff.app.data.retrieval.feature_set_provider import FeatureSetProvider
from oaff.app.data.sources.postgresql.stac_hybrid.postgresql_layer import PostgresqlLayer... | [
"oaff.app.util.now_as_rfc3339",
"sqlalchemy.text",
"uuid.uuid4",
"oaff.app.responses.models.collection_items_html.CollectionItemsHtml",
"sqlalchemy.select"
] | [((600, 607), 'uuid.uuid4', 'uuid4', ([], {}), '()\n', (605, 607), False, 'from uuid import uuid4\n'), ((3608, 3926), 'oaff.app.responses.models.collection_items_html.CollectionItemsHtml', 'CollectionItemsHtml', ([], {'format_links': 'links', 'next_link': '(page_links[PageLinkRel.NEXT] if PageLinkRel.NEXT in page_links... |
from numpy import sum
from gwlfe.Memoization import memoize
def TotLAEU(NumAnimals, AvgAnimalWt):
result = 0
aeu3 = (NumAnimals[5] * AvgAnimalWt[5]) / 1000
aeu4 = (NumAnimals[4] * AvgAnimalWt[4]) / 1000
aeu5 = (NumAnimals[6] * AvgAnimalWt[6]) / 1000
aeu6 = (NumAnimals[0] * AvgAnimalWt[0]) / 1000
... | [
"numpy.sum"
] | [((498, 568), 'numpy.sum', 'sum', (['(NumAnimals[[0, 1, 4, 5, 6]] * AvgAnimalWt[[0, 1, 4, 5, 6]] / 1000)'], {}), '(NumAnimals[[0, 1, 4, 5, 6]] * AvgAnimalWt[[0, 1, 4, 5, 6]] / 1000)\n', (501, 568), False, 'from numpy import sum\n')] |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import json
import pprint
import sys
import tempfile
from importlib import import_module
from pydoc import locate
from typing import Dict, List, Optional, Union
import click
import torch
from pytext import create_predictor
f... | [
"pytext.workflow.train_model",
"torch.cuda.device_count",
"click.echo",
"torch.cuda.is_available",
"pytext.create_predictor",
"sys.exit",
"pprint.pprint",
"click.group",
"click.option",
"json.dumps",
"pydoc.locate",
"pytext.utils.documentation_helper.eprint",
"tempfile.NamedTemporaryFile",
... | [((4901, 4914), 'click.group', 'click.group', ([], {}), '()\n', (4912, 4914), False, 'import click\n'), ((4916, 4957), 'click.option', 'click.option', (['"""--config-file"""'], {'default': '""""""'}), "('--config-file', default='')\n", (4928, 4957), False, 'import click\n'), ((4959, 5000), 'click.option', 'click.option... |
import pickle
from datetime import timedelta
from django import forms
from django.core.exceptions import ValidationError
from django.db import (
connection,
models,
)
from django.test import override_settings
from gcloudc.db.models.fields.charfields import (
CharField,
CharOrNoneField,
)
from gcloudc.d... | [
"gcloudc.db.models.fields.charfields.CharField",
"gcloudc.db.models.fields.charfields.CharOrNoneField",
"gcloudc.db.models.fields.related.GenericRelationField",
"django.db.connection.settings_dict.get",
"gcloudc.db.models.fields.computed.ComputedPositiveIntegerField",
"gcloudc.db.models.fields.json.JSONFi... | [((3682, 3713), 'gcloudc.db.models.fields.charfields.CharOrNoneField', 'CharOrNoneField', ([], {'max_length': '(100)'}), '(max_length=100)\n', (3697, 3713), False, 'from gcloudc.db.models.fields.charfields import CharField, CharOrNoneField\n'), ((7237, 7269), 'django.db.models.CharField', 'models.CharField', ([], {'max... |
"""
Not actually tests, but benchmarks.
"""
from __future__ import print_function
from PyOpenWorm.neuron import Neuron
from PyOpenWorm.connection import Connection
from PyOpenWorm import connect, disconnect
def setup():
connect(configFile='tests/data_integrity_test.conf')
def teardown():
disconnect()
def ... | [
"PyOpenWorm.connect",
"PyOpenWorm.disconnect",
"PyOpenWorm.connection.Connection",
"PyOpenWorm.neuron.Neuron"
] | [((226, 278), 'PyOpenWorm.connect', 'connect', ([], {'configFile': '"""tests/data_integrity_test.conf"""'}), "(configFile='tests/data_integrity_test.conf')\n", (233, 278), False, 'from PyOpenWorm import connect, disconnect\n'), ((301, 313), 'PyOpenWorm.disconnect', 'disconnect', ([], {}), '()\n', (311, 313), False, 'fr... |
from django import forms
from Apis.canino.models import Perro
class PerroForm(forms.ModelForm):
# TODO: Define other fields here
class Meta:
model = Perro
fields = [
'nombre',
'sexo',
'raza',
'edad',
'rescate',
'adoptante',
'vacuna',
... | [
"django.forms.CheckboxSelectMultiple",
"django.forms.Select",
"django.forms.TextInput"
] | [((601, 649), 'django.forms.TextInput', 'forms.TextInput', ([], {'attrs': "{'class': 'form-control'}"}), "(attrs={'class': 'form-control'})\n", (616, 649), False, 'from django import forms\n'), ((665, 710), 'django.forms.Select', 'forms.Select', ([], {'attrs': "{'class': 'form-control'}"}), "(attrs={'class': 'form-cont... |
# coding: utf-8
"""
Antenny API
This is an api that allows you to interact with the Antenny platform. It allows you to manage your clients and subscriptions. # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: <EMAIL>
Generated by: https://openapi-generator.tech
"""
from __future_... | [
"unittest.main",
"antenny.api.events_api.EventsApi"
] | [((873, 888), 'unittest.main', 'unittest.main', ([], {}), '()\n', (886, 888), False, 'import unittest\n'), ((594, 628), 'antenny.api.events_api.EventsApi', 'antenny.api.events_api.EventsApi', ([], {}), '()\n', (626, 628), False, 'import antenny\n')] |
# built-in
from pathlib import Path
# external
from flake8.formatting.base import BaseFormatter
# app
from .._logic import make_baseline
class BaseLineFormatter(BaseFormatter):
def format(self, error):
filename = error.filename
return make_baseline(
path=Path(filename),
c... | [
"pathlib.Path"
] | [((291, 305), 'pathlib.Path', 'Path', (['filename'], {}), '(filename)\n', (295, 305), False, 'from pathlib import Path\n')] |
import time
import os
from h264 import *
# Example usage of the library
if __name__ == '__main__':
Gst.init(None)
# ===========Recording and encoding 5 seconds of footage from the webcam===========
encoder = H264_Encoder()
pipeline = Gst.Pipeline.new(None)
# v4l2src ! image/jpeg,width=1280,hei... | [
"os.path.isdir",
"os.mkdir",
"time.sleep"
] | [((1972, 1985), 'time.sleep', 'time.sleep', (['(5)'], {}), '(5)\n', (1982, 1985), False, 'import time\n'), ((2403, 2423), 'os.path.isdir', 'os.path.isdir', (['"""cam"""'], {}), "('cam')\n", (2416, 2423), False, 'import os\n'), ((2433, 2448), 'os.mkdir', 'os.mkdir', (['"""cam"""'], {}), "('cam')\n", (2441, 2448), False,... |