code: def extract_bigram_feats(document, bigrams):
      """
      Populate a dictionary of bigram features, reflecting the presence/absence in
      the document of each of the tokens in `bigrams`. This extractor function only
      considers contiguous bigrams obtained by `nltk.bigrams`.
  
      :param document: a list of words/tokens.
      :param unigrams: a list of bigrams whose presence/absence has to be
          checked in `document`.
      :return: a dictionary of bigram features {bigram : boolean}.
  
      >>> bigrams = [('global', 'warming'), ('police', 'prevented'), ('love', 'you')]
      >>> document = 'ice is melting due to global warming'.split()
      >>> sorted(extract_bigram_feats(document, bigrams).items()) # doctest: +NORMALIZE_WHITESPACE
      [('contains(global - warming)', True), ('contains(love - you)', False),
      ('contains(police - prevented)', False)]
      """
      features = {}
      for bigr in bigrams:
          features[
              f"contains({bigr[0]} - {bigr[1]})"
          ] = bigr in nltk.bigrams(document)
      return features
  
imports: import codecs
  import csv
  import json
  import pickle
  import random
  import re
  import sys
  import time
  from copy import deepcopy
  import nltk
  from nltk.corpus import CategorizedPlaintextCorpusReader
  from nltk.data import load
  from nltk.tokenize.casual import EMOTICON_RE
label_desc: Use image node_id 3 for calling a global function with example usage: extract_bigram_feats(document, bigrams) and returns: features