当前位置: 首页>>代码示例>>Python>>正文


Python world.res_filename函数代码示例

本文整理汇总了Python中world.res_filename函数的典型用法代码示例。如果您正苦于以下问题:Python res_filename函数的具体用法?Python res_filename怎么用?Python res_filename使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了res_filename函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: check_summary_like_expected

def check_summary_like_expected(step, summary_file, expected_file):
    summary_contents = []
    expected_contents = []
    with UnicodeReader(res_filename(summary_file)) as summary_handler:
        for line in summary_handler:
            summary_contents.append(line)
    with UnicodeReader(res_filename(expected_file)) as expected_handler:
        for line in expected_handler:
            expected_contents.append(line)
    eq_(summary_contents, expected_contents)
开发者ID:GregTarr,项目名称:python,代码行数:10,代码来源:fields_steps.py

示例2: i_create_a_multivote

def i_create_a_multivote(step, predictions_file):
    predictions_file = res_filename(predictions_file)
    try:
        with open(predictions_file, 'r') as predictions_file:
            world.multivote = MultiVote(json.load(predictions_file))
    except IOError:
        assert False, "Failed to read %s" % predictions_file
开发者ID:GregTarr,项目名称:python,代码行数:7,代码来源:compute_multivote_prediction_steps.py

示例3: i_upload_a_file_with_args

def i_upload_a_file_with_args(step, file, args):
    resource = world.api.create_source(res_filename(file), json.loads(args))
    # update status
    world.status = resource['code']
    world.location = resource['location']
    world.source = resource['object']
    # save reference
    world.sources.append(resource['resource'])
开发者ID:david-x-chen,项目名称:python,代码行数:8,代码来源:create_source_steps.py

示例4: i_upload_a_file

def i_upload_a_file(step, file):
    resource = world.api.create_source(res_filename(file), {"project": world.project_id})
    # update status
    world.status = resource["code"]
    world.location = resource["location"]
    world.source = resource["object"]
    # save reference
    world.sources.append(resource["resource"])
开发者ID:bigmlcom,项目名称:python,代码行数:8,代码来源:create_source_steps.py

示例5: the_local_association_set_is_like_file

def the_local_association_set_is_like_file(step, filename):
    filename = res_filename(filename)
    """ Uncomment if different text settings are used
    with open(filename, "w") as filehandler:
        json.dump(result, filehandler)
    """
    with open(filename) as filehandler:
        file_result = json.load(filehandler)
    eq_(world.local_association_set, file_result)
开发者ID:javinp,项目名称:python,代码行数:9,代码来源:compare_predictions_steps.py

示例6: i_upload_a_file_with_args

def i_upload_a_file_with_args(step, file, args):
    args = json.loads(args)
    args.update({"project": world.project_id})
    resource = world.api.create_source(res_filename(file), args)
    # update status
    world.status = resource["code"]
    world.location = resource["location"]
    world.source = resource["object"]
    # save reference
    world.sources.append(resource["resource"])
开发者ID:bigmlcom,项目名称:python,代码行数:10,代码来源:create_source_steps.py

示例7: the_association_set_is_like_file

def the_association_set_is_like_file(step, filename):
    filename = res_filename(filename)
    result = world.association_set.get("association_set",{}).get("result", [])
    """ Uncomment if different text settings are used
    with open(filename, "w") as filehandler:
        json.dump(result, filehandler)
    """
    with open(filename) as filehandler:
        file_result = json.load(filehandler)
    eq_(result, file_result)
开发者ID:javinp,项目名称:python,代码行数:10,代码来源:compare_predictions_steps.py

示例8: i_upload_a_file_from_stdin

def i_upload_a_file_from_stdin(step, file):
    file_name = res_filename(file)
    with open(file_name, 'rb') as file_handler:
        resource = world.api.create_source(file_handler, \
            {'project': world.project_id})
        # update status
        world.status = resource['code']
        world.location = resource['location']
        world.source = resource['object']
        # save reference
        world.sources.append(resource['resource'])
开发者ID:bigmlcom,项目名称:python,代码行数:11,代码来源:create_source_steps.py

示例9: i_create_using_dict_data

def i_create_using_dict_data(step, data):
    # slurp CSV file to local variable
    mode = "rb"
    if sys.version > "3":
        mode = "rt"
    with open(res_filename(data), mode) as fid:
        reader = csv.DictReader(fid)
        dict_data = [row for row in reader]
    # create source
    resource = world.api.create_source(dict_data, {"project": world.project_id})
    # update status
    world.status = resource["code"]
    world.location = resource["location"]
    world.source = resource["object"]
    # save reference
    world.sources.append(resource["resource"])
开发者ID:bigmlcom,项目名称:python,代码行数:16,代码来源:create_source_steps.py

示例10: i_create_using_dict_data

def i_create_using_dict_data(step, data):
    # slurp CSV file to local variable
    mode = 'rb'
    if sys.version > '3':
        mode = 'rt'
    with open(res_filename(data), mode) as fid:
        reader = csv.DictReader(fid)
        dict_data = [row for row in reader]
    # create source
    resource = world.api.create_source(dict_data)
    # update status
    world.status = resource['code']
    world.location = resource['location']
    world.source = resource['object']
    # save reference
    world.sources.append(resource['resource'])
开发者ID:david-x-chen,项目名称:python,代码行数:16,代码来源:create_source_steps.py

示例11: i_export_cluster

def i_export_cluster(step, filename):
    world.api.export(world.cluster.get('resource'),
                     filename=res_filename(filename))
开发者ID:bigmlcom,项目名称:python,代码行数:3,代码来源:create_cluster_steps.py

示例12: i_export_time_series

def i_export_time_series(step, filename):
    world.api.export(world.time_series.get('resource'),
                     filename=res_filename(filename))
开发者ID:bigmlcom,项目名称:python,代码行数:3,代码来源:create_time_series_steps.py

示例13: i_create_local_time_series_from_file

def i_create_local_time_series_from_file(step, export_file):
    world.local_time_series = TimeSeries(res_filename(export_file))
开发者ID:bigmlcom,项目名称:python,代码行数:2,代码来源:create_time_series_steps.py

示例14: i_create_local_anomaly_from_file

def i_create_local_anomaly_from_file(step, export_file):
    world.local_anomaly = Anomaly(res_filename(export_file))
开发者ID:bigmlcom,项目名称:python,代码行数:2,代码来源:create_anomaly_steps.py

示例15: import_summary_file

def import_summary_file(step, summary_file):
    world.fields_struct = world.fields.new_fields_structure( \
        csv_attributes_file=res_filename(summary_file))
开发者ID:GregTarr,项目名称:python,代码行数:3,代码来源:fields_steps.py


注:本文中的world.res_filename函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。