def wash_url_argument(var, new_type):
out = []<EOL>if new_type == '<STR_LIT:list>':  <EOL><INDENT>if isinstance(var, list):<EOL><INDENT>out = var<EOL><DEDENT>else:<EOL><INDENT>out = [var]<EOL><DEDENT><DEDENT>elif new_type == '<STR_LIT:str>':  <EOL><INDENT>if isinstance(var, list):<EOL><INDENT>try:<EOL><INDENT>out = "<STR_LIT:%s>" % var[<NUM_LIT:0>]<EOL><DEDENT>except:<EOL><INDENT>out = "<STR_LIT>"<EOL><DEDENT><DEDENT>elif isinstance(var, str):<EOL><INDENT>out = var<EOL><DEDENT>else:<EOL><INDENT>out = "<STR_LIT:%s>" % var<EOL><DEDENT><DEDENT>elif new_type == '<STR_LIT:int>':  <EOL><INDENT>if isinstance(var, list):<EOL><INDENT>try:<EOL><INDENT>out = int(var[<NUM_LIT:0>])<EOL><DEDENT>except:<EOL><INDENT>out = <NUM_LIT:0><EOL><DEDENT><DEDENT>elif isinstance(var, (int, long)):<EOL><INDENT>out = var<EOL><DEDENT>elif isinstance(var, str):<EOL><INDENT>try:<EOL><INDENT>out = int(var)<EOL><DEDENT>except:<EOL><INDENT>out = <NUM_LIT:0><EOL><DEDENT><DEDENT>else:<EOL><INDENT>out = <NUM_LIT:0><EOL><DEDENT><DEDENT>elif new_type == '<STR_LIT>':  <EOL><INDENT>if isinstance(var, tuple):<EOL><INDENT>out = var<EOL><DEDENT>else:<EOL><INDENT>out = (var, )<EOL><DEDENT><DEDENT>elif new_type == '<STR_LIT>':  <EOL><INDENT>if isinstance(var, dict):<EOL><INDENT>out = var<EOL><DEDENT>else:<EOL><INDENT>out = {<NUM_LIT:0>: var}<EOL><DEDENT><DEDENT>return out<EOL>
Wash argument into 'new_type', that can be 'list', 'str',
                                           'int', 'tuple' or 'dict'.
If needed, the check 'type(var) is not None' should be done before
calling this function.
@param var: variable value
@param new_type: variable type, 'list', 'str', 'int', 'tuple' or 'dict'
@return: as much as possible, value var as type new_type
        If var is a list, will change first element into new_type.
        If int check unsuccessful, returns 0