def argument_parse(arg):
    """
    Small helper function to get rid of excess parenthesis at the begining and end and any whitespace.

    @param: arg is a string
    @return: arg with the spaces and parenthesis around arg removed
    """
    a = arg.replace(' ','')
    while a[0] == '(' and a[len(arg) - 1] == ')':
        a = a[1 : len(a) - 1]
    return a