Module Expr Str ImportFrom alias Import alias Import alias ImportFrom alias alias ImportFrom alias ImportFrom alias FunctionDef arguments args NameParam defaults body Expr Str FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Num If CompareEq NameLoad Str body Return Str orelse If CompareEq NameLoad Str body Return Str orelse If CompareEq NameLoad Str body Return Str Return NameLoad decorator_list Return Call AttributeLoad Call AttributeLoad NameLoad attr Str attr NameLoad SubscriptLoad NameLoad Slice Num Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str If CompareIn Str NameLoad body Assign NameStore Call AttributeLoad NameLoad attr If Call AttributeLoad NameLoad attr Str body Assign NameStore SubscriptLoad NameLoad Slice Num Assign NameStore Call NameLoad NameLoad NameLoad Return Call AttributeLoad Str attr NameLoad orelse Return Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad body Expr Str Assign NameStore Call NameLoad keyword NameLoad keyword NameLoad keyword NameLoad Assign NameStore ListLoad Num Assign NameStore ListLoad Num Assign NameStore ListLoad Assign NameStore ListLoad Assign NameStore ListLoad Assign NameStore ListLoad Assign NameStore ListLoad Assign NameStore ListLoad Assign NameStore ListLoad NameLoad Assign NameStore ListLoad Assign NameStore ListLoad NameLoad Assign NameStore ListLoad NameLoad Assign NameStore ListLoad NameLoad FunctionDef arguments args defaults body Expr Call AttributeLoad NameLoad attr If CompareGt Call NameLoad NameLoad Num body Assign NameStore Call NameLoad ListComp Call NameLoad NameLoad comprehension NameStore NameLoad orelse Assign NameStore Call NameLoad SubscriptLoad NameLoad Index Num If Call NameLoad NameLoad TupleLoad NameLoad NameLoad body Assign NameStore ListLoad For NameStore Call NameLoad AttributeLoad NameLoad attr body TryExcept body Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad handlers ExceptHandler type NameLoad body Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad Str Assign NameStore Call NameLoad ListComp Call NameLoad SubscriptLoad NameLoad Index Num comprehension NameStore NameLoad orelse Assign NameStore Call NameLoad SubscriptLoad SubscriptLoad NameLoad Index Num Index Num If NameLoad body Assign NameStore Call NameLoad Call AttributeLoad Str attr NameLoad orelse Assign NameStore NameLoad Assign NameStore Call NameLoad NameLoad NameLoad Call NameLoad NameLoad Call NameLoad NameLoad NameLoad NameLoad keyword BinOpAdd SubscriptLoad NameLoad Index Num Num keyword NameLoad If SubscriptLoad NameLoad Index Num body If UnaryOpNot NameLoad body Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad orelse Assign SubscriptStore NameLoad Index NameLoad NameLoad Delete SubscriptDel NameLoad Slice Delete SubscriptDel NameLoad Slice Delete SubscriptDel NameLoad Slice Delete SubscriptDel NameLoad Slice Delete SubscriptDel NameLoad Slice Delete SubscriptDel NameLoad Slice Delete SubscriptDel NameLoad Slice Assign SubscriptStore NameLoad Index Num NameLoad AugAssignAdd SubscriptStore NameLoad Index Num Num decorator_list FunctionDef arguments args NameParam NameParam defaults body If Call AttributeLoad NameLoad attr Str body Assign SubscriptStore NameLoad Index Num NameLoad Assign NameStore Call AttributeLoad SubscriptLoad NameLoad Slice Num attr Expr Call AttributeLoad NameLoad attr NameLoad orelse If Call AttributeLoad NameLoad attr Str body Assign SubscriptStore NameLoad Index Num NameLoad Assign SubscriptStore NameLoad Index Num NameLoad Assign NameStore Call AttributeLoad SubscriptLoad NameLoad Slice Num attr If NameLoad body Expr Call NameLoad Expr Call AttributeLoad NameLoad attr NameLoad orelse If Call AttributeLoad NameLoad attr Str body Assign SubscriptStore NameLoad Index Num NameLoad Assign SubscriptStore NameLoad Index Num NameLoad Assign NameStore Call AttributeLoad SubscriptLoad NameLoad Slice Num attr If Call AttributeLoad NameLoad attr Str body Assign TupleStore NameStore NameStore Call AttributeLoad SubscriptLoad NameLoad Slice Num attr Str Num Expr Call AttributeLoad NameLoad attr ListLoad Call NameLoad NameLoad Call AttributeLoad NameLoad attr orelse Expr Call AttributeLoad NameLoad attr ListLoad Num NameLoad orelse If Call AttributeLoad NameLoad attr Str body If NameLoad body Expr Call NameLoad Assign SubscriptStore NameLoad Index Num SubscriptStore NameLoad Index Num NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad SubscriptLoad NameLoad Slice Num attr orelse If Call AttributeLoad NameLoad attr Str body If SubscriptLoad NameLoad Index Num body AugAssignAdd SubscriptStore NameLoad Index Num BinOpAdd Str Call AttributeLoad NameLoad attr orelse If SubscriptLoad NameLoad Index Num body AugAssignAdd SubscriptStore SubscriptLoad NameLoad Index Num Index Num BinOpAdd Str Call AttributeLoad NameLoad attr orelse If SubscriptLoad NameLoad Index Num body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr decorator_list For TupleStore NameStore NameStore Call NameLoad Call AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr If UnaryOpNot Call NameLoad NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If Call AttributeLoad NameLoad attr Str body Assign SubscriptStore NameLoad Index Num SubscriptStore NameLoad Index Num NameLoad If BoolOpAnd NameLoad NameLoad body Expr Call NameLoad If Call AttributeLoad SubscriptLoad NameLoad Slice Num attr Str body For NameStore Call AttributeLoad Call AttributeLoad SubscriptLoad NameLoad Slice Num attr attr body Assign NameStore Call AttributeLoad NameLoad attr Str If CompareGtE NameLoad Num body TryExcept body Assign NameStore Call NameLoad SubscriptLoad NameLoad Slice BinOpAdd NameLoad Num handlers ExceptHandler type NameLoad body Continue Expr Call AttributeLoad NameLoad attr TupleLoad SubscriptLoad NameLoad Slice NameLoad NameLoad orelse Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad orelse If Call AttributeLoad SubscriptLoad NameLoad Slice Num attr Str body For NameStore Call AttributeLoad Call AttributeLoad SubscriptLoad NameLoad Slice Num attr attr Str body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr orelse If Call AttributeLoad SubscriptLoad NameLoad Slice Num attr Str body Assign SubscriptStore NameLoad Index Num NameLoad Expr Call NameLoad NameLoad Call AttributeLoad SubscriptLoad NameLoad Slice Num attr orelse If Call AttributeLoad SubscriptLoad NameLoad Slice Num attr Str body Assign NameStore Call AttributeLoad SubscriptLoad NameLoad Slice Num attr If NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad orelse Expr Call AttributeLoad NameLoad attr Call AttributeLoad SubscriptLoad NameLoad Slice Num attr orelse Expr Call NameLoad NameLoad NameLoad If NameLoad body Expr Call NameLoad orelse If BoolOpAnd UnaryOpNot SubscriptLoad NameLoad Index Num BoolOpOr NameLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr ListLoad Num Str Expr Call NameLoad Return NameLoad decorator_list Assign NameStore Call AttributeLoad NameLoad attr Str FunctionDef arguments args NameParam defaults body Expr Str Return BinOpMod Str Call AttributeLoad Call AttributeLoad Call AttributeLoad Call AttributeLoad Call AttributeLoad NameLoad attr Str Str attr Str Str attr Str Str attr Str Str attr Str Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Str Num body Expr Str If BoolOpAnd NameLoad CompareGt NameLoad Num body Assign NameStore Call NameLoad NameLoad Assign NameStore ListLoad For NameStore Call AttributeLoad NameLoad attr NameLoad body If CompareGt BinOpAdd Call NameLoad Call NameLoad NameLoad NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr While NameLoad body Assign NameStore ListLoad Assign NameStore Num While NameLoad body Assign NameStore BinOpAdd BinOpSub Call NameLoad Call NameLoad SubscriptLoad NameLoad Index Num Num NameLoad If CompareLt BinOpAdd NameLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AugAssignAdd NameStore NameLoad orelse If UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Break Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad orelse Expr Call AttributeLoad NameLoad attr NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareLtE Call NameLoad NameLoad Num body Return Call NameLoad NameLoad If BoolOpAnd NameLoad UnaryOpNot SubscriptLoad NameLoad Index Num body Delete SubscriptDel NameLoad Index Num AugAssignAdd SubscriptStore NameLoad Index Num Str Return BinOpAdd Str Call AttributeLoad Str attr ListComp BinOpAdd NameLoad Call NameLoad NameLoad comprehension NameStore NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults Num NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults Str body Return Call NameLoad NameLoad keyword NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults body If Call NameLoad NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults Str body If BoolOpAnd NameLoad CompareGt NameLoad Num body Assign NameStore NameLoad orelse Assign NameStore Num For NameStore Call NameLoad NameLoad NameLoad body Expr Call NameLoad BinOpMod Str TupleLoad NameLoad Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults Str body If Call NameLoad AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad body If AttributeLoad NameLoad attr body Expr Call NameLoad BinOpMod Str TupleLoad NameLoad Call NameLoad AttributeLoad NameLoad attr NameLoad Expr Call NameLoad BinOpMod Str TupleLoad NameLoad Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num NameLoad Expr Call NameLoad BinOpMod Str TupleLoad NameLoad Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num NameLoad For NameStore Call NameLoad AttributeLoad NameLoad attr body TryExcept body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad handlers ExceptHandler type NameLoad body Assign NameStore Str Expr Call NameLoad BinOpMod Str TupleLoad NameLoad NameLoad Call NameLoad NameLoad NameLoad orelse If AttributeLoad NameLoad attr body Expr Call NameLoad BinOpMod Str TupleLoad NameLoad Call NameLoad AttributeLoad NameLoad attr NameLoad Expr Call NameLoad BinOpMod Str TupleLoad NameLoad Call NameLoad AttributeLoad NameLoad attr NameLoad Expr Call NameLoad BinOpMod Str TupleLoad NameLoad Call NameLoad BoolOpOr AttributeLoad NameLoad attr Str NameLoad decorator_list Assign NameStore NameLoad If NameLoad body Assign NameStore Str orelse If NameLoad body Assign NameStore Str For NameStore Call NameLoad NameLoad keyword NameLoad body If UnaryOpNot AttributeLoad NameLoad attr body If NameLoad body Continue Assign NameStore AttributeLoad NameLoad attr If BoolOpAnd NameLoad CompareGt NameLoad Num body Assign NameStore ListLoad For NameStore Call AttributeLoad NameLoad attr body AugAssignAdd NameStore Call NameLoad NameLoad keyword NameLoad keyword Str Assign NameStore Call AttributeLoad Str attr NameLoad Expr Call NameLoad BinOpAdd NameLoad Str For NameStore AttributeLoad NameLoad attr body Expr Call NameLoad NameLoad For NameStore AttributeLoad NameLoad attr body Expr Call NameLoad NameLoad keyword Str If UnaryOpNot NameLoad body Assign NameStore ListLoad For TupleStore NameStore NameStore Call NameLoad AttributeLoad NameLoad attr body If NameLoad body Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str NameLoad orelse Expr Call AttributeLoad NameLoad attr BinOpMod Str Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str Expr Call NameLoad Call AttributeLoad Str attr NameLoad keyword Str If AttributeLoad NameLoad attr body Expr Call NameLoad BinOpMod Str Call AttributeLoad Str attr BinOpAdd ListLoad Str Call NameLoad AttributeLoad NameLoad attr If BoolOpAnd AttributeLoad NameLoad attr NameLoad body Expr Call NameLoad BinOpMod Str Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num keyword Str If CompareGt Call NameLoad AttributeLoad NameLoad attr Num body Expr Call NameLoad BinOpMod Str Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num keyword Str Expr Call NameLoad NameLoad Expr Call NameLoad Str If UnaryOpNot NameLoad body For NameStore Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad body For NameStore AttributeLoad NameLoad attr body Expr Call NameLoad NameLoad Expr Call NameLoad NameLoad keyword Str Expr Call NameLoad Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr orelse If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr keyword Lambda arguments args NameParam defaults AttributeLoad NameLoad attr Return NameLoad decorator_list
N/A N/A 
    babel.messages.pofile
    ~~~~~~~~~~~~~~~~~~~~~

    Reading and writing of files in the ``gettext`` PO (portable object)
    format.

    :copyright: (c) 2013 by the Babel Team.
    :license: BSD, see LICENSE for more details.
 __future__ print_function N/A os N/A re babel.messages.catalog Catalog Message babel.util wraptext babel._compat text_type unescape N/A N/A string N/A N/A N/A Reverse `escape` the given string.

    >>> print(unescape('"Say:\\n  \\"hello, world!\\"\\n"'))
    Say:
      "hello, world!"
    <BLANKLINE>

    :param string: the string to unescape
     replace_escapes N/A N/A match N/A N/A N/A m N/A N/A match group 1 N/A N/A m n N/A N/A N/A N/A N/A m t N/A N/A N/A N/A N/A m r N/A N/A N/A m N/A N/A N/A N/A N/A N/A re compile \\([\\trn"]) sub replace_escapes N/A string N/A 1 -1 N/A denormalize N/A N/A string N/A N/A N/A Reverse the normalization done by the `normalize` function.

    >>> print(denormalize(r'''""
    ... "Say:\n"
    ... "  \"hello, world!\"\n"'''))
    Say:
      "hello, world!"
    <BLANKLINE>

    >>> print(denormalize(r'''""
    ... "Say:\n"
    ... "  \"Lorem ipsum dolor sit "
    ... "amet, consectetur adipisicing"
    ... " elit, \"\n"'''))
    Say:
      "Lorem ipsum dolor sit amet, consectetur adipisicing elit, "
    <BLANKLINE>

    :param string: the string to denormalize
     N/A N/A string N/A N/A escaped_lines N/A N/A string splitlines N/A N/A N/A string startswith "" N/A N/A escaped_lines N/A escaped_lines N/A 1 N/A lines N/A map unescape escaped_lines N/A N/A N/A join lines N/A N/A N/A unescape string N/A read_po N/A N/A fileobj locale domain ignore_obsolete charset N/A None None False None N/A N/A Read messages from a ``gettext`` PO (portable object) file from the given
    file-like object and return a `Catalog`.

    >>> from datetime import datetime
    >>> from babel._compat import StringIO
    >>> buf = StringIO('''
    ... #: main.py:1
    ... #, fuzzy, python-format
    ... msgid "foo %(name)s"
    ... msgstr "quux %(name)s"
    ...
    ... # A user comment
    ... #. An auto comment
    ... #: main.py:3
    ... msgid "bar"
    ... msgid_plural "baz"
    ... msgstr[0] "bar"
    ... msgstr[1] "baaz"
    ... ''')
    >>> catalog = read_po(buf)
    >>> catalog.revision_date = datetime(2007, 4, 1)

    >>> for message in catalog:
    ...     if message.id:
    ...         print((message.id, message.string))
    ...         print(' ', (message.locations, sorted(list(message.flags))))
    ...         print(' ', (message.user_comments, message.auto_comments))
    (u'foo %(name)s', u'quux %(name)s')
      ([(u'main.py', 1)], [u'fuzzy', u'python-format'])
      ([], [])
    ((u'bar', u'baz'), (u'bar', u'baaz'))
      ([(u'main.py', 3)], [])
      ([u'A user comment'], [u'An auto comment'])

    .. versionadded:: 1.0
       Added support for explicit charset argument.

    :param fileobj: the file-like object to read the PO file from
    :param locale: the locale identifier or `Locale` object, or `None`
                   if the catalog is not bound to a locale (which basically
                   means it's a template)
    :param domain: the message domain
    :param ignore_obsolete: whether to ignore obsolete messages in the input
    :param charset: the character set of the catalog.
     N/A catalog N/A Catalog locale locale domain domain charset charset N/A counter N/A 0 N/A offset N/A 0 N/A messages N/A N/A translations N/A N/A locations N/A N/A flags N/A N/A user_comments N/A N/A auto_comments N/A N/A obsolete N/A False N/A context N/A N/A in_msgid N/A False N/A in_msgstr N/A False N/A in_msgctxt N/A False _add_message N/A N/A N/A N/A N/A N/A N/A translations sort N/A N/A N/A len messages 1 N/A N/A msgid N/A tuple N/A N/A denormalize m N/A m messages N/A N/A msgid N/A denormalize N/A messages N/A 0 N/A N/A isinstance msgid N/A list tuple N/A N/A string N/A N/A idx N/A range N/A catalog num_plurals N/A N/A N/A N/A N/A N/A string append N/A translations N/A idx N/A N/A N/A IndexError N/A N/A N/A N/A string append N/A idx N/A string N/A tuple N/A N/A denormalize N/A t N/A 1 N/A t string N/A N/A string N/A denormalize N/A N/A translations N/A 0 N/A 1 N/A context N/A N/A msgctxt N/A denormalize N/A N/A join context N/A N/A msgctxt None N/A message N/A Message msgid string N/A list locations N/A set flags auto_comments user_comments lineno N/A N/A offset N/A 0 1 context msgctxt N/A N/A obsolete N/A 0 N/A N/A N/A ignore_obsolete N/A N/A N/A N/A catalog obsolete N/A msgid message N/A N/A N/A catalog N/A msgid message N/A N/A messages N/A N/A N/A translations N/A N/A N/A context N/A N/A N/A locations N/A N/A N/A flags N/A N/A N/A auto_comments N/A N/A N/A user_comments N/A N/A N/A obsolete N/A 0 False N/A N/A counter N/A 0 1 N/A _process_message_line N/A N/A lineno line N/A N/A N/A N/A N/A line startswith msgid_plural N/A N/A N/A in_msgid N/A 0 True N/A msg N/A N/A N/A line N/A 12 lstrip N/A N/A N/A messages append msg N/A N/A N/A N/A line startswith msgid N/A N/A N/A in_msgid N/A 0 True N/A N/A offset N/A 0 lineno N/A txt N/A N/A N/A line N/A 5 lstrip N/A messages N/A N/A N/A _add_message N/A N/A N/A messages append txt N/A N/A N/A N/A line startswith msgstr N/A N/A N/A in_msgid N/A 0 False N/A N/A in_msgstr N/A 0 True N/A msg N/A N/A N/A line N/A 6 lstrip N/A N/A N/A msg startswith [ N/A N/A N/A idx msg N/A N/A N/A msg N/A 1 split ] 1 N/A N/A N/A translations append N/A N/A int idx N/A N/A msg lstrip N/A N/A N/A N/A translations append N/A 0 msg N/A N/A N/A N/A line startswith msgctxt N/A N/A messages N/A N/A N/A _add_message N/A N/A in_msgid N/A 0 N/A in_msgstr N/A 0 False N/A N/A N/A context append N/A N/A N/A line N/A 7 lstrip N/A N/A N/A N/A line startswith " N/A N/A N/A in_msgid N/A 0 N/A N/A N/A messages N/A -1 N/A N/A N/A line rstrip N/A N/A N/A in_msgstr N/A 0 N/A N/A N/A N/A translations N/A -1 N/A 1 N/A N/A N/A line rstrip N/A N/A N/A in_msgctxt N/A 0 N/A N/A N/A N/A context append N/A N/A line rstrip N/A N/A N/A lineno line N/A enumerate N/A N/A fileobj readlines N/A N/A line N/A N/A line strip N/A N/A N/A isinstance line text_type N/A N/A line N/A N/A line decode N/A catalog charset N/A N/A N/A line startswith # N/A N/A N/A in_msgid N/A 0 N/A in_msgstr N/A 0 False N/A N/A messages translations N/A N/A N/A _add_message N/A N/A N/A N/A line N/A 1 startswith : N/A N/A location N/A N/A N/A N/A N/A line N/A 2 lstrip split N/A N/A pos N/A N/A location rfind : N/A N/A pos 0 N/A N/A N/A N/A lineno N/A int N/A location N/A N/A pos 1 N/A N/A N/A ValueError N/A N/A N/A N/A N/A locations append N/A N/A location N/A pos lineno N/A N/A N/A N/A locations append N/A location None N/A N/A N/A N/A N/A line N/A 1 startswith , N/A N/A flag N/A N/A N/A N/A N/A line N/A 2 lstrip split , N/A N/A N/A N/A flags append N/A N/A flag strip N/A N/A N/A N/A N/A line N/A 1 startswith ~ N/A N/A N/A obsolete N/A 0 True N/A N/A _process_message_line lineno N/A N/A N/A line N/A 2 lstrip N/A N/A N/A N/A N/A line N/A 1 startswith . N/A N/A comment N/A N/A N/A line N/A 2 strip N/A comment N/A N/A N/A N/A auto_comments append comment N/A N/A N/A N/A user_comments append N/A N/A N/A line N/A 1 strip N/A N/A N/A _process_message_line lineno line N/A messages N/A N/A N/A _add_message N/A N/A N/A N/A N/A counter N/A 0 N/A flags user_comments auto_comments N/A N/A N/A N/A messages append N/A N/A N/A translations append N/A 0 N/A N/A _add_message N/A catalog N/A N/A WORD_SEP N/A N/A re compile (\s+|[^\s\w]*\w+[a-zA-Z]-(?=\w+[a-zA-Z])|(?<=[\w\!\"\'\&\.\,\?])-{2,}(?=\w)) escape N/A N/A string N/A N/A N/A Escape the given string so that it can be included in double-quoted
    strings in ``PO`` files.

    >>> escape('''Say:
    ...   "hello, world!"
    ... ''')
    '"Say:\\n  \\"hello, world!\\"\\n"'

    :param string: the string to escape
     N/A N/A "%s" N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A string replace \ \\ replace \t replace \r replace \n replace " \" N/A normalize N/A N/A string prefix width N/A 76 N/A N/A Convert a string into a format that is appropriate for .po files.

    >>> print(normalize('''Say:
    ...   "hello, world!"
    ... ''', width=None))
    ""
    "Say:\n"
    "  \"hello, world!\"\n"

    >>> print(normalize('''Say:
    ...   "Lorem ipsum dolor sit amet, consectetur adipisicing elit, "
    ... ''', width=32))
    ""
    "Say:\n"
    "  \"Lorem ipsum dolor sit "
    "amet, consectetur adipisicing"
    " elit, \"\n"

    :param string: the string to normalize
    :param prefix: a string that should be prepended to every line
    :param width: the maximum line width; use `None`, 0, or a negative number
                  to completely disable line wrapping
     N/A N/A width N/A width 0 N/A N/A prefixlen N/A len prefix N/A lines N/A N/A line N/A N/A string splitlines True N/A N/A N/A N/A N/A len N/A escape line prefixlen width N/A N/A chunks N/A N/A WORD_SEP split line N/A N/A N/A chunks reverse N/A chunks N/A N/A buf N/A N/A size 2 N/A chunks N/A N/A l N/A N/A N/A len N/A escape N/A chunks N/A -1 2 prefixlen N/A N/A N/A size l width N/A N/A N/A N/A buf append N/A N/A chunks pop N/A size l N/A N/A N/A buf N/A N/A N/A N/A buf append N/A N/A chunks pop N/A N/A N/A N/A lines append N/A N/A join buf N/A N/A N/A N/A lines append line N/A N/A lines N/A N/A string splitlines True N/A N/A N/A len lines 1 N/A N/A N/A escape string N/A N/A lines N/A N/A lines N/A -1 N/A N/A N/A lines N/A -1 N/A N/A lines N/A -1 N/A N/A ""
 N/A N/A join N/A N/A prefix N/A escape line N/A line lines N/A write_po N/A N/A fileobj catalog width no_location omit_header sort_output sort_by_file ignore_obsolete include_previous N/A 76 False False False False False False N/A N/A Write a ``gettext`` PO (portable object) template file for a given
    message catalog to the provided file-like object.

    >>> catalog = Catalog()
    >>> catalog.add(u'foo %(name)s', locations=[('main.py', 1)],
    ...             flags=('fuzzy',))
    <Message...>
    >>> catalog.add((u'bar', u'baz'), locations=[('main.py', 3)])
    <Message...>
    >>> from babel._compat import BytesIO
    >>> buf = BytesIO()
    >>> write_po(buf, catalog, omit_header=True)
    >>> print(buf.getvalue().decode("utf8"))
    #: main.py:1
    #, fuzzy, python-format
    msgid "foo %(name)s"
    msgstr ""
    <BLANKLINE>
    #: main.py:3
    msgid "bar"
    msgid_plural "baz"
    msgstr[0] ""
    msgstr[1] ""
    <BLANKLINE>
    <BLANKLINE>

    :param fileobj: the file-like object to write to
    :param catalog: the `Catalog` instance
    :param width: the maximum line width for the generated output; use `None`,
                  0, or a negative number to completely disable line wrapping
    :param no_location: do not emit a location comment for every message
    :param omit_header: do not include the ``msgid ""`` entry at the top of the
                        output
    :param sort_output: whether to sort the messages in the output by msgid
    :param sort_by_file: whether to sort the messages in the output by their
                         locations
    :param ignore_obsolete: whether to ignore obsolete messages and not include
                            them in the output; by default they are included as
                            comments
    :param include_previous: include the old msgid as a comment when
                             updating the catalog
     _normalize N/A N/A key prefix N/A N/A N/A N/A normalize key prefix prefix width width N/A _write N/A N/A text N/A N/A N/A N/A isinstance text text_type N/A N/A text N/A N/A text encode N/A catalog charset backslashreplace N/A N/A N/A fileobj write text N/A _write_comment N/A N/A comment prefix N/A N/A N/A N/A width N/A width 0 N/A N/A _width width N/A N/A _width 76 N/A line N/A wraptext comment _width N/A N/A N/A _write N/A #%s %s
 N/A prefix N/A N/A line strip N/A _write_message N/A N/A message prefix N/A N/A N/A N/A isinstance N/A message id N/A list tuple N/A N/A N/A message context N/A N/A N/A _write N/A %smsgctxt %s
 N/A prefix N/A _normalize N/A message context prefix N/A N/A _write N/A %smsgid %s
 N/A prefix N/A _normalize N/A N/A message id N/A 0 prefix N/A N/A _write N/A %smsgid_plural %s
 N/A prefix N/A _normalize N/A N/A message id N/A 1 prefix N/A idx N/A range N/A catalog num_plurals N/A N/A N/A N/A string N/A N/A message string N/A idx N/A N/A N/A IndexError N/A N/A string N/A N/A _write N/A %smsgstr[%d] %s
 N/A prefix idx N/A _normalize string prefix N/A N/A N/A message context N/A N/A N/A _write N/A %smsgctxt %s
 N/A prefix N/A _normalize N/A message context prefix N/A N/A _write N/A %smsgid %s
 N/A prefix N/A _normalize N/A message id prefix N/A N/A _write N/A %smsgstr %s
 N/A prefix N/A _normalize N/A N/A message string prefix N/A N/A sort_by None N/A sort_output N/A N/A sort_by message N/A N/A sort_by_file N/A N/A sort_by location N/A message N/A _sort_messages catalog sort_by sort_by N/A N/A N/A N/A message id N/A N/A omit_header N/A N/A N/A comment_header N/A catalog header_comment N/A N/A width N/A width 0 N/A N/A lines N/A N/A line N/A N/A comment_header splitlines N/A N/A lines N/A wraptext line width width subsequent_indent #  N/A comment_header N/A N/A join lines N/A N/A _write N/A comment_header N/A comment N/A message user_comments N/A N/A N/A _write_comment comment N/A comment N/A message auto_comments N/A N/A N/A _write_comment comment prefix . N/A N/A no_location N/A N/A locs N/A N/A N/A filename lineno N/A sorted N/A message locations N/A N/A lineno N/A N/A N/A N/A locs append N/A %s:%d N/A N/A N/A filename replace N/A os sep / lineno N/A N/A N/A N/A locs append N/A %s N/A N/A filename replace N/A os sep / N/A N/A _write_comment N/A N/A join locs prefix : N/A N/A message flags N/A N/A N/A _write N/A #%s
 N/A N/A ,  join N/A N/A N/A sorted N/A message flags N/A N/A N/A message previous_id include_previous N/A N/A N/A _write_comment N/A msgid %s N/A _normalize N/A N/A message previous_id N/A 0 prefix | N/A N/A N/A len N/A message previous_id 1 N/A N/A N/A _write_comment N/A msgid_plural %s N/A _normalize N/A N/A message previous_id N/A 1 prefix | N/A N/A _write_message message N/A N/A _write N/A N/A ignore_obsolete N/A N/A message N/A _sort_messages N/A N/A N/A catalog obsolete values sort_by sort_by N/A N/A comment N/A message user_comments N/A N/A N/A _write_comment comment N/A N/A _write_message message prefix #~  N/A N/A _write N/A _sort_messages N/A N/A messages sort_by N/A N/A N/A 
    Sort the given message iterable by the given criteria.

    Always returns a list.

    :param messages: An iterable of Messages.
    :param sort_by: Sort by which criteria? Options are `message` and `location`.
    :return: list[Message]
     N/A messages N/A list messages N/A N/A sort_by message N/A N/A N/A N/A messages sort N/A N/A N/A sort_by location N/A N/A N/A N/A messages sort key N/A N/A N/A m N/A N/A m locations N/A messages N/A