repo
stringlengths
7
90
file_url
stringlengths
81
315
file_path
stringlengths
4
228
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 14:38:15
2026-01-05 02:33:18
truncated
bool
2 classes
public-apis/public-apis
https://github.com/public-apis/public-apis/blob/a58c76cd32ef345da3e4b7252c7b47275e866ae7/scripts/tests/__init__.py
scripts/tests/__init__.py
# -*- coding: utf-8 -*-
python
MIT
a58c76cd32ef345da3e4b7252c7b47275e866ae7
2026-01-04T14:38:15.124778Z
false
public-apis/public-apis
https://github.com/public-apis/public-apis/blob/a58c76cd32ef345da3e4b7252c7b47275e866ae7/scripts/tests/test_validate_format.py
scripts/tests/test_validate_format.py
# -*- coding: utf-8 -*- import unittest from validate.format import error_message from validate.format import get_categories_content from validate.format import check_alphabetical_order from validate.format import check_title from validate.format import check_description, max_description_length from validate.format i...
python
MIT
a58c76cd32ef345da3e4b7252c7b47275e866ae7
2026-01-04T14:38:15.124778Z
false
public-apis/public-apis
https://github.com/public-apis/public-apis/blob/a58c76cd32ef345da3e4b7252c7b47275e866ae7/scripts/tests/test_validate_links.py
scripts/tests/test_validate_links.py
# -*- coding: utf-8 -*- import unittest from validate.links import find_links_in_text from validate.links import check_duplicate_links from validate.links import fake_user_agent from validate.links import get_host_from_link from validate.links import has_cloudflare_protection class FakeResponse(): def __init__(...
python
MIT
a58c76cd32ef345da3e4b7252c7b47275e866ae7
2026-01-04T14:38:15.124778Z
false
public-apis/public-apis
https://github.com/public-apis/public-apis/blob/a58c76cd32ef345da3e4b7252c7b47275e866ae7/scripts/validate/format.py
scripts/validate/format.py
# -*- coding: utf-8 -*- import re import sys from string import punctuation from typing import List, Tuple, Dict # Temporary replacement # The descriptions that contain () at the end must adapt to the new policy later punctuation = punctuation.replace('()', '') anchor = '###' auth_keys = ['apiKey', 'OAuth', 'X-Masha...
python
MIT
a58c76cd32ef345da3e4b7252c7b47275e866ae7
2026-01-04T14:38:15.124778Z
false
public-apis/public-apis
https://github.com/public-apis/public-apis/blob/a58c76cd32ef345da3e4b7252c7b47275e866ae7/scripts/validate/links.py
scripts/validate/links.py
# -*- coding: utf-8 -*- import re import sys import random from typing import List, Tuple import requests from requests.models import Response def find_links_in_text(text: str) -> List[str]: """Find links in a text and return a list of URLs.""" link_pattern = re.compile(r'((?:https?://|www\d{0,3}[.]|[a-z0-...
python
MIT
a58c76cd32ef345da3e4b7252c7b47275e866ae7
2026-01-04T14:38:15.124778Z
false
public-apis/public-apis
https://github.com/public-apis/public-apis/blob/a58c76cd32ef345da3e4b7252c7b47275e866ae7/scripts/validate/__init__.py
scripts/validate/__init__.py
# -*- coding: utf-8 -*- from validate import format from validate import links
python
MIT
a58c76cd32ef345da3e4b7252c7b47275e866ae7
2026-01-04T14:38:15.124778Z
false
deepseek-ai/DeepSeek-V3
https://github.com/deepseek-ai/DeepSeek-V3/blob/9b4e9788e4a3a731f7567338ed15d3ec549ce03b/inference/convert.py
inference/convert.py
import os import shutil from argparse import ArgumentParser from glob import glob from tqdm import tqdm, trange import torch from safetensors.torch import safe_open, save_file mapping = { "embed_tokens": ("embed", 0), "input_layernorm": ("attn_norm", None), "post_attention_layernorm": ("ffn_norm", None),...
python
MIT
9b4e9788e4a3a731f7567338ed15d3ec549ce03b
2026-01-04T14:38:15.450976Z
false
deepseek-ai/DeepSeek-V3
https://github.com/deepseek-ai/DeepSeek-V3/blob/9b4e9788e4a3a731f7567338ed15d3ec549ce03b/inference/model.py
inference/model.py
import math from dataclasses import dataclass from typing import Tuple, Optional, Literal import torch from torch import nn import torch.nn.functional as F import torch.distributed as dist from kernel import act_quant, weight_dequant, fp8_gemm world_size = 1 rank = 0 block_size = 128 gemm_impl: Literal["bf16", "fp8...
python
MIT
9b4e9788e4a3a731f7567338ed15d3ec549ce03b
2026-01-04T14:38:15.450976Z
true
deepseek-ai/DeepSeek-V3
https://github.com/deepseek-ai/DeepSeek-V3/blob/9b4e9788e4a3a731f7567338ed15d3ec549ce03b/inference/generate.py
inference/generate.py
import os import json from argparse import ArgumentParser from typing import List import torch import torch.distributed as dist from transformers import AutoTokenizer from safetensors.torch import load_model from model import Transformer, ModelArgs def sample(logits, temperature: float = 1.0): """ Samples a...
python
MIT
9b4e9788e4a3a731f7567338ed15d3ec549ce03b
2026-01-04T14:38:15.450976Z
false
deepseek-ai/DeepSeek-V3
https://github.com/deepseek-ai/DeepSeek-V3/blob/9b4e9788e4a3a731f7567338ed15d3ec549ce03b/inference/kernel.py
inference/kernel.py
from typing import Tuple, Optional import torch import triton import triton.language as tl from triton import Config @triton.jit def act_quant_kernel(x_ptr, y_ptr, s_ptr, BLOCK_SIZE: tl.constexpr, scale_fmt: tl.constexpr): """ Quantizes the input tensor `x_ptr` and stores the result in `y_ptr` and the scalin...
python
MIT
9b4e9788e4a3a731f7567338ed15d3ec549ce03b
2026-01-04T14:38:15.450976Z
false
deepseek-ai/DeepSeek-V3
https://github.com/deepseek-ai/DeepSeek-V3/blob/9b4e9788e4a3a731f7567338ed15d3ec549ce03b/inference/fp8_cast_bf16.py
inference/fp8_cast_bf16.py
import os import json from argparse import ArgumentParser from glob import glob from tqdm import tqdm import torch from safetensors.torch import load_file, save_file from kernel import weight_dequant def main(fp8_path, bf16_path): """ Converts FP8 weights to BF16 and saves the converted weights. This fu...
python
MIT
9b4e9788e4a3a731f7567338ed15d3ec549ce03b
2026-01-04T14:38:15.450976Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown-mcp/src/markitdown_mcp/__main__.py
packages/markitdown-mcp/src/markitdown_mcp/__main__.py
import contextlib import sys import os from collections.abc import AsyncIterator from mcp.server.fastmcp import FastMCP from starlette.applications import Starlette from mcp.server.sse import SseServerTransport from starlette.requests import Request from starlette.routing import Mount, Route from starlette.types import...
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown-mcp/src/markitdown_mcp/__about__.py
packages/markitdown-mcp/src/markitdown_mcp/__about__.py
# SPDX-FileCopyrightText: 2024-present Adam Fourney <adamfo@microsoft.com> # # SPDX-License-Identifier: MIT __version__ = "0.0.1a4"
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown-mcp/src/markitdown_mcp/__init__.py
packages/markitdown-mcp/src/markitdown_mcp/__init__.py
# SPDX-FileCopyrightText: 2024-present Adam Fourney <adamfo@microsoft.com> # # SPDX-License-Identifier: MIT from .__about__ import __version__ __all__ = [ "__version__", ]
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown-mcp/tests/__init__.py
packages/markitdown-mcp/tests/__init__.py
# SPDX-FileCopyrightText: 2024-present Adam Fourney <adamfo@microsoft.com> # # SPDX-License-Identifier: MIT
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/src/markitdown/_exceptions.py
packages/markitdown/src/markitdown/_exceptions.py
from typing import Optional, List, Any MISSING_DEPENDENCY_MESSAGE = """{converter} recognized the input as a potential {extension} file, but the dependencies needed to read {extension} files have not been installed. To resolve this error, include the optional dependency [{feature}] or [all] when installing MarkItDown....
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/src/markitdown/_uri_utils.py
packages/markitdown/src/markitdown/_uri_utils.py
import base64 import os from typing import Tuple, Dict from urllib.request import url2pathname from urllib.parse import urlparse, unquote_to_bytes def file_uri_to_path(file_uri: str) -> Tuple[str | None, str]: """Convert a file URI to a local file path""" parsed = urlparse(file_uri) if parsed.scheme != "f...
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/src/markitdown/__main__.py
packages/markitdown/src/markitdown/__main__.py
# SPDX-FileCopyrightText: 2024-present Adam Fourney <adamfo@microsoft.com> # # SPDX-License-Identifier: MIT import argparse import sys import codecs from textwrap import dedent from importlib.metadata import entry_points from .__about__ import __version__ from ._markitdown import MarkItDown, StreamInfo, DocumentConvert...
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/src/markitdown/_stream_info.py
packages/markitdown/src/markitdown/_stream_info.py
from dataclasses import dataclass, asdict from typing import Optional @dataclass(kw_only=True, frozen=True) class StreamInfo: """The StreamInfo class is used to store information about a file stream. All fields can be None, and will depend on how the stream was opened. """ mimetype: Optional[str] = N...
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/src/markitdown/__about__.py
packages/markitdown/src/markitdown/__about__.py
# SPDX-FileCopyrightText: 2024-present Adam Fourney <adamfo@microsoft.com> # # SPDX-License-Identifier: MIT __version__ = "0.1.4"
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/src/markitdown/_markitdown.py
packages/markitdown/src/markitdown/_markitdown.py
import mimetypes import os import re import sys import shutil import traceback import io from dataclasses import dataclass from importlib.metadata import entry_points from typing import Any, List, Dict, Optional, Union, BinaryIO from pathlib import Path from urllib.parse import urlparse from warnings import warn import...
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/src/markitdown/__init__.py
packages/markitdown/src/markitdown/__init__.py
# SPDX-FileCopyrightText: 2024-present Adam Fourney <adamfo@microsoft.com> # # SPDX-License-Identifier: MIT from .__about__ import __version__ from ._markitdown import ( MarkItDown, PRIORITY_SPECIFIC_FILE_FORMAT, PRIORITY_GENERIC_FILE_FORMAT, ) from ._base_converter import DocumentConverterResult, Document...
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/src/markitdown/_base_converter.py
packages/markitdown/src/markitdown/_base_converter.py
from typing import Any, BinaryIO, Optional from ._stream_info import StreamInfo class DocumentConverterResult: """The result of converting a document to Markdown.""" def __init__( self, markdown: str, *, title: Optional[str] = None, ): """ Initialize the Do...
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/src/markitdown/converters/_bing_serp_converter.py
packages/markitdown/src/markitdown/converters/_bing_serp_converter.py
import re import base64 import binascii from urllib.parse import parse_qs, urlparse from typing import Any, BinaryIO from bs4 import BeautifulSoup from .._base_converter import DocumentConverter, DocumentConverterResult from .._stream_info import StreamInfo from ._markdownify import _CustomMarkdownify ACCEPTED_MIME_T...
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/src/markitdown/converters/_llm_caption.py
packages/markitdown/src/markitdown/converters/_llm_caption.py
from typing import BinaryIO, Union import base64 import mimetypes from .._stream_info import StreamInfo def llm_caption( file_stream: BinaryIO, stream_info: StreamInfo, *, client, model, prompt=None ) -> Union[None, str]: if prompt is None or prompt.strip() == "": prompt = "Write a detailed caption fo...
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/src/markitdown/converters/_wikipedia_converter.py
packages/markitdown/src/markitdown/converters/_wikipedia_converter.py
import re import bs4 from typing import Any, BinaryIO from .._base_converter import DocumentConverter, DocumentConverterResult from .._stream_info import StreamInfo from ._markdownify import _CustomMarkdownify ACCEPTED_MIME_TYPE_PREFIXES = [ "text/html", "application/xhtml", ] ACCEPTED_FILE_EXTENSIONS = [ ...
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/src/markitdown/converters/_plain_text_converter.py
packages/markitdown/src/markitdown/converters/_plain_text_converter.py
import sys from typing import BinaryIO, Any from charset_normalizer import from_bytes from .._base_converter import DocumentConverter, DocumentConverterResult from .._stream_info import StreamInfo # Try loading optional (but in this case, required) dependencies # Save reporting of any exceptions for later _dependency...
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/src/markitdown/converters/_transcribe_audio.py
packages/markitdown/src/markitdown/converters/_transcribe_audio.py
import io import sys from typing import BinaryIO from .._exceptions import MissingDependencyException # Try loading optional (but in this case, required) dependencies # Save reporting of any exceptions for later _dependency_exc_info = None try: # Suppress some warnings on library import import warnings wi...
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/src/markitdown/converters/_epub_converter.py
packages/markitdown/src/markitdown/converters/_epub_converter.py
import os import zipfile from defusedxml import minidom from xml.dom.minidom import Document from typing import BinaryIO, Any, Dict, List from ._html_converter import HtmlConverter from .._base_converter import DocumentConverterResult from .._stream_info import StreamInfo ACCEPTED_MIME_TYPE_PREFIXES = [ "applica...
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/src/markitdown/converters/_csv_converter.py
packages/markitdown/src/markitdown/converters/_csv_converter.py
import csv import io from typing import BinaryIO, Any from charset_normalizer import from_bytes from .._base_converter import DocumentConverter, DocumentConverterResult from .._stream_info import StreamInfo ACCEPTED_MIME_TYPE_PREFIXES = [ "text/csv", "application/csv", ] ACCEPTED_FILE_EXTENSIONS = [".csv"] c...
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/src/markitdown/converters/_html_converter.py
packages/markitdown/src/markitdown/converters/_html_converter.py
import io from typing import Any, BinaryIO, Optional from bs4 import BeautifulSoup from .._base_converter import DocumentConverter, DocumentConverterResult from .._stream_info import StreamInfo from ._markdownify import _CustomMarkdownify ACCEPTED_MIME_TYPE_PREFIXES = [ "text/html", "application/xhtml", ] AC...
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/src/markitdown/converters/_pdf_converter.py
packages/markitdown/src/markitdown/converters/_pdf_converter.py
import sys import io from typing import BinaryIO, Any from .._base_converter import DocumentConverter, DocumentConverterResult from .._stream_info import StreamInfo from .._exceptions import MissingDependencyException, MISSING_DEPENDENCY_MESSAGE # Try loading optional (but in this case, required) dependencies # Sa...
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/src/markitdown/converters/_ipynb_converter.py
packages/markitdown/src/markitdown/converters/_ipynb_converter.py
from typing import BinaryIO, Any import json from .._base_converter import DocumentConverter, DocumentConverterResult from .._exceptions import FileConversionException from .._stream_info import StreamInfo CANDIDATE_MIME_TYPE_PREFIXES = [ "application/json", ] ACCEPTED_FILE_EXTENSIONS = [".ipynb"] class IpynbC...
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/src/markitdown/converters/_rss_converter.py
packages/markitdown/src/markitdown/converters/_rss_converter.py
from defusedxml import minidom from xml.dom.minidom import Document, Element from typing import BinaryIO, Any, Union from bs4 import BeautifulSoup from ._markdownify import _CustomMarkdownify from .._stream_info import StreamInfo from .._base_converter import DocumentConverter, DocumentConverterResult PRECISE_MIME_TY...
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/src/markitdown/converters/_exiftool.py
packages/markitdown/src/markitdown/converters/_exiftool.py
import json import locale import subprocess from typing import Any, BinaryIO, Union def _parse_version(version: str) -> tuple: return tuple(map(int, (version.split(".")))) def exiftool_metadata( file_stream: BinaryIO, *, exiftool_path: Union[str, None], ) -> Any: # Need a better type for json data ...
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/src/markitdown/converters/_xlsx_converter.py
packages/markitdown/src/markitdown/converters/_xlsx_converter.py
import sys from typing import BinaryIO, Any from ._html_converter import HtmlConverter from .._base_converter import DocumentConverter, DocumentConverterResult from .._exceptions import MissingDependencyException, MISSING_DEPENDENCY_MESSAGE from .._stream_info import StreamInfo # Try loading optional (but in this case...
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/src/markitdown/converters/_youtube_converter.py
packages/markitdown/src/markitdown/converters/_youtube_converter.py
import json import time import re import bs4 from typing import Any, BinaryIO, Dict, List, Union from urllib.parse import parse_qs, urlparse, unquote from .._base_converter import DocumentConverter, DocumentConverterResult from .._stream_info import StreamInfo # Optional YouTube transcription support try: # Suppr...
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/src/markitdown/converters/_outlook_msg_converter.py
packages/markitdown/src/markitdown/converters/_outlook_msg_converter.py
import sys from typing import Any, Union, BinaryIO from .._stream_info import StreamInfo from .._base_converter import DocumentConverter, DocumentConverterResult from .._exceptions import MissingDependencyException, MISSING_DEPENDENCY_MESSAGE # Try loading optional (but in this case, required) dependencies # Save repo...
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/src/markitdown/converters/_pptx_converter.py
packages/markitdown/src/markitdown/converters/_pptx_converter.py
import sys import base64 import os import io import re import html from typing import BinaryIO, Any from operator import attrgetter from ._html_converter import HtmlConverter from ._llm_caption import llm_caption from .._base_converter import DocumentConverter, DocumentConverterResult from .._stream_info import Strea...
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/src/markitdown/converters/__init__.py
packages/markitdown/src/markitdown/converters/__init__.py
# SPDX-FileCopyrightText: 2024-present Adam Fourney <adamfo@microsoft.com> # # SPDX-License-Identifier: MIT from ._plain_text_converter import PlainTextConverter from ._html_converter import HtmlConverter from ._rss_converter import RssConverter from ._wikipedia_converter import WikipediaConverter from ._youtube_conve...
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/src/markitdown/converters/_audio_converter.py
packages/markitdown/src/markitdown/converters/_audio_converter.py
from typing import Any, BinaryIO from ._exiftool import exiftool_metadata from ._transcribe_audio import transcribe_audio from .._base_converter import DocumentConverter, DocumentConverterResult from .._stream_info import StreamInfo from .._exceptions import MissingDependencyException ACCEPTED_MIME_TYPE_PREFIXES = [ ...
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/src/markitdown/converters/_image_converter.py
packages/markitdown/src/markitdown/converters/_image_converter.py
from typing import BinaryIO, Any, Union import base64 import mimetypes from ._exiftool import exiftool_metadata from .._base_converter import DocumentConverter, DocumentConverterResult from .._stream_info import StreamInfo ACCEPTED_MIME_TYPE_PREFIXES = [ "image/jpeg", "image/png", ] ACCEPTED_FILE_EXTENSIONS =...
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/src/markitdown/converters/_doc_intel_converter.py
packages/markitdown/src/markitdown/converters/_doc_intel_converter.py
import sys import re import os from typing import BinaryIO, Any, List from enum import Enum from .._base_converter import DocumentConverter, DocumentConverterResult from .._stream_info import StreamInfo from .._exceptions import MissingDependencyException # Try loading optional (but in this case, required) dependenci...
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/src/markitdown/converters/_docx_converter.py
packages/markitdown/src/markitdown/converters/_docx_converter.py
import sys import io from warnings import warn from typing import BinaryIO, Any from ._html_converter import HtmlConverter from ..converter_utils.docx.pre_process import pre_process_docx from .._base_converter import DocumentConverterResult from .._stream_info import StreamInfo from .._exceptions import MissingDepend...
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/src/markitdown/converters/_markdownify.py
packages/markitdown/src/markitdown/converters/_markdownify.py
import re import markdownify from typing import Any, Optional from urllib.parse import quote, unquote, urlparse, urlunparse class _CustomMarkdownify(markdownify.MarkdownConverter): """ A custom version of markdownify's MarkdownConverter. Changes include: - Altering the default heading style to use '#', ...
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/src/markitdown/converters/_zip_converter.py
packages/markitdown/src/markitdown/converters/_zip_converter.py
import zipfile import io import os from typing import BinaryIO, Any, TYPE_CHECKING from .._base_converter import DocumentConverter, DocumentConverterResult from .._stream_info import StreamInfo from .._exceptions import UnsupportedFormatException, FileConversionException # Break otherwise circular import for type hi...
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/src/markitdown/converter_utils/__init__.py
packages/markitdown/src/markitdown/converter_utils/__init__.py
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/src/markitdown/converter_utils/docx/pre_process.py
packages/markitdown/src/markitdown/converter_utils/docx/pre_process.py
import zipfile from io import BytesIO from typing import BinaryIO from xml.etree import ElementTree as ET from bs4 import BeautifulSoup, Tag from .math.omml import OMML_NS, oMath2Latex MATH_ROOT_TEMPLATE = "".join( ( "<w:document ", 'xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordpr...
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/src/markitdown/converter_utils/docx/__init__.py
packages/markitdown/src/markitdown/converter_utils/docx/__init__.py
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/src/markitdown/converter_utils/docx/math/omml.py
packages/markitdown/src/markitdown/converter_utils/docx/math/omml.py
# -*- coding: utf-8 -*- """ Office Math Markup Language (OMML) Adapted from https://github.com/xiilei/dwml/blob/master/dwml/omml.py On 25/03/2025 """ from defusedxml import ElementTree as ET from .latex_dict import ( CHARS, CHR, CHR_BO, CHR_DEFAULT, POS, POS_DEFAULT, SUB, SUP, F, ...
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/src/markitdown/converter_utils/docx/math/latex_dict.py
packages/markitdown/src/markitdown/converter_utils/docx/math/latex_dict.py
# -*- coding: utf-8 -*- """ Adapted from https://github.com/xiilei/dwml/blob/master/dwml/latex_dict.py On 25/03/2025 """ from __future__ import unicode_literals CHARS = ("{", "}", "_", "^", "#", "&", "$", "%", "~") BLANK = "" BACKSLASH = "\\" ALN = "&" CHR = { # Unicode : Latex Math Symbols # Top accents ...
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/src/markitdown/converter_utils/docx/math/__init__.py
packages/markitdown/src/markitdown/converter_utils/docx/math/__init__.py
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/tests/_test_vectors.py
packages/markitdown/tests/_test_vectors.py
import dataclasses from typing import List @dataclasses.dataclass(frozen=True, kw_only=True) class FileTestVector(object): filename: str mimetype: str | None charset: str | None url: str | None must_include: List[str] must_not_include: List[str] GENERAL_TEST_VECTORS = [ FileTestVector( ...
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/tests/test_docintel_html.py
packages/markitdown/tests/test_docintel_html.py
import io from markitdown.converters._doc_intel_converter import ( DocumentIntelligenceConverter, DocumentIntelligenceFileType, ) from markitdown._stream_info import StreamInfo def _make_converter(file_types): conv = DocumentIntelligenceConverter.__new__(DocumentIntelligenceConverter) conv._file_types...
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/tests/test_cli_vectors.py
packages/markitdown/tests/test_cli_vectors.py
#!/usr/bin/env python3 -m pytest import os import time import pytest import subprocess import locale from typing import List if __name__ == "__main__": from _test_vectors import ( GENERAL_TEST_VECTORS, DATA_URI_TEST_VECTORS, FileTestVector, ) else: from ._test_vectors import ( ...
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/tests/test_cli_misc.py
packages/markitdown/tests/test_cli_misc.py
#!/usr/bin/env python3 -m pytest import subprocess from markitdown import __version__ # This file contains CLI tests that are not directly tested by the FileTestVectors. # This includes things like help messages, version numbers, and invalid flags. def test_version() -> None: result = subprocess.run( ["p...
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/tests/__init__.py
packages/markitdown/tests/__init__.py
# SPDX-FileCopyrightText: 2024-present Adam Fourney <adamfo@microsoft.com> # # SPDX-License-Identifier: MIT
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/tests/test_module_vectors.py
packages/markitdown/tests/test_module_vectors.py
#!/usr/bin/env python3 -m pytest import os import time import pytest import base64 from pathlib import Path if __name__ == "__main__": from _test_vectors import GENERAL_TEST_VECTORS, DATA_URI_TEST_VECTORS else: from ._test_vectors import GENERAL_TEST_VECTORS, DATA_URI_TEST_VECTORS from markitdown import ( ...
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown/tests/test_module_misc.py
packages/markitdown/tests/test_module_misc.py
#!/usr/bin/env python3 -m pytest import io import os import re import shutil import pytest from unittest.mock import MagicMock from markitdown._uri_utils import parse_data_uri, file_uri_to_path from markitdown import ( MarkItDown, UnsupportedFormatException, FileConversionException, StreamInfo, ) # T...
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown-sample-plugin/src/markitdown_sample_plugin/_plugin.py
packages/markitdown-sample-plugin/src/markitdown_sample_plugin/_plugin.py
import locale from typing import BinaryIO, Any from striprtf.striprtf import rtf_to_text from markitdown import ( MarkItDown, DocumentConverter, DocumentConverterResult, StreamInfo, ) __plugin_interface_version__ = ( 1 # The version of the plugin interface that this plugin uses ) ACCEPTED_MIME_...
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown-sample-plugin/src/markitdown_sample_plugin/__about__.py
packages/markitdown-sample-plugin/src/markitdown_sample_plugin/__about__.py
# SPDX-FileCopyrightText: 2024-present Adam Fourney <adamfo@microsoft.com> # # SPDX-License-Identifier: MIT __version__ = "0.1.0a1"
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown-sample-plugin/src/markitdown_sample_plugin/__init__.py
packages/markitdown-sample-plugin/src/markitdown_sample_plugin/__init__.py
# SPDX-FileCopyrightText: 2024-present Adam Fourney <adamfo@microsoft.com> # # SPDX-License-Identifier: MIT from ._plugin import __plugin_interface_version__, register_converters, RtfConverter from .__about__ import __version__ __all__ = [ "__version__", "__plugin_interface_version__", "register_converter...
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown-sample-plugin/tests/__init__.py
packages/markitdown-sample-plugin/tests/__init__.py
# SPDX-FileCopyrightText: 2024-present Adam Fourney <adamfo@microsoft.com> # # SPDX-License-Identifier: MIT
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
microsoft/markitdown
https://github.com/microsoft/markitdown/blob/dde250a456d178fe344fce17ef10d00fe929f680/packages/markitdown-sample-plugin/tests/test_sample_plugin.py
packages/markitdown-sample-plugin/tests/test_sample_plugin.py
#!/usr/bin/env python3 -m pytest import os from markitdown import MarkItDown, StreamInfo from markitdown_sample_plugin import RtfConverter TEST_FILES_DIR = os.path.join(os.path.dirname(__file__), "test_files") RTF_TEST_STRINGS = { "This is a Sample RTF File", "It is included to test if the MarkItDown sample ...
python
MIT
dde250a456d178fe344fce17ef10d00fe929f680
2026-01-04T14:38:15.496810Z
false
nvbn/thefuck
https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/fastentrypoints.py
fastentrypoints.py
# Copyright (c) 2016, Aaron Christianson # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of condition...
python
MIT
c7e7e1d884d3bb241ea6448f72a989434c2a35ec
2026-01-04T14:38:15.457096Z
false
nvbn/thefuck
https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/setup.py
setup.py
#!/usr/bin/env python from setuptools import setup, find_packages import pkg_resources import sys import os import fastentrypoints try: if int(pkg_resources.get_distribution("pip").version.split('.')[0]) < 6: print('pip older than 6.0 not supported, please upgrade pip with:\n\n' ' pip ins...
python
MIT
c7e7e1d884d3bb241ea6448f72a989434c2a35ec
2026-01-04T14:38:15.457096Z
false
nvbn/thefuck
https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/release.py
release.py
#!/usr/bin/env python from subprocess import call import os import re version = None def get_new_setup_py_lines(): global version with open('setup.py', 'r') as sf: current_setup = sf.readlines() for line in current_setup: if line.startswith('VERSION = '): major, minor = re.fi...
python
MIT
c7e7e1d884d3bb241ea6448f72a989434c2a35ec
2026-01-04T14:38:15.457096Z
false
nvbn/thefuck
https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/test_ui.py
tests/test_ui.py
# -*- encoding: utf-8 -*- import pytest from itertools import islice from thefuck import ui from thefuck.types import CorrectedCommand from thefuck import const @pytest.fixture def patch_get_key(monkeypatch): def patch(vals): vals = iter(vals) monkeypatch.setattr('thefuck.ui.get_key', lambda: nex...
python
MIT
c7e7e1d884d3bb241ea6448f72a989434c2a35ec
2026-01-04T14:38:15.457096Z
false
nvbn/thefuck
https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/test_readme.py
tests/test_readme.py
def test_readme(source_root): with source_root.joinpath('README.md').open() as f: readme = f.read() bundled = source_root.joinpath('thefuck') \ .joinpath('rules') \ .glob('*.py') for rule in bundled: if rule.stem != '__i...
python
MIT
c7e7e1d884d3bb241ea6448f72a989434c2a35ec
2026-01-04T14:38:15.457096Z
false
nvbn/thefuck
https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/test_utils.py
tests/test_utils.py
# -*- coding: utf-8 -*- import pytest import warnings from mock import Mock, call, patch from thefuck.utils import default_settings, \ memoize, get_closest, get_all_executables, replace_argument, \ get_all_matched_commands, is_app, for_app, cache, \ get_valid_history_without_current, _cache, get_close_matc...
python
MIT
c7e7e1d884d3bb241ea6448f72a989434c2a35ec
2026-01-04T14:38:15.457096Z
false
nvbn/thefuck
https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/test_argument_parser.py
tests/test_argument_parser.py
import pytest from thefuck.argument_parser import Parser from thefuck.const import ARGUMENT_PLACEHOLDER def _args(**override): args = {'alias': None, 'command': [], 'yes': False, 'help': False, 'version': False, 'debug': False, 'force_command': None, 'repeat': False, 'enable_ex...
python
MIT
c7e7e1d884d3bb241ea6448f72a989434c2a35ec
2026-01-04T14:38:15.457096Z
false
nvbn/thefuck
https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/test_types.py
tests/test_types.py
# -*- coding: utf-8 -*- import os from subprocess import PIPE, STDOUT from mock import Mock import pytest from tests.utils import CorrectedCommand, Rule from thefuck import const from thefuck.exceptions import EmptyCommand from thefuck.system import Path from thefuck.types import Command class TestCorrectedCommand(o...
python
MIT
c7e7e1d884d3bb241ea6448f72a989434c2a35ec
2026-01-04T14:38:15.457096Z
false
nvbn/thefuck
https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/conftest.py
tests/conftest.py
import os import pytest from thefuck import shells from thefuck import conf, const from thefuck.system import Path shells.shell = shells.Generic() def pytest_configure(config): config.addinivalue_line("markers", "functional: mark test as functional") def pytest_addoption(parser): """Adds `--enable-function...
python
MIT
c7e7e1d884d3bb241ea6448f72a989434c2a35ec
2026-01-04T14:38:15.457096Z
false
nvbn/thefuck
https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/utils.py
tests/utils.py
from thefuck import types from thefuck.const import DEFAULT_PRIORITY class Rule(types.Rule): def __init__(self, name='', match=lambda *_: True, get_new_command=lambda *_: '', enabled_by_default=True, side_effect=None, priority=DEFAULT_PRIORITY, ...
python
MIT
c7e7e1d884d3bb241ea6448f72a989434c2a35ec
2026-01-04T14:38:15.457096Z
false
nvbn/thefuck
https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/test_conf.py
tests/test_conf.py
import pytest import six import os from mock import Mock from thefuck import const @pytest.fixture def load_source(mocker): return mocker.patch('thefuck.conf.load_source') def test_settings_defaults(load_source, settings): load_source.return_value = object() settings.init() for key, val in const.DEF...
python
MIT
c7e7e1d884d3bb241ea6448f72a989434c2a35ec
2026-01-04T14:38:15.457096Z
false
nvbn/thefuck
https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/test_corrector.py
tests/test_corrector.py
# -*- coding: utf-8 -*- import pytest from tests.utils import Rule, CorrectedCommand from thefuck import corrector, const from thefuck.system import Path from thefuck.types import Command from thefuck.corrector import get_corrected_commands, organize_commands @pytest.fixture def glob(mocker): results = {} mo...
python
MIT
c7e7e1d884d3bb241ea6448f72a989434c2a35ec
2026-01-04T14:38:15.457096Z
false
nvbn/thefuck
https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/__init__.py
tests/__init__.py
python
MIT
c7e7e1d884d3bb241ea6448f72a989434c2a35ec
2026-01-04T14:38:15.457096Z
false
nvbn/thefuck
https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/test_logs.py
tests/test_logs.py
import pytest from thefuck import logs def test_color(settings): settings.no_colors = False assert logs.color('red') == 'red' settings.no_colors = True assert logs.color('red') == '' @pytest.mark.usefixtures('no_colors') @pytest.mark.parametrize('debug, stderr', [ (True, 'DEBUG: test\n'), (F...
python
MIT
c7e7e1d884d3bb241ea6448f72a989434c2a35ec
2026-01-04T14:38:15.457096Z
false
nvbn/thefuck
https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/entrypoints/test_alias.py
tests/entrypoints/test_alias.py
from mock import Mock import pytest from thefuck.entrypoints.alias import _get_alias, print_alias @pytest.mark.parametrize( 'py2, enable_experimental_instant_mode, which, is_instant', [ (False, True, True, True), (False, False, True, False), (False, True, False, False), (True, True...
python
MIT
c7e7e1d884d3bb241ea6448f72a989434c2a35ec
2026-01-04T14:38:15.457096Z
false
nvbn/thefuck
https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/entrypoints/test_not_configured.py
tests/entrypoints/test_not_configured.py
import pytest import json from six import StringIO from mock import MagicMock from thefuck.shells.generic import ShellConfiguration from thefuck.entrypoints.not_configured import main @pytest.fixture(autouse=True) def usage_tracker(mocker): return mocker.patch( 'thefuck.entrypoints.not_configured._get_not...
python
MIT
c7e7e1d884d3bb241ea6448f72a989434c2a35ec
2026-01-04T14:38:15.457096Z
false
nvbn/thefuck
https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/entrypoints/__init__.py
tests/entrypoints/__init__.py
python
MIT
c7e7e1d884d3bb241ea6448f72a989434c2a35ec
2026-01-04T14:38:15.457096Z
false
nvbn/thefuck
https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/entrypoints/test_fix_command.py
tests/entrypoints/test_fix_command.py
import pytest from mock import Mock from thefuck.entrypoints.fix_command import _get_raw_command class TestGetRawCommand(object): def test_from_force_command_argument(self): known_args = Mock(force_command='git brunch') assert _get_raw_command(known_args) == ['git brunch'] def test_from_comma...
python
MIT
c7e7e1d884d3bb241ea6448f72a989434c2a35ec
2026-01-04T14:38:15.457096Z
false
nvbn/thefuck
https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_workon_doesnt_exists.py
tests/rules/test_workon_doesnt_exists.py
import pytest from thefuck.rules.workon_doesnt_exists import match, get_new_command from thefuck.types import Command @pytest.fixture(autouse=True) def envs(mocker): return mocker.patch( 'thefuck.rules.workon_doesnt_exists._get_all_environments', return_value=['thefuck', 'code_view']) @pytest.ma...
python
MIT
c7e7e1d884d3bb241ea6448f72a989434c2a35ec
2026-01-04T14:38:15.457096Z
false
nvbn/thefuck
https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_go_run.py
tests/rules/test_go_run.py
import pytest from thefuck.rules.go_run import match, get_new_command from thefuck.types import Command @pytest.mark.parametrize('command', [ Command('go run foo', ''), Command('go run bar', '')]) def test_match(command): assert match(command) @pytest.mark.parametrize('command, new_command', [ (Comm...
python
MIT
c7e7e1d884d3bb241ea6448f72a989434c2a35ec
2026-01-04T14:38:15.457096Z
false
nvbn/thefuck
https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_dry.py
tests/rules/test_dry.py
import pytest from thefuck.rules.dry import match, get_new_command from thefuck.types import Command @pytest.mark.parametrize('command', [ Command('cd cd foo', ''), Command('git git push origin/master', '')]) def test_match(command): assert match(command) @pytest.mark.parametrize('command, new_command',...
python
MIT
c7e7e1d884d3bb241ea6448f72a989434c2a35ec
2026-01-04T14:38:15.457096Z
false
nvbn/thefuck
https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_ls_lah.py
tests/rules/test_ls_lah.py
from thefuck.rules.ls_lah import match, get_new_command from thefuck.types import Command def test_match(): assert match(Command('ls', '')) assert match(Command('ls file.py', '')) assert match(Command('ls /opt', '')) assert not match(Command('ls -lah /opt', '')) assert not match(Command('pacman -S...
python
MIT
c7e7e1d884d3bb241ea6448f72a989434c2a35ec
2026-01-04T14:38:15.457096Z
false
nvbn/thefuck
https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_yarn_command_not_found.py
tests/rules/test_yarn_command_not_found.py
# -*- encoding: utf-8 -*- from io import BytesIO import pytest from thefuck.types import Command from thefuck.rules.yarn_command_not_found import match, get_new_command output = ''' error Command "{}" not found. '''.format yarn_help_stdout = b''' Usage: yarn [command] [flags] Options: -h, --help ...
python
MIT
c7e7e1d884d3bb241ea6448f72a989434c2a35ec
2026-01-04T14:38:15.457096Z
false
nvbn/thefuck
https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_brew_install.py
tests/rules/test_brew_install.py
import pytest from thefuck.rules.brew_install import match, get_new_command, _get_suggestions from thefuck.types import Command @pytest.fixture def brew_no_available_formula_one(): return '''Warning: No available formula with the name "giss". Did you mean gist?''' @pytest.fixture def brew_no_available_formula_t...
python
MIT
c7e7e1d884d3bb241ea6448f72a989434c2a35ec
2026-01-04T14:38:15.457096Z
false
nvbn/thefuck
https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_brew_update_formula.py
tests/rules/test_brew_update_formula.py
import pytest from thefuck.types import Command from thefuck.rules.brew_update_formula import get_new_command, match output = ("Error: This command updates brew itself, and does not take formula" " names.\nUse `brew upgrade thefuck`.") def test_match(): command = Command('brew update thefuck', output)...
python
MIT
c7e7e1d884d3bb241ea6448f72a989434c2a35ec
2026-01-04T14:38:15.457096Z
false
nvbn/thefuck
https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_git_rebase_no_changes.py
tests/rules/test_git_rebase_no_changes.py
import pytest from thefuck.rules.git_rebase_no_changes import match, get_new_command from thefuck.types import Command @pytest.fixture def output(): return '''Applying: Test commit No changes - did you forget to use 'git add'? If there is nothing left to stage, chances are that something else already introduced t...
python
MIT
c7e7e1d884d3bb241ea6448f72a989434c2a35ec
2026-01-04T14:38:15.457096Z
false
nvbn/thefuck
https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_rm_root.py
tests/rules/test_rm_root.py
import pytest from thefuck.rules.rm_root import match, get_new_command from thefuck.types import Command def test_match(): assert match(Command('rm -rf /', 'add --no-preserve-root')) @pytest.mark.parametrize('command', [ Command('ls', 'add --no-preserve-root'), Command('rm --no-preserve-root /', 'add --...
python
MIT
c7e7e1d884d3bb241ea6448f72a989434c2a35ec
2026-01-04T14:38:15.457096Z
false
nvbn/thefuck
https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_aws_cli.py
tests/rules/test_aws_cli.py
import pytest from thefuck.rules.aws_cli import match, get_new_command from thefuck.types import Command no_suggestions = '''\ usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters] To see help text, you can run: aws help aws <command> help aws <command> <subcommand> help aws: error: argu...
python
MIT
c7e7e1d884d3bb241ea6448f72a989434c2a35ec
2026-01-04T14:38:15.457096Z
false
nvbn/thefuck
https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_fix_file.py
tests/rules/test_fix_file.py
# -*- coding: utf-8 -*- import pytest import os from collections import namedtuple from thefuck.rules.fix_file import match, get_new_command from thefuck.types import Command FixFileTest = namedtuple('FixFileTest', ['script', 'file', 'line', 'col', 'output']) tests = ( FixFileTest('gcc a.c', 'a.c', 3, 1, """ a.c...
python
MIT
c7e7e1d884d3bb241ea6448f72a989434c2a35ec
2026-01-04T14:38:15.457096Z
false
nvbn/thefuck
https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_sed_unterminated_s.py
tests/rules/test_sed_unterminated_s.py
import pytest from thefuck.rules.sed_unterminated_s import match, get_new_command from thefuck.types import Command @pytest.fixture def sed_unterminated_s(): return "sed: -e expression #1, char 9: unterminated `s' command" def test_match(sed_unterminated_s): assert match(Command('sed -e s/foo/bar', sed_unte...
python
MIT
c7e7e1d884d3bb241ea6448f72a989434c2a35ec
2026-01-04T14:38:15.457096Z
false
nvbn/thefuck
https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_cargo_no_command.py
tests/rules/test_cargo_no_command.py
import pytest from thefuck.rules.cargo_no_command import match, get_new_command from thefuck.types import Command no_such_subcommand_old = """No such subcommand Did you mean `build`? """ no_such_subcommand = """error: no such subcommand \tDid you mean `build`? """ @pytest.mark.parametrize('command', [ ...
python
MIT
c7e7e1d884d3bb241ea6448f72a989434c2a35ec
2026-01-04T14:38:15.457096Z
false
nvbn/thefuck
https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_git_add_force.py
tests/rules/test_git_add_force.py
import pytest from thefuck.rules.git_add_force import match, get_new_command from thefuck.types import Command @pytest.fixture def output(): return ('The following paths are ignored by one of your .gitignore files:\n' 'dist/app.js\n' 'dist/background.js\n' 'dist/options.js\n' ...
python
MIT
c7e7e1d884d3bb241ea6448f72a989434c2a35ec
2026-01-04T14:38:15.457096Z
false
nvbn/thefuck
https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_pip_install.py
tests/rules/test_pip_install.py
# -*- coding: UTF-8 -*- from thefuck.rules.pip_install import match, get_new_command from thefuck.types import Command def test_match(): response1 = """ Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/entrypoints.pyc' Consider using the `...
python
MIT
c7e7e1d884d3bb241ea6448f72a989434c2a35ec
2026-01-04T14:38:15.457096Z
false
nvbn/thefuck
https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_npm_wrong_command.py
tests/rules/test_npm_wrong_command.py
import pytest from thefuck.rules.npm_wrong_command import match, get_new_command from thefuck.types import Command output = ''' Usage: npm <command> where <command> is one of: access, add-user, adduser, apihelp, author, bin, bugs, c, cache, completion, config, ddp, dedupe, deprecate, dist-tag, dist-tags, ...
python
MIT
c7e7e1d884d3bb241ea6448f72a989434c2a35ec
2026-01-04T14:38:15.457096Z
false
nvbn/thefuck
https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_git_pull_uncommitted_changes.py
tests/rules/test_git_pull_uncommitted_changes.py
import pytest from thefuck.rules.git_pull_uncommitted_changes import match, get_new_command from thefuck.types import Command @pytest.fixture def output(): return '''error: Cannot pull with rebase: You have unstaged changes.''' def test_match(output): assert match(Command('git pull', output)) assert not...
python
MIT
c7e7e1d884d3bb241ea6448f72a989434c2a35ec
2026-01-04T14:38:15.457096Z
false
nvbn/thefuck
https://github.com/nvbn/thefuck/blob/c7e7e1d884d3bb241ea6448f72a989434c2a35ec/tests/rules/test_npm_run_script.py
tests/rules/test_npm_run_script.py
import pytest from io import BytesIO from thefuck.rules.npm_run_script import match, get_new_command from thefuck.types import Command output = ''' Usage: npm <command> where <command> is one of: access, add-user, adduser, apihelp, author, bin, bugs, c, cache, completion, config, ddp, dedupe, deprecate, dist-...
python
MIT
c7e7e1d884d3bb241ea6448f72a989434c2a35ec
2026-01-04T14:38:15.457096Z
false
Free AI Image Generator No sign-up. Instant results. Open Now