code: def fd_to_int(fd):
      assert isinstance(fd, int) or hasattr(fd, "fileno")
  
      if isinstance(fd, int):
          return fd
      else:
          return fd.fileno()
  
imports: from __future__ import unicode_literals, absolute_import
  import sys
  import abc
  import errno
  import select
  import six
label_desc: Use image node_id 1 for calling a global function with example usage: fd_to_int(fd) and returns: fd, fd