#NEWLINE# def register_sensors( packs_base_paths = None , pack_dir = None , use_pack_cache = True , fail_on_failure = False ) : #NEWLINE# #INDENT# if packs_base_paths : #NEWLINE# #INDENT# assert isinstance ( packs_base_paths , list ) #NEWLINE# #UNINDENT# if ( not packs_base_paths ) : #NEWLINE# #INDENT# packs_base_paths = content_utils . get_packs_base_paths ( ) #NEWLINE# #UNINDENT# registrar = SensorsRegistrar ( use_pack_cache = use_pack_cache , fail_on_failure = fail_on_failure ) #NEWLINE# if pack_dir : #NEWLINE# #INDENT# result = registrar . register_sensors_from_pack ( pack_dir = pack_dir ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# result = registrar . register_sensors_from_packs ( base_dirs = packs_base_paths ) #NEWLINE# #UNINDENT# return result