p-doom/crowd-code-dataset-0.2 huggingface dataset:
[terminal_command] TERMINAL ()
python crowd-pilot/serialize_dataset_array_record.py --csv_root="/fast/project/HFMI_SynergyUnit/jafar_ws/data/crowd-pilot/crowd-code-0.1/csv/" --output_dir="/fast/project/HFMI_SynergyUnit/jafar_ws/data/crowd-pilot/crowd-code-0.1/array_record/"
[terminal_command] TERMINAL ()
python crowd-pilot/serialize_dataset_array_record.py --csv_root="/fast/project/HFMI_SynergyUnit/jafar_ws/data/crowd-pilot/crowd-code-0.1/csv/" --output_dir="/fast/project/HFMI_SynergyUnit/jafar_ws/data/crowd-pilot/crowd-code-0.1/bash_format_array_record/"
[content] crowd-pilot/serialization_utils.py (python)
                # Prepare sed command based on change type: insert, delete, replace
                before_total_lines = len(before.splitlines())
                if end_line < start_line:
                    # Pure insertion at position i1 (insert before start_line), or append at EOF
                    escaped_lines = [_escape_single_quotes_for_sed(line) for line in repl_lines]
                    sed_payload = "
".join(escaped_lines)
                    if start_line <= max(1, before_total_lines):
                        sed_cmd = f"sed -i '{start_line}i\\
{sed_payload}' {file_path}"
                    else:
                        sed_cmd = f"sed -i '$a\\
{sed_payload}' {file_path}"
                elif not repl_lines:
                    # Pure deletion
                    sed_cmd = f"sed -i '{start_line},{end_line}d' {file_path}"
                else:
                    # Replacement of a contiguous block
                    escaped_lines = [_escape_single_quotes_for_sed(line) for line in repl_lines]
                    sed_payload = "
".join(escaped_lines)
                    sed_cmd = f"sed -i '{start_line},{end_line}c\\
{sed_payload}' {file_path}"
[content] crowd-pilot/serialization_utils.py (python)
        # No visible change; choose a safe single-line replace at end of file
        start_line = max(1, len(before_lines))
        end_line = start_line
        repl = after_lines[start_line - 1:start_line] if after_lines else [""]
        return (start_line, end_line, repl)