code: def parse_tags(self, tags):
          
          dtags = {}
          if tags:
              try:
                  dtags = dict([x.split(':') for x in tags.split(',')])
              except ValueError:
                  # one of the 'key:value' pairs was missing
                  logger.info('Invalid tags passed: %s', tags)
                  dtags = {}
  
          return dtags
docs: Parse tags into a dict.
  
          input tags: a comma separated list of 'key:value' pairs.
              Example: foo:bar,spam:eggs
          output dtags: a dict of tags.
              Example: {'foo': 'bar', 'spam': 'eggs'}