Extracts the arms of the bandit if any.
510396
def get_bandit(self):
        
        arms_bandit = []
        for d in self.space:
            if d.type == 'bandit':
                arms_bandit += tuple(map(tuple, d.domain))
        return np.asarray(arms_bandit)
1303332
private function extractSnakes(array $v_save, $x, $y)
    {
        $snakes = array();
        for ($d = count($v_save) - 1; $x >= 0 && $y >= 0; $d--) {
            array_unshift($snakes, array($x, $y));

            $v = $v_save[$d];
            $k = $x - $y;

            if ($k === -$d || $k !== $d && $v[$k - 1] < $v[$k + 1]) {
                $k_prev = $k + 1;
            } else {
                $k_prev = $k - 1;
            }

            $x = $v[$k_prev];
            $y = $x - $k_prev;
        }

        return $snakes;
    }
1318049
def disarm(self, wait=True, timeout=None):
        '''
        '''
        self.armed = False

        if wait:
            self.wait_for(lambda: not self.armed, timeout=timeout,
                          errmsg='failed to disarm vehicle')
133440
def extract(self, item):
        

        article_candidates = []

        for extractor in self.extractor_list:
            article_candidates.append(extractor.extract(item))

        article_candidates = self.cleaner.clean(article_candidates)
        article = self.comparer.compare(item, article_candidates)

        item['article_title'] = article.title
        item['article_description'] = article.description
        item['article_text'] = article.text
        item['article_image'] = article.topimage
        item['article_author'] = article.author
        item['article_publish_date'] = article.publish_date
        item['article_language'] = article.language

        return item
642384
def bandit_session_convert!(exp, alt=nil, count=1)
      cookiename = "bandit_#{exp}".intern
      cookiename_converted = "bandit_#{exp}_converted".intern
      alt ||= cookies.signed[cookiename]
      unless alt.nil? or cookies.signed[cookiename_converted]
        Bandit.get_experiment(exp).convert!(alt, count)
        cookies.delete(cookiename)
      end
    end
1235450
function extractOp(position) {
  const firstPositionPiece = position.slice(0, position.indexOf('['));
  return (firstPositionPiece.substring(0, 1) === '$') ? firstPositionPiece : null;
}
1291273
def extract_possible_actions(self, state_key):
        '''
        

        '''
        x, y = state_key
        if self.__map_arr[y][x] == self.__wall_label:
            raise ValueError("It is the wall. (x, y)=(%d, %d)" % (x, y))

        around_map = [(x, y-1), (x, y+1), (x-1, y), (x+1, y)]
        possible_actoins_list = [(_x, _y) for _x, _y in around_map if self.__map_arr[_y][_x] != self.__wall_label and self.__map_arr[_y][_x] != self.__start_point_label]
        return possible_actoins_list
74735
def extract(self, pos, width):
        
        pos = operator.index(pos)
        width = operator.index(width)
        if width < 0:
            raise ValueError('width must not be negative')
        if pos < 0:
            raise ValueError('extracting out of range')
        return BinWord(width, self >> pos, trunc=True)
280547
def extract(self, destination):
        """"""
        with zipfile.ZipFile(self.archive, 'r') as zip_ref:
            zip_ref.extractall(destination)
217383
@Override
  public Object extractPeerObject() throws GeneralSecurityException {
    Preconditions.checkState(!isInProgress(), "Handshake is not complete.");
    return new AltsAuthContext(handshaker.getResult());
  }
302878
function equipFromInventory (attributes, index, slotName) {
        if (index >= attributes.inventory.length) {
            throw new InventoryIndexError(index);
        }

        var item = attributes.inventory[index];

        if (!slotName) {
            slotName = item.slot;
        }

        if (!slotName) {
            throw new UnequippableItemError(item.name);
        }

        if (!(slotName in attributes.equipped)) {
            throw new SlotNameError(slotName);
        }

        if (item.slot !== slotName) {
            throw new InvalidSlotError(item.slot, slotName);
        }

        if (!requirements.met(attributes, item.requirements)) {
            throw new RequirementsNotMetError();
        }

        if (attributes.equipped[slotName]) {
            unEquip(attributes, slotName);
        }

        attributes.inventory.splice(index, 1);
        attributes.equipped[slotName] = item;

        return attributes;
    }
380771
def update(self, bandit, payout):
        '''
        
        '''

        self.choices.append(bandit)
        self.pulls[bandit] += 1
        self.wins[bandit] += payout
        self.bandits.payouts[bandit] += payout
846286
def text_extract(path, password=None):
    """"""
    pdf = Info(path, password).pdf

    return [pdf.getPage(i).extractText() for i in range(pdf.getNumPages())]
379657
def extract(path, to_path='', ext='', **kwargs):
    
    Archive(path, ext=ext).extract(to_path, **kwargs)
1114007
def _extract_item(self, item):
        
        ver = 0
        if isinstance(item, tuple):
            ver_sent = True
            nitem = len(item)
            if nitem == 1:
                ext = item[0]
            elif nitem == 2:
                ext, ver = item
        else:
            ver_sent = False
            ext = item
        return ext, ver, ver_sent
136884
private Node<E> extract() {
		Node<E> current = head;
		head = head.next;

		current.item = head.item;
		head.item = null;

		return current;
	}
157621
def clip(arg, lower=None, upper=None):
    
    if lower is None and upper is None:
        raise ValueError("at least one of lower and " "upper must be provided")

    op = ops.Clip(arg, lower, upper)
    return op.to_expr()