Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(24)  |  Call(16)  |  Derive(0)  |  Import(8)

src/a/s/AsyncStageout-HEAD/src/python/AsyncStageOut/TransferWorker.py   AsyncStageout(Download)
import re
from WMCore.Credential.Proxy import Proxy
from AsyncStageOut import getHashLfn
from AsyncStageOut import getFTServer
from AsyncStageOut import getDNFromUserName
        for lfn in files:
            if lfn['value'].find('temp') > 1:
                docId = getHashLfn(lfn['value'])
                self.logger.debug("Marking acquired %s" % docId)
                # Load document to get the retry_count
        lfn_to_update = []
        for lfn in files:
            self.logger.info("Marking good %s" % getHashLfn(lfn))
            self.logger.debug("Marking good %s" % lfn)
            try:
                document = self.db.document( getHashLfn(lfn) )
                    data['lfn'] = outputLfn
                    data['last_update'] = last_update
                    updateUri = "/" + self.db.name + "/_design/AsyncTransfer/_update/updateJobs/" + getHashLfn(lfn)
                    updateUri += "?" + urllib.urlencode(data)
                    self.db.makeRequest(uri = updateUri, type = "PUT", decode = False)

src/a/s/AsyncStageout-HEAD/src/python/AsyncStageOut/PublisherWorker.py   AsyncStageout(Download)
from WMCore.Database.CMSCouch import CouchServer
from WMCore.Credential.Proxy import Proxy
from AsyncStageOut import getHashLfn
from WMCore.Services.PhEDEx.PhEDEx import PhEDEx
from RestClient.ErrorHandling.RestClientExceptions import HTTPError
                lfn_db = self.lfn_map[lfn]
                updateUri = "/" + self.db.name + "/_design/DBSPublisher/_update/updateFile/" + \
                            getHashLfn(lfn_db)
                updateUri += "?" + urllib.urlencode(data)
                self.logger.info(updateUri)
            data = {}
            lfn_db = self.lfn_map[lfn]
            docId = getHashLfn(lfn_db)
            self.logger.info("Marking failed %s of %s" % (docId, lfn_db))
            # Load document to get the retry_count

src/a/s/AsyncStageout-HEAD/src/python/AsyncStageOut/AnalyticsDaemon.py   AsyncStageout(Download)
from WMCore.WorkerThreads.BaseWorkerThread import BaseWorkerThread
 
from AsyncStageOut import getHashLfn
import time
import traceback
                                status[file['value']] = 'failed'
                                lfn = file['value']
                                docId = getHashLfn(lfn)
                                # Load document to get the failure reason from output file
                                try:
                                lfn = file['value'].replace('store', 'store/temp', 1)
                                status[lfn] = 'failed'
                                docId = getHashLfn(lfn)
                                # Load document to get the failure reason from output file
                                try:

src/a/s/AsyncStageout-HEAD/src/python/AsyncStageOut/Plugins/JSM.py   AsyncStageout(Download)
from AsyncStageOut.Plugins.Source import Source
import datetime
from AsyncStageOut import getHashLfn
 
class JSM(Source):
            value['lfn'] = value["_id"]
            value['user'] = value["_id"].split('/')[4]
            value['_id'] = getHashLfn( value["_id"] )
            value['size'] = value['size']
            value['retry_count'] = []

src/a/s/AsyncStageout-HEAD/src/python/AsyncStageOut/Plugins/Dummy.py   AsyncStageout(Download)
import random
from AsyncStageOut.Plugins.Source import Source
from AsyncStageOut import getHashLfn
import time
 
            user = random.choice(users)
            lfn = lfn_base % (user, random.randint(1000, 9999), i)
            id = getHashLfn( lfn )
            workflow = 'workflow-%s-%s' % (user, random.randint(1, 100))
            results.append( {'_id': id,

src/a/s/AsyncStageout-HEAD/src/python/AsyncStageOut/Plugins/CentralMonitoring.py   AsyncStageout(Download)
import datetime
import time
from AsyncStageOut import getHashLfn
 
class CentralMonitoring(Source):
            value['lfn'] = value["_id"]
            value['user'] = value["_id"].split('/')[4]
            value['_id'] = getHashLfn( value["_id"] )
            value['size'] = value['size']
            value['retry_count'] = []

src/a/s/AsyncStageout-HEAD/test/python/AsyncStageOut_t/LoadDummyData.py   AsyncStageout(Download)
"""
Insert dummy data into the AsyncTransfer CouchDB instance
"""
from AsyncStageOut import getHashLfn
import random
    user =  random.choice(users)
    dest = users_dest[user]
    _id=getHashLfn(lfn_base % (user,id , i))
    state='new'
    file_doc = {'_id': '%s' %(_id) ,

src/a/s/AsyncStageout-HEAD/test/python/AsyncStageOut_t/AsyncTransfer_t.py   AsyncStageout(Download)
from AsyncStageOut_t.fakeDaemon import fakeDaemon
from AsyncStageOut_t.AsyncTransferTest import AsyncTransferTest
from AsyncStageOut import getHashLfn
import datetime
import hashlib
        doc = {}
        lfn = random.choice(self.lfn) + doc_id
        doc['_id'] = getHashLfn(lfn)
        doc['dn'] = "/C=IT/O=INFN/OU=Personal Certificate/L=Perugia/CN=Hassen Riahi"
        doc['workflow'] = 'someWorkflow'
        """
        doc = {}
        doc['_id'] = getHashLfn("/this/is/a/lfnA")
        doc['dn'] = "/C=IT/O=INFN/OU=Personal Certificate/L=Perugia/CN=Hassen Riahi"
        doc['workflow'] = 'someWorkflow'
        """
        lfn = "/My/lfn/path"
        hashedLfn = getHashLfn(lfn)
        assert hashlib.sha224(lfn).hexdigest() == hashedLfn