def getid(obj):
    """Wrapper to get object's ID.

    Abstracts the common pattern of allowing both an object or
    an object's ID (UUID) as a parameter when dealing with relationships.
    """
    try:
        return obj.id
    except __HOLE__:
        return obj
dataset/ETHPy150Open openstack/python-cerberusclient/cerberusclient/common/base.py/getid