Converts a poker hand range to short notation.
It's the opposite of `prange`.

@name prange.reverse
@function
@param {Array.<String>} combos hand combos to be converted to short notation
@param {String} the short notation for the range
18967
function reverse(combos) {
  const { offsuit, suited, pairs } = sortOut(combos)

  const ps = reversePairs(pairs)
  const os = reverseNonPairs(offsuit, 'o')
  const su = reverseNonPairs(suited, 's')
  const nonpairs = unsuitWhenPossible(new Set(os), new Set(su))

  return ps.concat(nonpairs).join(', ')
}
1281332
def _generate_reversed_sql(self, keys, changed_keys):
        
        for key in keys:
            if key not in changed_keys:
                continue
            app_label, sql_name = key
            old_item = self.from_sql_graph.nodes[key]
            new_item = self.to_sql_graph.nodes[key]
            if not old_item.reverse_sql or old_item.reverse_sql == RunSQL.noop or new_item.replace:
                continue

            # migrate backwards
            operation = ReverseAlterSQL(sql_name, old_item.reverse_sql, reverse_sql=old_item.sql)
            sql_deps = [n.key for n in self.from_sql_graph.node_map[key].children]
            sql_deps.append(key)
            self.add_sql_operation(app_label, sql_name, operation, sql_deps)
626200
function invert(str, options){

  if(!options) options = {};
  if(!options.exclude) options.exclude = [];
  
  for(var rule in rules) {
  
    // Pass excluded rules
    if(options.exclude.indexOf(rule) != -1) continue;
    
    // Run rule
    str = rules[rule](str, options);
    
  }
  
  return str;

}
1205546
function invertBmp(range) {
        var output = '';
        var lastEnd = -1;

        XRegExp.forEach(
            range,
            /(\\x..|\\u....|\\?[\s\S])(?:-(\\x..|\\u....|\\?[\s\S]))?/,
            function(m) {
                var start = charCode(m[1]);
                if (start > (lastEnd + 1)) {
                    output += '\\u' + pad4(hex(lastEnd + 1));
                    if (start > (lastEnd + 2)) {
                        output += '-\\u' + pad4(hex(start - 1));
                    }
                }
                lastEnd = charCode(m[2] || m[1]);
            }
        );

        if (lastEnd < 0xFFFF) {
            output += '\\u' + pad4(hex(lastEnd + 1));
            if (lastEnd < 0xFFFE) {
                output += '-\\uFFFF';
            }
        }

        return output;
    }
15306
def hand(opts = {})
      range = Args::CardRange.new(opts[:range], deck_size: size)
      hand  = Args::HandSpecial.new(height).load!(opts, expand_by: size, layout: layout, dpi: dpi)
      sheet = Args::Sheet.new(custom_colors, { file: 'hand.png', trim_radius: 0 }).load!(opts, expand_by: size, layout: layout, dpi: dpi)
      render_hand(range, sheet, hand)
    end
1051165
function reverse(param) {
    var ret = new buffer.Buffer(param.length);
    for (var i = 0; i < param.length; i++) {
      ret[i] = param[param.length - i - 1];
    }
    return ret;
  }
371901
def setComboValue(combo, value):
    
    dataType = unwrapVariant(combo.property('dataType'))
    
    if dataType == 'string':
        return combo.setCurrentIndex(combo.findText(value))
    elif dataType == 'data':
        for i in range(combo.count()):
            if unwrapVariant(combo.itemData(i)) == value:
                return combo.setCurrentIndex(i)
        return combo.setCurrentIndex(-1)
    return combo.setCurrentIndex(value)
981659
public static function convertShorthand($val)
    {
        $val = trim($val);
        $last = strtolower($val[strlen($val) - 1]);

        if (!is_numeric($last)) {
            $val = (int) substr($val, 0, strlen($val) - 1);

            switch ($last) {
                // The 'G' modifier is available since PHP 5.1.0
                case 'g':
                    $val *= 1024;
                // no break
                case 'm':
                    $val *= 1024;
                // no break
                case 'k':
                    $val *= 1024;
            }
        }

        return $val;
    }
814211
function flip(input){
		input = input.reverse();
		
		// Flip any options back into the right order
		for(let i = 0, l = input.length; i < l; ++i){
			const arg = input[i];
			const opt = shortNames[arg] || longNames[arg];
			
			if(opt){
				const from    = Math.max(0, i - opt.arity);
				const to      = i + 1;
				const extract = input.slice(from, to).reverse();
				input.splice(from, extract.length, ...extract);
			}
		}
		
		return input;
	}
111256
function handRank(val) {
  if (val > 6185) return HIGH_CARD        // 1277 high card
  if (val > 3325) return ONE_PAIR         // 2860 one pair
  if (val > 2467) return TWO_PAIR         //  858 two pair
  if (val > 1609) return THREE_OF_A_KIND  //  858 three-kind
  if (val > 1599) return STRAIGHT         //   10 straights
  if (val > 322)  return FLUSH            // 1277 flushes
  if (val > 166)  return FULL_HOUSE       //  156 full house
  if (val > 10)   return FOUR_OF_A_KIND   //  156 four-kind
  return STRAIGHT_FLUSH                   //   10 straight-flushes
}
899135
function(proto, name, combo) {
		var base = proto[name];
		proto[name] = combo(function() {
			return base.apply(this, arguments);
		});
	}
474392
function reorder(aChildren, bChildren) {

    var bKeys = keyIndex(bChildren)

    if (!bKeys) {
        return bChildren
    }

    var aKeys = keyIndex(aChildren)

    if (!aKeys) {
        return bChildren
    }

    var bMatch = {}, aMatch = {}

    for (var key in bKeys) {
        bMatch[bKeys[key]] = aKeys[key]
    }

    for (var key in aKeys) {
        aMatch[aKeys[key]] = bKeys[key]
    }

    var aLen = aChildren.length
    var bLen = bChildren.length
    var len = aLen > bLen ? aLen : bLen
    var shuffle = []
    var freeIndex = 0
    var i = 0
    var moveIndex = 0
    var moves = {}
    var removes = moves.removes = {}
    var reverse = moves.reverse = {}
    var hasMoves = false

    while (freeIndex < len) {
        var move = aMatch[i]
        if (move !== undefined) {
            shuffle[i] = bChildren[move]
            if (move !== moveIndex) {
                moves[move] = moveIndex
                reverse[moveIndex] = move
                hasMoves = true
            }
            moveIndex++
        } else if (i in aMatch) {
            shuffle[i] = undefined
            removes[i] = moveIndex++
            hasMoves = true
        } else {
            while (bMatch[freeIndex] !== undefined) {
                freeIndex++
            }

            if (freeIndex < len) {
                var freeChild = bChildren[freeIndex]
                if (freeChild) {
                    shuffle[i] = freeChild
                    if (freeIndex !== moveIndex) {
                        hasMoves = true
                        moves[freeIndex] = moveIndex
                        reverse[moveIndex] = freeIndex
                    }
                    moveIndex++
                }
                freeIndex++
            }
        }
        i++
    }

    if (hasMoves) {
        shuffle.moves = moves
    }

    return shuffle
}
783262
private Range<RangeTimeUUID> toRange(@Nullable UUID start, @Nullable UUID end, boolean reversed) {
        // If the range is reversed then start and end will also be reversed and must therefore be swapped.
        if (reversed) {
            UUID tmp = start;
            start = end;
            end = tmp;
        }

        if (start == null) {
            if (end == null) {
                return Range.all();
            } else {
                return Range.atMost(new RangeTimeUUID(end));
            }
        } else if (end == null) {
            return Range.atLeast(new RangeTimeUUID(start));
        }
        return Range.closed(new RangeTimeUUID(start), new RangeTimeUUID(end));
    }
61704
@Override
  public IVersionRange invert() {
    if (ranges.size() == 2) {
      IVersionRange irange1 = ranges.first().invert();
      IVersionRange irange2 = ranges.last().invert();
      return new AndRange(irange1, irange2);
    }

    throw new UnsupportedOperationException();
  }
671250
function(b) {
            	var xa = [];

            	for(var i = this.rows(); i > 0; i--) {
            	    var w = 0;

            	    for(var j = this.cols(); j > i; j--) {
            		w += this.e(i, j) * xa[this.rows() - j];
            	    }

            	    xa.push((b.e(i) - w) / this.e(i, i));
            	}

            	return $V(xa.reverse());
                }
407271
def reverse_add_options(options = {}, raw_options = nil)
      @options.reverse_merge!(options.stringify_keys) unless options.blank?
      @raw_options << raw_options unless raw_options.blank?
    end
936305
@Override
  public final void reverseDraw(final Map<String, Object> pAddParam,
    final IMakingWarehouseEntry pEntity, final Date pDateAccount,
      final Long pDrawingOwnerId) throws Exception {
    if (!pEntity.getIdDatabaseBirth()
      .equals(getSrvOrm().getIdDatabase())) {
      throw new ExceptionWithCode(ExceptionWithCode.WRONG_PARAMETER,
        "can_not_make_di_entry_for_foreign_src");
    }
    String tblNm = getDrawItemEntryClass().getSimpleName().toUpperCase();
    List<T> diel = getSrvOrm().retrieveListWithConditions(pAddParam,
      getDrawItemEntryClass(), " where DRAWINGTYPE=" + pEntity.constTypeCode()
        + " and " + tblNm + ".IDDATABASEBIRTH=" + getSrvOrm().getIdDatabase()
          + " and DRAWINGID=" + pEntity.getReversedId());
    BigDecimal quantityToLeaveRst = pEntity.getItsQuantity();
    String langDef = (String) pAddParam.get("langDef");
    for (T dies : diel) {
      if (dies.getItsQuantity().doubleValue() < 0) {
        throw new ExceptionWithCode(ExceptionWithCode.FORBIDDEN,
          "Attempt to reverse reversed " + pAddParam.get("user"));
      }
      T die = createDrawItemEntry(pAddParam);
      die.setItsDate(pDateAccount);
      die.setIdDatabaseBirth(getSrvOrm().getIdDatabase());
      die.setSourceType(dies.getSourceType());
      die.setSourceId(dies.getSourceId());
      die.setDrawingType(pEntity.constTypeCode());
      die.setDrawingId(pEntity.getItsId());
      die.setDrawingOwnerId(pDrawingOwnerId);
      die.setDrawingOwnerType(pEntity.getOwnerType());
      die.setSourceOwnerId(dies.getSourceOwnerId());
      die.setSourceOwnerType(dies.getSourceOwnerType());
      die.setItsCost(dies.getItsCost());
      die.setItsTotal(dies.getItsTotal().negate());
      die.setUnitOfMeasure(dies.getUnitOfMeasure());
      die.setInvItem(dies.getInvItem());
      die.setItsQuantity(dies.getItsQuantity().negate());
      quantityToLeaveRst = quantityToLeaveRst.add(dies.getItsQuantity());
      if (quantityToLeaveRst.doubleValue() > 0) {
        throw new ExceptionWithCode(ExceptionWithCode.SOMETHING_WRONG,
          "Reversing source has different quantity against movement entries! "
            + pAddParam.get("user"));
      }
      die.setReversedId(dies.getItsId());
      die.setDescription(makeDescription(pAddParam, pEntity, dies) + " "
        + getSrvI18n().getMsg("reversed_entry_n", langDef)
          + getSrvOrm().getIdDatabase() + "-" + dies.getItsId());
      getSrvOrm().insertEntity(pAddParam, die);
      die.setIsNew(false);
      @SuppressWarnings("unchecked")
      IFactorySimple<IDrawItemSource> fctDis =
        (IFactorySimple<IDrawItemSource>) this.entitiesFactoriesFatory
         .lazyGet(pAddParam, srvTypeCode.getTypeCodeMap()
          .get(dies.getSourceType()));
      IDrawItemSource drawed = fctDis.create(pAddParam);
      String fldIdName = this.srvOrm.getTablesMap()
        .get(drawed.getClass().getSimpleName()).getIdFieldName();
      Method setterId = this.settersRapiHolder
        .getFor(drawed.getClass(), fldIdName);
      setterId.invoke(drawed, dies.getSourceId());
      drawed = srvOrm.retrieveEntity(pAddParam, drawed);
      drawed.setTheRest(drawed.getTheRest().add(dies.getItsQuantity()));
      srvOrm.updateEntity(pAddParam, drawed);
      dies.setReversedId(die.getItsId());
      dies.setDescription(dies.getDescription() + " "
        + getSrvI18n().getMsg("reversing_entry_n", langDef)
          + getSrvOrm().getIdDatabase() + "-" + die.getItsId()); //only local
      getSrvOrm().updateEntity(pAddParam, dies);
    }
    if (quantityToLeaveRst.doubleValue() != 0) {
      throw new ExceptionWithCode(ExceptionWithCode.SOMETHING_WRONG,
        "Reversing source has different quantity against movement entries! "
          + pAddParam.get("user"));
    }
  }