# Path: rlvision/utils.py
# def load_grid_selection(path):
# def process_map_data(path, return_full=False):
# def mask_grid(pos, grid, radius, one_is_free=True):
# def accumulate_map(source_grid, new_grid, one_is_free=True):
# def plot_grid(data, imsize, start=None, pos=None, goal=None, title=None):
# def process_gridworld_data(data_in, imsize):
# def load_mat_data(file_path):
# def find_layout(data, verbose=0):
# def init_h5_db(db_name, save_dir):
# def add_h5_group(group_name, db, db_path=None):
# def add_h5_ds(data, ds_name, db, group_name=None, data_type=np.uint8,
#               renew=False):
# def create_grid_8_dataset(mat_file_path, db_name, save_dir):
# def create_ds_from_splits(mat_file_prefix, db, splits):
# def create_grid_16_dataset(mat_file_prefix, db_name, save_dir, splits=5):
# def create_grid_28_dataset(mat_file_prefix, db_name, save_dir, splits=20):
# def create_grid_40_dataset(mat_file_prefix, db_name, save_dir, splits=100):
# def load_grid8(return_imsize=True):
# def load_grid16(split=None, return_imsize=True):
# def load_grid28(split=None, return_imsize=True):
# def load_grid40(split=None, return_imsize=True):


import os
import h5py
import cPickle as pickle
import numpy as np
import rlvision
from rlvision import utils
        the list of start position
    pos_traj : list
        the list of position trajectory
    goal_pos : list
        the goal of position
    """
    db, imsize = utils.load_grid16(split)

    return sample_data(db, imsize, num_samples)


def sample_data_grid28(split=None, num_samples=0):
    """Sample data from 28x28 grid.
    Parameters
    ----------
    num_samples : int
        number of samples
    Return
    ------
    grid_data : numpy.ndarray
        the grid data
    value_data : numpy.ndarray
        the value data
    start_pos_list : list
        the list of start position
    pos_traj : list
        the list of position trajectory
    goal_pos : list
        the goal of position
    """

# Path: rlvision/utils.py
# def load_grid_selection(path):
# def process_map_data(path, return_full=False):
# def mask_grid(pos, grid, radius, one_is_free=True):
# def accumulate_map(source_grid, new_grid, one_is_free=True):
# def plot_grid(data, imsize, start=None, pos=None, goal=None, title=None):
# def process_gridworld_data(data_in, imsize):
# def load_mat_data(file_path):
# def find_layout(data, verbose=0):
# def init_h5_db(db_name, save_dir):
# def add_h5_group(group_name, db, db_path=None):
# def add_h5_ds(data, ds_name, db, group_name=None, data_type=np.uint8,
#               renew=False):
# def create_grid_8_dataset(mat_file_path, db_name, save_dir):
# def create_ds_from_splits(mat_file_prefix, db, splits):
# def create_grid_16_dataset(mat_file_prefix, db_name, save_dir, splits=5):
# def create_grid_28_dataset(mat_file_prefix, db_name, save_dir, splits=20):
# def create_grid_40_dataset(mat_file_prefix, db_name, save_dir, splits=100):
# def load_grid8(return_imsize=True):
# def load_grid16(split=None, return_imsize=True):
# def load_grid28(split=None, return_imsize=True):
# def load_grid40(split=None, return_imsize=True):


# Path: rlvision/grid.py
import os
import h5py
import cPickle as pickle
import numpy as np
import rlvision
from rlvision import utils

        the list of start position
    pos_traj : list
        the list of position trajectory
    goal_pos : list
        the goal of position
    """
    db, imsize = utils.load_grid16(split)

    return sample_data(db, imsize, num_samples)


def sample_data_grid28(split=None, num_samples=0):
    """Sample data from 28x28 grid.
    Parameters
    ----------
    num_samples : int
        number of samples
    Return
    ------
    grid_data : numpy.ndarray
        the grid data
    value_data : numpy.ndarray
        the value data
    start_pos_list : list
        the list of start position
    pos_traj : list
        the list of position trajectory
    goal_pos : list
        the goal of position
    """

    db, imsize = utils.load_grid28(split)