parameters: (self, names, info_dict)
return_statement: return [name
                  for name in names
                  if is_required(name)]
docstring: Check each element name in the supplied dictionary and remove it if not
          required by the generator.
  
          This will allow some operations to take place before endFile no matter the order of generation.
docstring_summary: Check each element name in the supplied dictionary and remove it if not
          required by the generator.
docstring_tokens: Check each element name in the supplied dictionary and remove it if not required by the generator .
function: def keepOnlyRequired(self, names, info_dict):
          """Check each element name in the supplied dictionary and remove it if not
          required by the generator.
  
          This will allow some operations to take place before endFile no matter the order of generation."""
          # TODO Unpleasantly breaks encapsulation. Should be a method in the registry class
  
          def is_required(name):
              info = self.registry.lookupElementInfo(name, info_dict)
              if info is None:
                  return False
              if not info.required:
                  self.logMsg('diag', 'keepOnlyRequired: element',
                              name, 'IS NOT required, skipping')
              return info.required
  
          return [name
                  for name in names
                  if is_required(name)]
function_tokens: def keepOnlyRequired ( self , names , info_dict ) : # TODO Unpleasantly breaks encapsulation. Should be a method in the registry class def is_required ( name ) : info = self . registry . lookupElementInfo ( name , info_dict ) if info is None : return False if not info . required : self . logMsg ( 'diag' , 'keepOnlyRequired: element' , name , 'IS NOT required, skipping' ) return info . required return [ name for name in names if is_required ( name ) ]