def children( record, index, key='refs', stop_types=STOP_TYPES ):
    """Retrieve children records for given record"""
    result = []
    for ref in record.get( key,[]):
        try:
            record = index[ref]
        except KeyError, err:
            #print 'No record for %s address %s in %s'%(key, ref, record['address'] )
            pass # happens when an unreachable references a reachable that has been compressed out...
        else:
            if record['type'] not in stop_types:
                result.append(  record  )
    return result
def children ( record , index , key = 'refs' , stop_types = STOP_TYPES ) : result = [ ] for ref in record . get ( key , [ ] ) : try : record = index [ ref ] except KeyError , err : pass else : if record [ 'type' ] not in stop_types : result . append ( record ) return result
Retrieve children records for given record