#NEWLINE# def get_json_objects( files ) : #NEWLINE# #INDENT# objects = [ ] #NEWLINE# for f in contents : #NEWLINE# #INDENT# contents = open ( f , 'r' ) . read ( ) #NEWLINE# data = json_util . loads ( contents ) #NEWLINE# if isinstance ( data , list ) : #NEWLINE# #INDENT# objects += data #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( data , dict ) : #NEWLINE# #INDENT# objects . append ( data ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# logging . warning ( 'JSON file {} did not contain an object or list of objects' . format ( f ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return objects