code: def download_threads(self, url):
          
          # Set the name of the allele file - split the gene name from the URL
          output_file = os.path.join(self.output_path, '{}.tfa'.format(os.path.split(url)[-1]))
          # Check to see whether the file already exists, and if it is unusually small
          size = 0
          try:
              stats = os.stat(output_file)
              size = stats.st_size
          except FileNotFoundError:
              pass
          # If the file doesn't exist, or is truncated, proceed with the download
          if not os.path.isfile(output_file) or size <= 100:
              # Create a new session
              session = OAuth1Session(self.consumer_key,
                                      self.consumer_secret,
                                      access_token=self.session_token,
                                      access_token_secret=self.session_secret)
              # The allele file on the server is called alleles_fasta. Update the URL appropriately
              r = session.get(url + '/alleles_fasta')
              if r.status_code == 200 or r.status_code == 201:
                  if re.search('json', r.headers['content-type'], flags=0):
                      decoded = r.json()
                  else:
                      decoded = r.text
                  # Write the allele to disk
                  with open(output_file, 'w') as allele:
                      allele.write(decoded)
docs: Download the allele files