Home
last modified time | relevance | path

Searched +refs:flatten +refs:list (Results 1 – 25 of 8545) sorted by relevance

12345678910>>...342

/dports/devel/R-cran-purrr/purrr/tests/testthat/
H A Dtest-flatten.R14 expect_equal(flatten(list(1:2)), list(1, 2))
15 expect_equal(flatten(list(1, 2)), list(1, 2))
19 expect_equal(flatten(list(F)), list(F))
20 expect_equal(flatten(list(1L)), list(1L))
21 expect_equal(flatten(list(1)), list(1))
22 expect_equal(flatten(list("a")), list("a"))
24 expect_equal(flatten(list(1i)), list(1i))
30 expect_equal(flatten(list(NULL, 1)), list(1))
31 expect_equal(flatten(list(1, NULL)), list(1))
40 out <- flatten(list(a = list(1), b = list(2)))
[all …]
/dports/math/py-snuggs/snuggs-1.4.7/
H A Dtest_snuggs.py58 assert list(r.flatten()) == [1, 1, 1, 1]
66 assert list(r.flatten()) == [1, 1, 1, 1]
70 assert list(r.flatten()) == [1, 1, 1, 1]
79 assert list(r.flatten()) == [1, 1, 1, 1]
84 assert list(r.flatten()) == [1, 1]
89 assert list(r.flatten()) == [1, 1]
91 assert list(r.flatten()) == [1, 1]
106 assert list(result.flatten()) == [2.5, 2.5]
136 assert list(result.flatten()) == [1.0, 1.0]
149 assert list(result.flatten()) == [1.0, 0.0]
[all …]
/dports/editors/neovim/neovim-0.6.1/src/nvim/testdir/
H A Dtest_flatten.vim1 " Test for flatting list.
9 call assert_equal([], flatten([]))
41 let l:list = [[1], [2], [3]]
42 call assert_equal([1, 2, 3], flatten(l:list))
43 call assert_equal([1, 2, 3], l:list)
51 let l:list = [[1], [2], [3]]
52 call assert_equal([1, 2, 3], flatten(l:list))
54 call assert_equal([1, 2, 3], l:list)
56 " Tests for checking circular reference list can be flatten.
59 let l:z = flatten(l:y)
[all …]
/dports/editors/vim/vim-8.2.3745/src/testdir/
H A Dtest_flatten.vim1 " Test for flatting list.
10 call assert_equal([], flatten([]))
42 let l:list = [[1], [2], [3]]
43 call assert_equal([1, 2, 3], flatten(l:list))
44 call assert_equal([1, 2, 3], l:list)
52 let l:list = [[1], [2], [3]]
53 call assert_equal([1, 2, 3], flatten(l:list))
55 call assert_equal([1, 2, 3], l:list)
57 " Tests for checking circular reference list can be flattened.
60 let l:z = flatten(l:y)
[all …]
/dports/devel/R-cran-rlang/rlang/tests/testthat/
H A Dtest-vec-squash.R42 x <- list(1, list(2, list(3, list(4))))
43 expect_identical(flatten(x), list(1, 2, list(3, list(4))))
44 expect_identical(flatten(flatten(x)), list(1, 2, 3, list(4)))
45 expect_identical(flatten(flatten(flatten(x))), list(1, 2, 3, 4))
46 expect_identical(flatten(flatten(flatten(flatten(x)))), list(1, 2, 3, 4))
50 expect_identical(flatten(list(1L, splice(2:3))), list(1L, 2L, 3L))
83 flatten(list(a = list(A = TRUE), b = list(B = FALSE))) ,
89 flatten(list(a = list(TRUE), b = list(FALSE))) ,
110 x <- list(list(list(TRUE)), list(list(FALSE)))
116 x <- list(list(list("foo")), list(list("bar")))
[all …]
/dports/devel/R-cran-rlang/rlang/man/
H A Dflatten.Rd3 \name{flatten}
4 \alias{flatten}
22 flatten(x)
55 \item{x}{A list to flatten or squash. The contents of the list can
64 \code{flatten()} returns a list, \code{flatten_lgl()} a logical
72 \code{flatten()} removes one level hierarchy from a list, while
90 flatten(x)
95 flatten(deep)
96 flatten(flatten(deep))
109 str(flatten(list(1, foo, list(100))))
[all …]
/dports/devel/capnproto080/capnproto-0.8.0/c++/src/capnp/
H A Dstringify-test.c++468 prettyPrint(root).flatten()); in TEST()
477 auto list = root.initStructList(3); in TEST() local
478 list[0].setInt32Field(123); in TEST()
479 list[0].setTextField("foo"); in TEST()
480 list[1].setInt32Field(456); in TEST()
481 list[1].setTextField("bar"); in TEST()
482 list[2].setInt32Field(789); in TEST()
483 list[2].setTextField("baz"); in TEST()
514 prettyPrint(ll).flatten()); in TEST()
646 prettyPrint(root).flatten()); in TEST()
[all …]
/dports/devel/capnproto/capnproto-0.9.0/c++/src/capnp/
H A Dstringify-test.c++468 prettyPrint(root).flatten()); in TEST()
477 auto list = root.initStructList(3); in TEST() local
478 list[0].setInt32Field(123); in TEST()
479 list[0].setTextField("foo"); in TEST()
480 list[1].setInt32Field(456); in TEST()
481 list[1].setTextField("bar"); in TEST()
482 list[2].setInt32Field(789); in TEST()
483 list[2].setTextField("baz"); in TEST()
514 prettyPrint(ll).flatten()); in TEST()
646 prettyPrint(root).flatten()); in TEST()
[all …]
/dports/devel/boost-docs/boost_1_72_0/libs/hana/test/_include/laws/
H A Dmonad.hpp103 hana::flatten(hana::transform(m, f)) in TestMonad()
116 hana::flatten(mm), in TestMonad()
137 hana::flatten(list(list(), list())),
138 list()
142 hana::flatten(list(list(ct_eq<0>{}), list())),
147 hana::flatten(list(list(), list(ct_eq<0>{}))),
152 hana::flatten(list(list(ct_eq<0>{}), list(ct_eq<1>{}))),
157 hana::flatten(list(
159 list(),
167 hana::flatten(list(list(Tracked{1}, Tracked{2})));
[all …]
/dports/devel/boost-python-libs/boost_1_72_0/libs/hana/test/_include/laws/
H A Dmonad.hpp103 hana::flatten(hana::transform(m, f)) in TestMonad()
116 hana::flatten(mm), in TestMonad()
137 hana::flatten(list(list(), list())),
138 list()
142 hana::flatten(list(list(ct_eq<0>{}), list())),
147 hana::flatten(list(list(), list(ct_eq<0>{}))),
152 hana::flatten(list(list(ct_eq<0>{}), list(ct_eq<1>{}))),
157 hana::flatten(list(
159 list(),
167 hana::flatten(list(list(Tracked{1}, Tracked{2})));
[all …]
/dports/devel/boost-libs/boost_1_72_0/libs/hana/test/_include/laws/
H A Dmonad.hpp103 hana::flatten(hana::transform(m, f)) in TestMonad()
116 hana::flatten(mm), in TestMonad()
137 hana::flatten(list(list(), list())),
138 list()
142 hana::flatten(list(list(ct_eq<0>{}), list())),
147 hana::flatten(list(list(), list(ct_eq<0>{}))),
152 hana::flatten(list(list(ct_eq<0>{}), list(ct_eq<1>{}))),
157 hana::flatten(list(
159 list(),
167 hana::flatten(list(list(Tracked{1}, Tracked{2})));
[all …]
/dports/devel/hyperscan/boost_1_75_0/libs/hana/test/_include/laws/
H A Dmonad.hpp103 hana::flatten(hana::transform(m, f)) in TestMonad()
116 hana::flatten(mm), in TestMonad()
137 hana::flatten(list(list(), list())),
138 list()
142 hana::flatten(list(list(ct_eq<0>{}), list())),
147 hana::flatten(list(list(), list(ct_eq<0>{}))),
152 hana::flatten(list(list(ct_eq<0>{}), list(ct_eq<1>{}))),
157 hana::flatten(list(
159 list(),
167 hana::flatten(list(list(Tracked{1}, Tracked{2})));
[all …]
/dports/devel/R-cran-purrr/purrr/man/
H A Dflatten.Rd2 % Please edit documentation in R/flatten.R
3 \name{flatten}
4 \alias{flatten}
13 \title{Flatten a list of lists into a simple vector.}
15 flatten(.x)
32 \item{.x}{A list to flatten. The contents of the list can be anything for
33 \code{flatten()} (as a list is returned), but the contents must match the
44 \code{flatten()} returns a list, \code{flatten_lgl()} a logical
53 These functions remove a level hierarchy from a list. They are similar to
60 x \%>\% flatten()
[all …]
/dports/devel/py-qutip/qutip-4.6.2/qutip/
H A Ddimensions.py49 return np.prod(flatten(dims)) == 1
53 isinstance(dims, list) and
60 isinstance(dims[0], list)
96 def flatten(l): function
110 if not isinstance(l, list):
113 return sum(map(flatten, l), [])
130 if isinstance(l, list):
167 if not isinstance(l, list):
301 return flatten(perm)
326 return flatten(perm)
[all …]
/dports/sysutils/terraform/terraform-1.0.11/website/docs/language/functions/
H A Dflatten.html.md4 sidebar_current: "docs-funcs-collection-flatten"
6 The flatten function eliminates nested lists from a list.
9 # `flatten` Function
11 `flatten` takes a list and replaces any elements that are lists with a
12 flattened sequence of the list contents.
17 > flatten([["a", "b"], [], ["c"]])
25 > flatten([[["a", "b"], []], ["c"]])
74 # flatten ensures that this local value is a flat list of objects, rather
75 # than a list of lists of objects.
76 network_subnets = flatten([
[all …]
/dports/math/py-nevergrad/nevergrad-0.4.3.post2/nevergrad/optimization/
H A Dtest_externalbo.py9 from nevergrad.common.tools import flatten
17 (ng.p.Choice(list(range(10))), True),
22 … (ng.p.Instrumentation(ng.p.Scalar(lower=0, upper=1), a=ng.p.Choice(list(range(10)))), False),
33 ng.p.Choice(list(range(10))),
45 b=ng.p.Choice(list(range(10))), c=ng.p.Log(lower=1e-3, upper=1e3)
66 flatten(optim2.trials._dynamic_trials[it]["misc"]["vals"]) # type: ignore
86 a=ng.p.Choice([ng.p.Choice(list(range(10))), ng.p.Scalar(lower=0, upper=1)])
105 b=ng.p.Choice(list(range(10))), c=ng.p.Log(lower=1e-3, upper=1e3)
131 … assert flatten(_hp_parametrization_to_dict(parametrization)) == pytest.approx(flatten(dict_val))
132 assert flatten(_hp_dict_to_parametrization(hyperopt_val)) == pytest.approx(
[all …]
/dports/lang/racket/racket-8.3/share/pkgs/htdp-lib/stepper/private/
H A Dsyntax-property.rkt30 (flatten-association-list-ilist stepper-props))
43 (flatten-association-list-ilist
51 (define (flatten-association-list-ilist alist-tree)
59 (flatten-association-list-ilist (cdr alist-tree)))]
63 (raise-argument-error 'flatten-association-list-tree
70 (raise-argument-error 'flatten-association-list-tree
77 (flatten-association-list-ilist '()) '())
79 (flatten-association-list-ilist
83 (flatten-association-list-ilist
130 (syntax->list #`(property ...))
[all …]
/dports/science/py-OpenFermion/OpenFermion-1.3.0/src/openfermion/measurements/
H A Dfermion_partitioning.py19 def pair_within(labels: list) -> list: argument
88 def pair_between(frag1: list, frag2: list, start_offset: int = 0) -> tuple: argument
202 def pair_within_simultaneously(labels: list) -> tuple: argument
299 iterator_lists = [list(iterator) for iterator in iterators]
308 if flatten:
328 if flatten:
348 flatten):
352 def _parallel_iter(iterators, flatten=False): argument
373 if flatten:
374 next_result = list(temp) + next_result
[all …]
/dports/math/py-Diofant/Diofant-0.13.0/diofant/tests/utilities/
H A Dtest_iterables.py9 cantor_product, capture, default_sort_key, flatten, group,
65 assert flatten((1, (1,))) == [1, 1]
66 assert flatten((x, (x,))) == [x, x]
70 assert flatten(ls, levels=0) == ls
71 assert flatten(ls, levels=1) == [(-2, -1), (1, 2), (0, 0)]
72 assert flatten(ls, levels=2) == [-2, -1, 1, 2, 0, 0]
73 assert flatten(ls, levels=3) == [-2, -1, 1, 2, 0, 0]
75 pytest.raises(ValueError, lambda: flatten(ls, levels=-1))
80 assert flatten([MyOp(x, y), z]) == [MyOp(x, y), z]
81 assert flatten([MyOp(x, y), z], cls=MyOp) == [x, y, z]
[all …]
/dports/sysutils/nomad/nomad-1.1.0/website/content/docs/job-specification/hcl2/functions/collection/
H A Dflatten.mdx3 page_title: flatten - Functions - Configuration Language
4 description: The flatten function eliminates nested lists from a list.
7 # `flatten` Function
9 `flatten` takes a list and replaces any elements that are lists with a
10 flattened sequence of the list contents.
15 > flatten([["a", "b"], [], ["c"]])
23 > flatten([[["a", "b"], []], ["c"]])
78 # flatten ensures that this local value is a flat list of objects, rather
79 # than a list of lists of objects.
80 network_subnets = flatten([
[all …]
/dports/devel/tcllib/tcllib-1.20/modules/pt/tests/
H A Dpt_pexpr_op.tests31 test pt-pe-op-set:${setimpl}-3.0 {op flatten, wrong#args} -body {
32 pt::pe::op flatten
35 test pt-pe-op-set:${setimpl}-3.1 {op flatten, wrong#args} -body {
36 pt::pe::op flatten PE XXX
62 # flatten & fuse
73 test pt-pe-op-set:${setimpl}-7.$n {op flatten} -body {
74 pt::pe::op flatten $data
92 [list / space [list t "\{"]]
95 …[list / [list t n] [list t r] [list t t] [list t '] [list t "\""] [list t "\["] [list t "\]"] [lis…
99 [list / [list t \n] [list t \r]] \
[all …]
/dports/devel/tcllibc/tcllib-1.20/modules/pt/tests/
H A Dpt_pexpr_op.tests31 test pt-pe-op-set:${setimpl}-3.0 {op flatten, wrong#args} -body {
32 pt::pe::op flatten
35 test pt-pe-op-set:${setimpl}-3.1 {op flatten, wrong#args} -body {
36 pt::pe::op flatten PE XXX
62 # flatten & fuse
73 test pt-pe-op-set:${setimpl}-7.$n {op flatten} -body {
74 pt::pe::op flatten $data
92 [list / space [list t "\{"]]
95 …[list / [list t n] [list t r] [list t t] [list t '] [list t "\""] [list t "\["] [list t "\]"] [lis…
99 [list / [list t \n] [list t \r]] \
[all …]
/dports/misc/orange3/orange3-3.29.1/Orange/data/tests/
H A Dtest_table.py286 self.assertEqual(list(filtered.metas[:, -2].flatten()), list("ab"))
291 self.assertEqual(list(filtered.metas[:, -2].flatten()), list("abdg"))
299 self.assertEqual(list(filtered.metas[:, -2].flatten()), list("ab"))
303 self.assertEqual(list(filtered.metas[:, -2].flatten()), list("cdefg"))
311 self.assertEqual(list(filtered.metas[:, -2].flatten()), list("c"))
321 self.assertEqual(list(filtered.metas[:, -2].flatten()), list("adg"))
326 self.assertEqual(list(filtered.metas[:, -2].flatten()), list("dg"))
338 self.assertEqual(list(filtered.metas[:, -2].flatten()), list("cde"))
344 self.assertEqual(list(filtered.metas[:, -2].flatten()), list("bd"))
349 self.assertEqual(list(filtered.metas[:, -2].flatten()), list("bde"))
[all …]
/dports/lang/racket/racket-8.3/collects/syntax/
H A Dflatten-begin.rkt5 (provide flatten-begin
6 flatten-all-begins)
8 (define (flatten-begin stx)
9 (let ([l (syntax->list stx)])
19 ;; flatten-all-begins : Syntax -> (Listof Syntax)
21 (define (flatten-all-begins orig-stx)
32 (define lst (syntax->list stx))
37 (list (syntax-track-origin stx orig-stx #'begin)))))
/dports/lang/racket-minimal/racket-8.3/collects/syntax/
H A Dflatten-begin.rkt5 (provide flatten-begin
6 flatten-all-begins)
8 (define (flatten-begin stx)
9 (let ([l (syntax->list stx)])
19 ;; flatten-all-begins : Syntax -> (Listof Syntax)
21 (define (flatten-all-begins orig-stx)
32 (define lst (syntax->list stx))
37 (list (syntax-track-origin stx orig-stx #'begin)))))

12345678910>>...342