Select a unit at a point.
164518
def select_point(action, action_space, select_point_act, screen):
  """"""
  select = spatial(action, action_space).unit_selection_point
  screen.assign_to(select.selection_screen_coord)
  select.type = select_point_act
729824
def start(self, value: typing.Union[float, NormPointType]) -> None:
        """"""
        self.set_property("start", value)
289834
def point(self, t):
        """"""
        return (1 - t)**2*self.start + 2*(1 - t)*t*self.control + t**2*self.end
877691
def round(self):
    """"""
    return Point(int(round(self.x)), int(round(self.y)))
896359
def _lazy_load_units_by_code():
  """"""
  if UNITS_BY_CODE:
    # already populated
    return

  for unit in units.UNITS_BY_NAME.values():
    UNITS_BY_CODE[unit.code] = unit
5288
def floor(self):
    """"""
    return Point(int(math.floor(self.x)), int(math.floor(self.y)))
158463
async def can_place(self, building: Union[AbilityData, AbilityId, UnitTypeId], position: Point2) -> bool:
        """"""

        assert isinstance(building, (AbilityData, AbilityId, UnitTypeId))

        if isinstance(building, UnitTypeId):
            building = self._game_data.units[building.value].creation_ability
        elif isinstance(building, AbilityId):
            building = self._game_data.abilities[building.value]

        r = await self._client.query_building_placement(building, [position])
        return r[0] == ActionResult.Success
100065
def selectge(table, field, value, complement=False):
    """"""

    value = Comparable(value)
    return selectop(table, field, value, operator.ge, complement=complement)
313584
def select(self, axis, index, force_copy: bool = False):
        """"""
        if axis == 0:
            if index == slice(None) and not force_copy:
                return self
            return self[index]
        else:
            raise ValueError("In Histogram1D.select(), axis must be 0.")
840632
async def build(self, building: UnitTypeId, near: Union[Point2, Point3], max_distance: int=20, unit: Optional[Unit]=None, random_alternative: bool=True, placement_step: int=2):
        """"""

        if isinstance(near, Unit):
            near = near.position.to2
        elif near is not None:
            near = near.to2
        else:
            return

        p = await self.find_placement(building, near.rounded, max_distance, random_alternative, placement_step)
        if p is None:
            return ActionResult.CantFindPlacementLocation

        unit = unit or self.select_build_worker(p)
        if unit is None or not self.can_afford(building):
            return ActionResult.Error
        return await self.do(unit.build(building, p))
168875
def selection(self):
        """"""
        sel = QtGui.QItemSelection()
        for index in self.selectedIndexes():
            sel.select(index, index)
        return sel
71391
def selecteq(table, field, value, complement=False):
    """"""

    return selectop(table, field, value, operator.eq, complement=complement)
458870
def point(self, x=None, y=None, z=None, m=None, shape=None, part=None, point=None, addr=None):
        """"""
        # shape, part, point
        if shape and part and point:
            try: self._shapes[shape]
            except IndexError: self._shapes.append([])
            try: self._shapes[shape][part]
            except IndexError: self._shapes[shape].append([])
            try: self._shapes[shape][part][point]
            except IndexError: self._shapes[shape][part].append([])
            p = self._shapes[shape][part][point]
            if x: p[0] = x
            if y: p[1] = y
            if z: p[2] = z
            if m: p[3] = m
            self._shapes[shape][part][point] = p
        # shape, part
        elif shape and part and not point:
            try: self._shapes[shape]
            except IndexError: self._shapes.append([])
            try: self._shapes[shape][part]
            except IndexError: self._shapes[shape].append([])
            points = self._shapes[shape][part]
            for i in range(len(points)):
                p = points[i]
                if x: p[0] = x
                if y: p[1] = y
                if z: p[2] = z
                if m: p[3] = m
                self._shapes[shape][part][i] = p
        # shape
        elif shape and not part and not point:
            try: self._shapes[shape]
            except IndexError: self._shapes.append([])

        # point
        # part
        if addr:
            shape, part, point = addr
            self._shapes[shape][part][point] = [x, y, z, m]
        else:
            Writer.point(self, x, y, z, m)
        if self.autoBalance:
            self.balance()
963814
public void select(int pos) {
        if (pos >= 0) {
            try {
                int line = getLineOfOffset(pos);
                Rectangle rect = modelToView(pos);
                if (rect == null) {
                    select(pos, pos);
                } else {
                    try {
                        Rectangle nrect =
                            modelToView(getLineStartOffset(line + 1));
                        if (nrect != null) {
                            rect = nrect;
                        }
                    } catch (Exception exc) {
                    }
                    JViewport vp = (JViewport)getParent();
                    Rectangle viewRect = vp.getViewRect();
                    if (viewRect.y + viewRect.height > rect.y) {
                        // need to scroll up
                        select(pos, pos);
                    } else {
                        // need to scroll down
                        rect.y += (viewRect.height - rect.height)/2;
                        scrollRectToVisible(rect);
                        select(pos, pos);
                    }
                }
            } catch (BadLocationException exc) {
                select(pos, pos);
                //exc.printStackTrace();
            }
        }
    }
978077
def spots_at(self, x, y):
        """"""
        for spot in self.spot.values():
            if spot.collide_point(x, y):
                yield spot
146630
def Move(self, units):
        '  '
        steps = units * self.SPU  # translate units to steps 
        if steps > 0:                                          # look for direction
            spi.SPI_write(self.CS, [0x40 | (~self.Dir & 1), 0x40 | (~self.Dir & 1)])       
        else:
            spi.SPI_write(self.CS, [0x40 | (self.Dir & 1), 0x40 | (self.Dir & 1)]) 
        steps = int(abs(steps))     
        spi.SPI_write(self.CS, [(steps >> 16) & 0xFF, (steps >> 16) & 0xFF])
        spi.SPI_write(self.CS, [(steps >> 8) & 0xFF, (steps >> 8) & 0xFF])
        spi.SPI_write(self.CS, [steps & 0xFF, steps & 0xFF])
1280389
def select(self, cb=None):
        '''
        
        '''
        if not self._enabled:
            self._enabled = True
            self.send_frame(MethodFrame(self.channel_id, 90, 10))
            self._select_cb.append(cb)
            self.channel.add_synchronous_cb(self._recv_select_ok)