def register(context, runtime_version):
    context.register_function(cast)
    context.register_function(new)
    context.register_function(new_from_dict)
    context.register_function(id_)
    context.register_function(super_)
    context.register_function(psuper)
    context.register_function(require)
    context.register_function(find)
    context.register_function(sleep_)
    context.register_function(type_)
    context.register_function(name)
    context.register_function(obj_attribution)
    context.register_function(op_dot)
    context.register_function(ns_resolve)
    context.register_function(equal)
    context.register_function(not_equal)

    if runtime_version <= constants.RUNTIME_VERSION_1_1:
        context2 = context.create_child_context()
        for t in ("id", "cast", "super", "psuper", "type"):
            for spec in utils.to_extension_method(t, context):
                context2.register_function(spec)
        return context2
    return context
示例#2
0
def register(context, runtime_version):
    context.register_function(cast)
    context.register_function(new)
    context.register_function(new_from_dict)
    context.register_function(id_)
    context.register_function(super_)
    context.register_function(psuper)
    context.register_function(require)
    context.register_function(find)
    context.register_function(sleep_)
    context.register_function(typeinfo)
    context.register_function(typeinfo_for_class)
    context.register_function(name)
    context.register_function(obj_attribution)
    context.register_function(obj_attribution_static)
    context.register_function(op_dot)
    context.register_function(op_dot_static)
    context.register_function(ns_resolve)
    context.register_function(ns_resolve_unary)
    reflection.register(context)
    context.register_function(is_instance_of)
    if runtime_version <= constants.RUNTIME_VERSION_1_3:
        context.register_function(type_legacy)
    else:
        context.register_function(type_)

    if runtime_version <= constants.RUNTIME_VERSION_1_1:
        context = context.create_child_context()
        for t in ("id", "cast", "super", "psuper", "type"):
            for spec in utils.to_extension_method(t, context):
                context.register_function(spec)

    context.register_function(type_from_name)

    return context
示例#3
0
def register(context, runtime_version):
    context.register_function(cast)
    context.register_function(new)
    context.register_function(new_from_dict)
    context.register_function(id_)
    context.register_function(super_)
    context.register_function(psuper)
    context.register_function(require)
    context.register_function(find)
    context.register_function(sleep_)
    context.register_function(typeinfo)
    context.register_function(typeinfo_for_class)
    context.register_function(name)
    context.register_function(obj_attribution)
    context.register_function(obj_attribution_static)
    context.register_function(op_dot)
    context.register_function(op_dot_static)
    context.register_function(ns_resolve)
    context.register_function(ns_resolve_unary)
    reflection.register(context)
    context.register_function(is_instance_of)
    if runtime_version <= constants.RUNTIME_VERSION_1_3:
        context.register_function(type_legacy)
    else:
        context.register_function(type_)

    if runtime_version <= constants.RUNTIME_VERSION_1_1:
        context = context.create_child_context()
        for t in ('id', 'cast', 'super', 'psuper', 'type'):
            for spec in utils.to_extension_method(t, context):
                context.register_function(spec)

    context.register_function(type_from_name)

    return context
示例#4
0
def register(context, runtime_version):
    context.register_function(cast)
    context.register_function(new)
    context.register_function(new_from_dict)
    context.register_function(id_)
    context.register_function(super_)
    context.register_function(psuper)
    context.register_function(require)
    context.register_function(find)
    context.register_function(sleep_)
    context.register_function(type_)
    context.register_function(name)
    context.register_function(obj_attribution)
    context.register_function(op_dot)
    context.register_function(ns_resolve)
    context.register_function(equal)
    context.register_function(not_equal)

    if runtime_version <= constants.RUNTIME_VERSION_1_1:
        context2 = context.create_child_context()
        for t in ('id', 'cast', 'super', 'psuper', 'type'):
            for spec in utils.to_extension_method(t, context):
                context2.register_function(spec)
        return context2
    return context
示例#5
0
def register(context, tuples):
    if tuples:
        context.register_function(build_tuple)
        context.register_function(to_list)
        context.register_function(tuple_)

    context.register_function(dict_)
    context.register_function(dict_, name='#map')
    context.register_function(indexer, name='#indexer', exclusive=True)
    context.register_function(range_)
    context.register_function(switch, exclusive=True)
    context.register_function(as_)
    context.register_function(op_dot_context)
    context.register_function(dict_keyword_access)

    for t in ('get', 'list', 'bool', 'int', 'float', 'select', 'where', 'join',
              'sum', 'take_while'):
        for spec in utils.to_extension_method(t, context):
            context.register_function(spec)
示例#6
0
def register(context, tuples):
    if tuples:
        context.register_function(build_tuple)
        context.register_function(to_list)
        context.register_function(tuple_)

    context.register_function(dict_)
    context.register_function(dict_, name='#map')
    context.register_function(indexer, name='#indexer', exclusive=True)
    context.register_function(range_)
    context.register_function(switch, exclusive=True)
    context.register_function(as_)
    context.register_function(op_dot_context)
    context.register_function(dict_keyword_access)

    for t in ('get', 'list', 'bool', 'int', 'float', 'select', 'where',
              'join', 'sum', 'take_while'):
        for spec in utils.to_extension_method(t, context):
            context.register_function(spec)
def get_context(runtime_version):
    context = yaql_integration.create_empty_context()
    context.register_function(base64decode)
    context.register_function(base64encode)
    context.register_function(pselect)
    context.register_function(bind)
    context.register_function(random_name)
    context.register_function(patch_)
    context.register_function(logger)

    if runtime_version <= constants.RUNTIME_VERSION_1_1:
        context.register_function(substr)
        context.register_function(first_or_default)

        root_context = yaql_integration.create_context(runtime_version)
        for t in ('to_lower', 'to_upper', 'trim', 'join', 'split',
                  'starts_with', 'ends_with', 'matches', 'replace', 'flatten'):
            for spec in utils.to_extension_method(t, root_context):
                context.register_function(spec)
    return context
def get_context(runtime_version):
    context = yaql_integration.create_empty_context()
    context.register_function(base64decode)
    context.register_function(base64encode)
    context.register_function(pselect)
    context.register_function(bind)
    context.register_function(random_name)
    context.register_function(patch_)
    context.register_function(logger)

    if runtime_version <= constants.RUNTIME_VERSION_1_1:
        context.register_function(substr)
        context.register_function(first_or_default)

        root_context = yaql_integration.create_context(runtime_version)
        for t in ('to_lower', 'to_upper', 'trim', 'join', 'split',
                  'starts_with', 'ends_with', 'matches', 'replace',
                  'flatten'):
            for spec in utils.to_extension_method(t, root_context):
                context.register_function(spec)
    return context
示例#9
0
def register(context, runtime_version):
    context.register_function(cast)
    context.register_function(new)
    context.register_function(new_from_dict)
    context.register_function(id_)
    context.register_function(super_)
    context.register_function(psuper)
    context.register_function(require)
    context.register_function(find)
    context.register_function(sleep_)
    context.register_function(type_)
    context.register_function(name)
    context.register_function(obj_attribution)
    context.register_function(op_dot)
    context.register_function(ns_resolve)
    context.register_function(equal)
    context.register_function(not_equal)

    if runtime_version < constants.RUNTIME_VERSION_2_0:
        for t in ('id', 'cast', 'super', 'psuper', 'type'):
            for spec in utils.to_extension_method(t, context):
                context.register_function(spec)