def METHOD_NAME(directory, name, num_files, num_records, dimension, sagemaker_session):
    if not os.path.exists("test-data"):
        os.makedirs("test-data")
    for i in range(num_files):
        if num_records > 1:
            build_record_file(
                os.path.join(directory, name + str(i)), num_records=num_records, dimension=dimension
            )
        else:
            build_single_record_file(os.path.join(directory, name + str(i)), dimension=dimension)
    return sagemaker_session.upload_data(
        path=os.path.join(directory), key_prefix="pipemode-{}-files".format(name)
    )