id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
19,100 | test error with object | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible 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) an... |
19,101 | hex2bin | # SPDX-License-Identifier: LGPL-3.0-or-later
import logging
import numpy as np
from deepmd.nvnmd.data.data import (
jdata_sys,
)
log = logging.getLogger(__name__)
class Encode:
r"""Encoding value as hex, bin, and dec format."""
def __init__(self):
pass
def qr(self, v, nbit: int = 14):
... |
19,102 | test simple | # Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
"""
These tests are mostly from daceml, testing that the einsums for the BERT encoder are correctly specialized to BLAS
nodes.
"""
import pytest
import numpy as np
import dace
from dace.library import change_default
from dace.libraries import ... |
19,103 | do breaks | """Supporting functions for the text/tabular-reporting commands.
Namely: breaks, genemetrics.
"""
import collections
import math
import numpy as np
import pandas as pd
from . import params
from .segmetrics import segment_mean
# _____________________________________________________________________________
# breaks
... |
19,104 | cpu info | # CHIPSEC: Platform Security Assessment Framework
# Copyright (c) 2010-2021, Intel Corporation
#
# 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; Version 2.
#
# This program is distributed in the... |
19,105 | tags | # 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... |
19,106 | get view definition | # Copyright 2021 Collate
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software... |
19,107 | test open template | import unittest
import dbm
import shelve
import glob
import pickle
import os
from test import support
from test.support import os_helper
from collections.abc import MutableMapping
from test.test_dbm import dbm_iterator
def L1(s):
return s.decode("latin-1")
class byteskeydict(MutableMapping):
"Mapping that su... |
19,108 | on checkbox changed | # FIXME:
# - Add symbol resolve once https://github.com/keystone-engine/keystone/issues/351 is fixed
# - Show symbols in disassembly text
# - Support editing existing patches
# - Handle overlap with existing patches
from typing import TYPE_CHECKING, Optional
from PySide6.QtCore import QSize
from PySide6.QtGui import ... |
19,109 | write rating | # Copyright 2016-2022 Nick Boultbee
#
# 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 option) any later version.
from gi.repository import GLib
f... |
19,110 | step failed | import logging
import tempfile
import warnings
from abc import abstractmethod
from contextlib import contextmanager
from pathlib import Path
from typing import Dict, Generator, Iterable, Iterator, Optional, Tuple, TypeVar, Union
from urllib.parse import ParseResult
from tango.common.exceptions import StepStateError
fr... |
19,111 | test non expansion | import pytest
import salt.pillar.consul_pillar as consul_pillar
from tests.support.mock import MagicMock, patch
pytestmark = [
pytest.mark.skipif(
not consul_pillar.consul, reason="python-consul module not installed"
)
]
@pytest.fixture
def base_pillar_data():
return [
{
"Val... |
19,112 | get all experiments | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import os
import sqlite3
import nni
from .constants import NNI_HOME_DIR
from .common_utils import get_file_lock
def config_v0_to_v1(config: dict) -> dict:
if 'clusterMetaData' not in config:
return config
elif 'trainingServicePla... |
19,113 | wsgi | # -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
import importlib.util
import importlib.machinery
import os
import sys
import traceback
from gunicorn import util
from gunicorn.arbiter import Arbiter
from gunicorn.config import Config, get_de... |
19,114 | convert int to string args | ################################################################################
# GangaND280 Project.
# Anthony Hillairet
# Created 10/02/2014
################################################################################
"""@package ND280Executable
This module is designed to run any ND280 executable accessible in t... |
19,115 | test to json | # Copyright 2018 The Cirq Developers
#
# 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 agreed to in ... |
19,116 | set name | import logging
import pickle
import re
import uuid
from copy import deepcopy
from datetime import datetime
import numpy as np
from openpnm.utils import SettingsAttr, Workspace
ws = Workspace()
logger = logging.getLogger(__name__)
__all__ = [
'Project',
]
class ProjectSettings(SettingsAttr):
r"""
uuid... |
19,117 | set requires | from _typeshed import FileDescriptorOrPath, Incomplete, SupportsWrite
from collections.abc import Iterable, Mapping
from re import Pattern
from typing import IO, Any, ClassVar, TypeVar, overload
from typing_extensions import TypeAlias
from .cmd import Command
command_re: Pattern[str]
_OptionsList: TypeAlias = list[t... |
19,118 | plugin init | # -*- coding: utf-8 -*-
# FLEDGE_BEGIN
# See: http://fledge-iot.readthedocs.io/
# FLEDGE_END
""" Module for ImageTest poll mode plugin """
import copy
import logging
import numpy as np
from fledge.common import logger
from fledge.plugins.common import utils
__author__ = "Mark Riddoch"
__copyright__ = "Copyright (c... |
19,119 | latest prerelease | """Module for checking for new releases on GitHub."""
import attr
import pandas as pd
import requests
from typing import List, Dict, Any
REPO_ID = "talmolab/sleap"
ANALYTICS_ENDPOINT = "https://analytics.sleap.ai/ping"
@attr.s(auto_attribs=True)
class Release:
title: str = attr.ib(order=False)
version: str... |
19,120 | modified by id | # Copyright © 2019 Province of British Columbia
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
19,121 | start | from meerk40t.core.cutcode.cutobject import CutObject
from meerk40t.tools.rasterplotter import RasterPlotter
class RasterCut(CutObject):
"""
Rastercut accepts an image of type "L" or "1", and an offset in the x and y.
"""
def __init__(
self,
image,
offset_x,
offset_y,
... |
19,122 | check | #!/usr/bin/python3
import os
import crm_script
data = crm_script.get_input()
health_report = data[1]
print("Processing collected information...")
CORE_PACKAGES = ['corosync', 'pacemaker', 'resource-agents']
warnings = []
errors = []
def warn(fmt, *args):
warnings.append(fmt % args)
def error(fmt, *args):
... |
19,123 | test name returns expected string | # -------------------------------------------------------------------------------------------------
# Copyright (C) 2015-2023 Nautech Systems Pty Ltd. All rights reserved.
# https://nautechsystems.io
#
# Licensed under the GNU Lesser General Public License Version 3.0 (the "License");
# You may not use this file ex... |
19,124 | decode obis | """
*
* by david-m-m 2019-Mar-17
* by datenschuft 2020-Jan-04
*
* this software is released under GNU General Public License, version 2.
* 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 Foundatio... |
19,125 | add cmdline args | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Dropout Poly-encoder.
The dropout poly-encoder mimics a combination of a bi-encoder & poly-encoder during
training, a... |
19,126 | test model repository load error | import pytest
import grpc
from mlserver.cloudevents import (
CLOUDEVENTS_HEADER_SPECVERSION_DEFAULT,
CLOUDEVENTS_HEADER_SPECVERSION,
)
from mlserver.grpc import dataplane_pb2 as pb
from mlserver.grpc.converters import (
InferTensorContentsConverter,
InferInputTensorConverter,
InferOutputTensorConv... |
19,127 | get value | """
Interface to the env_workflow.xml file. This class inherits from EnvBase
"""
from CIME.XML.standard_module_setup import *
from CIME.XML.env_base import EnvBase
from CIME.utils import get_cime_root
import re, math
logger = logging.getLogger(__name__)
# pragma pylint: disable=attribute-defined-outside-init
clas... |
19,128 | test not captured | from contextlib import redirect_stderr, redirect_stdout
from io import StringIO
from pybind11_tests import iostream as m
def test_captured(capsys):
msg = "I've been redirected to Python, I hope!"
m.captured_output(msg)
stdout, stderr = capsys.readouterr()
assert stdout == msg
assert stderr == ""
... |
19,129 | test unload only scene | """
Copyright(C) 2023 Altom Consulting
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.
This program is... |
19,130 | test x minmax transformer | import os
import numpy as np
import deepchem as dc
def load_solubility_data():
"""Loads solubility dataset"""
current_dir = os.path.dirname(os.path.abspath(__file__))
featurizer = dc.feat.CircularFingerprint(size=1024)
tasks = ["log-solubility"]
input_file = os.path.join(current_dir,
... |
19,131 | get desktop name | # -*- coding: UTF-8 -*-
# A part of NonVisual Desktop Access (NVDA)
# Copyright (C) 2020-2023 NV Access Limited, Łukasz Golonka, Luke Davis
# This file may be used under the terms of the GNU General Public License, version 2 or later.
# For more details see: https://www.gnu.org/licenses/gpl-2.0.html
""" System related... |
19,132 | patch | # 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)
from spack.package import *
class Gtkplus(MesonPackage):
"""The GTK+ package contains libraries used for creating gr... |
19,133 | plot data | import matplotlib
import numpy as np
from matplotlib import pyplot
from open_atmos_jupyter_utils import show_plot
from packaging import version
from PySDM_examples.Shima_et_al_2009.error_measure import error_measure
from PySDM.physics.constants import si
_matplotlib_version_3_3_3 = version.parse("3.3.0")
_matplotlib_... |
19,134 | ext xdc existing report pk | '''
EDGAR.py implements an OpenSql database extension for Seatig's XDC
See COPYRIGHT.md for copyright information.
to use from command line:
--plugins xbrlDB/ext/XDC.py # note this plugin imports xbrlDB plugin
file name argument includes metadata:
-f "[{\"file\":\"abc.xbrl\", ... and optional fields for extXdc... |
19,135 | add registration revocation | # automatically generated by the FlatBuffers compiler, do not modify
# namespace: proto
import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()
class CalleeFeatures(object):
__slots__ = ['_tab']
@classmethod
def GetRootAs(cls, buf, offset=0):
n = flatbuffers.encode.Get... |
19,136 | test set up workload ce | """ Test class for Job Agent
"""
# imports
import pytest
import os
from diraccfg import CFG
# DIRAC Components
from DIRAC import gLogger, gConfig, S_OK, S_ERROR
from DIRAC.ConfigurationSystem.Client.ConfigurationData import gConfigurationData
from DIRAC.Core.Security.X509Chain import X509Chain # pylint: disable=impo... |
19,137 | main | #!/usr/bin/env python3
#
# This file is part of LiteX-Boards.
#
# Copyright (c) 2018-2019 Rohit Singh <rohit@rohitksingh.in>
# Copyright (c) 2019-2020 Florent Kermarrec <florent@enjoy-digital.fr>
# SPDX-License-Identifier: BSD-2-Clause
import os
from migen import *
from litex.gen import *
from litex_boards.platfor... |
19,138 | full api access | # 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... |
19,139 | instance0 task | # Test descriptor discovery/read/write from both GATTS and GATTC.
import sys
sys.path.append("")
from micropython import const
import time, machine
import uasyncio as asyncio
import aioble
import bluetooth
TIMEOUT_MS = 5000
SERVICE_UUID = bluetooth.UUID("A5A5A5A5-FFFF-9999-1111-5A5A5A5A5A5A")
CHAR1_UUID = bluetoo... |
19,140 | sync all | #!/usr/bin/env python3
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Base class for RPC testing
# Add python-bitcoinrpc to module search path:
import os
import sys
import shut... |
19,141 | test logger name | from unittest.mock import Mock, call
import pytest
import requests_mock as rm
from streamlink_cli.utils.versioncheck import check_version, get_latest, log
@pytest.fixture(autouse=True)
def _logger(caplog: pytest.LogCaptureFixture):
caplog.set_level(1, "streamlink.cli")
def METHOD_NAME():
assert log.name =... |
19,142 | get next | # pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRe... |
19,143 | from paths | import functools
import importlib.metadata
import logging
import os
import pathlib
import sys
import zipfile
import zipimport
from typing import Iterator, List, Optional, Sequence, Set, Tuple
from pip._vendor.packaging.utils import NormalizedName, canonicalize_name
from pip._internal.metadata.base import BaseDistribu... |
19,144 | test validate encryption source | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
19,145 | add arguments oss | import argparse
import os
from typing import cast, List, Optional, Tuple
from ..util.setting import (
CompilerType,
JSON_FOLDER_BASE_DIR,
LOG_DIR,
Option,
Test,
TestList,
TestType,
)
from ..util.utils import (
clean_up,
create_folder,
print_log,
raise_no_test_found_exception... |
19,146 | export type | from django.contrib import messages
from django.http import Http404
from django.urls import reverse
from django.utils.decorators import method_decorator
from django.utils.translation import gettext_lazy
from couchdbkit import ResourceNotFound
from memoized import memoized
from corehq.apps.domain.decorators import log... |
19,147 | po init builder wrapper | """ msginit tool
Tool specific initialization of msginit tool.
"""
# __COPYRIGHT__
#
# 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... |
19,148 | trigger cron job | # -*- coding: utf-8 -*-
# pylint: disable=E1101
"""
Tasks for dumping data directly from BigQuery to GCS.
"""
from datetime import datetime
from time import sleep
from typing import Union
from basedosdados.download.base import google_client
from basedosdados.upload.base import Base
from google.cloud import bigquery
im... |
19,149 | themes | import os
import io
import json
import logging
import copy
import glob
import core.event
import util.algorithm
import util.xresources
log = logging.getLogger(__name__)
THEME_BASE_DIR = os.path.dirname(os.path.realpath(__file__))
PATHS = [
".",
os.path.join(THEME_BASE_DIR, "../../themes")
]
if os.environ.get... |
19,150 | get tag raw | from gi.repository import GLib
import pytest
from xl.player.track_fader import TrackFader, FadeState
NoFade = FadeState.NoFade
FadingIn = FadeState.FadingIn
Normal = FadeState.Normal
FadingOut = FadeState.FadingOut
class FakeStream:
def __init__(self):
self.reset()
def reset(self):
self.pos... |
19,151 | request | #!/usr/bin/python3
# -----------------------------------------------------------
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc... |
19,152 | test absent with failure | import logging
import random
import string
import pytest
import salt.config
import salt.loader
import salt.states.boto_elasticsearch_domain as boto_elasticsearch_domain
from tests.support.mock import MagicMock, patch
boto = pytest.importorskip("boto")
boto3 = pytest.importorskip("boto3", "1.2.1")
botocore = pytest.i... |
19,153 | 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
# --------------------------------... |
19,154 | func | #!/usr/bin/env python3
#
# SPDX-License-Identifier: GPL-2.0-only
#
import sys, os, subprocess, re, shutil
whitelist = (
# type is supported by dash
'if type systemctl >/dev/null 2>/dev/null; then',
'if type systemd-tmpfiles >/dev/null 2>/dev/null; then',
'type update-rc.d >/dev/null 2>/dev/null; then'... |
19,155 | stop | # Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this f... |
19,156 | get historical sensor data | """Functions for interfacing with Epidata."""
import os
from datetime import datetime, date
from itertools import product
from typing import Tuple, List, Dict
from delphi_epidata import Epidata
from numpy import isnan
from pandas import date_range
from .data_containers import LocationSeries, SensorConfig
EPIDATA_STA... |
19,157 | test conflict parameter 6 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
19,158 | test skip tags | #!/usr/bin/env python
#
# Copyright 2007,2010,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from gnuradio import gr, gr_unittest, blocks
import pmt
import numpy
def make_tag(key, value, offset, srcid=None):
tag = gr.tag_t()
tag.key =... |
19,159 | dict length | # automatically generated by the FlatBuffers compiler, do not modify
# namespace: NetEncoding
import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()
class DictEncoded8FBArray(object):
__slots__ = ["_tab"]
@classmethod
def GetRootAs(cls, buf, offset=0):
n = flatbuffe... |
19,160 | test xy plot map screen | # (C) Copyright 2005-2021 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... |
19,161 | test lifecycle response contains all rules | # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 ... |
19,162 | reset type codec | # Stubs for asyncpg.connection (Python 3)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from asyncpg.cursor import CursorFactory
from asyncpg.prepared_stmt import PreparedStatement
from asyncpg.protocol import Record
from . import connect_utils
from asyncpg.transaction import Transactio... |
19,163 | test degree centrality | import pytest
import networkx as nx
from networkx.algorithms import bipartite
class TestBipartiteCentrality:
@classmethod
def setup_class(cls):
cls.P4 = nx.path_graph(4)
cls.K3 = nx.complete_bipartite_graph(3, 3)
cls.C4 = nx.cycle_graph(4)
cls.davis = nx.davis_southern_women_g... |
19,164 | get entangler map | # This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2020.
#
# 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... |
19,165 | components with version changes | from concourse.model.traits.notifications import NotificationTriggeringPolicy
from concourse.client.model import BuildStatus
import ccc.concourse
import concourse.util
import os
import traceback
import ci.util
import mailutil
def meta_vars():
build = concourse.util.find_own_running_build()
pipeline_metadat... |
19,166 | update plots | #!/usr/bin/env python3
#
# fsk_demod Statistics GUI
# Accepts the stats output from fsk_demod on stdin, and plots it.
#
# Mark Jessop 2016-03-13 <vk5qi@rfhead.net>
#
# NOTE: This is intended to be run on a 'live' stream of samples, and hence expects
# updates at about 10Hz. Anything faster will fill up the input queue ... |
19,167 | test can test multiple process models with | import os
import pytest
from flask import Flask
from flask import current_app
from spiffworkflow_backend.services.process_model_test_runner_service import NoTestCasesFoundError
from spiffworkflow_backend.services.process_model_test_runner_service import ProcessModelTestRunner
from spiffworkflow_backend.services.proces... |
19,168 | java | import os
import re
from osbenchmark.exceptions import SystemSetupError
from osbenchmark.utils import io
class JdkResolver:
SYS_PROP_REGEX = r".*%s.*=\s?(.*)"
def __init__(self, executor):
self.executor = executor
def resolve_jdk_path(self, host, majors):
"""
Resolves the path t... |
19,169 | test get datadir and port | #!/usr/bin/env python3
import os, sys
import unittest
from gppylib import gplog
from gppylib.commands.base import CommandResult
from gpsegstop import SegStop, SegStopStatus
from mock import patch
logger = gplog.get_unittest_logger()
class SegStopTestCase(unittest.TestCase):
def setUp(self):
self.segstop... |
19,170 | same filter as item | # Copyright (C) 2011 Chris Dekter
# Copyright (C) 2019-2020 Thomas Hess <thomas.hess@udo.edu>
#
# 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 opt... |
19,171 | test ind661 | import os
import sys
sys.path.append(
os.path.normpath(
os.path.join(os.path.abspath(__file__), "..", "..", "..", "common")
)
)
from env_indigo import ( # noqa
Indigo,
IndigoException,
getIndigoExceptionText,
joinPathPy,
)
indigo = Indigo()
def round(x):
if abs(x) < 1e-3:
... |
19,172 | wrapper | """Decorators for running functions with context/sockets.
.. versionadded:: 15.3
Like using Contexts and Sockets as context managers, but with decorator syntax.
Context and sockets are closed at the end of the function.
For example::
from zmq.decorators import context, socket
@context()
@socket(zmq... |
19,173 | configure | import os
from conan import ConanFile
from conan.tools.build import check_min_cppstd
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.files import copy, get, replace_in_file, rmdir
from conan.tools.scm import Version
from conan.errors import ConanInvalidConfiguration
requi... |
19,174 | get output foldername | """ Pre 90th percentile calculator """
import os
import json
import pandas as pd
RECENT_YEAR = 2019 # the most recent year that has the core fire season recorded
RANGES = [(1970, RECENT_YEAR), (RECENT_YEAR - 19, RECENT_YEAR),
(RECENT_YEAR - 9, RECENT_YEAR)]
PERCENTILE = 0.9
NUMBER_OF_DECIMAL_POINT = 5 # f... |
19,175 | get validation file | """
Validation methods for the NAPALM base.
See: https://napalm.readthedocs.io/en/latest/validate.html
"""
import yaml
import copy
import re
from typing import Dict, List, Union, TypeVar, Optional, TYPE_CHECKING
if TYPE_CHECKING:
from napalm.base import NetworkDriver
from napalm.base.exceptions import ValidationE... |
19,176 | system data | # 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... |
19,177 | test gm calculation soil reference | # The Hazard Library
# Copyright (C) 2012-2023 GEM Foundation
#
# 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, or (at your option) any later version.
#... |
19,178 | world size | import copy
import typing
import unittest
import torch
import torch.nn as nn
from torch.testing._internal import common_utils
SKIP_TEST = None
from apex.transformer.testing.distributed_test_base import NcclDistributedTestBase
try:
from apex.contrib.cudnn_gbn import GroupBatchNorm2d as GBN
except ImportError as e:... |
19,179 | test get country miss | from unittest.mock import Mock, patch
import pytest
import streamlink.utils.l10n as l10n
class TestLocalization:
@pytest.mark.parametrize(("locale", "expected"), [
("en_US", "en_US"),
("ko_KR", "ko_KR"),
])
def test_valid(self, locale, expected):
locale = l10n.Localization(locale... |
19,180 | test valid construction | # Copyright (c) 2009-2023 The Regents of the University of Michigan.
# Part of HOOMD-blue, released under the BSD 3-Clause License.
"""Test hoomd.hpmc.update.Clusters."""
import hoomd
from hoomd.conftest import (operation_pickling_check, logging_check,
autotuned_kernel_parameter_check)
fro... |
19,181 | spatial join query flat | # 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... |
19,182 | format seconds | # 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... |
19,183 | example | #
# Copyright Soramitsu Co., Ltd. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
#
import csv
import os.path
levels = ['*', '=', '-', '^', '"']
def header_char(level):
level = int(level) % len(levels)
return levels[level]
def header_overline(level):
level = int(level) % len(levels)
ret... |
19,184 | get contents | """
Wrapper for loading template based on a selected Theme.
"""
import os
import errno
from django.conf import settings
from django.template import TemplateDoesNotExist
from django.template.base import Origin
from django.template.loaders.base import Loader as DjangoLoader
from django.template.loaders.cached import Loa... |
19,185 | score | # -*- coding: utf-8 -*-
"""Base class for clustering."""
__author__ = ["chrisholder", "TonyBagnall"]
__all__ = ["BaseClusterer"]
import time
from abc import ABC, abstractmethod
import numpy as np
from aeon.base import BaseCollectionEstimator
from aeon.utils.validation._dependencies import _check_estimator_deps
cla... |
19,186 | test list of fractional float | # 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... |
19,187 | debug | import sys
from _typeshed import SupportsRead, SupportsReadline
from collections.abc import Callable, Iterable, Iterator
from socket import socket
from ssl import SSLContext
from types import TracebackType
from typing import Any, TextIO
from typing_extensions import Literal, Self
__all__ = ["FTP", "error_reply", "erro... |
19,188 | test random degree sequence large | import pytest
import networkx as nx
class TestConfigurationModel:
"""Unit tests for the :func:`~networkx.configuration_model`
function.
"""
def test_empty_degree_sequence(self):
"""Tests that an empty degree sequence yields the null graph."""
G = nx.configuration_model([])
a... |
19,189 | create redirect | import base64
import json
import logging
import uuid
from typing import Optional
from urllib.parse import parse_qs
from urllib.parse import urlencode
import requests
from defusedxml import ElementTree as ET
from oic.utils.authn.user import UserAuthnMethod
from oic.utils.http_util import SeeOther
from oic.utils.http_u... |
19,190 | test feature set selector 8 | # -*- coding: utf-8 -*-
"""This file is part of the TPOT library.
TPOT was primarily developed at the University of Pennsylvania by:
- Randal S. Olson (rso@randalolson.com)
- Weixuan Fu (weixuanf@upenn.edu)
- Daniel Angell (dpa34@drexel.edu)
- and many more generous open source contributors
TPOT is f... |
19,191 | test int | # BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE
import os
import numpy as np # noqa: F401
import pytest
import awkward as ak
DIR = os.path.dirname(__file__)
SAMPLES_DIR = os.path.join(os.path.abspath(DIR), "samples")
def METHOD_NAME():
filename = os.path.join(SAMPLES_D... |
19,192 | on first update | # -*- coding: utf-8 -*-
""" *==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, 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... |
19,193 | job args | from pprint import pformat
import yaml.parser
import yaml.scanner
import yaml
from awxkit.utils import args_string_to_list, seconds_since_date_string
from awxkit.api.resources import resources
from awxkit.api.mixins import HasStatus
import awxkit.exceptions as exc
from . import base
from . import page
class Unified... |
19,194 | test pdt 11 | # Copyright iris-grib contributors
#
# This file is part of iris-grib and is released under the LGPL license.
# See COPYING and COPYING.LESSER in the root of the repository for full
# licensing details.
"""
Tests for function
:func:`iris_grib._load_convert.statistical_cell_method`.
"""
# import iris_grib.tests first ... |
19,195 | scroll to top | from travertino.size import at_least
from ..libs import (
Gtk,
get_background_color_css,
get_color_css,
get_font_css,
gtk_alignment,
)
from .base import Widget
class MultilineTextInput(Widget):
def create(self):
# Wrap the TextView in a ScrolledWindow in order to show a
# vert... |
19,196 | encode number | from __future__ import division
import binascii
import base64
class UnexpectedDER(Exception):
pass
def encode_constructed(tag, value):
return int.to_bytes(0xa0+tag, 1, 'big') + encode_length(len(value)) + value
def encode_integer(r):
assert r >= 0 # can't support negative numbers yet
h = ("%x" %... |
19,197 | test list resources for web acl | from boto3 import client, resource, session
from moto import mock_ec2, mock_elbv2, mock_wafv2
from prowler.providers.aws.lib.audit_info.models import AWS_Audit_Info
from prowler.providers.aws.services.wafv2.wafv2_service import WAFv2
from prowler.providers.common.models import Audit_Metadata
AWS_ACCOUNT_NUMBER = "123... |
19,198 | register backends | # encoding: utf-8
from __future__ import annotations
from ckan.types import Context
from typing import Any
import ckan.plugins.interfaces as interfaces
class IDatastore(interfaces.Interface):
'''Allow modifying Datastore queries'''
def datastore_validate(self, context: Context, data_dict: dict[str, Any],
... |
19,199 | sai community test env check | import time
import pytest
import logging
from .cases_community import PROBE_TEST_CASE, TEST_CASE
from .conftest import get_sai_test_container_name
from .sai_infra import LIVENESS_CHECK_INTERVAL_IN_SEC
from .conftest import stop_and_rm_sai_test_container
from .sai_infra import SAI_TEST_ENV_RESET_TIMES
from .sai_infra i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.