Filters the 4D hash to find specs for all user visible API
966587
def show_chips(options = {})
      options = {
        group:             nil,
        family:            nil,
        performance:       nil,
        part:              nil,
        chips_to_be_shown: ChipArray.new,
        creating_chip:     false
      }.update(options)
      chips_to_be_shown = options[:chips_to_be_shown]
      filter_hash(_chips, options[:group]).each do |_group, hash|
        filter_hash(hash, options[:family]).each do |_family, hash_|
          filter_hash(hash_, options[:performance]).each do |_performance, hash__|
            filter_hash(hash__, options[:part]).each do |_part, chip|
              chips_to_be_shown << chip
            end
          end
        end
      end
      # If no specs were found must check the possibility another search
      # should be started with mode set to :local or :global
      if chips_to_be_shown.empty?
        # Don't want to re-call this method if the callee is trying to create a spec and just wants to know
        # if there is a spec with the exact same options
        if options[:creating_chip] == false
          # Doesn't make sense to recall the method however if the mode is already set to :global or :local
          options[:chips_to_be_shown] = chips_to_be_shown
          Origen.log.debug "re-calling show_chips with options #{options}"
          return show_chips(options)
        end
        Origen.log.debug "Returning no chips for options #{options}"
        return nil
      elsif chips_to_be_shown.size == 1
        Origen.log.debug "returning one spec #{chips_to_be_shown.first.part_name}"
        return chips_to_be_shown.first
      else
        Origen.log.debug "returning an array of specs during initial search: #{chips_to_be_shown}"
        return chips_to_be_shown
      end
    end
382768
def erlang_inspect(raw = false)
      result = '{'
      each_with_index { |obj, i| result << ',' if i > 0; result << Erlang.inspect(obj, raw: raw) }
      result << '}'
      return result
    end
255036
def parse_filter(filter)
      filter.is_a?(Hash) ? URI.encode(filter.to_json) : filter
    end
535601
private HashSet<Resource> getResources(GeneratorContext context, JClassType userType, FileFilter filter) {
    final String pack = userType.getPackage().getName().replace('.', '/');

    HashSet<Resource> resourceList = new HashSet<Resource>();
    for (String path : context.getResourcesOracle().getPathNames()) {
      if (!path.startsWith(pack))
        continue;
      String ext = getExtension(path);
      if (EXTENSION_MAP.containsKey(ext))
        resourceList.add(context.getResourcesOracle().getResource(path));
    }

    return resourceList;
  }
1214720
def hash(self):
        """"""
        return hash(
            self._shape + (
                self.tilewidth, self.tilelength, self.tiledepth,
                self.bitspersample, self.fillorder, self.predictor,
                self.extrasamples, self.photometric, self.compression,
                self.planarconfig))
429947
def pipeline_filters(options)
      filters = [
          HTML::Pipeline::MarkdownFilter,
          HTML::Pipeline::SanitizationFilter,
          HTML::Pipeline::ImageMaxWidthFilter,
          HTML::Pipeline::HttpsFilter,
          HTML::Pipeline::EmojiFilter,
          GithubMarkdownPreview::Pipeline::TaskListFilter
      ]

      if HtmlPreview::SYNTAX_HIGHLIGHTS
        filters << HTML::Pipeline::SyntaxHighlightFilter
      end

      if options[:comment_mode]
        filters << HTML::Pipeline::MentionFilter
      else
        filters << HTML::Pipeline::TableOfContentsFilter
      end

      filters
    end
1063867
def clean_security_hash(self):
        """"""
        security_hash_dict = {
            'content_type': self.data.get("content_type", ""),
            'object_pk': self.data.get("object_pk", ""),
            'timestamp': self.data.get("timestamp", ""),
        }
        expected_hash = self.generate_security_hash(**security_hash_dict)
        actual_hash = self.cleaned_data["security_hash"]
        if not constant_time_compare(expected_hash, actual_hash):
            raise forms.ValidationError("Security hash check failed.")
        return actual_hash
434372
def show_specs(options = {})
      options = {
        mode:              nil,
        spec:              nil,
        type:              nil,
        sub_type:          nil,
        specs_to_be_shown: SpecArray.new,
        owner:             nil,
        symbol:            false,
        creating_spec:     false
      }.update(options)
      options[:symbol] ? symbol = options.delete(:spec) : symbol = nil
      specs_to_be_shown = options[:specs_to_be_shown]
      filter_hash(_specs, options[:spec]).each do |_spec, hash|
        filter_hash(hash, options[:mode]).each do |_mode, hash_|
          filter_hash(hash_, options[:type]).each do |_type, hash__|
            filter_hash(hash__, options[:sub_type]).each do |_sub_type, spec|
              if symbol
                if spec.symbol && (spec.symbol.gsub(/<.*?>/, '').downcase.to_sym == symbol)
                  specs_to_be_shown << spec
                end
              else
                specs_to_be_shown << spec
              end
            end
          end
        end
      end
      # If no specs were found must check the possibility another search
      # should be started with mode set to :local or :global
      if specs_to_be_shown.empty?
        # Don't want to re-call this method if the callee is trying to create a spec and just wants to know
        # if there is a spec with the exact same options
        if options[:creating_spec] == false
          # Doesn't make sense to recall the method however if the mode is already set to :global or :local
          unless [:global, :local, nil].include?(options[:mode])
            # Need to check if there are :global or :local specs that match the filter(s) as well
            if self == Origen.top_level
              options[:mode] = :global
            else
              options[:mode] = :local
            end
            options[:specs_to_be_shown] = specs_to_be_shown
            Origen.log.debug "re-calling show_specs with options #{options}"
            return show_specs(options)
          end
        end
        Origen.log.debug "Returning no specs for options #{options}"
        return nil
      elsif specs_to_be_shown.size == 1
        print_to_console(specs_to_be_shown) if options[:verbose] == true
        Origen.log.debug "returning one spec #{specs_to_be_shown.first.name}"
        return specs_to_be_shown.first
      else
        Origen.log.debug "returning an array of specs during initial search: #{specs_to_be_shown}"
        return specs_to_be_shown
      end
    end
613166
protected void decodeFilters(final FacesContext context, final Sheet sheet, final Map<String, String> params,
                final String clientId) {
        int renderCol = 0;
        for (final SheetColumn column : sheet.getColumns()) {
            if (!column.isRendered()) {
                continue;
            }

            if (column.getValueExpression("filterBy") != null) {
                final String value = params.get(clientId + "_filter_" + renderCol);
                column.setFilterValue(value);
            }

            renderCol++;
        }
    }
1026323
def get(method, hmc, uri, uri_parms, logon_required):
        """"""
        query_str = uri_parms[0]
        try:
            console = hmc.consoles.lookup_by_oid(None)
        except KeyError:
            raise InvalidResourceError(method, uri)
        result_users = []
        filter_args = parse_query_parms(method, uri, query_str)
        for user in console.users.list(filter_args):
            result_user = {}
            for prop in user.properties:
                if prop in ('object-uri', 'name', 'type'):
                    result_user[prop] = user.properties[prop]
            result_users.append(result_user)
        return {'users': result_users}
634162
def find_object_hashes(root, meta_only=False):
    
    stack = [root]
    while stack:
        obj = stack.pop()
        if not meta_only and isinstance(obj, (TableNode, FileNode)):
            for objhash in obj.hashes:
                yield objhash
        stack.extend(itervalues(obj.get_children()))
        if obj.metadata_hash is not None:
            yield obj.metadata_hash
1189256
function filterBrowsers (browsers, re) {
    return Object.keys(browsers).filter(function (key) {
        return re.test(key);
    });
}
646235
def hash(self):
        """"""
        # Do not apply filters here (speed)
        hph = self.hparent.hash
        hpfilt = hashobj(self.hparent._filter)
        dhash = hashobj(hph + hpfilt)
        return dhash
255814
def search(type)
      resource_class = parse_type(type)
      client_setup
      filter = parse_hash(options['filter'])
      matches = resource_class.find_by(@client, filter)
      if matches.empty? # Search with integers & booleans converted
        filter = parse_hash(options['filter'], true)
        matches = resource_class.find_by(@client, filter) unless filter == options['filter']
      end
      if options['attribute']
        data = select_attributes_from_multiple(options['attribute'], matches)
        output data, -2 # Shift left by 2 so things look right
      else # List names only by default
        names = []
        matches.each { |m| names.push(m['name']) }
        output names
      end
    end
812972
def guid(self):
        '''
        
        '''
        iden = hashlib.md5()
        props = {'size': self.size}

        for name, item in self.hashes:
            iden.update(item.digest())
            props[name] = item.hexdigest()

        return iden.hexdigest(), props
1244022
def Filter(self, filename_spec):
    """"""
    if "@" in filename_spec:
      file_path, package_name = filename_spec.split("@")
    else:
      file_path, package_name = filename_spec, Resource.default_package

    resource_path = package.ResourcePath(package_name, file_path)
    if resource_path is not None:
      return resource_path


    # pylint: disable=unreachable
    raise FilterError(
        "Unable to find resource %s while interpolating: " % filename_spec)
729161
def condition_filterrific_params(fp)
      fp.each do |key, val|
        case
        when val.is_a?(Proc)
          # evaluate Procs
          fp[key] = val.call
        when val.is_a?(Array)
          # type cast integers in the array
          fp[key] = fp[key].map { |e| e =~ integer_detector_regex ? e.to_i : e }
        when val.is_a?(Hash)
          # type cast Hash to OpenStruct so that nested params render correctly
          # in the form
          fp[key] = OpenStruct.new(fp[key])
        when val =~ integer_detector_regex
          # type cast integer
          fp[key] = fp[key].to_i
        end
      end
      fp
    end