def generate_project(<EOL>location=None, runtime="<STR_LIT>", dependency_manager=None,<EOL>output_dir="<STR_LIT:.>", name='<STR_LIT>', no_input=False):
template = None<EOL>for mapping in list(itertools.chain(*(RUNTIME_DEP_TEMPLATE_MAPPING.values()))):<EOL><INDENT>if runtime in mapping['<STR_LIT>'] or any([r.startswith(runtime) for r in mapping['<STR_LIT>']]):<EOL><INDENT>if not dependency_manager:<EOL><INDENT>template = mapping['<STR_LIT>']<EOL>break<EOL><DEDENT>elif dependency_manager == mapping['<STR_LIT>']:<EOL><INDENT>template = mapping['<STR_LIT>']<EOL><DEDENT><DEDENT><DEDENT>if not template:<EOL><INDENT>msg = "<STR_LIT>".format(runtime, dependency_manager)<EOL>raise GenerateProjectFailedError(project=name, provider_error=msg)<EOL><DEDENT>params = {<EOL>"<STR_LIT>": location if location else template,<EOL>"<STR_LIT>": output_dir,<EOL>"<STR_LIT>": no_input<EOL>}<EOL>LOG.debug("<STR_LIT>")<EOL>LOG.debug("<STR_LIT:%s>", params)<EOL>if not location and name is not None:<EOL><INDENT>params['<STR_LIT>'] = {'<STR_LIT>': name, '<STR_LIT>': runtime}<EOL>params['<STR_LIT>'] = True<EOL>LOG.debug("<STR_LIT>")<EOL>LOG.debug("<STR_LIT:%s>", params)<EOL><DEDENT>try:<EOL><INDENT>LOG.debug("<STR_LIT>")<EOL>cookiecutter(**params)<EOL><DEDENT>except CookiecutterException as e:<EOL><INDENT>raise GenerateProjectFailedError(project=name, provider_error=e)<EOL><DEDENT>
Generates project using cookiecutter and options given

    Generate project scaffolds a project using default templates if user
    doesn't provide one via location parameter. Default templates are
    automatically chosen depending on runtime given by the user.

    Parameters
    ----------
    location: Path, optional
        Git, HTTP, Local path or Zip containing cookiecutter template
        (the default is None, which means no custom template)
    runtime: str, optional
        Lambda Runtime (the default is "nodejs", which creates a nodejs project)
    dependency_manager: str, optional
        Dependency Manager for the Lambda Runtime Project(the default is "npm" for a "nodejs" Lambda runtime)
    output_dir: str, optional
        Output directory where project should be generated
        (the default is ".", which implies current folder)
    name: str, optional
        Name of the project
        (the default is "sam-sample-app", which implies a project named sam-sample-app will be created)
    no_input : bool, optional
        Whether to prompt for input or to accept default values
        (the default is False, which prompts the user for values it doesn't know for baking)

    Raises
    ------
    GenerateProjectFailedError
        If the process of baking a project fails