docs: def _select_by_field_or_tag(self, tag=None, field=None):
          """For internal use only. Returns an OrderedDict of {identifier: field}
          representing fields which match the supplied field/tag.
  
          Parameters
          ----------
          tag : str
              Optionally specifies that the mask should only include fields with
              the specified tag.
          field : str
              Optionally specifies that the mask should only include the
              specified field.
  
          Raises
          ------
          UnknownTagError
              If the tag specified using the `tag` argument does not exist.
          UnavailableFieldError
              If the field specified using the `field` argument does not exist or
              is not available.
          """
          # Get the set of fields whose values will be included in the value
          if field is not None:
              # Select just the specified field (checking the field exists)
              field_obj = self.fields.get_field(field, self.field_values)
              selected_fields = OrderedDict([(field, field_obj)])
          elif tag is not None:
              # Select just fields with the specified tag
              selected_fields = OrderedDict(
                  (i, f)
                  for (i, f) in self.fields.enabled_fields(self.field_values)
                  if tag in f.tags)
              # Fail if no fields match the supplied tag. Because tags are
              # applied to parent fields in the hierarchy, it is guaranteed that
              # if a tag exists, at least one top-level (i.e. always present)
              # field will have the tag.
              if not selected_fields:
                  raise UnknownTagError(tag)
          else:
              # No specific field/tag supplied, select all enabled fields.
              selected_fields = OrderedDict(
                  (i, f)
                  for (i, f) in self.fields.enabled_fields(self.field_values))
  
          return selected_fields