Non-dissipative anomalous currents in 2D materials: the parity magnetic effect as an analog of the chiral magnetic effect