code: def get_key(self, fileobj):
          
          mapping = self.get_map()
          if mapping is None:
              raise RuntimeError("Selector is closed")
          try:
              return mapping[fileobj]
          except KeyError:
              raise KeyError("{0!r} is not registered".format(fileobj))
docs: Return the key associated with a registered file object.