def list_objects(bucket, prefix='', client=s3_client):
    '\n    Usage: [arg1]:[bucket name],[arg2]:[pattern to match keys in s3],[arg3]:[initialized s3 client object],\n    Description: Gets the keys in the S3 location\n    Returns: [list of keys], [list of directories]\n    '
    keys = []
    dirs = set()
    next_token = ''
    base_kwargs = {'Bucket': bucket, 'Prefix': prefix}
    while (next_token is not None):
        kwargs = base_kwargs.copy()
        if (next_token != ''):
            kwargs.update({'ContinuationToken': next_token})
        results = client.list_objects_v2(**kwargs)
        contents = results.get('Contents')
        for i in contents:
            k = i.get('Key')
            keys.append(k)
            dirs.add(k[:(k.rfind('/') + 1)])
        next_token = results.get('NextContinuationToken')
    return (keys, list(dirs))
Usage: [arg1]:[bucket name],[arg2]:[pattern to match keys in s3],[arg3]:[initialized s3 client object],
Description: Gets the keys in the S3 location
Returns: [list of keys], [list of directories]
def list_objects(bucket, prefix=, client=s3_client):
    '\n    Usage: [arg1]:[bucket name],[arg2]:[pattern to match keys in s3],[arg3]:[initialized s3 client object],\n    Description: Gets the keys in the S3 location\n    Returns: [list of keys], [list of directories]\n    '
    keys = []
    dirs = set()
    next_token = 
    base_kwargs = {'Bucket': bucket, 'Prefix': prefix}
    while (next_token is not None):
        kwargs = base_kwargs.copy()
        if (next_token != ):
            kwargs.update({'ContinuationToken': next_token})
        results = client.list_objects_v2(**kwargs)
        contents = results.get('Contents')
        for i in contents:
            k = i.get('Key')
            keys.append(k)
            dirs.add(k[:(k.rfind('/') + 1)])
        next_token = results.get('NextContinuationToken')
    return (keys, list(dirs))