'''simple docstring'''




def  lowerCamelCase__						(  SCREAMING_SNAKE_CASE :				str  ):
  UpperCAmelCase  							=		[]
  UpperCAmelCase  							=		1

  for i in range(len(SCREAMING_SNAKE_CASE  )  ):
    if i + 1 < len(SCREAMING_SNAKE_CASE  ) and text[i] == text[i + 1]:
      count += 1
    else:
      encoded.append((text[i], count)  )
      UpperCAmelCase  							=		1

  return encoded


def  lowerCamelCase__						(  SCREAMING_SNAKE_CASE :				list  ):
  return "".join(char * length for char, length in encoded  )


if __name__ == "__main__":
  from doctest import testmod

  testmod(name='run_length_encode', verbose=True)
  testmod(name='run_length_decode', verbose=True)





'''simple docstring'''




def  lowerCamelCase__						(  SCREAMING_SNAKE_CASE :				str  ):
  UpperCAmelCase  							=		str(SCREAMING_SNAKE_CASE  ).strip()
  if not bin_string:
    raise ValueError('Empty string was passed to the function'  )
  UpperCAmelCase  							=		bin_string[0] == '-'
  if is_negative:
    UpperCAmelCase  							=		bin_string[1:]
  if not all(char in '01' for char in bin_string  ):
    raise ValueError('Non-binary value was passed to the function'  )
  UpperCAmelCase  							=		0
  for char in bin_string:
    UpperCAmelCase  							=		2 * decimal_number + int(SCREAMING_SNAKE_CASE  )
  return -decimal_number if is_negative else decimal_number


if __name__ == "__main__":
  from doctest import testmod

  testmod()


