Dataset Preview Go to dataset viewer
The dataset preview is not available for this dataset.
Cannot get the split names for the dataset.
Error code:   SplitsNamesError
Exception:    SplitsNotFoundError
Message:      The split names could not be parsed from the dataset config.
Traceback:    Traceback (most recent call last):
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/inspect.py", line 376, in get_dataset_config_info
                  for split_generator in builder._split_generators(
                File "/tmp/modules-cache/datasets_modules/datasets/Samip--Scotch/67cf5e23d215c62fa9f2199dd684874cf3355e6f88641d9b7b98ef153efaca15/Scotch.py", line 102, in _split_generators
                  data_dir = [os.path.join(lang_dir,lang) for lang,lang_dir in dl_manager.download_and_extract(my_urls).items()]
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py", line 946, in download_and_extract
                  return self.extract(self.download(url_or_urls))
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py", line 909, in extract
                  urlpaths = map_nested(self._extract, path_or_paths, map_tuple=True)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 428, in map_nested
                  mapped = [
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 429, in <listcomp>
                  _single_map_nested((function, obj, types, None, True, None))
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 330, in _single_map_nested
                  return function(data_struct)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py", line 914, in _extract
                  protocol = _get_extraction_protocol(urlpath, use_auth_token=self.download_config.use_auth_token)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py", line 390, in _get_extraction_protocol
                  raise NotImplementedError(
              NotImplementedError: Extraction protocol for TAR archives like 'https://scotchdata.s3.amazonaws.com/python.tar.gz' is not implemented in streaming mode. Please use `dl_manager.iter_archive` instead.
              
              The above exception was the direct cause of the following exception:
              
              Traceback (most recent call last):
                File "/src/services/worker/src/worker/responses/splits.py", line 79, in get_splits_response
                  split_full_names = get_dataset_split_full_names(dataset, hf_token)
                File "/src/services/worker/src/worker/responses/splits.py", line 39, in get_dataset_split_full_names
                  return [
                File "/src/services/worker/src/worker/responses/splits.py", line 42, in <listcomp>
                  for split in get_dataset_split_names(dataset, config, use_auth_token=hf_token)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/inspect.py", line 426, in get_dataset_split_names
                  info = get_dataset_config_info(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/inspect.py", line 381, in get_dataset_config_info
                  raise SplitsNotFoundError("The split names could not be parsed from the dataset config.") from err
              datasets.inspect.SplitsNotFoundError: The split names could not be parsed from the dataset config.

Need help to make the dataset viewer work? Open an discussion for direct support.

YAML Metadata Warning: empty or missing yaml metadata in repo card (https://huggingface.co/docs/hub/datasets-cards)

Dataset Summary

Scotch is a dataset of about 19 million functions collected from open-source repositiories from GitHub with permissive licenses. Each function has its corresponding code context and about 4 million functions have corresponding docstrings.

Languages

The dataset includes functions written in programming languages Python, Java, Javascript, and Go.

Statistics

Split

The functions with docstrings is splitted into train, valid, and test set of 3200626, 400077, 400080 functions respectively.

Features

Each function consists of following features:

  • repository_name: Name of the repository the function belongs to.
  • function_path: Path of the function within the repository.
  • function_identifier: Function name/identifier.
  • language: Programming language the function is written in.
  • function: Function string.
  • docstring: Function docstring.
  • function_url: URL to the function code.
  • context: Code context.
  • license: License info of the repository (includes only repositories with permissive licenses).

Data Collection

The dataset is collected from GitHub repositories of respective languages with 5 or more stars. Such repositories are listed using SEART. Functions are parsed using a lightweight parser build on top of function parser from CodeSearchNet dataset and repositories were collected with help of github-downloader from EleutherAI.

Data Processing

All the code without permissive licenses are removed and deduplication is performed on the remaining set of functions. Afterwards, all the functions with single line of code, whose docstring contains non-English characters are removed. Files with multiple same functions are excluded. This results in about 19M functions. To obtain a dataset of NL-Code pairs, functions with no docstrings or doctrings less than 3 tokens separated by white-space are excluded. Following CodeSearchNet, functions with 'test' keyword in their name are excluded.

License

This dataset is under MIT License. However, the repositories the functions are collected from may have several permissive licenses. Those licenses include MIT License, Apache License 2.0, BSD 3-Clause “New” or “Revised” License, BSD 2-Clause “Simplified” License, and ISC License.

Edit dataset card
Evaluate models HF Leaderboard