parameters: (sender)
docstring: Checks if there is a dialog matching this sender
      @param sender: Sender name, partial match is possible
      @type sender: basestring
      @return: A pair of ( dialog id, priority )
      @rtype: tuple of integer or None
docstring_summary: Checks if there is a dialog matching this sender
docstring_tokens: Checks if there is a dialog matching this sender
function: def get_dialog_by_sender(sender):
      """
      Checks if there is a dialog matching this sender
      @param sender: Sender name, partial match is possible
      @type sender: basestring
      @return: A pair of ( dialog id, priority )
      @rtype: tuple of integer or None
      """
      if not sender:
          return None
      try:
          dlg = models.RemoteDialog.objects.get(sender__icontains=sender)
          return dlg.id, dlg.priority
      except models.RemoteDialog.DoesNotExist:
          return None
function_tokens: def get_dialog_by_sender ( sender ) : if not sender : return None try : dlg = models . RemoteDialog . objects . get ( sender__icontains = sender ) return dlg . id , dlg . priority except models . RemoteDialog . DoesNotExist : return None