kifield/common.py
def unquote(s):
    """Remove any quote marks around a string.

    Args:
        s (string): Quoted or unquoted string.

    Returns:
        string: Unquoted string.
    """

    if not isinstance(s, basestring):
        return s  # Not a string, so just return it.
    try:
        # This returns inner part of "..." or '...' strings.
        return re.match("^(['\"])(.*)\\1$", s).group(2)
    except (IndexError, AttributeError):
        # No surrounding quotes, so just return string.
        return s
Remove any quote marks around a string.

    Args:
        s (string): Quoted or unquoted string.

    Returns:
        string: Unquoted string.
    
Remove any quote marks around a string.
Remove any quote marks around a string .
def unquote(s):
    if not isinstance(s, basestring):
        return s  
    try:
        return re.match("^(['\"])(.*)\\1$", s).group(2)
    except (IndexError, AttributeError):
        return s
def unquote ( s ) : if not isinstance ( s , basestring ) : return s try : return re . match ( "^(['\"])(.*)\\1$" , s ) . group ( 2 ) except ( IndexError , AttributeError ) : return s
Remove any quote marks around a string.
Remove any quote marks around a string .
"""Remove any quote marks around a string.

    Args:
        s (string): Quoted or unquoted string.

    Returns:
        string: Unquoted string.
    """ # Not a string, so just return it. # This returns inner part of "..." or '...' strings. # No surrounding quotes, so just return string.
None
string
s
Quoted or unquoted string.
Quoted or unquoted string .