<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def as_operation(self):
 """Obtains a single `Operation` representing this instances contents. Returns: :class:`endpoints_management.gen.servicecontrol_v1_messages.Operation` """

        result = encoding.CopyProtoMessage(self._op)
        names = sorted(self._metric_values_by_name_then_sign.keys())
        for name in names:
            mvs = self._metric_values_by_name_then_sign[name]
            result.metricValueSets.append(
                sc_messages.MetricValueSet(
                    metricName=name, metricValues=mvs.values()))
        return result