id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
8,700
test apps
import sys import os import re import logging import subprocess from .utils import colorify log = logging.getLogger("main") # #################################################################### # REGISTER New application in the following global dictionries: APPTYPES = { "aligners": set(["muscle", "mafft", "clu...
8,701
dump option dicts
from _typeshed import FileDescriptorOrPath, Incomplete, SupportsWrite from collections.abc import Iterable, Mapping from distutils.cmd import Command from re import Pattern from typing import IO, Any, ClassVar, TypeVar, overload from typing_extensions import TypeAlias command_re: Pattern[str] _OptionsList: TypeAlias ...
8,702
visit time delta expr
from __future__ import annotations from fractions import Fraction from typing import Collection from dbt_semantic_interfaces.enum_extension import assert_values_exhausted from dbt_semantic_interfaces.type_enums.time_granularity import TimeGranularity from typing_extensions import override from metricflow.errors.erro...
8,703
split
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
8,704
upgrade
"""prepend tables with ctl Revision ID: aaa81d97a6f6 Revises: f53e04e5b7f5 Create Date: 2022-08-11 09:59:38.709501 """ from alembic import op # revision identifiers, used by Alembic. revision = "aaa81d97a6f6" down_revision = "f53e04e5b7f5" branch_labels = None depends_on = None def METHOD_NAME(): """Rename tab...
8,705
find python files
#!/usr/bin/env python3 """ Run Bluemira example files in sequence. Exit with code 1 if any errors. This will recursively search for python files within a given directory, and run them in sequence. It will report which ran without error, and which failed. By default, this script will disable plot/CAD display windows. ...
8,706
test roundtrip
from pathlib import Path from rdflib import ConjunctiveGraph, Dataset, Literal from rdflib.namespace import XSD def test_small_string(): s = """ ["http://example.com/s01", "http://example.com/a", "http://example.com/Type1", "globalId", "", ""] ["http://example.com/s01", "http://example.com/label"...
8,707
get status report
import logging import queue import threading import time import typing as t import uuid from abc import ABC, abstractmethod from concurrent.futures import Future from globus_compute_common import messagepack from globus_compute_common.messagepack.message_types import ( EPStatusReport, Result, TaskTransitio...
8,708
rpc
#!/usr/bin/env python3 """ Test program to demonstrate the remote config interfaces in rclone. This program can simulate rclone config create rclone config update rclone config password - NOT implemented yet rclone authorize - NOT implemented yet Pass the desired action as the first argument th...
8,709
test split
# pyOCD debugger # Copyright (c) 2015,2018-2019 Arm Limited # Copyright (c) 2022 Chris Reed # SPDX-License-Identifier: Apache-2.0 # # 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:...
8,710
test iteration hook
""" GTSAM Copyright 2010-2019, Georgia Tech Research Corporation, Atlanta, Georgia 30332-0415 All Rights Reserved See LICENSE for the license information Unit tests for IMU testing scenarios. Author: Frank Dellaert & Duy Nguyen Ta (Python) """ # pylint: disable=invalid-name, no-name-in-module from __future__ import ...
8,711
test remove done
from dvc.repo.experiments.queue.base import QueueDoneResult def test_remove_queued(test_queue, mocker): queued_test = ["queue1", "queue2", "queue3"] stash_dict = {} for name in queued_test: stash_dict[name] = mocker.Mock() msg_dict = {} entry_dict = {} for name in queued_test: ...
8,712
bins
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 1999-2021 Alibaba Group Holding 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-...
8,713
new item
# SPDX-License-Identifier: BSD-3-Clause # Copyright Contributors to the OpenColorIO Project. import copy from typing import Any, Optional import PyOpenColorIO as ocio from PySide2 import QtCore, QtGui from ..config_cache import ConfigCache from ..ref_space_manager import ReferenceSpaceManager from .config_item_model...
8,714
robot name from env variable
from collections import namedtuple from functools import lru_cache import logging import os import re from github import Github, GithubException, UnknownObjectException from .github_tools import ( exception_to_github, ) _LOGGER = logging.getLogger(__name__) def order(function): function.bot_order = True ...
8,715
set metapackage deps
# Copyright 2015-2016 Open Source Robotics Foundation, 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 applicabl...
8,716
config options
from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.apple import fix_apple_shared_install_name from conan.tools.build import cross_building from conan.tools.env import VirtualBuildEnv from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, ...
8,717
true block
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- from typing import Dict, List from azure.ai.ml._schema import PathAwareSchema from azure.ai.ml._utils.utils import is_data_binding_express...
8,718
get
""" This module defines the module QueryLilGIM. QueryLilGIM provides a method for finding neighboring genes (in a distance space defined by correlation similarity) for a set of query genes, based on gene expression data that are stored in a Google BigQuery table. The search for neighboring genes is based on correlation...
8,719
get data
import time import cv2 import numpy as np import pyqtgraph as pg from math import floor from queue import Empty from collections import deque from PyQt5 import QtGui, QtWidgets from scipy.spatial.distance import cdist from improv.actor import Actor, Spike from improv.store import StoreInterface, ObjectNotFoundError fr...
8,720
set up
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
8,721
kpipi amplitudes np
r"""Functions for observables in $K\to\pi\pi$ decays, in particular $\epsilon'/\epsilon$.""" import flavio from flavio.classes import Prediction, Observable from flavio.config import config from flavio.physics import ckm from flavio.physics.kdecays.wilsoncoefficients import wilsoncoefficients_sm_fourquark from math im...
8,722
configure
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2006-2018 (ita) """ C# support. A simple example:: def configure(conf): conf.load('cs') def build(bld): bld(features='cs', source='main.cs', gen='foo') Note that the configuration may compile C# snippets:: FRAG = ''' namespace Moo { public class Test ...
8,723
load
"""Init file for Supervisor add-on Git.""" import asyncio import functools as ft import logging from pathlib import Path import git from ..const import ATTR_BRANCH, ATTR_URL, URL_HASSIO_ADDONS from ..coresys import CoreSys, CoreSysAttributes from ..exceptions import StoreGitCloneError, StoreGitError, StoreJobError fr...
8,724
verify
#!/usr/bin/env python3 # # Copyright (c) 2021, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # ...
8,725
test login
# IMPORTATION STANDARD # IMPORTATION THIRDPARTY from unittest.mock import patch import pytest # IMPORTATION INTERNAL from openbb_terminal.core.models.user_model import ( CredentialsModel, PreferencesModel, ProfileModel, SourcesModel, UserModel, ) from openbb_terminal.core.session import sdk_sessi...
8,726
wait containers ready
# Copyright (c) 2020 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...
8,727
test boundary read
# coding=utf-8 """Tests for models.""" from django.test import TestCase from bims.tests.model_factories import ( BoundaryF, BoundaryTypeF, ClusterF ) class TestBoundaryType(TestCase): """ Tests CURD cluster. """ def setUp(self): """ Sets up before each test """ ...
8,728
test astar multigraph
import pytest import networkx as nx from networkx.utils import pairwise class TestAStar: @classmethod def setup_class(cls): edges = [ ("s", "u", 10), ("s", "x", 5), ("u", "v", 1), ("u", "x", 2), ("v", "y", 1), ("x", "u", 3), ...
8,729
target
"""adan""" import mindspore as ms from mindspore import ops from mindspore.common import dtype as mstype from mindspore.common.tensor import Tensor from mindspore.nn.optim.optimizer import Optimizer, opt_init_args_register try: from mindspore import jit except ImportError: from mindspore import ms_function as ...
8,730
name
from abc import ABC, abstractmethod import ast from collections import Counter import inspect import textwrap from .config import get_debug_mode from .ref import LazyCircuit from .view import InstView def _parse_name(inst): """ Returns 'name' if the source where @inst is instanced looks like: <name> = ...
8,731
filter
# -*- coding: utf-8 -*- # vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=python # License: GPL2 or later see COPYING # Written by Michael Simacek # Copyright (C) 2015 Red Hat, Inc. import logging import multiprocessing import os import shlex import socket import sys from io import StringIO from mockbuild i...
8,732
set up
# -*- encoding: utf-8 -*- import json import tempfile import unittest from werkzeug.test import Client from werkzeug.wrappers import Response from isso import Isso, config, core from isso.utils import http from fixtures import curl, FakeIP http.curl = curl class TestGuard(unittest.TestCase): data = json.dump...
8,733
over pressure ratio
################################################################################# # WaterTAP Copyright (c) 2020-2023, The Regents of the University of California, # through Lawrence Berkeley National Laboratory, Oak Ridge National Laboratory, # National Renewable Energy Laboratory, and National Energy Technology # Labo...
8,734
mock binary messenger
"""Test status bar integration.""" from __future__ import annotations import pytest from mock import AsyncMock from typing import List, Type, Optional from opentrons_hardware.drivers.binary_usb import BinaryMessenger from opentrons_hardware.firmware_bindings.utils import UInt8Field, UInt16Field from opentrons_hardware...
8,735
save settings
# -*- coding: utf-8 -*- # # Copyright (C) 2014 GNS3 Technologies Inc. # # This program 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 later version. ...
8,736
main
import os import sys import msvcrt import _winapi from pickle import load from multiprocessing import process, util from multiprocessing.context import set_spawning_popen from multiprocessing.popen_spawn_win32 import Popen as _Popen from . import reduction, spawn __all__ = ["Popen"] # # # def _path_eq(p1, p2): ...
8,737
print stats
#!/usr/bin/env python # -*- coding: utf-8 -*- from my_error import MyError import sys import mysql.connector from mysql.connector import errorcode import logging import config import opts import run_modules import actions import special_upgrade_action_pre import upgrade_health_checker # 由于用了/*+read_consistency(WEAK)...
8,738
get neighbors list
# # Copyright (C) 2022 The ESPResSo project # # This file is part of ESPResSo. # # ESPResSo 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 later vers...
8,739
commitizen config file
from pathlib import Path from shutil import copyfile import pytest from commitizen import bump from commitizen.exceptions import CurrentVersionNotFoundError MULTIPLE_VERSIONS_INCREASE_STRING = 'version = "1.2.9"\n' * 30 MULTIPLE_VERSIONS_REDUCE_STRING = 'version = "1.2.10"\n' * 30 TESTING_FILE_PREFIX = "tests/data"...
8,740
delete embeddings from vector db
import json import re import uuid from typing import Any, List, Iterable, Mapping from typing import Optional, Pattern import traceback import numpy as np import redis from redis.commands.search.field import TagField, VectorField from redis.commands.search.indexDefinition import IndexDefinition, IndexType from superag...
8,741
exists
# -*- coding: utf-8 -*- # Copyright (c) 2020, Frappe and contributors # For license information, please see license.txt import json import frappe import requests import pprint from boto3 import client, resource from frappe.model.document import Document from frappe.utils.password import get_decrypted_password def ...
8,742
overall
import logging import threading import time from collections import defaultdict from dataclasses import dataclass from datetime import datetime, timedelta import pandas as pd logger = logging.getLogger(__name__) UPDATE_INTERVAL = 60 * 60 * 12 # 12 hours GLOBAL_BASE_URL = ( "https://raw.githubusercontent.com/CS...
8,743
gt
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload fr...
8,744
tx account key list
from typing import Set, List, Tuple from .errors import ALTError from .solana_alt_limit import ALTLimit from .solana_tx import SolPubKey from .solana_tx_legacy import SolLegacyMsg class ALTListFilter: def __init__(self, legacy_msg: SolLegacyMsg) -> None: self._msg = legacy_msg self._validate_lega...
8,745
update1
import wx import wx.lib.newevent #import PYME.ui.autoFoldPanel as afp import PYME.ui.manualFoldPanel as afp import PYME.ui.layerFoldPanel as lfp import numpy as np from PYME.ui import histLimits import PYME.config import logging logger = logging.getLogger(__name__) #DisplayInvalidEvent, EVT_DISPLAY_CHANGE = wx.lib...
8,746
get data
#!/usr/bin/python #coding=utf-8 #@+leo-ver=5-thin #@+node:bob.20180205135005.1: * @file ../plugins/leo_babel/tests/lib_test.py #@@first #@@first #@@language python #@@tabwidth -4 #@+<< imports >> #@+node:bob.20180205135704.1: ** << imports >> import datetime # import time from leo.core import leoGlobals as leoG #@-<<...
8,747
query parameters
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # # Code generated by aaz-dev-tools # --------------------------------...
8,748
test module to device
""" Copyright 2020 The OneFlow 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 applicable law or agr...
8,749
text
import typing import humanize from django.conf import settings from django.core.validators import MinLengthValidator from django.db import models from django.utils import timezone from rest_framework.fields import DateTimeField from apps.slack.slack_formatter import SlackFormatter from common.public_primary_keys impo...
8,750
test no compaction
# --- BEGIN COPYRIGHT BLOCK --- # Copyright (C) 2022 Red Hat, Inc. # All rights reserved. # # License: GPL (version 3 or any later version). # See LICENSE for details. # --- END COPYRIGHT BLOCK --- # import logging import pytest import os import time import datetime from lib389.utils import get_default_db_lib from lib3...
8,751
has stateful partitioned call op
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
8,752
test solve
################################################################################# # WaterTAP Copyright (c) 2020-2023, The Regents of the University of California, # through Lawrence Berkeley National Laboratory, Oak Ridge National Laboratory, # National Renewable Energy Laboratory, and National Energy Technology # Labo...
8,753
context
import json from abc import ABCMeta, abstractmethod from collections import namedtuple from django.core.cache import cache from django.utils.translation import gettext as _ from memoized import memoized from corehq.apps.reports.v2.exceptions import ( EndpointNotFoundError, ReportFilterNotFound, ) from corehq...
8,754
name
# coding=utf-8 # *** WARNING: this file was generated by pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities from . im...
8,755
log4shell exploit client
from ipaddress import IPv4Address from threading import Event from typing import Callable, Tuple, Type from unittest.mock import MagicMock from uuid import UUID import pytest from agent_plugins.exploiters.log4shell.src.METHOD_NAME import Log4ShellExploitClient from agent_plugins.exploiters.log4shell.src.log4shell_opti...
8,756
recursion dfs walk
# This file is part of project Sverchok. It's copyrighted by the contributors # recorded in the version control history of the file, available from # its original location https://github.com/nortikin/sverchok/commit/master # # SPDX-License-Identifier: GPL3 # License-Filename: LICENSE from __future__ import annotation...
8,757
purge
""" Authorship — Stores a list of authors for each document. The data is stored in the environment under the key ``authors``. It's a dictionary, where the keys are the names of the documents and the values a list of author names. """ import itertools import os.path import re import sphinx.addnodes as addnodes from d...
8,758
set channel
# fake-enigma class slot: def __init__(self): self.list = [] def get(self): return self.list def __call__(self): for x in self.list: x() timers = set() import time from events import eventfnc ##################### ENIGMA BASE class eTimer: def __init__(self): self.timeout = slot() self.next_...
8,759
on epoch start
import os from abc import ABC, abstractmethod from typing import Any, Callable, Dict, Iterable, List, Optional, Union import ray import torch from coati.experience_buffer.utils import BufferItem from coati.experience_maker import Experience from torch.utils.data import DataLoader from tqdm import tqdm from .callbacks...
8,760
raise from status internal
# Copyright 2021 Collate # 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...
8,761
default traits view
# (C) Copyright 2020-2023 Enthought, Inc., Austin, TX # All rights reserved. # # This software is provided without warranty under the terms of the BSD # license included in LICENSE.txt and may be redistributed only under # the conditions described in the aforementioned license. The license # is also available online at...
8,762
google bucket file iter
import gzip import os import subprocess # nosec from seqr.utils.logging_utils import SeqrLogger logger = SeqrLogger(__name__) def run_command(command, user=None, pipe_errors=False): logger.info('==> {}'.format(command), user) return subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE if...
8,763
forward
from collections import OrderedDict from typing import Dict, List, Optional, Tuple, Union import torch from torch_complex.tensor import ComplexTensor from espnet2.enh.layers.complex_utils import is_complex from espnet2.enh.separator.abs_separator import AbsSeparator from espnet.nets.pytorch_backend.rnn.encoders impor...
8,764
eval adjoint
from ...core import Add, Expr, Mul, Number from ...core.logic import _fuzzy_group from ...core.strategies import do_one, exhaust, flatten, rm_id, typed, unpack from ...core.sympify import sympify from ...functions import adjoint from ..matrices import MatrixBase, ShapeError from .matexpr import Identity, MatrixExpr, Ze...
8,765
i n multicast
# Generated by h2py from /usr/include/netinet/in.h IPPROTO_IP = 0 IPPROTO_HOPOPTS = 0 IPPROTO_ICMP = 1 IPPROTO_IGMP = 2 IPPROTO_GGP = 3 IPPROTO_IPV4 = 4 IPPROTO_IPIP = IPPROTO_IPV4 IPPROTO_TCP = 6 IPPROTO_ST = 7 IPPROTO_EGP = 8 IPPROTO_PIGP = 9 IPPROTO_RCCMON = 10 IPPROTO_NVPII = 11 IPPROTO_PUP = 12 IPPROTO_ARGUS = 13 ...
8,766
test func gpstart quiet
#!python ''' Unit tests fro GpStart module Tests if database is running ''' import os import unittest2 as unittest import tinctest from gppylib.commands.base import Command from mpp.lib.gpstart import GpStart, GPstartException from mpp.lib.gpstop import GpStop, GPstopException class gpStartTestCase(unittest.TestCase)...
8,767
test init reinit
from unittest.mock import MagicMock, patch import pytest import wandb from wandb.errors import Error from wandb.proto import wandb_internal_pb2 as pb from wandb.sdk.wandb_init import _WandbInit def test_init(test_settings): class MyExitError(Exception): pass with patch("wandb.sdk.wandb_init._WandbIn...
8,768
private ip allocation method
# coding=utf-8 # *** WARNING: this file was generated by pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities from . im...
8,769
setup
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import hashlib import logging import math import numpy as np from fairseq.data import SampledMultiDataset from .sampled_multi_dataset impor...
8,770
recv
import asyncio import logging import time from collections import deque from contextlib import asynccontextmanager from typing import Any, AsyncIterator, Deque, Dict, List, Optional, Type, Union from uuid import uuid4 from fastapi import WebSocketDisconnect from websockets.exceptions import ConnectionClosed from freq...
8,771
test patriots day
# python-holidays # --------------- # A fast, efficient Python library for generating country, province and state # specific sets of holidays on the fly. It aims to make determining whether a # specific date is a holiday as fast and flexible as possible. # # Authors: dr-prodigy <dr.prodigy.github@gmail.com> (c) 2...
8,772
setup custom evmos
import json import os import signal import subprocess from pathlib import Path import tomlkit import web3 from pystarport import ports from web3.middleware import geth_poa_middleware from .cosmoscli import CosmosCLI from .utils import supervisorctl, wait_for_port DEFAULT_CHAIN_BINARY = "evmosd" class Evmos: de...
8,773
end
from enigma import eLabel from Components.GUIComponent import GUIComponent from Components.VariableText import VariableText from Tools.NumericalTextInput import NumericalTextInput class Input(VariableText, GUIComponent, NumericalTextInput): TEXT = 0 PIN = 1 NUMBER = 2 def __init__(self, text="", maxSize=False, ...
8,774
max scale
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
8,775
post hook
# Copyright 2020,2021 Sony Corporation. # Copyright 2021 Sony Group 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 ...
8,776
get global requests session
from __future__ import annotations import functools import random import socket import time from http import cookiejar from typing import Any, Callable, MutableMapping import requests import requests.adapters import urllib3 from cognite.client.config import global_config from cognite.client.exceptions import Cognite...
8,777
relevel
# Copyright Iris contributors # # This file is part of Iris and is released under the LGPL license. # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """ Routines for putting data on new strata (aka. isosurfaces), often in the Z direction. """ from functools import partial ...
8,778
ground truth
# Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved. # Original application code: NPBench - https://github.com/spcl/npbench import dace.dtypes import numpy as np import dace as dc import pytest import argparse from dace.fpga_testing import fpga_test, xilinx_test from dace.transformation.intersta...
8,779
test dib tunneling info
"""Unit test for KNX/IP DIB objects.""" import pytest from xknx.exceptions import CouldNotParseKNXIP from xknx.knxip import ( DIB, DIBDeviceInformation, DIBGeneric, DIBSecuredServiceFamilies, DIBServiceFamily, DIBSuppSVCFamilies, DIBTunnelingInfo, DIBTypeCode, KNXMedium, ) from xknx...
8,780
query parameters
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # # Code generated by aaz-dev-tools # --------------------------------...
8,781
producer
from logging import StreamHandler from threading import get_ident from celery import current_task from celery.signals import task_prerun, task_postrun from django.conf import settings from kombu import Connection, Exchange, Queue, Producer from kombu.mixins import ConsumerMixin from .utils import get_celery_task_log_...
8,782
get tries
from enigma import getPrevAsciiCode from Screens.HelpMenu import HelpableScreen from Screens.MessageBox import MessageBox from Screens.Screen import Screen from Screens.VirtualKeyBoard import VirtualKeyBoard from Components.ActionMap import HelpableNumberActionMap from Components.config import config from Components.In...
8,783
set up class
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """ Test TorchRankerAgent. """ import os import pytest import unittest import parlai.utils.testing as testing_utils fro...
8,784
test validate empty config
# Python libs import datetime import logging import time import pytest # Salt libs from salt.beacons import telegram_bot_msg # Salt testing libs from tests.support.mock import MagicMock, patch # Third-party libs try: import telegram HAS_TELEGRAM = True except ImportError: HAS_TELEGRAM = False log = l...
8,785
prepare request
# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRe...
8,786
test emit custom facility
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. from twisted.python.failure import Failure from twisted.trial.unittest import TestCase try: import syslog as _stdsyslog except ImportError: stdsyslog = None else: stdsyslog = _stdsyslog from twisted.python import syslog class Sy...
8,787
set value
#!/usr/bin/env python # -*- coding: utf-8 -*- """Creates a button""" # Part of the PsychoPy library # Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2022 Open Science Tools Ltd. # Distributed under the terms of the GNU General Public License (GPL). import numpy as np from psychopy import event, core, layout from p...
8,788
cdr type
""" If you have two expressions containing unification variables, these expressions can be "unified" if there exists an assignment to all unification variables such that the two expressions are equal. For instance, [5, A, B] and [A, C, 9] can be unified if A=C=5 and B=9, yielding [5, 5, 9]. [5, [A, B]] and [A, [1, 2]]...
8,789
delete objects
# pylint: disable=C0116 # Missing function docstrings import os import secrets from django.utils.crypto import get_random_string from siteapp.models import User, Portfolio from guidedmodules.models import TaskAnswer TMP_BASE_PATH = "/tmp/govready-q/datagen" rand = secrets.SystemRandom() # Initialize secure random ge...
8,790
action
# MIT License # # Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, ...
8,791
process score chunk
#!/usr/bin/env python3.9 from __future__ import annotations import argparse import asyncio import math import os import sys from dataclasses import dataclass from dataclasses import field from pathlib import Path from typing import Any from typing import Awaitable from typing import Iterator from typing import Optiona...
8,792
is name start
#!/usr/bin/python3 # coding: utf-8 # Small BBCode parser for reading Godot's XML doc format, so it can be translated into different formats (not just # Markdown, HTML etc). class NodeText: def __init__(self, text): self.text = text class NodeTag: def __init__(self): self.name = "" s...
8,793
dispatch
from django.contrib import messages from django.contrib.admin.utils import unquote from django.core.exceptions import PermissionDenied from django.db import transaction from django.http import Http404 from django.shortcuts import get_object_or_404, redirect from django.urls import reverse from django.utils.translation ...
8,794
mocked get mac address from iface
""" Copyright 2020 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...
8,795
prepare subprocess environ for creating local spark
import os import shutil import tempfile import zipfile def _get_active_spark_session(): try: from pyspark.sql import SparkSession except ImportError: # Return None if user doesn't have PySpark installed return None try: # getActiveSession() only exists in Spark 3.0 and abov...
8,796
gompertz
# This code is from https://github.com/automl/pybnn # pybnn authors: Aaron Klein, Moritz Freidank import numpy as np # all the models that we considered at some point all_models = {} model_defaults = {} display_name_mapping = {} def pow3(x, c, a, alpha): return c - a * x ** (-alpha) all_models["pow3"] = pow3 ...
8,797
close safety shutter
import os import time import abc import logging import gevent from mxcubecore.TaskUtils import error_cleanup class AbstractEnergyScan(object): __metaclass__ = abc.ABCMeta def __init__(self): self.data_collect_task = None self._egyscan_task = None self.scanning = False def open_sa...
8,798
transform inputs
# Copyright (c) 2022 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 applic...
8,799
test org admin edit sys auditor
import pytest from unittest import mock from django.test import TransactionTestCase from awx.main.access import UserAccess, RoleAccess, TeamAccess from awx.main.models import User, Organization, Inventory, Role class TestSysAuditorTransactional(TransactionTestCase): def rando(self): return User.objects....