docs: def parse_acl(acl_iter):
      """Parse a string, or list of ACE definitions, into usable ACEs."""
  
      if isinstance(acl_iter, basestring):
          acl_iter = [acl_iter]
  
      for chunk in acl_iter:
  
          if isinstance(chunk, basestring):
              chunk = chunk.splitlines()
              chunk = [re.sub(r'#.+', '', line).strip() for line in chunk]
              chunk = filter(None, chunk)
          else:
              chunk = [chunk]
  
          for ace in chunk:
  
              # If this was provided as a string, then parse the permission set.
              # Otherwise, use it as-is, which will result in an equality test.
              if isinstance(ace, basestring):
                  ace = ace.split(None, 2)
                  state, predicate, permission_set = ace
                  yield parse_state(state), parse_predicate(predicate), parse_permission_set(permission_set)
              else:
                  state, predicate, permission_set = ace
                  yield parse_state(state), parse_predicate(predicate), permission_set