def get_dates(self, resource):
        """
        Retrieve dates from git
        """
        # Run git log --pretty=%ai
        try:
            commits = subprocess.check_output([
                "git",
                "log",
                "--pretty=%ai",
                resource.path
            ]).split("\n")
            commits = commits[:-1]
        except subprocess.CalledProcessError:
            self.logger.warning(
                "Unable to get git history for [%s]" % resource)
            commits = None

        if commits:
            created = parse(commits[-1].strip())
            modified = parse(commits[0].strip())
        else:
            self.logger.warning("No git history for [%s]" % resource)
            created, modified = None, None

        return created, modified

#
# Mercurial Dates
#
dataset/ETHPy150Open hyde/hyde/hyde/ext/plugins/vcs.py/GitDatesPlugin.get_dates/original