
    
                     h    d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 d Zd	d
ddZd Zy)z/Utilities for AI Platform Tensorboard commands.    )absolute_import)division)unicode_literals)client)	arg_utils)	resourcesc                     d}d| v r|dz  }d| v r|dz  }d| v r|dz  }|dz  }	 t         j                  j                  | |	      S # t         j                  $ r$ t         j                  j                  | d
	      cY S w xY w)zParse operation relative resource name to the operation reference object.

  Args:
    operation_name: The operation resource name

  Returns:
    The operation reference object
  zaiplatform.projects.locationsz/tensorboards/z.tensorboardsz/experiments/z.experimentsz/runs/z.runsz.operations)
collectionz(aiplatform.projects.locations.operations)r   REGISTRYParseRelativeName WrongResourceCollectionException)operation_namer
   s     6lib/googlecloudsdk/command_lib/ai/tensorboards_util.pyParseTensorboardOperationr      s     /*'/!J&. J'J*O//: 0 / /		3	3 O//#M 0 O OOs    A 4A<;A<)scalarzfUsed for tensorboard-time-series that is a list of scalars. E.g. accuracy of a model over epochs/time.)tensorz{Used for tensorboard-time-series that is a list of tensors. E.g. histograms of weights of layer in a model over epoch/time.)zblob-sequencezzUsed for tensorboard-time-series that is a list of blob sequences. E.g. set of sample images with labels over epochs/time.)SCALARTENSORBLOB_SEQUENCEc           	          t        j                  dt        j                         j                  j
                  dt        dj                  |       d       S )Nz--typeTzValue type of the {noun}.noun)requiredcustom_mappingshelp_strdefault)r   ChoiceEnumMapperr   GetMessagesModule1GoogleCloudAiplatformV1beta1TensorboardTimeSeriesValueTypeValueValuesEnum_TYPE_CHOICESformatr   s    r   GetTensorboardTimeSeriesTypeArgr#   F   sL    		#	# 99#*11t1<
     N)__doc__
__future__r   r   r   1googlecloudsdk.api_lib.ai.tensorboard_time_seriesr   $googlecloudsdk.command_lib.util.apisr   googlecloudsdk.corer   r   r!   r#    r$   r   <module>r+      s=    6 &  ' D : )O4

&	r$   