def METHOD_NAME(layer_obj, command_obj, prereqs):
    """Given in ImageLayer object, shell and binary to look up, find packages
    installed in the layer using the default method:
        For snippets, we will get the packages installed by the command"""
    # set up a notice origin for the layer
    origin_layer = 'Layer {}'.format(layer_obj.layer_index)
    # find packages for the command
    cmd_msg = (formats.invoke_for_snippets + '\n' +
               content.print_package_invoke(command_obj.name))
    layer_obj.origins.add_notice_to_origins(origin_layer, Notice(
        cmd_msg, 'info'))
    pkg_list = filter.get_installed_package_names(command_obj)
    # collect all the dependencies for each package name
    all_pkgs = []
    for pkg_name in pkg_list:
        pkg_invoke = command_lib.check_for_unique_package(
            prereqs.listing, pkg_name)
        deps, deps_msg = com.get_package_dependencies(
            pkg_invoke, pkg_name, prereqs.fs_shell)
        if deps_msg:
            logger.warning(deps_msg)
            layer_obj.origins.add_notice_to_origins(
                origin_layer, Notice(deps_msg, 'error'))
        all_pkgs.append(pkg_name)
        all_pkgs.extend(deps)
    unique_pkgs = list(set(all_pkgs))
    # get package metadata for each package name
    for pkg_name in unique_pkgs:
        pkg = Package(pkg_name)
        dcom.fill_package_metadata(pkg, pkg_invoke, prereqs.fs_shell,
                                   layer_obj.get_layer_workdir(), prereqs.envs)
        layer_obj.add_package(pkg)