def ipa_to_pinyin(s, accented=True):
if accented:<EOL><INDENT>function = _ipa_syllable_to_accented<EOL><DEDENT>else:<EOL><INDENT>function = _ipa_syllable_to_numbered<EOL><DEDENT>return _convert(s, _IPA_SYLLABLE, function)<EOL>
Convert all IPA syllables in *s* to Pinyin.

    If *accented* is ``True``, diacritics are added to the Pinyin syllables. If
    it's ``False``, numbers are used to indicate tone.