docs: def filter_by_vnic_type(query, vnic_type):
      """Filter ports by vnic_type (currently only used for baremetals)"""
      port_model = models_v2.Port
      binding_model = ml2_models.PortBinding
      dst_binding_model = ml2_models.DistributedPortBinding
      query = (query
               .outerjoin_if_necessary(
                   binding_model,
                   port_model.id == binding_model.port_id)
               .outerjoin_if_necessary(
                   dst_binding_model,
                   port_model.id == dst_binding_model.port_id)
               .filter(
                   (binding_model.vnic_type == vnic_type) |
                   (dst_binding_model.vnic_type == vnic_type)))
      return query