def translate(self, term=None, phrase=None, strict=False, rating=None):
assert any((term, phrase)), '<STR_LIT>'<EOL>if phrase:<EOL><INDENT>phrase = phrase.replace('<STR_LIT:U+0020>', '<STR_LIT:->')<EOL><DEDENT>params = {'<STR_LIT:s>': (term or phrase)}<EOL>if rating:<EOL><INDENT>params.update({'<STR_LIT>': rating})<EOL><DEDENT>resp = self._fetch('<STR_LIT>', **params)<EOL>if resp['<STR_LIT:data>']:<EOL><INDENT>return GiphyImage(resp['<STR_LIT:data>'])<EOL><DEDENT>elif strict or self.strict:<EOL><INDENT>raise GiphyApiException(<EOL>"<STR_LIT>" %<EOL>(term or phrase))<EOL><DEDENT>
Retrieve a single image that represents a transalation of a term or
phrase into an animated gif. Punctuation is ignored. By default, this
will perform a `term` translation. If you want to translate by phrase,
use the `phrase` keyword argument.

:param term: Search term or terms
:type term: string
:param phrase: Search phrase
:type phrase: string
:param strict: Whether an exception should be raised when no results
:type strict: boolean
:param rating: limit results to those rated (y,g, pg, pg-13 or r).
:type rating: string