class_docstr: Context manager to mock a system command.
  
  The mock command will be written to a directory at the front of $PATH,
  taking precedence over any existing command with the same name.
  
  By specifying content as a string, you can determine what running the
  command will do. The default content records each time the command is
  called and exits: you can access these records with mockcmd.get_calls().
  
  On Windows, the specified content will be run by the Python interpreter in
  use. On Unix, it should start with a shebang (``#!/path/to/interpreter``).
class_docstr_tok: ["Context","manager","to","mock","a","system","command",".","The","mock","command","will","be","written","to","a","directory","at","the","front","of","$","PATH",",","taking","precedence","over","any","existing","command","with","the","same","name",".","By","specifying","content","as","a","string",",","you","can","determine","what","running","the","command","will","do",".","The","default","content","records","each","time","the","command","is","called","and","exits",":","you","can","access","these","records","with","mockcmd.get_calls","(",")",".","On","Windows",",","the","specified","content","will","be","run","by","the","Python","interpreter","in","use",".","On","Unix",",","it","should","start","with","a","shebang","(","``","#","!","\/path\/to\/interpreter","``",")","."]
docstr: Get a list of calls made to this mocked command.
  
  This relies on the default script content, so it will return an
  empty list if you specified a different content parameter.
  
  For each time the command was run, the list will contain a dictionary
  with keys argv, env and cwd.
docstr_tok: ["Get","a","list","of","calls","made","to","this","mocked","command",".","This","relies","on","the","default","script","content",",","so","it","will","return","an","empty","list","if","you","specified","a","different","content","parameter",".","For","each","time","the","command","was","run",",","the","list","will","contain","a","dictionary","with","keys","argv",",","env","and","cwd","."]
code: def get_calls(self):
      """Get a list of calls made to this mocked command.
  
      This relies on the default script content, so it will return an
      empty list if you specified a different content parameter.
  
      For each time the command was run, the list will contain a dictionary
      with keys argv, env and cwd.
      """
      if recording_dir is None:
          return []
      if not os.path.isfile(self.recording_file):
          return []
  
      with open(self.recording_file, "r") as f:
          # 1E is ASCII record separator, last chunk is empty
          chunks = f.read().split("\x1e")[:-1]
  
      return [json.loads(c) for c in chunks]
  
file_path: catboost/contrib/python/testpath/py2/testpath/commands.py
imports: import contextlib
  import json
  import os
  import shutil
  import sys
  import tempfile
label_desc: Use image node_id 6 for calling the MockCommand obj's underlying member method code with example usage: obj.get_calls() and returns: unknown, list, list