def message_about_scripts_not_on_PATH(scripts):<EOL>
if not scripts:<EOL><INDENT>return None<EOL><DEDENT>grouped_by_dir = collections.defaultdict(set)  <EOL>for destfile in scripts:<EOL><INDENT>parent_dir = os.path.dirname(destfile)<EOL>script_name = os.path.basename(destfile)<EOL>grouped_by_dir[parent_dir].add(script_name)<EOL><DEDENT>not_warn_dirs = [<EOL>os.path.normcase(i).rstrip(os.sep) for i in<EOL>os.environ.get("<STR_LIT>", "<STR_LIT>").split(os.pathsep)<EOL>]<EOL>executable_loc = os.environ.get("<STR_LIT>", sys.executable)<EOL>not_warn_dirs.append(os.path.normcase(os.path.dirname(executable_loc)))<EOL>warn_for = {<EOL>parent_dir: scripts for parent_dir, scripts in grouped_by_dir.items()<EOL>if os.path.normcase(parent_dir) not in not_warn_dirs<EOL>}<EOL>if not warn_for:<EOL><INDENT>return None<EOL><DEDENT>msg_lines = []<EOL>for parent_dir, scripts in warn_for.items():<EOL><INDENT>scripts = sorted(scripts)<EOL>if len(scripts) == <NUM_LIT:1>:<EOL><INDENT>start_text = "<STR_LIT>".format(scripts[<NUM_LIT:0>])<EOL><DEDENT>else:<EOL><INDENT>start_text = "<STR_LIT>".format(<EOL>"<STR_LIT:U+002CU+0020>".join(scripts[:-<NUM_LIT:1>]) + "<STR_LIT>" + scripts[-<NUM_LIT:1>]<EOL>)<EOL><DEDENT>msg_lines.append(<EOL>"<STR_LIT>"<EOL>.format(start_text, parent_dir)<EOL>)<EOL><DEDENT>last_line_fmt = (<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>)<EOL>if len(msg_lines) == <NUM_LIT:1>:<EOL><INDENT>msg_lines.append(last_line_fmt.format("<STR_LIT>"))<EOL><DEDENT>else:<EOL><INDENT>msg_lines.append(last_line_fmt.format("<STR_LIT>"))<EOL><DEDENT>return "<STR_LIT:\n>".join(msg_lines)<EOL>
Determine if any scripts are not on PATH and format a warning.

    Returns a warning message if one or more scripts are not on PATH,
    otherwise None.