class_docstr: Base selector implementation.
class_docstr_tok: ["Base","selector","implementation","."]
docstr: Return a file descriptor from a file object.
  
  This wraps _fileobj_to_fd() to do an exhaustive search in case
  the object is invalid but we still have it in our map.  This
  is used by unregister() so we can unregister an object that
  was previously registered even if it is closed.  It is also
  used by _SelectorMapping.
docstr_tok: ["Return","a","file","descriptor","from","a","file","object",".","This","wraps","_fileobj_to_fd","(",")","to","do","an","exhaustive","search","in","case","the","object","is","invalid","but","we","still","have","it","in","our","map",".","This","is","used","by","unregister","(",")","so","we","can","unregister","an","object","that","was","previously","registered","even","if","it","is","closed",".","It","is","also","used","by","_SelectorMapping","."]
code: def _fileobj_lookup(self, fileobj):
      """Return a file descriptor from a file object.
  
      This wraps _fileobj_to_fd() to do an exhaustive search in case
      the object is invalid but we still have it in our map.  This
      is used by unregister() so we can unregister an object that
      was previously registered even if it is closed.  It is also
      used by _SelectorMapping.
      """
      try:
          return _fileobj_to_fd(fileobj)
      except ValueError:
          # Do an exhaustive search.
          for key in self._fd_to_key.values():
              if key.fileobj is fileobj:
                  return key.fd
          # Raise ValueError after all.
          raise
  
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 2 for calling the _BaseSelectorImpl obj's underlying member method code with example usage: obj._fileobj_lookup(fileobj) and returns: _fileobj_to_fd, key