def parse_argument_spec(spec):
    if not spec:
        spec = ''
    val = 'lambda %s : None' % (spec,)
    tree = ast.parse(val)
    assert type(tree) is ast.Module
    if len(tree.body) != 1:
        raise SyntaxError('apparent Bobby Tables in argument spec')
    nod = tree.body[0]
    assert type(nod) is ast.Expr
    nod = nod.value
    assert type(nod) is ast.Lambda
    res = nod.args

    # Check for duplicate arguments.
    argset = set()
    for arg in res.args:
        if arg.arg in argset:
            raise SyntaxError('duplicate argument %s in function definition' % (arg.arg,))
        argset.add(arg.arg)
    for arg in res.kwonlyargs:
        if arg.arg in argset:
            raise SyntaxError('duplicate argument %s in function definition' % (arg.arg,))
        argset.add(arg.arg)
    if res.vararg is not None:
        if res.vararg in argset:
            raise SyntaxError('duplicate argument %s in function definition' % (res.vararg,))
        argset.add(res.vararg)
    if res.kwarg is not None:
        if res.kwarg in argset:
            raise SyntaxError('duplicate argument %s in function definition' % (res.kwarg,))
        argset.add(res.kwarg)

    
    return res
Test that a ContactInformation attribute can be created.
dataset/ETHPy150Open erkyrath/tworld/lib/two/evalctx.py/parse_argument_spec--crossover with--dataset/ETHPy150Open OpenKMIP/PyKMIP/kmip/tests/unit/core/factories/test_attribute_values.py/TestAttributeValueFactory.test_create_contact_information