handle <slot/> outlets
340088
function processSlotOutlet (el) {
  if (el.tag === 'slot') {
    el.slotName = getBindingAttr(el, 'name');
    if (el.key) {
      warn$1(
        "`key` does not work on <slot> because slots are abstract outlets " +
        "and can possibly expand into multiple elements. " +
        "Use the key on a wrapping element instead.",
        getRawBindingAttr(el, 'key')
      );
    }
  }
}
565147
def clamp(start, size, max_size)
      start += shift_vector(start)
      start -= shift_vector(max_size - (start + size))
      start
    end
895955
void tos_into_slot( int d, int n, String id ) {
    // In a copy-on-modify language, only update the local scope, or return val
    assert d==0 || (d==1 && _display[_tod]==n+1);
    int idx = _display[_tod-d]+n;
    // Temporary solution to kill a UDF from global name space. Needs to fix in the future.
    if (_tod == 0) ASTOp.removeUDF(id);
    subRef(_ary[idx], _key[idx]);
    subRef(_fcn[idx]);
    Frame fr =                   _ary[_sp-1];
    _ary[idx] = fr==null ? null : addRef(new Frame(fr));
    _d  [idx] =                  _d  [_sp-1] ;
    _str[idx] =                  _str[_sp-1] ;
    _fcn[idx] =           addRef(_fcn[_sp-1]);
    _key[idx] = d==0 && fr!=null ? id : null;
    // Temporary solution to add a UDF to global name space. Needs to fix in the future.
    if (_tod == 0 && _fcn[_sp-1] != null) ASTOp.putUDF(_fcn[_sp-1], id);
    assert _ary[0]== null || check_refcnt(_ary[0].anyVec());
  }
1285307
def slot_add_binding(self, slot_number, adapter):
        

        try:
            slot = self._slots[slot_number]
        except IndexError:
            raise DynamipsError('Slot {slot_number} does not exist on router "{name}"'.format(name=self._name, slot_number=slot_number))

        if slot is not None:
            current_adapter = slot
            raise DynamipsError('Slot {slot_number} is already occupied by adapter {adapter} on router "{name}"'.format(name=self._name,
                                                                                                                        slot_number=slot_number,
                                                                                                                        adapter=current_adapter))

        is_running = yield from self.is_running()

        # Only c7200, c3600 and c3745 (NM-4T only) support new adapter while running
        if is_running and not ((self._platform == 'c7200' and not str(adapter).startswith('C7200'))
                               and not (self._platform == 'c3600' and self.chassis == '3660')
                               and not (self._platform == 'c3745' and adapter == 'NM-4T')):
            raise DynamipsError('Adapter {adapter} cannot be added while router "{name}" is running'.format(adapter=adapter,
                                                                                                            name=self._name))

        yield from self._hypervisor.send('vm slot_add_binding "{name}" {slot_number} 0 {adapter}'.format(name=self._name,
                                                                                                         slot_number=slot_number,
                                                                                                         adapter=adapter))

        log.info('Router "{name}" [{id}]: adapter {adapter} inserted into slot {slot_number}'.format(name=self._name,
                                                                                                     id=self._id,
                                                                                                     adapter=adapter,
                                                                                                     slot_number=slot_number))

        self._slots[slot_number] = adapter

        # Generate an OIR event if the router is running
        if is_running:

            yield from self._hypervisor.send('vm slot_oir_start "{name}" {slot_number} 0'.format(name=self._name,
                                                                                                 slot_number=slot_number))

            log.info('Router "{name}" [{id}]: OIR start event sent to slot {slot_number}'.format(name=self._name,
                                                                                                 id=self._id,
                                                                                                 slot_number=slot_number))
874701
def elicit_slot!(slot_to_elicit, skip_render: false)
      directives << {
        type: "Dialog.ElicitSlot",
        slotToElicit: slot_to_elicit
      }

      if skip_render
        @slots_to_not_render_elicitation << slot_to_elicit
      end
    end
932480
private function callbackFactory(string $id, Slot $slot, callable $factory)
    {
        // count number of factory's args
        try{
            $refFunc = new \ReflectionFunction($factory);
            $cnt = count($refFunc->getParameters());
            $newInstance = null;
            switch($cnt){
                case 0:
                    // call factory with no parameters
                    $newInstance = $factory();
                    break;
                case 1:
                    // call factory with container
                    $newInstance = $factory($this);
                    break;
                case 2:
                default:
                    // create tmp slot
                    $tmp_slot = $slot ? clone($slot) : new Slot($id);
                    // call factory with container and slot
                    // factory can set component without restricting, because the new slot is not attached yet.
                    $newInstance = $factory($this,$tmp_slot);
                    // update slot
                    $this->slots[$id] = $tmp_slot;
                    break;
            }
        }
        catch(\ReflectionException $e)
        {
            throw new ContainerException('ReflectionFunction failed', $e);
        }
        return $newInstance;
    }
688761
def cluster_add_slots(self, slot, *slots):
        """"""
        slots = (slot,) + slots
        if not all(isinstance(s, int) for s in slots):
            raise TypeError("All parameters must be of type int")
        fut = self.execute(b'CLUSTER', b'ADDSLOTS', *slots)
        return wait_ok(fut)
893293
function itemChanged(slot) {
                    var itemNew = slot.itemNew;

                    if (!itemNew) {
                        return false;
                    }

                    var item = slot.item;

                    for (var property in item) {
                        switch (property) {
                            case "data":
                                // This is handled below
                                break;

                            default:
                                if (item[property] !== itemNew[property]) {
                                    return true;
                                }
                                break;
                        }
                    }

                    return (
                        listDataAdapter.compareByIdentity ?
                            item.data !== itemNew.data :
                            slot.signature !== itemSignature(itemNew)
                    );
                }
1026928
def handleCardDblClick( self, item ):
        
        widget = self.uiCardTREE.itemWidget(item, 0)
        if ( isinstance(widget, XAbstractCardWidget) ):
            self.emitRecordDoubleClicked(widget.record())
823682
def cluster_del_slots(self, slot, *slots):
        """"""
        slots = (slot,) + slots
        if not all(isinstance(s, int) for s in slots):
            raise TypeError("All parameters must be of type int")
        fut = self.execute(b'CLUSTER', b'DELSLOTS', *slots)
        return wait_ok(fut)
1183956
def slot_remove_nio_binding(self, slot_number, port_number):
        

        try:
            adapter = self._slots[slot_number]
        except IndexError:
            raise DynamipsError('Slot {slot_number} does not exist on router "{name}"'.format(name=self._name,
                                                                                              slot_number=slot_number))

        if adapter is None:
            raise DynamipsError("Adapter is missing in slot {slot_number}".format(slot_number=slot_number))

        if not adapter.port_exists(port_number):
            raise DynamipsError("Port {port_number} does not exist in adapter {adapter}".format(adapter=adapter,
                                                                                                port_number=port_number))

        yield from self.slot_disable_nio(slot_number, port_number)
        yield from self._hypervisor.send('vm slot_remove_nio_binding "{name}" {slot_number} {port_number}'.format(name=self._name,
                                                                                                                  slot_number=slot_number,
                                                                                                                  port_number=port_number))

        nio = adapter.get_nio(port_number)
        if nio is None:
            return
        yield from nio.close()
        adapter.remove_nio(port_number)

        log.info('Router "{name}" [{id}]: NIO {nio_name} removed from port {slot_number}/{port_number}'.format(name=self._name,
                                                                                                               id=self._id,
                                                                                                               nio_name=nio.name,
                                                                                                               slot_number=slot_number,
                                                                                                               port_number=port_number))

        return nio
500242
function onDrag( register, slot, args ) {
    const that = this;

    register( 'hammer.pan', function ( evt ) {
        if ( evt.isFinal ) return false;
        setHammerXY( that.$, evt );
        if ( typeof that._dragX === 'undefined' ) {
            that._dragX = evt.x;
            that._dragY = evt.y;
            that._dragStart = true;
        }
        setHammerVxVy.call( that, that.$, evt );
        const domEvt = evt.srcEvent;
        slot( {
            x: evt.x,
            y: evt.y,
            x0: evt.x0,
            y0: evt.y0,
            vx: evt.vx,
            vy: evt.vy,
            sx: evt.velocityX,
            sy: evt.velocityY,
            event: evt,
            target: evt.target,
            buttons: getButtons( evt ),
            preventDefault: domEvt.preventDefault.bind( domEvt ),
            stopPropagation: domEvt.stopImmediatePropagation.bind( domEvt )
        }, args );
        return true;
    } );
}
783763
def aliased_slot_name(self, slot: SLOT_OR_SLOTNAME) -> str:
        
        if isinstance(slot, str):
            slot = self.schema.slots[slot]
        return slot.alias if slot.alias else slot.name
152022
private function clean_slots(&$not_parallel_free, &$parallels_free) {
		$not_parallel_free = 0;
		$parallels_free = 0;
		for ($i = 0; $i < $this->max_processes; $i++) {
			// test if slot is used
			if ($this->processes[$i] >= 0) {
				$status = 0;
				// test if the process has finished (if true the freeing slot)
				$rc = pcntl_waitpid($this->processes[$i], $status, WNOHANG);
				if ($rc == $this->processes[$i]) {
					$this->free_slot($i);
					if ($i == 0) {
						$not_parallel_free++;
					} else {
						$parallels_free++;
					}
				}
//printf("[x]");
			} else {
				if ($i == 0) {
					$not_parallel_free++;
				} else {
					$parallels_free++;
				}
//printf("[ ]");
			}
		}
//printf("\n");
	}
903457
def slots_overlap(slot, other_slot):
    
    slot_ends_at = ends_at(slot)
    other_ends_at = ends_at(other_slot)
    if (slot.starts_at >= other_slot.starts_at and
        slot_ends_at <= other_ends_at
    ):
        return True
    if (other_slot.starts_at >= slot.starts_at and
        other_ends_at <= slot_ends_at
    ):
        return True
    return False
1357751
def connect(self, slot, *extra_args):
        
        slot = Slot(slot, *extra_args)
        self._functions.add(slot)
530900
def register(self, name, *slots):
        
        # setdefault initializes the object even if it exists. This is more efficient
        if name not in self:
            self[name] = Signal()

        for slot in slots:
            self[name].connect(slot)