id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
18,000
intersecting cones
from openpnm.models.geometry import _geodocs __all__ = ["spheres_and_cylinders", "circles_and_rectangles", "cones_and_cylinders", "intersecting_cones", "hybrid_cones_and_cylinders", "trapezoids_and_rectangles", "hybrid_trapezoids_and_rectangles", ...
18,001
model as dict
from unittest import mock import pytest from h_matchers import Any from lms.models import GradingInfo from lms.resources import LTILaunchResource from lms.services.grading_info import GradingInfoService from tests import factories pytestmark = pytest.mark.usefixtures("application_instance_service") class TestGetSt...
18,002
get name
# Copyright (C) 2022 CVAT.ai Corporation # # SPDX-License-Identifier: MIT import csv import json import os import random import sys from itertools import product NAME = "invitations" def read_rules(name): rules = [] with open(os.path.join(sys.argv[1], f"{name}.csv")) as f: reader = csv.DictReader(f)...
18,003
process
# Name: PythonVolumeExample # ******************************************************************************** # # Inviwo - Interactive Visualization Workshop # # Copyright (c) 2023 Inviwo Foundation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permi...
18,004
repr javascript
# encoding: utf-8 """IO capturing utilities.""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import sys from io import StringIO #----------------------------------------------------------------------------- # Classes and functions #----------------------------...
18,005
s
import numbers import pytest import numpy as np import pyarrow as pa import vaex @pytest.fixture(scope='session') def x(array_factory1): return array_factory1([0, 1, 2., None]) @pytest.fixture(scope='session') def y(array_factory2): return array_factory2([1, 2, None, None]) @pytest.fixture(scope='sessio...
18,006
add file
import logging import os import posixpath from pathlib import Path from flipper.utils import timestamp, file_md5 from flipper.utils.fstree import FsNode, compare_fs_trees MANIFEST_VERSION = 0 class ManifestRecord: tag = None @staticmethod def fromLine(line): raise NotImplementedError def t...
18,007
upload
import re import os import numpy as np from cloudfiles import CloudFiles from .. import autocropfn, readonlyguard, ImageSourceInterface from ... import compression from ... import chunks from ... import exceptions from ...lib import ( colorize, red, mkdir, Vec, Bbox, jsonify, generate_random_string, xyzran...
18,008
test feed eof after feed eof
from websockets.streams import StreamReader from .utils import GeneratorTestCase class StreamReaderTests(GeneratorTestCase): def setUp(self): self.reader = StreamReader() def test_read_line(self): self.reader.feed_data(b"spam\neggs\n") gen = self.reader.read_line(32) line = ...
18,009
test ordering
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in complia...
18,010
test dry run
from decimal import Decimal from django.test import TestCase from django_prbac.models import Role from corehq.apps.accounting.management.commands.change_role_for_software_plan_version import ( NewRoleDoesNotExist, OldRoleDoesNotExist, PlanVersionAndRoleMismatch, change_role_for_software_plan_version,...
18,011
test main
"""Test cases for traceback module""" from __future__ import with_statement import unittest from test.test_support import run_unittest, is_jython import traceback class TracebackCases(unittest.TestCase): # For now, a very minimal set of tests. I want to be sure that # formatting of SyntaxErrors works based ...
18,012
test prediction proba unify
# -*- coding: utf-8 -*- from __future__ import division from __future__ import print_function import os import sys import unittest # noinspection PyProtectedMember from numpy.testing import assert_allclose from numpy.testing import assert_array_less from numpy.testing import assert_equal from numpy.testing import ass...
18,013
initialize bookmarks
# 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...
18,014
configure optimizers
"""Demo of a simple transformer language model. Code is adapted from the PyTorch examples at https://github.com/pytorch/examples/blob/main/word_language_model """ import math import os from pathlib import Path from typing import Dict, List, Optional, Tuple import requests import torch import torch.nn as nn import to...
18,015
make
#!/usr/bin/env python3 """Test LZ4 interoperability between versions""" # # Copyright (C) 2011-present, Takayuki Matsuoka # All rights reserved. # GPL v2 License # import glob import subprocess import filecmp import os import shutil import sys import hashlib repo_url = 'https://github.com/lz4/lz4.git' tmp_dir_name =...
18,016
test n too large
# Copyright 2015 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,017
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 . imp...
18,018
id
# coding=utf-8 # *** WARNING: this file was generated by pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities from . im...
18,019
function code to register
import binascii import esphome.codegen as cg import esphome.config_validation as cv from esphome.components import modbus from esphome.const import CONF_ADDRESS, CONF_ID, CONF_NAME, CONF_LAMBDA, CONF_OFFSET from esphome.cpp_helpers import logging from .const import ( CONF_BITMASK, CONF_BYTE_OFFSET, CONF_COM...
18,020
parse repo url
# Copyright 2018 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
18,021
random be
# Electrum - lightweight Bitcoin client # Copyright (C) 2011 Thomas Voegtlin # # 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 t...
18,022
on finished
import os import threading from dataclasses import asdict from pathlib import Path def test_conda_cloud_index(datadir, data_regression): from robocorp_code.deps.conda_cloud import SqliteQueries, index_conda_info target_sqlite = datadir / "sqlite.db" index_conda_info(datadir / "noarch-testdata.json", targ...
18,023
make loader
import re import xml.etree.ElementTree as etree from typing import TYPE_CHECKING, Callable, Dict, List, Match, Optional, Tuple, Union import flask import pystache import pystache.parsed from flask_babel import gettext from markdown import Markdown, markdown from markdown.extensions import Extension from markdown.treep...
18,024
test save zip store close file
# -*- coding: utf-8 -*- # Copyright 2007-2023 The HyperSpy developers # # This file is part of RosettaSciIO. # # RosettaSciIO 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...
18,025
build schema on 200
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # # Code generated by aaz-dev-tools # --------------------------------...
18,026
rsample
import torch from torch.distributions import constraints from torch.distributions.categorical import Categorical from torch.distributions.distribution import Distribution __all__ = ["OneHotCategorical", "OneHotCategoricalStraightThrough"] class OneHotCategorical(Distribution): r""" Creates a one-hot categori...
18,027
test measurement with key
# Copyright 2021 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 ...
18,028
show
from spytest import st from apis.system.rest import rest_status from apis.system.rest import get_rest from apis.system.rest import config_rest, delete_rest import utilities.common as utils def verify(dut, **kwargs): cli_type = st.get_ui_type(dut, **kwargs) """ Author : Kiran Vedula (kvedula@broadcom.com) ...
18,029
matrix power
from collections.abc import Iterable from typing import ( Literal as L, overload, TypeVar, Any, SupportsIndex, SupportsInt, ) from numpy import ( generic, floating, complexfloating, int32, float64, complex128, ) from numpy.linalg import LinAlgError as LinAlgError from ...
18,030
test duplicated sentence
# Copyright © Michal Čihař <michal@weblate.org> # # SPDX-License-Identifier: GPL-3.0-or-later """Tests for duplicate checks.""" from weblate.checks.duplicate import DuplicateCheck from weblate.checks.models import Check from weblate.checks.tests.test_checks import CheckTestCase, MockUnit from weblate.lang.models impo...
18,031
set up
import ctk import qt import slicer from slicer.ScriptedLoadableModule import * # # MarkupsInCompareViewersSelfTest # class MarkupsInCompareViewersSelfTest(ScriptedLoadableModule): def __init__(self, parent): ScriptedLoadableModule.__init__(self, parent) parent.title = "MarkupsInCompareViewersSel...
18,032
location
# 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...
18,033
every n epochs
# Copyright (c) OpenMMLab. All rights reserved. # Copyright (c) Alibaba, Inc. and its affiliates. from functools import wraps from modelscope.utils.constant import TrainerStages from modelscope.utils.import_utils import is_method_overridden from .priority import Priority class Hook: """ The Hook base class o...
18,034
post operations
# -------------------------------------------------------------------------------------------- # 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,035
create group
#!/usr/bin/env python data = { "default_prefix": "OSVC_COMP_GROUP_", "example_value": """ { "tibco": { "gid": 1000, }, "tibco1": { "gid": 1001, } } """, "description": """* Verify a local system group configuration * A minus (-) prefix to the group name indicates the user should not exist """, ...
18,036
test no properties
############################################################################## # # Copyright (c) 2017 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
18,037
get sweeptime averages
from qkit.core.instrument_base import Instrument from qkit.drivers.AbstractVNA import AbstractVNA from qkit.drivers.ZHInst_SHFSG import ZHInst_SHFSG from qkit.drivers.ZHInst_UHFQA import ZHInst_UHFQA from zhinst.toolkit import TriggerMode, Alignment, SequenceType import numpy as np MAXIMUM_FREQUENCY = (8.5 + 0.65)*1...
18,038
validate no public to public peerings
import ipaddress import logging import sys from typing import ( Union, cast, ) from reconcile import queries from reconcile.gql_definitions.vpc_peerings_validator import vpc_peerings_validator from reconcile.gql_definitions.vpc_peerings_validator.vpc_peerings_validator import ( ClusterPeeringConnectionClus...
18,039
submit training job
"""A Future-like api for jobs created by the SequentialEngine, an Engine that sequentially computes the submitted jobs.""" from evalml.automl.engine.engine_base import ( EngineBase, EngineComputation, evaluate_pipeline, score_pipeline, train_pipeline, ) from evalml.objectives.utils import get_object...
18,040
test validate catches bad sig
""" tests for otupdate.buildroot.file_actions Checks functionality and error cases for the update utility functions there """ import binascii import hashlib import os import subprocess from unittest import mock import zipfile import pytest from otupdate.buildroot import update_actions from otupdate.common import fil...
18,041
assert not equal
# Stubs for unittest.case (Python 3.5) # # NOTE: This dynamically typed stub was automatically generated by stubgen. from typing import Any import logging from collections import namedtuple DIFF_OMITTED = ... # type: Any class SkipTest(Exception): ... class _ShouldStop(Exception): ... class _UnexpectedSuccess(Excep...
18,042
test magnetic operations
from itertools import combinations import numpy as np import pytest from operation import MagneticOperation, remainder1_symmetry_operation from magnetic_hall import MagneticHallSymbol from transform import Transformation, get_standard_hall_number from load import get_spg_table, get_msg_table def METHOD_NAME(): ...
18,043
logic key
# Copyright 1999-2021 Alibaba Group Holding Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
18,044
prepare inputs
#!/usr/bin/env python3 # Copyright (c) 2023 CINN 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 r...
18,045
lazy self
# coding: utf-8 """ some helper functions that might be generally useful """ from __future__ import absolute_import, print_function from functools import partial import re from .compat import text_type, binary_type if False: # MYPY from typing import Any, Dict, Optional, List, Text # NOQA from .compat im...
18,046
test list objects works
# -*- coding: utf-8 -*- # MinIO Python Library for Amazon S3 Compatible Cloud Storage, # (C) 2015-2020 MinIO, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.or...
18,047
extract data
# 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...
18,048
init early exit excepthook
############################################################################### # ilastik: interactive learning and segmentation toolkit # # Copyright (C) 2011-2014, the ilastik developers # <team@ilastik.org> # # This program is free software; you can redistribute it and/or # mod...
18,049
test rpm metadata from file
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import importlib.resources import os import re import shutil import unittest from antlir.find_built_subvol import fi...
18,050
kind
# 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 __all__ ...
18,051
cleanup atexit
''' NetNS objects ============= A NetNS object is IPRoute-like. It runs in the main network namespace, but also creates a proxy process running in the required netns. All the netlink requests are done via that proxy process. NetNS supports standard IPRoute API, so can be used instead of IPRoute, e.g., in IPDB:: ...
18,052
merge pyramid
#!/usr/bin/env python3 # coding: utf-8 """ @file: pyramid.py @description: @author: Ping Qiu @email: qiuping1@genomics.cn @last modified by: Ping Qiu change log: 2021/06/11 create file. """ import time import h5py import numpy as np import tifffile as tifi from PIL import Image def _write_attrs(gp, d): """...
18,053
test basic write file uncompressed
#!/usr/bin/python2.7 # -*- coding: utf-8 -*- # # Copyright 2012 Google Inc. 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/LIC...
18,054
test account logo url invalid
"""Tests for Account model's profile features.""" import pytest from furl import furl from sqlalchemy.exc import StatementError from coaster.sqlalchemy import StateTransitionError from funnel import models def test_account_logo_url_valid(db_session, new_organization) -> None: assert new_organization.name == 't...
18,055
run test
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Exercise the listreceivedbyaddress API from test_framework.test_framework import BitcoinTestFramework ...
18,056
post run
#! /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...
18,057
visit yield expr
"""Find all subexpressions of an AST node.""" from __future__ import annotations from mypy.nodes import ( AssertTypeExpr, AssignmentExpr, AwaitExpr, CallExpr, CastExpr, ComparisonExpr, ConditionalExpr, DictExpr, DictionaryComprehension, Expression, GeneratorExpr, IndexE...
18,058
a2dismod
""" Support for Apache Please note: The functions in here are Debian-specific. Placing them in this separate file will allow them to load only on Debian-based systems, while still loading under the ``apache`` namespace. """ import logging import os import salt.utils.decorators.path import salt.utils.path log = logg...
18,059
t5 viewer
import streamlit as st import pandas as pd from simpletransformers.t5 import T5Model from simpletransformers.streamlit.streamlit_utils import get, simple_transformers_model def get_states(model, session_state=None): if session_state: setattr(session_state, "max_length", model.args.max_length) set...
18,060
dict
import functools import re from typing import Annotated, Any from fastapi import Depends from pydantic import BaseModel from pydantic.error_wrappers import ErrorWrapper, ValidationError from sqlalchemy import create_engine, inspect from sqlalchemy.ext.declarative import declarative_base, declared_attr from sqlalchemy....
18,061
get application state
"""OAuth 2 Clients""" from json import loads from typing import Any, Optional from urllib.parse import parse_qsl from django.utils.crypto import constant_time_compare, get_random_string from django.utils.translation import gettext as _ from requests.exceptions import RequestException from requests.models import Respon...
18,062
init config
# Copyright The Cloud Custodian Authors. # SPDX-License-Identifier: Apache-2.0 """ Cloud-Custodian AWS Lambda Entry Point """ import os import logging import json from c7n.config import Config from c7n.structure import StructureParser from c7n.resources import load_resources from c7n.resources.aws import AWS from c7n....
18,063
configure
from conan import ConanFile from conan.tools.apple import fix_apple_shared_install_name from conan.tools.env import VirtualBuildEnv from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rename, replace_in_file, rm, rmdir from conan.tools.gnu import Autotools, AutotoolsToolchain fro...
18,064
test complete voro output
""" @author: ruess """ import pytest from masci_tools.io.parsers.voroparser_functions import parse_voronoi_output from pathlib import Path import os DIR = Path(__file__).parent.resolve() class Test_voronoi_parser_functions: """ Tests for the voronoi parser functions """ grouping_ref = ['volumes_gro...
18,065
etag
# 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,066
raise if locking self out of admin
from typing import Optional from django.contrib.auth import get_user_model from django.contrib.auth.password_validation import validate_password from django.core.exceptions import ValidationError from baserow_premium.admin.users.exceptions import ( CannotDeactivateYourselfException, CannotDeleteYourselfExcept...
18,067
get running pod
#!/usr/bin/env python import argparse import json import subprocess import os import sys import tempfile def msg_exit(msg): print(msg) sys.exit(0) def get_kubectl_cmd_prefix(): kubectl_cmd = ['kubectl'] if args.namespace: kubectl_cmd.extend(['-n', args.namespace]) if args.kubeconfig: ...
18,068
run real
import os import platform import time from configparser import ConfigParser from logging import getLogger from typing import Union, Iterable from PyQt5.QtCore import pyqtSignal, QObject, QRunnable import rare.utils.wine as wine from rare.lgndr.core import LegendaryCore from rare.models.game import RareGame from rare....
18,069
test apply auto limit multi query end
import unittest from redash.query_runner import BaseQueryRunner, BaseSQLQueryRunner from redash.utils import gen_query_hash class TestBaseSQLQueryRunner(unittest.TestCase): def setUp(self): self.query_runner = BaseSQLQueryRunner({}) def test_check_query_limit_no_limit(self): query = "SELECT ...
18,070
structure from str
"""Classes for reading/writing mcsqs files following the rndstr.in format.""" from __future__ import annotations import numpy as np from monty.dev import deprecated from pymatgen.core.lattice import Lattice from pymatgen.core.periodic_table import get_el_sp from pymatgen.core.structure import Structure __author__ =...
18,071
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,072
forward features
""" MindSpore implementation of `MobileNetV1`. Refer to MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications. """ import mindspore.common.initializer as init from mindspore import Tensor, nn from .helpers import load_pretrained from .layers.pooling import GlobalAvgPooling from .registry ...
18,073
test detail view private visible to initiator
import pytest from django.contrib.contenttypes.models import ContentType from django.urls import reverse from adhocracy4.projects.enums import Access from adhocracy4.test.helpers import assert_template_response from adhocracy4.test.helpers import freeze_phase from adhocracy4.test.helpers import redirect_target from ad...
18,074
test can register
import re from django.core import mail from django.urls import reverse from django_webtest import WebTest from oscar.core.compat import get_user_model from oscar.test import factories from oscar.test.testcases import WebTestCase User = get_user_model() class TestAUserWhoseForgottenHerPassword(WebTest): def tes...
18,075
completions
from typing import Any, Dict from fastapi import HTTPException from fastapi.encoders import jsonable_encoder from mlflow.gateway.config import CohereConfig, RouteConfig from mlflow.gateway.providers.base import BaseProvider from mlflow.gateway.providers.utils import rename_payload_keys, send_request from mlflow.gatew...
18,076
test validate ds subset
import pytest from pathlib import Path import xarray as xr import numpy as np import pandas as pd from pysd.tools.ncfiles import NCFile @pytest.fixture(scope="session") def sample_dataset(): # generation of data (slight modification from xarray.Dataset example) np.random.seed(0) temperature = 15 + 8 * n...
18,077
verify all data sources read
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
18,078
edge decisions
from __future__ import print_function from builtins import range import logging import numpy as np import networkx as nx import vigra from ilastikrag.util import edge_mask_for_axis, edge_ids_for_axis, unique_edge_labels, label_vol_mapping logger = logging.getLogger(__name__) def METHOD_NAME(overseg_vol, groundtru...
18,079
test feed parsing too long
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Test cases for L{twisted.protocols.haproxy.V1Parser}. """ from twisted.internet import address from twisted.trial import unittest from .. import _v1parser from .._exceptions import InvalidNetworkProtocol, InvalidProxyHeader, MissingAddressDat...
18,080
get chart based on status
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from collections import defaultdict import frappe from frappe import _ from frappe.utils import date_diff, flt, getdate, today from erpnext.stock.report.stock_analytics.stock_analytics import get_pe...
18,081
start query
import logging import os from collections import namedtuple import boto3 from retrying import retry from config import config logger = logging.getLogger(__name__) def _get_value(filters, name, default): return f"'{filters.get(name, default) or default}'" QueryResult = namedtuple("QueryResult", ["id", "status...
18,082
check id format
"""Interface to overide kotsu code for sktime use.""" import re import warnings from typing import Callable, Optional, Union from sktime.utils.validation._dependencies import _check_soft_dependencies def METHOD_NAME(id_format: str, id: str) -> None: """Check if given input ID follows regex specified in id_forma...
18,083
predict
# Copyright (c) OpenMMLab. All rights reserved. from abc import ABCMeta, abstractmethod from typing import Dict, List, Tuple, Union from mmengine.model import BaseModel from torch import Tensor from mmdet.registry import MODELS from mmdet.structures import OptTrackSampleList, TrackSampleList from mmdet.utils import O...
18,084
test integers
# test interactions between int, float, Decimal and Fraction import unittest import random import math import sys import operator from test.support import run_unittest from decimal import Decimal as D from fractions import Fraction as F # Constants related to the hash implementation; hash(x) is based # on the reduc...
18,085
get user details
""" MediaWiki OAuth1 backend, docs at: https://python-social-auth.readthedocs.io/en/latest/backends/mediawiki.html """ import re import time from urllib.parse import parse_qs, urlencode, urlparse import jwt import requests from requests_oauthlib import OAuth1 from ..exceptions import AuthException from .oauth im...
18,086
decode
# coding=utf-8 # Copyright 2022 Meta Platforms authors and The HuggingFace Team. 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/LI...
18,087
test localtime daylight true dst false
import datetime from email import utils import test.support import time import unittest import sys import os.path class DateTimeTests(unittest.TestCase): datestring = 'Sun, 23 Sep 2001 20:10:55' dateargs = (2001, 9, 23, 20, 10, 55) offsetstring = ' -0700' utcoffset = datetime.timedelta(hours=-7) t...
18,088
test build
################################################################################# # WaterTAP Copyright (c) 2020-2023, The Regents of the University of California, # through Lawrence Berkeley National Laboratory, Oak Ridge National Laboratory, # National Renewable Energy Laboratory, and National Energy Technology # Labo...
18,089
gaudi python wrapper
import subprocess from datetime import datetime import time import uuid from os import makedirs, path from GangaCore.Core.exceptions import GangaException from GangaCore.Runtime.GPIexport import exportToGPI from GangaCore.Utility.files import expandfilename from GangaCore.Utility.logging import getLogger from GangaCore...
18,090
send events
# 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,091
id
# coding=utf-8 # *** WARNING: this file was generated by pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import _utilities from . imp...
18,092
param groups
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import logging from collections import defaultdict from dataclasses import dataclass, field from typing import Dict, Any, List, Optional impo...
18,093
schedule reload
''' Kivy Catalog ============ The Kivy Catalog viewer showcases widgets available in Kivy and allows interactive editing of kivy language code to get immediate feedback. You should see a two panel screen with a menu spinner button (starting with 'Welcome') and other controls across the top.The left pane contains kivy ...
18,094
get batch size
# Copyright (c) OpenMMLab. All rights reserved. from typing import Any, Dict, Sequence, Union import numpy as np import pycuda.autoinit # noqa:F401 import pycuda.driver as cuda import tensorrt as trt DEFAULT_CALIBRATION_ALGORITHM = trt.CalibrationAlgoType.ENTROPY_CALIBRATION_2 class HDF5Calibrator(trt.IInt8Calibra...
18,095
find mismatched arrays
import sys from os import path import glob import collections from ruamel import yaml from io import StringIO yaml_writer = yaml.YAML(typ="rt") def main(): any_failure = False for reference_file in glob.glob('content/*/en.yaml'): en = load_yaml(reference_file) structure_dir = path.basename(p...
18,096
run query until no updates
from django.core.management.base import BaseCommand from django.db import connections, transaction from corehq.apps.domain_migration_flags.api import ( ALL_DOMAINS, get_migration_status, set_migration_complete, set_migration_started, ) from corehq.apps.domain_migration_flags.exceptions import ( Dom...
18,097
validate
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt import frappe from frappe import _ from frappe.model.document import Document from frappe.query_builder import Criterion from frappe.utils import get_link_to_form from hrms.hr.doctype.shift_assignme...
18,098
test solution
################################################################################# # WaterTAP Copyright (c) 2020-2023, The Regents of the University of California, # through Lawrence Berkeley National Laboratory, Oak Ridge National Laboratory, # National Renewable Energy Laboratory, and National Energy Technology # Labo...
18,099
get supported triggers
# TODO: move to utils import logging from collections import defaultdict from typing import Callable, Dict, List, Optional, Type, Union, get_args, get_origin import jsonref import yaml from robusta.core.playbooks.actions_registry import Action from robusta.core.playbooks.base_trigger import BaseTrigger, ExecutionBase...