parameters: (self, address, new_tags)
docstring: Assigns a new set of tags to an address overwriting any existing tag assignments.
  
          :param address: A string dotted-decimal IP address such as "192.168.2.100" or "21.66" or "1.2.0.0/16"
          :param new_tags: A list of tag strings. e.g. ['tag_one', 'tag_two', 'tag_three']
          :return: None
docstring_summary: Assigns a new set of tags to an address overwriting any existing tag assignments.
docstring_tokens: Assigns a new set of tags to an address overwriting any existing tag assignments .
function: def set_tags(self, address, new_tags):
          """
          Assigns a new set of tags to an address overwriting any existing tag assignments.
  
          :param address: A string dotted-decimal IP address such as "192.168.2.100" or "21.66" or "1.2.0.0/16"
          :param new_tags: A list of tag strings. e.g. ['tag_one', 'tag_two', 'tag_three']
          :return: None
          """
          what = "ipstart, ipend, tag"
          r = common.determine_range_string(address)
          row = {"ipstart": r[0], "ipend": r[1]}
          where = "ipstart = $ipstart AND ipend = $ipend"
  
          existing = list(self.db.select(self.table_tags, vars=row, what=what, where=where))
          new_tags = set(new_tags)
          old_tags = {x.tag for x in existing}
          removals = old_tags - new_tags
          additions = new_tags - old_tags
  
          for tag in additions:
              row['tag'] = tag
              self.db.insert(self.table_tags, **row)
  
          for tag in removals:
              row['tag'] = tag
              where = "ipstart = $ipstart AND ipend = $ipend AND tag = $tag"
              self.db.delete(self.table_tags, where=where, vars=row)
function_tokens: def set_tags ( self , address , new_tags ) : what = "ipstart, ipend, tag" r = common . determine_range_string ( address ) row = { "ipstart" : r [ 0 ] , "ipend" : r [ 1 ] } where = "ipstart = $ipstart AND ipend = $ipend" existing = list ( self . db . select ( self . table_tags , vars = row , what = what , where = where ) ) new_tags = set ( new_tags ) old_tags = { x . tag for x in existing } removals = old_tags - new_tags additions = new_tags - old_tags for tag in additions : row [ 'tag' ] = tag self . db . insert ( self . table_tags , * * row ) for tag in removals : row [ 'tag' ] = tag where = "ipstart = $ipstart AND ipend = $ipend AND tag = $tag" self . db . delete ( self . table_tags , where = where , vars = row )