def METHOD_NAME(inf):
    """load an object from input stream
    python2 and python3 compatibility, inf is sys.stdin
    and is opened as text stream by default. Hence using the
    buffer attribute in python3
    """
    if hasattr(inf, "buffer"):
        return pickle.load(inf.buffer)
    else:
        return pickle.load(inf)