U
    /e];                     @  s  d Z ddlmZ ddlZeeZddlmZm	Z	m
Z
mZ ddlmZmZ ddlmZmZ ddlmZ d	ZG d
d dZddddddddddZedddZedddddddddd d!dd"d#Zed$d%d&d'Zed(d)d*d+Zed,d-d.d/d0d1Zed2d3d4Zed5d6d7d8d9Zed:d;d<d=d>d?d@dAdBdCdDdEZedFdGdHdIdJdKdLdMdNdO
ZedPdQZ edPdQdRZ!edSdTZ"edUdVdWdXZ#dYZ$ee%e&e$ dZ  Z'ee%e&e$ d d[diZ(ed\ Z)ee)Z*ed!d"Z+ed] Z,ee,Z-ed^d_Z.ed+d`daZ/eZ0edbdcddZ1ed5d6d7d8d9Z2ededcdfZ3edg Z4ee4Z5edhdidjdkZ6edldmdndodpdqdrdsdtdudvdwdxdydzd{ddd|d}d~ddddddddZ7eej8jddiZ9eddddddddddddddddddddddddddddZ:eddZ;edddZ<eddZ=eej> Z?ed Z@ee@ZAeddddddZBeddZCeddZDedcdddddZEeddddZFed ZGeeGZHeddddZIeddăZJeddƃZKeddZLedddZMed!d"dZNed dd#ddd̃ZOeddddЃZPeddddUZQeddd!d"d3d4ZRedddԃZSed2ddddZTed dd#ZUed3d4ZVdS )a   Common enumerations to be used together with |Enum| property.

This module provides many pre-defined enumerations, as well as functions
for creating new enumerations.

New enumerations can be created using the |enumeration| function:

.. code-block:: python

    #: Specify a nautically named side, port or starboard
    MyEnum = enumeration("port", "starboard")

Typically, enumerations are used to define |Enum| properties:

.. code-block:: python

    from bokeh.model import Model
    from bokeh.core.properties import Enum

    class MyModel(Model):

        location = Enum(MyEnum, help="""
        Whether the thing should be a port or starboard.
        """)

Enumerations have a defined order and support iteration:

.. code-block:: python

    >>> for loc in MyEnum:
    ...     print(loc)
    ...
    port
    starboard

as well as containment tests:

.. code-block:: python

    >>> "port" in MyEnum
    True

Enumerations can be easily documented in Sphinx documentation with the
:ref:`bokeh.sphinxext.bokeh_enum` Sphinx extension.

----

.. autofunction:: bokeh.core.enums.enumeration

----

.. |Enum| replace:: :class:`~bokeh.core.properties.Enum`
.. |enumeration| replace:: :func:`~bokeh.core.enums.enumeration`

    )annotationsN)AnyDictIteratorList)Literalget_args   )colorspalettes)	nice_join)8AlignAnchor
AngleUnitsAutosizeMode
ButtonTypeCalendarPositionDashPattern
DateFormatDatetimeUnits	Dimension
Dimensions	DirectionEnumerationenumeration	FontStyleHatchPatternHatchPatternAbbreviation
HoldPolicyHorizontalLocationJitterRandomDistributionLatLonLegendClickPolicyLegendLocationLineCapLineDashLineJoinLocationMapType
MarkerType
NamedColorNumeralLanguageOrientationOutputBackendPaddingUnitsPalettePlaceRenderLevel
RenderModeResetPolicyRoundingFunctionSelectionMode
SizingModeSizingPolicySortDirectionSpatialUnitsStartEndStepMode	TextAlignTextBaselineTextureRepetitionTickLabelOrientationTooltipAttachmentTooltipFieldFormatterTrackPolicyVerticalAlignVerticalLocationc                   @  st   e Zd ZU dZdZded< ded< ded< ded	< d
dddZdddddZddddZddddZ	eZ
dS )r   z Represent an enumerated collection of values.

    .. note::
        Instances of ``Enumeration`` typically should not be constructed
        directly. Instead, use the |enumeration| function.

     z	List[str]_valuesstr_defaultbool_case_sensitive_quotezIterator[str])returnc                 C  s
   t | jS N)iterrF   selfrE   rE   4/tmp/pip-unpacked-wheel-f5fndrjf/bokeh/core/enums.py__iter__   s    zEnumeration.__iter__)valuerL   c                 C  s   | j s| }|| jkS rM   )rJ   lowerrF   )rP   rS   rE   rE   rQ   __contains__   s    zEnumeration.__contains__c                   s0   | j r
tnt dd fdd| jD  dS )NzEnumeration(z, c                 3  s   | ]} |V  qd S rM   rE   ).0xfnrE   rQ   	<genexpr>   s     z&Enumeration.__str__.<locals>.<genexpr>))rK   reprrG   joinrF   rO   rE   rX   rQ   __str__   s    zEnumeration.__str__intc                 C  s
   t | jS rM   )lenrF   rO   rE   rE   rQ   __len__   s    zEnumeration.__len__N)__name__
__module____qualname____doc__	__slots____annotations__rR   rU   r^   ra   __repr__rE   rE   rE   rQ   r      s   
r   TF)case_sensitivequoter   rI   )valuesri   rj   rL   c                 G  s   t |dkr&t|d dr&t|d }|r<tdd |D sNtdt| t |t t|krttdt| dd	 |D }|t||d | |d
 t	dt
f| S )a   Create an |Enumeration| object from a sequence of values.

    Call ``enumeration`` with a sequence of (unique) strings to create an
    Enumeration object:

    .. code-block:: python

        #: Specify the horizontal alignment for rendering text
        TextAlign = enumeration("left", "right", "center")

    Args:
        values (str) : string enumeration values, passed as positional arguments

            The order of arguments is the order of the enumeration, and the
            first element will be considered the default value when used
            to create |Enum| properties.

    Keyword Args:
        case_sensitive (bool, optional) :
            Whether validation should consider case or not (default: True)

        quote (bool, optional):
            Whether values should be quoted in the string representations
            (default: False)

    Raises:
        ValueError if values empty, if any value is not a string or not unique

    Returns:
        Enumeration

       r   __args__c                 s  s   | ]}t |to|V  qd S rM   )
isinstancerG   rV   rS   rE   rE   rQ   rZ      s     zenumeration.<locals>.<genexpr>z.expected a non-empty sequence of strings, got z&enumeration items must be unique, got c                 S  s   i | ]
}||qS rE   rE   ro   rE   rE   rQ   
<dictcomp>   s      zenumeration.<locals>.<dictcomp>)rF   rH   rJ   rK   r   )r`   hasattrr   all
ValueErrorr   setupdatelisttyper   )ri   rj   rk   attrsrE   rE   rQ   r      s    !r   startcenterendZtop_leftZ
top_centerZ	top_rightZcenter_leftZcenter_centerZcenter_rightZbottom_leftZbottom_centerZbottom_righttopleftrightZbottomdegZradZgradZturnZfit_columnsZfit_viewportZ	force_fitnonedefaultZprimarysuccesswarningZdangerlightautoabovebelowZsolidZdashedZdottedZdotdashZdashdotZATOMZW3CzRFC-3339zISO-8601ZCOOKIEzRFC-822zRFC-850zRFC-1036zRFC-1123zRFC-2822ZRSS	TIMESTAMPmicrosecondsZmillisecondssecondsZminsecminutesZhourminhoursdaysmonthsZyearswidthheightZbothZclockZ	anticlocknormalZitalicZboldzbold italic)) Zblank).dot)oZring)-Zhorizontal_line)|Zvertical_line)+cross)"Zhorizontal_dash):Zvertical_dash)@Zspiral)/Zright_diagonal_line)\Zleft_diagonal_line)rW   Zdiagonal_cross),Zright_diagonal_dash)`Zleft_diagonal_dash)vZhorizontal_wave)>Zvertical_wave)*Zcriss_crossrl   rj   )combineZcollect)uniformr   ZlatZlonZhideZmuteZbuttroundZsquareZmiterZbevel)r   r   r}   r~   Z	satelliteZroadmapZterrainZhybridZasteriskZcircleZcircle_crossZ
circle_dotZcircle_xZcircle_yr   ZdashZdiamondZdiamond_crossZdiamond_dotr   hexZhex_dotZinverted_triangleplusZsquare_crossZ
square_dotZ
square_pinZsquare_xZstarZstar_dotZtriangleZtriangle_dotZtriangle_pinrW   yri   zbe-nlZchscszda-dkzde-chdeenzen-gbzes-ESesetfizfr-CAzfr-chfrhuitjaznl-nlplzpt-brzpt-ptruzru-UAskthtrzuk-UAZ
horizontalZverticalZcanvassvgZwebglpercentabsolute)r   r   r}   r~   rz   imageZunderlayZglyphZguide
annotationoverlaycssstandardZ
event_onlyZnearestfloorZ	rounddownceilZroundupreplaceappendZ	intersectsubtract)Zstretch_widthZstretch_heightZstretch_bothZscale_widthZscale_heightZ
scale_bothfixedr   ZfitminmaxZ	ascendingZ
descendingZscreendatabeforeafterZmiddleZ
alphabeticZhangingideographicrepeatZrepeat_xZrepeat_yZ	no_repeatparallelZnumeraldatetimeZprintfZflex)Wre   
__future__r   logging	getLoggerrb   logtypingr   r   r   r   Ztyping_extensionsr   r    r
   r   Zutil.stringr   __all__r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Z_hatch_patternsrv   zipr   r   ZHoldPolicyTyper   r   ZJitterRandomDistributionTyper    r!   r"   r#   r$   r%   r&   ZLocationTyper'   r(   r)   namedr*   r+   r,   r-   r.   Z__palettes__r/   Z	PlaceTyper0   r1   r2   r3   r4   r5   ZSizingModeTyper6   r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rE   rE   rQ   <module>   s,  ;
C 5               
     



                       	                  







