def stripquotes(inpstring, both=False, quotechar='"'):
    """
    Return an unquoted str of supplied str

    Parameters
    ----------
    inpstring : str
        Input string
    both : boolean, optional default False
        Strip both single and double quotes from input if True, otherwise
        strip single-quote or double-quote as specified by ``param quotechar``
    quotechar : str 
        A string from {"'", '"'} for striping single-quote or double-quote
        respectively.

    Returns
    -------
    str
        Stripped string.

    """
    if not both:
        if inpstring.startswith(quotechar) and inpstring.endswith(quotechar):
            return inpstring[1:-1]
    else:
        if inpstring.startswith('"') and inpstring.endswith('"'):
            return inpstring[1:-1]
        elif inpstring.startswith("'") and inpstring.endswith("'"):
            return inpstring[1:-1]