def get_non_generated_file_lines():
 lines_to_copy = []
 flag_found = False
 with open('./plotly/graph_objs/graph_objs.py', 'r') as f:
  for line_to_copy in f:
   if line_to_copy.startswith(FLAG):
    flag_found = True
    break
   lines_to_copy.append(line_to_copy)
 if (not flag_found):
  raise ValueError('Failed to find flag:\n"{}"\nin graph_objs_tools.py.'.format(FLAG))
 return lines_to_copy

def get_non_generated_file_lines ( ) : lines_to_copy = [ ] flag_found = False with open ( './plotly/graph_objs/graph_objs.py' , 'r' ) as f : for line_to_copy in f : if line_to_copy . startswith ( FLAG ) : flag_found = True break lines_to_copy . append ( line_to_copy ) if ( not flag_found ) : raise ValueError ( 'Failed to find flag:\n"{}"\nin graph_objs_tools.py.' . format ( FLAG ) ) return lines_to_copy
copy each line up to our special flag line and return .