Given a device name, return the corresponding interface object

def interface_by_name(self, name):
        '''
        Given a device name, return the corresponding interface object
        '''
        if name in self._devinfo:
            return self._devinfo[name]
        raise KeyError("No device named {}".format(name))