code: def wrap_embedded_keyvalue(self, data):
          
          if data is not None:
              try:
                  data = u'{}'.format(data)
                  # variables = re.findall(self._vars_keyvalue_embedded, u'{}'.format(data))
              except UnicodeEncodeError:
                  # variables = re.findall(self._vars_keyvalue_embedded, data)
                  pass
  
              variables = []
              for v in re.finditer(self._vars_keyvalue_embedded, data):
                  variables.append(v.group(0))
  
              for var in set(variables):  # recursion over set to handle duplicates
                  # pull (#App:1441:embedded_string!String) from (": #App:1441:embedded_string!String)
                  variable_string = re.search(self._variable_parse, var).group(0)
                  # reformat to replace the correct instance only, handling the case where a variable
                  # is embedded multiple times in the same key value array.
                  data = data.replace(var, '": "{}"'.format(variable_string))
          return data
docs: Wrap keyvalue embedded variable in double quotes.
  
          Args:
              data (string): The data with embedded variables.
  
          Returns:
              (string): Results retrieved from DB