code: def _get_baremetal_switches(self, port):
          
  
          all_switches = set()
          active_switches = set()
          all_link_info = port[bc.portbindings.PROFILE]['local_link_information']
          for link_info in all_link_info:
              switch_info = self._get_baremetal_switch_info(link_info)
              if not switch_info:
                  continue
              switch_ip = switch_info['switch_ip']
  
              # If not for Nexus
              if not self._switch_defined(switch_ip):
                  continue
  
              all_switches.add(switch_ip)
              if self.is_switch_active(switch_ip):
                  active_switches.add(switch_ip)
  
          return list(all_switches), list(active_switches)
docs: Get switch ip addresses from baremetal transaction.
  
          This method is used to extract switch information
          from the transaction where VNIC_TYPE is baremetal.
  
          :param port: Received port transaction
          :returns: list of all switches
          :returns: list of only switches which are active