code: def _format_object_mask(objectmask):
      
      objectmask = objectmask.strip()
  
      if (not objectmask.startswith('mask') and
              not objectmask.startswith('[')):
          objectmask = "mask[%s]" % objectmask
      return objectmask
docs: Format the new style object mask.
  
      This wraps the user mask with mask[USER_MASK] if it does not already
      have one. This makes it slightly easier for users.
  
      :param objectmask: a string-based object mask