def _process_record(self, header, element):

        fedora_id = self._get_id(header)
        
        if self._stream is None:
            url = '%s/objects/%s/objectXML' % (self._fedora_url,
                                               fedora_id)
        else:
            # get only a specific data stream
            url = '%s/get/%s/%s' % (self._fedora_url,
                                    fedora_id, 
                                    self._stream)

        if self._user and self._pass:
            password = ('%s:%s' % (self._user, self._pass)).strip().encode('base64')
            headers = {'Authorization': 'Basic %s' % password}
            request = urllib2.Request(url, headers=headers)
        else:
            request = urllib2.Request(url)

        try:
            fp = urllib2.urlopen(request)
            xml_data = fp.read()
            fp.close()
        except urllib2.HTTPError, err:
            self._log.warning('HTTP %s -> Can not get Fedora data: %s' % (err.code, url))
            return False

        directory = hashlib.md5(fedora_id).hexdigest()[:3]

        path = os.path.join(self._path, directory)
        if not os.path.isdir(path):
            os.mkdir(path)
                
        path = os.path.join(path, '%s.xml' % fedora_id)
        
        fp = open(path, 'w')
        fp.write(xml_data)
        fp.close()
        return True
dataset/ETHPy150Open infrae/moai/moai/provider/fedora.py/FedoraBasedContentProvider._process_record/original