code: def parse_helper(attrs, attrs_name, alt_value=None):
      
      tuple_re = re.compile('\([0-9L|,| ]+\)')
      if not attrs:
          return alt_value
      attrs_str = None if attrs.get(attrs_name) is None else str(attrs.get(attrs_name))
      if attrs_str is None:
          return alt_value
      attrs_match = tuple_re.search(attrs_str)
      if attrs_match is not None:
          if attrs_match.span() == (0, len(attrs_str)):
              dims = eval(attrs_str)
              return dims
          else:
              raise AttributeError("Malformed %s dimensions: %s" % (attrs_name, str(attrs_str)))
      return alt_value
docs: Helper function to parse operator attributes in required format.