Cleans string quoting in response.
421173
def clean_response(response):
    
    response = re.sub("^['\"]", "", response)
    response = re.sub("['\"]$", "", response)
    return response
1087202
def clean(self):
        """"""
        return Text(self.__text_cleaner.clean(self[TEXT]), **self.__kwargs)
498180
def clean_text(self, url, **kwargs):
        """"""
        try:
            return normalize_url(url)
        except UnicodeDecodeError:
            log.warning("Invalid URL: %r", url)
734623
def clean(self, text, **kwargs):
        """"""
        text = stringify(text)
        if text is not None:
            return self.clean_text(text, **kwargs)
358756
def unquote(str):
    """"""
    if len(str) > 1:
        if str.startswith('"') and str.endswith('"'):
            return str[1:-1].replace('\\\\', '\\').replace('\\"', '"')
        if str.startswith('<') and str.endswith('>'):
            return str[1:-1]
    return str
71343
public function cleanString()
		{
			//get rid of newline holders in values
			$this->processString = str_replace('\\\\\\\\n', ' ', $this->processString);

			//replace newline holders with newline
			$this->processString = str_replace('\n', "\n", $this->processString);

			//match returns extra curly bracket at EOL, get rid of it
			$this->processString = substr($this->processString, 0, -1);

			//convert unicode encoded characters to html entities hex
			$this->processString = preg_replace('/\\\\u([0-9a-fA-F]{4})/', '&#x$1;', $this->processString);

			//get rid of escapes added for javascript
			$this->processString = stripslashes($this->processString);
		}
885143
def _clean_data(api_response):
    '''
    
    '''
    data = {}
    data.update(api_response['DATA'])

    if not data:
        response_data = api_response['DATA']
        data.update(response_data)

    return data
1018722
public static String stripQuotes( String input ) {
      if( input.length() < 2 ){
         return input;
      }else if( input.startsWith( SINGLE_QUOTE ) && input.endsWith( SINGLE_QUOTE ) ){
         return input.substring( 1, input.length() - 1 );
      }else if( input.startsWith( DOUBLE_QUOTE ) && input.endsWith( DOUBLE_QUOTE ) ){
         return input.substring( 1, input.length() - 1 );
      }else{
         return input;
      }
   }
146146
def strip_spaces_and_quotes(value):
    
    value = value.strip() if value else ""
    if value and len(value) > 1 and (value[0] == value[-1] == '"'):
        value = value[1:-1]
    if not value:
        value = ""
    return value
483917
def _clean_message(message):
    ''''''
    message = message.replace('zonecfg: ', '')
    message = message.splitlines()
    for line in message:
        if line.startswith('On line'):
            message.remove(line)
    return "\n".join(message)
830861
private static String convertToQuotedString(String s) {
    if (s == null || s.isEmpty()) {
      return null;
    }
    // If already quoted, return as-is
    if (s.charAt(0) == '"' && s.charAt(s.length() - 1) == '"') {
      return s;
    }
    return '\"' + s + '\"';
  }
475197
function _removeQuotes(src) {
        if (_isQuote(src[0]) && src[src.length - 1] === src[0]) {
            var q = src[0];
            src = src.substr(1, src.length - 2);
            src = src.replace("\\" + q, q);
        }
        return src;
    }
283007
private static String cleanString(String field) {
        int size = field.length();
        StringBuilder sb = new StringBuilder(size);
        for (int i = 0; i < size; i++) {
            char nextChar = field.charAt(i);
            switch (nextChar) {
            case HttpConstants.COLON:
            case HttpConstants.COMMA:
            case HttpConstants.EQUALS:
            case HttpConstants.SEMICOLON:
            case HttpConstants.HT:
                sb.append(HttpConstants.SP_CHAR);
                break;
            case HttpConstants.DOUBLE_QUOTE:
                // nothing added, just removes it
                break;
            default:
                sb.append(nextChar);
                break;
            }
        }
        return sb.toString().trim();
    }
483174
def _clean(self, value):
		""""""
		
		value = (str(v) for v in value)
		
		if self.strip:
			value = (v.strip() for v in value)
		
		if not self.empty:
			value = (v for v in value if v)
		
		return value
627348
static public String stripQuotes(String string0) {
        // if an empty string, return it
        if (string0.length() == 0) {
            return string0;
        }
        // if the first and last characters are quotes, just do 1 substring
        if (string0.length() > 1 && string0.charAt(0) == '"' && string0.charAt(string0.length() - 1) == '"') {
            return string0.substring(1, string0.length() - 1);
        } else if (string0.charAt(0) == '"') {
            string0 = string0.substring(1);
        } else if (string0.charAt(string0.length() - 1) == '"') {
            string0 = string0.substring(0, string0.length() - 1);
        }
        return string0;
    }
445562
protected function cleanResponse()
    {
        // If the option to strip bad characters is not set, then we shouldn't
        // do anything here.
        if (!$this->options['strip_bad_chars']) {
            return;
        }

        // Strip invalid characters from the XML response body.
        $count = 0;
        $this->__last_response = preg_replace(
            '/(?!&#x0?(9|A|D))(&#x[0-1]?[0-9A-F];)/',
            ' ',
            $this->__last_response,
            -1,
            $count
        );

        // If the option to warn on bad characters is set, and some characters
        // were stripped, then trigger a warning.
        if ($this->options['warn_on_bad_chars'] && $count > 0) {
            trigger_error(
                'Invalid characters were stripped from the XML SOAP response.',
                E_USER_WARNING
            );
        }
    }
571012
public static String stripDoubleQuotes(String s)
    {
        String ret = s;
        if(hasDoubleQuotes(s))
            ret = s.substring(1, s.length()-1);
        return ret;
    }