Home
last modified time | relevance | path

Searched refs:from_string (Results 1 – 25 of 90) sorted by relevance

1234

/external/python/jinja/tests/
Dtest_filters.py35 tmpl = env.from_string('{{ "foo bar"|capitalize }}')
39 tmpl = env.from_string('{{ "foo"|center(9) }}')
43 tmpl = env.from_string(
59 t = env.from_string(f"{{{{ foo|dictsort({args}) }}}}")
64 tmpl = env.from_string("{{ foo|batch(3)|list }}|{{ foo|batch(3, 'X')|list }}")
72 tmpl = env.from_string("{{ foo|slice(3)|list }}|{{ foo|slice(3, 'X')|list }}")
80 tmpl = env.from_string("""{{ '<">&'|escape }}""")
88 tmpl = env.from_string("{{ foo|trim(chars) }}")
93 tmpl = env.from_string("""{{ foo|striptags }}""")
102 tmpl = env.from_string(
[all …]
Dtest_lexnparse.py45 tmpl = env.from_string(
52 tmpl = env.from_string("1 {%- raw -%} 2 {%- endraw -%} 3")
59 tmpl = env.from_string("bar\n{% raw %}\n {{baz}}2 spaces\n{% endraw %}\nfoo")
66 tmpl = env.from_string(
73 tmpl = env.from_string(
81 tmpl = env.from_string(
95 tmpl = env.from_string(f"{{{{ {char!r} }}}}")
97 assert env.from_string('{{ "\N{HOT SPRINGS}" }}').render() == "\u2668"
102 tmpl = env.from_string("""{{ 'foo'|pprint }}|{{ 'bär'|pprint }}""")
118 tmpl = env.from_string("1\n2\r\n3\n4\n")
[all …]
Dtest_imports.py28 t = test_env.from_string('{% import "module" as m %}{{ m.test() }}')
30 t = test_env.from_string(
34 t = test_env.from_string(
38 t = test_env.from_string('{% from "module" import test %}{{ test() }}')
40 t = test_env.from_string(
44 t = test_env.from_string(
50 test_env.from_string('{% from "foo" import bar %}')
51 test_env.from_string('{% from "foo" import bar, baz %}')
54 test_env.from_string('{% from "foo" import %}')
58 test_env.from_string('{% from "foo" import bar, %}')
[all …]
Dtest_core_tags.py17 tmpl = env.from_string("{% for item in seq %}{{ item }}{% endfor %}")
21 tmpl = env.from_string("{% for item in seq %}XXX{% else %}...{% endfor %}")
25 tmpl = env.from_string("{% for item in [] %}{% else %}{{ item }}{% endfor %}")
29 tmpl = env.from_string("<{% for item in seq %}{% else %}{% endfor %}>")
35 tmpl = env.from_string(
70 tmpl = env.from_string(
79 tmpl = env.from_string(
89 tmpl = env.from_string(
98 tmpl = env.from_string("{% for item in seq %}{% endfor %}{{ item }}")
103 tmpl = env.from_string("{% for item in iter %}{{ item }}{% endfor %}")
[all …]
Dtest_async.py135 t = test_env_async.from_string('{% import "module" as m %}{{ m.test() }}')
137 t = test_env_async.from_string(
141 t = test_env_async.from_string(
145 t = test_env_async.from_string('{% from "module" import test %}{{ test() }}')
147 t = test_env_async.from_string(
151 t = test_env_async.from_string(
157 test_env_async.from_string('{% from "foo" import bar, baz with context %}')
158 test_env_async.from_string('{% from "foo" import bar, baz, with context %}')
159 test_env_async.from_string('{% from "foo" import bar, with context %}')
160 test_env_async.from_string('{% from "foo" import bar, with, context %}')
[all …]
Dtest_api.py32 tmpl = env.from_string("{{ foo.items()|list }}")
34 tmpl = env.from_string('{{ foo|attr("items")()|list }}')
36 tmpl = env.from_string('{{ foo["items"] }}')
41 t = e.from_string("{% for item in seq %}|{{ item }}{% endfor %}")
46 t = e.from_string("<{{ none }}>")
51 t = e.from_string("<{{ value }}>")
61 t = e.from_string("{{ value }}")
70 t = e.from_string("{{ value }}")
81 t = e.from_string("{{ value }}")
149 t = env.from_string("{{ foo }}")
[all …]
Dtest_security.py41 SecurityError, env.from_string("{{ foo.foo() }}").render, foo=PrivateStuff()
43 assert env.from_string("{{ foo.bar() }}").render(foo=PrivateStuff()) == "23"
46 SecurityError, env.from_string("{{ foo._foo() }}").render, foo=PublicStuff()
48 assert env.from_string("{{ foo.bar() }}").render(foo=PublicStuff()) == "23"
49 assert env.from_string("{{ foo.__class__ }}").render(foo=42) == ""
50 assert env.from_string("{{ foo.func_code }}").render(foo=lambda: None) == ""
54 env.from_string("{{ foo.__class__.__subclasses__() }}").render,
60 pytest.raises(SecurityError, env.from_string("{{ [].append(23) }}").render)
61 pytest.raises(SecurityError, env.from_string("{{ {1:2}.clear() }}").render)
67 env.from_string,
[all …]
Dtest_regression.py14 t = env.from_string(
24 t = env.from_string(
35 t = env.from_string(
47 t = env.from_string(
59 t = env.from_string(
71 t = env.from_string(
88 env.from_string("{{ 'test'|testing(some='stuff') }}").render()
97 t = env.from_string(
106 tmpl = env.from_string('{{ "http://www.example.org/<foo"|urlize }}')
113 tmpl = env.from_string(
[all …]
Dtest_asyncfilters.py30 tmpl = env_async.from_string("{{ foo()|first }}")
45 tmpl = env_async.from_string(
61 tmpl = env_async.from_string(
83 tmpl = env_async.from_string(
98 tmpl = env_async.from_string('{{ items()|join("|") }}')
106 tmpl = env2.from_string('{{ ["<foo>", "<span>foo</span>"|safe]|join }}')
117 tmpl = env_async.from_string("""{{ users()|join(', ', 'username') }}""")
123 tmpl = env_async.from_string('{{ items()|reject("odd")|join("|") }}')
129 tmpl = env_async.from_string('{{ items()|reject|join("|") }}')
135 tmpl = env_async.from_string('{{ items()|select("odd")|join("|") }}')
[all …]
Dtest_nativetypes.py17 t = env.from_string("{{ missing is defined }}")
22 t = env.from_string("{{ missing }}")
27 t = env.from_string("{{ 3 + missing }}")
34 t = env.from_string("{{ value|int }}")
41 t = env.from_string("{{ a + b }}")
48 t = env.from_string("{{ a }} + {{ b }}")
55 t = env.from_string("{% for x in value %}{{ x }}{% endfor %}")
62 t = env.from_string("{% for x in value %}{{ x }}{% endfor %}")
69 t = env.from_string("{% for x in value %}{{ x }}{% endfor %}")
87 t = env.from_string(source)
[all …]
Dtest_tests.py13 tmpl = env.from_string("{{ missing is defined }}|{{ true is defined }}")
17 tmpl = env.from_string("""{{ 1 is even }}|{{ 2 is even }}""")
21 tmpl = env.from_string("""{{ 1 is odd }}|{{ 2 is odd }}""")
25 tmpl = env.from_string("""{{ "foo" is lower }}|{{ "FOO" is lower }}""")
112 t = env.from_string(f"{{{{ {op} }}}}")
116 tmpl = env.from_string('{{ "FOO" is upper }}|{{ "foo" is upper }}')
120 tmpl = env.from_string(
153 t = env.from_string(f"{{{{ 2 is {op} }}}}")
157 tmpl = env.from_string("{{ foo is sameas false }}|{{ 0 is sameas false }}")
161 tmpl = env.from_string("{{ foo is sameas none }}")
[all …]
Dtest_ext.py167 t = env.from_string('{% autoescape true %}{{ "<test>" }}{% endautoescape %}')
173 tmpl = env.from_string(
182 tmpl = env.from_string(
193 tmpl = env.from_string(
204 tmpl = env.from_string("{% test %}")
209 tmpl = env.from_string('{% set test_var="test_content" %}{% test %}')
214 tmpl = env.from_string(
231 tmpl = env.from_string("{[[TEST]]}")
237 tmpl = env.from_string("Foo _(bar) Baz")
255 t = env.from_string("Hello\n{% debug %}\nGoodbye")
[all …]
/external/python/oauth2client/tests/
Dtest__pure_python_crypt.py53 signer = crypt.RsaSigner.from_string(self._load_private_key_bytes())
56 verifier = crypt.RsaVerifier.from_string(
62 signer = crypt.RsaSigner.from_string(self._load_private_key_bytes())
65 verifier = crypt.RsaVerifier.from_string(
70 verifier = crypt.RsaVerifier.from_string(
79 verifier = crypt.RsaVerifier.from_string(
86 verifier = crypt.RsaVerifier.from_string(
93 verifier = crypt.RsaVerifier.from_string(
100 verifier = crypt.RsaVerifier.from_string(
111 crypt.RsaVerifier.from_string(cert_bytes, is_x509_cert=True)
[all …]
Dtest__pycrypto_crypt.py40 signer = crypt.PyCryptoSigner.from_string(
44 verifier = crypt.PyCryptoVerifier.from_string(
49 verifier = crypt.PyCryptoVerifier.from_string(
55 verifier = crypt.PyCryptoVerifier.from_string(
63 verifier = crypt.PyCryptoVerifier.from_string(
73 crypt.PyCryptoSigner.from_string(key_bytes)
Dtest_jwt.py72 signer = self.signer.from_string(private_key,
76 verifier = self.verifier.from_string(public_key, True)
96 signer = self.signer.from_string(private_key)
171 signer = self.signer.from_string(private_key)
215 verifier = self.verifier.from_string(public_key, is_x509_cert=False)
243 signer = crypt.Signer.from_string(private_key)
/external/tensorflow/tensorflow/python/framework/
Ddevice_spec_test.py157 d = device_spec_type.from_string("/job:foo/replica:0")
161 d = device_spec_type.from_string("/replica:1/task:0/cpu:0")
166 d = device_spec_type.from_string("/replica:1/task:0/device:CPU:0")
171 d = device_spec_type.from_string("/job:muu/device:GPU:2")
180 d = device_spec.DeviceSpecV1.from_string("/job:foo/replica:0")
183 d.merge_from(device_spec.DeviceSpecV1.from_string("/task:1/device:GPU:2"))
187 d.merge_from(device_spec.DeviceSpecV1.from_string("/task:1/cpu:0"))
190 d.merge_from(device_spec.DeviceSpecV1.from_string("/job:boo/device:GPU:0"))
193 d.merge_from(device_spec.DeviceSpecV1.from_string("/job:muu/cpu:2"))
195 d.merge_from(device_spec.DeviceSpecV1.from_string(
[all …]
Ddevice.py42 DeviceSpec.from_string(spec)
57 device = DeviceSpec.from_string(device)
122 self._spec = spec.__class__.from_string(spec.to_string())
124 self._spec = DeviceSpec.from_string(spec)
132 current_device = DeviceSpec.from_string(node_def.device or "")
/external/parameter-framework/asio-1.10.6/include/asio/ip/impl/
Daddress.ipp129 address address::from_string(const char* str)
132 address addr = from_string(str, ec);
137 address address::from_string(const char* str, asio::error_code& ec)
140 asio::ip::address_v6::from_string(str, ec);
150 asio::ip::address_v4::from_string(str, ec);
162 address address::from_string(const std::string& str)
164 return from_string(str.c_str());
167 address address::from_string(const std::string& str,
170 return from_string(str.c_str(), ec);
Daddress_v4.ipp91 address_v4 address_v4::from_string(const char* str)
94 address_v4 addr = from_string(str, ec);
99 address_v4 address_v4::from_string(
109 address_v4 address_v4::from_string(const std::string& str)
111 return from_string(str.c_str());
114 address_v4 address_v4::from_string(
117 return from_string(str.c_str(), ec);
/external/tensorflow/tensorflow/python/distribute/
Ddevice_util.py49 d = tf_device.DeviceSpec.from_string(d.name)
51 d = tf_device.DeviceSpec.from_string(d)
62 host_cpu = tf_device.DeviceSpec.from_string(
72 tf_device.DeviceSpec.from_string(default))
124 spec = tf_device.DeviceSpec.from_string(device)
/external/parameter-framework/asio-1.10.6/include/asio/ip/
Daddress.hpp94 ASIO_DECL static address from_string(const char* str);
98 ASIO_DECL static address from_string(
103 ASIO_DECL static address from_string(const std::string& str);
107 ASIO_DECL static address from_string(
Daddress_v6.hpp95 ASIO_DECL static address_v6 from_string(const char* str);
98 ASIO_DECL static address_v6 from_string(
102 ASIO_DECL static address_v6 from_string(const std::string& str);
105 ASIO_DECL static address_v6 from_string(
Daddress_v4.hpp98 ASIO_DECL static address_v4 from_string(const char* str);
101 ASIO_DECL static address_v4 from_string(
105 ASIO_DECL static address_v4 from_string(const std::string& str);
108 ASIO_DECL static address_v4 from_string(
/external/python/jinja/docs/
Dnativetypes.rst21 >>> t = env.from_string('{{ x + y }}')
30 >>> t = env.from_string('[{% for item in data %}{{ item + 1 }},{% endfor %}]')
39 >>> t = env.from_string('{{ x }} * {{ y }}')
52 >>> result = env.from_string('{{ x }}').render(x=Foo(15))
/external/tensorflow/tensorflow/python/training/
Ddevice_setter.py114 current_device = pydev.DeviceSpec.from_string(op.device or "")
122 ps_device = pydev.DeviceSpec.from_string(self._ps_device)
131 worker_device = pydev.DeviceSpec.from_string(self._worker_device or "")
208 ps_job_name = pydev.DeviceSpec.from_string(ps_device).job

1234