def ArgumentStringToInt(arg_string):
    """ convert '1234' or '0x123' to int
        params:
          arg_string: str - typically string passed from commandline. ex '1234' or '0xA12CD'
        returns:
          int - integer representation of the string
    """
    arg_string = arg_string.strip()
    if arg_string.find('0x') >=0:
        return int(arg_string, 16)
    else:
        return int(arg_string)