Get profile.

        Generates a personality profile for the author of the input text. The service
        accepts a maximum of 20 MB of input content, but it requires much less text to
        produce an accurate profile. The service can analyze text in Arabic, English,
        Japanese, Korean, or Spanish. It can return its results in a variety of languages.
        **See also:**
        * [Requesting a
        profile](https://cloud.ibm.com/docs/services/personality-insights/input.html)
        * [Providing sufficient
        input](https://cloud.ibm.com/docs/services/personality-insights/input.html#sufficient)
        ### Content types
         You can provide input content as plain text (`text/plain`), HTML (`text/html`),
        or JSON (`application/json`) by specifying the **Content-Type** parameter. The
        default is `text/plain`.
        * Per the JSON specification, the default character encoding for JSON content is
        effectively always UTF-8.
        * Per the HTTP specification, the default encoding for plain text and HTML is
        ISO-8859-1 (effectively, the ASCII character set).
        When specifying a content type of plain text or HTML, include the `charset`
        parameter to indicate the character encoding of the input text; for example,
        `Content-Type: text/plain;charset=utf-8`.
        **See also:** [Specifying request and response
        formats](https://cloud.ibm.com/docs/services/personality-insights/input.html#formats)
        ### Accept types
         You must request a response as JSON (`application/json`) or comma-separated
        values (`text/csv`) by specifying the **Accept** parameter. CSV output includes a
        fixed number of columns. Set the **csv_headers** parameter to `true` to request
        optional column headers for CSV output.
        **See also:**
        * [Understanding a JSON
        profile](https://cloud.ibm.com/docs/services/personality-insights/output.html)
        * [Understanding a CSV
        profile](https://cloud.ibm.com/docs/services/personality-insights/output-csv.html).

        :param Content content: A maximum of 20 MB of content to analyze, though the
        service requires much less text; for more information, see [Providing sufficient
        input](https://cloud.ibm.com/docs/services/personality-insights/input.html#sufficient).
        For JSON input, provide an object of type `Content`.
        :param str accept: The type of the response. For more information, see **Accept
        types** in the method description.
        :param str content_language: The language of the input text for the request:
        Arabic, English, Japanese, Korean, or Spanish. Regional variants are treated as
        their parent language; for example, `en-US` is interpreted as `en`.
        The effect of the **Content-Language** parameter depends on the **Content-Type**
        parameter. When **Content-Type** is `text/plain` or `text/html`,
        **Content-Language** is the only way to specify the language. When
        **Content-Type** is `application/json`, **Content-Language** overrides a language
        specified with the `language` parameter of a `ContentItem` object, and content
        items that specify a different language are ignored; omit this parameter to base
        the language on the specification of the content items. You can specify any
        combination of languages for **Content-Language** and **Accept-Language**.
        :param str accept_language: The desired language of the response. For
        two-character arguments, regional variants are treated as their parent language;
        for example, `en-US` is interpreted as `en`. You can specify any combination of
        languages for the input and response content.
        :param bool raw_scores: Indicates whether a raw score in addition to a normalized
        percentile is returned for each characteristic; raw scores are not compared with a
        sample population. By default, only normalized percentiles are returned.
        :param bool csv_headers: Indicates whether column labels are returned with a CSV
        response. By default, no column labels are returned. Applies only when the
        response type is CSV (`text/csv`).
        :param bool consumption_preferences: Indicates whether consumption preferences are
        returned with the results. By default, no consumption preferences are returned.
        :param str content_type: The type of the input. For more information, see
        **Content types** in the method description.
        Default: `text/plain`.
        :param dict headers: A `dict` containing the request headers
        :return: A `DetailedResponse` containing the result, headers and HTTP status code.
        :rtype: DetailedResponse

def profile(self,
                content,
                accept,
                content_language=None,
                accept_language=None,
                raw_scores=None,
                csv_headers=None,
                consumption_preferences=None,
                content_type=None,
                **kwargs):
        """
        Get profile.

        Generates a personality profile for the author of the input text. The service
        accepts a maximum of 20 MB of input content, but it requires much less text to
        produce an accurate profile. The service can analyze text in Arabic, English,
        Japanese, Korean, or Spanish. It can return its results in a variety of languages.
        **See also:**
        * [Requesting a
        profile](https://cloud.ibm.com/docs/services/personality-insights/input.html)
        * [Providing sufficient
        input](https://cloud.ibm.com/docs/services/personality-insights/input.html#sufficient)
        ### Content types
         You can provide input content as plain text (`text/plain`), HTML (`text/html`),
        or JSON (`application/json`) by specifying the **Content-Type** parameter. The
        default is `text/plain`.
        * Per the JSON specification, the default character encoding for JSON content is
        effectively always UTF-8.
        * Per the HTTP specification, the default encoding for plain text and HTML is
        ISO-8859-1 (effectively, the ASCII character set).
        When specifying a content type of plain text or HTML, include the `charset`
        parameter to indicate the character encoding of the input text; for example,
        `Content-Type: text/plain;charset=utf-8`.
        **See also:** [Specifying request and response
        formats](https://cloud.ibm.com/docs/services/personality-insights/input.html#formats)
        ### Accept types
         You must request a response as JSON (`application/json`) or comma-separated
        values (`text/csv`) by specifying the **Accept** parameter. CSV output includes a
        fixed number of columns. Set the **csv_headers** parameter to `true` to request
        optional column headers for CSV output.
        **See also:**
        * [Understanding a JSON
        profile](https://cloud.ibm.com/docs/services/personality-insights/output.html)
        * [Understanding a CSV
        profile](https://cloud.ibm.com/docs/services/personality-insights/output-csv.html).

        :param Content content: A maximum of 20 MB of content to analyze, though the
        service requires much less text; for more information, see [Providing sufficient
        input](https://cloud.ibm.com/docs/services/personality-insights/input.html#sufficient).
        For JSON input, provide an object of type `Content`.
        :param str accept: The type of the response. For more information, see **Accept
        types** in the method description.
        :param str content_language: The language of the input text for the request:
        Arabic, English, Japanese, Korean, or Spanish. Regional variants are treated as
        their parent language; for example, `en-US` is interpreted as `en`.
        The effect of the **Content-Language** parameter depends on the **Content-Type**
        parameter. When **Content-Type** is `text/plain` or `text/html`,
        **Content-Language** is the only way to specify the language. When
        **Content-Type** is `application/json`, **Content-Language** overrides a language
        specified with the `language` parameter of a `ContentItem` object, and content
        items that specify a different language are ignored; omit this parameter to base
        the language on the specification of the content items. You can specify any
        combination of languages for **Content-Language** and **Accept-Language**.
        :param str accept_language: The desired language of the response. For
        two-character arguments, regional variants are treated as their parent language;
        for example, `en-US` is interpreted as `en`. You can specify any combination of
        languages for the input and response content.
        :param bool raw_scores: Indicates whether a raw score in addition to a normalized
        percentile is returned for each characteristic; raw scores are not compared with a
        sample population. By default, only normalized percentiles are returned.
        :param bool csv_headers: Indicates whether column labels are returned with a CSV
        response. By default, no column labels are returned. Applies only when the
        response type is CSV (`text/csv`).
        :param bool consumption_preferences: Indicates whether consumption preferences are
        returned with the results. By default, no consumption preferences are returned.
        :param str content_type: The type of the input. For more information, see
        **Content types** in the method description.
        Default: `text/plain`.
        :param dict headers: A `dict` containing the request headers
        :return: A `DetailedResponse` containing the result, headers and HTTP status code.
        :rtype: DetailedResponse
        """

        if content is None:
            raise ValueError('content must be provided')
        if accept is None:
            raise ValueError('accept must be provided')
        if isinstance(content, Content):
            content = self._convert_model(content, Content)

        headers = {
            'Accept': accept,
            'Content-Language': content_language,
            'Accept-Language': accept_language,
            'Content-Type': content_type
        }
        if 'headers' in kwargs:
            headers.update(kwargs.get('headers'))
        sdk_headers = get_sdk_headers('personality_insights', 'V3', 'profile')
        headers.update(sdk_headers)

        params = {
            'version': self.version,
            'raw_scores': raw_scores,
            'csv_headers': csv_headers,
            'consumption_preferences': consumption_preferences
        }

        if content_type == 'application/json' and isinstance(content, dict):
            data = json.dumps(content)
        else:
            data = content

        url = '/v3/profile'
        response = self.request(
            method='POST',
            url=url,
            headers=headers,
            params=params,
            data=data,
            accept_json=(accept is None or accept == 'application/json'))
        return response