code: def _command_template(self, switches, objectInput=None):
          
          command = ["java", "-jar", self.file_jar, "-eUTF-8"]
          if self.memory_allocation:
              command.append("-Xmx{}".format(self.memory_allocation))
          command.extend(switches)
  
          if not objectInput:
              objectInput = subprocess.PIPE
  
          log.debug("Subprocess command: {}".format(", ".join(command)))
  
          if six.PY2:
              with open(os.devnull, "w") as devnull:
                  out = subprocess.Popen(
                      command,
                      stdin=objectInput,
                      stdout=subprocess.PIPE,
                      stderr=devnull)
  
          elif six.PY3:
              out = subprocess.Popen(
                  command,
                  stdin=objectInput,
                  stdout=subprocess.PIPE,
                  stderr=subprocess.DEVNULL)
  
          stdoutdata, _ = out.communicate()
          return stdoutdata.decode("utf-8").strip()
docs: Template for Tika app commands
  
          Args:
              switches (list): list of switches to Tika app Jar
              objectInput (object): file object/standard input to analyze
  
          Return:
              Standard output data (unicode Python 2, str Python 3)