<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def camelize(string, uppercase_first_letter=True):
 """ Convert strings to CamelCase. Examples:: "DeviceType" "deviceType" :func:`camelize` can be thought of as a inverse of :func:`underscore`, although there are some cases where that does not hold:: "IoError" :param uppercase_first_letter: if set to `True` :func:`camelize` converts strings to UpperCamelCase. If set to `False` :func:`camelize` produces lowerCamelCase. Defaults to `True`. """

    if uppercase_first_letter:
        return re.sub(r"(?:^|_)(.)", lambda m: m.group(1).upper(), string)
    else:
        return string[0].lower() + camelize(string)[1:]