id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
7,900
test call script
# -*- encoding: utf-8 -*- import multiprocessing import os import sys import pytest import six from tests.utils import call_program from . import utils def METHOD_NAME(monkeypatch): # Set a very short timeout to exit fast monkeypatch.setenv("DD_PROFILING_API_TIMEOUT", "0.1") monkeypatch.setenv("DD_PROF...
7,901
test enrich error message
# Copyright (c) 2021, Victor Martinez <VictorMartinezRubio@gmail.com> # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # SPDX-License-Identifier: GPL-3.0-or-later from __future__ import (absolute_import, division, print_function) __metaclass__ = type f...
7,902
set configuration
import FWCore.ParameterSet.Config as cms def METHOD_NAME(process, collection, mode, monitorFile, binaryFile, primaryWidth = 0.0, cosmicsZeroTesla = False): ############# ## general ## ############# process.load("Alignment.CommonAlignmentProducer.AlignmentProducerAsAnalyzer_cff") ...
7,903
test no var
#!/usr/bin/env python # For plotting and testing import matplotlib matplotlib.use('Agg') matplotlib.rcParams.update(matplotlib.rcParamsDefault) from pytest import raises from collections import namedtuple # Msaf imports import msaf from msaf.configparser import (AddConfigVar, BoolParam, EnumStr, ...
7,904
load config
from __future__ import absolute_import import inspect import os import sys import lit.Test import lit.formats import lit.TestingConfig import lit.util # LitConfig must be a new style class for properties to work class LitConfig(object): """LitConfig - Configuration data for a 'lit' test runner instance, shared ...
7,905
composite mapper
import pytest from vtkmodules.vtkCommonCore import vtkLookupTable import pyvista as pv from pyvista.plotting.METHOD_NAME import BlockAttributes, CompositePolyDataMapper @pytest.fixture() def METHOD_NAME(multiblock_poly): pl = pv.Plotter() actor, mapper = pl.add_composite(multiblock_poly) return mapper ...
7,906
from json
from typing import Any, AnyStr from django.contrib.gis.gdal import CoordTransform, SpatialReference from django.contrib.gis.gdal.base import GDALBase from django.contrib.gis.gdal.envelope import Envelope from django.contrib.gis.gdal.geomtype import OGRGeomType from django.contrib.gis.geos import GEOSGeometry class OG...
7,907
fetch from airtable
import gzip import os from typing import Optional import pandas as pd import pendulum from calitp_data_infra.auth import get_secret_by_name from calitp_data_infra.storage import get_fs, make_name_bq_safe from pyairtable import Table from pydantic import BaseModel from airflow.models import BaseOperator def process_...
7,908
test taskpriority detail api unauthorized
import urllib.parse from django.contrib.auth.models import User from django.test import TestCase from dfirtrack_main.models import Taskpriority class TaskpriorityAPIViewTestCase(TestCase): """taskpriority API view tests""" @classmethod def setUpTestData(cls): # create object Taskpriorit...
7,909
close
# 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 ...
7,910
closeup ovn
# # ovirt-engine-setup -- ovirt engine setup # # Copyright oVirt Authors # SPDX-License-Identifier: Apache-2.0 # # """OVN plugin.""" import gettext import os from otopi import constants as otopicons from otopi import filetransaction from otopi import plugin from otopi import util from ovirt_engine_setup import con...
7,911
test columnize
# Copyright (c) 2011 Florian Mounier # Copyright (c) 2012 Tycho Andersen # Copyright (c) 2014 Sean Vig # # 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...
7,912
test audio volume muted png
""" test_images.py contains unittests for libqtile.images.Img and its supporting code. """ import os from glob import glob from os import path import cairocffi import cairocffi.pixbuf import pytest from libqtile import images TEST_DIR = path.dirname(os.path.abspath(__file__)) DATA_DIR = path.join(TEST_DIR, "data") P...
7,913
admin passphrase
# coding: utf-8 """ NetHSM All endpoints expect exactly the specified JSON. Additional properties will cause a Bad Request Error (400). All HTTP errors contain a JSON structure with an explanation of type string. All <a href=\"https://tools.ietf.org/html/rfc4648#section-4\">base64</a> encoded values are Big E...
7,914
get args
#!/usr/bin/env python # Copyright 2020 Johns Hopkins University (Author: Desh Raj) # Apache 2.0 # This script is based on the Bayesian HMM-based xvector clustering # code released by BUTSpeech at: https://github.com/BUTSpeechFIT/VBx. # Note that this assumes that the provided labels are for a single # recording. So th...
7,915
save to gcs
import gzip import os from typing import Optional import pandas as pd import pendulum from calitp_data_infra.auth import get_secret_by_name from calitp_data_infra.storage import get_fs, make_name_bq_safe from pyairtable import Table from pydantic import BaseModel from airflow.models import BaseOperator def process_...
7,916
download path
""" Update session object for tracking state across multiple calls """ import base64 from collections import namedtuple import enum import logging import os import shutil from typing import Mapping, Optional, Union import uuid import functools from . import constants, config from aiohttp import web SESSION_VARNAME ...
7,917
test length reader read invalid size
# -*- encoding: utf-8 -*- import io import t import pytest from unittest import mock from gunicorn import util from gunicorn.http.body import Body, LengthReader, EOFReader from gunicorn.http.wsgi import Response from gunicorn.http.unreader import Unreader, IterUnreader, SocketUnreader from gunicorn.http.errors import...
7,918
teardown
# Copyright (c) Facebook, Inc. and its affiliates. import logging import torch from mmf.trainers.callbacks.base import Callback from mmf.utils.configuration import get_mmf_env from mmf.utils.logger import ( calculate_time_left, setup_output_folder, summarize_report, TensorboardLogger, WandbLogger, ...
7,919
request
import asyncio import copy import logging import urllib.parse from contextlib import contextmanager from fnmatch import fnmatchcase from disnake import Embed from disnake.http import HTTPClient, Route from tests.discord_mock_data import MESSAGE_ID, RESPONSES, TEST_CHANNEL_ID, TEST_DMCHANNEL_ID from tests.utils import...
7,920
acc0key hold accident
from binascii import hexlify import json import pytest from cryptoadvance.specter.key import Key from embit.bip39 import mnemonic_to_seed from embit.bip32 import HDKey, NETWORKS from embit import script @pytest.fixture def mnemonic_ghost_machine(): return 11 * "ghost " + "machine" @pytest.fixture def mnemonic_...
7,921
infer observed and model labels
# ---------------------------------------------------------------------------- # Copyright (C) 2021-2023 Deepchecks (https://www.deepchecks.com) # # This file is part of Deepchecks. # Deepchecks is distributed under the terms of the GNU Affero General # Public License (version 3 or later). # You should have received a ...
7,922
label to contour
#!/usr/bin/env python3 import json import os import cv2 import numpy as np class LabelBoxParser: """ Class to read an exported labelbox annotation file (must be JSON formatted) and call a user specified callback function with this parsed annotation along with the image it annotates. """ def ...
7,923
read sound file
from test import support from test.support import import_helper, warnings_helper import warnings support.requires('audio') from test.support import findfile with warnings.catch_warnings(): warnings.simplefilter("ignore", DeprecationWarning) ossaudiodev = import_helper.import_module('ossaudiodev') audioop = wa...
7,924
is secure
# The following was taken from: # # https://github.com/machinalis/mypy-django/blob/master/django/http/request.pyi # # The file is dated April 2017, so it may not represent the latest version of Django. # Stubs for django.http.request (Python 3.5) # # NOTE: This dynamically typed stub was automatically generated by s...
7,925
list
# 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 ...
7,926
index
# emacs: -*- mode: python-mode; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## # # See COPYING file distributed along with the NiBabel package for the # copyright and license terms. # ### ### ### #...
7,927
call fn
# 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...
7,928
skip backend
import scipy._lib.uarray as ua from . import _pocketfft class _ScipyBackend: """The default backend for fft calculations Notes ----- We use the domain ``numpy.scipy`` rather than ``scipy`` because in the future, ``uarray`` will treat the domain as a hierarchy. This means the user can install ...
7,929
get by
"""Holder for the custom join/leave messages database class and the associated methods""" import discord from loguru import logger from dozer import db async def send_log(member): """Sends the message for when a user joins or leave a guild""" config = await CustomJoinLeaveMessages.METHOD_NAME(guild_id=member...
7,930
add phase plot
# -*- coding: utf-8 -*- # Dioptas - GUI program for fast processing of 2D X-ray diffraction data # Principal author: Clemens Prescher (clemens.prescher@gmail.com) # Copyright (C) 2014-2019 GSECARS, University of Chicago, USA # Copyright (C) 2015-2018 Institute for Geology and Mineralogy, University of Cologne, Germany ...
7,931
render path
""" ParallelCluster ParallelCluster API # noqa: E501 The version of the OpenAPI document: 3.8.0 Generated by: https://openapi-generator.tech """ class OpenApiException(Exception): """The base exception class for all OpenAPIExceptions""" class ApiTypeError(OpenApiException, TypeError): def...
7,932
check has points
""" ckwg +31 Copyright 2020 by Kitware, 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 of conditions and the ...
7,933
test ga rpn head predict by feat
# Copyright (c) OpenMMLab. All rights reserved. from unittest import TestCase import torch from mmengine.config import ConfigDict from mmengine.structures import InstanceData from mmdet.models.dense_heads import GARPNHead ga_rpn_config = ConfigDict( dict( num_classes=1, in_channels=4, fea...
7,934
test phase proc lp cvxopt
""" Unit Tests for Py-ART's correct/proc_phase.py module. """ # Can also be run as a script to create a ray_plot.png file # python test_phase_proc.py # This file should look like the reference_ray_plot.png file # Use: # python test_phase_proc.py -r # to recreate the reference_rays.npz and reference_ray_plot.png files...
7,935
test 07 assign thermal loss
import os import shutil from _unittest.conftest import config import pytest from pyaedt import Hfss from pyaedt import Icepak from pyaedt import Mechanical test_project_name = "coax_Mech" @pytest.fixture(scope="class") def aedtapp(add_app): app = add_app(application=Mechanical, solution_type="Thermal") ret...
7,936
execute
#!/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...
7,937
test two kernel fusion
__copyright__ = "Copyright (C) 2021 University of Illinois Board of Trustees" __license__ = """ 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 th...
7,938
convert hecke eigenvalues
# If Hecke eigenfield is in the LMFDB, expresses eigenvalues in terms of listed integral basis # TODO: Integrate with LLL-reduced basis? (see NotImplementedError below) import pymongo, hashlib from sage.all import PolynomialRing, QQ, preparse, gp, NumberField, matrix, vector #from sage.all import * #P = subprocess.Po...
7,939
close
import os import wandb from annotator.oneformer.detectron2.utils import comm from annotator.oneformer.detectron2.utils.events import EventWriter, get_event_storage def setup_wandb(cfg, args): if comm.is_main_process(): init_args = { k.lower(): v for k, v in cfg.WANDB.items() ...
7,940
test vector get indexed diffraction vectors warn
# -*- coding: utf-8 -*- # Copyright 2016-2023 The pyXem developers # # This file is part of pyXem. # # pyXem 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 optio...
7,941
get exp
from __future__ import print_function import numpy as nm from sfepy.base.base import pause, Struct from sfepy.homogenization.utils import integrate_in_time def compute_mean_decay(coef): r""" Compute mean decay approximation of a non-scalar fading memory coefficient. """ n_step = coef.shape[0] ...
7,942
main
#!/usr/bin/env python3 import collections import sys import json DepEntry = collections.namedtuple('DepEntry', 'widget dep enable die hide') dep_map = ( DepEntry("title", "preview_frame", "none", True, False), DepEntry("title", "chapters_tab", "none", True, False), DepEntry("title", "start_point", "none",...
7,943
is holiday
import calendar from datetime import datetime, timedelta from typing import Tuple from django.conf import settings from django.utils import timezone from django.utils.timesince import timeuntil MONTHS_IN_YEAR = 12 TIME_ZERO = dict(hour=0, minute=0, second=0, microsecond=0) def get_yesterday_datetime_range() -> Tup...
7,944
assert progress added to all
from contextlib import contextmanager import numpy as np from napari.utils import cancelable_progress, progrange, progress @contextmanager def METHOD_NAME(prog): """Check prog is added to `progress_instances` on init & removed on close""" assert prog in progress._all_instances yield assert prog not ...
7,945
delete
from __future__ import annotations from abc import ABC, abstractmethod from typing import List, Optional, Any, Union from attr import define from azure.core.exceptions import ( ClientAuthenticationError, ResourceNotFoundError, map_error, HttpResponseError, ) from azure.core.pipeline import PipelineRes...
7,946
update
# This module contains abstractions for the input stream. You don't have to # looks further, there are no pretty code. # # We define two classes here. # # Mark(source, line, column) # It's just a record and its only use is producing nice error messages. # Parser does not use it for any other purposes. # # Reader(so...
7,947
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 # --------------------------------...
7,948
get shapefile data
__author__ = 'Irwan Fathurrahman <irwan@kartoza.com>' __date__ = '07/03/17' import os import shapefile import struct from django.conf import settings LIMIT_FILE = 20 * 1024 * 1024 class FileExceedLimit(Exception): def __init__(self): super(FileExceedLimit, self).__init__( 'File Exceed Li...
7,949
disable
from typing import Optional from PySide6.QtGui import QAction from PySide6.QtWidgets import QMenu class MenuEntry: def __init__(self, caption, action, shortcut=None, checkable=False, checked=False, enabled=True, key=None): self.caption = caption self.action = action self.shortcut = shortc...
7,950
save node state
# Copyright 2022 Hathor Labs # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
7,951
test wrapper read only error
import pylvarray import pygeosx import numpy as np import pytest import os # Geosx paths level_zero = 'domain/MeshBodies/mesh1/meshLevels/Level0/' node_manager = level_zero + 'nodeManager/' cell_blocks = level_zero + 'ElementRegions/elementRegionsGroup/dummy/elementSubRegions/cellBlock01/' class TestPygeosxObjects(o...
7,952
pack double
"""Implements (a subset of) Sun XDR -- eXternal Data Representation. See: RFC 1014 """ import struct try: from cStringIO import StringIO as _StringIO except ImportError: from StringIO import StringIO as _StringIO __all__ = ["Error", "Packer", "Unpacker", "ConversionError"] # exceptions class Error(Exceptio...
7,953
bc xpos traction
# ---------------------------------------------------------------------- # # Brad T. Aagaard, U.S. Geological Survey # Charles A. Williams, GNS Science # Matthew G. Knepley, University at Buffalo # # This code was developed as part of the Computational Infrastructure # for Geodynamics (http://geodynamics.org). # # Copy...
7,954
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 . imp...
7,955
set low power mode
# Platform-specific SFP transceiver interface for SONiC # try: import time from sonic_sfp.sfputilbase import SfpUtilBase except ImportError as e: raise ImportError("%s - required module not found" % str(e)) class SfpUtil(SfpUtilBase): """Platform-specific SfpUtil class""" PORT_START = 1 PORT...
7,956
sample predictor 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...
7,957
configure for target
import json class HardwareTargetLoader: def __init__(self, env, target_scons_dir, target_id): self.env = env self.target_scons_dir = target_scons_dir self.target_dir = self._getTargetDir(target_id) # self.target_id = target_id self.layered_target_dirs = [] self.inc...
7,958
usage
#!/usr/bin/python # Tests P2P_Find # Will listen # Then Program will exit ######### MAY NEED TO RUN AS SUDO ############# import dbus import sys, os import time import gobject import threading import getopt from dbus.mainloop.glib import DBusGMainLoop def METHOD_NAME(): print("Usage:") print(" %s -i <interface_nam...
7,959
configure args
# 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 import re from spack.package import * class BerkeleyDb(AutotoolsPackage): """Oracle Berkeley DB""" ho...
7,960
toggle
""" Changing UI styles in response to events This example has a button which cycles its appearance through a repeating list of different styles when pressed, except when it is disabled by the user. If arcade and Python are properly installed, you can run this example with: python -m arcade.gui.examples.style_v2 """ f...
7,961
copyfile
"""Simple HTTP Server. This module builds on BaseHTTPServer by implementing the standard GET and HEAD requests in a fairly straightforward manner. """ __version__ = "0.6" __all__ = ["SimpleHTTPRequestHandler"] import os import posixpath import BaseHTTPServer import urllib import cgi import sys import shutil impor...
7,962
register
import sys import ctypes import neuron import numpy from neuron import h import traceback # reducing the indirection improves performance try: _numpy_core_multiarray_int_asbuffer = numpy.core.multiarray.int_asbuffer except: pass _ctypes_addressof = ctypes.addressof _numpy_array = numpy.array _numpy_frombuffer ...
7,963
calibrate
#! /usr/bin/env python from __future__ import print_function, division import time import logging import sys from os import path, getenv # if PAPARAZZI_HOME not set, then assume the tree containing this # file is a reasonable substitute PPRZ_HOME = getenv("PAPARAZZI_HOME", path.normpath(path.join(path.dirname(path.a...
7,964
on chk nightdone
from __future__ import annotations import re from typing import Optional from src import users from src.containers import UserSet, UserDict from src.decorators import command from src.events import Event, event_listener from src.functions import get_players, get_all_players, match_role from src.messages import messag...
7,965
optimizer
# 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 dataclasses import dataclass, field import torch import torch.distributed as dist from fairseq.dataclass.configs import FairseqBMUFConfi...
7,966
configurator
from unittest.mock import create_autospec import pytest from pyramid.config import Configurator from lms.models.lti_params import CLAIM_PREFIX, LTIParams, includeme class TestLTIParams: @pytest.mark.parametrize( "lti_11_key,value", [ ("user_id", "USER_ID"), ("roles", "Ins...
7,967
row policy
from testflows.core import * from testflows.asserts import error from rbac.requirements import * from rbac.helper.common import * import rbac.helper.errors as errors @contextmanager def METHOD_NAME(node, name, table): try: with Given("I have a row policy"): node.query(f"CREATE ROW POLICY {name...
7,968
buffer decode
""" Python 'utf-8-sig' Codec This work similar to UTF-8 with the following changes: * On encoding/writing a UTF-8 encoded BOM will be prepended/written as the first three bytes. * On decoding/reading if the first three bytes are a UTF-8 encoded BOM, these bytes will be skipped. """ import codecs ### Codec APIs ...
7,969
preferred compression
from collections.abc import Callable, Iterable, Mapping, Sequence from logging import Logger from socket import socket from threading import Condition, Event, Lock, Thread from types import ModuleType from typing import Any, Protocol from typing_extensions import TypeAlias from paramiko.auth_handler import AuthHandler...
7,970
get
'''Define SearchEngine for search dialogs.''' import re from tkinter import StringVar, BooleanVar, TclError from tkinter import messagebox def METHOD_NAME(root): '''Return the singleton SearchEngine instance for the process. The single SearchEngine saves settings between dialog instances. If there is not...
7,971
transform entity query output
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
7,972
test propoerty
import random from math import sqrt from unittest import TestCase import cv2 import numpy as np import torch from mmengine.testing import assert_allclose from mmdet.structures.bbox import HorizontalBoxes from mmdet.structures.mask import BitmapMasks, PolygonMasks class TestHorizontalBoxes(TestCase): def test_i...
7,973
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...
7,974
data
# Copyright (C) 2020 South Western Sydney Local Health District, # University of New South Wales # 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...
7,975
test get bookmarks return from bookmarks supplier
# Copyright (c) "Neo4j" # Neo4j Sweden AB [https://neo4j.com] # # This file is part of Neo4j. # # 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...
7,976
get fingerprint
#!/usr/bin/env python """ Copyright (c) 2006-2023 sqlmap developers (https://sqlmap.org/) See the file 'LICENSE' for copying permission """ import re from lib.core.common import Backend from lib.core.common import Format from lib.core.common import unArrayizeValue from lib.core.data import conf from lib.core.data im...
7,977
convert identity
# -*- coding: utf-8 -*- """Machine type converters for Series scitype. Exports conversion and mtype dictionary for Series scitype: convert_dict: dict indexed by triples of str 1st element = convert from - str 2nd element = convert to - str 3rd element = considered as this scitype - str elements are conversion f...
7,978
get states
#!/usr/bin/env python3 # 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 unittest from typing import Dict, Iterable, Optional, Type, Union import torch f...
7,979
build options
#!/usr/bin/env python3 '''Story Teller: Utility to help analyze log for certain sequence of events. e.g.: reboot (including warm/fast reboot), interface flapping, etc. ''' import argparse import os import subprocess import sys from shlex import quote from sonic_py_common.general import getstatusoutput_noshell_pipe ...
7,980
check subpath
# Copyright Contributors to the Packit project. # SPDX-License-Identifier: MIT """ Functions and classes dealing with syncing files between repositories """ import copy import os import glob import logging from pathlib import Path from typing import List, Optional, Union, Sequence, Iterator from packit.exceptions imp...
7,981
print graphql type
from __future__ import annotations import textwrap from typing import TYPE_CHECKING, List, Optional from strawberry.codegen import CodegenFile, QueryCodegenPlugin from strawberry.codegen.types import ( GraphQLBoolValue, GraphQLEnumValue, GraphQLField, GraphQLFieldSelection, GraphQLFragmentSpread, ...
7,982
get open file limit
""" Utilities for working with file systems """ import os import pathlib from contextlib import contextmanager from pathlib import Path, PureWindowsPath from typing import Union import fsspec import pathspec from fsspec.core import OpenFile from fsspec.implementations.local import LocalFileSystem import prefect def...
7,983
anneal thresh2
#!/usr/bin/python ################## # annealThresh.py # # Copyright David Baddeley, 2011 # d.baddeley@auckland.ac.nz # # 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 L...
7,984
random password
from collections import defaultdict from django.db import models from django.utils import timezone from django.utils.translation import gettext_lazy as _ from rest_framework.exceptions import ValidationError from simple_history.utils import bulk_create_with_history from assets.models import Host from common.db.models...
7,985
register backend
import logging import os import re import tempfile from contextlib import contextmanager from pathlib import Path from urllib.parse import urlparse from django import forms from django.conf import settings from django.utils.translation import gettext as _ from netbox.registry import registry from .choices import Data...
7,986
cert name to str
from _typeshed import Incomplete import _win32typing def CryptProtectData( DataIn, DataDescr: str | None = ..., OptionalEntropy: Incomplete | None = ..., Reserved: Incomplete | None = ..., PromptStruct: _win32typing.PyCRYPTPROTECT_PROMPTSTRUCT | None = ..., Flags: int = ..., ): ... def CryptUn...
7,987
idle task
# Copyright (C) 2016 Intel Corporation. All rights reserved. # # This file 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. # # This fi...
7,988
test get source files
"""Tests for distutils.command.build_clib.""" import unittest import os import sys from test.test_support import run_unittest from distutils.command.build_clib import build_clib from distutils.errors import DistutilsSetupError from distutils.tests import support from distutils.spawn import find_executable class Buil...
7,989
test parameter scale
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest import numpy as np from numpy.testing import assert_allclose from gammapy.modeling import Parameter, Parameters def test_parameter_init(): par = Parameter("spam", 42, "deg") assert par.name == "spam" assert par.factor == 42 ...
7,990
function removed
# Copyright (c) 2015-2023 Vector 35 Inc # # 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, publish, ...
7,991
ancestor exists
from django.utils.translation import gettext from eulxml.xpath import serialize from eulxml.xpath.ast import BinaryExpression, FunctionCall, Step from corehq.apps.case_search.const import OPERATOR_MAPPING, EQ from corehq.apps.case_search.exceptions import CaseFilterError, TooManyRelatedCasesError from corehq.apps.case...
7,992
copy to ssl
import pytest from leapp.libraries.actor.cupsmigrate import migrate_certkey class MockFileSystem(object): def __init__(self, infiles): self.files = {} self.ssl_dir = [] self.files = infiles for path in infiles.keys(): if path.startswith('/etc/cups/ssl'...
7,993
patch sources
from conan import ConanFile from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir, save from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.microsoft import is_msvc import os import textwrap required_conan_version = ...
7,994
stub get resources
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Stub functions that are used by the Amazon API Gateway unit tests. When tests are run against an actual AWS account, the stubber class does not set up stubs and passes all calls through to the Boto3 client. ...
7,995
test hard degree16
# -*- coding: utf-8 -*- from lmfdb.tests import LmfdbTest class NumberFieldTest(LmfdbTest): # All tests should pass def test_Q(self): self.check_args('/NumberField/Q', r'\chi_{1}') self.check_args('/NumberField/1.1.1.1', r'\chi_{1}') def test_hard_degree10(self): self.check_args('/...
7,996
mesh owner
# 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...
7,997
verify dict
""" This module contains methods to load, verify and build configurations for the satosa proxy. """ import logging import os import os.path from satosa.exception import SATOSAConfigurationError from satosa.yaml import load as yaml_load from satosa.yaml import YAMLError logger = logging.getLogger(__name__) class SA...
7,998
add log
# 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...
7,999
get requires for build sdist
#!/usr/bin/env python3 """ maturin's implementation of the PEP 517 interface. Calls maturin through subprocess Currently, the "return value" of the rust implementation is the last line of stdout On windows, apparently pip's subprocess handling sets stdout to some windows encoding (e.g. cp1252 on my machine), even tho...