Create tracker entity from html
@param html
178923
function createEntity(html, id) {
    let $ = parser.load(html)

    let trs = $('.tabproperty table tr').slice(2)

    let states = utils.tableParser(trs, {
        date: {
            idx: 1,
            mandatory: true,
            parser: e => moment.tz(e, "MM/DD/YYYY hh:mm a", zone).format()
        },
        country: {
            idx: 3,
            mandatory: true
        },
        area: {
            idx: 5,
            mandatory: true
        },
        state: {
            idx: 7,
            mandatory: true
        }
    }).map(line => {
        return {
            date: line.date,
            state: line.state,
            area: line.country + ' - ' + line.area
        }
    }).reverse()

    return new EntityInfo({
        id: id,
        states: states
    })
}
528979
function () {
    var self = this;
    var trackedControllerEls = this.el.querySelectorAll('[tracked-controls]');
    this.trackedControllerEls = {};
    trackedControllerEls.forEach(function setupController (trackedControllerEl) {
      if (!trackedControllerEl.id) {
        warn('Found a tracked controller entity without an ID. ' +
             'Provide an ID or this controller will not be recorded');
        return;
      }
      trackedControllerEl.setAttribute('motion-capture-recorder', {
        autoRecord: false,
        visibleStroke: false
      });
      self.trackedControllerEls[trackedControllerEl.id] = trackedControllerEl;
      if (self.isRecording) {
        trackedControllerEl.components['motion-capture-recorder'].startRecording();
      }
    });
  }
1197734
@SuppressWarnings("unchecked")
    public <T> T trackEntity(Class<T> clazz, DocumentInfo documentFound) {
        return (T) trackEntity(clazz, documentFound.getId(), documentFound.getDocument(), documentFound.getMetadata(), noTracking);
    }
709022
public final ServiceTracker<T, ServletContextHelperElement> create(final Class<? extends T> trackedClass) {
		return new ServiceTracker<>(bundleContext, createFilter(bundleContext, trackedClass), this);
	}
73373
function fromHTML(html) {
                var div = document.createElement('div');
                div.innerHTML = html;
                return div.childNodes;
            }
244861
function (html) {
            var t = this;

            if (html != null) {
                t.$ta.val(html);
                t.syncCode(true);
                t.$c.trigger('tbwchange');
                return t;
            }

            return t.$ta.val();
        }
1165758
function( pathToHTMLFile ){
        var deferred = Q.defer(),
            targetHTML = new TargetHTML( pathToHTMLFile );

        targetHTML.init()
            .then( function( targetHTML ){ return this.getTemplate( targetHTML.detectTemplateId() ); }.bind( this ) )
            .then( function( template ){ return template.generateCode( targetHTML.pickOutValues(), pathToHTMLFile ); } )
            .then( function( HTMLCode ){ return targetHTML.update( HTMLCode ); } )
            .catch( function( error ){ deferred.reject( error ); } )
            .finally( function(){ deferred.resolve( pathToHTMLFile ); } );

        return deferred.promise;
    }
334065
private ResourceXMLParser.Entity createEntity(final INodeEntry node) {
        final ResourceXMLParser.Entity ent = new ResourceXMLParser.Entity();
        ent.setName(node.getNodename());
        ent.setResourceType(NODE_ENTITY_TAG);
        

        if(null!=node.getAttributes()){
            for (final String setName : node.getAttributes().keySet()) {
                String value = node.getAttributes().get(setName);
                ent.setProperty(setName, value);
            }
        }
        if(null!=node.getTags()){
            ent.setProperty("tags", joinStrings(node.getTags(), ", "));
        }



        return ent;
    }
1331350
function createWinitEntity(id, html) {
    let $ = parser.load(html)

    let lines = $('ul li')

    let states = utils.tableParser(
        lines,
        {
            'date': {
                'idx': 2, 'mandatory': true, 'parser': elem => {
                    return moment.tz(elem, 'YYYY-MM-DD HH:mm:ss', 'en', zone).format()
                }
            },
            'state': {'idx': 3, 'mandatory': true},
            'area': {'idx': 4, 'mandatory': false}
        },
        elem => true)

    return new WinitInfo({
        id: id,
        state: states[0].state,
        states: states
    })
}
423008
function createEntity(id, json) {

    const originStates = json.dat[0].track.z1.map(mapRow)
    const destinStates = json.dat[0].track.z2 ? json.dat[0].track.z1.map(mapRow) : null

    return new EntityInfo({
        id: id,
        states: originStates,
        destinStates: destinStates
    })
}
1368106
def create(self):
        
        if self._track is None:
            self._track = self.db[self.tracking_collection_name]
431558
function(html) {
		this._newdom = this._parse(html);
		this._crawl(this._newdom, this._olddom, this._newdom, this._keyid, {});
		this._olddom = this._newdom;
	}
560795
function buildMessageHTML(messageText, messageSenderId, messageDateSent, attachmentFileId, messageId, status){
  var messageAttach;
  if(attachmentFileId){
      messageAttach = '<img src="' + QB.content.publicUrl(attachmentFileId) + '/' + '/download.xml?token='+token+'" alt="attachment" class="attachments img-responsive" />';
  }

	var isMessageSticker = stickerpipe.isSticker(messageText);

  var delivered = '<img class="icon-small" src="images/delivered.jpg" alt="" id="delivered_'+messageId+'">';
  var read = '<img class="icon-small" src="images/read.jpg" alt="" id="read_'+messageId+'">';

	var messageTextHtml = messageText;
	if (messageAttach) {
		messageTextHtml = messageAttach;
	} else if (isMessageSticker) {
		messageTextHtml = '<div class="message-sticker-container"></div>';

		stickerpipe.parseStickerFromText(messageText, function(sticker, isAsync) {
			if (isAsync) {
				$('#' + messageId + ' .message-sticker-container').html(sticker.html);
			} else {
				messageTextHtml = sticker.html;
			}
		});
	}

  var messageHtml =
			'<div class="list-group-item" id="'+messageId+'">'+
				'<time datetime="'+messageDateSent+ '" class="pull-right">'
					+jQuery.timeago(messageDateSent)+
				'</time>'+

				'<h4 class="list-group-item-heading">'+messageSenderId+'</h4>'+
				'<p class="list-group-item-text">'+
					messageTextHtml +
				'</p>'
				+delivered+read+
			'</div>';
  return messageHtml;
}
312047
private function createDOMDocumentFromHTML($html = null) {

        if ($html != null) {
            libxml_use_internal_errors(true);
            $dom = new DOMDocument;
            $dom->loadHTML($html);
            libxml_clear_errors();
            libxml_use_internal_errors(false);
            return $dom;
        }
    }
569742
function createCorreosEntity(html) {
    let $ = parser.load(html)

    var id = $('.shipping span').get(0).children[0].data.trim()
    var state = $('.status').get(0).children[2].data.trim()
    var state2 = ""
    try {
        state2 = $('.status-desc .status-message').get(0).children[0].data.trim()
    } catch (e) {
        // sometimes there is no state2
    }

    var deliveryDate = $('.status').get(0).children[4]
    if (deliveryDate !== undefined) {
        deliveryDate = deliveryDate.data.trim()
        deliveryDate = deliveryDate.substring(deliveryDate.indexOf(',') + 1)
        deliveryDate = getDeliveryDate(deliveryDate.trim())
    }

    var origin = $('.origin').get(0).children[0].data.trim()
    var destiny = $('.destiny').get(0).children[0].data.trim()
    origin = origin.substring(origin.indexOf(':') + 1).trim()
    destiny = destiny.substring(destiny.indexOf(':') + 1).trim()

    let states = utils.tableParser(
        $('table tbody tr'),
        {
            'date': {
                'idx': 1, 'mandatory': true, 'parser': elem => {
                    return moment.tz(elem, ', DD/MM/YYYY HH:mm', 'es', zone).format()
                }
            },
            'state': {'idx': 5, 'mandatory': true},
            'area': {'idx': 3}
        },
        elem => true)

    return new CorreosInfo({
        id: id,
        state: state.replace('.', ''),
        state2: state2.replace('.', ''),
        origin: origin,
        destiny: destiny,
        deliveryDate: deliveryDate,
        states: states
    })
}
484505
RenderException addStackTraceElement(TemplateNode template, SourceLocation location) {
    // Typically, this is fast since templates aren't that deep and we only do this in error
    // situations so performance matters less.
    soyStackTrace.add(template.createStackTraceElement(location));
    return this;
  }
978337
function initDocument (document, window) {
  const html = document.childNodes.find(el => el.tagName === 'HTML');
  const documentElement = html || (document.childNodes.length > 0 ? document.childNodes[0] : null);
  const head = html ? html.childNodes.find(el => el.tagName === 'HEAD') : new window.HTMLHeadElement();
  const body = html ? html.childNodes.find(el => el.tagName === 'BODY') : new window.HTMLBodyElement();

  document.documentElement = documentElement;
  document.readyState = 'loading';
  document.head = head;
  document.body = body;
  document.location = window.location;
  document.cookie = '';
  document.referrer = '';
  document.createElement = (tagName, options = {}) => {
    tagName = tagName.toUpperCase();
    const HTMLElementTemplate = window[symbols.htmlTagsSymbol][tagName];
    const element = HTMLElementTemplate ? new HTMLElementTemplate() : new window.HTMLElement(tagName);
    options.is && element.setAttribute('is', options.is);
    return element;
  };
  document.createElementNS = (namespace, tagName, options) => document.createElement(tagName, options);
  document.createDocumentFragment = () => new window.DocumentFragment();
  document.createTextNode = text => new window.Text(text);
  document.createComment = comment => new window.Comment(comment);
  document.createEvent = type => {
    switch (type) {
      case 'KeyboardEvent':
      case 'KeyboardEvents':
        return new KeyboardEvent();
      case 'MouseEvent':
      case 'MouseEvents':
        return new MouseEvent();
      case 'Event':
      case 'Events':
      case 'HTMLEvents':
        return new Event();
      default:
        throw new Error('invalid createEvent type: ' + type);
    }
  };
  document.createRange = () => new window.Range();
  document.importNode = (el, deep) => el.cloneNode(deep);
  document.scripts = utils._makeHtmlCollectionProxy(document.documentElement, 'script');
  document.styleSheets = [];
  document.implementation = new DOMImplementation(window);
  document.resources = new GlobalContext.Resources(); // non-standard
  document.activeElement = body;
  document.open = () => {
    document.innerHTML = '';
  };
  document.close = () => {};
  document.write = htmlString => {
    const childNodes = parse5.parseFragment(htmlString, {
      locationInfo: true,
    }).childNodes.map(childNode => GlobalContext._fromAST(childNode, window, document.body, document, true));
    for (let i = 0; i < childNodes.length; i++) {
      document.body.appendChild(childNodes[i]);
    }
  };
  document.execCommand = command => {
    if (command === 'copy') {
      // nothing
    } else if (command === 'paste') {
      document.dispatchEvent(new Event('paste'));
    }
  };
  document[symbols.pointerLockElementSymbol] = null;
  document[symbols.fullscreenElementSymbol] = null;

  const runElQueue = [];
  const _addRun = fn => {
    (async () => {
      if (!document[symbols.runningSymbol]) {
        document[symbols.runningSymbol] = true;

        try {
          await fn();
        } catch(err) {
          console.warn(err.stack);
        }

        document[symbols.runningSymbol] = false;
        if (runElQueue.length > 0) {
          _addRun(runElQueue.shift());
        } else {
          document.emit('flush');
        }
      } else {
        runElQueue.push(fn);
      }
    })();
  };
  document[symbols.runningSymbol] = false;
  document[symbols.addRunSymbol] = _addRun;

  if (window.top === window) {
    document.addEventListener('pointerlockchange', () => {
      const iframes = document.getElementsByTagName('iframe');
      for (let i = 0; i < iframes.length; i++) {
        const iframe = iframes[i];
        if (iframe.contentDocument) {
          iframe.contentDocument._emit('pointerlockchange');
        }
      }
    });
    document.addEventListener('fullscreenchange', () => {
      const iframes = document.getElementsByTagName('iframe');
      for (let i = 0; i < iframes.length; i++) {
        const iframe = iframes[i];
        if (iframe.contentDocument) {
          iframe.contentDocument._emit('fullscreenchange');
        }
      }
    });
  }

  process.nextTick(async () => {
    if (body) {
      const bodyChildNodes = body.childNodes;
      body.childNodes = new window.NodeList();

      try {
        await GlobalContext._runHtml(document.head, window);
      } catch(err) {
        console.warn(err);
      }

      body.childNodes = bodyChildNodes;

      try {
        await GlobalContext._runHtml(document.body, window);
      } catch(err) {
        console.warn(err);
      }

      document.readyState = 'interactive';
      document.dispatchEvent(new Event('readystatechange', {target: document}));

      document.dispatchEvent(new Event('DOMContentLoaded', {
        target: document,
        bubbles: true,
      }));
    } else {
      try {
        await GlobalContext._runHtml(document, window);
      } catch(err) {
        console.warn(err);
      }

      document.readyState = 'interactive';
      document.dispatchEvent(new Event('readystatechange', {target: document}));

      document.dispatchEvent(new Event('DOMContentLoaded', {
        target: document,
        bubbles: true,
      }));
    }

    document.readyState = 'complete';
    document.dispatchEvent(new Event('readystatechange', {target: document}));

    document.dispatchEvent(new Event('load', {target: document}));
    window.dispatchEvent(new Event('load', {target: window}));

    const displays = window.navigator.getVRDisplaysSync();
    if (displays.length > 0 && (!window[symbols.optionsSymbol].args || ['all', 'webvr'].includes(window[symbols.optionsSymbol].args.xr))) {
      const _initDisplays = () => {
        const presentingDisplay = displays.find(display => display.isPresenting);
        if (presentingDisplay && presentingDisplay.constructor.name === 'FakeVRDisplay') {
          _emitOneDisplay(presentingDisplay);
        } else {
          _emitOneDisplay(displays[0]);
        }
      };
      const _emitOneDisplay = display => {
        const e = new window.Event('vrdisplayactivate');
        e.display = display;
        window.dispatchEvent(e);
      };
      const _delayFrames = (fn, n = 1) => {
        if (n === 0) {
          fn();
        } else {
          window.requestAnimationFrame(() => {
            _delayFrames(fn, n - 1);
          });
        }
      };
      if (document.resources.resources.length === 0) {
        _delayFrames(() => {
          _initDisplays();
        }, 2); // arbitary delay to give site time to bind events
      } else {
        const _update = () => {
          if (document.resources.resources.length === 0) {
            _initDisplays();
            document.resources.removeEventListener('update', _update);
          }
        };
        document.resources.addEventListener('update', _update);
      }
    }
  });

  return document;
}