license: mit
task_categories:
- text-generation
language:
- en
tags:
- Python
- code
size_categories:
- 1M<n<10M
Python-Code-Large
Python-Code-Large is a large-scale corpus of Python source code comprising more than 2 million rows of Python code. The dataset is designed to support research in large language model (LLM) pretraining, code intelligence, software engineering automation, and program analysis for the Python ecosystem.
By providing a high-volume, language-specific corpus, Python-Code-Large enables systematic experimentation in Python-focused model training, domain adaptation, and downstream code understanding tasks.
Python-Code-Large addresses the need for a dedicated Python-only dataset at substantial scale, enabling focused research across data science, backend systems, automation, scientific computing, and AI-driven Python environments.
1. Dataset Composition
Programming Language: Python
Size: 2M+ rows of Python code
File Format: .jsonl
Each record is stored as structured JSON Lines format for efficient streaming, large-scale training, and distributed processing.
Content Types
The dataset includes a wide variety of Python constructs and paradigms, such as:
Function definitions and decorators
Class-based and object-oriented programming
Inheritance and multiple inheritance patterns
Async programming (async / await)
Generators and iterators
Context managers
Exception handling patterns
Type hints and annotations
Functional programming constructs (map, filter, lambda)
List, dictionary, and set comprehensions
Metaprogramming patterns
Data processing pipelines
Web framework logic
REST API implementations
Machine learning scripts
Data science notebooks (converted to .py where applicable)
CLI utilities
Testing frameworks (unit tests, integration tests)
Configuration and environment management code
Docstrings and inline documentation
Modern Python 3.x features
2. Intended Research Applications
2.1 Pretraining
Training Python code foundation models from scratch
Continued pretraining of existing LLMs
Python-specialized language modeling
Tokenizer training optimized for Python syntax
AST-aware pretraining experiments
2.2 Fine-Tuning and Adaptation
Code completion systems
Intelligent IDE assistants
Automated refactoring tools
Conversational programming agents
Python-specific copilots
Docstring generation systems
Type inference assistants
2.3 Code Intelligence Tasks
Code summarization
Code-to-text generation
Documentation generation
Bug detection
Vulnerability detection
Clone detection
Code similarity modeling
Readability enhancement
_ Static code analysis
- Structural and dependency modeling
2.4 Software Engineering Research
Empirical studies of Python coding patterns
Analysis of async architectures in Python
Framework usage studies
Dependency and import graph modeling
AST-based experiments
Cross-version Python evolution analysis
Type adoption analysis (PEP-based transitions)
Large-scale study of testing patterns
3. Research Opportunities Enabled
Python-Code-Large enables exploration of:
Python-specific tokenizer efficiency
Function-level representation learning
Retrieval-augmented generation for code
Secure code modeling
Long-context modeling of large Python files
Docstring-conditioned generation
Python-specific benchmark creation
Thanks to open source community for all the guidance & support!!