Return the LilyPond equivalent of a Composition in a string.
772647
def from_Composition(composition):
    """"""
    # warning Throw exception
    if not hasattr(composition, 'tracks'):
        return False
    result = '\\header { title = "%s" composer = "%s" opus = "%s" } '\
         % (composition.title, composition.author, composition.subtitle)
    for track in composition.tracks:
        result += from_Track(track) + ' '
    return result[:-1]
809704
def type_string(self):
        """"""
        if self.is_tuple:
            subtypes = [item.type_string for item in self.children]
            return '{}({})'.format(
                '' if self.val_guaranteed else '*',
                ', '.join(subtypes))
        elif self.is_list:
            return '{}[{}]'.format(
                '' if self.val_guaranteed else '*',
                self.children[0].type_string)
        else:
            return '{}{}'.format(
                '' if self.val_guaranteed else '*',
                self.type_.__name__)
1234702
def from_string(cls, s, space):
        """"""

        import hashlib

        hs = hashlib.sha1(s).hexdigest()

        return cls.from_hex(hs, space)
1230087
def tostring(self, root=None, doctype=None, pretty_print=True):
        """"""
        if root is None:
            root = self.root
        return etree.tounicode(
            root, doctype=doctype or self.info.doctype, pretty_print=pretty_print
        )
984222
function stringifyString( v , runtime , isTemplateSentence ) {
	var maybeDollar = '' ;

	if ( isTemplateSentence ) {
		if ( v.key ) {
			v = v.key ;
			maybeDollar = '$' ;
		}
		else {
			runtime.str += runtime.depth ? ' <Sentence>' : '<Sentence>' ;
			return ;
		}
	}

	if ( runtime.preferQuotes ) {
		return stringifyStringMaybeQuotes( v , runtime , maybeDollar ) ;
	}

	return stringifyStringMaybeStringLine( v , runtime , maybeDollar ) ;

}
116153
def toLily(self):
        '''
        
        '''
        lilystring = "\\version \"2.18.2\" \n"

        partstrings = []
        ids_loaded = []
        groupings = []
        if len(self.groups) > 0:
            # here we need to do some set union theory
            lstring, groupings, ids_loaded = self.handleGroups()
            lilystring += lstring
        children = [
            child for child in self.GetSortedChildren() if child not in ids_loaded]
        for child in children:
            part = self.getPart(child)
            partstring = part.toLily()
            lilystring += partstring[0]
            partstrings.append(partstring[1])
        lilystring += self.item.toLily()
        lilystring += "<<"
        lilystring += "".join([gstring for gstring in groupings])
        lilystring += "".join([partstring for partstring in partstrings])
        lilystring += ">>"
        return lilystring
309599
function(s) {
			var type = (YL.isNull(s) || YL.isUndefined(s)) ? ('' + s) : typeof s;
			return 'string' === type ? s : type + this.DELIMITER + s;
		}
433618
def str_if_nested_or_str(s):
    """"""
    if isinstance(s, ALL_STRING_TYPES):
        return str(s)
    if isinstance(s, (list, tuple)):
        return type(s)(map(str_if_nested_or_str, s))
    if isinstance(s, (dict, )):
        return stringify_dict_contents(s)
    return s
603834
def _to_string(self):
        """"""
        if self.sections:
            start = "/" if self.bound_start else "**/"
            sections = "/**/".join(str(section) for section in self.sections)
            end = "" if self.bound_end else "/**"
        else:
            start = ""
            sections = ""
            end = "" if self.bound_end else "**"
        return "{0}{1}{2}/{3}".format(start, sections, end, str(self.file_pattern))
1050946
def jp_compose(s, base=None):
    
    if s == None:
        return base

    ss = [s] if isinstance(s, six.string_types) else s
    ss = [s.replace('~', '~0').replace('/', '~1') for s in ss]
    if base:
        ss.insert(0, base)
    return '/'.join(ss)
712513
function literalFromParts(parts) {
  let s = '';
  for (let i=0; i<parts.length; i++) {
    let literal = parts[i].literal;
    s += literal || '';
  }
  return s;
}
868727
def from_string(cls, string):
    """"""
    # Note: There is some ambiguity as to whether the string passed is intended
    # to become a unit looked up by name or suffix, or a Dimension descriptor.
    if string in units.UNITS_BY_ALL:
      return cls(description=string, unit=units.Unit(string))
    else:
      return cls(description=string)
771407
def str(self, space=False):
    """"""
    return "%s/%s (%s)" % (str(int(self.id)).rjust(space and 4),
                           self.name.ljust(space and 50),
                           "; ".join(str(a) for a in self.args))
777931
def pretty_str(self, indent=0):
        
        indent = ' ' * indent
        values = '{{{}}}'.format(', '.join(map(pretty_str, self.value)))

        if self.parenthesis:
            return '{}({})'.format(indent, values)
        return '{}{}'.format(indent, values)
701134
def get_string(self, offset=0):
        """"""
        if not self.has_space(offset=offset):
            return ''

        # Get a char for each char in the current string from pos onward
        #  solong as the char is not whitespace.
        string = self.string
        pos = self.pos + offset
        for i, char in enumerate(string[pos:]):
            if char.isspace():
                return string[pos:pos + i]
        else:
            return string[pos:]
725940
def string(self, *pattern, **kwargs):
        
        set_defaults(self._kwargs, kwargs)
        set_defaults(self._functional_defaults, kwargs)
        set_defaults(self._defaults, kwargs)
        pattern = self.rebulk.build_string(*pattern, **kwargs)
        part = ChainPart(self, pattern)
        self.parts.append(part)
        return part
616067
def _render_str(self, string):
        """"""
        if isinstance(string, StrLabel):
            string = string._render(string.expr)
        string = str(string)
        if len(string) == 0:
            return ''
        name, supers, subs = split_super_sub(string)
        return render_latex_sub_super(
            name, subs, supers, translate_symbols=True)