Defines a flag from the flag_instance.
480983
def _define_absl_flag(self, flag_instance, suppress):
    """"""
    flag_name = flag_instance.name
    short_name = flag_instance.short_name
    argument_names = ['--' + flag_name]
    if short_name:
      argument_names.insert(0, '-' + short_name)
    if suppress:
      helptext = argparse.SUPPRESS
    else:
      # argparse help string uses %-formatting. Escape the literal %'s.
      helptext = flag_instance.help.replace('%', '%%')
    if flag_instance.boolean:
      # Only add the `no` form to the long name.
      argument_names.append('--no' + flag_name)
      self.add_argument(
          *argument_names, action=_BooleanFlagAction, help=helptext,
          metavar=flag_instance.name.upper(),
          flag_instance=flag_instance)
    else:
      self.add_argument(
          *argument_names, action=_FlagAction, help=helptext,
          metavar=flag_instance.name.upper(),
          flag_instance=flag_instance)
729457
def DEFINE_float(flag_name, default_value, docstring, required=False):  # pylint: disable=invalid-name
    
    _define_helper(flag_name, default_value, docstring, float, required)
1290989
def DEFINE_string(flag_name, default_value, docstring, required=False):  # pylint: disable=invalid-name
    
    _define_helper(flag_name, default_value, docstring, str, required)
1366999
def get_flag_value(self, name, default):  # pylint: disable=invalid-name
    

    value = self.__getattr__(name)
    if value is not None:  # Can't do if not value, b/c value might be '0' or ""
      return value
    else:
      return default
790776
def set_flag(self, user, note=None, status=None):
        
        if not user.id:
            return None

        init_kwargs = {
            'user': user,
            'linked_object': self,
        }
        if note is not None:
            init_kwargs['note'] = note
        if status is not None:
            init_kwargs['status'] = status

        flag = get_flag_model()(**init_kwargs)
        try:
            flag.save()
        except IntegrityError:  # Record already exists.
            pass
        return flag
1167771
def toSet(self, flags):
        
        return {key for key, value in self.items() if value & flags}
96405
def add_flag(var, flag):
    
    if var:
        var = flag + " " + str(var)
    else:
        var = ""
    return var
846318
def set_flagstate(flagset):
    
    if not flagset <= _all_flags:
        raise ValueError("unrecognized flags in flagset")

    for f in flagset:
        set_flag(f)
    for f in _all_flags - flagset:
        clear_flag(f)
921267
function flag(input) {
  if (!CODE_RE.test(input) || input === 'UK') {
    input = nameToCode(input);
  }

  return codeToFlag(input);
}
894917
def _pretty_access_flags_gen(self):
        

        if self.is_public():
            yield "public"
        if self.is_final():
            yield "final"
        if self.is_abstract():
            yield "abstract"
        if self.is_interface():
            if self.is_annotation():
                yield "@interface"
            else:
                yield "interface"
        if self.is_enum():
            yield "enum"
515851
def FlagValues(*params)
      if params.size==1 && params.first.kind_of?(FlagValues)
        params.first
      else
        FlagValues.new(*params)
      end
    end
890190
def add_flags(self, *flags):
        
        if not isinstance(flags, (list, tuple)):
            flags = [str(flags)]

        self.extend(["--%s" % f for f in flags])
        return self
105461
def add_flag_values(self, entry, flag):
        '''  '''
        if flag in self.flags:
            self.flags[flag].append(entry)
1072449
def remove_flag(self, flag):
        
        super(Entry, self).remove_flag(flag)
        self._changed_attrs.add('flags')
91682
def _define_absl_flags(self, absl_flags):
    """"""
    key_flags = set(absl_flags.get_key_flags_for_module(sys.argv[0]))
    for name in absl_flags:
      if name in _BUILT_IN_FLAGS:
        # Do not inherit built-in flags.
        continue
      flag_instance = absl_flags[name]
      # Each flags with short_name appears in FLAGS twice, so only define
      # when the dictionary key is equal to the regular name.
      if name == flag_instance.name:
        # Suppress the flag in the help short message if it's not a main
        # module's key flag.
        suppress = flag_instance not in key_flags
        self._define_absl_flag(flag_instance, suppress)
1175759
public function withFlag($flag): void
    {
        $flag = $this->parseFlag($flag);

        $this->flags = $this->flags | $flag;
    }
34364
public function flag()
    {
        $args = func_get_args();
        $num = count($args);

        if ($num > 1) {
            $this->flags[$args[0]] = $args[1];

            return $this;
        }

        if (array_key_exists($args[0], $this->flags)) {
            return $this->flags[$args[0]];
        }
    }