Connection
Base URL, credentials and a reachable server.
Check zero and full-width rotations with counts reduced modulo the width, rejecting negative counts and values that do not fit.
Base URL, credentials and a reachable server.
A model available through the configured endpoint.
Context limits and tool support are determined by the model and server.
def rotate_left(value, count, width):
if any(type(x) is not int for x in (value, count, width)):
raise ValueError("rotate.type")
if not 1 <= width <= 64 or not 0 <= value < (1 << width) or count < 0:
raise ValueError("rotate.range")
count %= width
mask = (1 << width) - 1
return ((value << count) | (value >> (width - count))) & mask