def get_max_value_from_bytes(bytes_size: int, signed=True) -> int:
  """Gets the max value that a number can be given the bytes.

  Args:
    bytes_size: Bytes size.
    signed: Whether number is signed or not.

  Returns:
    Max number for given bytes.
  """
  bits_size = bytes_size * 8
  if signed:
    bits_size = bits_size - 1  # Remove one bit for sign.
  return 2 ** bits_size