'Define a new alias after validating it.
This will raise an :exc:`AliasError` if there are validation
problems.'

def define_alias(self, name, cmd):

    caller = Alias(shell=self.shell, name=name, cmd=cmd)
    self.shell.magics_manager.register_function(caller, magic_kind='line', magic_name=name)
