Writes the given function input definition.
4539
protected void writeFunction( FunctionInputDef function)
    {
    xmlWriter_
      .element( FUNCTION_TAG)
      .attribute( NAME_ATR, function.getName())
      .content( () ->
        {
        writeAnnotations( function);
        for( String varType : function.getVarTypes())
          {
          writeInputs(
            varType,
            toStream( function.getVarDefs())
            .filter( varDef -> varDef.getType().equals( varType))
            .sorted());
          }
        })
      .write();
    }
127732
public void write( SystemInputDef systemInput)
    {
    JsonWriterFactory writerFactory = Json.createWriterFactory( MapBuilder.of( PRETTY_PRINTING, true).build());
    JsonWriter jsonWriter = writerFactory.createWriter( getWriter());

    jsonWriter.write( SystemInputJson.toJson( systemInput));
    }
590951
private void writeMef(Definition def, Writer out, int indent) throws IOException
   {
      writeWithIndent(out, indent, "/**\n");
      writeWithIndent(out, indent, " * Get message endpoint factory\n");
      writeWithIndent(out, indent, " * @return Message endpoint factory\n");
      writeWithIndent(out, indent, " */\n");

      writeWithIndent(out, indent, "public MessageEndpointFactory getMessageEndpointFactory()");
      writeLeftCurlyBracket(out, indent);
      writeWithIndent(out, indent + 1, "return endpointFactory;");

      writeRightCurlyBracket(out, indent);
      writeEol(out);
   }
476997
def write_stdout function #, string
      # TODO save and restore r0
      function.mov( :r0 ,  1 ) # 1 == stdout
      function.mov( :r1 , receiver_register )
      function.mov( receiver_register , :r3 )
      syscall( function.insertion_point , 4 ) # 4 == write
    end
499738
public function writeRoutineFunction(): void
  {
    if (!$this->lobAsStringFlag && $this->isBlobParameter($this->routine['parameters']))
    {
      $this->writeRoutineFunctionWithLob();
    }
    else
    {
      $this->writeRoutineFunctionWithoutLob();
    }
  }
42997
def write_to(self, f):
        
        f = CodeWriter(f)

        # Write all header files
        headers = set()
        for plugin in self.plugins:
            headers = headers.union(plugin.header_files())
        for header in headers:
            f.writeln("#include <{}>".format(header))
        f.writeln("")

        # Write all declarations
        for plugin in self.plugins:
            plugin.write_declarations(f)
        f.writeln("")

        # Write the setup function
        with f._function("void", "setup"):
            # Setup all plugins
            f.writeln("// Setup all plugins")
            for plugin in self.plugins:
                plugin.setup_plugin(f)
            # Setup all modules
            f.writeln("// Setup all modules")
            for mod_name in self.modules.keys():
                for plugin in self.plugins:
                    plugin.setup_module(mod_name, f)
        f.writeln("")

        # Write the loop function
        with f._function("void", "loop"):
            # Update all plugins
            f.writeln("// Update all plugins")
            for plugin in self.plugins:
                plugin.update_plugin(f)
            # Update all modules
            f.writeln("// Update all modules")
            for mod_name, mod_info in self.modules.items():
                for plugin in self.plugins:
                    plugin.update_module(mod_name, f)

                # Read all module outputs
                for output_name in mod_info["outputs"]:
                    cond = "{mod_name}.get_{output_name}({msg_name})".format(
                        mod_name=mod_name, output_name=output_name,
                        msg_name=self.msg_name(mod_name, output_name)
                    )
                    with f._if(cond):
                        for plugin in self.plugins:
                            plugin.on_output(mod_name, output_name, f)

            # Read statuses of all modules
            f.writeln("// Read statuses of all modules")
            with f._if("should_read_statuses()"):
                for plugin in self.plugins:
                    plugin.start_read_module_status(f)
                for mod_name in self.modules:
                    for plugin in self.plugins:
                        plugin.read_module_status(mod_name, f)
                for plugin in self.plugins:
                    plugin.end_read_module_status(f)
38913
def write(self, f):
        
        if isinstance(f, str):
            f = io.open(f, 'w', encoding='utf-8')

        if not hasattr(f, 'read'):
            raise AttributeError("Wrong type of file: {0}".format(type(f)))

        NS_LOGGER.info('Write to `{0}`'.format(f.name))
        for section in self.sections.keys():
            f.write('[{0}]\n'.format(section))
            for k, v in self[section].items():
                f.write('{0:15}= {1}\n'.format(k, v))
            f.write('\n')
        f.close()
710173
def write(self, value):
        """"""
        assert self.num_write_waits > 0, self
        self.num_write_waits -= 1
        self.values.append(value)
        if self.readable:
            LOG.debug('%s is now readable', self.name)
587534
def write_docstring_for_shortcut(self):
        """"""
        # cursor placed below function definition
        result = self.get_function_definition_from_below_last_line()
        if result is not None:
            __, number_of_lines_of_function = result
            cursor = self.code_editor.textCursor()
            for __ in range(number_of_lines_of_function):
                cursor.movePosition(QTextCursor.PreviousBlock)

            self.code_editor.setTextCursor(cursor)

        cursor = self.code_editor.textCursor()
        self.line_number_cursor = cursor.blockNumber() + 1

        self.write_docstring_at_first_line_of_function()
611395
function write(s) {
		var err
		var args = Array.prototype.slice.call(arguments)
		var cb = typeof args[args.length - 1] === 'function' ? args.pop() : null
		var cbCounter = 1
		if (writeToStdoutEnabled) {
			cbCounter++
			process.stdout.write(s, stdWr)
		}
		if (writeStream) {
			cbCounter++
			writeStream.write(s, wRes)
		}
		end()

		function stdWr(e) {
			if (e) {
				if (!err) err = e
				writeToStdoutEnabled = false
				write('stdout error: ' + e.message)
				self.emit('error', e)
			}
			end()
		}

		function wRes(e) {
			if (e) {
				if (!err) err = e
				writeStream = false
				write('stream error: ' + e.message)
				self.emit('error', e)
			}
			end()
		}

		function end() {
			if (!--cbCounter)
				if (cb)
					if (err) cb(err)
					else cb()
		}
	}
196090
def _write(self, fp):
        """"""
        def write_section(name, section_dict):
            fp.write(("[%s]\n" % name).encode(defenc))
            for (key, value) in section_dict.items():
                if key != "__name__":
                    fp.write(("\t%s = %s\n" % (key, self._value_to_string(value).replace('\n', '\n\t'))).encode(defenc))
                # END if key is not __name__
        # END section writing

        if self._defaults:
            write_section(cp.DEFAULTSECT, self._defaults)
        for name, value in self._sections.items():
            write_section(name, value)
412681
protected void writeGenerator( String function, ITestCaseGenerator generator)
    {
    if( !generator.getClass().equals( TupleGenerator.class))
      {
      throw
        new UnsupportedOperationException
        ( "Can't write generator=" + generator
          + ": only TupleGenerator currently supported");
      }

    writeTupleGenerator( function, (TupleGenerator) generator);
    }
819521
private void writeMethod(Definition def, Writer out, int indent) throws IOException
   {
      if (def.getMcfDefs().get(getNumOfMcf()).isDefineMethodInConnection())
      {
         if (def.getMcfDefs().get(getNumOfMcf()).getMethods().size() > 0)
         {
            for (MethodForConnection method : def.getMcfDefs().get(getNumOfMcf()).getMethods())
            {
               writeMethodSignature(out, indent, method);
               writeLeftCurlyBracket(out, indent);
               writeIndent(out, indent + 1);

               if (!method.getReturnType().equals("void"))
               {
                  out.write("return ");
               }
               out.write("mc." + 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(");");

               writeRightCurlyBracket(out, indent);
               writeEol(out);
            }
         }
      }
      else
      {
         writeSimpleMethodSignature(out, indent, " * Call me", "public void callMe()");
         writeLeftCurlyBracket(out, indent);
         writeWithIndent(out, indent + 1, "if (mc != null)\n");
         writeWithIndent(out, indent + 2, "mc.callMe();");
         writeRightCurlyBracket(out, indent);
      }

      writeEol(out);
      writeSimpleMethodSignature(out, indent, " * Close", "public void close()");
      writeLeftCurlyBracket(out, indent);
      writeWithIndent(out, indent + 1, "if (mc != null)\n");
      writeLeftCurlyBracket(out, indent + 1);
      writeWithIndent(out, indent + 2, "mc.closeHandle(this);\n");
      writeIndent(out, indent + 2);
      out.write("mc = null;");
      writeRightCurlyBracket(out, indent + 1);
      writeRightCurlyBracket(out, indent);

      writeEol(out);
      writeWithIndent(out, indent, "/**\n");
      writeWithIndent(out, indent, " * Set ManagedConnection\n");
      writeWithIndent(out, indent, " */\n");
      writeWithIndent(out, indent,
            "void setManagedConnection(" + def.getMcfDefs().get(getNumOfMcf()).getMcClass() + " mc)");
      writeLeftCurlyBracket(out, indent);
      writeWithIndent(out, indent + 1, "this.mc = mc;");
      writeRightCurlyBracket(out, indent);
   }
984054
void writeConfigProps(Definition def, Writer out, int indent) throws IOException
   {
      if (getConfigProps(def) == null)
         return;

      for (int i = 0; i < getConfigProps(def).size(); i++)
      {
         String name = getConfigProps(def).get(i).getName();
         String upcaseName = upcaseFirst(name);
         //set
         writeWithIndent(out, indent, "/** \n");
         writeWithIndent(out, indent, " * Set " + name);
         writeEol(out);
         writeWithIndent(out, indent, " * @param " + name + " The value\n");
         writeWithIndent(out, indent, " */\n");

         writeWithIndent(out, indent, "public void set" +
               upcaseName +
               "(" +
               getConfigProps(def).get(i).getType() +
               " " +
               name +
               ")");
         writeLeftCurlyBracket(out, indent);
         writeWithIndent(out, indent + 1, "this." + name + " = " + name + ";");
         writeRightCurlyBracket(out, indent);
         writeEol(out);

         //get
         writeWithIndent(out, indent, "/** \n");
         writeWithIndent(out, indent, " * Get " + name);
         writeEol(out);
         writeWithIndent(out, indent, " * @return The value\n");
         writeWithIndent(out, indent, " */\n");
         writeWithIndent(out, indent, "public " +
               getConfigProps(def).get(i).getType() +
               " get" +
               upcaseName +
               "()");
         writeLeftCurlyBracket(out, indent);
         writeWithIndent(out, indent + 1, "return " + name + ";");
         writeRightCurlyBracket(out, indent);
         writeEol(out);
      }
   }
1318865
void write(Object value) throws IOException {
    if (clientInputSerializer != null) {
      clientInputSerializer.serialize(value);
      return;
    }

    byte[] bval;
    int valSize;
    if (value instanceof BytesWritable) {
      BytesWritable val = (BytesWritable) value;
      bval = val.getBytes();
      valSize = val.getLength();
    } else if (value instanceof Text) {
      Text val = (Text) value;
      bval = val.getBytes();
      valSize = val.getLength();
    } else {
      String sval = value.toString();
      bval = sval.getBytes("UTF-8");
      valSize = bval.length;
    }
    clientOut_.write(bval, 0, valSize);
  }
128834
@JSFunction
    public static void writeLine(Context cx, Scriptable thisObj,
                                            Object[] args, Function funObj)
        throws IOException
    {
        write0(thisObj, args, true);
    }
255075
@Nullable
    Optional<String> writeFunctionCounter(FunctionCounter counter) {
        double count = counter.count();
        if (Double.isFinite(count) && count > 0) {
            // can't use "count" field because sum is required whenever count is set.
            return Optional.of(write(counter.getId(), "functionCounter", Fields.Value.tag(), decimal(count)));
        }
        return Optional.empty();
    }