@classmethod
def resolve_attr_spec(cls, spec, cb_obj, model=None):
    """
        Resolves a Callback attribute specification looking the
        corresponding attribute up on the cb_obj, which should be a
        bokeh model. If not model is supplied cb_obj is assumed to
        be the same as the model.
        """
    if not cb_obj:
        raise Exception('Bokeh plot attribute %s could not be found' % spec)
    if model is None:
        model = cb_obj
    spec = spec.split('.')
    resolved = cb_obj
    for p in spec[1:]:
        if p == 'attributes':
            continue
        if isinstance(resolved, dict):
            resolved = resolved.get(p)
        else:
            resolved = getattr(resolved, p, None)
    return {'id': model.ref['id'], 'value': resolved}
