id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
18,800
cb
#!/usr/bin/python # # (c) 2008 Mandriva, http://www.mandriva.com/ # # $Id$ # # This file is part of Pulse 2, http://pulse2.mandriva.org # # Pulse 2 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 versio...
18,801
field
""" component_wise_divide ===================== Autogenerated DPF operator classes. """ from warnings import warn from ansys.dpf.core.dpf_operator import Operator from ansys.dpf.core.inputs import Input, _Inputs from ansys.dpf.core.outputs import Output, _Outputs from ansys.dpf.core.operators.specification import PinSp...
18,802
from json
# THIS FILE IS AUTO-GENERATED. DO NOT EDIT from verta._swagger.base_type import BaseType class ModeldbCreateExperimentRun(BaseType): def __init__(self, id=None, project_id=None, experiment_id=None, name=None, description=None, date_created=None, date_updated=None, start_time=None, end_time=None, code_version=None, c...
18,803
future loading
# Copyright © 2021 United States Government as represented by the Administrator of the National Aeronautics and Space Administration. All Rights Reserved. # This ensures that the directory containing examples is in the python search directories """ This example demonstrates the Polynomial Chaos Expansion (PCE) Surro...
18,804
flags
# SPDX-FileCopyrightText: Red Hat, Inc. # SPDX-License-Identifier: GPL-2.0-or-later from __future__ import absolute_import import re from collections import namedtuple from vdsm.common import cache from vdsm.common import cpuarch _PATH = '/proc/cpuinfo' CpuInfo = namedtuple('CpuInfo', 'flags, frequency, model, pp...
18,805
df expected station
import datetime as dt from zoneinfo import ZoneInfo import polars as pl import pytest from polars.testing import assert_frame_equal from wetterdienst.provider.imgw.hydrology.api import ImgwHydrologyRequest, ImgwHydrologyResolution @pytest.fixture def METHOD_NAME(): return pl.DataFrame( { "st...
18,806
make qsci
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import os from spack.package import * class Qscintilla(QMakePackage): """ QScintilla is a port to Qt of Neil Ho...
18,807
test class weight
# ============================================================================== # Copyright 2021 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.o...
18,808
py serialize headers
"""Http related parsers and protocol.""" import asyncio import zlib from typing import Any, Awaitable, Callable, NamedTuple, Optional, Union # noqa from multidict import CIMultiDict from .abc import AbstractStreamWriter from .base_protocol import BaseProtocol from .compression_utils import ZLibCompressor from .help...
18,809
test to client
# coding=utf-8 # Copyright 2021-present, the Recognai S.L. 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 ...
18,810
create ecies aead hkdf key template
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
18,811
test get response rspauth
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.words.protocols.jabber.sasl_mechanisms}. """ from twisted.python.compat import networkString from twisted.trial import unittest from twisted.words.protocols.jabber import sasl_mechanisms class PlainTests(unittest.TestCa...
18,812
make curves
import numpy as np import bpy from bpy.props import EnumProperty, IntProperty from sverchok.node_tree import SverchCustomTreeNode from sverchok.data_structure import updateNode, zip_long_repeat, ensure_nesting_level from sverchok.utils.geom_2d.merge_mesh import crop_mesh_delaunay from sverchok.utils.sv_mesh_utils im...
18,813
test no header row
#!/usr/bin/env python import sys from unittest.mock import patch import agate from csvkit.utilities.csvstat import CSVStat, launch_new_instance from tests.utils import ColumnsTests, CSVKitTestCase, EmptyFileTests, NamesTests class TestCSVStat(CSVKitTestCase, ColumnsTests, EmptyFileTests, NamesTests): Utility =...
18,814
test get direct user nodes
# pylint: disable=missing-function-docstring, missing-module-docstring import os from pyccel.parser.parser import Parser from pyccel.errors.errors import Errors from pyccel.ast.basic import Basic from pyccel.ast.core import Assign, Return, FunctionDef, AugAssign, FunctionDefArgument from pyccel.ast.l...
18,815
close
import io import itertools import sys import typing from .._models import Request, Response from .._types import SyncByteStream from .base import BaseTransport if typing.TYPE_CHECKING: from _typeshed import OptExcInfo # pragma: no cover from _typeshed.wsgi import WSGIApplication # pragma: no cover _T = typ...
18,816
create divisions
""" manage.py import_divisionsets_from_csv -f FILE, --file FILE Path to import e.g: /foo/bar/baz.csv -u URL, --url URL URL to import e.g: http://foo.bar/baz.csv -s S3, --s3 S3 S3 key to import e.g: foo/bar/baz.csv This command imports a CSV containing division names from an Electoral Change Order and...
18,817
process email
from email.headerregistry import Address from typing import Callable, Dict, Optional, Set, Tuple from django.core import validators from django.core.exceptions import ValidationError from django.utils.translation import gettext as _ from zerver.lib.name_restrictions import is_disposable_domain # TODO: Move Disposabl...
18,818
parameters
""" Copyright (c) 2018-2023 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 law or agreed to in writin...
18,819
test cluster gcn correctness
import pytest import torch from torch_geometric.data import Data from torch_geometric.loader import ClusterData, ClusterLoader from torch_geometric.testing import onlyFullTest, onlyOnline from torch_geometric.utils import sort_edge_index try: # TODO Using `pyg-lib` metis partitioning leads to some weird bugs in t...
18,820
wtf field kwargs
# This file is part of Indico. # Copyright (C) 2002 - 2023 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from copy import deepcopy from wtforms.fields import BooleanField, StringField, TextAreaField from wtform...
18,821
sift down
''' Implement a Min-Heap class that supports Building a Min Heap from an input array of integers. Inserting integers in the heap. Removing the heap's minimum / root value. Peeking at the heap's minimum / root value. Sifting integers up and down the heap, which is to be used when inserting and removing value...
18,822
test copy with attributes
import unittest import warnings from pathlib import Path from robot.utils.asserts import (assert_equal, assert_false, assert_not_equal, assert_raises, assert_raises_with_msg, assert_true) from robot.model import TestSuite, TestCase, Keyword from robot.model.testcase import TestCases ...
18,823
test scalar len1 first dim
# 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. """ Unit tests for the :mod:`iris.fileformats._structured_array_identification.ArrayStructure` class. """ # Import iris.tests...
18,824
expected text
# SPDX-FileCopyrightText: Ryan Roden-Corrent (rcorre) <ryan@rcorre.net> # # SPDX-License-Identifier: GPL-3.0-or-later """Test the keyhint widget.""" import pytest from qutebrowser.utils import usertypes from qutebrowser.misc import objects from qutebrowser.misc.keyhintwidget import KeyHintView def METHOD_NAME(*arg...
18,825
tags
# 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...
18,826
check same targets
#! /usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2011 (ita) """ Common mistakes highlighting. There is a performance impact, so this tool is only loaded when running ``waf -v`` """ typos = { 'feature':'features', 'sources':'source', 'targets':'target', 'include':'includes', 'export_include':'export_includes',...
18,827
test warn on host array
import numpy as np from numba import cuda from numba.cuda.testing import unittest, CUDATestCase, skip_on_cudasim from numba.tests.support import linux_only, override_config from numba.core.errors import NumbaPerformanceWarning import warnings @skip_on_cudasim('cudasim does not raise performance warnings') class TestW...
18,828
add logging level
"""Manages logging configuration for DVC repo.""" import logging import logging.config import logging.handlers import os import sys import colorama from dvc.env import DVC_SHOW_TRACEBACK from dvc.progress import Tqdm def METHOD_NAME(level_name, level_num, method_name=None): """ Adds a new logging level to ...
18,829
df to csv task
from typing import Any, Dict, List import pandas as pd from prefect import Flow from prefect.utilities import logging from prefect.utilities.tasks import task from viadot.flows.adls_to_azure_sql import METHOD_NAME from viadot.task_utils import METADATA_COLUMNS, add_ingestion_metadata_task from ..tasks import AzureDa...
18,830
test grdview on a plane with colored
""" Test Figure.grdview. """ import pytest from pygmt import Figure, grdcut from pygmt.exceptions import GMTInvalidInput from pygmt.helpers import GMTTempFile, data_kind from pygmt.helpers.testing import load_static_earth_relief @pytest.fixture(scope="module", name="region") def fixture_region(): """ Test reg...
18,831
parse connection string
""" Plugin for django-redis that supports redis sentinel. Credits : - https://github.com/lamoda/django-sentinel - https://github.com/KabbageInc/django-redis-sentinel """ import logging import random from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils.cache impo...
18,832
main
#!/usr/bin/env python """ Copyright (C) 2022 Intel Corporation Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception """ from subprocess import Popen, DEVNULL, PIPE import argparse import os import json TM...
18,833
list dataset collection files
import logging from typing import Final from aiocache import cached from fastapi import APIRouter, Depends, Header, Request from fastapi_pagination import Page, Params from fastapi_pagination.api import create_page, resolve_params from fastapi_pagination.bases import RawParams from servicelib.fastapi.requests_decorato...
18,834
find socket ids
import logging from collections.abc import Iterator from contextlib import contextmanager from dataclasses import dataclass from typing import Final from aiohttp import web from servicelib.logging_utils import get_log_record_extra, log_context from .registry import ( RedisResourceRegistry, ResourcesDict, ...
18,835
sort parts
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2016-2018 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in ...
18,836
test change xml template list
import xml.etree.ElementTree as ET import pytest import salt.utils.xmlutil as xml @pytest.fixture def xml_doc(): return ET.fromstring( """ <domain> <name>test01</name> <memory unit="MiB">1024</memory> <cpu> <topology sockets="1"/> <...
18,837
test all no replace self
# Copyright (c) 2017 The University of Manchester # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
18,838
setup csv param file space
from pytest import raises from numpy.testing import assert_equal, assert_allclose import numpy as np import pytest from SALib.util import ( read_param_file, _scale_samples, _unscale_samples, compute_groups_matrix, ) from SALib.sample import latin @pytest.fixture(scope="function") def setup_param_fil...
18,839
html escape
""" This Module contains generic utility functions for creating plots within PyCBC. """ import os.path, pycbc.version import configparser as ConfigParser from html.parser import HTMLParser from xml.sax.saxutils import escape, unescape escape_table = { '"': "&quot;", "'": "&apos;", ...
18,840
shlex process stream
from __future__ import annotations import typing as t import click from globus_cli.types import DATA_CONTAINER_T F = t.TypeVar("F", bound=t.Callable) def str2bool(v: str) -> bool | None: v = v.lower() if v in ("y", "yes", "t", "true", "on", "1"): return True elif v in ("n", "no", "f", "false",...
18,841
list in string
""" A utility designed to clean up CSV data. """ from .table import Table import argparse import os import datetime import copy import re parser = argparse.ArgumentParser(description='Clean all of the datas.') parser.add_argument( '--input', dest='input', default=False, help='The csv to clean up.') args = p...
18,842
layout
import plotly.graph_objs as go import cea.plots.optimization from cea.plots.variable_naming import NAMING, COLOR __author__ = "Daren Thomas" __copyright__ = "Copyright 2019, Architecture and Building Systems - ETH Zurich" __credits__ = ["Jimeno A. Fonseca", "Daren Thomas"] __license__ = "MIT" __version__ = "0.1" ...
18,843
classify input file
"""util.py - General utilities for running, loading, and processing benchmarks """ import json import os import tempfile import subprocess import sys # Input file type enumeration IT_Invalid = 0 IT_JSON = 1 IT_Executable = 2 _num_magic_bytes = 2 if sys.platform.startswith('win') else 4 def is_executable_file(filena...
18,844
test gpu
# Copyright 2019-2022 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 from dace.transformation.interstate import FPGA...
18,845
build cancel tx
import logging from typing import List, Generator from ..common_neon.errors import NoMoreRetriesError from ..common_neon.solana_tx import SolTx from ..common_neon.solana_tx_legacy import SolLegacyTx from ..common_neon.solana_tx_list_sender import SolTxSendState from ..common_neon.utils import NeonTxResultInfo from .....
18,846
test request args
import asyncio import asynctest from stig.client.errors import AuthError, ConnectionError from stig.client.poll import RequestPoller class TestRequestPoller(asynctest.ClockedTestCase): def setUp(self): self.mock_request_args = None self.mock_request_kwargs = None self.mock_request_calls ...
18,847
test registry duplicated entry
import os import pytest from wazuh_testing import global_parameters import wazuh_testing.fim as fim from wazuh_testing.tools.configuration import load_wazuh_configurations from wazuh_testing.tools.utils import get_version # Helper functions def extra_configuration_after_yield(): fim.delete_registry(fim.registry_...
18,848
test multiple success blocking user
"""retire user test""" import hashlib import pytest from django.contrib.auth import get_user_model from social_django.models import UserSocialAuth from users.factories import UserFactory, UserSocialAuthFactory from users.management.commands import retire_users from users.models import BlockList User = get_user_model(...
18,849
cache logo
import os import subprocess import warnings import requests cache_dir = os.path.expanduser(os.getenv('XDG_CACHE_HOME', "~/.cache") + "/bugwarrior") logo_path = cache_dir + "/logo.png" logo_url = "https://upload.wikimedia.org/wikipedia/" + \ "en/5/59/Taskwarrior_logo.png" def METHOD_NAME(): if os.path.exist...
18,850
complete
#!/usr/bin/env python # # Simple tool for managing the Splash Screen in MIT App Inventor using # the Remote API Service # # @author Jeffrey I. Schiller <jis@mit.edu> import os import sys import getpass from getopt import getopt, GetoptError os.environ['SERVER_SOFTWARE'] = 'MIT SplashScreen Manager 1.0' # Googlism d...
18,851
test table stream
# Copyright 2018- The Pixie 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 w...
18,852
url
# -------------------------------------------------------------------------------------------- # 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 # --------------------------------...
18,853
abfsdatetime to timestamp
# 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 may not use this file ex...
18,854
setprofile
import sys from collections.abc import Callable, Iterable, Mapping from types import TracebackType from typing import Any, List, Optional, Type, TypeVar, Union _T = TypeVar("_T") __all__ = [ "get_ident", "active_count", "Condition", "current_thread", "enumerate", "main_thread", "TIMEOUT_MA...
18,855
enumerate user metas
import requests import time import json from django.core.cache import cache import logging from heltour import settings logger = logging.getLogger(__name__) def _apicall(url, timeout=1800, check_interval=0.1, post_data=None): # Make a request to the local API worker to put the result of a lichess API call into t...
18,856
test properties context manager
import os import sys import time import unittest import xlwings as xw from .common import SPEC, TestBase, this_dir class TestApps(TestBase): def test_active(self): self.assertTrue(xw.apps.active in [self.app1, self.app2]) def test_len(self): n_original = len(xw.apps) app = xw.App(sp...
18,857
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 # --------------------------------...
18,858
get event categories
# 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...
18,859
test add season repeated months
# 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. """ Test the coordinate categorisation functions. """ # import iris tests first so that some things can be initialised before ...
18,860
get low critical threshold
#!/usr/bin/env python3 ######################################################################## # # Module contains an implementation of SONiC Platform Base API and # provides the Thermals' information which are available in the platform # ######################################################################## try:...
18,861
nnls
#!/usr/bin/env python # -*- coding: utf-8 -*- """Non-negative least squares""" # The scipy library provides an nnls solver, but it does # not generalize efficiently to matrix-valued problems. # We therefore provide an alternate solver here. # # The vectorized solver uses the L-BFGS-B over blocks of # data to efficient...
18,862
sql bulk insert from records incremental
import collections import logging import tempfile import typing as T from contextlib import contextmanager, nullcontext from pathlib import Path from simple_salesforce import Salesforce from sqlalchemy import Column, Integer, MetaData, Table, Unicode, inspect from sqlalchemy.engine.base import Connection from sqlalche...
18,863
preprocess xml
import os from xml.etree import ElementTree from .utils import get_class_names import numpy as np from ..abstract import Loader class VOC(Loader): """ Dataset loader for the falling things dataset (FAT). # Arguments data_path: Data path to VOC2007 annotations split: String determining the da...
18,864
delete
""" Class to implement the Small Files benchmark as a subclass of the benchmark operator This workload is required an elastic-search instance to run. """ # Builtin modules import logging # Local modules from ocs_ci.framework import config from ocs_ci.ocs import constants, benchmark_operator from ocs_ci.ocs.benchmar...
18,865
annotate label bitmasks
""" Avoiding direct model imports in here so that we can import these functions into places that should not initiate the Django app registry. Modified from: https://github.com/learningequality/kolibri/blob/0f6bb6781a4453cd9fdc836d52b65dd69e395b20/kolibri/core/content/utils/search.py With model import references chang...
18,866
index content
from abc import ABC from abc import abstractmethod import pluggy from sqlalchemy.orm import Session import typing from tracim_backend.config import CFG from tracim_backend.lib.core.content import ContentApi from tracim_backend.lib.core.userworkspace import RoleApi from tracim_backend.lib.utils.logger import logger fro...
18,867
write data
# ---------------------------------------------------------------------------- # CLASSES: nightly # # Test Case: zerocopy.py # # Tests: libsim - connecting to simulation and retrieving data from it. # # Programmer: Brad Whitlock # Date: Wed Jul 22 16:07:12 PDT 2015 # # Modifications: # # -------------...
18,868
url concat
import re import socket from urllib.parse import urlencode import dns from dns.resolver import NXDOMAIN, NoAnswer, NoNameservers, Resolver, Timeout from tldextract import extract as tld_extract from inbox.logging import get_logger log = get_logger("inbox.util.url") from inbox.providers import providers # http://ww...
18,869
array
# *************************************************************************** # * Copyright (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> * # * Copyright (c) 2009, 2010 Ken Cline <cline@frii.com> * # * Copyright (c) 2020 FreeCAD Developers * # * ...
18,870
private method
from unittest import mock from pyramid import testing from pyramid.exceptions import ConfigurationError from kinto.core import statsd from kinto.core.testing import skip_if_no_statsd, unittest from .support import BaseWebTest class TestedClass: attribute = 3.14 def test_method(self): pass def...
18,871
test cloud app properties
from collections import OrderedDict from unittest import TestCase try: from generator import Generator except ImportError as error: from generator.generator import Generator from model.integer import Integer from model.param import Param from model.string import String from model.struct import Struct from tra...
18,872
create app with config
# SPDX-License-Identifier: Apache-2.0 # Copyright 2023 The HuggingFace Authors. import uvicorn from libapi.config import UvicornConfig from libapi.jwt_token import get_jwt_public_keys from libapi.routes.healthcheck import healthcheck_endpoint from libapi.routes.metrics import create_metrics_endpoint from libapi.utils ...
18,873
test index users all extra links
from functools import reduce import operator from django.contrib.auth.models import Group, Permission from django.db.models import Q from django.test import TestCase, override_settings from django.urls import reverse from django.utils.crypto import get_random_string from accounts.models import User from zentral.conf im...
18,874
config dict errors
"""Library for the ingress relation. This library contains the Requires and Provides classes for handling the ingress interface. Import `IngressRequires` in your charm, with two required options: - "self" (the charm itself) - config_dict `config_dict` accepts the following keys: - service-hostname (requi...
18,875
parse page
# -*- coding: utf-8 -*- """Parser for Safari Binary Cookie files.""" import os from dfdatetime import cocoa_time as dfdatetime_cocoa_time from dtfabric.runtime import data_maps as dtfabric_data_maps from plaso.containers import events from plaso.lib import cookie_plugins_helper from plaso.lib import dtfabric_helper...
18,876
dist handle
import os # toolchains options ARCH='arm' CPU='cortex-m4' CROSS_TOOL='gcc' # bsp lib config BSP_LIBRARY_TYPE = None if os.getenv('RTT_CC'): CROSS_TOOL = os.getenv('RTT_CC') if os.getenv('RTT_ROOT'): RTT_ROOT = os.getenv('RTT_ROOT') # cross_tool provides the cross compiler # EXEC_PATH is the compiler execute...
18,877
test module not found
from . import util as test_util machinery = test_util.import_importlib('importlib.machinery') import os import re import sys import unittest import warnings from test import support from test.support import import_helper from contextlib import contextmanager from .util import temp_module import_helper.import_module('...
18,878
execute load in source
import hashlib from dagster import ( In, List, Nothing, Out, _check as check, op, ) from dagster_pandas import DataFrame from google.cloud.bigquery.encryption_configuration import EncryptionConfiguration from google.cloud.bigquery.job import LoadJobConfig, QueryJobConfig from google.cloud.bigqu...
18,879
test normalize scores
# # Pyserini: Reproducible IR research with sparse and dense representations # # 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...
18,880
test read gzip files
# Copyright 2017 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...
18,881
test pushing to registry
import io import sys from pathlib import Path from uuid import uuid4 import pendulum import pytest from _pytest.capture import CaptureFixture from prefect.utilities.dockerutils import ( ImageBuilder, PushError, push_image, silence_docker_warnings, ) from prefect.utilities.slugify import slugify with ...
18,882
main
# Copyright © 2021 United States Government as represented by the Administrator of the National Aeronautics and Space Administration. All Rights Reserved. from io import StringIO import sys import unittest from prog_models.models import BatteryElectroChemEOD as Battery from prog_models.data_models import DMDModel ...
18,883
check pip version
#!/usr/bin/env python3 import argparse import os import shutil import subprocess import sys import re from typing import Optional, Union from pathlib import Path SOURCE_ROOT = Path(__file__).parent.parent VERBOSE = False sys.path.append(str(SOURCE_ROOT)) # Colours ANSI_BLUE = "\x1b[94;20m" ANSI_RED = "\x1b[91;20m" A...
18,884
compose fn
# Functions for synthesizing magic methods for JIT-compiled dataclasses import ast import dataclasses import inspect import os from functools import partial from typing import Callable, Dict, List from torch._jit_internal import FAKE_FILENAME_PREFIX, is_optional from torch._sources import ParsedDef, SourceContext de...
18,885
version constraint
# Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import os.path import runpy import subprocess from typing import List # required env vars: # CU_VERSION: E.g. ...
18,886
set body
import unittest import xmlrpc.client from DateTime import DateTime class FauxResponse: def __init__(self): self._headers = {} self._body = None def METHOD_NAME(self, body): self._body = body def setHeader(self, name, value): self._headers[name] = value def setStatu...
18,887
quiet image
# Copyright 2019 pydicom authors. See LICENSE file for details. """Pydicom command line interface program for `pydicom show`""" import argparse from collections.abc import Callable from pydicom.dataset import Dataset from pydicom.cli.main import filespec_help, filespec_parser def add_subparser(subparsers: argparse....
18,888
method
# -------------------------------------------------------------------------------------------- # 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 # --------------------------------...
18,889
test close assignment
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt import unittest import frappe from frappe.utils import add_days, getdate, nowdate from erpnext.projects.doctype.task.task import CircularReferenceError class TestTask(unittest.TestCase): ...
18,890
test doc example
import doctest import pytest from insights.core.exceptions import SkipComponent from insights.parsers import tuned from insights.parsers.tuned import Tuned from insights.tests import context_wrap TUNED_OUTPUT = ''' Available profiles: - balanced - desktop - latency-performance - network-latency - network-throughput -...
18,891
extract data
# 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) AutoRest Code Generator. # Changes may ...
18,892
load field
# coding: utf-8 from pathlib import Path import numpy as np from sklearn.datasets import load_svmlight_file import lightgbm as lgb EXAMPLES_DIR = Path(__file__).absolute().parents[2] / 'examples' class FileLoader: def __init__(self, directory, prefix, config_file='train.conf'): self.directory = direct...
18,893
compute minimum eigenvalue
# This code is part of Qiskit. # # (C) Copyright IBM 2022. # # 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 derivative wo...
18,894
should retry
#!/usr/bin/env python # # Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved. # from __future__ import annotations """This module implements the base class for authenticator classes. Note: **kwargs are added to most functions so that child classes can safely ignore extra in arguments in case of ...
18,895
test annotation post schema full
# 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...
18,896
test local dict
import pytest from diofant import (Abs, And, Float, Function, I, Integer, Limit, Mul, Pow, Rational, Symbol, exp, sin) from diofant.parsing.sympy_parser import (TokenError, convert_xor, function_exponentiation, imp...
18,897
forwards global
import logging import math import time from typing import Sequence from snuba.clickhouse.native import ClickhousePool from snuba.clusters.cluster import ClickhouseClientSettings, get_cluster from snuba.clusters.storage_sets import StorageSetKey from snuba.migrations import migration, operations TABLE_NAME = "querylog...
18,898
main
#!/usr/bin/env python3 # -*- coding: utf-8; py-indent-offset: 4 -*- # # Author: Linuxfabrik GmbH, Zurich, Switzerland # Contact: info (at) linuxfabrik (dot) ch # https://www.linuxfabrik.ch/ # License: The Unlicense, see LICENSE file. # https://github.com/Linuxfabrik/monitoring-plugins/blob/main/CONTRIBUTING....
18,899
setxattr
#! /usr/bin/env python # encoding: utf-8 """ Use extended attributes instead of database files 1. Input files will be made writable 2. This is only for systems providing extended filesystem attributes 3. By default, hashes are calculated only if timestamp/size change (HASH_CACHE below) 4. The module enables "deep_inp...