Accept list of record_set_group dicts.
        Return list of record_set_group objects.
779590
def create_record_set_groups(self, record_set_group_dicts):
        """"""
        record_set_groups = []
        for name, group in record_set_group_dicts.iteritems():
            # pop removes the 'Enabled' key and tests if True.
            if group.pop('Enabled', True):
                record_set_groups.append(
                    self.create_record_set_group(name, group)
                )
        return record_set_groups
552661
def collectRecords(self, parent=None):
        
        out = []
        if not parent:
            for i in range(self.topLevelItemCount()):
                item = self.topLevelItem(i)
                try:
                    out.append(item.record())
                except AttributeError:
                    pass
                
                out += self.collectRecords(item)
        else:
            for c in range(parent.childCount()):
                item = parent.child(c)
                try:
                    out.append(item.record())
                except AttributeERror:
                    pass
                
                out += self.collectRecords(item)
        
        return out
218146
def recordset(method):
        """"""
        def wrapper(self, *args, **kwargs):
            if self.__records__ is None:
                raise ValidationError(
                    'There are no records in the set.',
                )
            return method(self, *args, **kwargs)
        return Api.model(wrapper)
413276
def convert(cls, record):
        
        if isinstance(record, list):
            return [cls._convert(r) for r in record]
        else:
            return [cls._convert(record)]
276920
def capture_delete_records(records):
    """"""
    for rec in records:
        model = create_delete_model(rec)
        if model:
            try:
                model.delete(condition=(CurrentSecurityGroupModel.eventTime <= rec['detail']['eventTime']))
            except DeleteError:
                LOG.warning(f'[X] Unable to delete security group. Security group does not exist. Record: {rec}')
        else:
            LOG.warning(f'[?] Unable to delete security group. Security group does not exist. Record: {rec}')
951808
def _group(self, group_data):
        
        if isinstance(group_data, dict):
            # get xid from dict
            xid = group_data.get('xid')
        else:
            # get xid from object
            xid = group_data.xid

        if self.groups.get(xid) is not None:
            # return existing group from memory
            group_data = self.groups.get(xid)
        elif self.groups_shelf.get(xid) is not None:
            # return existing group from shelf
            group_data = self.groups_shelf.get(xid)
        else:
            # store new group
            self.groups[xid] = group_data
        return group_data
1240889
def records(self):
        
        import ns1.rest.records
        return ns1.rest.records.Records(self.config)
288306
def create_record_set(self, rs_dict):
        """"""
        record_set_md5 = get_record_set_md5(rs_dict["Name"], rs_dict["Type"])
        rs = route53.RecordSetType.from_dict(record_set_md5, rs_dict)
        rs = add_hosted_zone_id_if_missing(rs, self.hosted_zone_id)
        rs = self.add_hosted_zone_id_for_alias_target_if_missing(rs)
        return self.template.add_resource(rs)
476785
def capture_update_records(records):
    """"""
    for rec in records:
        data = cloudwatch.get_historical_base_info(rec)
        group = describe_group(rec, cloudwatch.get_region(rec))

        if len(group) > 1:
            raise Exception(f'[X] Multiple groups found. Record: {rec}')

        if not group:
            LOG.warning(f'[?] No group information found. Record: {rec}')
            continue

        group = group[0]

        # Determine event data for group - and pop off items that are going to the top-level:
        LOG.debug(f'Processing group. Group: {group}')
        data.update({
            'GroupId': group['GroupId'],
            'GroupName': group.pop('GroupName'),
            'VpcId': group.pop('VpcId', None),
            'arn': get_arn(group.pop('GroupId'), cloudwatch.get_region(rec), group.pop('OwnerId')),
            'Region': cloudwatch.get_region(rec)
        })

        data['Tags'] = pull_tag_dict(group)

        # Set the remaining items to the configuration:
        data['configuration'] = group

        # Set the version:
        data['version'] = VERSION

        LOG.debug(f'[+] Writing Dynamodb Record. Records: {data}')
        current_revision = CurrentSecurityGroupModel(**data)
        current_revision.save()
847553
def group_records_by_type(records, update_events):
    
    update_records, delete_records = [], []
    for record in records:
        if record.get("detail-type", "") == "Scheduled Event":
            LOG.error("[X] Received a Scheduled Event in the Queue... Please check that your environment is set up"
                      " correctly.")
            continue

        # Ignore SQS junk messages (like subscription notices and things):
        if not record.get("detail"):
            continue

        # Do not capture error events:
        if not record["detail"].get("errorCode"):
            if record['detail']['eventName'] in update_events:
                update_records.append(record)
            else:
                delete_records.append(record)

    return update_records, delete_records
498697
def group_attrib(self):
        '''
        
        '''
        group_attributes = [g.attrib for g in self.dataset.groups if self in g]
        if group_attributes:
            return concat_namedtuples(*group_attributes)
352499
def get_pdb_sets(self):
        ''''''

        assert(self.id != None)

        data = []
        for pdb_set in self.pdb_sets:

            pdb_set_record = dict(
                PPComplexID = self.id,
                SetNumber = pdb_set['set_number'],
                IsComplex = pdb_set['is_complex'],
                Notes = pdb_set['notes'],
            )

            chain_records = []
            for side, chain_details in sorted(pdb_set['chains'].iteritems()):
                chain_records.append(dict(
                    PPComplexID = self.id,
                    SetNumber = pdb_set['set_number'],
                    Side = side,
                    ChainIndex = chain_details['chain_index'],
                    PDBFileID = chain_details['pdb_file_id'],
                    Chain = chain_details['chain_id'],
                    NMRModel = chain_details['nmr_model'],
                ))

            data.append(dict(pdb_set = pdb_set_record, chain_records = chain_records))

        return data
81099
def selectedRecords(self):
        
        output = []
        for item in self.selectedItems():
            if ( isinstance(item, XOrbRecordItem) ):
                output.append(item.record())
        return output
1121659
def recordSet( self ):
        
        if ( not self.table() ):
            return None
        
        recordSet = RecordSet(self.table())
        recordSet.setQuery(self.query())
        
        # set the grouping options
        grouping = nativestring(self.uiGroupingTXT.text()).split(',')
        while ( '' in grouping ):
            grouping.remove('')
        
        recordSet.setGroupBy( grouping )
        
        # set the sorting options
        sorting = nativestring(self.uiSortingTXT.text()).split(',')
        while ( '' in sorting ):
            sorting.remove('')
        
        recordSet.setOrder([i.split('|') for i in sorting])
        
        # set the paged options
        recordSet.setPaged(self.uiPagedCHK.isChecked())
        recordSet.setPageSize(self.uiPagedSPN.value())
        
        return recordSet
296707
def get_all(self, uids: Iterable[int]) -> Mapping[int, Record]:
        
        return {uid: self._records[uid] for uid in uids
                if uid in self._records}
1238935
def to_record_per_alt(self):
        ''''''
        record_list = []
        for alt in self.ALT:
            record_list.append(copy.copy(self))
            record_list[-1].ALT = [alt]
        return record_list
1143788
def list_records(self, rtype=None, name=None, content=None, **kwargs):
        

        if not rtype and kwargs.get('type'):
            warnings.warn('Parameter "type" is deprecated, use "rtype" instead.',
                          DeprecationWarning)
            rtype = kwargs.get('type')

        return self._list_records(rtype=rtype, name=name, content=content)