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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
yihong0618/bilingual_book_maker | https://github.com/yihong0618/bilingual_book_maker | null | null | null | null | 9,239 | null | null | mit | null | null | null | null | null | null | null | book_maker/translator/tencent_transmart_translator.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:09.674256 | import re
import time
import uuid
import requests
from rich import print
from .base_translator import Base
class TencentTranSmart(Base):
"""
Tencent TranSmart translator
"""
def __init__(self, key, language, **kwargs) -> None:
super().__init__(key, language)
self.api_url = "https://t... |
yihong0618/bilingual_book_maker | https://github.com/yihong0618/bilingual_book_maker | null | null | null | null | 9,239 | null | null | mit | null | null | null | null | null | null | null | tests/test_pdf_cli.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:09.854519 | import subprocess
import sys
import pytest
fitz = pytest.importorskip("fitz")
def test_pdf_cli_creates_txt_and_optional_epub(tmp_path):
pdf_path = tmp_path / "cli_test.pdf"
doc = fitz.open()
page = doc.new_page()
page.insert_text((72, 72), "CLI test\nPDF content")
doc.save(str(pdf_path))
# ... |
yihong0618/bilingual_book_maker | https://github.com/yihong0618/bilingual_book_maker | null | null | null | null | 9,239 | null | null | mit | null | null | null | null | null | null | null | tests/test_epub_metadata.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:09.890359 | import pytest
from ebooklib import epub
from book_maker.loader.epub_loader import EPUBBookLoader
def test_epub_loader_handles_custom_metadata(tmp_path):
source_book = epub.EpubBook()
source_book.add_metadata("DC", "title", "Metadata Copy Test", {"id": "title-id"})
source_book.add_metadata("DC", "creator"... |
yihong0618/bilingual_book_maker | https://github.com/yihong0618/bilingual_book_maker | null | null | null | null | 9,239 | null | null | mit | null | null | null | null | null | null | null | tests/test_integration.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:09.930283 | import os
import shutil
import subprocess
import sys
from pathlib import Path
import pytest
@pytest.fixture()
def test_book_dir() -> str:
"""Return test book dir"""
# TODO: Can move this to conftest.py if there will be more unittests
return str(Path(__file__).parent.parent / "test_books")
def test_goog... |
yihong0618/bilingual_book_maker | https://github.com/yihong0618/bilingual_book_maker | null | null | null | null | 9,239 | null | null | mit | null | null | null | null | null | null | null | book_maker/utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:09.942129 | import tiktoken
# Borrowed from : https://github.com/openai/whisper
LANGUAGES = {
"en": "english",
"zh-hans": "simplified chinese",
"zh": "simplified chinese",
"zh-hant": "traditional chinese",
"zh-yue": "cantonese",
"de": "german",
"es": "spanish",
"ru": "russian",
"ko": "korean",
... |
yihong0618/bilingual_book_maker | https://github.com/yihong0618/bilingual_book_maker | null | null | null | null | 9,239 | null | null | mit | null | null | null | null | null | null | null | tests/test_pdf_loader.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:10.321367 | import pytest
fitz = pytest.importorskip("fitz")
from book_maker.loader.pdf_loader import PDFBookLoader
class DummyModel:
def __init__(
self,
key,
language,
api_base=None,
temperature=1.0,
source_lang="auto",
**kwargs,
):
pass
def translat... |
yihong0618/bilingual_book_maker | https://github.com/yihong0618/bilingual_book_maker | null | null | null | null | 9,239 | null | null | mit | null | null | null | null | null | null | null | tests/test_provider_loader.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:10.322060 | import json
import os
import pytest
from book_maker.provider_loader import (
_merge_configs,
get_provider,
get_translator_class,
load_provider_config,
validate_provider,
SUPPORTED_API_STYLES,
)
from book_maker.translator.chatgptapi_translator import ChatGPTAPI
from book_maker.translator.claude_... |
yihong0618/bilingual_book_maker | https://github.com/yihong0618/bilingual_book_maker | null | null | null | null | 9,239 | null | null | mit | null | null | null | null | null | null | null | book_maker/translator/custom_api_translator.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:12.694640 | from .base_translator import Base
import re
import json
import requests
import time
from rich import print
class CustomAPI(Base):
"""
Custom API translator
"""
def __init__(self, custom_api, language, **kwargs) -> None:
super().__init__(custom_api, language)
self.language = language
... |
yihong0618/bilingual_book_maker | https://github.com/yihong0618/bilingual_book_maker | null | null | null | null | 9,239 | null | null | mit | null | null | null | null | null | null | null | book_maker/translator/claude_translator.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:12.723913 | import re
from rich import print
from anthropic import Anthropic
from .base_translator import Base
class Claude(Base):
def __init__(
self,
key,
language,
api_base=None,
prompt_template=None,
prompt_sys_msg=None,
temperature=1.0,
context_flag=False,
... |
yihong0618/bilingual_book_maker | https://github.com/yihong0618/bilingual_book_maker | null | null | null | null | 9,239 | null | null | mit | null | null | null | null | null | null | null | book_maker/translator/base_translator.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:12.930959 | import itertools
import re
from abc import ABC, abstractmethod
# Special delimiter for batch translation - UUID-based token unlikely to appear in any text
BATCH_DELIMITER = "\n\n@@\n\n"
class Base(ABC):
# Default values for fatal error handling - subclasses can override
TRANSLATION_ERROR_MARKER = None
d... |
eriklindernoren/Keras-GAN | https://github.com/eriklindernoren/Keras-GAN | null | null | null | null | 9,212 | null | null | mit | null | null | null | null | null | null | null | aae/aae.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:15.345612 | from __future__ import print_function, division
from keras.datasets import mnist
from keras.layers import Input, Dense, Reshape, Flatten, Dropout, multiply, GaussianNoise
from keras.layers import BatchNormalization, Activation, Embedding, ZeroPadding2D
from keras.layers import MaxPooling2D, merge
from keras.laye... |
eriklindernoren/Keras-GAN | https://github.com/eriklindernoren/Keras-GAN | null | null | null | null | 9,212 | null | null | mit | null | null | null | null | null | null | null | bigan/bigan.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:15.354239 | from __future__ import print_function, division
from keras.datasets import mnist
from keras.layers import Input, Dense, Reshape, Flatten, Dropout, multiply, GaussianNoise
from keras.layers import BatchNormalization, Activation, Embedding, ZeroPadding2D
from keras.layers import MaxPooling2D, concatenate
from kera... |
eriklindernoren/Keras-GAN | https://github.com/eriklindernoren/Keras-GAN | null | null | null | null | 9,212 | null | null | mit | null | null | null | null | null | null | null | cogan/cogan.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:15.355767 | from __future__ import print_function, division
import scipy
from keras.datasets import mnist
from keras.layers import Input, Dense, Reshape, Flatten, Dropout
from keras.layers import BatchNormalization, Activation, ZeroPadding2D
from keras.layers.advanced_activations import LeakyReLU
from keras.layers.convolutional i... |
eriklindernoren/Keras-GAN | https://github.com/eriklindernoren/Keras-GAN | null | null | null | null | 9,212 | null | null | mit | null | null | null | null | null | null | null | context_encoder/context_encoder.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:15.360755 | from __future__ import print_function, division
from keras.datasets import cifar10
from keras.layers import Input, Dense, Reshape, Flatten, Dropout, multiply, GaussianNoise
from keras.layers import BatchNormalization, Activation, Embedding, ZeroPadding2D
from keras.layers import MaxPooling2D
from keras.layers.ad... |
eriklindernoren/Keras-GAN | https://github.com/eriklindernoren/Keras-GAN | null | null | null | null | 9,212 | null | null | mit | null | null | null | null | null | null | null | bgan/bgan.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:15.371526 | from __future__ import print_function, division
from keras.datasets import mnist
from keras.layers import Input, Dense, Reshape, Flatten, Dropout
from keras.layers import BatchNormalization, Activation, ZeroPadding2D
from keras.layers.advanced_activations import LeakyReLU
from keras.layers.convolutional import UpSampl... |
eriklindernoren/Keras-GAN | https://github.com/eriklindernoren/Keras-GAN | null | null | null | null | 9,212 | null | null | mit | null | null | null | null | null | null | null | cyclegan/data_loader.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:15.372983 | import scipy
from glob import glob
import numpy as np
class DataLoader():
def __init__(self, dataset_name, img_res=(128, 128)):
self.dataset_name = dataset_name
self.img_res = img_res
def load_data(self, domain, batch_size=1, is_testing=False):
data_type = "train%s" % domain if not is_... |
eriklindernoren/Keras-GAN | https://github.com/eriklindernoren/Keras-GAN | null | null | null | null | 9,212 | null | null | mit | null | null | null | null | null | null | null | ccgan/ccgan.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:15.383229 | from __future__ import print_function, division
from keras.datasets import mnist
from keras_contrib.layers.normalization.instancenormalization import InstanceNormalization
from keras.layers import Input, Dense, Reshape, Flatten, Dropout, multiply, GaussianNoise
from keras.layers import BatchNormalization, Activat... |
eriklindernoren/Keras-GAN | https://github.com/eriklindernoren/Keras-GAN | null | null | null | null | 9,212 | null | null | mit | null | null | null | null | null | null | null | cyclegan/cyclegan.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:15.391629 | from __future__ import print_function, division
import scipy
from keras.datasets import mnist
from keras_contrib.layers.normalization.instancenormalization import InstanceNormalization
from keras.layers import Input, Dense, Reshape, Flatten, Dropout, Concatenate
from keras.layers import BatchNormalization, Activation,... |
eriklindernoren/Keras-GAN | https://github.com/eriklindernoren/Keras-GAN | null | null | null | null | 9,212 | null | null | mit | null | null | null | null | null | null | null | cgan/cgan.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:15.415857 | from __future__ import print_function, division
from keras.datasets import mnist
from keras.layers import Input, Dense, Reshape, Flatten, Dropout, multiply
from keras.layers import BatchNormalization, Activation, Embedding, ZeroPadding2D
from keras.layers.advanced_activations import LeakyReLU
from keras.layers.c... |
eriklindernoren/Keras-GAN | https://github.com/eriklindernoren/Keras-GAN | null | null | null | null | 9,212 | null | null | mit | null | null | null | null | null | null | null | acgan/acgan.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:15.420351 | from __future__ import print_function, division
from keras.datasets import mnist
from keras.layers import Input, Dense, Reshape, Flatten, Dropout, multiply
from keras.layers import BatchNormalization, Activation, Embedding, ZeroPadding2D
from keras.layers.advanced_activations import LeakyReLU
from keras.layers.c... |
eriklindernoren/Keras-GAN | https://github.com/eriklindernoren/Keras-GAN | null | null | null | null | 9,212 | null | null | mit | null | null | null | null | null | null | null | discogan/data_loader.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:15.913751 | import scipy
from glob import glob
import numpy as np
class DataLoader():
def __init__(self, dataset_name, img_res=(128, 128)):
self.dataset_name = dataset_name
self.img_res = img_res
def load_data(self, batch_size=1, is_testing=False):
data_type = "train" if not is_testing else "val"
... |
eriklindernoren/Keras-GAN | https://github.com/eriklindernoren/Keras-GAN | null | null | null | null | 9,212 | null | null | mit | null | null | null | null | null | null | null | dcgan/dcgan.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:15.934542 | from __future__ import print_function, division
from keras.datasets import mnist
from keras.layers import Input, Dense, Reshape, Flatten, Dropout
from keras.layers import BatchNormalization, Activation, ZeroPadding2D
from keras.layers.advanced_activations import LeakyReLU
from keras.layers.convolutional import UpSampl... |
eriklindernoren/Keras-GAN | https://github.com/eriklindernoren/Keras-GAN | null | null | null | null | 9,212 | null | null | mit | null | null | null | null | null | null | null | infogan/infogan.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:15.980696 | from __future__ import print_function, division
from keras.datasets import mnist
from keras.layers import Input, Dense, Reshape, Flatten, Dropout, multiply, concatenate
from keras.layers import BatchNormalization, Activation, Embedding, ZeroPadding2D, Lambda
from keras.layers.advanced_activations import LeakyReLU... |
eriklindernoren/Keras-GAN | https://github.com/eriklindernoren/Keras-GAN | null | null | null | null | 9,212 | null | null | mit | null | null | null | null | null | null | null | pix2pix/data_loader.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:15.991245 | import scipy
from glob import glob
import numpy as np
import matplotlib.pyplot as plt
class DataLoader():
def __init__(self, dataset_name, img_res=(128, 128)):
self.dataset_name = dataset_name
self.img_res = img_res
def load_data(self, batch_size=1, is_testing=False):
data_type = "trai... |
eriklindernoren/Keras-GAN | https://github.com/eriklindernoren/Keras-GAN | null | null | null | null | 9,212 | null | null | mit | null | null | null | null | null | null | null | lsgan/lsgan.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:15.997563 | from __future__ import print_function, division
from keras.datasets import mnist
from keras.layers import Input, Dense, Reshape, Flatten, Dropout
from keras.layers import BatchNormalization, Activation, ZeroPadding2D
from keras.layers.advanced_activations import LeakyReLU
from keras.layers.convolutional import UpSampl... |
eriklindernoren/Keras-GAN | https://github.com/eriklindernoren/Keras-GAN | null | null | null | null | 9,212 | null | null | mit | null | null | null | null | null | null | null | dualgan/dualgan.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:16.002958 | from __future__ import print_function, division
import scipy
from keras.datasets import mnist
from keras.layers import Input, Dense, Reshape, Flatten, Dropout, Concatenate
from keras.layers import BatchNormalization, Activation, ZeroPadding2D
from keras.layers.advanced_activations import LeakyReLU
from keras.layers.co... |
eriklindernoren/Keras-GAN | https://github.com/eriklindernoren/Keras-GAN | null | null | null | null | 9,212 | null | null | mit | null | null | null | null | null | null | null | discogan/discogan.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:16.003924 | from __future__ import print_function, division
import scipy
from keras.datasets import mnist
from keras_contrib.layers.normalization.instancenormalization import InstanceNormalization
from keras.layers import Input, Dense, Reshape, Flatten, Dropout, Concatenate
from keras.layers import BatchNormalization, Activation,... |
eriklindernoren/Keras-GAN | https://github.com/eriklindernoren/Keras-GAN | null | null | null | null | 9,212 | null | null | mit | null | null | null | null | null | null | null | pix2pix/pix2pix.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:16.022124 | from __future__ import print_function, division
import scipy
from keras.datasets import mnist
from keras_contrib.layers.normalization.instancenormalization import InstanceNormalization
from keras.layers import Input, Dense, Reshape, Flatten, Dropout, Concatenate
from keras.layers import BatchNormalization, Activation,... |
eriklindernoren/Keras-GAN | https://github.com/eriklindernoren/Keras-GAN | null | null | null | null | 9,212 | null | null | mit | null | null | null | null | null | null | null | gan/gan.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:16.022579 | from __future__ import print_function, division
from keras.datasets import mnist
from keras.layers import Input, Dense, Reshape, Flatten, Dropout
from keras.layers import BatchNormalization, Activation, ZeroPadding2D
from keras.layers.advanced_activations import LeakyReLU
from keras.layers.convolutional import UpSampl... |
eriklindernoren/Keras-GAN | https://github.com/eriklindernoren/Keras-GAN | null | null | null | null | 9,212 | null | null | mit | null | null | null | null | null | null | null | pixelda/data_loader.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:16.044280 | import scipy
from glob import glob
import numpy as np
from keras.datasets import mnist
from skimage.transform import resize as imresize
import pickle
import os
import urllib
import gzip
class DataLoader():
"""Loads images from MNIST (domain A) and MNIST-M (domain B)"""
def __init__(self, img_res=(128, 128)):
... |
eriklindernoren/Keras-GAN | https://github.com/eriklindernoren/Keras-GAN | null | null | null | null | 9,212 | null | null | mit | null | null | null | null | null | null | null | pixelda/pixelda.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:16.509633 | from __future__ import print_function, division
import scipy
from keras.datasets import mnist
from keras_contrib.layers.normalization.instancenormalization import InstanceNormalization
from keras.layers import Input, Dense, Reshape, Flatten, Dropout, Concatenate
from keras.layers import BatchNormalization, Activation,... |
eriklindernoren/Keras-GAN | https://github.com/eriklindernoren/Keras-GAN | null | null | null | null | 9,212 | null | null | mit | null | null | null | null | null | null | null | pixelda/test.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:16.552826 | from __future__ import print_function, division
import scipy
import datetime
import matplotlib.pyplot as plt
import sys
from data_loader import DataLoader
import numpy as np
import os
# Configure MNIST and MNIST-M data loader
data_loader = DataLoader(img_res=(32, 32))
mnist, _ = data_loader.load_data(domain="A", ba... |
eriklindernoren/Keras-GAN | https://github.com/eriklindernoren/Keras-GAN | null | null | null | null | 9,212 | null | null | mit | null | null | null | null | null | null | null | srgan/data_loader.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:16.575130 | import scipy
from glob import glob
import numpy as np
import matplotlib.pyplot as plt
class DataLoader():
def __init__(self, dataset_name, img_res=(128, 128)):
self.dataset_name = dataset_name
self.img_res = img_res
def load_data(self, batch_size=1, is_testing=False):
data_type = "trai... |
eriklindernoren/Keras-GAN | https://github.com/eriklindernoren/Keras-GAN | null | null | null | null | 9,212 | null | null | mit | null | null | null | null | null | null | null | wgan_gp/wgan_gp.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:16.577825 |
# Large amount of credit goes to:
# https://github.com/keras-team/keras-contrib/blob/master/examples/improved_wgan.py
# which I've used as a reference for this implementation
from __future__ import print_function, division
from keras.datasets import mnist
from keras.layers.merge import _Merge
from keras.layers impor... |
eriklindernoren/Keras-GAN | https://github.com/eriklindernoren/Keras-GAN | null | null | null | null | 9,212 | null | null | mit | null | null | null | null | null | null | null | wgan/wgan.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:16.589130 | from __future__ import print_function, division
from keras.datasets import mnist
from keras.layers import Input, Dense, Reshape, Flatten, Dropout
from keras.layers import BatchNormalization, Activation, ZeroPadding2D
from keras.layers.advanced_activations import LeakyReLU
from keras.layers.convolutional import UpSampl... |
eriklindernoren/Keras-GAN | https://github.com/eriklindernoren/Keras-GAN | null | null | null | null | 9,212 | null | null | mit | null | null | null | null | null | null | null | srgan/srgan.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:16.617547 | """
Super-resolution of CelebA using Generative Adversarial Networks.
The dataset can be downloaded from: https://www.dropbox.com/sh/8oqt9vytwxb3s4r/AADIKlz8PR9zr6Y20qbkunrba/Img/img_align_celeba.zip?dl=0
Instrustion on running the script:
1. Download the dataset from the provided link
2. Save the folder 'img_align_c... |
eriklindernoren/Keras-GAN | https://github.com/eriklindernoren/Keras-GAN | null | null | null | null | 9,212 | null | null | mit | null | null | null | null | null | null | null | sgan/sgan.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:16.618063 | from __future__ import print_function, division
from keras.datasets import mnist
from keras.layers import Input, Dense, Reshape, Flatten, Dropout, multiply, GaussianNoise
from keras.layers import BatchNormalization, Activation, Embedding, ZeroPadding2D
from keras.layers.advanced_activations import LeakyReLU
from keras... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/pylsp/__main__.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:19.780744 | # Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
import argparse
import logging
import logging.config
import sys
import time
try:
import ujson as json
except Exception:
import json
from ._version import __version__
from .python_lsp import (
PythonLS... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | bootstrap.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:19.782324 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2009- Spyder Project Contributors
#
# Distributed under the terms of the MIT License
# (see spyder/__init__.py for details)
# ----------------------------------------------------... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/pylsp/_utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:19.783453 | # Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
import functools
import inspect
import logging
import os
import pathlib
import re
import subprocess
import sys
import threading
import time
from typing import Optional
import docstring_to_markdown
import jedi
JED... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/pylsp/config/config.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:19.820790 | # Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
import logging
import sys
from collections.abc import Mapping, Sequence
from functools import lru_cache
from typing import Union
import pluggy
from pluggy._hooks import HookImpl
from pylsp import PYLSP, _utils, h... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/pylsp/config/source.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:19.821517 | # Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
import configparser
import logging
import os
import sys
log = logging.getLogger(__name__)
class ConfigSource:
"""Base class for implementing a config source."""
def __init__(self, root_path) -> None:
... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/pylsp/config/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:19.822454 | # Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
|
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/pylsp/config/flake8_conf.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:19.824468 | # Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
import logging
import os
from pylsp._utils import find_parents
from .source import ConfigSource
log = logging.getLogger(__name__)
CONFIG_KEY = "flake8"
PROJECT_CONFIGS = [".flake8", "setup.cfg", "tox.ini"]
OPT... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | conftest.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:19.890668 | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
#
"""
Configuration file for Pytest
NOTE: DO NOT add fixtures here. It could generate problems with
QtAwesome being called before a QApplication is created.
"""
import concurrent.futures
import os
... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/pylsp/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:20.849089 | # Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
import os
import pluggy
from . import _version
from ._version import __version__
def convert_version_info(version: str) -> (int, ..., str):
version_info = version.split(".")
for i, v in enumerate(versio... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/pylsp/config/pycodestyle_conf.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:20.944052 | # Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
import pycodestyle
from pylsp._utils import find_parents
from .source import ConfigSource
CONFIG_KEY = "pycodestyle"
USER_CONFIGS = [pycodestyle.USER_CONFIG] if pycodestyle.USER_CONFIG else []
PROJECT_CONFIGS = ... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/pylsp/hookspecs.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:21.041549 | # Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
from pylsp import hookspec
@hookspec
def pylsp_code_actions(config, workspace, document, range, context):
pass
@hookspec
def pylsp_code_lens(config, workspace, document) -> None:
pass
@hookspec
def py... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/pylsp/lsp.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:21.042113 | # Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
"""Some Language Server Protocol constants
https://github.com/Microsoft/language-server-protocol/blob/master/protocol.md
"""
class CompletionItemKind:
Text = 1
Method = 2
Function = 3
Constructor... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/pylsp/plugins/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:21.150399 | # Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
|
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/pylsp/plugins/folding.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:21.491578 | # Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
import re
import parso
import parso.python.tree as tree_nodes
from pylsp import hookimpl
SKIP_NODES = (tree_nodes.Module, tree_nodes.IfStmt, tree_nodes.TryStmt)
IDENTATION_REGEX = re.compile(r"(\s+).+")
@hooki... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/pylsp/plugins/jedi_completion.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:21.603312 | # Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
import logging
import os
import parso
from pylsp import _utils, hookimpl, lsp
from pylsp.plugins._resolvers import LABEL_RESOLVER, SNIPPET_RESOLVER
log = logging.getLogger(__name__)
# Map to the LSP type
# > Va... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/pylsp/plugins/highlight.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:21.704154 | # Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
import logging
from pylsp import _utils, hookimpl, lsp
log = logging.getLogger(__name__)
@hookimpl
def pylsp_document_highlight(document, position):
code_position = _utils.position_to_jedi_linecolumn(docume... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/pylsp/plugins/jedi_rename.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:21.736504 | # Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
import logging
from pylsp import _utils, hookimpl, uris
log = logging.getLogger(__name__)
@hookimpl
def pylsp_rename(config, workspace, document, position, new_name):
log.debug(
"Executing rename of... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/pylsp/plugins/hover.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:21.744507 | # Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
import logging
from pylsp import _utils, hookimpl
log = logging.getLogger(__name__)
@hookimpl
def pylsp_hover(config, document, position):
signature_config = config.settings().get("signature", {})
code_... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/pylsp/plugins/mccabe_lint.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:22.138513 | # Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
import ast
import logging
import mccabe
from pylsp import hookimpl, lsp
log = logging.getLogger(__name__)
THRESHOLD = "threshold"
DEFAULT_THRESHOLD = 15
@hookimpl
def pylsp_lint(config, workspace, document):
... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/pylsp/plugins/preload_imports.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:22.178408 | # Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
import logging
from pylsp import hookimpl
log = logging.getLogger(__name__)
MODULES = [
"OpenGL",
"PIL",
"array",
"audioop",
"binascii",
"cPickle",
"cStringIO",
"cmath",
"coll... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/pylsp/plugins/pycodestyle_lint.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:22.322041 | # Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
import logging
import pycodestyle
from pylsp import hookimpl, lsp
from pylsp._utils import get_eol_chars
try:
from autopep8 import continued_indentation as autopep8_c_i
except ImportError:
pass
else:
... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/pylsp/plugins/pydocstyle_lint.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:22.353858 | # Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
import contextlib
import logging
import os
import re
import sys
import pydocstyle
from pylsp import hookimpl, lsp
log = logging.getLogger(__name__)
# PyDocstyle is a little verbose in debug message
pydocstyle_l... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/pylsp/plugins/pyflakes_lint.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:22.383396 | # Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
from pyflakes import api as pyflakes_api
from pyflakes import messages
from pylsp import hookimpl, lsp
# Pyflakes messages that should be reported as Errors instead of Warns
PYFLAKES_ERROR_MESSAGES = (
messag... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/pylsp/plugins/references.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:22.740206 | # Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
import logging
from pylsp import _utils, hookimpl, uris
log = logging.getLogger(__name__)
@hookimpl
def pylsp_references(document, position, exclude_declaration):
code_position = _utils.position_to_jedi_lin... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/pylsp/plugins/pylint_lint.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:22.746337 | # Copyright 2018 Google LLC.
# Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
"""Linter plugin for pylint."""
import collections
import logging
import os
import re
import shlex
import sys
from subprocess import PIPE, Popen
from pylsp import hookimpl, lsp
try:
... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/pylsp/plugins/rope_completion.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:22.985097 | # Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
import logging
from rope.contrib.codeassist import code_assist, sorted_proposals
from pylsp import _utils, hookimpl, lsp
log = logging.getLogger(__name__)
@hookimpl
def pylsp_settings():
# Default rope_com... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/pylsp/plugins/signature.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:23.062111 | # Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
import logging
import re
from pylsp import _utils, hookimpl
log = logging.getLogger(__name__)
SPHINX = re.compile(r"\s*:param\s+(?P<param>\w+):\s*(?P<doc>[^\n]+)")
EPYDOC = re.compile(r"\s*@param\s+(?P<param>\w+... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/pylsp/plugins/rope_autoimport.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:23.174111 | # Copyright 2022- Python Language Server Contributors.
import logging
import threading
from collections.abc import Generator
from typing import Any, Optional, Union
import parso
from jedi import Script
from parso.python import tree
from parso.tree import NodeOrLeaf
from rope.base.resources import Resource
from rope.c... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/pylsp/plugins/symbols.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:23.326793 | # Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
import logging
import re
from pathlib import Path
from pylsp import hookimpl
from pylsp.lsp import SymbolKind
log = logging.getLogger(__name__)
@hookimpl
def pylsp_document_symbols(config, document):
symbol... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/pylsp/plugins/type_definition.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:23.350323 | # Copyright 2021- Python Language Server Contributors.
import logging
from pylsp import _utils, hookimpl
log = logging.getLogger(__name__)
def lsp_location(name):
module_path = name.module_path
if module_path is None or name.line is None or name.column is None:
return None
uri = module_path.as_... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/pylsp/plugins/yapf_format.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:23.571806 | # Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
import logging
import os
import whatthepatch
from yapf.yapflib import file_resources, style
from yapf.yapflib.yapf_api import FormatCode
from pylsp import hookimpl
from pylsp._utils import get_eol_chars
log = lo... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/pylsp/python_lsp.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:23.646933 | # Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
import logging
import os
import socketserver
import sys
import threading
import uuid
from functools import partial
from typing import Any
try:
import ujson as json
except Exception:
import json
from pylsp... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/pylsp/text_edit.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:23.740910 | # Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
def get_well_formatted_range(lsp_range):
start = lsp_range["start"]
end = lsp_range["end"]
if start["line"] > end["line"] or (
start["line"] == end["line"] and start["character"] > end["charac... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/pylsp/uris.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:23.921007 | # Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
"""A collection of URI utilities with logic built on the VSCode URI library.
https://github.com/Microsoft/vscode-uri/blob/e59cab84f5df6265aed18ae5f43552d3eef13bb9/lib/index.ts
"""
import re
from urllib import par... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/pylsp/workspace.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:23.924850 | # Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
import functools
import io
import logging
import os
import re
import uuid
from collections.abc import Generator
from contextlib import contextmanager
from threading import RLock
from typing import Callable, Optiona... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/scripts/jsonschema2md.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:24.145845 | import json
import sys
from argparse import ArgumentParser, FileType
def describe_array(prop: dict) -> str:
extra = ""
if "items" in prop:
unique_qualifier = ""
if "uniqueItems" in prop:
unique_qualifier = "unique" if prop["uniqueItems"] else "non-unique"
item_type = descri... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/setup.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:24.224696 | #!/usr/bin/env python3
# Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
from setuptools import setup
if __name__ == "__main__":
setup(
name="python-lsp-server", # to allow GitHub dependency tracking work
)
|
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/test/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:24.317713 | # Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
import pytest
from pylsp import IS_WIN
unix_only = pytest.mark.skipif(IS_WIN, reason="Unix only")
windows_only = pytest.mark.skipif(not IS_WIN, reason="Windows only")
|
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/test/fixtures.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:24.509512 | # Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
import os
from io import StringIO
from unittest.mock import MagicMock
import pytest
from pylsp_jsonrpc.dispatchers import MethodDispatcher
from pylsp_jsonrpc.endpoint import Endpoint
from pylsp_jsonrpc.exceptions ... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/test/conftest.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:24.524842 | # Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
"""pytest configuration"""
import logging
from pylsp.__main__ import LOG_FORMAT
logging.basicConfig(level=logging.DEBUG, format=LOG_FORMAT)
pytest_plugins = ["test.fixtures"]
|
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/test/plugins/test_autoimport.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:24.853431 | # Copyright 2022- Python Language Server Contributors.
from typing import Any
from unittest.mock import Mock, patch
import jedi
import parso
import pytest
from pylsp import IS_WIN, lsp, uris
from pylsp.config.config import Config
from pylsp.plugins.rope_autoimport import (
_get_score,
_should_insert,
cac... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/test/plugins/test_autopep8_format.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:24.877149 | # Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
import pytest
from pylsp import uris
from pylsp.plugins.autopep8_format import pylsp_format_document, pylsp_format_range
from pylsp.workspace import Document
DOC_URI = uris.from_fs_path(__file__)
DOC = """a = ... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/test/plugins/test_completion.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:25.101141 | # Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
import math
import os
import sys
from pathlib import Path
from typing import NamedTuple
import pytest
from pylsp import lsp, uris
from pylsp._utils import JEDI_VERSION
from pylsp.plugins.jedi_completion import (
... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/test/plugins/test_definitions.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:25.130773 | # Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
import os
from pylsp import uris
from pylsp.plugins.definition import pylsp_definitions
from pylsp.workspace import Document
DOC_URI = uris.from_fs_path(__file__)
DOC = """def a():
pass
print(a())
class Di... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/pylsp/plugins/definition.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:25.395694 | # Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
from __future__ import annotations
import logging
from typing import TYPE_CHECKING, Any
import jedi
from pylsp import _utils, hookimpl, uris
if TYPE_CHECKING:
from jedi.api import Script
from jedi.api.cl... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/pylsp/plugins/flake8_lint.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:25.539207 | # Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
"""Linter pluging for flake8"""
import logging
import os.path
import re
import sys
from pathlib import PurePath
from subprocess import PIPE, Popen
from flake8.plugins.pyflakes import FLAKE8_PYFLAKES_CODES
from p... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/pylsp/plugins/_resolvers.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:25.545885 | # Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
import logging
from collections import defaultdict
from time import time
from jedi.api.classes import Completion
from pylsp import lsp
log = logging.getLogger(__name__)
# ---- Base class
# --------------------... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/pylsp/plugins/_rope_task_handle.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:25.577734 | from __future__ import annotations
import logging
from collections.abc import Sequence
from typing import Callable, ContextManager
from rope.base.taskhandle import BaseJobSet, BaseTaskHandle
from pylsp._utils import throttle
from pylsp.workspace import Workspace
log = logging.getLogger(__name__)
Report = Callable[[... |
spyder-ide/spyder | https://github.com/spyder-ide/spyder | null | null | null | null | 9,211 | null | null | mit | null | null | null | null | null | null | null | external-deps/python-lsp-server/pylsp/plugins/autopep8_format.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:25.649645 | # Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
import logging
import pycodestyle
from autopep8 import continued_indentation as autopep8_c_i
from autopep8 import fix_code
from pylsp import hookimpl
from pylsp._utils import get_eol_chars
log = logging.getLogge... |
tobymao/sqlglot | https://github.com/tobymao/sqlglot | null | null | null | null | 9,194 | null | null | mit | null | null | null | null | null | null | null | sqlglot/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:28.266159 | # ruff: noqa: F401
"""
.. include:: ../README.md
----
"""
from __future__ import annotations
from collections.abc import Collection
from builtins import type as Type
import logging
import typing as t
from sqlglot import expressions as exp
from sqlglot.dialects.dialect import Dialect as Dialect, Dialects as Dialect... |
tobymao/sqlglot | https://github.com/tobymao/sqlglot | null | null | null | null | 9,194 | null | null | mit | null | null | null | null | null | null | null | sqlglot/_typing.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:28.268095 | from __future__ import annotations
import typing as t
from collections.abc import Mapping, Sequence
if t.TYPE_CHECKING:
from typing_extensions import ParamSpec
import sqlglot
from sqlglot.dialects.dialect import DialectType
from sqlglot.errors import ErrorLevel
P = ParamSpec("P")
B = t.TypeVar(... |
tobymao/sqlglot | https://github.com/tobymao/sqlglot | null | null | null | null | 9,194 | null | null | mit | null | null | null | null | null | null | null | benchmarks/parse.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:28.269395 | import argparse
import inspect
import json
import os
import subprocess
import sys
import tempfile
import time
# --- Query definitions ---
large_in = (
"SELECT * FROM t WHERE x IN (" + ", ".join(f"'s{i}'" for i in range(20000)) + ")"
" OR y IN (" + ", ".join(str(i) for i in range(20000)) + ")"
)
values = "IN... |
tobymao/sqlglot | https://github.com/tobymao/sqlglot | null | null | null | null | 9,194 | null | null | mit | null | null | null | null | null | null | null | .github/scripts/get_integration_test_params.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:28.274944 | #!/usr/bin/env python3
"""
This script is intended to be used as part of a GitHub Actions workflow in order to decide if the integration tests should:
a) be triggered at all
b) if they should be triggered, should they be triggered for a subset of dialects or all dialects?
The tests can be triggered manually by using ... |
tobymao/sqlglot | https://github.com/tobymao/sqlglot | null | null | null | null | 9,194 | null | null | mit | null | null | null | null | null | null | null | setup.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:28.283756 | from setuptools import setup
from setuptools_scm import get_version
version = get_version(local_scheme="no-local-version")
setup(
extras_require={
"dev": [
"duckdb>=0.6",
# sqlglot-mypy 1.20+ is the build dep for sqlglotc and only ships
# for py3.10+; on py3.9 just use ... |
tobymao/sqlglot | https://github.com/tobymao/sqlglot | null | null | null | null | 9,194 | null | null | mit | null | null | null | null | null | null | null | benchmarks/optimize.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:28.285257 | import sys
import os
import pyperf
# Add the project root to the path so we can import from tests
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from sqlglot.optimizer import optimize
from sqlglot import parse_one
from tests.helpers import load_sql_fixture_pairs, TPCH_SCHEMA, TPCDS_SC... |
tobymao/sqlglot | https://github.com/tobymao/sqlglot | null | null | null | null | 9,194 | null | null | mit | null | null | null | null | null | null | null | benchmarks/compare.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:28.295361 | #!/usr/bin/env python3
"""Compare two benchmark JSON files and output a markdown table with diff indicators."""
import json
import sys
def _fmt_time(seconds):
if seconds >= 1:
return f"{seconds:.2f}s"
if seconds >= 1e-3:
return f"{seconds * 1e3:.1f}ms"
return f"{seconds * 1e6:.0f}us"
de... |
tobymao/sqlglot | https://github.com/tobymao/sqlglot | null | null | null | null | 9,194 | null | null | mit | null | null | null | null | null | null | null | sqlglot/__main__.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:28.307998 | from __future__ import annotations
import argparse
import sys
import sqlglot
from sqlglot.helper import to_bool
parser = argparse.ArgumentParser(description="Transpile SQL")
parser.add_argument(
"sql",
metavar="sql",
type=str,
help="SQL statement(s) to transpile, or - to parse stdin.",
)
parser.add_a... |
tobymao/sqlglot | https://github.com/tobymao/sqlglot | null | null | null | null | 9,194 | null | null | mit | null | null | null | null | null | null | null | pdoc/cli.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:28.310228 | #!/usr/bin/env python3
from importlib import import_module
from pathlib import Path
from unittest import mock
from pdoc.__main__ import cli, parser
# Need this import or else import_module doesn't work
import sqlglot # noqa
from sqlglot.dialects import * # noqa: F403
# Load all dialects up front because lazy load... |
tobymao/sqlglot | https://github.com/tobymao/sqlglot | null | null | null | null | 9,194 | null | null | mit | null | null | null | null | null | null | null | sqlglot/dialects/dremio.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:29.336429 | from __future__ import annotations
from sqlglot import tokens
from sqlglot.dialects.dialect import Dialect
from sqlglot.generators.dremio import DremioGenerator
from sqlglot.parsers.dremio import DremioParser
class Dremio(Dialect):
SUPPORTS_USER_DEFINED_TYPES = False
CONCAT_COALESCE = True
CONCAT_WS_COAL... |
tobymao/sqlglot | https://github.com/tobymao/sqlglot | null | null | null | null | 9,194 | null | null | mit | null | null | null | null | null | null | null | sqlglot/dialects/drill.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:29.338760 | from __future__ import annotations
from sqlglot import tokens
from sqlglot.dialects.dialect import Dialect
from sqlglot.generators.drill import DrillGenerator
from sqlglot.parsers.drill import DrillParser
class Drill(Dialect):
NORMALIZE_FUNCTIONS: bool | str = False
PRESERVE_ORIGINAL_NAMES = True
NULL_O... |
tobymao/sqlglot | https://github.com/tobymao/sqlglot | null | null | null | null | 9,194 | null | null | mit | null | null | null | null | null | null | null | sqlglot/dialects/clickhouse.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:29.340121 | from __future__ import annotations
from sqlglot import exp, tokens
from sqlglot.dialects.dialect import (
Dialect,
NormalizationStrategy,
)
from sqlglot.generators.clickhouse import ClickHouseGenerator
from sqlglot.parsers.clickhouse import ClickHouseParser
from sqlglot.tokens import TokenType
from sqlglot.ty... |
tobymao/sqlglot | https://github.com/tobymao/sqlglot | null | null | null | null | 9,194 | null | null | mit | null | null | null | null | null | null | null | sqlglot/dialects/databricks.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:29.341322 | from __future__ import annotations
from copy import deepcopy
from collections import defaultdict
from sqlglot import exp
from sqlglot.dialects.spark import Spark
from sqlglot.generators.databricks import DatabricksGenerator
from sqlglot.parsers.databricks import DatabricksParser
from sqlglot.tokens import TokenType
f... |
tobymao/sqlglot | https://github.com/tobymao/sqlglot | null | null | null | null | 9,194 | null | null | mit | null | null | null | null | null | null | null | sqlglot/dialects/bigquery.py | null | null | null | null | null | null | Python | 2026-05-04T02:06:29.342726 | from __future__ import annotations
import typing as t
from sqlglot.optimizer.annotate_types import TypeAnnotator
from sqlglot import exp, jsonpath, tokens
from sqlglot._typing import E
from sqlglot.parsers.bigquery import BigQueryParser
from sqlglot.generators.bigquery import BigQueryGenerator
from sqlglot.dialects... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.