<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def create(ctx, name, integration_type, location, non_interactive, quiet, dry_run):
 """Create scaffolding for a new integration."""

    repo_choice = ctx.obj['repo_choice']
    root = resolve_path(location) if location else get_root()
    path_sep = os.path.sep

    integration_dir = os.path.join(root, normalize_package_name(name))
    if os.path.exists(integration_dir):
        abort('Path `{}` already exists!'.format(integration_dir))

    template_fields = {}
    if repo_choice != 'core' and not non_interactive and not dry_run:
        template_fields['author'] = click.prompt('Your name')
        template_fields['email'] = click.prompt('Your email')
        template_fields['email_packages'] = template_fields['email']
        click.echo()

    config = construct_template_fields(name, repo_choice, **template_fields)

    files = create_template_files(integration_type, root, config, read=not dry_run)
    file_paths = [file.file_path.replace('{}{}'.format(root, path_sep), '', 1) for file in files]

    path_tree = tree()
    for file_path in file_paths:
        branch = path_tree

        for part in file_path.split(path_sep):
            branch = branch[part]

    if dry_run:
        if quiet:
            echo_info('Will create `{}`'.format(integration_dir))
        else:
            echo_info('Will create in `{}`:'.format(root))
            display_path_tree(path_tree)
        return

    for file in files:
        file.write()

    if quiet:
        echo_info('Created `{}`'.format(integration_dir))
    else:
        echo_info('Created in `{}`:'.format(root))
        display_path_tree(path_tree)