def METHOD_NAME(capstring):
    value = None
    caps = capstring.split(',')
    capslist = []
    for cap in caps:
        try:
            (key_version, value) = [i.strip() for i in cap.split("=", 1)]
        except ValueError:
            # Bad directive: not in 'a = b' format
            continue
        # parse out the version
        # lets give it a shot sans regex's first...
        (key,version) = key_version.split("(", 1)
        # just to be paranoid
        if version[-1] != ")":
            print("something broke in parsing the capabilited headers")
        #FIXME: raise an approriate exception here...
        # trim off the trailing paren
        version = version[:-1]
        data = {'version': version, 'value': value}
        capslist.append((key, data))
    return capslist