parameters: (filepath: str)
return_statement: return initial_commit_time.split('-')[0]
docstring: Get file creation time and return the year as a stringified integer.
      Because git-clone overwrites ctime, we need to retrieve it
      using git-log.
docstring_summary: Get file creation time and return the year as a stringified integer.
      Because git-clone overwrites ctime, we need to retrieve it
      using git-log.
docstring_tokens: Get file creation time and return the year as a stringified integer . Because git - clone overwrites ctime we need to retrieve it using git - log .
function: def get_ctime_year(filepath: str) -> str:
      """
      Get file creation time and return the year as a stringified integer.
      Because git-clone overwrites ctime, we need to retrieve it
      using git-log.
      """
      # %aI: author date as an YYYY-MM-DDTHH:MM:SS-HH:MM string (git 2.21).
      command = "git --no-pager log --reverse --format=\"%aI\" {}".format(
          filepath)
      try:
          out = subprocess.check_output(command.split())
      except subprocess.CalledProcessError as e:
          sys.exit("%s error: %s" % (command, e))
      assert (type(out) == bytes)
      initial_commit_time = out.decode().strip('"').strip("'").split('\n', 1)[0]
      return initial_commit_time.split('-')[0]
function_tokens: def get_ctime_year ( filepath : str ) -> str : # %aI: author date as an YYYY-MM-DDTHH:MM:SS-HH:MM string (git 2.21). command = "git --no-pager log --reverse --format=\"%aI\" {}" . format ( filepath ) try : out = subprocess . check_output ( command . split ( ) ) except subprocess . CalledProcessError as e : sys . exit ( "%s error: %s" % ( command , e ) ) assert ( type ( out ) == bytes ) initial_commit_time = out . decode ( ) . strip ( '"' ) . strip ( "'" ) . split ( '\n' , 1 ) [ 0 ] return initial_commit_time . split ( '-' ) [ 0 ]