import sys
import boto3

BUCKET_NAME = 'mitLookit'

def get_all_study_attachments(study_uuid):
    s3 = boto3.resource('s3')

    bucket = s3.Bucket(BUCKET_NAME)
    study_files = []
    for key in bucket.objects.filter(Prefix=f'videoStream_{study_uuid}'):
        study_files.append(key)
    return study_files

if __name__ == '__main__':
    study_uuid = sys.argv[1]
    get_study_keys(study_uuid)

import sys
import boto3

BUCKET_NAME = 'mitLookit'

def get_all_study_attachments(study_uuid):
    s3 = boto3.resource('s3')
    bucket = s3.Bucket(BUCKET_NAME)
    return bucket.objects.filter(Prefix=f'videoStream_{study_uuid}')

if __name__ == '__main__':
    study_uuid = sys.argv[1]
    get_study_keys(study_uuid)

Remove looping through items and appending them to list.
Remove looping through items and appending them to list.

  import sys
  import boto3
  
  BUCKET_NAME = 'mitLookit'
  
  def get_all_study_attachments(study_uuid):
      s3 = boto3.resource('s3')
- 
      bucket = s3.Bucket(BUCKET_NAME)
-     study_files = []
-     for key in bucket.objects.filter(Prefix=f'videoStream_{study_uuid}'):
+     return bucket.objects.filter(Prefix=f'videoStream_{study_uuid}')
-         study_files.append(key)
-     return study_files
  
  if __name__ == '__main__':
      study_uuid = sys.argv[1]
      get_study_keys(study_uuid)
  
Remove looping through items and appending them to list.
## Code Before:
import sys
import boto3

BUCKET_NAME = 'mitLookit'

def get_all_study_attachments(study_uuid):
    s3 = boto3.resource('s3')

    bucket = s3.Bucket(BUCKET_NAME)
    study_files = []
    for key in bucket.objects.filter(Prefix=f'videoStream_{study_uuid}'):
        study_files.append(key)
    return study_files

if __name__ == '__main__':
    study_uuid = sys.argv[1]
    get_study_keys(study_uuid)

## Instruction:
Remove looping through items and appending them to list.
## Code After:
import sys
import boto3

BUCKET_NAME = 'mitLookit'

def get_all_study_attachments(study_uuid):
    s3 = boto3.resource('s3')
    bucket = s3.Bucket(BUCKET_NAME)
    return bucket.objects.filter(Prefix=f'videoStream_{study_uuid}')

if __name__ == '__main__':
    study_uuid = sys.argv[1]
    get_study_keys(study_uuid)
