docs: def _gettags(self, codes=None, lock=None):
          """Return list of (code, TiffTag)."""
          tags = []
          for tag in self.tags.values():
              code = tag.code
              if not codes or code in codes:
                  tags.append((code, tag))
          return tags