def normalize_argv(args, size=0):
 args = list(args)
 for (idx, val) in enumerate(args):
  if (to_int(val) is not None):
   args[idx] = to_int(val)
  if (size and (idx == size)):
   return args[:idx]
 if (size == 0):
  return args
 for i in range(len(args), size):
  args += [None]
 return args

def normalize_argv ( args , size = 0 ) : args = list ( args ) for ( idx , val ) in enumerate ( args ) : if ( to_int ( val ) is not None ) : args [ idx ] = to_int ( val ) if ( size and ( idx == size ) ) : return args [ : idx ] if ( size == 0 ) : return args for i in range ( len ( args ) , size ) : args += [ None ] return args
normalize argv to list with predefined length .