def close_all_open_files(exclude=set()):
 maxfd = get_maximum_file_descriptors()
 for fd in reversed(range(maxfd)):
  if (fd not in exclude):
   close_file_descriptor_if_open(fd)

def close_all_open_files ( exclude = set ( ) ) : maxfd = get_maximum_file_descriptors ( ) for fd in reversed ( range ( maxfd ) ) : if ( fd not in exclude ) : close_file_descriptor_if_open ( fd )
close all open file descriptors .