def dbref(dbref, reqhash=True):
    if reqhash:
        num = (int(dbref.lstrip('#')) if (isinstance(dbref, basestring) and
                                           dbref.startswith("#") and
                                           dbref.lstrip('#').isdigit())
                                       else None)
        return num if num > 0 else None
    elif isinstance(dbref, basestring):
        dbref = dbref.lstrip('#')
        return int(dbref) if dbref.isdigit() and int(dbref) > 0 else None
    else:
        return dbref if isinstance(dbref, int) else None
Traverses the annotated suffix tree in breadth-first order.
dataset/ETHPy150Open evennia/evennia/evennia/utils/utils.py/dbref--crossover with--dataset/ETHPy150Open mikhaildubov/AST-text-analysis/east/asts/ast.py/AnnotatedSuffixTree.traverse_breadth_first