Return some docs about how to call this webservice
344752
@GET
    @Produces(MediaType.TEXT_PLAIN)
    public InputStream doc() throws IOException {
        //noinspection ConstantConditions
        return getClass().getClassLoader().getResource("SnomedCoderService_help.txt").openStream();
    }
1024771
function getService(params, callback) {
    if (typeof params === 'function') {
        callback = params;
        params = {};
    }
    var protocol = this.options.Protocol || (util.isBrowser && location.protocol === 'http:' ? 'http:' : 'https:');
    var domain = this.options.ServiceDomain;
    var appId = params.AppId || this.options.appId;
    if (domain) {
        domain = domain.replace(/\{\{AppId\}\}/ig, appId || '').replace(/\{\{.*?\}\}/ig, '');
        if (!/^[a-zA-Z]+:\/\//.test(domain)) {
            domain = protocol + '//' + domain;
        }
        if (domain.slice(-1) === '/') {
            domain = domain.slice(0, -1);
        }
    } else {
        domain = protocol + '//service.cos.myqcloud.com';
    }
    submitRequest.call(this, {
        Action: 'name/cos:GetService',
        url: domain,
        method: 'GET',
        headers: params.Headers,
    }, function (err, data) {
        if (err) {
            return callback(err);
        }
        var buckets = (data && data.ListAllMyBucketsResult && data.ListAllMyBucketsResult.Buckets
            && data.ListAllMyBucketsResult.Buckets.Bucket) || [];
        buckets = util.isArray(buckets) ? buckets : [buckets];
        callback(null, {
            Buckets: buckets,
            statusCode: data.statusCode,
            headers: data.headers,
        });
    });
}
99701
def parseService(self, yadis_url, uri, type_uris, service_element):
        """"""
        self.type_uris = type_uris
        self.server_url = uri
        self.used_yadis = True

        if not self.isOPIdentifier():
            # XXX: This has crappy implications for Service elements
            # that contain both 'server' and 'signon' Types.  But
            # that's a pathological configuration anyway, so I don't
            # think I care.
            self.local_id = findOPLocalIdentifier(service_element,
                                                  self.type_uris)
            self.claimed_id = yadis_url
1003835
def prepare_and_invoke_api_call(path, options = {})
      api_call = prepare_api_call(path, options)
      data = invoke_api_call(api_call)

      parsed_data = case options[:format]
        when 'json' then JSON.parse(data)
        when 'xml' then REXML::Document.new(data)
        else JSON.parse(data) rescue REXML::Document.new(data) rescue data
      end
      RubyDesk.logger.info "Parsed data: #{parsed_data.inspect}"
      return parsed_data
    end
1340463
def callServiceRequest(self, service_request, *args, **kwargs):
        
        if self.mustExposeRequest(service_request):
            http_request = kwargs.get('http_request', None)
            args = (http_request,) + args

        return service_request(*args)
3575
def getMethods(self):
        
        callables = {}

        for name in dir(self.service):
            method = getattr(self.service, name)

            if name.startswith('_') or not python.callable(method):
                continue

            callables[name] = method

        return callables
128663
def doc():
    """"""
    kwdb = current_app.kwdb

    libraries = get_collections(kwdb, libtype="library")
    resource_files = get_collections(kwdb, libtype="resource")
    hierarchy = get_navpanel_data(kwdb)

    return flask.render_template("home.html",
                                 data={"libraries": libraries,
                                       "version": __version__,
                                       "libdoc": None,
                                       "hierarchy": hierarchy,
                                       "resource_files": resource_files
                                   })
853319
function(href)
    {
        var _this = this;

        return Q.nfcall(request, href).then(function(data) {
            var $ = cheerio.load(data);

            var serviceName =
	            $('.collection')
		            .first()
		            .text()
		            .trim()
		            .replace(/\./g, '');
            var serviceDescription =
                $('h1').nextAll('p').first().text();

            _this.services.push(serviceName);

            var ret = {
                serviceName: serviceName,
                description: serviceDescription,
                methods: []
            };

            // Extract method information
            $('.full_method').each(function() {
                var $el         = $(this);
                var collection  = $el.find('.collection')
                    .text().replace('.','').trim();
                var method      = $el.find('.method').text().trim();
                var description = $el.nextAll('p').first().text();
                var $table      = $el.nextAll('table.table-striped').first();

                var methodInfo = {
                    name: method,
                    description: description,
                    params: []
                };

                // Fix for documentation not having api keys
                if (serviceName == 'DiscountService')
                    methodInfo.params.push('apiKey');

                // iterate over all the paramters
                $table.find('tbody tr').each(function() {
                    var td = $(this).find('td').first().text().trim();

                    if (td != 'Key' && td != 'privateKey' && td != 'key')
                        methodInfo.params.push(td);
                    else
                        methodInfo.params.push('apiKey');
                });

                ret.methods.push(methodInfo);
            });

            return ret;
        });
    }
115730
function buildMethodName(req) {
    return [
        req.params.service,
        req.params.subservice
    ].filter(Boolean).join('-');
}
416695
def _get_method(self, request):
        
        if self._is_doc_request(request):
            return self.get_documentation
        else:
            return super(DocumentedResource, self)._get_method(request)
1203530
def call(self, method, *args):
        
        try:
            response = getattr(self.client.service, method)(*args)
        except (URLError, SSLError) as e:
            log.exception('Failed to connect to responsys service')
            raise ConnectError("Request to service timed out")
        except WebFault as web_fault:
            fault_name = getattr(web_fault.fault, 'faultstring', None)
            error = str(web_fault.fault.detail)

            if fault_name == 'TableFault':
                raise TableFault(error)
            if fault_name == 'ListFault':
                raise ListFault(error)
            if fault_name == 'API_LIMIT_EXCEEDED':
                raise ApiLimitError(error)
            if fault_name == 'AccountFault':
                raise AccountFault(error)

            raise ServiceError(web_fault.fault, web_fault.document)
        return response
860296
def _get_url_doc(self):
        
        resolver = get_resolver(None)
        possibilities = resolver.reverse_dict.getlist(self)
        urls = [possibility[0] for possibility in possibilities]
        return urls
362755
def get_help(self, about, help_type='Operation'):
        
        params = {'About': about, 'HelpType': help_type,}
        return self._process_request('Help', params)
271804
def _docstring(self):
        
        s = '"""' + "\n"
        s += "webhook2lambda2sqs generated function source\n"
        s += "this code was generated by webhook2lambda2sqs v%s\n" % VERSION
        s += "<%s>\n" % PROJECT_URL
        s += "this project is licensed under the AGPLv3 open source license.\n"
        s += "\n"
        s += "DO NOT MODIFY this function; modifications should be made by "
        s += "re-running\n"
        s += "the project with an updated configuration.\n"
        s += '"""' + "\n"
        return s
1133481
def _call(self, path, method, body=None, headers=None):
        
        try:
            resp = self.http.do_call(path, method, body, headers)
        except http.HTTPError as err:
            if err.status == 401:
                raise PermissionError('Insufficient permissions to query ' +
                    '%s with user %s :%s' % (path, self.user, err))
            raise
        return resp
932812
def call(request)
      m = request.method.downcase.to_sym

      # Only respond to listed methods
      unless respond_to?(m)
        allowed = METHODS.select { |m| respond_to?(m) }.map(&:upcase).join(', ')
        return [
          405,
          { 'Content-Type' => 'text/plain', 'Allow' => allowed },
          "Method not allowed: '#{request.env['REQUEST_METHOD']}'"
        ]
      end

      begin
        send(m, request)
      rescue RestError => e
        error(e.response_code, e.error)
      end
    end
1347703
function(operation, res) {
      var that = this;
      var method = res.req.method;

      return operation.then(function(doc) {
        if (method === 'POST') {
          if (that._path && (that._key || that._index)) {
            res.header('Location', '/' + that._path + '/' + doc[that._key || that._index]);
          }

          return res.status(201).json(doc);
        }

        return res.status(200).json(doc);
      }, function(err) {
        console.error(err.message);

        if (method === 'POST' || method === 'PUT') {
          return res.status(409).end();
        }

        if (method === 'GET') {
          res.status(404).end();
        }

        return res.status(500).end();
      });
    }