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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | robusta_krr/core/models/severity.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:47.042510 | from __future__ import annotations
import enum
from typing import Callable, Optional
from robusta_krr.core.models.allocations import RecommendationValue, ResourceType
class Severity(str, enum.Enum):
"""
The severity of the scan.
The severity is calculated based on the difference between the current val... |
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | robusta_krr/core/models/result.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:47.043352 | from __future__ import annotations
from typing import Any, Optional, Union
import pydantic as pd
from robusta_krr.core.abstract import formatters
from robusta_krr.core.models.allocations import RecommendationValue, ResourceAllocations, ResourceType
from robusta_krr.core.models.objects import K8sObjectData
from robus... |
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | robusta_krr/core/models/objects.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:47.044728 | from __future__ import annotations
from typing import Literal, Optional
import pydantic as pd
from robusta_krr.core.models.allocations import ResourceAllocations
from robusta_krr.utils.batched import batched
from kubernetes.client.models import V1LabelSelector
KindLiteral = Literal[
"Deployment",
"DaemonSet... |
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | robusta_krr/core/integrations/prometheus/metrics/cpu.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:51.005055 | from robusta_krr.core.models.objects import K8sObjectData
from .base import PrometheusMetric, QueryType
class CPULoader(PrometheusMetric):
"""
A metric loader for loading CPU usage metrics.
"""
query_type: QueryType = QueryType.QueryRange
def get_query(self, object: K8sObjectData, duration: str... |
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | robusta_krr/core/integrations/prometheus/metrics/base.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:51.011231 | from __future__ import annotations
import abc
import asyncio
import datetime
import enum
from concurrent.futures import ThreadPoolExecutor
from functools import reduce
from typing import Any, Optional, TypedDict
import numpy as np
import pydantic as pd
from prometrix import CustomPrometheusConnect
from tenacity impor... |
robusta-dev/krr | https://github.com/robusta-dev/krr | null | null | null | null | 4,577 | null | null | mit | null | null | null | null | null | null | null | robusta_krr/core/integrations/prometheus/metrics_service/base_metric_service.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:51.015692 | import abc
import datetime
from concurrent.futures import ThreadPoolExecutor
from typing import List, Optional, Dict, Any
from kubernetes.client.api_client import ApiClient
from robusta_krr.core.abstract.strategies import PodsTimeData
from robusta_krr.core.models.config import settings
from robusta_krr.core.models.ob... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | computer_use/utils.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:53.379422 | import os
from io import BytesIO
import pandas as pd
import requests
from PIL import Image, ImageDraw
def draw_point(
image_input, point: tuple = None, radius: int = 8, color: str = "red"
) -> Image.Image:
"""
Draw a point on an image and return the modified image.
`point` should be (x_norm, y_norm) ... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | computer_use/autonomous_gui_agent.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:53.381111 | # Take a screenshot of the screen
import json
import math
import os
import time
import tkinter as tk
from tkinter import Label
import mlx.core as mx
import pyautogui
import sounddevice as sd
import soundfile as sf
from PIL import ImageGrab
from pynput.mouse import Controller as MouseController
from rich import print
f... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | agents/grounded_reasoning/fp_tools.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:53.391757 | """Falcon Perception grounding tools for the grounded reasoning agent."""
import numpy as np
from PIL import Image
def _image_region(cx_norm, cy_norm):
"""Map a normalised centroid to a human-readable region string."""
if cx_norm < 0.33:
h = "left"
elif cx_norm < 0.67:
h = "center"
el... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | computer_use/autonomous_gui_agent_voice.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:53.404437 | # Take a screenshot of the screen
import json
import math
import os
import time
import tkinter as tk
from tkinter import Label
import mlx.core as mx
import numpy as np
import pyautogui
import sounddevice as sd
import soundfile as sf
from PIL import ImageGrab
from pynput.mouse import Controller as MouseController
from ... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | agents/grounded_reasoning/viz.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:53.406269 | """Set-of-Marks visualisation helpers for the grounded reasoning agent."""
import numpy as np
from PIL import Image, ImageDraw, ImageFont
# Colour palette — each mask gets a distinct colour (cycles after 10)
_PALETTE = [
(255, 80, 80), # red
(80, 200, 80), # green
(80, 120, 255), # blue
(255, 220, ... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | agents/grounded_reasoning/mask_ops.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:53.407487 | """Pre-defined spatial operations on mask metadata for the grounded reasoning agent.
These deterministic functions replace numerical reasoning that would otherwise
require the VLM to sort floats in natural language — an unreliable operation for
small quantised models. The VLM picks the right function name and paramet... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | computer_use/gui_agent_voice.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:53.410977 | import os
import time
import mlx.core as mx
import mlx_whisper
import numpy as np
import speech_recognition as sr
from PIL import ImageGrab
from utils import draw_point, update_navigation_history
from mlx_vlm import load
from mlx_vlm.utils import generate
min_pixels = 256 * 28 * 28
max_pixels = 1512 * 982
_NAV_SYST... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | agents/grounded_reasoning/agent.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:53.419670 | """Grounded visual reasoning: Falcon Perception + local VLM on Apple Silicon.
Architecture
------------
User query + Image
│
▼
┌──────────────────────────────────────────┐
│ Orchestrator VLM (any mlx-vlm model) │
│ Classifies task type, plans tool calls, │
│ reasons over pixel-accurate metadat... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | computer_use/gui_agent.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:53.424655 | # Take a screenshot of the screen
import os
import time
import mlx.core as mx
from PIL import ImageGrab
from utils import draw_point, update_navigation_history
from mlx_vlm import load
from mlx_vlm.utils import generate
min_pixels = 256 * 28 * 28
max_pixels = 1512 * 982
_NAV_SYSTEM = """You are an assistant trained... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | examples/qwen3_omni_demo.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:53.996249 | import mlx.core as mx
import numpy as np
import soundfile as sf
from mlx_vlm import load
from mlx_vlm.models.qwen3_omni_moe.omni_utils import prepare_omni_inputs
# Configuration
model_path = "mlx_qwen3_omni_4bit_path"
audio_path = "dev/question.wav"
image_path = "dev/cars.jpg"
output_audio_path = "output_mlx.wav"
spe... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | examples/structured_outputs.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:54.010305 | import sys
import mlx.core as mx
try:
from outlines.models.transformers import TransformerTokenizer
from outlines.processors import JSONLogitsProcessor
except ImportError:
print(
"Outlines is not installed, please install it with `pip install outlines==1.1.1`"
)
sys.exit(1)
from mlx_vlm i... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | examples/sharded_generate.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:54.033240 | """
Run with:
```
mlx.launch \
--backend jaccl \
--env MLX_METAL_FAST_SYNCH=1 \
--hostfile /path/to/hosts.json \
/path/to/sharded_generate.py \
--prompt 'Describe this image.' --image /path/to/image.jpg
```
For more information on running distributed programs with MLX see the documentation:
https... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | examples/omni.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:54.050143 | import argparse
import asyncio
import json
import logging
import os
import threading
import time
import warnings
import wave
import aiohttp
import cv2
import numpy as np
import sounddevice as sd
import webrtcvad
warnings.filterwarnings(
"ignore",
message="pkg_resources is deprecated",
category=UserWarning... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | mlx_vlm/chat.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:54.052030 | import argparse
import codecs
import os
import sys
from typing import Dict, List
from rich import print as rprint
from rich.console import Console
from rich.markdown import Markdown
from rich.panel import Panel
from rich.prompt import Prompt
from mlx_vlm import load
from mlx_vlm.generate import (
DEFAULT_KV_GROUP... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | mlx_vlm/__main__.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:54.054593 | #!/usr/bin/env python
"""Entry point for mlx_vlm CLI."""
import importlib
import sys
if __name__ == "__main__":
subcommands = {
"generate",
"convert",
"chat",
"chat_ui",
"server",
"video_generate",
}
if len(sys.argv) < 2:
raise ValueError(f"CLI requ... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | mlx_vlm/chat_ui.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:54.056061 | import argparse
import gc
import json
import threading
try:
import gradio as gr
except ImportError:
raise SystemExit(
"mlx_vlm.chat_ui requires 'gradio'. "
"Install it with: pip install 'mlx-vlm[ui]'"
)
import mlx.core as mx
from mlx_vlm import load
from .generate import PromptCacheState,... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | examples/utils.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:54.058074 | import json
import re
from typing import Union
import matplotlib.patches as patches
import matplotlib.pyplot as plt
import numpy as np
from PIL import Image
def normalize_bbox(model_type, x_min, y_min, x_max, y_max, image_width, image_height):
# Normalize coordinates
if model_type == "paligemma":
y_m... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | mlx_vlm/convert.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:54.066379 | import argparse
import glob
import shutil
from pathlib import Path
from typing import Callable, Optional, Union
import mlx.core as mx
import mlx.nn as nn
from mlx.utils import tree_map_with_path
from .utils import (
MODEL_CONVERSION_DTYPES,
create_model_card,
fetch_from_hub,
get_model_path,
save_c... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | mlx_vlm/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:54.067422 | import os
os.environ["TRANSFORMERS_NO_ADVISORY_WARNINGS"] = "1"
os.environ["TRANSFORMERS_VERBOSITY"] = "error"
from .convert import convert
from .generate import (
BatchResponse,
BatchStats,
GenerationResult,
PromptCacheState,
batch_generate,
generate,
stream_generate,
)
from .prompt_utils... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | mlx_vlm/deprecation.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:54.742347 | import functools
import warnings
from typing import Callable, Optional
def deprecate(
remove_version: str,
message: str,
instead: Optional[str] = None,
since: Optional[str] = None,
) -> Callable:
"""
Mark a function or method as deprecated.
Args:
remove_version: Version when this ... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | mlx_vlm/evals/math_vista.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:54.744339 | import argparse
import csv
import json
import logging
import os
import random
import re
from pathlib import Path
from typing import Optional
from datasets import load_dataset
from PIL import Image
from tqdm import tqdm
from mlx_vlm import load
from mlx_vlm.evals.utils import inference
def process_question(sample: d... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | mlx_vlm/lora.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:54.745562 | import argparse
import json
import logging
import mlx.optimizers as optim
from datasets import load_dataset
from .trainer.datasets import PreferenceVisionDataset, VisionDataset
from .trainer.orpo_trainer import ORPOTrainingArgs, train_orpo
from .trainer.sft_trainer import TrainingArgs, train
from .trainer.utils impor... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | mlx_vlm/evals/mmmu.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:54.746749 | import argparse
import csv
import logging
import os
import random
import re
from json import dump
from datasets import load_dataset
from tqdm import tqdm
from mlx_vlm import load
from mlx_vlm.evals.utils import inference
# All 30 MMMU subjects (confirmed from dataset)
MMMU_SUBJECTS = [
"Accounting",
"Agricul... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | mlx_vlm/evals/ocrbench.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:54.757160 | import argparse
import csv
import json
import logging
import random
import traceback
from pathlib import Path
from typing import Optional
import mlx.core as mx
from datasets import load_dataset
from tqdm import tqdm
from mlx_vlm import load
from mlx_vlm.evals.utils import inference
from mlx_vlm.generate import batch_... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | mlx_vlm/evals/mmstar.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:54.758797 | import argparse
import csv
import logging
import os
import random
import re
from copy import deepcopy
from json import dump
from datasets import load_dataset
from tqdm import tqdm
from mlx_vlm import load
from mlx_vlm.evals.utils import inference
def extract_answer(predict, answer):
"""
Extracts the answer ... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | mlx_vlm/evals/utils.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:54.762671 | from mlx_vlm import generate
from mlx_vlm.prompt_utils import apply_chat_template
def inference(
model,
processor,
question,
image,
max_tokens=3000,
temperature=0.0,
resize_shape=None,
verbose=False,
):
"""Run inference on a single question."""
if image is None:
num_ima... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | mlx_vlm/generate.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:54.843658 | import argparse
import codecs
import contextlib
import functools
import json
import time
import warnings
from collections.abc import Sequence
from dataclasses import dataclass
from typing import Any, Callable, Dict, Generator, List, Optional, Tuple, Union
import mlx.core as mx
import mlx.nn as nn
from mlx.utils import... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | mlx_vlm/models/aya_vision/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:55.300255 | from .aya_vision import LanguageModel, Model, VisionModel
from .config import ModelConfig, TextConfig, VisionConfig
|
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | mlx_vlm/models/aya_vision/aya_vision.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:55.328596 | from typing import Optional
import mlx.core as mx
import mlx.nn as nn
import numpy as np
from ..base import InputEmbeddingsFeatures
from . import processing_aya_vision # noqa: F401
from .config import ModelConfig
from .language import LanguageModel
from .vision import VisionModel
class AyaVisionMultiModalProjector... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | mlx_vlm/models/deepseek_vl_v2/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:55.367394 | import mlx_vlm.models.deepseek_vl_v2.processing_deepsek_vl_v2 # noqa: F401 (installs processor patch)
from .config import MLPConfig, ModelConfig, ProjectorConfig, TextConfig, VisionConfig
from .deepseek_vl_v2 import DeepseekVLV2Processor, LanguageModel, Model, VisionModel
|
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | mlx_vlm/models/aya_vision/vision.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:55.368746 | from typing import Optional
import mlx.core as mx
import mlx.nn as nn
import numpy as np
from ..interpolate import resize_bilinear
from .config import VisionConfig
def check_array_shape(arr):
shape = arr.shape
# Check if the shape has 4 dimensions
if len(shape) != 4:
return False
out_chann... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | mlx_vlm/models/aya_vision/config.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:55.373650 | from dataclasses import dataclass
from typing import List, Optional
from ..base import BaseModelConfig
@dataclass
class TextConfig(BaseModelConfig):
model_type: str
hidden_size: int = 8192
head_dim: int = 128
num_hidden_layers: int = 40
intermediate_size: int = 14336
num_attention_heads: int ... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | mlx_vlm/models/cache.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:55.374820 | from typing import Any, List, Optional, Tuple
import mlx.core as mx
import mlx.nn as nn
from mlx_lm.models.cache import (
ArraysCache,
BatchKVCache,
BatchRotatingKVCache,
CacheList,
ChunkedKVCache,
KVCache,
QuantizedKVCache,
RotatingKVCache,
_BaseCache,
)
class BatchQuantizedKVCac... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | mlx_vlm/models/aya_vision/processing_aya_vision.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:55.380315 | """
Processor class for AyaVision.
Adapted from HuggingFace Transformers:
https://github.com/huggingface/transformers/blob/main/src/transformers/models/aya_vision/processing_aya_vision.py
"""
from typing import List, Optional, Union
import numpy as np
from transformers.image_processing_utils import BatchFeature
from... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | mlx_vlm/models/aya_vision/language.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:55.399572 | from typing import Optional, Tuple
import mlx.core as mx
import mlx.nn as nn
from ..base import (
LanguageModelOutput,
create_attention_mask,
scaled_dot_product_attention,
)
from ..cache import KVCache, RotatingKVCache
from .config import TextConfig
class Attention(nn.Module):
def __init__(self, con... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | mlx_vlm/models/base.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:55.412823 | import inspect
import math
from abc import abstractmethod
from dataclasses import dataclass
from typing import Dict, List, Optional
import mlx.core as mx
import mlx.nn as nn
import numpy as np
from mlx_lm.models.base import create_attention_mask, create_ssm_mask
from mlx_lm.models.base import (
scaled_dot_product_... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | mlx_vlm/models/deepseek_vl_v2/config.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:55.434724 | import inspect
from dataclasses import dataclass
from typing import Dict, List, Optional
from ..base import BaseModelConfig
@dataclass
class TextConfig(BaseModelConfig):
model_type: str = "deepseek_v2"
vocab_size: int = 102400
hidden_size: int = 1280
intermediate_size: int = 6848
moe_intermediate... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | mlx_vlm/models/deepseek_vl_v2/conversation.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:56.302858 | """
From https://github.com/lm-sys/FastChat/blob/main/fastchat/conversation.py
"""
import dataclasses
from enum import IntEnum, auto
from typing import Dict, List
class SeparatorStyle(IntEnum):
"""Separator styles."""
DeepSeek = auto()
DeepSeekV2 = auto()
PLAIN = auto()
ALIGNMENT = auto()
@dat... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | mlx_vlm/models/deepseekocr/conversation.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:56.304044 | """
From https://github.com/lm-sys/FastChat/blob/main/fastchat/conversation.py
"""
import dataclasses
from enum import IntEnum, auto
from typing import Dict, List
class SeparatorStyle(IntEnum):
"""Separator styles."""
DeepSeek = auto()
DeepSeekV2 = auto()
PLAIN = auto()
ALIGNMENT = auto()
@dat... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | mlx_vlm/models/deepseekocr/config.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:56.304677 | import inspect
from dataclasses import dataclass
from typing import Dict, List, Optional, Tuple, Union
from ..base import BaseModelConfig
@dataclass
class TextConfig(BaseModelConfig):
model_type: str = "deepseek_v2"
vocab_size: int = 102400
hidden_size: int = 1280
intermediate_size: int = 6848
mo... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | mlx_vlm/models/deepseek_vl_v2/deepseek_vl_v2.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:56.600059 | import math
from typing import Optional
import mlx.core as mx
import mlx.nn as nn
import numpy as np
from transformers import AutoProcessor
from ..base import InputEmbeddingsFeatures
from .config import ModelConfig, ProjectorConfig
from .language import LanguageModel
from .processing_deepsek_vl_v2 import DeepseekVLV2... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | mlx_vlm/models/deepseek_vl_v2/language.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:56.764768 | import math
from typing import Any, Optional
import mlx.core as mx
import mlx.nn as nn
from mlx_lm.models.switch_layers import SwitchGLU
from ..base import (
LanguageModelOutput,
create_attention_mask,
scaled_dot_product_attention,
)
from .config import TextConfig
def yarn_find_correction_dim(
num_r... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | mlx_vlm/models/deepseek_vl_v2/vision.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:56.856659 | from functools import partial
from math import sqrt
from typing import Dict, Optional, Union
import mlx.core as mx
import mlx.nn as nn
from .config import MLPConfig, VisionConfig
def check_array_shape(arr):
shape = arr.shape
# Check if the shape has 4 dimensions
if len(shape) != 4:
return False... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | mlx_vlm/models/deepseekocr/deepseekocr.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:56.877437 | import math
from typing import Optional
import mlx.core as mx
import mlx.nn as nn
import numpy as np
from transformers import AutoProcessor
from mlx_vlm.models.base import InputEmbeddingsFeatures
from .config import ModelConfig, ProjectorConfig, SAMViTConfig
from .language import LanguageModel
from .processing_deeps... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | mlx_vlm/models/deepseekocr/language.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:57.072377 | import math
from typing import Any, Optional
import mlx.core as mx
import mlx.nn as nn
from mlx_lm.models.switch_layers import SwitchGLU
from ..base import (
LanguageModelOutput,
create_attention_mask,
scaled_dot_product_attention,
)
from .config import TextConfig
def yarn_find_correction_dim(
num_r... |
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | mlx_vlm/models/deepseekocr/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:57.287222 | from .config import MLPConfig, ModelConfig, ProjectorConfig, TextConfig, VisionConfig
from .deepseekocr import DeepseekOCRProcessor, LanguageModel, Model, VisionModel
|
Blaizzy/mlx-vlm | https://github.com/Blaizzy/mlx-vlm | null | null | null | null | 4,572 | null | null | mit | null | null | null | null | null | null | null | mlx_vlm/models/deepseek_vl_v2/processing_deepsek_vl_v2.py | null | null | null | null | null | null | Python | 2026-05-04T01:57:57.900586 | """
From https://github.com/deepseek-ai/DeepSeek-VL2
"""
import math
from dataclasses import dataclass
from typing import Dict, List, Literal, Optional, Tuple
import mlx.core as mx
import numpy as np
from PIL import Image, ImageOps
from transformers import LlamaTokenizerFast
from transformers.processing_utils import ... |
jendrikseipp/vulture | https://github.com/jendrikseipp/vulture | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | tests/test_encoding.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:00.852538 | import codecs
from vulture.utils import ExitCode
from . import v
assert v # Silence pyflakes.
def test_encoding1(v):
v.scan(
"""\
# -*- coding: utf-8 -*-
pass
"""
)
assert v.exit_code == ExitCode.NoDeadCode
def test_encoding2(v):
v.scan(
"""\
#! /usr/bin/env python
# -*- coding: ... |
jendrikseipp/vulture | https://github.com/jendrikseipp/vulture | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | tests/test_confidence.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:00.861421 | from vulture import core
dc = core.DEFAULT_CONFIDENCE
def check_min_confidence(code, min_confidence, expected):
v = core.Vulture(verbose=True)
v.scan(code)
detected = {
item.name: item.confidence
for item in v.get_unused_code(min_confidence=min_confidence)
}
assert detected == exp... |
jendrikseipp/vulture | https://github.com/jendrikseipp/vulture | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | tests/test_config.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:00.874310 | """
Unit tests for config file and CLI argument parsing.
"""
import pathlib
from io import BytesIO
from textwrap import dedent
import pytest
from vulture.config import (
DEFAULTS,
InputError,
_check_input_config,
_parse_args,
_parse_toml,
make_config,
)
def get_toml_bytes(toml_str: str) -> ... |
jendrikseipp/vulture | https://github.com/jendrikseipp/vulture | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | dev/make-release-notes.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:00.876499 | #! /usr/bin/env python3
import re
import sys
_, VERSION, CHANGELOG, LIST = sys.argv
HEADER_REGEX = rf"# {VERSION} \(\d\d\d\d-\d\d-\d\d\)\n"
notes_list = []
with open(CHANGELOG) as f:
first_line = next(f)
if not re.match(HEADER_REGEX, first_line):
sys.exit(
f'First changelog line "{first... |
jendrikseipp/vulture | https://github.com/jendrikseipp/vulture | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | tests/test_conditions.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:00.878368 | import ast
from vulture import utils
from . import v
assert v # Silence pyflakes
def check_condition(code, result):
condition = ast.parse(code, mode="eval").body
if result:
assert utils.condition_is_always_true(condition)
else:
assert utils.condition_is_always_false(condition)
def te... |
jendrikseipp/vulture | https://github.com/jendrikseipp/vulture | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | tests/test_imports.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:00.880443 | from . import check, v
assert v # Silence pyflakes.
def test_import_star(v):
v.scan(
"""\
from a import *
from a.b import *
"""
)
check(v.defined_imports, [])
check(v.unused_imports, [])
def test_import_from_future(v):
v.scan("""from __future__ import division""")
check(v.defined_i... |
jendrikseipp/vulture | https://github.com/jendrikseipp/vulture | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | tests/test_format_strings.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:00.887690 | from . import check, v
assert v # Silence pyflakes.
def test_old_format_string(v):
v.scan("'%(a)s, %(b)d' % locals()")
check(v.used_names, ["a", "b", "locals"])
def test_new_format_string(v):
v.scan("'{a}, {b:0d} {c:<30} {d:.2%}'.format(**locals())")
check(v.used_names, ["a", "b", "c", "d", "forma... |
jendrikseipp/vulture | https://github.com/jendrikseipp/vulture | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | tests/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:00.889754 | import pathlib
import subprocess
import sys
import pytest
from vulture import core
REPO = pathlib.Path(__file__).resolve().parents[1]
WHITELISTS = [
str(path)
for path in (REPO / "vulture" / "whitelists").glob("*.py")
# Pint is incompatible with Python 3.13 (https://github.com/hgrecco/pint/issues/1969).
... |
jendrikseipp/vulture | https://github.com/jendrikseipp/vulture | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | tests/test_ignore.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:00.892437 | from vulture import core
from . import check
def check_ignore(code, ignore_names, ignore_decorators, expected):
v = core.Vulture(
verbose=True,
ignore_names=ignore_names,
ignore_decorators=ignore_decorators,
)
v.scan(code)
check(v.get_unused_code(), expected)
def test_var():... |
jendrikseipp/vulture | https://github.com/jendrikseipp/vulture | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | tests/test_errors.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:00.925987 | import pytest
from vulture.utils import ExitCode
from . import call_vulture, v
assert v # Silence pyflakes.
def test_syntax_error(v):
v.scan("foo bar")
assert int(v.report()) == ExitCode.InvalidInput
def test_null_byte(v):
v.scan("\x00")
assert int(v.report()) == ExitCode.InvalidInput
def test... |
jendrikseipp/vulture | https://github.com/jendrikseipp/vulture | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | tests/test_item.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:01.460657 | from . import v
assert v # Silence pyflakes
def test_item_repr(v):
v.scan(
"""\
import os
message = "foobar"
class Foo:
def bar():
pass
"""
)
for item in v.get_unused_code():
assert repr(item) == f"{item.name!r}"
def test_item_attr(v):
v.scan("foo.bar = 'bar'")
as... |
jendrikseipp/vulture | https://github.com/jendrikseipp/vulture | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | tests/test_make_whitelist.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:01.517353 | import pytest
from . import check, v
assert v # silence pyflakes
@pytest.fixture
def check_whitelist(v):
def examine(code, results_before, results_after):
v.scan(code)
check(v.get_unused_code(), results_before)
for item in v.get_unused_code():
v.scan(item.get_whitelist_strin... |
jendrikseipp/vulture | https://github.com/jendrikseipp/vulture | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | tests/test_size.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:01.524239 | import ast
import sys
import pytest
from vulture import lines
def count_lines(node):
"""Estimate the number of lines of the given AST node."""
last_lineno = lines.get_last_line_number(node)
return last_lineno - lines.get_first_line_number(node) + 1
def check_size(example, size):
tree = ast.parse(e... |
jendrikseipp/vulture | https://github.com/jendrikseipp/vulture | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | tests/test_reachability.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:01.525323 | from . import check_multiple_unreachable, check_unreachable, v
assert v # Silence pyflakes
def test_return_assignment(v):
v.scan(
"""\
def foo():
print("Hello World")
return
a = 1
"""
)
check_unreachable(v, 4, 1, "return")
def test_return_multiline_return_statements(v):
v.scan(... |
jendrikseipp/vulture | https://github.com/jendrikseipp/vulture | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | tests/test_noqa.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:01.526992 | import pytest
from vulture.core import ERROR_CODES
from vulture.noqa import NOQA_CODE_MAP, NOQA_REGEXP, _parse_error_codes
from . import check, v
assert v # Silence pyflakes.
@pytest.mark.parametrize(
"line, codes",
[
("# noqa", ["all"]),
("## noqa", ["all"]),
("# noqa Hi, go on.",... |
jendrikseipp/vulture | https://github.com/jendrikseipp/vulture | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | tests/test_script.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:01.527857 | import glob
import os.path
import subprocess
import sys
from vulture.utils import ExitCode
from . import REPO, WHITELISTS, call_vulture
def test_module_with_explicit_whitelists():
assert call_vulture(["vulture/", *WHITELISTS]) == ExitCode.NoDeadCode
def test_module_with_implicit_whitelists():
assert call_... |
jendrikseipp/vulture | https://github.com/jendrikseipp/vulture | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | tests/test_report.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:01.538566 | import pytest
from . import v
assert v # Silence pyflakes
mock_code = """\
import foo
class Foo:
def __init__(self):
print("Initialized foo")
def bar(self):
self.foobar = "unused attribute"
foobar = "unused variable"
日本人 = "unused variable"
return
print("unr... |
jendrikseipp/vulture | https://github.com/jendrikseipp/vulture | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | tests/test_sorting.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:01.570458 | from . import v
assert v # Silence pyflakes
def test_sorting(v):
v.scan(
"""\
def foo():
print("Hello, I am a long function.")
return "World"
def bar():
pass
"""
)
assert [item.name for item in v.get_unused_code(sort_by_size=True)] == [
"bar",
"foo",
]
assert... |
jendrikseipp/vulture | https://github.com/jendrikseipp/vulture | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | tests/test_scavenging.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:01.571892 | from vulture.utils import ExitCode
from . import check, v
assert v # Silence pyflakes.
def test_function_object1(v):
v.scan(
"""\
def func():
pass
a = func
"""
)
check(v.defined_funcs, ["func"])
check(v.unused_funcs, [])
def test_function_object2(v):
v.scan(
"""\
def func... |
jendrikseipp/vulture | https://github.com/jendrikseipp/vulture | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | tests/test_utils.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:01.591024 | import ast
import os
import pathlib
import pytest
from vulture import utils
class TestFormatPath:
@pytest.fixture
def tmp_cwd(self, tmp_path, monkeypatch):
cwd = tmp_path / "workingdir"
cwd.mkdir()
monkeypatch.chdir(cwd)
return cwd
def test_relative_inside(self):
... |
jendrikseipp/vulture | https://github.com/jendrikseipp/vulture | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | vulture/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:02.067406 | from vulture.core import Vulture
from vulture.version import __version__
assert __version__
assert Vulture
|
jendrikseipp/vulture | https://github.com/jendrikseipp/vulture | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | vulture/core.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:02.121798 | import ast
import pkgutil
import re
import string
import sys
from fnmatch import fnmatch, fnmatchcase
from functools import partial
from pathlib import Path
from vulture import lines, noqa, utils
from vulture.config import InputError, make_config
from vulture.reachability import Reachability
from vulture.utils import ... |
jendrikseipp/vulture | https://github.com/jendrikseipp/vulture | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | vulture/config.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:02.139648 | """
This module handles retrieval of configuration values from either the
command-line arguments or the pyproject.toml file.
"""
import argparse
import pathlib
try:
import tomllib
except ModuleNotFoundError:
import tomli as tomllib
from .version import __version__
#: Possible configuration options and their... |
jendrikseipp/vulture | https://github.com/jendrikseipp/vulture | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | vulture/reachability.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:02.153036 | import ast
from vulture import utils
class Reachability:
def __init__(self, report):
self._report = report
self._no_fall_through_nodes = set()
def visit(self, node):
"""When called, all children of this node have already been visited."""
if isinstance(node, (ast.Break, ast.Co... |
jendrikseipp/vulture | https://github.com/jendrikseipp/vulture | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | vulture/noqa.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:02.168551 | import re
from collections import defaultdict
NOQA_REGEXP = re.compile(
# Use the same regex as flake8 does.
# https://github.com/pycqa/flake8/blob/main/src/flake8/defaults.py
# We're looking for items that look like this:
# `# noqa`
# `# noqa: E123`
# `# noqa: E123,W451,F921`
# `# NoQA: E1... |
jendrikseipp/vulture | https://github.com/jendrikseipp/vulture | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | vulture/utils.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:02.169676 | import ast
import pathlib
import sys
import tokenize
from enum import IntEnum
class VultureInputException(Exception):
pass
class ExitCode(IntEnum):
NoDeadCode = 0
InvalidInput = 1
InvalidCmdlineArguments = 2
DeadCode = 3
def _safe_eval(node, default):
"""
Safely evaluate the Boolean ex... |
jendrikseipp/vulture | https://github.com/jendrikseipp/vulture | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | vulture/lines.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:02.190082 | def get_last_line_number(node):
return node.end_lineno
def get_first_line_number(node):
"""
From Python 3.8 onwards, lineno for decorated objects is the line at which
the object definition starts, which is different from what Python < 3.8
reported -- the lineno of the first decorator. To preserve ... |
jendrikseipp/vulture | https://github.com/jendrikseipp/vulture | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | vulture/whitelists/argparse_whitelist.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:02.234536 | import argparse
argparse.ArgumentParser().epilog
argparse.ArgumentDefaultsHelpFormatter("prog")._fill_text
argparse.ArgumentDefaultsHelpFormatter("prog")._get_help_string
|
jendrikseipp/vulture | https://github.com/jendrikseipp/vulture | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | vulture/whitelists/ast_whitelist.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:03.023798 | from whitelist_utils import Whitelist
# NodeVisitor methods are called implicitly.
whitelist_node_visitor = Whitelist()
whitelist_node_visitor.visit_Assert
whitelist_node_visitor.visit_Assign
whitelist_node_visitor.visit_AsyncFor
whitelist_node_visitor.visit_AsyncFunctionDef
whitelist_node_visitor.visit_AsyncWith
whi... |
jendrikseipp/vulture | https://github.com/jendrikseipp/vulture | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | vulture/whitelists/enum_whitelist.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:03.026753 | import enum
class EnumWhitelist(enum.Enum):
EnumWhitelist = 1
# Special attributes used by enum classes.
EnumWhitelist.EnumWhitelist._name_
EnumWhitelist.EnumWhitelist._value_
|
jendrikseipp/vulture | https://github.com/jendrikseipp/vulture | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | vulture/whitelists/ssl_whitelist.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:03.041802 | import ssl
ctx = ssl.SSLContext()
ctx.check_hostname
ctx.hostname_checks_common_name
ctx.keylog_filename
ctx.maximum_version
ctx.minimum_version
ctx.options
ctx.post_handshake_auth
ctx.sni_callback
ctx.sslobject_class
ctx.sslsocket_class
ctx.verify_flags
ctx.verify_mode
|
jendrikseipp/vulture | https://github.com/jendrikseipp/vulture | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | vulture/whitelists/string_whitelist.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:03.053535 | import string
string.Formatter.check_unused_args
string.Formatter.convert_field
string.Formatter.format
string.Formatter.format_field
string.Formatter.get_field
string.Formatter.get_value
string.Formatter.parse
string.Formatter.vformat
|
jendrikseipp/vulture | https://github.com/jendrikseipp/vulture | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | vulture/whitelists/collections_whitelist.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:03.059638 | import collections
# To free memory, the "default_factory" attribute can be set to None.
collections.defaultdict().default_factory
|
jendrikseipp/vulture | https://github.com/jendrikseipp/vulture | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | vulture/whitelists/ctypes_whitelist.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:04.670269 | from ctypes import _CFuncPtr, _Pointer
_CFuncPtr.argtypes
_CFuncPtr.errcheck
_CFuncPtr.restype
_Pointer.contents
|
jendrikseipp/vulture | https://github.com/jendrikseipp/vulture | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | vulture/whitelists/sys_whitelist.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:04.742782 | import sys
sys.excepthook
# Never report redirected streams as unused.
sys.stderr
sys.stdin
sys.stdout
|
jendrikseipp/vulture | https://github.com/jendrikseipp/vulture | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | vulture/whitelists/unittest_whitelist.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:04.874630 | from unittest import TestCase, mock
TestCase.setUp
TestCase.tearDown
TestCase.setUpClass
TestCase.tearDownClass
TestCase.run
TestCase.skipTest
TestCase.debug
TestCase.failureException
TestCase.longMessage
TestCase.maxDiff
TestCase.subTest
mock.Mock.return_value
mock.Mock.side_effect
mock.MagicMock.return_value
mock.... |
jendrikseipp/vulture | https://github.com/jendrikseipp/vulture | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | vulture/whitelists/whitelist_utils.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:04.875253 | """
Vulture sometimes reports used code as unused. To avoid these
false-positives, you can write a Python file that explicitly uses the
code and pass it to vulture:
vulture myscript.py mydir mywhitelist.py
When creating a whitelist file, you have to make sure not to write code
that hides unused code in other files. ... |
scottrogowski/code2flow | https://github.com/scottrogowski/code2flow | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | code2flow/python.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:07.273639 | import ast
import logging
import os
from .model import (OWNER_CONST, GROUP_TYPE, Group, Node, Call, Variable,
BaseLanguage, djoin)
def get_call_from_func_element(func):
"""
Given a python ast that represents a function call, clear and create our
generic Call object. Some calls have no... |
scottrogowski/code2flow | https://github.com/scottrogowski/code2flow | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | code2flow/engine.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:07.320119 | import argparse
import collections
import json
import logging
import os
import subprocess
import sys
import time
from .python import Python
from .javascript import Javascript
from .ruby import Ruby
from .php import PHP
from .model import (TRUNK_COLOR, LEAF_COLOR, NODE_COLOR, GROUP_TYPE, OWNER_CONST,
... |
scottrogowski/code2flow | https://github.com/scottrogowski/code2flow | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | setup.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:07.329100 | from setuptools import setup
from code2flow.engine import VERSION
url_base = 'https://github.com/scottrogowski/code2flow'
download_url = '%s/archive/code2flow-%s.tar.gz' % (url_base, VERSION)
setup(
name='code2flow',
version=VERSION,
description='Visualize your source code as DOT flowcharts',
long_de... |
scottrogowski/code2flow | https://github.com/scottrogowski/code2flow | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | make_expected.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:07.331130 | #!/usr/bin/env python3
import os
import pprint
import sys
import tempfile
from code2flow.engine import main
from tests.test_graphs import get_edges_set_from_file, get_nodes_set_from_file
DESCRIPTION = """
This file is a tool to generate test cases given a directory
"""
if __name__ == '__main__':
output_filename... |
scottrogowski/code2flow | https://github.com/scottrogowski/code2flow | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | code2flow/php.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:07.338366 | import json
import os
import subprocess
from .model import (Group, Node, Call, Variable, BaseLanguage,
OWNER_CONST, GROUP_TYPE, is_installed, flatten, djoin)
def lineno(tree):
"""
Return the line number of the AST
:param tree ast:
:rtype: int
"""
return tree['attributes'][... |
scottrogowski/code2flow | https://github.com/scottrogowski/code2flow | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | code2flow/ruby.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:07.340429 | import json
import subprocess
from .model import (Group, Node, Call, Variable, BaseLanguage,
OWNER_CONST, GROUP_TYPE, is_installed, flatten)
def resolve_owner(owner_el):
"""
Resolve who owns the call, if anyone.
So if the expression is i_ate.pie(). And i_ate is a Person, the callee is... |
scottrogowski/code2flow | https://github.com/scottrogowski/code2flow | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | code2flow/javascript.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:07.350780 | import logging
import os
import json
import subprocess
from .model import (Group, Node, Call, Variable, BaseLanguage,
OWNER_CONST, GROUP_TYPE, is_installed, djoin, flatten)
def lineno(el):
"""
Get the first line number of ast element
:param ast el:
:rtype: int
"""
if isin... |
scottrogowski/code2flow | https://github.com/scottrogowski/code2flow | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | code2flow/model.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:07.352094 | import abc
import os
TRUNK_COLOR = '#966F33'
LEAF_COLOR = '#6db33f'
EDGE_COLORS = ["#000000", "#E69F00", "#56B4E9", "#009E73",
"#F0E442", "#0072B2", "#D55E00", "#CC79A7"]
NODE_COLOR = "#cccccc"
class Namespace(dict):
"""
Abstract constants class
Constants can be accessed via .attribute or... |
scottrogowski/code2flow | https://github.com/scottrogowski/code2flow | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | tests/test_code/py/ambiguous_resolution/ambiguous_resolution.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:07.905361 | class Abra():
def magic():
pass
def abra_it():
pass
class Cadabra():
def magic():
pass
def cadabra_it(a=None):
a.abra_it()
def main(cls):
obj = cls()
obj.magic()
obj.cadabra_it()
main()
|
scottrogowski/code2flow | https://github.com/scottrogowski/code2flow | null | null | null | null | 4,571 | null | null | mit | null | null | null | null | null | null | null | tests/test_code/py/async_basic/async_basic.py | null | null | null | null | null | null | Python | 2026-05-04T01:58:07.921461 | import asyncio
class A:
def __init__(self):
pass
async def test(self):
print("hello world")
async def main():
a = A()
await a.test()
asyncio.run(main())
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.