Did I find the right examples for you? yes no

# cogent.core.location.Span

All Samples(168)  |  Call(152)  |  Derive(2)  |  Import(14)

```
import re
from cogent.core.location import LostSpan, Span, Map, _LostSpan

```
```
if c == 'M':
spans.append(Span(posn, posn+n))
posn += n
else:
```

```
import re
from cogent.core.location import LostSpan, Span, Map, _LostSpan

```
```
if c == 'M':
spans.append(Span(posn, posn+n))
posn += n
else:
```

```"""
from cogent.util.unit_test import TestCase, main
from cogent.core.location import Span, Range, Point, RangeFromString, Map

__author__ = "Rob Knight"
```
```    def setUp(self):
"""Define some standard Spans"""
self.empty = Span(0, 0)
self.full = Span(35, 30)    #will convert to (30, 35) internally
self.overlapping = Span(32, 36)
self.inside = Span(31, 32)
```

```"""
from cogent.util.unit_test import TestCase, main
from cogent.core.location import Span, Range, Point, RangeFromString

__author__ = "Rob Knight"
```
```    def setUp(self):
"""Define some standard Spans"""
self.empty = Span(0, 0)
self.full = Span(35, 30)    #will convert to (30, 35) internally
self.overlapping = Span(32, 36)
self.inside = Span(31, 32)
```

```from cogent import DNA, LoadSeqs
from cogent.core.annotation import Feature, Variable, _Feature
from cogent.core.location import Map, Span, as_map

__author__ = "Gavin Huttley"
```
```    def test_span(self):
length = 100
forward = Span(20, 30)
reverse = Span(70, 80, Reverse=True)
assert forward.reversedRelativeTo(100) == reverse
```
```    def test_map(self):
"""reversing a map with multiple spans should preserve span relative
order"""
forward = [Span(20,30), Span(40,50)]
fmap = Map(spans=forward, parent_length=100)
```

```import copy
import warnings
from cogent.core.location import Map, Span, _norm_slice
from cogent.core.moltype import DNA

```

```import copy
import warnings
from cogent.core.location import Map, Span, _norm_slice
from cogent.core.moltype import DNA

```

```from cogent import DNA, LoadSeqs
from cogent.core.annotation import Feature, Variable
from cogent.core.location import Map, Span

__author__ = "Gavin Huttley"
```
```    def test_span(self):
length = 100
forward = Span(20, 30)
reverse = Span(70, 80, Reverse=True)
assert forward.reversedRelativeTo(100) == reverse
```
```    def test_map(self):
"""reversing a map with multiple spans should preserve span relative
order"""
forward = [Span(20,30), Span(40,50)]
fmap = Map(spans=forward, parent_length=100)
```

```from __future__ import division
from cogent.core.alignment import Alignment
from cogent.core.location import Span

__author__ = "Jeremy Widmann"
```
```class Location(Span):
"""Object that stores location information for a module

-Sequence refers to the original sequence the module came from
-SeqId is the key of the sequence in the alignment
```

```from __future__ import division
from cogent.core.alignment import Alignment
from cogent.core.location import Span

__author__ = "Jeremy Widmann"
```
```class Location(Span):
"""Object that stores location information for a module

-Sequence refers to the original sequence the module came from
-SeqId is the key of the sequence in the alignment
```

1 | 2  Next