ó
    Ë<iý=  ã                   óD   • S r S rS rS rS rS rS rS rS rS	 r	S
 r
g)u–   Functions to perform conversions between the different Confidence scales.
As specified in STIXâ„¢ Version 2.1. Part 1: STIX Core Concepts - Appendix Bc                 óV   • U S:X  a  gU S:X  a  gU S:X  a  gU S:X  a  g[        S	U -  5      e)
a)  
This method will transform a string value from the None / Low / Med /
High scale to its confidence integer representation.

The scale for this confidence representation is the following:

.. list-table:: None, Low, Med, High to STIX Confidence
    :header-rows: 1

    * - None/ Low/ Med/ High
      - STIX Confidence Value
    * - Not Specified
      - Not Specified
    * - None
      - 0
    * - Low
      - 15
    * - Med
      - 50
    * - High
      - 85

Args:
    scale_value (str): A string value from the scale. Accepted strings are
        "None", "Low", "Med" and "High". Argument is case sensitive.

Returns:
    int: The numerical representation corresponding to values in the
        None / Low / Med / High scale.

Raises:
    ValueError: If `scale_value` is not within the accepted strings.
ÚNoneé    ÚLowé   ÚMedé2   ÚHighéU   ú1STIX Confidence value cannot be determined for %s©Ú
ValueError©Úscale_values    ÚQ/home/james-whalen/.local/lib/python3.13/site-packages/stix2/confidence/scales.pyÚnone_low_med_high_to_valuer      sB   € ðD fÓØØ	˜Ó	ØØ	˜Ó	ØØ	˜Ó	ØäÐLÈ{ÑZÓ[Ð[ó    c                 óŒ   • U S:X  a  gSU s=:¼  a  S:¼  a   g  SU s=:¼  a  S:¼  a   g  S	U s=:¼  a  S
:¼  a   g  [        SU -  5      e)am  
This method will transform an integer value into the None / Low / Med /
High scale string representation.

The scale for this confidence representation is the following:

.. list-table:: STIX Confidence to None, Low, Med, High
    :header-rows: 1

    * - Range of Values
      - None/ Low/ Med/ High
    * - 0
      - None
    * - 1-29
      - Low
    * - 30-69
      - Med
    * - 70-100
      - High

Args:
    confidence_value (int): An integer value between 0 and 100.

Returns:
    str: A string corresponding to the None / Low / Med / High scale.

Raises:
    ValueError: If `confidence_value` is out of bounds.

r   r   é   é   r   éE   é   r   éd   éF   r	   ú!Range of values out of bounds: %sr   ©Úconfidence_values    r   Úvalue_to_none_low_medium_highr   5   se   € ð> ˜1ÓØØ	ÐÕ	$ 1Ô	$Øð 
%à	ÐÕ	% 2Ô	%Øð 
&à	Ð Õ	& BÔ	&Øð 
'ô Ð<Ð?OÑOÓPÐPr   c                 ó¸   • U S:X  a  gU S:X  a  gU S:X  a  gU S:X  a  gU S	:X  a  g
U S:X  a  gU S:X  a  gU S:X  a  gU S:X  a  gU S:X  a  gU S:X  a  g[        SU -  5      e)a(  
This method will transform a string value from the 0-10 scale to its
confidence integer representation.

The scale for this confidence representation is the following:

.. list-table:: 0-10 to STIX Confidence
    :header-rows: 1

    * - 0-10 Scale
      - STIX Confidence Value
    * - 0
      - 0
    * - 1
      - 10
    * - 2
      - 20
    * - 3
      - 30
    * - 4
      - 40
    * - 5
      - 50
    * - 6
      - 60
    * - 7
      - 70
    * - 8
      - 80
    * - 9
      - 90
    * - 10
      - 100

Args:
    scale_value (str): A string value from the scale. Accepted strings are "0"
        through "10" inclusive.

Returns:
    int: The numerical representation corresponding to values in the 0-10
        scale.

Raises:
    ValueError: If `scale_value` is not within the accepted strings.

Ú0r   Ú1é
   Ú2é   Ú3r   Ú4é(   Ú5r   Ú6é<   Ú7r   Ú8éP   Ú9éZ   Ú10r   r   r   r   s    r   Úzero_ten_to_valuer0   `   s   € ð^ cÓØØ	˜Ó	ØØ	˜Ó	ØØ	˜Ó	ØØ	˜Ó	ØØ	˜Ó	ØØ	˜Ó	ØØ	˜Ó	ØØ	˜Ó	ØØ	˜Ó	ØØ	˜Ó	ØäÐLÈ{ÑZÓ[Ð[r   c                 ó~  • SU s=:¼  a  S:¼  a   g  SU s=:¼  a  S:¼  a   g  SU s=:¼  a  S:¼  a   g	  S
U s=:¼  a  S:¼  a   g  SU s=:¼  a  S:¼  a   g  SU s=:¼  a  S:¼  a   g  SU s=:¼  a  S:¼  a   g  SU s=:¼  a  S:¼  a   g  SU s=:¼  a  S:¼  a   g  SU s=:¼  a  S:¼  a   g  SU s=:¼  a  S :¼  a   g!  [        S"U -  5      e)#aÎ  
This method will transform an integer value into the 0-10 scale string
representation.

The scale for this confidence representation is the following:

.. list-table:: STIX Confidence to 0-10
    :header-rows: 1

    * - Range of Values
      - 0-10 Scale
    * - 0-4
      - 0
    * - 5-14
      - 1
    * - 15-24
      - 2
    * - 25-34
      - 3
    * - 35-44
      - 4
    * - 45-54
      - 5
    * - 55-64
      - 6
    * - 65-74
      - 7
    * - 75-84
      - 8
    * - 95-94
      - 9
    * - 95-100
      - 10

Args:
    confidence_value (int): An integer value between 0 and 100.

Returns:
    str: A string corresponding to the 0-10 scale.

Raises:
    ValueError: If `confidence_value` is out of bounds.

é   r   r   é   é   r    é   r   r"   é"   é   r$   é,   é#   r%   é6   é-   r'   é@   é7   r(   éJ   éA   r*   éT   éK   r+   é^   r
   r-   r   é_   r/   r   r   r   s    r   Úvalue_to_zero_tenrD   ©   s  € ðZ 	ÐÕ! Ô!Øð "à	ÐÕ	$ 1Ô	$Øð 
%à	ÐÕ	% 2Ô	%Øð 
&à	ÐÕ	% 2Ô	%Øð 
&à	ÐÕ	% 2Ô	%Øð 
&à	ÐÕ	% 2Ô	%Øð 
&à	ÐÕ	% 2Ô	%Øð 
&à	ÐÕ	% 2Ô	%Øð 
&à	ÐÕ	% 2Ô	%Øð 
&à	ÐÕ	% 2Ô	%Øð 
&à	Ð Õ	& BÔ	&Øð 
'ô Ð<Ð?OÑOÓPÐPr   c                 óŒ   • U S:X  a  [        SU -  5      eU S:X  a  gU S:X  a  gU S:X  a  gU S	:X  a  g
U S:X  a  g[        SU -  5      e)a  
This method will transform a string value from the Admiralty Credibility
scale to its confidence integer representation.

The scale for this confidence representation is the following:

.. list-table:: Admiralty Credibility Scale to STIX Confidence
    :header-rows: 1

    * - Admiralty Credibility
      - STIX Confidence Value
    * - 6 - Truth cannot be judged
      - (Not present)
    * - 5 - Improbable
      - 10
    * - 4 - Doubtful
      - 30
    * - 3 - Possibly True
      - 50
    * - 2 - Probably True
      - 70
    * - 1 - Confirmed by other sources
      - 90

Args:
    scale_value (str): A string value from the scale. Accepted strings are
        "6 - Truth cannot be judged", "5 - Improbable", "4 - Doubtful",
        "3 - Possibly True", "2 - Probably True" and
        "1 - Confirmed by other sources". Argument is case sensitive.

Returns:
    int: The numerical representation corresponding to values in the
        Admiralty Credibility scale.

Raises:
    ValueError: If `scale_value` is not within the accepted strings.

z6 - Truth cannot be judgedr   ú5 - Improbabler!   ú4 - Doubtfulr   ú3 - Possibly Truer   ú2 - Probably Truer   ú1 - Confirmed by other sourcesr.   r   r   s    r   Úadmiralty_credibility_to_valuerK   ð   sk   € ðN Ð2Ó2ÜÐLÈ{ÑZÓ[Ð[Ø	Ð(Ó	(ØØ	˜Ó	&ØØ	Ð+Ó	+ØØ	Ð+Ó	+ØØ	Ð8Ó	8ØäÐLÈ{ÑZÓ[Ð[r   c                 ó¾   • SU s=:¼  a  S:¼  a   g  SU s=:¼  a  S:¼  a   g  SU s=:¼  a  S:¼  a   g	  S
U s=:¼  a  S:¼  a   g  SU s=:¼  a  S:¼  a   g  [        SU -  5      e)a  
This method will transform an integer value into the Admiralty Credibility
scale string representation.

The scale for this confidence representation is the following:

.. list-table:: STIX Confidence to Admiralty Credibility Scale
    :header-rows: 1

    * - Range of Values
      - Admiralty Credibility
    * - N/A
      - 6 - Truth cannot be judged
    * - 0-19
      - 5 - Improbable
    * - 20-39
      - 4 - Doubtful
    * - 40-59
      - 3 - Possibly True
    * - 60-79
      - 2 - Probably True
    * - 80-100
      - 1 - Confirmed by other sources

Args:
    confidence_value (int): An integer value between 0 and 100.

Returns:
    str: A string corresponding to the Admiralty Credibility scale.

Raises:
    ValueError: If `confidence_value` is out of bounds.

é   r   rF   é'   r#   rG   é;   r&   rH   éO   r)   rI   r   r,   rJ   r   r   r   s    r   Úvalue_to_admiralty_credibilityrQ   '  s‡   € ðF 
ÐÕ" Ô"Øð #à	ÐÕ	% 2Ô	%Øð 
&à	ÐÕ	% 2Ô	%Ø"ð 
&à	ÐÕ	% 2Ô	%Ø"ð 
&à	Ð Õ	& BÔ	&Ø/ð 
'ô Ð<Ð?OÑOÓPÐPr   c                 ó€   • U S:X  a  gU S:X  a  gU S:X  a  gU S:X  a  gU S	:X  a  g
U S:X  a  gU S:X  a  g[        SU -  5      e)aù  
This method will transform a string value from the WEP scale to its
confidence integer representation.

The scale for this confidence representation is the following:

.. list-table:: WEP to STIX Confidence
    :header-rows: 1

    * - WEP
      - STIX Confidence Value
    * - Impossible
      - 0
    * - Highly Unlikely/Almost Certainly Not
      - 10
    * - Unlikely/Probably Not
      - 20
    * - Even Chance
      - 50
    * - Likely/Probable
      - 70
    * - Highly likely/Almost Certain
      - 90
    * - Certain
      - 100

Args:
    scale_value (str): A string value from the scale. Accepted strings are
        "Impossible", "Highly Unlikely/Almost Certainly Not",
        "Unlikely/Probably Not", "Even Chance", "Likely/Probable",
        "Highly likely/Almost Certain" and "Certain". Argument is case
        sensitive.

Returns:
    int: The numerical representation corresponding to values in the WEP
        scale.

Raises:
    ValueError: If `scale_value` is not within the accepted strings.

Ú
Impossibler   ú$Highly Unlikely/Almost Certainly Notr!   úUnlikely/Probably Notr   úEven Chancer   úLikely/Probabler   úHighly likely/Almost Certainr.   ÚCertainr   r   r   r   s    r   Úwep_to_valuerZ   X  sg   € ðT lÓ"ØØ	Ð>Ó	>ØØ	Ð/Ó	/ØØ	˜Ó	%ØØ	Ð)Ó	)ØØ	Ð6Ó	6ØØ	˜	Ó	!ØäÐLÈ{ÑZÓ[Ð[r   c                 óÚ   • U S:X  a  gSU s=:¼  a  S:¼  a   g  SU s=:¼  a  S:¼  a   g  S	U s=:¼  a  S
:¼  a   g  SU s=:¼  a  S:¼  a   g  SU s=:¼  a  S:¼  a   g  U S:X  a  g[        SU -  5      e)a×  
This method will transform an integer value into the WEP scale string
representation.

The scale for this confidence representation is the following:

.. list-table:: STIX Confidence to WEP
    :header-rows: 1

    * - Range of Values
      - WEP
    * - 0
      - Impossible
    * - 1-19
      - Highly Unlikely/Almost Certainly Not
    * - 20-39
      - Unlikely/Probably Not
    * - 40-59
      - Even Chance
    * - 60-79
      - Likely/Probable
    * - 80-99
      - Highly likely/Almost Certain
    * - 100
      - Certain

Args:
    confidence_value (int): An integer value between 0 and 100.

Returns:
    str: A string corresponding to the WEP scale.

Raises:
    ValueError: If `confidence_value` is out of bounds.

r   rS   rM   r   rT   rN   r#   rU   rO   r&   rV   rP   r)   rW   éc   r,   rX   r   rY   r   r   r   s    r   Úvalue_to_wepr]   ”  s›   € ðJ ˜1ÓØØ	ÐÕ	$ 1Ô	$Ø5ð 
%à	ÐÕ	% 2Ô	%Ø&ð 
&à	ÐÕ	% 2Ô	%Øð 
&à	ÐÕ	% 2Ô	%Ø ð 
&à	ÐÕ	% 2Ô	%Ø-ð 
&à	˜SÓ	 ØäÐ<Ð?OÑOÓPÐPr   c                 ó€   • U S:X  a  gU S:X  a  gU S:X  a  gU S:X  a  gU S	:X  a  g
U S:X  a  gU S:X  a  g[        SU -  5      e)aŠ  
This method will transform a string value from the DNI scale to its
confidence integer representation.

The scale for this confidence representation is the following:

.. list-table:: DNI Scale to STIX Confidence
    :header-rows: 1

    * - DNI Scale
      - STIX Confidence Value
    * - Almost No Chance / Remote
      - 5
    * - Very Unlikely / Highly Improbable
      - 15
    * - Unlikely / Improbable
      - 30
    * - Roughly Even Chance / Roughly Even Odds
      - 50
    * - Likely / Probable
      - 70
    * - Very Likely / Highly Probable
      - 85
    * - Almost Certain / Nearly Certain
      - 95

Args:
    scale_value (str): A string value from the scale. Accepted strings are
        "Almost No Chance / Remote", "Very Unlikely / Highly Improbable",
        "Unlikely / Improbable", "Roughly Even Chance / Roughly Even Odds",
        "Likely / Probable", "Very Likely / Highly Probable" and
        "Almost Certain / Nearly Certain". Argument is case sensitive.

Returns:
    int: The numerical representation corresponding to values in the DNI
        scale.

Raises:
    ValueError: If `scale_value` is not within the accepted strings.

úAlmost No Chance / Remoter4   ú!Very Unlikely / Highly Improbabler   úUnlikely / Improbabler   ú'Roughly Even Chance / Roughly Even Oddsr   úLikely / Probabler   úVery Likely / Highly Probabler
   úAlmost Certain / Nearly CertainrC   r   r   r   s    r   Údni_to_valuerf   Ë  sj   € ðT Ð1Ó1ØØ	Ð;Ó	;ØØ	Ð/Ó	/ØØ	ÐAÓ	AØØ	Ð+Ó	+ØØ	Ð7Ó	7ØØ	Ð9Ó	9ØäÐLÈ{ÑZÓ[Ð[r   c                 óþ   • SU s=:¼  a  S:¼  a   g  SU s=:¼  a  S:¼  a   g  SU s=:¼  a  S:¼  a   g	  S
U s=:¼  a  S:¼  a   g  SU s=:¼  a  S:¼  a   g  SU s=:¼  a  S:¼  a   g  SU s=:¼  a  S:¼  a   g  [        SU -  5      e)a,  
This method will transform an integer value into the DNI scale string
representation.

The scale for this confidence representation is the following:

.. list-table:: STIX Confidence to DNI Scale
    :header-rows: 1

    * - Range of Values
      - DNI Scale
    * - 0-9
      - Almost No Chance / Remote
    * - 10-19
      - Very Unlikely / Highly Improbable
    * - 20-39
      - Unlikely / Improbable
    * - 40-59
      - Roughly Even Chance / Roughly Even Odds
    * - 60-79
      - Likely / Probable
    * - 80-89
      - Very Likely / Highly Probable
    * - 90-100
      - Almost Certain / Nearly Certain

Args:
    confidence_value (int): An integer value between 0 and 100.

Returns:
    str: A string corresponding to the DNI scale.

Raises:
    ValueError: If `confidence_value` is out of bounds.

é	   r   r_   rM   r!   r`   rN   r#   ra   rO   r&   rb   rP   r)   rc   éY   r,   rd   r   r.   re   r   r   r   s    r   Úvalue_to_dnirj     s³   € ðJ 	ÐÕ! Ô!Ø*ð "à	ÐÕ	% 2Ô	%Ø2ð 
&à	ÐÕ	% 2Ô	%Ø&ð 
&à	ÐÕ	% 2Ô	%Ø8ð 
&à	ÐÕ	% 2Ô	%Ø"ð 
&à	ÐÕ	% 2Ô	%Ø.ð 
&à	Ð Õ	& BÔ	&Ø0ð 
'ô Ð<Ð?OÑOÓPÐPr   N)Ú__doc__r   r   r0   rD   rK   rQ   rZ   r]   rf   rj   © r   r   Ú<module>rm      sR   ðñPò+\ò\(QòVF\òRDQòN4\òn.Qòb9\òx4Qòn9\óx4Qr   