This kata is the second part of a series: [Neighbourhood kata collection](https://www.codewars.com/collections/5b2f4db591c746349d0000ce). If this one is to easy you can try out the harder Katas.;)
___
The neighbourhood of a cell (in a matrix) are cells that are near to it. There are two popular types:
- The [Moore neighborhood](https://en.wikipedia.org/wiki/Moore_neighborhood) are eight cells which surround a given cell.
- The [Von Neumann neighborhood](https://en.wikipedia.org/wiki/Von_Neumann_neighborhood) are four cells which share a border with the given cell.
___
# Task
Given a neighbourhood type (`"moore"` or `"von_neumann"`), a 2D matrix (a list of lists) and a pair of coordinates, return the list of neighbours of the given cell.
Notes:
- The order of the elements in the output list is not important. 
- If the input indexes are outside the matrix, return an empty list.
- If the the matrix is empty, return an empty list.
- Order of the indices: The first index should be applied for the outer/first matrix layer. The last index for the most inner/last layer. `coordinates = (m, n)` should be apllied like `mat[m][n]`
___
## Examples
```
\ n   0    1    2    3    4
m  --------------------------
0  |  0 |  1 |  2 |  3 |  4 |
1  |  5 |  6 |  7 |  8 |  9 |
2  | 10 | 11 | 12 | 13 | 14 |
3  | 15 | 16 | 17 | 18 | 19 |
4  | 20 | 21 | 22 | 23 | 24 |
   --------------------------
get_neighborhood("moore", mat, (1,1)) == [0, 1, 2, 5, 7, 10, 11, 12]
get_neighborhood("moore", mat, (0,0)) == [1, 6, 5]
get_neighborhood("moore", mat, (4,2)) == [21, 16, 17, 18, 23]
get_neighborhood("von_neumann", mat, (1,1)) == [1, 5, 7, 11]
get_neighborhood("von_neumann", mat, (0,0)) == [1, 5]
get_neighborhood("von_neumann", mat, (4,2)) == [21, 17, 23]
```
___
Translations are appreciated.^^
If you like chess take a look at [Chess Aesthetics](https://www.codewars.com/kata/5b574980578c6a6bac0000dc)
If you like puzzles and take a look at [Rubik's cube](https://www.codewars.com/kata/5b3bec086be5d8893000002e)
def get_neighbourhood(n_type, matrix, coordinates):
    height = len(matrix)
    width = len(matrix[0])
    y, x = coordinates
    if not (0 <= y < height and 0 <= x < width): return []
    moore = [(y+dy, x+dx) for dy in [-1, 0, 1] for dx in [-1, 0, 1] if (dy, dx) != (0, 0)]
    von_neumann = [moore[idx] for idx in (1, 3, 4, 6)]
    neighbors_coords = eval(n_type)
    neighbors = [matrix[y][x] for y, x in neighbors_coords if 0 <= y < height and 0 <= x < width]
    return neighbors
def get_neighbourhood(n_type, matrix, coordinates):
    height = len(matrix)
    width = len(matrix[0])
    y, x = coordinates
    if not (0 <= y < height and 0 <= x < width): return []
    moore = [(y+dy, x+dx) for dy in [-1, 0, 1] for dx in [-1, 0, 1] if (dy, dx) != (0, 0)]
    von_neumann = [moore[idx] for idx in (1, 3, 4, 6)]
    neighbors_coords = eval(n_type)
    neighbors = [matrix[y][x] for y, x in neighbors_coords if 0 <= y < height and 0 <= x < width]
    return neighbors