Human: Python code to do bit masking in 3D. Assistant: 
Here is a Python code to do bit masking in 3D

import numpy as np

def bit_mask(val, mask):
    """
    Returns val with mask applied
    """
    return (val & mask)

# Enter the array
a = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])

# Calling the function
print((bit_mask(a, 0b10000000)))

#Example Output
# [0 0 0 0 0 0 0 0 0 0]

#Remember to inspect code for bugs.