original_docstring: Uses the cookie generated by cURL to fetch an XML, and applies a file
      name filter to only select certain files for download.
docstring: Uses the cookie generated by cURL to fetch an XML, and applies a file
  name filter to only select certain files for download.
docstring_tokens: Uses the cookie generated by cURL to fetch an XML and applies a file name filter to only select certain files for download .
code: def parse_xml(x, cookie, flt):
      """Uses the cookie generated by cURL to fetch an XML, and applies a file
      name filter to only select certain files for download."""
      #   Create another temporary named file for the XML output
      xml_out = tempfile.NamedTemporaryFile(
          mode='w+t',
          prefix='JMM_JGI_XML_',
          suffix='.xml',
          delete=False)
      #   Use cURL to download the XML, passing the cookies we generated
      #   earlier to authenticate.
      cmd = [
          'curl',
          x,
          '-b',
          cookie.name,
          '-o',
          xml_out.name
          ]
      #   Execute the command
      p = subprocess.Popen(
          cmd,
          shell=False,
          stdout=subprocess.PIPE,
          stderr=subprocess.PIPE)
      out, err = p.communicate()
      #   Then, read the XML back from the file
      xml = xml_out.read()
      #   Convert it to an element tree for easy access
      xml_tree = ElementTree.fromstring(xml)
      #   Get all files
      #   And start empty lists to house the URLs and their checksums
      urls = []
      md5s = []
      for elem in xml_tree.findall('.//file'):
          #   if the URL ends in a certain suffix, then save it
          if flt in elem.attrib.get('url'):
              url = elem.attrib.get('url')
              md5 = elem.attrib.get('md5')
              urls.append(url)
              md5s.append(md5)
      #   Delete the XML temp file
      os.remove(xml_out.name)
      return zip(urls, md5s)
code_tokens: def parse_xml ( x , cookie , flt ) : xml_out = tempfile . NamedTemporaryFile ( mode = 'w+t' , prefix = 'JMM_JGI_XML_' , suffix = '.xml' , delete = False ) cmd = [ 'curl' , x , '-b' , cookie . name , '-o' , xml_out . name ] p = subprocess . Popen ( cmd , shell = False , stdout = subprocess . PIPE , stderr = subprocess . PIPE ) out , err = p . communicate ( ) xml = xml_out . read ( ) xml_tree = ElementTree . fromstring ( xml ) urls = [ ] md5s = [ ] for elem in xml_tree . findall ( './/file' ) : if flt in elem . attrib . get ( 'url' ) : url = elem . attrib . get ( 'url' ) md5 = elem . attrib . get ( 'md5' ) urls . append ( url ) md5s . append ( md5 ) os . remove ( xml_out . name ) return zip ( urls , md5s )
short_docstring: Uses the cookie generated by cURL to fetch an XML, and applies a file
  name filter to only select certain files for download.
short_docstring_tokens: Uses the cookie generated by cURL to fetch an XML and applies a file name filter to only select certain files for download .
comment: """Uses the cookie generated by cURL to fetch an XML, and applies a file
      name filter to only select certain files for download."""$SEP$#   Create another temporary named file for the XML output$SEP$#   Use cURL to download the XML, passing the cookies we generated$SEP$#   earlier to authenticate.$SEP$#   Execute the command$SEP$#   Then, read the XML back from the file$SEP$#   Convert it to an element tree for easy access$SEP$#   Get all files$SEP$#   And start empty lists to house the URLs and their checksums$SEP$#   if the URL ends in a certain suffix, then save it$SEP$#   Delete the XML temp file