code: def attrgetrow(self, groupname, key, value=None):
          if not isinstance(key, str):
              return self._attrgetrow(groupname, key)
          rownrs = self.attrfindrows(groupname, key, value)
          if len(rownrs) == 0:
              raise IndexError("Image attribute " + key + " in group " +
                               groupname + " has no matches for value " +
                               str(value))
          if len(rownrs) > 1:
              raise IndexError("Image attribute " + key + " in group " +
                               groupname + " has multiple matches for value " +
                               str(value))
          return self._attrgetrow(groupname, rownrs[0])