Did I find the right examples for you? yes no

# pretty_symbology.xobj

All Samples(21)  |  Call(16)  |  Derive(0)  |  Import(5)
```Construct spatial object of given length.

return: [] of equal-length strings
```

```        def xobj(symb, length):
"""Construct spatial object of given length.

return: [] of equal-length strings
"""

if length <= 0:
raise ValueError("Length should be greater than 0")

# TODO robustify when no unicodedat available
if _use_unicode:
_xobj = _xobj_unicode
else:
_xobj = _xobj_ascii

vinfo = _xobj[symb]

c1 = top = bot = mid = None

if not isinstance(vinfo, tuple):        # 1 entry
ext = vinfo
else:
if isinstance(vinfo[0], tuple):     # (vlong), c1
vlong = vinfo[0]
c1 = vinfo[1]
else:                               # (vlong), c1
vlong = vinfo

ext = vlong[0]

try:
top = vlong[1]
bot = vlong[2]
mid = vlong[3]
except IndexError:
pass

if c1 is None:
c1 = ext
if top is None:
top = ext
if bot is None:
bot = ext
if mid is not None:
if (length % 2) == 0:
# even height, but we have to print it somehow anyway...
# XXX is it ok?
length += 1

else:
mid = ext

if length == 1:
return c1

res = []
next = (length - 2)//2
nmid = (length - 2) - next*2

res += [top]
res += [ext]*next
res += [mid]*nmid
res += [ext]*next
res += [bot]

return res
```

```
from .stringpict import prettyForm, stringPict
from .pretty_symbology import xstr, hobj, vobj, xobj, xsym, pretty_symbol, \
pretty_atom, pretty_use_unicode, pretty_try_use_unicode, greek_unicode, U, \
annotated
```
```    def _print_Product(self, expr):
func = expr.term
pretty_func = self._print(func)

horizontal_chr = xobj('_', 1)
corner_chr = xobj('_', 1)
vertical_chr = xobj('|', 1)
```
```        if self._use_unicode:
# use unicode corners
horizontal_chr = xobj('-', 1)
corner_chr = u('\u252c')

```

```
from .stringpict import prettyForm, stringPict
from .pretty_symbology import xstr, hobj, vobj, xobj, xsym, pretty_symbol, \
pretty_atom, pretty_use_unicode, pretty_try_use_unicode, greek_unicode, U, \
annotated
```
```    def _print_Product(self, expr):
func = expr.term
pretty_func = self._print(func)

horizontal_chr = xobj('_', 1)
corner_chr = xobj('_', 1)
vertical_chr = xobj('|', 1)
```
```        if self._use_unicode:
# use unicode corners
horizontal_chr = xobj('-', 1)
corner_chr = u('\u252c')

```

```from __future__ import print_function, division

from .pretty_symbology import hobj, vobj, xsym, xobj, pretty_use_unicode
from sympy.core.compatibility import u, string_types, xrange

```
```            self.height() - 1 - self.baseline)*2 + 1
slash = '\n'.join(
' '*(height - i - 1) + xobj('/', 1) + ' '*i
for i in range(height)
)
```

```from __future__ import print_function, division

from .pretty_symbology import hobj, vobj, xsym, xobj, pretty_use_unicode
from sympy.core.compatibility import u, string_types, xrange

```
```            self.height() - 1 - self.baseline)*2 + 1
slash = '\n'.join(
' '*(height - i - 1) + xobj('/', 1) + ' '*i
for i in range(height)
)
```

```from sympy import Interval

from pretty_symbology import xstr, hobj, vobj, xobj, xsym, pretty_symbol,\
pretty_atom, pretty_use_unicode, pretty_try_use_unicode, greek

```
```