Adds the Macro PDF417 control block codewords (if any).
431506
private void addMacroCodewords() {

        // if the structured append series size is 1, this isn't
        // actually part of a structured append series
        if (structuredAppendTotal == 1) {
            return;
        }

        // add the Macro marker codeword
        codeWords[codeWordCount++] = 928;

        // add the segment index, padded with leading zeros to five digits
        // use numeric compaction, but no latch
        int segmentIndex = structuredAppendPosition - 1;
        int[] data = new int[5];
        for (int x = data.length - 1; x >= 0; x--) {
            data[x] = '0' + (segmentIndex % 10);
            segmentIndex /= 10;
        }
        processNumbers(data, 0, data.length, true);

        // add the file ID (base 900, which is easy since we limit
        // file ID values to the range 0 to 899)
        codeWords[codeWordCount++] = structuredAppendFileId;

        // NOTE: we could add the optional segment count field here, but
        // it doesn't appear to be necessary... if we do eventually decide
        // to add it, it will probably be [923, 001, count1, count2]

        // add the terminator to the last symbol of the series
        boolean last = (structuredAppendPosition == structuredAppendTotal);
        if (last) {
            codeWords[codeWordCount++] = 922;
        }
    }
763073
def do_macro_block(parser, token):
    
    tag_name, macro_name, args, kwargs = parse_macro_params(token)
    # could add extra validation on the macro_name tag
    # here, but probably don't need to since we're checking
    # if there's a macro by that name anyway.
    try:
        # see if the macro is in the context.
        macro = parser._macros[macro_name]
    except (AttributeError, KeyError):
        raise template.TemplateSyntaxError(
            "Macro '{0}' is not defined ".format(macro_name) +
            "previously to the {0} tag".format(tag_name))
    # get the arg and kwarg nodes from the nodelist
    nodelist = parser.parse(('endmacro_block',))
    parser.delete_first_token()

    # Loop through nodes, sorting into args/kwargs
    # (we could do this more semantically, but we loop
    # only once like this as an optimization).
    for node in nodelist:
        if isinstance(node, MacroArgNode) and not isinstance(node, MacroKwargNode):
            # note that MacroKwargNode is also a MacroArgNode (via inheritance),
            # so we must check against this.
            args.append(node)
        elif isinstance(node, MacroKwargNode):
            if node.keyword in macro.kwargs:
                # check that the keyword is defined as an argument for
                # the macro.
                if node.keyword not in kwargs:
                    # add the keyword argument to the dict
                    # if it's not in there
                    kwargs[node.keyword] = node
                else:
                    # raise a template syntax error if the
                    # keyword is already in the dict (thus a keyword
                    # argument was passed twice.
                    raise template.TemplateSyntaxError(
                        "{0} template tag was supplied "
                        "the same keyword argument multiple times.".format(
                            tag_name))
            else:
                raise template.TemplateSyntaxError(
                    "{0} template tag was supplied with a "
                    "keyword argument not defined by the {1} macro.".format(
                        tag_name, macro_name))
        # The following is a check that only whitespace is inside the macro_block tag,
        # but it's currently removed for reasons of backwards compatibility/potential 
        # uses people might have to put extra stuff in te macro_block tag.
        # elif not isinstance(node, template.TextNode) or node.s.strip() != "":
        #     # whitespace is allowed, anything else is not
        #     raise template.TemplateSyntaxError(
        #         "{0} template tag received an argument that "
        #         "is neither a arg or a kwarg tag. Make sure there's "
        #         "text or template tags directly descending "
        #         "from the {0} tag.".format(tag_name))

    # check that there aren't more arg tags than args
    # in the macro.
    if len(args) > len(macro.args):
        raise template.TemplateSyntaxError(
            "{0} template tag was supplied too many arg block tags.".format(
                tag_name))

    macro.parser = parser
    return MacroBlockNode(macro, nodelist, args, kwargs)
1231549
public void addByeCommand() {
        StringBuilder buf = new StringBuilder();
        buf.append("(bye)");
        fifo.add(fifo.size(), buf.toString());
    }
698149
private Block wrapInMacroMarker(MacroBlock macroBlockToWrap, List<Block> newBlocks)
    {
        return new MacroMarkerBlock(macroBlockToWrap.getId(), macroBlockToWrap.getParameters(),
            macroBlockToWrap.getContent(), newBlocks, macroBlockToWrap.isInline());
    }
271066
def add_block(pBlock, pBehaviour = Languages::KEEP_LEVEL)
      return nil unless (pBlock.instance_of?Languages::BlockData)
      add_with_manager(pBlock, 'block', pBehaviour)
    end
269417
void addTags(Message<?> message, SpanCustomizer result, MessageChannel channel) {
		// TODO topic etc
		if (channel != null) {
			result.tag("channel", messageChannelName(channel));
		}
	}
604780
def add_jump_instruction(jump_arg, code_to_insert):
    
    extended_arg_list = []
    if jump_arg > MAX_BYTE:
        extended_arg_list += [EXTENDED_ARG, jump_arg >> 8]
        jump_arg = jump_arg & MAX_BYTE

    # remove 'RETURN_VALUE' instruction and add 'POP_JUMP_IF_TRUE' with (if needed) 'EXTENDED_ARG'
    return list(code_to_insert.co_code[:-RETURN_VALUE_SIZE]) + extended_arg_list + [opmap['POP_JUMP_IF_TRUE'], jump_arg]
323090
def extendMarkdown(self, md, md_globals):
        
        md.parser.blockprocessors.add('table',
                                      TableProcessor(md.parser),
                                      '<hashheader')
386353
protected function addImpliedCommands()
    {
        if (count($this->columns) > 0 && ! $this->creating()) {
            array_unshift($this->commands, $this->createCommand('add'));
        }

        $this->addFluentIndexes();
    }
413093
def add_command(self, cmd_name, *args):
        """"""
        self.__commands.append(Command(cmd_name, args))
1279194
def add_whitespace_hook(self, data: cmd2.plugin.PostparsingData) -> cmd2.plugin.PostparsingData:
        
        command = data.statement.command
        # regular expression with looks for:
        #  ^ - the beginning of the string
        # ([^\s\d]+) - one or more non-whitespace non-digit characters, set as capture group 1
        # (\d+) - one or more digit characters, set as capture group 2
        command_pattern = re.compile(r'^([^\s\d]+)(\d+)')
        match = command_pattern.search(command)
        if match:
            data.statement = self.statement_parser.parse("{} {} {}".format(
                match.group(1),
                match.group(2),
                '' if data.statement.args is None else data.statement.args
            ))
        return data
737262
def addDrizKeywords(self,hdr,versions):
        

        # Extract some global information for the keywords
        _geom = 'User parameters'

        _imgnum = 0
        for pl in self.parlist:

            # Start by building up the keyword prefix based
            # on the image number for the chip
            #_keyprefix = 'D%03d'%_imgnum
            _imgnum += 1

            drizdict = DRIZ_KEYWORDS.copy()
            # Update drizdict with current values
            drizdict['VER']['value'] = pl['driz_version'][:44]
            drizdict['DATA']['value'] = pl['data'][:64]
            drizdict['DEXP']['value'] = pl['exptime']
            drizdict['OUDA']['value'] = pl['outFinal'][:64]
            drizdict['OUWE']['value'] = pl['outWeight'][:64]
            if pl['outContext'] is None:
                outcontext = ""
            else:
                outcontext = pl['outContext'][:64]
            drizdict['OUCO']['value'] = outcontext
            if self.single:
                drizdict['MASK']['value'] = pl['singleDrizMask'][:64]
            else:
                drizdict['MASK']['value'] = pl['finalMask'][:64]

            # Process the values of WT_SCL to be consistent with
            # what IRAF Drizzle would output
            if 'wt_scl_val' in pl:
                _wtscl = pl['wt_scl_val']
            else:
                if pl['wt_scl'] == 'exptime': _wtscl = pl['exptime']
                elif pl['wt_scl'] == 'expsq': _wtscl = pl['exptime']*pl['exptime']
                else: _wtscl = pl['wt_scl']

            drizdict['WTSC']['value'] = _wtscl
            drizdict['KERN']['value'] = pl['kernel']
            drizdict['PIXF']['value'] = pl['pixfrac']
            drizdict['OUUN']['value'] = self.units
            if pl['fillval'] is None:
                _fillval = 'INDEF'
            else:
                _fillval = pl['fillval']
            drizdict['FVAL']['value'] = _fillval
            drizdict['WKEY']['value'] = pl['driz_wcskey']

            drizdict['SCAL'] = {'value':pl['scale'],'comment':'Drizzle, pixel size (arcsec) of output image'}
            drizdict['ISCL'] = {'value':pl['idcscale'],'comment':'Drizzle, default IDCTAB pixel size(arcsec)'}

            # Now update header with values
            writeDrizKeywords(hdr,_imgnum,drizdict)
            del drizdict

        # Add version information as HISTORY cards to the header
        if versions is not None:
            ver_str = "AstroDrizzle processing performed using: "
            hdr.add_history(ver_str)
            for k in versions.keys():
                ver_str = '    '+str(k)+' Version '+str(versions[k])
                hdr.add_history(ver_str)
729428
def add_block(self, name):
        

        if not self.RE_NAME.match(name):
            raise ValueError(u"Invalid block name '{0}'"
                             .format(common.from_utf8(name)))

        if name in self._block_map:
            raise ValueError(u"Block '{0}' already exists"
                             .format(common.from_utf8(name)))

        # add new block and index mapping
        self._block_map[name] = len(self._ast[2])  # must come first
        option_list = []
        block = [name, option_list]
        self._ast[2].append(block)
43544
def add_directive(self,
                      key: Optional[str],
                      value: str,
                      lineno: Optional[int] = None,
                      comment: str = '') -> None:
        ''' '''
        if key is None:
            # continuation of multi-line directive
            self.statements[-1][2] += value
            self.values.append(value)
            if self._action is not None:
                self._action_options += value
        else:
            # new directive, the comment before it are used
            self.statements.append([':', key, value, comment])
            self.values = [value]
        if lineno:
            self.lineno = lineno
441906
def add_controls(self, env, target_name='control',
                     file_name='control.json',
                     encoder_cls=SConsEncoder):
        
        if not HAS_SCONS:
            raise ImportError('SCons not available')

        @self.add_target(name=target_name)
        def control(outdir, c):
            return env.Command(os.path.join(outdir, file_name),
                               [],
                               action=_create_control_file,
                               control_dict=c,
                               encoder_cls=encoder_cls)
239066
def add_cmd_handler(self, cmd, func):
        """"""
        len_args = len(inspect.getargspec(func)[0])

        def add_meta(f):
            def decorator(*args, **kwargs):
                f(*args, **kwargs)
            decorator.bytes_needed = len_args - 1  # exclude self
            decorator.__name__ = f.__name__
            return decorator
        func = add_meta(func)
        self._command_handlers[cmd] = func
685859
def register_macro(self, *macros):
        
        for m in macros:
            if inspect.isclass(m) and issubclass(m, macro_module.Macro):
                self.macros.append(m)
            else:
                raise TypeError("Coundn't register macro; a macro must inherit"
                                " from macro.Macro")