code: def setup_mturk_connection(self):
          ''' Connect to turk '''
          if ((self.aws_access_key_id == 'YourAccessKeyId') or
                  (self.aws_secret_access_key == 'YourSecretAccessKey')):
              print "AWS access key not set in ~/.psiturkconfig; please enter a valid access key."
              assert False
  
          if self.is_sandbox:
              endpoint_url = 'https://mturk-requester-sandbox.us-east-1.amazonaws.com'
          else:
              endpoint_url = 'https://mturk-requester.us-east-1.amazonaws.com'
  
          self.mtc = boto3.client('mturk',
                  region_name='us-east-1',
                  aws_access_key_id=self.aws_access_key_id,
                  aws_secret_access_key=self.aws_secret_access_key,
                  endpoint_url=endpoint_url)
          return Truf setup_mturk_connection(self):
          ''' Connect to turk '''
          if ((self.aws_access_key_id == 'YourAccessKeyId') or
                  (self.aws_secret_access_key == 'YourSecretAccessKey')):
              print "AWS access key not set in ~/.psiturkconfig; please enter a valid access key."
              assert False
  
          if self.is_sandbox:
              endpoint_url = 'https://mturk-requester-sandbox.us-east-1.amazonaws.com'
          else:
              endpoint_url = 'https://mturk-requester.us-east-1.amazonaws.com'
  
          self.mtc = boto3.client('mturk',
                  region_name='us-east-1',
                  aws_access_key_id=self.aws_access_key_id,
                  aws_secret_access_key=self.aws_secret_access_key,
                  endpoint_url=endpoint_url)
          return True
docs: Connect to turk