code: def _import_protobuf_from_file(grpc_pyfile, method_name, service_name = None):
      
      
      prefix = grpc_pyfile[:-12]
      pb2      = __import__("%s_pb2"%prefix)
      pb2_grpc = __import__("%s_pb2_grpc"%prefix) 
      
      
      # we take all objects from pb2_grpc module which endswith "Stub", and we remove this postfix to get service_name
      all_service_names = [stub_name[:-4] for stub_name in dir(pb2_grpc) if stub_name.endswith("Stub")]
      
      # if service_name was specified we take only this service_name
      if (service_name):
          if (service_name not in all_service_names):
              return False, None
          all_service_names = [service_name]    
  
      found_services = []
      for service_name in all_service_names:
          service_descriptor =  getattr(pb2, "DESCRIPTOR").services_by_name[service_name]
          for method in service_descriptor.methods:
              if(method.name == method_name):
                  request_class      = method.input_type._concrete_class
                  response_class     = method.output_type._concrete_class
                  stub_class         = getattr(pb2_grpc, "%sStub"%service_name)
                  
                  found_services.append(service_name)
      if (len(found_services) == 0):
          return False, None
      if (len(found_services) > 1):
          raise Exception("Error while loading protobuf. We found methods %s in multiply services [%s]."
                          " You should specify service_name."%(method_name, ", ".join(found_services)))
      return True, (stub_class, request_class, response_class)
docs: helper function which try to import method from the given _pb2_grpc.py file
      service_name should be provided only in case of name conflict
      return (False, None)  in case of failure
      return (True, (stub_class, request_class, response_class)) in case of success