repo_full_name
stringlengths
6
93
repo_url
stringlengths
25
112
repo_api_url
stringclasses
28 values
owner
stringclasses
28 values
repo_name
stringclasses
28 values
description
stringclasses
28 values
stars
int64
617
98.8k
forks
int64
31
355
watchers
int64
990
999
license
stringclasses
2 values
default_branch
stringclasses
2 values
repo_created_at
timestamp[s]date
2012-07-24 23:12:50
2025-06-16 08:07:28
repo_updated_at
timestamp[s]date
2026-02-23 15:23:15
2026-05-03 18:52:12
repo_topics
listlengths
0
13
repo_languages
unknown
is_fork
bool
1 class
open_issues
int64
3
104
file_path
stringlengths
3
208
file_name
stringclasses
509 values
file_extension
stringclasses
1 value
file_size_bytes
int64
101
84k
file_url
stringclasses
627 values
file_raw_url
stringclasses
627 values
file_sha
stringclasses
624 values
language
stringclasses
8 values
parsed_at
stringdate
2026-05-04 01:12:36
2026-05-04 19:41:55
text
stringlengths
100
102k
graphql-python/graphene
https://github.com/graphql-python/graphene
null
null
null
null
8,241
null
null
mit
null
null
null
null
null
null
null
examples/starwars_relay/schema.py
null
null
null
null
null
null
Python
2026-05-04T02:12:31.801958
import graphene from graphene import relay from .data import create_ship, get_empire, get_faction, get_rebels, get_ship class Ship(graphene.ObjectType): """A ship in the Star Wars saga""" class Meta: interfaces = (relay.Node,) name = graphene.String(description="The name of the ship.") @cl...
graphql-python/graphene
https://github.com/graphql-python/graphene
null
null
null
null
8,241
null
null
mit
null
null
null
null
null
null
null
examples/starwars_relay/tests/test_mutation.py
null
null
null
null
null
null
Python
2026-05-04T02:12:31.803217
from graphene.test import Client from ..data import setup from ..schema import schema setup() client = Client(schema) def test_mutations(): result = client.execute(""" mutation MyMutation { introduceShip(input:{clientMutationId:"abc", shipName: "Peter", factionId: "1"}) { ship { ...
graphql-python/graphene
https://github.com/graphql-python/graphene
null
null
null
null
8,241
null
null
mit
null
null
null
null
null
null
null
graphene/__init__.py
null
null
null
null
null
null
Python
2026-05-04T02:12:31.803959
from .pyutils.version import get_version from .relay import ( BaseGlobalIDType, ClientIDMutation, Connection, ConnectionField, DefaultGlobalIDType, GlobalID, Node, PageInfo, SimpleGlobalIDType, UUIDGlobalIDType, is_node, ) from .types import ( ID, UUID, Argument, ...
graphql-python/graphene
https://github.com/graphql-python/graphene
null
null
null
null
8,241
null
null
mit
null
null
null
null
null
null
null
graphene/relay/id_type.py
null
null
null
null
null
null
Python
2026-05-04T02:12:32.613513
from graphql_relay import from_global_id, to_global_id from ..types import ID, UUID from ..types.base import BaseType from typing import Type class BaseGlobalIDType: """ Base class that define the required attributes/method for a type. """ graphene_type: Type[BaseType] = ID @classmethod de...
graphql-python/graphene
https://github.com/graphql-python/graphene
null
null
null
null
8,241
null
null
mit
null
null
null
null
null
null
null
graphene/pyutils/version.py
null
null
null
null
null
null
Python
2026-05-04T02:12:32.616492
import datetime import os import subprocess def get_version(version=None): "Returns a PEP 440-compliant version number from VERSION." version = get_complete_version(version) # Now build the two parts of the version number: # main = X.Y[.Z] # sub = .devN - for pre-alpha releases # | {a|b|r...
graphql-python/graphene
https://github.com/graphql-python/graphene
null
null
null
null
8,241
null
null
mit
null
null
null
null
null
null
null
graphene/relay/mutation.py
null
null
null
null
null
null
Python
2026-05-04T02:12:32.618207
import re from ..types import Field, InputObjectType, String from ..types.mutation import Mutation from ..utils.thenables import maybe_thenable class ClientIDMutation(Mutation): class Meta: abstract = True @classmethod def __init_subclass_with_meta__( cls, output=None, input_fields=None,...
graphql-python/graphene
https://github.com/graphql-python/graphene
null
null
null
null
8,241
null
null
mit
null
null
null
null
null
null
null
graphene/relay/tests/test_connection_async.py
null
null
null
null
null
null
Python
2026-05-04T02:12:32.620287
from pytest import mark from graphql_relay.utils import base64 from graphene.types import ObjectType, Schema, String from graphene.relay.connection import Connection, ConnectionField, PageInfo from graphene.relay.node import Node letter_chars = ["A", "B", "C", "D", "E"] class Letter(ObjectType): class Meta: ...
graphql-python/graphene
https://github.com/graphql-python/graphene
null
null
null
null
8,241
null
null
mit
null
null
null
null
null
null
null
graphene/relay/tests/test_connection.py
null
null
null
null
null
null
Python
2026-05-04T02:12:32.621513
import re from pytest import raises from ...types import Argument, Field, Int, List, NonNull, ObjectType, Schema, String from ..connection import ( Connection, ConnectionField, PageInfo, ConnectionOptions, get_edge_class, ) from ..node import Node class MyObject(ObjectType): class Meta: ...
graphql-python/graphene
https://github.com/graphql-python/graphene
null
null
null
null
8,241
null
null
mit
null
null
null
null
null
null
null
graphene/relay/__init__.py
null
null
null
null
null
null
Python
2026-05-04T02:12:32.622683
from .node import Node, is_node, GlobalID from .mutation import ClientIDMutation from .connection import Connection, ConnectionField, PageInfo from .id_type import ( BaseGlobalIDType, DefaultGlobalIDType, SimpleGlobalIDType, UUIDGlobalIDType, ) __all__ = [ "BaseGlobalIDType", "ClientIDMutation"...
graphql-python/graphene
https://github.com/graphql-python/graphene
null
null
null
null
8,241
null
null
mit
null
null
null
null
null
null
null
graphene/relay/node.py
null
null
null
null
null
null
Python
2026-05-04T02:12:32.623845
from functools import partial from inspect import isclass from ..types import Field, Interface, ObjectType from ..types.interface import InterfaceOptions from ..types.utils import get_type from .id_type import BaseGlobalIDType, DefaultGlobalIDType def is_node(objecttype): """ Check if the given objecttype ha...
graphql-python/graphene
https://github.com/graphql-python/graphene
null
null
null
null
8,241
null
null
mit
null
null
null
null
null
null
null
graphene/relay/connection.py
null
null
null
null
null
null
Python
2026-05-04T02:12:32.625055
import re from collections.abc import Iterable from functools import partial from typing import Type from graphql_relay import connection_from_array from ..types import Boolean, Enum, Int, Interface, List, NonNull, Scalar, String, Union from ..types.field import Field from ..types.objecttype import ObjectType, Object...
graphql-python/graphene
https://github.com/graphql-python/graphene
null
null
null
null
8,241
null
null
mit
null
null
null
null
null
null
null
graphene/relay/tests/test_connection_query.py
null
null
null
null
null
null
Python
2026-05-04T02:12:32.658316
from pytest import mark from graphql_relay.utils import base64 from ...types import ObjectType, Schema, String from ..connection import Connection, ConnectionField, PageInfo from ..node import Node letter_chars = ["A", "B", "C", "D", "E"] class Letter(ObjectType): class Meta: interfaces = (Node,) ...
graphql-python/graphene
https://github.com/graphql-python/graphene
null
null
null
null
8,241
null
null
mit
null
null
null
null
null
null
null
graphene/relay/tests/test_node_custom.py
null
null
null
null
null
null
Python
2026-05-04T02:12:33.452192
from textwrap import dedent from graphql import graphql_sync from ...types import Interface, ObjectType, Schema from ...types.scalars import Int, String from ..node import Node class CustomNode(Node): class Meta: name = "Node" @staticmethod def to_global_id(type_, id): return id @s...
graphql-python/graphene
https://github.com/graphql-python/graphene
null
null
null
null
8,241
null
null
mit
null
null
null
null
null
null
null
graphene/relay/tests/test_custom_global_id.py
null
null
null
null
null
null
Python
2026-05-04T02:12:33.453259
import re from uuid import uuid4 from graphql import graphql_sync from ..id_type import BaseGlobalIDType, SimpleGlobalIDType, UUIDGlobalIDType from ..node import Node from ...types import Int, ObjectType, Schema, String class TestUUIDGlobalID: def setup_method(self): self.user_list = [ {"id"...
graphql-python/graphene
https://github.com/graphql-python/graphene
null
null
null
null
8,241
null
null
mit
null
null
null
null
null
null
null
graphene/tests/issues/test_1293.py
null
null
null
null
null
null
Python
2026-05-04T02:12:33.596865
# https://github.com/graphql-python/graphene/issues/1293 from datetime import datetime, timezone import graphene from graphql.utilities import print_schema class Filters(graphene.InputObjectType): datetime_after = graphene.DateTime( required=False, default_value=datetime.fromtimestamp(1434549820...
graphql-python/graphene
https://github.com/graphql-python/graphene
null
null
null
null
8,241
null
null
mit
null
null
null
null
null
null
null
graphene/relay/tests/test_mutation_async.py
null
null
null
null
null
null
Python
2026-05-04T02:12:33.606784
from pytest import mark from graphene.types import ID, Field, ObjectType, Schema from graphene.types.scalars import String from graphene.relay.mutation import ClientIDMutation from graphene.test import Client class SharedFields(object): shared = String() class MyNode(ObjectType): # class Meta: # in...
graphql-python/graphene
https://github.com/graphql-python/graphene
null
null
null
null
8,241
null
null
mit
null
null
null
null
null
null
null
graphene/relay/tests/test_global_id.py
null
null
null
null
null
null
Python
2026-05-04T02:12:33.616356
from graphql_relay import to_global_id from ...types import ID, NonNull, ObjectType, String from ...types.definitions import GrapheneObjectType from ..node import GlobalID, Node class CustomNode(Node): class Meta: name = "Node" class User(ObjectType): class Meta: interfaces = [CustomNode] ...
graphql-python/graphene
https://github.com/graphql-python/graphene
null
null
null
null
8,241
null
null
mit
null
null
null
null
null
null
null
graphene/relay/tests/test_node.py
null
null
null
null
null
null
Python
2026-05-04T02:12:33.622362
import re from textwrap import dedent from graphql_relay import to_global_id from ...types import ObjectType, Schema, String from ..node import Node, is_node class SharedNodeFields: shared = String() something_else = String() def resolve_something_else(*_): return "----" class MyNode(ObjectTy...
graphql-python/graphene
https://github.com/graphql-python/graphene
null
null
null
null
8,241
null
null
mit
null
null
null
null
null
null
null
graphene/relay/tests/test_mutation.py
null
null
null
null
null
null
Python
2026-05-04T02:12:33.623285
from pytest import mark, raises from ...types import ( ID, Argument, Field, InputField, InputObjectType, NonNull, ObjectType, Schema, ) from ...types.scalars import String from ..mutation import ClientIDMutation class SharedFields: shared = String() class MyNode(ObjectType): ...
graphql-python/graphene
https://github.com/graphql-python/graphene
null
null
null
null
8,241
null
null
mit
null
null
null
null
null
null
null
graphene/test/__init__.py
null
null
null
null
null
null
Python
2026-05-04T02:12:33.694686
from graphql.error import GraphQLError from graphene.types.schema import Schema def default_format_error(error): if isinstance(error, GraphQLError): return error.formatted return {"message": str(error)} def format_execution_result(execution_result, format_error): if execution_result: re...
graphql-python/graphene
https://github.com/graphql-python/graphene
null
null
null
null
8,241
null
null
mit
null
null
null
null
null
null
null
graphene/tests/issues/test_1394.py
null
null
null
null
null
null
Python
2026-05-04T02:12:34.297020
from ...types import ObjectType, Schema, String, NonNull class Query(ObjectType): hello = String(input=NonNull(String)) def resolve_hello(self, info, input): if input == "nothing": return None return f"Hello {input}!" schema = Schema(query=Query) def test_required_input_provid...
graphql-python/graphene
https://github.com/graphql-python/graphene
null
null
null
null
8,241
null
null
mit
null
null
null
null
null
null
null
graphene/tests/issues/test_1419.py
null
null
null
null
null
null
Python
2026-05-04T02:12:34.307256
import pytest from ...types.base64 import Base64 from ...types.datetime import Date, DateTime from ...types.decimal import Decimal from ...types.generic import GenericScalar from ...types.json import JSONString from ...types.objecttype import ObjectType from ...types.scalars import ID, BigInt, Boolean, Float, Int, Str...
graphql-python/graphene
https://github.com/graphql-python/graphene
null
null
null
null
8,241
null
null
mit
null
null
null
null
null
null
null
graphene/tests/issues/test_313.py
null
null
null
null
null
null
Python
2026-05-04T02:12:34.479615
# https://github.com/graphql-python/graphene/issues/313 import graphene class Query(graphene.ObjectType): rand = graphene.String() class Success(graphene.ObjectType): yeah = graphene.String() class Error(graphene.ObjectType): message = graphene.String() class CreatePostResult(graphene.Union): c...
graphql-python/graphene
https://github.com/graphql-python/graphene
null
null
null
null
8,241
null
null
mit
null
null
null
null
null
null
null
graphene/tests/issues/test_356.py
null
null
null
null
null
null
Python
2026-05-04T02:12:34.480134
# https://github.com/graphql-python/graphene/issues/356 from pytest import raises import graphene from graphene import relay class SomeTypeOne(graphene.ObjectType): pass class SomeTypeTwo(graphene.ObjectType): pass class MyUnion(graphene.Union): class Meta: types = (SomeTypeOne, SomeTypeTwo)...
graphql-python/graphene
https://github.com/graphql-python/graphene
null
null
null
null
8,241
null
null
mit
null
null
null
null
null
null
null
graphene/tests/issues/test_425.py
null
null
null
null
null
null
Python
2026-05-04T02:12:34.483775
# https://github.com/graphql-python/graphene/issues/425 # Adapted for Graphene 2.0 from graphene.types.enum import Enum, EnumOptions from graphene.types.inputobjecttype import InputObjectType from graphene.types.objecttype import ObjectType, ObjectTypeOptions # ObjectType class SpecialOptions(ObjectTypeOptions): ...
graphql-python/graphene
https://github.com/graphql-python/graphene
null
null
null
null
8,241
null
null
mit
null
null
null
null
null
null
null
graphene/tests/issues/test_720.py
null
null
null
null
null
null
Python
2026-05-04T02:12:34.484417
# https://github.com/graphql-python/graphene/issues/720 # InputObjectTypes overwrite the "fields" attribute of the provided # _meta object, so even if dynamic fields are provided with a standard # InputObjectTypeOptions, they are ignored. import graphene class MyInputClass(graphene.InputObjectType): @classmethod...
graphql-python/graphene
https://github.com/graphql-python/graphene
null
null
null
null
8,241
null
null
mit
null
null
null
null
null
null
null
graphene/tests/issues/test_490.py
null
null
null
null
null
null
Python
2026-05-04T02:12:34.491674
# https://github.com/graphql-python/graphene/issues/313 import graphene class Query(graphene.ObjectType): some_field = graphene.String(from_=graphene.String(name="from")) def resolve_some_field(self, info, from_=None): return from_ def test_issue(): query_string = """ query myQuery { ...
graphql-python/graphene
https://github.com/graphql-python/graphene
null
null
null
null
8,241
null
null
mit
null
null
null
null
null
null
null
graphene/tests/issues/test_956.py
null
null
null
null
null
null
Python
2026-05-04T02:12:34.492158
import graphene def test_issue(): options = {"description": "This my enum", "deprecation_reason": "For the funs"} new_enum = graphene.Enum("MyEnum", [("some", "data")], **options) assert new_enum._meta.description == options["description"] assert new_enum._meta.deprecation_reason == options["deprecati...
graphql-python/graphene
https://github.com/graphql-python/graphene
null
null
null
null
8,241
null
null
mit
null
null
null
null
null
null
null
graphene/tests/issues/test_881.py
null
null
null
null
null
null
Python
2026-05-04T02:12:34.492609
import pickle from ...types.enum import Enum class PickleEnum(Enum): # is defined outside of test because pickle unable to dump class inside ot pytest function A = "a" B = 1 def test_enums_pickling(): a = PickleEnum.A pickled = pickle.dumps(a) restored = pickle.loads(pickled) assert typ...
graphql-python/graphene
https://github.com/graphql-python/graphene
null
null
null
null
8,241
null
null
mit
null
null
null
null
null
null
null
graphene/types/__init__.py
null
null
null
null
null
null
Python
2026-05-04T02:12:34.679462
from graphql import GraphQLResolveInfo as ResolveInfo from .argument import Argument from .base64 import Base64 from .context import Context from .datetime import Date, DateTime, Time from .decimal import Decimal from .dynamic import Dynamic from .enum import Enum from .field import Field from .inputfield import Input...
vietnh1009/ASCII-generator
https://github.com/vietnh1009/ASCII-generator
null
null
null
null
8,239
null
null
mit
null
null
null
null
null
null
null
utils.py
null
null
null
null
null
null
Python
2026-05-04T02:12:36.972904
import numpy as np from PIL import Image, ImageFont, ImageDraw, ImageOps def sort_chars(char_list, font, language): if language == "chinese": char_width, char_height = font.getsize("制") elif language == "korean": char_width, char_height = font.getsize("ㅊ") elif language == "japanese": ...
vietnh1009/ASCII-generator
https://github.com/vietnh1009/ASCII-generator
null
null
null
null
8,239
null
null
mit
null
null
null
null
null
null
null
video2video.py
null
null
null
null
null
null
Python
2026-05-04T02:12:36.982496
""" @author: Viet Nguyen <nhviet1009@gmail.com> """ import argparse import cv2 import numpy as np from PIL import Image, ImageFont, ImageDraw, ImageOps def get_args(): parser = argparse.ArgumentParser("Image to ASCII") parser.add_argument("--input", type=str, default="data/input.mp4", help="Path to input vid...
vietnh1009/ASCII-generator
https://github.com/vietnh1009/ASCII-generator
null
null
null
null
8,239
null
null
mit
null
null
null
null
null
null
null
img2txt.py
null
null
null
null
null
null
Python
2026-05-04T02:12:37.012606
""" @author: Viet Nguyen <nhviet1009@gmail.com> """ import argparse import cv2 import numpy as np def get_args(): parser = argparse.ArgumentParser("Image to ASCII") parser.add_argument("--input", type=str, default="data/input.jpg", help="Path to input image") parser.add_argument("--output", type=str, def...
vietnh1009/ASCII-generator
https://github.com/vietnh1009/ASCII-generator
null
null
null
null
8,239
null
null
mit
null
null
null
null
null
null
null
img2img.py
null
null
null
null
null
null
Python
2026-05-04T02:12:37.013128
""" @author: Viet Nguyen <nhviet1009@gmail.com> """ import argparse import cv2 import numpy as np from PIL import Image, ImageDraw, ImageOps from utils import get_data def get_args(): parser = argparse.ArgumentParser("Image to ASCII") parser.add_argument("--input", type=str, default="data/input.jpg", help="Pa...
vietnh1009/ASCII-generator
https://github.com/vietnh1009/ASCII-generator
null
null
null
null
8,239
null
null
mit
null
null
null
null
null
null
null
img2img_color.py
null
null
null
null
null
null
Python
2026-05-04T02:12:37.057265
""" @author: Viet Nguyen <nhviet1009@gmail.com> """ import argparse import cv2 import numpy as np from PIL import Image, ImageDraw, ImageOps from utils import get_data def get_args(): parser = argparse.ArgumentParser("Image to ASCII") parser.add_argument("--input", type=str, default="data/input.jpg", help="P...
vietnh1009/ASCII-generator
https://github.com/vietnh1009/ASCII-generator
null
null
null
null
8,239
null
null
mit
null
null
null
null
null
null
null
video2video_color.py
null
null
null
null
null
null
Python
2026-05-04T02:12:37.057958
""" @author: Viet Nguyen <nhviet1009@gmail.com> """ import argparse import cv2 import numpy as np from PIL import Image, ImageFont, ImageDraw, ImageOps def get_args(): parser = argparse.ArgumentParser("Image to ASCII") parser.add_argument("--input", type=str, default="data/input.mp4", help="Path to input vid...
vietnh1009/ASCII-generator
https://github.com/vietnh1009/ASCII-generator
null
null
null
null
8,239
null
null
mit
null
null
null
null
null
null
null
alphabets.py
null
null
null
null
null
null
Python
2026-05-04T02:12:37.204232
GENERAL = { "simple": "@%#*+=-:. ", "complex": "$@B%8&WM#*oahkbdpqwmZO0QLCJUYXzcvunxrjft/\|()1{}[]?-_+~<>i!lI;:,\"^`'. " } # Full list could be found here https://github.com/tsroten/zhon/tree/develop/zhon/cedict CHINESE = { "standard": "龘䶑瀰幗獼鑭躙䵹觿䲔釅欄鐮䥯鶒獭鰽襽螻鰱蹦屭繩圇婹歜剛屧磕媿慪像僭堳噞呱棒偁呣塙唑浠唼刻凌咄亟拮俗参坒估这聿布允仫忖玗甴木亪女去凸五圹亐囗弌九...
utkuozbulak/pytorch-cnn-visualizations
https://github.com/utkuozbulak/pytorch-cnn-visualizations
null
null
null
null
8,208
null
null
mit
null
null
null
null
null
null
null
src/guided_gradcam.py
null
null
null
null
null
null
Python
2026-05-04T02:12:39.678790
""" Created on Thu Oct 23 11:27:15 2017 @author: Utku Ozbulak - github.com/utkuozbulak """ import numpy as np from misc_functions import (get_example_params, convert_to_grayscale, save_gradient_images) from gradcam import GradCam from guided_backprop import Guid...
utkuozbulak/pytorch-cnn-visualizations
https://github.com/utkuozbulak/pytorch-cnn-visualizations
null
null
null
null
8,208
null
null
mit
null
null
null
null
null
null
null
src/LRP.py
null
null
null
null
null
null
Python
2026-05-04T02:12:39.679530
# -*- coding: utf-8 -*- """ Created on Mon Mar 14 13:32:09 2022 @author: ut """ import copy import numpy as np from PIL import Image import torch import torch.nn as nn from misc_functions import apply_heatmap, get_example_params class LRP(): """ Layer-wise relevance propagation with gamma+epsilon rule ...
utkuozbulak/pytorch-cnn-visualizations
https://github.com/utkuozbulak/pytorch-cnn-visualizations
null
null
null
null
8,208
null
null
mit
null
null
null
null
null
null
null
src/cnn_layer_visualization.py
null
null
null
null
null
null
Python
2026-05-04T02:12:39.682057
""" Created on Sat Nov 18 23:12:08 2017 @author: Utku Ozbulak - github.com/utkuozbulak """ import os import numpy as np import torch from torch.optim import Adam from torchvision import models from misc_functions import preprocess_image, recreate_image, save_image class CNNLayerVisualization(): """ Pro...
utkuozbulak/pytorch-cnn-visualizations
https://github.com/utkuozbulak/pytorch-cnn-visualizations
null
null
null
null
8,208
null
null
mit
null
null
null
null
null
null
null
src/grad_times_image.py
null
null
null
null
null
null
Python
2026-05-04T02:12:39.690549
""" Created on Wed Jun 19 17:12:04 2019 @author: Utku Ozbulak - github.com/utkuozbulak """ from misc_functions import (get_example_params, convert_to_grayscale, save_gradient_images) from vanilla_backprop import VanillaBackprop # from guided_backprop import Guide...
utkuozbulak/pytorch-cnn-visualizations
https://github.com/utkuozbulak/pytorch-cnn-visualizations
null
null
null
null
8,208
null
null
mit
null
null
null
null
null
null
null
src/guided_backprop.py
null
null
null
null
null
null
Python
2026-05-04T02:12:39.691074
""" Created on Thu Oct 26 11:23:47 2017 @author: Utku Ozbulak - github.com/utkuozbulak """ import torch from torch.nn import ReLU from misc_functions import (get_example_params, convert_to_grayscale, save_gradient_images, get_positive...
utkuozbulak/pytorch-cnn-visualizations
https://github.com/utkuozbulak/pytorch-cnn-visualizations
null
null
null
null
8,208
null
null
mit
null
null
null
null
null
null
null
src/gradcam.py
null
null
null
null
null
null
Python
2026-05-04T02:12:39.693359
""" Created on Thu Oct 26 11:06:51 2017 @author: Utku Ozbulak - github.com/utkuozbulak """ from PIL import Image import numpy as np import torch from misc_functions import get_example_params, save_class_activation_images class CamExtractor(): """ Extracts cam features from the model """ def __in...
utkuozbulak/pytorch-cnn-visualizations
https://github.com/utkuozbulak/pytorch-cnn-visualizations
null
null
null
null
8,208
null
null
mit
null
null
null
null
null
null
null
src/integrated_gradients.py
null
null
null
null
null
null
Python
2026-05-04T02:12:39.700375
""" Created on Wed Jun 19 17:06:48 2019 @author: Utku Ozbulak - github.com/utkuozbulak """ import torch import numpy as np from misc_functions import get_example_params, convert_to_grayscale, save_gradient_images class IntegratedGradients(): """ Produces gradients generated with integrated gradients fro...
utkuozbulak/pytorch-cnn-visualizations
https://github.com/utkuozbulak/pytorch-cnn-visualizations
null
null
null
null
8,208
null
null
mit
null
null
null
null
null
null
null
src/deep_dream.py
null
null
null
null
null
null
Python
2026-05-04T02:12:39.700940
""" Created on Mon Nov 21 21:57:29 2017 @author: Utku Ozbulak - github.com/utkuozbulak """ import os from PIL import Image import torch from torch.optim import SGD from torchvision import models from misc_functions import preprocess_image, recreate_image, save_image class DeepDream(): """ Produces an i...
utkuozbulak/pytorch-cnn-visualizations
https://github.com/utkuozbulak/pytorch-cnn-visualizations
null
null
null
null
8,208
null
null
mit
null
null
null
null
null
null
null
src/generate_class_specific_samples.py
null
null
null
null
null
null
Python
2026-05-04T02:12:39.715235
""" Created on Thu Oct 26 14:19:44 2017 @author: Utku Ozbulak - github.com/utkuozbulak """ import os import numpy as np import torch from torch.optim import SGD from torchvision import models from misc_functions import preprocess_image, recreate_image, save_image class ClassSpecificImageGeneration(): """ ...
utkuozbulak/pytorch-cnn-visualizations
https://github.com/utkuozbulak/pytorch-cnn-visualizations
null
null
null
null
8,208
null
null
mit
null
null
null
null
null
null
null
src/generate_regularized_class_specific_samples.py
null
null
null
null
null
null
Python
2026-05-04T02:12:39.715683
""" Created on Tues Mar 10 08:13:15 2020 @author: Alex Stoken - https://github.com/alexstoken Last tested with torchvision 0.5.0 with image and model on cpu """ import os import numpy as np from PIL import Image, ImageFilter import torch from torch.optim import SGD from torch.autograd import Variable from torchvision...
utkuozbulak/pytorch-cnn-visualizations
https://github.com/utkuozbulak/pytorch-cnn-visualizations
null
null
null
null
8,208
null
null
mit
null
null
null
null
null
null
null
src/smooth_grad.py
null
null
null
null
null
null
Python
2026-05-04T02:12:40.267866
""" Created on Wed Mar 28 10:12:13 2018 @author: Utku Ozbulak - github.com/utkuozbulak """ import numpy as np from torch.autograd import Variable import torch from misc_functions import (get_example_params, convert_to_grayscale, save_gradient_images) from vanil...
utkuozbulak/pytorch-cnn-visualizations
https://github.com/utkuozbulak/pytorch-cnn-visualizations
null
null
null
null
8,208
null
null
mit
null
null
null
null
null
null
null
src/layercam.py
null
null
null
null
null
null
Python
2026-05-04T02:12:40.291199
""" Created on Mon Jul 5 12:39:11 2021 @author: Peng-Tao Jiang - github.com/PengtaoJiang """ from PIL import Image import numpy as np import torch from misc_functions import get_example_params, save_class_activation_images class CamExtractor(): """ Extracts cam features from the model """ def __...
utkuozbulak/pytorch-cnn-visualizations
https://github.com/utkuozbulak/pytorch-cnn-visualizations
null
null
null
null
8,208
null
null
mit
null
null
null
null
null
null
null
src/inverted_representation.py
null
null
null
null
null
null
Python
2026-05-04T02:12:40.310019
""" Created on Wed Jan 17 08:05:11 2018 @author: Utku Ozbulak - github.com/utkuozbulak """ import torch from torch.autograd import Variable from torch.optim import SGD import os from misc_functions import get_example_params, recreate_image, save_image class InvertedRepresentation(): def __init__(self, model): ...
utkuozbulak/pytorch-cnn-visualizations
https://github.com/utkuozbulak/pytorch-cnn-visualizations
null
null
null
null
8,208
null
null
mit
null
null
null
null
null
null
null
src/misc_functions.py
null
null
null
null
null
null
Python
2026-05-04T02:12:40.330046
""" Created on Thu Oct 21 11:09:09 2017 @author: Utku Ozbulak - github.com/utkuozbulak """ import os import copy import numpy as np from PIL import Image import matplotlib.cm as mpl_color_map from matplotlib.colors import ListedColormap from matplotlib import pyplot as plt import torch from torch.autograd import Vari...
utkuozbulak/pytorch-cnn-visualizations
https://github.com/utkuozbulak/pytorch-cnn-visualizations
null
null
null
null
8,208
null
null
mit
null
null
null
null
null
null
null
src/layer_activation_with_guided_backprop.py
null
null
null
null
null
null
Python
2026-05-04T02:12:40.330588
""" Created on Thu Oct 26 11:23:47 2017 @author: Utku Ozbulak - github.com/utkuozbulak """ import torch from torch.nn import ReLU from misc_functions import (get_example_params, convert_to_grayscale, save_gradient_images, get_positive...
utkuozbulak/pytorch-cnn-visualizations
https://github.com/utkuozbulak/pytorch-cnn-visualizations
null
null
null
null
8,208
null
null
mit
null
null
null
null
null
null
null
src/vanilla_backprop.py
null
null
null
null
null
null
Python
2026-05-04T02:12:40.342646
""" Created on Thu Oct 26 11:19:58 2017 @author: Utku Ozbulak - github.com/utkuozbulak """ import torch from misc_functions import get_example_params, convert_to_grayscale, save_gradient_images class VanillaBackprop(): """ Produces gradients generated with vanilla back propagation from the image """...
utkuozbulak/pytorch-cnn-visualizations
https://github.com/utkuozbulak/pytorch-cnn-visualizations
null
null
null
null
8,208
null
null
mit
null
null
null
null
null
null
null
src/scorecam.py
null
null
null
null
null
null
Python
2026-05-04T02:12:40.343371
""" Created on Wed Apr 29 16:11:20 2020 @author: Haofan Wang - github.com/haofanwang """ from PIL import Image import numpy as np import torch import torch.nn.functional as F from misc_functions import get_example_params, save_class_activation_images class CamExtractor(): """ Extracts cam features from ...
litestar-org/litestar
https://github.com/litestar-org/litestar
null
null
null
null
8,195
null
null
mit
null
null
null
null
null
null
null
.github/workflows/notify_released_issues/get_closed_issues.py
null
null
null
null
null
null
Python
2026-05-04T02:12:42.945973
from __future__ import annotations import itertools import json import pathlib import re import sys __all__ = ( "find_resolved_issues", "main", ) def find_resolved_issues(source: str, tag: str) -> list[str]: version = tag.split("v", maxsplit=1)[-1] changelog_line = f".. changelog:: {version}" st...
litestar-org/litestar
https://github.com/litestar-org/litestar
null
null
null
null
8,195
null
null
mit
null
null
null
null
null
null
null
docs/conf.py
null
null
null
null
null
null
Python
2026-05-04T02:12:42.947147
from __future__ import annotations import importlib.metadata import os import re import warnings from datetime import datetime from functools import partial from typing import Any from sphinx.addnodes import document from sphinx.application import Sphinx from sqlalchemy.exc import SAWarning warnings.filterwarnings("...
litestar-org/litestar
https://github.com/litestar-org/litestar
null
null
null
null
8,195
null
null
mit
null
null
null
null
null
null
null
docs/examples/application_hooks/before_send_hook.py
null
null
null
null
null
null
Python
2026-05-04T02:12:42.958813
from __future__ import annotations from typing import TYPE_CHECKING from litestar import Litestar, get from litestar.datastructures import MutableScopeHeaders if TYPE_CHECKING: from litestar.types import Message, Scope @get("/test", sync_to_thread=False) def handler() -> dict[str, str]: """Example Handler ...
litestar-org/litestar
https://github.com/litestar-org/litestar
null
null
null
null
8,195
null
null
mit
null
null
null
null
null
null
null
docs/examples/application_hooks/after_exception_hook.py
null
null
null
null
null
null
Python
2026-05-04T02:12:42.959601
import logging from typing import TYPE_CHECKING from litestar import Litestar, get from litestar.exceptions import HTTPException from litestar.status_codes import HTTP_400_BAD_REQUEST logger = logging.getLogger() if TYPE_CHECKING: from litestar.types import Scope @get("/some-path", sync_to_thread=False) def my...
litestar-org/litestar
https://github.com/litestar-org/litestar
null
null
null
null
8,195
null
null
mit
null
null
null
null
null
null
null
docs/examples/application_hooks/on_app_init.py
null
null
null
null
null
null
Python
2026-05-04T02:12:42.961990
from typing import TYPE_CHECKING from litestar import Litestar if TYPE_CHECKING: from litestar.config.app import AppConfig async def close_db_connection() -> None: """Closes the database connection on application shutdown.""" def receive_app_config(app_config: "AppConfig") -> "AppConfig": """Receives ...
litestar-org/litestar
https://github.com/litestar-org/litestar
null
null
null
null
8,195
null
null
mit
null
null
null
null
null
null
null
docs/examples/application_hooks/lifespan_manager.py
null
null
null
null
null
null
Python
2026-05-04T02:12:42.986608
from collections.abc import AsyncGenerator from contextlib import asynccontextmanager from sqlalchemy.ext.asyncio import create_async_engine from litestar import Litestar @asynccontextmanager async def db_connection(app: Litestar) -> AsyncGenerator[None, None]: engine = getattr(app.state, "engine", None) if...
litestar-org/litestar
https://github.com/litestar-org/litestar
null
null
null
null
8,195
null
null
mit
null
null
null
null
null
null
null
docs/examples/application_state/passing_initial_state.py
null
null
null
null
null
null
Python
2026-05-04T02:12:43.015333
from typing import Any from litestar import Litestar, get from litestar.datastructures import State @get("/", sync_to_thread=False) def handler(state: State) -> dict[str, Any]: return state.dict() app = Litestar(route_handlers=[handler], state=State({"count": 100}))
litestar-org/litestar
https://github.com/litestar-org/litestar
null
null
null
null
8,195
null
null
mit
null
null
null
null
null
null
null
docs/examples/application_state/using_custom_state.py
null
null
null
null
null
null
Python
2026-05-04T02:12:43.614391
from typing import Any from litestar import Litestar, get from litestar.datastructures import State class MyState(State): count: int = 0 def increment(self) -> None: self.count += 1 @get("/", sync_to_thread=False) def handler(state: MyState) -> dict[str, Any]: state.increment() return stat...
litestar-org/litestar
https://github.com/litestar-org/litestar
null
null
null
null
8,195
null
null
mit
null
null
null
null
null
null
null
docs/examples/application_state/using_application_state.py
null
null
null
null
null
null
Python
2026-05-04T02:12:43.615072
import logging from typing import TYPE_CHECKING, Any from litestar import Litestar, Request, get from litestar.datastructures import State from litestar.di import Provide if TYPE_CHECKING: from litestar.types import ASGIApp, Receive, Scope, Send logger = logging.getLogger(__name__) def set_state_on_startup(app...
litestar-org/litestar
https://github.com/litestar-org/litestar
null
null
null
null
8,195
null
null
mit
null
null
null
null
null
null
null
docs/examples/application_state/using_immutable_state.py
null
null
null
null
null
null
Python
2026-05-04T02:12:43.616457
from typing import Any from litestar import Litestar, get from litestar.datastructures import ImmutableState @get("/", sync_to_thread=False) def handler(state: ImmutableState) -> dict[str, Any]: setattr(state, "count", 1) # raises AttributeError return state.dict() app = Litestar(route_handlers=[handler])...
litestar-org/litestar
https://github.com/litestar-org/litestar
null
null
null
null
8,195
null
null
mit
null
null
null
null
null
null
null
docs/examples/caching/cache.py
null
null
null
null
null
null
Python
2026-05-04T02:12:43.618245
from litestar import Litestar, get from litestar.config.response_cache import CACHE_FOREVER @get("/cached", cache=True) async def my_cached_handler() -> str: return "cached" @get("/cached-seconds", cache=120) # seconds async def my_cached_handler_seconds() -> str: return "cached for 120 seconds"...
litestar-org/litestar
https://github.com/litestar-org/litestar
null
null
null
null
8,195
null
null
mit
null
null
null
null
null
null
null
docs/examples/caching/cache_response_filter.py
null
null
null
null
null
null
Python
2026-05-04T02:12:43.652266
from litestar import Litestar from litestar.config.response_cache import ResponseCacheConfig from litestar.types import HTTPScope def custom_cache_response_filter(_: HTTPScope, status_code: int) -> bool: # Cache only 2xx responses return 200 <= status_code < 300 response_cache_config = ResponseCacheConfig(c...
litestar-org/litestar
https://github.com/litestar-org/litestar
null
null
null
null
8,195
null
null
mit
null
null
null
null
null
null
null
docs/examples/caching/key_builder_for_route_handler.py
null
null
null
null
null
null
Python
2026-05-04T02:12:43.653674
from litestar import Litestar, Request, get def key_builder(request: Request) -> str: return request.url.path + request.headers.get("my-header", "") @get("/cached-path", cache=True, cache_key_builder=key_builder) async def cached_handler() -> str: return "cached" app = Litestar([cached_handler...
litestar-org/litestar
https://github.com/litestar-org/litestar
null
null
null
null
8,195
null
null
mit
null
null
null
null
null
null
null
docs/examples/caching/key_builder.py
null
null
null
null
null
null
Python
2026-05-04T02:12:43.657126
from litestar import Litestar, Request from litestar.config.response_cache import ResponseCacheConfig def key_builder(request: Request) -> str: return request.url.path + request.headers.get("my-header", "") app = Litestar([], response_cache_config=ResponseCacheConfig(key_builder=key_builder))
litestar-org/litestar
https://github.com/litestar-org/litestar
null
null
null
null
8,195
null
null
mit
null
null
null
null
null
null
null
docs/examples/caching/redis_store.py
null
null
null
null
null
null
Python
2026-05-04T02:12:43.658105
import asyncio from litestar import Litestar, get from litestar.config.response_cache import ResponseCacheConfig from litestar.stores.redis import RedisStore @get(cache=10) async def something() -> str: await asyncio.sleep(1) return "something" redis_store = RedisStore.with_client(url="redis:/...
litestar-org/litestar
https://github.com/litestar-org/litestar
null
null
null
null
8,195
null
null
mit
null
null
null
null
null
null
null
docs/examples/channels/create_route_handlers.py
null
null
null
null
null
null
Python
2026-05-04T02:12:43.659360
from litestar import Litestar from litestar.channels import ChannelsPlugin from litestar.channels.backends.memory import MemoryChannelsBackend channels_plugin = ChannelsPlugin( backend=MemoryChannelsBackend(), channels=["foo", "bar"], create_ws_route_handlers=True, ) app = Litestar(plugins=[channels_plugi...
litestar-org/litestar
https://github.com/litestar-org/litestar
null
null
null
null
8,195
null
null
mit
null
null
null
null
null
null
null
docs/examples/channels/iter_stream.py
null
null
null
null
null
null
Python
2026-05-04T02:12:44.255162
from litestar import Litestar, WebSocket, websocket from litestar.channels import ChannelsPlugin from litestar.channels.backends.memory import MemoryChannelsBackend @websocket("/ws") async def handler(socket: WebSocket, channels: ChannelsPlugin) -> None: await socket.accept() async with channels.start_subscr...
litestar-org/litestar
https://github.com/litestar-org/litestar
null
null
null
null
8,195
null
null
mit
null
null
null
null
null
null
null
docs/examples/channels/create_route_handlers_send_history.py
null
null
null
null
null
null
Python
2026-05-04T02:12:44.298541
from litestar import Litestar from litestar.channels import ChannelsPlugin from litestar.channels.backends.memory import MemoryChannelsBackend channels_plugin = ChannelsPlugin( backend=MemoryChannelsBackend(history=10), # set the amount of messages per channel # to keep in the backend channels=["foo", "ba...
litestar-org/litestar
https://github.com/litestar-org/litestar
null
null
null
null
8,195
null
null
mit
null
null
null
null
null
null
null
docs/examples/channels/put_history.py
null
null
null
null
null
null
Python
2026-05-04T02:12:44.299820
from litestar import Litestar, WebSocket, websocket from litestar.channels import ChannelsPlugin from litestar.channels.backends.memory import MemoryChannelsBackend @websocket("/ws") async def handler(socket: WebSocket, channels: ChannelsPlugin) -> None: await socket.accept() async with channels.start_subscr...
litestar-org/litestar
https://github.com/litestar-org/litestar
null
null
null
null
8,195
null
null
mit
null
null
null
null
null
null
null
docs/examples/channels/run_in_background.py
null
null
null
null
null
null
Python
2026-05-04T02:12:44.301010
from litestar import Litestar, WebSocket, websocket from litestar.channels import ChannelsPlugin from litestar.channels.backends.memory import MemoryChannelsBackend @websocket("/ws") async def handler(socket: WebSocket, channels: ChannelsPlugin) -> None: await socket.accept() async with ( channels.st...
litestar-org/litestar
https://github.com/litestar-org/litestar
null
null
null
null
8,195
null
null
mit
null
null
null
null
null
null
null
docs/examples/data_transfer_objects/factory/dto_data_problem_statement.py
null
null
null
null
null
null
Python
2026-05-04T02:12:44.315449
from __future__ import annotations from dataclasses import dataclass, field from uuid import UUID, uuid4 from litestar import Litestar, post from litestar.dto import DataclassDTO, DTOConfig @dataclass class User: name: str email: str age: int id: UUID = field(default_factory=uuid4) class UserWrite...
litestar-org/litestar
https://github.com/litestar-org/litestar
null
null
null
null
8,195
null
null
mit
null
null
null
null
null
null
null
docs/examples/data_transfer_objects/defining_dtos_on_layers.py
null
null
null
null
null
null
Python
2026-05-04T02:12:44.335504
from __future__ import annotations from dataclasses import dataclass, field from uuid import UUID, uuid4 from litestar import Controller, delete, get, post, put from litestar.app import Litestar from litestar.dto import DataclassDTO from litestar.dto.config import DTOConfig @dataclass class User: name: str ...
litestar-org/litestar
https://github.com/litestar-org/litestar
null
null
null
null
8,195
null
null
mit
null
null
null
null
null
null
null
docs/examples/data_transfer_objects/factory/dto_data_usage.py
null
null
null
null
null
null
Python
2026-05-04T02:12:44.337069
from dataclasses import dataclass from uuid import UUID, uuid4 from litestar import Litestar, post from litestar.dto import DataclassDTO, DTOConfig, DTOData @dataclass class User: name: str email: str age: int id: UUID class UserWriteDTO(DataclassDTO[User]): """Don't allow client to set the id....
litestar-org/litestar
https://github.com/litestar-org/litestar
null
null
null
null
8,195
null
null
mit
null
null
null
null
null
null
null
docs/examples/data_transfer_objects/factory/excluding_fields.py
null
null
null
null
null
null
Python
2026-05-04T02:12:44.857305
from datetime import datetime from typing import Annotated from uuid import UUID from advanced_alchemy.extensions.litestar import SQLAlchemyDTO from sqlalchemy import ForeignKey from sqlalchemy.orm import Mapped, mapped_column, relationship from litestar import Litestar, post from litestar.dto import DTOConfig, dto_f...
litestar-org/litestar
https://github.com/litestar-org/litestar
null
null
null
null
8,195
null
null
mit
null
null
null
null
null
null
null
docs/examples/data_transfer_objects/factory/enveloping_return_data.py
null
null
null
null
null
null
Python
2026-05-04T02:12:44.906675
from dataclasses import dataclass from datetime import datetime from typing import Generic, TypeVar from advanced_alchemy.extensions.litestar import SQLAlchemyDTO from sqlalchemy.orm import Mapped from litestar import Litestar, get from litestar.dto import DTOConfig from .my_lib import Base T = TypeVar("T") @data...
litestar-org/litestar
https://github.com/litestar-org/litestar
null
null
null
null
8,195
null
null
mit
null
null
null
null
null
null
null
docs/examples/data_transfer_objects/factory/leading_underscore_private_override.py
null
null
null
null
null
null
Python
2026-05-04T02:12:44.933281
from dataclasses import dataclass from litestar import Litestar, post from litestar.dto import DataclassDTO, DTOConfig @dataclass class Foo: this_will: str _this_will: str = "not_go_away!" class DTO(DataclassDTO[Foo]): config = DTOConfig(underscore_fields_private=False) @post("/", dto=DTO, sync_to_th...
litestar-org/litestar
https://github.com/litestar-org/litestar
null
null
null
null
8,195
null
null
mit
null
null
null
null
null
null
null
docs/examples/data_transfer_objects/factory/leading_underscore_private.py
null
null
null
null
null
null
Python
2026-05-04T02:12:44.937546
from dataclasses import dataclass from litestar import Litestar, post from litestar.dto import DataclassDTO @dataclass class Foo: this_will: str _this_will: str = "Mars" @post("/", dto=DataclassDTO[Foo], sync_to_thread=False) def handler(data: Foo) -> Foo: return data app = Litestar(route_handlers=[h...
litestar-org/litestar
https://github.com/litestar-org/litestar
null
null
null
null
8,195
null
null
mit
null
null
null
null
null
null
null
docs/examples/data_transfer_objects/factory/marking_fields.py
null
null
null
null
null
null
Python
2026-05-04T02:12:44.968993
from datetime import datetime from advanced_alchemy.extensions.litestar import SQLAlchemyDTO from sqlalchemy.orm import Mapped, mapped_column from litestar import Litestar, post from litestar.dto import dto_field from .my_lib import Base class User(Base): # `Base` defines `id` field as: # id: Mapped[UUID] ...
litestar-org/litestar
https://github.com/litestar-org/litestar
null
null
null
null
8,195
null
null
mit
null
null
null
null
null
null
null
docs/examples/data_transfer_objects/factory/patch_requests.py
null
null
null
null
null
null
Python
2026-05-04T02:12:44.982548
from __future__ import annotations from dataclasses import dataclass from uuid import UUID from litestar import Litestar, patch from litestar.dto import DataclassDTO, DTOConfig, DTOData @dataclass class Person: id: UUID name: str age: int class PatchDTO(DataclassDTO[Person]): """Don't allow client...
litestar-org/litestar
https://github.com/litestar-org/litestar
null
null
null
null
8,195
null
null
mit
null
null
null
null
null
null
null
docs/examples/data_transfer_objects/factory/providing_values_for_nested_data.py
null
null
null
null
null
null
Python
2026-05-04T02:12:44.983671
from __future__ import annotations from dataclasses import dataclass from litestar import Litestar, post from litestar.dto import DataclassDTO, DTOConfig, DTOData @dataclass class Address: id: int street: str @dataclass class Person: id: int name: str age: int address: Address class Read...
litestar-org/litestar
https://github.com/litestar-org/litestar
null
null
null
null
8,195
null
null
mit
null
null
null
null
null
null
null
docs/examples/data_transfer_objects/factory/my_lib.py
null
null
null
null
null
null
Python
2026-05-04T02:12:45.001234
from __future__ import annotations from typing import Any from advanced_alchemy.extensions.litestar import base, mixins from sqlalchemy.orm import DeclarativeBase class _Base(base.CommonTableAttributes, mixins.UUIDPrimaryKey, DeclarativeBase): """Fake base SQLAlchemy model for typing purposes.""" Base: _Base ...
litestar-org/litestar
https://github.com/litestar-org/litestar
null
null
null
null
8,195
null
null
mit
null
null
null
null
null
null
null
docs/examples/data_transfer_objects/factory/paginated_return_data.py
null
null
null
null
null
null
Python
2026-05-04T02:12:45.002568
from datetime import datetime from advanced_alchemy.extensions.litestar import SQLAlchemyDTO from sqlalchemy.orm import Mapped from litestar import Litestar, get from litestar.dto import DTOConfig from litestar.pagination import ClassicPagination from .my_lib import Base class User(Base): name: Mapped[str] ...
litestar-org/litestar
https://github.com/litestar-org/litestar
null
null
null
null
8,195
null
null
mit
null
null
null
null
null
null
null
docs/examples/data_transfer_objects/factory/included_fields.py
null
null
null
null
null
null
Python
2026-05-04T02:12:45.019183
from datetime import datetime from typing import Annotated from uuid import UUID from advanced_alchemy.extensions.litestar import SQLAlchemyDTO from sqlalchemy import ForeignKey from sqlalchemy.orm import Mapped, mapped_column, relationship from litestar import Litestar, post from litestar.dto import DTOConfig, dto_f...
litestar-org/litestar
https://github.com/litestar-org/litestar
null
null
null
null
8,195
null
null
mit
null
null
null
null
null
null
null
docs/examples/data_transfer_objects/factory/related_items.py
null
null
null
null
null
null
Python
2026-05-04T02:12:45.812493
from __future__ import annotations from typing import Annotated from uuid import UUID from advanced_alchemy.extensions.litestar import SQLAlchemyDTO from sqlalchemy import ForeignKey from sqlalchemy.orm import Mapped, mapped_column, relationship from litestar import Litestar, put from litestar.dto import DTOConfig ...
litestar-org/litestar
https://github.com/litestar-org/litestar
null
null
null
null
8,195
null
null
mit
null
null
null
null
null
null
null
docs/examples/data_transfer_objects/factory/renaming_fields.py
null
null
null
null
null
null
Python
2026-05-04T02:12:46.253504
from datetime import datetime from typing import Annotated from advanced_alchemy.extensions.litestar import SQLAlchemyDTO from sqlalchemy.orm import Mapped, mapped_column from litestar import Litestar, post from litestar.dto import DTOConfig, dto_field from .my_lib import Base class User(Base): name: Mapped[st...
litestar-org/litestar
https://github.com/litestar-org/litestar
null
null
null
null
8,195
null
null
mit
null
null
null
null
null
null
null
docs/examples/data_transfer_objects/factory/simple_dto_factory_example.py
null
null
null
null
null
null
Python
2026-05-04T02:12:46.254098
from datetime import datetime from advanced_alchemy.extensions.litestar import SQLAlchemyDTO from sqlalchemy.orm import Mapped from litestar import Litestar, post from .my_lib import Base class User(Base): # `Base` defines `id` field as: # id: Mapped[UUID] = mapped_column(default=uuid4, primary_key=True) ...
litestar-org/litestar
https://github.com/litestar-org/litestar
null
null
null
null
8,195
null
null
mit
null
null
null
null
null
null
null
docs/examples/data_transfer_objects/factory/tutorial/controller.py
null
null
null
null
null
null
Python
2026-05-04T02:12:46.254772
from __future__ import annotations from dataclasses import dataclass from litestar import Controller, Litestar, patch, post, put from litestar.dto import DataclassDTO, DTOConfig, DTOData @dataclass class Person: name: str age: int email: str id: int class ReadDTO(DataclassDTO[Person]): config ...
litestar-org/litestar
https://github.com/litestar-org/litestar
null
null
null
null
8,195
null
null
mit
null
null
null
null
null
null
null
docs/examples/data_transfer_objects/factory/response_return_data.py
null
null
null
null
null
null
Python
2026-05-04T02:12:46.255875
from datetime import datetime from advanced_alchemy.extensions.litestar import SQLAlchemyDTO from sqlalchemy.orm import Mapped from litestar import Litestar, Response, get from litestar.dto import DTOConfig from .my_lib import Base class User(Base): name: Mapped[str] password: Mapped[str] created_at: M...
litestar-org/litestar
https://github.com/litestar-org/litestar
null
null
null
null
8,195
null
null
mit
null
null
null
null
null
null
null
docs/examples/data_transfer_objects/factory/tutorial/dto_data.py
null
null
null
null
null
null
Python
2026-05-04T02:12:46.256729
from __future__ import annotations from dataclasses import dataclass from litestar import Litestar, post from litestar.dto import DataclassDTO, DTOConfig, DTOData @dataclass class Person: name: str age: int email: str id: int class ReadDTO(DataclassDTO[Person]): config = DTOConfig(exclude={"em...
litestar-org/litestar
https://github.com/litestar-org/litestar
null
null
null
null
8,195
null
null
mit
null
null
null
null
null
null
null
docs/examples/data_transfer_objects/factory/renaming_all_fields.py
null
null
null
null
null
null
Python
2026-05-04T02:12:46.683747
from datetime import datetime from typing import Annotated from advanced_alchemy.extensions.litestar import SQLAlchemyDTO from sqlalchemy.orm import Mapped, mapped_column from litestar import Litestar, post from litestar.dto import DTOConfig, dto_field from .my_lib import Base class User(Base): first_name: Map...
litestar-org/litestar
https://github.com/litestar-org/litestar
null
null
null
null
8,195
null
null
mit
null
null
null
null
null
null
null
docs/examples/data_transfer_objects/factory/tutorial/field_renaming_strategy.py
null
null
null
null
null
null
Python
2026-05-04T02:12:46.967863
from __future__ import annotations from dataclasses import dataclass from litestar import Litestar, get from litestar.dto import DataclassDTO, DTOConfig @dataclass class Address: street: str city: str country: str @dataclass class Person: name: str age: int email: str address: Address ...
litestar-org/litestar
https://github.com/litestar-org/litestar
null
null
null
null
8,195
null
null
mit
null
null
null
null
null
null
null
docs/examples/data_transfer_objects/factory/tutorial/explicit_field_renaming.py
null
null
null
null
null
null
Python
2026-05-04T02:12:47.554894
from __future__ import annotations from dataclasses import dataclass from litestar import Litestar, get from litestar.dto import DataclassDTO, DTOConfig @dataclass class Address: street: str city: str country: str @dataclass class Person: name: str age: int email: str address: Address ...
bitsandbytes-foundation/bitsandbytes
https://github.com/bitsandbytes-foundation/bitsandbytes
null
null
null
null
8,172
null
null
mit
null
null
null
null
null
null
null
.github/scripts/set_platform_tag.py
null
null
null
null
null
null
Python
2026-05-04T02:12:50.019043
import argparse import platform import sys def get_platform_tag(architecture): system = platform.system() if system == "Linux": tag = "manylinux_2_24_x86_64" if architecture == "x86_64" else "manylinux_2_24_aarch64" elif system == "Darwin": tag = "macosx_14_0_arm64" elif system == "Wi...
bitsandbytes-foundation/bitsandbytes
https://github.com/bitsandbytes-foundation/bitsandbytes
null
null
null
null
8,172
null
null
mit
null
null
null
null
null
null
null
benchmarking/optimizer_benchmark.py
null
null
null
null
null
null
Python
2026-05-04T02:12:50.019569
""" Extracted from tests/test_optim.py Usage: pytest benchmarking/optimizer_benchmark.py """ import time import pytest from tests.helpers import describe_dtype, id_formatter import torch import bitsandbytes as bnb str2optimizers = {"paged_adamw": (torch.optim.AdamW, bnb.optim.PagedAdamW)} @pytest.mark.parametriz...
bitsandbytes-foundation/bitsandbytes
https://github.com/bitsandbytes-foundation/bitsandbytes
null
null
null
null
8,172
null
null
mit
null
null
null
null
null
null
null
.github/scripts/auditwheel_show.py
null
null
null
null
null
null
Python
2026-05-04T02:12:50.022474
import argparse import subprocess def main(): ap = argparse.ArgumentParser() ap.add_argument("wheels", nargs="*") args = ap.parse_args() if not args.wheels: ap.error("At least one wheel must be provided.") for whl in args.wheels: print(f"### `{whl}`") audit_wheel_output = ...
bitsandbytes-foundation/bitsandbytes
https://github.com/bitsandbytes-foundation/bitsandbytes
null
null
null
null
8,172
null
null
mit
null
null
null
null
null
null
null
benchmarking/int8/training_benchmark.py
null
null
null
null
null
null
Python
2026-05-04T02:12:50.026681
""" Extracted from tests/test_functional.py Usage: pytest benchmarking/int8/training_benchmark.py """ import time import pytest import torch from bitsandbytes import functional as F k = 20 torch.set_printoptions(precision=5, sci_mode=False, linewidth=120, edgeitems=20, threshold=10000) @pytest.mark.parametrize(...