Extracts the modification operation(s) from the map.

        :rtype: list, None
546637
def to_op(self):
        
        removes = [('remove', r) for r in self._removes]
        value_updates = list(self._extract_updates(self._value))
        new_updates = list(self._extract_updates(self._updates))
        all_updates = removes + value_updates + new_updates
        if all_updates:
            return all_updates
        else:
            return None
747933
def _convert_method_settings_into_operations(method_settings=None):
    
    # operations docs here: https://tools.ietf.org/html/rfc6902#section-4
    operations = []
    if method_settings:
        for method in method_settings.keys():
            for key, value in method_settings[method].items():
                if isinstance(value, bool):
                    if value:
                        value = 'true'
                    else:
                        value = 'false'
                operations.append({
                    'op': 'replace',
                    'path': method + _resolve_key(key),
                    'value': value
                })
    return operations
1151113
private Map<UUID, Long> getExtendedAttributes(AttributeUpdaterOperation operation) {
        Collection<AttributeUpdate> updates = operation.getAttributeUpdates();
        if (updates == null) {
            return Collections.emptyMap();
        }

        return updates.stream()
                .filter(au -> !Attributes.isCoreAttribute(au.getAttributeId()))
                .collect(Collectors.toMap(AttributeUpdate::getAttributeId, AttributeUpdate::getValue));
    }
1073122
public java.util.List<ModificationState> getModificationStates() {
        if (modificationStates == null) {
            modificationStates = new com.amazonaws.internal.SdkInternalList<ModificationState>();
        }
        return modificationStates;
    }
1212854
def export_modifications(self):
        
        if self.__modified_data__ is not None:
            return self.export_data()

        result = {}

        for key, value in enumerate(self.__original_data__):
            try:
                if not value.is_modified():
                    continue
                modifications = value.export_modifications()
            except AttributeError:
                continue

            try:
                result.update({'{}.{}'.format(key, f): v for f, v in modifications.items()})
            except AttributeError:
                result[key] = modifications

        return result
1190688
def op_get_mutate_fields( op_name ):
    
    global MUTATE_FIELDS

    if op_name not in MUTATE_FIELDS.keys():
        raise Exception("No such operation '%s'" % op_name)

    fields = MUTATE_FIELDS[op_name][:]
    return fields
306097
def modify(self, dn: str, mod_list: dict) -> None:
        

        return self._do_with_retry(lambda obj: obj.modify_s(dn, mod_list))
363046
def get_active_modifiers(self):
        
        keys = ctypes.pointer(charcodemap_t())
        nkeys = ctypes.c_int(0)

        _libxdo.xdo_get_active_modifiers(
            self._xdo, ctypes.byref(keys), ctypes.byref(nkeys))
        return [keys[i] for i in range(nkeys.value)]
840079
def fields(self):
        ''''''
        out = dict()
        for operator in self.ops:
            out.update(**operator.fields)

        return out
1170365
def operations_map(self):
        # type: () -> Dict[Union[str, None], str]
        
        document_ast = self.document_ast
        operations = {}  # type: Dict[Union[str, None], str]
        for definition in document_ast.definitions:
            if isinstance(definition, ast.OperationDefinition):
                if definition.name:
                    operations[definition.name.value] = definition.operation
                else:
                    operations[None] = definition.operation

        return operations
502816
def _extract_mod_from_feature(mf):
        """"""
        # ModificationFeature / SequenceModificationVocabulary
        mf_type = mf.getModificationType()
        if mf_type is None:
            return None
        mf_type_terms = mf_type.getTerm().toArray()
        known_mf_type = None
        for t in mf_type_terms:
            if t.startswith('MOD_RES '):
                t = t[8:]
            mf_type_indra = _mftype_dict.get(t)
            if mf_type_indra is not None:
                known_mf_type = mf_type_indra
                break
        if not known_mf_type:
            logger.debug('Skipping modification with unknown terms: %s' %
                        ', '.join(mf_type_terms))
            return None

        mod_type, residue = known_mf_type

        # getFeatureLocation returns SequenceLocation, which is the
        # generic parent class of SequenceSite and SequenceInterval.
        # Here we need to cast to SequenceSite in order to get to
        # the sequence position.
        mf_pos = mf.getFeatureLocation()
        if mf_pos is not None:
            # If it is not a SequenceSite we can't handle it
            if not mf_pos.modelInterface.getName() == \
                'org.biopax.paxtools.model.level3.SequenceSite':
                mod_pos = None
            else:
                mf_site = cast(_bp('SequenceSite'), mf_pos)
                mf_pos_status = mf_site.getPositionStatus()
                if mf_pos_status is None:
                    mod_pos = None
                elif mf_pos_status and mf_pos_status.toString() != 'EQUAL':
                    logger.debug('Modification site position is %s' %
                                mf_pos_status.toString())
                else:
                    mod_pos = mf_site.getSequencePosition()
                    mod_pos = '%s' % mod_pos
        else:
            mod_pos = None
        mc = ModCondition(mod_type, residue, mod_pos, True)
        return mc
622383
def update_effects(self, node):
    
    return [self.combine(node.args[0], node_args_k, register=True,
                         aliasing_type=True)
            for node_args_k in node.args[1:]]
665990
def to_dict(self, omit=()):
        
        result = dict(self)
        for key in omit:
            if key in result:
                del result[key]
        return result
1216343
def get_diff(self, other_mapping):
        
        result = MultiField(name=self.name)
        new_fields = set(self.fields.keys())
        if not isinstance(other_mapping, MultiField):
            n_mapping = MultiField(name=self.name)
            n_mapping.add_fields([other_mapping])
            other_mapping = n_mapping

        old_fields = set(other_mapping.fields.keys())
        #we propagate new fields
        added = new_fields - old_fields
        if added:
            result.add_fields([(add, self.fields[add]) for add in added])
            #TODO: raise in field changed
        if len(result.fields) > 0:
            return result
        return None
344388
def changed(self):
        '''
        
        '''
        def _changed(diffs, prefix):
            keys = []
            for key in diffs.keys():
                if not isinstance(diffs[key], dict):
                    continue

                if isinstance(diffs[key], dict) and 'old' not in diffs[key]:
                    keys.extend(_changed(diffs[key],
                                       prefix='{0}{1}.'.format(prefix, key)))
                    continue
                if self.ignore_unset_values:
                    if 'old' in diffs[key] and 'new' in diffs[key] and \
                            diffs[key]['old'] != self.NONE_VALUE and \
                            diffs[key]['new'] != self.NONE_VALUE:
                        if isinstance(diffs[key]['new'], dict):
                            keys.extend(
                                _changed(diffs[key]['new'],
                                         prefix='{0}{1}.'.format(prefix, key)))
                        else:
                            keys.append('{0}{1}'.format(prefix, key))
                    elif isinstance(diffs[key], dict):
                        keys.extend(
                            _changed(diffs[key],
                                     prefix='{0}{1}.'.format(prefix, key)))
                else:
                    if 'old' in diffs[key] and 'new' in diffs[key]:
                        if isinstance(diffs[key]['new'], dict):
                            keys.extend(
                                _changed(diffs[key]['new'],
                                         prefix='{0}{1}.'.format(prefix, key)))
                        else:
                            keys.append('{0}{1}'.format(prefix, key))
                    elif isinstance(diffs[key], dict):
                        keys.extend(
                            _changed(diffs[key],
                                     prefix='{0}{1}.'.format(prefix, key)))

            return keys

        return sorted(_changed(self._diffs, prefix=''))
1190977
def modified(self):
        '''
        
        '''
        try:
            dt = datetime.datetime.fromtimestamp(self.stats.st_mtime)
            return dt.strftime('%Y.%m.%d %H:%M:%S')
        except OSError:
            return None
326002
def export_modified_data(self):
        
        # TODO: why None? Try to get a better flag
        result = {key: None for key in self.__deleted_fields__}

        for key, value in self.__modified_data__.items():
            if key in result.keys():
                continue
            try:
                result[key] = value.export_modified_data()
            except AttributeError:
                result[key] = value

        for key, value in self.__original_data__.items():
            if key in result.keys():
                continue
            try:
                if value.is_modified():
                    result[key] = value.export_modified_data()
            except AttributeError:
                pass

        return result