class_docstr: Class that produces JSON event objects that stream an igraph graph to
  Gephi using the Gephi Graph Streaming API.
  
  The Gephi graph streaming format is a simple JSON-based format that can be used
  to post mutations to a graph (i.e. node and edge additions, removals and updates)
  to a remote component. For instance, one can open up Gephi (http://www.gephi.org),
  install the Gephi graph streaming plugin and then send a graph from igraph
  straight into the Gephi window by using `GephiGraphStreamer` with the
  appropriate URL where Gephi is listening.
  
  Example::
  
      >>> from cStringIO import StringIO
      >>> from igraph import Graph
      >>> buf = StringIO()
      >>> streamer = GephiGraphStreamer()
      >>> graph = Graph.Formula("A --> B, B --> C")
      >>> streamer.post(graph, buf)
      >>> print(buf.getvalue())        # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE
      {"an": {"igraph:...:v:0": {"name": "A"}}}
      {"an": {"igraph:...:v:1": {"name": "B"}}}
      {"an": {"igraph:...:v:2": {"name": "C"}}}
      {"ae": {"igraph:...:e:0:1": {...}}}
      {"ae": {"igraph:...:e:1:2": {...}}}
      <BLANKLINE>
class_docstr_tok: ["Class","that","produces","JSON","event","objects","that","stream","an","igraph","graph","to","Gephi","using","the","Gephi","Graph","Streaming","API",".","The","Gephi","graph","streaming","format","is","a","simple","JSON-based","format","that","can","be","used","to","post","mutations","to","a","graph","(","i.e",".","node","and","edge","additions",",","removals","and","updates",")","to","a","remote","component",".","For","instance",",","one","can","open","up","Gephi","(","http",":","\/\/www.gephi.org",")",",","install","the","Gephi","graph","streaming","plugin","and","then","send","a","graph","from","igraph","straight","into","the","Gephi","window","by","using","`","GephiGraphStreamer","`","with","the","appropriate","URL","where","Gephi","is","listening",".","Example",":",":",">",">",">","from","cStringIO","import","StringIO",">",">",">","from","igraph","import","Graph",">",">",">","buf","=","StringIO","(",")",">",">",">","streamer","=","GephiGraphStreamer","(",")",">",">",">","graph","=","Graph.Formula","(","``","A","--",">","B",",","B","--",">","C","''",")",">",">",">","streamer.post","(","graph",",","buf",")",">",">",">","print","(","buf.getvalue","(",")",")","#","doctest",":","+ELLIPSIS",",","+NORMALIZE_WHITESPACE","{","``","an","''",":","{","``","igraph",":","...",":","v:0","''",":","{","``","name","''",":","``","A","''","}","}","}","{","``","an","''",":","{","``","igraph",":","...",":","v:1","''",":","{","``","name","''",":","``","B","''","}","}","}","{","``","an","''",":","{","``","igraph",":","...",":","v:2","''",":","{","``","name","''",":","``","C","''","}","}","}","{","``","ae","''",":","{","``","igraph",":","...",":","e:0:1","''",":","{","...","}","}","}","{","``","ae","''",":","{","``","igraph",":","...",":","e:1:2","''",":","{","...","}","}","}","<","BLANKLINE",">"]
docstr: Sends a single JSON event to the given destination using the given
  JSON encoder.  When ``encoder`` is ``None``, it falls back to the
  default JSON encoder of the streamer in the `encoder` property.
  
  ``destination`` must be a file-like object or an instance of
  `GephiConnection`.
  
  The method flushes the destination after sending the event. If you want
  to avoid this (e.g., because you are sending many events), set
  ``flush`` to ``False``.
docstr_tok: ["Sends","a","single","JSON","event","to","the","given","destination","using","the","given","JSON","encoder",".","When","``","encoder","``","is","``","None","``",",","it","falls","back","to","the","default","JSON","encoder","of","the","streamer","in","the","`","encoder","`","property",".","``","destination","``","must","be","a","file-like","object","or","an","instance","of","`","GephiConnection","`",".","The","method","flushes","the","destination","after","sending","the","event",".","If","you","want","to","avoid","this","(","e.g.",",","because","you","are","sending","many","events",")",",","set","``","flush","``","to","``","False","``","."]
code: def send_event(self, event, destination, encoder=None, flush=True):
      """Sends a single JSON event to the given destination using the given
      JSON encoder.  When ``encoder`` is ``None``, it falls back to the
      default JSON encoder of the streamer in the `encoder` property.
  
      ``destination`` must be a file-like object or an instance of
      `GephiConnection`.
  
      The method flushes the destination after sending the event. If you want
      to avoid this (e.g., because you are sending many events), set
      ``flush`` to ``False``.
      """
      encoder = encoder or self.encoder
      destination.write(encoder.encode(event).encode("utf-8"))
      destination.write(b"\r\n")
      if flush:
          destination.flush()
  
imports: import json
  import urllib.error
  import urllib.parse
  import urllib.request
label_desc: Use image node_id 4 for calling the GephiGraphStreamer obj's underlying member method code with example usage: obj.send_event(event, destination, encoder, flush) without return types