def METHOD_NAME(ndb, target):
    return (
        ndb.task_manager.db_fetchone(
            '''
                      SELECT count(*) FROM interfaces
                      WHERE
                          f_target = '%s' AND
                          f_index != 0
                      '''
            % target
        )
    )[0]