human
Complete the below
def harvest_lettuces(only_the_apps=None, avoid_apps=None, path='features'):

    ''''gets all installed apps that are not from django.contrib
    returns a list of tuples with (path_to_app, app_module)'
    '''

=====
Write me a the Python code you requested?
assistant
#Here is the Python code you requested.
    apps = get_apps()
    if (isinstance(only_the_apps, (list, tuple)) and any(only_the_apps)):
        def _filter_only_specified(module):
            return (module.__name__ in only_the_apps)
        apps = filter(_filter_only_specified, apps)
    else:
        apps = filter(_filter_bultins, apps)
        apps = filter(_filter_configured_apps, apps)
        apps = filter(_filter_configured_avoids, apps)
    if (isinstance(avoid_apps, (list, tuple)) and any(avoid_apps)):
        def _filter_avoid(module):
            return (module.__name__ not in avoid_apps)
        apps = filter(_filter_avoid, apps)
    joinpath = (lambda app: (join(dirname(app.__file__), path), app))
    return map(joinpath, apps)