<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def sanitize_args(cmd: List[str]) -> List[str]: """ Filter the command so that it no longer contains passwords """

    sanitized = []
    for idx, fieldname in enumerate(cmd):
        def _is_password(cmdstr):
            return 'wifi-sec.psk' in cmdstr\
                or 'password' in cmdstr.lower()
        if idx > 0 and _is_password(cmd[idx-1]):
            sanitized.append('****')
        else:
            sanitized.append(fieldname)
    return sanitized