def mode_assignment(arg):
arg = arg.upper()<EOL>stream_args = ('<STR_LIT>', '<STR_LIT>', '<STR_LIT>')<EOL>try:<EOL><INDENT>if arg in stream_args:<EOL><INDENT>return '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>return arg<EOL><DEDENT><DEDENT>except Exception:<EOL><INDENT>return None<EOL><DEDENT>
Translates arg to enforce proper assignment