当前位置: 首页>>代码示例>>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;未经允许,请勿转载。