def search_for_devices_by_serial_number(self, sn):
import re<EOL>sn_search = re.compile(sn)<EOL>matches = []<EOL>for dev_o in self.get_all_devices_in_portal():<EOL><INDENT>try:<EOL><INDENT>if sn_search.match(dev_o['<STR_LIT>']):<EOL><INDENT>matches.append(dev_o)<EOL><DEDENT><DEDENT>except TypeError as err:<EOL><INDENT>print("<STR_LIT>".format(<EOL>dev_o['<STR_LIT:info>']['<STR_LIT:description>']['<STR_LIT:name>'],<EOL>str(err)))<EOL><DEDENT><DEDENT>return matches<EOL>
Returns a list of device objects that match the serial number
in param 'sn'.

This will match partial serial numbers.