text:
package com.danilo.guessAB;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

/**
 * Unit test for simple App.
 */
public class AppTest
{
    /**
     * Rigorous Test :-)
     */
    @Test
    public void testgetA()
    {
        int result = App.getA("1234", "1234");
        Assertions.assertEquals(4, result);
    }

    @Test
    public void testgetB()
    {
        int result = App.getB("1234", "4321");
        Assertions.assertEquals(4, result);
    }
}


text:
module ValidationGroup
  module ActiveRecord
    module ActsMethods # extends ActiveRecord::Base
      def self.extended(base)
        # Add class accessor which is shared between all models and stores
        # validation groups defined for each model
        base.class_eval do
          cattr_accessor :validation_group_classes
          self.validation_group_classes = {}
        end
      end

      def validation_group(name, options={})
        self_groups = (self.validation_group_classes[self] ||= {})
        self_groups[name] = options[:fields] || []

        unless included_modules.include?(InstanceMethods)
          attr_reader :current_validation_group
          include InstanceMethods
        end
      end
    end

    module InstanceMethods # included in every model which calls validation_group
      def enable_validation_group(group)
        # Check if given validation group is defined for current class
        # or one of its ancestors
        group_classes = self.class.validation_group_classes
        found = ValidationGroup::Util.current_and_ancestors(self.class).
                  find do |klass|
                    group_classes[klass] &&
                    group_classes[klass].include?(group)
                  end
        if found
          @current_validation_group = group
        else
          raise ArgumentError, "No validation group of name #{group}"
        end
      end

      def disable_validation_group
        @current_validation_group = nil
      end

      def validation_group_enabled?
        respond_to?(:current_validation_group) && !current_validation_group.nil?
      end
    end

    module Errors # included in ActiveRecord::Errors
      def add_with_validation_group(attribute,
                                    msg = @@default_error_messages[:invalid], *args,
                                    &block)
        add_error = true
        if @base.validation_group_enabled?
          current_group = @base.current_validation_group
          found = ValidationGroup::Util.current_and_ancestors(@base.class).
            find do |klass|
              klasses = klass.validation_group_classes
              klasses[klass] && klasses[klass][current_group] &&
              klasses[klass][current_group].include?(attribute)
            end
          add_error = false unless found
        end
        add_without_validation_group(attribute, msg, *args,&block) if add_error
      end

      def self.included(base) #:nodoc:
        base.class_eval do
          alias_method_chain :add, :validation_group
        end
      end
    end
  end

  module Util
    # Return array of consisting of current and its superclasses
    # down to and including base_class.
    def self.current_and_ancestors(current)
      returning [] do |klasses|
        klasses << current
        root = current.base_class
        until current == root
          current = current.superclass
          klasses << current
        end
      end
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
class EventAttachment < ActiveRecord::Base
  belongs_to :event

  has_attached_file :attachment

  validates_attachment_size :attachment, :less_than => 42.megabytes
  do_not_validate_attachment_file_type :attachment

  has_paper_trail meta: { associated_id: :event_id, associated_type: "Event" }

  scope :is_public, -> { where(public: true) }

  def link_title
    if self.title.present?
      self.title
    elsif self.attachment_file_name.present?
      self.attachment_file_name
    else
      I18n.t('activerecord.models.event_attachment')
    end
  end
end


text:
<!--
IMPORTANT PLEASE READ: Hi there! If this is a *usage question* or you're not sure if its a bug, please **do not post it here**, post it on Stack Overflow (http://stackoverflow.com/questions/tagged/redux-observable) first; if you get no response after a reasonable amount of time, create a ticket here and link us to your Stack Overflow question. If this is not a "feature" or a "bug", or the phrase "How do I...?" applies, then it's probably a usage question. Thank you!

We also have a Gitter channel anyone is welcome to join to discuss and find help: https://gitter.im/redux-observable/redux-observable

Most usage questions are not actually redux-observable specific, but rather general RxJS questions and patterns, so you can also find help in the RxJS community at large. RxJS bugs can be reported in their repo: https://github.com/ReactiveX/rxjs
-->

**Do you want to request a *feature* or report a *bug*?**

<!-- Make sure someone else hasn't already reported it: https://github.com/redux-observable/redux-observable/issues -->

**What is the current behavior?**

**If the current behavior is a bug, please provide the steps to reproduce and a minimal demo of the problem using JSBin, StackBlitz, or similar.**

<!--
The easier it is to reproduce the more likely someone will be able to quickly help. Very often in the process you may discover it's not a bug or gain a better understanding of what the cause is.

Here are some you can use as starting points:

JSBins: https://redux-observable.js.org/#online-live-examples
StackBlitz: https://stackblitz.com/edit/redux-observable-playground
-->

**What is the expected behavior?**

**Which versions of redux-observable, and which browser and OS are affected by this issue? Did this work in previous versions of redux-observable?**


text:
<?php
/**
 * Archive Views
 *
 * Usage:
 * Calls a function based on the archive of a page, in the style of `[archive]_view`
 * Hyphens are converted into underscores automatically,
 * e.g. case-studies -> case_studies_view
 *
 * Global context changes should be made either after Initial Set Up in
 * this file, or in the `functions.php` file.
 *
 * Page specific context goes in the its `_view` function below.
 *
 * You have access to the $context and the $post ($context['post']).
 *
 */

function generic_view ($context) {
	  Timber::render('archive/generic.twig', $context);
}

function portfolio_view ($context) {

	$args = array(
	  'post_type' => 'portfolio',
	  'paged' => $paged,
	  'orderby' => 'menu_order',
	  'order' => 'ASC',
	  'posts_per_page' => -1
	);

	$context['portfolio'] = Timber::get_posts($args);

    Timber::render('archive/portfolio.twig', $context);
}

// DO NOT DO ANYTHING AFTER THIS!
$view = str_replace('-', '_',strtolower(get_query_var('post_type')).'_view');
if (function_exists ($view)) {
	call_user_func($view, $context);
}
else {
	call_user_func('generic_view', $context);
}