'Post a twitter status message from the authenticated user.
https://dev.twitter.com/docs/api/1.1/post/statuses/update
Args:
status:
The message text to be posted. Must be less than or equal to 140
characters.
media:
A URL, a local file, or a file-like object (something with a read()
method), or a list of any combination of the above.
media_additional_owners:
A list of user ids representing Twitter users that should be able
to use the uploaded media in their tweets. If you pass a list of
media, then additional_owners will apply to each object. If you
need more granular control, please use the UploadMedia* methods.
media_category:
Only for use with the AdsAPI. See
https://dev.twitter.com/ads/creative/promoted-video-overview if
this applies to your application.
in_reply_to_status_id:
The ID of an existing status that the status to be posted is
in reply to.  This implicitly sets the in_reply_to_user_id
attribute of the resulting status to the user ID of the
message being replied to.  Invalid/missing status IDs will be
ignored. [Optional]
latitude:
Latitude coordinate of the tweet in degrees. Will only work
in conjunction with longitude argument. Both longitude and
latitude will be ignored by twitter if the user has a false
geo_enabled setting. [Optional]
longitude:
Longitude coordinate of the tweet in degrees. Will only work
in conjunction with latitude argument. Both longitude and
latitude will be ignored by twitter if the user has a false
geo_enabled setting. [Optional]
place_id:
A place in the world. These IDs can be retrieved from
GET geo/reverse_geocode. [Optional]
display_coordinates:
Whether or not to put a pin on the exact coordinates a tweet
has been sent from. [Optional]
trim_user:
If True the returned payload will only contain the user IDs,
otherwise the payload will contain the full user data item.
[Optional]
verify_status_length:
If True, api throws a hard error that the status is over
140 characters. If False, Api will attempt to post the
status. [Optional]
Returns:
A twitter.Status instance representing the message posted.'

def PostUpdate(self, status, media=None, media_additional_owners=None, media_category=None, in_reply_to_status_id=None, latitude=None, longitude=None, place_id=None, display_coordinates=False, trim_user=False, verify_status_length=True):

    url = ('%s/statuses/update.json' % self.base_url)
    if (isinstance(status, str) or (self._input_encoding is None)):
        u_status = status
    else:
        u_status = str(status, self._input_encoding)
    if (verify_status_length and (calc_expected_status_length(u_status) > 140)):
        raise TwitterError('Text    must    be    less    than    or    equal    to    140    characters.')
    parameters = {'status': u_status}
    if media:
        media_ids = []
        if isinstance(media, int):
            media_ids.append(media)
        elif isinstance(media, list):
            for media_file in media:
                if isinstance(media_file, int):
                    media_ids.append(media_file)
                    continue
                (_, _, file_size, media_type) = parse_media_file(media_file)
                if ((media_type == 'image/gif') or (media_type == 'video/mp4')):
                    raise TwitterError('You    cannot    post    more    than    1    GIF    or    1    video    in    a    single    status.')
                if (file_size > self.chunk_size):
                    media_id = self.UploadMediaChunked(media=media_file, additional_owners=media_additional_owners, media_category=media_category)
                else:
                    media_id = self.UploadMediaSimple(media=media_file, additional_owners=media_additional_owners, media_category=media_category)
                media_ids.append(media_id)
        else:
            (_, _, file_size, _) = parse_media_file(media)
            if (file_size > self.chunk_size):
                media_ids = self.UploadMediaChunked(media, media_additional_owners)
            else:
                media_ids.append(self.UploadMediaSimple(media, media_additional_owners))
        parameters['media_ids'] = ','.join([str(mid) for mid in media_ids])
    if in_reply_to_status_id:
        parameters['in_reply_to_status_id'] = in_reply_to_status_id
    if ((latitude is not None) and (longitude is not None)):
        parameters['lat'] = str(latitude)
        parameters['long'] = str(longitude)
    if (place_id is not None):
        parameters['place_id'] = str(place_id)
    if display_coordinates:
        parameters['display_coordinates'] = 'true'
    if trim_user:
        parameters['trim_user'] = 'true'
    resp = self._RequestUrl(url, 'POST', data=parameters)
    data = self._ParseAndCheckTwitter(resp.content.decode('utf-8'))
    return Status.NewFromJsonDict(data)
