class_docstr: Base selector implementation.
class_docstr_tok: ["Base","selector","implementation","."]
code: def modify(self, fileobj, events, data=None):
      try:
          key = self._fd_to_key[self._fileobj_lookup(fileobj)]
      except KeyError:
          raise KeyError(
              "{!r} is not registered".format(fileobj)
          ) from None
      if events != key.events:
          self.unregister(fileobj)
          key = self.register(fileobj, events, data)
      elif data != key.data:
          # Use a shortcut to update the data.
          key = key._replace(data=data)
          self._fd_to_key[key.fd] = key
      return key
  
imports: from abc import ABCMeta, abstractmethod
  from collections import namedtuple
  from collections.abc import Mapping
  import math
  import select
  import sys
label_desc: Use image node_id 5 for calling the _BaseSelectorImpl obj's underlying member method code with example usage: obj.modify(fileobj, events, data) and returns: key