repo_id stringclasses 400
values | commit_sha stringclasses 400
values | commit_index int32 0 951 | in_repo_split stringclasses 1
value | cross_repo_split stringclasses 1
value | test_file stringlengths 7 121 | test_function stringlengths 1 108 | assertion_type stringclasses 32
values | difficulty stringclasses 8
values | context_lines int32 3 600 | prefix large_stringlengths 44 113k | target large_stringlengths 1 498 | anchor_sha stringclasses 400
values | anchor_index int32 0 951 | qna_source stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_core.py | test_pdict | assert | collection | 19 | import pytest
import isobar as iso
def test_pdict():
a = iso.PDict({
"a": iso.PSequence([1, 2, 3], 1),
"b": 4,
"c": None
})
assert list(a) == [
{"a": 1, "b": 4, "c": None},
{"a": 2, "b": 4, "c": None},
{"a": 3, "b": 4, "c": None}
]
a = iso.PDict([{"a... | [1, 2, 3] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_core.py | test_parrayindex_pattern | assert | collection | 9 | import pytest
import isobar as iso
def test_parrayindex_pattern():
a = iso.PConstant(5)
b = iso.PConstant(9)
c = iso.PArrayIndex([a, b], iso.PSequence([0, 1], 2))
assert list(c) == | [5, 9, 5, 9] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_core.py | test_pfunc | pytest.raises | variable | 12 | import pytest
import isobar as iso
def test_pfunc():
s = "abc"
a = iso.PSequence([0, 1, 2], 1)
b = iso.PFunc(lambda: s[next(a)])
assert next(b) == 'a'
assert next(b) == 'b'
assert next(b) == 'c'
with pytest.raises( | StopIteration) | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_core.py | test_pdictkey | assert | collection | 10 | import pytest
import isobar as iso
def test_pdictkey():
d1 = {"foo": "bar", "baz": "buzz"}
d2 = {"foo": "boo", "baz": "bez"}
a = iso.PSequence(["foo", "baz"], 1)
b = iso.PDictKey(iso.PSequence([d1, d2]), a)
assert list(b) == | ["bar", "bez"] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_core.py | test_pconcatenate | assert | collection | 10 | import pytest
import isobar as iso
def test_pconcatenate():
a = iso.PSequence([1, 2], 1)
b = iso.PSequence([3, 4], 1)
c = iso.PSequence([5], 1)
d = iso.PConcatenate([a, b, c])
assert list(d) == | [1, 2, 3, 4, 5] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_core.py | test_pabs | assert | collection | 8 | import pytest
import isobar as iso
def test_pabs():
a = iso.PSequence([4, 5, 1, -2, None, 1, -1.5], 1)
b = iso.PAbs(a)
assert list(b) == | [4, 5, 1, 2, None, 1, 1.5] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_core.py | test_pint | assert | collection | 8 | import pytest
import isobar as iso
def test_pint():
a = iso.PSequence([4, 5, 1.2, -2.9, None, 1, -1.5], 1)
b = iso.PInt(a)
assert list(b) == | [4, 5, 1, -2, None, 1, -1] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_core.py | test_pdict | assert | collection | 20 | import pytest
import isobar as iso
def test_pdict():
a = iso.PDict({
"a": iso.PSequence([1, 2, 3], 1),
"b": 4,
"c": None
})
assert list(a) == [
{"a": 1, "b": 4, "c": None},
{"a": 2, "b": 4, "c": None},
{"a": 3, "b": 4, "c": None}
]
a = iso.PDict([{"a... | [{"a": 1}, {"a": 2}, {"a": 3}] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_lsystem.py | test_plsystem | assert | collection | 6 | import isobar as iso
def test_plsystem():
a = iso.PLSystem("N[-N++N]-N", 1)
assert list(a) == | [0, -1, 1, -1] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_lsystem.py | test_plsystem | assert | collection | 9 | import isobar as iso
def test_plsystem():
a = iso.PLSystem("N[-N++N]-N", 1)
assert list(a) == [0, -1, 1, -1]
a = iso.PLSystem("N[-N++N]-N", 2)
assert list(a) == | [0, -1, 1, -1, -2, -3, -1, -3, -1, -2, 0, -2, -2, -3, -1, -3] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_markov.py | test_pmarkov | assert | collection | 7 | import isobar as iso
def test_pmarkov():
a = iso.PMarkov([1, 1, 2, 3, 1])
a.seed(0)
assert a.nextn(16) == | [3, 1, 2, 3, 1, 2, 3, 1, 1, 1, 2, 3, 1, 2, 3, 1] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_markov.py | test_pmarkov | assert | collection | 13 | import isobar as iso
def test_pmarkov():
a = iso.PMarkov([1, 1, 2, 3, 1])
a.seed(0)
assert a.nextn(16) == [3, 1, 2, 3, 1, 2, 3, 1, 1, 1, 2, 3, 1, 2, 3, 1]
a.reset()
assert a.nextn(16) == [3, 1, 2, 3, 1, 2, 3, 1, 1, 1, 2, 3, 1, 2, 3, 1]
a = iso.PMarkov({1: [2, 2, 3], 2: [3], 3: [1, 2]})
a.s... | [3, 1, 2, 3, 2, 3, 2, 3, 1, 3, 1, 2, 3, 1, 3, 2] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_operators.py | test_pattern_add | assert | collection | 7 | import isobar as iso
def test_pattern_add():
p1 = iso.PSequence([1, 2, 3], 1)
assert list(p1 + 1.5) == [2.5, 3.5, 4.5]
assert list(-1 + p1) == | [0, 1, 2] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_operators.py | test_pattern_add | assert | collection | 10 | import isobar as iso
def test_pattern_add():
p1 = iso.PSequence([1, 2, 3], 1)
assert list(p1 + 1.5) == [2.5, 3.5, 4.5]
assert list(-1 + p1) == [0, 1, 2]
p2 = iso.PSequence([2, 3, 4, 5], 1)
assert list(p1 + p2) == | [3, 5, 7] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_operators.py | test_pattern_sub | assert | collection | 7 | import isobar as iso
def test_pattern_sub():
p1 = iso.PSequence([1, 2, 3], 1)
assert list(p1 - 0.5) == [0.5, 1.5, 2.5]
assert list(1 + p1) == | [2, 3, 4] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_operators.py | test_pattern_sub | assert | collection | 10 | import isobar as iso
def test_pattern_sub():
p1 = iso.PSequence([1, 2, 3], 1)
assert list(p1 - 0.5) == [0.5, 1.5, 2.5]
assert list(1 + p1) == [2, 3, 4]
p2 = iso.PSequence([2, 3, 4, 5], 1)
assert list(p2 - p1) == | [1, 1, 1] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_operators.py | test_pattern_div | assert | collection | 10 | import isobar as iso
def test_pattern_div():
p1 = iso.PSequence([1, 2, 3], 1)
assert list(p1 / 2.0) == [0.5, 1.0, 1.5]
assert list(2 / p1) == [2, 1, 2 / 3]
p2 = iso.PSequence([2, 4, 6, 8], 1)
assert list(p2 / p1) == | [2, 2, 2] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_operators.py | test_pattern_floordiv | assert | collection | 6 | import isobar as iso
def test_pattern_floordiv():
p1 = iso.PSequence([1, 2, 3], 1)
assert list(p1 // 2) == | [0, 1, 1] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_operators.py | test_pattern_floordiv | assert | collection | 7 | import isobar as iso
def test_pattern_floordiv():
p1 = iso.PSequence([1, 2, 3], 1)
assert list(p1 // 2) == [0, 1, 1]
assert list(2 // p1) == | [2, 1, 0] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_operators.py | test_pattern_mod | assert | collection | 6 | import isobar as iso
def test_pattern_mod():
p1 = iso.PSequence([1, 2, 3], 1)
assert list(p1 % 2) == | [1, 0, 1] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_operators.py | test_pattern_mod | assert | collection | 7 | import isobar as iso
def test_pattern_mod():
p1 = iso.PSequence([1, 2, 3], 1)
assert list(p1 % 2) == [1, 0, 1]
assert list(2 % p1) == | [0, 0, 2] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_operators.py | test_pattern_mod | assert | collection | 10 | import isobar as iso
def test_pattern_mod():
p1 = iso.PSequence([1, 2, 3], 1)
assert list(p1 % 2) == [1, 0, 1]
assert list(2 % p1) == [0, 0, 2]
p2 = iso.PSequence([2, 4, 6, 8], 1)
assert list(p2 % p1) == | [0, 0, 0] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_operators.py | test_pattern_pow | assert | collection | 6 | import isobar as iso
def test_pattern_pow():
p1 = iso.PSequence([1, 2, 3], 1)
assert list(p1 ** 2) == | [1, 4, 9] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_operators.py | test_pattern_pow | assert | collection | 7 | import isobar as iso
def test_pattern_pow():
p1 = iso.PSequence([1, 2, 3], 1)
assert list(p1 ** 2) == [1, 4, 9]
assert list(2 ** p1) == | [2, 4, 8] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_operators.py | test_pattern_lshift | assert | collection | 6 | import isobar as iso
def test_pattern_lshift():
p1 = iso.PSequence([1, 2, 3], 1)
assert list(p1 << 1) == | [2, 4, 6] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_operators.py | test_pattern_eq | assert | collection | 6 | import isobar as iso
def test_pattern_eq():
p1 = iso.PSequence([1, 2, 3], 1)
assert list(p1 == 2) == | [0, 1, 0] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_scalar.py | test_pchanged | assert | numeric_literal | 9 | import pytest
import isobar as iso
def test_pchanged():
a = iso.PSequence([1, 1, 2, 3, 3, "a", "a", "b", None, None, 1], 1)
b = iso.PChanged(a)
assert next(b) == | 0 | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_scalar.py | test_pchanged | assert | numeric_literal | 10 | import pytest
import isobar as iso
def test_pchanged():
a = iso.PSequence([1, 1, 2, 3, 3, "a", "a", "b", None, None, 1], 1)
b = iso.PChanged(a)
assert next(b) == 0
assert next(b) == | 1 | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_scalar.py | test_pscalar | assert | collection | 10 | import pytest
import isobar as iso
def test_pscalar():
a = iso.PScalar(iso.PSequence([1, (2, 3), (4, 5, 6), (), 7], 1), method="mean")
assert list(a) == [1,2.5,5,None,7]
a = iso.PScalar(iso.PSequence([1, (2, 3), (4, 5, 6), (), 7], 1), method="first")
assert list(a) == | [1,2,4,None,7] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_scalar.py | test_pscalar | assert | collection | 7 | import pytest
import isobar as iso
def test_pscalar():
a = iso.PScalar(iso.PSequence([1, (2, 3), (4, 5, 6), (), 7], 1), method="mean")
assert list(a) == | [1,2.5,5,None,7] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_scalar.py | test_pmap_args | assert | collection | 8 | import pytest
import isobar as iso
def test_pmap_args():
a = iso.PSequence([4, 5, 1, -2, 1, -1.5], 1)
b = iso.PMap(a, lambda x, y: x + y, iso.PSeries())
assert list(b) == | [4, 6, 3, 1, 5, 3.5] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_scalar.py | test_pskipif | assert | collection | 10 | import pytest
import isobar as iso
def test_pskipif():
a = iso.PSequence([1, 2, -1, 0, 4], 1)
b = iso.PSequence([0, 1, False, True, None])
c = iso.PSkipIf(a, b)
assert list(c) == | [1, None, -1, None, 4] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_scalar.py | test_pmap | assert | collection | 8 | import pytest
import isobar as iso
def test_pmap():
a = iso.PSequence([4, 5, 1, -2, 1, -1.5], 1)
b = iso.PMap(a, lambda value: value * value)
assert list(b) == | [16, 25, 1, 4, 1, 2.25] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_scalar.py | test_pround | assert | collection | 9 | import pytest
import isobar as iso
def test_pround():
# Note that Python3 rounds x.5 to the nearest even number
a = iso.PSequence([0, 0.1, 0.5, 1, 1.5, None, -3.9], 1)
b = iso.PRound(a)
assert list(b) == | [0, 0, 0, 1, 2, None, -4] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_scalar.py | test_pindexof | assert | collection | 9 | import pytest
import isobar as iso
def test_pindexof():
a = iso.PSequence([1, 2, 3, 7, None, 1], 1)
b = iso.PSequence([[ 1, 2, 3, 4], [ 5, 6, 7, 8 ]])
c = iso.PIndexOf(b, a)
assert list(c) == | [0, None, 2, 2, None, None] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_scalar.py | test_plinlin | assert | collection | 8 | import pytest
import isobar as iso
def test_plinlin():
a = iso.PSequence([4, 5, 1, -2, 1, -1.5], 1)
b = iso.PScaleLinLin(a, 0, 10, 100, 200)
assert list(b) == | [140, 150, 110, 80, 110, 85] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_scalar.py | test_pround | assert | collection | 14 | import pytest
import isobar as iso
def test_pround():
# Note that Python3 rounds x.5 to the nearest even number
a = iso.PSequence([0, 0.1, 0.5, 1, 1.5, None, -3.9], 1)
b = iso.PRound(a)
assert list(b) == [0, 0, 0, 1, 2, None, -4]
assert all(x is None or type(x) == int for x in list(b))
a = iso... | [40, 60, 0, -10, None, 1000] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_scalar.py | test_pwrap | assert | collection | 8 | import pytest
import isobar as iso
def test_pwrap():
a = iso.PSequence([0, 0.1, 0.5, 1, 1.5, -3.9], 1)
b = iso.PWrap(a, 1, 2)
assert list(b) == | [1.0, 1.1, 1.5, 1, 1.5, 1.1] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_scalar.py | test_pchanged | assert | collection | 12 | import pytest
import isobar as iso
def test_pchanged():
a = iso.PSequence([1, 1, 2, 3, 3, "a", "a", "b", None, None, 1], 1)
b = iso.PChanged(a)
assert next(b) == 0
assert next(b) == 1
list(b)
assert list(b) == | [0, 1, 1, 0, 1, 0, 1, 1, 0, 1] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_scalar.py | test_pdiff | assert | collection | 12 | import pytest
import isobar as iso
def test_pdiff():
a = iso.PSequence([4, 5, 5, 1, -2, None, 1, 1.5], 1)
b = iso.PDiff(a)
assert next(b) == 1
assert next(b) == 0
list(b)
assert list(b) == | [1, 0, -4, -3, None, None, 0.5] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_sequence.py | test_ppatterngeneratoraction | assert | numeric_literal | 19 | import pytest
import isobar as iso
def test_ppatterngeneratoraction():
n = 0
def generate():
nonlocal n
n += 1
if n == 1:
return iso.PSequence([0], 2)
elif n == 2:
return iso.PSequence([1, 2], 1)
else:
return None
a = iso.PPatter... | 0 | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_sequence.py | test_ppatterngeneratoraction | assert | numeric_literal | 21 | import pytest
import isobar as iso
def test_ppatterngeneratoraction():
n = 0
def generate():
nonlocal n
n += 1
if n == 1:
return iso.PSequence([0], 2)
elif n == 2:
return iso.PSequence([1, 2], 1)
else:
return None
a = iso.PPatter... | 1 | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_sequence.py | test_ppatterngeneratoraction | assert | numeric_literal | 22 | import pytest
import isobar as iso
def test_ppatterngeneratoraction():
n = 0
def generate():
nonlocal n
n += 1
if n == 1:
return iso.PSequence([0], 2)
elif n == 2:
return iso.PSequence([1, 2], 1)
else:
return None
a = iso.PPatter... | 2 | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_sequence.py | test_psequence_ints | assert | collection | 7 | import pytest
import isobar as iso
def test_psequence_ints():
a = iso.PSequence([1, 2, 3], 1)
assert list(a) == | [1, 2, 3] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_sequence.py | test_pinterpolate | pytest.raises | variable | 18 | import pytest
import isobar as iso
def test_pinterpolate():
a = iso.PSequence([0, 1, 2], 1)
steps = iso.PSequence([4, 2], 1)
b = iso.PInterpolate(a, steps, iso.INTERPOLATION_NONE)
assert list(b) == [0, 0, 0, 0, 1, 1, 2]
a = iso.PSequence([0, 1, 2], 1)
steps = iso.PSequence([4, 2], 1)
b = i... | ValueError) | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_sequence.py | test_psubsequence | assert | collection | 8 | import pytest
import isobar as iso
def test_psubsequence():
a = iso.PSeries()
b = iso.PSubsequence(a, 4, 4)
assert list(b) == | [4, 5, 6, 7] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_sequence.py | test_ppad | assert | collection | 12 | import pytest
import isobar as iso
def test_ppad():
a = iso.PSequence([1, None, 2], 1)
b = iso.PPad(a, 6)
assert list(b) == [1, None, 2, None, None, None]
a = iso.PSequence([1, None, 2], 1)
b = iso.PPad(a, 3)
assert list(b) == | [1, None, 2] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_sequence.py | test_parpeggiator | assert | collection | 7 | import pytest
import isobar as iso
def test_parpeggiator():
a = iso.PArpeggiator([0, 1, 2, 3], iso.PArpeggiator.UP)
assert a.nextn(16) == | [0, 1, 2, 3] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_sequence.py | test_parpeggiator | assert | collection | 10 | import pytest
import isobar as iso
def test_parpeggiator():
a = iso.PArpeggiator([0, 1, 2, 3], iso.PArpeggiator.UP)
assert a.nextn(16) == [0, 1, 2, 3]
a = iso.PArpeggiator([0, 1, 2, 3], iso.PArpeggiator.DOWN)
assert a.nextn(16) == | [3, 2, 1, 0] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_sequence.py | test_parpeggiator | assert | collection | 13 | import pytest
import isobar as iso
def test_parpeggiator():
a = iso.PArpeggiator([0, 1, 2, 3], iso.PArpeggiator.UP)
assert a.nextn(16) == [0, 1, 2, 3]
a = iso.PArpeggiator([0, 1, 2, 3], iso.PArpeggiator.DOWN)
assert a.nextn(16) == [3, 2, 1, 0]
a = iso.PArpeggiator([0, 1, 2, 3], iso.PArpeggiator.C... | [0, 3, 1, 2] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_sequence.py | test_parpeggiator | assert | collection | 25 | import pytest
import isobar as iso
def test_parpeggiator():
a = iso.PArpeggiator([0, 1, 2, 3], iso.PArpeggiator.UP)
assert a.nextn(16) == [0, 1, 2, 3]
a = iso.PArpeggiator([0, 1, 2, 3], iso.PArpeggiator.DOWN)
assert a.nextn(16) == [3, 2, 1, 0]
a = iso.PArpeggiator([0, 1, 2, 3], iso.PArpeggiator.C... | [1, 2, 0, 3] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_sequence.py | test_ppatterngeneratoraction | pytest.raises | variable | 23 | import pytest
import isobar as iso
def test_ppatterngeneratoraction():
n = 0
def generate():
nonlocal n
n += 1
if n == 1:
return iso.PSequence([0], 2)
elif n == 2:
return iso.PSequence([1, 2], 1)
else:
return None
a = iso.PPatter... | StopIteration) | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_sequence.py | test_pseries | assert | collection | 7 | import pytest
import isobar as iso
def test_pseries():
a = iso.PSeries(2, iso.PSequence([1, 2]), iso.PConstant(5))
assert list(a) == | [2, 3, 5, 6, 8] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_sequence.py | test_preverse | assert | collection | 8 | import pytest
import isobar as iso
def test_preverse():
a = iso.PSequence([1, 2, 3, 4, 5], 1)
b = iso.PReverse(a)
assert list(b) == | [5, 4, 3, 2, 1] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_sequence.py | test_pcollapse | assert | collection | 8 | import pytest
import isobar as iso
def test_pcollapse():
a = iso.PSequence([1, 2, None, 3, 4, None, None, 5, 6, None], 1)
b = iso.PCollapse(a)
assert list(b) == | [1, 2, 3, 4, 5, 6] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_sequence.py | test_prange | assert | collection | 9 | import pytest
import isobar as iso
def test_prange():
a = iso.PRange(0, iso.PConstant(10), iso.PSequence([1, 2]))
assert list(a) == [0, 1, 3, 4, 6, 7, 9]
a = iso.PRange(500, -500, -250)
assert list(a) == | [500, 250, 0, -250] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_sequence.py | test_prange | assert | collection | 7 | import pytest
import isobar as iso
def test_prange():
a = iso.PRange(0, iso.PConstant(10), iso.PSequence([1, 2]))
assert list(a) == | [0, 1, 3, 4, 6, 7, 9] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_static.py | test_pcurrenttime | assert | numeric_literal | 8 | import pytest
import isobar as iso
from . import dummy_timeline
def test_pcurrenttime(dummy_timeline):
pattern = iso.PCurrentTime()
assert next(pattern) == | 0 | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_static.py | test_pcurrenttime | assert | collection | 24 | import pytest
import isobar as iso
from . import dummy_timeline
def test_pcurrenttime(dummy_timeline):
pattern = iso.PCurrentTime()
assert next(pattern) == 0
values = []
def action(t):
nonlocal values
values.append(t)
dummy_timeline.schedule({
"action": action,
"a... | [0.0] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_static.py | test_pglobals | pytest.raises | variable | 7 | import pytest
import isobar as iso
from . import dummy_timeline
def test_pglobals():
with pytest.raises( | KeyError) | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_static.py | test_pcurrenttime | assert | collection | 29 | import pytest
import isobar as iso
from . import dummy_timeline
def test_pcurrenttime(dummy_timeline):
pattern = iso.PCurrentTime()
assert next(pattern) == 0
values = []
def action(t):
nonlocal values
values.append(t)
dummy_timeline.schedule({
"action": action,
"a... | [0.0, 1.0] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_static.py | test_pglobals | assert | func_call | 11 | import pytest
import isobar as iso
from . import dummy_timeline
def test_pglobals():
with pytest.raises(KeyError):
iso.Globals.get("key")
iso.Globals.set("key", iso.Key("C", "major"))
assert iso.Globals.get("key") == | iso.Key("C", "major") | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_static.py | test_pstaticpattern | assert | collection | 16 | import pytest
import isobar as iso
from . import dummy_timeline
def test_pstaticpattern(dummy_timeline):
pattern = iso.PStaticPattern(pattern=iso.PSequence([1, 2, 3, 4], 1),
element_duration=iso.PSequence([1, 2, 0, 1]))
dummy_timeline.schedule({
"note": pattern
})
... | [0, 1, 1, 2, 2, 3, 3, 4] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_static.py | test_pstaticpattern | assert | collection | 17 | import pytest
import isobar as iso
from . import dummy_timeline
def test_pstaticpattern(dummy_timeline):
pattern = iso.PStaticPattern(pattern=iso.PSequence([1, 2, 3, 4], 1),
element_duration=iso.PSequence([1, 2, 0, 1]))
dummy_timeline.schedule({
"note": pattern
})
... | [1, 1, 2, 2, 2, 2, 4, 4] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_tonal.py | test_pdegree | assert | collection | 7 | import pytest
import isobar as iso
def test_pdegree():
a = iso.PDegree(iso.PSequence([0, 1, -1, None, 7], 1))
assert list(a) == | [0, 2, -1, None, 12] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_tonal.py | test_pnearest | assert | collection | 7 | import pytest
import isobar as iso
def test_pnearest():
a = iso.PNearestNoteInKey(iso.PSequence([0, 1, 2, 3, -1, None, 12.5], 1), iso.Key("C", "major"))
assert list(a) == | [0, 0, 2, 2, -1, None, 12] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_tonal.py | test_pdegree | assert | collection | 11 | import pytest
import isobar as iso
def test_pdegree():
a = iso.PDegree(iso.PSequence([0, 1, -1, None, 7], 1))
assert list(a) == [0, 2, -1, None, 12]
# Test on array values
a = iso.PDegree(iso.PSequence([[0, 1], [2, 3], [None, -1]], 1))
assert list(a) == | [(0, 2), (4, 5), (None, -1)] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_tonal.py | test_pfilterbykey | assert | collection | 7 | import pytest
import isobar as iso
def test_pfilterbykey():
a = iso.PFilterByKey(iso.PSequence([0, 1, 2, 3, -1, None, 2], 1), iso.Key("C", "major"))
assert list(a) == | [0, None, 2, None, -1, None, 2] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_pattern_tonal.py | test_pmiditofrequency | assert | collection | 7 | import pytest
import isobar as iso
def test_pmiditofrequency():
a = iso.PMidiNoteToFrequency(iso.PSequence([0, 60, 60.5, None], 1))
assert list(a) == | [8.175798915643707, 261.6255653005986, 269.2917795270241, None] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_shorthand_notation.py | test_shorthand_notation_parser | assert | variable | 8 | from isobar.pattern import PSequence
from isobar.shorthand.notation import parse_notation
def test_shorthand_notation_parser():
seq = parse_notation('1 -2 [10 11] [c#4 [30.1 -30.2 30.3]]')
expected = [1, -2, 10, 'c#4', 1, -2, 11, 30.1, 1, -2, 10, 'c#4', 1, -2, 11, -30.2]
assert seq == | expected | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_timeline.py | test_timeline_schedule | assert | numeric_literal | 14 | import isobar as iso
import pytest
import time
from isobar.io import DummyOutputDevice, MidiOutputDevice
from . import dummy_timeline
from isobar.exceptions import InvalidEventException
def test_timeline_schedule(dummy_timeline):
events = {
iso.EVENT_NOTE: iso.PSequence([1], 1)
}
dummy_timeline.sch... | 1 | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_timeline.py | test_timeline_schedule | assert | numeric_literal | 16 | import isobar as iso
import pytest
import time
from isobar.io import DummyOutputDevice, MidiOutputDevice
from . import dummy_timeline
from isobar.exceptions import InvalidEventException
def test_timeline_schedule(dummy_timeline):
events = {
iso.EVENT_NOTE: iso.PSequence([1], 1)
}
dummy_timeline.sch... | 2 | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_timeline.py | test_timeline_unschedule | assert | numeric_literal | 21 | import isobar as iso
import pytest
import time
from isobar.io import DummyOutputDevice, MidiOutputDevice
from . import dummy_timeline
from isobar.exceptions import InvalidEventException
def test_timeline_unschedule(dummy_timeline):
events = {
iso.EVENT_NOTE: iso.PSequence([1]),
iso.EVENT_GATE: 0.5
... | 4 | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_timeline.py | test_timeline_unschedule | assert | numeric_literal | 23 | import isobar as iso
import pytest
import time
from isobar.io import DummyOutputDevice, MidiOutputDevice
from . import dummy_timeline
from isobar.exceptions import InvalidEventException
def test_timeline_unschedule(dummy_timeline):
events = {
iso.EVENT_NOTE: iso.PSequence([1]),
iso.EVENT_GATE: 0.5
... | 0 | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_timeline.py | test_timeline_schedule_count | assert | numeric_literal | 16 | import isobar as iso
import pytest
import time
from isobar.io import DummyOutputDevice, MidiOutputDevice
from . import dummy_timeline
from isobar.exceptions import InvalidEventException
@pytest.mark.skip
def test_timeline_schedule_count(dummy_timeline):
dummy_timeline.schedule({
iso.EVENT_NOTE: iso.PSeries... | 8 | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_timeline.py | test_timeline_reset | assert | numeric_literal | 25 | import isobar as iso
import pytest
import time
from isobar.io import DummyOutputDevice, MidiOutputDevice
from . import dummy_timeline
from isobar.exceptions import InvalidEventException
def test_timeline_reset(dummy_timeline):
track = dummy_timeline.schedule({
iso.EVENT_NOTE: iso.PSequence([1, 2], 1),
... | 6 | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_timeline.py | test_timeline_seconds_to_beats | pytest.approx | numeric_literal | 11 | import isobar as iso
import pytest
import time
from isobar.io import DummyOutputDevice, MidiOutputDevice
from . import dummy_timeline
from isobar.exceptions import InvalidEventException
def test_timeline_seconds_to_beats(dummy_timeline):
timeline = iso.Timeline(120)
assert timeline.seconds_to_beats(1) == pyte... | 2) | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_timeline.py | test_timeline_seconds_to_beats | pytest.approx | numeric_literal | 14 | import isobar as iso
import pytest
import time
from isobar.io import DummyOutputDevice, MidiOutputDevice
from . import dummy_timeline
from isobar.exceptions import InvalidEventException
def test_timeline_seconds_to_beats(dummy_timeline):
timeline = iso.Timeline(120)
assert timeline.seconds_to_beats(1) == pytes... | 3) | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_timeline.py | test_timeline_tempo | assert | numeric_literal | 13 | import isobar as iso
import pytest
import time
from isobar.io import DummyOutputDevice, MidiOutputDevice
from . import dummy_timeline
from isobar.exceptions import InvalidEventException
def test_timeline_tempo(dummy_timeline):
# Set tempo of internal clock
dummy_timeline.clock_source = iso.Clock(dummy_timeline... | 180 | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_timeline.py | test_timeline_reset | assert | numeric_literal | 21 | import isobar as iso
import pytest
import time
from isobar.io import DummyOutputDevice, MidiOutputDevice
from . import dummy_timeline
from isobar.exceptions import InvalidEventException
def test_timeline_reset(dummy_timeline):
track = dummy_timeline.schedule({
iso.EVENT_NOTE: iso.PSequence([1, 2], 1),
... | 0.0 | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_timeline.py | test_timeline_tempo | assert | none_literal | 18 | import isobar as iso
import pytest
import time
from isobar.io import DummyOutputDevice, MidiOutputDevice
from . import dummy_timeline
from isobar.exceptions import InvalidEventException
def test_timeline_tempo(dummy_timeline):
# Set tempo of internal clock
dummy_timeline.clock_source = iso.Clock(dummy_timeline... | None | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_timeline_clock.py | test_timeline_clock_accuracy | assert | variable | 24 | import isobar as iso
import pytest
import time
def test_timeline_clock_accuracy():
#--------------------------------------------------------------------------------
# 480 ticks per beat @ 125bpm = 1 tick per 1ms
#--------------------------------------------------------------------------------
timeline ... | dt | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_timeline_event.py | test_event_action | assert | numeric_literal | 18 | import isobar as iso
import pytest
from . import dummy_timeline
def test_event_action(dummy_timeline):
dummy_timeline.event_times = []
def increment_counter():
dummy_timeline.event_times.append(dummy_timeline.current_time)
if len(dummy_timeline.event_times) >= 5:
raise StopIteratio... | 5 | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_timeline_event.py | example_function | assert | numeric_literal | 7 | import isobar as iso
import pytest
from . import dummy_timeline
def example_function(a, b, foo, bar="bar"):
assert a == | 1 | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_timeline_event.py | example_function | assert | numeric_literal | 8 | import isobar as iso
import pytest
from . import dummy_timeline
def example_function(a, b, foo, bar="bar"):
assert a == 1
assert b == | 2 | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_timeline_event.py | example_function | assert | string_literal | 9 | import isobar as iso
import pytest
from . import dummy_timeline
def example_function(a, b, foo, bar="bar"):
assert a == 1
assert b == 2
assert foo == | "foo" | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_timeline_event.py | example_function | assert | string_literal | 10 | import isobar as iso
import pytest
from . import dummy_timeline
def example_function(a, b, foo, bar="bar"):
assert a == 1
assert b == 2
assert foo == "foo"
assert bar == | "bar" | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_timeline_event.py | test_event_invalid_properties | pytest.raises | variable | 11 | import isobar as iso
import pytest
from . import dummy_timeline
def test_event_invalid_properties(dummy_timeline):
dummy_timeline.schedule({
"note": 0,
"foo": "bar"
})
with pytest.raises( | ValueError) | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_timeline_event.py | test_event_action | pytest.approx | collection | 19 | import isobar as iso
import pytest
from . import dummy_timeline
def test_event_action(dummy_timeline):
dummy_timeline.event_times = []
def increment_counter():
dummy_timeline.event_times.append(dummy_timeline.current_time)
if len(dummy_timeline.event_times) >= 5:
raise StopIteratio... | [0, 1, 2, 3, 4]) | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_timeline_event.py | test_event_action | assert | func_call | 19 | import isobar as iso
import pytest
from . import dummy_timeline
def test_event_action(dummy_timeline):
dummy_timeline.event_times = []
def increment_counter():
dummy_timeline.event_times.append(dummy_timeline.current_time)
if len(dummy_timeline.event_times) >= 5:
raise StopIteratio... | pytest.approx([0, 1, 2, 3, 4]) | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_timeline_event.py | test_event_dict_permut | assert | collection | 18 | import isobar as iso
import pytest
from . import dummy_timeline
def test_event_dict_permut(dummy_timeline):
notes = [
{"note": 60, "duration": 0.5},
{"note": 64, "duration": 0.25},
{"note": 67, "duration": 1.0}
]
dummy_timeline.schedule(iso.PPermut(iso.PSequence(notes, 1)))
dum... | [60, 60, 64, 64, 67, 67, 60, 60, 67, 67, 64, 64, 64, 64, 60, 60, 67, 67, 64, 64, 67, 67, 60, 60, 67, 67, 60, 60, 64, 64, 67, 67, 64, 64, 60, 60] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_timeline_event.py | test_event_dict_permut | assert | collection | 17 | import isobar as iso
import pytest
from . import dummy_timeline
def test_event_dict_permut(dummy_timeline):
notes = [
{"note": 60, "duration": 0.5},
{"note": 64, "duration": 0.25},
{"note": 67, "duration": 1.0}
]
dummy_timeline.schedule(iso.PPermut(iso.PSequence(notes, 1)))
dum... | [0.0, 0.5, 0.5, 0.75, 0.75, 1.75, 1.75, 2.25, 2.25, 3.25, 3.25, 3.5, 3.5, 3.75, 3.75, 4.25, 4.25, 5.25, 5.25, 5.5, 5.5, 6.5, 6.5, 7.0, 7.0, 8.0, 8.0, 8.5, 8.5, 8.75, 8.75, 9.75, 9.75, 10.0, 10.0, 10.5] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_timeline_event.py | test_event_octave | assert | collection | 13 | import isobar as iso
import pytest
from . import dummy_timeline
def test_event_octave(dummy_timeline):
dummy_timeline.schedule({
iso.EVENT_DEGREE: iso.PSequence([0, 1, 2, 3], 1),
iso.EVENT_DURATION: 1.0,
iso.EVENT_OCTAVE: iso.PSequence([2, 4])
})
dummy_timeline.run()
assert dum... | [ [0, 'note_on', 24, 64, 0], [1, 'note_off', 24, 0], [1, 'note_on', 50, 64, 0], [2, 'note_off', 50, 0], [2, 'note_on', 28, 64, 0], [3, 'note_off', 28, 0], [3, 'note_on', 53, 64, 0], [4, 'note_off', 53, 0] ] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_timeline_event.py | test_event_note_octave | assert | collection | 13 | import isobar as iso
import pytest
from . import dummy_timeline
def test_event_note_octave(dummy_timeline):
dummy_timeline.schedule({
iso.EVENT_NOTE: iso.PSequence([0, 1, 2, 3], 1),
iso.EVENT_DURATION: 1.0,
iso.EVENT_OCTAVE: iso.PSequence([2, 4])
})
dummy_timeline.run()
assert ... | [ [0, 'note_on', 24, 64, 0], [1, 'note_off', 24, 0], [1, 'note_on', 49, 64, 0], [2, 'note_off', 49, 0], [2, 'note_on', 26, 64, 0], [3, 'note_off', 26, 0], [3, 'note_on', 51, 64, 0], [4, 'note_off', 51, 0] ] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_timeline_event.py | test_event_key | assert | collection | 13 | import isobar as iso
import pytest
from . import dummy_timeline
def test_event_key(dummy_timeline):
dummy_timeline.schedule({
iso.EVENT_DEGREE: iso.PSequence([0, 1, 2, 3], 1),
iso.EVENT_KEY: iso.PSequence([iso.Key("C", "major"), iso.Key("F", "major")]),
iso.EVENT_TRANSPOSE: 12
})
du... | [ [0, 'note_on', 12, 64, 0], [1, 'note_off', 12, 0], [1, 'note_on', 19, 64, 0], [2, 'note_off', 19, 0], [2, 'note_on', 16, 64, 0], [3, 'note_off', 16, 0], [3, 'note_on', 22, 64, 0], [4, 'note_off', 22, 0] ] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_timeline_event.py | test_event_dur | assert | collection | 12 | import isobar as iso
import pytest
from . import dummy_timeline
def test_event_dur(dummy_timeline):
dummy_timeline.schedule({
iso.EVENT_NOTE: iso.PSequence([1, 2, 3]),
iso.EVENT_DURATION: iso.PSequence([1, 1.5, 2, 1.5], 1)
})
dummy_timeline.run()
assert dummy_timeline.output_device.eve... | [ [0, 'note_on', 1, 64, 0], [1, 'note_off', 1, 0], [1, 'note_on', 2, 64, 0], [2.5, 'note_off', 2, 0], [2.5, 'note_on', 3, 64, 0], [4.5, 'note_off', 3, 0], [4.5, 'note_on', 1, 64, 0], [6, 'note_off', 1, 0] ] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_timeline_event.py | test_event_gate | assert | collection | 13 | import isobar as iso
import pytest
from . import dummy_timeline
def test_event_gate(dummy_timeline):
dummy_timeline.schedule({
iso.EVENT_NOTE: iso.PSequence([1, 2, 3, 4, 5], 1),
iso.EVENT_DURATION: iso.PSequence([1, 2]),
iso.EVENT_GATE: iso.PSequence([0.5, 1, 1.5]),
})
dummy_timelin... | [ [0, 'note_on', 1, 64, 0], [0.5, 'note_off', 1, 0], [1, 'note_on', 2, 64, 0], [3, 'note_off', 2, 0], [3, 'note_on', 3, 64, 0], [4, 'note_on', 4, 64, 0], [4.5, 'note_off', 3, 0], [5, 'note_off', 4, 0], [6, 'note_on', 5, 64, 0], [7, 'note_off', 5, 0], ] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_timeline_event.py | test_event_chord_2 | assert | collection | 13 | import isobar as iso
import pytest
from . import dummy_timeline
def test_event_chord_2(dummy_timeline):
dummy_timeline.schedule({
iso.EVENT_NOTE: iso.PSequence([(1, 2, 3), (4, 5, 6)], 1),
iso.EVENT_GATE: (1, 2, 3),
iso.EVENT_AMPLITUDE: iso.PSequence([(10, 20, 30), (40, 50, 60)])
})
... | [ [0, 'note_on', 1, 10, 0], [0, 'note_on', 2, 20, 0], [0, 'note_on', 3, 30, 0], [1, 'note_off', 1, 0], [1, 'note_on', 4, 40, 0], [1, 'note_on', 5, 50, 0], [1, 'note_on', 6, 60, 0], [2, 'note_off', 2, 0], [2, 'note_off', 4, 0], [3, 'note_off', 3, 0], [3, 'note_off', 5, 0], [4, 'note_off', 6, 0] ] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_timeline_event.py | test_event_degree | assert | collection | 13 | import isobar as iso
import pytest
from . import dummy_timeline
def test_event_degree(dummy_timeline):
dummy_timeline.schedule({
iso.EVENT_DEGREE: iso.PSequence([0, 1, 2, 3, None, 7, -1], 1),
iso.EVENT_DURATION: 1.0,
iso.EVENT_TRANSPOSE: 12
})
dummy_timeline.run()
assert dummy_... | [ [0, 'note_on', 12, 64, 0], [1, 'note_off', 12, 0], [1, 'note_on', 14, 64, 0], [2, 'note_off', 14, 0], [2, 'note_on', 16, 64, 0], [3, 'note_off', 16, 0], [3, 'note_on', 17, 64, 0], [4, 'note_off', 17, 0], [5, 'note_on', 24, 64, 0], [6, 'note_off', 24, 0], [6, 'note_on', 11, 64, 0], [7, 'note_off', 11, 0] ] | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
ideoforms/isobar | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | train | train | tests/test_timeline_event.py | test_event_chord | assert | collection | 13 | import isobar as iso
import pytest
from . import dummy_timeline
def test_event_chord(dummy_timeline):
dummy_timeline.schedule({
iso.EVENT_NOTE: iso.PSequence([(0, 7), 4, (2, 9, 11), 7], 1),
iso.EVENT_DURATION: iso.PSequence([1, 2]),
iso.EVENT_AMPLITUDE: iso.PSequence([10, 20, 30])
})
... | [ [0, 'note_on', 0, 10, 0], [0, 'note_on', 7, 10, 0], [1, 'note_off', 0, 0], [1, 'note_off', 7, 0], [1, 'note_on', 4, 20, 0], [3, 'note_off', 4, 0], [3, 'note_on', 2, 30, 0], [3, 'note_on', 9, 30, 0], [3, 'note_on', 11, 30, 0], [4, 'note_off', 2, 0], [4, 'note_off', 9, 0], [4, 'note_off', 11, 0], [4, 'note_on', 7, 10, ... | 92601c8db7a9107ff3b9f8d480b8cd21415c0915 | 87 | v2_extractor_at_anchor |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.