Evaluates the board state from `source` and returns an iterable of
		Actions as a result.
188850
def evaluate(self, source):
		
		ret = self.check(source)
		if self._neg:
			ret = not ret
		if ret:
			if self._if:
				return self._if
		elif self._else:
			return self._else
1186621
def evaluate(self, global_state: GlobalState, post=False) -> List[GlobalState]:
        
        # Generalize some ops
        log.debug("Evaluating {}".format(self.op_code))
        op = self.op_code.lower()
        if self.op_code.startswith("PUSH"):
            op = "push"
        elif self.op_code.startswith("DUP"):
            op = "dup"
        elif self.op_code.startswith("SWAP"):
            op = "swap"
        elif self.op_code.startswith("LOG"):
            op = "log"

        instruction_mutator = (
            getattr(self, op + "_", None)
            if not post
            else getattr(self, op + "_" + "post", None)
        )

        if instruction_mutator is None:
            raise NotImplementedError

        if self.iprof is None:
            result = instruction_mutator(global_state)
        else:
            start_time = datetime.now()
            result = instruction_mutator(global_state)
            end_time = datetime.now()
            self.iprof.record(op, start_time, end_time)

        return result
197180
def get_implicit_deps(self):
        """"""
        result = []
        build_env = self.get_build_env()
        for act in self.get_action_list():
            deps = act.get_implicit_deps(self.get_all_targets(),
                                         self.get_all_sources(),
                                         build_env)
            result.extend(deps)
        return result
895219
def select_action(self, nb_actions, probs):
        
        action = np.random.choice(range(nb_actions), p=probs)
        return action
375556
private void evaluateState()
    {
        synchronized (this.callList)
        {
            // Get the highest prioirty state from the set of calls.
            PeerState newState = PeerState.NOTSET;
            for (CallTracker call : this.callList)
            {
                if (call.getState().getPriority() > newState.getPriority())
                    newState = call.getState();
            }

            this._state = newState;
        }
    }
1169964
def _process_actions(self, actions, inport, packet):
        '''
        
        '''
        second_stage = []
        for a in actions:
            fn = a(packet=packet, net=self._switchyard_net, controllers=self._controller_connections, inport=inport)
            if (fn):
                second_stage.append(fn)
        for fn in second_stage:
            fn()
452593
def extract_possible_actions(self, state_key):
        '''
        

        '''
        if state_key in self.__state_action_list_dict:
            return self.__state_action_list_dict[state_key]
        else:
            action_list = []
            state_key_list = [action_list.extend(self.__state_action_list_dict[k]) for k in self.__state_action_list_dict.keys() if len([s for s in state_key if s in k]) > 0]
            return action_list
95956
def actions(self, state):
        ''''''
        rows = string_to_list(state)
        row_e, col_e = find_location(rows, 'e')

        actions = []
        if row_e > 0:
            actions.append(rows[row_e - 1][col_e])
        if row_e < 2:
            actions.append(rows[row_e + 1][col_e])
        if col_e > 0:
            actions.append(rows[row_e][col_e - 1])
        if col_e < 2:
            actions.append(rows[row_e][col_e + 1])

        return actions
596968
def evaluate(grid):
    ""
    if is_won(grid): return -1
    succs = successors(grid)
    return -min(map(evaluate, succs)) if succs else 0
3190
def _do_policy_eval(tf_sess, to_eval, policies, active_episodes):
    

    eval_results = {}

    if tf_sess:
        builder = TFRunBuilder(tf_sess, "policy_eval")
        pending_fetches = {}
    else:
        builder = None

    if log_once("compute_actions_input"):
        logger.info("Inputs to compute_actions():\n\n{}\n".format(
            summarize(to_eval)))

    for policy_id, eval_data in to_eval.items():
        rnn_in_cols = _to_column_format([t.rnn_state for t in eval_data])
        policy = _get_or_raise(policies, policy_id)
        if builder and (policy.compute_actions.__code__ is
                        TFPolicyGraph.compute_actions.__code__):
            # TODO(ekl): how can we make info batch available to TF code?
            pending_fetches[policy_id] = policy._build_compute_actions(
                builder, [t.obs for t in eval_data],
                rnn_in_cols,
                prev_action_batch=[t.prev_action for t in eval_data],
                prev_reward_batch=[t.prev_reward for t in eval_data])
        else:
            eval_results[policy_id] = policy.compute_actions(
                [t.obs for t in eval_data],
                rnn_in_cols,
                prev_action_batch=[t.prev_action for t in eval_data],
                prev_reward_batch=[t.prev_reward for t in eval_data],
                info_batch=[t.info for t in eval_data],
                episodes=[active_episodes[t.env_id] for t in eval_data])
    if builder:
        for k, v in pending_fetches.items():
            eval_results[k] = builder.get(v)

    if log_once("compute_actions_result"):
        logger.info("Outputs of compute_actions():\n\n{}\n".format(
            summarize(eval_results)))

    return eval_results
867797
def snapshot(ctx, board, done):
    
    ctx.obj['board_id'] = board
    ts = TrelloStats(ctx.obj)
    Snapshot.create_table(fail_silently=True)
    done_id = ts.get_list_id_from_name(done)
    ct = cycle_time(ts, board, done)
    env = get_env()
    print render_text(env, **dict(cycle_time=ct))

    # Create snapshot
    print Snapshot.create(board_id=board, done_id=done_id, cycle_time=ct)
778235
def fromrepetitions(cls, iterable):
        
        d = cls()
        for key in iterable:
            d[key] = d[key] + 1 if key in d else 1
        return d
336138
def model_actions(self):
        
        observations = self.get('rollout:observations')
        model_action = self.model.action(observations)
        return model_action
852507
def state(self):
        
        return Emitter(weakref.proxy(self.lib), self.lib.jit_new_state())
1311593
def capture(board):
    
    game = Game()
    v = (0, 0)
    stub_actor = base.Actor('capture', v, v, v, v, v, v, v, v, v)
    root = base.State(board, stub_actor, stub_actor,
                      turn=1, actions_remaining=1)
    solution_node = None
    for eot in game.all_ends_of_turn(root):
        # check for a solution
        if eot.is_mana_drain:  # quick check before checking whole board
            if eot.parent.board.is_empty():
                solution_node = eot
                break
    # if solution found, build the list of swaps
    solution_sequence = list()  # empty sequence (no solution) by default
    if solution_node:
        node = solution_node
        while node:
            # record each swap in the path to the root
            if not isinstance(node, base.Swap):
                node = node.parent
                continue
            summary = base.Summary(node.parent.board, node.position_pair,
                                   None, None, None)
            solution_sequence.append(summary)
            node = node.parent
    return tuple(reversed(solution_sequence))
640655
def boards
      boards = Board.from_response client.get("/organizations/#{id}/boards/all")
      MultiAssociation.new(self, boards).proxy
    end
54016
def performAction(self, action):
        
        self._lastAction = []

        # Markups chosen for each generator.
        actions = self._allActions[action]

        n = self.numOffbids * len(self.generators)
        markups = actions[:n]
        withholds = actions[n:]

#        print "ALL ACTIONS:", self._allActions
#        print "ACTIONS:", markups, withholds

        self._offbid(markups, withholds)