parameters: (converter_group, line, container_obj_ref, diff=None)
return_statement: return patches
docstring: Creates a patch for the Resistance ability of a line.
  
          :param converter_group: Group that gets the patch.
          :type converter_group: ...dataformat.converter_object.ConverterObjectGroup
          :param line: Unit/Building line that has the ability.
          :type line: ...dataformat.converter_object.ConverterObjectGroup
          :param container_obj_ref: Reference of the raw API object the patch is nested in.
          :type container_obj_ref: str
          :param diff: A diff between two ConvertObject instances.
          :type diff: ...dataformat.converter_object.ConverterObject
          :returns: The forward references for the generated patches.
          :rtype: list
docstring_summary: Creates a patch for the Resistance ability of a line.
docstring_tokens: Creates a patch for the Resistance ability of a line .
function: def resistance_ability(converter_group, line, container_obj_ref, diff=None):
          """
          Creates a patch for the Resistance ability of a line.
  
          :param converter_group: Group that gets the patch.
          :type converter_group: ...dataformat.converter_object.ConverterObjectGroup
          :param line: Unit/Building line that has the ability.
          :type line: ...dataformat.converter_object.ConverterObjectGroup
          :param container_obj_ref: Reference of the raw API object the patch is nested in.
          :type container_obj_ref: str
          :param diff: A diff between two ConvertObject instances.
          :type diff: ...dataformat.converter_object.ConverterObject
          :returns: The forward references for the generated patches.
          :rtype: list
          """
          head_unit_id = line.get_head_unit_id()
          dataset = line.data
  
          patches = []
  
          name_lookup_dict = internal_name_lookups.get_entity_lookups(dataset.game_version)
  
          game_entity_name = name_lookup_dict[head_unit_id][0]
  
          diff_armors = diff["armors"]
          if not isinstance(diff_armors, NoDiffMember):
              patch_target_ref = f"{game_entity_name}.Resistance"
              patches.extend(AoCUpgradeEffectSubprocessor.get_attack_resistances(converter_group,
                                                                                 line, diff,
                                                                                 patch_target_ref))
  
          # TODO: Other resistance types
  
          return patches
function_tokens: def resistance_ability ( converter_group , line , container_obj_ref , diff = None ) : head_unit_id = line . get_head_unit_id ( ) dataset = line . data patches = [ ] name_lookup_dict = internal_name_lookups . get_entity_lookups ( dataset . game_version ) game_entity_name = name_lookup_dict [ head_unit_id ] [ 0 ] diff_armors = diff [ "armors" ] if not isinstance ( diff_armors , NoDiffMember ) : patch_target_ref = f"{game_entity_name}.Resistance" patches . extend ( AoCUpgradeEffectSubprocessor . get_attack_resistances ( converter_group , line , diff , patch_target_ref ) ) # TODO: Other resistance types return patches