docs: def filter_unnecessary_ports(query, device_owners=None, vnic_type=None,
                               active=True):
      """Filter out all ports are not needed on CVX """
      query = (query
               .filter_unbound_ports()
               .filter_by_device_owner(device_owners)
               .filter_by_device_id()
               .filter_unmanaged_physnets())
      if active:
          query = query.filter_inactive_ports()
      if vnic_type:
          query = query.filter_by_vnic_type(vnic_type)
      return query