Search a upper header for +hdr+
 @param [Header::Base] hdr
 @return [void]
 @yieldparam [Header::Base] found upper header
501769
def search_upper_header(hdr)
      hdr.class.known_headers.each do |nh, bindings|
        return nh if bindings.check?(hdr)
      end

      nil
    end
737318
def hw(self, hw):
        
        if hw.upper() == "INIT":
            self._raw(HW_INIT)
        elif hw.upper() == "SELECT":
            self._raw(HW_SELECT)
        elif hw.upper() == "RESET":
            self._raw(HW_RESET)
        else: # DEFAULT: DOES NOTHING
            pass
60019
public static <T extends Header> T getHeader(final Header[] hdrs, short id) {
        if(hdrs == null)
            return null;
        for(Header hdr: hdrs) {
            if(hdr == null)
                return null;
            if(hdr.getProtId() == id)
                return (T)hdr;
        }
        return null;
    }
493188
def search_hash(self, searchterm):
        
        return self.__search(type_attribute=self.__misphashtypes(), value=searchterm)
869801
def json_iterator(hdr, rowlist, lang, add_vtype=False):
    
    # Return the header row
    yield hdr if not add_vtype else ((h, 'type') for h in hdr)
    # Now the data rows
    for row in rowlist:
        if lang and not lang_match_json(row, hdr, lang):
            continue
        yield ((row[c]['value'], jtype(row[c])) if c in row else ('', '')
               for c in hdr)
767047
def to_h
      hash = {}
      [:bri, :hue, :sat].each do |attr|
        value = send(attr)
        hash[attr] = value if value
      end
      hash
    end
255405
def _write_header(self, image, hdu):
        """"""
        hduhdr = hdu.header

        # Ginga image header object for the given extension only.
        # Cannot use get_header() because that might also return PRI hdr.
        ghdr = image.metadata['header']

        for key in ghdr:
            # Need this to avoid duplication because COMMENT is a weird field
            if key.upper() == 'COMMENT':
                continue

            bnch = ghdr.get_card(key)

            # Insert new keyword
            if key not in hduhdr:
                hduhdr[key] = (bnch.value, bnch.comment)

            # Update existing keyword
            elif hduhdr[key] != bnch.value:
                hduhdr[key] = bnch.value
832453
def process_header(raw)
      # this util gives us arrays of values. We are only set up to handle one header value.
      WEBrick::HTTPUtils.parse_header(raw.strip).map.inject({}) do |h,(k,v)|
        h[k]=v.first; h
      end
    end
53023
def run(self, fnc_name, hdrs_usr):
        """"""
        fnc = self.fncs[fnc_name]
        with open(self.fin) as fin_stream:
            for lnum, line in enumerate(fin_stream):
                line = line.rstrip('\r\n') # chomp
                # Obtain Data if headers have been collected from the first line
                if self.hdr2idx:
                    self._init_data_line(fnc, lnum, line)
                # Obtain the header
                else:
                    self.do_hdr(line, hdrs_usr)
            if self.log is not None:
                self.log.write("  {:9} data READ:  {}\n".format(len(self.ret_list), self.fin))
        return self.ret_list, self.hdr2idx
134745
def hdr_xform(self, hdrs):
        """"""
        xform = []
        hdrs = self.replace_nulls(hdrs)
        for hdr in hdrs:
            hdr = hdr.replace('.', '_')
            hdr = hdr.replace(' ', '_')
            hdr = hdr.replace('#', 'N')
            hdr = hdr.replace('-', '_')
            hdr = hdr.replace('"', '')
            xform.append(hdr)
        return xform
42111
def find_symbol(symbol, method=nil)
      result = nil
      case symbol
      when /^::(.*)/
        result = toplevel.find_symbol($1)
      when /::/
        modules = symbol.split(/::/)
        unless modules.empty?
          module_name = modules.shift
          result = find_module_named(module_name)
          if result
            modules.each do |module_name|
              result = result.find_module_named(module_name)
              break unless result
            end
          end
        end
      else
        # if a method is specified, then we're definitely looking for
        # a module, otherwise it could be any symbol
        if method
          result = find_module_named(symbol)
        else
          result = find_local_symbol(symbol)
          if result.nil?
            if symbol =~ /^[A-Z]/
              result = parent
              while result && result.name != symbol
                result = result.parent
              end
            end
          end
        end
      end
      if result && method
        if !result.respond_to?(:find_local_symbol)
          p result.name
          p method
          fail
        end
        result = result.find_local_symbol(method)
      end
      result
    end
420972
def return_result(res, method)
      unless method == :lexer_name_for || method == :highlight || method == :css
        res = MultiJson.load(res, :symbolize_keys => true)
      end
      res = res.rstrip if res.class == String
      res
    end
718940
def header_style(header)
      if header.type != :header
        raise "header_style called with non-header element"
      end
      line = element_line(header)
      if line.start_with?("#")
        if line.strip.end_with?("#")
          :atx_closed
        else
          :atx
        end
      else
        :setext
      end
    end
159742
def match_header(cls, header):
        

        pixvalue = header.get('PIXVALUE')
        naxis = header.get('NAXIS', 0)

        return (super(_ConstantValueImageBaseHDU, cls).match_header(header) and
                (isinstance(pixvalue, float) or _is_int(pixvalue)) and
                naxis == 0)
116973
def has_header(self, hdrclass):
        '''
        
        '''
        if isinstance(hdrclass, str):
            return self.get_header_by_name(hdrclass) is not None
        return self.get_header(hdrclass) is not None
211193
def render_hash(hsh)
      str = ""
      indiff_hsh = hsh.with_indifferent_access
      indiff_hsh.keys.sort.each do |key|
        str << "#{key}: "
        value = indiff_hsh[key]
        PP::pp(value, str)
      end
      str
    end
730567
def upper(self):
        
        q = self.copy()
        q.addFunction(Query.Function.Upper)
        return q