
    $$}g
                     Z    d Z ddlmZ ddlmZ  e            Ze	 	 	 	 	 	 dd            ZdS )z1.2.0   )apply_settings)DateDataParserNc                     t           }|s|s|s	|s|j        st          |||||          }|                    | |          }|r|d         S dS )a|  Parse date and time from given date string.

    :param date_string:
        A string representing date and/or time in a recognizably valid format.
    :type date_string: str

    :param date_formats:
        A list of format strings using directives as given
        `here <https://docs.python.org/2/library/datetime.html#strftime-and-strptime-behavior>`_.
        The parser applies formats one by one, taking into account the detected languages/locales.
    :type date_formats: list

    :param languages:
        A list of language codes, e.g. ['en', 'es', 'zh-Hant'].
        If locales are not given, languages and region are used to construct locales for translation.
    :type languages: list

    :param locales:
        A list of locale codes, e.g. ['fr-PF', 'qu-EC', 'af-NA'].
        The parser uses only these locales to translate date string.
    :type locales: list

    :param region:
        A region code, e.g. 'IN', '001', 'NE'.
        If locales are not given, languages and region are used to construct locales for translation.
    :type region: str

    :param settings:
        Configure customized behavior using settings defined in :mod:`dateparser.conf.Settings`.
    :type settings: dict

    :param detect_languages_function:
        A function for language detection that takes as input a string (the `date_string`) and
        a `confidence_threshold`, and returns a list of detected language codes.
        Note: this function is only used if ``languages`` and ``locales`` are not provided.
    :type detect_languages_function: function

    :return: Returns :class:`datetime <datetime.datetime>` representing parsed date if successful, else returns None
    :rtype: :class:`datetime <datetime.datetime>`.
    :raises:
        ``ValueError``: Unknown Language, ``TypeError``: Languages argument must be a list,
        ``SettingValidationError``: A provided setting is not valid.
    )	languageslocalesregionsettingsdetect_languages_functiondate_objN)_default_parser_defaultr   get_date_data)	date_stringdate_formatsr   r   r   r	   r
   parserdatas	            S/var/www/py-google-trends/myenv/lib/python3.11/site-packages/dateparser/__init__.pyparser   	   s    j F 	

 
 %	

  
  &?
 
 
 \::D  J       )NNNNNN)__version__confr   dater   r   r    r   r   <module>r      s                            .""  "H  H  H  H  H  H r   