def getid(obj):
    try:
        return obj.id
    except AttributeError:
        return obj
Extracts object ID.
dataset/ETHPy150Open openstack/python-cloudkittyclient/cloudkittyclient/common/base.py/getid