Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def read_file(file_name):
"""
Reads a JSON file, skipping any bad segments
"""
with open(file_name, encoding="utf-8") as f:
input_json = json.load(f)
segments = read_in_memory(input_json)
return segments