Reads the `what` parameter and returns it's content.

@param {object|string} what
@return {object}
554709
function(what) {
    var mainData = what;
    var localData = {};
    if (typeof what == 'string') {
      // main
      var mainFile = path.resolve(process.cwd(), what);
      delete require.cache[mainFile];
      mainData = require(mainFile);
      // local
      var localFile = mainFile.substr(0, mainFile.lastIndexOf('.'))+'.local'+path.extname(mainFile);
      if (fs.existsSync(localFile)) {
        delete require.cache[localFile];
        localData = require(localFile);
      }
    }
    // main and local merged
    return _.merge({},
      _.merge({}, mainData.default, mainData[this.env]),
      _.merge({}, localData.default, localData[this.env])
    );
  }
396364
function (content) {
            var contentType = content.contentType;

            if (contentType && contentType in this.contentProcessors) {
                return this.processContent(this.contentProcessors[contentType].processContent(content));
            }
            return content.value || "";
        }
1131523
function parse (string) {
  if (!string) {
    throw new TypeError('argument string is required')
  }

  // support req/res-like objects as argument
  var header = typeof string === 'object'
    ? getcontenttype(string)
    : string

  if (typeof header !== 'string') {
    throw new TypeError('argument string is required to be a string')
  }

  var index = header.indexOf(';')
  var type = index !== -1
    ? header.substr(0, index).trim()
    : header.trim()

  if (!TYPE_REGEXP.test(type)) {
    throw new TypeError('invalid media type')
  }

  var obj = new ContentType(type.toLowerCase())

  // parse parameters
  if (index !== -1) {
    var key
    var match
    var value

    PARAM_REGEXP.lastIndex = index

    while ((match = PARAM_REGEXP.exec(header))) {
      if (match.index !== index) {
        throw new TypeError('invalid parameter format')
      }

      index += match[0].length
      key = match[1].toLowerCase()
      value = match[2]

      if (value[0] === '"') {
        // remove quotes and escapes
        value = value
          .substr(1, value.length - 2)
          .replace(QESC_REGEXP, '$1')
      }

      obj.parameters[key] = value
    }

    if (index !== header.length) {
      throw new TypeError('invalid parameter format')
    }
  }

  return obj
}
552922
def content(self):
        
        if not self._content:

            self._content = self._read()

        return self._content
781801
function get (element, content) {
    element = document.createElement(element);
    if (element && content) {
      element.innerHTML = content;
    }
    return element;
  }
1321533
public function getRibbonXMLData($What = 'all') //we need some constants here...
    {
        $ReturnData = null;
        $What = strtolower($What);
        switch ($What){
            case 'all':
                $ReturnData = $this->ribbonXMLData;
                break;
            case 'target':
            case 'data':
                if (is_array($this->ribbonXMLData) && array_key_exists($What, $this->ribbonXMLData)) {
                    $ReturnData = $this->ribbonXMLData[$What];
                }
                break;
        }

        return $ReturnData;
    }
87812
function slice(what, start) {
        for (var j = 0, i = start || 0, arr = []; i < what.length; i++) {
            arr[j++] = what[i];
        }
        return arr;
    }
1220438
function content() {
				const libraryJS = libraryJSInfo;
				if ( libraryJS.controls || libraryJS.elements || libraryJS.interfaces || libraryJS.types ) {
					return {
						controls: libraryJS.controls,
						elements: libraryJS.elements,
						types: libraryJS.types,
						interfaces: libraryJS.interfaces
					};
				}
			}
1031156
def matches(text, what):
    '''
    
    
    '''
    return text.find(what) > -1 if is_string(what) else what.match(text)
379725
function(stuff) {
      var len = this.str.length;
      if (typeof stuff == 'number') {
        this.str = this.str.substr(stuff);
      } else if (typeof stuff == 'string') {
        this.str = this.str.substr(stuff.length);
      } else if (stuff instanceof RegExp) {
        var m = this.str.match(stuff);
        if (m) {
          this.str = this.str.substr(m[0].length);
        }
      }
      return len > this.str.length;
    }
900795
function(key, options) {

		options = assign({
			isArgument: true
		}, options);

		var res = this.read(key, options);
		return res.value;
	}
973604
function getContent(modalId, opts) {
        var data = {
          modalId: modalId,
          theme: opts.theme,
          header: opts.header,
          fullScreen: opts.fullScreen ? "fullscreen" : "",
          styles: "",
          iframe: opts.iframe,
          iframeLoadingMsg: opts.iframeLoadingMsg,
          disableResize: opts.disableResize
        };

        if (opts.zIndex) {
          data.styles += "z-index:" + opts.zIndex + ";";
        }
        if (opts.absolute) {
          data.styles += "position:absolute;";
        }

        if (data.iframe && typeof data.iframe.param === "string") {
          data.iframe.param = ax5.util.param(data.iframe.param);
        }

        return MODAL.tmpl.get.call(this, "content", data, {});
      }
621557
function process_get(request, response, uri) {
	// if path is /things then return the set of thing models
	let path = URL.parse(request.url).pathname;
	
	if (path === "/things") {
		if (!authorised(request))
			return fail(401, "unauthorized", response);
		
		let list = [];
		
		for (var name in things) {
			if (things.hasOwnProperty(name)) {
				list.push(things[name].model);
			}
		}
		
		body = JSON.stringify(list, null, 4);
	
		response.writeHead(200, {
			'Content-Type': mime_types.json,
			'Pragma': 'no-cache',
			'Cache-Control': 'no-cache',
			'Access-Control-Allow-Origin': '*',
			'Access-Control-Allow-Credentials': 'true',
			'Content-Length': body.length
		});

		if (request.method === "GET")
				response.write(body);

		response.end();
		return;
	}

	// does path start with /things/thingID for some thingID?

	if (/^\/things\/.+/.test(path)) {
		if (!authorised(request))
			return fail(401, "unauthorized", response);

		path = path.substr(8);
		
		let i = path.indexOf('/');
		var thingID, body;
		
		if (i < 0) {
			thingID = path;
			path = "";
		} else {
			thingID = path.substr(0, i);
			path = path.substr(i);
		}
		
		if (thingID) {
			let thing = things[thingID];
			
			if (!thing)
				return fail(404, "unknown thing: " + thingID, response);
				
			if (!thing.model)
				return fail(404, "no model for thing: " + thingID, response);
				
			if (path === "") {
				body = JSON.stringify(thing.model, null, 4);
				console.log(body);
			} else if (path === "/properties"){
				// construct set of property values
				let values = {};
				
				for (var name in thing.properties) {
					if (thing.properties.hasOwnProperty(name)) {
						values[name] = thing.properties[name].value;
					}
				}
				
				body = JSON.stringify(values, null, 4);
			} else if (/^\/properties\/.+/.test(path)) {
				path = path.substr(12);
				console.log("property name: " + path);
				let property = thing.properties[path];
				
				if (property === undefined)
					return fail(404, "unknown property: " + path, response);
					
				body = JSON.stringify(property.value, null, 4);
			} else if (path === "/events") {
				// add to thing's set of server-sent event streams
				console.log("new server-sent event stream for thing: " + thing.name);
				
				response.writeHead(200, {
					'Content-Type': 'text/event-stream',
					'Cache-Control': 'no-cache',
					'Connection': 'keep-alive',
					'Access-Control-Allow-Credentials': 'true',
					'Access-Control-Allow-Origin': '*'
				});

				if (request.method === "HEAD") {
					response.end();
					return;
				}

				let id = gensym();
				console.log('client id = ' + id);
				
				thing.clients[id] = {
					id: id,
					response: response
				};
				
				// tidy up when connection is closed
				// e.g. after a browser tab is hidden

				response.on("close", function () {
					console.log('lost client id = ' + id);
					let clients = thing.clients
					delete clients[id];
				});

				response.on("end", function () {
					console.log('lost client id = ' + id);
					let clients = thing.clients
					delete clients[id];
				});

				return;
			} else if (/^\/events\/.+/.test(path)) {
				path = path.substr(8);
				console.log("long poll on event named: " + path);
				let event = thing.events[path];
				
				if (event === undefined)
					return fail(404, "unknown event: " + path, response);
					
				event.longpoll.push(response);
				return;
			} else {
				return fail(404, "invalid request: " + uri, response);
			}
			
			console.log('body length = ' + body.length);
			
			response.writeHead(200, {
				'Content-Type': mime_types.json,
				'Pragma': 'no-cache',
				'Cache-Control': 'no-cache',
				'Access-Control-Allow-Origin': '*',
				'Access-Control-Allow-Credentials': 'true',
				'Content-Length': body.length
			});

			if (request.method === "GET")
					response.write(body);

			response.end();
			return;
		}
		
		return fail(404, "missing thingID: " + path, response);
	}
	
	let prefix = './www';

	console.log('request for "' + path + '"');
	// assume this is a request for a file

	if (path[path.length-1] === '/')
		path += 'index.html';

	let filename = decodeURI(prefix + path);
	let gzipped = false;

	console.log('filename: ' + filename);

	FS.stat(filename, function(error, stat) {
		var ext = PATH.extname(filename);
		var mime = null;

		if (ext === ".gz") {
			gzipped = true;
			ext = PATH.extname(filename.substr(0, filename.length-3));
		}

		if (ext.length > 1)
			mime = mime_types[ext.split(".")[1]];

		if (error || !mime) {
			console.log("unable to serve " + filename);
			var body = "404 not found: " + request.url;
			response.writeHead(404, {
				'Content-Type': 'text/plain',
				'Content-Length': body.length
			});

			if (request.method === "GET")
				response.write(body);

			response.end();
		} else {
			if (gzipped) {
				console.log("filename has mime type " + mime);
				response.writeHead(200, {
					'Content-Type': mime,
					'Content-Encoding': 'gzip',
					'Pragma': 'no-cache',
					'Cache-Control': 'no-cache',
					'Access-Control-Allow-Origin': '*',
					'Access-Control-Allow-Credentials': 'true',
					'Content-Length': stat.size
				});
			} else {
				response.writeHead(200, {
					'Content-Type': mime,
					'Pragma': 'no-cache',
					'Cache-Control': 'no-cache',
					'Access-Control-Allow-Origin': '*',
					'Access-Control-Allow-Credentials': 'true',
					'Content-Length': stat.size
				});
			}

			if (request.method === "GET") {
				var stream = FS.createReadStream(filename);
				stream.pipe(response);
			} else
				response.end();
		}
	});
}
566042
def matches?(string, what)
      Regexp === what ? string.strip =~ what : string == what.to_s
    end
750090
def get_content(media_or_io)
      case true
      when is_binary?(media_or_io) then media_or_io
      when is_file?(media_or_io)   then File.read(media_or_io)
      when is_url?(media_or_io)    then open(media_or_io).read
      when is_string?(media_or_io) then media_or_io
      when is_io?(media_or_io)     then media_or_io.read
      else raise UnsupportedType.new("That media type is unsupported")
      end
    end
1035289
function getContentType(url: string): string {
  url = trimUrlQuery(url);
  const dot = url.lastIndexOf(".");
  if (dot >= 0) {
    const name = url.substring(dot + 1);
    if (name in contentMap) {
      return contentMap[name];
    }
  }
  return "text/plain";
}
1351791
function (/**String*/name, /**Object*/data) /**String*/ {
            var self = this;
            var template = data && data.views ?
                data.views.templates[name] : this.templates[name];
            if(!template){
                return '';
            }
            return self.getContent(template, data);
        }