<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def file_or_path(file):
 """ Open a file and return the handler if a path is given. If a file handler is given, return it directly. :param file: A file handler or path to a file. :returns: A tuple with the open file handler and whether it was a path. :rtype: (file, bool) """


    is_path = False
    if isinstance(file, string_types):
        if not os.path.exists(file):
            raise IOError('File at path ' + file + ' does not exist.')
        file = open(file, 'rb')
        is_path = True

    return file, is_path