Generate flag fragment.
422915
protected function sqlFlag($buffer_id)
	{
		if (isset($this->buffers[$buffer_id])) {
			if (isset($this->buffers[$flag_buf])) {
				echo ' ', $this->buffers[$flag_buf];
			}
		}
	}
282855
public function flag() {
        global $DB;

        $this->ensure_fields_exist(array('name', 'userid', 'rawname', 'flag'), 'flag');

        // Update all the tags to flagged.
        $this->timemodified = time();
        $this->flag++;
        $DB->update_record('tag', array('timemodified' => $this->timemodified,
            'flag' => $this->flag, 'id' => $this->id));

        $event = \core\event\tag_flagged::create(array(
            'objectid' => $this->id,
            'relateduserid' => $this->userid,
            'context' => context_system::instance(),
            'other' => array(
                'name' => $this->name,
                'rawname' => $this->rawname
            )

        ));
        $event->trigger();
    }
619394
def nlmsg_flags(self, value):
        """"""
        self.bytearray[self._get_slicers(2)] = bytearray(c_uint16(value or 0))
1223657
def _process_flags(self):
        
        super()._process_flags()

        if len(self.args) == 0:
            self.multi_mode = False
1017257
def parse_flags(*flags, **kwargs):
    """"""

    parsed = {
        'ASFLAGS':       OrderedSet(),
        'CFLAGS':        OrderedSet(),
        'DEFINES':       OrderedSet(),
        'INCLUDES':      OrderedSet(),
        'FRAMEWORKS':    OrderedSet(),
        'FRAMEWORKPATH': OrderedSet(),
        'LDFLAGS':       OrderedSet(),
        'LIBS':          OrderedSet(),
        'LIBPATH':       OrderedSet(),
    }

    def _parse(arg):
        if not arg:
            return

        if not isinstance(arg, STR_TYPES):
            for item in arg:
                _parse(arg)
            return

        def add_define(name):
            part = name.split('=')
            if len(part) == 1:
                parsed['DEFINES'].add(name)
            else:
                parsed['DEFINES'].add([part[0], '='.join(part[1:])])

        part = shlex.split(arg)
        curr = None   # For multiword arguments
        for item in part:
            if curr is not None:
                if curr == 'DEFINES':
                    add_define(item)
                elif curr == '-include':
                    parsed['CFLAGS'].add(('-include', item))
                elif curr == '-isysroot':
                    parsed['CFLAGS'].add(('-isysroot', item))
                    parsed['LDFLAGS'].add(('-isysroot', item))
                elif curr == '-arch':
                    parsed['CFLAGS'].add(('-arch', item))
                    parsed['LDFLAGS'].add(('-arch', item))
                else:
                    parsed[curr].add(item)
                curr = None

            elif not item[0] in '-+':
                parsed['LIBS'].add(item)

            elif item == '-dylib_file':
                parsed['LDFLAGS'].add(item)
                curr = 'LDFLAGS'

            elif item[:2] == '-L':
                if item[2:]:
                    parsed['LIBPATH'].add(item[2:])
                else:
                    curr = 'LIBPATH'

            elif item[:2] == '-l':
                if item[2:]:
                    parsed['LIBS'].add(item[2:])
                else:
                    curr = 'LIBS'

            elif item[:2] == '-I':
                if item[2:]:
                    parsed['INCLUDES'].add(item[2:])
                else:
                    curr = 'INCLUDES'

            elif item[:4] == '-Wa,':
                parsed['ASFLAGS'].add(arg[4:])
                parsed['CFLAGS'].add(item)

            elif item[:4] == '-Wp,':
                parsed['CFLAGS'].add(item)

            elif item[:2] == '-D':
                if item[2:]:
                    parsed['DEFINES'].add(item[2:])
                else:
                    curr = 'DEFINES'

            elif item == '-framework':
                curr = 'FRAMEWORKS'

            elif item[:14] == '-frameworkdir=':
                parsed['FRAMEWORKPATH'].add(item[14:])

            elif item[:2] == '-F':
                if item[2:]:
                    parsed['FRAMEWORKPATH'].add(item[2:])
                else:
                    curr = 'FRAMEWORKPATH'

            elif item in ('-mno-cygwin', '-pthread', '-openmp', '-fopenmp'):
                parsed['CFLAGS'].add(item)
                parsed['LDFLAGS'].add(item)

            elif item == '-mwindows':
                parsed['LDFLAGS'].add(item)

            elif item[:5] == '-std=':
                parsed['CFLAGS'].add(item)

            elif item[0] == '+':
                parsed['CFLAGS'].add(item)
                parsed['LDFLAGS'].add(item)

            elif item in ('-include', '-isysroot', '-arch'):
                curr = item

            else:
                parsed[kwargs.get('origin', 'CFLAGS')].add(item)

    for arg in flags:
        _parse(arg)

    return parsed
713379
function customFragment (token, tokens) {
  let escaping = false
  let fragment = ''
  token = tokens.shift() // remove opened {
  while (true) {
    if (!token) {
      throw new Error('A custom fragment requires "}" to terminate')
    }
    if (escaping) {
      if (includes('{}', token)) {
        fragment += token
      } else {
        fragment += `\\${token}`
      }
      escaping = false
    } else if (token === '\\') {
      escaping = true
    } else if (token === '}') {
      break
    } else {
      fragment += token
    }
    token = tokens.shift()
  }
  return { _type: customFragment.name, fragment }
}
468280
def _create_flags(self, kw):
        

        flags = {}
        for k in kw.keys():
            flags[k] = kw[k]
            flags[k.lower()] = flags[k]
        return flags
92366
def ifi_flags(self, value):
        """"""
        self.bytearray[self._get_slicers(4)] = bytearray(c_uint(value or 0))
865271
def fragment(self, fragsize=1392):
        """"""
        fnb = 0
        fl = self
        lst = list()
        while fl.underlayer is not None:
            fnb += 1
            fl = fl.underlayer

        for p in fl:
            s = raw(p[fnb].payload)
            nb = (len(s) + fragsize) // fragsize
            for i in range(nb):
                q = p.copy()
                del q[fnb].payload
                q[fnb].len = SOMEIP.LEN_OFFSET_TP + \
                    len(s[i * fragsize:(i + 1) * fragsize])
                q[fnb].more_seg = 1
                if i == nb - 1:
                    q[fnb].more_seg = 0
                q[fnb].offset += i * fragsize // 16
                r = conf.raw_layer(load=s[i * fragsize:(i + 1) * fragsize])
                r.overload_fields = p[fnb].payload.overload_fields.copy()
                q.add_payload(r)
                lst.append(q)

        return lst
461301
def xincludeProcessFlags(self, flags):
        
        ret = libxml2mod.xmlXIncludeProcessFlags(self._o, flags)
        return ret
964716
def flags(self, index):
        """"""
        column = index.column()

        if index.isValid():
            if column in [C.COL_START, C.COL_END]:
#                return Qt.ItemFlags(Qt.ItemIsEnabled | Qt.ItemIsSelectable)
                return Qt.ItemFlags(Qt.ItemIsEnabled)
            else:
                return Qt.ItemFlags(Qt.ItemIsEnabled | Qt.ItemIsSelectable)
#                return Qt.ItemFlags(Qt.ItemIsEnabled)
        else:
            return Qt.ItemFlags(Qt.ItemIsEnabled)
366489
public static String flagsToString(short flags) {
        StringBuilder sb=new StringBuilder();
        boolean first=true;

        Flag[] all_flags=Flag.values();
        for(Flag flag: all_flags) {
            if(isFlagSet(flags, flag)) {
                if(first)
                    first=false;
                else
                    sb.append("|");
                sb.append(flag);
            }
        }
        return sb.toString();
    }
525701
def render(self, flags: Flags) -> Text:
        
        return random.choice(self.best_for_flags(flags)).value
872996
def __RenderOurModuleFlags(self, module, output_lines, prefix=''):
    """"""
    flags = self._GetFlagsDefinedByModule(module)
    if flags:
      self.__RenderModuleFlags(module, flags, output_lines, prefix)
562773
def flags(self, index):
        "
        return QtCore.Qt.ItemIsEditable | QtCore.Qt.ItemIsEnabled | QtCore.Qt.ItemIsSelectable
115468
def _setFlag(self, name, val, defVal):
        """"""
        if not hasattr(self, "flags"):
            self.flags = {}
        if val != defVal:
            self.flags[name] = val
1334842
def set_flag(self, value, flag, reset_val=False):
        """"""
        if not self.__dict__[flag]:
            self.__dict__[flag] = matrix(1.0, (len(self.__dict__[value]), 1),
                                         'd')
        for idx, item in enumerate(self.__dict__[value]):
            if item == 0:
                self.__dict__[flag][idx] = 0
                if reset_val:
                    self.__dict__[value][idx] = 1