
    ePi                        U d Z ddlmZ ddlZddlZd<dZddddddddd	d
ddZeeedz  f         e	d<   ddddddddZ
eeef         e	d<   i ddd
dddddddddd d!d"d#d$d%d&d'dd(d)d*d+d,d-d.d	d/dd0d1d2d3d4iZeeef         e	d5<   e G d6 d7                      Zdeeef         fd8Zd9eeef         ddfd:Zed;k    r e             dS dS )=z Generate the AUTHORS.rst file from git commit history.

This module reads git commit logs and produces a formatted list of contributors
grouped by their contribution count, mapping email aliases and GitHub usernames.
    )	dataclassNreturnc                  @    t                      } t          |            dS )z- Generate and print the AUTHORS.rst content. N)get_git_contributorsprint_contributors)contributorss    x/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/av-16.1.0.dist-info/licenses/AUTHORS.pymainr
      s#     ())L|$$$$$    zgithub@mikeboers.comzdavoudialireza@gmail.comztcaswell@gmail.comxxr@megvii.comdaniel.b.allan@gmail.comzchaudominic2@gmail.com)zgit@mikeboers.comzmboers@keypics.comzmikeb@loftysky.comzmikeb@markmedia.cozwesternx@mikeboers.comzmark@mark-VirtualBox.(none)za.davoudi@aut.ac.irztcaswell@bnl.govzxxr3376@gmail.comzdallan@pha.jhu.eduz-61652821+laggykiller@users.noreply.github.comEMAIL_ALIASESzCasper van der Welz	Dan AllanzManuel Goacolouz	Mark ReidzMoritz KassnerzVidar Tonaas Fauskez	Xinran Xu)zcaspervdw@gmail.comr   zmgoacolou@cls.frmindmark@gmail.commoritzkassner@gmail.comvidartf@gmail.comr   CANONICAL_NAMESzbilly.shambrook@gmail.combillyshambrookdanielballanadavoudi	mikeboerszjeremy.laine@m4x.orgjlainezkalle.litterfeldt@gmail.comlitterfeldtr   markreidvfxr   mkassnerzrush@logic.czzradek-senfeldzself@brendanlong.combrendanlong	tacaswellzulrik.mikaelsson@magine.comrawlerr   vidartfzwillpatera@gmail.com
willpateraxxr3376laggykillerzwyattblue@auto-editor.com	WyattBluezCurtis@GreenKey.netdotysanGITHUB_USERNAMESc                       e Zd ZU dZeed<   ee         ed<   dZedz  ed<   dZe	ed<   e
defd	            Zd
edefdZdS )ContributorzH Represents a contributor with their email, names, and GitHub username. emailnamesNgithubr   commit_countr   c                 P    d                     t          | j                            S )z Return the formatted display name for the contributor.

        Returns:
            Comma-separated sorted list of contributor names.
        z, )joinsortedr(   )selfs    r	   display_namezContributor.display_nameN   s      yy
++,,,r   bulletc           
          | j         r%| d| j         d| j         d| j          d| j          d
S | d| j         d| j         dS )z Format the contributor line for RST output.

        Args:
            bullet: The bullet character to use (- or *).

        Returns:
            Formatted RST line with contributor info.
         z <z>; `@z <https://github.com/z>`_>)r)   r/   r'   )r.   r0   s     r	   format_linezContributor.format_lineX   s     ; 	 H HD- H H H H[H H7;{H H H ==4,==
====r   )__name__
__module____qualname____doc__str__annotations__setr)   r*   intpropertyr/   r4    r   r	   r&   r&   E   s         RRJJJs8OOOFC$JL#-c - - - X-># ># > > > > > >r   r&   c                  :   i } t          j        g dd                                          }|D ]}|                                                    dd          \  }}t
                              ||          }|sK|| vr9t          |t                      t                              |                    | |<   | |         }|j
                            |           |xj        dz  c_        t                                          D ]\  }}|| v r|h| |         _
        | S )z Parse git log and return contributors grouped by canonical email.

    Returns:
        Dictionary mapping canonical emails to Contributor objects.
    )gitlogz--format=%aN,%aET)text,   )r'   r(   r)   )
subprocesscheck_output
splitlinesstriprsplitr   getr&   r;   r$   r(   addr*   r   items)r   git_loglinenamer'   canonical_emailcontributorcanonical_names           r	   r   r   j   sG    ,.L%***   jll 
  & &jjll))#q11e'++E599 	,..,7%ee'++O<<- - -L) #?3d###  A%   !0!6!6!8!8 9 9~L  )7(8L%r   r   c                    t          d                    dd                     t          |                                 d           }d}d}|D ]r}t	          t          j        |j                            }|r||k    r|dz  }t                       |}d	|d
z           }t          |                    |                     sdS )zPrint contributors grouped by logarithmic order of commits.

    Args:
        contributors: Dictionary of contributors to print.
    zd        Contributors
        ============

        All contributors (by number of commits):
        z         c                      | j          | j        fS )N)r*   r'   )cs    r	   <lambda>z$print_contributors.<locals>.<lambda>   s    0 r   )keyNr   rD   z-*   )	printreplacer-   valuesr<   mathrA   r*   r4   )r   sorted_contributors
last_orderblock_indexrQ   orderr0   s          r	   r   r      s     
 
 GJ##% % % !00  
 "JK* / /DH[56677 	*--1KGGG
 kAo&k%%f--..../ /r   __main__)r   N)r8   dataclassesr   r]   rE   r
   r   dictr9   r:   r   r$   r&   r   r   r5   r>   r   r	   <module>re      s     " ! ! ! ! !     % % % % 00004#'5,)45M( (tCtO$   $ 0 +)%/.!# #c3h   $!1$$ 
$ K	$
 H$ "=$ -$ z$ _$ M$ +$ "8$ $ L$ i$  m!$"  #$$ 9%$ $ $sCx.   , !> !> !> !> !> !> !> !>H#d3#34 # # # #L"/T#{*:%; "/ "/ "/ "/ "/J zDFFFFF r   