Returns a filter-like string from a hash
 If array_join is given, arrays are joined rather than having their own separated key:values

 ex: filter_string({:name => 'some value', :tags => ['abc', 'def']}) = "name:'some value' tag:abc tag:def"
170835
def filter_string(filter = {}, array_join = nil)
      filter.inject('') do |mem, kv|
        key, value = kv
        if value.is_a?(Array)
          if !array_join.nil?
            mem += value.inject('') { |m, v|
              v = "\"#{v}\"" if v.to_s.include?(' ')
              m+= "#{key}:#{v}"
            }
            return mem
          else
            value = value.join(array_join)
          end
        end
        value = "\"#{value}\"" if value.to_s.include?(' ')
        mem += "#{key}:#{value} "
      end
    end
64951
def _convert_hashes(values):
    
    hashes = {}
    if not values:
        return hashes
    for value in values:
        try:
            name, value = value.split(":", 1)
        except ValueError:
            name = "sha256"
        if name not in hashes:
            hashes[name] = []
        hashes[name].append(value)
    return hashes
787848
def to_camel_keys(value = self)
      case value
      when Array
        value.map { |v| to_camel_keys(v) }
      when Hash
        Hash[value.map { |k, v| [camelize_key(k), to_camel_keys(v)] }]
      else
        value
      end
    end
1175211
def method_return_string(meth)
      return "" unless meth[:tags]

      return_value = meth[:tags].find { |t| t[:name] == "return" && t[:types] }
      return "" if return_value.nil?
      return "" if return_value[:types].nil?
      return "" unless return_value[:types].kind_of? Array

      unless return_value.empty?
        return "" if return_value[:types].first == "void"
        return return_value[:types].first
      end
      ""
    end
305585
def to_h(values_only: false, with_values: false, with_errors: false)
      if values_only
        Hash[*options.flat_map {|opt| [opt.name, opt.type == 'group' ? opt.value.to_h(values_only: true) : opt.value]}]
      else
        Hash[*options.flat_map {|opt| [opt.name, opt.to_h(with_value: with_values, with_errors: with_errors).reject {|k,_| k==:name}]}]
      end
    end
449877
function filter( arr, str ) {
	var len = arr.length,
		out = [],
		i;

	for ( i = 0; i < len; i++ ) {
		if ( arr[ i ] !== str ) {
			out.push( arr[ i ] );
		}
	}
	return out;
}
924480
def string_to_hash(markup)
      options = {}

      if match = markup.match(Syntax)
        markup.scan(TagAttributes) do |key, value|
          options[key.to_sym] = value.gsub(/\A"|"\z/, "")
        end
      end

      options
    end
290394
def sanitize_filterrific_param(val)
      case val
      when Array
        # Return Array
        val.map { |e| sanitize_filterrific_param(e) }
      when Hash
        # Return Hash
        val.inject({}) { |m, (k,v)| m[k] = sanitize_filterrific_param(v); m }
      when NilClass
        # Nothing to do, use val as is
        val
      when String
        helpers.sanitize(val)
      else
        # Nothing to do, use val as is
        val
      end
    end
1177544
function _abstract_solr_filter_template(filters){
	
	var allbuf = new Array();
	for( var filter_key in filters ){

	    var filter_val = filters[filter_key];

	    // If the value looks like an array, iterate over it and
	    // collect.
	    if( filter_val &&
		filter_val != null &&
		typeof filter_val == 'object' &&
		filter_val.length ){

		    for( var i = 0; i < filter_val.length; i++ ){
			var minibuffer = new Array();
			var try_val = filter_val[i];
			if( typeof(try_val) != 'undefined' &&
			try_val != '' ){
			    minibuffer.push('fq=');
			    minibuffer.push(filter_key);
			    minibuffer.push(':');
			    minibuffer.push('"');
			    minibuffer.push(filter_val[i]);
			    minibuffer.push('"');
			    allbuf.push(minibuffer.join(''));
			}
		    }		    
		}else{
		    var minibuf = new Array();
		    if( typeof(filter_val) != 'undefined' &&
			filter_val != '' ){
			    minibuf.push('fq=');
			    minibuf.push(filter_key);
			    minibuf.push(':');
			    minibuf.push('"');
			    minibuf.push(filter_val);
			    minibuf.push('"');
			    allbuf.push(minibuf.join(''));
			}
		}
	}
	return allbuf.join('&');
    }
337240
def _keys(result, key_ary, hash)
      hash.each do |key, value|
        key_ary << key
        result << "/#{key_ary.join('/')}"
        _keys(result, key_ary, value) if value.is_a?(Hash)
        key_ary.pop
      end
    end
992493
def to_s
      string = "#{@name}"
      # If value is either nil or an empty array
      if @value.nil? || @value.is_a?(Array) && @value.size == 0
        string << " (#{@type}"
        string << "/#{@subtype}" if @subtype
        string << ')'
        string << ' [required]' if @required
      else
        if @type.eql?('Array')
          string << ' ='
          @value.each { |v| string << "\n  - #{v}" }
        else
          string << " = #{@value}"
        end
      end
      string << "\n"
    end
741817
def run_through(hash, join_value)
      hash.map do |k,v|
        if v.is_a?(Hash)
          [k,run_through(v, join_value)].join(join_value)
        else #works for Symbols and Strings
          [k,v].join(join_value)
        end
      end.first
    end
808887
def nested_join(array, o_str= '{', c_str= '}'):
    '''
        
    '''
    result = ''
    for x in array :
        if type(x) == type([])  :
            result  +=o_str+ nested_join(x)+ c_str
        else                    :
            result  +=x
    return result
93022
def [](index)
      return @hash[index] if @hash&.has_key?(index)

      begin
        value = __getobj__[index]
        return value if @hash.nil?
        wrap_value = __wrap__(value)
        @hash[index] = wrap_value if wrap_value
        wrap_value || value
      end
    end
864103
def _create_search_filter(filter_by):
        
        return ",".join(
            [
                "{0}:{1}".format(key, value)
                for key, value in filter_by.items()
                if value is not None
            ]
        )
892167
def format_filter_value(value)
      return value if value.is_a?(Array) || value.is_a?(Hash)
      return nil if value.blank?

      value = value.to_s
      case value
        when 'true', 'TRUE' then true
        when 'false', 'FALSE' then false
        else
          value
      end
    end
1328576
def to_hash
      {}.tap { |h|
        model_class.filterrific_available_filters.each do |filter_name|
          param_value = self.send(filter_name)
          case
          when param_value.blank?
            # do nothing
          when param_value.is_a?(Proc)
            # evaluate Proc so it can be serialized
            h[filter_name] = param_value.call
          when param_value.is_a?(OpenStruct)
            # convert OpenStruct to hash
            h[filter_name] = param_value.marshal_dump
          else
            h[filter_name] = param_value
          end
        end
      }
    end