Second argument can be the whitelist_attributes array or keyword
 arguments. This is to ensure backwards compatibility with old plugins.
551145
def model_field_mappings(model, options = {})
      if Array == options
        whitelist_attributes = options
      else
        whitelist_attributes = options.fetch(:whitelist_attributes, nil)
        mappings = options.fetch(:mappings, {})
      end

      Para::AttributeFieldMappings.new(
        model, whitelist_attributes: whitelist_attributes, mappings: mappings
      )
    end
1029562
function whitelist($params, $post_data) {
		// version 2 only.
		$request_url = "{$this->url_base}/track/site";
		$response = $this->curl($request_url, $post_data, "PUT", "tracking_whitelist");
		return $response;
	}
19241
def include_extra_kwargs(self, kwargs, extra_kwargs):
        
        if extra_kwargs.get('read_only', False):
            for attr in [
                'required', 'default', 'allow_blank', 'allow_null',
                'min_length', 'max_length', 'min_value', 'max_value',
                'validators', 'queryset'
            ]:
                kwargs.pop(attr, None)

        if extra_kwargs.get('default') and kwargs.get('required') is False:
            kwargs.pop('required')

        if extra_kwargs.get('read_only', kwargs.get('read_only', False)):
            extra_kwargs.pop('required', None)  # Read only fields should always omit the 'required' argument.

        kwargs.update(extra_kwargs)

        return kwargs
35939
static function attributeHideList()
    {
        $attributes = array();
        $ini = eZINI::instance( 'collect.ini' );
        $attributes[] = $ini->variable( 'InfoSettings', 'TypeAttribute' );
        $attributes[] = $ini->variable( 'EmailSettings', 'SendEmailAttribute' );
        $attributes[] = $ini->variable( 'DisplaySettings', 'DisplayAttribute' );
        $attributes[] = $ini->variable( 'DisplaySettings', 'RedirectURLAttribute' );
        $attributes[] = $ini->variable( 'CollectionSettings', 'CollectAnonymousDataAttribute' );
        $attributes[] = $ini->variable( 'CollectionSettings', 'CollectionUserDataAttribute' );
        return $attributes;
    }
681097
function formatAttrs(attributes, opts, keyOnlyAttribs = []) {
  if (!attributes) return;

  var output = '',
    value;

  // Loop through the attributes
  for (var key in attributes) {
    value = attributes[key];
    if (output) {
      output += ' ';
    }

    if (!value && booleanAttributes[key] || isExpr(key) || isKeyOnlyAttr(key, keyOnlyAttribs)) {
      output += key;
    } else {
      output += key + `=${isExpr(value) ? '' : '"'}` + (opts.decodeEntities ? entities.encodeXML(value) : value) + (isExpr(value) ? '' : '"');
    }
  }

  return output;
}
1232820
def method_missing(name, *args, &block)
      return attributes[name.to_sym] if attributes.include?(name.to_sym)
      return super
    end
252816
public static AttributesBuilder attributes(String[] arguments) {
        AttributesBuilder attributesBuilder = new AttributesBuilder();
        attributesBuilder.arguments(arguments);
        return attributesBuilder;
    }
827514
def _checkAttribs(self, strict):
        """"""
        if self.min:
            warning("Minimum value not allowed for boolean-type parameter " +
                    self.name, strict)
            self.min = None
        if self.max:
            if not self.prompt:
                warning("Maximum value not allowed for boolean-type parameter " +
                                self.name + " (probably missing comma)",
                                strict)
                # try to recover by assuming max string is prompt
                self.prompt = self.max
            else:
                warning("Maximum value not allowed for boolean-type parameter " +
                        self.name, strict)
            self.max = None
        if self.choice:
            warning("Choice values not allowed for boolean-type parameter " +
                    self.name, strict)
            self.choice = None
664131
def has_attribute(*args)

      args.each { |a| a = a.to_s; return a if attributes[a] != nil }

      nil
    end
1143452
public function whitelist() {
        $args = func_get_args();

        if (isset($args[0]) && is_array($args[0])) {
            $args = $args[0];
        }

        $this->_whitelist += $args;
        $this->_whitelist = array_filter($this->_whitelist);

        return $this;
    }
1358636
def boolean_or_list(config_name, args, configs, alternative_names=[]):
    """"""

    # when argument flag present, set to wildcard regex
    for key in alternative_names + [config_name]:
        if hasattr(args, key) and getattr(args, key):
            setattr(args, config_name, ['.*'])
            return

    setattr(args, config_name, [])

    option = None
    alternative_names.insert(0, config_name)
    for key in alternative_names:
        if configs.has_option('settings', key):
            option = configs.get('settings', key)
            break

    if option is not None:
        if option.strip().lower() == 'true':
            setattr(args, config_name, ['.*'])
        elif option.strip().lower() != 'false':
            for pattern in option.split("\n"):
                if pattern.strip() != '':
                    getattr(args, config_name).append(pattern)
869975
def requires_one(*args)
      missing, required = missing_attributes(args)

      if missing.length == args.length
        fail(ArgumentError, "#{missing.keys[0...-1].join(', ')} or #{missing.keys[-1]} are required for this operation")
      end

      required
    end
373612
function compileAttrs(attrs, options) {
  assert(Array.isArray(attrs), 'Attrs should be an array');
  assert(attrs.every(function (attr) {
    return attr &&
      typeof attr === 'object' &&
      typeof attr.name === 'string' &&
      (typeof attr.val === 'string' || typeof attr.val === 'boolean') &&
      typeof attr.mustEscape === 'boolean';
  }), 'All attributes should be supplied as an object of the form {name, val, mustEscape}');
  assert(options && typeof options === 'object', 'Options should be an object');
  assert(typeof options.terse === 'boolean', 'Options.terse should be a boolean');
  assert(
    typeof options.runtime === 'function',
    'Options.runtime should be a function that takes a runtime function name and returns the source code that will evaluate to that function at runtime'
  );
  assert(
    options.format === 'html' || options.format === 'object',
    'Options.format should be "html" or "object"'
  );

  var buf = [];
  var classes = [];
  var classEscaping = [];

  function addAttribute(key, val, mustEscape, buf) {
    if (isConstant(val)) {
      if (options.format === 'html') {
        var str = stringify(runtime.attr(key, toConstant(val), mustEscape, options.terse));
        var last = buf[buf.length - 1];
        if (last && last[last.length - 1] === str[0]) {
          buf[buf.length - 1] = last.substr(0, last.length - 1) + str.substr(1);
        } else {
          buf.push(str);
        }
      } else {
        val = toConstant(val);
        if (mustEscape) {
          val = runtime.escape(val);
        }
        buf.push(stringify(key) + ': ' + stringify(val));
      }
    } else {
      if (options.format === 'html') {
        buf.push(options.runtime('attr') + '("' + key + '", ' + val + ', ' + stringify(mustEscape) + ', ' + stringify(options.terse) + ')');
      } else {
        if (mustEscape) {
          val = options.runtime('escape') + '(' + val + ')';
        }
        buf.push(stringify(key) + ': ' + val);
      }
    }
  }

  attrs.forEach(function(attr){
    var key = attr.name;
    var val = attr.val;
    var mustEscape = attr.mustEscape;

    if (key === 'class') {
      classes.push(val);
      classEscaping.push(mustEscape);
    } else {
      if (key === 'style') {
        if (isConstant(val)) {
          val = stringify(runtime.style(toConstant(val)));
        } else {
          val = options.runtime('style') + '(' + val + ')';
        }
      }
      addAttribute(key, val, mustEscape, buf);
    }
  });
  var classesBuf = [];
  if (classes.length) {
    if (classes.every(isConstant)) {
      addAttribute(
        'class',
        stringify(runtime.classes(classes.map(toConstant), classEscaping)),
        false,
        classesBuf
      );
    } else {
      classes = classes.map(function (cls, i) {
        if (isConstant(cls)) {
          cls = stringify(classEscaping[i] ? runtime.escape(toConstant(cls)) : toConstant(cls));
          classEscaping[i] = false;
        }
        return cls;
      });
      addAttribute(
        'class',
        options.runtime('classes') + '([' + classes.join(',') + '], ' + stringify(classEscaping) + ')',
        false,
        classesBuf
      );
    }
  }
  buf = classesBuf.concat(buf);
  if (options.format === 'html') return buf.length ? buf.join('+') : '""';
  else return '{' + buf.join(',') + '}';
}
277609
def _clean_kwargs(keep_name=False, **kwargs):
    '''
    
    '''
    if 'name' in kwargs and not keep_name:
        kwargs['name_or_id'] = kwargs.pop('name')

    return __utils__['args.clean_kwargs'](**kwargs)
986774
def method_missing(*args)
      method = args[0].to_s
      case args.length
        when 2
          k, v = method.delete('=').to_sym, args[1]
          add_attribute k, v
      end
    end
1158366
def attributes(*fields_name, **options, &block)
      if options.include? :except
        @fields = resolve_model_reflections.reject do |field|
          options[:except].include? field.to_sym
        end
      elsif options.include? :append
         @fields += options[:append]
      else
        # set new value for fields
        @fields = fields_name.map(&:to_s) unless fields_name.empty?
      end

      @fields.concat(block.call.map(&:to_s)) if block_given?
    end
1363173
function simplifyWhitelist(whitelist) {
	var results = [];

	if (Array.isArray(whitelist)) {
	  // whitelist is in Simplified format
	  for (var i = 0; i < whitelist.length; i++) {
	    results.push({
	      "id": whitelist[i]
	    });
	  }
	} else {
	  // whitelist is in Verbose format
	  for (var project in whitelist) {
	    var vlist = whitelist[project];
	    for (var i = 0; i < vlist.length; i++) {
	      var id = vlist[i].id;
	      results.push({
	        "id": id,
	        "dependencyPaths": vlist[i].dependencyPaths
	      });
	    }
	  }
	}

	return results;
}