def quote_str(obj):
    """
    Adds extra quotes to a string. If the argument is not a string it is
    returned unmodified

    :param obj: Object
    :type  obj: any

    :rtype: Same as argument

    For example:

        >>> import putil.misc
        >>> putil.misc.quote_str(5)
        5
        >>> putil.misc.quote_str('Hello!')
        '"Hello!"'
        >>> putil.misc.quote_str('He said "hello!"')
        '\\'He said "hello!"\\''
    """
    if not isinstance(obj, str):
        return obj
    else:
        return "'{obj}'".format(obj=obj) if '"' in obj else '"{obj}"'.format(
            obj=obj)
