id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
17,700
mkbasedir
""" Downsample an image stack or volume by clipping fourier frequencies """ import argparse import math import os import logging import numpy as np from cryodrgn import fft, utils from cryodrgn.mrc import MRCHeader, MRCFile from cryodrgn.source import ImageSource logger = logging.getLogger(__name__) def add_args(pa...
17,701
enqueue
# Copyright (c) 2021, Frappe Technologies and contributors # License: MIT. See LICENSE import json from datetime import datetime import click from croniter import croniter import frappe from frappe.model.document import Document from frappe.utils import get_datetime, now_datetime from frappe.utils.background_jobs im...
17,702
make clear button
# This code is part of Qiskit. # # (C) Copyright IBM 2017, 2019. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivat...
17,703
get all modules
""" This module provides interface to interact with the chassis of the DUT via platform API remotely """ import json import logging import re logger = logging.getLogger(__name__) INBAND_PORT_REGEX = (r"(Ethernet-IB)(\d+)$") def chassis_api(conn, name, args=None): if args is None: args = [] conn...
17,704
on 200
# -------------------------------------------------------------------------------------------- # 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 # --------------------------------...
17,705
test deployment
# pylint: disable=unused-argument # pylint: disable=redefined-outer-name import asyncio import json from copy import deepcopy from pathlib import Path from typing import AsyncIterator import aiohttp import dask_gateway import pytest from faker import Faker from pytest_simcore.helpers.utils_docker import get_localhos...
17,706
test web application flow
# Copyright (c) 2019, Frappe Technologies and contributors # License: MIT. See LICENSE from urllib.parse import urljoin import requests import frappe from frappe.integrations.doctype.social_login_key.test_social_login_key import ( create_or_update_social_login_key, ) from frappe.tests.utils import FrappeTestCase d...
17,707
test crm show all thresholds
import os import sys import mock import pytest from importlib import reload from tabulate import tabulate from click.testing import CliRunner from utilities_common.db import Db from .mock_tables import dbconnector import crm.main as crm test_path = os.path.dirname(os.path.abspath(__file__)) mock_db_path = os.path.j...
17,708
mkdir
# 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 applic...
17,709
mock yaml file
import json import logging import tempfile from pathlib import Path from xml.etree import ElementTree import docx import yaml from bs4 import BeautifulSoup from autogpt.commands.file_operations_utils import is_file_binary_fn, read_textual_file logger = logging.getLogger(__name__) plain_text_str = "Hello, world!" ...
17,710
unit of measurement
""" Module for exposing a (virtual) sensor to KNX bus. It provides functionality for * push local state changes to KNX bus * KNX devices may read local values via GROUP READ. (A typical example for using this class is the outside temperature read from e.g. an internet serviceand exposed to the KNX bus. KNX devices m...
17,711
fix files
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
17,712
forward
# Mikel Broström 🔥 Yolo Tracking 🧾 AGPL-3.0 license import torch import torch.nn as nn from .clip.simple_tokenizer import SimpleTokenizer as _Tokenizer _tokenizer = _Tokenizer() def weights_init_kaiming(m): classname = m.__class__.__name__ if classname.find('Linear') != -1: nn.init.kaiming_normal...
17,713
test not equal different type
# (C) Copyright 2005-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...
17,714
terminal size
# -*- coding: utf-8 -*- # Back In Time # Copyright (C) 2012-2022 Germar Reitze # # 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 2 of the License, or # (at your ...
17,715
bars
# piker: trading gear for hackers # Copyright (C) 2018-present Tyler Goodlet (in stewardship of piker0) # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, ...
17,716
interval to series
# ___________________________________________________________________________ # # Pyomo: Python Optimization Modeling Objects # Copyright (c) 2008-2022 # National Technology and Engineering Solutions of Sandia, LLC # Under the terms of Contract DE-NA0003525 with National Technology and # Engineering Solutions of ...
17,717
creation time
# 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...
17,718
test no unescaped equal
import unittest from robot.utils.asserts import assert_equal from robot.utils.escaping import escape, unescape, split_from_equals def assert_unescape(inp, exp): assert_equal(unescape(inp), exp, repr(inp)) class TestUnEscape(unittest.TestCase): def test_no_backslash(self): for inp in ['no escapes',...
17,719
var
'''VAR and VARMA process this does not actually do much, trying out a version for a time loop alternative representation: * textbook, different blocks in matrices * Kalman filter * VAR, VARX and ARX could be calculated with signal.lfilter only tried some examples, not implemented TODO: try minimizing sum of square...
17,720
create project logging
import time import urllib import pytest from .common import CATTLE_TEST_URL from .common import DEFAULT_TIMEOUT from .common import USER_TOKEN from .common import WebsocketLogParse from .common import create_connection from .common import create_kubeconfig from .common import create_project_and_ns from .common import...
17,721
nameext from url
# -*- coding: utf-8 -*- # Copyright 2015-2022 Mike Fährmann # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. """Collection of functions that work on strings/text""" import re impor...
17,722
test simpleflow workflow terminate
# See README for more information about integration tests from __future__ import annotations from flaky import flaky from sure import expect from . import VCRIntegrationTest, vcr class TestSimpleflowCommand(VCRIntegrationTest): # def invoke(self, command, arguments): # # type: (Callable, AnyStr) -> Any ...
17,723
fmt unpack
#!/usr/bin/env python3 # # Cross Platform and Multi Architecture Advanced Binary Emulation Framework # from qiling.const import QL_ARCH from .context import Context from .arch import ArchCORTEX_M, ArchARM, ArchMIPS, ArchX86, ArchX8664 from .misc import check_and_eval import re, math def setup_memory_Manager(ql): ...
17,724
set audio offset
# -*- coding: utf-8 -*- """ Copyright (C) 2017 Sebastian Golasch (plugin.video.netflix) Copyright (C) 2019 Smeulf (original implementation module) Operations for changing the playback status SPDX-License-Identifier: MIT See LICENSES/MIT.md for more information. """ import time import xbmc import x...
17,725
on socket disconnect handler
import binascii import logging import os import sys import traceback from base64 import b64decode, b64encode from code import InteractiveConsole from pathlib import Path from PyQt5.QtNetwork import QTcpServer from tribler.gui.utilities import connect, take_screenshot class CodeExecutor: """ This class is re...
17,726
name
# 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...
17,727
ampsupport
import re import arrow import logging import datetime from urllib.parse import unquote from settings import (DEFAULT_THEME_DATE_FORMAT, DEFAULT_THEME_TIMEZONE) from superdesk import get_resource_service logger = logging.getLogger('superdesk') DEFAULT_IFRAME_WIDTH = "350" DEFAULT_IFRAME_HEIGHT = "350" def moment_da...
17,728
submit
#!/usr/bin/env python3 # SPDX-License-Identifier: MIT import errno, ctypes, sys, atexit, os, os.path, mmap from construct import * from m1n1 import malloc from m1n1.utils import Register32 from m1n1.agx import AGX from m1n1.agx.render import * from m1n1.agx.uapi import * from m1n1.proxyutils import * from m1n1.utils ...
17,729
bucket tags
"""CFNgin Bucket Blueprint.""" from __future__ import annotations from typing import TYPE_CHECKING, ClassVar, Dict, Union from troposphere import Equals, If, Not, NoValue, Or, Tag, Tags, s3 from ... import __version__ from ...compat import cached_property from .base import Blueprint from .variables.types import CFNS...
17,730
test basic single threaded behavior
"""Tests for thread_async_queue.""" from __future__ import annotations import asyncio from concurrent.futures import ThreadPoolExecutor from itertools import chain from typing import List, NamedTuple import pytest from opentrons.protocol_runner.thread_async_queue import ( ThreadAsyncQueue, QueueClosed, ) ...
17,731
test wrong percentiles type
import copy import numpy as np import pytest import torch import torchio as tio from ...utils import TorchioTestCase class TestRescaleIntensity(TorchioTestCase): def test_rescale_to_same_intentisy(self): min_t1 = float(self.sample_subject.t1.data.min()) max_t1 = float(self.sample_subject.t1.data...
17,732
load tip length calibration
import json import typing import logging from pydantic import ValidationError from dataclasses import asdict from opentrons import config from .. import file_operators as io, helpers, types as local_types from opentrons.protocols.api_support.constants import OPENTRONS_NAMESPACE from opentrons.util.helpers import utc...
17,733
status
import asyncio import functools import importlib from stix_shifter_utils.utils.async_utils import run_in_thread from stix_shifter_utils.utils.error_response import ErrorResponder RESULTS = 'results' RESULTS_STIX = 'results_stix' QUERY = 'query' DELETE = 'delete' STATUS = 'status' PING = 'ping' IS_ASYNC = 'is_async' ...
17,734
validate delete args
from types import SimpleNamespace from typing import Any, cast from resoto_plugin_aws.aws_client import AwsClient from test.resources import round_trip_for from resoto_plugin_aws.resource.sagemaker import ( AwsSagemakerNotebook, AwsSagemakerAlgorithm, AwsSagemakerApp, AwsSagemakerModel, AwsSagemaker...
17,735
script file browser slot
# -*- 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. ...
17,736
object storage bucket
from pathlib import Path from datetime import date from io import StringIO import os import pytest import boto3 # noqa from django.core.management import call_command, CommandError from django.utils import timezone from sqlite_utils import Database from ..models import SiteCheck from ...accounts import models as ac...
17,737
seafile set repo property
from pysearpc import searpc_func, SearpcError, NamedPipeClient class SeafileRpcClient(NamedPipeClient): """RPC used in client""" def __init__(self, socket_path, *args, **kwargs): NamedPipeClient.__init__( self, socket_path, "seafile-rpcserver", *ar...
17,738
spawn python
# Common utility functions used by various script execution tests # e.g. test_cmd_line, test_cmd_line_script and test_runpy import sys import os import re import os.path import tempfile import subprocess import py_compile import contextlib import shutil try: import zipfile except ImportError: # If Python is b...
17,739
settings
# SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # SPDX-License-Identifier: GPL-3.0-or-later import logging import pytest QtWebEngineCore = pytest.importorskip('qutebrowser.qt.webenginecore') QWebEngineSettings = QtWebEngineCore.QWebEngineSettings from qutebrowser.browser.webengine i...
17,740
display html
from __future__ import print_function from __future__ import absolute_import from __future__ import division try: basestring except NameError: basestring = str import os import sys import ast from compas_rhino.forms import TextForm from compas_rhino.forms import ImageForm import System import rhinoscriptsy...
17,741
id
# 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...
17,742
polygons from bitmap
# Copyright (c) Alibaba, Inc. and its affiliates. import cv2 import numpy as np import pyclipper from shapely.geometry import Polygon def rboxes_to_polygons(rboxes): """ Convert rboxes to polygons ARGS `rboxes`: [n, 5] RETURN `polygons`: [n, 8] """ theta = rboxes[:, 4:5] c...
17,743
test peer communication denied
import shutil import pytest from saltfactories.utils import random_string @pytest.fixture(scope="module") def pillar_state_tree(tmp_path_factory): _pillar_state_tree = tmp_path_factory.mktemp("pillar") try: yield _pillar_state_tree finally: shutil.rmtree(str(_pillar_state_tree), ignore_er...
17,744
get existing ledger entries
# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt import frappe from frappe import _, qb from frappe.model.document import Document from frappe.utils.data import comma_and class RepostAccountingLedger(Document): def __init__(self, *args, **kwargs)...
17,745
get clipped pointcloud
################################################################################################## ## License: Apache 2.0. See LICENSE file in root directory. #### ################################################################################################## ## Box Dime...
17,746
main
#!/usr/bin/env python from commands import getstatusoutput from platform import node from socket import socket, AF_INET, SOCK_STREAM from sys import argv from time import sleep, time DELAY = 60 CARBON_SERVER = 'localhost' CARBON_PORT = 2003 class Carbon: def __init__(self, hostname, port): self.s = socke...
17,747
retrieve datasets
# Copyright Contributors to the Amundsen project. # SPDX-License-Identifier: Apache-2.0 import json import logging import re from collections import namedtuple from datetime import datetime, timezone from typing import ( Any, Dict, Iterator, List, ) import google.oauth2.service_account import google_auth_httplib2...
17,748
run with time
from decimal import Decimal import os import random from sqlalchemy import __version__ from sqlalchemy import Column from sqlalchemy import create_engine from sqlalchemy import ForeignKey from sqlalchemy import Integer from sqlalchemy import Numeric from sqlalchemy import String from sqlalchemy.orm import declarative_...
17,749
get std handle
"""Interface for interacting with windows api console functions. The core export is the `enable_virtual_processing` context manager that redirects console input events and inputs them as ascii codes; this includes mouse input. Credits: - Implementation: [Tired-Fox (Zachary)](https://github.com/Tired-Fox/) """ fr...
17,750
delete files and dir
#!/usr/bin/env python # Copyright 2018, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list o...
17,751
disable database logging
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
17,752
user tz
"""""" from __future__ import annotations import datetime from unittest import mock import pytz from wtforms.form import Form from abilian.app import Application from abilian.core.entities import Entity from abilian.services.security import READ, WRITE, Anonymous, Owner, Role from . import FormPermissions, fields, ...
17,753
text strip
# -*- coding: utf-8 -* import os import random import re import six import argparse import io import math prog = re.compile("[^a-z ]", flags=0) def parse_args(): parser = argparse.ArgumentParser( description="Paddle word2 vector preprocess") parser.add_argument( '--build_dict_corpus_dir', type...
17,754
has move effects
# Copyright 2020-2023 Capypara and the SkyTemple Contributors # # This file is part of SkyTemple. # # SkyTemple 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 y...
17,755
test frontend
#!/usr/bin/env python3 # # QAPI parser test harness # # Copyright (c) 2013 Red Hat Inc. # # Authors: # Markus Armbruster <armbru@redhat.com> # # This work is licensed under the terms of the GNU GPL, version 2 or later. # See the COPYING file in the top-level directory. # import argparse import difflib import os impo...
17,756
validation epoch end
# 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...
17,757
test run tasks
# This file is part of the Open Data Cube, see https://opendatacube.org for more information # # Copyright (c) 2015-2023 ODC Contributors # SPDX-License-Identifier: Apache-2.0 """ Module """ from datacube.ui.task_app import task_app, run_tasks, wrap_task import datacube.executor def make_test_config(index, config, *...
17,758
port end
#!/usr/bin/env python # sfputil.py # # Platform-specific SFP transceiver interface for SONiC # try: import os import re import time import collections from sonic_sfp.sfputilbase import SfpUtilBase from sonic_py_common import device_info except ImportError as e: raise ImportError("%s - requ...
17,759
test timeseries generator
# Copyright 2016 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...
17,760
set initial
import collections import json from django import forms from django.forms.utils import flatatt from django.forms.widgets import CheckboxInput, Input from django.utils.encoding import force_str from django.utils.safestring import mark_safe from django.utils.html import format_html, conditional_escape from django.utils....
17,761
listdir
# coding: utf-8 # # Copyright 2021 The Oppia 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 requi...
17,762
test generate optional indices
# This file is part of Hypothesis, which may be found at # https://github.com/HypothesisWorks/hypothesis/ # # Copyright the Hypothesis Authors. # Individual contributors are listed in AUTHORS.rst and the git log. # # This Source Code Form is subject to the terms of the Mozilla Public License, # v. 2.0. If a copy of the...
17,763
odometry2 pose3 d
import rospy import threading from math import asin, atan2, pi from nav_msgs.msg import Odometry def quat2Yaw(qw, qx, qy, qz): ''' Translates from Quaternion to Yaw. @param qw,qx,qy,qz: Quaternion values @type qw,qx,qy,qz: float @return Yaw value translated from Quaternion ''' rotateZa...
17,764
get one commcare user at location
from itertools import chain from dimagi.utils.chunked import chunked from dimagi.utils.couch.database import iter_docs from corehq.apps.es import UserES from corehq.apps.locations.models import SQLLocation def _cc_users_by_location(domain, location_id, include_docs=True, wrap=True, user_class=None): from corehq...
17,765
import fields
# Copyright (C) 2023 ASTRON (Netherlands Institute for Radio Astronomy) # SPDX-License-Identifier: GPL-3.0-or-later """ These tests are checking that the python bindings for the Fields class behave correctly. The tests check the same functionalities checked in DP3/common/test/unit/tFields.cc for the C++ version of the...
17,766
base test
# 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. from argparse import Namespace import os import re import unittest from pathlib import Path from tqdm import tqdm from typing import List, Dic...
17,767
client proc
#!/usr/bin/python3 # # SYNOPSIS # -------- # server: # ./test.py -s -l XPRT:HOST:PORT # client: # ./test.py -c XPRT:HOST:PORT # # DESCRIPTIONS # ------------ # Immediately update after lookup completed. import os import io import pdb import sys import time import socket import logging import argparse as ap import ...
17,768
get by name
from typing import List, Optional from pydantic.error_wrappers import ErrorWrapper, ValidationError from sqlalchemy.sql.expression import true from dispatch.exceptions import NotFoundError from dispatch.project import service as project_service from .models import ( IncidentPriority, IncidentPriorityCreate, ...
17,769
send
""" 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...
17,770
test has transparency
# Copyright (c) 2008, 2010 Aldo Cortesi # Copyright (c) 2011 Florian Mounier # Copyright (c) 2011 Anshuman Bhaduri # Copyright (c) 2020 Matt Colligan # # 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 ...
17,771
generate
"""SCons.Tool.sunc++ Tool-specific initialization for C++ on SunOS / Solaris. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # __COPYRIGHT__ # # Permission is hereby granted, free of charge, to any person...
17,772
init weights
import math import torch from torch.nn import functional as F def METHOD_NAME(m, mean=0.0, std=0.01): classname = m.__class__.__name__ if classname.find("Conv") != -1: m.weight.data.normal_(mean, std) def get_padding(kernel_size, dilation=1): return int((kernel_size * dilation - dilation) / 2) ...
17,773
create
from rest_framework import viewsets from .models import ListModel from . import serializers from utils.page import MyPageNumberPagination from rest_framework.filters import OrderingFilter from django_filters.rest_framework import DjangoFilterBackend from rest_framework.response import Response from .filter import Filte...
17,774
test generate ingestion flow for athena input
# Copyright Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompan...
17,775
submission media
from pyramid.decorator import reify from sqlalchemy.ext.hybrid import hybrid_property from sqlalchemy.orm import backref, relationship from libweasyl.media import get_submission_media from libweasyl.models.helpers import clauses_for from libweasyl.models.meta import Base from libweasyl.models.users import Login from l...
17,776
staff api client
import json import logging from unittest import mock from unittest.mock import Mock import graphene import pytest from django.core.serializers.json import DjangoJSONEncoder from django.test.client import MULTIPART_CONTENT, Client from django.urls import reverse from django.utils.functional import SimpleLazyObject fro...
17,777
search order
from typing import Any, Dict, Iterable, Union, Optional, List, Iterator, Mapping, Set from dbt.clients.jinja import MacroGenerator, MacroStack from dbt.contracts.graph.nodes import Macro from dbt.include.global_project import PROJECT_NAME as GLOBAL_PROJECT_NAME from dbt.exceptions import DuplicateMacroNameError, Packa...
17,778
target host
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.mssql.src.mssql_client import MSSQLClient from agent_plugins.exploiters.mssql.src.mssql_exploit_client import MSSQ...
17,779
get platform string
#!/usr/bin/env python ######################################################################## # File : dirac-platform # Author : Adria Casajus ######################################################################## """ The *dirac-platform* script determines the "platform" of a certain node. The platform is a string...
17,780
find probe packet
#!/usr/bin/env python3 """ Portchannel member ping: get portchannel member packet loss state. """ import argparse import ipaddress import random import select import socket import sys import time from swsscommon.swsscommon import ConfigDBConnector from scapy.all import * RCV_SIZE = 20480 RCV_TIMEOUT = 10000 SE...
17,781
get cassette path
# emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- # ex: set sts=4 ts=4 sw=4 et: # ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## # # See COPYING file distributed along with the datalad package for the # copyright and license terms. # # ## ### ### ...
17,782
test return 0 if there is no
# Copyright 2016 Hardcoded Software (http://www.hardcoded.net) # # This software is licensed under the "GPLv3" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.gnu.org/licenses/gpl-3.0.html # The commented out tests are tests for func...
17,783
gsutil cp
import re import json from typing import List, Optional from subprocess import call, Popen, PIPE def diagnose( name: str, dest: str, hail_log: str, overwrite: bool, no_diagnose: bool, compress: bool, workers: List[str], take: Optional[int], ): print("Diagnosing cluster '{}'...".fo...
17,784
check connection
from typing import Optional from collections import OrderedDict import pandas as pd import redshift_connector from mindsdb_sql import parse_sql from mindsdb_sql.render.sqlalchemy_render import SqlalchemyRender from redshift_sqlalchemy import dialect from mindsdb.integrations.libs.base import DatabaseHandler from min...
17,785
get refresh token
# # Copyright (c) 2023 Airbyte, Inc., all rights reserved. # import logging from abc import abstractmethod from typing import Any, List, Mapping, MutableMapping, Optional, Tuple, Union import backoff import pendulum import requests from airbyte_cdk.models import Level from airbyte_cdk.sources.http_logger import forma...
17,786
expectation gaussian linear
# Copyright 2017-2020 The GPflow Contributors. 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 appli...
17,787
get command query
import logging from typing import Dict, List, Optional, Tuple, Union import requests from requests.exceptions import ConnectionError, HTTPError from zulip_bots.lib import BotHandler commands_list = ("list", "top", "help") class YoutubeHandler: def usage(self) -> str: return """ This plugin ...
17,788
pipeline runner
# 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 use ...
17,789
type2str
#!/usr/bin/env python # binja type library info utility import os, sys, re, random import binaryninja from binaryninja.enums import * from binaryninja import typelibrary # The class Type as defined in api/python/types.py is nearly a discriminated union. # By examining the .type_class member you can decide which prope...
17,790
build topo
#!/usr/bin/env python # SPDX-License-Identifier: ISC # # Copyright (c) 2022 by # Donatas Abraitis <donatas@opensourcerouting.org> # """ Test if BGP SoO per neighbor works correctly. Routes having SoO extended community MUST be rejected if the neighbor is configured with soo (neighbor soo). """ import os import sys i...
17,791
initialize
# Necessary imports. Provides library functions to ease writing tests. from lib import prebuild, testcase, SUBMITTY_INSTALL_DIR import subprocess import os import glob import shutil import traceback ############################################################################ # COPY THE ASSIGNMENT FROM THE SAMPLE ASSI...
17,792
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...
17,793
save data
from fud.stages import Stage, SourceType, Source from fud.utils import shell, TmpDir from fud.errors import MissingDynamicConfiguration from pathlib import Path # The temporary filename used for converting mrxl.data to verilog.data _DATA_FILE = "data.json" class MrXLStage(Stage): """ Stage that invokes the ...
17,794
crop export data
import wx import os class ExportDialog(wx.Dialog): def __init__(self,parent, roi=None): wx.Dialog.__init__(self, parent, title='Export Data') vsizer = wx.BoxSizer(wx.VERTICAL) # hsizer = wx.BoxSizer(wx.HORIZONTAL) # # hsizer.Add(wx.StaticText(self, -1, 'Format:'), 0, wx.ALL|wx.ALIGN...
17,795
start
"""XKNX is an Asynchronous Python module for reading and writing KNX/IP packets.""" from __future__ import annotations import asyncio from collections.abc import Awaitable import logging from logging.handlers import TimedRotatingFileHandler import os import signal from sys import platform from types import TracebackTy...
17,796
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...
17,797
sample program configs
# Copyright (c) 2021 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 appli...
17,798
end points
""" Curve Wrappers """ from math import pi as PI from rpw import revit, DB from rpw.base import BaseObjectWrapper from rpw.db.element import Element from rpw.db.xyz import XYZ from rpw.utils.mixins import ByNameCollectMixin class Curve(BaseObjectWrapper): """ DB.Curve Wrapper >>> curve = Curve.new(Exis...
17,799
get camera functionality
#!/usr/bin/env python """ Provides the (software) time base for a film. Hazen 04/17 """ from PyQt5 import QtCore import storm_control.sc_library.parameters as params import storm_control.hal4000.halLib.halFunctionality as halFunctionality import storm_control.hal4000.halLib.halMessage as halMessage import storm_con...