


'''simple docstring'''

from datetime import datetime as dt
import os

from github import Github


lowerCamelCase							:   int  						=	[
    'good first issue',
    'good second issue',
    'good difficult issue',
    'feature request',
    'new model',
    'wip',
]

def _SCREAMING_SNAKE_CASE      ()       ->       str:






       """simple docstring"""







       lowercase__      			= Github(os.environ['''GITHUB_TOKEN''']       )
       lowercase__      			= g.get_repo('''huggingface/transformers'''       )
       lowercase__      			= repo.get_issues(state='''open'''       )

       for issue in open_issues:
              lowercase__      			= sorted([comment for comment in issue.get_comments()]  , key=lambda A       : i.created_at  , reverse=A       )
              lowercase__      			= comments[0] if len(A       ) > 0 else None
              if (
                  last_comment is not None
                  and last_comment.user.login == "github-actions[bot]"
                  and (dt.utcnow() - issue.updated_at).days > 7
                  and (dt.utcnow() - issue.created_at).days >= 30
                  and not any(label.name.lower() in LABELS_TO_EXEMPT for label in issue.get_labels()       )
              ):
                     # print(f"Would close issue {issue.number} since it has been 7 days of inactivity since bot mention.")
                     issue.edit(state='''closed'''       )
              elif (
                  (dt.utcnow() - issue.updated_at).days > 23
                  and (dt.utcnow() - issue.created_at).days >= 30
                  and not any(label.name.lower() in LABELS_TO_EXEMPT for label in issue.get_labels()       )
              ):
                     # print(f"Would add stale comment to {issue.number}")
                     issue.create_comment(
                         '''This issue has been automatically marked as stale because it has not had '''
                         '''recent activity. If you think this still needs to be addressed '''
                         '''please comment on this thread.\n\nPlease note that issues that do not follow the '''
                         '''[contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) '''
                         '''are likely to be ignored.'''       )


if __name__ == "__main__":
 main()








'''simple docstring'''

from ...configuration_utils import PretrainedConfig
from ...utils import logging


lowerCamelCase							:   int  						=	logging.get_logger(__name__)

lowerCamelCase							:   List[Any]  						=	{
    'google/realm-cc-news-pretrained-embedder': (
        'https://huggingface.co/google/realm-cc-news-pretrained-embedder/resolve/main/config.json'
    ),
    'google/realm-cc-news-pretrained-encoder': (
        'https://huggingface.co/google/realm-cc-news-pretrained-encoder/resolve/main/config.json'
    ),
    'google/realm-cc-news-pretrained-scorer': (
        'https://huggingface.co/google/realm-cc-news-pretrained-scorer/resolve/main/config.json'
    ),
    'google/realm-cc-news-pretrained-openqa': (
        'https://huggingface.co/google/realm-cc-news-pretrained-openqa/aresolve/main/config.json'
    ),
    'google/realm-orqa-nq-openqa': 'https://huggingface.co/google/realm-orqa-nq-openqa/resolve/main/config.json',
    'google/realm-orqa-nq-reader': 'https://huggingface.co/google/realm-orqa-nq-reader/resolve/main/config.json',
    'google/realm-orqa-wq-openqa': 'https://huggingface.co/google/realm-orqa-wq-openqa/resolve/main/config.json',
    'google/realm-orqa-wq-reader': 'https://huggingface.co/google/realm-orqa-wq-reader/resolve/main/config.json',
    # See all REALM models at https://huggingface.co/models?filter=realm
}
class   __lowerCAmelCase						(lowercase_     ):





      '''simple docstring'''






      lowerCAmelCase__					:     Optional[int]  					=							"""realm"""



      def __init__(self    :    str   ,						UpperCamelCase    :    List[Any]=30522   ,						UpperCamelCase    :    List[Any]=768   ,						UpperCamelCase    :    int=128   ,						UpperCamelCase    :    Any=12   ,						UpperCamelCase    :    Tuple=12   ,						UpperCamelCase    :    List[Any]=8   ,						UpperCamelCase    :    Union[str, Any]=3072   ,						UpperCamelCase    :    List[str]="gelu_new"   ,						UpperCamelCase    :    Any=0.1   ,						UpperCamelCase    :    List[str]=0.1   ,						UpperCamelCase    :    Dict=512   ,						UpperCamelCase    :    Dict=2   ,						UpperCamelCase    :    List[Any]=0.02   ,						UpperCamelCase    :    List[Any]=1E-12   ,						UpperCamelCase    :    Dict=256   ,						UpperCamelCase    :    Union[str, Any]=10   ,						UpperCamelCase    :    Optional[int]=1E-3   ,						UpperCamelCase    :    Tuple=5   ,						UpperCamelCase    :    Optional[int]=320   ,						UpperCamelCase    :    List[str]=13353718   ,						UpperCamelCase    :    Optional[Any]=5000   ,						UpperCamelCase    :    str=1   ,						UpperCamelCase    :    Union[str, Any]=0   ,						UpperCamelCase    :    List[Any]=2   ,						**UpperCamelCase    :    int   ,						):

             '''simple docstring'''







             super().__init__(pad_token_id=UpperCamelCase   ,						bos_token_id=UpperCamelCase   ,						eos_token_id=UpperCamelCase   ,						**UpperCamelCase )

             # Common config
             lowercase__      			= vocab_size
             lowercase__      			= max_position_embeddings
             lowercase__      			= hidden_size
             lowercase__      			= retriever_proj_size
             lowercase__      			= num_hidden_layers
             lowercase__      			= num_attention_heads
             lowercase__      			= num_candidates
             lowercase__      			= intermediate_size
             lowercase__      			= hidden_act
             lowercase__      			= hidden_dropout_prob
             lowercase__      			= attention_probs_dropout_prob
             lowercase__      			= initializer_range
             lowercase__      			= type_vocab_size
             lowercase__      			= layer_norm_eps

             # Reader config
             lowercase__      			= span_hidden_size
             lowercase__      			= max_span_width
             lowercase__      			= reader_layer_norm_eps
             lowercase__      			= reader_beam_size
             lowercase__      			= reader_seq_len

             # Retrieval config
             lowercase__      			= num_block_records
             lowercase__      			= searcher_beam_size




