Dataset Viewer
Auto-converted to Parquet Duplicate
file_path
stringlengths
10
10
code
stringlengths
79
330k
code_en
stringlengths
79
330k
language
stringclasses
1 value
license
stringclasses
0 values
token_count
int32
24
158k
0037437.py
from classes.Despachante import * from classes.Sistema import * from classes.Processo import * from tkinter import * from tkinter import ttk from tkinter.filedialog import askopenfilename as fileChooser class EscDeProcessos: def __init__(self, master=None): #Tamanho da janela master.minsize(width=7...
from classes.Despachante import * from classes.Sistema import * from classes.Processo import * from tkinter import * from tkinter import ttk from tkinter.filedialog import askopenfilename as fileChooser class EscDeProcessos: def __init__(self, master=None): #Tamanho da janela master.minsize(width=7...
en
null
3,719
0036153.py
#!/usr/bin/env python # Copyright 2020 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Reports binary size metrics for LaCrOS build artifacts. More information at //docs/speed/binary_size/metrics.md. """ import argpars...
#!/usr/bin/env python # Copyright 2020 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Reports binary size metrics for LaCrOS build artifacts. More information at //docs/speed/binary_size/metrics.md. """ import argpars...
en
null
3,750
0035653.py
""" Convert characters (chr) to integer (int) labels and vice versa. REVIEW: index 0 bug, also see: https://github.com/baidu-research/warp-ctc/tree/master/tensorflow_binding `ctc_loss`_ maps labels from 0=<unused>, 1=<space>, 2=a, ..., 27=z, 28=<blank> See: https://www.tensorflow.org/api_docs/python/tf/nn/ctc_loss "...
""" Convert characters (chr) to integer (int) labels and vice versa. REVIEW: index 0 bug, also see: https://github.com/baidu-research/warp-ctc/tree/master/tensorflow_binding `ctc_loss`_ maps labels from 0=<unused>, 1=<space>, 2=a, ..., 27=z, 28=<blank> See: https://www.tensorflow.org/api_docs/python/tf/nn/ctc_loss "...
en
null
504
0037957.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
en
null
474
0001021.py
# Write a Python program to get execution time for a Python method. import time def sum_of_n_numbers(x): start_time = time.time() s = 0 for i in range(1, x + 1): s = s + i end_time = time.time() return s, end_time - start_time n = 5 print("\nTime to sum of 1 to ", n, " and required time...
# Write a Python program to get execution time for a Python method. import time def sum_of_n_numbers(x): start_time = time.time() s = 0 for i in range(1, x + 1): s = s + i end_time = time.time() return s, end_time - start_time n = 5 print("\nTime to sum of 1 to ", n, " and required time...
en
null
130
0017967.py
import re import time from django.conf import settings from django.utils.timezone import make_aware, make_naive, utc re_pattern = re.compile('[^\u0000-\uD7FF\uE000-\uFFFF]+', re.UNICODE) def sanitize_unicode(u): # We may not be able to store all special characters thanks # to MySQL's boneheadedness, so acce...
import re import time from django.conf import settings from django.utils.timezone import make_aware, make_naive, utc re_pattern = re.compile('[^\u0000-\uD7FF\uE000-\uFFFF]+', re.UNICODE) def sanitize_unicode(u): # We may not be able to store all special characters thanks # to MySQL's boneheadedness, so acce...
en
null
371
0048230.py
""" Implements the DIAL-protocol to communicate with the Chromecast """ from collections import namedtuple import json import logging import socket import ssl import urllib.request from uuid import UUID import zeroconf from .const import CAST_TYPE_CHROMECAST, CAST_TYPES, SERVICE_TYPE_HOST XML_NS_UPNP_DEVICE = "{urn:...
""" Implements the DIAL-protocol to communicate with the Chromecast """ from collections import namedtuple import json import logging import socket import ssl import urllib.request from uuid import UUID import zeroconf from .const import CAST_TYPE_CHROMECAST, CAST_TYPES, SERVICE_TYPE_HOST XML_NS_UPNP_DEVICE = "{urn:...
en
null
1,839
0019568.py
# coding: utf-8 """ Mux API Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 The version of the OpenAPI document: v1 Contact: devex@mux.com Gener...
# coding: utf-8 """ Mux API Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 The version of the OpenAPI document: v1 Contact: devex@mux.com Gener...
en
null
1,109
0033287.py
import os import markdown import codecs import difflib try: import nose except ImportError as e: msg = e.args[0] msg = msg + ". The nose testing framework is required to run the Python-" \ "Markdown tests. Run `pip install nose` to install the latest version." e.args = (msg,) + e.args[1:] ra...
import os import markdown import codecs import difflib try: import nose except ImportError as e: msg = e.args[0] msg = msg + ". The nose testing framework is required to run the Python-" \ "Markdown tests. Run `pip install nose` to install the latest version." e.args = (msg,) + e.args[1:] ra...
en
null
1,860
0018939.py
# -*- coding: utf-8 -*- """ Created on Mon Dec 21 16:44:36 2020 @author: wantysal """ # Standard library import import numpy as np # Local import from mosqito.sound_level_meter.noct_spectrum._getFrequencies import _getFrequencies def _spectrum_smoothing(freqs_in, spec, noct, low_freq, high_freq, freqs_out): """...
# -*- coding: utf-8 -*- """ Created on Mon Dec 21 16:44:36 2020 @author: wantysal """ # Standard library import import numpy as np # Local import from mosqito.sound_level_meter.noct_spectrum._getFrequencies import _getFrequencies def _spectrum_smoothing(freqs_in, spec, noct, low_freq, high_freq, freqs_out): """...
en
null
914
0008742.py
#!/usr/bin/env python3 """ An example script to send data to CommCare using the Submission API Usage: $ export CCHQ_PROJECT_SPACE=my-project-space $ export CCHQ_CASE_TYPE=person $ export CCHQ_USERNAME=user@example.com $ export CCHQ_PASSWORD=MijByG_se3EcKr.t $ export CCHQ_USER_ID=c0ffeeeeeb574eb8b5...
#!/usr/bin/env python3 """ An example script to send data to CommCare using the Submission API Usage: $ export CCHQ_PROJECT_SPACE=my-project-space $ export CCHQ_CASE_TYPE=person $ export CCHQ_USERNAME=user@example.com $ export CCHQ_PASSWORD=MijByG_se3EcKr.t $ export CCHQ_USER_ID=c0ffeeeeeb574eb8b5...
en
null
1,996
0010801.py
# Copyright (c) 2012 NTT DOCOMO, INC. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
# Copyright (c) 2012 NTT DOCOMO, INC. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
en
null
881
0007285.py
import hashlib from ecdsa.curves import Ed25519, SECP256k1 from .principal import Principal import ecdsa class Identity: def __init__(self, privkey = "", type = "ed25519", anonymous = False): privkey = bytes(bytearray.fromhex(privkey)) self.anonymous = anonymous if anonymous: r...
import hashlib from ecdsa.curves import Ed25519, SECP256k1 from .principal import Principal import ecdsa class Identity: def __init__(self, privkey = "", type = "ed25519", anonymous = False): privkey = bytes(bytearray.fromhex(privkey)) self.anonymous = anonymous if anonymous: r...
en
null
908
0019223.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # @Date : Feb-09-21 22:23 # @Author : Kelly Hwong (dianhuangkan@gmail.com) import numpy as np import tensorflow as tf class XOR_Dataset(tf.keras.utils.Sequence): """XOR_Dataset.""" def __init__( self, batch_size=1, shuffle=False, ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # @Date : Feb-09-21 22:23 # @Author : Kelly Hwong (dianhuangkan@gmail.com) import numpy as np import tensorflow as tf class XOR_Dataset(tf.keras.utils.Sequence): """XOR_Dataset.""" def __init__( self, batch_size=1, shuffle=False, ...
en
null
600
0016186.py
""" This module is for managing OMERO imports, making use of the OMERO CLI, which can be called from a Python script. Note that this code requires a properly structured import.json file, which is produced during data intake (using the intake.py module). """ import logging from ezomero import post_dataset, post_projec...
""" This module is for managing OMERO imports, making use of the OMERO CLI, which can be called from a Python script. Note that this code requires a properly structured import.json file, which is produced during data intake (using the intake.py module). """ import logging from ezomero import post_dataset, post_projec...
en
null
3,805
0026028.py
import librosa import librosa.filters import numpy as np import tensorflow as tf from scipy import signal from scipy.io import wavfile def load_wav(path, sr): return librosa.core.load(path, sr=sr)[0] def save_wav(wav, path, sr): wav *= 32767 / max(0.01, np.max(np.abs(wav))) #proposed by @dsmiller wav...
import librosa import librosa.filters import numpy as np import tensorflow as tf from scipy import signal from scipy.io import wavfile def load_wav(path, sr): return librosa.core.load(path, sr=sr)[0] def save_wav(wav, path, sr): wav *= 32767 / max(0.01, np.max(np.abs(wav))) #proposed by @dsmiller wav...
en
null
2,853
0028922.py
from buildtest.cli.help import buildtest_help def test_buildtest_help(): buildtest_help(command="build") buildtest_help(command="buildspec") buildtest_help(command="config") buildtest_help(command="cdash") buildtest_help(command="history") buildtest_help(command="inspect") buildtest_help(c...
from buildtest.cli.help import buildtest_help def test_buildtest_help(): buildtest_help(command="build") buildtest_help(command="buildspec") buildtest_help(command="config") buildtest_help(command="cdash") buildtest_help(command="history") buildtest_help(command="inspect") buildtest_help(c...
en
null
140
0037594.py
#!/usr/bin/env python2 # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test resurrection of mined transactions when # the blockchain is re-organized. # from test_framework impo...
#!/usr/bin/env python2 # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test resurrection of mined transactions when # the blockchain is re-organized. # from test_framework impo...
en
null
1,050
0010807.py
#!/usr/bin/env python3 import logging import sys import subprocess from taupage import configure_logging, get_config def main(): """Configure custom sysctl parameters If a sysctl section is present, add the valid parameters to sysctl and reloads. """ CUSTOM_SYSCTL_CONF = '/etc/sysctl.d/99-custom.co...
#!/usr/bin/env python3 import logging import sys import subprocess from taupage import configure_logging, get_config def main(): """Configure custom sysctl parameters If a sysctl section is present, add the valid parameters to sysctl and reloads. """ CUSTOM_SYSCTL_CONF = '/etc/sysctl.d/99-custom.co...
en
null
397
0017586.py
# flake8: noqa from typing import Any from fugue_version import __version__ from IPython import get_ipython from IPython.display import Javascript from fugue_notebook.env import NotebookSetup, _setup_fugue_notebook _HIGHLIGHT_JS = r""" require(["codemirror/lib/codemirror"]); function set(str) { var obj = {}, wor...
# flake8: noqa from typing import Any from fugue_version import __version__ from IPython import get_ipython from IPython.display import Javascript from fugue_notebook.env import NotebookSetup, _setup_fugue_notebook _HIGHLIGHT_JS = r""" require(["codemirror/lib/codemirror"]); function set(str) { var obj = {}, wor...
en
null
1,006
End of preview. Expand in Data Studio

Language Decoded | Multilingual Code Dataset

Multilingual Python code datasets for the Language Decoded project (part of Cohere's Tiny Aya Expedition), investigating whether code's reasoning benefit for language models is language-dependent or structure-dependent.

Research Question

Does fine-tuning on non-English code (Python with translated keywords) improve multilingual reasoning as much as English code does?

Prior work (Aryabumi et al., 2024 -- "To Code or Not to Code") demonstrated that including English code in pre-training data improves downstream reasoning performance by approximately 8%. However, that study only tested English code. This dataset enables the natural follow-up: does the reasoning benefit come from the structure of code, or from the language of its keywords?

Dataset Description

This dataset provides filtered, quality-controlled Python source code in multiple configurations: the original English, three keyword-swapped variants (Chinese, Spanish, Urdu), a blended native+transpiled mix, and strictly native Chinese code. The source data is drawn from bigcode/the-stack-dedup (Python subset), filtered for quality using the following criteria:

  • AST-valid Python only (must parse without errors)
  • Permissive licenses only (MIT, Apache-2.0, BSD, etc.)
  • 10--1000 lines of code
  • Minimum 21 GitHub stars
  • No autogenerated files
  • SHA-256 deduplication

Keyword-swapped variants are produced using Legesher v0.7.3, which translates Python reserved words (37 keywords, 72 builtins, 66 exceptions) into the target language while preserving code structure and semantics.

Available Configs

Each condition is available in two sizes: -32k (full filtered corpus, ~31.8k train + ~3.5k validation) and -5k (stratified subset, 4.5k train + 500 validation). The -5k subsets are used for QLoRA fine-tuning on consumer GPUs.

Config Condition Language Description Train Val
condition-1-en-32k 1 (control) English Unmodified filtered Python from The Stack Dedup 31,818 3,536
condition-1-en-5k 1 (control) English Stratified 5k subset of condition-1 4,500 500
condition-2-zh-32k 2 Chinese Keyword-swapped Python via Legesher v0.7.3 31,818 3,536
condition-2-zh-5k 2 Chinese Stratified 5k subset of condition-2-zh 4,500 500
condition-2-es-32k 2 Spanish Keyword-swapped Python via Legesher v0.7.3 31,818 3,536
condition-2-es-5k 2 Spanish Stratified 5k subset of condition-2-es 4,500 500
condition-2-ur-32k 2 Urdu Keyword-swapped Python via Legesher v0.7.3 31,818 3,536
condition-2-ur-5k 2 Urdu Stratified 5k subset of condition-2-ur 4,500 500
condition-3-zh-5k 3 Chinese Blended: 3,486 native Chinese code + 1,514 transpiled Python 4,500 500
condition-4-zh-5k 4 Chinese Strictly native Chinese code (no transpiled code) 6,553 729

Schema

Conditions 1--2

Used by: condition-1-en-*, condition-2-zh-*, condition-2-es-*, condition-2-ur-*

Column Type Description
code string Python source code. For condition-2 configs, this is the transpiled (keyword-swapped) version. For condition-1, this is the original English source.
code_en string Original English Python source code. Identical to code for condition-1-en.
language string ISO 639-1 language code: en, ur, zh, or es.
file_path string Original file path in The Stack Dedup.
license string SPDX license identifier for the source file.
token_count int64 Token count computed using the CohereLabs/tiny-aya-base tokenizer.

Condition 3

Used by: condition-3-zh-5k

Condition 3 blends native Chinese code with transpiled code and adds a source_type column to distinguish them. code_en is populated for transpiled rows (keeping them in sync with conditions 1--2) but null for native code rows, which have no English equivalent.

Column Type Description
file_path string File identifier (native filename or transpiled file path)
code string The code content (native or transpiled)
code_en string/null English original -- populated for transpiled rows, null for native code rows
language string ISO 639-1 language code (zh)
license string Source license (SPDX identifier, UNKNOWN, or varies)
token_count int64 Token count computed using the CohereLabs/tiny-aya-base tokenizer
source_type string "native" (natively Chinese-authored) or "transpiled" (keyword-swapped English)

Condition 4

Used by: condition-4-zh-5k

Condition 4 contains strictly native Chinese code -- code written by developers who think and code in Chinese. This uses the same schema as the language-decoded-community dataset rather than the transpilation schema, since there is no English original to reference.

Column Type Description
filename string Original filename
content string The code content
extension string File extension (e.g., .py, .c, .wenyan)
source string Data source (e.g., thestack, wenyan, program_in_chinese)
quality_tier string Quality rating: A (highest) through D (lowest)
sha256 string SHA-256 hash for deduplication
byte_size int64 File size in bytes
total_lines int64 Total line count
cjk_ratio float64 Ratio of CJK characters in the file
has_cjk bool Whether the file contains CJK characters

Experimental Conditions

The Language Decoded experiment uses a ladder of conditions to isolate the mechanism behind code's reasoning benefit:

Condition Name Purpose
Baseline No fine-tuning Establishes the performance floor
Condition 1 English code Tests whether code fine-tuning helps at all (replicates Aryabumi et al.)
Condition 2 Keyword-swapped code Tests whether the language of keywords matters for the reasoning benefit
Condition 3 Mixed native sources Tests whether diverse native-language code adds value beyond keyword swapping
Condition 4 Strictly native code Tests whether code authored by native speakers carries unique signal beyond transpilation

The Experimental Ladder

  • Baseline --> 1: Does code help at all?
  • 1 --> 2: Does the language of keywords matter?
  • 2 --> 3: Does diversity of native-language sources add value beyond keyword swap?
  • 3 --> 4: Does code written in the cultural context of a language carry something that transpiled+mixed can't?

Usage

from datasets import load_dataset

# Load full-size English code (control)
ds = load_dataset("legesher/language-decoded-data", "condition-1-en-32k")

# Load 5k subset (for QLoRA fine-tuning)
ds = load_dataset("legesher/language-decoded-data", "condition-1-en-5k")

# Load keyword-swapped variants
ds = load_dataset("legesher/language-decoded-data", "condition-2-zh-5k")
ds = load_dataset("legesher/language-decoded-data", "condition-2-es-5k")
ds = load_dataset("legesher/language-decoded-data", "condition-2-ur-5k")

# Load blended native + transpiled (condition 3)
ds = load_dataset("legesher/language-decoded-data", "condition-3-zh-5k")

# Load strictly native code (condition 4)
ds = load_dataset("legesher/language-decoded-data", "condition-4-zh-5k")

# Access splits
train = ds["train"]
val = ds["validation"]

# Filter condition-3 by source type
native_only = train.filter(lambda x: x["source_type"] == "native")

Technical Details

Parameter Value
Source dataset bigcode/the-stack-dedup (Python subset)
Transpilation tool Legesher v0.7.3 (legesher-core, legesher-i18n)
Tokenizer CohereLabs/tiny-aya-base
Base model CohereLabs/tiny-aya-base (3.35B params)
Train/validation split 90% / 10% (seed 42)
File format Parquet (snappy compression)
Filtering criteria AST-valid, permissive licenses, 10--1000 lines, min 21 GitHub stars, no autogenerated files, SHA-256 deduplication

Limitations

  • Source bias: The Stack Dedup skews toward popular, well-starred GitHub repositories, which may not represent the full diversity of Python code in the wild.
  • Keyword-only transpilation: Legesher translates Python reserved words (keywords, builtins, exceptions) but leaves comments, docstrings, string literals, and variable/function names in their original language (typically English). This means condition-2 code is a hybrid of translated keywords and English identifiers.
  • Token count variation: Transpiled code may have different token counts than the English original due to multi-byte characters (especially for Chinese and Urdu), even though the code structure is identical.
  • Single programming language: Currently limited to Python. Results may not generalize to other programming languages.
  • Condition 4 scope: Native Chinese code is limited to publicly available sources (The Stack, Wenyan, Program-in-Chinese, Qi, Mulan) and may not represent the full spectrum of Chinese-language programming.

Citation

@misc{language-decoded-2026,
  title={Language Decoded: Investigating Language-Dependent vs. Structure-Dependent Reasoning Benefits of Code},
  author={Madison Edgar and Saad Ahmed Bazaz and Tom Sherborne and Rashik Shahjahan and Khojasteh Mirza and Sarah Jawaid and Rafay Mustafa and Sohaib Ahmed Bazaz},
  year={2026},
  publisher={Hugging Face},
  url={https://huggingface.co/datasets/legesher/language-decoded-data}
}

Links

License

Apache 2.0

Downloads last month
140

Collection including legesher/language-decoded-data

Paper for legesher/language-decoded-data