code: def set_all_vlan_states(self, nexus_host, vlanid_range):
          
  
          starttime = time.time()
  
          if not vlanid_range:
              LOG.warning("Exiting set_all_vlan_states: "
                          "No vlans to configure")
              return
  
          # Eliminate possible whitespace and separate vlans by commas
          vlan_id_list = re.sub(r'\s', '', vlanid_range).split(',')
          if not vlan_id_list or not vlan_id_list[0]:
              LOG.warning("Exiting set_all_vlan_states: "
                          "No vlans to configure")
              return
  
          path_str, body_vlan_all = self.start_create_vlan()
          while vlan_id_list:
              rangev = vlan_id_list.pop(0)
              if '-' in rangev:
                  fr, to = rangev.split('-')
                  max = int(to) + 1
                  for vlan_id in range(int(fr), max):
                      body_vlan_all = self.get_create_vlan(
                          nexus_host, vlan_id, 0, body_vlan_all)
              else:
                  body_vlan_all = self.get_create_vlan(
                      nexus_host, rangev, 0, body_vlan_all)
  
          body_vlan_all = self.end_create_vlan(body_vlan_all)
          self.send_edit_string(
              nexus_host, path_str, body_vlan_all)
  
          self.capture_and_print_timeshot(
              starttime, "set_all_vlan_states",
              switch=nexus_host)
docs: Set the VLAN states to active.