<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_service(self, factory, svc_registration):
 # type: (Any, ServiceRegistration) -> Any """ Returns the service required by the bundle. The Service Factory is called only when necessary while the Prototype Service Factory is called each time :param factory: The service factory :param svc_registration: The ServiceRegistration object :return: The requested service instance (created if necessary) """

        svc_ref = svc_registration.get_reference()
        if svc_ref.is_prototype():
            return self._get_from_prototype(factory, svc_registration)

        return self._get_from_factory(factory, svc_registration)