This requires a jquery locator or an ID. The leading hash (#) should not be provided to this method if it is just an ID
428722
@LogExecTime
	public void fireEvent(String locator, String eventName)
	{
		jtCore.fireEvent(locator, eventName);
	}
774972
def get_by_id_or_404(self, id, **kwargs):
        """"""
        obj = self.get_by_id(id=id, **kwargs)

        if obj:
            return obj

        raise Http404
84060
function submitSearch() {
    var searchInput = getSearchInput();
    // FIXME: SUI validation for select2 field
      if (!searchInput.valid) {
      alert('Please select team members');
      return;
    }
    console.log('publishing', searchInput);
    $('.search.message').html('Search results:');
    $('.search.message').removeClass('hidden');
    context.pubsub.status('queued', function(res) {
      console.log(res);
      var message = '';
      if (res.err) {
        message = res.err;
      } else {
        message = 'found <a target="_searchresult" href="' + res.status.uri + '">' + res.status.uri + '</a> from ' + res.status.source;
      }

      $('.search.message').append('<div>' + message + '</div>');
    });

    context.pubsub.search.queue(searchInput);
    context.queryLib.setAnnotationTags($('#searchCategories').val().split(','));
    context.queryLib.submitQuery();
  }
63186
function(baseURI) {
      var hash = baseURI.indexOf("#");
      if (hash>=0) {
        baseURI = baseURI.substring(0,hash);
      }
      if (options && options.baseURIMap) {
        baseURI = options.baseURIMap(baseURI);
      }
      return baseURI;
    }
34539
def api_hash(replace = nil)
      self.replace = replace unless replace.nil?
      {
        url:          href,
        description:  description,
        extended:     extended,
        tags:         tag.join(" "),
        replace:      replace,
        shared:       shared,
        toread:       toread
      }.select { |key, value| ! value.nil? }
    end
1353600
def id_hash(id, organization)
      {
        id: id,
        provider: organization.oauth_provider,
        realm: organization.oauth_uid
      }
    end
1096814
function (hash) {
            var iframe = this._iframe;
            if (!iframe) {
                return;
            }
            hash = hash || "";
            if (this._currentIframeHashString != hash) {
                var src = ['javascript:document.open();'];
                src.push('document.write(\"<script type=\\\"text/javascript\\\">');
                if (Aria.domain) {
                    src.push('document.domain=\\\"' + Aria.domain + '\\\";');
                }
                src.push('if (parent.' + this.$classpath + '){parent.' + this.$classpath
                        + '.polledIframeHashString=\\\"' + hash + '\\\";}');
                src.push("</script>\");");
                src.push('document.close();');
                iframe.src = src.join("");
                this._currentIframeHashString = hash;
            }
        }
1108413
function initStatus() {
  if (window.location.search.length > 0 &&
      window.location.search[0] == '?') {
    var query = window.location.search.substr(1);
    var pieces = query.split('&');
    $.each(pieces, function(index, param) {
      var mapping = param.split('=');
      if (mapping.length != 2) {
        return;
      }
      if (mapping[0] == 'auto' && mapping[1] == 'false') {
        AUTO_REFRESH = false;
      } else if (mapping[0] == 'root') {
        ROOT_PIPELINE_ID = mapping[1];
        if (ROOT_PIPELINE_ID.match(/^pipeline-/)) {
          ROOT_PIPELINE_ID = ROOT_PIPELINE_ID.substring(9);
        }
      }
    });
  }

  if (!Boolean(ROOT_PIPELINE_ID)) {
    setButter('Missing root param' +
        '. For a job list click <a href="list">here</a>.',
        true, null, true);
    return;
  }

  var loadingMsg = 'Loading... #' + ROOT_PIPELINE_ID;
  var attempts = 1;
  var ajaxRequest = {
    type: 'GET',
    url: 'rpc/tree?root_pipeline_id=' + ROOT_PIPELINE_ID,
    dataType: 'text',
    error: function(request, textStatus) {
      if (request.status == 404) {
        if (++attempts <= 5) {
          setButter(loadingMsg + ' [attempt #' + attempts + ']');
          window.setTimeout(function() {
            $.ajax(jQuery.extend({}, ajaxRequest));
          }, 2000);
        } else {
          setButter('Could not find pipeline #' + ROOT_PIPELINE_ID +
              '. For a job list click <a href="list">here</a>.',
              true, null, true);
        }
      } else if (request.status == 449) {
        var root = request.getResponseHeader('root_pipeline_id');
        var newURL = '?root=' + root + '#pipeline-' + ROOT_PIPELINE_ID;
        window.location.replace(newURL);
      } else {
        getResponseDataJson(textStatus);
      }
    },
    success: function(data, textStatus, request) {
      var response = getResponseDataJson(null, data);
      if (response) {
        clearButter();
        STATUS_MAP = response;
        LANG = request.getResponseHeader('Pipeline-Lang');
        initStatusDone();
      }
    }
  };
  setButter(loadingMsg);
  $.ajax(jQuery.extend({}, ajaxRequest));
}
1060202
function Id (_id) {
  var dec
  var hex

  if (typeof _id === 'number') {
    dec = _id
    var tmp = ('00000000000000' + _id.toString(16))
    hex = tmp.substring(tmp.length - 12, tmp.length)
  }
  if (typeof _id === 'string') {
    dec = parseInt(_id, 16)
    hex = _id
  }
  if (typeof _id === 'undefined') {
    hex = sha1((~~(Math.random() * 1e9)).toString(36) + Date.now())
      .substring(0, 12)
    dec = parseInt(hex, 16)
  }

  this.toHex = function () {
    return hex
  }

  this.toDec = function () {
    return dec
  }

  this.next = function () {
    if (hex === maxHex) {
      return '000000000000'
    } else {
      var a = ('000000000000' + ((dec + 1).toString(16)))
      return a.substring(a.length - 12, a.length)
    }
  }

  return this
}
565686
function() {
        var lookupValue = this.value;
        if (lookupValue === null || lookupValue === undefined || lookupValue === '') {
            if (this.unselectedText !== undefined || (!this.startingValue && !this.rendered)) {
                this.select.selectedIndex = 0;
                return this;
            } else if (!this.options.length && this.value === null) {
                return this;
            }
        }

        // Pull out the id if it's a model
        if (this.options.isCollection && this.yieldModel) {
            lookupValue = lookupValue && lookupValue[this.idAttribute];
        }

        if (lookupValue || lookupValue === 0 || lookupValue === null) {
            if (lookupValue === null) lookupValue = ''; // DOM sees only '' empty value
            for (var i = this.select.options.length; i--; i) {
                if (this.select.options[i].value == lookupValue) {
                    this.select.selectedIndex = i;
                    return this;
                }
            }
        }

        // failed to match any
        throw new Error('no option exists for value: ' + lookupValue);
    }
510614
function () {
        var i, x, entry

        // Custom selectors
        for (x in this.hashForMethods) {
            if (this.hashForMethods.hasOwnProperty(x)) {
                entry = this.hashForMethods[x]
                this.unscheduleAllSelectorsForTarget(entry.target)
            }
        }
        // Updates selectors
        for (i = 0, len = this.updatesNeg.length; i < len; i++) {
            entry = this.updatesNeg[i]
            if (entry) {
                this.unscheduleUpdateForTarget(entry.target)
            }
        }

        for (i = 0, len = this.updates0.length; i < len; i++) {
            entry = this.updates0[i]
            if (entry) {
                this.unscheduleUpdateForTarget(entry.target)
            }
        }

        for (i = 0, len = this.updatesPos.length; i < len; i++) {
            entry = this.updatesPos[i]
            if (entry) {
                this.unscheduleUpdateForTarget(entry.target)
            }
        }
    }
721778
function get_id(val) {
  if ( typeof val === 'string' || typeof val === 'number' )
    return val;

  if ( typeof val === 'object' && val.id )
    return val.id;

  return false;
}
704804
function(target) {
      var id = 'unknown';

      if (target && typeof target.innerHTML === 'string') {
        if (target.id) {
          id = '#' + target.id;
        } else if (target.nodeName) {
          id = target.nodeName.toLowerCase();

          if (target.className) {
            var classes = target.className.split(/\s+/);
            for (var i = 0, length = classes.length; i < length; i++) {
              id += '.' + classes[i];
            }
          }
        }
      }

      return id;
    }
1071423
def find(id)
      raise ArgumentError.new("Missing id/slug") unless id

      result = access_token.get("#{API_BASE}#{self.class::API_PATH}#{id}")
      raise ServiceError.new(result.code, result.body) unless result.code == "200"

      self.class::ITEM_CLASS.new(result.body)
    end
522408
private void ensureId(final Element element) {
        final String id = element.getId();
        if (id == null || id.isEmpty()) {
            element.setId(Document.get().createUniqueId());
        }
    }
1088383
def find_hash(id, options = {})
      options.assert_valid_keys(:request_level)
      level = find_level(options[:request_level])
      record = self.find(id, :select => level.select_field.join(', '), :include => level.include_field)
      level.receive record
    end
1153286
function( url ) {
                var parsedUrl = this.parseUrl( url || location.href ),
                    uri = url ? parsedUrl : location,

                    // Make sure to parse the url or the location object for the hash because using
                    // location.hash is autodecoded in firefox, the rest of the url should be from
                    // the object (location unless we're testing) to avoid the inclusion of the
                    // authority
                    hash = parsedUrl.hash;

                // mimic the browser with an empty string when the hash is empty
                hash = hash === "#" ? "" : hash;

                return uri.protocol +
                    parsedUrl.doubleSlash +
                    uri.host +

                    // The pathname must start with a slash if there's a protocol, because you
                    // can't have a protocol followed by a relative path. Also, it's impossible to
                    // calculate absolute URLs from relative ones if the absolute one doesn't have
                    // a leading "/".
                    ( ( uri.protocol !== "" && uri.pathname.substring( 0, 1 ) !== "/" ) ?
                        "/" : "" ) +
                    uri.pathname +
                    uri.search +
                    hash;
            }