@staticmethod
    def _extract_id(obj):
        try:
            return obj.id
        except AttributeError:
            return obj
Return obj.id, or obj if the object doesn't have an ID
dataset/ETHPy150Open photo/openphoto-python/trovebox/api/api_base.py/ApiBase._extract_id