class_docstr: Amazon SageMaker channel configurations for S3 data sources.
  
  Attributes:
      config (dict[str, dict]): A SageMaker ``DataSource`` referencing
          a SageMaker ``S3DataSource``.
class_docstr_tok: ["Amazon","SageMaker","channel","configurations","for","S3","data","sources",".","Attributes",":","config","(","dict","[","str",",","dict","]",")",":","A","SageMaker","``","DataSource","``","referencing","a","SageMaker","``","S3DataSource","``","."]
docstr: Create a definition for input data used by an SageMaker training job.
  
  See AWS documentation on the ``CreateTrainingJob`` API for more details
  on the parameters.
  
  Args:
      s3_data (str or PipelineVariable): Defines the location of S3 data to train on.
      distribution (str or PipelineVariable): Valid values: ``'FullyReplicated'``,
          ``'ShardedByS3Key'`` (default: ``'FullyReplicated'``).
      compression (str or PipelineVariable): Valid values: ``'Gzip'``, ``None``
          (default: None). This is used only in Pipe input mode.
      content_type (str or PipelineVariable): MIME type of the input data
          (default: None).
      record_wrapping (str or PipelineVariable): Valid values: 'RecordIO'
          (default: None).
      s3_data_type (str or PipelineVariable): Valid values: ``'S3Prefix'``,
          ``'ManifestFile'``, ``'AugmentedManifestFile'``.
          If ``'S3Prefix'``, ``s3_data`` defines a prefix of s3 objects to train on.
          All objects with s3 keys beginning with ``s3_data`` will be used to train.
          If ``'ManifestFile'`` or ``'AugmentedManifestFile'``,
          then ``s3_data`` defines a
          single S3 manifest file or augmented manifest file respectively,
          listing the S3 data to train on. Both the ManifestFile and
          AugmentedManifestFile formats are described at `S3DataSource
          <https://docs.aws.amazon.com/sagemaker/latest/dg/API_S3DataSource.html>`_
          in the `Amazon SageMaker API reference`.
      instance_groups (list[str] or list[PipelineVariable]): Optional. A list of
          instance group names in string format that you specified while configuring
          a heterogeneous cluster using the :class:`sagemaker.instance_group.InstanceGroup`.
          S3 data will be sent to all instance groups in the specified list.
          For instructions on how to use InstanceGroup objects
          to configure a heterogeneous cluster
          through the SageMaker generic and framework estimator classes, see
          `Train Using a Heterogeneous Cluster
          <https://docs.aws.amazon.com/sagemaker/latest/dg/train-heterogeneous-cluster.html>`_
          in the *Amazon SageMaker developer guide*.
          (default: None)
      input_mode (str or PipelineVariable): Optional override for this channel's input mode
          (default: None). By default, channels will use the input mode defined on
          ``sagemaker.estimator.EstimatorBase.input_mode``, but they will ignore
          that setting if this parameter is set.
  
              * None - Amazon SageMaker will use the input mode specified in the ``Estimator``
              * 'File' - Amazon SageMaker copies the training dataset from the S3 location to
                  a local directory.
              * 'Pipe' - Amazon SageMaker streams data directly from S3 to the container via
                  a Unix-named pipe.
              * 'FastFile' - Amazon SageMaker streams data from S3 on demand instead of
                  downloading the entire dataset before training begins.
  
      attribute_names (list[str] or list[PipelineVariable]): A list of one or more attribute
          names to use that are found in a specified AugmentedManifestFile.
      target_attribute_name (str or PipelineVariable): The name of the attribute will be
          predicted (classified) in a SageMaker AutoML job. It is required if the input is
          for SageMaker AutoML job.
      shuffle_config (sagemaker.inputs.ShuffleConfig): If specified this configuration enables
          shuffling on this channel. See the SageMaker API documentation for more info:
          https://docs.aws.amazon.com/sagemaker/latest/dg/API_ShuffleConfig.html
docstr_tok: ["Create","a","definition","for","input","data","used","by","an","SageMaker","training","job",".","See","AWS","documentation","on","the","``","CreateTrainingJob","``","API","for","more","details","on","the","parameters",".","Args",":","s3_data","(","str","or","PipelineVariable",")",":","Defines","the","location","of","S3","data","to","train","on",".","distribution","(","str","or","PipelineVariable",")",":","Valid","values",":","``","'FullyReplicated","'","``",",","``","'ShardedByS3Key","'","``","(","default",":","``","'FullyReplicated","'","``",")",".","compression","(","str","or","PipelineVariable",")",":","Valid","values",":","``","'Gzip","'","``",",","``","None","``","(","default",":","None",")",".","This","is","used","only","in","Pipe","input","mode",".","content_type","(","str","or","PipelineVariable",")",":","MIME","type","of","the","input","data","(","default",":","None",")",".","record_wrapping","(","str","or","PipelineVariable",")",":","Valid","values",":","'RecordIO'","(","default",":","None",")",".","s3_data_type","(","str","or","PipelineVariable",")",":","Valid","values",":","``","'S3Prefix","'","``",",","``","'ManifestFile","'","``",",","``","'AugmentedManifestFile","'","``",".","If","``","'S3Prefix","'","``",",","``","s3_data","``","defines","a","prefix","of","s3","objects","to","train","on",".","All","objects","with","s3","keys","beginning","with","``","s3_data","``","will","be","used","to","train",".","If","``","'ManifestFile","'","``","or","``","'AugmentedManifestFile","'","``",",","then","``","s3_data","``","defines","a","single","S3","manifest","file","or","augmented","manifest","file","respectively",",","listing","the","S3","data","to","train","on",".","Both","the","ManifestFile","and","AugmentedManifestFile","formats","are","described","at","`","S3DataSource","<","https",":","\/\/docs.aws.amazon.com\/sagemaker\/latest\/dg\/API_S3DataSource.html",">","`","_","in","the","`","Amazon","SageMaker","API","reference","`",".","instance_groups","(","list","[","str","]","or","list","[","PipelineVariable","]",")",":","Optional",".","A","list","of","instance","group","names","in","string","format","that","you","specified","while","configuring","a","heterogeneous","cluster","using","the",":","class",":","`","sagemaker.instance_group.InstanceGroup","`",".","S3","data","will","be","sent","to","all","instance","groups","in","the","specified","list",".","For","instructions","on","how","to","use","InstanceGroup","objects","to","configure","a","heterogeneous","cluster","through","the","SageMaker","generic","and","framework","estimator","classes",",","see","`","Train","Using","a","Heterogeneous","Cluster","<","https",":","\/\/docs.aws.amazon.com\/sagemaker\/latest\/dg\/train-heterogeneous-cluster.html",">","`","_","in","the","*","Amazon","SageMaker","developer","guide","*",".","(","default",":","None",")","input_mode","(","str","or","PipelineVariable",")",":","Optional","override","for","this","channel","'s","input","mode","(","default",":","None",")",".","By","default",",","channels","will","use","the","input","mode","defined","on","``","sagemaker.estimator.EstimatorBase.input_mode","``",",","but","they","will","ignore","that","setting","if","this","parameter","is","set",".","*","None","-","Amazon","SageMaker","will","use","the","input","mode","specified","in","the","``","Estimator","``","*","'File","'","-","Amazon","SageMaker","copies","the","training","dataset","from","the","S3","location","to","a","local","directory",".","*","'Pipe","'","-","Amazon","SageMaker","streams","data","directly","from","S3","to","the","container","via","a","Unix-named","pipe",".","*","'FastFile","'","-","Amazon","SageMaker","streams","data","from","S3","on","demand","instead","of","downloading","the","entire","dataset","before","training","begins",".","attribute_names","(","list","[","str","]","or","list","[","PipelineVariable","]",")",":","A","list","of","one","or","more","attribute","names","to","use","that","are","found","in","a","specified","AugmentedManifestFile",".","target_attribute_name","(","str","or","PipelineVariable",")",":","The","name","of","the","attribute","will","be","predicted","(","classified",")","in","a","SageMaker","AutoML","job",".","It","is","required","if","the","input","is","for","SageMaker","AutoML","job",".","shuffle_config","(","sagemaker.inputs.ShuffleConfig",")",":","If","specified","this","configuration","enables","shuffling","on","this","channel",".","See","the","SageMaker","API","documentation","for","more","info",":","https",":","\/\/docs.aws.amazon.com\/sagemaker\/latest\/dg\/API_ShuffleConfig.html"]
code: def __init__(
      self,
      s3_data: Union[str, PipelineVariable],
      distribution: Optional[Union[str, PipelineVariable]] = None,
      compression: Optional[Union[str, PipelineVariable]] = None,
      content_type: Optional[Union[str, PipelineVariable]] = None,
      record_wrapping: Optional[Union[str, PipelineVariable]] = None,
      s3_data_type: Union[str, PipelineVariable] = "S3Prefix",
      instance_groups: Optional[
          List[Union[str, PipelineVariable]]
      ] = None,
      input_mode: Optional[Union[str, PipelineVariable]] = None,
      attribute_names: Optional[
          List[Union[str, PipelineVariable]]
      ] = None,
      target_attribute_name: Optional[
          Union[str, PipelineVariable]
      ] = None,
      shuffle_config: Optional["ShuffleConfig"] = None,
  ):
      r"""Create a definition for input data used by an SageMaker training job.
  
      See AWS documentation on the ``CreateTrainingJob`` API for more details
      on the parameters.
  
      Args:
          s3_data (str or PipelineVariable): Defines the location of S3 data to train on.
          distribution (str or PipelineVariable): Valid values: ``'FullyReplicated'``,
              ``'ShardedByS3Key'`` (default: ``'FullyReplicated'``).
          compression (str or PipelineVariable): Valid values: ``'Gzip'``, ``None``
              (default: None). This is used only in Pipe input mode.
          content_type (str or PipelineVariable): MIME type of the input data
              (default: None).
          record_wrapping (str or PipelineVariable): Valid values: 'RecordIO'
              (default: None).
          s3_data_type (str or PipelineVariable): Valid values: ``'S3Prefix'``,
              ``'ManifestFile'``, ``'AugmentedManifestFile'``.
              If ``'S3Prefix'``, ``s3_data`` defines a prefix of s3 objects to train on.
              All objects with s3 keys beginning with ``s3_data`` will be used to train.
              If ``'ManifestFile'`` or ``'AugmentedManifestFile'``,
              then ``s3_data`` defines a
              single S3 manifest file or augmented manifest file respectively,
              listing the S3 data to train on. Both the ManifestFile and
              AugmentedManifestFile formats are described at `S3DataSource
              <https://docs.aws.amazon.com/sagemaker/latest/dg/API_S3DataSource.html>`_
              in the `Amazon SageMaker API reference`.
          instance_groups (list[str] or list[PipelineVariable]): Optional. A list of
              instance group names in string format that you specified while configuring
              a heterogeneous cluster using the :class:`sagemaker.instance_group.InstanceGroup`.
              S3 data will be sent to all instance groups in the specified list.
              For instructions on how to use InstanceGroup objects
              to configure a heterogeneous cluster
              through the SageMaker generic and framework estimator classes, see
              `Train Using a Heterogeneous Cluster
              <https://docs.aws.amazon.com/sagemaker/latest/dg/train-heterogeneous-cluster.html>`_
              in the *Amazon SageMaker developer guide*.
              (default: None)
          input_mode (str or PipelineVariable): Optional override for this channel's input mode
              (default: None). By default, channels will use the input mode defined on
              ``sagemaker.estimator.EstimatorBase.input_mode``, but they will ignore
              that setting if this parameter is set.
  
                  * None - Amazon SageMaker will use the input mode specified in the ``Estimator``
                  * 'File' - Amazon SageMaker copies the training dataset from the S3 location to
                      a local directory.
                  * 'Pipe' - Amazon SageMaker streams data directly from S3 to the container via
                      a Unix-named pipe.
                  * 'FastFile' - Amazon SageMaker streams data from S3 on demand instead of
                      downloading the entire dataset before training begins.
  
          attribute_names (list[str] or list[PipelineVariable]): A list of one or more attribute
              names to use that are found in a specified AugmentedManifestFile.
          target_attribute_name (str or PipelineVariable): The name of the attribute will be
              predicted (classified) in a SageMaker AutoML job. It is required if the input is
              for SageMaker AutoML job.
          shuffle_config (sagemaker.inputs.ShuffleConfig): If specified this configuration enables
              shuffling on this channel. See the SageMaker API documentation for more info:
              https://docs.aws.amazon.com/sagemaker/latest/dg/API_ShuffleConfig.html
      """
      self.config = {
          "DataSource": {
              "S3DataSource": {
                  "S3DataType": s3_data_type,
                  "S3Uri": s3_data,
              }
          }
      }
  
      if not (target_attribute_name or distribution):
          distribution = "FullyReplicated"
  
      if distribution is not None:
          self.config["DataSource"]["S3DataSource"][
              "S3DataDistributionType"
          ] = distribution
  
      if compression is not None:
          self.config["CompressionType"] = compression
      if content_type is not None:
          self.config["ContentType"] = content_type
      if record_wrapping is not None:
          self.config["RecordWrapperType"] = record_wrapping
      if instance_groups is not None:
          self.config["DataSource"]["S3DataSource"][
              "InstanceGroupNames"
          ] = instance_groups
      if input_mode is not None:
          self.config["InputMode"] = input_mode
      if attribute_names is not None:
          self.config["DataSource"]["S3DataSource"][
              "AttributeNames"
          ] = attribute_names
      if target_attribute_name is not None:
          self.config["TargetAttributeName"] = target_attribute_name
      if shuffle_config is not None:
          self.config["ShuffleConfig"] = {"Seed": shuffle_config.seed}
  
imports: from __future__ import absolute_import, print_function
  from typing import Union, Optional, List
  import attr
  from sagemaker.workflow.entities import PipelineVariable
label_desc: Use image node_id 1 to create a new TrainingInput object from inherited base classes: object with example: obj = TrainingInput(s3_data, distribution, compression, content_type, record_wrapping, s3_data_type, instance_groups, input_mode, attribute_names, target_attribute_name, shuffle_config)