Only useful for EOS
555331
def run_commands(self, commands):
        """"""
        if "eos" in self.profile:
            return list(self.parent.cli(commands).values())[0]
        else:
            raise AttributeError("MockedDriver instance has not attribute '_rpc'")
465412
function() {
    var block = this.emptyBlock(0);

    while ('eos' != this.peek().type) {
      if ('newline' == this.peek().type) {
        this.advance();
      } else if ('text-html' == this.peek().type) {
        block.nodes = block.nodes.concat(this.parseTextHtml());
      } else {
        var expr = this.parseExpr();
        if (expr)
          block.nodes.push(expr);
        }
      }

    return block;
  }
660261
function findBiggestUtxo(utxos) {
  var largestAmount = 0;
  var largestIndex = 0;

  for (var i = 0; i < utxos.length; i++) {
    var thisUtxo = utxos[i];

    if (thisUtxo.satoshis > largestAmount) {
      largestAmount = thisUtxo.satoshis;
      largestIndex = i;
    }
  }

  return utxos[largestIndex];
}
1126283
def _parse_eoc_segment(self, fptr):
        
        offset = fptr.tell() - 2
        length = 0

        return EOCsegment(length, offset)
812076
function() {
    return this.callLexerFunction('blank')
      || this.callLexerFunction('eos')
      || this.callLexerFunction('endInterpolation')
      || this.callLexerFunction('yield')
      || this.callLexerFunction('doctype')
      || this.callLexerFunction('interpolation')
      || this.callLexerFunction('case')
      || this.callLexerFunction('when')
      || this.callLexerFunction('default')
      || this.callLexerFunction('extends')
      || this.callLexerFunction('append')
      || this.callLexerFunction('prepend')
      || this.callLexerFunction('block')
      || this.callLexerFunction('mixinBlock')
      || this.callLexerFunction('include')
      || this.callLexerFunction('mixin')
      || this.callLexerFunction('call')
      || this.callLexerFunction('conditional')
      || this.callLexerFunction('each')
      || this.callLexerFunction('while')
      || this.callLexerFunction('tag')
      || this.callLexerFunction('filter')
      || this.callLexerFunction('blockCode')
      || this.callLexerFunction('code')
      || this.callLexerFunction('id')
      || this.callLexerFunction('dot')
      || this.callLexerFunction('className')
      || this.callLexerFunction('attrs')
      || this.callLexerFunction('attributesBlock')
      || this.callLexerFunction('indent')
      || this.callLexerFunction('text')
      || this.callLexerFunction('textHtml')
      || this.callLexerFunction('comment')
      || this.callLexerFunction('slash')
      || this.callLexerFunction('colon')
      || this.fail();
  }
199418
function _e2p(emitter, event, options) {
  let p = e2p(emitter, event, options);

  return p.then(() => {
    p.cancel();
    return p;
  })
  .catch(err => {
    p.cancel();
    throw err;
  });
}
1007996
@Override
    protected void generateDao(TableDefinition table, JavaWriter out1) {
        UniqueKeyDefinition key = table.getPrimaryKey();
        if (key == null) {
            logger.info("Skipping DAO generation", out1.file().getName());
            return;
        }
        VertxJavaWriter out = (VertxJavaWriter) out1;
        generateDAO(key, table, out);
    }
341683
function unsuspendSubscriber (topic, token) {
    if (typeof token === 'string') {
      return !!applyTopicDescendents(
        unsuspendTopic, 'subscriptions', token, topic
      );
    }

    var node = ancestorTopicSearch(token.topic, topic);
    if (node.topic !== token.topic) {
      return false;
    }

    var i = searchAround(
      getId, getPriority,
      token.id, token.priority,
      binaryIndexBy(getPriority, token.priority, node.subscriptions),
      node.subscriptions
    );

    if (i === -1) {
      return false;
    }

    return !!unsuspendNode(node.subscriptions[i]);
  }
814027
def _format_rules_for_eos(self, rules):
        """"""
        in_rules = []
        eg_rules = []
        for rule in rules:
            protocol = rule.get('protocol')
            cidr = rule.get('remote_ip_prefix', 'any')
            min_port = rule.get('port_range_min')
            max_port = rule.get('port_range_max')
            direction = rule.get('direction')
            ethertype = rule.get('ethertype')
            if not self._supported_rule(protocol, ethertype):
                continue
            formatted_rule = self._format_rule(protocol, cidr, min_port,
                                               max_port, direction)
            if rule['direction'] == n_const.INGRESS_DIRECTION:
                in_rules.append(formatted_rule)
            elif rule['direction'] == n_const.EGRESS_DIRECTION:
                eg_rules.append(formatted_rule)
        return in_rules, eg_rules
240279
def all(cls, otp=False, ccid=False, u2f=False):
        """"""
        pids = set([
            cls.YUBIKEY,
            cls.NEO_OTP,
            cls.NEO_OTP_CCID,
            cls.NEO_CCID,
            cls.NEO_U2F,
            cls.NEO_OTP_U2F,
            cls.NEO_U2F_CCID,
            cls.NEO_OTP_U2F_CCID,
            cls.NEO_SKY,
            cls.YK4_OTP,
            cls.YK4_U2F,
            cls.YK4_OTP_U2F,
            cls.YK4_CCID,
            cls.YK4_OTP_CCID,
            cls.YK4_U2F_CCID,
            cls.YK4_OTP_U2F_CCID,
            cls.PLUS_U2F_OTP
        ])

        if otp:
            pids.difference_update(set([
                cls.NEO_CCID,
                cls.NEO_U2F,
                cls.NEO_U2F_CCID,
                cls.NEO_SKY,
                cls.YK4_U2F,
                cls.YK4_CCID,
                cls.YK4_U2F_CCID
            ]))

        if ccid:
            pids.difference_update(set([
                cls.YUBIKEY,
                cls.NEO_OTP,
                cls.NEO_U2F,
                cls.NEO_OTP_U2F,
                cls.NEO_SKY,
                cls.YK4_OTP,
                cls.YK4_U2F,
                cls.YK4_OTP_U2F,
                cls.PLUS_U2F_OTP
            ]))

        if u2f:
            pids.difference_update(set([
                cls.YUBIKEY,
                cls.NEO_OTP,
                cls.NEO_OTP_CCID,
                cls.NEO_CCID,
                cls.YK4_OTP,
                cls.YK4_CCID,
                cls.YK4_OTP_CCID
            ]))

        return pids
776671
def mattr_writer(*syms)
      syms.each do |sym|
        raise NameError.new("invalid attribute name: #{sym}") unless sym =~ /^[_A-Za-z]\w*$/
        class_eval(<<-EOS, __FILE__, __LINE__ + 1)
          @@#{sym} = nil unless defined? @@#{sym}
          def self.#{sym}=(obj)
            @@#{sym} = obj
          end
        EOS

        send("#{sym}=", yield) if block_given?
      end
    end
217176
def sighash_for_witness(index, script_pubkey_or_script_code, hash_type, amount, skip_separator_index)
      hash_prevouts = Bitcoin.double_sha256(inputs.map{|i|i.out_point.to_payload}.join)
      hash_sequence = Bitcoin.double_sha256(inputs.map{|i|[i.sequence].pack('V')}.join)
      outpoint = inputs[index].out_point.to_payload
      amount = [amount].pack('Q')
      nsequence = [inputs[index].sequence].pack('V')
      hash_outputs = Bitcoin.double_sha256(outputs.map{|o|o.to_payload}.join)

      script_code = script_pubkey_or_script_code.to_script_code(skip_separator_index)

      case (hash_type & 0x1f)
      when SIGHASH_TYPE[:single]
        hash_outputs = index >= outputs.size ? "\x00".ljust(32, "\x00") : Bitcoin.double_sha256(outputs[index].to_payload)
        hash_sequence = "\x00".ljust(32, "\x00")
      when SIGHASH_TYPE[:none]
        hash_sequence = hash_outputs = "\x00".ljust(32, "\x00")
      end

      if (hash_type & SIGHASH_TYPE[:anyonecanpay]) != 0
        hash_prevouts = hash_sequence ="\x00".ljust(32, "\x00")
      end
      hash_type |= (Bitcoin.chain_params.fork_id << 8) if Bitcoin.chain_params.fork_chain?
      buf = [ [version].pack('V'), hash_prevouts, hash_sequence, outpoint,
              script_code ,amount, nsequence, hash_outputs, [@lock_time, hash_type].pack('VV')].join
      Bitcoin.double_sha256(buf)
    end
71577
public String[] getContext(Object o) {
    /** String preceeding the eos character in the eos token. */
    String prefix;
    /** Space delimited token preceeding token containing eos character. */
    String previous;
    /** String following the eos character in the eos token. */
    String suffix;
    /** Space delimited token following token containsing eos character. */
    String next;
    Object first = ((Pair) o).a;
    /** Character offset of eos character in */
    int position = ((Integer) ((Pair) o).b).intValue();

    if (first instanceof String[]) {
      String[] $_ = (String[]) first;
      previous = $_[0];
      String current = $_[1];
      prefix = current.substring(0, position);
      suffix = current.substring(position + 1);
      if (suffix.startsWith(" "))
        collectFeats.add("sn");
      if (prefix.endsWith(" "))
        collectFeats.add("pn");
      collectFeats.add("eos=" + current.charAt(position));
      next = $_[2];
    }
    else { //compute previous, next, prefix and suffix Strings and space previous, space next features and eos features. 
      StringBuffer sb = (StringBuffer) ((Pair) o).a;
      int lastIndex = sb.length() - 1;
      { // compute space previous and space next features.
        if (position > 0 && sb.charAt(position - 1) == ' ')
          collectFeats.add("sp");
        if (position < lastIndex && sb.charAt(position + 1) == ' ')
          collectFeats.add("sn");
        collectFeats.add("eos=" + sb.charAt(position));
      }
      int prefixStart = previousSpaceIndex(sb, position);

      int c = position;
      { ///assign prefix, stop if you run into a period though otherwise stop at space
        while (--c > prefixStart) {
          for (int eci = 0, ecl = eosCharacters.length; eci < ecl; eci++) {
            if (sb.charAt(c) == eosCharacters[eci]) {
              prefixStart = c;
              c++; // this gets us out of while loop.
              break;
            }
          }
        }
        prefix = sb.substring(prefixStart, position).trim();
      }
      int prevStart = previousSpaceIndex(sb, prefixStart);
      previous = sb.substring(prevStart, prefixStart).trim();

      int suffixEnd = nextSpaceIndex(sb, position, lastIndex);
      {
        c = position;
        while (++c < suffixEnd) {
          for (int eci = 0, ecl = eosCharacters.length; eci < ecl; eci++) {
            if (sb.charAt(c) == eosCharacters[eci]) {
              suffixEnd = c;
              c--; // this gets us out of while loop.
              break;
            }
          }
        }
      }
      int nextEnd = nextSpaceIndex(sb, suffixEnd + 1, lastIndex + 1);
      if (position == lastIndex) {
        suffix = "";
        next = "";
      }
      else {
        suffix = sb.substring(position + 1, suffixEnd).trim();
        next = sb.substring(suffixEnd + 1, nextEnd).trim();
      }
    }

    buf.append("x=");
    buf.append(prefix);
    collectFeats.add(buf.toString());
    buf.setLength(0);
    if (!prefix.equals("")) {
      collectFeats.add(Integer.toString(prefix.length()));
      if (isFirstUpper(prefix)) {
        collectFeats.add("xcap");
      }
      if (inducedAbbreviations.contains(prefix)) {
        collectFeats.add("xabbrev");
      }
    }

    buf.append("v=");
    buf.append(previous);
    collectFeats.add(buf.toString());
    buf.setLength(0);
    if (!previous.equals("")) {
      if (isFirstUpper(previous)) {
        collectFeats.add("vcap");
      }
      if (inducedAbbreviations.contains(previous)) {
        collectFeats.add("vabbrev");
      }
    }

    buf.append("s=");
    buf.append(suffix);
    collectFeats.add(buf.toString());
    buf.setLength(0);
    if (!suffix.equals("")) {
      if (isFirstUpper(suffix)) {
        collectFeats.add("scap");
      }
      if (inducedAbbreviations.contains(suffix)) {
        collectFeats.add("sabbrev");
      }
    }

    buf.append("n=");
    buf.append(next);
    collectFeats.add(buf.toString());
    buf.setLength(0);
    if (!next.equals("")) {
      if (isFirstUpper(next)) {
        collectFeats.add("ncap");
      }
      if (inducedAbbreviations.contains(next)) {
        collectFeats.add("nabbrev");
      }
    }

    String[] context = new String[collectFeats.size()];
    context = (String[]) collectFeats.toArray(context);
    collectFeats.clear();
    return context;
  }
1253083
public function main()
    {
        $this->setup();
        while (!$this->eos()) {
            $p = $this->pos();
            $state = $this->stateName();

            $this->loadTransitions();
            list($nextPatternData, $nextPatternIndex, $nextPatternMatches) = $this->nextStartData();
            list($endIndex, $endMatches) = $this->nextEndData();

            if (($nextPatternIndex <= $endIndex || $endIndex === -1) && $nextPatternIndex !== -1) {
                // we're pushing a new state
                if ($p < $nextPatternIndex) {
                    $this->recordRange($p, $nextPatternIndex);
                }
                $newPos = $nextPatternIndex;
                $this->pos($newPos);
                $tok = $nextPatternData[0];
                if (isset($this->overrides[$tok])) {
                    // call override
                    $ret = call_user_func($this->overrides[$tok], $nextPatternMatches);
                    if ($ret === true) {
                        break;
                    }
                    if ($this->stateName() === $state && $this->pos() <= $newPos) {
                        throw new Exception('Override failed to either advance the pointer or change the state');
                    }
                } else {
                    // no override
                    $this->posShift(strlen($nextPatternMatches[0]));
                    $this->pushState($nextPatternData);
                    $this->record($nextPatternMatches[0]);
                    if ($nextPatternData[2] === null) {
                        // state was a full pattern, so pop now
                        $this->popState();
                    }
                }
            } elseif ($endIndex !== -1) {
                // we're at the end of a state, record what's left and pop it
                $to = $endIndex + strlen($endMatches[0]);
                $this->recordRange($this->pos(), $to);
                $this->pos($to);
                $this->popState();
            } else {
                // no more matches, consume the rest of the stirng and break
                $this->record($this->rest());
                $this->terminate();
                break;
            }
            if ($this->stateName() === $state && $this->pos() <= $p) {
                throw new Exception('Failed to advance pointer in state' . $this->stateName());
            }
        }

        // unterminated states will have left some tokens open, we need to
        // close these so there's just the root node on the stack
        assert(count($this->tokenTreeStack) >= 1);
        while (count($this->tokenTreeStack) > 1) {
            $this->popState();
        }

        return $this->tokenTreeStack[0];
    }
826356
def encode(self, input_str):
    """"""
    inputs = self.encoders["inputs"].encode(input_str) + [EOS_ID]
    batch_inputs = np.reshape(inputs, [1, -1, 1, 1])  # Make it 3D.
    return batch_inputs
1034609
public boolean isUseless() {

        boolean useless = true;
        synchronized (conditions) {
            for (Iterator iterator = this.conditions.iterator(); iterator.hasNext(); ) {
                IObjectReference objRef = (IObjectReference) iterator.next();
                if (!objRef.isStale() && !((IWatchedCondition) (objRef.get())).isUseless()) {
                    useless = false;
                }
            }
        }

        return useless;
    }
789624
def read_single_xso(src, type_):
    

    result = None

    def cb(instance):
        nonlocal result
        result = instance

    read_xso(src, {type_: cb})

    return result