def import_videos(pattern, max_videos=None, shuffle=False,
                  landmark_resolver=same_name_video, normalise=True,
                  importer_method='ffmpeg', as_generator=False, verbose=False):
    r"""Multiple video (and associated landmarks) importer.

    For each video found yields a :map:`LazyList`. By default, landmark files
    sharing the same filename stem will be imported and attached with a group
    name based on the extension of the landmark file appended with the frame
    number, although this behavior can be customised (see `landmark_resolver`).

    Note that this is a function returns a :map:`LazyList`. Therefore, the
    function will return immediately and indexing into the returned list
    will load an image at run time. If all images should be loaded, then simply
    wrap the returned :map:`LazyList` in a Python `list`.

    Parameters
    ----------
    pattern : `str`
        A glob path pattern to search for videos. Every video found to match
        the glob will be imported one by one. See :map:`video_paths` for more
        details of what videos will be found.
    max_videos : positive `int`, optional
        If not ``None``, only import the first ``max_videos`` found. Else,
        import all.
    shuffle : `bool`, optional
        If ``True``, the order of the returned videos will be randomised. If
        ``False``, the order of the returned videos will be alphanumerically
        ordered.
    landmark_resolver : `function`, optional
        This function will be used to find landmarks for the
        video. The function should take two arguments (the path to the video and
        the frame number) and return a dictionary of the form ``{'group_name':
        'landmark_filepath'}`` Default finds landmarks with the same name as the
        video file, appended with '_{frame_number}'.
    normalise : `bool`, optional
        If ``True``, normalise the frame pixels between 0 and 1 and convert
        to floating point. If ``False``, the native datatype of the image will
        be maintained (commonly `uint8`). Note that in general Menpo assumes
        :map:`Image` instances contain floating point data - if you disable this
        flag you will have to manually convert the frames you import to floating
        point before doing most Menpo operations. This however can be useful to
        save on memory usage if you only wish to view or crop the frames.
    importer_method : {'ffmpeg'}, optional
        A string representing the type of importer to use, by default ffmpeg
        is used.
    as_generator : `bool`, optional
        If ``True``, the function returns a generator and assets will be yielded
        one after another when the generator is iterated over.
    verbose : `bool`, optional
        If ``True`` progress of the importing will be dynamically reported with
        a progress bar.

    Returns
    -------
    lazy_list : :map:`LazyList` or generator of :map:`LazyList`
        A :map:`LazyList` or generator yielding :map:`LazyList` instances that
        wrap the video object.

    Raises
    ------
    ValueError
        If no videos are found at the provided glob.

    Examples
    --------
    Import videos at and rescale every frame of each video:

    >>> videos = []
    >>> for video in menpo.io.import_videos('./set_of_videos/*'):
    >>>    frames = []
    >>>    for frame in video:
    >>>        # rescale to a sensible size as we go
    >>>        frames.append(frame.rescale(0.2))
    >>>    videos.append(frames)
    """
    kwargs = {'normalise': normalise}
    video_importer_methods = {'ffmpeg': ffmpeg_video_types}
    if video_importer_methods not in importer_method:
        raise ValueError('Unsupported importer method requested. Valid values '
                         'are: {}'.format(video_importer_methods.keys()))

    return _import_glob_lazy_list(
        pattern, video_importer_methods[importer_method],
        max_assets=max_videos, shuffle=shuffle,
        landmark_resolver=landmark_resolver,
        landmark_ext_map=image_landmark_types,
        landmark_attach_func=_import_lazylist_attach_landmarks,
        as_generator=as_generator,
        verbose=verbose,
        importer_kwargs=kwargs
    )
dataset/ETHPy150Open menpo/menpo/menpo/io/input/base.py/import_videos/swapped operands of `not in`