turns the elements into a string formatted for VCard
514127
private function asVcard($name)
    {
        $name = preg_replace('/\s\s+/i', '', $name); //remove extra white spaces
        $name = preg_replace('/[^A-Za-z0-9\x{002D}\x{002E}\x{00C0}-\x{00FF} -]/', '', $name); //remove special chars
        $name = trim($name); // trim
        $nm_expl = explode(' ', $name);
        $head = '';
        if (in_array($nm_expl[0], array('Prof.', 'Professor', 'Dr.', 'Doutor' ))) {
            $head = array_shift($nm_expl);
        }
        $lastnm = array_pop($nm_expl);
        $n = $lastnm.';'.implode(' ', $nm_expl).';'.$head.';';
        return "BEGIN:VCARD\nVERSION:4.0\nN:$n\nFN:$name\nEND:VCARD";
    }
340109
def __toString(self, values):
		
		for key in values:
			if not values[key] is str:
				values[key] = str(values[key])
		return values
1331298
def to_vcf(in_tsv, data):
    
    call_convert = {"Amp": "DUP", "Del": "DEL"}
    out_file = "%s.vcf" % utils.splitext_plus(in_tsv)[0]
    if not utils.file_uptodate(out_file, in_tsv):
        with file_transaction(data, out_file) as tx_out_file:
            with open(in_tsv) as in_handle:
                with open(tx_out_file, "w") as out_handle:
                    out_handle.write(VCF_HEADER + "#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT\t%s\n"
                                     % (dd.get_sample_name(data)))
                    header = in_handle.readline().split("\t")
                    for cur in (dict(zip(header, l.split("\t"))) for l in in_handle):
                        if cur["Amp_Del"] in call_convert:
                            svtype = call_convert[cur["Amp_Del"]]
                            info = "SVTYPE=%s;END=%s;SVLEN=%s;FOLD_CHANGE_LOG=%s;PROBES=%s;GENE=%s" % (
                                svtype, cur["End"], int(cur["End"]) - int(cur["Start"]),
                                cur["Log2ratio"], cur["Ab_Seg"], cur["Gene"])
                            out_handle.write("\t".join([cur["Chr"], cur["Start"], ".", "N", "<%s>" % (svtype),
                                                        ".", ".", info, "GT", "1/1"]) + "\n")
    return vcfutils.sort_by_ref(out_file, data)
498695
def _format_info(data):
    '''
    
    '''
    return {'name': data.gr_name,
            'gid': data.gr_gid,
            'passwd': data.gr_passwd,
            'members': data.gr_mem}
965717
def _get_columns_as_string(self):
        """"""
        columnslist = []
        for rowidx, row in self.columns.iterrows():
            columnslist.append("#%s = %s" % (rowidx, row.description))
        return "\n".join(columnslist)
330113
def to_string(self):
        
        # From ykdef.h :
        #
        # // Frame structure
	# #define SLOT_DATA_SIZE  64
        # typedef struct {
        #     unsigned char payload[SLOT_DATA_SIZE];
        #     unsigned char slot;
        #     unsigned short crc;
        #     unsigned char filler[3];
        # } YKFRAME;
        filler = b''
        return struct.pack('<64sBH3s',
                           self.payload, self.command, self.crc, filler)
65764
function formatValues(values) {
  var formatted = {};
  for (var key in values) {
    if (values.hasOwnProperty(key)) {
      if (typeof values[key] === 'boolean') {
        var position = key.indexOf('{');
        if (position !== -1) {
          if (values[key] === true) {
            // Each options of SelectWidget are stored as boolean and grouped using '{' and '}'
            // eg:
            // gender{male} = true
            // gender{female} = false
            var newKey = key.substr(0, position);
            var newValue = key.substr(position);
            newValue = newValue.replace('{', '');
            newValue = newValue.replace('}', '');
            if (!Array.isArray(formatted[newKey])) {
              formatted[newKey] = [];
            }
            formatted[newKey].push(newValue);
          }
        } else {
          formatted[key] = values[key];
        }
      } else {
        if (typeof values[key] === 'string') {
          formatted[key] = values[key].trim();
        } else {
          formatted[key] = values[key];
        }
      }
    }
  }
  return formatted;
}
381709
def _to_vcard(self, entry):
        """"""
        card = vCard()

        card.add('uid').value = Abook._gen_uid(entry)
        card.add('fn').value = entry['name']
        card.add('n').value = Abook._gen_name(entry['name'])

        if 'email' in entry:
            for email in entry['email'].split(','):
                card.add('email').value = email

        addr_comps = ['address', 'address2', 'city', 'country', 'zip', 'country']
        if any(comp in entry for comp in addr_comps):
            card.add('adr').value = Abook._gen_addr(entry)

        if 'other' in entry:
            tel = card.add('tel')
            tel.value = entry['other']

        if 'phone' in entry:
            tel = card.add('tel')
            tel.type_param = 'home'
            tel.value = entry['phone']

        if 'workphone' in entry:
            tel = card.add('tel')
            tel.type_param = 'work'
            tel.value = entry['workphone']

        if 'mobile' in entry:
            tel = card.add('tel')
            tel.type_param = 'cell'
            tel.value = entry['mobile']

        if 'nick' in entry:
            card.add('nickname').value = entry['nick']

        if 'url' in entry:
            card.add('url').value = entry['url']

        if 'notes' in entry:
            card.add('note').value = entry['notes']

        self._add_photo(card, entry['name'])

        return card
795998
def tostr(self):
        """"""
        element = _transform.SVGFigure(self.width, self.height)
        element.append(self)
        svgstr = element.to_str()
        return svgstr
728628
private String toStringIterative() {
		final String PADDING = "                                 ";
		final StringBuilder sb = new StringBuilder();
		int elements_debug_local_recounter = 0;
		Node<K, V> node = null;
		int nodeid = rootIdx;
		int depth = 0;
		stackSlots.clear();
		stackSlots.push(rootIdx); // init seed, root node
		boolean lastIsInternal = !Node.isLeaf(rootIdx);
		while (!stackSlots.isEmpty()) {
			nodeid = stackSlots.pop();
			node = getNode(nodeid);
			if (!node.isLeaf()) {
				for (int i = node.allocated; i >= 0; i--) {
					stackSlots.push(((InternalNode<K, V>) node).childs[i]);
				}
			} else {
				elements_debug_local_recounter += node.allocated;
			}
			// For Indentation
			if (lastIsInternal || !node.isLeaf()) { // Last or Curret are Internal
				depth += (lastIsInternal ? +1 : -1);
			}
			lastIsInternal = !node.isLeaf();
			sb.append(PADDING.substring(0, Math.min(PADDING.length(), Math.max(depth - 1, 0))));
			//
			sb.append(node.toString()).append("\n");
		}

		// Count elements
		sb.append("height=").append(getHeight()).append(" root=").append(rootIdx).append(" low=")
				.append(lowIdx).append(" high=").append(highIdx).append(" elements=").append(elements)
				.append(" recounter=").append(elements_debug_local_recounter);

		return sb.toString();
	}
162989
def formatetfindexjson(fundbjson):
        """"""
        result = {}
        for row in fundbjson["rows"]:
            cell = row["cell"]
            fundb_id = cell["fund_id"]
            result[fundb_id] = cell
        return result
595458
def to_str(self):
        ''''''
        pairs = []
        for name, value in self.get_all():
            if value and self._wrap_width:
                pairs.append('{0}:{1}'.format(
                    name,
                    '\r\n'.join(textwrap.wrap(
                        value, width=self._wrap_width,
                        drop_whitespace=False, initial_indent=' ',
                        subsequent_indent=' '
                    ))
                ))
            elif value:
                pairs.append('{0}: {1}'.format(name, value))
            else:
                pairs.append('{0}:'.format(name))

        pairs.append('')
        return '\r\n'.join(pairs)
460373
function formatCSV(values) {
    if (values instanceof Array) {
        return values.map(v => formatValue(v)).join();
    }
    if (typeof values === 'object' && values !== null) {
        return Object.keys(values).map(v => formatValue(values[v])).join();
    }
    return values === undefined ? '' : formatValue(values);
}
726482
public function buildVCard()
    {
        // init string
        $string = "BEGIN:VCARD\r\n";
        $string .= "VERSION:3.0\r\n";
        $string .= "REV:" . date("Y-m-d") . "T" . date("H:i:s") . "Z\r\n";

        // loop all properties
        $properties = $this->getProperties();
        foreach ($properties as $property) {
            // add to string
            $string .= $this->fold($property['key'] . ':' . $this->escape($property['value']) . "\r\n");
        }

        // add to string
        $string .= "END:VCARD\r\n";

        // return
        return $string;
    }
103808
function (format) {
  throw new Error(index$1.red('[indian-ocean] You passed in an object but converting to ' + index$1.bold(format) + ' requires a list of objects.') + index$1.cyan('\nIf you would like to write a one-row csv, put your object in a list like so: `' + index$1.bold('[data]') + '`\n'));
}
663806
def format_struct(struct_def):
    '''
    '''
    text = []
    text.append('cdef struct {}:'.format(struct_def.tp_name))
    text.extend(
        ['{}{}'.format(tab, format_variable(var))
         for var in struct_def.members]
    )

    for name in struct_def.names:
        text.append('ctypedef {} {}'.format(struct_def.tp_name, name))

    return text
1217826
def to_string(self, limit=None):
        
        header = self.short_string()
        if len(self) == 0:
            return header
        contents = ""
        element_lines = [
            "  -- %s" % (element,)
            for element in self.elements[:limit]
        ]
        contents = "\n".join(element_lines)

        if limit is not None and len(self.elements) > limit:
            contents += "\n  ... and %d more" % (len(self) - limit)
        return "%s\n%s" % (header, contents)