def _fileobj_to_fd(fileobj):
    if isinstance(fileobj, six.integer_types):
        fd = fileobj
    else:
        try:
            fd = int(fileobj.fileno())
        except (AttributeError, TypeError, ValueError):
            raise ValueError("Invalid file object: "
                             "{0!r}".format(fileobj))
    if fd < 0:
        raise ValueError("Invalid file descriptor: {0}".format(fd))
    return fd
Format a point for printing, based on specified precision with trailing zeros. Uniform printing for vector-like data
dataset/ETHPy150Open dpkp/kafka-python/kafka/selectors34.py/_fileobj_to_fd--crossover with--dataset/ETHPy150Open neuropoly/spinalcordtoolbox/dev/itk_transfo/mat_to_displacement.py/point2str