def edit_custom_examples(program, config):
    """
    Edit custom examples for the given program, creating the file if it does
    not exist.
    """
    if (not config.custom_dir) or (not os.path.exists(config.custom_dir)):
        _inform_cannot_edit_no_custom_dir()
        return

    # resolve aliases
    resolved_program = get_resolved_program(program, config)
    custom_file_paths = get_file_paths_for_program(
        resolved_program,
        config.custom_dir
    )

    if (len(custom_file_paths) > 0):
        path_to_edit = custom_file_paths[0]
    else:
        # A new file.
        path_to_edit = os.path.join(config.custom_dir, resolved_program + '.md')

    # Edit the first. Handles the base case.
    subprocess.call([config.editor_cmd, path_to_edit])

    Edit custom examples for the given program, creating the file if it does
    not exist.
    
eg/util.py