<s> from githistorydata . codeline import CodeLine <EOL> from githistorydata . dataline import DataLine <EOL> def expand_authors ( log_lines ) : <EOL> for log_line in log_lines : <EOL> spl = log_line . author . split ( "<STR_LIT:U+002C>" ) <EOL> weight = <NUM_LIT:1.0> / len ( spl ) <EOL> for auth in spl : <EOL> yield CodeLine ( <EOL> log_line . commit_hash , <EOL> log_line . date , <EOL> auth . strip ( ) , <EOL> weight <EOL> ) <EOL> def expand_detail ( commit_detail , weight ) : <EOL> return ( <EOL> DataLine ( <EOL> commit_detail . commit_hash , <EOL> commit_detail . date , <EOL> commit_detail . author , <EOL> int ( fc . added * weight ) , <EOL> int ( fc . removed * weight ) , <EOL> fc . name <EOL> ) <EOL> for fc in commit_detail . file_changes <EOL> ) <EOL> def expand_lines ( git , code_lines ) : <EOL> for ln in code_lines : <EOL> commit_detail = git . show ( ln . commit_hash , ln . date , ln . author ) <EOL> for data_line in expand_detail ( commit_detail , ln . weight ) : <EOL> yield data_line </s>
