def METHOD_NAME(self, actual: np.array, predicted: np.array, sample_weight: typing.Optional[np.array] = None,
          labels: typing.Optional[np.array] = None) -> float:
    """Initialize logger to print additional info in case of invalid inputs(exception is raised) and to enable debug prints"""
    logger = self.logger
    from h2oaicore.systemutils import loggerinfo
    # loggerinfo(logger, "Start Poisson Deviance Scorer.......")
    # loggerinfo(logger, 'Actual:%s' % str(actual))
    # loggerinfo(logger, 'Predicted:%s' % str(predicted))
    # loggerinfo(logger, 'Sample W:%s' % str(sample_weight))
    try:
        if sample_weight is not None:
            '''Check if any element of the sample_weight array is nan'''
            if np.isnan(np.sum(sample_weight)):
                loggerinfo(logger, 'Sample Weight:%s' % str(sample_weight))
                loggerinfo(logger, 'Sample Weight Nan values index:%s' % str(np.argwhere(np.isnan(sample_weight))))
                raise RuntimeError(
                    'Error during Poisson Deviance score calculation. Invalid sample weight values. Expecting only non-nan values')
        '''Cast as float to avoid error with addition when DAI sends integers'''
        actual = actual.astype('float64')
        predicted = predicted.astype('float64')
        '''Safety mechanizm in case predictions or actuals are zero'''
        epsilon = 1E-8
        actual += epsilon
        predicted += epsilon
        '''Check if any element of the arrays is not positive or nan'''
        if (actual <= 0).any() or np.isnan(np.sum(actual)):
            loggerinfo(logger, 'Actual:%s' % str(actual))
            loggerinfo(logger, 'Non-positive Actuals:%s' % str(actual[actual <= 0]))
            loggerinfo(logger, 'Nan values index:%s' % str(np.argwhere(np.isnan(actual))))
            raise RuntimeError(
                'Error during Poisson deviance score calculation. Invalid actuals values. Expecting only positive values')
        if (predicted <= 0).any() or np.isnan(np.sum(predicted)):
            loggerinfo(logger, 'Predicted:%s' % str(predicted))
            loggerinfo(logger, 'Invalid Predicted:%s' % str(predicted[predicted <= 0]))
            loggerinfo(logger, 'Nan values index:%s' % str(np.argwhere(np.isnan(predicted))))
            raise RuntimeError(
                'Error during Poisson deviance score calculation. Invalid predicted values. Expecting only positive values')
        dev = 2 * (actual * np.log(actual / predicted) + predicted - actual)
        METHOD_NAME = np.average(dev, weights=sample_weight)
        '''Validate that score is non-negative and is not infinity or Nan'''
        if METHOD_NAME >= 0 and METHOD_NAME < float("inf"):
            pass
        else:
            loggerinfo(logger, 'Invalid calculated score:%s' % str(METHOD_NAME))
            raise RuntimeError(
                'Error during Poisson Deviance score calculation. Invalid calculated score:%s. \
                 Score should be non-negative and less than infinity. Nan is not valid' % str(METHOD_NAME))
    except Exception as e:
        '''Print error message into DAI log file'''
        loggerinfo(logger, 'Error during Poisson Deviance score calculation. Exception raised: %s' % str(e))
        raise
    return METHOD_NAME