#NEWLINE# @ classmethod #NEWLINE# def FromMillis( cls , timeout_ms ) : #NEWLINE# #INDENT# 'Create a new PolledTimeout if needed.\n\n    If timeout_ms is already a PolledTimeout, just return it, otherwise create a\n    new PolledTimeout with the given timeout in milliseconds.\n\n    Args:\n      timeout_ms: PolledTimeout object, or number of milliseconds to use for\n        creating a new one.\n\n    Returns:\n      A PolledTimeout object that will expire in timeout_ms milliseconds, which\n    may be timeout_ms itself, or a newly allocated PolledTimeout.\n    ' #NEWLINE# if hasattr ( timeout_ms , 'HasExpired' ) : #NEWLINE# #INDENT# return timeout_ms #NEWLINE# #UNINDENT# if ( timeout_ms is None ) : #NEWLINE# #INDENT# return cls ( None ) #NEWLINE# #UNINDENT# return cls ( ( timeout_ms / 1000.0 ) )