repo stringlengths 7 90 | file_url stringlengths 81 315 | file_path stringlengths 4 228 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 14:38:15 2026-01-05 02:33:18 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
reflex-dev/reflex | https://github.com/reflex-dev/reflex/blob/5b3aa272183504eae277ef61f72c162d72a290a5/tests/units/components/graphing/test_recharts.py | tests/units/components/graphing/test_recharts.py | from reflex.components.recharts.charts import (
AreaChart,
BarChart,
LineChart,
PieChart,
RadarChart,
RadialBarChart,
ScatterChart,
)
from reflex.components.recharts.general import ResponsiveContainer
def test_area_chart():
ac = AreaChart.create()
assert isinstance(ac, ResponsiveCo... | python | Apache-2.0 | 5b3aa272183504eae277ef61f72c162d72a290a5 | 2026-01-04T14:43:58.087685Z | false |
reflex-dev/reflex | https://github.com/reflex-dev/reflex/blob/5b3aa272183504eae277ef61f72c162d72a290a5/tests/units/components/graphing/test_plotly.py | tests/units/components/graphing/test_plotly.py | import numpy as np
import plotly.graph_objects as go
import pytest
import reflex as rx
from reflex.utils.serializers import serialize, serialize_figure
@pytest.fixture
def plotly_fig() -> go.Figure:
"""Get a plotly figure.
Returns:
A random plotly figure.
"""
# Generate random data.
rng ... | python | Apache-2.0 | 5b3aa272183504eae277ef61f72c162d72a290a5 | 2026-01-04T14:43:58.087685Z | false |
reflex-dev/reflex | https://github.com/reflex-dev/reflex/blob/5b3aa272183504eae277ef61f72c162d72a290a5/tests/units/components/graphing/__init__.py | tests/units/components/graphing/__init__.py | """Graphing component tests."""
| python | Apache-2.0 | 5b3aa272183504eae277ef61f72c162d72a290a5 | 2026-01-04T14:43:58.087685Z | false |
reflex-dev/reflex | https://github.com/reflex-dev/reflex/blob/5b3aa272183504eae277ef61f72c162d72a290a5/tests/units/components/markdown/test_markdown.py | tests/units/components/markdown/test_markdown.py | import pytest
from reflex.components.component import Component, memo
from reflex.components.datadisplay.code import CodeBlock
from reflex.components.datadisplay.shiki_code_block import ShikiHighLevelCodeBlock
from reflex.components.markdown.markdown import Markdown, MarkdownComponentMap
from reflex.components.radix.t... | python | Apache-2.0 | 5b3aa272183504eae277ef61f72c162d72a290a5 | 2026-01-04T14:43:58.087685Z | false |
reflex-dev/reflex | https://github.com/reflex-dev/reflex/blob/5b3aa272183504eae277ef61f72c162d72a290a5/tests/units/components/markdown/__init__.py | tests/units/components/markdown/__init__.py | python | Apache-2.0 | 5b3aa272183504eae277ef61f72c162d72a290a5 | 2026-01-04T14:43:58.087685Z | false | |
reflex-dev/reflex | https://github.com/reflex-dev/reflex/blob/5b3aa272183504eae277ef61f72c162d72a290a5/tests/units/utils/test_format.py | tests/units/utils/test_format.py | from __future__ import annotations
import datetime
import json
from typing import Any
import plotly.graph_objects as go
import pytest
from reflex.components.tags.tag import Tag
from reflex.constants.state import FIELD_MARKER
from reflex.event import (
EventChain,
EventHandler,
EventSpec,
JavascriptIn... | python | Apache-2.0 | 5b3aa272183504eae277ef61f72c162d72a290a5 | 2026-01-04T14:43:58.087685Z | false |
reflex-dev/reflex | https://github.com/reflex-dev/reflex/blob/5b3aa272183504eae277ef61f72c162d72a290a5/tests/units/utils/test_tasks.py | tests/units/utils/test_tasks.py | import asyncio
import contextlib
import os
from unittest.mock import Mock
import pytest
from reflex.utils.tasks import ensure_task
CI = bool(os.environ.get("CI", False))
class NotSuppressedError(Exception):
"""An exception that should not be suppressed."""
@pytest.mark.asyncio
async def test_ensure_task_supp... | python | Apache-2.0 | 5b3aa272183504eae277ef61f72c162d72a290a5 | 2026-01-04T14:43:58.087685Z | false |
reflex-dev/reflex | https://github.com/reflex-dev/reflex/blob/5b3aa272183504eae277ef61f72c162d72a290a5/tests/units/utils/test_utils.py | tests/units/utils/test_utils.py | import os
import typing
from collections.abc import Mapping, Sequence
from functools import cached_property
from pathlib import Path
from typing import Any, ClassVar, List, Literal, NoReturn # noqa: UP035
import pytest
from packaging import version
from pytest_mock import MockerFixture
from reflex import constants
f... | python | Apache-2.0 | 5b3aa272183504eae277ef61f72c162d72a290a5 | 2026-01-04T14:43:58.087685Z | false |
reflex-dev/reflex | https://github.com/reflex-dev/reflex/blob/5b3aa272183504eae277ef61f72c162d72a290a5/tests/units/utils/test_processes.py | tests/units/utils/test_processes.py | """Test process utilities."""
import socket
import threading
from contextlib import closing
from unittest import mock
import pytest
from reflex.testing import DEFAULT_TIMEOUT, AppHarness
from reflex.utils.processes import is_process_on_port
def test_is_process_on_port_free_port():
"""Test is_process_on_port re... | python | Apache-2.0 | 5b3aa272183504eae277ef61f72c162d72a290a5 | 2026-01-04T14:43:58.087685Z | false |
reflex-dev/reflex | https://github.com/reflex-dev/reflex/blob/5b3aa272183504eae277ef61f72c162d72a290a5/tests/units/utils/test_types.py | tests/units/utils/test_types.py | from typing import Any, Literal, TypedDict
import pytest
from reflex.utils import types
from reflex.vars.base import Var
@pytest.mark.parametrize(
("params", "allowed_value_str", "value_str"),
[
(["size", 1, Literal["1", "2", "3"], "Heading"], "'1','2','3'", "1"),
(["size", "1", Literal[1, 2... | python | Apache-2.0 | 5b3aa272183504eae277ef61f72c162d72a290a5 | 2026-01-04T14:43:58.087685Z | false |
reflex-dev/reflex | https://github.com/reflex-dev/reflex/blob/5b3aa272183504eae277ef61f72c162d72a290a5/tests/units/utils/test_token_manager.py | tests/units/utils/test_token_manager.py | """Unit tests for TokenManager implementations."""
import asyncio
import pickle
import time
from collections.abc import Callable, Generator
from contextlib import asynccontextmanager
from unittest.mock import AsyncMock, Mock, patch
import pytest
from reflex import config
from reflex.app import EventNamespace
from re... | python | Apache-2.0 | 5b3aa272183504eae277ef61f72c162d72a290a5 | 2026-01-04T14:43:58.087685Z | false |
reflex-dev/reflex | https://github.com/reflex-dev/reflex/blob/5b3aa272183504eae277ef61f72c162d72a290a5/tests/units/utils/__init__.py | tests/units/utils/__init__.py | python | Apache-2.0 | 5b3aa272183504eae277ef61f72c162d72a290a5 | 2026-01-04T14:43:58.087685Z | false | |
reflex-dev/reflex | https://github.com/reflex-dev/reflex/blob/5b3aa272183504eae277ef61f72c162d72a290a5/tests/units/utils/test_imports.py | tests/units/utils/test_imports.py | import pytest
from reflex.utils.imports import (
ImportDict,
ImportVar,
ParsedImportDict,
merge_imports,
parse_imports,
)
@pytest.mark.parametrize(
("import_var", "expected_name"),
[
(
ImportVar(tag="BaseTag"),
"BaseTag",
),
(
Im... | python | Apache-2.0 | 5b3aa272183504eae277ef61f72c162d72a290a5 | 2026-01-04T14:43:58.087685Z | false |
reflex-dev/reflex | https://github.com/reflex-dev/reflex/blob/5b3aa272183504eae277ef61f72c162d72a290a5/tests/units/utils/test_serializers.py | tests/units/utils/test_serializers.py | import datetime
import decimal
import json
from enum import Enum
from pathlib import Path
from typing import Any
import pytest
from reflex.base import Base
from reflex.components.core.colors import Color
from reflex.utils import serializers
from reflex.utils.format import json_dumps
from reflex.vars.base import Liter... | python | Apache-2.0 | 5b3aa272183504eae277ef61f72c162d72a290a5 | 2026-01-04T14:43:58.087685Z | false |
reflex-dev/reflex | https://github.com/reflex-dev/reflex/blob/5b3aa272183504eae277ef61f72c162d72a290a5/tests/units/plugins/test_sitemap.py | tests/units/plugins/test_sitemap.py | """Unit tests for the sitemap plugin."""
import datetime
from unittest.mock import MagicMock, patch
import reflex as rx
from reflex.app import UnevaluatedPage
from reflex.plugins.sitemap import SitemapLink, generate_links_for_sitemap, generate_xml
def test_generate_xml_empty_links():
"""Test generate_xml with a... | python | Apache-2.0 | 5b3aa272183504eae277ef61f72c162d72a290a5 | 2026-01-04T14:43:58.087685Z | false |
reflex-dev/reflex | https://github.com/reflex-dev/reflex/blob/5b3aa272183504eae277ef61f72c162d72a290a5/tests/units/assets/test_assets.py | tests/units/assets/test_assets.py | import shutil
from collections.abc import Generator
from pathlib import Path
import pytest
import reflex as rx
import reflex.constants as constants
def test_shared_asset() -> None:
"""Test shared assets."""
# The asset function copies a file to the app's external assets directory.
asset = rx.asset(path=... | python | Apache-2.0 | 5b3aa272183504eae277ef61f72c162d72a290a5 | 2026-01-04T14:43:58.087685Z | false |
reflex-dev/reflex | https://github.com/reflex-dev/reflex/blob/5b3aa272183504eae277ef61f72c162d72a290a5/tests/units/istate/__init__.py | tests/units/istate/__init__.py | python | Apache-2.0 | 5b3aa272183504eae277ef61f72c162d72a290a5 | 2026-01-04T14:43:58.087685Z | false | |
reflex-dev/reflex | https://github.com/reflex-dev/reflex/blob/5b3aa272183504eae277ef61f72c162d72a290a5/tests/units/istate/manager/test_redis.py | tests/units/istate/manager/test_redis.py | """Tests specific to redis state manager."""
import asyncio
import os
import time
import uuid
from collections.abc import AsyncGenerator
from typing import Any
import pytest
import pytest_asyncio
from reflex.istate.manager.redis import StateManagerRedis
from reflex.state import BaseState, _substate_key
from tests.un... | python | Apache-2.0 | 5b3aa272183504eae277ef61f72c162d72a290a5 | 2026-01-04T14:43:58.087685Z | false |
reflex-dev/reflex | https://github.com/reflex-dev/reflex/blob/5b3aa272183504eae277ef61f72c162d72a290a5/tests/units/istate/manager/__init__.py | tests/units/istate/manager/__init__.py | python | Apache-2.0 | 5b3aa272183504eae277ef61f72c162d72a290a5 | 2026-01-04T14:43:58.087685Z | false | |
reflex-dev/reflex | https://github.com/reflex-dev/reflex/blob/5b3aa272183504eae277ef61f72c162d72a290a5/tests/units/vars/test_dep_tracking_integration.py | tests/units/vars/test_dep_tracking_integration.py | """Integration tests for dependency tracking with computed vars."""
from __future__ import annotations
import reflex as rx
from reflex.state import State
class IntegrationTestState(State):
"""State for integration testing with dependency tracker."""
count: int = 0
name: str = "test"
items: list[str... | python | Apache-2.0 | 5b3aa272183504eae277ef61f72c162d72a290a5 | 2026-01-04T14:43:58.087685Z | false |
reflex-dev/reflex | https://github.com/reflex-dev/reflex/blob/5b3aa272183504eae277ef61f72c162d72a290a5/tests/units/vars/test_object.py | tests/units/vars/test_object.py | import dataclasses
from collections.abc import Sequence
import pytest
from typing_extensions import assert_type
import reflex as rx
from reflex.utils.types import GenericType
from reflex.vars.base import Var
from reflex.vars.object import LiteralObjectVar, ObjectVar
from reflex.vars.sequence import ArrayVar
pytest.i... | python | Apache-2.0 | 5b3aa272183504eae277ef61f72c162d72a290a5 | 2026-01-04T14:43:58.087685Z | false |
reflex-dev/reflex | https://github.com/reflex-dev/reflex/blob/5b3aa272183504eae277ef61f72c162d72a290a5/tests/units/vars/test_base.py | tests/units/vars/test_base.py | from collections.abc import Mapping, Sequence
import pytest
from reflex.state import State
from reflex.vars.base import computed_var, figure_out_type
class CustomDict(dict[str, str]):
"""A custom dict with generic arguments."""
class ChildCustomDict(CustomDict):
"""A child of CustomDict."""
class Generi... | python | Apache-2.0 | 5b3aa272183504eae277ef61f72c162d72a290a5 | 2026-01-04T14:43:58.087685Z | false |
reflex-dev/reflex | https://github.com/reflex-dev/reflex/blob/5b3aa272183504eae277ef61f72c162d72a290a5/tests/units/vars/test_dep_tracking.py | tests/units/vars/test_dep_tracking.py | """Tests for dependency tracking functionality."""
from __future__ import annotations
import sys
import pytest
import reflex as rx
import tests.units.states.upload as tus_upload
from reflex.state import State
from reflex.utils.exceptions import VarValueError
from reflex.vars.dep_tracking import (
DependencyTrac... | python | Apache-2.0 | 5b3aa272183504eae277ef61f72c162d72a290a5 | 2026-01-04T14:43:58.087685Z | false |
reflex-dev/reflex | https://github.com/reflex-dev/reflex/blob/5b3aa272183504eae277ef61f72c162d72a290a5/tests/units/compiler/test_compiler_utils.py | tests/units/compiler/test_compiler_utils.py | def TestState(State):
pass
def test_compile_state():
# TODO: Implement test for compile_state function.
pass
| python | Apache-2.0 | 5b3aa272183504eae277ef61f72c162d72a290a5 | 2026-01-04T14:43:58.087685Z | false |
reflex-dev/reflex | https://github.com/reflex-dev/reflex/blob/5b3aa272183504eae277ef61f72c162d72a290a5/tests/units/compiler/test_compiler.py | tests/units/compiler/test_compiler.py | import importlib.util
import os
from pathlib import Path
import pytest
from pytest_mock import MockerFixture
from reflex import constants
from reflex.compiler import compiler, utils
from reflex.components.base import document
from reflex.components.el.elements.metadata import Link
from reflex.constants.compiler impor... | python | Apache-2.0 | 5b3aa272183504eae277ef61f72c162d72a290a5 | 2026-01-04T14:43:58.087685Z | false |
reflex-dev/reflex | https://github.com/reflex-dev/reflex/blob/5b3aa272183504eae277ef61f72c162d72a290a5/tests/units/compiler/__init__.py | tests/units/compiler/__init__.py | """Compiler tests."""
| python | Apache-2.0 | 5b3aa272183504eae277ef61f72c162d72a290a5 | 2026-01-04T14:43:58.087685Z | false |
reflex-dev/reflex | https://github.com/reflex-dev/reflex/blob/5b3aa272183504eae277ef61f72c162d72a290a5/tests/units/states/mutation.py | tests/units/states/mutation.py | """Test states for mutable vars."""
import reflex as rx
from reflex.state import BaseState
class OtherBase(rx.Base):
"""A Base model with a str field."""
bar: str = ""
class CustomVar(rx.Base):
"""A Base model with multiple fields."""
foo: str = ""
array: list[str] = []
hashmap: dict[str,... | python | Apache-2.0 | 5b3aa272183504eae277ef61f72c162d72a290a5 | 2026-01-04T14:43:58.087685Z | false |
reflex-dev/reflex | https://github.com/reflex-dev/reflex/blob/5b3aa272183504eae277ef61f72c162d72a290a5/tests/units/states/upload.py | tests/units/states/upload.py | """Test states for upload-related tests."""
from pathlib import Path
from typing import ClassVar
import reflex as rx
from reflex.state import BaseState, State
class UploadBaseState(BaseState):
"""The base state for uploading a file."""
class UploadState(BaseState):
"""The base state for uploading a file."... | python | Apache-2.0 | 5b3aa272183504eae277ef61f72c162d72a290a5 | 2026-01-04T14:43:58.087685Z | false |
reflex-dev/reflex | https://github.com/reflex-dev/reflex/blob/5b3aa272183504eae277ef61f72c162d72a290a5/tests/units/states/__init__.py | tests/units/states/__init__.py | """Common rx.BaseState subclasses for use in tests."""
from reflex.state import BaseState
class GenState(BaseState):
"""A state with event handlers that generate multiple updates."""
value: int
def go(self, c: int):
"""Increment the value c times and update each time.
Args:
... | python | Apache-2.0 | 5b3aa272183504eae277ef61f72c162d72a290a5 | 2026-01-04T14:43:58.087685Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/setup.py | setup.py | #!/usr/bin/env python
# Copyright The Lightning AI 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 l... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/.actions/assistant.py | .actions/assistant.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/pytorch_lightning/__setup__.py | src/pytorch_lightning/__setup__.py | import glob
import os.path
from importlib.util import module_from_spec, spec_from_file_location
from pathlib import Path
from types import ModuleType
from typing import Any
from pkg_resources import parse_requirements
from setuptools import find_packages
_PROJECT_ROOT = "."
_SOURCE_ROOT = os.path.join(_PROJECT_ROOT, ... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/pytorch_lightning/__about__.py | src/pytorch_lightning/__about__.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/pytorch_lightning/__version__.py | src/pytorch_lightning/__version__.py | import os
_PACKAGE_ROOT = os.path.dirname(__file__)
_VERSION_PATH = os.path.join(os.path.dirname(_PACKAGE_ROOT), "version.info")
if not os.path.exists(_VERSION_PATH):
# relevant for `bdist_wheel`
_VERSION_PATH = os.path.join(_PACKAGE_ROOT, "version.info")
with open(_VERSION_PATH, encoding="utf-8") as fopen:
... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/__setup__.py | src/lightning/__setup__.py | import glob
import os.path
from importlib.util import module_from_spec, spec_from_file_location
from pathlib import Path
from types import ModuleType
from typing import Any
from setuptools import find_namespace_packages
_PROJECT_ROOT = "."
_SOURCE_ROOT = os.path.join(_PROJECT_ROOT, "src")
_PACKAGE_ROOT = os.path.join... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/__about__.py | src/lightning/__about__.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/__init__.py | src/lightning/__init__.py | """Root package info."""
import logging
# explicitly don't set root logger's propagation and leave this to subpackages to manage
_logger = logging.getLogger(__name__)
_logger.setLevel(logging.INFO)
_console = logging.StreamHandler()
_console.setLevel(logging.INFO)
formatter = logging.Formatter("%(levelname)s: %(mes... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/__version__.py | src/lightning/__version__.py | import os
_PACKAGE_ROOT = os.path.dirname(__file__)
_VERSION_PATH = os.path.join(os.path.dirname(_PACKAGE_ROOT), "version.info")
if not os.path.exists(_VERSION_PATH):
# relevant for `bdist_wheel`
_VERSION_PATH = os.path.join(_PACKAGE_ROOT, "version.info")
with open(_VERSION_PATH, encoding="utf-8") as fopen:
... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/cli.py | src/lightning/fabric/cli.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/wrappers.py | src/lightning/fabric/wrappers.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/connector.py | src/lightning/fabric/connector.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/fabric.py | src/lightning/fabric/fabric.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | true |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/__init__.py | src/lightning/fabric/__init__.py | """Root package info."""
import logging
import os
import sys
from lightning_utilities.core.imports import package_available
if os.path.isfile(os.path.join(os.path.dirname(__file__), "__about__.py")):
from lightning.fabric.__about__ import * # noqa: F403
if os.path.isfile(os.path.join(os.path.dirname(__file__), ... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/_graveyard/tpu.py | src/lightning/fabric/_graveyard/tpu.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/_graveyard/__init__.py | src/lightning/fabric/_graveyard/__init__.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/plugins/__init__.py | src/lightning/fabric/plugins/__init__.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/plugins/precision/double.py | src/lightning/fabric/plugins/precision/double.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/plugins/precision/amp.py | src/lightning/fabric/plugins/precision/amp.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/plugins/precision/half.py | src/lightning/fabric/plugins/precision/half.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/plugins/precision/bitsandbytes.py | src/lightning/fabric/plugins/precision/bitsandbytes.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/plugins/precision/precision.py | src/lightning/fabric/plugins/precision/precision.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/plugins/precision/utils.py | src/lightning/fabric/plugins/precision/utils.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/plugins/precision/fsdp.py | src/lightning/fabric/plugins/precision/fsdp.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/plugins/precision/transformer_engine.py | src/lightning/fabric/plugins/precision/transformer_engine.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/plugins/precision/__init__.py | src/lightning/fabric/plugins/precision/__init__.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/plugins/precision/deepspeed.py | src/lightning/fabric/plugins/precision/deepspeed.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/plugins/precision/xla.py | src/lightning/fabric/plugins/precision/xla.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/plugins/collectives/single_device.py | src/lightning/fabric/plugins/collectives/single_device.py | from typing import Any
from torch import Tensor
from typing_extensions import override
from lightning.fabric.plugins.collectives.collective import Collective
from lightning.fabric.utilities.types import CollectibleGroup
class SingleDeviceCollective(Collective):
"""Support for collective operations on a single d... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/plugins/collectives/__init__.py | src/lightning/fabric/plugins/collectives/__init__.py | from lightning.fabric.plugins.collectives.collective import Collective
from lightning.fabric.plugins.collectives.single_device import SingleDeviceCollective
from lightning.fabric.plugins.collectives.torch_collective import TorchCollective
__all__ = [
"Collective",
"TorchCollective",
"SingleDeviceCollective... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/plugins/collectives/collective.py | src/lightning/fabric/plugins/collectives/collective.py | from abc import ABC, abstractmethod
from typing import Any, Optional
from torch import Tensor
from typing_extensions import Self
from lightning.fabric.utilities.types import CollectibleGroup
class Collective(ABC):
"""Interface for collective operations.
Supports communications between multiple processes an... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/plugins/collectives/torch_collective.py | src/lightning/fabric/plugins/collectives/torch_collective.py | import datetime
import os
from typing import Any, Optional, Union
import torch
import torch.distributed as dist
from torch import Tensor
from typing_extensions import Self, override
from lightning.fabric.plugins.collectives.collective import Collective
from lightning.fabric.utilities.types import CollectibleGroup, Re... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/plugins/environments/lsf.py | src/lightning/fabric/plugins/environments/lsf.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/plugins/environments/cluster_environment.py | src/lightning/fabric/plugins/environments/cluster_environment.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/plugins/environments/lightning.py | src/lightning/fabric/plugins/environments/lightning.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/plugins/environments/mpi.py | src/lightning/fabric/plugins/environments/mpi.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/plugins/environments/slurm.py | src/lightning/fabric/plugins/environments/slurm.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/plugins/environments/torchelastic.py | src/lightning/fabric/plugins/environments/torchelastic.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/plugins/environments/__init__.py | src/lightning/fabric/plugins/environments/__init__.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/plugins/environments/kubeflow.py | src/lightning/fabric/plugins/environments/kubeflow.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/plugins/environments/xla.py | src/lightning/fabric/plugins/environments/xla.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/plugins/io/checkpoint_io.py | src/lightning/fabric/plugins/io/checkpoint_io.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/plugins/io/torch_io.py | src/lightning/fabric/plugins/io/torch_io.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/plugins/io/__init__.py | src/lightning/fabric/plugins/io/__init__.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/plugins/io/xla.py | src/lightning/fabric/plugins/io/xla.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/accelerators/cuda.py | src/lightning/fabric/accelerators/cuda.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/accelerators/mps.py | src/lightning/fabric/accelerators/mps.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/accelerators/registry.py | src/lightning/fabric/accelerators/registry.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/accelerators/cpu.py | src/lightning/fabric/accelerators/cpu.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/accelerators/accelerator.py | src/lightning/fabric/accelerators/accelerator.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/accelerators/__init__.py | src/lightning/fabric/accelerators/__init__.py | # Copyright The Lightning AI 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 writi... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/accelerators/xla.py | src/lightning/fabric/accelerators/xla.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/utilities/load.py | src/lightning/fabric/utilities/load.py | # Copyright 2023 MathInf GmbH
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this files from this repository except in compliance
# with the License reproduced below (also at
# http://www.apache.org/licenses/LICENSE-2.0).
#
# Unless required by applicable law or agreed to in writi... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/utilities/device_dtype_mixin.py | src/lightning/fabric/utilities/device_dtype_mixin.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/utilities/enums.py | src/lightning/fabric/utilities/enums.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/utilities/registry.py | src/lightning/fabric/utilities/registry.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/utilities/cloud_io.py | src/lightning/fabric/utilities/cloud_io.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/utilities/spike.py | src/lightning/fabric/utilities/spike.py | import json
import os
import warnings
from typing import TYPE_CHECKING, Any, Literal, Optional, Union
import torch
from lightning.fabric.utilities.imports import _TORCHMETRICS_GREATER_EQUAL_1_0_0
from lightning.fabric.utilities.types import _PATH
if TYPE_CHECKING:
from lightning.fabric.fabric import Fabric
cla... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/utilities/optimizer.py | src/lightning/fabric/utilities/optimizer.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/utilities/imports.py | src/lightning/fabric/utilities/imports.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/utilities/exceptions.py | src/lightning/fabric/utilities/exceptions.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/utilities/logger.py | src/lightning/fabric/utilities/logger.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/utilities/seed.py | src/lightning/fabric/utilities/seed.py | import logging
import os
import random
from random import getstate as python_get_rng_state
from random import setstate as python_set_rng_state
from typing import Any, Optional
import torch
from lightning.fabric.utilities.imports import _NUMPY_AVAILABLE
from lightning.fabric.utilities.rank_zero import _get_rank, rank_... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/utilities/apply_func.py | src/lightning/fabric/utilities/apply_func.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/utilities/distributed.py | src/lightning/fabric/utilities/distributed.py | import atexit
import contextlib
import logging
import os
import signal
import time
from collections.abc import Iterable, Iterator, Sized
from contextlib import nullcontext
from datetime import timedelta
from pathlib import Path
from typing import TYPE_CHECKING, Any, Optional, Union
import torch
import torch.nn.functio... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/utilities/__init__.py | src/lightning/fabric/utilities/__init__.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/utilities/types.py | src/lightning/fabric/utilities/types.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/utilities/device_parser.py | src/lightning/fabric/utilities/device_parser.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/utilities/rank_zero.py | src/lightning/fabric/utilities/rank_zero.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/utilities/throughput.py | src/lightning/fabric/utilities/throughput.py | # Copyright The Lightning AI 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 wri... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Lightning-AI/pytorch-lightning | https://github.com/Lightning-AI/pytorch-lightning/blob/027455bcd9433f201b1136f68d54b1a07588abe3/src/lightning/fabric/utilities/consolidate_checkpoint.py | src/lightning/fabric/utilities/consolidate_checkpoint.py | import logging
import sys
from argparse import ArgumentParser, Namespace
from pathlib import Path
import torch
from lightning.fabric.utilities.imports import _TORCH_GREATER_EQUAL_2_3
from lightning.fabric.utilities.load import _METADATA_FILENAME, _load_distributed_checkpoint
_log = logging.getLogger(__name__)
def ... | python | Apache-2.0 | 027455bcd9433f201b1136f68d54b1a07588abe3 | 2026-01-04T14:43:23.878860Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.