Return the mechanism's maximally-irreducible cause (|MIC|).

        Alias for |find_mice()| with ``direction`` set to |CAUSE|.
515749
def mic(self, mechanism, purviews=False):
        
        return self.find_mice(Direction.CAUSE, mechanism, purviews=purviews)
525782
def probability(self, direction, mechanism, purview):
        
        repertoire = self.repertoire(direction, mechanism, purview)

        return self.state_probability(direction, repertoire, purview)
464264
def get(self, key):
        
        mice = super().get(key)

        if mice is not None:  # Hit
            return mice

        # Try and get the key from the parent cache.
        if self.parent_subsystem_hash:
            parent_key = key.replace(str(self.subsystem_hash),
                                     str(self.parent_subsystem_hash), 1)
            mice = super().get(parent_key)

            if mice is not None and not mice.damaged_by_cut(self.subsystem):
                return mice

        return None
475239
def phi(self, mechanism, purview):
        """"""
        return min(self.phi_cause_mip(mechanism, purview),
                   self.phi_effect_mip(mechanism, purview))
561385
def _resolve(self):
        
        if self.src in (None, NONE):
            return None
        return self.ctx(src=self.src)
430272
def get_tc_device(self):
        

        if self.direction == TrafficDirection.OUTGOING:
            return self.device

        if self.direction == TrafficDirection.INCOMING:
            return self.ifb_device

        raise ParameterError(
            "unknown direction", expected=TrafficDirection.LIST, value=self.direction
        )
694839
def phi_effect_mip(self, mechanism, purview):
        
        mip = self.effect_mip(mechanism, purview)
        return mip.phi if mip else 0
1276444
def last_event(self):
        
        if self.mouse_event.last_event is None:
            return None
        ev = self.copy()
        ev.mouse_event = self.mouse_event.last_event
        return ev
366210
function() {
        var orderedCauses = [],
            totalConstantOccurences = [];

        for (var i = 0; i < this.causes.length; i++) {
            var cause = this.causes[i],
                constantOccurences = 0;
            if (!(cause.subject.indexOf('?') === 0)) {
                constantOccurences++;
            }
            if (!(cause.predicate.indexOf('?') === 0)) {
                constantOccurences++;
            }
            if (!(cause.object.indexOf('?') === 0)) {
                constantOccurences++;
            }
            totalConstantOccurences.push({
                cause: cause,
                constantOccurences: constantOccurences
            });
        }

        totalConstantOccurences = totalConstantOccurences.sort(function(a, b) {
            var x = a.constantOccurences; var y = b.constantOccurences;
            return ((x > y) ? -1 : ((x < y) ? 1 : 0));
        });

        for(var i = 0; i < totalConstantOccurences.length; i++) {
            orderedCauses.push(totalConstantOccurences[i].cause);
        }

        this.causes = orderedCauses;
    }
362308
def getMouse(self):
        
        # FIXME: this isn't working during an executing cell
        self.mouse_x.value = -1
        self.mouse_y.value = -1
        while self.mouse_x.value == -1 and self.mouse_y.value == -1:
            time.sleep(.1)
        return (self.mouse_x.value, self.mouse_y.value)
700512
def irreducible_effects(self):
        """"""
        return tuple(link for link in self
                     if link.direction is Direction.EFFECT)
472934
def compute_motor_command(self, m_ag):
        
        m_env = bounds_min_max(m_ag, self.conf.m_mins, self.conf.m_maxs)
        return m_env
739787
function() {
        if (this.explicit) {
            return this.valid;
        } else if (this.causedBy === undefined || this.causedBy.length == 0) {
            return undefined;
        } else {
            var valid,
                causes = this.causedBy,
                explicitFact;
            for (var i = 0; i < causes.length; i++) {
                valid = true;
                for (var j = 0; j < causes[i].length; j++) {
                    explicitFact = causes[i][j];
                    valid = valid && explicitFact.valid;
                }
                if (valid) {
                    return true;
                }
            }
            return false;
        }
    }
1190169
def effect_repertoire(self, mechanism, purview):
        """"""
        return self.repertoire(Direction.EFFECT, mechanism, purview)
332114
def find_actual_cause(self, mechanism, purviews=False):
        """"""
        return self.find_causal_link(Direction.CAUSE, mechanism, purviews)
735996
def null_concept(self):
        
        # Unconstrained cause repertoire.
        cause_repertoire = self.cause_repertoire((), ())
        # Unconstrained effect repertoire.
        effect_repertoire = self.effect_repertoire((), ())

        # Null cause.
        cause = MaximallyIrreducibleCause(
            _null_ria(Direction.CAUSE, (), (), cause_repertoire))
        # Null effect.
        effect = MaximallyIrreducibleEffect(
            _null_ria(Direction.EFFECT, (), (), effect_repertoire))

        # All together now...
        return Concept(mechanism=(),
                       cause=cause,
                       effect=effect,
                       subsystem=self)
1338496
def getCorrect(self, tolerance):
        
        return Numeric.add.reduce(Numeric.fabs(self.target - self.activation) < tolerance)