Intent grabs things from our sources and pulls out what events we're interested in, as well as mapping to useful data (so streams of strings, instead of observables of text input events)
503054
function intent(sources) {
    const horizonCollection = sources.horizon(sources.config.collectionName)
    // Every time the enter key is hit in the text box
    const enterHit$ = sources.DOM
            .select('#input')
            .events('keydown')
            .filter(ev => ev.keyCode === 13)
            .map(ev => ev.target.value || null)
            .share()
    // Every time the text in the input box changes
    const inputChange$ = sources.DOM
            .select('#input')
            .events('input')
            .map(ev => ev.target.value)
    // all our chats from the horizon server
    const messages$ = horizonCollection
            .order('datetime', 'descending')
            .limit(sources.config.chatLength)
            .watch()

    // Every time the user hits enter, store the message to the server
    // Note: this is an observable of observables
    const writeOps$$ = enterHit$.map(text =>
      horizonCollection.store({
        authorId: sources.config.authorId,
        datetime: new Date(),
        text,
      })
    )

    // This merges the stream of the input values with a stream that
    // returns null whenever enter is hit. This will clear the text
    // box after submitting.
    const inputValue$ = inputChange$.merge(enterHit$.map(() => null))
    return {
      inputValue$,
      writeOps$$,
      messages$,
    }
  }
628908
function handleShowInOS() {
        var entry = ProjectManager.getSelectedItem();
        if (entry) {
            brackets.app.showOSFolder(entry.fullPath, function (err) {
                if (err) {
                    console.error("Error showing '" + entry.fullPath + "' in OS folder:", err);
                }
            });
        }
    }
953068
function processInputStream(msg) {
      var tmp = msg.payload;

      if ('string' === typeof msg.payload) {
        msg.payload = JSON.parse(tmp);
      }
      if (msg.payload.action) {
        if ('start' === msg.payload.action) {
          startPacket = msg.payload;
        }
      } else {
        msg.payload = { 'action' : 'data', 'data' : tmp };
      }

      return Promise.resolve(msg.payload);
    }
816701
function (text) {
      var inApiSection = false;

      return fs.createReadStream(opts.src)
        .pipe(es.split("\n"))
        .pipe(es.through(function (line) {
          // Hit the start marker.
          if (line === opts.start) {
            // Emit our line (it **is** included).
            this.emit("data", line);

            // Emit our the processed API data.
            this.emit("data", text);

            // Mark that we are **within** API section.
            inApiSection = true;
          }

          // End marker.
          if (line === opts.end) {
            // Mark that we have **exited** API section.
            inApiSection = false;
          }

          // Re-emit lines only if we are not within API section.
          if (!inApiSection) {
            this.emit("data", line);
          }
        }))
        .pipe(es.join("\n"))
        .pipe(es.wait());
    }
1268757
function readStream(stream) {
  return new Promise(function(resolve) {
    stream.pipe(concat(function(data) {
      resolve(data.toString().trim());
    }));
  });
}
294372
def _gather_buffers(self, event: Message):
        
        if isinstance(event, BytesMessage):
            buf = self._byte_buffer
        else:
            buf = self._string_buffer

        # yay for code shortening
        buf.write(event.data)
        buf.seek(0)
        data = buf.read()
        buf.seek(0)
        buf.truncate()
        return data
108668
function(selector, from, doc, data) {
      Contexts[selector] = from;
      Results[selector] = data;
      return;
    }
306567
@NonNull
    public Searcher search(@Nullable final Intent intent) {
        String query = null;
        Object origin = null;
        if (intent != null) {
            if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
                query = intent.hasExtra(SearchManager.QUERY) ?
                        intent.getStringExtra(SearchManager.QUERY) : intent.getDataString();
                origin = intent;
            }
        }
        return search(query, origin);
    }
773228
public static Intent shareText(String subject, String text) {
        Intent intent = new Intent();
        intent.setAction(Intent.ACTION_SEND);
        if (!TextUtils.isEmpty(subject)) {
            intent.putExtra(Intent.EXTRA_SUBJECT, subject);
        }
        intent.putExtra(Intent.EXTRA_TEXT, text);
        intent.setType("text/plain");
        return intent;
    }
1099125
private void doExtraction(GatherExtractionInfo info) {
    // Insert a global temp if we are using the USE_GLOBAL_TEMP pattern.
    if (pattern == Pattern.USE_GLOBAL_TEMP) {
      Node injectionPoint = compiler.getNodeForCodeInsertion(null);

      Node var = NodeUtil.newVarNode(PROTOTYPE_ALIAS, null)
          .useSourceInfoIfMissingFromForTree(injectionPoint);

      injectionPoint.addChildToFront(var);
      compiler.reportChangeToEnclosingScope(var);
    }
    // Go through all extraction instances and extract each of them.
    for (ExtractionInstance instance : info.instances) {
      extractInstance(instance);
    }
  }
691926
function DataChanneMessageEvent (event) {
    this.data = event.data;
    this.source = event.source;
    this.lastEventId = event.lastEventId;
    this.origin = event.origin;
    this.timeStamp = event.timeStamp;
    this.type = event.type;
    this.ports = event.ports;
    this.path = event.path;
  }
912866
def load_fetched_objects_into_contexts(events, model_data, context_hints_per_source):
    
    for event in events:
        context_hints = context_hints_per_source.get(event.source, {})
        for context_key, hints in context_hints.items():
            model = get_model(hints['app_name'], hints['model_name'])
            for d, value in dict_find(event.context, context_key):
                if isinstance(value, list):
                    for i, model_id in enumerate(d[context_key]):
                        d[context_key][i] = model_data[model].get(model_id)
                else:
                    d[context_key] = model_data[model].get(value)
1263484
function(action) {
			var list = this._trackedtypes[action.type];
			if (list) {
				list.forEach(function(checks) {
					var handler = checks[0];
					var matches = checks[1] === action.global;
					var hacking = handler === this.spirit && this.$handleownaction;
					if (matches && (handler !== action.target || hacking)) {
						handler.onaction(action);
					}
				}, this);
			}
		}
586063
public void setIntents(java.util.Collection<Intent> intents) {
        if (intents == null) {
            this.intents = null;
            return;
        }

        this.intents = new java.util.ArrayList<Intent>(intents);
    }
1140498
function()
		{
			var linkType = this.getContentElement( 'info', 'linkType' ),
					urlField;
			if ( linkType && linkType.getValue() == 'url' )
			{
				urlField = this.getContentElement( 'info', 'url' );
				urlField.select();
			}
		}
902700
static void requestAppDetails(Source source) {
        Intent intent = new Intent(source.getContext(), BridgeActivity.class);
        intent.putExtra(KEY_TYPE, BridgeRequest.TYPE_APP_DETAILS);
        source.startActivity(intent);
    }
895558
private static List<TraceEvent> getEvents(List<String> data) throws Exception
   {
      List<TraceEvent> result = new ArrayList<TraceEvent>();

      for (String s : data)
      {
         result.add(TraceEvent.parse(s));
      }

      return result;
   }