code: def from_file(cls, filename):
          
          import csv
          with open(filename, 'r') as f:
              reader = csv.DictReader(f)
              row = reader.next()  # Only one row in the file
          try:
              cls.ACCESS_KEY_ID = row['Access Key Id']
              cls.SECRET_ACCESS_KEY = row['Secret Access Key']
          except KeyError:
              raise IOError('Invalid credentials format')
docs: Load ACCESS_KEY_ID and SECRET_ACCESS_KEY from csv
          generated by Amazon's IAM.
  
          >>> ec2.credentials.from_file('credentials.csv')