<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def list_files(bucket, profile_name=None):
 """ List up to 1000 files in a bucket. Parameters bucket : str profile_name : str, optional AWS profile Returns ------- s3_paths : List[str] """

    session = boto3.Session(profile_name=profile_name)
    conn = session.client('s3')
    keys = []
    ret = conn.list_objects(Bucket=bucket)
    print(ret)
    if 'Contents' not in ret:
        return []
    # Make this a generator in future and use the marker:
    # https://boto3.readthedocs.io/en/latest/reference/services/
    #     s3.html#S3.Client.list_objects
    for key in conn.list_objects(Bucket=bucket)['Contents']:
        keys.append('s3://' + bucket + '/' + key['Key'])
    return keys