class_docstr: Locale implementation using the `gettext` module.
docstr: Allows to set context for translation, accepts plural forms.
  
  Usage example::
  
      pgettext("law", "right")
      pgettext("good", "right")
  
  Plural message example::
  
      pgettext("organization", "club", "clubs", len(clubs))
      pgettext("stick", "club", "clubs", len(clubs))
  
  To generate POT file with context, add following options to step 1
  of `load_gettext_translations` sequence::
  
      xgettext [basic options] --keyword=pgettext:1c,2 --keyword=pgettext:1c,2,3
  
  .. versionadded:: 4.2
docstr_tok: ["Allows","to","set","context","for","translation",",","accepts","plural","forms",".","Usage","example",":",":","pgettext","(","``","law","''",",","``","right","''",")","pgettext","(","``","good","''",",","``","right","''",")","Plural","message","example",":",":","pgettext","(","``","organization","''",",","``","club","''",",","``","clubs","''",",","len","(","clubs",")",")","pgettext","(","``","stick","''",",","``","club","''",",","``","clubs","''",",","len","(","clubs",")",")","To","generate","POT","file","with","context",",","add","following","options","to","step","1","of","`","load_gettext_translations","`","sequence",":",":","xgettext","[","basic","options","]","--","keyword=pgettext:1c,2","--","keyword=pgettext:1c,2,3","..","versionadded",":",":","4.2"]
code: def pgettext(
      self,
      context: str,
      message: str,
      plural_message: Optional[str] = None,
      count: Optional[int] = None,
  ) -> str:
      """Allows to set context for translation, accepts plural forms.
  
      Usage example::
  
          pgettext("law", "right")
          pgettext("good", "right")
  
      Plural message example::
  
          pgettext("organization", "club", "clubs", len(clubs))
          pgettext("stick", "club", "clubs", len(clubs))
  
      To generate POT file with context, add following options to step 1
      of `load_gettext_translations` sequence::
  
          xgettext [basic options] --keyword=pgettext:1c,2 --keyword=pgettext:1c,2,3
  
      .. versionadded:: 4.2
      """
      if plural_message is not None:
          assert count is not None
          msgs_with_ctxt = (
              "%s%s%s" % (context, CONTEXT_SEPARATOR, message),
              "%s%s%s" % (context, CONTEXT_SEPARATOR, plural_message),
              count,
          )
          result = self.ngettext(*msgs_with_ctxt)
          if CONTEXT_SEPARATOR in result:
              # Translation not found
              result = self.ngettext(message, plural_message, count)
          return result
      else:
          msg_with_ctxt = "%s%s%s" % (
              context,
              CONTEXT_SEPARATOR,
              message,
          )
          result = self.gettext(msg_with_ctxt)
          if CONTEXT_SEPARATOR in result:
              # Translation not found
              result = message
          return result
  
imports: import codecs
  import csv
  import datetime
  import gettext
  import glob
  import os
  import re
  from tornado import escape
  from tornado.log import gen_log
  from tornado._locale_data import LOCALE_NAMES
  from typing import Iterable, Any, Union, Dict, Optional
label_desc: Use image node_id 3 for calling the GettextLocale obj's underlying member method code with example usage: obj.pgettext(context, message, plural_message, count) and returns: result, result