Add a write method for named schema to a class.
352508
def _read_function(schema):
    
    def func(
        filename=None,
        data=None,
        add_node_labels=True,
        use_uids=True,
        **kwargs):
        # Use generic write class to write data.
        return _read(
            filename=filename,
            data=data,
            schema=schema,
            add_node_labels=add_node_labels,
            use_uids=use_uids,
            **kwargs
        )
    # Update docs
    func.__doc__ = _read_doc_template(schema)
    return func
300747
public static <T> void writeTo(OutputStream out, T message, Schema<T> schema, boolean numeric,
            LinkedBuffer buffer) throws IOException
    {
        if (buffer.start != buffer.offset)
        {
            throw new IllegalArgumentException("Buffer previously used and had not been reset.");
        }

        MsgpackXOutput output = new MsgpackXOutput(buffer, numeric, schema);

        LinkedBuffer objectHeader = output.writeStartObject();
        schema.writeTo(output, message);

        if (output.isLastRepeated())
        {
            output.writeEndArray();
        }

        output.writeEndObject(objectHeader);

        LinkedBuffer.writeTo(out, buffer);
    }
723218
protected int writeEnclosingMethodAttribute(Name attributeName, ClassSymbol c) {
        if (c.owner.kind != MTH && // neither a local class
            c.name != names.empty) // nor anonymous
            return 0;

        int alenIdx = writeAttr(attributeName);
        ClassSymbol enclClass = c.owner.enclClass();
        MethodSymbol enclMethod =
            (c.owner.type == null // local to init block
             || c.owner.kind != MTH) // or member init
            ? null
            : (MethodSymbol)c.owner;
        databuf.appendChar(pool.put(enclClass));
        databuf.appendChar(enclMethod == null ? 0 : pool.put(nameType(c.owner)));
        endAttr(alenIdx);
        return 1;
    }
837898
private void writeMethods(Definition def, Writer out, int indent) throws IOException
   {
      if (def.getMcfDefs().get(0).isDefineMethodInConnection())
      {
         if (def.getMcfDefs().get(0).getMethods().size() > 0)
         {
            for (MethodForConnection method : def.getMcfDefs().get(0).getMethods())
            {
               writeMethodSignature(out, indent, method);

               writeLeftCurlyBracket(out, indent);
               writeIndent(out, indent + 1);
               if (!method.getReturnType().equals("void"))
               {
                  out.write("return ");
               }
               out.write("getConnection()." + method.getMethodName() + "(");
               int paramSize = method.getParams().size();
               for (int i = 0; i < paramSize; i++)
               {
                  MethodParam param = method.getParams().get(i);
                  out.write(param.getName());
                  if (i + 1 < paramSize)
                     out.write(", ");
               }
               out.write(");\n");

               writeRightCurlyBracket(out, indent);
            }
         }
      }
      else
      {
         writeSimpleMethodSignature(out, indent, " * Call me", "public void callMe()");
         writeLeftCurlyBracket(out, indent);
         writeWithIndent(out, indent + 1, "try");
         writeLeftCurlyBracket(out, indent + 1);
         writeWithIndent(out, indent + 2, "getConnection().callMe();");
         writeRightCurlyBracket(out, indent + 1);
         writeWithIndent(out, indent + 1, "catch (Exception e)");
         writeLeftCurlyBracket(out, indent + 1);
         writeRightCurlyBracket(out, indent + 1);
         writeRightCurlyBracket(out, indent);
      }
   }
123881
public function setSchemaByName($schema_name = null)
    {
        if (! $schema_name) {
            $schema_name = $this->namespace;
        }
        if (strpos($schema_name, '.') === false) {
            $schema_name = (String) $this->db . '.' . $schema_name;
        }

        // Check formats
        if ($this->client->schema_format === 'php') {
            $schema_file = $this->client->schema_dir . '/' . $schema_name . '.php';
            if (file_exists($schema_file)) {
                $schema = include $schema_file;
                if (! is_array($schema)) {
                    throw new \Exception('Possible PHP syntax error in ' . $schema_file);
                }
            }
        } elseif ($this->client->schema_format === 'json') {
            $schema_file = $this->client->schema_dir . '/' . $schema_name . '.json';
            if (file_exists($schema_file)) {
                $json_string = file_get_contents($schema_file);
                $schema = json_decode($json_string, true);
                if (empty($schema)) {
                    throw new \Exception('Possible JSON parse error in ' . $schema_file);
                }
            }
        } else {
            throw new \Exception('Unknown schema format: ' . $this->client->schema_format);
        }

        // Assign Schema
        if (! empty($schema)) {
            $this->setSchema($schema);
        }

    }
1222564
public static <T> void writeTo(MessageBufferOutput out, T message, Schema<T> schema, boolean numeric)
            throws IOException
    {

        MessagePacker packer = MessagePack.newDefaultPacker(out);

        try
        {
            writeTo(packer, message, schema, numeric);
        }
        finally
        {
            packer.flush();
        }
    }
637336
private void createSchema() throws SQLException {
		logger.entering(CLASSNAME, "createSchema");
		Connection conn = getConnectionToDefaultSchema();

		logger.log(Level.INFO, schema + " schema does not exists. Trying to create it.");
		PreparedStatement ps = null;
		ps = conn.prepareStatement("CREATE SCHEMA " + schema);
		ps.execute();

		cleanupConnection(conn, null, ps);
		logger.exiting(CLASSNAME, "createSchema");
	}
691382
def save(self, *args, **kwargs):
        """"""
        if self.descriptor_schema:
            try:
                validate_schema(self.descriptor, self.descriptor_schema.schema)  # pylint: disable=no-member
                self.descriptor_dirty = False
            except DirtyError:
                self.descriptor_dirty = True
        elif self.descriptor and self.descriptor != {}:
            raise ValueError("`descriptor_schema` must be defined if `descriptor` is given")

        super().save()
367511
def []= (name, value)
      field = schema.fields[name.to_s] || FieldDefinition.new(name, :type => value.class)
      write_attribute(field, value, self)
    end
1278387
def add_methods(self, service):
        """"""
        bindings = {
            "document/literal": Document(self),
            "rpc/literal": RPC(self),
            "rpc/encoded": Encoded(self)}
        for p in service.ports:
            binding = p.binding
            ptype = p.binding.type
            operations = p.binding.type.operations.values()
            for name in (op.name for op in operations):
                m = Facade("Method")
                m.name = name
                m.location = p.location
                m.binding = Facade("binding")
                op = binding.operation(name)
                m.soap = op.soap
                key = "/".join((op.soap.style, op.soap.input.body.use))
                m.binding.input = bindings.get(key)
                key = "/".join((op.soap.style, op.soap.output.body.use))
                m.binding.output = bindings.get(key)
                p.methods[name] = m
943891
def insert_doc(self, p_elem, docstring):
        """"""
        dtag = self.namespaces[self.a_uri] + ":documentation"
        elem = SchemaNode(dtag, text=docstring)
        p_elem.annots.append(elem)
1141613
public static <T> void writeTo(Writer writer, T message, Schema<T> schema,
            boolean numeric) throws IOException
    {
        final JsonGenerator generator = DEFAULT_JSON_FACTORY.createJsonGenerator(writer);
        try
        {
            writeTo(generator, message, schema, numeric);
        }
        finally
        {
            generator.close();
        }
    }
772591
private void createSchemaOnDb() {
        StringBuilder sql = new StringBuilder();
        sql.append(topology.getSqlgGraph().getSqlDialect().createSchemaStatement(this.name));
        if (this.sqlgGraph.getSqlDialect().needsSemicolon()) {
            sql.append(";");
        }
        if (logger.isDebugEnabled()) {
            logger.debug(sql.toString());
        }
        Connection conn = this.sqlgGraph.tx().getConnection();
        try (Statement stmt = conn.createStatement()) {
            stmt.execute(sql.toString());
        } catch (SQLException e) {
            logger.error("schema creation failed " + this.sqlgGraph.toString(), e);
            throw new RuntimeException(e);
        }
    }
1013240
protected Collection<JavaWriter> writeExtraData(SchemaDefinition definition, Function<File,JavaWriter> writerGenerator){
        return Collections.emptyList();
    }
757036
private void writeObject(ObjectOutputStream out) throws IOException {
		out.writeInt(batchSize);
		this.conf.write(out);
		out.writeUTF(schema.toString());

		out.writeInt(selectedFields.length);
		for (int f : selectedFields) {
			out.writeInt(f);
		}

		out.writeInt(conjunctPredicates.size());
		for (Predicate p : conjunctPredicates) {
			out.writeObject(p);
		}
	}
335426
def addMethod(self, m):
        
        if m.nargs == -1:
            m.nargs = len([a for a in marshal.genCompleteTypes(m.sigIn)])
            m.nret = len([a for a in marshal.genCompleteTypes(m.sigOut)])
        self.methods[m.name] = m
        self._xml = None
87284
private void defineWriteBridgeMethod()
    {
        classDefinition.addMethod(
                new MethodDefinition(a(PUBLIC, BRIDGE, SYNTHETIC), "write", null, arg("struct", Object.class), arg("protocol", TProtocol.class))
                        .addException(Exception.class)
                        .loadThis()
                        .loadVariable("struct", structType)
                        .loadVariable("protocol")
                        .invokeVirtual(
                                codecType,
                                "write",
                                type(void.class),
                                structType,
                                type(TProtocol.class)
                        )
                        .ret()
        );
    }