str: the synonym serialized in obo format.
180131
def obo(self):
        
        return 'synonym: "{}" {} [{}]'.format(
            self.desc,
            ' '.join([self.scope, self.syn_type.name])\
                if self.syn_type else self.scope,
            ', '.join(self.xref)
        )
110437
def serialized (self, sep=os.linesep):
        
        return unicode_safe(sep).join([
            u"%s link" % self.scheme,
            u"base_url=%r" % self.base_url,
            u"parent_url=%r" % self.parent_url,
            u"base_ref=%r" % self.base_ref,
            u"recursion_level=%d" % self.recursion_level,
            u"url_connection=%s" % self.url_connection,
            u"line=%d" % self.line,
            u"column=%d" % self.column,
            u"page=%d" % self.page,
            u"name=%r" % self.name,
            u"anchor=%r" % self.anchor,
            u"cache_url=%s" % self.cache_url,
           ])
527152
def str2dict(str_in):
    '''
    
    '''
    dict_out = safe_eval(str_in)
    if not isinstance(dict_out, dict):
        dict_out = None
    return dict_out
1003274
def _str(obj):
    """"""
    values = []
    for name in obj._attribs:
        val = getattr(obj, name)
        if isinstance(val, str):
            val = repr(val)
        val = str(val) if len(str(val)) < 10 else "(...)"
        values.append((name, val))
    values = ", ".join("{}={}".format(k, v) for k, v in values)
    return "{}({})".format(obj.__class__.__name__, values)
98042
def fmt_repr(obj):
  
  items = ["%s = %r" % (k, v) for k, v in list(exclude_fields(obj).items())]
  return "<%s: {%s}>" % (obj.__class__.__name__, ', '.join(items))
557783
def obj_to_string(obj):
    ''''''
    if not obj:
        return None
    elif isinstance(obj, bytes):
        return obj.decode('utf-8')
    elif isinstance(obj, basestring):
        return obj
    elif is_lazy_string(obj):
        return obj.value
    elif hasattr(obj, '__html__'):
        return obj.__html__()
    else:
        return str(obj)
922796
def _short_repr(obj):
  """"""
  stringified = pprint.saferepr(obj)
  if len(stringified) > 200:
    return '%s... (%d bytes)' % (stringified[:200], len(stringified))
  return stringified
444799
def _encode(self):
        """"""
        obj = {k: v for k, v in self.__dict__.items()
               if not k.startswith('_') and type(v) in SAFE_TYPES}
        obj.update({k: v._encode() for k, v in self.__dict__.items()
                   if isinstance(v, Ent)})
        return obj
212480
def _repr(obj):
    """"""
    vals = ", ".join("{}={!r}".format(
        name, getattr(obj, name)) for name in obj._attribs)
    if vals:
        t = "{}(name={}, {})".format(obj.__class__.__name__, obj.name, vals)
    else:
        t = "{}(name={})".format(obj.__class__.__name__, obj.name)
    return t
1311631
def qual(obj):
    
    return u'{}.{}'.format(obj.__class__.__module__, obj.__class__.__name__)
1241026
def get_object(cls, abbr):
        '''
        
        '''
        obj = get_metadata(abbr)
        if obj is None:
            msg = 'No metadata found for abbreviation %r' % abbr
            raise DoesNotExist(msg)
        return cls(obj)
919709
def to_str(obj):
    
    if not isinstance(obj, str) and PY3 and isinstance(obj, bytes):
        obj = obj.decode('utf-8')
    return obj if isinstance(obj, string_types) else str(obj)
730763
def bencode(obj):
    """"""
    if isinstance(obj, int):
        return "i" + str(obj) + "e"

    if isinstance(obj, str):
        if not obj:
            return None
        return str(len(obj)) + ":" + obj

    if isinstance(obj, list):
        res = "l"
        for elem in obj:
            elem = bencode(elem)
            if elem:
                res += elem
        return res + "e"

    if isinstance(obj, dict):
        res = "d"
        for key in sorted(obj.keys()):
            if key in obj:
                value = bencode(obj[key])
                key = bencode(key)
                if key and value:
                    res += key + value

        return res + "e"

    if isinstance(obj, unicode):
        return bencode(obj.encode('utf-8'))

    if isinstance(obj, collections.OrderedDict):
        return bencode(dict(obj))
    raise Exception("Unknown object: %s (%s)" % (repr(obj), repr(type(obj))))
1037830
def safe_str(obj):
    
    try:
        return str(obj)
    except UnicodeEncodeError:
        # obj is unicode
        try:
            return unicode(obj).encode('unicode_escape')  # noqa for undefined-variable
        except NameError:
            # This is Python 3, just return the obj as it's already unicode
            return obj
657665
function(obj) {
                if (obj === undefined)
                    return obj + "";
                if (obj === null)
                    return obj + "";
                return Object[LEXICON.p].toString.call(obj).replace(/^\[object (.+)\]$/, '$1').toLowerCase();
            }
331296
def object_as_dict(obj):
    
    return {c.key: getattr(obj, c.key)
            for c in inspect(obj).mapper.column_attrs}
965373
def value_to_string(self, obj):
        """"""
        try:
            return force_unicode(self.__get__(obj))
        except TypeError:
            return str(self.__get__(obj))