class_docstr: The main 'connection' object for PickleShare database 
class_docstr_tok: ["The","main","'connection","'","object","for","PickleShare","database"]
docstr: db['key'] = 5 
docstr_tok: ["db","[","'key","'","]","=","5"]
code: def __setitem__(self, key, value):
      """db['key'] = 5"""
      fil = self.root / key
      parent = fil.parent
      if parent and not parent.is_dir():
          parent.mkdir(parents=True)
      # We specify protocol 2, so that we can mostly go between Python 2
      # and Python 3. We can upgrade to protocol 3 when Python 2 is obsolete.
      with fil.open("wb") as f:
          pickle.dump(value, f, protocol=2)
      try:
          self.cache[fil] = (value, fil.stat().st_mtime)
      except OSError as e:
          if e.errno != errno.ENOENT:
              raise
  
imports: from __future__ import print_function
  import os, stat, time
  import errno
  import sys
label_desc: Use image node_id 3 for calling the PickleShareDB obj's underlying member method code with example usage: obj.__setitem__(key, value) without return types