Hand Information
160373
def hand_record
      raise Pokerstats::HandHistoryParseError, "#{HAND_RECORD_INCOMPLETE_MESSAGE}: #{(HAND_INFORMATION_KEYS - @hand_information.keys).inspect}" unless (HAND_INFORMATION_KEYS - @hand_information.keys).empty?
      HAND_INFORMATION_KEYS.inject({}) do |hash, key| 
        hash.merge!(key => @hand_information[key])
      end
    end
1116783
def _objects_touch_each_other(self, object1: Object, object2: Object) -> bool:
        
        in_vertical_range = object1.y_loc <= object2.y_loc + object2.size and \
                            object1.y_loc + object1.size >= object2.y_loc
        in_horizantal_range = object1.x_loc <= object2.x_loc + object2.size and \
                            object1.x_loc + object1.size >= object2.x_loc
        touch_side = object1.x_loc + object1.size == object2.x_loc or \
                     object2.x_loc + object2.size == object1.x_loc
        touch_top_or_bottom = object1.y_loc + object1.size == object2.y_loc or \
                              object2.y_loc + object2.size == object1.y_loc
        return (in_vertical_range and touch_side) or (in_horizantal_range and touch_top_or_bottom)
959294
def _remaining_points(hands):
    '''
    
    '''
    points = []
    for hand in hands:
        points.append(sum(d.first + d.second for d in hand))

    return points
599595
public function getDescription()
	{
		$description = $this->description;

		if (null == $description) {
			$description = $this->getFingerprint();
		}

		return $description;
	}
620224
def _randomized_hands():
    '''
    
    '''
    all_dominoes = [dominoes.Domino(i, j) for i in range(7) for j in range(i, 7)]
    random.shuffle(all_dominoes)
    return [dominoes.Hand(all_dominoes[0:7]), dominoes.Hand(all_dominoes[7:14]),
            dominoes.Hand(all_dominoes[14:21]), dominoes.Hand(all_dominoes[21:28])]
601672
function (t){	
		t.gc.width(t.w);			//the grip's container width is updated				
		for(var i=0; i<t.ln; i++){	//for each column
			var c = t.c[i]; 			
			t.g[i].css({			//height and position of the grip is updated according to the table layout
				left: c.offset().left - t.offset().left + c.outerWidth(false) + t.cs / 2 + PX,
				height: t.opt.headerOnly? t.c[0].outerHeight(false) : t.outerHeight(false)				
			});			
		} 	
	}
716537
def _get_reference(self):
        
        super()._get_reference()
        self.cube_body_id = self.sim.model.body_name2id("cube")
        self.l_finger_geom_ids = [
            self.sim.model.geom_name2id(x) for x in self.gripper.left_finger_geoms
        ]
        self.r_finger_geom_ids = [
            self.sim.model.geom_name2id(x) for x in self.gripper.right_finger_geoms
        ]
        self.cube_geom_id = self.sim.model.geom_name2id("cube")
939400
def make_hand(str)
      ret = { "FU" => 0, "KY" => 0, "KE" => 0, "GI" => 0, "KI" => 0, "KA" => 0, "HI" => 0 }
      return ret if str.empty?

      str.gsub(/　$/, "").split("　").each do |kind|
        next if kind.empty?
        ret[kind2csa(kind[0])] = kind.length == 1 ? 1 : kan2n2(kind[1..-1])
      end

      ret
    end
683429
def _id(self):
        """"""
        return (self.__class__, self.number_of_needles, self.needle_positions,
                self.left_end_needle)
1123877
function announceDiscard(player, game) {
  game.announce('player:discard', {
    cards: Language.printCards(player.hand, game.language),
    player
  })
}
382958
function updateFinger (peerId, row) {
  var availablePeers = Object.keys(peerTable)
  availablePeers.splice(availablePeers.indexOf(peerId), 1)

  // if row hasn't been checked before
  if (!peerTable[peerId].fingers[row]) {
    peerTable[peerId].fingers[row] = {
      ideal: idealFinger(new Id(peerId), row).toHex(),
      current: undefined
    }
  }

  var best = availablePeers.shift()
  availablePeers.forEach((otherId) => {
    const isFBT = fingerBestFit(
        new Id(peerId),
        new Id(peerTable[peerId].fingers[row].ideal),
        new Id(best),
        new Id(otherId))
    if (isFBT) {
      best = otherId
    }
  })
  if (best === peerTable[peerId].fingers[row].current) {
    return // nevermind then
  }
  peerTable[peerId].fingers[row].current = best
  peerTable[peerId].socket.emit('we-update-finger', {
    row: row,
    id: best
  })
}
1129802
def Q(self):
        
        N = self.N
        tig_to_idx = self.tig_to_idx
        signs = self.signs
        Q = np.ones((N, N, BB), dtype=int) * -1  # Use -1 as the sentinel
        for (at, bt), k in self.contacts_oriented.items():
            if not (at in tig_to_idx and bt in tig_to_idx):
                continue
            ai = tig_to_idx[at]
            bi = tig_to_idx[bt]
            ao = signs[ai]
            bo = signs[bi]
            Q[ai, bi] = k[(ao, bo)]
        return Q
420701
function getGestureEventName (gesture, active) {
  var eventName;

  if (!gesture) { return; }

  eventName = EVENTS[gesture];
  if (eventName === 'grip') {
    return eventName + (active ? 'close' : 'open');
  }
  if (eventName === 'point' || eventName === 'thumb') {
    return eventName + (active ? 'up' : 'down');
  }
  if (eventName === 'pointing' || eventName === 'pistol') {
    return eventName + (active ? 'start' : 'end');
  }
  return;
}
1322785
function getFingerData( id ) {
			for(var i=0; i<fingerData.length; i++) {
				if(fingerData[i].identifier == id) {
					return fingerData[i];	
				}
			}
		}
590859
private void setHandsComp(int[] otherTiles, List<Mentsu> mentsuList) {
        System.arraycopy(otherTiles, 0, handsComp, 0, otherTiles.length);
        for (Mentsu mentsu : mentsuList) {
            int code = mentsu.getTile().getCode();

            if (mentsu.isOpen()) {
                isOpen = true;
            }

            if (mentsu instanceof Shuntsu) {
                handsComp[code - 1] += 1;
                handsComp[code] += 1;
                handsComp[code + 1] += 1;
            } else if (mentsu instanceof Kotsu) {
                handsComp[code] += 3;
            } else if (mentsu instanceof Kantsu) {
                handsComp[code] += 4;
            } else if (mentsu instanceof Toitsu) {
                handsComp[code] += 2;
            }
        }
    }
753634
def handshake(self):
        
        if self._socket is None:
            self._socket = self._connect()
        return self.call('handshake', {"Version": 1}, expect_body=False)
642589
function(time, x, y) {
		if(time - _gestureCheckSpeedTime > 50) {
			var o = _posPoints.length > 2 ? _posPoints.shift() : {};
			o.x = x;
			o.y = y; 
			_posPoints.push(o);
			_gestureCheckSpeedTime = time;
		}
	}