Set bucket-type properties
500289
def set_bucket_type_props(self, bucket_type, props):
        
        self._check_bucket_types(bucket_type)
        msg_code = riak.pb.messages.MSG_CODE_SET_BUCKET_TYPE_REQ
        codec = self._get_codec(msg_code)
        msg = codec.encode_set_bucket_type_props(bucket_type, props)
        resp_code, resp = self._request(msg, codec)
        return True
480952
function setVirtuals(schema, paths) {
  paths.forEach(path => {
    const props = path.options.virtual.properties;

    if (props[path.path]) {
      schema.virtual(props[path.path]).get(function() {
        return path.enumValues;
      });
    }
  });
}
427553
function(bucket, keys, cb){
		contract(arguments)
			.params('string', 'array', 'function')
			.end()
		;
		
		var table = '';
		if (bucket.indexOf('allows') != -1) {
			table = this.prefix + this.buckets.permissions;
			this.db
				.select('key', 'value')
				.from(table)
				.where({'key': bucket})
				.then(function(results) {
					if (results.length && results[0].value) {
						var keyArrays = [];
						_.each(keys, function(key) {
							keyArrays.push.apply(keyArrays, results[0].value[key]);
						});
						cb(undefined, _.union(keyArrays));
					} else {
						cb(undefined, []);
					}
					
				})
			;
		} else {
			table = this.prefix + bucket;
			this.db
				.select('key', 'value')
				.from(table)
				.whereIn('key', keys)
				.then(function(results) {
					if (results.length) {
						var keyArrays = [];
						_.each(results, function(result) {
							keyArrays.push.apply(keyArrays, result.value);
						});
						cb(undefined, _.union(keyArrays));
					} else {
						cb(undefined, []);
					}
				})
			;
		}
	}
1145054
function(params, callback) {
        var err = null;

        if (typeof(params) === "object" && params !== null)
        {
            if(typeof(params.Bucket) !== "string" || params.Bucket.length <= 0)
            {
                err = new Error("Mock-AWS-S3: Argument 'params' must contain a 'Bucket' (String) property");
            }
        }
        else {
            err = new Error("Mock-AWS-S3: Argument 'params' must be an Object");
        }

        var opts = _.extend({}, this.defaultOptions, applyBasePath(params));

        if (err !== null) {
            callback(err);
        }

        var bucketPath = opts.basePath || "";
        bucketPath += opts.Bucket;

        fs.remove(bucketPath, function(err) {
            return callback(err);
        });
	}
486085
function setOptions(schema, options) {
  function setDefaults(array) {
    if (!array.length) {
      if (options.find) { array.push('find'); }
      if (options.findOne || !options.find) { array.push('findOne'); }
    }
  }

  options = options || {};

  options.only = options.only || [];
  options.validateBeforeSave = options.validateBeforeSave === undefined
                                ? schema.options.validateBeforeSave
                                : Boolean(options.validateBeforeSave);

  ['virtual', 'attach', 'modify'].filter(prop => options[prop])
    .forEach(
      prop => {
        if (typeof options[prop] !== 'object') {
          options[prop] = {};
        }
        options[prop].properties = options[prop].properties || {};
        options[prop].only = options[prop].only || Object.keys(options[prop].properties);
      }
    );

  if (options.modify) {
    delete options.modify.properties;
    options.modify.on = options.modify.on || [];
    setDefaults(options.modify.on);
  }
  if (options.attach) {
    Object.keys(options.attach.properties).forEach(property => {
      options.attach.properties[property].on = options.attach.properties[property].on || [];
      setDefaults(options.attach.properties[property].on);
    });
  }

  return options;
}
1347905
def set_bucket_name(self, bucket_name):
        
        is_valid_bucket_name(bucket_name)

        self.policies.append(('eq', '$bucket', bucket_name))
        self.form_data['bucket'] = bucket_name
        self.bucket_name = bucket_name
1081069
private synchronized void initBuckets() {
    final SparseIntArray bucketSizes = mPoolParams.bucketSizes;

    // create the buckets
    if (bucketSizes != null) {
      fillBuckets(bucketSizes);
      mAllowNewBuckets = false;
    } else {
      mAllowNewBuckets = true;
    }
  }
518076
def clear_bucket_props(self, bucket):
        
        bucket_type = self._get_bucket_type(bucket.bucket_type)
        url = self.bucket_properties_path(bucket.name,
                                          bucket_type=bucket_type)
        url = self.bucket_properties_path(bucket.name)
        headers = {'Content-Type': 'application/json'}

        # Run the request...
        status, _, _ = self._request('DELETE', url, headers, None)

        if status == 204:
            return True
        elif status == 405:
            return False
        else:
            raise RiakError('Error %s clearing bucket properties.'
                            % status)
844378
function schemaType(schema) {
    let type;
    if (schema.hasOwnProperty('type')) {
        type = schema.type;
    } else if (schema.hasOwnProperty('properties') || schema.hasOwnProperty('allOf') || schema.hasOwnProperty('additionalProperties')) {
        type = 'object';
    } else if (schema.hasOwnProperty('items')) {
        type = 'array';
    }

    switch (type) {
        case 'array':
        case 'boolean':
        case 'file':
        case 'integer':
        case 'number':
        case 'object':
        case 'string':
            return type;
    }
}
1129196
function configureCorsForBucket(aws, bucketName) {
  const params = {
    Bucket: bucketName,
    CORSConfiguration: require('./resources/CORSPolicy')
  };

  return aws.request('S3', 'putBucketCors', params);
}
1013394
def set(self, key, data, retry=0):
    
    
    
    try:

      if type(data) != dict:
        raise Exception("data needs to be of type <dict>")

      self.bucket.set(key, 0, 0, json.dumps(data))

    except:
      raise
274664
def get_bucket_props(self, bucket):
        
        bucket_type = self._get_bucket_type(bucket.bucket_type)
        url = self.bucket_properties_path(bucket.name,
                                          bucket_type=bucket_type)
        status, headers, body = self._request('GET', url)

        if status == 200:
            props = json.loads(bytes_to_str(body))
            return props['props']
        else:
            raise RiakError('Error getting bucket properties.')
404878
public void setBucketAcl(String bucketName, CannedAccessControlList cannedAcl,
            RequestMetricCollector requestMetricCollector) throws SdkClientException,
            AmazonServiceException {
        SetBucketAclRequest request = new SetBucketAclRequest(bucketName, cannedAcl)
            .withRequestMetricCollector(requestMetricCollector);
        setBucketAcl(request);
    }
351861
def get_bucket_props(self, bucket):
        
        msg_code = riak.pb.messages.MSG_CODE_GET_BUCKET_REQ
        codec = self._get_codec(msg_code)
        msg = codec.encode_get_bucket_props(bucket)
        resp_code, resp = self._request(msg, codec)
        return codec.decode_bucket_props(resp.props)
306351
synchronized public void set(Element value) {
    int bind = ((int)value.getIndex() & Integer.MAX_VALUE) % buckets.length;
    Element[] bucket = buckets[bind];
    int count = counts[bind];
    if (bucket == null)
      buckets[bind] = bucket = new Element[initBucketSize];
    else if (bucket.length == count) {
      bucket = new Element[count * 2];
      System.arraycopy(buckets[bind], 0, bucket, 0, count);
      buckets[bind] = bucket;
    }
    bucket[count] = value;
    counts[bind] = count + 1;
    totalSize += 1;
  }
1077862
def set_property_type(self, property_types):
        
        query_add = ''
        for property_type in property_types:
            if not isinstance(property_type, PropertyType):
                raise DaftException("property_types should be an instance of PropertyType.")
            query_add += str(property_type)

        self._query_params += query_add
41934
def _set(self, schema):
        """"""
        if isinstance(schema, CommonSchema):
            self._spl_type = False
            self._schema = schema.schema()
            self._style = self._default_style()
        else:
            self._spl_type = schema._spl_type
            self._schema = schema._schema
            self._style = schema._style