'Get a batch of data, either randomly chosen, or specified directly.
Args:
data_extxd: The data to model, numpy tensors with shape:
# examples x # time steps x # dimensions
ext_input_extxi (optional): The external inputs, numpy tensor with shape:
# examples x # time steps x # external input dimensions
batch_size:  The size of the batch to return
example_idxs (optional): The example indices used to select examples.
Returns:
A tuple with two parts:
1. Batched data numpy tensor with shape:
batch_size x # time steps x # dimensions
2. Batched external input numpy tensor with shape:
batch_size x # time steps x # external input dims'

@staticmethod
def get_batch(data_extxd, ext_input_extxi=None, batch_size=None, example_idxs=None):

    assert ((batch_size is not None) or (example_idxs is not None)), 'Problems'
    (E, T, D) = data_extxd.shape
    if (example_idxs is None):
        example_idxs = np.random.choice(E, batch_size)
    ext_input_bxtxi = None
    if (ext_input_extxi is not None):
        ext_input_bxtxi = ext_input_extxi[example_idxs, :, :]
    return (data_extxd[example_idxs, :, :], ext_input_bxtxi)
