text:
require "feidee_utils/mixins/parent_and_path"
require 'minitest/autorun'

class FeideeUtils::Mixins::ParentAndPathTest < MiniTest::Test
  class TestClass
    include FeideeUtils::Mixins::ParentAndPath

    attr_accessor :raw_path, :depth, :parent_poid, :poid

    class << self
      @instances = {}
      attr_accessor :instances

      def find_by_id id
        return @instances[id]
      end
    end
  end

  def setup
    @child = TestClass.new
    @child.poid = 2
    @child.raw_path = "/1/2"
    @child.parent_poid = 1

    @parent = TestClass.new
    @parent.poid = 1
    @parent.raw_path = "/1"
    @parent.parent_poid = 0

    @other = TestClass.new
    @other.poid = 3
    @other.raw_path = "/3"
    @other.parent_poid = 0

    TestClass.instances = { 1 => @parent, 2 => @child, 3 => @other }
  end

  def test_validate_depth_integrity_errors
    @child.depth = 0
    assert_raises FeideeUtils::Mixins::ParentAndPath::InconsistentDepthException do
      @child.validate_depth_integrity
    end
  end

  def test_validate_depth_integrity
    @child.depth = 1
    @child.validate_depth_integrity
  end

  def test_path
    assert_equal [1, 2], @child.path
    assert_equal [1], @parent.path
  end

  def test_validate_path_integrity_hard_errors
    # Trace is longer.
    @parent.parent_poid = 3
    assert_raises FeideeUtils::Mixins::ParentAndPath::InconsistentPathException do
      @child.validate_path_integrity_hard
    end

    # Path is longer.
    @child.parent_poid = 0
    assert_raises FeideeUtils::Mixins::ParentAndPath::InconsistentPathException do
      @child.validate_path_integrity_hard
    end

    # Trace and path differs.
    @child.parent_poid = 3
    assert_raises FeideeUtils::Mixins::ParentAndPath::InconsistentPathException do
      @child.validate_path_integrity_hard
    end
  end

  def test_validate_path_integrity_hard
    @child.validate_path_integrity_hard
    @parent.validate_path_integrity_hard
  end

  def test_validate_one_level_path_integrity_errors
    @parent.raw_path = "/3"
    assert_raises FeideeUtils::Mixins::ParentAndPath::InconsistentPathException do
      @child.validate_one_level_path_integrity
    end

    # Wrong child POID.
    @child.poid = 3
    assert_raises FeideeUtils::Mixins::ParentAndPath::InconsistentPathException do
      @child.validate_one_level_path_integrity
    end
  end

  def test_validate_one_level_path_integrity
    @child.validate_one_level_path_integrity
    @parent.validate_one_level_path_integrity
  end

  def test_parent
    assert_equal @parent, @child.parent
  end

  def test_has_parent
    assert @child.has_parent?
    refute @parent.has_parent?
  end
end


text:
package scalan

import java.lang.reflect.{InvocationTargetException, Method}
import scala.annotation.tailrec
import scala.reflect.ClassTag
import scalan.compilation.{GraphVizConfig, GraphVizExport}
import scalan.util.ScalaNameUtil
import debox.{Buffer => DBuffer}
import spire.syntax.all.cfor

trait MethodCalls extends Base with GraphVizExport { self: Scalan =>

  def delayInvoke = throw new DelayInvokeException

  /** Graph node to represent invocation of the method of some class.
    * @param receiver    node ref representing instance on which the method is called
    * @param method      method which is called (descriptor from `java.lang.reflect`)
    * @param args        node refs representing arguments passed to the method
    * @param neverInvoke it true this method cannot be performed, even if the
    *                    receiver node allow this
    * @param resultType  type descriptor of the method's result
    * @param isAdapterCall whether this MC was created by generated adapter class.
    *                      This typically means, that receiver node doesn't implement
    *                      given `method`.
    */
  case class MethodCall private[MethodCalls](receiver: Sym, method: Method, args: Seq[AnyRef], neverInvoke: Boolean)
                                            (val resultType: Elem[Any], val isAdapterCall: Boolean = false) extends Def[Any] {

    override def mirror(t: Transformer): Ref[Any] = {
      val len = args.length
      val args1 = new Array[AnyRef](len)
      cfor(0)(_ < len, _ + 1) { i =>
        args1(i) = transformProductParam(args(i), t).asInstanceOf[AnyRef]
      }
      val receiver1 = t(receiver)
      // in the case neverInvoke is false, the method is invoked in rewriteDef
      mkMethodCall(receiver1, method, args1, neverInvoke, isAdapterCall, resultType).asInstanceOf[Ref[Any]]
    }

    override def toString = {
      val methodStr = method.toString.replace("java.lang.", "").
        replace("public ", "").replace("abstract ", "")
      s"MethodCall($receiver, $methodStr, [${args.mkString(", ")}], $neverInvoke)"
    }

    /** Try invoke `method` on the node instance refered by `receiver`.
      * Each MC node contains enough information to perform invocation using
      * `java.lang.reflect.Method.invoke` method. However, this is not possible
      * if the node pointed to by `receiver` don't implement this method,
      * for example when receiver is Lambda variable pointing to Variable node
      * instance (in which case this MC was created by adapter)
      * @return invocation result descriptor.
      * @see InvokeResult
      */
    def tryInvoke: InvokeResult =
      if (neverInvoke && !isAdapterCall) {
        InvokeImpossible
      } else {
        invokeMethod[InvokeResult](
          receiver, method, args.toArray,
          { res => InvokeSuccess(res.asInstanceOf[Sym]) },
          { InvokeFailure(_) },
          { InvokeImpossible }
        )
      }

    import scalan.util.CollectionUtil.TraversableOps
    override def equals(other: Any): Boolean = (this eq other.asInstanceOf[AnyRef]) || {
      other match {
        case other: MethodCall =>
          receiver == other.receiver &&
          method == other.method &&
          resultType.name == other.resultType.name &&
          neverInvoke == other.neverInvoke &&
          isAdapterCall == other.isAdapterCall &&
          args.length == other.args.length &&
          args.sameElements2(other.args) // this is required in case method have T* arguments
        case _ => false
      }
    }

    override lazy val hashCode: Int = {
      var h = receiver.hashCode() * 31 + method.hashCode()
      h = h * 31 + resultType.name.hashCode
      h = h * 31 + (if(neverInvoke) 1 else 0)
      h = h * 31 + (if(isAdapterCall) 1 else 0)
      h = h * 31 + args.hashCode()
      h
    }
  }

  /** Represents invocation of constructor of the class described by `eA`.
    * @param  eA          class descriptor for new instance
    * @param  args        arguments of class constructor
    */
  case class NewObject[A](eA: Elem[A], args: Seq[Any]) extends BaseDef[A]()(eA) {
    override def transform(t: Transformer) = NewObject(eA, t(args))
  }

  /** Creates new MethodCall node and returns its node ref. */
  def mkMethodCall(receiver: Sym, method: Method, args: Seq[AnyRef],
                   neverInvoke: Boolean, isAdapterCall: Boolean, resultElem: Elem[_]): Sym = {
    reifyObject(MethodCall(receiver, method, args, neverInvoke)(asElem[Any](resultElem), isAdapterCall))
  }

  /** Creates new NewObject node and returns its node ref. */
  def newObjEx[A](args: Any*)(implicit eA: Elem[A]): Ref[A] = {
    reifyObject(NewObject[A](eA, args))
  }

  @tailrec
  private def baseCause(e: Throwable): Throwable = e match {
    case e: java.lang.reflect.UndeclaredThrowableException => baseCause(e.getCause)
    case e: InvocationTargetException => baseCause(e.getCause)
    case e: ExceptionInInitializerError => baseCause(e.getCause)
    case e => e
  }

  /** Used by Graphviz dot file generator to format text label of the graph node. */
  override protected def formatDef(d: Def[_])(implicit config: GraphVizConfig): String = d match {
    case MethodCall(obj, method, args, _) =>
      val methodCallStr =
        s"${ScalaNameUtil.cleanScalaName(method.getName)}(${args.mkString(", ")})"
      if (obj.isCompanionType) {
        s"$obj.$methodCallStr"
      } else {
        val className = ScalaNameUtil.cleanNestedClassName(method.getDeclaringClass.getName)
        s"$obj.$className.$methodCallStr"
      }
    case NewObject(eA, args) =>
      val className = ScalaNameUtil.cleanNestedClassName(eA.sourceType.name)
      s"new $className(${args.mkString(", ")})"
    case _ => super.formatDef(d)
  }

  /** This method is called for each MethodCall node which is about to be added to the graph.
    * This means `mc` has been examined by all the rewrite rules, but has not need rewritten.
    * Now, if this method returns null, then mc will be added to the graph.
    * However, in this method, `mc` can be examined by a second set of RW rules
    * (kind of lower priority rules). These rules kind of context dependent, because at this
    * point we know that the first RW set didn't triggered any rewrite. */
  def rewriteNonInvokableMethodCall(mc: MethodCall): Ref[_] = null

  /** Create delegate instance suitable for method invocation.
    * It is used when T is a class or a trait and the node referred by x doesn't conform to T.
    * This method returns dynamically constructed instance, which conforms to T.
    * Whenever a method of T is called on that instance, the call is intercepted and
    * `DelegatedInterceptionHandler.invoke` method is called, then a new MethodCall can
    * be constructed (which is befavior by default).
    */
  protected def unrefDelegate[T <: AnyRef](x: Ref[T])(implicit ct: ClassTag[T]): T = {
    val d = x.node
    if (d.isInstanceOf[Const[_]])
      d.asInstanceOf[Const[T]@unchecked].x
    else
      !!!(s"Cannot do undefDelegate($x -> ${x.node})")
  }

  /** Generic helper to call the given method on the given receiver node. */
  private[scalan] def invokeMethod[A](receiver: Sym, m: Method, args: Array[AnyRef],
                              onInvokeSuccess: AnyRef => A,
                              onInvokeException: Throwable => A,
                              onInvokeImpossible: => A): A = {
    val d = receiver.node
    if (canBeInvoked(d, m, args)) {
      try {
        val res = m.invoke(d, args: _*)
        onInvokeSuccess(res)
      } catch {
        case e: Exception => onInvokeException(baseCause(e))
      }
    }
    else
      onInvokeImpossible
  }

  /** Method invocation enabler.
    * @return  true if the given method can be invoked on the given node. */
  def isInvokeEnabled(d: Def[_], m: Method) = true

  /** Method invocation checker. */
  protected def canBeInvoked(d: Def[_], m: Method, args: Array[AnyRef]) = {
    m.getDeclaringClass.isAssignableFrom(d.getClass) && isInvokeEnabled(d, m)
  }

  /** Result of MethodCall invocation.
    * @see tryInvoke */
  sealed abstract class InvokeResult
  /** Successful MethodCall invocation with the given result. */
  case class InvokeSuccess(result: Ref[_]) extends InvokeResult
  /** Exception thrown during MethodCall invocation. */
  case class InvokeFailure(exception: Throwable) extends InvokeResult
  /** Invocation is not possible, e.g. when receiver doesn't implemented the method. */
  case object InvokeImpossible extends InvokeResult

  def throwInvocationException(whatFailed: String, cause: Throwable, receiver: Sym, m: Method, args: Seq[Any]) = {
    val buf = DBuffer.empty[Sym]
    buf += receiver
    Def.extractSyms(args, buf)
    val deps = buf.toArray()
    !!!(s"$whatFailed (${receiver.varNameWithType}).${m.getName}(${args.mkString(", ")}) failed", baseCause(cause), deps: _*)
  }
}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--The "acceptLicense" attribute has been deprecated. Use "-acceptLicense" command line option to accept license agreements.-->
<agent-input acceptLicense='true' clean='true' temporary='false'>
<server>
<repository location='_CLM_REPO_'/>
</server>
<profile id='Collaborative Lifecycle Management' installLocation='_JAZZ_HOME_'>
<data key='eclipseLocation' value='_JAZZ_HOME_'/>
<data key='user.import.profile' value='false'/>
<data key='cic.selector.os' value='linux'/>
<data key='cic.selector.ws' value='gtk'/>
<data key='cic.selector.arch' value='x86_64'/>
<data key='user.com.ibm.team.install.jfs.migration-options.server-shortcut-key-prefix' value='JazzTeamServer'/>
<data key='user.com.ibm.team.install.jfs.app.jazz.context-root' value='_CONTEXT_'/>
<data key='user.com.ibm.team.install.jfs.app.admin.context-root' value='admin'/>
<data key='user.com.ibm.team.install.jfs.appserver.user-override' value='true'/>
<data key='user.com.ibm.team.install.jfs.appserver.noappserver.disable' value='false'/>
<data key='user.com.ibm.team.install.jfs.appserver.tomcat.disable' value='true'/>
<data key='user.JazzFoundationServer.NoAppServer.WebApps.InstallLocation' value='_JAZZ_HOME_/server/webapps'/>
<data key='user.com.ibm.team.install.context-root-override' value='true'/>
<data key='cic.selector.nl' value='en'/>
</profile>
<install modify='false'>
<offering id='com.ibm.team.install.jfs.app.jts' profile='Collaborative Lifecycle Management' features='jfs.base,jazz,lpa,clmhelp,rcl' installFixes='none' />
<offering id='com.ibm.team.install.jfs.app.product-clm' profile='IBM Collaborative Lifecycle Management' features='server.conf,server.provision,require.jts' installFixes='none' />
</install>
<preference name='com.ibm.cic.common.core.preferences.eclipseCache' value='/opt/IBM/IBMIMShared'/>
<preference name='com.ibm.cic.common.core.preferences.connectTimeout' value='30'/>
<preference name='com.ibm.cic.common.core.preferences.readTimeout' value='45'/>
<preference name='com.ibm.cic.common.core.preferences.downloadAutoRetryCount' value='0'/>
<preference name='offering.service.repositories.areUsed' value='true'/>
<preference name='com.ibm.cic.common.core.preferences.ssl.nonsecureMode' value='false'/>
<preference name='com.ibm.cic.common.core.preferences.http.disablePreemptiveAuthentication' value='false'/>
<preference name='http.ntlm.auth.kind' value='NTLM'/>
<preference name='http.ntlm.auth.enableIntegrated.win32' value='true'/>
<preference name='com.ibm.cic.common.core.preferences.preserveDownloadedArtifacts' value='true'/>
<preference name='com.ibm.cic.common.core.preferences.keepFetchedFiles' value='false'/>
<preference name='PassportAdvantageIsEnabled' value='false'/>
<preference name='com.ibm.cic.common.core.preferences.searchForUpdates' value='false'/>
<preference name='com.ibm.cic.agent.ui.displayInternalVersion' value='false'/>
<preference name='com.ibm.cic.common.sharedUI.showErrorLog' value='true'/>
<preference name='com.ibm.cic.common.sharedUI.showWarningLog' value='true'/>
<preference name='com.ibm.cic.common.sharedUI.showNoteLog' value='true'/>
</agent-input>


text:
require "cases/helper"

class CopyTableTest < ActiveRecord::TestCase
  fixtures :companies, :comments

  def setup
    @connection = ActiveRecord::Base.connection
    class << @connection
      public :copy_table, :table_structure, :indexes
    end
  end

  def test_copy_table(from = 'companies', to = 'companies2', options = {})
    assert_nothing_raised {copy_table(from, to, options)}
    assert_equal row_count(from), row_count(to)

    if block_given?
      yield from, to, options
    else
      assert_equal column_names(from), column_names(to)
    end

    @connection.drop_table(to) rescue nil
  end

  def test_copy_table_renaming_column
    test_copy_table('companies', 'companies2',
        :rename => {'client_of' => 'fan_of'}) do |from, to, options|
      expected = column_values(from, 'client_of')
      assert expected.any?, 'only nils in resultset; real values are needed'
      assert_equal expected, column_values(to, 'fan_of')
    end
  end

  def test_copy_table_with_index
    test_copy_table('comments', 'comments_with_index') do
      @connection.add_index('comments_with_index', ['post_id', 'type'])
      test_copy_table('comments_with_index', 'comments_with_index2') do
        assert_equal table_indexes_without_name('comments_with_index'),
                     table_indexes_without_name('comments_with_index2')
      end
    end
  end

  def test_copy_table_without_primary_key
    test_copy_table('developers_projects', 'programmers_projects')
  end

  def test_copy_table_with_id_col_that_is_not_primary_key
    test_copy_table('goofy_string_id', 'goofy_string_id2') do |from, to, options|
      original_id = @connection.columns('goofy_string_id').detect{|col| col.name == 'id' }
      copied_id = @connection.columns('goofy_string_id2').detect{|col| col.name == 'id' }
      assert_equal original_id.type, copied_id.type
      assert_equal original_id.sql_type, copied_id.sql_type
      assert_equal original_id.limit, copied_id.limit
      assert_equal original_id.primary, copied_id.primary
    end
  end

protected
  def copy_table(from, to, options = {})
    @connection.copy_table(from, to, {:temporary => true}.merge(options))
  end

  def column_names(table)
    @connection.table_structure(table).map {|column| column['name']}
  end

  def column_values(table, column)
    @connection.select_all("SELECT #{column} FROM #{table} ORDER BY id").map {|row| row[column]}
  end

  def table_indexes_without_name(table)
    @connection.indexes('comments_with_index').delete(:name)
  end

  def row_count(table)
    @connection.select_one("SELECT COUNT(*) AS count FROM #{table}")['count']
  end
end


text:
#import <XCTest/XCTest.h>

#import "FBApplicationDouble.h"
#import "FBSession.h"

@interface FBSessionTests : XCTestCase
@property (nonatomic, strong) FBSession *session;
@property (nonatomic, strong) FBApplication *testedApplication;
@end

@implementation FBSessionTests

- (void)setUp
{
  [super setUp];
  self.testedApplication = (id)FBApplicationDouble.new;
  self.session = [FBSession sessionWithApplication:self.testedApplication];
}

- (void)testSessionFetching
{
  FBSession *fetchedSession = [FBSession sessionWithIdentifier:self.session.identifier];
  XCTAssertEqual(self.session, fetchedSession);
}

- (void)testSessionFetchingBadIdentifier
{
  XCTAssertNil([FBSession sessionWithIdentifier:@"FAKE_IDENTIFIER"]);
}

- (void)testSessionCreation
{
  XCTAssertNotNil(self.session.identifier);
  XCTAssertNotNil(self.session.elementCache);
}

- (void)testActiveSession
{
  XCTAssertEqual(self.session, [FBSession activeSession]);
}

- (void)testKillingSession
{
  [self.session kill];
  XCTAssertTrue(((FBApplicationDouble *)self.testedApplication).didTerminate);
  XCTAssertNil([FBSession activeSession]);
}

@end


text:
#* interpreter/do_loop.rb - The fOOrth language do loop support module.
module XfOOrth

  #* interpreter/do_loop.rb - The fOOrth language do loop support module.
  class VirtualMachine

    #The runtime implementation of the "do" word.
    #
Parameters:
    #* jloop - An optional outer loop value.
    #* block - A block of code to be executed as the do loop body.
    #
Block Parameters:
    #* iloop - The stack frame of the current loop counter. This
    #  corresponds to the fOOrth 'i' value.
    #* jloop - The stack frame of any containing loop counter. This corresponds
    #  to the fOOrth 'j' value. If there is no containing loop, this
    #  will always be a zero frame ie: [0, 0, 0].
    #
Note:
    #* Nested loops must be in the same compiler context in order to use this
    #  mechanism. Otherwise, loop index counters must be passed in explicitly.
    #
Endemic Code Smells
    #* :reek:FeatureEnvy  -- false positive
    def vm_do(jloop = [0, 0, 0], &block)
      #Pop the start and ending values from the stack.
      start_index, end_index = popm(2)

      #Construct the loop data frame.
      iloop = [start_index, end_index - 1, start_index + end_index - 1]

      #Loop until done!
      while iloop[0] <= iloop[1]
        #Yield to the loop.
        yield iloop, jloop
      end
    end

    #The runtime implementation of the "+loop" word.
    def vm_do_increment
      inc_raw = self.pop

      unless (inc_value = inc_raw.to_foorth_n)
        error "F40: Cannot convert a #{inc_raw.foorth_name} to a Numeric instance"
      end

      if inc_value > 0
        inc_value
      else
        error "F41: Invalid loop increment value: #{inc_value}"
      end
    end

  end

end


text:
module LeagueManager
  VERSION = "1.6.0"
end


text:
namespace v8 {
namespace internal {

class CallOrConstructBuiltinsAssembler : public CodeStubAssembler {
 public:
  explicit CallOrConstructBuiltinsAssembler(compiler::CodeAssemblerState* state)
      : CodeStubAssembler(state) {}

  void CallOrConstructWithArrayLike(TNode<Object> target,
                                    SloppyTNode<Object> new_target,
                                    TNode<Object> arguments_list,
                                    TNode<Context> context);
  void CallOrConstructDoubleVarargs(TNode<Object> target,
                                    SloppyTNode<Object> new_target,
                                    TNode<FixedDoubleArray> elements,
                                    TNode<Int32T> length,
                                    TNode<Int32T> args_count,
                                    TNode<Context> context, TNode<Int32T> kind);
  void CallOrConstructWithSpread(TNode<Object> target, TNode<Object> new_target,
                                 TNode<Object> spread, TNode<Int32T> args_count,
                                 TNode<Context> context);

  enum class CallFunctionTemplateMode : uint8_t {
    kCheckAccess,
    kCheckCompatibleReceiver,
    kCheckAccessAndCompatibleReceiver,
  };

  void CallFunctionTemplate(CallFunctionTemplateMode mode,
                            TNode<FunctionTemplateInfo> function_template_info,
                            TNode<IntPtrT> argc, TNode<Context> context);

 private:
  TNode<JSReceiver> GetCompatibleReceiver(TNode<JSReceiver> receiver,
                                          TNode<HeapObject> signature,
                                          TNode<Context> context);
};

}  // namespace internal
}  // namespace v8

#endif  // V8_BUILTINS_BUILTINS_CALL_GEN_H_


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
 ~ Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
 ~
 ~ 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.
-->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    <parent>
        <groupId>org.wso2.carbon.identity.framework</groupId>
        <artifactId>identity-framework</artifactId>
        <version>5.20.72-SNAPSHOT</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <artifactId>feature-categories</artifactId>
    <packaging>pom</packaging>
    <name>WSO2 Carbon Identity - Feature Categories Module</name>
    <url>http://wso2.org</url>

    <modules>
        <module>authorization</module>
        <module>inbound-authentication</module>
        <module>inbound-provisioning</module>
        <module>keystore-mgt</module>
        <module>notification-mgt</module>
        <module>outbound-authentication</module>
        <module>outbound-provisioning</module>
        <module>user-mgt</module>
        <module>workflow</module>
    </modules>

</project>


text:
package api.eventbrite

import org.scalatest.FunSuite
import org.scalatest.matchers.ShouldMatchers
import EventBriteParser.parseEvents

class EventbriteParserTest extends FunSuite with ShouldMatchers {

    test("should map 1 dummy event") {
        val events: Seq[EventbriteEvent] = parseEvents("""{"events":[ {"event": { "id":4737033595 } } ] }""")
        events.size should be (1)
        events.head.id should be(Option("4737033595"))
    }

    test("should understand no event found") {
        val response = parseEvents("""{"events": [], "error": {"error_type": "Not Found", "error_message": "No events found matching the following criteria. [organizer=pppppppppppppp,  ]"}}""")
        response should be (Nil)
    }

    ignore("unknown response from eventbrite should throw IllegalStateException") {
        val thrown = evaluating {
            parseEvents("""{"toto": "titi"}""")
        } should produce [IllegalStateException]
        thrown.getMessage should include ("""{"toto": "titi"}""")
    }
}


text:
<?php

namespace Waredesk\Exceptions;

use Waredesk\Exception;

class AuthenticationErrorException extends Exception
{
}


text:
package com.example.gank.widget;

import com.example.gank.main.R;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

public class MenuItem extends RelativeLayout{

	private TextView mTextView;
	private ImageView mImageView;

	public MenuItem(Context context)
	{
		this(context, null);
	}

	public MenuItem(Context context, AttributeSet attrs) {
		super(context, attrs);
		LayoutInflater.from(context).inflate(R.layout.menu_item, this);
		mTextView=(TextView)findViewById(R.id.txt_menufragment_item);
		mImageView=(ImageView)findViewById(R.id.img_menu_img);
	}

	public void setText(String text)
	{
		mTextView.setText(text);
	}

	public void setImg(int img)
	{
		mImageView.setImageResource(img);
	}
}


text:
class Camera : public ofBaseHasPixels {
protected:
	int deviceId, width, height;
	ofImage img;
	bool horizontalFlip;
	bool ready;
	unsigned long previous;

public:
	Camera();
	~Camera();

	void setDeviceId(int deviceId);
	void setHorizontalFlip(bool horizontalFlip);
	bool initGrabber(int width, int height);
	bool update();
	int getWidth() const;
	int getHeight() const;
	bool getReady() const;
	ofPixels& getPixels();
	const ofPixels& getPixels() const;
	ofTexture& getTextureReference();
	void draw(int x, int y);
};


text:
"""runpy.py - locating and running Python code using the module namespace

Provides support for locating and running Python scripts using the Python
module namespace instead of the native filesystem.

This allows Python code to play nicely with non-filesystem based PEP 302
importers when locating support scripts as well as when importing modules.
"""
# Written by Nick Coghlan <ncoghlan at gmail.com>
#    to implement PEP 338 (Executing Modules as Scripts)

import sys
import imp
try:
    from imp import get_loader
except ImportError:
    from pkgutil import get_loader

__all__ = [
    "run_module",
]

def _run_code(code, run_globals, init_globals=None,
              mod_name=None, mod_fname=None,
              mod_loader=None, pkg_name=None):
    """Helper for _run_module_code"""
    if init_globals is not None:
        run_globals.update(init_globals)
    run_globals.update(__name__ = mod_name,
                       __file__ = mod_fname,
                       __loader__ = mod_loader,
                       __package__ = pkg_name)
    exec code in run_globals
    return run_globals

def _run_module_code(code, init_globals=None,
                    mod_name=None, mod_fname=None,
                    mod_loader=None, pkg_name=None):
    """Helper for run_module"""
    # Set up the top level namespace dictionary
    temp_module = imp.new_module(mod_name)
    mod_globals = temp_module.__dict__
    # Modify sys.argv[0] and sys.module[mod_name]
    saved_argv0 = sys.argv[0]
    restore_module = mod_name in sys.modules
    if restore_module:
        saved_module = sys.modules[mod_name]
    sys.argv[0] = mod_fname
    sys.modules[mod_name] = temp_module
    try:
        _run_code(code, mod_globals, init_globals,
                    mod_name, mod_fname,
                    mod_loader, pkg_name)
    finally:
        sys.argv[0] = saved_argv0
        if restore_module:
            sys.modules[mod_name] = saved_module
        else:
            del sys.modules[mod_name]
    # Copy the globals of the temporary module, as they
    # may be cleared when the temporary module goes away
    return mod_globals.copy()

# This helper is needed due to a missing component in the PEP 302
# loader protocol (specifically, "get_filename" is non-standard)
# Since we can't introduce new features in maintenance releases,
# support was added to zipimporter under the name '_get_filename'
def _get_filename(loader, mod_name):
    for attr in ("get_filename", "_get_filename"):
        meth = getattr(loader, attr, None)
        if meth is not None:
            return meth(mod_name)
    return None

# Helper to get the loader, code and filename for a module
def _get_module_details(mod_name):
    loader = get_loader(mod_name)
    if loader is None:
        raise ImportError("No module named %s" % mod_name)
    if loader.is_package(mod_name):
        raise ImportError(("%s is a package and cannot " +
                          "be directly executed") % mod_name)
    code = loader.get_code(mod_name)
    if code is None:
        raise ImportError("No code object available for %s" % mod_name)
    filename = _get_filename(loader, mod_name)
    return loader, code, filename

# XXX ncoghlan: Should this be documented and made public?
# (Current thoughts: don't repeat the mistake that lead to its
# creation when run_module() no longer met the needs of
# mainmodule.c, but couldn't be changed because it was public)
def _run_module_as_main(mod_name, set_argv0=True):
    """Runs the designated module in the __main__ namespace

       These __*__ magic variables will be overwritten:
           __file__
           __loader__
    """
    try:
        loader, code, fname = _get_module_details(mod_name)
    except ImportError as exc:
        # Try to provide a good error message
        # for directories, zip files and the -m switch
        if set_argv0:
            # For -m switch, just disply the exception
            info = str(exc)
        else:
            # For directories/zipfiles, let the user
            # know what the code was looking for
            info = "can't find '__main__.py' in %r" % sys.argv[0]
        msg = "%s: %s" % (sys.executable, info)
        sys.exit(msg)
    pkg_name = mod_name.rpartition('.')[0]
    main_globals = sys.modules["__main__"].__dict__
    if set_argv0:
        sys.argv[0] = fname
    return _run_code(code, main_globals, None,
                     "__main__", fname, loader, pkg_name)

def run_module(mod_name, init_globals=None,
               run_name=None, alter_sys=False):
    """Execute a module's code without importing it

       Returns the resulting top level namespace dictionary
    """
    loader, code, fname = _get_module_details(mod_name)
    if run_name is None:
        run_name = mod_name
    pkg_name = mod_name.rpartition('.')[0]
    if alter_sys:
        return _run_module_code(code, init_globals, run_name,
                                fname, loader, pkg_name)
    else:
        # Leave the sys module alone
        return _run_code(code, {}, init_globals, run_name,
                         fname, loader, pkg_name)

if __name__ == "__main__":
    # Run the module specified as the next command line argument
    if len(sys.argv) < 2:
        print >> sys.stderr, "No module specified for execution"
    else:
        del sys.argv[0] # Make the requested module sys.argv[0]
        _run_module_as_main(sys.argv[0])


text:
<?php

namespace JasonRoman\NbaApi\Params\GLeague;

use JasonRoman\NbaApi\Params\AbstractParam;

/**
 * Base class which any G-League API-specific parameters must extend from.
 */
abstract class AbstractGLeagueParam extends AbstractParam
{
}


text:
class AddShowKbShortcutsTourToUsers < ActiveRecord::Migration[5.2]
  def change
    add_column :users, :show_kb_shortcuts_tour, :boolean, default: true, null: false

  end
end


text:
<?php

namespace Bendozy\ORM;

use Bendozy\ORM\Base\Model;

class User extends Model
{
	protected static $primaryKey = 'id';
}


text:
package com.amazonaws.services.inspector2.model;

import javax.annotation.Generated;

/**
 *
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public enum ErrorCode {

    ALREADY_ENABLED("ALREADY_ENABLED"),
    ENABLE_IN_PROGRESS("ENABLE_IN_PROGRESS"),
    DISABLE_IN_PROGRESS("DISABLE_IN_PROGRESS"),
    SUSPEND_IN_PROGRESS("SUSPEND_IN_PROGRESS"),
    RESOURCE_NOT_FOUND("RESOURCE_NOT_FOUND"),
    ACCESS_DENIED("ACCESS_DENIED"),
    INTERNAL_ERROR("INTERNAL_ERROR"),
    SSM_UNAVAILABLE("SSM_UNAVAILABLE"),
    SSM_THROTTLED("SSM_THROTTLED"),
    EVENTBRIDGE_UNAVAILABLE("EVENTBRIDGE_UNAVAILABLE"),
    EVENTBRIDGE_THROTTLED("EVENTBRIDGE_THROTTLED"),
    RESOURCE_SCAN_NOT_DISABLED("RESOURCE_SCAN_NOT_DISABLED"),
    DISASSOCIATE_ALL_MEMBERS("DISASSOCIATE_ALL_MEMBERS"),
    ACCOUNT_IS_ISOLATED("ACCOUNT_IS_ISOLATED");

    private String value;

    private ErrorCode(String value) {
        this.value = value;
    }

    @Override
    public String toString() {
        return this.value;
    }

    /**
     * Use this in place of valueOf.
     *
     * @param value
     *        real value
     * @return ErrorCode corresponding to the value
     *
     * @throws IllegalArgumentException
     *         If the specified value does not map to one of the known values in this enum.
     */
    public static ErrorCode fromValue(String value) {
        if (value == null || "".equals(value)) {
            throw new IllegalArgumentException("Value cannot be null or empty!");
        }

        for (ErrorCode enumEntry : ErrorCode.values()) {
            if (enumEntry.toString().equals(value)) {
                return enumEntry;
            }
        }

        throw new IllegalArgumentException("Cannot create enum from " + value + " value!");
    }
}


text:
dart_pbkdf2
===========

License: MIT

Dart implementation of the [PBKDF2](http://en.wikipedia.org/wiki/PBKDF2) key derivation function

## Usage:

```
// default is to use SHA256
var pbkdf2 = new Pbkdf2();

// to use SHA1
var pbkdf2 = new Pbkdf2(new SHA1());

// [Password] and [Salt] can be List<int> or Strings
var key = pbkdf2.generate(Password, Salt, iterations, derived_key_length);
```

## Tests:

```
# run only the util tests
make testutil

# run only the SHA1 tests (excluding the longest running)
make testsha1

# run only the SHA256 tests (excluding the longest running)
make testsha256

# run the SHA1 longest running tests
make testsha1long

# run the SHA256 longest running tests
make testsha256long

# or run all of the tests, except the longest running
make test
```


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">

<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<TITLE>
HttpClient 3.0.1 API: Uses of Class org.apache.commons.httpclient.auth.RFC2617Scheme
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

Uses of Class
org.apache.commons.httpclient.auth.RFC2617Scheme

Packages that use RFC2617Scheme

org.apache.commons.httpclient.auth
Provides implementation of various authentication schemes as well as
      utility classes that can be used to authenticate HTTP requests.

Uses of RFC2617Scheme in org.apache.commons.httpclient.auth

Subclasses of RFC2617Scheme in org.apache.commons.httpclient.auth

 class
BasicScheme

 Basic authentication scheme as defined in RFC 2617.

 class
DigestScheme

 Digest authentication scheme as defined in RFC 2617.

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

Copyright © 2001-2006 Apache Software Foundation. All Rights Reserved.