import glob


def to_files_or_content(value):
    """File path/glob/content disambiguator.

    Check if the value passed is a glob, a set of files in a list or is string
    content.

    Args:
        value (str): Value to check.

    Returns:
        tuple: Two values being the first a boolean that indicates if ``value``
        is a list of files (``True``) or string content (``False``) and the
        second value is the content, which could be an iterator (if a glob or
        a list of files is passed or a string).
    """
    try:
        parsed = glob.glob(value)
    except TypeError:
        # inferes list
        return (True, value)
    except Exception as err:
        # some strings like '[s-m]' will produce
        # 're.error: bad character range ... at position'

        # NOTE: in Python3.6, 're.error' is 'sre_constants' error,
        # so 'sre_constants' must be removed when Python3.6 support is gone
        if (
            err.__module__ in ['re', 'sre_constants']
            and err.__class__.__name__ == 'error'
        ):
            return (False, value)
        raise err
    if not parsed:
        # assumes it is content
        return (False, value)
    return (True, parsed)