parameters: (template)
return_statement: return list(extractor.attributes)
docstring: Extract attributes from a command string template.
  
          E.g., for template 'ls %(dir1)s %(dir2)s' the result is
          ['dir1', 'dir2'].
  
          Args:
              template: The template to extract attributes from.
          Returns:
              The list of named attributes extracted from the template.
docstring_summary: Extract attributes from a command string template.
docstring_tokens: Extract attributes from a command string template .
function: def _get_command_attributes(template):
          """Extract attributes from a command string template.
  
          E.g., for template 'ls %(dir1)s %(dir2)s' the result is
          ['dir1', 'dir2'].
  
          Args:
              template: The template to extract attributes from.
          Returns:
              The list of named attributes extracted from the template.
          """
          class Extractor:
              """Helper class extracting attributes from a string template.
              """
              def __init__(self):
                  self.attributes = set()
  
              def __getitem__(self, attribute):
                  self.attributes.add(attribute)
                  return 0
  
          extractor = Extractor()
          try:
              template % extractor
          except ValueError:
              LOG.exception('failed to customize template %s', template)
          return list(extractor.attributes)
function_tokens: def _get_command_attributes ( template ) : class Extractor : """Helper class extracting attributes from a string template.
              """ def __init__ ( self ) : self . attributes = set ( ) def __getitem__ ( self , attribute ) : self . attributes . add ( attribute ) return 0 extractor = Extractor ( ) try : template % extractor except ValueError : LOG . exception ( 'failed to customize template %s' , template ) return list ( extractor . attributes )