def __init__(self, bucket, prefix, sagemaker_session):
        """Create an S3DataSource instance

        Args:
            bucket (str): S3 bucket name
            prefix (str): S3 prefix path to the data
            sagemaker_session (:class:`sagemaker.session.Session`): a sagemaker_session with the desired settings
                to talk to S3
        """

        # Create a temporary dir to store the S3 contents
        root_dir = sagemaker.utils.get_config_value('local.container_root', sagemaker_session.config)
        if root_dir:
            root_dir = os.path.abspath(root_dir)

        working_dir = tempfile.mkdtemp(dir=root_dir)
        # Docker cannot mount Mac OS /var folder properly see
        # https://forums.docker.com/t/var-folders-isnt-mounted-properly/9600
        # Only apply this workaround if the user didn't provide an alternate storage root dir.
        if root_dir is None and platform.system() == 'Darwin':
            working_dir = '/private{}'.format(working_dir)

        sagemaker.utils.download_folder(bucket, prefix, working_dir, sagemaker_session)
        self.files = LocalFileDataSource(working_dir)
def __init__ ( self , bucket , prefix , sagemaker_session ) : root_dir = sagemaker . utils . get_config_value ( 'local.container_root' , sagemaker_session . config ) if root_dir : root_dir = os . path . abspath ( root_dir ) working_dir = tempfile . mkdtemp ( dir = root_dir ) if root_dir is None and platform . system ( ) == 'Darwin' : working_dir = '/private{}' . format ( working_dir ) sagemaker . utils . download_folder ( bucket , prefix , working_dir , sagemaker_session ) self . files = LocalFileDataSource ( working_dir )
Create an S3DataSource instance

        Args:
            bucket (str): S3 bucket name
            prefix (str): S3 prefix path to the data
            sagemaker_session (:class:`sagemaker.session.Session`): a sagemaker_session with the desired settings
                to talk to S3