parameters: (when)
return_statement: return int(ms_since_epoch)
docstring: Converts a datetime.datetime to integer milliseconds since the epoch.
  
    Requires special handling to preserve microseconds.
  
    Args:
      when: A datetime.datetime instance.
  
    Returns:
      Integer time since the epoch in milliseconds. If the supplied 'when' is
      None, the return value will be None.
docstring_summary: Converts a datetime.datetime to integer milliseconds since the epoch.
docstring_tokens: Converts a datetime . datetime to integer milliseconds since the epoch .
function: def _get_timestamp_ms(when):
    """Converts a datetime.datetime to integer milliseconds since the epoch.
  
    Requires special handling to preserve microseconds.
  
    Args:
      when: A datetime.datetime instance.
  
    Returns:
      Integer time since the epoch in milliseconds. If the supplied 'when' is
      None, the return value will be None.
    """
    if when is None:
      return None
    ms_since_epoch = float(time.mktime(when.utctimetuple()) * 1000.0)
    ms_since_epoch += when.microsecond / 1000.0
    return int(ms_since_epoch)
function_tokens: def _get_timestamp_ms ( when ) : if when is None : return None ms_since_epoch = float ( time . mktime ( when . utctimetuple ( ) ) * 1000.0 ) ms_since_epoch += when . microsecond / 1000.0 return int ( ms_since_epoch )