code: def _fetch_analysis_for_local_id(analysis, ans_cond):
      
      # Getting the first reflexed analysis from the chain
      first_reflexed = analysis.getOriginalReflexedAnalysis()
      # Getting all reflexed analysis created due to this first analysis
      analyses_catalog = getToolByName(analysis, CATALOG_ANALYSIS_LISTING)
      derivatives_brains = analyses_catalog(
          getOriginalReflexedAnalysisUID=first_reflexed.UID()
      )
      # From all the related reflexed analysis, return the one that matches
      # with the local id 'ans_cond'
      for derivative in derivatives_brains:
          derivative = derivative.getObject()
          if derivative.getReflexRuleLocalID() == ans_cond:
              return derivative
      return None
docs: This function returns an analysis when the derivative IDs conditions
      are met.
      :analysis: the analysis full object which we want to obtain the
          rules for.
      :ans_cond: the local id with the target derivative reflex rule id.