code: def rule_collection(href, cls):
      
      instance = cls(href=href)
      meth = getattr(instance, 'create')
      return type( 
          cls.__name__, (SubElementCollection,), {
              'create': meth,
              'create_rule_section': instance.create_rule_section})(href, cls)
docs: Rule collections insert a ``create`` and ``create_rule_section`` method
      into the collection. This collection type is returned when accessing rules
      through a reference, as::
  
          policy = FirewallPolicy('mypolicy')
          policy.fw_ipv4_access_rules.create(....)
          policy.fw_ipv4_access_rules.create_rule_section(...)
      
      See the class types documentation, or use help()::
      
          print(help(policy.fw_ipv4_access_rules))
  
      :rtype: SubElementCollection