REPOEXEC: Evaluate Code Generation with a Repository-Level Executable Benchmark
Paper • 2406.11927 • Published • 11
id int64 0 190k | prompt stringlengths 21 13.4M | docstring stringlengths 1 12k ⌀ |
|---|---|---|
0 | from setuptools import find_packages, setup
import os
import subprocess
import time
def readme():
with open('README.md', encoding='utf-8') as f:
content = f.read()
return content | null |
1 | from setuptools import find_packages, setup
import os
import subprocess
import time
version_file = 'realesrgan/version.py'
def get_hash():
if os.path.exists('.git'):
sha = get_git_hash()[:7]
else:
sha = 'unknown'
return sha
def write_version_py():
content = """# GENERATED VERSION FILE
#... | null |
2 | from setuptools import find_packages, setup
import os
import subprocess
import time
version_file = 'realesrgan/version.py'
def get_version():
with open(version_file, 'r') as f:
exec(compile(f.read(), version_file, 'exec'))
return locals()['__version__'] | null |
3 | from setuptools import find_packages, setup
import os
import subprocess
import time
def get_requirements(filename='requirements.txt'):
here = os.path.dirname(os.path.realpath(__file__))
with open(os.path.join(here, filename), 'r') as f:
requires = [line.replace('\n', '') for line in f.readlines()]
... | null |
4 | import argparse
import cv2
import glob
import mimetypes
import numpy as np
import os
import shutil
import subprocess
import torch
from basicsr.archs.rrdbnet_arch import RRDBNet
from basicsr.utils.download_util import load_file_from_url
from os import path as osp
from tqdm import tqdm
from realesrgan import RealESRGANer... | null |
5 | import argparse
import cv2
import glob
import mimetypes
import numpy as np
import os
import shutil
import subprocess
import torch
from basicsr.archs.rrdbnet_arch import RRDBNet
from basicsr.utils.download_util import load_file_from_url
from os import path as osp
from tqdm import tqdm
from realesrgan import RealESRGANer... | null |
6 | import os
os.system('pip install gfpgan')
os.system('python setup.py develop')
import cv2
import shutil
import tempfile
import torch
from basicsr.archs.rrdbnet_arch import RRDBNet
from basicsr.archs.srvgg_arch import SRVGGNetCompact
from realesrgan.utils import RealESRGANer
def clean_folder(folder):
for filename i... | null |
7 | import argparse
import cv2
import numpy as np
import os
import sys
from basicsr.utils import scandir
from multiprocessing import Pool
from os import path as osp
from tqdm import tqdm
def worker(path, opt):
"""Worker for each process.
Args:
path (str): Image path.
opt (dict): Configuration dict. ... | Crop images to subimages. Args: opt (dict): Configuration dict. It contains: input_folder (str): Path to the input folder. save_folder (str): Path to save folder. n_thread (int): Thread number. |
8 | import cv2
import numpy as np
from PIL import Image
def rotate_array(image: np.ndarray, angle: float) -> np.ndarray:
if angle == 0:
return image
h, w = image.shape[:2]
center = (w // 2, h // 2)
M = cv2.getRotationMatrix2D(center, angle, 1.0)
return cv2.warpAffine(image, M, (w, h))
def rotat... | null |
9 | import traceback
from typing import Dict
from scripts.io.util import load_classes_from_directory
from scripts.use_cases.face_detector import FaceDetector
from scripts.use_cases.face_processor import FaceProcessor
from scripts.use_cases.mask_generator import MaskGenerator
def create(all_classes, type: str) -> Dict:
... | null |
10 | import traceback
from typing import Dict
from scripts.io.util import load_classes_from_directory
from scripts.use_cases.face_detector import FaceDetector
from scripts.use_cases.face_processor import FaceProcessor
from scripts.use_cases.mask_generator import MaskGenerator
def create(all_classes, type: str) -> Dict:
def... | null |
11 | import traceback
from typing import Dict
from scripts.io.util import load_classes_from_directory
from scripts.use_cases.face_detector import FaceDetector
from scripts.use_cases.face_processor import FaceProcessor
from scripts.use_cases.mask_generator import MaskGenerator
def create(all_classes, type: str) -> Dict:
... | null |
12 | import operator
from typing import Dict
from lark import Lark, Tree
def starts_with(a, b):
return a.startswith(b) | null |
13 | import operator
from typing import Dict
from lark import Lark, Tree
def ends_with(a, b):
return a.endswith(b) | null |
14 | import operator
from typing import Dict
from lark import Lark, Tree
def contains(a, b):
return b in a | null |
15 | import operator
from typing import Dict
from lark import Lark, Tree
def not_contains(a, b):
return b not in a | null |
16 | import operator
from typing import Dict
from lark import Lark, Tree
def evaluate(query: str, attributes: Dict[str, str]) -> bool:
def validate(query: str):
return evaluate(query, {}) | null |
17 | from typing import Dict, List, Optional, Union
from pydantic import BaseModel, root_validator, validator
class Worker(BaseModel):
name: str
params: Optional[Dict]
def default_params(cls, values):
if "params" not in values or values["params"] is None:
values["params"] = {}
return ... | null |
18 | import os
import gradio as gr
from modules import script_callbacks, shared
from scripts.entities.option import Option
from scripts.io.util import inferencers_dir
from scripts.ui import workflow_editor
from scripts.ui.param_value_parser import ParamValueParser
inferencers_dir = os.path.join(get_path("scripts", "inferen... | null |
19 | import json
import os
from typing import Any, Dict, List
import gradio as gr
from modules import shared
from pydantic import ValidationError
from scripts.io.util import workflows_dir
from scripts.use_cases.workflow_manager import WorkflowManager
def load_workflow(file: str) -> str:
if file is not None:
file... | null |
20 | import cv2
import numpy as np
from modules.processing import StableDiffusionProcessingImg2Img
from PIL import Image
from scripts.entities.face import Face
from scripts.use_cases.face_processor import FaceProcessor
def color_generator(colors):
while True:
for color in colors:
yield color | null |
21 | import importlib.util
import inspect
import os
from typing import List, Type
import modules.scripts as scripts
from modules import shared
def get_path(*p: str) -> str:
dir = os.path.join(scripts.basedir(), *p)
if not os.path.isdir(dir):
dir = os.path.join(scripts.basedir(), "extensions", "sd-face-edito... | null |
22 | import seqio
import t5.data
from t5.data.glue_utils import get_glue_weight_mapping
from t5.data.glue_utils import get_super_glue_weight_mapping
from t5.data.glue_utils import get_super_glue_weight_mapping_sentinel
import t5.data.tasks
_GLUE_WEIGHT_MAPPING = get_glue_weight_mapping()
_SUPER_GLUE_WEIGHT_MAPPING = get_su... | null |
23 | import seqio
import t5.data
from t5.data.glue_utils import get_glue_weight_mapping
from t5.data.glue_utils import get_super_glue_weight_mapping
from t5.data.glue_utils import get_super_glue_weight_mapping_sentinel
import t5.data.tasks
_GLUE_WEIGHT_MAPPING = get_glue_weight_mapping()
_SUPER_GLUE_WEIGHT_MAPPING = get_su... | null |
24 | import gin
import seqio
DEFAULT_SPM_PATH = "gs://t5-data/vocabs/cc_all.32000/sentencepiece.model"
DEFAULT_EXTRA_IDS = 100
def get_default_vocabulary():
return seqio.SentencePieceVocabulary(DEFAULT_SPM_PATH, DEFAULT_EXTRA_IDS) | null |
25 | import gin
import seqio
The provided code snippet includes necessary dependencies for implementing the `rate_num_examples` function. Write a Python function `def rate_num_examples( task, maximum=None, temperature=1.0, scale=1.0, fallback_to_num_input_examples=True)` to solve the following problem:
Mixing rate ... | Mixing rate equal to the number of examples for the task. |
26 | import gin
import seqio
The provided code snippet includes necessary dependencies for implementing the `rate_unsupervised` function. Write a Python function `def rate_unsupervised(task, value=1e6)` to solve the following problem:
Gin-configurable mixing rate for the unsupervised co-training task.
Here is the function... | Gin-configurable mixing rate for the unsupervised co-training task. |
27 | import tensorflow.compat.v2 as tf
The provided code snippet includes necessary dependencies for implementing the `lower_text` function. Write a Python function `def lower_text(string, **unused_kwargs)` to solve the following problem:
Lowercases text.
Here is the function:
def lower_text(string, **unused_kwargs):
"... | Lowercases text. |
28 | import tensorflow.compat.v2 as tf
The provided code snippet includes necessary dependencies for implementing the `qa` function. Write a Python function `def qa(answer, example=None, is_target=False)` to solve the following problem:
Returns answer, or all answers if the full example is provided.
Here is the function:
... | Returns answer, or all answers if the full example is provided. |
29 | import tensorflow.compat.v2 as tf
The provided code snippet includes necessary dependencies for implementing the `span_qa` function. Write a Python function `def span_qa(answer, example=None, is_target=False)` to solve the following problem:
Returns answer, or a dict with answers and context if the example is provided... | Returns answer, or a dict with answers and context if the example is provided. |
30 | import tensorflow.compat.v2 as tf
The provided code snippet includes necessary dependencies for implementing the `wsc_simple` function. Write a Python function `def wsc_simple(prediction, example=None, is_target=False)` to solve the following problem:
Sees whether we predicted the referent or not.
Here is the functio... | Sees whether we predicted the referent or not. |
31 | import tensorflow.compat.v2 as tf
The provided code snippet includes necessary dependencies for implementing the `rank_classification` function. Write a Python function `def rank_classification(score, example=None, is_target=False, passthrough_fea... | A postprocessor for the `rank_classification` preprocessor and metric. |
32 | import collections
import functools
from t5.data import postprocessors
from t5.data import preprocessors
from t5.evaluation import metrics
GLUE_WEIGHT_MAPPING = {
"glue_cola_v002": 8_551.,
"glue_sst2_v002": 67_349.,
"glue_mrpc_v002": 3_668.,
"glue_qqp_v002": 363_849.,
"glue_stsb_v002": 5_749.,
"... | null |
33 | import collections
import functools
from t5.data import postprocessors
from t5.data import preprocessors
from t5.evaluation import metrics
SUPER_GLUE_WEIGHT_MAPPING = {
"dpr_v001_simple": 1_322.,
"super_glue_wsc_v102_simple_train": 259.,
"super_glue_wsc_v102_simple_eval": 0.,
"super_glue_boolq_v102": 9_... | null |
34 | import collections
import functools
from t5.data import postprocessors
from t5.data import preprocessors
from t5.evaluation import metrics
SUPER_GLUE_WEIGHT_MAPPING_SENTINEL = {
"dpr_v001_simple_1_sentinel": 1_322.,
"super_glue_wsc_v102_simple_1_sentinel_train": 259.,
"super_glue_wsc_v102_simple_1_sentinel_... | null |
35 | import collections
import functools
from t5.data import postprocessors
from t5.data import preprocessors
from t5.evaluation import metrics
The provided code snippet includes necessary dependencies for implementing the `get_glue_text_preprocessor` function. Write a Python function `def get_glue_text_preprocessor(builde... | Return the glue preprocessor. Args: builder_config: a BuilderConfig Returns: a preprocessor function |
36 | import collections
import functools
from t5.data import postprocessors
from t5.data import preprocessors
from t5.evaluation import metrics
def get_glue_postprocess_fn(builder_config):
if builder_config.name == "stsb":
return postprocessors.string_to_float
elif builder_config.name == "multirc":
return postp... | null |
37 | import collections
import functools
from t5.data import postprocessors
from t5.data import preprocessors
from t5.evaluation import metrics
GLUE_METRICS = collections.OrderedDict([
("cola", [metrics.sklearn_metrics_wrapper(
"matthews_corrcoef", metric_post_process_fn=lambda x: 100 * x)]),
("sst2", [metri... | null |
38 | import collections
import functools
from t5.data import postprocessors
from t5.data import preprocessors
from t5.evaluation import metrics
SUPERGLUE_METRICS = collections.OrderedDict([
("boolq", [metrics.accuracy]),
("cb", [metrics.mean_multiclass_f1(num_classes=3), metrics.accuracy]),
("copa", [metrics.acc... | null |
39 | import collections
import functools
import math
import re
from typing import Any, Callable, Mapping, Optional, Protocol, Sequence, Union
import uuid
from absl import logging
import babel
import gin
import seqio
import tensorflow.compat.v2 as tf
The provided code snippet includes necessary dependencies for implementing... | Convert a summarization dataset to a text2text pair. For example, say the dataset returns examples of this format: {'article': <article>, 'highlights': <summary>} If article_key = 'article', summary_key = 'highlights', then the outputs will have the format: {'inputs': 'summarize': <article>, 'targets': <summary>} Args:... |
40 | import collections
import functools
import math
import re
from typing import Any, Callable, Mapping, Optional, Protocol, Sequence, Union
import uuid
from absl import logging
import babel
import gin
import seqio
import tensorflow.compat.v2 as tf
NON_SPACED_LANGUAGE_RANGES = (
'\u1000-\u104f', # Burmese
'\u4e00-... | Pad non-spaced languages with spaces around each character. Args: x: an example to process. text_key: a string, the key for the text feature to preprocess in the dataset examples. Returns: A preprocessed example. |
41 | import collections
import functools
import math
import re
from typing import Any, Callable, Mapping, Optional, Protocol, Sequence, Union
import uuid
from absl import logging
import babel
import gin
import seqio
import tensorflow.compat.v2 as tf
AUTOTUNE = tf.data.experimental.AUTOTUNE
def _pad_punctuation(text):
"""A... | Convert a TriviaQA example to multiple flattened examples. TriviaQA produces examples with this form: {'entity_pages': {dict of wiki entities}, 'search_results': <dict of web search results>, 'answer': {dict of all answers}, 'question': <question>, 'question_id': <question_id>, 'question_source': <question_source>} Thi... |
42 | import collections
import functools
import math
import re
from typing import Any, Callable, Mapping, Optional, Protocol, Sequence, Union
import uuid
from absl import logging
import babel
import gin
import seqio
import tensorflow.compat.v2 as tf
AUTOTUNE = tf.data.experimental.AUTOTUNE
def squad(x, include_context=True)... | Convert SQuAD examples to a text2text pair with span output. SQuAD produces examples with this form: {'context': <article>, 'question': <question>, 'answers': { 'text': [<all answers>] }} This function returns examples with the format {'inputs': 'context: <article> question: <question>', 'targets': 'start: <start_index... |
43 | import collections
import functools
import math
import re
from typing import Any, Callable, Mapping, Optional, Protocol, Sequence, Union
import uuid
from absl import logging
import babel
import gin
import seqio
import tensorflow.compat.v2 as tf
The provided code snippet includes necessary dependencies for implementing... | Randomly split single-string examples into multiple examples each. Segment lengths are chosen according to a log-uniform distribution. Each incoming string is chopped into multiple equal-length examples with the last one possibly being shorter. If the input string is longer than max_words_total, then we use one random ... |
44 | import collections
import functools
import math
import re
from typing import Any, Callable, Mapping, Optional, Protocol, Sequence, Union
import uuid
from absl import logging
import babel
import gin
import seqio
import tensorflow.compat.v2 as tf
def split_text_to_words(dataset, text_key='text', min_num_words=2):
"""Sp... | Create a dataset consisting of fill-in-the-blank text examples. The input examples should have a key text_key associated with a tf.string value. The output examples have keys 'inputs' and 'targets'. The input string is split on whitespace to form a sequence of words. This sequence is chopped randomly into segments of o... |
45 | import collections
import functools
import math
import re
from typing import Any, Callable, Mapping, Optional, Protocol, Sequence, Union
import uuid
from absl import logging
import babel
import gin
import seqio
import tensorflow.compat.v2 as tf
def split_text_to_words(dataset, text_key='text', min_num_words=2):
"""Sp... | Fill in the blank preprocessor that labels blank with a binned size. The actual blank size is sampled uniformly from the inclusive range of the min and max bin. The blank is then filled in with the closest bin size to the actual blank size. Args: dataset: a tf.data.Dataset, the dataset to preprocess. size_bins: a list,... |
46 | import collections
import functools
import math
import re
from typing import Any, Callable, Mapping, Optional, Protocol, Sequence, Union
import uuid
from absl import logging
import babel
import gin
import seqio
import tensorflow.compat.v2 as tf
AUTOTUNE = tf.data.experimental.AUTOTUNE
def translate(x, source_language, ... | Convert a multi-translate dataset to a text2text pair. For example, say the dataset returns examples which have a 'translations' feature key so that examples have the following format: { ... 'translations': { 'language': ['de', 'fr', 'en'], 'translation': ['Das ist gut.', 'Ca c'est bon', 'That is good.'] }, ... } If so... |
47 | import collections
import functools
import math
import re
from typing import Any, Callable, Mapping, Optional, Protocol, Sequence, Union
import uuid
from absl import logging
import babel
import gin
import seqio
import tensorflow.compat.v2 as tf
The provided code snippet includes necessary dependencies for implementing... | Converts DPR examples to a simple text to text format. A typical example from the definite pronoun resolution dataset might look like { 'sentence': 'Bob asked Tom if he can lend some money.', 'pronoun': 'he', 'candidates': ['Bob', 'Tom'], 'label': 1, } This will be transformed to { 'inputs': 'wsc: Bob asked Tom if *he*... |
48 | import collections
import functools
import math
import re
from typing import Any, Callable, Mapping, Optional, Protocol, Sequence, Union
import uuid
from absl import logging
import babel
import gin
import seqio
import tensorflow.compat.v2 as tf
def neighboring_pairs(dataset, text_key='text', reuse_sentences=True):
""... | Create a dataset containing a next sentence prediction objective. The input examples should have a key text_key associated with a tf.string value. The output examples have keys 'inputs' and 'targets'. EXAMPLE OUTPUTS: { input: "nsp: sentence1: The man went to the store. sentence2: Penguins are " "flightless birds.", ta... |
49 | import collections
import functools
import math
import re
from typing import Any, Callable, Mapping, Optional, Protocol, Sequence, Union
import uuid
from absl import logging
import babel
import gin
import seqio
import tensorflow.compat.v2 as tf
The provided code snippet includes necessary dependencies for implementing... | Basic language modeling objective for text - empty inputs. Given inputs with the format: {"text": "Here is some text."} This preprocess produces examples with the format {"inputs": "", "targets": "Here is some text."} Args: x: an example to process. Returns: A preprocessed example. |
50 | import collections
import functools
import math
import re
from typing import Any, Callable, Mapping, Optional, Protocol, Sequence, Union
import uuid
from absl import logging
import babel
import gin
import seqio
import tensorflow.compat.v2 as tf
AUTOTUNE = tf.data.experimental.AUTOTUNE
def _wsc_inputs(x):
"""Given an ... | Converts SuperGLUE WSC examples to a simple text to text format. A typical example from SuperGLUE WSC might look like { 'text': 'Mitchell asked Tom if he could lend some money.', 'span1_text': 'Tom', 'span2_text': 'he', 'span2_index': 4, } This will be transformed to { 'inputs': 'wsc: Bob asked Tom if *he* can lend som... |
51 | import collections
import functools
import math
import re
from typing import Any, Callable, Mapping, Optional, Protocol, Sequence, Union
import uuid
from absl import logging
import babel
import gin
import seqio
import tensorflow.compat.v2 as tf
The provided code snippet includes necessary dependencies for implementing... | Converts GLUE WNLI examples to a simple text to text format. A typical example from WNLI might look like: { 'sentence1': 'The fish ate the worm. It was tasty.', 'sentence2': 'The worm was tasty.', 'label': 1, } This will be transformed to: { 'inputs': 'wsc: The fish ate the worm. *It* was tasty.', 'targets': 'The worm'... |
52 | import collections
import functools
import math
import re
from typing import Any, Callable, Mapping, Optional, Protocol, Sequence, Union
import uuid
from absl import logging
import babel
import gin
import seqio
import tensorflow.compat.v2 as tf
def rank_classification(
ds: tf.data.Dataset,
inputs_fn: Callable[[... | Create 'inputs' and 'targets' strings for ranking classification. Intended to be used with `rank_classification` postprocessor and metric. Inputs will be formatted by filling in the feature values in the `inputs_formats` and `targets_formats` strings. Nested features can be accessed by concatenating the features using ... |
53 | import collections
import functools
import math
import re
from typing import Any, Callable, Mapping, Optional, Protocol, Sequence, Union
import uuid
from absl import logging
import babel
import gin
import seqio
import tensorflow.compat.v2 as tf
The provided code snippet includes necessary dependencies for implementing... | Splits TSV lines into dict examples mapping field name to string value. Args: line: an example containing a comma/tab-delimited string. field_names: a list of strings, the ordered names of the TSV fields. Defaults to "inputs" and "targets". field_delim: a string, the delimiter to split on e.g. ',' for csv. field_column... |
54 | import collections
import functools
import math
import re
from typing import Any, Callable, Mapping, Optional, Protocol, Sequence, Union
import uuid
from absl import logging
import babel
import gin
import seqio
import tensorflow.compat.v2 as tf
The provided code snippet includes necessary dependencies for implementing... | r"""Parse tab-delimited strings into inputs and targets. This function takes a tf.data.Dataset of strings, each of which contains tab-delimited fields. The function returns a tf.data.Dataset of feature dictionaries of the form {"inputs": string, "targets": string}. inputs_format contains a template string and field num... |
55 | import collections
import functools
import math
import re
from typing import Any, Callable, Mapping, Optional, Protocol, Sequence, Union
import uuid
from absl import logging
import babel
import gin
import seqio
import tensorflow.compat.v2 as tf
def select_random_chunk(dataset: tf.data.Dataset,
o... | Final pretraining objective used in Raffel et al., 2019. Args: dataset: A tf.data.Dataset with dictionaries containing the key `input_feature_key`. sequence_length: dict mapping of feature key to int length for that feature. output_features: mapping of keys to features. mean_noise_span_length: the mean number of tokens... |
56 | import collections
import functools
import math
import re
from typing import Any, Callable, Mapping, Optional, Protocol, Sequence, Union
import uuid
from absl import logging
import babel
import gin
import seqio
import tensorflow.compat.v2 as tf
def select_random_chunk(dataset: tf.data.Dataset,
o... | Baseline pretraining objective used in Raffel et al., 2019. |
57 | import collections
import functools
import math
import re
from typing import Any, Callable, Mapping, Optional, Protocol, Sequence, Union
import uuid
from absl import logging
import babel
import gin
import seqio
import tensorflow.compat.v2 as tf
def select_random_chunk(dataset: tf.data.Dataset,
o... | Prefix language modeling objective used in Raffel et al. 2019. |
58 | import collections
import functools
import math
import re
from typing import Any, Callable, Mapping, Optional, Protocol, Sequence, Union
import uuid
from absl import logging
import babel
import gin
import seqio
import tensorflow.compat.v2 as tf
def select_random_chunk(dataset: tf.data.Dataset,
o... | Full language modeling objective with EOS only at document boundaries. |
59 | import collections
import functools
import math
import re
from typing import Any, Callable, Mapping, Optional, Protocol, Sequence, Union
import uuid
from absl import logging
import babel
import gin
import seqio
import tensorflow.compat.v2 as tf
The provided code snippet includes necessary dependencies for implementing... | Token-preprocessor to trim sequence at the beginning. Args: x: an example with dictionaries containing keys_to_trim. sequence_length: a dict of ints. keys_to_trim: a list of feature keys. Returns: A preprocessed example. |
60 | import collections
import functools
import math
import re
from typing import Any, Callable, Mapping, Optional, Protocol, Sequence, Union
import uuid
from absl import logging
import babel
import gin
import seqio
import tensorflow.compat.v2 as tf
The provided code snippet includes necessary dependencies for implementing... | Token preprocessor for the trivia QA dataset to truncate inputs. This function takes a dataset containing "targets" and "inputs". It searches for the "targets" in the "inputs" and truncates the "inputs" to `sequence_length` while ensuring that the "targets" are present in the "inputs". The function will randomly select... |
61 | import collections
import functools
import math
import re
from typing import Any, Callable, Mapping, Optional, Protocol, Sequence, Union
import uuid
from absl import logging
import babel
import gin
import seqio
import tensorflow.compat.v2 as tf
The provided code snippet includes necessary dependencies for implementing... | Configure this to point at unsupervised preprocessors. This function creates an extra level of indirection in case we want different unsupervised pretraining functions in the future which do not fit into the denoise() framework. This function should be used as a post-cache preprocessing function. Args: dataset: A tf.da... |
62 | import collections
import functools
import math
import re
from typing import Any, Callable, Mapping, Optional, Protocol, Sequence, Union
import uuid
from absl import logging
import babel
import gin
import seqio
import tensorflow.compat.v2 as tf
def split_tokens(dataset: tf.data.Dataset,
min_tokens_per_... | null |
This source contains the instruction-tuning dataset to fine-tune models in our work.
{
"id": 0,
"prompt": "import base64\nimport random\nimport unicodedata\nimport zlib\nfrom typing import Union\nfrom uuid import uuid4\nfrom ._regex import *\nfrom .errors import InvalidInputError\nfrom .validation import is_snake_case, is_full_string, is_camel_case, is_integer, is_string\n\nclass InvalidInputError(TypeError):\n \"\"\"\n Custom error raised when received object is not a string as expected.\n \"\"\"\n\n def __init__(self, input_data: Any):\n \"\"\"\n :param input_data: Any received object\n \"\"\"\n type_name = type(input_data).__name__\n msg = 'Expected \"str\", received \"{}\"'.format(type_name)\n super().__init__(msg)\n\ndef is_string(obj: Any) -> bool:\n \"\"\"\n Checks if an object is a string.\n\n *Example:*\n\n >>> is_string('foo') # returns true\n >>> is_string(b'foo') # returns false\n\n :param obj: Object to test.\n :return: True if string, false otherwise.\n \"\"\"\n return isinstance(obj, str)\n\ndef reverse(input_string: str) -> str:\n \"\"\"\n Returns the string with its chars reversed.\n\n *Example:*\n\n >>> reverse('hello') # returns 'olleh'\n\n :param input_string: String to revert.\n :type input_string: str\n :return: Reversed string.\n \"\"\"\n",
"docstring":
}
Data fields for inline level:
The instruction tuning dataset is not split and only contains data subset.
You can load this dataset using datasets library: pip install datasets
from datasets import load_dataset
# Load full dataset
dataset = load_dataset("Fsoft-AIC/RepoExec-Instruct")
MIT License
@article{nam2024repoexec,
title={RepoExec: Evaluate Code Generation with a Repository-Level Executable Benchmark},
author={Hai, Nam Le and Manh, Dung Nguyen and Bui, Nghi DQ},
journal={arXiv preprint arXiv:2406.11927v1},
year={2024}
}
This dataset is developed by FSOFT AI4Code team.