original_docstring: Write Dockerfile to containerize this instance's python function
docstring: Write Dockerfile to containerize this instance's python function
docstring_tokens: Write Dockerfile to containerize this instance ' s python function
code: def _write_dockerfile(self):
          """Write Dockerfile to containerize this instance's python function"""
          with open(self.docker_path, "w") as f:
              template_path = os.path.abspath(
                  os.path.join(
                      os.path.dirname(__file__), "templates", "Dockerfile.template"
                  )
              )
  
              if self.github_installs:
                  github_installs_string = "".join(
                      [
                          " \\\n    && pip install --no-cache-dir git+" + install
                          for install in self.github_installs
                      ]
                  )
              else:
                  github_installs_string = ""
  
              with open(template_path, "r") as template:
                  s = Template(template.read())
                  f.write(
                      s.substitute(
                          app_name=self.name,
                          username=self.username,
                          base_image=self.base_image,
                          script_base_name=os.path.basename(self.script_path),
                          github_installs_string=github_installs_string,
                      )
                  )
  
          mod_logger.info("Wrote Dockerfile {path:s}".format(path=self.docker_path))
code_tokens: def _write_dockerfile ( self ) : with open ( self . docker_path , "w" ) as f : template_path = os . path . abspath ( os . path . join ( os . path . dirname ( __file__ ) , "templates" , "Dockerfile.template" ) ) if self . github_installs : github_installs_string = "" . join ( [ " \\\n    && pip install --no-cache-dir git+" + install for install in self . github_installs ] ) else : github_installs_string = "" with open ( template_path , "r" ) as template : s = Template ( template . read ( ) ) f . write ( s . substitute ( app_name = self . name , username = self . username , base_image = self . base_image , script_base_name = os . path . basename ( self . script_path ) , github_installs_string = github_installs_string , ) ) mod_logger . info ( "Wrote Dockerfile {path:s}" . format ( path = self . docker_path ) )
short_docstring: Write Dockerfile to containerize this instance's python function
short_docstring_tokens: Write Dockerfile to containerize this instance ' s python function
comment: """Write Dockerfile to containerize this instance's python function"""