code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import json
import logging
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.models import User
from django.forms.forms import NON_FIELD_ERRORS
from django.forms.util import ErrorList
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect, ... | [
"django_prbac.models.Grant.objects.filter",
"corehq.apps.accounting.forms.TriggerBookkeeperEmailForm",
"corehq.apps.accounting.models.Invoice.objects.get",
"django_prbac.decorators.requires_privilege_raise404",
"django.core.urlresolvers.reverse",
"corehq.apps.accounting.models.CreditLine.objects.filter",
... | [((2411, 2442), 'logging.getLogger', 'logging.getLogger', (['"""accounting"""'], {}), "('accounting')\n", (2428, 2442), False, 'import logging\n'), ((2446, 2502), 'django_prbac.decorators.requires_privilege_raise404', 'requires_privilege_raise404', (['privileges.ACCOUNTING_ADMIN'], {}), '(privileges.ACCOUNTING_ADMIN)\n... |
# -*- coding: utf-8 -*-
"""This file contains an Outlook search MRU Registry parser."""
from __future__ import unicode_literals
from plaso.containers import events
from plaso.containers import time_events
from plaso.lib import definitions
from plaso.parsers import winreg
from plaso.parsers.winreg_plugins import inter... | [
"plaso.containers.time_events.DateTimeValuesEvent",
"plaso.parsers.winreg_plugins.interface.WindowsRegistryKeyPathFilter",
"plaso.parsers.winreg.WinRegistryParser.RegisterPlugin"
] | [((3366, 3429), 'plaso.parsers.winreg.WinRegistryParser.RegisterPlugin', 'winreg.WinRegistryParser.RegisterPlugin', (['OutlookSearchMRUPlugin'], {}), '(OutlookSearchMRUPlugin)\n', (3405, 3429), False, 'from plaso.parsers import winreg\n'), ((3188, 3294), 'plaso.containers.time_events.DateTimeValuesEvent', 'time_events.... |
#get spectral coefficients for omega
#script for plotting stuff directly from hard disk and not to be used with the bash script
import os
import sys
import glob
import time
import pathlib
import logging
import numpy as np
from mpi4py import MPI
comm = MPI.COMM_WORLD
from scipy.sparse import linalg as spla
from dedalus... | [
"numpy.abs",
"matplotlib.pyplot.axes",
"numpy.angle",
"simple_sphere.SimpleSphere",
"matplotlib.pyplot.figure",
"numpy.mean",
"numpy.arange",
"os.path.join",
"numpy.meshgrid",
"matplotlib.patches.Rectangle",
"os.path.exists",
"matplotlib.pyplot.colorbar",
"numpy.max",
"matplotlib.pyplot.rc... | [((449, 470), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (463, 470), False, 'import matplotlib\n'), ((638, 665), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (655, 665), False, 'import logging\n'), ((1218, 1245), 'matplotlib.pyplot.rc', 'plt.rc', (['"""text"""... |
# -*- coding: utf-8 -*-
import unittest
import numpy as np
from datetime import date
from funcat import FOURWEEK, FOURWEEKQTY
from funcat.api import T, S, set_current_freq, symbol, \
CLOSE
from funcat.utils import FuncatTestCase
class TestTurtle(FuncatTestCase):
@classmethod
def setUp(cls) -> None:
... | [
"funcat.api.S",
"funcat.api.T",
"funcat.api.symbol",
"funcat.FOURWEEKQTY",
"funcat.FOURWEEK",
"funcat.api.set_current_freq",
"funcat.FOURWEEKQTY.__self__.default_quantity"
] | [((321, 334), 'funcat.api.T', 'T', (['"""20210506"""'], {}), "('20210506')\n", (322, 334), False, 'from funcat.api import T, S, set_current_freq, symbol, CLOSE\n'), ((343, 359), 'funcat.api.S', 'S', (['"""000001.XSHG"""'], {}), "('000001.XSHG')\n", (344, 359), False, 'from funcat.api import T, S, set_current_freq, symb... |
import signal
class McmderError(Exception):
"""Parent of Errors in this module."""
pass
class McmdError(McmderError):
"""Raised when run() is called with check=True and the process.
returns a non-zero exit status.
Attributes:
cmd, returncode, stderr, output
"""
def __init__(self,... | [
"signal.Signals"
] | [((667, 699), 'signal.Signals', 'signal.Signals', (['(-self.returncode)'], {}), '(-self.returncode)\n', (681, 699), False, 'import signal\n')] |
import random
import pprint
import logging
import config
logger = logging.getLogger('root')
class AbstractStrategy():
def prepare(self, relax_operators, search_operators):
"""
prepares the strategy by providing the (non-empty) lists of relax and search operators.
needs to be called befo... | [
"random.random",
"random.choice",
"logging.getLogger"
] | [((69, 94), 'logging.getLogger', 'logging.getLogger', (['"""root"""'], {}), "('root')\n", (86, 94), False, 'import logging\n'), ((2519, 2555), 'random.choice', 'random.choice', (['self._relax_operators'], {}), '(self._relax_operators)\n', (2532, 2555), False, 'import random\n'), ((2582, 2619), 'random.choice', 'random.... |
# -*- coding: utf-8 -*-
import sys,os
import re
import scrapy
import logging
import urllib.parse
from scrapybot.items.freelancer import *
from scrapybot.spiders import *
from scrapybot.util import *
from scrapy.utils.misc import load_object
logger = logging.getLogger(__name__)
class FreelancerSpider(ArgsSupport, s... | [
"re.search",
"logging.getLogger"
] | [((252, 279), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (269, 279), False, 'import logging\n'), ((667, 722), 're.search', 're.search', (['"""https?://(.*).freelancer.com/jobs/.*$"""', 'url'], {}), "('https?://(.*).freelancer.com/jobs/.*$', url)\n", (676, 722), False, 'import re\n')] |
from django.contrib.auth.models import AbstractUser
from django.db import models
from dicom_models.staging.models import RadiologyStudy
from prioritizers import registry as prioritizers
from solo.models import SingletonModel
class StudyList(models.Model):
name = models.CharField(max_length=100, blank=True, null=Tr... | [
"django.db.models.CharField",
"django.db.models.ManyToManyField",
"django.db.models.ForeignKey"
] | [((268, 323), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)', 'blank': '(True)', 'null': '(True)'}), '(max_length=100, blank=True, null=True)\n', (284, 323), False, 'from django.db import models\n'), ((338, 376), 'django.db.models.ManyToManyField', 'models.ManyToManyField', (['RadiologySt... |
# -*- coding: utf-8 -*-
from datetime import datetime
from .media import _media_upload
from .type import RequestType
def complaint_list_query(self, begin_date=None, end_date=None, limit=10, offset=0, complainted_mchid=None):
"""查询投诉单列表
:param begin_date: 开始日期,投诉发生的开始日期,格式为YYYY-MM-DD。注意,查询日期跨度不超过30天,当前查询为实时查... | [
"datetime.datetime.now"
] | [((705, 719), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (717, 719), False, 'from datetime import datetime\n')] |
import logging
from abc import ABC, abstractmethod
logger = logging.getLogger(__name__)
class PaddownException(Exception):
pass
class Paddown(ABC):
@abstractmethod
def has_valid_padding(self, ciphertext: bytes) -> bool:
"""
Override this method and send off the ciphertext to check for v... | [
"logging.getLogger"
] | [((61, 88), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (78, 88), False, 'import logging\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 25 13:53:31 2018
@author: alechat
"""
import os, sys
if os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))) not in sys.path:
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))))... | [
"keras.models.load_model",
"keras.utils.io_utils.H5Dict",
"numpy.load",
"numpy.ones",
"keras.utils.generic_utils.get_custom_objects",
"numpy.shape",
"os.path.isfile",
"numpy.arange",
"shape_constraint.cadmos_lib.shear_norm",
"keras.layers.Input",
"numpy.round",
"AlphaTransform.AlphaShearletTra... | [((4534, 4552), 'numpy.array', 'np.array', (['[96, 96]'], {}), '([96, 96])\n', (4542, 4552), True, 'import numpy as np\n'), ((4556, 4578), 'shape_constraint.cadmos_lib.makeUi', 'cl.makeUi', (['row', 'column'], {}), '(row, column)\n', (4565, 4578), True, 'import shape_constraint.cadmos_lib as cl\n'), ((4658, 4726), 'Alp... |
import sqlite3
from sqlite3 import Error
def dict_factory(cursor, row):
d = {}
for idx, col in enumerate(cursor.description):
d[col[0]] = row[idx]
return d
class SqliteHelper:
def __init__(self, file):
self.__file = file
self.__conn = None
def connect(self):
tr... | [
"sqlite3.connect"
] | [((349, 377), 'sqlite3.connect', 'sqlite3.connect', (['self.__file'], {}), '(self.__file)\n', (364, 377), False, 'import sqlite3\n')] |
import torch
import torch.nn.utils.prune as prune
import numpy as np
from copy import deepcopy
import sys
sys.path.append('../src')
from train import train
from evaluate import test
class PruneModel:
def __init__(self, network, batch_size, train_loader, val_loader, test_loader, optimizer, epochs, scheduler, devi... | [
"sys.path.append",
"copy.deepcopy",
"torch.zeros_like",
"evaluate.test",
"torch.abs",
"train.train",
"torch.sum"
] | [((107, 132), 'sys.path.append', 'sys.path.append', (['"""../src"""'], {}), "('../src')\n", (122, 132), False, 'import sys\n'), ((644, 661), 'copy.deepcopy', 'deepcopy', (['network'], {}), '(network)\n', (652, 661), False, 'from copy import deepcopy\n'), ((5405, 5436), 'copy.deepcopy', 'deepcopy', (['self.original_netw... |
#File Read Write Functions
#Python v3.7.1
#Date: 12/09/18
#Importing the operating system for file handling functions
import os
#Checks to see if a file exists
def fileExists(filePath):
return os.path.exists(filePath)
#Reads from a specified file
def readFile(filePath):
data = ''
if not fileExists(filePa... | [
"os.path.exists"
] | [((199, 223), 'os.path.exists', 'os.path.exists', (['filePath'], {}), '(filePath)\n', (213, 223), False, 'import os\n')] |
"""
Models for test execution (runs, results).
"""
import datetime
from django.core.exceptions import ValidationError, ObjectDoesNotExist
from django.db import connection, transaction, models
from django.db.models import Q, Count, Max
from model_utils import Choices
from ..mtmodel import MTModel, TeamModel, DraftSt... | [
"django.db.models.Max",
"django.db.models.TextField",
"django.db.models.URLField",
"django.db.models.ManyToManyField",
"django.core.exceptions.ValidationError",
"django.db.models.ForeignKey",
"django.db.models.CharField",
"django.db.models.Q",
"django.db.models.BooleanField",
"django.db.connection... | [((643, 697), 'django.db.models.ForeignKey', 'models.ForeignKey', (['ProductVersion'], {'related_name': '"""runs"""'}), "(ProductVersion, related_name='runs')\n", (660, 697), False, 'from django.db import connection, transaction, models\n'), ((709, 741), 'django.db.models.CharField', 'models.CharField', ([], {'max_leng... |
# Generated by Django 3.1.3 on 2022-04-04 10:33
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('onlinecourse', '0007_auto_20220216_1913'),
]
operations = [
migrations.RemoveField(
model_name='instructor',
name='total_lea... | [
"django.db.migrations.RemoveField"
] | [((232, 302), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""instructor"""', 'name': '"""total_learners"""'}), "(model_name='instructor', name='total_learners')\n", (254, 302), False, 'from django.db import migrations\n')] |
"""Verifies the 'common.py' module"""
from argparse import Namespace
import pkg_resources
from nose.tools import eq_, ok_, raises
from pronto import Term
from termlink.common import _to_coding, _to_equivalence_from_scope, _to_relationship, execute
from termlink.models import Coding, Relationship
@raises(ValueErr... | [
"argparse.Namespace",
"termlink.common._to_relationship",
"termlink.models.Coding",
"termlink.common._to_equivalence_from_scope",
"pkg_resources.resource_filename",
"nose.tools.eq_",
"pronto.Term",
"nose.tools.raises",
"termlink.common._to_coding"
] | [((305, 323), 'nose.tools.raises', 'raises', (['ValueError'], {}), '(ValueError)\n', (311, 323), False, 'from nose.tools import eq_, ok_, raises\n'), ((3176, 3196), 'nose.tools.raises', 'raises', (['RuntimeError'], {}), '(RuntimeError)\n', (3182, 3196), False, 'from nose.tools import eq_, ok_, raises\n'), ((526, 593), ... |
from conans import ConanFile, CMake, tools
class SimperiumcConan(ConanFile):
name = "simperium-c"
version = "0.1.0"
license = "MIT"
url = "https://github.com/franc0is/simperium-c"
description = "A C library to integrate Simperium's service"
settings = "os", "compiler", "build_type", "arch"
... | [
"conans.CMake"
] | [((967, 978), 'conans.CMake', 'CMake', (['self'], {}), '(self)\n', (972, 978), False, 'from conans import ConanFile, CMake, tools\n')] |
from datetime import datetime, timedelta, tzinfo
import socket
from django.conf import settings
from django.db import models
from django.utils.translation import gettext_lazy as _
try:
import pytz
except ImportError:
pytz = None
ZERO = timedelta(0)
class UTC(tzinfo):
"""
UTC implementation taken fr... | [
"django.db.models.TextField",
"django.utils.translation.gettext_lazy",
"django.conf.settings.ROOT_URLCONF.split",
"datetime.datetime.utcnow",
"datetime.timedelta",
"django.db.models.DateTimeField",
"datetime.datetime.now"
] | [((247, 259), 'datetime.timedelta', 'timedelta', (['(0)'], {}), '(0)\n', (256, 259), False, 'from datetime import datetime, timedelta, tzinfo\n'), ((1217, 1265), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'db_index': '(True)', 'default': 'now'}), '(db_index=True, default=now)\n', (1237, 1265), Fals... |
# Copyright 2016 ASLP@NPU. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | [
"tensorflow.gfile.Exists",
"tensorflow.logging.fatal",
"os.path.dirname",
"os.path.join",
"sys.exit",
"io_funcs.tfrecords_io.get_padded_batch"
] | [((835, 863), 'os.path.dirname', 'os.path.dirname', (['sys.path[0]'], {}), '(sys.path[0])\n', (850, 863), False, 'import os\n'), ((3046, 3091), 'os.path.join', 'os.path.join', (['self._config_dir', "(name + '.lst')"], {}), "(self._config_dir, name + '.lst')\n", (3058, 3091), False, 'import os\n'), ((2137, 2385), 'io_fu... |
from pyvista import examples
grid = examples.load_explicit_structured() # doctest:+SKIP
grid.compute_connections() # doctest:+SKIP
grid.plot(show_edges=True) # doctest:+SKIP
| [
"pyvista.examples.load_explicit_structured"
] | [((36, 71), 'pyvista.examples.load_explicit_structured', 'examples.load_explicit_structured', ([], {}), '()\n', (69, 71), False, 'from pyvista import examples\n')] |
#
# Copyright 2015 Cisco Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | [
"mock.patch.object",
"uuid.uuid4",
"datetime.datetime.utcnow",
"mock.Mock",
"mock.MagicMock",
"oslo_utils.netutils.urlsplit"
] | [((3113, 3167), 'mock.patch.object', 'mock.patch.object', (['KafkaBrokerPublisher', '"""_get_client"""'], {}), "(KafkaBrokerPublisher, '_get_client')\n", (3130, 3167), False, 'import mock\n'), ((3636, 3690), 'mock.patch.object', 'mock.patch.object', (['KafkaBrokerPublisher', '"""_get_client"""'], {}), "(KafkaBrokerPubl... |
# proc: Simple interface to Linux process information.
#
# Author: <NAME> <<EMAIL>>
# Last Change: June 1, 2016
# URL: https://proc.readthedocs.io
"""
The :mod:`proc.unix` module manipulates UNIX processes using signals.
This module contains no Linux-specific details, instead it relies only on
process IDs and common ... | [
"os.kill",
"logging.getLogger"
] | [((1029, 1056), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1046, 1056), False, 'import logging\n'), ((3463, 3483), 'os.kill', 'os.kill', (['self.pid', '(0)'], {}), '(self.pid, 0)\n', (3470, 3483), False, 'import os\n'), ((4838, 4871), 'os.kill', 'os.kill', (['self.pid', 'signal.SIGTE... |
import os
import pytest
from scrapy.settings import Settings
@pytest.fixture()
def settings(request):
""" Default scrapy-prerender settings """
s = dict(
# collect scraped items to .collected_items attribute
ITEM_PIPELINES={
'tests.utils.CollectorPipeline': 100,
},
... | [
"os.environ.get",
"scrapy.settings.Settings",
"pytest.fixture"
] | [((65, 81), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (79, 81), False, 'import pytest\n'), ((991, 1002), 'scrapy.settings.Settings', 'Settings', (['s'], {}), '(s)\n', (999, 1002), False, 'from scrapy.settings import Settings\n'), ((372, 403), 'os.environ.get', 'os.environ.get', (['"""PRERENDER_URL"""'], {})... |
# coding=utf-8
# Author: <NAME>
# Date: Sept 11, 2019
#
# Description: Dispalys Statistics about the calculated pipelines.
#
#
import math
import numpy as np
import pandas as pd
pd.set_option('display.max_rows', 100)
pd.set_option('display.max_columns', 500)
pd.set_option('display.width', 1000)
pd.set_option('display.p... | [
"tabulate.tabulate",
"pandas.set_option",
"pandas.DataFrame.from_records"
] | [((178, 216), 'pandas.set_option', 'pd.set_option', (['"""display.max_rows"""', '(100)'], {}), "('display.max_rows', 100)\n", (191, 216), True, 'import pandas as pd\n'), ((217, 258), 'pandas.set_option', 'pd.set_option', (['"""display.max_columns"""', '(500)'], {}), "('display.max_columns', 500)\n", (230, 258), True, '... |
from enum import unique, Enum
from random import shuffle, choice, uniform
from insomniac.actions_types import LikeAction, FollowAction, GetProfileAction, StoryWatchAction, CommentAction
from insomniac.device_facade import DeviceFacade
from insomniac.navigation import switch_to_english, search_for, LanguageChangedExcep... | [
"insomniac.softban_indicator.softban_indicator.detect_action_blocked_dialog",
"insomniac.views.ProfileView",
"random.shuffle",
"insomniac.softban_indicator.softban_indicator.detect_empty_profile",
"insomniac.views.LikersListView",
"insomniac.views.OpenedPostView",
"insomniac.navigation.LanguageChangedEx... | [((4232, 4251), 'insomniac.scroll_end_detector.ScrollEndDetector', 'ScrollEndDetector', ([], {}), '()\n', (4249, 4251), False, 'from insomniac.scroll_end_detector import ScrollEndDetector\n'), ((16993, 17015), 'insomniac.sleeper.sleeper.random_sleep', 'sleeper.random_sleep', ([], {}), '()\n', (17013, 17015), False, 'fr... |
import spacy
nlp = spacy.load("zh_core_web_sm")
text = (
"在300多年的风雨历程中,历代同仁堂人始终恪守“炮制虽繁必不敢省人工,品味虽贵必不敢减物力”的古训,"
"树立“修合无人见,存心有天知”的自律意识,造就了制药过程中兢兢小心、精益求精的严细精神。"
)
# 关闭tagger和parser
with nlp.disable_pipes("tagger", "parser"):
# 处理文本
doc = nlp(text)
# 打印doc中的实体
print(doc.ents)
| [
"spacy.load"
] | [((20, 48), 'spacy.load', 'spacy.load', (['"""zh_core_web_sm"""'], {}), "('zh_core_web_sm')\n", (30, 48), False, 'import spacy\n')] |
# SPDX-FileCopyrightText: 2009 Fermi Research Alliance, LLC
# SPDX-License-Identifier: Apache-2.0
#
# Project:
# glideinWMS
#
# File Version:
#
# Description:
# This module contains the generic params classes
#
# Extracted from:
# cgWParams.py
#
# Author:
# <NAME>
#
import copy
import os
import os.path
import... | [
"copy.deepcopy",
"os.path.abspath",
"os.unlink",
"glideinwms.lib.xmlParse.UserDict.__init__",
"os.stat",
"os.rename",
"glideinwms.lib.xmlParse.xmlfile2dict",
"glideinwms.lib.xmlParse.OrderedDict",
"os.path.join"
] | [((8169, 8182), 'glideinwms.lib.xmlParse.OrderedDict', 'OrderedDict', ([], {}), '()\n', (8180, 8182), False, 'from glideinwms.lib.xmlParse import OrderedDict\n'), ((13167, 13193), 'os.rename', 'os.rename', (['tmp_name', 'fname'], {}), '(tmp_name, fname)\n', (13176, 13193), False, 'import os\n'), ((13849, 13889), 'glide... |
import torch
import numpy as np
from torch.utils.data import Dataset
class DomainAdaptationMoonDataset(Dataset):
r"""Domain adaptation version of the moon dataset object to iterate and collect samples.
"""
def __init__(self, data):
self.xs, self.ys, self.xt, self.yt = data
def __len__(self):
... | [
"numpy.load",
"numpy.array"
] | [((944, 993), 'numpy.load', 'np.load', (['config.dataloader.MoonsNS.source_train_x'], {}), '(config.dataloader.MoonsNS.source_train_x)\n', (951, 993), True, 'import numpy as np\n'), ((1093, 1142), 'numpy.load', 'np.load', (['config.dataloader.MoonsNS.target_train_x'], {}), '(config.dataloader.MoonsNS.target_train_x)\n'... |
"""
@created by: heyao
@created at: 2021-12-09 13:30:09
"""
import random
import os
import numpy as np
import torch
def seed_everything(seed=42):
random.seed(seed)
os.environ['PYTHONASSEED'] = str(seed)
np.random.seed(seed)
torch.manual_seed(seed)
if torch.cuda.is_available():
torch.cuda.... | [
"numpy.random.seed",
"torch.manual_seed",
"torch.cuda.manual_seed",
"torch.cuda.is_available",
"random.seed"
] | [((153, 170), 'random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (164, 170), False, 'import random\n'), ((218, 238), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (232, 238), True, 'import numpy as np\n'), ((243, 266), 'torch.manual_seed', 'torch.manual_seed', (['seed'], {}), '(seed)\n', (26... |
#!/usr/bin/env python
# Copyright 2018 Intel Corporation
#
# 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 ... | [
"tempfile.NamedTemporaryFile",
"pdo.contract.Contract",
"random.choice",
"pdo.contract.register_contract",
"pdo.contract.add_enclave_to_contract",
"pdo.contract.ContractState.create_new_state",
"pdo.common.crypto.string_to_byte_array",
"logging.getLogger"
] | [((1254, 1281), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1271, 1281), False, 'import logging\n'), ((3510, 3539), 'random.choice', 'random.choice', (['enclaveclients'], {}), '(enclaveclients)\n', (3523, 3539), False, 'import random\n'), ((2872, 3052), 'pdo.contract.add_enclave_to_co... |
from taurex.log import Logger
import numpy as np
class Output(Logger):
def __init__(self, name):
super().__init__(name)
def open(self):
raise NotImplementedError
def create_group(self, group_name):
raise NotImplementedError
def close(self):
raise NotImplementedError... | [
"taurex.util.util.recursively_save_dict_contents_to_output",
"numpy.array"
] | [((702, 759), 'taurex.util.util.recursively_save_dict_contents_to_output', 'recursively_save_dict_contents_to_output', (['out', 'dictionary'], {}), '(out, dictionary)\n', (742, 759), False, 'from taurex.util.util import recursively_save_dict_contents_to_output\n'), ((1052, 1072), 'numpy.array', 'np.array', (['list_arra... |
# $Id: TestMetadataMerging.py 1047 2009-01-15 14:48:58Z bhavana $
#
# Unit testing for WebBrick library functions (Functions.py)
# See http://pyunit.sourceforge.net/pyunit.html
#
import sys, unittest, logging, re, StringIO, os, cgi, rdflib
from rdflib import URIRef, Namespace, RDF
from os.path import normpath
sys.path... | [
"sys.path.append",
"MiscLib.TestUtils.runTests",
"TestConfig.setDatasetsBaseDir",
"ManifestRDFUtils.compareRDFGraphs",
"ManifestRDFUtils.getDictionaryFromManifest",
"rdflib.URIRef",
"ManifestRDFUtils.updateManifestFile",
"ManifestRDFUtils.writeToManifestFile",
"ManifestRDFUtils.getElementValuesFromM... | [((312, 333), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (327, 333), False, 'import sys, unittest, logging, re, StringIO, os, cgi, rdflib\n'), ((334, 363), 'sys.path.append', 'sys.path.append', (['"""../cgi-bin"""'], {}), "('../cgi-bin')\n", (349, 363), False, 'import sys, unittest, logging, ... |
# Generated by Django 3.2 on 2021-04-25 13:36
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("jobs", "0002_auto_20210425_1615"),
]
operations = [
migrations.AddField(
model_name="listing",
name="cur... | [
"django.db.models.CharField"
] | [((347, 390), 'django.db.models.CharField', 'models.CharField', ([], {'default': '"""$"""', 'max_length': '(5)'}), "(default='$', max_length=5)\n", (363, 390), False, 'from django.db import migrations, models\n')] |
from rlcard.utils.utils import init_standard_deck
class LimitholdemDealer(object):
def __init__(self, np_random):
''' Initialize a limitholdem dealer class
'''
self.np_random = np_random
self.deck = init_standard_deck()
self.shuffle()
self.pot = 0
def shuffle(s... | [
"rlcard.utils.utils.init_standard_deck"
] | [((237, 257), 'rlcard.utils.utils.init_standard_deck', 'init_standard_deck', ([], {}), '()\n', (255, 257), False, 'from rlcard.utils.utils import init_standard_deck\n')] |
"""
This library contains metrics to quantify the shape of a waveform
1. threshold_amplitude - only look at a metric while oscillatory amplitude is above a set percentile threshold
2. rdratio - Ratio of rise time and decay time
3. pt_duration - Peak and trough durations and their ratio
3. symPT - symmetry between peak ... | [
"numpy.sum",
"numpy.abs",
"numpy.random.randint",
"numpy.arange",
"numpy.mean",
"numpy.copy",
"numpy.std",
"numpy.max",
"numpy.log10",
"analysis_helpers.misshapen.nonshape.ampT",
"numpy.flipud",
"numpy.percentile",
"analysis_helpers.misshapen.nonshape.findpt",
"numpy.min",
"numpy.vstack"... | [((2175, 2265), 'analysis_helpers.misshapen.nonshape.ampT', 'ampT', (['x', 'frange', 'Fs'], {'rmv_edge': '(False)', 'filter_fn': 'filter_fn', 'filter_kwargs': 'filter_kwargs'}), '(x, frange, Fs, rmv_edge=False, filter_fn=filter_fn, filter_kwargs=\n filter_kwargs)\n', (2179, 2265), False, 'from analysis_helpers.missh... |
import glob
import shutil
import os
from pdf2image import convert_from_path, convert_from_bytes
# main entry
def run_help():
print("Hello !")
pass
def run_compress():
print("Hello !")
pass
def run_folder_pdfs_2_cbz(dir_name):
full_name = dir_name + "/" + "*.pdf"
full_list = glob.glob(full_... | [
"os.mkdir",
"pdf2image.convert_from_path",
"shutil.make_archive",
"os.path.basename",
"os.path.dirname",
"os.path.splitext",
"shutil.move",
"glob.glob",
"shutil.rmtree"
] | [((305, 325), 'glob.glob', 'glob.glob', (['full_name'], {}), '(full_name)\n', (314, 325), False, 'import glob\n'), ((478, 505), 'os.path.basename', 'os.path.basename', (['full_name'], {}), '(full_name)\n', (494, 505), False, 'import os\n'), ((522, 549), 'os.path.splitext', 'os.path.splitext', (['full_name'], {}), '(ful... |
# Author: <NAME>
import csv
import json
with open("all_groups.json", "r", encoding="utf-8") as f:
groups = json.load(f)
with open("all_groups.csv", "w", newline="", encoding="utf8") as csvfile:
csvwriter = csv.writer(csvfile, delimiter=';', quotechar='"', quoting=csv.QUOTE_MINIMAL)
csvwriter.writerow(("N... | [
"json.load",
"csv.writer"
] | [((113, 125), 'json.load', 'json.load', (['f'], {}), '(f)\n', (122, 125), False, 'import json\n'), ((217, 293), 'csv.writer', 'csv.writer', (['csvfile'], {'delimiter': '""";"""', 'quotechar': '"""\\""""', 'quoting': 'csv.QUOTE_MINIMAL'}), '(csvfile, delimiter=\';\', quotechar=\'"\', quoting=csv.QUOTE_MINIMAL)\n', (227,... |
# Copyright 2016 Intel Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | [
"ironic.db.sqlalchemy.models.Base.__subclasses__",
"ironic.objects.base.IronicObjectRegistry.obj_classes",
"ironic.common.release_mappings.get_object_versions",
"mock.patch.dict",
"oslo_utils.versionutils.convert_version_to_tuple",
"ironic.common.release_mappings.RELEASE_MAPPING.values"
] | [((1395, 1446), 'oslo_utils.versionutils.convert_version_to_tuple', 'versionutils.convert_version_to_tuple', (['conf_version'], {}), '(conf_version)\n', (1432, 1446), False, 'from oslo_utils import versionutils\n'), ((1464, 1517), 'oslo_utils.versionutils.convert_version_to_tuple', 'versionutils.convert_version_to_tupl... |
"""
This file is for the methods concerning everything naive bayes
TODO:
1. convert nominal values to numbers DONE!
2. 2/3 of the data is training data, rest is test DONE from previous!
3. k is specified at runtime ? DONE searching the nearest neighbors
4. majority vote between neighbors DONE
5. reverse trasform from ... | [
"operator.itemgetter"
] | [((2475, 2488), 'operator.itemgetter', 'itemgetter', (['(1)'], {}), '(1)\n', (2485, 2488), False, 'from operator import itemgetter\n'), ((3142, 3155), 'operator.itemgetter', 'itemgetter', (['(1)'], {}), '(1)\n', (3152, 3155), False, 'from operator import itemgetter\n')] |
from .id_converter import IDConverter
from .errors import EmojiNotFound
from nextcord import Emoji
from nextcord.ext.abc import ContextBase
import re
import nextcord
class EmojiConverter(IDConverter[Emoji]):
"""Converts to a :class:`~Emoji`.
All lookups are done for the local guild first, if available. If th... | [
"re.match",
"nextcord.utils.get"
] | [((758, 821), 're.match', 're.match', (['"""<a?:[a-zA-Z0-9\\\\_]{1,32}:([0-9]{15,20})>$"""', 'argument'], {}), "('<a?:[a-zA-Z0-9\\\\_]{1,32}:([0-9]{15,20})>$', argument)\n", (766, 821), False, 'import re\n'), ((1033, 1080), 'nextcord.utils.get', 'nextcord.utils.get', (['guild.emojis'], {'name': 'argument'}), '(guild.em... |
import gc
import os
from glob import glob
import numpy as np
from PIL import Image
import pickle
from tqdm import tqdm_notebook, tqdm
from models.network import U_Net, R2U_Net, AttU_Net, R2AttU_Net
from models.linknet import LinkNet34
from models.deeplabv3.deeplabv3plus import DeepLabV3Plus
from backboned_unet import U... | [
"matplotlib.pyplot.title",
"numpy.sum",
"matplotlib.pyplot.suptitle",
"pickle.load",
"torchvision.transforms.Normalize",
"torch.no_grad",
"segmentation_models_pytorch.Unet",
"matplotlib.pyplot.imshow",
"torch.load",
"models.deeplabv3.deeplabv3plus.DeepLabV3Plus",
"models.Transpose_unet.unet.mode... | [((12300, 12357), 'sklearn.model_selection.StratifiedKFold', 'StratifiedKFold', ([], {'n_splits': '(5)', 'shuffle': '(True)', 'random_state': '(1)'}), '(n_splits=5, shuffle=True, random_state=1)\n', (12315, 12357), False, 'from sklearn.model_selection import KFold, StratifiedKFold\n'), ((6888, 6922), 'torchvision.trans... |
#!/usr/bin/env python
#
# Copyright (c) 2020 Intel Corporation
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
#
"""
a sensor that reports the state of all traffic lights
"""
import rospy
from carla_msgs.msg import CarlaTrafficLightStatusList,\
... | [
"carla_msgs.msg.CarlaTrafficLightInfoList",
"carla_msgs.msg.CarlaTrafficLightStatusList"
] | [((1440, 1469), 'carla_msgs.msg.CarlaTrafficLightStatusList', 'CarlaTrafficLightStatusList', ([], {}), '()\n', (1467, 1469), False, 'from carla_msgs.msg import CarlaTrafficLightStatusList, CarlaTrafficLightInfoList\n'), ((2448, 2477), 'carla_msgs.msg.CarlaTrafficLightStatusList', 'CarlaTrafficLightStatusList', ([], {})... |
from adminsortable2.admin import SortableAdminMixin
from django.contrib import admin
from psalter.models import PsalmTopic
class PsalmTopicAdmin(SortableAdminMixin, admin.ModelAdmin):
list_display = ("topic_name", "psalms")
fields = ("topic_name", "psalms")
admin.site.register(PsalmTopic, PsalmTopicAdmin)
| [
"django.contrib.admin.site.register"
] | [((271, 319), 'django.contrib.admin.site.register', 'admin.site.register', (['PsalmTopic', 'PsalmTopicAdmin'], {}), '(PsalmTopic, PsalmTopicAdmin)\n', (290, 319), False, 'from django.contrib import admin\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import unittest
import warnings
import pytest
from nose.plugins.attrib import attr
from six import StringIO
from conans.client import tools
from conans.client.output import ConanOutput
from conans.client.tools.oss import cpu_count
from conans.client.tools.win i... | [
"conans.util.files.load",
"warnings.simplefilter",
"conans.test.utils.mocks.MockSettings",
"conans.client.tools.environment_append",
"os.path.exists",
"six.StringIO",
"conans.util.files.save",
"conans.test.utils.test_files.temp_folder",
"warnings.catch_warnings",
"nose.plugins.attrib.attr",
"con... | [((574, 595), 'nose.plugins.attrib.attr', 'attr', (['"""visual_studio"""'], {}), "('visual_studio')\n", (578, 595), False, 'from nose.plugins.attrib import attr\n'), ((1017, 1030), 'conans.test.utils.test_files.temp_folder', 'temp_folder', ([], {}), '()\n', (1028, 1030), False, 'from conans.test.utils.test_files import... |
from dataclasses import dataclass
import functions as fx
import glow.gwas.log_reg as lr
import glow.gwas.approx_firth as af
import pandas as pd
from nptyping import Float, NDArray
import numpy as np
import pytest
from typing import Any
@dataclass
class TestData:
phenotypes: NDArray[(Any, ), Float]
covariates:... | [
"numpy.allclose",
"numpy.zeros",
"numpy.isnan",
"functions.compare_to_regenie",
"glow.gwas.approx_firth._fit_firth",
"pandas.read_table",
"glow.gwas.log_reg.logistic_regression",
"pytest.mark.min_spark",
"functions.get_input_dfs"
] | [((4970, 4996), 'pytest.mark.min_spark', 'pytest.mark.min_spark', (['"""3"""'], {}), "('3')\n", (4991, 4996), False, 'import pytest\n'), ((5345, 5371), 'pytest.mark.min_spark', 'pytest.mark.min_spark', (['"""3"""'], {}), "('3')\n", (5366, 5371), False, 'import pytest\n'), ((5725, 5751), 'pytest.mark.min_spark', 'pytest... |
"""Support for the SmartWeather weather service."""
import logging
from typing import Dict, List
from homeassistant.components.weather import (
ATTR_FORECAST_CONDITION,
ATTR_FORECAST_PRECIPITATION,
ATTR_FORECAST_PRECIPITATION_PROBABILITY,
ATTR_FORECAST_TEMP,
ATTR_FORECAST_TEMP_LOW,
ATTR_FORECAST... | [
"homeassistant.util.dt.utc_from_timestamp",
"homeassistant.util.temperature.celsius_to_fahrenheit",
"logging.getLogger"
] | [((1137, 1164), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1154, 1164), False, 'import logging\n'), ((5275, 5328), 'homeassistant.util.temperature.celsius_to_fahrenheit', 'celsius_to_fahrenheit', (['self._forecast.temp_high_today'], {}), '(self._forecast.temp_high_today)\n', (5296, 5... |
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | [
"hashlib.md5",
"google.appengine.api.datastore.Get",
"email.Generator.Generator",
"email.MIMEMultipart.MIMEMultipart",
"google.appengine.api.datastore.Key.from_path",
"email.MIMEBase.MIMEBase",
"google.appengine.api.blobstore.blobstore._format_creation",
"google.appengine.api.datastore.Delete",
"cSt... | [((3244, 3257), 'hashlib.md5', 'hashlib.md5', ([], {}), '()\n', (3255, 3257), False, 'import hashlib\n'), ((3396, 3469), 'google.appengine.api.datastore.Key.from_path', 'datastore.Key.from_path', (['blobstore.BLOB_INFO_KIND', 'blob_key'], {'namespace': '""""""'}), "(blobstore.BLOB_INFO_KIND, blob_key, namespace='')\n",... |
from setuptools import setup
requirements = [
'numpy',
'pandas',
'scikit-learn',
'matplotlib'
]
setup(
name='ds_internship_task2',
version='0.1',
url='https://github.com/acivgin1/M1-DS-internship',
description='Testing standard classifiers on titanic dataset',
entry_points={'consol... | [
"setuptools.setup"
] | [((114, 492), 'setuptools.setup', 'setup', ([], {'name': '"""ds_internship_task2"""', 'version': '"""0.1"""', 'url': '"""https://github.com/acivgin1/M1-DS-internship"""', 'description': '"""Testing standard classifiers on titanic dataset"""', 'entry_points': "{'console_scripts': ['run-all=ds_internship_task2.command_li... |
import io
from setuptools import setup
setup(name='NotSoFastQC',
description='A tool to generate FastQC-like graphs from a FastQC file',
long_description=io.open('README.md', encoding='utf-8').read(),
long_description_content_type='text/markdown',
version='1.1',
url='https://github.com/ja... | [
"io.open"
] | [((167, 205), 'io.open', 'io.open', (['"""README.md"""'], {'encoding': '"""utf-8"""'}), "('README.md', encoding='utf-8')\n", (174, 205), False, 'import io\n')] |
import cv2
import numpy as np
import os
def load_image(path: str) -> np.ndarray:
"""Загрузка ихображения
:param path: путь к файлу с изображением
:return: загруженное изображение
"""
if type(path) != str:
raise TypeError(f'Тип переменной path {type(path)} не является строкой')
if not... | [
"cv2.Canny",
"numpy.int0",
"cv2.cvtColor",
"os.path.exists",
"cv2.rectangle",
"cv2.imread",
"cv2.boxPoints",
"numpy.array",
"cv2.minAreaRect",
"cv2.inRange"
] | [((420, 436), 'cv2.imread', 'cv2.imread', (['path'], {}), '(path)\n', (430, 436), False, 'import cv2\n'), ((772, 795), 'numpy.array', 'np.array', (['[110, 50, 50]'], {}), '([110, 50, 50])\n', (780, 795), True, 'import numpy as np\n'), ((814, 839), 'numpy.array', 'np.array', (['[130, 255, 255]'], {}), '([130, 255, 255])... |
# -*- coding: utf-8 -*-
# test_formats.py
"""
sfftk.formats modules unit tests
"""
from __future__ import division
import os
import shlex
import unittest
import __init__ as tests
from .. import schema
from ..core.parser import parse_args
from ..formats import am, seg, map, mod, stl, surf
__author__ = "<NAME>, PhD"... | [
"os.path.join"
] | [((518, 569), 'os.path.join', 'os.path.join', (['tests.TEST_DATA_PATH', '"""segmentations"""'], {}), "(tests.TEST_DATA_PATH, 'segmentations')\n", (530, 569), False, 'import os\n'), ((695, 747), 'os.path.join', 'os.path.join', (['cls.segmentations_path', '"""test_data.am"""'], {}), "(cls.segmentations_path, 'test_data.a... |
import collections
from django.shortcuts import render
from django.urls import reverse, resolve
from django.http import HttpResponseRedirect, JsonResponse, HttpResponse
from django.contrib.auth.decorators import login_required
from django.forms import formset_factory
from .models import NOTTTravel, NOTTChaperon, NOTTCh... | [
"cpovc_forms.models.OVCBasicPerson.objects.filter",
"django.http.JsonResponse",
"cpovc_forms.models.OVCBasicCRS.objects.filter",
"cpovc_registry.models.RegPersonsExternalIds.objects.get",
"cpovc_main.functions.get_dict",
"django.forms.formset_factory",
"django.http.HttpResponseRedirect",
"django.http.... | [((1147, 1200), 'django.shortcuts.render', 'render', (['request', '"""management/home.html"""', "{'form': {}}"], {}), "(request, 'management/home.html', {'form': {}})\n", (1153, 1200), False, 'from django.shortcuts import render\n'), ((1411, 1433), 'cpovc_reports.forms.CaseLoad', 'CaseLoad', (['request.user'], {}), '(r... |
from sqlalchemy.ext.declarative import declarative_base, declared_attr
class CustomBase(object):
""" Generates __tablename__ automatically """
@declared_attr
def __tablename__(cls):
return cls.__name__.lower()
Base = declarative_base(cls=CustomBase)
| [
"sqlalchemy.ext.declarative.declarative_base"
] | [((242, 274), 'sqlalchemy.ext.declarative.declarative_base', 'declarative_base', ([], {'cls': 'CustomBase'}), '(cls=CustomBase)\n', (258, 274), False, 'from sqlalchemy.ext.declarative import declarative_base, declared_attr\n')] |
doctests = """
########### Tests mostly copied from test_listcomps.py ############
Test simple loop with conditional
>>> sum({i*i for i in range(100) if i&1 == 1})
166650
Test simple case
>>> {2*y + x + 1 for x in (0,) for y in (1,)}
set([3])
Test simple nesting
>>> list(sorted({(i,j) for i in... | [
"gc.collect",
"sys.gettotalrefcount",
"test.test_support.run_doctest"
] | [((3418, 3466), 'test.test_support.run_doctest', 'test_support.run_doctest', (['test_setcomps', 'verbose'], {}), '(test_setcomps, verbose)\n', (3442, 3466), False, 'from test import test_support\n'), ((3648, 3696), 'test.test_support.run_doctest', 'test_support.run_doctest', (['test_setcomps', 'verbose'], {}), '(test_s... |
import numpy as np
import random
import pickle
class Loader:
@staticmethod
def load_train_set_and_test_set(path):
# loading training set features
with open(path + "/new/train_set_features.pkl", "rb") as f:
train_set_features2 = pickle.load(f)
# reducing feature vector len... | [
"numpy.std",
"random.shuffle",
"pickle.load",
"numpy.array"
] | [((348, 385), 'numpy.std', 'np.std', ([], {'a': 'train_set_features2', 'axis': '(0)'}), '(a=train_set_features2, axis=0)\n', (354, 385), True, 'import numpy as np\n'), ((991, 1027), 'numpy.std', 'np.std', ([], {'a': 'test_set_features2', 'axis': '(0)'}), '(a=test_set_features2, axis=0)\n', (997, 1027), True, 'import nu... |
# -*- coding: utf-8 -*-
# пример без использования дизайнера, все Gui определяется тут
from PyQt4 import QtCore
from PyQt4 import QtGui
# создадим "алиас" для этого метода, чтобы писать меньше кода
fromUtf8 = QtCore.QString.fromUtf8
class Ui(QtGui.QWidget):
def __init__(self, parent=None):
super(Ui,self)._... | [
"PyQt4.QtGui.QGridLayout",
"PyQt4.QtGui.QTextEdit",
"PyQt4.QtGui.QApplication",
"PyQt4.QtGui.QPushButton",
"PyQt4.QtCore.SIGNAL"
] | [((2412, 2440), 'PyQt4.QtGui.QApplication', 'QtGui.QApplication', (['sys.argv'], {}), '(sys.argv)\n', (2430, 2440), False, 'from PyQt4 import QtGui\n'), ((794, 813), 'PyQt4.QtGui.QGridLayout', 'QtGui.QGridLayout', ([], {}), '()\n', (811, 813), False, 'from PyQt4 import QtGui\n'), ((919, 936), 'PyQt4.QtGui.QTextEdit', '... |
import itertools
import six
from chainer import testing
def pooling_patches(dims, ksize, stride, pad, cover_all):
"""Return tuples of slices that indicate pooling patches."""
# Left-top indexes of each pooling patch.
if cover_all:
xss = itertools.product(
*[six.moves.range(-p, d + p -... | [
"chainer.testing.run_module",
"six.moves.zip",
"six.moves.range"
] | [((768, 806), 'chainer.testing.run_module', 'testing.run_module', (['__name__', '__file__'], {}), '(__name__, __file__)\n', (786, 806), False, 'from chainer import testing\n'), ((293, 330), 'six.moves.range', 'six.moves.range', (['(-p)', '(d + p - k + s)', 's'], {}), '(-p, d + p - k + s, s)\n', (308, 330), False, 'impo... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging.config
from logging.handlers import RotatingFileHandler
from .. import config
DEBUG_PLUS = 15
logging.addLevelName(DEBUG_PLUS, "DEBUG_PLUS")
LOG_FORMAT = '[%(asctime)s - %(levelname)s] %(pathname)s...%(funcName)s, line %(lineno)s > %(message)s'
def deplu... | [
"logging.handlers.RotatingFileHandler"
] | [((638, 715), 'logging.handlers.RotatingFileHandler', 'RotatingFileHandler', (['config.log_path'], {'maxBytes': '(1024 * 1024 * 5)', 'backupCount': '(0)'}), '(config.log_path, maxBytes=1024 * 1024 * 5, backupCount=0)\n', (657, 715), False, 'from logging.handlers import RotatingFileHandler\n')] |
import ctcsound
def init_csound_with_orc(args_list, orc_file, silent, string_values):
with open(orc_file, "r") as f:
orc_string = f.read()
if silent:
args_list.append("-m0")
args_list.append("-d")
cs = ctcsound.Csound()
cs.compileOrc(orc_string)
for x in args_list:
c... | [
"ctcsound.Csound"
] | [((239, 256), 'ctcsound.Csound', 'ctcsound.Csound', ([], {}), '()\n', (254, 256), False, 'import ctcsound\n'), ((687, 704), 'ctcsound.Csound', 'ctcsound.Csound', ([], {}), '()\n', (702, 704), False, 'import ctcsound\n')] |
import os
import sys
import re
import sublime
import sublime_plugin
from sbot_common import *
#-----------------------------------------------------------------------------------
def _do_sub(view, edit, reo, sub):
# Generic substitution function.
regions = sbot_common.get_sel_regions(view)
for reg in reg... | [
"re.compile"
] | [((643, 678), 're.compile', 're.compile', (['"""^[ \t]+"""', 're.MULTILINE'], {}), "('^[ \\t]+', re.MULTILINE)\n", (653, 678), False, 'import re\n'), ((750, 785), 're.compile', 're.compile', (['"""[\t ]+$"""', 're.MULTILINE'], {}), "('[\\t ]+$', re.MULTILINE)\n", (760, 785), False, 'import re\n'), ((846, 889), 're.comp... |
# GENERATED FILE - DO NOT EDIT THIS FILE UNLESS YOU ARE A WIZZARD
#pylint: skip-file
from heat.engine import properties
from heat.engine import constraints
from heat.engine import attributes
from heat.common.i18n import _
from avi.heat.avi_resource import AviResource
from avi.heat.avi_resource import AviNestedResource... | [
"heat.common.i18n._"
] | [((513, 518), 'heat.common.i18n._', '_', (['""""""'], {}), "('')\n", (514, 518), False, 'from heat.common.i18n import _\n'), ((653, 686), 'heat.common.i18n._', '_', (['"""IP address of controller VM."""'], {}), "('IP address of controller VM.')\n", (654, 686), False, 'from heat.common.i18n import _\n'), ((869, 899), 'h... |
#!/usr/bin/env python3
import rospy
from bitbots_msgs.msg import FootPressure
import argparse
import random
import time
import tkinter
import threading
parser = argparse.ArgumentParser()
parser.add_argument("-r", "--rate", help="Publish rate", dest="rate", type=int, default=200)
parser.add_argument("-n", "--noise", ... | [
"argparse.ArgumentParser",
"tkinter.mainloop",
"tkinter.Button",
"rospy.get_rostime",
"rospy.Publisher",
"rospy.Rate",
"rospy.signal_shutdown",
"bitbots_msgs.msg.FootPressure",
"random.random",
"random.seed",
"rospy.init_node",
"tkinter.Scale",
"tkinter.Tk",
"rospy.Duration"
] | [((163, 188), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (186, 188), False, 'import argparse\n'), ((1592, 1604), 'tkinter.Tk', 'tkinter.Tk', ([], {}), '()\n', (1602, 1604), False, 'import tkinter\n'), ((2308, 2357), 'tkinter.Button', 'tkinter.Button', (['master'], {'command': 'zero', 'text'... |
#!/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
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | [
"ansible.module_utils.network.f5.common.fq_name",
"ansible.module_utils.network.f5.bigip.F5Client",
"distutils.version.LooseVersion",
"ansible.module_utils.network.f5.common.cleanup_tokens",
"netaddr.IPAddress",
"ansible.module_utils.network.f5.common.F5ModuleError",
"ansible.module_utils.basic.AnsibleM... | [((24609, 24707), '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', (24622, 24707), False, 'from ansible.module_utils.b... |
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
class DataAugmentor:
"""
A class used for data augmentation (partially taken from : https://www.wouterbulten.nl/blog/tech/data-augmentation-using-tensorflow-data-dataset/)
Attributes
----------
batch : tf.Tensor, opti... | [
"tensorflow.random.set_seed",
"tensorflow.keras.backend.min",
"tensorflow.keras.preprocessing.image.ImageDataGenerator",
"numpy.random.seed",
"numpy.random.random_sample",
"tensorflow.clip_by_value",
"tensorflow.random.uniform",
"tensorflow.image.random_contrast",
"tensorflow.keras.backend.mean",
... | [((1028, 1057), 'tensorflow.random.set_seed', 'tf.random.set_seed', (['self.seed'], {}), '(self.seed)\n', (1046, 1057), True, 'import tensorflow as tf\n'), ((1066, 1091), 'numpy.random.seed', 'np.random.seed', (['self.seed'], {}), '(self.seed)\n', (1080, 1091), True, 'import numpy as np\n'), ((1318, 1368), 'tensorflow.... |
# Generated by Django 2.0.9 on 2019-04-24 20:55
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('movement', '0004_auto_20190423_1633'),
]
operations = [
migrations.AlterField(
model_name='move... | [
"django.db.models.OneToOneField"
] | [((388, 565), 'django.db.models.OneToOneField', 'models.OneToOneField', ([], {'blank': '(True)', 'null': '(True)', 'on_delete': 'django.db.models.deletion.CASCADE', 'to': '"""movement.MovementDailySquare"""', 'verbose_name': '"""Movimiento CD Contrapartida"""'}), "(blank=True, null=True, on_delete=django.db.models.\n ... |
import unittest
from quickbooks import QuickBooks
from quickbooks.objects.vendor import Vendor, ContactInfo
class VendorTests(unittest.TestCase):
def test_unicode(self):
vendor = Vendor()
vendor.DisplayName = "test"
self.assertEquals(str(vendor), "test")
def test_to_ref(self):
... | [
"quickbooks.objects.vendor.ContactInfo",
"quickbooks.objects.vendor.Vendor",
"quickbooks.QuickBooks"
] | [((194, 202), 'quickbooks.objects.vendor.Vendor', 'Vendor', ([], {}), '()\n', (200, 202), False, 'from quickbooks.objects.vendor import Vendor, ContactInfo\n'), ((332, 340), 'quickbooks.objects.vendor.Vendor', 'Vendor', ([], {}), '()\n', (338, 340), False, 'from quickbooks.objects.vendor import Vendor, ContactInfo\n'),... |
from cone.app import compat
from cone.app.browser import RelatedViewConsumer
from cone.app.browser.batch import Batch
from cone.app.browser.utils import format_date
from cone.app.browser.utils import make_query
from cone.app.browser.utils import make_url
from cone.app.utils import node_path
from cone.tile import Tile
f... | [
"cone.app.browser.utils.make_url",
"cone.app.browser.utils.format_date",
"cone.app.browser.utils.make_query",
"plumber.plumbing",
"cone.app.compat.unquote",
"cone.app.utils.node_path"
] | [((562, 591), 'plumber.plumbing', 'plumbing', (['RelatedViewConsumer'], {}), '(RelatedViewConsumer)\n', (570, 591), False, 'from plumber import plumbing\n'), ((3466, 3481), 'cone.app.browser.utils.make_query', 'make_query', ([], {}), '(**p)\n', (3476, 3481), False, 'from cone.app.browser.utils import make_query\n'), ((... |
import inspect
import os.path
from six import reraise as raise_
import pytest
try:
from py.io import saferepr
except ImportError:
saferepr = repr
_FAILED_ASSUMPTIONS = []
_ASSUMPTION_LOCALS = []
class FailedAssumption(Exception):
pass
def assume(expr, msg=''):
"""
Checks the expression, if it... | [
"py.io.saferepr",
"pytest.hookimpl",
"inspect.stack"
] | [((1862, 1895), 'pytest.hookimpl', 'pytest.hookimpl', ([], {'hookwrapper': '(True)'}), '(hookwrapper=True)\n', (1877, 1895), False, 'import pytest\n'), ((654, 669), 'inspect.stack', 'inspect.stack', ([], {}), '()\n', (667, 669), False, 'import inspect\n'), ((1345, 1358), 'py.io.saferepr', 'saferepr', (['val'], {}), '(v... |
import pandas as pd
import pytest
import xwrf
from . import importorskip
@importorskip('cf_xarray')
@pytest.mark.parametrize(
'name, cf_grid_mapping_name', [('lambert_conformal', 'lambert_conformal_conic')]
)
def test_postprocess(name, cf_grid_mapping_name):
# Verify initial/raw state
raw_ds = xwrf.tut... | [
"xwrf.tutorial.open_dataset",
"pandas.api.types.is_datetime64_dtype",
"pandas.api.types.is_string_dtype",
"pandas.api.types.is_numeric_dtype",
"pytest.mark.parametrize"
] | [((105, 214), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""name, cf_grid_mapping_name"""', "[('lambert_conformal', 'lambert_conformal_conic')]"], {}), "('name, cf_grid_mapping_name', [('lambert_conformal',\n 'lambert_conformal_conic')])\n", (128, 214), False, 'import pytest\n'), ((312, 344), 'xwrf.tut... |
# Copyright The PyTorch Lightning 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 agreed to i... | [
"os.path.join",
"pytorch_lightning.utilities.cloud_io.get_filesystem",
"fsspec.register_implementation",
"torch.randn",
"tests.helpers.BoringModel",
"torch.jit.load",
"pytest.raises",
"tests.helpers.runif.RunIf",
"torch.device",
"pytest.mark.parametrize",
"torch.no_grad",
"torch.allclose"
] | [((908, 987), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""modelclass"""', '[BoringModel, ParityModuleRNN, BasicGAN]'], {}), "('modelclass', [BoringModel, ParityModuleRNN, BasicGAN])\n", (931, 987), False, 'import pytest\n'), ((1519, 1598), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""mode... |
import clr
import math
clr.AddReference('RevitAPI')
clr.AddReference('RevitAPIUI')
from Autodesk.Revit.DB import *
doc = __revit__.ActiveUIDocument.Document
app = __revit__.Application
t = Transaction(doc, 'Create Line')
t.Start()
#Create a plane by normal and origin
origin = XYZ.Zero
normal = XYZ.BasisZ
p... | [
"clr.AddReference"
] | [((23, 51), 'clr.AddReference', 'clr.AddReference', (['"""RevitAPI"""'], {}), "('RevitAPI')\n", (39, 51), False, 'import clr\n'), ((53, 83), 'clr.AddReference', 'clr.AddReference', (['"""RevitAPIUI"""'], {}), "('RevitAPIUI')\n", (69, 83), False, 'import clr\n')] |
from behave import given, then, when
import validate_signature as vs
import common as c
import json
@given('The user validates a "{file}"')
def validation_file(context, file):
encoded = c.encode_file(file)
json = c.add_bytes_json(encoded)
context.response = vs.validate_signature(json)
@given("The user p... | [
"behave.when",
"behave.then",
"common.change_property",
"json.loads",
"common.add_bytes_json",
"validate_signature.validate_signature",
"common.encode_file",
"behave.given"
] | [((103, 141), 'behave.given', 'given', (['"""The user validates a "{file}\\""""'], {}), '(\'The user validates a "{file}"\')\n', (108, 141), False, 'from behave import given, then, when\n'), ((303, 338), 'behave.given', 'given', (['"""The user prepares the post"""'], {}), "('The user prepares the post')\n", (308, 338),... |
import copy
from scrapy import Item
from scrapy.http import Request, Response
from scrapy.spiders import CrawlSpider
from scrapy.utils.reqser import request_to_dict
class Parser:
def _clean_headers(self, headers):
# Use the new setting, if empty, try the deprecated one
excluded = self.spider.sett... | [
"copy.deepcopy",
"scrapy.utils.reqser.request_to_dict"
] | [((1040, 1084), 'scrapy.utils.reqser.request_to_dict', 'request_to_dict', (['request'], {'spider': 'self.spider'}), '(request, spider=self.spider)\n', (1055, 1084), False, 'from scrapy.utils.reqser import request_to_dict\n'), ((3802, 3821), 'copy.deepcopy', 'copy.deepcopy', (['elem'], {}), '(elem)\n', (3815, 3821), Fal... |
# Generated by Django 4.0 on 2021-12-15 18:18
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('jobs', '0003_alter_job_summary'),
]
operations = [
migrations.AlterField(
model_name='job',
name='video',
... | [
"django.db.models.FileField"
] | [((326, 375), 'django.db.models.FileField', 'models.FileField', ([], {'null': '(True)', 'upload_to': '"""video/%y"""'}), "(null=True, upload_to='video/%y')\n", (342, 375), False, 'from django.db import migrations, models\n')] |
from django.urls import path
from . import views
from . import api
app_name = 'hcat'
urlpatterns = [
path('', views.index, name='index'),
path('project/<int:pk>/', views.ProjectDetailView.as_view(), name='project_detail'),
path('project', views.ProjectListView.as_view(), name='project_list'),
path('pr... | [
"django.urls.path"
] | [((107, 142), 'django.urls.path', 'path', (['""""""', 'views.index'], {'name': '"""index"""'}), "('', views.index, name='index')\n", (111, 142), False, 'from django.urls import path\n')] |
from __future__ import print_function
import unittest, os, sys
import cStringIO
import ConfigParser
# setup system library path
pathname = os.path.realpath('../')
sys.path.insert(0, pathname)
sys.path.insert(0, '.')
try:
from osg_configure.modules import resourcecatalog
from osg_configure.modules.resourcecata... | [
"unittest.main",
"ConfigParser.SafeConfigParser",
"osg_configure.modules.resourcecatalog.RCEntry",
"osg_configure.modules.resourcecatalog.ResourceCatalog",
"osg_configure.modules.subcluster.resource_catalog_from_config",
"os.path.realpath",
"sys.path.insert",
"cStringIO.StringIO",
"sys.stderr.write"... | [((140, 163), 'os.path.realpath', 'os.path.realpath', (['"""../"""'], {}), "('../')\n", (156, 163), False, 'import unittest, os, sys\n'), ((164, 192), 'sys.path.insert', 'sys.path.insert', (['(0)', 'pathname'], {}), '(0, pathname)\n', (179, 192), False, 'import unittest, os, sys\n'), ((193, 216), 'sys.path.insert', 'sy... |
from unittest import TestCase
from anadroid.device.Device import get_first_connected_device
class TestDevice(TestCase):
device = get_first_connected_device()
def test_unlock_screen(self):
self.__class__.device.unlock_screen()
self.assertTrue(self.__class__.device.is_screen_unlocked())
d... | [
"anadroid.device.Device.get_first_connected_device"
] | [((136, 164), 'anadroid.device.Device.get_first_connected_device', 'get_first_connected_device', ([], {}), '()\n', (162, 164), False, 'from anadroid.device.Device import get_first_connected_device\n')] |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("fuauth", "0001_initial"), ("messagebox", "0001_initial")]
operations = [
migrations.AlterField(
... | [
"django.db.models.ForeignKey"
] | [((394, 466), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'to': 'settings.AUTH_USER_MODEL', 'on_delete': 'models.CASCADE'}), '(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)\n', (411, 466), False, 'from django.db import migrations, models\n')] |
from diffiqult import Tasks
from diffiqult import System_mol
from diffiqult.Basis import basis_set_3G_STO
mol = [
( 8,(0.0, 0.0, 0.091685801102911746)),
( 1,(1.4229678834888837, 0.0, -0.98120954931681137)),
( 1,(-1.4229678834888837, 0.0, -0.98120954931681137))]
basis = basis_set_3G_STO
ne = 10
system = System_mol(m... | [
"diffiqult.Tasks",
"diffiqult.System_mol"
] | [((308, 378), 'diffiqult.System_mol', 'System_mol', (['mol', 'basis', 'ne'], {'shifted': '(False)', 'angs': '(False)', 'mol_name': '"""agua"""'}), "(mol, basis, ne, shifted=False, angs=False, mol_name='agua')\n", (318, 378), False, 'from diffiqult import System_mol\n'), ((773, 818), 'diffiqult.Tasks', 'Tasks', (['syste... |
#!/usr/bin/env python
from pyrf.gui.spectrum_analyzer import main
main()
| [
"pyrf.gui.spectrum_analyzer.main"
] | [((68, 74), 'pyrf.gui.spectrum_analyzer.main', 'main', ([], {}), '()\n', (72, 74), False, 'from pyrf.gui.spectrum_analyzer import main\n')] |
#
# 3way_junction.py
# A Python program to simulate a 3 way traffic light
# controlled road junction using Pimoroni's PiGlow.
#
# The PiGlow is a small add on board for the Raspberry Pi that
# provides 18 individually controllable LEDs.
#
# For full details including setup, documentation and examples see:
# https://g... | [
"piglow.clear",
"random.randint",
"time.sleep",
"piglow.single",
"piglow.show"
] | [((1982, 1996), 'piglow.clear', 'piglow.clear', ([], {}), '()\n', (1994, 1996), False, 'import piglow\n'), ((1997, 2021), 'piglow.single', 'piglow.single', (['(1)', '(6)', '(255)'], {}), '(1, 6, 255)\n', (2010, 2021), False, 'import piglow\n'), ((2022, 2046), 'piglow.single', 'piglow.single', (['(2)', '(6)', '(255)'], ... |
"""
Test Stories module.
This module contains tests for Stories objects.
"""
import pytest
from esak import exceptions
def test_known_story(talker):
sm = talker.story(35505)
assert sm.title == "Spider-Man!"
assert sm.type == "story"
assert sm.thumbnail is None
assert sm.creators[0].name == "<NA... | [
"pytest.raises"
] | [((1969, 2003), 'pytest.raises', 'pytest.raises', (['exceptions.ApiError'], {}), '(exceptions.ApiError)\n', (1982, 2003), False, 'import pytest\n')] |
## Note: the package always contains both libraries (shared vs static) independent of shared setting
## that is done to avoid patching CMakefile
from conans import ConanFile, CMake, tools
from conans.errors import ConanInvalidConfiguration
import os
import glob
import shutil
class ApacheMilagro(ConanFile):
name =... | [
"conans.tools.get",
"os.rename",
"conans.tools.Version",
"conans.CMake",
"conans.tools.check_min_cppstd",
"conans.errors.ConanInvalidConfiguration",
"conans.tools.collect_libs"
] | [((1800, 1811), 'conans.CMake', 'CMake', (['self'], {}), '(self)\n', (1805, 1811), False, 'from conans import ConanFile, CMake, tools\n'), ((2407, 2460), 'conans.tools.get', 'tools.get', ([], {}), "(**self.conan_data['sources'][self.version])\n", (2416, 2460), False, 'from conans import ConanFile, CMake, tools\n'), ((2... |
# Generated by Django 2.2.5 on 2019-11-10 18:29
from django.db import migrations, models
def fix_cassette_coords(apps, schema_editor):
"""
Update Cassette location coordinates to be more centered since labels
are now shown entirely within each sample location
"""
ContainerType = apps.get_model('l... | [
"django.db.migrations.RunPython",
"django.db.models.F"
] | [((1009, 1050), 'django.db.migrations.RunPython', 'migrations.RunPython', (['fix_cassette_coords'], {}), '(fix_cassette_coords)\n', (1029, 1050), False, 'from django.db import migrations, models\n'), ((812, 825), 'django.db.models.F', 'models.F', (['"""x"""'], {}), "('x')\n", (820, 825), False, 'from django.db import m... |
import json
from gocd.api.endpoint import Endpoint
__all__ = ['PipelineConfig']
class PipelineConfig(Endpoint):
base_path = 'go/api/admin/pipelines'
id = 'name'
#: The result of a job/stage has been finalised when these values are set
final_results = ['Passed', 'Failed']
def __init__(self, serve... | [
"json.dumps"
] | [((2977, 2995), 'json.dumps', 'json.dumps', (['config'], {}), '(config)\n', (2987, 2995), False, 'import json\n')] |
import random
import math
def media(X):
return sum(X) / len(X)
def varianza(X):
mu = media(X)
acumulador = 0
for x in X:
acumulador += (x - mu)**2
return acumulador / len(X)
def desviacion_estandar(X):
return math.sqrt(varianza(X))
if __name__ == '__main__':
X = [random.randint(1,... | [
"random.randint"
] | [((303, 324), 'random.randint', 'random.randint', (['(1)', '(21)'], {}), '(1, 21)\n', (317, 324), False, 'import random\n')] |
import json
import requests
from CommandTemplate import CommandTemplate
from IrcMessage import IrcMessage
class Command(CommandTemplate):
triggers = ['translate']
helptext = "Translates the provided text. The first argument should be a two-letter country code ('it' for Italy, etc.) if you want to translate from E... | [
"requests.get"
] | [((1661, 1748), 'requests.get', 'requests.get', (['"""http://api.mymemory.translated.net/get"""'], {'params': 'params', 'timeout': '(15.0)'}), "('http://api.mymemory.translated.net/get', params=params,\n timeout=15.0)\n", (1673, 1748), False, 'import requests\n')] |
import setuptools
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open("README.md", "r") as fh:
long_description = fh.read()
requires = ["loguru", "elasticsearch == 7.11.0"]
setup(name="elasticSearch_collections",
description="Collections of ElasticSearc... | [
"setuptools.find_packages"
] | [((677, 703), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (701, 703), False, 'import setuptools\n')] |
#!/usr/bin/env python2
# PYTHON_ARGCOMPLETE_OK
"""
pytest: unit and functional testing with Python.
"""
__all__ = [
'main',
'UsageError',
'cmdline',
'hookspec',
'hookimpl',
'__version__',
]
if __name__ == '__main__': # if run as a script or by 'python -m pytest'
# we trigger the below "else... | [
"pytest.main",
"_pytest.config._preloadplugins"
] | [((1185, 1202), '_pytest.config._preloadplugins', '_preloadplugins', ([], {}), '()\n', (1200, 1202), False, 'from _pytest.config import main, UsageError, _preloadplugins, cmdline, hookspec, hookimpl\n'), ((1010, 1023), 'pytest.main', 'pytest.main', ([], {}), '()\n', (1021, 1023), False, 'import pytest\n')] |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import os
project_name = "reco-tut-asr"; branch = "main"; account = "sparsh-ai"
project_path = os.path.join('/content', project_name)
if not os.path.exists(project_path):
get_ipython().system(u'cp /content/drive/MyDrive/mykeys.py /content')
import mykeys
ge... | [
"pandas.DataFrame",
"sys.path.append",
"numpy.isin",
"numpy.average",
"sklearn.tree.DecisionTreeRegressor",
"matplotlib.pyplot.hist",
"numpy.count_nonzero",
"pandas.read_csv",
"numpy.std",
"os.path.exists",
"numpy.isnan",
"sklearn.linear_model.LinearRegression",
"numpy.array",
"matplotlib.... | [((145, 183), 'os.path.join', 'os.path.join', (['"""/content"""', 'project_name'], {}), "('/content', project_name)\n", (157, 183), False, 'import os\n'), ((1218, 1256), 'pandas.read_csv', 'pd.read_csv', (['"""./data/silver/items.csv"""'], {}), "('./data/silver/items.csv')\n", (1229, 1256), True, 'import pandas as pd\n... |
import sys
import unittest
if sys.version_info<(3,4):
class TestDummy(unittest.TestCase):
def test_asyncio(self):
raise unittest.SkipTest("asyncio needs Py >=3.4")
else:
from .asynciotest import *
| [
"unittest.SkipTest"
] | [((145, 188), 'unittest.SkipTest', 'unittest.SkipTest', (['"""asyncio needs Py >=3.4"""'], {}), "('asyncio needs Py >=3.4')\n", (162, 188), False, 'import unittest\n')] |
#!/usr/bin/env python
import os
import sys
# For coverage.
if __package__ is None:
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/..")
from unittest import main, TestCase
import requests
import requests_mock
from iris_sdk.client import Client
from iris_sdk.models.account import Account
XML_RES... | [
"unittest.main",
"os.path.abspath",
"requests_mock.Mocker",
"iris_sdk.client.Client",
"iris_sdk.models.account.Account"
] | [((18850, 18856), 'unittest.main', 'main', ([], {}), '()\n', (18854, 18856), False, 'from unittest import main, TestCase\n'), ((5030, 5071), 'iris_sdk.client.Client', 'Client', (['"""http://foo"""', '"""bar"""', '"""bar"""', '"""qux"""'], {}), "('http://foo', 'bar', 'bar', 'qux')\n", (5036, 5071), False, 'from iris_sdk... |
"""Main module that contains SimulationOptimization class definition
.. module:: sim_opt.py
:synopsis: DWSIM simulation optimization class
.. moduleauthor:: <NAME> <<EMAIL>>
:Module: sim_opt.py
:Author: <NAME> <<EMAIL>>
"""
import numpy as np
import time
class SimulationOptimization():
"""Class that defines... | [
"numpy.asarray",
"numpy.zeros",
"time.sleep",
"pythoncom.CoInitialize",
"numpy.append",
"clr.AddReference",
"numpy.array",
"numpy.linalg.norm"
] | [((1505, 1531), 'numpy.array', 'np.array', (['[]'], {'dtype': 'object'}), '([], dtype=object)\n', (1513, 1531), True, 'import numpy as np\n'), ((1882, 1894), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (1890, 1894), True, 'import numpy as np\n'), ((1916, 1928), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', ... |
import logging
from unittest import TestCase
from lymph.utils.logging import get_loglevel
class LoggingUtilsTests(TestCase):
def test_get_loglevel(self):
self.assertEqual(get_loglevel('DEBUG'), logging.DEBUG)
self.assertEqual(get_loglevel('debug'), logging.DEBUG)
self.assertEqual(get_log... | [
"lymph.utils.logging.get_loglevel"
] | [((187, 208), 'lymph.utils.logging.get_loglevel', 'get_loglevel', (['"""DEBUG"""'], {}), "('DEBUG')\n", (199, 208), False, 'from lymph.utils.logging import get_loglevel\n'), ((250, 271), 'lymph.utils.logging.get_loglevel', 'get_loglevel', (['"""debug"""'], {}), "('debug')\n", (262, 271), False, 'from lymph.utils.loggin... |
import pybullet as p
import pybullet_data
from time import sleep, time
# import control
# import slycot
p.connect(p.GUI)
p.setAdditionalSearchPath(pybullet_data.getDataPath())
p.loadURDF("plane.urdf")
botpos=[0,0,0.08]
botori = p.getQuaternionFromEuler([0, 0, 0])
bot = p.loadURDF("urdf/Paucibot.urdf", *botpos, *botor... | [
"pybullet.getQuaternionFromEuler",
"pybullet.stepSimulation",
"pybullet.setGravity",
"pybullet.getBasePositionAndOrientation",
"pybullet.getJointInfo",
"pybullet.getNumJoints",
"time.time",
"pybullet.setJointMotorControl2",
"time.sleep",
"pybullet_data.getDataPath",
"pybullet.connect",
"pybull... | [((105, 121), 'pybullet.connect', 'p.connect', (['p.GUI'], {}), '(p.GUI)\n', (114, 121), True, 'import pybullet as p\n'), ((177, 201), 'pybullet.loadURDF', 'p.loadURDF', (['"""plane.urdf"""'], {}), "('plane.urdf')\n", (187, 201), True, 'import pybullet as p\n'), ((229, 264), 'pybullet.getQuaternionFromEuler', 'p.getQua... |
"""Run the chain syncer, storing data in the given db dir.
Run with `python -m scripts.chainsync -db <path>`.
"""
import asyncio
import logging
from typing import (
cast,
Type,
Union,
)
from eth.exceptions import HeaderNotFound
from trinity.db.eth1.chain import (
AsyncChainDB,
AsyncHeaderDB,
)
fr... | [
"tests.core.integration_test_helpers.connect_to_peers_loop",
"asyncio.get_event_loop",
"argparse.ArgumentParser",
"logging.basicConfig",
"trinity.db.eth1.chain.AsyncChainDB",
"trinity.protocol.common.context.ChainContext",
"p2p.ecies.generate_privkey",
"asyncio.Event",
"typing.cast",
"p2p.kademlia... | [((1295, 1320), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1318, 1320), False, 'import argparse\n'), ((1668, 1781), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO', 'format': '"""%(asctime)s %(levelname)s: %(message)s"""', 'datefmt': '"""%H:%M:%S"""'}), "(level=... |
#
# Copyright 2016 The BigDL 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 agreed to in ... | [
"copy.deepcopy",
"pandas.read_csv",
"numpy.savetxt",
"numpy.zeros",
"numpy.array"
] | [((1669, 1757), 'pandas.read_csv', 'pd.read_csv', (['train_file_name'], {'names': 'COLUMNS', 'skipinitialspace': '(True)', 'engine': '"""python"""'}), "(train_file_name, names=COLUMNS, skipinitialspace=True, engine=\n 'python')\n", (1680, 1757), True, 'import pandas as pd\n'), ((1849, 1948), 'pandas.read_csv', 'pd.r... |
import tensorflow as tf
import tensorflow_addons as tfa
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Dropout
from sklearn import metrics
from sklearn import preprocessing
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelEncoder
i... | [
"argparse.ArgumentParser",
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.layers.Dense",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"protobuf.api_pb2.ModelResults",
"sklearn.preprocessing.MinMaxScaler",
"grpc.insecure_channel",
"protobuf.api_pb2.Empty",
"time.sleep",
"s... | [((588, 613), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (611, 613), False, 'import argparse\n'), ((917, 929), 'tensorflow.keras.models.Sequential', 'Sequential', ([], {}), '()\n', (927, 929), False, 'from tensorflow.keras.models import Sequential\n'), ((1942, 2100), 'pandas.read_csv', 'pd.... |
# Generated by Django 3.0.4 on 2020-04-04 04:06
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('timetable', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='account',
name='universityID',
... | [
"django.db.models.CharField"
] | [((332, 379), 'django.db.models.CharField', 'models.CharField', ([], {'default': '"""xxxx"""', 'max_length': '(10)'}), "(default='xxxx', max_length=10)\n", (348, 379), False, 'from django.db import migrations, models\n'), ((503, 545), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'max_lengt... |