Custom Map Function In Python