def blame(self, extensions=None, ignore_dir=None, committer=True, by='repository'):
        """
        Returns the blame from the current HEAD of the repositories as a DataFrame.  The DataFrame is grouped by committer
        name, so it will be the sum of all contributions to all repositories by each committer. As with the commit history
        method, extensions and ignore_dirs parameters can be passed to exclude certain directories, or focus on certain
        file extensions. The DataFrame will have the columns:

         * committer
         * loc

        :param extensions: (optional, default=None) a list of file extensions to return commits for
        :param ignore_dir: (optional, default=None) a list of directory names to ignore
        :param committer: (optional, default=True) true if committer should be reported, false if author
        :param by: (optional, default=repository) whether to group by repository or by file
        :return: DataFrame
        """

        df = None

        for repo in self.repos:
            try:
                if df is None:
                    df = repo.blame(extensions=extensions, ignore_dir=ignore_dir, committer=committer, by=by)
                else:
                    df = df.append(repo.blame(extensions=extensions, ignore_dir=ignore_dir, committer=committer, by=by))
            except GitCommandError as err:
                print('Warning! Repo: %s couldnt be blamed' % (repo, ))
                pass

        df = df.reset_index(level=1)
        df = df.reset_index(level=1)
        if committer:
            if by == 'repository':
                df = df.groupby('committer').agg({'loc': np.sum})
            elif by == 'file':
                df = df.groupby(['committer', 'file']).agg({'loc': np.sum})
        else:
            if by == 'repository':
                df = df.groupby('author').agg({'loc': np.sum})
            elif by == 'file':
                df = df.groupby(['author', 'file']).agg({'loc': np.sum})

        df = df.sort_values(by=['loc'], ascending=False)

        return df
dataset/ETHPy150Open wdm0006/git-pandas/gitpandas/project.py/ProjectDirectory.blame/original