parameters: (patch_data)
return_statement: return patches
docstring: Split a concatenated series of patches into N separate patches
docstring_summary: Split a concatenated series of patches into N separate patches
docstring_tokens: Split a concatenated series of patches into N separate patches
function: def split_patches(patch_data):
    """Split a concatenated series of patches into N separate patches"""
    patches = []
    patch_start = re.compile('^From [0-9a-f]+ ')
    # Keep line endings in case any patches target files with CRLF.
    keep_line_endings = True
    for line in patch_data.splitlines(keep_line_endings):
      if patch_start.match(line):
        patches.append([])
      patches[-1].append(line)
    return patches
function_tokens: def split_patches ( patch_data ) : patches = [ ] patch_start = re . compile ( '^From [0-9a-f]+ ' ) # Keep line endings in case any patches target files with CRLF. keep_line_endings = True for line in patch_data . splitlines ( keep_line_endings ) : if patch_start . match ( line ) : patches . append ( [ ] ) patches [ - 1 ] . append ( line ) return patches