def dbref(accessing_obj, accessed_obj, *args, **kwargs):
    if not args:
        return False
    try:
        dbref = int(args[0].strip().strip('#'))
    except ValueError:
        return False
    if hasattr(accessing_obj, 'dbid'):
        return dbref == accessing_obj.dbid
    return False
Usage:
dataset/ETHPy150Open evennia/evennia/evennia/locks/lockfuncs.py/dbref