def get_z_variable(nc):
axis_z = nc.get_variables_by_attributes(axis='<STR_LIT>')<EOL>if axis_z:<EOL><INDENT>return axis_z[<NUM_LIT:0>].name<EOL><DEDENT>valid_standard_names = ('<STR_LIT>', '<STR_LIT>', '<STR_LIT>')<EOL>z = nc.get_variables_by_attributes(standard_name=lambda x: x in valid_standard_names)<EOL>if z:<EOL><INDENT>return z[<NUM_LIT:0>].name<EOL><DEDENT>return<EOL>
Returns the name of the variable that defines the Z axis or height/depth

:param netCDF4.Dataset nc: netCDF dataset