Serializes a branch node
420580
def encode_branch_node(left_child_node_hash, right_child_node_hash):
    
    validate_is_bytes(left_child_node_hash)
    validate_length(left_child_node_hash, 32)
    validate_is_bytes(right_child_node_hash)
    validate_length(right_child_node_hash, 32)
    return BRANCH_TYPE_PREFIX + left_child_node_hash + right_child_node_hash
207462
def serialize(_conf)
      [name, Network.fields.map { |sym| [sym.to_s, send(sym)] }.to_h]
    end
1331169
def serializeTransform(transformObj):
    
    return ' '.join([command + '(' + ' '.join([scourUnitlessLength(number) for number in numbers]) + ')'
                     for command, numbers in transformObj])
1126910
def write
      node = to_rxf_node(@members.root , 0)
      io = StringIO.new
      node.out( io , 0 )
      io.string
    end
72966
function serializeChildren(node) {
	var children = node.childNodes;
	if (children.length === 0) {
		return null;
	}
	
	if (children.length === 1 && children[0].nodeType === 3) {
		return children[0].nodeValue;
	}
	
	var result = "";
	var serializer = new XMLSerializer();
	for (var i = 0; i < children.length; i++) {
		result += serializer.serializeToString(children[i]);
	}
	return result;
}
1237963
def node_val_dump(self):
        """"""
        self._flush_node_val()
        for (
                graph, node, key, branch, turn, tick, value
        ) in self.sql('node_val_dump'):
            yield (
                self.unpack(graph),
                self.unpack(node),
                self.unpack(key),
                branch,
                turn,
                tick,
                self.unpack(value)
            )
1014635
function getBranchLinkDomains(branchXml, key) {
    const output = [];
    if (branchXml.hasOwnProperty(key)) {
      for (let i = 0; i < branchXml[key].length; i++) {
        const item = branchXml[key][i];
        output.push(item.$.value);
      }
    }
    return output;
  }
956052
def makebranchcomponents(data, commdct, anode="epnode"):
    """"""
    alledges = []

    objkey = 'BRANCH'
    cnamefield = "Component %s Name"
    inletfield = "Component %s Inlet Node Name"
    outletfield = "Component %s Outlet Node Name"

    numobjects = len(data.dt[objkey])
    cnamefields = loops.repeatingfields(data, commdct, objkey, cnamefield)
    inletfields = loops.repeatingfields(data, commdct, objkey, inletfield)
    outletfields = loops.repeatingfields(data, commdct, objkey, outletfield)

    inlts = loops.extractfields(data, commdct, 
        objkey, [inletfields] * numobjects)
    cmps = loops.extractfields(data, commdct, 
        objkey, [cnamefields] * numobjects)
    otlts = loops.extractfields(data, commdct, 
        objkey, [outletfields] * numobjects)

    zipped = list(zip(inlts, cmps, otlts))
    tzipped = [transpose2d(item) for item in zipped]
    for i in range(len(data.dt[objkey])):
        tt = tzipped[i]
        # branchname = data.dt[objkey][i][1]
        edges = []
        for t0 in tt:
            edges = edges + [((t0[0], anode), t0[1]), (t0[1], (t0[2], anode))]
        alledges = alledges + edges
    return alledges
193058
def dump_tree(node, name=None, initial_indent='', indentation='    ',
              maxline=120, maxmerged=80,
              # Runtime optimization
              iter_node=iter_node, special=ast.AST,
              list=list, isinstance=isinstance, type=type, len=len):
    
    def dump(node, name=None, indent=''):
        level = indent + indentation
        name = name and name + '=' or ''
        values = list(iter_node(node))
        if isinstance(node, list):
            prefix, suffix = '%s[' % name, ']'
        elif values:
            prefix, suffix = '%s%s(' % (name, type(node).__name__), ')'
        elif isinstance(node, special):
            prefix, suffix = name + type(node).__name__, ''
        else:
            return '%s%s' % (name, repr(node))
        node = [dump(a, b, level) for a, b in values if b != 'ctx']
        oneline = '%s%s%s' % (prefix, ', '.join(node), suffix)
        if len(oneline) + len(indent) < maxline:
            return '%s' % oneline
        if node and len(prefix) + len(node[0]) < maxmerged:
            prefix = '%s%s,' % (prefix, node.pop(0))
        node = (',\n%s' % level).join(node).lstrip()
        return '%s\n%s%s%s' % (prefix, level, node, suffix)
    return dump(node, name, initial_indent)
238685
function _dumpDOM(root) {
        var result = "",
            indent = "";

        function walk(node) {
            if (node.tag) {
                result += indent + "TAG " + node.tagID + " " + node.tag + " " + JSON.stringify(node.attributes) + "\n";
            } else {
                result += indent + "TEXT " + (node.tagID || "- ") + node.content + "\n";
            }
            if (node.isElement()) {
                indent += "  ";
                node.children.forEach(walk);
                indent = indent.slice(2);
            }
        }
        walk(root);

        return result;
    }
1090851
public static void serializeWriterFilePermissions(State state, int numBranches, int branchId,
      FsPermission fsPermissions) {
    serializeFsPermissions(state,
        ForkOperatorUtils.getPropertyNameForBranch(ConfigurationKeys.WRITER_FILE_PERMISSIONS, numBranches, branchId),
        fsPermissions);
  }
648859
def handle_branch(repo, **kwargs):
    """"""
    log.info('branch: %s %s' %(repo, kwargs))
    if type(repo) in [unicode, str]:
        path = os.path.join(repo, kwargs.get('name', 'Unnamed'))
        desc = kwargs.get('desc')
        branch = Repo.new(path=path, desc=desc, bare=True)
    else:
        name = kwargs.get('name')
        path = kwargs.get('path')
        if path and not name:
            name = os.path.basename(path)
        desc = kwargs.get('desc')
        branch = repo.branch(name=name, desc=desc)
    return branch.serialize()
553918
private void publishSingleTaskData(WorkUnitState state, int branchId)
      throws IOException {
    publishData(state, branchId, true, new HashSet<Path>());
    addLineageInfo(state, branchId);
  }
77303
def tostring(node, indent=4, nsmap=None):
    
    out = io.BytesIO()
    writer = StreamingXMLWriter(out, indent, nsmap=nsmap)
    writer.serialize(node)
    return out.getvalue()
796973
def serialize(self, node: SchemaNode,
                  value: Any) -> Union[str, ColanderNullType]:
        
        if value is None:
            retval = ''
        else:
            # noinspection PyUnresolvedReferences
            retval = self.type_.serialize(node, value)
        # log.debug("AllowNoneType.serialize: {!r} -> {!r}", value, retval)
        return retval
179935
void serializeNode(OutputArchive oa, StringBuilder path) throws IOException {
        String pathString = path.toString();
        DataNode node = getNode(pathString);
        if (node == null) {
            return;
        }
        String children[] = null;
        synchronized (node) {
            scount++;
            oa.writeString(pathString, "path");
            oa.writeRecord(node, "node");
            Set<String> childs = node.getChildren();
            if (childs != null) {
                children = childs.toArray(new String[childs.size()]);
            }
        }
        path.append('/');
        int off = path.length();
        if (children != null) {
            for (String child : children) {
                // since this is single buffer being resused
                // we need
                // to truncate the previous bytes of string.
                path.delete(off, Integer.MAX_VALUE);
                path.append(child);
                serializeNode(oa, path);
            }
        }
    }
97610
public static void dump(Node alt, int lv, PrintWriter out) {
        for (int i = 0; i < lv; i++)
            out.print("  ");
        out.println(alt.cs != null ? ('"'+alt.cs.toString()+'"') : "(null)");
        if (alt.branches != null) {
            for (Node br : alt.branches) {
                dump(br, lv + 1, out);
            }
        }
    }