<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def upload(apikey, picture, resize=None, rotation='00', noexif=False, callback=None):
 """ prepares post for regular upload :param str apikey: Apikey needed for Autentication on picflash. :param str/tuple/list picture: Path to picture as str or picture data. \ If data a tuple or list with the file name as str \ and data as byte object in that order. :param str resize: Aresolution in the folowing format: \ '80x80'(optional) :param str|degree rotation: The picture will be rotated by this Value. \ Allowed values are 00, 90, 180, 270.(optional) :param boolean noexif: set to True when exif data should be purged.\ (optional) :param function callback: function witch will be called after every read. \ Need to take one argument. you can use the len function to determine \ the body length and call bytes_read(). """


    if isinstance(picture, str):
        with open(picture, 'rb') as file_obj:
            picture_name = picture
            data = file_obj.read()
    elif isinstance(picture, (tuple, list)):
        picture_name = picture[0]
        data = picture[1]
    else:
        raise TypeError("The second argument must be str or list/tuple. "
                        "Please refer to the documentation for details.")


    check_rotation(rotation)
    check_resize(resize)
    check_callback(callback)

    post_data = compose_post(apikey, resize, rotation, noexif)

    post_data['Datei[]'] = (punify_filename(basename(picture_name)), data)

    return do_upload(post_data, callback)