code: def escape_quotes(self, val):
          
          if self.is_string(val) and self._in_quotes(val, self.quote):
              # make sure any previously escaped quotes are not re-escaped
              middle = self.remove_quotes(val).replace("\\" + self.quote, self.quote)
              middle = middle.replace(self.quote, "\\" + self.quote)
              val = self.add_quotes(middle)
  
          return val
docs: Escape any quotes in a value