code: def common_items_ratio(pronac, dt):
      
      segment_id = get_segment_id(str(pronac))
      metrics = data.common_items_metrics.to_dict(orient='index')[segment_id]
      ratio = common_items_percentage(pronac, segment_common_items(segment_id))
  
      # constant that defines the threshold to verify if a project
      # is an outlier.
      k = 1.5
  
      threshold = metrics['mean'] - k * metrics['std']
      uncommon_items = get_uncommon_items(pronac)
  
      pronac_filter = data.all_items['PRONAC'] == pronac
      uncommon_items_filter = (
          data.all_items['idPlanilhaItens']
          .isin(uncommon_items)
      )
      items_filter = (pronac_filter & uncommon_items_filter)
  
      filtered_items = (
          data
          .all_items[items_filter]
          .drop_duplicates(subset='idPlanilhaItens')
      )
      uncommon_items = add_info_to_uncommon_items(filtered_items, uncommon_items)
  
      return {
          'is_outlier': ratio < threshold,
          'valor': ratio,
          'maximo_esperado': metrics['mean'],
          'desvio_padrao': metrics['std'],
          'items_incomuns': uncommon_items,
          'items_comuns_que_o_projeto_nao_possui': get_common_items_not_present(pronac),
      }
docs: Calculates the common items on projects in a cultural segment,
      calculates the uncommon items on projects in a cultural segment and
      verify if a project is an outlier compared to the other projects
      in his segment.