Nested dictionary containing the values of all condition
        sequences.

        See the documentation on property |HydPy.conditions| for further
        information.
3712
def conditions(self) -> Dict[str, Dict[str, Union[float, numpy.ndarray]]]:
        
        conditions = {}
        for subname in NAMES_CONDITIONSEQUENCES:
            subseqs = getattr(self, subname, ())
            subconditions = {seq.name: copy.deepcopy(seq.values)
                             for seq in subseqs}
            if subconditions:
                conditions[subname] = subconditions
        return conditions
637068
def _to_dict(self):
        
        if self.all_:
            return {"all": True}

        return {
            "keys": self.keys,
            "ranges": [keyrange._to_dict() for keyrange in self.ranges],
        }
125240
def to_dict(self):
        
        return {key: val.to_dict() if isinstance(val, NestedDict) else val
                for key, val in self.items()}
697270
def evaluate_conditionals_in_context (properties, context):
    
    if __debug__:
        from .property_set import PropertySet
        assert is_iterable_typed(properties, Property)
        assert isinstance(context, PropertySet)
    base = []
    conditional = []

    for p in properties:
        if p.condition:
            conditional.append (p)
        else:
            base.append (p)

    result = base[:]
    for p in conditional:

        # Evaluate condition
        # FIXME: probably inefficient
        if all(x in context for x in p.condition):
            result.append(Property(p.feature, p.value))

    return result
329380
def filter_sequences(self, seq_type):
        
        return DictList(x for x in self.sequences if isinstance(x, seq_type))
1209600
def _build_preconditions_table(self):
        ''''''
        self.local_action_preconditions = dict()
        self.global_action_preconditions = []
        action_fluents = self.action_fluents
        for precond in self.preconds:
            scope = precond.scope
            action_scope = [action for action in scope if action in action_fluents]
            if len(action_scope) == 1:
                name = action_scope[0]
                self.local_action_preconditions[name] = self.local_action_preconditions.get(name, [])
                self.local_action_preconditions[name].append(precond)
            else:
                self.global_action_preconditions.append(precond)
209609
def dict_of_lists(self):
        
        result = {}
        for key, value in self._items:
            if key in result:
                result[key].append(value)
            else:
                result[key] = [value]
        return result
210976
def _generate_conditions(self, map_slice):
        
        conditions = []
        for dim, dim_slice in zip(self.kdims, map_slice):
            if isinstance(dim_slice, slice):
                start, stop = dim_slice.start, dim_slice.stop
                if dim.values:
                    values = dim.values
                    dim_slice = slice(None if start is None else values.index(start),
                                      None if stop is None else values.index(stop))
                if dim_slice == slice(None):
                    conditions.append(self._all_condition())
                elif start is None:
                    conditions.append(self._upto_condition(dim_slice))
                elif stop is None:
                    conditions.append(self._from_condition(dim_slice))
                else:
                    conditions.append(self._range_condition(dim_slice))
            elif isinstance(dim_slice, (set, list)):
                if dim.values:
                    dim_slice = [dim.values.index(dim_val)
                                 for dim_val in dim_slice]
                conditions.append(self._values_condition(dim_slice))
            elif dim_slice is Ellipsis:
                conditions.append(self._all_condition())
            elif callable(dim_slice):
                conditions.append(dim_slice)
            elif isinstance(dim_slice, (tuple)):
                raise IndexError("Keys may only be selected with sets or lists, not tuples.")
            else:
                if dim.values:
                    dim_slice = dim.values.index(dim_slice)
                conditions.append(self._value_condition(dim_slice))
        return conditions
1183481
def iflatten_dict_values(node, depth=0):
    
    if isinstance(node, dict):
        _iter = (iflatten_dict_values(value) for value in six.itervalues(node))
        return util_iter.iflatten(_iter)
    else:
        return node
525217
def values(self, key_type=None):
        
        if(key_type is not None):
            all_items = {} # in order to preserve keys() type (dict_values for python3) 
            keys_used = set()
            direct_key = str(key_type)
            if direct_key in self.__dict__:
                for intermediate_key in self.__dict__[direct_key].values():
                    if not intermediate_key in keys_used:
                        all_items[intermediate_key] = self.items_dict[intermediate_key]
                        keys_used.add(intermediate_key)
            return all_items.values()
        else:
            return self.items_dict.values()
651712
def condition_from_code(condcode):
    """"""
    if condcode in __BRCONDITIONS:
        cond_data = __BRCONDITIONS[condcode]

        return {CONDCODE: condcode,
                CONDITION: cond_data[0],
                DETAILED: cond_data[1],
                EXACT: cond_data[2],
                EXACTNL: cond_data[3],
                }
    return None
224265
def conditions
      key = self.key
      if key
        model.key_conditions(repository, key)
      else
        conditions = {}
        properties.each do |property|
          next unless property.loaded?(self)
          conditions[property] = property.get!(self)
        end
        conditions
      end
    end
462718
def keys_in_dict(d, parent_key, keys):
    
    for key, value in d.iteritems():
        if isinstance(value, dict):
            keys_in_dict(value, key, keys)
        else:
            if parent_key:
                prefix = parent_key + "."
            else:
                prefix = ""

            keys.append(prefix + key)

    return keys
389829
def compile_patterns_in_dictionary(dictionary):
    
    for key, value in dictionary.items():
        if isinstance(value, str):
            dictionary[key] = re.compile(value)
        elif isinstance(value, dict):
            compile_patterns_in_dictionary(value)
    return dictionary
437650
def inner_join_impl(other, sequence):
    
    seq_dict = {}
    for element in sequence:
        seq_dict[element[0]] = element[1]
    seq_kv = seq_dict
    other_kv = dict(other)
    keys = seq_kv.keys() if len(seq_kv) < len(other_kv) else other_kv.keys()
    result = {}
    for k in keys:
        if k in seq_kv and k in other_kv:
            result[k] = (seq_kv[k], other_kv[k])
    return six.viewitems(result)
381033
def _asdict(self):
    """"""
    # Start with any default values we have, and override with loaded values,
    # and then override with flag values.
    retval = {key: self._declarations[key].default_value for
              key in self._declarations if self._declarations[key].has_default}
    retval.update(self._loaded_values)
    # Only update keys that are declared so we don't allow injecting
    # un-declared keys via commandline flags.
    for key, value in self._modules['six'].iteritems(self._flag_values):
      if key in self._declarations:
        retval[key] = value
    return retval
1141117
def dict_values(src):
    
    for v in src.values():
        if isinstance(v, dict):
            for v in dict_values(v):
                yield v
        else:
            yield v