Return an Instance of :class:`sagemaker.local.data.DataSource` that can handle
    the provided data_source URI.

    data_source can be either file:// or s3://

    Args:
        data_source (str): a valid URI that points to a data source.
        sagemaker_session (:class:`sagemaker.session.Session`): a SageMaker Session to interact with
            S3 if required.

    Returns
        :class:`sagemaker.local.data.DataSource`: an Instance of a Data Source

def get_data_source_instance(data_source, sagemaker_session):
    """Return an Instance of :class:`sagemaker.local.data.DataSource` that can handle
    the provided data_source URI.

    data_source can be either file:// or s3://

    Args:
        data_source (str): a valid URI that points to a data source.
        sagemaker_session (:class:`sagemaker.session.Session`): a SageMaker Session to interact with
            S3 if required.

    Returns
        :class:`sagemaker.local.data.DataSource`: an Instance of a Data Source

    """
    parsed_uri = urlparse(data_source)
    if parsed_uri.scheme == 'file':
        return LocalFileDataSource(parsed_uri.netloc + parsed_uri.path)
    elif parsed_uri.scheme == 's3':
        return S3DataSource(parsed_uri.netloc, parsed_uri.path, sagemaker_session)