repo
stringclasses
454 values
file_path
stringlengths
5
201
extension
stringclasses
1 value
content
stringlengths
8
509k
num_lines
int64
3
16.9k
size_bytes
int64
8
511k
mkdocs
mkdocs/__init__.py
.py
#!/usr/bin/env python # For acceptable version formats, see https://www.python.org/dev/peps/pep-0440/ __version__ = '1.6.1'
6
126
textual
src/textual/_time.py
.py
import asyncio import sys from asyncio import sleep as asyncio_sleep from time import monotonic, perf_counter WINDOWS = sys.platform == "win32" if WINDOWS: time = perf_counter else: time = monotonic if WINDOWS: # sleep on windows as a resolution of 15ms # Python3.11 is somewhat better, but this hom...
53
1,410
pyomo
pyomo/scripting/plugins/convert.py
.py
# ____________________________________________________________________________________ # # Pyomo: Python Optimization Modeling Objects # Copyright (c) 2008-2026 National Technology and Engineering Solutions of Sandia, LLC # Under the terms of Contract DE-NA0003525 with National Technology and Engineering # Solutions of...
271
9,215
sphinx
sphinx/domains/cpp/_ids.py
.py
"""Important note on ids ---------------------------------------------------------------------------- Multiple id generation schemes are used due to backwards compatibility. - v1: 1.2.3 <= version < 1.3 The style used before the rewrite. It is not the actual old code, but a replication of the behaviour. - ...
606
18,432
onnxruntime
onnxruntime/test/python/transformers/test_qmoe_wfp4afp8_cuda.py
.py
# -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- # # Tes...
510
18,129
clearml
clearml/backend_interface/task/hyperparams.py
.py
from collections import defaultdict from typing import ( Optional, Sequence, Callable, Mapping, Union, Dict, Iterable, Generator, Tuple, Any, ) from ...backend_api import Session from ...backend_api.services import tasks class HyperParams: def __init__(self, task: Any) -> ...
240
9,325
luigi
test/auto_namespace_test/my_namespace_test.py
.py
from helpers import LuigiTestCase import luigi class MyNamespaceTest(LuigiTestCase): def test_auto_namespace_scope(self): class MyTask(luigi.Task): pass self.assertTrue(self.run_locally(["auto_namespace_test.my_namespace_test.MyTask"])) self.assertEqual(MyTask.get_task_namesp...
13
368
loguru
tests/test_parse.py
.py
import io import pathlib import re from datetime import datetime import pytest from loguru import logger TEXT = "This\nIs\nRandom\nText\n123456789\nABC!DEF\nThis Is The End\n" @pytest.fixture def fileobj(): with io.StringIO(TEXT) as file: yield file def test_parse_file(tmp_path): file = tmp_path ...
147
4,452
beam
sdks/python/apache_beam/utils/logger_test.py
.py
# # 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 us...
109
4,243
openvino
tests/layer_tests/onnx_tests/test_floor.py
.py
# Copyright (C) 2018-2026 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import pytest pytest.importorskip("openvino.tools.mo", reason="Ticket - 157136") from common.layer_test_class import check_ir_version from common.onnx_layer_test_class import OnnxRuntimeLayerTest, onnx_make_model from unit_tests.utils....
183
6,091
hydra
tests/standalone_apps/discovery_test_plugin/setup.py
.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved from setuptools import find_namespace_packages, setup setup( name="hydra-discovery-test-plugin", version="0.1.0", author="Omry Yadan", author_email="omry@yadan.net", url="https://github.com/hydra-ecosystem/hydra/", packages=...
13
413
pyomo
examples/performance/misc/set1.py
.py
# ____________________________________________________________________________________ # # Pyomo: Python Optimization Modeling Objects # Copyright (c) 2008-2026 National Technology and Engineering Solutions of Sandia, LLC # Under the terms of Contract DE-NA0003525 with National Technology and Engineering # Solutions of...
54
1,442
pymc
tests/distributions/moments/test_means.py
.py
# Copyright 2024 - present The PyMC 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
279
9,062
openvino
tests/layer_tests/tensorflow_tests/test_tf_IsNan.py
.py
# Copyright (C) 2018-2026 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import numpy as np import pytest import tensorflow as tf from common.tf_layer_test_class import CommonTFLayerTest from common.utils.tf_utils import mix_array_with_value class TestIsNan(CommonTFLayerTest): def _prepare_input(self, i...
47
1,704
wandb
wandb/sdk/artifacts/storage_handlers/wb_artifact_handler.py
.py
"""WB artifact storage handler.""" from __future__ import annotations import os from typing import TYPE_CHECKING, Literal from urllib.parse import urlparse from wandb.apis import PublicApi from wandb.sdk.artifacts.artifact_file_cache import get_artifact_file_cache from wandb.sdk.artifacts.artifact_manifest_entry imp...
131
4,764
pyomo
examples/pyomo/amplbook2/diet.py
.py
# ____________________________________________________________________________________ # # Pyomo: Python Optimization Modeling Objects # Copyright (c) 2008-2026 National Technology and Engineering Solutions of Sandia, LLC # Under the terms of Contract DE-NA0003525 with National Technology and Engineering # Solutions of...
69
1,694
textual
src/textual/widgets/_input.py
.py
from __future__ import annotations import re from dataclasses import dataclass from typing import TYPE_CHECKING, ClassVar, Iterable, NamedTuple from rich.cells import cell_len, get_character_cell_size from rich.console import RenderableType from rich.highlighter import Highlighter from rich.text import Text from typi...
1,134
41,180
rq
rq/job.py
.py
from __future__ import annotations import asyncio import inspect import json import logging import re import warnings import zlib from collections.abc import Callable, Iterable, Mapping, Sequence from contextvars import ContextVar from datetime import datetime, timedelta from enum import Enum from typing import TYPE_C...
2,022
83,220
pymc
tests/logprob/test_binary.py
.py
# Copyright 2024 - present The PyMC 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
162
5,302
saleor
saleor/webhook/tests/test_webhook_ip_filtering.py
.py
from ...core.http_client import HTTPClient from ...core.models import EventDeliveryAttempt from ..transport.asynchronous import trigger_webhooks_async def test_rejects_private_ips(webhook, monkeypatch): """Ensure private IP addresses are rejected by webhooks.""" # Enable IP filter monkeypatch.setattr(HTT...
29
987
pyro
pyro/infer/reparam/softmax.py
.py
# Copyright Contributors to the Pyro project. # SPDX-License-Identifier: Apache-2.0 import torch import pyro import pyro.distributions as dist from .reparam import Reparam class GumbelSoftmaxReparam(Reparam): """ Reparametrizer for :class:`~pyro.distributions.RelaxedOneHotCategorical` latent variables....
61
1,869
astropy
astropy/visualization/wcsaxes/wcsapi.py
.py
# Functions/classes for WCSAxes related to APE14 WCSes from __future__ import annotations from contextlib import contextmanager import numpy as np from astropy import units as u from astropy.coordinates import ICRS, BaseCoordinateFrame, SkyCoord from astropy.wcs import WCS from astropy.wcs.wcsapi import SlicedLowLev...
460
15,476
onnxruntime
tools/ci_build/manage_java_artifacts.py
.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # This script runs after ORT jars are built. It picks up the jars from ORT's build dir then repack them a bit. import argparse import logging import re import shutil import subprocess import sys import zipfile from pathlib i...
313
13,469
astropy
astropy/samp/tests/test_standard_profile.py
.py
import pytest # By default, tests should not use the internet. from astropy.samp import conf from astropy.samp.errors import SAMPProxyError from astropy.samp.hub import SAMPHubServer from astropy.samp.integrated_client import SAMPIntegratedClient from astropy.tests.helper import CI from .test_helpers import TEST_REPL...
293
8,894
onnx
onnx/backend/sample/__init__.py
.py
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0
4
81
biopython
Bio/Cluster/__init__.py
.py
# This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. # """Cluster Analysis. The Bio.Cluster provides commonly used clustering algorithms and was designed with the application to gene expression data in mi...
1,290
50,617
wagtail
wagtail/admin/forms/search.py
.py
from django import forms from django.utils.translation import gettext as _ from django.utils.translation import gettext_lazy class SearchForm(forms.Form): def __init__(self, *args, **kwargs): placeholder = kwargs.pop("placeholder", _("Search…")) super().__init__(*args, **kwargs) self.field...
20
572
hatch
tests/config/test_model.py
.py
import subprocess import pytest from hatch.config.model import ConfigurationError, RootConfig def test_default(default_cache_dir, default_data_dir): config = RootConfig({}) config.parse_fields() assert config.raw_data == { "mode": "local", "project": "", "shell": "", "di...
1,468
44,352
saleor
saleor/tests/e2e/checkout/utils/checkout_lines_add.py
.py
from ...utils import get_graphql_content CHECKOUT_LINES_ADD_MUTATION = """ mutation checkoutLinesAdd($checkoutId: ID!, $lines: [CheckoutLineInput!]!) { checkoutLinesAdd(id: $checkoutId, lines: $lines) { checkout { lines { id isGift quantity variant { id } ...
82
1,462
coremltools
coremltools/converters/mil/backend/nn/passes/mlmodel_passes.py
.py
# Copyright (c) 2020, Apple Inc. All rights reserved. # # Use of this source code is governed by a BSD-3-clause license that can be # found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause def _get_nn_spec(spec): if spec.WhichOneof("Type") == "neuralNetwork": nn_spec = spec.ne...
468
18,489
saleor
saleor/graphql/meta/tests/queries/test_warehouse.py
.py
import graphene from ....tests.utils import assert_no_permission, get_graphql_content from .utils import PRIVATE_KEY, PRIVATE_VALUE, PUBLIC_KEY, PUBLIC_VALUE QUERY_WAREHOUSE_PUBLIC_META = """ query warehouseMeta($id: ID!){ warehouse(id: $id){ metadata{ key valu...
178
5,027
openvino
tests/layer_tests/tensorflow_tests/test_tf_UnsortedSegmentSum.py
.py
# Copyright (C) 2018-2026 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import numpy as np import pytest import tensorflow as tf from common.tf_layer_test_class import CommonTFLayerTest rng = np.random.default_rng(23254) class TestUnsortedSegmentSum(CommonTFLayerTest): def _prepare_input(self, inputs_...
63
3,219
cvxpy
cvxpy/tests/test_power_atom.py
.py
""" Copyright 2025 CVXPY 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 http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, softwa...
371
15,433
jupytext
tests/data/notebooks/outputs/ipynb_to_script/sample_rise_notebook_66.py
.py
# --- # jupyter: # kernelspec: # display_name: Python 3 # language: python # name: python3 # --- # + [markdown] slideshow={"slide_type": "slide"} # A markdown cell # + slideshow={"slide_type": ""} 1+1 # + [markdown] cell_style="center" slideshow={"slide_type": "fragment"} # Markdown cell two
17
310
wagtail
wagtail/api/v2/utils.py
.py
import swapper from wagtail.api.utils import get_full_url from wagtail.coreutils import resolve_model_string Page = swapper.load_model("wagtailcore", "Page") class BadRequestError(Exception): pass def get_object_detail_url(router, request, model, pk): url_path = router.get_object_detail_urlpath(model, pk)...
248
7,791
onnx
onnx/reference/ops/aionnxml/op_tree_ensemble_classifier.py
.py
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np from onnx.reference.ops.aionnxml._common_classifier import ( logistic, probit, softmax, softmax_zero, ) from onnx.reference.ops.aionnxml._op_run_aionnxml import OpRunA...
133
4,844
pdm
src/pdm/cli/options.py
.py
from __future__ import annotations import argparse import os import sys from functools import partial from typing import TYPE_CHECKING, cast if TYPE_CHECKING: from collections.abc import Sequence from typing import Any, Protocol from pdm.project import Project class ActionCallback(Protocol): ...
546
15,942
mlflow
tests/projects/test_projects.py
.py
import json import os import shutil import subprocess import uuid from unittest import mock import git import pytest import yaml import mlflow from mlflow import MlflowClient from mlflow.entities import RunStatus, SourceType, ViewType from mlflow.environment_variables import MLFLOW_CONDA_CREATE_ENV_CMD, MLFLOW_CONDA_...
549
19,035
hydra
hydra/plugins/plugin.py
.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved from abc import ABC class Plugin(ABC): ...
6
116
onnxruntime
onnxruntime/python/tools/quantization/operators/binary_op.py
.py
import onnx from onnx import onnx_pb as onnx_proto # noqa: F401 from ..quant_utils import TENSOR_NAME_QUANT_SUFFIX, QuantizedValue, QuantizedValueType, attribute_to_kwarg, ms_domain from .base_operator import QuantOperatorBase class QLinearBinaryOp(QuantOperatorBase): def __init__(self, onnx_quantizer, onnx_nod...
73
2,472
beam
sdks/python/apache_beam/io/gcp/bigquery_read_internal.py
.py
# # 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 us...
493
16,919
onnxruntime
onnxruntime/python/tools/quantization/operators/softmax.py
.py
import onnx import onnx.helper from ..quant_utils import TENSOR_NAME_QUANT_SUFFIX, QuantizedValue, QuantizedValueType, attribute_to_kwarg, ms_domain from .base_operator import QuantOperatorBase class QLinearSoftmax(QuantOperatorBase): def quantize(self): node = self.node # set limitations for sof...
75
2,640
saleor
saleor/graphql/checkout/tests/mutations/test_checkout_complete_price_override.py
.py
from decimal import Decimal import pytest from .....checkout import calculations from .....checkout.fetch import fetch_checkout_info, fetch_checkout_lines from .....checkout.utils import add_voucher_code_to_checkout from .....discount import DiscountValueType, RewardValueType from .....discount.models import Promotio...
752
28,147
qutip
qutip/tests/core/test_expect.py
.py
import pytest import collections import functools import numpy as np import qutip from qutip.core.data import CSR, Dense import qutip.core.data as _data # We want to test the broadcasting rules for `qutip.expect` for a whole bunch # of different systems, without having to repeatedly specify the systems over # and over...
176
7,547
saleor
saleor/webhook/models.py
.py
from django.contrib.postgres.fields import ArrayField from django.contrib.postgres.indexes import GinIndex from django.db import models from ..app.models import App from ..app.validators import AppURLValidator from ..core.utils.json_serializer import CustomJsonEncoder from .const import MAX_FILTERABLE_CHANNEL_SLUGS_LI...
76
2,623
onnx
onnx/reference/ops/op_transpose.py
.py
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import numpy as np from onnx.reference.op_run import OpRun class Transpose(OpRun): def _run(self, data, perm=None): perm_ = None if (perm is None or len(perm) == 0) else perm if pe...
21
592
luigi
luigi/contrib/webhdfs.py
.py
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
105
3,075
saleor
saleor/graphql/tax/tests/queries/test_tax_classes.py
.py
import graphene import pytest from .....tax.models import TaxClass from ....tests.utils import assert_no_permission, get_graphql_content from ..fragments import TAX_CLASS_FRAGMENT QUERY = ( """ query TaxClasses($sortBy: TaxClassSortingInput, $filter: TaxClassFilterInput) { taxClasses(first: 100, sortB...
90
2,405
hydra
tests/test_examples/test_patterns.py
.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved from pathlib import Path from textwrap import dedent from typing import Any, List from omegaconf import OmegaConf from pytest import mark, param from hydra.test_utils.test_utils import ( TTaskRunner, assert_text_same, chdir_hydra_root,...
162
4,603
textual
tests/snapshot_tests/snapshot_apps/input_validation.py
.py
from textual.app import App, ComposeResult from textual.validation import Number from textual.widgets import Input VALIDATORS = [ Number(minimum=1, maximum=5), ] class InputApp(App): CSS = """ Input.-valid { border: tall $success 60%; } Input.-valid:focus { border: tall $success; ...
46
971
probability
tensorflow_probability/python/experimental/distributions/increment_log_prob_test.py
.py
# Copyright 2021 The TensorFlow Probability Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
118
4,338
mlflow
dev/dev_stubs/claude_cli.py
.py
"""Credential-free stub `claude` CLI for reviewing provider-gated Assistant UI. The MLflow Assistant's "Claude Code" provider only reveals its chat panel after an auth probe succeeds: it shells out to ``claude -p hi --max-turns 1 --output-format json`` and unlocks the UI when that exits 0 (see ``mlflow/assistant/provi...
110
4,093
pyro
pyro/ops/einsum/torch_sample.py
.py
# Copyright (c) 2017-2019 Uber Technologies, Inc. # SPDX-License-Identifier: Apache-2.0 import operator from functools import reduce import pyro.distributions as dist import pyro.ops.einsum.torch_log from pyro.ops import packed from pyro.ops.einsum.adjoint import ( Backward, einsum_backward_sample, transp...
80
2,736
coremltools
deps/protobuf/python/google/protobuf/descriptor.py
.py
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redi...
1,183
45,140
probability
tensorflow_probability/python/internal/reparameterization.py
.py
# Copyright 2018 The TensorFlow Probability Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
75
2,649
pyomo
pyomo/opt/parallel/__init__.py
.py
# ____________________________________________________________________________________ # # Pyomo: Python Optimization Modeling Objects # Copyright (c) 2008-2026 National Technology and Engineering Solutions of Sandia, LLC # Under the terms of Contract DE-NA0003525 with National Technology and Engineering # Solutions of...
17
742
omegaconf
tests/interpolation/built_in_resolvers/test_oc_create.py
.py
from typing import Any, Dict, List from pytest import mark, param, raises from omegaconf import DictConfig, ListConfig, OmegaConf from omegaconf.errors import InterpolationResolutionError @mark.parametrize( ("cfg", "key", "expected"), [ # Note that since `oc.create` is simply calling `OmegaConf.crea...
140
3,890
beam
sdks/python/apache_beam/examples/inference/runinference_metrics/setup.py
.py
# # 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 us...
44
1,586
mlflow
examples/openai/autologging/module_client.py
.py
import os import openai import mlflow assert "OPENAI_API_KEY" in os.environ, "Please set the OPENAI_API_KEY environment variable." mlflow.openai.autolog( log_input_examples=True, log_model_signatures=True, log_models=True, registered_model_name="openai_model", ) messages = [ { "role": "...
36
848
probability
discussion/robust_inverse_graphics/util/tree_util_test.py
.py
# Copyright 2024 The TensorFlow Probability Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
63
1,995
saleor
saleor/graphql/menu/tests/mutations/test_menu_item_update.py
.py
import json from unittest import mock import graphene from django.utils.functional import SimpleLazyObject from freezegun import freeze_time from .....core.utils.json_serializer import CustomJsonEncoder from .....webhook.event_types import WebhookEventAsyncType from .....webhook.payloads import generate_meta, generat...
135
4,103
probability
tensorflow_probability/python/internal/broadcast_util_test.py
.py
# Copyright 2021 The TensorFlow Probability Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
71
2,770
clearml
clearml/utilities/plotlympl/mplexporter/renderers/fake_renderer.py
.py
from typing import Optional, Any import numpy from .base import Renderer class FakeRenderer(Renderer): """ Fake Renderer This is a fake renderer which simply outputs a text tree representing the elements found in the plot(s). This is used in the unit tests for the package. Below are the m...
118
3,343
metrics
src/torchmetrics/functional/classification/specificity_sensitivity.py
.py
# Copyright The Lightning team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
485
23,556
onnxruntime
onnxruntime/test/python/transformers/test_parity_neox_attention.py
.py
# -------------------------------------------------------------------------- # Copyright 2020 The HuggingFace Inc. team # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at http://www.apache.org/l...
485
20,135
astropy
astropy/coordinates/builtin_frames/utils.py
.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module contains functions/values used repeatedly in different modules of the ``builtin_frames`` package. """ import warnings import erfa import numpy as np from astropy import units as u from astropy.coordinates.earth import EarthLocation from ...
423
14,566
voila
tests/app/syntax_error_test.py
.py
import os import pytest NOTEBOOK_PATH = "syntax_error.ipynb" @pytest.fixture def voila_notebook(notebook_directory): return os.path.join(notebook_directory, NOTEBOOK_PATH) async def test_syntax_error(http_server_client, base_url): response = await http_server_client.fetch(base_url) assert response.cod...
19
489
mlflow
tests/store/tracking/sqlalchemy_store/test_sqlalchemy_store_assessments.py
.py
import time import uuid import pytest from mlflow.entities import ( AssessmentSource, AssessmentSourceType, Expectation, Feedback, trace_location, ) from mlflow.entities.assessment import ExpectationValue, FeedbackValue from mlflow.entities.trace_info import TraceInfo from mlflow.entities.trace_st...
598
22,809
wandb
wandb/sdk/artifacts/_generated/fetch_advanced_registry_features.py
.py
# Generated by ariadne-codegen # Source: tools/graphql_codegen/artifacts/ from __future__ import annotations from pydantic import Field from wandb._pydantic import GQLResult class FetchAdvancedRegistryFeatures(GQLResult): organization: FetchAdvancedRegistryFeaturesOrganization | None class FetchAdvancedRegis...
27
769
voila
voila/app.py
.py
############################################################################# # Copyright (c) 2018, Voilà Contributors # # Copyright (c) 2018, QuantStack # # # # Distri...
1,002
36,242
mlflow
mlflow/entities/param.py
.py
import sys from mlflow.entities._mlflow_object import _MlflowObject from mlflow.protos.service_pb2 import Param as ProtoParam class Param(_MlflowObject): """ Parameter object. """ def __init__(self, key, value): if "pyspark.ml" in sys.modules: import pyspark.ml.param ...
50
1,133
beam
sdks/python/apache_beam/examples/inference/online_clustering/write_data_to_pubsub_pipeline/pipeline/options.py
.py
# # 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 us...
63
2,320
sphinx
sphinx/highlighting.py
.py
"""Highlight code blocks using Pygments.""" from __future__ import annotations from functools import partial from importlib import import_module from typing import TYPE_CHECKING import pygments from pygments import highlight from pygments.filters import ErrorToken from pygments.formatters import HtmlFormatter, Latex...
238
7,855
probability
tensorflow_probability/python/distributions/empirical.py
.py
# Copyright 2018 The TensorFlow Probability Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
367
14,254
pyomo
pyomo/contrib/incidence_analysis/config.py
.py
# ____________________________________________________________________________________ # # Pyomo: Python Optimization Modeling Objects # Copyright (c) 2008-2026 National Technology and Engineering Solutions of Sandia, LLC # Under the terms of Contract DE-NA0003525 with National Technology and Engineering # Solutions of...
150
4,824
metrics
src/torchmetrics/nominal/pearson.py
.py
# Copyright The Lightning team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
160
6,567
wandb
wandb/sdk/artifacts/storage_policies/_multipart.py
.py
"""Helpers and constants for multipart upload and download.""" from __future__ import annotations import logging import math import threading from collections.abc import Callable, Iterator from concurrent.futures import FIRST_EXCEPTION, Executor, ThreadPoolExecutor, wait from dataclasses import dataclass, field from ...
303
11,036
gunicorn
tests/test_asgi_error_handling.py
.py
# # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. """ ASGI error handling tests. Tests for application error scenarios and graceful shutdown behavior to ensure robust error handling in ASGI applications. """ import asyncio from unittest import mock import pytes...
395
12,245
luigi
luigi/contrib/bigquery_avro.py
.py
"""Specialized tasks for handling Avro data in BigQuery from GCS.""" import logging from luigi.contrib.bigquery import BigQueryLoadTask, SourceFormat from luigi.contrib.gcs import GCSClient from luigi.task import flatten logger = logging.getLogger("luigi-interface") try: import avro import avro.datafile exc...
108
4,227
mlflow
mlflow/deployments/__init__.py
.py
""" Exposes functionality for deploying MLflow models to custom serving tools. Note: model deployment to AWS Sagemaker can currently be performed via the :py:mod:`mlflow.sagemaker` module. Model deployment to Azure can be performed by using the `azureml library <https://pypi.org/project/azureml-mlflow/>`_. MLflow doe...
120
4,763
mamba
micromamba/tests/test_proxy.py
.py
import os import shutil import subprocess import time import urllib.parse from pathlib import Path import pytest from . import helpers __this_dir__ = Path(__file__).parent.resolve() @pytest.fixture def mitmdump_exe(): """Get the path to the ``mitmdump`` executable. If the executable is provided in a conda...
118
3,793
biopython
Tests/test_MafIO_index.py
.py
# Copyright 2012 by Andrew Sczesnak. All rights reserved. # Revisions Copyright 2017 by Blaise Li. All rights reserved. # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. """Unit tests for Bio.AlignIO....
745
32,437
mlflow
tests/gateway/test_tracing_utils.py
.py
import asyncio import json from typing import Any import pytest import mlflow from mlflow.entities import SpanType from mlflow.gateway.constants import MLFLOW_GATEWAY_CALLER_HEADER from mlflow.gateway.schemas.chat import StreamResponsePayload from mlflow.gateway.tracing_utils import ( _extract_caller, _get_mo...
1,135
41,606
coremltools
coremltools/converters/mil/mil/ops/tests/iOS14/test_recurrent.py
.py
# Copyright (c) 2020, Apple Inc. All rights reserved. # # Use of this source code is governed by a BSD-3-clause license that can be # found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause import itertools import numpy as np import pytest import coremltools as ct from coremltools._deps i...
894
29,717
metrics
tests/unittests/clustering/_inputs.py
.py
# Copyright The Lightning team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
58
2,083
cvxpy
cvxpy/reductions/solvers/qp_solvers/highs_qpif.py
.py
""" Copyright, the CVXPY authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software ...
264
9,542
cvxpy
cvxpy/reductions/eliminate_pwl/canonicalizers/min_canon.py
.py
""" Copyright 2018 Akshay Agrawal 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...
30
1,013
onnxruntime
tools/python/benchmark_mmap_ort.py
.py
#!/usr/bin/env python3 """ Developer benchmark for memory-mapped .ort model loading. Compares session construction time and process memory across loading configurations: 1. Standard .ort load (file read into heap buffer) 2. Memory-mapped .ort load (session.use_memory_mapped_ort_model) 3. Memory-mapped + direct i...
386
13,938
openvino
src/bindings/python/src/openvino/frontend/pytorch/torchdynamo/backend.py
.py
# Copyright (C) 2018-2026 Intel Corporation # SPDX-License-Identifier: Apache-2.0 # flake8: noqa # mypy: ignore-errors import logging import os from functools import partial from hashlib import sha256 import torch from torch._dynamo.backends.common import fake_tensor_unsupported, aot_autograd from torch._dynamo.back...
141
6,331
mlflow
mlflow/dspy/util.py
.py
import json import logging import tempfile from collections import defaultdict from pathlib import Path from typing import Any import dspy from dspy import Example import mlflow from mlflow.entities import LoggedModelOutput _logger = logging.getLogger(__name__) EXCLUDE_LM_PARAMS = {"api_key", "api_base", "azure_ad_...
159
5,166
mlflow
mlflow/store/artifact/dbfs_artifact_repo.py
.py
import json import os import posixpath import mlflow.utils.databricks_utils from mlflow.entities import FileInfo from mlflow.environment_variables import ( MLFLOW_DISABLE_DATABRICKS_SDK_FOR_RUN_ARTIFACTS, MLFLOW_ENABLE_DBFS_FUSE_ARTIFACT_REPO, ) from mlflow.exceptions import MlflowException from mlflow.protos....
265
11,587
wandb
wandb/sdk/lib/sparkline.py
.py
# # From pysparklines (BSD License): https://pypi.python.org/pypi/pysparklines from __future__ import annotations import math spark_chars = "▁▂▃▄▅▆▇█" # math.isfinite doesn't exist in python2, so provider our own def isfinite(f): return not (math.isinf(f) or math.isnan(f)) def sparkify(series: list[float | in...
45
1,361
beam
sdks/python/apache_beam/tools/fn_api_runner_microbenchmark.py
.py
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
151
5,039
onnxruntime
onnxruntime/test/testdata/transform/recompute/3layer_bloom_optimized_training.py
.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. """This file is used to generate test data for MemoryOptimizer tests in onnxruntime/test/optimizer/memory_optimizer_test.cc. The libs used to generate 3 layer bloom model. optimum: f6adbef5c4a6bd16a17e3b22712028...
85
2,717
mlflow
tests/llama_index/test_llama_index_serialization.py
.py
import json from collections import Counter, deque from unittest import mock import pytest from llama_index.core import PromptTemplate, Settings from llama_index.embeddings.openai import OpenAIEmbedding from llama_index.llms.openai import OpenAI from mlflow.llama_index.serialize_objects import ( _construct_prompt...
151
5,419
beam
sdks/python/apache_beam/runners/direct/util.py
.py
# # 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 us...
94
3,318
openvino
tests/e2e_tests/pipelines/pipeline_templates/collect_reference_templates.py
.py
# Copyright (C) 2018-2026 Intel Corporation # SPDX-License-Identifier: Apache-2.0 """Common reference collection templates processed by testing framework. """ from collections import OrderedDict from e2e_tests.common.decorators import wrap_ord_dict from e2e_tests.pipelines.pipeline_templates.postproc_template import ...
147
6,748
coremltools
coremltools/converters/mil/backend/mil/test_helper.py
.py
# Copyright (c) 2020, Apple Inc. All rights reserved. # # Use of this source code is governed by a BSD-3-clause license that can be # found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause from coremltools.converters.mil.mil.passes.defs.preprocess import NameSanitizer as _NameSanitizer c...
28
1,265
qutip
qutip/tests/core/test_dimensions.py
.py
import numbers from typing import Literal import pytest import collections import numpy as np import qutip from qutip.core.dimensions import ( flatten, unflatten, enumerate_flat, deep_remove, deep_map, dims_idxs_to_tensor_idxs, dims_to_tensor_shape, dims_to_tensor_perm, einsum, to_tensor_rep, from_tensor_re...
484
19,456
sphinx
sphinx/directives/code.py
.py
from __future__ import annotations import sys import textwrap from difflib import unified_diff from typing import TYPE_CHECKING from docutils import nodes from docutils.parsers.rst import directives from sphinx import addnodes from sphinx.directives import optional_int from sphinx.locale import __ from sphinx.util i...
520
18,916