def cables_from_source(path, predicate=None):
    """\
    Returns a generator with ``ICable`` instances.

    `path`
        Either a directory or a CSV file.
    `predicate`
        A predicate that is invoked for each cable reference identifier.
        If the predicate evaluates to ``False`` the cable is ignored.
        By default, all cables are used.
        I.e. ``cables_from_source('cables.csv', lambda r: r.startswith('09'))``
        would return cables where the reference identifier starts with ``09``.
    """
    return cables_from_directory(path, predicate) if os.path.isdir(path) else cables_from_csv(path, predicate)
def cables_from_source ( path , predicate = None ) : return cables_from_directory ( path , predicate ) if os . path . isdir ( path ) else cables_from_csv ( path , predicate )
\
    Returns a generator with ``ICable`` instances.

    `path`
        Either a directory or a CSV file.
    `predicate`
        A predicate that is invoked for each cable reference identifier.
        If the predicate evaluates to ``False`` the cable is ignored.
        By default, all cables are used.
        I.e. ``cables_from_source('cables.csv', lambda r: r.startswith('09'))``
        would return cables where the reference identifier starts with ``09``.