Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
yaml_data.append(line)
continue
# there was no ----* marker
if not found_first and stripped_line != "":
break
if not found_first:
return input_data, MetaSchema().load({})
new_input = input_data[skipped_chars:]
if len(yaml_data) == 0:
return new_input, MetaSchema().load({})
yaml_data = "\n".join(yaml_data)
data = MetaSchema().loads(yaml_data)
return new_input, data
if not found_first:
found_first = True
# found the second one
else:
break
if found_first and not is_marker:
yaml_data.append(line)
continue
# there was no ----* marker
if not found_first and stripped_line != "":
break
if not found_first:
return input_data, MetaSchema().load({})
new_input = input_data[skipped_chars:]
if len(yaml_data) == 0:
return new_input, MetaSchema().load({})
yaml_data = "\n".join(yaml_data)
data = MetaSchema().loads(yaml_data)
return new_input, data