def import_video(filepath, landmark_resolver=same_name_video, normalise=True,
                 importer_method='ffmpeg'):
    r"""Single video (and associated landmarks) importer.

    If a video file is found at `filepath`, returns an :map:`LazyList` wrapping
    all the frames of the video. 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`).

    Parameters
    ----------
    filepath : `pathlib.Path` or `str`
        A relative or absolute filepath to a video file.
    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 farmes 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.

    Returns
    -------
    frames : :map:`LazyList`
        An lazy list of :map:`Image` or subclass thereof which wraps the frames
        of the video. This list can be treated as a normal list, but the frame
        is only read when the video is indexed or iterated.
    """
    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(filepath, video_importer_methods[importer_method],
                   landmark_ext_map=image_landmark_types,
                   landmark_resolver=landmark_resolver,
                   landmark_attach_func=_import_lazylist_attach_landmarks,
                   importer_kwargs=kwargs)
dataset/ETHPy150Open menpo/menpo/menpo/io/input/base.py/import_video/swapped operands of `not in`