text:
#include "main.h"
#include "User.h"
#include "Nick.h"
#include "Modules.h"
#include "Chan.h"
#include "FileUtils.h"
#include <pthread.h>
#include <climits>

#define MAX_EXTS 6
#define MAX_CHARS 16

class CUrlBufferModule : public CModule
{
private:
	VCString lastUrls, nicks;

	unsigned int linkNum;
	CString target;
	static const string supportedExts[MAX_EXTS];
	static const char unSupportedChars[MAX_CHARS];

	static inline CString getStdoutFromCommand(const CString& cmd);
	inline void LoadDefaults();
	inline CString convertTime(const CString& str)
	{
		time_t curtime;
		tm* timeinfo;
		char buffer[1024];

		time(&curtime);
		curtime += (time_t) (m_pUser->GetTimezoneOffset() * 60 * 60);
		timeinfo = localtime(&curtime);

		if (!strftime(buffer, sizeof(buffer), str.c_str(), timeinfo))
		{
			return "";
		}
		return CString(buffer);
	}
	inline bool isValidExtension(CString ext)
	{
		ext.MakeLower();
		for(int i=0; i< MAX_EXTS; i++)
		{
			if( ext == supportedExts[i])
				return true;
		}
		return false;
	}
	inline bool isValidDir(const string& dir)
	{
		for(int i=0; i< MAX_CHARS; i++)
		{
			if (dir.find(unSupportedChars[i]) !=string::npos)
				return false;
		}
		return true;
	}
	static void* sendLinks(void *ptr);
	inline void CheckLineForLink(const CString& sMessage, const CString& sOrigin);
	inline void CheckLineForTrigger(const CString& sMessage, const CString& sTarget);
public:
	MODCONSTRUCTOR(CUrlBufferModule) {}

	bool OnLoad(const CString& sArgs, CString& sErrorMsg);
	~CUrlBufferModule();
	EModRet OnUserMsg(CString& sTarget, CString& sMessage);
	EModRet OnPrivMsg(CNick& Nick, CString& sMessage);
	EModRet OnChanMsg(CNick& Nick, CChan& Channel, CString& sMessage);
	void OnModCommand(const CString& sCommand);

};

const string CUrlBufferModule::supportedExts[MAX_EXTS] =
				{"jpg", "png", "gif", "jpeg", "bmp", "tiff"} ;

const char CUrlBufferModule::unSupportedChars[MAX_CHARS] =
				{'|', ';', '!', '@', '#', '(', ')', '<', '>', '"',  '\'', '`', '~', '=', '&', '^'};

bool CUrlBufferModule::OnLoad(const CString& sArgs, CString& sErrorMsg)
{
	LoadDefaults();
	return true;
}

CUrlBufferModule::~CUrlBufferModule() {}

CUrlBufferModule::EModRet CUrlBufferModule::OnUserMsg(CString& sTarget, CString& sMessage)
{
	CheckLineForLink(sMessage, "");
	CheckLineForTrigger(sMessage, m_pUser->GetIRCNick().GetNick());
	return CONTINUE;
}

CUrlBufferModule::EModRet CUrlBufferModule::OnPrivMsg(CNick& Nick, CString& sMessage)
{
	CheckLineForLink(sMessage, Nick.GetNick());
	CheckLineForTrigger(sMessage, Nick.GetNick());
	return CONTINUE;
}

CUrlBufferModule::EModRet CUrlBufferModule::OnChanMsg(CNick& Nick, CChan& Channel, CString& sMessage)
{
	CheckLineForLink(sMessage, Nick.GetNick());
	CheckLineForTrigger(sMessage, Nick.GetNick());
	return CONTINUE;
}

void CUrlBufferModule::OnModCommand(const CString& sCommand)
{
	CString command = sCommand.Token(0).AsLower().Trim_n();

	if (command == "help")
	{
		CTable CmdTable;

		CmdTable.AddColumn("Command");
		CmdTable.AddColumn("Description");

		CmdTable.AddRow();
		CmdTable.SetCell("Command", "ENABLE");
		CmdTable.SetCell("Description", "Activates link buffering.");

		CmdTable.AddRow();
		CmdTable.SetCell("Command", "DISABLE");
		CmdTable.SetCell("Description", "Deactivates link buffering.");

		CmdTable.AddRow();
		CmdTable.SetCell("Command", "ENABLELOCAL");
		CmdTable.SetCell("Description", "Enables downloading of each link to local directory.");

		CmdTable.AddRow();
		CmdTable.SetCell("Command", "DISABLELOCAL");
		CmdTable.SetCell("Description", "Disables downloading of each link to local directory.");

		CmdTable.AddRow();
		CmdTable.SetCell("Command","ENABLEPUBLIC");
		CmdTable.SetCell("Description", "Enables the usage of !showlinks publicly, by other users.");

		CmdTable.AddRow();
                CmdTable.SetCell("Command","DISABLEPUBLIC");
                CmdTable.SetCell("Description", "Disables the usage of !showlinks publicly, by other users.");

		CmdTable.AddRow();
		CmdTable.SetCell("Command", "DIRECTORY <#directory>");
		CmdTable.SetCell("Description", "Sets the local directory where the links will be saved.");

		CmdTable.AddRow();
		CmdTable.SetCell("Command", "CLEARBUFFER");
		CmdTable.SetCell("Description", "Empties the link buffer.");

		CmdTable.AddRow();
		CmdTable.SetCell("Command", "BUFFERSIZE <#size>");
		CmdTable.SetCell("Description", "Sets the size of the link buffer. Only integers >=0.");

		CmdTable.AddRow();
		CmdTable.SetCell("Command", "SHOWSETTINGS");
		CmdTable.SetCell("Description", "Prints all the settings.");

		CmdTable.AddRow();
                CmdTable.SetCell("Command", "BUFFERALLLINKS");
                CmdTable.SetCell("Description", "Toggles the buffering of all links or only image links.");

		CmdTable.AddRow();
		CmdTable.SetCell("Command", "SHOWLINKS <#number>");
		CmdTable.SetCell("Description", "Prints <#number> or <#buffersize> number of cached links.");

		CmdTable.AddRow();
		CmdTable.SetCell("Command", "HELP");
		CmdTable.SetCell("Description", "This help.");

		PutModule(CmdTable);
		return;
	}else if (command == "enable")
	{
		SetNV("enable","true",true);
		PutModule("Enabled buffering");
	}else if (command == "disable")
	{
		SetNV("enable","false",true);
		PutModule("Disabled buffering");
	}else if (command == "enablelocal")
	{
		if(GetNV("directory") == "")
		{
			PutModule("Directory is not set. First set a directory and then enable local caching");
			return;
		}
		SetNV("enablelocal","true",true);
		PutModule("Enabled local caching");
	}else if (command == "disablelocal")
	{
		SetNV("enablelocal", "false", true);
		PutModule("Disabled local caching");
	}else if (command == "enablepublic")
	{
		SetNV("enablepublic", "true", true);
		PutModule("Enabled public usage of showlinks.");
	}else if (command == "disablepublic")
        {
                SetNV("enablepublic", "false", true);
                PutModule("Disabled public usage of showlinks.");
        }else if (command == "directory")
	{
		CString dir=sCommand.Token(1).Replace_n("//", "/").TrimRight_n("/") + "/";
		if (!isValidDir(dir))
		{
			PutModule("Error in directory name. Avoid using: | ; ! @ # ( ) < > \" ' ` ~ = & ^ <space> <tab>");
			return;
		}
		// Check if file exists and is directory
		if (dir.empty() || !CFile::Exists(dir) || !CFile::IsDir(dir, false))
		{
			PutModule("Invalid path or no write access to ["+ sCommand.Token(1) +"].");
			return;
		}
		SetNV("directory", dir, true);
		PutModule("Directory for local caching set to " + GetNV("directory"));
	}else if (command == "clearbuffer")
	{
		lastUrls.clear();
		nicks.clear();
	}else if (command == "buffersize")
	{
		unsigned int bufSize = sCommand.Token(1).ToUInt();
		if(bufSize==0 || bufSize==UINT_MAX)
		{
			PutModule("Error in buffer size. Use only integers >= 0.");
			return;
		}
		SetNV("buffersize", CString(bufSize), true);
		PutModule("Buffer size set to " + GetNV("buffersize"));
	}else if (command == "showsettings")
	{
		for(MCString::iterator it = BeginNV(); it != EndNV(); it++)
		{
			PutModule(it->first.AsUpper() + " : " + it->second);
		}
	}else if(command == "bufferalllinks"){
		SetNV("bufferalllinks", CString(!GetNV("bufferalllinks").ToBool()), true);
		PutModule( CString(GetNV("bufferalllinks").ToBool()?"Enabled":"Disabled") + " buffering of all links.");
	}else if (command == "showlinks")
	{
		 if(lastUrls.empty())
                        PutModule("No links were found...");
                 else
                 {
                        unsigned int maxLinks = GetNV("buffersize").ToUInt();
                        unsigned int size = sCommand.Token(1).ToUInt();
                        if(size!=0 && size<UINT_MAX) //if it was a valid number
                              maxLinks = size;
			unsigned int maxSize = lastUrls.size()-1;
			for(unsigned int i=0; i<=maxSize && i< maxLinks; i++)
		        {
                		PutModule(nicks[maxSize-i] + ": " + lastUrls[maxSize-i]);
        		}
  		 }
	}else
	{
		PutModule("Unknown command! Try HELP.");
	}
}

void CUrlBufferModule::LoadDefaults()
{
	if(GetNV("enable")==""){
		SetNV("enable", "true", true);
	}
	if(GetNV("enablelocal")==""){
		SetNV("enablelocal", "false", true);
	}
	if(GetNV("buffersize")== ""){
		SetNV("buffersize", "5", true);
	}
	if(GetNV("enablepublic")==""){
		SetNV("enablepublic", "true", true);
	}
	if(GetNV("bufferalllinks")==""){
		SetNV("bufferalllinks", "false", true);
	}
}

void CUrlBufferModule::CheckLineForLink(const CString& sMessage, const CString& sOrigin)
{
	if(sOrigin != m_pUser->GetIRCNick().GetNick() && GetNV("enable").ToBool() )
	{
		VCString words;
		CString output;
		sMessage.Split(" ", words, false, "", "", true, true);
		for (size_t a = 0; a < words.size(); a++)
		{
			CString& word = words[a];
			if(word.Left(4) == "http" || word.Left(4) == "www.")
			{
				//if you find an image download it, save it in the www directory and keep the new link in buffer
				VCString tokens;
				word.Split("/", tokens, false, "", "", true, true);
				string name = tokens[tokens.size()-1];
				word.Split(".", tokens, false, "", "", true, true);

				//if it's an image link download/upload it else just keep the link
				if(isValidExtension( tokens[tokens.size()-1] ))
				{
                                        std::stringstream ss;
					if( GetNV("enablelocal").ToBool())
					{
						CString dir = GetNV("directory") + convertTime("%Y-%m-%d") + "/";
						if(!CFile::Exists(dir) && !CFile::IsDir(dir, false))
						{
							CDir::MakeDir(dir, 0755);
						}
						ss << "wget -b -O " << dir.c_str() << name <<" -q " << word.c_str() << " 2>&1";
                                                getStdoutFromCommand(ss.str());
					}
					ss.str("");
					if (!word.WildCmp("*imgur*")) {
						ss << "curl -d \"image=" << word.c_str() << "\" -d \"key=5ce86e7f95d8e58b18931bf290f387be\" http://api.imgur.com/2/upload.xml | sed -n 's/.*<original>\\(.*\\)<\\/original>.*/\\1/p' 2>&1";
						output = getStdoutFromCommand(ss.str());
						lastUrls.push_back(output);
					}else {
						lastUrls.push_back(word);
					}
				} else if(GetNV("bufferalllinks").ToBool()){
					lastUrls.push_back(word);
				}
                                nicks.push_back( (sOrigin.empty())? m_pUser->GetIRCNick().GetNick() : sOrigin );
			}
		}
	}
}

CString CUrlBufferModule::getStdoutFromCommand(const CString& cmd)
{
	string data="";
	char buffer[128];
	FILE* stream = popen(cmd.c_str(), "r");
	if (stream == NULL || !stream || ferror(stream))
	{
		return "Error!";
	}
	while (!feof(stream))
	{
		if (fgets(buffer, 128, stream) != NULL)
			data.append(buffer);
	}
	pclose(stream);
	return data;
}

void *CUrlBufferModule::sendLinks(void *ptr)
{
	CUrlBufferModule *caller = static_cast<CUrlBufferModule*> (ptr);
	VCString links = caller->lastUrls;
        VCString nicks = caller->nicks;
	unsigned int maxSize = links.size()-1;

	for(unsigned int i=0; i<=maxSize && i<caller->linkNum; i++)
	{
		sleep(2);
		caller->PutIRC("PRIVMSG " + caller->target + " :" + nicks[maxSize-i] + ": "+ links[maxSize-i]);
	}
	return NULL;
}

void CUrlBufferModule::CheckLineForTrigger(const CString& sMessage, const CString& sTarget)
{
	if(GetNV("enablepublic").ToBool())
	{
		VCString words;
		sMessage.Split(" ", words, false, "", "", true, true);
		for (size_t a = 0; a < words.size(); a++)
		{
			CString& word = words[a];
			if(word.AsLower() == "!showlinks")
			{
				if(lastUrls.empty())
					PutIRC("PRIVMSG " + sTarget + " :No links were found...");
				else
				{
					unsigned int maxLinks = GetNV("buffersize").ToUInt();

					if (a+1 < words.size())
					{
						unsigned int size = words[a+1].ToUInt();
						if(size!=0 && size<UINT_MAX) //if it was a valid number
							maxLinks = size;
					}
					linkNum = maxLinks;
					target = sTarget;

					pthread_t thread;
                                        pthread_attr_t attr;
                                        pthread_attr_init(&attr);
                                        pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
					pthread_create( &thread, &attr, &sendLinks, this);
				}
			}
		}
	}
}

MODULEDEFS(CUrlBufferModule, "Module that caches locally images/links posted on irc channels.")


text:
/* ** GENEREATED FILE - DO NOT MODIFY ** */
package com.wilutions.mslib.outlook;
import com.wilutions.com.*;

/**
 * AddressList.
 *
 */
@CoInterface(guid="{00063049-0000-0000-C000-000000000046}")
public interface AddressList extends IDispatch {
  static boolean __typelib__loaded = __TypeLib.load();
  @DeclDISPID(61440)  public _Application getApplication() throws ComException;
  @DeclDISPID(61450)  public OlObjectClass getClass_() throws ComException;
  @DeclDISPID(61451)  public _NameSpace getSession() throws ComException;
  @DeclDISPID(61441)  public IDispatch getParent() throws ComException;
  @DeclDISPID(256)  public AddressEntries getAddressEntries() throws ComException;
  @DeclDISPID(61470)  public String getID() throws ComException;
  @DeclDISPID(91)  public Integer getIndex() throws ComException;
  @DeclDISPID(61463)  public Boolean getIsReadOnly() throws ComException;
  @DeclDISPID(12289)  public String getName() throws ComException;
  @DeclDISPID(64250)  public MAPIFolder GetContactsFolder() throws ComException;
  @DeclDISPID(64237)  public OlAddressListType getAddressListType() throws ComException;
  @DeclDISPID(64238)  public Integer getResolutionOrder() throws ComException;
  @DeclDISPID(64248)  public Boolean getIsInitialAddressList() throws ComException;
  @DeclDISPID(64253)  public PropertyAccessor getPropertyAccessor() throws ComException;
}

redpajama_set_name: RedPajamaGithub


text:
require 'log4r'

module VagrantPlugins
  module Cloudstack
    module Action
      # This action reads the SSH info for the machine and puts it into the
      # `:machine_ssh_info` key in the environment.
      class ReadSSHInfo
        def initialize(app, env)
          @app    = app
          @logger = Log4r::Logger.new("vagrant_cloudstack::action::read_ssh_info")
        end

        def call(env)
          env[:machine_ssh_info] = read_ssh_info(env[:cloudstack_compute], env[:machine])

          @app.call(env)
        end

        def read_ssh_info(cloudstack, machine)
          return nil if machine.id.nil?

          # Find the machine
          server = cloudstack.servers.get(machine.id)
          if server.nil?
            # The machine can't be found
            @logger.info("Machine couldn't be found, assuming it got destroyed.")
            machine.id = nil
            return nil
          end

          # Get the Port forwarding config
          domain        = machine.provider_config.domain_id
          domain_config = machine.provider_config.get_domain_config(domain)

          pf_ip_address_id = domain_config.pf_ip_address_id
          pf_ip_address    = domain_config.pf_ip_address
          pf_public_port   = domain_config.pf_public_port

          if pf_public_port.nil?
            pf_public_port_file = machine.data_dir.join('pf_public_port')
            if pf_public_port_file.file?
              File.read(pf_public_port_file).each_line do |line|
                pf_public_port = line.strip
              end
              domain_config.pf_public_port = pf_public_port
            end
          end

          if not pf_ip_address and pf_ip_address_id and pf_public_port
            begin
              response = cloudstack.list_public_ip_addresses({:id => pf_ip_address_id})
            rescue Fog::Compute::Cloudstack::Error => e
              raise Errors::FogError, :message => e.message
            end

            if response["listpublicipaddressesresponse"]["count"] == 0
              @logger.info("IP address #{pf_ip_address_id} not exists.")
              env[:ui].info(I18n.t("IP address #{pf_ip_address_id} not exists."))
              pf_ip_address = nil
            else
              pf_ip_address = response["listpublicipaddressesresponse"]["publicipaddress"][0]["ipaddress"]
            end
          end

          if domain_config.keypair.nil? && domain_config.ssh_key.nil?
            sshkeyfile_file = machine.data_dir.join('sshkeyfile')
            if sshkeyfile_file.file?
              domain_config.ssh_key = sshkeyfile_file.to_s
            end
          end

          ssh_info = {
                       :host => pf_ip_address || server.nics[0]['ipaddress'],
                       :port => pf_public_port
                     }
          ssh_info = ssh_info.merge({
            :private_key_path => domain_config.ssh_key,
            :password         => nil
          }) unless domain_config.ssh_key.nil?
          ssh_info = ssh_info.merge({ :username => domain_config.ssh_user }) unless domain_config.ssh_user.nil?
          ssh_info
        end
      end
    end
  end
end


text:
class ItemsController < ApplicationController
  before_action :load_category, :only => [:index, :in_category]

  def load_category
    @categories = Category.all
  end

  def index
    @items = Item.active
    @page_title = "Full Menu"
  end

  def in_category
    @category = Category.find_by_slug(params[:category_slug])
    @items = @category.items.active
    @page_title = @category.title
    render :index
  end

  def update
    @item = Item.find(params[:id])
    @item.update(item_params)
    flash.notice = "#{@item.name} was updated"
    redirect_to edit_item_path(@item.id)
  end

  private

  def item_params
    params.require(:item).permit(:title, :description, :price, :photo, :photo_file_name)
  end

  def load_category
    @categories = Category.all
  end

end


text:
$:.unshift(File.dirname(__FILE__) + '/../lib')

require 'ym4r/google_maps/geocoding'
require 'test/unit'

include Ym4r::GoogleMaps

class TestGmGeocoding< Test::Unit::TestCase
  def test_google_maps_geocoding
    placemarks = Ym4r::GoogleMaps::Geocoding.get("Rue Clovis Paris")
    assert_equal(Ym4r::GoogleMaps::Geocoding::GEO_SUCCESS,placemarks.status)
    assert_equal(1,placemarks.length)
    placemark = placemarks[0]
    assert_equal("FR",placemark.country_code)
    assert_equal("Paris",placemark.locality)
    assert_equal("75005",placemark.postal_code)
  end

  def test_google_maps_pakistan
    placemarks = Ym4r::GoogleMaps::Geocoding.get("Lahore PK")
    assert_equal(Ym4r::GoogleMaps::Geocoding::GEO_SUCCESS,placemarks.status)
    assert_equal(1,placemarks.length)
    placemark = placemarks[0]
    assert_equal("PK",placemark.country_code)
    assert_equal("Lahore",placemark.locality)
    assert_equal("",placemark.thoroughfare)
  end

  def test_google_maps_multiple_matches
    placemarks = Ym4r::GoogleMaps::Geocoding.get("gooseberry")
    assert_equal(Ym4r::GoogleMaps::Geocoding::GEO_SUCCESS,placemarks.status)
    assert_equal(4,placemarks.length)

    placemark = placemarks[0]
    assert_equal("US",placemark.country_code)
    assert_equal("UT", placemark.administrative_area)
    assert_equal("Blanding",placemark.locality)
    assert_equal("Gooseberry",placemark.thoroughfare)
    assert_equal("84511",placemark.postal_code)

    placemark = placemarks[1]
    assert_equal("US",placemark.country_code)
    assert_equal("OR", placemark.administrative_area)
    assert_equal("",placemark.locality)
    assert_equal("",placemark.thoroughfare)
    assert_equal("",placemark.postal_code)

    placemark = placemarks[2]
    assert_equal("US",placemark.country_code)
    assert_equal("UT", placemark.administrative_area)
    assert_equal("Salina",placemark.locality)
    assert_equal("",placemark.thoroughfare)
    assert_equal("",placemark.postal_code)

    placemark = placemarks[3]
    assert_equal("US",placemark.country_code)
    assert_equal("CA", placemark.administrative_area)
    assert_equal("",placemark.locality)
    assert_equal("Gooseberry",placemark.thoroughfare)
    assert_equal("93651",placemark.postal_code)

  end
end


text:
class openssl:
    name = "openssl 1.1.0c"
    url = "https://www.openssl.org/source/openssl-1.1.0c.tar.gz"
    dirname = "" # leave empty to auto guess
    ffmpeg_opts = [ "--enable-openssl" ];

    def skip(self, prefix, force):
        if force: return False;
        if file_exist(prefix + "/bin/openssl"): return True;
        return False;

    def configure(self, prefix):
        runcmd("./config --prefix={} --openssldir={}/ssl".format(prefix, prefix)
	             + " enable-heartbeats enable-weak-ssl-ciphers"
		     + " enable-md2 enable-rc5 zlib");

    def make(self, prefix, opts):
        runcmd("make {}".format(opts));

    def install(self, prefix):
        runcmd("make install");

deps.append(openssl());

# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
FieldVisitor
</TITLE>

<META NAME="date" CONTENT="2010-03-06">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

org.deuce.objectweb.asm

Interface FieldVisitor

All Known Implementing Classes:
FieldNode

public interface FieldVisitor

A visitor to visit a Java field. The methods of this interface must be called
 in the following order: ( <tt>visitAnnotation</tt> |
 <tt>visitAttribute</tt> )* <tt>visitEnd</tt>.

Author:

Eric Bruneton

Method Summary

 AnnotationVisitor
visitAnnotation(java.lang.String desc,
                boolean visible)

          Visits an annotation of the field.

 void
visitAttribute(Attribute attr)

          Visits a non standard attribute of the field.

 void
visitEnd()

          Visits the end of the field.

Method Detail

visitAnnotation

AnnotationVisitor visitAnnotation(java.lang.String desc,
                                  boolean visible)

Visits an annotation of the field.

Parameters:
desc - the class descriptor of the annotation class.
visible - <tt>true</tt> if the annotation is visible at runtime.

Returns:
a visitor to visit the annotation values, or <tt>null</tt> if
         this visitor is not interested in visiting this annotation.

visitAttribute

void visitAttribute(Attribute attr)

Visits a non standard attribute of the field.

Parameters:
attr - an attribute.

visitEnd

void visitEnd()

Visits the end of the field. This method, which is the last one to be
 called, is used to inform the visitor that all the annotations and
 attributes of the field have been visited.

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD


text:
package org.apache.pulsar.broker.transaction.buffer.impl;

import org.apache.pulsar.broker.service.Topic;
import org.apache.pulsar.broker.transaction.buffer.TransactionBuffer;
import org.apache.pulsar.broker.transaction.buffer.TransactionBufferProvider;

/**
 * A provider that provides in-memory implementations of {@link TransactionBuffer}.
 */
public class InMemTransactionBufferProvider implements TransactionBufferProvider {

    @Override
    public TransactionBuffer newTransactionBuffer(Topic originTopic) {
        return new InMemTransactionBuffer(originTopic);
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright 2005-2014 The Kuali Foundation

    Licensed under the Educational Community License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.opensource.org/licenses/ecl2.php

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
                           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">

  <bean class="org.kuali.rice.core.util.ApplicationThreadLocalCleaner" lazy-init="false"/>

  <import resource="classpath:org/kuali/rice/config/RiceServiceRegistrySpringBeans.xml"/>

  <import resource="classpath:org/kuali/rice/config/RiceServiceSpringBeans.xml"/>

</beans>


text:
__author__ = 'ZSGX'

from model.group import Group

def test_group_list(app, db):
    def clean(group):
        return Group(id=group.id, name=group.name.strip())
    ui_list = app.group.get_group_list()
    db_list = map(clean, db.get_group_list())
    assert sorted(ui_list, key=Group.id_or_max) == sorted(db_list, key=Group.id_or_max)


text:
<?xml version="1.0" encoding="UTF-8"?>
<CustomFieldTranslation xmlns="http://soap.sforce.com/2006/04/metadata">
    <name>Mailing_County__c</name>
    <label>Postitusmaa</label>
</CustomFieldTranslation>


text:
namespace OmniXaml.TypeLocation
{
    public class Address
    {
        public Address(string ns, string typeName)
        {
            Namespace = ns;
            TypeName = typeName;
        }
        public string Namespace { get; set; }
        public string TypeName { get; set; }

        public override string ToString()
        {
            return $"{nameof(Namespace)}: {Namespace}, {nameof(TypeName)}: {TypeName}";
        }
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
in Burt, Ann. Mo. bot. Gdn 12: 270 (1926)

#### Original name
Peniophora roumeguerei subsp. roumeguerei (Bres.) Bres.

### Remarks
null


text:
class AnswerHierarchy < ApplicationRecord
  clone_options follow: []
end


text:
@IF DEFINED PYTHON (@setlocal enableextensions & %PYTHON% -u -x %~f0 %* & goto :EOF) ELSE (@setlocal enableextensions & python.exe -u -x %~f0 %* & goto :EOF)
#!python.exe
# EASY-INSTALL-SCRIPT: 'lua-protobuf==0.0.1','protoc-gen-lua'
__requires__ = 'lua-protobuf==0.0.1'
try:
	import pkg_resources
	pkg_resources.run_script('lua-protobuf==0.0.1', 'protoc-gen-lua')
except Exception as e:
	import sys
	if type(e).__name__ == 'DistributionNotFound':
		from os.path import dirname, realpath
		path = dirname(realpath(__file__))
		sys.path.append(path)
		try:
			filename = '%s/protoc-gen-lua'%path
			exec(compile(open(filename, 'r').read(), filename, 'exec'))
		except Exception as e:
			sys.stderr.write('Failed to generate -%s-%s'%(type(e).__name__, e))
			import traceback
			print(traceback.format_exc())
			sys.exit(1)
	else:
		sys.stderr.write('Failed to generate -%s-%s'%(type(e).__name__, e))
		import traceback
		print(traceback.format_exc())
		sys.exit(1)


text:
source "$(dirname "${BASH_SOURCE[0]}")/lib/failover-functions.sh"

#
#  main():
#
setup_failover

start_failover_services

echo "`basename $0`: OpenShift IP Failover service terminated."


text:
package v1beta1

import (
	"testing"

	"github.com/google/go-cmp/cmp"
)

func TestIsReady(t *testing.T) {
	status := &IdentityStatus{}
	want := false

	got := status.IsReady()

	if diff := cmp.Diff(want, got); diff != "" {
		t.Errorf("Unexpected difference (-want, +got): %v", diff)
	}
}


text:
package org.hl7.fhir.instance.model.valuesets;

// Generated on Sat, Aug 22, 2015 23:00-0400 for FHIR v0.5.0

import org.hl7.fhir.instance.model.EnumFactory;

public class ObservationCategoryEnumFactory implements EnumFactory<ObservationCategory> {

  public ObservationCategory fromCode(String codeString) throws IllegalArgumentException {
    if (codeString == null || "".equals(codeString))
      return null;
    if ("social-history".equals(codeString))
      return ObservationCategory.SOCIALHISTORY;
    if ("vital-signs".equals(codeString))
      return ObservationCategory.VITALSIGNS;
    if ("imaging".equals(codeString))
      return ObservationCategory.IMAGING;
    if ("laboratory".equals(codeString))
      return ObservationCategory.LABORATORY;
    if ("procedure".equals(codeString))
      return ObservationCategory.PROCEDURE;
    if ("survey".equals(codeString))
      return ObservationCategory.SURVEY;
    if ("exam".equals(codeString))
      return ObservationCategory.EXAM;
    if ("therapy".equals(codeString))
      return ObservationCategory.THERAPY;
    throw new IllegalArgumentException("Unknown ObservationCategory code '"+codeString+"'");
  }

  public String toCode(ObservationCategory code) {
    if (code == ObservationCategory.SOCIALHISTORY)
      return "social-history";
    if (code == ObservationCategory.VITALSIGNS)
      return "vital-signs";
    if (code == ObservationCategory.IMAGING)
      return "imaging";
    if (code == ObservationCategory.LABORATORY)
      return "laboratory";
    if (code == ObservationCategory.PROCEDURE)
      return "procedure";
    if (code == ObservationCategory.SURVEY)
      return "survey";
    if (code == ObservationCategory.EXAM)
      return "exam";
    if (code == ObservationCategory.THERAPY)
      return "therapy";
    return "?";
  }

}


text:
package com.jnape.palatable.lambda.internal.iteration;

import com.jnape.palatable.lambda.functions.Fn1;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import static com.jnape.palatable.lambda.functions.builtin.fn2.All.all;
import static java.util.Collections.singletonList;

public final class PredicatedTakingIterable<A> implements Iterable<A> {
    private final List<Fn1<? super A, ? extends Boolean>> predicates;
    private final Iterable<A>                             as;

    public PredicatedTakingIterable(Fn1<? super A, ? extends Boolean> predicate, Iterable<A> as) {
        List<Fn1<? super A, ? extends Boolean>> predicates = new ArrayList<>(singletonList(predicate));
        while (as instanceof PredicatedTakingIterable) {
            PredicatedTakingIterable<A> nested = (PredicatedTakingIterable<A>) as;
            predicates.addAll(0, nested.predicates);
            as = nested.as;
        }
        this.predicates = predicates;
        this.as = as;
    }

    @Override
    public Iterator<A> iterator() {
        Fn1<? super A, ? extends Boolean> metaPredicate = a -> all(p -> p.apply(a), predicates);
        return new PredicatedTakingIterator<>(metaPredicate, as.iterator());
    }
}


text:
cd ../research-computing-with-cpp-demo-build/RCCPP-build/bin/
./LifeGameTest


text:
package infinitystorage.block;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyDirection;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.InventoryHelper;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.items.IItemHandler;
import infinitystorage.InfinityStorage;
import infinitystorage.item.ItemBlockBase;
import infinitystorage.tile.TileBase;

public abstract class BlockBase extends Block {
    private static final PropertyDirection DIRECTION = PropertyDirection.create("direction");

    private String name;

    public BlockBase(String name) {
        super(Material.ROCK);

        this.name = name;

        setHardness(1.9F);
        setRegistryName(InfinityStorage.ID, name);
        setCreativeTab(InfinityStorage.INSTANCE.tab);
    }

    @Override
    public String getUnlocalizedName() {
        return "block." + InfinityStorage.ID + ":" + name;
    }

    protected BlockStateContainer.Builder createBlockStateBuilder() {
        BlockStateContainer.Builder builder = new BlockStateContainer.Builder(this);

        if (getPlacementType() != null) {
            builder.add(DIRECTION);
        }

        return builder;
    }

    @Override
    protected BlockStateContainer createBlockState() {
        return createBlockStateBuilder().build();
    }

    public Item createItem() {
        return new ItemBlockBase(this, getPlacementType(), false);
    }

    @Override
    @SuppressWarnings("deprecation")
    public IBlockState getStateFromMeta(int meta) {
        return getDefaultState();
    }

    @Override
    public int getMetaFromState(IBlockState state) {
        return 0;
    }

    @Override
    @SuppressWarnings("deprecation")
    public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos) {
        if (getPlacementType() != null) {
            return state.withProperty(DIRECTION, ((TileBase) world.getTileEntity(pos)).getDirection());
        }

        return state;
    }

    @Override
    public int damageDropped(IBlockState state) {
        return getMetaFromState(state);
    }

    @Override
    public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis) {
        if (!world.isRemote && getPlacementType() != null) {
            TileBase tile = (TileBase) world.getTileEntity(pos);

            tile.setDirection(getPlacementType().getNext(tile.getDirection()));

            tile.updateBlock();

            return true;
        }

        return false;
    }

    @Override
    public void breakBlock(World world, BlockPos pos, IBlockState state) {
        TileEntity tile = world.getTileEntity(pos);

        if (tile instanceof TileBase && ((TileBase) tile).getDrops() != null) {
            IItemHandler handler = ((TileBase) tile).getDrops();

            for (int i = 0; i < handler.getSlots(); ++i) {
                if (handler.getStackInSlot(i) != null) {
                    InventoryHelper.spawnItemStack(world, pos.getX(), pos.getY(), pos.getZ(), handler.getStackInSlot(i));
                }
            }
        }

        super.breakBlock(world, pos, state);
    }

    @Override
    public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest) {
        return willHarvest || super.removedByPlayer(state, world, pos, player, willHarvest);
    }

    @Override
    public void harvestBlock(World world, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity tile, ItemStack stack) {
        super.harvestBlock(world, player, pos, state, tile, stack);

        world.setBlockToAir(pos);
    }

    public EnumPlacementType getPlacementType() {
        return EnumPlacementType.HORIZONTAL;
    }
}


text:
import { factory } from '../../utils/factory'
import { deepMap } from '../../utils/collection'
import { squareNumber } from '../../plain/number'

const name = 'square'
const dependencies = ['typed']

export const createSquare = /* #__PURE__ */ factory(name, dependencies, ({ typed }) => {
  /**
   * Compute the square of a value, `x * x`.
   * For matrices, the function is evaluated element wise.
   *
   * Syntax:
   *
   *    math.square(x)
   *
   * Examples:
   *
   *    math.square(2)           // returns number 4
   *    math.square(3)           // returns number 9
   *    math.pow(3, 2)           // returns number 9
   *    math.multiply(3, 3)      // returns number 9
   *
   *    math.square([1, 2, 3, 4])  // returns Array [1, 4, 9, 16]
   *
   * See also:
   *
   *    multiply, cube, sqrt, pow
   *
   * @param  {number | BigNumber | Fraction | Complex | Array | Matrix | Unit} x
   *            Number for which to calculate the square
   * @return {number | BigNumber | Fraction | Complex | Array | Matrix | Unit}
   *            Squared value
   */
  const square = typed(name, {
    number: squareNumber,

    Complex: function (x) {
      return x.mul(x)
    },

    BigNumber: function (x) {
      return x.times(x)
    },

    Fraction: function (x) {
      return x.mul(x)
    },

    'Array | Matrix': function (x) {
      // deep map collection, skip zeros since square(0) = 0
      return deepMap(x, square, true)
    },

    Unit: function (x) {
      return x.pow(2)
    }
  })

  return square
})


text:
. /etc/profile.d/java.sh
. /etc/profile.d/kafka.sh

if [ $# -gt 0 ]; then
    $KAFKA_HOME/bin/kafka-topics.sh --create --zookeeper localhost --replication-factor 2 --partition 2 --topic $1
else
    echo "Usage: create_topic.sh <topic_name>"
fi


text:
package org.codehaus.httpcache4j;

import org.codehaus.httpcache4j.util.OptionalUtils;
import org.codehaus.httpcache4j.util.Preconditions;

import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;

/**
 * Represents the different conditional types that an HTTP request may have.
 * This are basically 4 things:
 *

 *
If-Match

 *
If-None-Match

 *
If-Unmodified-Since

 *
If-Modified-Since

 *

 *
 *
 Combinations of these conditionals are possible with the following exceptions

 *
 *

 *

 *
Conditional	Can be combined with	Unspecified

 *

 *

 *

 *     If-Match	If-Unmodified-Since	If-None-Match, If-Modified-Since
 *

 *

 *     If-None-Match	If-Modified-Since	If-Match, If-Unmodified-Since
 *

 *

 *     If-Unmodified-Since	If-Match	If-None-Match, If-Modified-Since
 *

 *

 *     If-Modified-Since	If-None-Match	If-Match, If-Unmodified-Since
 *

 *

 *

 *
 * @author Erlend Hamnaberg
 */
public final class Conditionals {
    private final List<Tag> match;
    private final List<Tag> noneMatch;
    private final Optional<LocalDateTime> modifiedSince;
    private final Optional<LocalDateTime> unModifiedSince;
    private static final String ERROR_MESSAGE = "The combination of %s and %s is undefined by the HTTP specification";

    public Conditionals() {
        this(empty(), empty(), Optional.empty(), Optional.empty());
    }

    private static List<Tag> empty() {
        return Collections.emptyList();
    }

    public Conditionals(List<Tag> match, List<Tag> noneMatch, Optional<LocalDateTime> modifiedSince, Optional<LocalDateTime> unModifiedSince) {
        this.match = match;
        this.noneMatch = noneMatch;
        this.modifiedSince = modifiedSince;
        this.unModifiedSince = unModifiedSince;
    }

    /**
     * Adds tags to the If-Match header.
     *
     * @param tag the tag to add, may be null. This means the same as adding {@link Tag#ALL}
     * @throws IllegalArgumentException if ALL is supplied more than once, or you add a null tag more than once.
     * @return a new Conditionals object with the If-Match tag added.
     */
    public Conditionals addIfMatch(Tag tag) {
        Preconditions.checkArgument(!modifiedSince.isPresent(), String.format(ERROR_MESSAGE, HeaderConstants.IF_MATCH, HeaderConstants.IF_MODIFIED_SINCE));
        Preconditions.checkArgument(noneMatch.isEmpty(), String.format(ERROR_MESSAGE, HeaderConstants.IF_MATCH, HeaderConstants.IF_NONE_MATCH));
        List<Tag> match = new ArrayList<>(this.match);

        if (tag == null) {
            tag = Tag.ALL;
        }
        if (Tag.ALL.equals(tag)) {
            match.clear();
        }
        if (!match.contains(Tag.ALL)) {
            if (!match.contains(tag)) {
                match.add(tag);
            }
        }
        else {
            throw new IllegalArgumentException("Tag ALL already in the list");
        }
        return new Conditionals(Collections.unmodifiableList(match), empty(), Optional.empty(), unModifiedSince);
    }

    /**
     * Adds tags to the If-None-Match header.
     *
     * The meaning of "If-None-Match: *" is that the method MUST NOT be performed if the representation selected by
     * the origin server (or by a cache, possibly using the Vary mechanism, see section 14.44) exists,
     * and SHOULD be performed if the representation does not exist.
     * This feature is intended to be useful in preventing races between PUT operations.
     *
     * @param tag the tag to add, may be null. This means the same as adding {@link Tag#ALL}
     * @throws IllegalArgumentException if ALL is supplied more than once, or you add a null tag more than once.
     * @return a new Conditionals object with the If-None-Match tag added.
     */
    public Conditionals addIfNoneMatch(Tag tag) {
        Preconditions.checkArgument(!unModifiedSince.isPresent(), String.format(ERROR_MESSAGE, HeaderConstants.IF_NONE_MATCH, HeaderConstants.IF_UNMODIFIED_SINCE));
        Preconditions.checkArgument(match.isEmpty(), String.format(ERROR_MESSAGE, HeaderConstants.IF_NONE_MATCH, HeaderConstants.IF_MATCH));
        List<Tag> noneMatch = new ArrayList<>(this.noneMatch);
        if (tag == null) {
            tag = Tag.ALL;
        }
        if (Tag.ALL.equals(tag)) {
            noneMatch.clear();
        }
        if (!noneMatch.contains(Tag.ALL)) {
            if (!noneMatch.contains(tag)) {
                noneMatch.add(tag);
            }
        }
        else {
            throw new IllegalArgumentException("Tag ALL already in the list");
        }
        return new Conditionals(empty(), Collections.unmodifiableList(noneMatch), modifiedSince, Optional.empty());
    }

    /**
     * You should use the server's time here. Otherwise you might get unexpected results.
     *
     * The typical use case is:
     *
     *
     *

     *   HTTPResponse response = ....
     *   HTTPRequest request = createRequest();
     *   request = request.conditionals(new Conditionals().ifModifiedSince(response.getLastModified());
     *

     *
     * @param time the time to check.
     * @return the conditionals with the If-Modified-Since date set.
     */
    public Conditionals ifModifiedSince(LocalDateTime time) {
        Preconditions.checkArgument(match.isEmpty(), String.format(ERROR_MESSAGE, HeaderConstants.IF_MODIFIED_SINCE, HeaderConstants.IF_MATCH));
        Preconditions.checkArgument(!unModifiedSince.isPresent(), String.format(ERROR_MESSAGE, HeaderConstants.IF_MODIFIED_SINCE, HeaderConstants.IF_UNMODIFIED_SINCE));
        time = time.withNano(0);
        return new Conditionals(empty(), noneMatch, Optional.of(time), Optional.empty());
    }

    /**
     * You should use the server's time here. Otherwise you might get unexpected results.
     * The typical use case is:
     *
     *
     *

     *   HTTPResponse response = ....
     *   HTTPRequest request = createRequest();
     *   request = request.conditionals(new Conditionals().ifUnModifiedSince(response.getLastModified());
     *

     *
     * @param time the time to check.
     * @return the conditionals with the If-Unmodified-Since date set.
     */
    public Conditionals ifUnModifiedSince(LocalDateTime time) {
        Preconditions.checkArgument(noneMatch.isEmpty(), String.format(ERROR_MESSAGE, HeaderConstants.IF_UNMODIFIED_SINCE, HeaderConstants.IF_NONE_MATCH));
        Preconditions.checkArgument(!modifiedSince.isPresent(), String.format(ERROR_MESSAGE, HeaderConstants.IF_UNMODIFIED_SINCE, HeaderConstants.IF_MODIFIED_SINCE));
        time = time.withNano(0);
        return new Conditionals(match, empty(), Optional.empty(), Optional.of(time));
    }

    public List<Tag> getMatch() {
        return Collections.unmodifiableList(match);
    }

    public List<Tag> getNoneMatch() {
        return Collections.unmodifiableList(noneMatch);
    }

    public Optional<LocalDateTime> getModifiedSince() {
        return modifiedSince;
    }

    public Optional<LocalDateTime> getUnModifiedSince() {
        return unModifiedSince;
    }

    /**
     *
     * @return {@code true} if the Conditionals represents a unconditional request.
     */
    public boolean isUnconditional() {
      return noneMatch.contains(Tag.ALL) || match.contains(Tag.ALL) || (match.isEmpty() && !unModifiedSince.isPresent()) || (noneMatch.isEmpty() && !modifiedSince.isPresent()) ;
    }

    /**
     * Converts the Conditionals into real headers.
     * @return real headers.
     */
    public Headers toHeaders() {
        Headers headers = new Headers();
        if (!getMatch().isEmpty()) {
            headers = headers.add(new Header(HeaderConstants.IF_MATCH, buildTagHeaderValue(getMatch())));
        }
        if (!getNoneMatch().isEmpty()) {
            headers = headers.add(new Header(HeaderConstants.IF_NONE_MATCH, buildTagHeaderValue(getNoneMatch())));
        }
        if (modifiedSince.isPresent()) {
            headers = headers.set(HeaderUtils.toHttpDate(HeaderConstants.IF_MODIFIED_SINCE, modifiedSince.get()));
        }
        if (unModifiedSince.isPresent()) {
            headers = headers.set(HeaderUtils.toHttpDate(HeaderConstants.IF_UNMODIFIED_SINCE, unModifiedSince.get()));
        }

        return headers;
    }

    public static Conditionals valueOf(Headers headers) {
        List<Tag> ifMatch = makeTags(headers.getFirstHeaderValue(HeaderConstants.IF_MATCH).orElse(null));
        List<Tag> ifNoneMatch = makeTags(headers.getFirstHeaderValue(HeaderConstants.IF_NONE_MATCH).orElse(null));
        Optional<LocalDateTime> modifiedSince = headers.getFirstHeader(HeaderConstants.IF_MODIFIED_SINCE).flatMap(HeaderUtils::fromHttpDate);
        Optional<LocalDateTime> unModifiedSince = headers.getFirstHeader(HeaderConstants.IF_UNMODIFIED_SINCE).flatMap(HeaderUtils::fromHttpDate);
        return new Conditionals(ifMatch, ifNoneMatch, modifiedSince, unModifiedSince);
    }

    private static List<Tag> makeTags(String ifMatch) {
        if (ifMatch == null) {
            return Arrays.asList();
        }
        return Collections.unmodifiableList(Arrays.asList(ifMatch.split(",")).stream().
                filter(m -> !Objects.toString(m, "").isEmpty()).
                map(String::trim).
                flatMap(t -> OptionalUtils.stream(Tag.parse(t))).collect(Collectors.toList()));
    }

    private String buildTagHeaderValue(List<Tag> match) {
        return match.stream().map(Tag::format).collect(Collectors.joining(","));
    }
}


text:
<!DOCTYPE html>

        <title>Twitter Naughty List</title>
        <meta content='width=device-width' name='viewport'>
        <link href="/wtf/naughtynice/css/main.css" media="screen" rel="stylesheet" type="text/css" />

                    Naughty or Nice

fooballs

                <input id="twitter-name" type="text" placeholder="by @twitter_name" autofocus autocorrect="off" autocapitalize="off" />

Santa's List Stats

                                Nicest
                                Naughtiest

                    ---

People on the nice list

                    ---

People on the naughty list

                Elf-made in Santa's Workshop by
                Katie Ball

                    Follow @mektball

                    </script>


text:
Check two given binary trees are identical or not. Assuming any number of tweaks are allowed. A tweak is defined as a swap of the children of one node in the tree.

**Example**

```
    1            1
   / \          / \
  2   3   and  3   2
 /                  \
4                    4
```
are identical.

# Thoughts

- Recursive
- Check node from tree a, and node from tree b. If the node differs, then return False
- If the node is the same, check the following two conditions:
  - a's left == b's left && a's right == b's right
  - a's left == b's right && a's right == b's left

# My Solution

```
    def isTweakedIdentical(self, a, b):
        # Write your code here
        if a == None and b == None:
            return True

        if a and b and a.val == b.val:
            return self.isTweakedIdentical(a.left, b.left) and \
                    self.isTweakedIdentical(a.right, b.right) or \
                    self.isTweakedIdentical(a.left, b.right) and \
                    self.isTweakedIdentical(a.right, b.left)

        return False
```

# Reference