Equivalent to the pin_groups method but considers other pins rather than regular pins
557833
def other_pin_groups(id = nil, options = {}, &_block)
      id, options = nil, id if id.is_a?(Hash)
      if id
        pin = Origen.pin_bank.find(id, options.merge(other_pin: true))
        unless pin
          puts <<-END
    You have tried to reference other_pin_group :#{id} within #{self.class} but it does not exist, this could be
    because the pin group has not been defined yet or it is an alias that is not available in the current context.

    If you meant to define the other_pin_group then use the add_other_pin_group method instead.

          END
          fail 'Other pin group not found'
        end
        pin
      else
        Origen.pin_bank.other_pin_groups(options)
      end
    end
482433
def parse_port_pin(name_str):
    """"""
    if len(name_str) < 3:
        raise ValueError("Expecting pin name to be at least 3 charcters.")
    if name_str[0] != 'P':
        raise ValueError("Expecting pin name to start with P")
    if name_str[1] < 'A' or name_str[1] > 'K':
        raise ValueError("Expecting pin port to be between A and K")
    port = ord(name_str[1]) - ord('A')
    pin_str = name_str[2:]
    if not pin_str.isdigit():
        raise ValueError("Expecting numeric pin number.")
    return (port, int(pin_str))
161635
function(seriesCallback) {
                async.eachLimit(groupedPinIds, 50, function(groupOfPinIds, eachCallback) {
                    var pinIdsString = groupOfPinIds.join(',');
                    getCache(pinIdsString, true, function (cacheData) {
                        if (cacheData === null) {
                            get('http://api.pinterest.com/v3/pidgets/pins/info/?pin_ids=' + pinIdsString, true, function (response) {
                                putCache(pinIdsString, JSON.stringify(response));
                                allPinsData = allPinsData.concat(response.data ? response.data : []);
                                eachCallback();
                                return;
                            });
                        } else {
                            allPinsData = allPinsData.concat(cacheData.data ? cacheData.data : []);
                            eachCallback();
                            return;
                        }
                    });
                }, function (err) {
                    if(err) {
                        throw err;
                    }
                    seriesCallback();
                    return;
                });             
            }
873868
def is_pinned(self, color: Color, square: Square) -> bool:
        
        return self.pin_mask(color, square) != BB_ALL
1327894
def pars_in_groups(self):
        
        pargp = self.par_groups
        allpars = dict()
        for cpg in pargp:
            allpars[cpg] = [i for i in self.parameter_data.loc[self.parameter_data.pargp == cpg, 'parnme']]
        return allpars
1314994
def read(self, pin, is_differential=False):
        
        pin = pin if is_differential else pin + 0x04
        return self._read(pin)
202684
def group_factory(bridge, number, name, led_type):
    
    if led_type in [RGBW, BRIDGE_LED]:
        return RgbwGroup(bridge, number, name, led_type)
    elif led_type == RGBWW:
        return RgbwwGroup(bridge, number, name)
    elif led_type == WHITE:
        return WhiteGroup(bridge, number, name)
    elif led_type == DIMMER:
        return DimmerGroup(bridge, number, name)
    elif led_type == WRGB:
        return WrgbGroup(bridge, number, name)
    else:
        raise ValueError('Invalid LED type: %s', led_type)
1367894
private static void isrCallback(int pin) {
        // dispatch callback to the subscribers for this pin
        List<GpioInterruptCallback> callbacks = isrCallbacks[pin];

        // ensure callbacks collection exists for this pins number
        if(callbacks != null && !callbacks.isEmpty()){
            // iterate over each callback delegate and invoke the callback if the pin and edge type match
            for(GpioInterruptCallback callback : callbacks){
                callback.callback(pin);
            }
        }
    }
444633
def pint2cfunits(value):
    
    # Print units using abbreviations (millimeter -> mm)
    s = "{:~}".format(value)

    # Search and replace patterns
    pat = r'(?P<inverse>/ )?(?P<unit>\w+)(?: \*\* (?P<pow>\d))?'

    def repl(m):
        i, u, p = m.groups()
        p = p or (1 if i else '')
        neg = '-' if i else ('^' if p else '')

        return "{}{}{}".format(u, neg, p)

    out, n = re.subn(pat, repl, s)
    return out
1333
protected function getPins( $reset = false ) {
		if ( $reset ) {
			$this->_pins = [];
		}
		if ( empty( $this->_pins ) ) {
			$pins = get_transient( self::PIN );
			if ( ! is_array( $pins ) ) {
				$pins = [];
			}
			$this->_pins = $pins;
		}
		return $this->_pins;
	}
393909
def is_pinned(self):
        # type: () -> bool
        
        specifiers = self.specifier
        return (len(specifiers) == 1 and
                next(iter(specifiers)).operator in {'==', '==='})
921821
def pin_command(self):
        """"""
        parts = [
            'pip-compile',
            '--no-header',
            '--verbose',
            '--rebuild',
            '--no-index',
            '--output-file', self.outfile,
            self.infile,
        ]
        if OPTIONS['upgrade']:
            parts.insert(3, '--upgrade')
        if self.add_hashes:
            parts.insert(1, '--generate-hashes')
        return parts
623491
def set(pin, value):
    ''''''
    if value is LOW:
        value = 0
    value = int(bool(value))
    log.debug("Write {0}: {1}".format(pin, value))
    f = _open[pin].value
    _write(f, value)
756950
def pin_list_to_board_dict(pinlist):
    

    board_dict = {
        "digital": [],
        "analog": [],
        "pwm": [],
        "servo": [],  # 2.2 specs
        # 'i2c': [],  # 2.3 specs
        "disabled": [],
    }
    for i, pin in enumerate(pinlist):
        pin.pop()  # removes the 0x79 on end
        if not pin:
            board_dict["disabled"] += [i]
            board_dict["digital"] += [i]
            continue

        for j, _ in enumerate(pin):
            # Iterate over evens
            if j % 2 == 0:
                # This is safe. try: range(10)[5:50]
                if pin[j:j + 4] == [0, 1, 1, 1]:
                    board_dict["digital"] += [i]

                if pin[j:j + 2] == [2, 10]:
                    board_dict["analog"] += [i]

                if pin[j:j + 2] == [3, 8]:
                    board_dict["pwm"] += [i]

                if pin[j:j + 2] == [4, 14]:
                    board_dict["servo"] += [i]

                # Desable I2C
                if pin[j:j + 2] == [6, 1]:
                    pass

    # We have to deal with analog pins:
    # - (14, 15, 16, 17, 18, 19)
    # + (0, 1, 2, 3, 4, 5)
    diff = set(board_dict["digital"]) - set(board_dict["analog"])
    board_dict["analog"] = [n for n, _ in enumerate(board_dict["analog"])]

    # Digital pin problems:
    # - (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)
    # + (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13)

    board_dict["digital"] = [n for n, _ in enumerate(diff)]
    # Based on lib Arduino 0017
    board_dict["servo"] = board_dict["digital"]

    # Turn lists into tuples
    # Using dict for Python 2.6 compatibility
    board_dict = dict([(key, tuple(value)) for key, value in board_dict.items()])

    return board_dict
1299363
def Led(pin_number)
      pin = Pin.new(pin_number, @board)
      (leds << Led.new(pin)).last
    end
276363
def power_pins(id = nil, options = {}, &block)
      id, options = nil, id if id.is_a?(Hash)
      options = {
        power_pin: true
      }.merge(options)
      pins(id, options, &block)
    end
1267516
def _group(tlist, cls, match,
           valid_prev=lambda t: True,
           valid_next=lambda t: True,
           post=None,
           extend=True,
           recurse=True
           ):
    """"""

    tidx_offset = 0
    pidx, prev_ = None, None
    for idx, token in enumerate(list(tlist)):
        tidx = idx - tidx_offset

        if token.is_whitespace:
            continue

        if recurse and token.is_group and not isinstance(token, cls):
            _group(token, cls, match, valid_prev, valid_next, post, extend)

        if match(token):
            nidx, next_ = tlist.token_next(tidx)
            if prev_ and valid_prev(prev_) and valid_next(next_):
                from_idx, to_idx = post(tlist, pidx, tidx, nidx)
                grp = tlist.group_tokens(cls, from_idx, to_idx, extend=extend)

                tidx_offset += to_idx - from_idx
                pidx, prev_ = from_idx, grp
                continue

        pidx, prev_ = tidx, token