當前位置: 首頁>>代碼示例>>Python>>正文


Python __builtin__.False方法代碼示例

本文整理匯總了Python中__builtin__.False方法的典型用法代碼示例。如果您正苦於以下問題:Python __builtin__.False方法的具體用法?Python __builtin__.False怎麽用?Python __builtin__.False使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在__builtin__的用法示例。


在下文中一共展示了__builtin__.False方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: get_data

# 需要導入模塊: import __builtin__ [as 別名]
# 或者: from __builtin__ import False [as 別名]
def get_data(problem, n_train, n_batch):
        
    if problem == 'cifar10':
        # Load data
        data_train, data_valid = G.misc.data.cifar10(False)
    if problem == 'svhn':
        # Load data
        data_train, data_valid = G.misc.data.svhn(False, True)
    elif problem == 'mnist':
        # Load data
        validset = False
        if validset:
            data_train, data_valid, data_test = G.misc.data.mnist_binarized(validset, False)
        else:
            data_train, data_valid = G.misc.data.mnist_binarized(validset, False)
        data_train['x'] = data_train['x'].reshape((-1,1,28,28))
        data_valid['x'] = data_valid['x'].reshape((-1,1,28,28))
    elif problem == 'lfw':
        data_train = G.misc.data.lfw(False,True)
        data_valid = G.ndict.getRows(data_train, 0, 1000)
    

    data_init = {'x':data_train['x'][:n_batch]}
        
    if n_train > 0:
        data_train = G.ndict.getRows(data_train, 0, n_train)
        data_valid = G.ndict.getRows(data_valid, 0, n_train)
    
    return data_train, data_valid, data_init 
開發者ID:openai,項目名稱:iaf,代碼行數:31,代碼來源:train.py

示例2: getJobResult_wait_ForJobProgressCycle

# 需要導入模塊: import __builtin__ [as 別名]
# 或者: from __builtin__ import False [as 別名]
def getJobResult_wait_ForJobProgressCycle(jobID, APIAccessKey, BaseURL):
    
    isInCycle = True
    cycleCompleteCount = 0
    jobStatus = "unset" # "inprogress", "complete", "error_generic", "error_timeout"
    numOfCyclesToTry = 1800
    
    while(isInCycle == True):
        
         
        # get Job Progress value
        currentJobProgress = check_JobProgress(jobID, APIAccessKey, BaseURL)
        printMe("Current Job Progress: " + str(currentJobProgress) + ".  JobID: " + str(jobID))
        time.sleep(1) 
        
        # Process Job Status
        if(currentJobProgress == 100):
            jobStatus = "complete"
            isInCycle = False
        elif(currentJobProgress == -1):
            jobStatus = "error_generic"
            isInCycle = False
        else:
            jobStatus = "inprogress"
            isInCycle = True
            
        # Should we bail out of this loop?
        if(cycleCompleteCount > numOfCyclesToTry):
            jobStatus = "error_timeout"
            isInCycle = False
        
        cycleCompleteCount += 1
        
        # For long wait times, echo the cycle
        if(cycleCompleteCount % 50 == 0):
            printMe("Still working.... Cycle: " + str(cycleCompleteCount))
        
        
        
        
    # Process return (did the job fail or succeed..)
    printMe("Result of Job Status Cycle: " + str(jobStatus))
    if(jobStatus == "complete"):
        return True
    else:
        return False
    

# attempt to Convert epochTime to ints and then sort 
開發者ID:nasa,項目名稱:RHEAS,代碼行數:51,代碼來源:ClimateSERV_API_Access.py


注:本文中的__builtin__.False方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。