@classmethod
    def convert_to_requested_unit_applier(cls, compatibles):
        def apply_requested_unit(target, _graph_config):
            tags = target['tags']
            try:
                scale, extra_op = compatibles[tags['unit']]
            except (KeyError, __HOLE__):
                # this probably means ES didn't respect the query we made,
                # or we didn't make it properly, or something? issue a warning
                # but let things go on
                warnings.warn("Found a target with unit %r which wasn't in our "
                              "list of compatible units (%r) for this query."
                              % (tags.get('unit'), compatibles.keys()),
                              RuntimeWarning)
                return
            if extra_op == 'derive':
                cls.apply_derivative_to_target(target, scale)
            else:
                if scale != 1.0:
                    cls.apply_graphite_function_to_target(target, 'scale', scale)
                if extra_op == 'integrate':
                    # graphite assumes that anything you integrate is per minute.
                    # hitcount assumes that incoming data is per second.
                    cls.apply_graphite_function_to_target(target, 'hitcount', '1min')
                    cls.apply_graphite_function_to_target(target, 'integral')
        return apply_requested_unit
dataset/ETHPy150Open vimeo/graph-explorer/graph_explorer/query.py/Query.convert_to_requested_unit_applier