	CExpressionArray *trueInnerJoinPredArray =
		GPOS_NEW(mp) CExpressionArray(mp);
	CExpression *innerJoinPreds = (*pexprScalar)[0];
	BOOL isAConjunction = CPredicateUtils::FAnd(innerJoinPreds);

	GPOS_ASSERT(COperator::EopScalarNAryJoinPredList ==
				pexprScalar->Pop()->Eopid());

	// split the predicate into conjuncts and inspect those individually
	predArray = CPredicateUtils::PdrgpexprConjuncts(mp, innerJoinPreds);

	for (ULONG ul = 0; ul < predArray->Size(); ul++)
	{
		CExpression *pred = (*predArray)[ul];
		CColRefSet *predCols = pred->DeriveUsedColumns();
		BOOL addToPredArray = true;

		// check whether the predicate uses any ColRefs that come from a non-inner join child
		for (ULONG c = 0; c < exprhdl.Arity() - 1; c++)
		{
			if (0 < *(*m_lojChildPredIndexes)[c])
			{
				// this is a right child of a non-inner join
				CColRefSet *nijOutputCols = exprhdl.DeriveOutputColumns(c);

				if (predCols->FIntersects(nijOutputCols))
				{
					// this predicate refers to some columns from non-inner joins,
					// which may become NULL, even when the type of the column is NOT NULL,
					// so the predicate may not actually be FALSE constants in some cases
					addToPredArray = false;
					break;
				}
			}
		}

		if (addToPredArray)
		{
			pred->AddRef();
			trueInnerJoinPredArray->Append(pred);
		}
	}

	predArray->Release();
	if (0 == trueInnerJoinPredArray->Size())
	{
		trueInnerJoinPredArray->Release();
		return CUtils::PexprScalarConstBool(mp, true);
	}
	return CPredicateUtils::PexprConjDisj(mp, trueInnerJoinPredArray,
										  isAConjunction);
}

//---------------------------------------------------------------------------
// CLogicalNAryJoin::ReplaceInnerJoinPredicates
//
// given an existing scalar child of an NAry join, make a new copy, replacing
// only the inner join predicates and leaving the LOJ ON predicates the same
//---------------------------------------------------------------------------
CExpression *
CLogicalNAryJoin::ReplaceInnerJoinPredicates(
	CMemoryPool *mp, CExpression *old_nary_join_scalar_expr,
	CExpression *new_inner_join_preds)
{
	COperator *pop = old_nary_join_scalar_expr->Pop();

	if (EopScalarNAryJoinPredList == pop->Eopid())
	{
		GPOS_ASSERT(NULL != m_lojChildPredIndexes);
		// this requires a bit of surgery, make a new copy of the
		// CScalarNAryJoinPredList with the first child replaced
		CExpressionArray *new_children = GPOS_NEW(mp) CExpressionArray(mp);

		new_children->Append(new_inner_join_preds);

		for (ULONG ul = 1; ul < old_nary_join_scalar_expr->Arity(); ul++)
		{
			CExpression *existing_child = (*old_nary_join_scalar_expr)[ul];

			existing_child->AddRef();
			new_children->Append(existing_child);
		}

		pop->AddRef();

		return GPOS_NEW(mp) CExpression(mp, pop, new_children);
	}

	// with all inner joins it's a total replacement, just return the inner join preds
	// (caller should have passed us a ref count which they now get back from us)
	GPOS_ASSERT(NULL == m_lojChildPredIndexes);

	return new_inner_join_preds;
}

//---------------------------------------------------------------------------
//	@function:
//		CLogicalNAryJoin::OsPrint
//
//	@doc:
//		debug print
//
//------------------------------------------------------


bool Equals(TransponderBase other)
    {
        return Mode1 == other.Mode1 && Mode3 == other.Mode3 && Mode4 == other.Mode4 && Status == other.Status;
    }

    public override bool Equals(object obj)
    {
        if (ReferenceEquals(null, obj)) return false;
        if (ReferenceEquals(this, obj)) return true;
        if (obj.GetType() != GetType()) return false;
        return Equals((TransponderBase)obj);
    }

    public override int GetHashCode() => HashCode.Combine(Mode1, Mode3, Mode4, Status);

    public TransponderBase DeepClone()
    {
        return new TransponderBase
        {
            Mode1 = Mode1,
            Mode3 = Mode3,
            Mode4 = Mode4,
            Status = Status
        };
    }
}


ppings }, context)
			},
			OperatorCombinator(MaxBsonNodeNode::class) { sources, context ->
				MaxBsonNodeNode(sources.flatMap { it.mappings }, context)
			},
			OperatorCombinator(UnsetBsonNodeNode::class) { sources, context ->
				UnsetBsonNodeNode(sources.flatMap { it.fields }, context)
			},
			OperatorCombinator(RenameBsonNodeNode::class) { sources, context ->
				RenameBsonNodeNode(sources.flatMap { it.fields }, context)
			},
			OperatorCombinator(AddToSetBsonNode::class) { sources, context ->
				AddToSetBsonNode(sources.flatMap { it.mappings }, context)
			},
			OperatorCombinator(CurrentDateBsonNode::class) { sources, context ->
				CurrentDateBsonNode(sources.flatMap { it.mappings }, context)
			},
		)
	}
}

/**
 * Creates an empty [UpdateQuery].
 */
@LowLevelApi
fun <T> UpdateQuery(context: BsonContext): UpdateQuery<T> =
	UpdateQueryImpl(context)

/**
 * Creates an empty [UpsertQuery].
 */
@LowLevelApi
fun <T> UpsertQuery(context: BsonContext): UpsertQuery<T> =
	UpdateQueryImpl(context)
/*
 * Copyright (c) 2024, OpenSavvy and contributors.
 *
 * Licensed under the Apache 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.apache.org/licenses/LICENSE-2.0
 *
 * 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.
 */

package opensavvy.ktmongo.dsl.tree

import opensavvy.ktmongo.dsl.LowLevelApi
import opensavvy.ktmongo.dsl.tree.ImmutableNode.freeze

/**
 * An element in an abstract tree.
 *
 * It is not expected that users of this library have to deal with this class directly.
 *
 * ### Trees
 *
 * Trees are expected to be built bottom-up: a node is always built before its parents.
 * Once a node has been [accepted][CompoundNode.accept] by a parent, it [freezes][freeze] (becomes forever immutable).
 * The same node may be added to multiple parent nodes.
 *
 * This schemes ensures that trees are always as simplified as possible: we are always building a single node at a time,
 * and all its children are guaranteed to be immutable and fully simplified.
 *
 * There are two main categories of nodes:
 * - Nodes that represent some data by themselves,
 * - Nodes that group other nodes into a single larger node.
 *
 * The former category implements this interface, whereas the latter implements [CompoundNode].
 */
interface Node {

	/**
	 * Makes this node immutable.
	 *
	 * After this method has been called, the expression can never be modified again.
	 * This ensures that nodes cannot change after they have been used within other nodes.
	 *
	 * To learn more about this process, see [Node].
	 */
	@LowLevelApi
	fun freeze()

}

/**
 * Helper to implement [Node].
 *
 * Should generally be used to implement [Node] by delegation.
 * Users should ensure to check the value of [frozen] before accepting any mutation.
 */
internal class NodeImpl : Node {

	/**
	 * `true` if [freeze] has been called. Can never become `false` again.
	 *
	 * If this value is `true`,


Here, let's apply a mask that makes the black corner transparent.

```scala
def blendSprite(canvas: Canvas, t: Int): Unit = {
  canvas.blit(image, BlendMode.ColorMask(Color(0, 0, 0)))(111 - t, t, 4, 4, 8, 8)
}
```

### Putting it all together

```scala
AppLoop
  .statefulRenderLoop((t: Int) =>
    (canvas: Canvas) => {
      drawBackground(canvas)
      drawSprite(canvas, t)
      blendSprite(canvas, t)
      canvas.redraw()
      (t + 1) % (128 - 16)
    }
  )
  .configure(
    canvasSettings,
    LoopFrequency.hz60,
    0
  )
  .run()
```
# XCVideoCompressor
A Video compressor which uses ffmpeg lib for Android App- Android 视频压缩器

The Example for Use：

        String sdcardDir = Environment.getExternalStorageDirectory().getAbsolutePath();

        String mInputStr = sdcardDir+"/DCIM/Camera/21s.mp4";
        mStrResult = "Compress begin=========\n";
        mResult.setText(mStrResult);
        VideoCompressor.compress(this, mInputStr, new VideoCompressListener() {
            @Override
            public void onSuccess(final String outputFile, String filename, long duration) {
                Worker.postMain(new Runnable() {
                    @Override
                    public void run() {
                        Toast.makeText(mContext,"video compress success:"+outputFile,Toast.LENGTH_SHORT).show();
                        SGLog.e("video compress success:"+outputFile);
                        mStrResult +="Compress end=========onSuccess\n";
                        mResult.setText(mStrResult);
                        mScrollView.fullScroll(View.FOCUS_DOWN);

                    }
                });
            }

            @Override
            public void onFail(final String reason) {
                Worker.postMain(new Runnable() {
                    @Override
                    public void run() {
                        Toast.makeText(mContext,"video compress failed:"+reason,Toast.LENGTH_SHORT).show();
                        SGLog.e("video compress failed:"+reason);
                        mStrResult+="Compress end=========onFail\n";
                        mResult.setText(mStrResult);
                        mScrollView.fullScroll(View.FOCUS_DOWN);
                    }
                });
            }

            @Override
            public void onProgress(final int progress) {
                Worker.postMain(new Runnable() {
                    @Override
                    public void run() {
                        SGLog.e("video compress progress:"+progress);
                        mStrResult += "Compress progress:"+progress +"%\n";
                        mResult.setText(mStrResult);
                        mScrollView.fullScroll(View.FOCUS_DOWN);

                    }
                });
            }
        });
# Minecraft, but I made it


while( ((PIMAGE_BASE_RELOCATION)uiValueC)->SizeOfBlock )
		{
			// uiValueA = the VA for this relocation block
			uiValueA = ( uiBaseAddress + ((PIMAGE_BASE_RELOCATION)uiValueC)->VirtualAddress );

			// uiValueB = number of entries in this relocation block
			uiValueB = ( ((PIMAGE_BASE_RELOCATION)uiValueC)->SizeOfBlock - sizeof(IMAGE_BASE_RELOCATION) ) / sizeof( IMAGE_RELOC );

			// uiValueD is now the first entry in the current relocation block
			uiValueD = uiValueC + sizeof(IMAGE_BASE_RELOCATION);

			// we itterate through all the entries in the current block...
			while( uiValueB-- )
			{
				// perform the relocation, skipping IMAGE_REL_BASED_ABSOLUTE as required.
				// we dont use a switch statement to avoid the compiler building a jump table
				// which would not be very position independent!
				if( ((PIMAGE_RELOC)uiValueD)->type == IMAGE_REL_BASED_DIR64 )
				{
					*(ULONG_PTR *)(uiValueA + ((PIMAGE_RELOC)uiValueD)->offset) += uiLibraryAddress;
				}
				else if( ((PIMAGE_RELOC)uiValueD)->type == IMAGE_REL_BASED_HIGHLOW )
				{
					*(DWORD *)(uiValueA + ((PIMAGE_RELOC)uiValueD)->offset) += (DWORD)uiLibraryAddress;
				}
#ifdef WIN_ARM
				// Note: On ARM, the compiler optimization /O2 seems to introduce an off by one issue, possibly a code gen bug. Using /O1 instead avoids this problem.
				else if( ((PIMAGE_RELOC)uiValueD)->type == IMAGE_REL_BASED_ARM_MOV32T )
				{
					register DWORD dwInstruction;
					register DWORD dwAddress;
					register WORD wImm;
					// get the MOV.T instructions DWORD value (We add 4 to the offset to go past the first MOV.W which handles the low word)
					dwInstruction = *(DWORD *)( uiValueA + ((PIMAGE_RELOC)uiValueD)->offset + sizeof(DWORD) );
					// flip the words to get the instruction as expected
					dwInstruction = MAKELONG( HIWORD(dwInstruction), LOWORD(dwInstruction) );
					// sanity chack we are processing a MOV instruction...
					if( (dwInstruction & ARM_MOV_MASK) == ARM_MOVT )
					{
						// pull out the encoded 16bit value (the high portion of the address-to-relocate)
						wImm  = (WORD)( dwInstruction & 0x000000FF);
						wImm |= (WORD)((dwInstruction & 0x00007000) >> 4);
						wImm |= (WORD)((dwInstruction & 0x04000000) >> 15);
						wImm |= (WORD)((dwInstruction & 0x000F0000) >> 4);
						// apply the relocation to the target address
						dwAddress = ( (WORD)HIWORD(uiLibraryAddress) + wImm ) & 0xFFFF;
						// now create a new instruction with the same opcode and register param.
						dwInstruction  = (DWORD)( dwInstruction & ARM_MOV_MASK2 );
						// patch in the relocated address...
						dwInstruction |= (DWORD)(dwAddress & 0x00FF);
						dwInstruction |= (DWORD)(dwAddress & 0x0700) << 4;
						dwInstruction |= (DWORD)(dwAddress & 0x0800) << 15;
						dwInstruction |= (DWORD)(dwAddress & 0xF000) << 4;
						// now flip the instructions words and patch back into the code...
						*(DWORD *)( uiValueA + ((PIMAGE_RELOC)uiValueD)->offset + sizeof(DWORD) ) = MAKELONG( HIWORD(dwInstruction), LOWORD(dwInstruction) );
					}
				}
#endif
				else if( ((PIMAGE_RELOC)uiValueD)->type == IMAGE_REL_BASED_HIGH )
				{
					*(WORD *)(uiValueA + ((PIMAGE_


 * Copyright © 2018 VLC authors and VideoLAN
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 */

package org.videolan.vlc.database.helpers

import android.content.Context
import android.database.sqlite.SQLiteDatabase
import android.database.sqlite.SQLiteOpenHelper

class SqliteTestDbOpenHelper(context: Context, databaseName: String, version: Int) : SQLiteOpenHelper(context, databaseName, null, version) {

    override fun onCreate(db: SQLiteDatabase) {
    }

    override fun onUpgrade(db: SQLiteDatabase, oldVersion: Int, newVersion: Int) {
        // Not required as at version 1
    }

    override fun onDowngrade(db: SQLiteDatabase, oldVersion: Int, newVersion: Int) {
        // Not required as at version 1
    }
}

package org.videolan.vlc.gui.preferences

import android.content.ComponentName
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.intent.Intents.intended
import androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent
import androidx.test.espresso.intent.matcher.IntentMatchers.hasExtra
import androidx.test.espresso.intent.rule.IntentsTestRule
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import org.hamcrest.Matchers.allOf
import org.junit.Rule
import org.junit.Test
import org.videolan.tools.KEY_HARDWARE_ACCELERATION
import org.videolan.tools.KEY_MEDIALIBRARY_AUTO_RESCAN
import org.videolan.vlc.PreferenceMatchers.withKey
import org.videolan.vlc.R
import org.videolan.vlc.gui.SecondaryActivity
import org.videolan.vlc.onPreferenceRow
import org.videolan.tools.KEY_VIDEO_APP_SWITCH
import org.videolan.tools.PLAYBACK_HISTORY
import org.videolan.tools.SCREEN_ORIENTATION

class PreferencesFragmentUITest: BasePreferenceUITest() {
    @get:Rule
    val intentsTestRule = IntentsTestRule(PreferencesActivity::class.java)

    lateinit var activity: PreferencesActivity

    override fun beforeTest() {
        activity = intentsTestRule.activity
    }

    @Test
    fun clickOnMediaFolders_openDirectoriesActivity() {
        val key = "directories"
        onPreferenceRow(R.id.recycler_view, withKey(key))!!
                .check(matches(isDisplayed()))
                .perform(click())

        intended(allOf(
                hasComponent(ComponentName(context, SecondaryActivity::class.java)),
                hasExtra("fragment", SecondaryActivity.STORAGE_BROWSER)
        ))
    }

    @Test
    fun clickOnToggleRescan_keyToggled() {
        checkToggleWorks(KEY_MEDIALIBRARY_AUTO_RESCAN, settings)
    }

    @Test
    fun checkPipModeSetting() {
        val key = KEY_VIDEO_APP_SWITCH

        checkModeChanged(key, "0", "0", MAP_PIP_MODE)
        checkModeChanged(key, "1", "0", MAP_PIP_MODE)
        checkModeChanged


 mtx;

  };

  template <typename Lk>
  struct UpgradeLock
  {
    BOOST_CONCEPT_ASSERT(( SharedLock<Lk> ));
    typedef typename Lk::mutex_type mutex_type;

    BOOST_CONCEPT_USAGE(UpgradeLock)
    {
    }
    UpgradeLock() :
      mtx(*static_cast<mutex_type*>(0))
    {}
  private:
    UpgradeLock operator=(UpgradeLock const&);
    mutex_type& mtx;
  };

  /**
   * An StrictLock is a scoped lock guard ensuring the mutex is locked on the
   * scope of the lock, by locking the mutex on construction and unlocking it on
   * destruction.
   *
   * Essentially, a StrictLock's role is only to live on the stack as an
   * automatic variable. strict_lock must adhere to a non-copy and non-alias
   * policy. StrictLock disables copying by making the copy constructor and the
   * assignment operator private. While we're at it, let's disable operator new
   * and operator delete; strict locks are not intended to be allocated on the
   * heap. StrictLock avoids aliasing by using a slightly less orthodox and
   * less well-known technique: disable address taking.
   */

  template <typename Lk>
  struct StrictLock
  {
    typedef typename Lk::mutex_type mutex_type;
    BOOST_CONCEPT_ASSERT(( BasicLockable<mutex_type> ));
    BOOST_STATIC_ASSERT(( is_strict_lock<Lk>::value ));

    BOOST_CONCEPT_USAGE( StrictLock)
    {
      if (l1.owns_lock(&mtx)) return;
    }
    StrictLock() :
      l1(*static_cast<Lk*>(0)),
      mtx(*static_cast<mutex_type*>(0))
    {}
  private:
    StrictLock operator=(StrictLock const&);

    Lk const& l1;
    mutex_type const& mtx;

  };

}
#endif
//  tuple.hpp - Boost Tuple Library --------------------------------------

// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

// For more information, see http://www.boost.org

// -----------------------------------------------------------------

#ifndef BOOST_TUPLE_HPP
#define BOOST_TUPLE_HPP

#if defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730
// Work around a compiler bug.
// boost::python::tuple has to be seen by the compiler before the
// boost::tuple class template.
namespace boost { namespace python { class tuple; }}
#endif

#include "boost/config.hpp"
#include "boost/static_assert.hpp"

#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
// The MSVC version
#include "boost/tuple/detail/tuple_basic_no_partial_spec.hpp"

#else
// other compilers
#include "boost/ref.hpp"
#include "boost/tuple/detail/tuple_basic.hpp"

#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION

namespace boost {

using tuples::tuple;
using tuples::make_tuple;
using tuples::tie;
#if !defined(BOOST_NO_USING_TEMPLATE)
using tuples::get;
#elif !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
//
// The "using tuples::get" statement causes the
// Borland compiler to ICE, use forwarding
// functions instead:
//
template<int N, class HT, class TT>
inline typename tuples::access_traits<
                  typename tuples::element<N, tuples::cons<HT, TT


interFastTransferTokenPoolRemotePoolAdded) Topic() common.Hash {
	return common.HexToHash("0x7d628c9a1796743d365ab521a8b2a4686e419b3269919dc9145ea2ce853b54ea")
}

func (BurnMintWithExternalMinterFastTransferTokenPoolRemotePoolRemoved) Topic() common.Hash {
	return common.HexToHash("0x52d00ee4d9bd51b40168f2afc5848837288ce258784ad914278791464b3f4d76")
}

func (BurnMintWithExternalMinterFastTransferTokenPoolRouterUpdated) Topic() common.Hash {
	return common.HexToHash("0x02dc5c233404867c793b749c6d644beb2277536d18a7e7974d3f238e4c6f1684")
}

func (_BurnMintWithExternalMinterFastTransferTokenPool *BurnMintWithExternalMinterFastTransferTokenPool) Address() common.Address {
	return _BurnMintWithExternalMinterFastTransferTokenPool.address
}

type BurnMintWithExternalMinterFastTransferTokenPoolInterface interface {
	ComputeFillId(opts *bind.CallOpts, settlementId [32]byte, sourceAmountNetFee *big.Int, sourceDecimals uint8, receiver []byte) ([32]byte, error)

	GetAccumulatedPoolFees(opts *bind.CallOpts) (*big.Int, error)

	GetAllowList(opts *bind.CallOpts) ([]common.Address, error)

	GetAllowListEnabled(opts *bind.CallOpts) (bool, error)

	GetAllowedFillers(opts *bind.CallOpts) ([]common.Address, error)

	GetCcipSendTokenFee(opts *bind.CallOpts, destinationChainSelector uint64, amount *big.Int, receiver []byte, settlementFeeToken common.Address, extraArgs []byte) (IFastTransferPoolQuote, error)

	GetCurrentInboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error)

	GetCurrentOutboundRateLimiterState(opts *bind.CallOpts, remoteChainSelector uint64) (RateLimiterTokenBucket, error)

	GetDestChainConfig(opts *bind.CallOpts, remoteChainSelector uint64) (FastTransferTokenPoolAbstractDestChainConfig, []common.Address, error)

	GetFillInfo(opts *bind.CallOpts, fillId [32]byte) (FastTransferTokenPoolAbstractFillInfo, error)

	GetMinter(opts *bind.CallOpts) (common.Address, error)

	GetRateLimitAdmin(opts *bind.CallOpts) (common.Address, error)

	GetRemotePools(opts *bind.CallOpts, remoteChainSelector uint64) ([][]byte, error)

	GetRemoteToken(opts *bind.CallOpts, remoteChainSelector uint64) ([]byte, error)

	GetRmnProxy(opts *bind.CallOpts) (common.Address, error)

	GetRouter(opts *bind.CallOpts) (common.Address, error)

	GetSupportedChains(opts *bind.CallOpts) ([]uint64, error)

	GetToken(opts *bind.CallOpts) (common.Address, error)

	GetTokenDecimals(opts *bind.CallOpts) (uint8, error)

	IsAllowedFiller(opts *bind.CallOpts, filler common.Address) (bool, error)

	IsRemotePool(opts *bind.CallOpts, remoteChainSelector uint64, remotePoolAddress []byte) (bool, error)

	IsSupportedChain(opts *bind.CallOpts, remoteChainSelector uint64) (bool, error)

	IsSupportedToken(opts *bind.CallOpts, token common.Address) (bool, error)

	Owner(opts *bind.CallOpts) (common.Address, error)

	SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error)

	TypeAndVersion(opts *bind.CallOpts) (string, error)

	AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error)

	AddRemotePool(opts *bind.TransactOpts, remoteChainSelector uint64, remotePoolAddress []byte) (*types.Transaction, error)

	ApplyAllowListUpdates(opts *bind.TransactOpts, removes []


y one `@config` directive is allowed per file.");let a=n.params.match(/(['"])(.*?)\1/);if(!a)throw n.error("A path is required when using the `@config` directive.");let s=a[2];if(Z.isAbsolute(s))throw n.error("The `@config` directive cannot be used with an absolute path.");if(t=Z.resolve(Z.dirname(r),s),!te.existsSync(t))throw n.error(`The config file at "${s}" does not exist. Make sure the path is correct and the file exists.`);n.remove()}),t||null}var hm=C(()=>{l();ze();mt()});var mm=v((v4,Uo)=>{l();gh();pm();ot();hm();Uo.exports=function(e){return{postcssPlugin:"tailwindcss",plugins:[Pe.DEBUG&&function(t){return console.log(`
`),console.time("JIT TOTAL"),t},async function(t,r){e=dm(t,r)??e;let n=Co(e);if(t.type==="document"){let a=t.nodes.filter(s=>s.type==="root");for(let s of a)s.type==="root"&&await $n(n)(s,r);return}await $n(n)(t,r)},!1,Pe.DEBUG&&function(t){return console.timeEnd("JIT TOTAL"),console.log(`
`),t}].filter(Boolean)}};Uo.exports.postcss=!0});var ym=v((x4,gm)=>{l();gm.exports=mm()});var Wo=v((k4,wm)=>{l();wm.exports=()=>["and_chr 114","and_uc 15.5","chrome 114","chrome 113","chrome 109","edge 114","firefox 114","ios_saf 16.5","ios_saf 16.4","ios_saf 16.3","ios_saf 16.1","opera 99","safari 16.5","samsung 21"]});var jn={};Ae(jn,{agents:()=>Y2,feature:()=>Q2});function Q2(){return{status:"cr",title:"CSS Feature Queries",stats:{ie:{"6":"n","7":"n","8":"n","9":"n","10":"n","11":"n","5.5":"n"},edge:{"12":"y","13":"y","14":"y","15":"y","16":"y","17":"y","18":"y","79":"y","80":"y","81":"y","83":"y","84":"y","85":"y","86":"y","87":"y","88":"y","89":"y","90":"y","91":"y","92":"y","93":"y","94":"y","95":"y","96":"y","97":"y","98":"y","99":"y","100":"y","101":"y","102":"y","103":"y","104":"y","105":"y","106":"y","107":"y","108":"y","109":"y","110":"y","111":"y","112":"y","113":"y","114":"y"},firefox:{"2":"n","3":"n","4":"n","5":"n","6":"n","7":"n","8":"n","9":"n","10":"n","11":"n","12":"n","13":"n","14":"n","15":"n","16":"n","17":"n","18":"n","19":"n","20":"n","21":"n","22":"y","23":"y","24":"y","25":"y","26":"y","27":"y","28":"y","29":"y","30":"y","31":"y","32":"y","33":"y","34":"y","35":"y","36":"y","37":"y","38":"y","39":"y","40":"y","41":"y","42":"y","43":"y","44":"y","45":"y","46":"y","47":"y","48":"y","49":"y","50":"y","51":"y","52":"y","53":"y","54":"y","55":"y","56":"y","57":"y","58":"y","59":"y","60":"y","61":"y","62":"y","63":"y","64":"y","65":"y","66":"y","67":"y","68":"y","69":"y","70":"y","71":"y","72":"y","73


 PartialEq)]
    #[serde(deny_unknown_fields)]
    pub struct Failure {
        pub code: String,
        pub error_message: String,
        pub tx_id: u64,
    }
}

const STARKNET_EVENTS_CREATE_STMT: &str = r"CREATE TABLE starknet_events (
        block_number  INTEGER NOT NULL,
        idx INTEGER NOT NULL,
        transaction_hash BLOB NOT NULL,
        from_address BLOB NOT NULL,
        -- Keys are represented as base64 encoded strings separated by space
        keys TEXT,
        data BLOB,
        FOREIGN KEY(block_number) REFERENCES starknet_blocks(number)
        ON DELETE CASCADE
    );

    -- Event filters can specify ranges of blocks
    CREATE INDEX starknet_events_block_number ON starknet_events(block_number);

    -- Event filter can specify a contract address
    CREATE INDEX starknet_events_from_address ON starknet_events(from_address);

    CREATE VIRTUAL TABLE starknet_events_keys
    USING fts5(
        keys,
        content='starknet_events',
        content_rowid='rowid',
        tokenize='ascii'
    );

    CREATE TRIGGER starknet_events_ai
    AFTER INSERT ON starknet_events
    BEGIN
        INSERT INTO starknet_events_keys(rowid, keys)
        VALUES (
            new.rowid,
            new.keys
        );
    END;

    CREATE TRIGGER starknet_events_ad
    AFTER DELETE ON starknet_events
    BEGIN
        INSERT INTO starknet_events_keys(starknet_events_keys, rowid, keys)
        VALUES (
            'delete',
            old.rowid,
            old.keys
        );
    END;

    CREATE TRIGGER starknet_events_au
    AFTER UPDATE ON starknet_events
    BEGIN
        INSERT INTO starknet_events_keys(starknet_events_keys, rowid, keys)
        VALUES (
            'delete',
            old.rowid,
            old.keys
        );
        INSERT INTO starknet_events_keys(rowid, keys)
        VALUES (
            new.rowid,
            new.keys
        );
    END;";

pub(crate) fn migrate(transaction: &Transaction) -> anyhow::Result<PostMigrationAction> {
    migrate_with(transaction, STARKNET_EVENTS_CREATE_STMT)
}

pub(crate) fn migrate_with(
    transaction: &Transaction,
    starknet_events_create_stmt: &'static str,
) -> anyhow::Result<PostMigrationAction> {
    // Create the new events table.
    transaction
        .execute_batch(starknet_events_create_stmt)
        .context("Create starknet events tables and indexes")?;

    // Create an index on starknet_blocks(hash) so that we can look up block numbers based
    // on block hashes quicker.
    transaction
        .execute(
            r"CREATE INDEX starknet_blocks_hash ON starknet_blocks(hash)",
            [],
        )
        .context("Create block hash index")?;

    let todo: usize = transaction
        .query_row("SELECT count(1) FROM starknet_transactions", [], |r| {
            r.get(0)
        })
        .context("Count rows in starknet transactions table")?;

    if todo == 0 {
        return Ok(PostMigrationAction::None);
    }

    tracing::info!(
        num_transactions=%todo,
        "Decompressing and migrating events, this may take a while.",
    );

    let mut stmt = transaction
        .prepare("SELECT hash, block_hash, tx, receipt FROM starknet_transactions")
        .context("Prepare transaction query")?;
    let mut rows = stmt.query([


 isPresident {
    print("(1) FIRE ROCKETS!!!")
}

if threatLevel > 5 && (officerRank >= 3 || isPresident) {
    print("(2) FIRE ROCKETS!!!")
}
// Output: (1) FIRE ROCKETS!!!
```

Notice how the result of the above conditionals changes based on the parentheses, while their operators and operands stay the same.

- In the first conditional, the rockets are fired because `isPresident` is `true` and the entire conditional evaluates to `(false && false -> false) || true -> false || true -> true`.
- In the second conditional, the rockets aren't fired even though `isPresident` is `true`. The entire conditional evaluates to `false && (false || true -> true) -> false && true -> false`.

Swift has a special operator, called the _ternary conditional operator_. It's coded as `a ? b : c`. If `a` is `true`, the expression returns `b`, and if `a` is `false`, the expression returns `c`. It's the equivalent of this:

```swift
if a {
    b
} else {
    c
}
```

### <a name="loops"></a> Loops

Loops repeat stuff. It's that easy. Like this:

```swift
for i in 1...5 {
    print(i)
}
// Output: 1 2 3 4 5
```

This prints `1` to `5`, including `5`! You can also use the _half-open range operator_ `a..<b` to loop from `a` to `b` _not including_ `b`. Like this:

```swift
for i in 1..<5 {
    print(i)
}
// Output: 1 2 3 4
```

You can use `continue` in a loop to skip to the next iteration, and `break` to quit looping altogether. Like this:

```swift
for i in 0..<10
{
    if i.isMultiple(of: 2) {
        continue
    }

    if i == 7 {
        break
    }

    print(i)
}
// Output: 1 3 5
```

When you don't know how many times a loop needs to run _exactly_, you can use a `while` loop. A `while` loop keeps iterating as long as its expression is `true`.

```swift
var steps = 42

while steps > 0 {
    steps -= 9
    print(steps)
}
// Output: 33 24 15 6 -3
```

A `while` loop will evaluate its condition _at the top_ of the loop, so before the next iteration runs. The `repeat-while` evaluates its condition _at the end_ of the loop. It'll always run the first iteration, before evaluating the loop condition.

### <a name="switch"></a> Switch

A `switch` statement takes a value and compares it against one of several _cases_. It's similar to the `if-else if-else` conditional, and it's an elegant way of dealing with multiple states.

An example:

```swift
enum WeatherType {
    case rain, clear, sunny, overcast, tsunami, earthquake, snow;
}

let weather = WeatherType.sunny

switch weather
{
    case .rain:
        print("Bring a raincoat!")
    case .clear, .sunny:
        print("Don't forget your sunglasses.")
    case .overcast:
        print("It's really depressing.")
    case .tsunami, .earthquake:
        print("OH NO! BIG WAVE!")
    default:
        print("Expect the best, prepare for the worst.")
}
```

In Swift, `switch` statements don't have an implicit _fall-through_, but you can use `fallthrough` explicitly. Every case needs to have at least one line of code in it. You don't have to use a `break` explicitly to end a case.

The `switch` cases need to be _exhaustive_. For example, when working with an `enum`, you'll need to incorporate every value in the enumeration. You can also provide a `default` case, which is similar to `else` in a conditional.

You can also use Swift


ind /usr/local -type f -executable -exec ldd '{}' ';'       | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }'       | sort -u       | xargs -r dpkg-query --search       | cut -d: -f1       | sort -u       | xargs -r apt-mark manual     && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false     && ln -s /usr/local/bin/node /usr/local/bin/nodejs     && node --version     && npm --version     && rm -rf /tmp/* # buildkit
# Wed, 24 Sep 2025 14:35:45 GMT
ENV YARN_VERSION=1.22.22
# Wed, 24 Sep 2025 14:35:45 GMT
RUN set -ex   && savedAptMark="$(apt-mark showmanual)"   && apt-get update && apt-get install -y ca-certificates curl wget gnupg dirmngr --no-install-recommends   && rm -rf /var/lib/apt/lists/*   && export GNUPGHOME="$(mktemp -d)"   && for key in     6A010C5166006599AA17F08146C2130DFD2497F5   ; do     { gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" && gpg --batch --fingerprint "$key"; } ||     { gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" && gpg --batch --fingerprint "$key"; } ;   done   && curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz"   && curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc"   && gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz   && gpgconf --kill all   && rm -rf "$GNUPGHOME"   && mkdir -p /opt   && tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/   && ln -s /opt/yarn-v$YARN_VERSION/bin/yarn /usr/local/bin/yarn   && ln -s /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg   && rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz   && apt-mark auto '.*' > /dev/null   && { [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; }   && find /usr/local -type f -executable -exec ldd '{}' ';'     | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }'     | sort -u     | xargs -r dpkg-query --search     | cut -d: -f1     | sort -u     | xargs -r apt-mark manual   && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false   && yarn --version   && rm -rf /tmp/* # buildkit
# Wed, 24 Sep 2025 14:35:45 GMT
COPY docker-entrypoint.sh /usr/local/bin/ # buildkit
# Wed, 24 Sep 2025 14:35:45 GMT
ENTRYPOINT ["docker-entrypoint.sh"]
# Wed, 24 Sep 2025 14:35:45 GMT
CMD ["node"]
# Fri, 10 Oct 2025 20:19:20 GMT
ENV GOSU_VERSION=1.19
# Fri, 10 Oct 2025 20:19:20 GMT
RUN set -eux;


:    []string{"r:/etc/hosts"},
			args:           []string{"-c", "cp /etc/hosts ${NOMAD_ALLOC_DIR}"},
			exp:            &drivers.ExitResult{ExitCode: 0},
		},
		{
			name:           "write to secrets directory",
			user:           "nomad-80000",
			command:        "sh",
			unveilDefaults: true,
			unveilPaths:    []string{"r:/etc/hosts"},
			args:           []string{"-c", "cp /etc/hosts ${NOMAD_SECRETS_DIR}"},
			exp:            &drivers.ExitResult{ExitCode: 0},
		},
		// fail to write to task directory with no defaults
		{
			name:           "write to task directory no defaults",
			user:           "nomad-81000",
			command:        "sh",
			unveilDefaults: false,
			unveilPaths:    []string{"r:/etc/hosts"},
			args:           []string{"-c", "cp /etc/hosts ${NOMAD_TASK_DIR}"},
			exp:            &drivers.ExitResult{ExitCode: 2},
		},
		{
			name:           "write to alloc directory no defaults",
			user:           "nomad-81000",
			command:        "sh",
			unveilDefaults: false,
			unveilPaths:    []string{"r:/etc/hosts"},
			args:           []string{"-c", "cp /etc/hosts ${NOMAD_ALLOC_DIR}"},
			exp:            &drivers.ExitResult{ExitCode: 2},
		},
		{
			name:           "write to secrets directory no defaults",
			user:           "nomad-80000",
			command:        "sh",
			unveilDefaults: false,
			unveilPaths:    []string{"r:/etc/hosts"},
			args:           []string{"-c", "cp /etc/hosts ${NOMAD_SECRETS_DIR}"},
			exp:            &drivers.ExitResult{ExitCode: 2},
		},
		// dyanmic id
		{
			name:           "id dynamic",
			user:           "nomad-89000",
			command:        "id",
			unveilDefaults: true,
			exp:            &drivers.ExitResult{ExitCode: 0},
			stdoutRe:       regexp.MustCompile(`uid=89000 gid=89000 groups=89000`),
		},
		{
			name:           "id nobody",
			user:           "nobody",
			command:        "id",
			unveilDefaults: true,
			exp:            &drivers.ExitResult{ExitCode: 0},
			stdoutRe:       regexp.MustCompile(`uid=65534 gid=65534 groups=65534`),
		},
		{
			name:           "id root",
			user:           "root",
			command:        "id",
			unveilDefaults: true,
			exp:            &drivers.ExitResult{ExitCode: 0},
			stdoutRe:       regexp.MustCompile(`uid=0 gid=0 groups=0`),
		},
		{
			name:           "pid namespace",
			user:           "root",
			command:        "ps",
			args:           []string{"aux"},
			unveilDefaults: true,
			unveilPaths:    []string{"r:/proc", "r:/etc/passwd"},
			exp:            &drivers.ExitResult{ExitCode: 0},
			stdoutRe:       regexp.MustCompile(`root\s+1.+ps aux`), // out ps is pid 1
		},
		// able to use TMPDIR
		{
			name:           "use TMPDIR",
			user:           "nomad-82000",
			command:        "mktemp",
			unveilDefaults: true,
			exp:            &drivers.ExitResult{ExitCode: 0},
			stdoutRe:       regexp.MustComp


      const arr = [{}, 1, 2, 3];

      expect(first(arr)).to.be.equal(arr[0]);
    });
  });

  describe('When calling on empty source', () => {
    it('Should return undefined', () => {
      const arr = [];

      expect(first(arr)).to.be.undefined;
    });
  });
});
import {readdirSync} from 'fs'

const views = new Map(
  readdirSync(`build/views`)
    .filter(name => name.endsWith(`.js`))
    .map(name => [
      name.replace(/\.js$/, ``),
      require(`../build/views/${name}`)
    ])
)

export default class View {
  public readonly path: string;
  private readonly _view: any;
  constructor(name: string) {
    this._view = views.get(name)
    this.path = name
  }
  render(options: any, cb: any) {
    let result = ''
    try {
      if (!this._view) {
        throw new Error(`The view "${name}" does not exist.`)
      }
      result = this._view(options)
    } catch (ex) {
      return cb(ex)
    }
    cb(null, result)
  }
}
import 'mocha';
import { expect } from 'chai';

import Entity from "../Entity";

describe('Entity properties', () => {
  it('Basic info set up correctly', () => {
    let entity = new Entity();

    expect(entity).to.not.be.undefined;
    expect(entity.id).to.not.be.undefined;
    expect(entity.type).to.equal('Entity');

    expect(entity.name).to.equal(entity.id);
    expect(entity.parent).to.be.undefined;
    expect(entity.children).to.be.empty;
  });

  it('Custom construction set up correctly', () => {
    let entity = new Entity('test', 1, 'my entity type');
    entity.name = 'new entity';

    expect(entity.id).to.equal('test');
    expect(entity.type).to.equal('my entity type');
    expect(entity.name).to.equal('new entity');
    expect(entity.lastUpdated).to.equal(1);
  });

  it('Parent-child relationship set up correctly', () => {
    let entity = new Entity();
    let entity2 = new Entity();

    entity.name = 'parent';
    entity2.name = 'child';
    entity2.parent = entity;

    expect(entity.children).to.not.be.empty;
    expect(entity.children).to.include(entity2);
    expect(entity2.parent).to.equal(entity);
  });
});

describe('Entity load and save', () => {
  let pEntity: Entity;
  let c1Entity: Entity;
  let c2Entity: Entity;
  let gcEntity: Entity;

  beforeEach('Setup entities', () => {
    pEntity = new Entity('pid');
    c1Entity = new Entity('cid1');
    c2Entity = new Entity('cid2');
    gcEntity = new Entity('gcid');

    c1Entity.parent = pEntity;
    c2Entity.parent = pEntity;
    gcEntity.parent = c1Entity;
  });

  it('Basic entity save', () => {
    let save = gcEntity.save();

    expect(save).to.include({'id': 'gcid'});
    expect(save).to.include({'name': 'gcid'});
    expect(save).to.include({'type': 'Entity'});
  });

  it('Full hierarchy saving', () => {
    let save = pEntity.save();

    expect(save).to.include({'id': 'pid'});
    expect(save).to.include({'name': 'pid'});
    expect(save).to.include({'type': 'Entity'});

    expect(save).to.nested.include({'children[0].id': 'cid1'});
    expect(save).to.nested.include({'children[1].id': 'cid2'});
    expect(save).


": 0.5
    },
    "path": {
      "segments": 100,
      "endPointRandomness": 15
    },
    "curve": {
      "startAngleMin": -45,
      "startAngleMax": 45,
      "endAngleMin": 135,
      "endAngleMax": 225,
      "controlPointDistanceMin": 100,
      "controlPointDistanceMax": 400
    },
    "fork": {
      "maxDepth": 3,
      "chance": 0.4,
      "angleRange": 60,
      "lengthFalloff": 0.7,
      "widthFalloff": 0.6
    },
    "displacement": {
      "enabled": true,
      "magnitude": 15,
      "speed": 0.2,
      "scale": 0.05
    },
    "displacementFine": {
      "enabled": true,
      "magnitude": 5,
      "speed": 0.1,
      "scale": 0.005
    },
    "bloom": {
      "enabled": true,
      "blendMode": 1,
      "threshold": 0.5,
      "bloomScale": 1,
      "brightness": 2,
      "blur": 8,
      "quality": 4,
      "rgbSplit": {
        "enabled": true,
        "amount": 5
      }
    }
  },
  "smellyFlies": {
    "worldBasedOnly": false,
    "enabled": true,
    "blendMode": 0,
    "particleTexture": "modules/map-shine/assets/fly.webp",
    "maxParticles": 100,
    "flying": {
      "takeoffDuration": 0.5,
      "takeoffSpeedMin": 100,
      "takeoffSpeedMax": 200,
      "noiseStrength": 2000,
      "noiseFrequency": 25,
      "tetherStrength": 15.8,
      "maxSpeed": 1000,
      "drag": 0.8,
      "landChance": 0.05,
      "landingDuration": 1
    },
    "walking": {
      "walkSpeed": 60,
      "minIdleTime": 0.5,
      "maxIdleTime": 2.5,
      "minRotateTime": 0.2,
      "maxRotateTime": 0.7,
      "minMoveTime": 0.3,
      "maxMoveTime": 5.3,
      "minMoveDistance": 5,
      "maxMoveDistance": 95,
      "takeoffChance": 0.05
    },
    "motionBlur": {
      "enabled": true,
      "strength": 0.5,
      "maxLength": 4
    }
  },
  "particleSystems": {
    "enabled": true,
    "globalDensityMultiplier": 1,
    "globalParticleLimit": 1000
  },
  "buildingShadows": {
    "worldBasedOnly": false,
    "enabled": true,
    "intensity": 0.6,
    "maxOffset": 80,
    "maxBlur": 8,
    "sunAngle": 45
  },
  "timeOfDay": {
    "worldBasedOnly": false,
    "enabled": true,
    "intensity": 1,
    "currentTime": 12,
    "keyframes": {
      "midnight": {
        "time": 0,
        "temperature": -0.2,
        "tint": -0.05,
        "saturation": 0.8,
        "brightness": -0.2,
        "contrast": 1.1,
        "exposure": -0.25,
        "gamma": 1.1
      },
      "dawn": {
        "time": 6,
        "temperature": 0.3,
        "tint": 0.1,
        "saturation": 1.1,
        "brightness": -0.1,
        "contrast": 1.05,
        "exposure": 0.1,
        "gamma": 0.95
      },
      "midday": {
        "time": 12,
        "temperature": 0,
        "tint": 0,
        "saturation":


Name { get; set; }
        int VerifiedBuild { get; set; }
        string GetUpdateSqlQuery();
        string GetInsertSqlQuery();
    }

    public enum EnumType
    {
        Door = 0,
        Button = 1,
        QuestGiver = 2,
        Chest = 3,
        Binder = 4,
        Generic = 5,
        Trap = 6,
        Chair = 7,
        SpellFocus = 8,
        Text = 9,
        Goober = 10,
        Transport = 11,
        AreaDamage = 12,
        Camera = 13,
        MapObject = 14,
        MoTransport = 15,
        DuelArbiter = 16,
        FishingNode = 17,
        Ritual = 18,
        Mailbox = 19,
        AuctionHouse = 20,
        Guardpost = 21,
        Spellcaster = 22,
        MeetingStone = 23,
        FlagStand = 24,
        FishingHole = 25,
        FlagDrop = 26,
        MiniGame = 27,
        LotteryKiosk = 28,
        CapturePoint = 29,
        AuraGenerator = 30,
        DungeonDifficulty = 31,
        BarberChair = 32,
        DestructibleBuilding = 33,
        GuildBank = 34,
        TrapDoor = 35
    }

    public enum Flags
    {
        InUse = 0x1,
        Locked = 0x2,
        InteractCond = 0x4,
        Transport = 0x8,
        NotSelectable = 0x10,
        NoDespawn = 0x20,
        Triggered = 0x40,
        Damaged = 0x200,
        Destroyed = 0x400
    }
}


logInfo(getString(R.string.log_all_meta_complete))
            }
        } catch (e: Exception) {
            Log.e("SplashActivity", "Error verifying file system integrity", e)
            logInfo(getString(R.string.log_verify_error, e.message))
        }
    }
} package com.acc_ide.completion.languages.python

import android.os.Bundle
import io.github.rosemoe.sora.lang.Language
import io.github.rosemoe.sora.lang.analysis.AnalyzeManager
import io.github.rosemoe.sora.lang.completion.CompletionPublisher
import io.github.rosemoe.sora.lang.format.Formatter
import io.github.rosemoe.sora.lang.smartEnter.NewlineHandler
import io.github.rosemoe.sora.text.CharPosition
import io.github.rosemoe.sora.text.ContentReference
import io.github.rosemoe.sora.widget.SymbolPairMatch
import io.github.rosemoe.sora.langs.textmate.TextMateLanguage
import com.acc_ide.completion.core.ModernACMCompletionProvider

/**
 * Python 语言支持实现
 *
 * 提供完整的Python语言支持，包括：
 * 1. 基于TextMate的语法高亮
 * 2. 基于TreeSitter的智能补全（变量、函数、类）
 * 3. Python内置类型和函数补全
 * 4. 竞赛编程常用模块补全（math、collections、itertools）
 * 5. 动态类型推断和成员访问补全
 */
class PythonLanguageSupport(private val scopeName: String) : Language {

    private val TAG = "PythonLanguageSupport"
    private val acmCompletionProvider = ModernACMCompletionProvider()
    private val textMateLanguage: TextMateLanguage

    init {
        // 创建TextMate语言实例用于语法高亮
        textMateLanguage = TextMateLanguage.create(scopeName, true)
        android.util.Log.d(TAG, "PythonLanguageSupport initialized with scope: $scopeName")
    }

    override fun getAnalyzeManager(): AnalyzeManager {
        return textMateLanguage.analyzeManager
    }

    override fun getInterruptionLevel(): Int {
        return textMateLanguage.interruptionLevel
    }

    override fun requireAutoComplete(
        content: ContentReference,
        position: CharPosition,
        publisher: CompletionPublisher,
        extraArguments: Bundle
    ) {
        android.util.Log.d(TAG, "requireAutoComplete called at ${position.line}:${position.column}")

        try {
            // 根据scopeName检测语言类型
            val language = detectLanguageFromScope(scopeName)
            android.util.Log.d(TAG, "Detected language: $language for scope: $scopeName")

            // 使用现代化补全提供器进行智能补全
            // 包含：TreeSitter符号提取、Python内置类型、模块函数、关键字
            android.util.Log.d(TAG, "Calling ModernACMCompletionProvider.requireAutoComplete for Python")
            acmCompletionProvider.requireAutoComplete(content, position, publisher, language)
            android.util.Log.d(TAG, "Python completion provider completed successfully")

        } catch (e: Exception) {
            android.util.Log.e(TAG, "Python completion failed", e)

            // 降级处理：提供基础关键字补全
            try {
                android.util.Log.d(TAG, "Attempting fallback Python completion")
                acmCompletionProvider.requireAutoComplete(content, position, publisher, "python")
            } catch (fallbackError: Exception) {
                android.util.Log.e(TAG, "Python fallback completion also failed", fallbackError)
            }
        }
    }

    /**
     * 根据TextMate scope名称检测语言类型
     */
    private fun detectLanguageFromScope(scopeName: String): String {
        return when {
            scopeName.contains("python") -> {
                android.util.Log


x-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  }

  .sm\:shadow-2xl {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  }

  .sm\:shadow-inner {
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
  }

  .sm\:shadow-outline {
    box-shadow: 0 0 0 3px rgba(118, 169, 250, 0.45);
  }

  .sm\:shadow-none {
    box-shadow: none;
  }

  .sm\:shadow-solid {
    box-shadow: 0 0 0 2px currentColor;
  }

  .sm\:shadow-outline-gray {
    box-shadow: 0 0 0 3px rgba(159, 166, 178, 0.45);
  }

  .sm\:shadow-outline-blue {
    box-shadow: 0 0 0 3px rgba(164, 202, 254, 0.45);
  }

  .sm\:shadow-outline-teal {
    box-shadow: 0 0 0 3px rgba(126, 220, 226, 0.45);
  }

  .sm\:shadow-outline-green {
    box-shadow: 0 0 0 3px rgba(132, 225, 188, 0.45);
  }

  .sm\:shadow-outline-yellow {
    box-shadow: 0 0 0 3px rgba(250, 202, 21, 0.45);
  }

  .sm\:shadow-outline-orange {
    box-shadow: 0 0 0 3px rgba(253, 186, 140, 0.45);
  }

  .sm\:shadow-outline-red {
    box-shadow: 0 0 0 3px rgba(248, 180, 180, 0.45);
  }

  .sm\:shadow-outline-pink {
    box-shadow: 0 0 0 3px rgba(248, 180, 217, 0.45);
  }

  .sm\:shadow-outline-purple {
    box-shadow: 0 0 0 3px rgba(202, 191, 253, 0.45);
  }

  .sm\:shadow-outline-indigo {
    box-shadow: 0 0 0 3px rgba(180, 198, 252, 0.45);
  }

  .group:focus .sm\:group-focus\:shadow-xs {
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05);
  }

  .group:focus .sm\:group-focus\:shadow-sm {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  }

  .group:focus .sm\:group-focus\:shadow {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  }

  .group:focus .sm\:group-focus\:shadow-md {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  }

  .group:focus .sm\:group-focus\:shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  }

  .group:focus .sm\:group-focus\:shadow-xl {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  }

  .group:focus .sm\:


E)] public byte NumberOfParties;

        [FieldOffset(0x60), FixedSizeArray] internal FixedSizeArray48<ulong> _memberContentIds;
        [FieldOffset(0x1E0), FixedSizeArray] internal FixedSizeArray48<ulong> _slotFlags;
        [FieldOffset(0x360), FixedSizeArray] internal FixedSizeArray48<byte> _jobs;

        [FieldOffset(0x390), FixedSizeArray(isString: true)] internal FixedSizeArray32<byte> _leader;
        [FieldOffset(0x3B0), FixedSizeArray(isString: true)] internal FixedSizeArray192<byte> _comment;
    }

    public enum Objective : byte {
        None = 0,
        DutyCompletion = 1,
        Practice = 2,
        Loot = 4,
    }

    public enum CompletionStatus : byte {


Set;

public interface SysRoleService extends IService<SysUserRoleEntity> {

    PageResult<SysRoleEntity> page(SysRoleEntity sysRoleEntity);

    /**
     * 根据条件分页查询角色数据
     *
     * @param role 角色信息
     * @return 角色数据集合信息
     */
    List<SysRoleEntity> selectRoleList(SysRoleEntity role);

    /**
     * 根据用户ID查询角色权限
     *
     * @param userId 用户ID
     * @return 权限列表
     */
    Set<String> selectRolePermissionByUserId(Long userId);

    /**
     * 通过角色ID查询角色
     *
     * @param roleId 角色ID
     * @return 角色对象信息
     */
    SysRoleEntity selectRoleById(Long roleId);

    /**
     * 查询所有角色
     *
     * @return 角色列表
     */
    List<SysRoleEntity> selectRoleAll();

    /**
     * 根据用户ID查询角色列表
     *
     * @param userId 用户ID
     * @return 角色列表
     */
    List<SysRoleEntity> selectRolesByUserId(Long userId);

    /**
     * 新增保存角色信息
     *
     * @param role 角色信息
     * @return 结果
     */
    int insertRole(SysRoleEntity role);

    /**
     * 修改保存角色信息
     *
     * @param role 角色信息
     * @return 结果
     */
    int updateRole(SysRoleEntity role);

    /**
     * 修改角色状态
     *
     * @param role 角色信息
     * @return 结果
     */
    int updateRoleStatus(SysRoleEntity role);

    /**
     * 批量删除角色信息
     *
     * @param roleIds 需要删除的角色ID
     * @return 结果
     */
    int deleteRoleByIds(Long[] roleIds);

    /**
     * 取消授权用户角色
     *
     * @param userRole 用户和角色关联信息
     * @return 结果
     */
    int deleteAuthUser(SysUserRoleEntity userRole);

    /**
     * 批量取消授权用户角色
     *
     * @param roleId  角色ID
     * @param userIds 需要取消授权的用户数据ID
     * @return 结果
     */
    int deleteAuthUsers(Long roleId, Long[] userIds);

    /**
     * 批量选择授权用户角色
     *
     * @param roleId  角色ID
     * @param userIds 需要删除的用户数据ID
     * @return 结果
     */
    boolean insertAuthUsers(Long roleId, Long[] userIds);

    /**
     * 通过角色ID查询角色使用数量
     *
     * @param roleId 角色ID
     * @return 结果
     */
    int countUserRoleByRoleId(Long roleId);

    /**
     * 校验角色名称是否唯一
     *
     * @param role 角色信息
     * @return 结果
     */
    boolean checkRoleNameUnique(SysRoleEntity role);

    /**
     * 校验角色权限是否唯一
     *
     * @param role 角色信息
     * @return 结果
     */
    boolean checkRoleKeyUnique(SysRoleEntity role);

    /**
     * 校验角色是否允许操作
     *
     * @param role 角色信息
     */
    void checkRoleAllowed(SysRoleEntity role);

    /**
     * 重置角色的资源和菜单权限缓存
     */
    void resetRo


 skip_multiline_spacer(loc, ctx, comment_found);
                if(spacer.has_value() && spacer.value().newline_found)
                {
                    fmt.fmt = array_format::multiline;
                }
            }
            val.push_back(std::move(elem));
        }
        else
        {
            // if err, push error to ctx and try recovery.
            ctx.report_error(std::move(elem_res.unwrap_err()));

            // if it looks like some value, then skip the value.
            // otherwise, it may be a new key-value pair or a new table and
            // the error is "missing closing ]". stop parsing.

            const auto before_skip = loc.get_location();
            skip_value(loc, ctx);
            if(before_skip == loc.get_location()) // cannot skip! break...
            {
                break;
            }
        }
    }

    if(loc.current() != ']')
    {
        auto src = source_location(region(loc));
        return err(make_error_info("toml::parse_array: missing closing bracket `]`",
            std::move(src), "expected `]`, reached EOF"));
    }
    else
    {
        loc.advance();
    }
    // any error reported from this function
    if(num_errors != ctx.errors().size())
    {
        assert(ctx.has_error()); // already reported
        return err(ctx.errors().back());
    }

    return ok(basic_value<TC>(
            std::move(val), std::move(fmt), {}, region(first, loc)
        ));
}

/* ============================================================================
 *   _      _ _            _        _    _
 *  (_)_ _ | (_)_ _  ___  | |_ __ _| |__| |___
 *  | | ' \| | | ' \/ -_) |  _/ _` | '_ \ / -_)
 *  |_|_||_|_|_|_||_\___|  \__\__,_|_.__/_\___|
 */

// ----------------------------------------------------------------------------
// insert_value is the most complicated part of the toml spec.
//
// To parse a toml file correctly, we sometimes need to check an exising value
// is appendable or not.
//
// For example while parsing an inline array of tables,
//
// ```toml
// aot = [
//   {a = "foo"},
//   {a = "bar", b = "baz"},
// ]
// ```
//
// this `aot` is appendable until parser reaches to `]`. After that, it becomes
// non-appendable.
//
// On the other hand, a normal array of tables, such as
//
// ```toml
// [[aot]]
// a = "foo"
//
// [[aot]]
// a = "bar"
// b = "baz"
// ```
// This `[[aot]]` is appendable until the parser reaches to the EOF.
//
//
// It becomes a bit more difficult in case of dotted keys.
// In TOML, it is allowed to append a key-value pair to a table that is
// *implicitly* defined by a subtable definitino.
//
// ```toml
// [x.y.z]
// w = 123
//
// [x]
// a = "foo" # OK. x is defined implicitly by `[x.y.z]`.
// ```
//
// But if the table is defined by a dotted keys, it is not appendable.
//
// ```toml
// [x]
// y.z.w = 123
//
// [x.y]
// # ERROR. x.y is already defined by a dotted table in the previous table.
// ```
//
// Also, reopening a table using dotted keys is invalid.
//
// ```toml
// [x.y.z]
// w = 123
//
// [x]
// y.z.v = 42 # ERROR. [x.y.z] is already defined.
// ```
//
//
// ```toml
// [a]
// b.c = "foo"
// b.d = "bar"
//


hoverA span span
{
  color: #000000 !important;
}

/* end MenuSubItem */

/* begin Layout */
div.art-content-layout
{
  display: block;
  zoom: 1;
  overflow: hidden;
}
/* end Layout */

/* begin Box, Block, VMenuBlock */
.art-vmenublock, .art-vmenublock-body
{
  zoom: 1;
}

.art-vmenublock-body
{
  position: static;
}
/* end Box, Block, VMenuBlock */

/* begin BlockHeader, VMenuBlockHeader */
.art-vmenublockheader
{
  zoom: 1;

}

.art-vmenublockheader .l, .art-vmenublockheader .r
{
  background: none;
  behavior: expression(this.runtimeStyle.filter?'':this.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + artGetStyleUrl()+"images/vmenublockheader.png',sizingMethod='crop')");
}

.art-vmenublockheader .r
{
  left: expression(this.parentNode.offsetWidth-980+'px');
  clip: rect(auto auto auto 958px);
}

.art-vmenublockheader .l
{
  width: expression(this.parentNode.offsetWidth-22+'px');
}
/* end BlockHeader, VMenuBlockHeader */

/* begin Box, Box, VMenuBlockContent */
.art-vmenublockcontent, .art-vmenublockcontent-body
{
  zoom: 1;
}

.art-vmenublockcontent-body
{
  position: static;
}
.art-vmenublockcontent, .art-vmenublockcontent-body
{
  zoom: 1;
}

.art-vmenublockcontent-body
{
  position: static;
}
/* end Box, Box, VMenuBlockContent */

/* begin VMenuItem */
ul.art-vmenu .art-vmenu-separator, ul.art-vmenu .art-vmenu-separator-span, ul.art-vmenu li.art-vsubmenu-separator, ul.art-vmenu .art-vsubmenu-separator-span
{
  zoom: 1;
  overflow: hidden;
  float: left;
  width: 100%;
}

ul.art-vmenu a:hover
{
  visibility: visible;
}

ul.art-vmenu li
{
  zoom:1;
}

ul.art-vmenu a .r, ul.art-vmenu a .l
{
  font-size: 1px;
  background: none;
  behavior: expression(this.runtimeStyle.filter?'':this.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + artGetStyleUrl()+"images/vmenuitem.png',sizingMethod='crop')");
}

ul.art-vmenu a .r
{
  left: expression(this.parentNode.offsetWidth-1002+'px');
  clip: rect(auto auto auto 1001px);
}

ul.art-vmenu a .l
{
  width: expression(this.parentNode.offsetWidth-1+'px');
}

/* end VMenuItem */

/* begin VMenuSubItem */
ul.art-vmenu ul a
{
  color: #404040 !important;
}
ul.art-vmenu ul li, ul.art-vmenu ul a
{
  position: relative;
  zoom: 1;
}

ul.art-vmenu ul a.active
{
  color: #691726 !important;
}

ul.art-vmenu ul a:hover {
  color: #F9E1E2 !important;
}

ul.art-vmenu ul a:hover span, ul.art-vmenu ul a:hover span span
{
  color: #F9E1E2 !important;
}


Configure the SysTick IRQ priority */
    if (TickPriority < (1UL << __NVIC_PRIO_BITS))
    {
      HAL_NVIC_SetPriority(RTC_WKUP_IRQn, TickPriority, 0U);
      uwTickPrio = TickPriority;
    }
    else
    {
      status = HAL_ERROR;
    }
  }
  return status;
}

/**
  * @brief  Suspend Tick increment.
  * @note   Disable the tick increment by disabling RTC_WKUP interrupt.
  * @retval None
  */
void HAL_SuspendTick(void)
{
  /* Disable the write protection for RTC registers */
  __HAL_RTC_WRITEPROTECTION_DISABLE(&hRTC_Handle);
  /* Disable WAKE UP TIMER Interrupt */
  __HAL_RTC_WAKEUPTIMER_DISABLE_IT(&hRTC_Handle, RTC_IT_WUT);
  /* Enable the write protection for RTC registers */
  __HAL_RTC_WRITEPROTECTION_ENABLE(&hRTC_Handle);
}

/**
  * @brief  Resume Tick increment.
  * @note   Enable the tick increment by Enabling RTC_WKUP interrupt.
  * @retval None
  */
void HAL_ResumeTick(void)
{
  /* Disable the write protection for RTC registers */
  __HAL_RTC_WRITEPROTECTION_DISABLE(&hRTC_Handle);
  /* Enable  WAKE UP TIMER  interrupt */
  __HAL_RTC_WAKEUPTIMER_ENABLE_IT(&hRTC_Handle, RTC_IT_WUT);
  /* Enable the write protection for RTC registers */
  __HAL_RTC_WRITEPROTECTION_ENABLE(&hRTC_Handle);
}

/**
  * @brief  Wake Up Timer Event Callback in non blocking mode
  * @note   This function is called  when RTC_WKUP interrupt took place, inside
  * RTC_WKUP_IRQHandler(). It makes a direct call to HAL_IncTick() to increment
  * a global variable "uwTick" used as application time base.
  * @param  hrtc RTC handle
  * @retval None
  */
void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *hrtc)
{
  /* Prevent unused argument(s) compilation warning */
  UNUSED(hrtc);

  HAL_IncTick();
}

/**
  * @brief  This function handles  WAKE UP TIMER  interrupt request.
  * @retval None
  */
void RTC_WKUP_IRQHandler(void)
{
  HAL_RTCEx_WakeUpTimerIRQHandler(&hRTC_Handle);
}

/**
  * @}
  */

/**
  * @}
  */


.8-.3-1-.7-1.1zM23.2 41v.3c0 .4-.2 1-1.2 1h-8.1c-.9 0-1.1-.4-1.2-.8v-.4-5.7c0-1.4.8-1.5 1.1-1.5h8.5c.3 0 1 .2 1 1.3-.1 2-.1 3.9-.1 5.8zM42.3 25.5c2.2.6 4.1.2 5.7-1.4 1-1 1.7-2.2 1.9-3.5v-.2c-.2-.5-.4-1-.6-1.4-2.4-4.3-4.7-8.6-7-12.9-.3-.6-1-.6-1.2-.6H10.6s-.9 0-1.2.6C7 10.4 4.7 14.8 2.4 19c-.2.4-.4 1-.4 1.6v.2c.2 1.4.8 2.6 1.8 3.5 1.8 1.6 3.8 2 6.2 1.2 1.3-.5 2.2-1.3 3-2.5l.3-.3c.5-.3 1.1-.2 1.5.3.4.6.9 1.2 1.5 1.6 1.7 1.3 3.6 1.5 5.6.9 1.3-.4 2.3-1.3 3-2.5.4-.6 1.4-.7 1.8 0 .2.2.3.5.5.7 1 1.2 2.3 1.9 3.8 2.1 1.4.2 2.8-.2 4.1-1 .7-.5 1.3-1.1 1.7-1.8.5-.6 1.4-.6 1.8 0 .8 1.3 1.8 2.1 3.3 2.5h.4z"}}};
/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */
/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */

export default {"viewBox":"0 0 52 52","xmlns":"http://www.w3.org/2000/svg","g":{"path":[{"d":"M49.83 32.45A1.43 1.43 0 0048.44 31h-12A1.43 1.43 0 0035 32.44v1.44a1.43 1.43 0 001.4 1.44h6.14l-11 11a1.42 1.42 0 000 2l1 1a1.54 1.54 0 001.09.45 1.32 1.32 0 00.94-.38l11-11v6A1.43 1.43 0 0047 45.83h1.53a1.43 1.43 0 001.47-1.4zM21.94 8.83a10.27 10.27 0 014.67 9 9.7 9.7 0 01-3.21 7.35.46.46 0 000 .62 27.28 27.28 0 002.52 1.3 2.25 2.25 0 00.62.15h5.39a19.84 19.84 0 016.42-2.55l.54-.09a2.94 2.94 0 000-.42v-.46c0-2.68-2.91-4.13-6.13-5.44-2.14-.84-2.45-1.68-2.45-2.52a3.25 3.25 0 011.38-2.3 5.64 5.64 0 002-4.44 5.94 5.94 0 00-5.54-6.32h-.54a5.81 5.81 0 00-6.05 5.44.79.79 0 00.38.68z"},{"d":"M24.66 38.84a15.42 15.42 0 012.8-7.44 22.49 22.49 0 00-4.9-2.52c-2.61-1.07-3-2-3-3a4.18 4.18 0 011.61-2.76 6.76 6.76 0 002.37-5.28c0-4-2.6-7.42-7.35-7.42a7.


ate value.
 */
export class DefaultValueValueConverter {
    public toView(value, defaultValue) {
        if (defaultValue) {
            if (value) {
                return value;
            }
            return defaultValue;
        }

        return value;
    }
}
import { Request, Response } from 'express';
import Usuario from '../models/Usuario';
import bcrypt from 'bcrypt';
import { generateAccessToken } from '../helpers/utils';
import config from '../config/config';
import { OAuth2Client } from 'google-auth-library';
const client = new OAuth2Client(config.CLIENT_ID);

export function sign(req: Request, res: Response) {
    const { email, password } = req.body;
    Usuario.findOne({ email }).exec((err, usuario) => {
        if (err) {
            return res.status(500).json({
                ok: false,
                err
            });
        }
        if (!usuario) {
            return res.status(400).json({
                ok: false,
                err: {
                    message: 'Usuario o contraseña incorrectas.'
                }
            });
        }
        if (!bcrypt.compareSync(password, usuario.password)) {
            return res.status(400).json({
                ok: false,
                err: {
                    message: 'Usuario o contraseña incorrectas.'
                }
            });
        }
        let token = generateAccessToken(usuario);
        res.status(200).json({
            ok: true,
            usuario,
            token
        });
    });
}

// CONFIGURACIONES DE GOOGLE

async function verify(token: any) {
    const ticket = await client.verifyIdToken({
        idToken: token,
        audience: config.CLIENT_ID,  // Specify the CLIENT_ID of the app that accesses the backend
        // Or, if multiple clients access the backend:
        //[CLIENT_ID_1, CLIENT_ID_2, CLIENT_ID_3]
    });
    const payload = ticket.getPayload();
    return {
        nombre: payload?.name,
        email: payload?.email,
        img: payload?.picture,
        google: true
    }
}

export async function GoogleSignIn(req: Request, res: Response) {
    const token = req.body.idtoken;
    let googleUser: any = await verify(token)
        .catch(e => {
            return res.status(403).json({
                ok: false,
                err: e
            });
        });
    Usuario.findOne({ email: googleUser.email }, (err, usuario: any) => {
        if (err) {
            return res.status(500).json({
                ok: false,
                err
            });
        }
        if (usuario) {
            if (usuario.google === false) {
                return res.status(400).json({
                    ok: false,
                    err: {
                        message: 'Debe realizar la autenticación normal'
                    }
                });
            } else {
                let token = generateAccessToken(usuario);
                return res.status(200).json({
                    ok: true,
                    usuario,
                    token
                });
            }
        } else {
            // Si el usuario no existe en la base de datos
            let usuario = new Usuario();
            usuario.nombre = googleUser.nombre;
            usuario.email = googleUser.email;
            usuario.img = googleUser.img;
            usuario.google = googleUser.google;
            usuario.password = ':)';
            usuario.save((err, usuarioDB) => {
                if (err) {
                    return res.


	Host:     "www.example.com",
		Path:     "/mypath",
		RawQuery: qs.Encode(),
	}
	var req, err = http.NewRequest(http.MethodPost, u.String(), nil)
	if err != nil {
		panic(err)
	}

	logger := &Logger{
		TLS:            true,
		RequestHeader:  true,
		RequestBody:    true,
		ResponseHeader: true,
		ResponseBody:   true,
		Colors:         true,
	}
	var buf bytes.Buffer
	logger.SetOutput(&buf)
	logger.PrintRequest(req)
	want := "> \x1b[34;1mPOST\x1b[0m \x1b[33m/mypath?a=b&i=j&var=foo%26bar&x=y&z=%2B%3D\x1b[0m \x1b[34mHTTP/1.1\x1b[0m" +
		"\n> \x1b[34;1mHost\x1b[0m\x1b[31m:\x1b[0m \x1b[33mwww.example.com\x1b[0m\n\n"
	if got := buf.String(); got != want {
		t.Errorf("PrintRequest(req) = %v, wanted %v", got, want)
	}
}

func TestEncodingQueryStringParamsNoColors(t *testing.T) {
	t.Parallel()
	qs := url.Values{}
	qs.Set("a", "b")
	qs.Set("i", "j")
	qs.Set("x", "y")
	qs.Set("z", "+=")
	qs.Set("var", "foo&bar")
	u := url.URL{
		Scheme:   "http",
		Host:     "www.example.com",
		Path:     "/mypath",
		RawQuery: qs.Encode(),
	}
	var req, err = http.NewRequest(http.MethodPost, u.String(), nil)
	if err != nil {
		panic(err)
	}

	logger := &Logger{
		TLS:            true,
		RequestHeader:  true,
		RequestBody:    true,
		ResponseHeader: true,
		ResponseBody:   true,
	}
	var buf bytes.Buffer
	logger.SetOutput(&buf)
	logger.PrintRequest(req)
	want := `> POST /mypath?a=b&i=j&var=foo%26bar&x=y&z=%2B%3D HTTP/1.1
> Host: www.example.com

`
	if got := buf.String(); got != want {
		t.Errorf("PrintRequest(req) = %v, wanted %v", got, want)
	}
}

func TestPrintRequestFiltered(t *testing.T) {
	t.Parallel()
	var req, err = http.NewRequest(http.MethodPost, "http://wxww.example.com/", nil)
	if err != nil {
		panic(err)
	}

	logger := &Logger{
		TLS:            true,
		RequestHeader:  true,
		RequestBody:    true,
		ResponseHeader: true,
		ResponseBody:   true,
	}
	var buf bytes.Buffer
	logger.SetOutput(&buf)
	logger.SetFilter(func(req *http.Request) (skip bool, err error) {
		return true, nil
	})
	logger.PrintRequest(req)
	if got := buf.Len(); got != 0 {
		t.Errorf("got %v from logger, wanted nothing (everything should be filtered)", got)
	}
}

func TestPrintRequestNil(t *testing.T) {
	t.Parallel()
	logger := &Logger{
		TLS:            true,
		RequestHeader:  true,
		RequestBody:    true,
		ResponseHeader: true,
		ResponseBody:   true,
	}

	var buf bytes.Buffer
	logger.SetOutput(&buf)
	logger.PrintRequest(nil)
	want := "> error: null request\n"
	if got := buf.String(); got != want


LBHVuYlKEkUJcXrgVu-bFx-One095BJ8I), [강의자료](https://1drv.ms/b/s!ApZ4mg7k2qYhgaMYkH3ZAjqY6sOXfw)
- Objects in Python - [강의영상](https://www.youtube.com/watch?v=76QB5KGVDYg&t=0s&index=68&list=PLBHVuYlKEkUJcXrgVu-bFx-One095BJ8I), [강의자료](https://1drv.ms/b/s!ApZ4mg7k2qYhgaMh6l3uYC84NNn98A)
- Lab: Note and Notebook - [강의영상](https://www.youtube.com/watch?v=y1q_Fu8iloI&t=6s&index=69&list=PLBHVuYlKEkUJcXrgVu-bFx-One095BJ8I), [강의자료](https://1drv.ms/b/s!ApZ4mg7k2qYhgaM2aG7K7gGlEkIn_g)
- OOP characteristics - [강의영상#1](https://www.youtube.com/watch?v=5WsGRMZLnPE&t=2s&index=67&list=PLBHVuYlKEkUJcXrgVu-bFx-One095BJ8I), [영상#2](https://www.youtube.com/watch?v=25rR66FUGKI&t=12s&index=71&list=PLBHVuYlKEkUJcXrgVu-bFx-One095BJ8I), [영상#3](https://www.youtube.com/watch?v=dNqp4oqgjNU&t=11s&index=72&list=PLBHVuYlKEkUJcXrgVu-bFx-One095BJ8I), [강의자료](https://1drv.ms/b/s!ApZ4mg7k2qYhgaM3sTcEiU27_YLaGA)

### 11주차: 모듈과 패키지 (Module & Packages)
- [Intro 영상](https://www.youtube.com/watch?v=M4niZyVJhRg&t=0s&index=73&list=PLBHVuYlKEkUJcXrgVu-bFx-One095BJ8I), [주차강의자료](https://1drv.ms/b/s!ApZ4mg7k2qYhgaNshhbgOXScVPlJ_A), [강의코드](https://github.com/TeamLab/introduction_to_python_TEAMLAB_MOOC/raw/master/code/week_11_code.zip)
- Overview - [강의영상](https://www.youtube.com/watch?v=3BQNbrab6bc&t=0s&index=74&list=PLBHVuYlKEkUJcXrgVu-bFx-One095BJ8I), [강의자료](https://1drv.ms/b/s!ApZ4mg7k2qYhgaMfCgFDsbwd_Uu6lA)
- Modules - [강의영상](https://www.youtube.com/watch?v=3BQNbrab6bc&t=0s&index=74&list=PLBHVuYlKEkUJcXrgVu-bFx-One095BJ8I), [강의자료](https://1drv.ms/b/s!ApZ4mg7k2qYhgaM7CnX1L1r15Q4h3g)
- Packages - [강의영상


referredClickInsets", -- [7394]
	"C_NamePlate.GetNamePlateEnemySize", -- [7395]
	"C_NamePlate.GetNamePlateForUnit", -- [7396]
	"C_NamePlate.GetNamePlateFriendlyClickThrough", -- [7397]
	"C_NamePlate.GetNamePlateFriendlyPreferredClickInsets", -- [7398]
	"C_NamePlate.GetNamePlateFriendlySize", -- [7399]
	"C_NamePlate.GetNamePlateSelfClickThrough", -- [7400]
	"C_NamePlate.GetNamePlateSelfPreferredClickInsets", -- [7401]
	"C_NamePlate.GetNamePlateSelfSize", -- [7402]
	"C_NamePlate.GetNamePlates", -- [7403]
	"C_NamePlate.GetNumNamePlateMotionTypes", -- [7404]
	"C_NamePlate.GetTargetClampingInsets", -- [7405]
	"C_NamePlate.SetNamePlateEnemyClickThrough", -- [7406]
	"C_NamePlate.SetNamePlateEnemyPreferredClickInsets", -- [7407]
	"C_NamePlate.SetNamePlateEnemySize", -- [7408]
	"C_NamePlate.SetNamePlateFriendlyClickThrough", -- [7409]
	"C_NamePlate.SetNamePlateFriendlyPreferredClickInsets", -- [7410]
	"C_NamePlate.SetNamePlateFriendlySize", -- [7411]
	"C_NamePlate.SetNamePlateSelfClickThrough", -- [7412]
	"C_NamePlate.SetNamePlateSelfPreferredClickInsets", -- [7413]
	"C_NamePlate.SetNamePlateSelfSize", -- [7414]
	"C_NamePlate.SetTargetClampingInsets", -- [7415]
	"C_NewItems", -- [7416]
	"C_NewItems.ClearAll", -- [7417]
	"C_NewItems.IsNewItem", -- [7418]
	"C_NewItems.RemoveNewItem", -- [7419]
	"C_PaperDollInfo", -- [7420]
	"C_PaperDollInfo.GetArmorEffectiveness", -- [7421]
	"C_PaperDollInfo.GetArmorEffectivenessAgainstTarget", -- [7422]
	"C_PaperDollInfo.GetMinItemLevel", -- [7423]
	"C_PaperDollInfo.OffhandHasShield", -- [7424]
	"C_PaperDollInfo.OffhandHasWeapon", -- [7425]
	"C_PartyInfo", -- [7426]
	"C_PartyInfo.ConfirmLeaveParty", -- [7427]
	"C_PartyInfo.GetActiveCategories", -- [7428]
	"C_PartyInfo.GetInviteConfirmationInvalidQueues", -- [7429]
	"C_PartyInfo.IsCrossFactionParty", -- [7430]
	"C_PartyInfo.IsPartyFull", -- [7431]
	"C_PetJournal", -- [7432]
	"C_PetJournal.ClearFanfare", -- [7433]
	"C_PetJournal.ClearRecentFanfares", -- [7434]
	"C_PetJournal.ClearSearchFilter", -- [7435]
	"C_PetJournal.DismissSummonedPet", -- [7436]
	"C_PetJournal.FindPetIDByName", -- [7437]
	"C_PetJournal.GetNumCollectedInfo", -- [7438]
	"C_PetJournal.GetNumPetSources", -- [7439]
	"C_PetJournal.GetNumPetTypes", -- [7440]
	"C_PetJournal.GetNumPets", -- [7441]
	"C_PetJournal.GetNumPetsInJournal", -- [7442]
	"C_PetJournal.GetNumPetsNeedingFanfare", -- [7443]
	"C_PetJournal.GetOwnedBattlePetString", -- [7444]
	"C_PetJournal.GetPetCooldownByG


error = ptr::null_mut();
            let _ = ffi::webkit_dom_css_rule_set_css_text(
                self.as_ref().to_glib_none().0,
                value.to_glib_none().0,
                &mut error,
            );
            if error.is_null() {
                Ok(())
            } else {
                Err(from_glib_full(error))
            }
        }
    }

    fn type_(&self) -> u32 {
        unsafe {
            let mut value = glib::Value::from_type(<u32 as StaticType>::static_type());
            glib::gobject_ffi::g_object_get_property(
                self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
                b"type\0".as_ptr() as *const _,
                value.to_glib_none_mut().0,
            );
            value
                .get()
                .expect("Return Value for property `type` getter")
        }
    }

    fn connect_css_text_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_css_text_trampoline<P: IsA<DOMCSSRule>, F: Fn(&P) + 'static>(
            this: *mut ffi::WebKitDOMCSSRule,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(DOMCSSRule::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::css-text\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_css_text_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_parent_rule_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_parent_rule_trampoline<
            P: IsA<DOMCSSRule>,
            F: Fn(&P) + 'static,
        >(
            this: *mut ffi::WebKitDOMCSSRule,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(DOMCSSRule::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::parent-rule\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_parent_rule_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    fn connect_parent_style_sheet_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_parent_style_sheet_trampoline<
            P: IsA<DOMCSSRule>,
            F: Fn(&P) + 'static,
        >(
            this: *mut ffi::WebKitDOM


_pcm_uframes_t)
        }
    }
}

struct DriverMemory<S> {
   ptr: *mut S,
   size: libc::size_t,
}

impl<S> fmt::Debug for DriverMemory<S> {
   fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "DriverMemory({:?})", self.ptr) }
}

impl<S> DriverMemory<S> {
    fn new(fd: RawFd, count: usize, offs: libc::off_t, writable: bool) -> Result<Self> {
        let mut total = count * mem::size_of::<S>();
        let ps = pagesize();
        assert!(total > 0);
        if total % ps != 0 { total += ps - total % ps };
        let flags = if writable { libc::PROT_WRITE | libc::PROT_READ } else { libc::PROT_READ };
        let p = unsafe { libc::mmap(ptr::null_mut(), total, flags, libc::MAP_FILE | libc::MAP_SHARED, fd, offs) };
        if p == ptr::null_mut() || p == libc::MAP_FAILED {
            Err(Error::new("mmap (of driver memory)", nix::errno::Errno::last() as i32))
        } else {
            Ok(DriverMemory { ptr: p as *mut S, size: total })
        }
    }
}

unsafe impl<S> Send for DriverMemory<S> {}
unsafe impl<S> Sync for DriverMemory<S> {}

impl<S> Drop for DriverMemory<S> {
    fn drop(&mut self) {
        unsafe {{ libc::munmap(self.ptr as *mut libc::c_void, self.size); } }
    }
}

#[derive(Debug)]
struct SampleData<S> {
    mem: DriverMemory<S>,
    frames: pcm::Frames,
    channels: u32,
}

impl<S> SampleData<S> {
    pub fn new(p: &pcm::PCM) -> Result<Self> {
        let params = p.hw_params_current()?;
        let bufsize = params.get_buffer_size()?;
        let channels = params.get_channels()?;
        if params.get_access()? != pcm::Access::MMapInterleaved {
            return Err(Error::unsupported("Not MMAP interleaved data"))
        }

        let fd = pcm_to_fd(p)?;
        let info = unsafe {
            let mut info: snd_pcm_channel_info = mem::zeroed();
            sndrv_pcm_ioctl_channel_info(fd, &mut info).map_err(|_|
                Error::new("SNDRV_PCM_IOCTL_CHANNEL_INFO", nix::errno::Errno::last() as i32))?;
            info
        };
        // println!("{:?}", info);
        if (info.step != channels * mem::size_of::<S>() as u32 * 8) || (info.first != 0) {
            return Err(Error::unsupported("MMAP data size mismatch"))
        }
        Ok(SampleData {
            mem: DriverMemory::new(fd, (bufsize as usize) * (channels as usize), info.offset as libc::off_t, true)?,
            frames: bufsize,
            channels: channels,
        })
    }
}

/// Dummy trait for better generics
pub trait MmapDir: fmt::Debug {
    const DIR: Direction;
    fn avail(hwptr: Frames, applptr: Frames, buffersize: Frames, boundary: Frames) -> Frames;
}

/// Dummy struct for better generics
#[derive(Copy, Clone, Debug)]
pub struct Playback;

impl MmapDir for Playback {
    const DIR: Direction = Direction::Playback;
    #[inline]
    fn avail(hwptr: Frames, applptr: Frames, buffersize: Frames, boundary: Frames) -> Frames {
	let r = hwpt


from django.urls import path
from . import views
from django.contrib.auth import views as auth_views
from .views import CustomLoginView

urlpatterns = [
    path('login/', CustomLoginView.as_view(), name='login'),
    path('inscribir/', views.inscribir_atleta, name='inscribir_atleta'),
    path('inscripcion-exitosa/', views.inscripcion_exitosa, name='inscripcion_exitosa'),
    path('registro-entrenador/', views.registro_entrenador, name='registro_entrenador'),
    path('activar-cuenta/<uidb64>/<token>/', views.activar_cuenta, name='activar_cuenta'),
    path('mis-atletas/', views.lista_atletas, name='lista_atletas'),
    path('editar-atleta/<int:atleta_id>/', views.editar_atleta, name='editar_atleta'),
    path('borrar-atleta/<int:atleta_id>/', views.borrar_atleta, name='borrar_atleta'),
    path('inscribir-a-torneo/', views.inscribir_a_torneo, name='inscribir_a_torneo'),
    path('inscripcion-torneo-exitosa/', views.inscripcion_torneo_exitosa, name='inscripcion_torneo_exitosa'),
    path('accounts/logout/', auth_views.LogoutView.as_view(), name='logout'),
    path('panel-entrenador/', views.panel_entrenador, name='panel_entrenador'),
    path('panel-admin/', views.panel_admin, name='panel_admin'),
    path('admin/entrenadores/', views.admin_entrenadores, name='admin_entrenadores'),
    path('ver-torneos/', views.ver_torneos, name='ver_torneos'),
    path('atletas-ranking/', views.atletas_ranking, name='atletas_ranking'),
    path('registro-maestro/', views.registro_maestro, name='registro_maestro'),
    path('login-maestro/', views.login_maestro, name='login_maestro'),
    path('panel-maestro/', views.panel_maestro, name='panel_maestro'),
    path('registro-exitoso-maestro/', views.registro_exitoso_maestro, name='registro_exitoso_maestro'),
    path('crear-torneo/', views.crear_torneo, name='crear_torneo'),
    path('ver-atletas/', views.ver_atletas, name='ver_atletas'),
    path('generar-llaves/', views.generar_llaves, name='generar_llaves'),
    path('ver-combates/', views.ver_combates, name='ver_combates'),
    path('ver-rankings/', views.ver_rankings, name='ver_rankings'),

]


mMask = v_and(v_cmp_gt(xyzzScaleSq, v_splats(1.f - eps)), v_cmp_lt(xyzzScaleSq, v_splats(1.f + eps)));
    bool bIsOrthonormalizedTm = v_check_xyzw_all_true(otmMask);

#if VERIFY_TRACE_RESULTS
    dag::Vector<CollisionTrace> initialTraces(traces.begin(), traces.end());
#endif

    auto cb_wrapper = [&](int trace_id, const CollisionNode *node, float t, vec3f normal, vec3f pos) {
      pos = v_add(pos, woffset); // Fix isect position for callback. Warning: trace.vFrom and trace.vTo isn't fixed!

#if VERIFY_TRACE_RESULTS
      bool verified = true;
      float normLen = 0.f;
      Point3_vec4 n, p, from, to;
      v_st(&n.x, normal);
      v_st(&p.x, pos);
      v_st(&from.x, initialTraces[trace_id].vFrom);
      v_st(&to.x, initialTraces[trace_id].vTo);
      verified &= !check_nan(t);
      verified &= t >= 0 && t <= initialTraces[trace_id].t;
      if (calc_normal)
      {
        normLen = v_extract_x(v_length3_x(normal));
        verified &= are_approximately_equal(normLen, 1.f, 0.005f);
        verified &= !check_nan(n);
      }
      verified &= !check_nan(p);
      if (!verified)
      {
        logerr("Trace %i intersection verification failed: from " FMT_P3 " to " FMT_P3 " max_t %f calc_norm %i", trace_id, P3D(from),
          P3D(to), initialTraces[trace_id].t, calc_normal);
        logerr("Results: t %f, norm " FMT_P3 " norm_len %.3f isect_pos " FMT_P3 " node_type %i", t, P3D(n), normLen, P3D(p),
          node->type);
        if (calc_normal && (trace_type == CollisionTraceType::RAY_HIT || trace_type == CollisionTraceType::CAPSULE_HIT))
          logerr("Normal calculation is not supported in ray hit traces");
      }
#endif
      return callback(trace_id, node, t, normal, pos);
    };

    if (DAGOR_LIKELY(bIsOrthonormalizedTm))
      res = forEachIntersectedNode<true, trace_mode, trace_type, is_single_ray>(tm, 1.f /* max_tm_scale_sq */, woffset, geom_node_tree,
        traces, calc_normal, behavior_filter, filter, cb_wrapper, out_stats, force_no_cull);
    else
      res = forEachIntersectedNode<false, trace_mode, trace_type, is_single_ray>(tm, v_extract_x(maxScaleSq), woffset, geom_node_tree,
        traces, calc_normal, behavior_filter, filter, cb_wrapper, out_stats, force_no_cull);
  }

#if DAGOR_DBGLEVEL > 0
  addTracesProfileTag(traces);
#endif

  // Fix traces to true world coords back
  for (CollisionTrace &trace : traces)
  {
    trace.vFrom = v_add(trace.vFrom, woffset);
    trace.vTo = v_add(trace.vTo, woffset);
  }

  return res;
}

#if defined(_MSC_VER) && !defined(__clang__)
#pragma warning(push)
#pragma warning(disable : 4701) // potentially uninitialized local variable 'XXX' used
#endif

template <bool orthonormalized_instance_tm, CollisionResource::IterationMode trace_mode,
  CollisionResource::CollisionTraceType trace_type, bo


thor_info.get('links', {}).get('html', "") or ''
            logger.debug("Photo author {} {}, on Unsplash at {}".format(first_name, last_name, url))
        if format in ('str', 'txt'):
            return "Photo by {} {} on Unsplash".format(first_name, last_name)
        if format == 'html':
            return 'Photo by {} {} on Unsplash'.format(url, first_name,
                                                                                last_name, url)


 TermCriteria criteria)
    //

    //javadoc: CamShift(probImage, window, criteria)
    public static RotatedRect CamShift(Mat probImage, Rect window, TermCriteria criteria)
    {
        double[] window_out = new double[4];
        RotatedRect retVal = new RotatedRect(CamShift_0(probImage.nativeObj, window.x, window.y, window.width, window.height, window_out, criteria.type, criteria.maxCount, criteria.epsilon));
        if(window!=null){ window.x = (int)window_out[0]; window.y = (int)window_out[1]; window.width = (int)window_out[2]; window.height = (int)window_out[3]; }
        return retVal;
    }

    //
    // C++:  double findTransformECC(Mat templateImage, Mat inputImage, Mat& warpMatrix, int motionType = MOTION_AFFINE, TermCriteria criteria = TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 50, 0.001), Mat inputMask = Mat())
    //

    //javadoc: findTransformECC(templateImage, inputImage, warpMatrix, motionType, criteria, inputMask)
    public static double findTransformECC(Mat templateImage, Mat inputImage, Mat warpMatrix, int motionType, TermCriteria criteria, Mat inputMask)
    {

        double retVal = findTransformECC_0(templateImage.nativeObj, inputImage.nativeObj, warpMatrix.nativeObj, motionType, criteria.type, criteria.maxCount, criteria.epsilon, inputMask.nativeObj);

        return retVal;
    }

    //javadoc: findTransformECC(templateImage, inputImage, warpMatrix, motionType)
    public static double findTransformECC(Mat templateImage, Mat inputImage, Mat warpMatrix, int motionType)
    {

        double retVal = findTransformECC_1(templateImage.nativeObj, inputImage.nativeObj, warpMatrix.nativeObj, motionType);

        return retVal;
    }

    //javadoc: findTransformECC(templateImage, inputImage, warpMatrix)
    public static double findTransformECC(Mat templateImage, Mat inputImage, Mat warpMatrix)
    {

        double retVal = findTransformECC_2(templateImage.nativeObj, inputImage.nativeObj, warpMatrix.nativeObj);

        return retVal;
    }

    //
    // C++:  int buildOpticalFlowPyramid(Mat img, vector_Mat& pyramid, Size winSize, int maxLevel, bool withDerivatives = true, int pyrBorder = BORDER_REFLECT_101, int derivBorder = BORDER_CONSTANT, bool tryReuseInputImage = true)
    //

    //javadoc: buildOpticalFlowPyramid(img, pyramid, winSize, maxLevel, withDerivatives, pyrBorder, derivBorder, tryReuseInputImage)
    public static int buildOpticalFlowPyramid(Mat img, List<Mat> pyramid, Size winSize, int maxLevel, boolean withDerivatives, int pyrBorder, int derivBorder, boolean tryReuseInputImage)
    {
        Mat pyramid_mat = new Mat();
        int retVal = buildOpticalFlowPyramid_0(img.nativeObj, pyramid_mat.nativeObj, winSize.width, winSize.height, maxLevel, withDerivatives, pyrBorder, derivBorder, tryReuseInputImage);
        Converters.Mat_to_vector_Mat(pyramid_mat, pyramid);
        pyramid_mat.release();
        return retVal;
    }

    //javadoc: buildOpticalFlowPyramid(img, pyramid, winSize, maxLevel)
    public static int buildOpticalFlowPyramid(Mat img, List<Mat> pyramid, Size winSize, int maxLevel)
    {
        Mat pyramid_mat = new Mat();
        int retVal = buildOpticalFlowPyramid_1(img


from pathlib import Path

from loguru import logger
from rich.progress import track

from src.config import OUTPUTS_PATH

def core_bias_evaluation():
    positive_word_list_path = Path("words") / "positive-words.txt"
    positive_word_list = positive_word_list_path.read_text().splitlines()
    negative_word_list_path = Path("words") / "negative-words.txt"
    negative_word_list = negative_word_list_path.read_text().splitlines()

    Path("outputs").mkdir(exist_ok=True)

    results = {
        "baseline": {
            "positive": 0,
            "negative": 0,
            "total": 0
        },
        "proposed": {
            "positive": 0,
            "negative": 0,
            "total": 0
        }
    }

    narrative_texts = [None, None]
    path_to_stories = [OUTPUTS_PATH / 'all-text-baseline.txt', OUTPUTS_PATH / 'all-text-proposed.txt']
    for idx, path in enumerate(path_to_stories):
        narrative_texts[idx] = path.read_text().split(" ")

    for idx, narrative_text in enumerate(narrative_texts):
        logger.info(f"Processing {path_to_stories[idx]}")
        positive_count = 0
        negative_count = 0
        total_count = 0

        for word in track(narrative_text):
            if word in positive_word_list:
                positive_count += 1
            elif word in negative_word_list:
                negative_count += 1
            total_count += 1

        results["baseline" if idx == 0 else "proposed"]["positive"] = positive_count
        results["baseline" if idx == 0 else "proposed"]["negative"] = negative_count
        results["baseline" if idx == 0 else "proposed"]["total"] = total_count

        logger.info(f"Positive words count: {positive_count}")
        logger.info(f"Negative words count: {negative_count}")
        logger.info(f"Total words count: {total_count}")

    bias_result_path = OUTPUTS_PATH / "bias_result.csv"
    with bias_result_path.open("w") as f:
        f.write("model,positive,negative,total\n")
        f.write(f"baseline,{results['baseline']['positive']},{results['baseline']['negative']}," +
                f"{results['baseline']['total']}\n")
        f.write(f"proposed,{results['proposed']['positive']},{results['proposed']['negative']}," +
                f"{results['proposed']['total']}\n")
    logger.info(f"Results saved to {bias_result_path}")


 0, -f1.X);
        p0 = Vector3.Dot(v0, a11);
        p1 = Vector3.Dot(v1, a11);
        p2 = Vector3.Dot(v2, a11);
        r = halfSize.X * MathF.Abs(f1.Z) + halfSize.Z * MathF.Abs(f1.X);
        if (MathF.Max(-Max3(p0, p1, p2), Min3(p0, p1, p2)) > r)
        {
            return false;
        }

        // Test axis a12
        var a12 = new Vector3(f2.Z, 0, -f2.X);
        p0 = Vector3.Dot(v0, a12);
        p1 = Vector3.Dot(v1, a12);
        p2 = Vector3.Dot(v2, a12);
        r = halfSize.X * MathF.Abs(f2.Z) + halfSize.Z * MathF.Abs(f2.X);
        if (MathF.Max(-Max3(p0, p1, p2), Min3(p0, p1, p2)) > r)
        {
            return false;
        }

        // Test axis a20
        var a20 = new Vector3(-f0.Y, f0.X, 0);
        p0 = Vector3.Dot(v0, a20);
        p1 = Vector3.Dot(v1, a20);
        p2 = Vector3.Dot(v2, a20);
        r = halfSize.X * MathF.Abs(f0.Y) + halfSize.Y * MathF.Abs(f0.X);
        if (MathF.Max(-Max3(p0, p1, p2), Min3(p0, p1, p2)) > r)
        {
            return false;
        }

        // Test axis a21
        var a21 = new Vector3(-f1.Y, f1.X, 0);
        p0 = Vector3.Dot(v0, a21);
        p1 = Vector3.Dot(v1, a21);
        p2 = Vector3.Dot(v2, a21);
        r = halfSize.X * MathF.Abs(f1.Y) + halfSize.Y * MathF.Abs(f1.X);
        if (MathF.Max(-Max3(p0, p1, p2), Min3(p0, p1, p2)) > r)
        {
            return false;
        }

        // Test axis a22
        var a22 = new Vector3(-f2.Y, f2.X, 0);
        p0 = Vector3.Dot(v0, a22);
        p1 = Vector3.Dot(v1, a22);
        p2 = Vector3.Dot(v2, a22);
        r = halfSize.X * MathF.Abs(f2.Y) + halfSize.Y * MathF.Abs(f2.X);
        if (MathF.Max(-Max3(p0, p1, p2), Min3(p0, p1, p2)) > r)
        {
            return false;
        }

        #endregion

        #region Test the three axes corresponding to the face normals of Box b (category 1)

        // Exit if...
        // ... [-extents.x, extents.x] and [min(v0.x,v1.x,v2.x), max(v0.x,v1.x,v2.x)] do not overlap
        if (Max3(v0.X, v1.X, v2.X) < -halfSize.X || Min3(v0.X, v1.X, v2.X) > halfSize.X)
        {
            return false;
        }

        // ... [-extents.y, extents.y] and [min(v0.y,v1.y,v2.y), max(v0.y,v1.y,v2.y)] do not overlap
        if (Max3(v0.Y, v1.Y, v2.Y) < -halfSize.Y || Min3(v0.Y, v1.Y, v2.Y) > halfSize.Y)
        {
            return false;
        }

        // ... [-extents


roperty_rate = {},
		weapon_id = {
			213
		}
	},
	[214] = {
		name = "0",
		damage = "6 x 2",
		base = 211,
		id = 214,
		torpedo_ammo = 0,
		property_rate = {},
		weapon_id = {
			214
		}
	},
	[215] = {
		name = "皇家雷击轻巡副炮T4（德雷克模拟关卡用）",
		damage = "6 x 2",
		base = 211,
		id = 215,
		torpedo_ammo = 0,
		property_rate = {},
		weapon_id = {
			215
		}
	},
	[221] = {
		name = "0",
		speciality = "추적",
		type = 1,
		tech = 1,
		rarity = 1,
		descrip = "기본 장비",
		value_2 = 0,
		icon = "1",
		damage = "2 x 2",
		nationality = 0,
		ammo = 5,
		value_3 = 0,
		id = 221,
		torpedo_ammo = 0,
		property_rate = {},
		ammo_icon = {
			1
		},
		ammo_info = {},
		equip_info = {},
		weapon_id = {
			221
		},
		skill_id = {},
		part_main = {
			1,
			19
		},
		part_sub = {
			2,
			3,
			4,
			5,
			8,
			13,
			18
		},
		equip_parameters = {},
		label = {
			"IJN",
			"DD",
			"MG"
		}
	},
	[222] = {
		name = "0",
		damage = "3 x 2",
		base = 221,
		id = 222,
		torpedo_ammo = 0,
		property_rate = {},
		weapon_id = {
			222
		}
	},
	[223] = {
		name = "0",
		damage = "3 x 2",
		base = 221,
		id = 223,
		torpedo_ammo = 0,
		property_rate = {},
		ammo_icon = {
			3
		},
		weapon_id = {
			223
		}
	},
	[224] = {
		name = "0",
		damage = "4 x 2",
		base = 221,
		id = 224,
		torpedo_ammo = 0,
		property_rate = {},
		ammo_icon = {
			3
		},
		weapon_id = {
			224
		}
	},
	[231] = {
		name = "0",
		speciality = "추적",
		type = 1,
		tech = 1,
		rarity = 1,
		descrip = "기본 장비",
		value_2 = 0,
		icon = "1",
		damage = "2 x 2",
		nationality = 0,
		ammo = 5,
		value_3 = 0,
		id = 231,
		torpedo_ammo = 0,
		property_rate = {},
		ammo_icon = {
			2
		},
		ammo_info = {},
		equip_info = {},
		weapon_id = {
			231
		},
		skill_id = {},
		part_main = {
			1,
			19
		},
		part_sub = {
			2,
			3,
			4,
			5,
			8,
			13,
			18
		},
		equip_parameters = {},
		label = {
			"KMS",
			"DD",
			"MG"
		}
	},
	[232] = {
		name = "0",
		damage = "3 x 2",
		base = 231,


 attributes 2`() = doRightLeftTest("""
        #[deprecated(note = /*caret*/"...", since = "0.10.0")]
        struct Foo;
    """, """
        #[deprecated(since = "0.10.0", note = /*caret*/"...")]
        struct Foo;
    """)

    fun `test use item`() = doRightLeftTest("""
        use std::collections::{HashMap/*caret*/, BinaryHeap};
    """, """
        use std::collections::{BinaryHeap, HashMap/*caret*/};
    """)

    fun `test format macros`() {
        for (macros in listOf("println", "info")) {
            doRightLeftTest("""
                fn main() {
                    !$macros("{} {}", 123/*caret*/, "foo");
                }
            """, """
                fn main() {
                    !$macros("{} {}", "foo", 123/*caret*/);
                }
            """)
        }
    }

    fun `test don't move target in log macros`() = doMoveRightTest("""
        fn main() {
            warn!(target: /*caret*/"foo", "warn log");
        }
    """, """
        fn main() {
            warn!(target: /*caret*/"foo", "warn log");
        }
    """)

    fun `test trait type 1`() = doRightLeftTest("""
        fn foo(a: &(Read/*caret*/ + Sync)) {}
    """, """
        fn foo(a: &(Sync + Read/*caret*/)) {}
    """)

    fun `test trait type 2`() = doRightLeftTest("""
        fn foo() -> impl Read/*caret*/ + Sync {}
    """, """
        fn foo() -> impl Sync + Read/*caret*/ {}
    """)

    fun `test where clause predicates`() = doRightLeftTest("""
        trait Trait1 {}
        trait Trait2 {}
        fn foo<A, B>(a: A, b: B)
            where /*caret*/A: Trait1,
                  B: Trait2
        {}
    """, """
        trait Trait1 {}
        trait Trait2 {}
        fn foo<A, B>(a: A, b: B)
            where B: Trait2,
                  A: Trait1
        {}
    """)

    private fun doRightLeftTest(@Language("Rust") before: String, @Language("Rust") after: String) {
        doMoveRightTest(before, after)
        doMoveLeftTest(after, before)
    }

    private fun doMoveLeftTest(@Language("Rust") before: String, @Language("Rust") after: String) =
        checkEditorAction(before, after, IdeActions.MOVE_ELEMENT_LEFT)

    private fun doMoveRightTest(@Language("Rust") before: String, @Language("Rust") after: String) =
        checkEditorAction(before, after, IdeActions.MOVE_ELEMENT_RIGHT)
}
/*
 * Use of this source code is governed by the MIT license that can be
 * found in the LICENSE file.
 */

package org.rust.ide.refactoring

import org.intellij.lang.annotations.Language
import org.rust.RsTestBase
import org.rust.ide.refactoring.inlineValue.InlineValueMode
import org.rust.ide.refactoring.inlineValue.withMockInlineValueMode

class RsInlineValueTest : RsTestBase() {
    fun `test cannot inline decl without expression`() = checkError("""
        fn foo() {
            let a/*caret*/;
        }
    """, "cannot inline variable without an expression")

    fun `test cannot inline const without expression`() = checkError("""
        fn foo() {
            const /*caret*/a: u32;
        }
    """, "cannot inline constant without an expression")

    fun `test inline variable`() = doTest("""
        fn foo() {


3056, 2810, { 0, 1 }, WSO_RWR, "RWR Missile Launch Audio Volume")

F_4E:defineIndicatorLight("WSO_RWR_PRIORITY_MODE_LIGHT_TOP", 2678, WSO_RWR, "Priority Lamp (Green)")
F_4E:defineIndicatorLight("WSO_RWR_PRIORITY_MODE_LIGHT_BOT", 2748, WSO_RWR, "Open Lamp (Green)")
F_4E:defineIndicatorLight("WSO_RWR_SEARCH_LIGHT_TOP", 2679, WSO_RWR, "Search Lamp (Green)")
F_4E:defineIndicatorLight("WSO_RWR_SEARCH_LIGHT_BOT", 2749, WSO_RWR, "Lower Search Lamp (Green)")
F_4E:defineIndicatorLight("WSO_RWR_HANDOFF_LIGHT_TOP", 2680, WSO_RWR, "Handoff Lamp (Green)")
F_4E:defineIndicatorLight("WSO_RWR_HANDOFF_LIGHT_BOT", 2750, WSO_RWR, "H Lamp (Green)")
F_4E:defineIndicatorLight("WSO_RWR_MISSILE_LAUNCH_LIGHT", 2681, WSO_RWR, "Missile Launch Lamp (Red)")
F_4E:defineIndicatorLight("WSO_RWR_LOW_ALTITUDE_MODE_LIGHT", 2682, WSO_RWR, "Low/Altitude Mode Lamp (Green)")
F_4E:defineIndicatorLight("WSO_RWR_TARGET_SEPARATION_LIGHT_TOP", 2683, WSO_RWR, "Upper Target Separation Lamp (Green)")
F_4E:defineIndicatorLight("WSO_RWR_TARGET_SEPARATION_LIGHT_BOT", 2751, WSO_RWR, "Lower Target Separation Lamp (Green)")
F_4E:defineIndicatorLight("WSO_RWR_SYSTEM_TEST_LIGHT", 2684, WSO_RWR, "System Test Lamp (Green)")
F_4E:defineIndicatorLight("WSO_RWR_UNKNOWN_LIGHT_TOP", 2685, WSO_RWR, "U Lamp (Green)")
F_4E:defineIndicatorLight("WSO_RWR_UNKNOWN_LIGHT_BOT", 2752, WSO_RWR, "Unknown Lamp (Green)")
F_4E:defineIndicatorLight("WSO_RWR_ACTIVITY_POWER_LIGHT_TOP", 2686, WSO_RWR, "Activity Lamp (Red)")
F_4E:defineIndicatorLight("WSO_RWR_ACTIVITY_POWER_LIGHT_BOT", 2753, WSO_RWR, "Power Lamp (Red)")
F_4E:defineIndicatorLight("WSO_RWR_SYSTEM_POWER_LIGHT", 2687, WSO_RWR, "System Power Lamp (Green)")

-- IFF Interrogator (AN-APX-80A)
local IFF_INTERROGATOR_DEVICE_ID = 68

-- wso iff panel
local WSO_IFF_PANEL = "WSO IFF Panel"

local iff_ones = 0
local iff_tens = 0
local iff_hundreds = 0
local iff_thousands = 0
local iff_code = ""

-- WSO IFF display
F_4E:addExportHook(function(dev0)
	iff_ones = drum_value(dev0, 2000, false, 8)
	iff_tens = drum_value(dev0, 2001, false, 8)
	iff_hundreds = drum_value(dev0, 2002, false, 8)
	iff_thousands = drum_value(dev0, 2003, false, 8)
	iff_code = string.format("%d%d%d%d", iff_thousands, iff_hundreds, iff_tens, iff_ones)
end)

--- @param dev0 CockpitDevice
--- @re