def crop_array(top, left, bottom, right, array):
    """Crops an array (i.e., returns a subarray).

    The indices for cropping should be given as arguments.
    The order is ``top, left, bottom, right``.
    For ``top`` and ``left``, they are the first indices to be included,
    while ``bottom`` and ``right`` are the first indices to be dropped.

    For instance, if you have the array::

      arry = [[1, 2, 3],
              [4, 5, 6],
              [7, 8, 9]]

    The top left :math:`2 \\times 2` array is obtained with::

      >>> crop_array(0, 0, 2, 2, arry)
      [[1, 2],
       [4, 5]]


    The command is equivalent to::

      >>> array.copy()[top:bottom,left:right]

    Parameters:

    top: integer
        first index from the top to be included
    left: integer
        first integer from the left to be included
    bottom: integer
        first index from the top to be left out
    rigth: integer
        first index from the left to be left out
    """
    return array.copy()[top:bottom,left:right]