
    Iui                     z   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        yy)=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        |        y)z- Generate and print the AUTHORS.rst content. N)get_git_contributorsprint_contributors)contributorss    V/opt/pipecat/venv/lib/python3.12/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                   t    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y)ContributorzH Represents a contributor with their email, names, and GitHub username. emailnamesNgithubr   commit_countr   c                 J    dj                  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                   r9| 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   ss     ;;(!D--.b =[[M!6t{{m3H 4,,-R

|1==r   )__name__
__module____qualname____doc__str__annotations__setr)   r*   intpropertyr/   r4    r   r	   r&   r&   E   sW    RJs8OFC$JL#-c - -># ># >r   r&   c                      i } t        j                  g dd      j                         }|D ]  }|j                         j	                  dd      \  }}t
        j                  ||      }|s?|| vr,t        |t               t        j                  |            | |<   | |   }|j                  j                  |       |xj                  dz  c_         t        j                         D ]  \  }}|| v s|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   s    ,.L%%* jl 
  &jjl))#q1e'++E59,.,7%e'++O<-L) #?3d#  A% !&$ "1!6!6!8 9~L )7(8L%9 r   r   c                 L   t        dj                  dd             t        | j                         d       }d}d}|D ]d  }t	        t        j                  |j                              }|r||k7  r|dz  }t                |}d	|d
z     }t        |j                  |             f y)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                 4    | 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
 "JK* /DHH[5567*-1KG
 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F r   