rubocop:disable Style/ClassVars
425332
def add(code, len, chr)
      self.final = true if chr == EOS && @depth <= 7
      if len.zero?
        @emit = chr
      else
        bit = (code & (1 << (len - 1))).zero? ? 0 : 1
        node = @next[bit] ||= Node.new(@depth + 1)
        node.add(code, len - 1, chr)
      end
    end
509417
def _stylize
      styles = style

      if styles.class == Hash
        set_attribute(
          'style',
          styles.map { |k, v| "#{k}:#{v};" }.join
        )
      end
    end
1102136
def replace!(oth)
      if self.class != oth.class
        raise ArgumentError, "expected #{self.class} object"
      end

      component.each do |c|
        self.__send__("#{c}=", oth.__send__(c))
      end
    end
535165
def process_style( class_name, style_element )
      if (style_element != nil) then
        style_element.attributes.each_attribute do |attr|
          if (@style_dispatch.has_key?(attr.expanded_name)) then
            self.send( @style_dispatch[attr.expanded_name], class_name,
              attr.name, attr.value )
          end
        end
      end
    end
706528
def generate_class_template(
      class_name, class_path, methods_template, options)
      reportable_prepare = \
          if options[:reportable]
            Constants::REPORTABLE_PREPARE
          else
            ''
          end
      ERB.new(Constants::CLASS_TEMPLATE).result(binding)
    end
597553
def load_v7_plugin_class(contents, plugin_path)
      plugin_class = eval(contents, TOPLEVEL_BINDING, plugin_path) # rubocop: disable Security/Eval
      unless plugin_class.kind_of?(Class) && plugin_class < Ohai::DSL::Plugin
        raise Ohai::Exceptions::IllegalPluginDefinition, "Plugin file cannot contain any statements after the plugin definition"
      end
      plugin_class.sources << plugin_path
      @v7_plugin_classes << plugin_class unless @v7_plugin_classes.include?(plugin_class)
      plugin_class
    rescue SystemExit, Interrupt # rubocop: disable Lint/ShadowedException
      raise
    rescue Ohai::Exceptions::InvalidPluginName => e
      logger.warn("Plugin Name Error: <#{plugin_path}>: #{e.message}")
    rescue Ohai::Exceptions::IllegalPluginDefinition => e
      logger.warn("Plugin Definition Error: <#{plugin_path}>: #{e.message}")
    rescue NoMethodError => e
      logger.warn("Plugin Method Error: <#{plugin_path}>: unsupported operation \'#{e.name}\'")
    rescue SyntaxError => e
      # split on occurrences of
      #    <env>: syntax error,
      #    <env>:##: syntax error,
      # to remove from error message
      parts = e.message.split(/<.*>[:[0-9]+]*: syntax error, /)
      parts.each do |part|
        next if part.length == 0
        logger.warn("Plugin Syntax Error: <#{plugin_path}>: #{part}")
      end
    rescue Exception, Errno::ENOENT => e
      logger.warn("Plugin Error: <#{plugin_path}>: #{e.message}")
      logger.trace("Plugin Error: <#{plugin_path}>: #{e.inspect}, #{e.backtrace.join('\n')}")
    end
908847
function validateVars() {
  _.each(xml2js.CLASSES, function(classSpec, className) {
    var valid = _.pick(classSpec.variables, function(varSpec, varName) {
      return ofValidType(varSpec, className + '.' + varName, className);
    });
    if (xml2js.opts.strict) {
      xml2js.CLASSES[className].variables = valid;
    }
  });
}
700577
def method_missing(id_or_class, *args, &block)
      if id_or_class.to_s =~ /(.*)!$/
        @attrs[:id] = $1
      else
        id = id_or_class
        @attrs[:class] = @attrs[:class] ? "#{@attrs[:class]} #{id}".strip : id
      end

      unless args.empty?
        if args.last.respond_to? :to_hash
          @attrs.merge! args.pop.to_hash
        end
      end

      args.push(@attrs)

      while @stream.length > @original_stream_length
        @stream.pop
      end

      if block
        @builder.tag! @sym, *args, &block
      else
        @builder.tag! @sym, *args
      end

      self
    end
223578
def class attachment = nil, style_name = nil
      return super() if attachment.nil? && style_name.nil?
      attachment.instance.class.to_s.underscore.pluralize
    end
1287841
def dress(value, handler = DressHelper.new)
      handler.failed!(self, value) unless ruby_type===value
      value
    end
667558
def classFromString(str)
      # Start with Object, and look up the module one path component at a time
      str.split('::').inject(Object) do |mod, class_name|
        mod.const_get(class_name)
      end
    end
1248386
def models(parent = nil)
      model_paths = Dir["#{Rails.root}/app/models/*_jobs/*.rb"]
      model_paths.each{ |path| require path }
      sanitized_model_paths = model_paths.map { |path| path.gsub(/.*\/app\/models\//, '').gsub('.rb', '') }
      model_constants = sanitized_model_paths.map do |path|
        path.split('/').map { |token| token.camelize }.join('::').constantize
      end
      model_constants.select { |model| superclasses(model).include?(::Ohm::Model) }

      if parent
        model_constants.select { |model| model.included_modules.include?(parent) }
      else
        model_constants
      end
    end
311496
def as_json(_options = {})
      hash = {}
      instance_variables.each do |var|
        name = var[1..-1]

        if name =~ /^__/
          # if a variable starts with double underscore, strip one off
          name = name[1..-1]
        elsif name =~ /^_/
          # Hide variables that start with single underscore
          name = nil
        end

        hash[name] = instance_variable_get(var) if name
      end
      hash
    end
361376
def feature(name = nil)
      if !name
        self.class.features.keys
      else
        if self.class.features.key?(name)
          self.class.features[name]
        else
          fail "Feature #{name} does not exist!"
        end
      end
    end
1056100
def sanitize_class(class_component)
    class_component.to_s.split('_').collect {|elem| elem.slice(0,1).capitalize + elem.slice(1..-1) }.join('')
  end
1032410
def executeRubyComponents
      fileDir = File.dirname(@fileName)
      #puts "Executing ruby components in directory #{fileDir} ..."
      Dir.chdir(fileDir) do
        for rubyComponent in @rubyComponents
          rubyCode = rubyComponent.text
          #puts ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
          #puts "Executing ruby (line #{rubyComponent.lineNumber}) #{rubyCode.inspect} ..."
          @pageObject.instance_eval(rubyCode, @fileName, rubyComponent.lineNumber)
          #puts "Finished executing ruby at line #{rubyComponent.lineNumber}"
        end
      end
      #puts "Finished executing ruby components."
    end
889602
def bootstrap_styled(cls=None, add_meta=True, form_group=True, 
    input_class='form-control'):
    

    def real_decorator(cls):
        class NewClass(cls): pass
        NewClass.__name__ = cls.__name__
        NewClass = custom_widget_wrapper(NewClass)

        _call = NewClass.__call__

        def call(*args, **kwargs):
            if input_class:
                kwargs.setdefault('class', input_class)

            return _call(*args, **kwargs)

        if add_meta: call = meta_wrapped(call)
        if form_group: call = form_group_wrapped(call)

        NewClass.__call__ = call
        return NewClass

    if cls:
        # Allow calling decorator(cls) instead of decorator()(cls)
        rv = real_decorator(cls)
        return rv

    return real_decorator