Is key in (low, high)
340251
function in_range(key, low, high) {
    //return (low < high && key > low && key < high) ||
    //    (low > high && (key > low || key < high)) ||
    //    (low === high && key !== low);
    return (less_than(low, high) && less_than(low, key) && less_than(key, high)) ||
        (less_than(high, low) && (less_than(low, key) || less_than(key, high))) ||
        (equal_to(low, high) && !equal_to(key, low));
}
460791
public int size(Key low, Key high) {
	if (low.compareTo(high) > 0)
	    return 0;
	if (contains(high))
	    return rank(high) - rank(low) + 1;
	else
	    return rank(high) - rank(low);
    }
727355
def validate_key(key):
    
    if len(key.split()) != 2:
        raise ValueError("'{}' is not in the form '(key) (mode)'".format(key))
    key, mode = key.split()
    if key.lower() not in KEY_TO_SEMITONE:
        raise ValueError(
            "Key {} is invalid; should be e.g. D or C# or Eb".format(key))
    if mode not in ['major', 'minor']:
        raise ValueError(
            "Mode '{}' is invalid; must be 'major' or 'minor'".format(mode))
899809
function compareKey(one: string, two: string): number {
  const delta = one.length - two.length;
  if (delta > 0) {
    return 1;
  }
  if (delta < 0) {
    return -1;
  }
  return one > two ? 1 : -1;
}
1234989
function getkey(key) {
        var parsedKey = Number(key);

        return (isNaN(parsedKey) || key.indexOf('.') !== -1)? key : parsedKey;
    }
477095
private static boolean validateKey(String key) {
    if (key.length() > KEY_MAX_SIZE
        || key.isEmpty()
        || key.charAt(0) < 'a'
        || key.charAt(0) > 'z') {
      return false;
    }
    for (int i = 1; i < key.length(); i++) {
      char c = key.charAt(i);
      if (!(c >= 'a' && c <= 'z')
          && !(c >= '0' && c <= '9')
          && c != '_'
          && c != '-'
          && c != '*'
          && c != '/') {
        return false;
      }
    }
    return true;
  }
863916
def keyEvent(self, key, down=1):
        """"""
        self.transport.write(pack("!BBxxI", 4, down, key))
590060
function ltrim(key, start, stop, req) {
  var val = this.getKey(key, req);
  if(val === undefined) return null;
  val.ltrim(start, stop);
  if(val.llen() === 0) {
    this.delKey(key, req);
  }
  return OK;
}
655370
def check_key(self, key: str) -> bool:
        
        keys = self.get_keys()
        return key in keys
326709
@Override
    public K higherKey(K key)
    {
        Entry<K, V> entry = entry(key, null);
        Entry<K, V> higher = entrySet.higher(entry);
        if (higher != null)
        {
            return higher.getKey();
        }
        return null;
    }
1238883
static int binarySearch(long keys[], int start, int len, long key) {
        int high = start + len, low = start - 1, guess;
        while (high - low > 1) {
            // use >>> for average or we could get an integer overflow.
            guess = (high + low) >>> 1;
            long guessedKey = keys[guess];
            if (guessedKey < key) {
                low = guess;
            } else {
                high = guess;
            }
        }

        if (high == start + len) {
            return ~(start + len);
        }

        long highKey = keys[high];
        if (highKey == key) {
            return high;
        } else {
            return ~high;
        }
    }
1312702
function (key) {
    
            key = key.toLowerCase();
        
            var property = this.config[key];
    
            if (property && property.event) {
    
                if (this.initialConfig[key] && 
                    !Lang.isUndefined(this.initialConfig[key])) {
    
                    this.setProperty(key, this.initialConfig[key]);

                    return true;
    
                }
    
            } else {
    
                return false;
            }
    
        }
997059
public boolean isOrdered(Iterable<InternalKey> keys)
    {
        Iterator<InternalKey> iterator = keys.iterator();
        if (!iterator.hasNext()) {
            return true;
        }

        InternalKey previous = iterator.next();
        while (iterator.hasNext()) {
            InternalKey next = iterator.next();
            if (compare(previous, next) > 0) {
                return false;
            }
            previous = next;
        }
        return true;
    }
1137310
public function isKey()
    {
        $args = func_get_args();
        
        if (count($args) == 0) {
            return $this;
        }
        
        $last = array_pop($args);
        
        $pointer = &$this->data;
        foreach ($args as $i => $step) {
            if (!isset($pointer[$step])
                || !is_array($pointer[$step])
            ) {
                return false;
            }

            $pointer = &$pointer[$step];
        }
        
        if (!isset($pointer[$last])) {
            return false;
        }
        
        return true;
    }
1321667
public boolean isConsistent() {
        for (int i = 1; i < filledUpTo; i++) {
            int comp1 = KeyUtils.compareKey(maxKeyPerChunk[i], maxKeyPerChunk[i - 1]);
            if (comp1 <= 0) {
                return false;
            }
        }
        return true;
    }
198187
def filter_input(keys, raw):
    """"""
    if len(keys) == 1:
        if keys[0] in UI.keys['up']:
            keys[0] = 'up'
        elif keys[0] in UI.keys['down']:
            keys[0] = 'down'
        elif len(keys[0]) == 4 and keys[0][0] == 'mouse press':
            if keys[0][1] == 4:
                keys[0] = 'up'
            elif keys[0][1] == 5:
                keys[0] = 'down'
    return keys
1152661
function hasAtLeastOneKey(target, attrs) {
    var attrsLen = attrs.length;
    var i = 0;
    var counter = 0;
    for (; i < attrsLen; i++) {
      if (target[attrs[i]] !== undefined) {
        counter++;
      }
    }
    return !!counter;
  }