def select_mimetype(request_headers, request_options):
    """
        Returns a mimetype based on the format param or Accept header
        Args:
            request_headers (dict): headers from the Request object
            request_options (dict): args or form fields from Request object
        Returns:
            The mimetype as a string
            is_csv (boolean): whether the requested format is CSV or not
    """
    mimetype = request_headers.get("Accept", "application/json")
    if "format" in request_options:
        req_format = request_options["format"].lower()
        if req_format == "xml":
            mimetype = "text/xml"
        elif req_format == "csv":
            mimetype = "text/csv"
        elif req_format == "tsv":
            mimetype = "text/tab-separated-values"
        else:
            mimetype = "application/json"
    if "text/csv" in mimetype or "text/tab-separated-values" in mimetype:
        is_csv = True
    else:
        is_csv = False
    return mimetype, is_csv