def remove_metadata(module_data, start_line, start_col, end_line, end_col):
 lines = module_data.split('\n')
 new_lines = lines[:start_line]
 if (start_col != 0):
  new_lines.append(lines[start_line][:start_col])
 next_line = lines[end_line]
 if ((len(next_line) - 1) != end_col):
  new_lines.append(next_line[end_col:])
 if (len(lines) > end_line):
  new_lines.extend(lines[(end_line + 1):])
 return '\n'.join(new_lines)

def remove_metadata ( module_data , start_line , start_col , end_line , end_col ) : lines = module_data . split ( '\n' ) new_lines = lines [ : start_line ] if ( start_col != 0 ) : new_lines . append ( lines [ start_line ] [ : start_col ] ) next_line = lines [ end_line ] if ( ( len ( next_line ) - 1 ) != end_col ) : new_lines . append ( next_line [ end_col : ] ) if ( len ( lines ) > end_line ) : new_lines . extend ( lines [ ( end_line + 1 ) : ] ) return '\n' . join ( new_lines )
remove a section of a module file .