
    s                     R   S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSK	J
r
  SSK	Jr  SS	K	Jr  SS
KJr  SSKJr  SSKJr  SSKJr  \R*                  " SSSS9r\R*                  " S\SSS9r\R*                  " S\SSS9r\R*                  " SSSS9rS r\
R8                  4S jrg)z;Flag definitions specifically for gcloud ai hp-tuning-jobs.    )absolute_import)division)unicode_literals)base)concepts)	constants)flags)region_util)hp_tuning_jobs_util)	arg_utils)labels_util)concept_parsersz--display-nameTz8Display name of the hyperparameter tuning job to create.)requiredhelpz--max-trial-countNz7Desired total number of trials. The default value is 1.)typedefaultr   z--parallel-trial-countzDDesired number of Trials to run in parallel. The default value is 1.z--configa  
Path to the job configuration file. This file should be a YAML document containing a HyperparameterTuningSpec.
If an option is specified both in the configuration file **and** via command line arguments, the command line arguments
override the configuration file.

Example(YAML):

  displayName: TestHpTuningJob
  maxTrialCount: 1
  parallelTrialCount: 1
  studySpec:
    metrics:
    - metricId: x
      goal: MINIMIZE
    parameters:
    - parameterId: z
      integerValueSpec:
        minValue: 1
        maxValue: 100
    algorithm: RANDOM_SEARCH
  trialJobSpec:
    workerPoolSpecs:
    - machineSpec:
        machineType: n1-standard-4
      replicaCount: 1
      containerSpec:
        imageUri: gcr.io/ucaip-test/ucaip-training-test
c                    [         R                  U 5        [        R                  U 5        [        R                  U 5        [        R                  U 5        [
        R                  " U 5        [        R                  " U S[        R                  " [        R                  5      S9  [        R                  R                  U 5        [        R                  R                  U 5        [        R                  R                  U 5        [        R                   R                  U 5        [        R"                  " U S5        [$        R&                  " SUSS9R(                  R                  U 5        g)z*Adds arguments for creating hp tuning job.z%to create a hyperparameter tuning jobprompt_funchyperparameter tuning jobz--algorithmz0Search algorithm specified for the given study. )help_strN)_HPTUNING_JOB_DISPLAY_NAMEAddToParser_HPTUNING_JOB_CONFIG_HPTUNING_MAX_TRIAL_COUNT_HPTUNING_PARALLEL_TRIAL_COUNTr   AddCreateLabelsFlagsr	   AddRegionResourceArgr
   GetPromptForRegionFuncr   SUPPORTED_TRAINING_REGIONSTRAINING_SERVICE_ACCOUNTNETWORKENABLE_WEB_ACCESSENABLE_DASHBOARD_ACCESSAddKmsKeyResourceArgr   ChoiceEnumMapper
choice_arg)parseralgorithm_enums     9lib/googlecloudsdk/command_lib/ai/hp_tuning_jobs/flags.pyAddCreateHpTuningJobFlagsr+   R   s    ((0""6*''/ ,,V4""6*-44

.
.01
   ,,V4--F#%%f-++F3V%@AA J{{6"    c           
      4   [         R                  " [        R                  S[         R                  [
        R                  " [        R                  " U5      S9SS9n[        R                  R                  SUSR                  U5      SS9R                  U 5        g	)
a2  Adds a resource argument for a Vertex AI hyperparameter tuning job.

NOTE: Must be used only if it's the only resource arg in the command.

Args:
  parser: the parser for the command.
  verb: str, the verb to describe the resource, such as 'to update'.
  regions: list[str], the list of supported regions.
r   r   F)resource_collectionresource_name
projectsIdlocationsIddisable_auto_completershptuning_jobz!The hyperparameter tuning job {}.T)r   N)r   ResourceSpecr   HPTUNING_JOB_COLLECTION DEFAULT_PROJECT_ATTRIBUTE_CONFIGr	   RegionAttributeConfigr
   r   r   ConceptParserForResourceformatr   )r(   verbregionsjob_resource_specs       r*   AddHptuningJobResourceArgr>   m   s     ++-EE/::--!88AC#% ++)006	 ,  ![(r,   )__doc__
__future__r   r   r   googlecloudsdk.callioper    googlecloudsdk.calliope.conceptsr   googlecloudsdk.command_lib.air   r	   r
   ,googlecloudsdk.command_lib.ai.hp_tuning_jobsr   $googlecloudsdk.command_lib.util.apisr   $googlecloudsdk.command_lib.util.argsr   (googlecloudsdk.command_lib.util.conceptsr   Argumentr   intr   r   r   r+   r    r>    r,   r*   <module>rK      s    B &  ' ( 5 3 / 5 L : < D!]]
DG  !MM		B	D 
 "&		O	"Q 
 }}
 B#: '0&J&J)r,   