def get_global_register_attributes(self, register_attribute, do_sort=True, **kwargs):
<EOL>try:<EOL><INDENT>names = iterable(kwargs.pop('<STR_LIT:name>'))<EOL><DEDENT>except KeyError:<EOL><INDENT>register_attribute_list = []<EOL><DEDENT>else:<EOL><INDENT>register_attribute_list = [self.global_registers[reg][register_attribute] for reg in names]<EOL><DEDENT>for keyword in kwargs.keys():<EOL><INDENT>allowed_values = iterable(kwargs[keyword])<EOL>try:<EOL><INDENT>register_attribute_list.extend(map(itemgetter(register_attribute), filter(lambda global_register: set(iterable(global_register[keyword])).intersection(allowed_values), self.global_registers.itervalues())))<EOL><DEDENT>except AttributeError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>if not register_attribute_list and filter(None, kwargs.itervalues()):<EOL><INDENT>raise ValueError('<STR_LIT>' % register_attribute)<EOL><DEDENT>if do_sort:<EOL><INDENT>return sorted(set(flatten_iterable(register_attribute_list)))<EOL><DEDENT>else:<EOL><INDENT>return flatten_iterable(register_attribute_list)<EOL><DEDENT>
Calculating register numbers from register names.

        Usage: get_global_register_attributes("attribute_name", name = [regname_1, regname_2, ...], addresses = 2)
        Receives: attribute name to be returned, dictionaries (kwargs) of register attributes and values for making cuts
        Returns: list of attribute values that matches dictionaries of attributes