<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(client, source_dir):
 """Upload listing files in source_dir. folder herachy."""

    print('')
    print('upload store listings')
    print('---------------------')
    listings_folder = os.path.join(source_dir, 'listings')
    langfolders = filter(os.path.isdir, list_dir_abspath(listings_folder))

    for language_dir in langfolders:
        language = os.path.basename(language_dir)
        with open(os.path.join(language_dir, 'listing.json')) as listings_file:
            listing = json.load(listings_file)
        listing_response = client.update(
            'listings', language=language, body=listing)

        print('  Listing for language %s was updated.' %
              listing_response['language'])