• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python world.res_filename函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: i_download_anomaly_score_file

def i_download_anomaly_score_file(step, filename):
    file_object = world.api.download_batch_anomaly_score(
        world.batch_anomaly_score, filename=res_filename(filename))
    assert file_object is not None
    world.output = file_object
开发者ID:GregTarr,项目名称:python,代码行数:5,代码来源:create_batch_prediction_steps.py


示例17: i_download_predictions_file

def i_download_predictions_file(step, filename):
    file_object = world.api.download_batch_prediction(
        world.batch_prediction, filename=res_filename(filename))
    assert file_object is not None
    world.output = file_object
开发者ID:GregTarr,项目名称:python,代码行数:5,代码来源:create_batch_prediction_steps.py


示例18: i_create_local_ensemble_from_file

def i_create_local_ensemble_from_file(step, export_file):
    world.local_ensemble = Ensemble(res_filename(export_file))
开发者ID:bigmlcom,项目名称:python,代码行数:2,代码来源:create_ensemble_steps.py


示例19: files_equal

def files_equal(step, local_file, data):
    contents_local_file = open(res_filename(local_file)).read()
    contents_data = open(res_filename(data)).read()
    assert contents_local_file == contents_data
开发者ID:KrishnaHarish,项目名称:python,代码行数:4,代码来源:create_dataset_steps.py


示例20: i_export_a_dataset

def i_export_a_dataset(step, local_file):
    world.api.download_dataset(world.dataset['resource'],
                               filename=res_filename(local_file))
开发者ID:KrishnaHarish,项目名称:python,代码行数:3,代码来源:create_dataset_steps.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python world.show_doc函数代码示例发布时间:2022-05-26
下一篇:
Python utils.run_cmd函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap