def _parse_disallowed_patterns(disallowed_patterns):
    """ Parse disallowed patterns from flake8 options.

    Parameters
    ----------
    disallowed_patterns : str
        Configuration that represents a pairing of filename pattern
        and regular expression for disallowed import.
        Multiple items should be separated by newlines.

    Returns
    -------
    results : list of tuple(str, str)
        The first item in the tuple is the pattern for matching files.
        The second item in the tuple is the pattern for matching disallowed
        imports.
    """
    results = []
    disallowed_patterns = disallowed_patterns.replace(" ", "")
    for rule in disallowed_patterns.splitlines():
        if not rule:
            continue
        file_pattern, disallowed = rule.split(":")
        results.append((file_pattern.strip(), disallowed.strip()))
    return results