parameters: (cwd, logger=None)
return_statement: return ret != 0
docstring: Ensure that node_modules is up to date.
  
      Returns true if the node_modules was updated.
docstring_summary: Ensure that node_modules is up to date.
docstring_tokens: Ensure that node_modules is up to date .
function: def ensure_node_modules(cwd, logger=None):
      """Ensure that node_modules is up to date.
  
      Returns true if the node_modules was updated.
      """
      logger = _ensure_logger(logger)
      yarn_proc = ProgressProcess(['node', YARN_PATH, 'check', '--verify-tree'], cwd=cwd, logger=logger)
      ret = yarn_proc.wait()
  
      # Update node_modules if needed.
      if ret != 0:
          yarn_proc = ProgressProcess(['node', YARN_PATH], cwd=cwd, logger=logger)
          yarn_proc.wait()
          dedupe_yarn(REPO_ROOT, logger)
  
      return ret != 0
function_tokens: def ensure_node_modules ( cwd , logger = None ) : logger = _ensure_logger ( logger ) yarn_proc = ProgressProcess ( [ 'node' , YARN_PATH , 'check' , '--verify-tree' ] , cwd = cwd , logger = logger ) ret = yarn_proc . wait ( ) # Update node_modules if needed. if ret != 0 : yarn_proc = ProgressProcess ( [ 'node' , YARN_PATH ] , cwd = cwd , logger = logger ) yarn_proc . wait ( ) dedupe_yarn ( REPO_ROOT , logger ) return ret != 0