require 'fileutils'
require File.dirname(__FILE__) + '/../abstract_unit'

CACHE_DIR = 'test_cache'
# Don't change '/../temp/' cavalierly or you might hoze something you don't want hozed
FILE_STORE_PATH = File.join(File.dirname(__FILE__), '/../temp/', CACHE_DIR)
ActionController::Base.perform_caching = true
ActionController::Base.page_cache_directory = FILE_STORE_PATH
ActionController::Base.fragment_cache_store = :file_store, FILE_STORE_PATH

class PageCachingTestController < ActionController::Base
  caches_page :ok, :no_content, :found, :not_found

  def ok
    head :ok
  end

  def no_content
    head :no_content
  end

  def found
    redirect_to :action => 'ok'
  end

  def not_found
    head :not_found
  end
end

class PageCachingTest < Test::Unit::TestCase
  def setup
    ActionController::Routing::Routes.draw do |map|
      map.main '', :controller => 'posts'
      map.resources :posts
      map.connect ':controller/:action/:id'
    end

    @request = ActionController::TestRequest.new
    @request.host = 'hostname.com'

    @response   = ActionController::TestResponse.new
    @controller = PageCachingTestController.new

    @params = {:controller => 'posts', :action => 'index', :only_path => true, :skip_relative_url_root => true}
    @rewriter = ActionController::UrlRewriter.new(@request, @params)

    FileUtils.rm_rf(File.dirname(FILE_STORE_PATH))
    FileUtils.mkdir_p(FILE_STORE_PATH)
  end

  def teardown
    FileUtils.rm_rf(File.dirname(FILE_STORE_PATH))
  end

  def test_page_caching_resources_saves_to_correct_path_with_extension_even_if_default_route
    @params[:format] = 'rss'
    assert_equal '/posts.rss', @rewriter.rewrite(@params)
    @params[:format] = nil
    assert_equal '/', @rewriter.rewrite(@params)
  end

  def test_should_cache_get_with_ok_status
    get :ok
    assert_response :ok
    assert_page_cached :ok, "get with ok status should have been cached"
  end

  [:ok, :no_content, :found, :not_found].each do |status|
    [:get, :post, :put, :delete].each do |method|
      unless method == :get and status == :ok
        define_method "test_shouldnt_cache_#{method}_with_#{status}_status" do
          @request.env['REQUEST_METHOD'] = method.to_s.upcase
          process status
          assert_response status
          assert_page_not_cached status, "#{method} with #{status} status shouldn't have been cached"
        end
      end
    end
  end

  private
    def assert_page_cached(action, message = "#{action} should have been cached")
      assert page_cached?(action), message
    end

    def assert_page_not_cached(action, message = "#{action} shouldn't have been cached")
      assert !page_cached?(action), message
    end

    def page_cached?(action)
      File.exist? "#{FILE_STORE_PATH}/page_caching_test/#{action}.html"
    end
end

class ActionCachingTestController < ActionController::Base
  caches_action :index

  def index
    @cache_this = Time.now.to_f.to_s
    render :text => @cache_this
  end

  def expire
    expire_action :controller => 'action_caching_test', :action => 'index'
    render :nothing => true
  end

end

class ActionCachingMockController
  attr_accessor :mock_url_for
  attr_accessor :mock_path

  def initialize
    yield self if block_given?
  end

  def url_for(*args)
    @mock_url_for
  end

  def request
    mocked_path = @mock_path
    Object.new.instance_eval(<<-EVAL)
      def path; '#{@mock_path}' end
      self
    EVAL
  end
end

class ActionCacheTest < Test::Unit::TestCase
  def setup
    reset!
    FileUtils.mkdir_p(FILE_STORE_PATH)
    @path_class = ActionController::Caching::Actions::ActionCachePath
    @mock_controller = ActionCachingMockController.new
  end

  def teardown
    FileUtils.rm_rf(File.dirname(FILE_STORE_PATH))
  end

  def test_simple_action_cache
    get :index
    cached_time = content_to_cache
    assert_equal cached_time, @response.body
    reset!

    get :index
    assert_equal cached_time, @response.body
  end

  def test_cache_expiration
    get :index
    cached_time = content_to_cache
    reset!

    get :index
    assert_equal cached_time, @response.body
    reset!

    get :expire
    reset!

    get :index
    new_cached_time = content_to_cache
    assert_not_equal cached_time, @response.body
    reset!

    get :index
    assert_response :success
    assert_equal new_cached_time, @response.body
  end

  def test_cache_is_scoped_by_subdomain
    @request.host = 'jamis.hostname.com'
    get :index
    jamis_cache = content_to_cache

    @request.host = 'david.hostname.com'
    get :index
    david_cache = content_to_cache
    assert_not_equal jamis_cache, @response.body

    @request.host = 'jamis.hostname.com'
    get :index
    assert_equal jamis_cache, @response.body

    @request.host = 'david.hostname.com'
    get :index
    assert_equal david_cache, @response.body
  end

  def test_xml_version_of_resource_is_treated_as_different_cache
    @mock_controller.mock_url_for = 'http://example.org/posts/'
    @mock_controller.mock_path    = '/posts/index.xml'
    path_object = @path_class.new(@mock_controller)
    assert_equal 'xml', path_object.extension
    assert_equal 'example.org/posts/index.xml', path_object.path
  end

  def test_empty_path_is_normalized
    @mock_controller.mock_url_for = 'http://example.org/'
    @mock_controller.mock_path    = '/'

    assert_equal 'example.org/index', @path_class.path_for(@mock_controller)
  end

  def test_file_extensions
    get :index, :id => 'kitten.jpg'
    get :index, :id => 'kitten.jpg'

    assert_response :success
  end

  private
    def content_to_cache
      assigns(:cache_this)
    end

    def reset!
      @request    = ActionController::TestRequest.new
      @response   = ActionController::TestResponse.new
      @controller = ActionCachingTestController.new
      @request.host = 'hostname.com'
    end
end

{'repo_name': 'qxjit/deep-test', 'stars': '122', 'repo_language': 'Ruby', 'file_name': 'timewarp_test.rb', 'mime_type': 'text/x-ruby', 'hash': -5281236427001311283, 'source_dataset': 'data'}


# frozen_string_literal: false
#--
# httpauth/userdb.rb -- UserDB mix-in module.
#
# Author: IPR -- Internet Programming with Ruby -- writers
# Copyright (c) 2003 Internet Programming with Ruby writers. All rights
# reserved.
#
# $IPR: userdb.rb,v 1.2 2003/02/20 07:15:48 gotoyuzo Exp $

module WEBrick
  module HTTPAuth

    ##
    # User database mixin for HTTPAuth.  This mixin dispatches user record
    # access to the underlying auth_type for this database.

    module UserDB

      ##
      # The authentication type.
      #
      # WEBrick::HTTPAuth::BasicAuth or WEBrick::HTTPAuth::DigestAuth are
      # built-in.

      attr_accessor :auth_type

      ##
      # Creates an obscured password in +realm+ with +user+ and +password+
      # using the auth_type of this database.

      def make_passwd(realm, user, pass)
        @auth_type::make_passwd(realm, user, pass)
      end

      ##
      # Sets a password in +realm+ with +user+ and +password+ for the
      # auth_type of this database.

      def set_passwd(realm, user, pass)
        self[user] = pass
      end

      ##
      # Retrieves a password in +realm+ for +user+ for the auth_type of this
      # database.  +reload_db+ is a dummy value.

      def get_passwd(realm, user, reload_db=false)
        make_passwd(realm, user, self[user])
      end
    end
  end
end

{'repo_name': 'aptana/studio3', 'stars': '862', 'repo_language': 'JavaScript', 'file_name': 'org.eclipse.core.resources.prefs', 'mime_type': 'text/plain', 'hash': 3278045707681602413, 'source_dataset': 'data'}


// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s

@class SUPER, Y; // expected-note 2 {{forward declaration of class here}}

@interface INTF :SUPER  // expected-error {{attempting to use the forward class 'SUPER' as superclass of 'INTF'}}
@end

@interface SUPER @end

@interface INTF1 : SUPER  // expected-note {{previous definition is here}}
@end

@interface INTF2 : INTF1
@end

@interface INTF3 : Y // expected-error {{attempting to use the forward class 'Y' as superclass of 'INTF3'}} \
                     // expected-note{{'INTF3' declared here}}
@end

@interface INTF1  // expected-error {{duplicate interface definition for class 'INTF1'}}
@end

@implementation SUPER
- (void)dealloc {
    [super dealloc]; // expected-error {{'SUPER' cannot use 'super' because it is a root class}}
}
@end

@interface RecursiveClass : RecursiveClass // expected-error {{trying to recursively use 'RecursiveClass' as superclass of 'RecursiveClass'}}
@end

@implementation RecursiveClass
@end

@implementation iNTF3 // expected-warning{{cannot find interface declaration for 'iNTF3'; did you mean 'INTF3'?}}
@end

{'repo_name': 'GoSSIP-SJTU/TripleDoggy', 'stars': '139', 'repo_language': 'C++', 'file_name': '2a2a50bb6a5c024ffdaa235dcdd387bcb308cea1.svn-base', 'mime_type': 'text/plain', 'hash': -8676624612274154228, 'source_dataset': 'data'}


/****************************************************************************
 *
 * Copyright 2016 Samsung Electronics 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.
 *
 ****************************************************************************/
/***************************************************************************
 * libc/net/lib_delroute.c
 *
 *   Copyright (C) 2013 Gregory Nutt. All rights reserved.
 *   Author: Gregory Nutt <gnutt@nuttx.org>
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 * 3. Neither the name NuttX nor the names of its contributors may be
 *    used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 *
 ***************************************************************************/

/***************************************************************************
 * Compilation Switches
 ***************************************************************************/

/***************************************************************************
 * Included Files
 ***************************************************************************/

#include <tinyara/config.h>

#include <sys/socket.h>
#include <sys/ioctl.h>
#include <stdint.h>
#include <string.h>
#include <net/route.h>

/***************************************************************************
 * Global Functions
 ***************************************************************************/

/****************************************************************************
 * Function: net_delroute
 *
 * Description:
 *   Add a new route to the routing table.  This is just a convenience
 *   wrapper for the SIOCADDRT ioctl call.
 *
 * Parameters:
 *   sockfd   - Any socket descriptor
 *   target   - Target address on the remote network (required)
 *   netmask  - Network mask defining the external network (required)
 *
 * Returned Value:
 *   OK on success; -1 on failure with the errno variable set appropriately.
 *
 ****************************************************************************/

int delroute(int sockfd, FAR struct sockaddr_storage *target, FAR struct sockaddr_storage *netmask)
{
	struct rtentry entry;

	/* Set up the rtentry structure */

	memset(&entry, 0, sizeof(struct rtentry));
	entry.rt_target = target;	/* Target address */
	entry.rt_netmask = netmask;	/* Network mask defining the sub-net */

	/* Then perform the ioctl */

	return ioctl(sockfd, SIOCDELRT, (unsigned long)((uintptr_t)&entry));
}

{'repo_name': 'Samsung/TizenRT', 'stars': '345', 'repo_language': 'C', 'file_name': 'Kconfig', 'mime_type': 'text/plain', 'hash': 1632874167816098380, 'source_dataset': 'data'}


// Copyright (c) 2012 Ecma International.  All rights reserved.
// Ecma International makes this code available under the terms and conditions set
// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
// "Use Terms").   Any redistribution of this code must retain the above
// copyright and this notice and otherwise comply with the Use Terms.

/*---
es5id: 15.4.4.17-7-c-i-10
description: >
    Array.prototype.some - element to be retrieved is own accessor
    property on an Array
includes: [runTestCase.js]
---*/

function testcase() {

        var kValue = "abc";

        function callbackfn(val, idx, obj) {
            if (idx === 10) {
                return val === kValue;
            }
            return false;
        }

        var arr = [];

        Object.defineProperty(arr, "10", {
            get: function () {
                return kValue;
            },
            configurable: true
        });

        return arr.some(callbackfn);
    }
runTestCase(testcase);

{'repo_name': 'PiotrDabkowski/Js2Py', 'stars': '1184', 'repo_language': 'JavaScript', 'file_name': 'framework.js', 'mime_type': 'text/plain', 'hash': 8070127683463773944, 'source_dataset': 'data'}


#ForumContainer .navbar {
	z-index: 1025;
}

#ForumContainer .newIndicator {
	max-width: 40px;
}

#ForumContainer #TopicTools input {
	margin-bottom: 10px;
}

#ForumContainer #PostResponseMessage, #ForumContainer #TopicModerationLog {
	display: none;
}

#ForumContainer .activityFeedPoints {
	font-size: 200%;
	font-weight: bold;
	text-align: center;
	min-width: 60px;
	float: left;
	margin-right: 1em;
}

#ForumContainer .toLabelX {
	cursor: pointer;
}

#ForumContainer #ToModal #ToResultList {
	height: 200px;
	overflow-y: scroll;
	margin-top: 10px;
}

#ForumContainer #PMToBox div {
	margin-right: 5px;
}

#ForumContainer .answerData {
	text-align: center;
	min-width: 4em;
}

#ForumContainer .answerData .answerStatus {
	margin: 1em auto;
	font-size: 2em;
}

#ForumContainer .answerData .badge {
	font-size: 150%;
}

#ForumContainer .answerButton, #ForumContainer .answerCheck {
	font-size: 150%;
	text-align: center;
}

#ForumContainer .answerButton {
	cursor: pointer;
}

#ForumContainer .answerVote {
	white-space: nowrap;
}

#ForumContainer .QAstate {
	width: 40px;
}
#ForumContainer .QAstate span {
	margin-top: 6px;
}

#ForumContainer .newPostBlock {
	border-left: solid 4px #d3d3d3;
	padding-left: 10px;
}

/* post item */

#ForumContainer .postItem {
	margin: 20px 0;
}
#ForumContainer .postUserData h3 {
	cursor: pointer;
}
#ForumContainer blockquote {
	font-size: 100%;
	border-left: 5px solid #aaaaaa;
	padding: 0 1em;
}
#ForumContainer .postItem hr {
	margin: 10px 0;
}
#ForumContainer .miniProfileBox {
	display: none;
}
#ForumContainer .postItem .voteCount {
	display: inline-block;
	cursor: pointer;
	position: absolute;
	margin-top: 5px;
}
#ForumContainer .voters {
	max-height: 120px;
	width: 150px;
	overflow: auto;
	position: relative;
	display: none;
	padding: 4px;
	text-align: left;
	border-radius: 2px;
	z-index: 1000;
}
#ForumContainer .postItem .voters ul {
	margin: 4px;padding: 0;
}
#ForumContainer .voters li { list-style: none;font-size: 100%; }
#ForumContainer .postItem .postTools {
	display: inline-block;
	margin-left: 40px;
}
#ForumContainer .postItem .postTools input {
	padding: 0;
}
#ForumContainer .postItem .moderationLog {
	display: none;
}
#ForumContainer .postItem .postImage {
	max-width: 100%;height: auto;
}
#ForumContainer .postItem iframe {
	max-width: 100%;
}
#ForumContainer .postTime {
	display: block;
}

/* text editor */

#ForumContainer #FullText {
	height: 300px;
}
#tinymce {
	padding: 10px !important;
}
#ForumContainer .postForm {
	margin: 10px 0;
}

#ForumContainer #ParsedFullText {
	overflow-y: scroll;overflow-x: hidden;
	max-height: 350px;
}

#ForumContainer .voteCount .voters {
	display: none;
}

#ForumContainer .morePostsButton {
	margin-bottom: 10px;
}

#ForumContainer .morePager:hover, #ForumContainer .currentPager:hover {
	background: none;
}
#ForumContainer .morePager, #ForumContainer .currentPager .page-link {
	cursor: default;
	white-space: nowrap;
}

/* queries */

@media(min-width:1px) {
	#ForumContainer #PreviewModal .modal-dialog {
		width: 90%!important;
		max-height: 95% !important;
		margin: 10px auto;
	}
}

/* Bootstrap overrides */

#ForumContainer #AccountBox .badge {
	background-color: #ff0000;color: white;
	position: relative;
	top: -2px;
}

#ForumContainer .hidden {
	display: none !important;
}

.btn-link {
	border: none;
	cursor: pointer;
	background: none;
}

/* icons */

@font-face {
	font-family: 'pfglyphs';
	src: url('fonts/pfglyphs.eot?enukk');
	src: url('fonts/pfglyphs.eot?enukk#iefix') format('embedded-opentype'), url('fonts/pfglyphs.ttf?enukk') format('truetype'), url('fonts/pfglyphs.woff?enukk') format('woff'), url('fonts/pfglyphs.svg?enukk#pfglyphs') format('svg');
	font-weight: normal;
	font-style: normal;
}

.miniProfile a.icon {
	text-decoration: none !important;
	margin-right: .5em;
}

[class^="icon-"], [class*=" icon-"] {
	font-family: 'pfglyphs' !important;
	speak: none;
	font-style: normal;
	font-weight: normal;
	font-variant: normal;
	text-transform: none;
	line-height: 1;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.icon-file-text2:before {
	content: "\e926";
}

.icon-envelop:before {
	content: "\e945";
}

.icon-pushpin:before {
	content: "\e946";
}

.icon-bell:before {
	content: "\e951";
}

.icon-users:before {
	content: "\e972";
}

.icon-user-plus:before {
	content: "\e973";
}

.icon-user-minus:before {
	content: "\e974";
}

.icon-search:before {
	content: "\e986";
}

.icon-lock:before {
	content: "\e98f";
}

.icon-unlocked:before {
	content: "\e990";
}

.icon-stats-bars:before {
	content: "\e99c";
}

.icon-trophy:before {
	content: "\e99e";
}

.icon-link:before {
	content: "\e9cb";
}

.icon-star-empty:before {
	content: "\e9d7";
}

.icon-star-full:before {
	content: "\e9d9";
}

.icon-warning:before {
	content: "\ea07";
}

.icon-question:before {
	content: "\ea09";
}

.icon-plus:before {
	content: "\ea0a";
}

.icon-minus:before {
	content: "\ea0b";
}

.icon-info:before {
	content: "\ea0c";
}

.icon-cancel-circle:before {
	content: "\ea0d";
}

.icon-cross:before {
	content: "\ea0f";
}

.icon-checkmark:before {
	content: "\ea10";
}

.icon-checkmark2:before {
	content: "\ea11";
}

.icon-backward2:before {
	content: "\ea1f";
}

.icon-forward3:before {
	content: "\ea20";
}

.icon-previous2:before {
	content: "\ea23";
}

.icon-next2:before {
	content: "\ea24";
}

.icon-circle-up:before {
	content: "\ea41";
}

.icon-circle-right:before {
	content: "\ea42";
}

.icon-circle-down:before {
	content: "\ea43";
}

.icon-circle-left:before {
	content: "\ea44";
}

.icon-share2:before {
	content: "\ea82";
}

.icon-google3:before {
	content: "\ea8a";
}

.icon-facebook2:before {
	content: "\ea91";
}

.icon-instagram:before {
	content: "\ea92";
}

.icon-twitter:before {
	content: "\ea96";
}

.icon-rss2:before {
	content: "\ea9c";
}

.icon-youtube:before {
	content: "\ea9d";
}

.icon-vimeo2:before {
	content: "\eaa1";
}

.icon-github:before {
	content: "\eab0";
}

.icon-skype:before {
	content: "\eac5";
}

.icon-linkedin:before {
	content: "\eac9";
}

.icon-pinterest:before {
	content: "\ead1";
}

#ForumContainer .newIndicator a {
	text-decoration: none;
}
#ForumContainer .topicIndicator {
	font-size: 2em;
	width: 40px;
}

#ForumContainer .topicIndicator .topicIndicatorBadge {
	position: relative;
	font-size: 60%;
	text-shadow: -2px 0 white, 0 2px white, 2px 0 white, 0 -2px white;
}
#ForumContainer .topicIndicator .soloLeftBadge {
	left: -95%;
}
#ForumContainer .topicIndicator .firstBadge {
	left: -25%;
}
#ForumContainer .topicIndicator .secondBadge {
	left: -145%;
}

#ForumContainer #Profile div.row div {
	padding:.5em;
}

{'repo_name': 'POPWorldMedia/POPForums', 'stars': '134', 'repo_language': 'C#', 'file_name': 'index.md', 'mime_type': 'text/plain', 'hash': 4125382759736395439, 'source_dataset': 'data'}


/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You 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 org.apache.carbondata.core.scan.filter;

import java.util.BitSet;

import org.apache.carbondata.core.metadata.AbsoluteTableIdentifier;
import org.apache.carbondata.core.metadata.encoder.Encoding;
import org.apache.carbondata.core.metadata.schema.table.column.CarbonColumn;
import org.apache.carbondata.core.scan.expression.BinaryExpression;
import org.apache.carbondata.core.scan.expression.Expression;
import org.apache.carbondata.core.scan.expression.LiteralExpression;
import org.apache.carbondata.core.scan.expression.conditional.BinaryConditionalExpression;
import org.apache.carbondata.core.scan.expression.conditional.ConditionalExpression;
import org.apache.carbondata.core.scan.expression.conditional.GreaterThanEqualToExpression;
import org.apache.carbondata.core.scan.expression.conditional.InExpression;
import org.apache.carbondata.core.scan.expression.conditional.LessThanExpression;
import org.apache.carbondata.core.scan.expression.conditional.StartsWithExpression;
import org.apache.carbondata.core.scan.expression.exception.FilterUnsupportedException;
import org.apache.carbondata.core.scan.expression.logical.AndExpression;
import org.apache.carbondata.core.scan.expression.logical.OrExpression;
import org.apache.carbondata.core.scan.expression.logical.TrueExpression;
import org.apache.carbondata.core.scan.filter.executer.FilterExecutor;
import org.apache.carbondata.core.scan.filter.executer.ImplicitColumnFilterExecutor;
import org.apache.carbondata.core.scan.filter.intf.ExpressionType;
import org.apache.carbondata.core.scan.filter.resolver.ConditionalFilterResolverImpl;
import org.apache.carbondata.core.scan.filter.resolver.FilterResolverIntf;
import org.apache.carbondata.core.scan.filter.resolver.LogicalFilterResolverImpl;
import org.apache.carbondata.core.scan.filter.resolver.RowLevelFilterResolverImpl;
import org.apache.carbondata.core.scan.filter.resolver.RowLevelRangeFilterResolverImpl;
import org.apache.carbondata.core.scan.filter.resolver.resolverinfo.FalseConditionalResolverImpl;
import org.apache.carbondata.core.scan.filter.resolver.resolverinfo.TrueConditionalResolverImpl;

public class FilterExpressionProcessor implements FilterProcessor {
  /**
   * Implementation will provide the resolved form of filters based on the
   * filter expression tree which is been passed in Expression instance.
   *
   * @param expressionTree  , filter expression tree
   * @param tableIdentifier ,contains carbon store information
   * @return a filter resolver tree
   */
  public FilterResolverIntf getFilterResolver(Expression expressionTree,
      AbsoluteTableIdentifier tableIdentifier) throws FilterUnsupportedException {
    if (null != expressionTree && null != tableIdentifier) {
      return getFilterResolverTree(expressionTree, tableIdentifier);
    }
    return null;
  }

  /**
   * API will return a filter resolver instance which will be used by
   * executors to evaluate or execute the filters.
   *
   * @param expressionTree , resolver tree which will hold the resolver tree based on
   *                       filter expression.
   * @return FilterResolverIntf type.
   */
  private FilterResolverIntf getFilterResolverTree(Expression expressionTree,
      AbsoluteTableIdentifier tableIdentifier) throws FilterUnsupportedException {
    FilterResolverIntf filterEvaluatorTree =
        createFilterResolverTree(expressionTree, tableIdentifier);
    traverseAndResolveTree(filterEvaluatorTree, tableIdentifier);
    return filterEvaluatorTree;
  }

  /**
   * constructing the filter resolver tree based on filter expression.
   * this method will visit each node of the filter resolver and prepares
   * the surrogates of the filter members which are involved filter
   * expression.
   *
   * @param filterResolverTree
   * @param tableIdentifier
   */
  private void traverseAndResolveTree(FilterResolverIntf filterResolverTree,
      AbsoluteTableIdentifier tableIdentifier)
      throws FilterUnsupportedException {
    if (null == filterResolverTree) {
      return;
    }
    traverseAndResolveTree(filterResolverTree.getLeft(), tableIdentifier);
    filterResolverTree.resolve();
    traverseAndResolveTree(filterResolverTree.getRight(), tableIdentifier);
  }

  /**
   * Pattern used : Visitor Pattern
   * Method will create filter resolver tree based on the filter expression tree,
   * in this algorithm based on the expression instance the resolvers will created
   *
   * @param expressionTree
   * @param tableIdentifier
   * @return
   */
  private FilterResolverIntf createFilterResolverTree(Expression expressionTree,
      AbsoluteTableIdentifier tableIdentifier) {
    ExpressionType filterExpressionType = expressionTree.getFilterExpressionType();
    BinaryExpression currentExpression = null;
    switch (filterExpressionType) {
      case OR:
      case AND:
        currentExpression = (BinaryExpression) expressionTree;
        return new LogicalFilterResolverImpl(
            createFilterResolverTree(currentExpression.getLeft(), tableIdentifier),
            createFilterResolverTree(currentExpression.getRight(), tableIdentifier),
            currentExpression);
      case RANGE:
        return getFilterResolverBasedOnExpressionType(ExpressionType.RANGE, true,
            expressionTree, tableIdentifier, expressionTree);
      case EQUALS:
      case IN:
        return getFilterResolverBasedOnExpressionType(ExpressionType.EQUALS,
            ((BinaryConditionalExpression) expressionTree).isNull, expressionTree,
            tableIdentifier, expressionTree);
      case GREATERTHAN:
      case GREATERTHAN_EQUALTO:
      case LESSTHAN:
      case LESSTHAN_EQUALTO:
        return getFilterResolverBasedOnExpressionType(ExpressionType.EQUALS, true, expressionTree,
            tableIdentifier, expressionTree);
      case STARTSWITH:
        assert (expressionTree instanceof StartsWithExpression);
        currentExpression = (StartsWithExpression) expressionTree;
        Expression re = currentExpression.getRight();
        assert (re instanceof LiteralExpression);
        LiteralExpression literal = (LiteralExpression) re;
        String value = literal.getLiteralExpValue().toString();
        Expression left = new GreaterThanEqualToExpression(currentExpression.getLeft(), literal);
        String maxValueLimit = value.substring(0, value.length() - 1) + (char) (
            ((int) value.charAt(value.length() - 1)) + 1);
        Expression right = new LessThanExpression(currentExpression.getLeft(),
            new LiteralExpression(maxValueLimit, literal.getLiteralExpDataType()));
        currentExpression = new AndExpression(left, right);
        return new LogicalFilterResolverImpl(
            createFilterResolverTree(currentExpression.getLeft(), tableIdentifier),
            createFilterResolverTree(currentExpression.getRight(), tableIdentifier),
            currentExpression);
      case NOT_EQUALS:
      case NOT_IN:
        return getFilterResolverBasedOnExpressionType(ExpressionType.NOT_EQUALS, false,
            expressionTree, tableIdentifier, expressionTree);
      case FALSE:
        return getFilterResolverBasedOnExpressionType(ExpressionType.FALSE, false,
            expressionTree, tableIdentifier, expressionTree);
      case TRUE:
        return getFilterResolverBasedOnExpressionType(ExpressionType.TRUE, false,
            expressionTree, tableIdentifier, expressionTree);
      default:
        return getFilterResolverBasedOnExpressionType(ExpressionType.UNKNOWN, false, expressionTree,
            tableIdentifier, expressionTree);
    }
  }

  /**
   * Factory method which will return the resolver instance based on filter expression
   * expressions.
   */
  private FilterResolverIntf getFilterResolverBasedOnExpressionType(
      ExpressionType filterExpressionType, boolean isExpressionResolve, Expression expression,
      AbsoluteTableIdentifier tableIdentifier, Expression expressionTree) {
    BinaryConditionalExpression currentCondExpression = null;
    ConditionalExpression condExpression = null;
    switch (filterExpressionType) {
      case FALSE:
        return new FalseConditionalResolverImpl(expression, false, false);
      case TRUE:
        return new TrueConditionalResolverImpl(expression, false, false);
      case EQUALS:
        currentCondExpression = (BinaryConditionalExpression) expression;
        // check for implicit column in the expression
        if (currentCondExpression instanceof InExpression) {
          CarbonColumn carbonColumn =
              currentCondExpression.getColumnList().get(0).getCarbonColumn();
          if (carbonColumn.hasEncoding(Encoding.IMPLICIT)) {
            return new ConditionalFilterResolverImpl(expression, isExpressionResolve, true,
                currentCondExpression.getColumnList().get(0).getCarbonColumn().isMeasure());
          }
        }

        CarbonColumn column = currentCondExpression.getColumnList().get(0).getCarbonColumn();
        if (currentCondExpression.isSingleColumn() && !column.getDataType().isComplexType()) {
          // In case of Range Column Dictionary Include we do not need to resolve the range
          // expression as it is already resolved and has the surrogates in the filter value
          if (FilterUtil.checkIfExpressionContainsColumn(currentCondExpression.getLeft())
              && FilterUtil.checkIfExpressionContainsColumn(currentCondExpression.getRight()) || (
              FilterUtil.checkIfRightExpressionRequireEvaluation(currentCondExpression.getRight())
                  || FilterUtil
                  .checkIfLeftExpressionRequireEvaluation(currentCondExpression.getLeft()))) {
            return new RowLevelFilterResolverImpl(expression, isExpressionResolve, true,
                tableIdentifier);
          }
          if (currentCondExpression.getFilterExpressionType() == ExpressionType.GREATERTHAN
              || currentCondExpression.getFilterExpressionType() == ExpressionType.LESSTHAN
              || currentCondExpression.getFilterExpressionType()
              == ExpressionType.GREATERTHAN_EQUALTO
              || currentCondExpression.getFilterExpressionType()
              == ExpressionType.LESSTHAN_EQUALTO) {
            return new RowLevelRangeFilterResolverImpl(expression, isExpressionResolve, true,
                tableIdentifier);
          }
          return new ConditionalFilterResolverImpl(expression, isExpressionResolve, true,
              column.isMeasure());

        }
        break;
      case RANGE:
        return new ConditionalFilterResolverImpl(expression, isExpressionResolve, true, false);
      case NOT_EQUALS:
        currentCondExpression = (BinaryConditionalExpression) expression;
        column = currentCondExpression.getColumnList().get(0).getCarbonColumn();
        if (currentCondExpression.isSingleColumn() && !column.getDataType().isComplexType()) {
          if (FilterUtil.checkIfExpressionContainsColumn(currentCondExpression.getLeft())
              && FilterUtil.checkIfExpressionContainsColumn(currentCondExpression.getRight()) || (
              FilterUtil.checkIfRightExpressionRequireEvaluation(currentCondExpression.getRight())
                  || FilterUtil
                  .checkIfLeftExpressionRequireEvaluation(currentCondExpression.getLeft()))) {
            return new RowLevelFilterResolverImpl(expression, isExpressionResolve, false,
                tableIdentifier);
          }
          if (expressionTree.getFilterExpressionType() == ExpressionType.GREATERTHAN
              || expressionTree.getFilterExpressionType() == ExpressionType.LESSTHAN
              || expressionTree.getFilterExpressionType() == ExpressionType.GREATERTHAN_EQUALTO
              || expressionTree.getFilterExpressionType() == ExpressionType.LESSTHAN_EQUALTO) {

            return new RowLevelRangeFilterResolverImpl(expression, isExpressionResolve, false,
                tableIdentifier);
          }

          return new ConditionalFilterResolverImpl(expression, isExpressionResolve, false,
              column.isMeasure());
        }
        break;

      default:
        if (expression instanceof ConditionalExpression) {
          condExpression = (ConditionalExpression) expression;
          column = condExpression.getColumnList().get(0).getCarbonColumn();
          if (condExpression.isSingleColumn() && !column.isComplex()) {
            condExpression = (ConditionalExpression) expression;
            if (condExpression.getColumnList().get(0).getCarbonColumn().isMeasure()) {
              return new ConditionalFilterResolverImpl(expression, true, true,
                  condExpression.getColumnList().get(0).getCarbonColumn().isMeasure());
            }
          }
        }
    }
    return new RowLevelFilterResolverImpl(expression, false, false, tableIdentifier);
  }

  public static boolean isScanRequired(FilterExecutor filterExecutor, byte[][] maxValue,
      byte[][] minValue, boolean[] isMinMaxSet) {
    if (filterExecutor instanceof ImplicitColumnFilterExecutor) {
      return ((ImplicitColumnFilterExecutor) filterExecutor)
          .isFilterValuesPresentInAbstractIndex(maxValue, minValue, isMinMaxSet);
    } else {
      // otherwise decide based on min/max value
      BitSet bitSet = filterExecutor.isScanRequired(maxValue, minValue, isMinMaxSet);
      return !bitSet.isEmpty();
    }
  }

  /**
   * Remove UnknownExpression and change to TrueExpression
   *
   * @param expressionTree
   * @return expressionTree without UnknownExpression
   */
  public Expression removeUnknownExpression(Expression expressionTree) {
    ExpressionType filterExpressionType = expressionTree.getFilterExpressionType();
    BinaryExpression currentExpression = null;
    switch (filterExpressionType) {
      case OR:
        currentExpression = (BinaryExpression) expressionTree;
        return new OrExpression(
                removeUnknownExpression(currentExpression.getLeft()),
                removeUnknownExpression(currentExpression.getRight())
        );
      case AND:
        currentExpression = (BinaryExpression) expressionTree;
        return new AndExpression(
                removeUnknownExpression(currentExpression.getLeft()),
                removeUnknownExpression(currentExpression.getRight())
        );
      case UNKNOWN:
        return new TrueExpression(null);
      default:
        return expressionTree;
    }
  }

  /**
   * Change UnknownResolver to TrueExpression Resolver.
   *
   * @param tableIdentifier
   * @return
   */
  public FilterResolverIntf changeUnknownResolverToTrue(AbsoluteTableIdentifier tableIdentifier) {
    return getFilterResolverBasedOnExpressionType(ExpressionType.TRUE, false,
        new TrueExpression(null), tableIdentifier, new TrueExpression(null));

  }
}

{'repo_name': 'apache/carbondata', 'stars': '1075', 'repo_language': 'Scala', 'file_name': 'ArrowCarbonReaderTest.java', 'mime_type': 'text/x-java', 'hash': -2010638565201502270, 'source_dataset': 'data'}


fileFormatVersion: 2
guid: ffe6a388a543b98488dfeec1e73a8c9e
timeCreated: 1480605800
licenseType: Pro
TextureImporter:
  fileIDToRecycleName: {}
  serializedVersion: 2
  mipmaps:
    mipMapMode: 0
    enableMipMap: 1
    linearTexture: 0
    correctGamma: 0
    fadeOut: 0
    borderMipMap: 0
    mipMapFadeDistanceStart: 1
    mipMapFadeDistanceEnd: 3
  bumpmap:
    convertToNormalMap: 0
    externalNormalMap: 0
    heightScale: .25
    normalMapFilter: 0
  isReadable: 0
  grayScaleToAlpha: 0
  generateCubemap: 0
  cubemapConvolution: 0
  cubemapConvolutionSteps: 8
  cubemapConvolutionExponent: 1.5
  seamlessCubemap: 0
  textureFormat: -1
  maxTextureSize: 1024
  textureSettings:
    filterMode: -1
    aniso: -1
    mipBias: -1
    wrapMode: -1
  nPOTScale: 1
  lightmap: 0
  rGBM: 0
  compressionQuality: 50
  spriteMode: 0
  spriteExtrude: 1
  spriteMeshType: 1
  alignment: 0
  spritePivot: {x: .5, y: .5}
  spriteBorder: {x: 0, y: 0, z: 0, w: 0}
  spritePixelsToUnits: 100
  alphaIsTransparency: 0
  textureType: -1
  buildTargetSettings: []
  spriteSheet:
    sprites: []
  spritePackingTag:
  userData:
  assetBundleName:
  assetBundleVariant:

{'repo_name': 'lllyasviel/YGOProUnity_V2', 'stars': '115', 'repo_language': 'C#', 'file_name': 'AudioManager.asset', 'mime_type': 'text/plain', 'hash': -2556202430316519794, 'source_dataset': 'data'}


#!/usr/bin/env python
# encoding: utf-8
#
# Copyright SAS Institute
#
#  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.
#

# NOTE: This test requires a running CAS server.  You must use an ~/.authinfo
#       file to specify your username and password.  The CAS host and port must
#       be specified using the CASHOST and CASPORT environment variables.
#       A specific protocol ('cas', 'http', 'https', or 'auto') can be set using
#       the CASPROTOCOL environment variable.
#

import os
import swat
import swat.utils.testing as tm
from dlpy.model import Model
from dlpy.layers import *
from dlpy.utils import DLPyError
from dlpy import Sequential
import unittest

class TestNetwork(unittest.TestCase):
    # Create a class attribute to hold the cas host type
    server_type = None
    s = None

    def setUp(self):
        swat.reset_option()
        swat.options.cas.print_messages = False
        swat.options.interactive_mode = False

        self.s = swat.CAS()
        self.server_type = tm.get_cas_host_type(self.s)

        if self.server_type.startswith("lin") or self.server_type.startswith("osx"):
            self.server_sep = '/'

        if 'DLPY_DATA_DIR' in os.environ:
            self.data_dir = os.environ.get('DLPY_DATA_DIR')
            if self.data_dir.endswith(self.server_sep):
                self.data_dir = self.data_dir[:-1]
            self.data_dir += self.server_sep

        if 'DLPY_DATA_DIR_LOCAL' in os.environ:
            self.data_dir_local = os.environ.get('DLPY_DATA_DIR_LOCAL')
            if self.data_dir_local.endswith(self.server_sep):
                self.data_dir_local = self.data_dir_local[:-1]
            self.data_dir_local += self.server_sep

    def test_network_option_type(self):
        input1 = Input(n_channels = 1, width = 28, height = 28)
        conv1 = Conv2d(2)(input1)
        conv2 = Conv2d(2)(input1)
        concat1 = Concat()([conv1, conv2])
        output1 = OutputLayer(n=2)(concat1)
        model1 = Model(conn = self.s, inputs = [input1], outputs = output1)
        model1.compile()
        model1.print_summary()
        self.assertTrue(model1.count_params() == 6314)

        model2 = Model(conn = self.s, inputs = input1, outputs = output1)
        model2.compile()
        model2.print_summary()
        model2.plot_network()
        self.assertTrue(model2.count_params() == 6314)

    def test_concat(self):
        input1 = Input(n_channels=1, width=28, height=28)
        input2 = Input(n_channels=3, width=28, height=28)
        conv1 = Conv2d(2)(input1)
        conv2 = Conv2d(2)(input1)
        conv3 = Conv2d(2)(input2)
        output2 = OutputLayer(n=2)(conv3)
        concat1 = Concat()([conv1, conv2, conv3])
        output1 = OutputLayer(n=2)(concat1)
        model1 = Model(conn=self.s, inputs=[input1, input2], outputs=[output1, output2])
        model1.compile()
        model1.print_summary()
        self.assertTrue(model1.count_params() == 12644)

    def test_inputs(self):
        conv1 = Conv2d(2)
        with self.assertRaises(ValueError):
            output1 = OutputLayer(2)(conv1)
            Model(conn=self.s, inputs=[conv1], outputs=[output1])

    def test_without_variable(self):
        input1 = Input(n_channels=1, width=28, height=28)
        conv1 = Conv2d(2)(Conv2d(2)(input1))
        output1 = OutputLayer(n=2)(conv1)
        model1 = Model(conn=self.s, inputs=[input1], outputs=[output1])
        model1.compile()
        model1.print_summary()
        self.assertTrue(model1.count_params() == 3196)

    def test_multiple_inputs_outputs(self):
        input1 = Input(n_channels=1, width=28, height=28)
        input2 = Input(n_channels=3, width=28, height=28)
        conv1 = Conv2d(2)(Conv2d(2)(input1))
        conv2 = Conv2d(2)(input1)
        conv3 = Conv2d(2)(input2)
        output2 = OutputLayer(n=2)(conv3)
        concat1 = Concat()([conv1, conv2, conv3])
        output1 = OutputLayer(n=2)(concat1)
        model1 = Model(conn=self.s, inputs=[input1, input2], outputs=[output1, output2])
        model1.compile()
        model1.print_summary()
        self.assertTrue(model1.count_params() == 12682)

    def test_given_name(self):
        inputs = Input(3, 512, 512, scale=1.0 / 255, name='input1')
        conv1 = Conv2d(8, 3, act='relu')(inputs)
        conv2 = Conv2d(8, 3, act='relu')(inputs)
        merge3 = Concat()([conv1, conv2])
        conv3 = Conv2d(3, 3, act='relu')(merge3)
        output1 = OutputLayer(name='output1')(conv3)
        model = Model(self.s, inputs=inputs, outputs=output1)
        model.compile()
        self.assertTrue(inputs._op.name == 'input1')
        self.assertTrue(output1._op.name == 'output1')
        model.print_summary()

    def test_multi_src_layer_fc(self):
        inputs = Input(1, 28, 28, scale=1.0 / 255, name='InputLayer_1')
        fc1 = Dense(n=128, name = 'dense1')(inputs)
        fc2 = Dense(n=64, name = 'dense2')(fc1)
        fc3 = Dense(n=64, name = 'dense3')([fc1, fc2])
        output1 = OutputLayer(n=10, name='OutputLayer_1')(fc3)
        model = Model(self.s, inputs=inputs, outputs=output1)
        model.compile()
        self.assertTrue(model.count_params() == 117386)

    def test_single_src_layer_list_fc(self):
        inputs = Input(1, 28, 28, scale=1.0 / 255, name='InputLayer_1')
        fc1 = Dense(n=128)(inputs)
        fc3 = Dense(n=64)([fc1])
        output1 = OutputLayer(n=10, name='OutputLayer_1')(fc3)
        model = Model(self.s, inputs=inputs, outputs=output1)
        model.compile()
        self.assertTrue(model.count_params() == 109194)

    def test_non_list_src_layers(self):
        inputs = Input(1, 28, 28, scale=1.0 / 255, name='InputLayer_1')
        fc1 = Dense(n=128)(inputs)
        fc2 = Dense(n=64)(fc1)
        output1 = OutputLayer(n=10, name='OutputLayer_1')([fc1, fc2])
        model = Model(self.s, inputs=inputs, outputs=output1)
        model.compile()
        model.print_summary()
        self.assertTrue(model.count_params() == 109834)

    def test_duplicated_src_layers_call(self):
        inputs = Input(1, 28, 28, scale=1.0 / 255, name='InputLayer_1')
        fc1 = Dense(n=128)(inputs)
        fc2 = Dense(n=64)(fc1)
        output1 = OutputLayer(n=10, name='OutputLayer_1')(fc1)
        model = Model(self.s, inputs=inputs, outputs=output1)
        model.compile()
        # self.assertTrue(len(fc1.src_layers) == 1)

    def test_raise_conv_multi_src(self):
        with self.assertRaises(DLPyError):
            inputs = Input(3, 512, 512, scale=1.0 / 255, name='input1')
            conv1 = Conv2d(8, 3, act='relu')(inputs)
            conv2 = Conv2d(8, 3, act='relu')(inputs)
            conv3 = Conv2d(8, 3)([conv1, conv2])
            output1 = OutputLayer(name='output1')(conv3)
            model = Model(self.s, inputs=inputs, outputs=output1)
            model.compile()

    # def test_lack_inputs_outputs(self):
    #     with self.assertRaises(DLPyError):
    #         inputs = Input(3, 512, 512, scale=1.0 / 255, name='input1')
    #         conv1 = Conv2d(8, 3, act='relu')(inputs)
    #         conv2 = Conv2d(8, 3, act='relu')(inputs)
    #         conv3 = Conv2d(8, 3)([conv1])
    #         output1 = OutputLayer(name='output1')(conv3)
    #         model = Model(self.s, inputs=inputs)
    #         model.compile()
    #
    #     with self.assertRaises(DLPyError):
    #         inputs = Input(3, 512, 512, scale=1.0 / 255, name='input1')
    #         conv1 = Conv2d(8, 3, act='relu')(inputs)
    #         conv2 = Conv2d(8, 3, act='relu')(inputs)
    #         conv3 = Conv2d(8, 3)([conv1])
    #         output1 = OutputLayer(name='output1')(conv3)
    #         model = Model(self.s, outputs=output1)
    #         model.compile()

    def test_submodel_as_input_network(self):
        inputs1 = Input(1, 53, 53, scale=1.0 / 255, name='InputLayer_1')
        # inputs2 = InputLayer(1, 28, 28, scale = 1.0 / 255, name = 'InputLayer_2')
        dense1 = Dense(10, name='dense1')(inputs1)
        dense2 = Dense(12, name='dense2')(dense1)
        dense3 = Dense(n=128, name='dense3')(dense2)
        model_dense = Model(self.s, inputs=inputs1, outputs= dense3)

        inputs2 = Input(1, 53, 53, scale=1.0 / 255, name='InputLayer_2')
        out_submodel = model_dense(inputs2)

        concat1 = Dense(20, 'concat1')(out_submodel)
        output1 = OutputLayer(n=10, name='OutputLayer_1')(concat1)
        model = Model(self.s, inputs=[inputs2], outputs=output1)
        model.compile()
        model.print_summary()
        self.assertTrue(model.count_params() == 32516)

    def test_submodel_as_inputs_network(self):
        inputs1 = Input(1, 53, 53, scale=1.0 / 255, name='InputLayer_1')
        # inputs2 = InputLayer(1, 28, 28, scale = 1.0 / 255, name = 'InputLayer_2')
        dense1 = Dense(10, name = 'd1')(inputs1)
        dense2 = Dense(12, name = 'd2')(dense1)
        dense3 = Dense(n=128, name = 'd3')(dense2)
        model_dense = Model(self.s, inputs=inputs1, outputs= dense3)

        inputs2 = Input(1, 53, 53, scale = 1.0 / 255, name = 'InputLayer_2')
        # inputs2 = InputLayer(1, 28, 28, scale = 1.0 / 255, name = 'InputLayer_2')
        dense4 = Dense(10, name = 'd4')(inputs2)
        dense5 = Dense(12, name = 'd5')(dense4)
        dense6 = Dense(n = 128, name = 'd6')(dense5)
        model_dense2 = Model(self.s, inputs = inputs2, outputs = dense6)

        inputs3 = Input(1, 53, 53, scale = 1.0 / 255, name = 'InputLayer_3')
        inputs4 = Input(1, 53, 53, scale = 1.0 / 255, name = 'InputLayer_4')
        out3 = model_dense(inputs3)
        out4 = model_dense2(inputs4)

        out5 = [out4[0], out3[0]]

        concat1 = Dense(20, name = 'd7')(out5)
        output1 = OutputLayer(n=10, name='OutputLayer_1')(concat1)
        model = Model(self.s, inputs=[inputs3, inputs4], outputs=output1)
        model.compile()
        model.print_summary()
        self.assertTrue(model.count_params() == 62262)

    def test_submodel_in_middle_network(self):
        inputs1 = Input(1, 53, 53, scale=1.0 / 255, name='InputLayer_1')
        inputs2 = Input(1, 28, 28, scale = 1.0 / 255, name = 'InputLayer_2')
        dense1 = Dense(10, name = 'd1')(inputs2)
        dense2 = Dense(12, name = 'd2')(dense1)
        dense3 = Dense(n=128, name = 'd3')(dense2)
        model_dense = Model(self.s, inputs=inputs2, outputs= dense3)

        fore = model_dense(inputs1)

        concat1 = Dense(20, name = 'd7')(fore)
        output1 = OutputLayer(n = 10, name = 'OutputLayer_1')(concat1)

        model = Model(self.s, inputs=[inputs1], outputs=output1)
        model.compile()
        model.print_summary()
        self.assertTrue(model.count_params() == 32516)

    def test_submodel_multiple_inputs_network(self):
        inputs1 = Input(1, 53, 53, scale=1.0 / 255, name='InputLayer_1')
        # inputs2 = InputLayer(1, 28, 28, scale = 1.0 / 255, name = 'InputLayer_2')
        dense1 = Dense(10, name = 'd1')(inputs1)
        dense2 = Dense(12, name = 'd2')(dense1)
        dense3 = Dense(n=128, name = 'd3')(dense2)
        # model_dense = Model(self.s, inputs=inputs1, outputs= dense3)

        inputs2 = Input(1, 53, 53, scale = 1.0 / 255, name = 'InputLayer_2')
        # inputs2 = InputLayer(1, 28, 28, scale = 1.0 / 255, name = 'InputLayer_2')
        dense4 = Dense(10, name = 'd4')(inputs2)
        dense5 = Dense(12, name = 'd5')(dense4)
        dense6 = Dense(n = 128, name = 'd6')(dense5)
        dense7 = Dense(n =190, name = 'cat1')([dense3, dense6])
        model_dense = Model(self.s, inputs = [inputs1, inputs2], outputs = [dense7])

        input3 = Input(1, 53, 53, scale = 1.0 / 255, name = 'InputLayer_3')
        input4 = Input(1, 53, 53, scale = 1.0 / 255, name = 'InputLayer_4')

        out = model_dense([input3, input4])

        dense7 = Dense(20, name = 'd7')(out)
        output1 = OutputLayer(n=10, name='OutputLayer_1')(dense7)
        model = Model(self.s, inputs=[input3, input4], outputs=output1)
        model.compile()
        model.print_summary()
        self.assertTrue(model.count_params() == 87822)

    def test_submodel_multiple_inputs_in_middle_network(self):
        inputs3 = Input(1, 53, 53, scale = 1.0 / 255, name = 'InputLayer_3')
        inputs4 = Input(1, 53, 53, scale = 1.0 / 255, name = 'InputLayer_4')

        inputs1 = Input(1, 53, 53, scale=1.0 / 255, name='InputLayer_1')
        # inputs2 = InputLayer(1, 28, 28, scale = 1.0 / 255, name = 'InputLayer_2')
        dense1 = Dense(10, name = 'd1')(inputs1)
        dense2 = Dense(12, name = 'd2')(dense1)
        dense3 = Dense(n=128, name = 'd3')(dense2)
        # model_dense = Model(self.s, inputs=inputs1, outputs= dense3)

        inputs2 = Input(1, 53, 53, scale = 1.0 / 255, name = 'InputLayer_2')
        # inputs2 = InputLayer(1, 28, 28, scale = 1.0 / 255, name = 'InputLayer_2')
        dense4 = Dense(10, name = 'd4')(inputs2)
        dense5 = Dense(12, name = 'd5')(dense4)
        dense6 = Dense(n = 128, name = 'd6')(dense5)
        dense7 = Dense(n =190, name = 'cat1')([dense3, dense6])

        model_dense = Model(self.s, inputs = [inputs1, inputs2], outputs = [dense7])
        sub_model = model_dense([inputs3, inputs4])

        dense7 = Dense(20, name = 'd7')(sub_model)
        output1 = OutputLayer(n=10, name='OutputLayer_1')(dense7)
        model = Model(self.s, inputs=[inputs3, inputs4], outputs=output1)
        model.compile()
        model.print_summary()

    def test_resnet(self):
        def conv_block(x, filters, size, stride = 1, mode = 'same', act = True):
            x = Conv2d(filters, size, size, act = 'identity', include_bias = False, stride = stride)(x)
            x = BN(act = 'relu' if act else 'identity')(x)
            return x

        def res_block(ip, nf = 64):
            x = conv_block(ip, nf, 3, 1)
            x = conv_block(x, nf, 3, 1, act = False)
            return Res()([x, ip])

        inp = Input(1, 32, 32, scale = 1.0 / 255, name = 'InputLayer_1')
        x = conv_block(inp, 64, 9, 1)
        for i in range(1): x = res_block(x)
        x = Conv2d(1, 9, 9, act = 'tanh')(x)
        output = OutputLayer(n = 100)(x)
        model = Model(self.s, inputs = inp, outputs = output)
        model.compile()

    def test_sequential_conversion(self):
        from dlpy.sequential import Sequential
        model1 = Sequential(self.s)
        model1.add(InputLayer(3, 224, 224))
        model1.add(Conv2d(8, 7))
        model1.add(Pooling(2))
        model1.add(Conv2d(8, 7))
        model1.add(Pooling(2))
        model1.add(Dense(16))
        model1.add(OutputLayer(act = 'softmax', n = 2))

        func_model = model1.to_functional_model()
        func_model.compile()
        func_model.print_summary()

    def test_stop_layers(self):
        from dlpy.sequential import Sequential
        model1 = Sequential(self.s)
        model1.add(InputLayer(3, 224, 224))
        model1.add(Conv2d(8, 7))
        model1.add(Pooling(2))
        model1.add(Conv2d(8, 7))
        model1.add(Pooling(2))
        model1.add(Dense(16))
        model1.add(OutputLayer(act = 'softmax', n = 2))

        inputlayer = model1.layers[0]
        inp = Input(**inputlayer.config)
        func_model = model1.to_functional_model(stop_layers = [model1.layers[-1]])
        x = func_model(inp)
        out = Keypoints(n=10)(x)
        func_model_keypoints = Model(self.s, inp, out)
        func_model_keypoints.compile()
        func_model_keypoints.print_summary()

    def test_from_model(self):
        from dlpy.applications import ResNet18_Caffe, VGG11
        vgg11 = VGG11(self.s)
        backbone1 = vgg11.to_functional_model(vgg11.layers[-2])
        self.assertEqual(backbone1.layers[-1].__class__.__name__, 'Dense')
        model_resnet18 = ResNet18_Caffe(self.s, n_classes = 6, random_crop = 'none', width = 400, height = 400)
        backbone2 = model_resnet18.to_functional_model(model_resnet18.layers[-3])
        self.assertEqual(backbone2.layers[-1].__class__.__name__, 'BN')

    def test_from_model(self):
        from dlpy.applications import ResNet18_Caffe, VGG11
        vgg11 = VGG11(self.s)
        backbone1 = vgg11.to_functional_model(vgg11.layers[-2])
        self.assertEqual(backbone1.layers[-1].__class__.__name__, 'Dense')
        model_resnet18 = ResNet18_Caffe(self.s, n_classes = 6, random_crop = 'none', width = 400, height = 400)
        backbone2 = model_resnet18.to_functional_model(model_resnet18.layers[-3])
        self.assertEqual(backbone2.layers[-1].__class__.__name__, 'BN')

    def test_multiple_branch(self):
        from dlpy.sequential import Sequential
        model = Sequential(self.s, model_table = 'Simple_CNN')
        model.add(InputLayer(3, 48, 96, scale = 1 / 255, random_mutation = 'none'))
        model.add(Conv2d(64, 7, include_bias = True, act = 'relu'))
        model.add(Pooling(2))
        model.add(Conv2d(64, 3, include_bias = True, act = 'relu'))
        model.add(Pooling(2))
        model.add(Conv2d(64, 3, include_bias = True, act = 'relu'))
        model.add(Pooling(2))
        model.add(Conv2d(64, 3, include_bias = True, act = 'relu'))
        model.add(Pooling(2))
        model.add(Dense(16))
        model.add(OutputLayer(n = 1, act = 'sigmoid'))
        branch = model.to_functional_model(stop_layers = model.layers[-1])
        inp1 = Input(**branch.layers[0].config)  # tensor
        branch1 = branch(inp1)  # tensor
        inp2 = Input(**branch.layers[0].config)  # tensor
        branch2 = branch(inp2)  # tensor
        inp3 = Input(**branch.layers[0].config)  # tensor
        branch3 = branch(inp3)  # tensor
        triplet = OutputLayer(n = 1)(branch1 + branch2 + branch3)
        triplet_model = Model(self.s, inputs = [inp1, inp2, inp3], outputs = triplet)
        triplet_model.compile()
        triplet_model.print_summary()
        self.assertEqual(len(triplet_model.layers), 31)
        triplet_model.share_weights({'Convo.1': ['Convo.1_2', 'Convo.1_3']})
        triplet_model.compile()

    def test_residual_output_shape0(self):
        inLayer = Input(n_channels = 3, width = 32, height = 128,
                        name = 'input1', random_mutation = 'random', random_flip = 'HV')
        conv1 = Conv2d(32, 3, 3, name = 'conv1', act = 'relu', init = 'msra')([inLayer])
        conv2 = Conv2d(32, 5, 5, name = 'conv2', act = 'relu', init = 'msra')([inLayer])
        fc1 = Dense(3, name = 'fc1')([conv1])
        fc2 = Dense(3, name = 'fc2')([conv2])
        res = Res(name = 'res1')([fc1, fc2])
        outLayer = OutputLayer(n = 3, name = 'output')([res])
        model = Model(self.s, inLayer, outLayer)
        model.compile()
        self.assertEqual(model.summary['Output Size'].values[-2], 3)
        model.print_summary()

    def test_stop_layers1(self):
        from dlpy.applications import MobileNetV1
        backbone = MobileNetV1(self.s, width = 1248, height = 1248)
        backbone_pure = backbone.to_functional_model(stop_layers = backbone.layers[-2])
        # expect last layer to be a bn layer right before global average pooling
        self.assertEqual(backbone_pure.output_layers[0].name, 'conv_pw_13_bn')

    def test_stop_layers2(self):
        from dlpy.applications import MobileNetV2
        backbone = MobileNetV2(self.s, width = 1248, height = 1248)
        backbone_pure = backbone.to_functional_model(stop_layers = backbone.layers[-14])
        # expect to get one outputs(block_15_depthwise) since stop layer is in a branch
        # output layer is not a valid output_layers since its dependencies cannot be traversed.
        self.assertEqual(len(backbone_pure.output_layers), 1)

    def test_astore_deploy_wrong_path(self):
        from dlpy.sequential import Sequential
        from dlpy.utils import caslibify
        model1 = Sequential(self.s, model_table='Simple_CNN1')
        model1.add(InputLayer(3, 224, 224))
        model1.add(Conv2d(1, 17))
        model1.add(Pooling(14))
        model1.add(Dense(3))
        model1.add(OutputLayer(act='softmax', n=2))

        if self.data_dir is None:
            tm.TestCase.skipTest(self, "DLPY_DATA_DIR is not set in the environment variables")

        caslib, path, tmp_caslib = caslibify(self.s, path=self.data_dir+'images.sashdat', task='load')

        self.s.table.loadtable(caslib=caslib,
                               casout={'name': 'eee', 'replace': True},
                               path=path)

        r = model1.fit(data='eee', inputs='_image_', target='_label_', save_best_weights=True)

        self.assertTrue(r.severity == 0)

        with self.assertRaises(DLPyError):
            model1.deploy(path='/amran/komran', output_format='astore')

    def test_mix_cnn_rnn_network(self):
        from dlpy.applications import ResNet50_Caffe
        from dlpy import Sequential
        from dlpy.blocks import Bidirectional
        # the case is to test if CNN and RNN model can be connect using functional api
        # the model_type is expected to be RNN in 19w47.
        # CNN
        model = ResNet50_Caffe(self.s)
        cnn_head = model.to_functional_model(stop_layers = model.layers[-1])
        # RNN
        model_rnn = Sequential(conn = self.s, model_table = 'rnn')
        model_rnn.add(Bidirectional(n = 100, n_blocks = 2))
        model_rnn.add(OutputLayer('fixed'))

        f_rnn = model_rnn.to_functional_model()
        # connecting
        inp = Input(**cnn_head.layers[0].config)
        x = cnn_head(inp)
        y = f_rnn(x)
        cnn_rnn = Model(self.s, inp, y)
        cnn_rnn.compile()
        # check type
        self.assertTrue(cnn_rnn.model_type == 'RNN')
        self.assertTrue(cnn_rnn.layers[-1].name == 'fixed')
        self.assertTrue(x[0].shape == (1, 1, 2048))

        f_rnn = model_rnn.to_functional_model()
        # connecting
        inp = Input(**cnn_head.layers[0].config)
        x = cnn_head(inp)
        y = f_rnn(x)
        cnn_rnn = Model(self.s, inp, y)
        cnn_rnn.compile()
        # it should be fixed if I create f_rnn again.
        self.assertTrue(cnn_rnn.layers[-1].name == 'fixed')

        inp = Input(**cnn_head.layers[0].config)
        x = cnn_head(inp)
        y = f_rnn(x)
        cnn_rnn = Model(self.s, inp, y)
        cnn_rnn.compile()
        # it should be fixed if I create f_rnn again.
        self.assertTrue(cnn_rnn.layers[-1].name == 'fixed_2')

    def test_extract_segmentation1(self):
        model = Sequential(self.s, model_table = 'Simple_CNN')
        model.add(InputLayer(3, 48, 96, scale = 1.0 / 255, random_mutation = 'none'))
        model.add(Dense(16))
        model.add(Segmentation(act='AUTO', target_scale=10))
        model_extracted = Model.from_table(self.s.CASTable(model.model_table['name']))
        model_extracted.compile()
        self.assertTrue(model_extracted.layers[-1].config['act'] == 'AUTO')
        self.assertTrue(model_extracted.layers[-1].config['target_scale'] == 10)

    def test_extract_embeddingloss1(self):
        model = Sequential(self.s, model_table = 'Simple_CNN')
        model.add(InputLayer(3, 48, 96, scale = 1.0 / 255, random_mutation = 'none'))
        model.add(Dense(16))
        model.add(EmbeddingLoss(margin=10))
        model_extracted = Model.from_table(self.s.CASTable(model.model_table['name']))
        model_extracted.compile()
        self.assertTrue(model_extracted.layers[-1].config['margin'] == 10)

    def test_extract_clustering1(self):
        model = Sequential(self.s, model_table = 'Simple_CNN')
        model.add(InputLayer(3, 48, 96, scale = 1.0 / 255, random_mutation = 'none'))
        model.add(Dense(16))
        model.add(Clustering(n_clusters=10))
        model_extracted = Model.from_table(self.s.CASTable(model.model_table['name']))
        model_extracted.compile()
        self.assertTrue(model_extracted.layers[-1].config['n_clusters'] == 10)

    def test_extract_clustering1(self):
        model = Sequential(self.s, model_table = 'Simple_CNN')
        model.add(InputLayer(3, 48, 96, scale = 1.0 / 255, random_mutation = 'none'))
        model.add(Split(16))
        model.add(Clustering(n_clusters=10))
        model_extracted = Model.from_table(self.s.CASTable(model.model_table['name']))
        model_extracted.compile()

    def test_multiple_stop_layers1(self):
        from dlpy.applications import ResNet50_Caffe
        resnet50 = ResNet50_Caffe(self.s, "res50")
        stop_layers = [resnet50.layers[x] for x in [-2, 4, -8] ]
        feature_extractor1 = resnet50.to_functional_model(stop_layers=stop_layers)

    def test_multiple_stop_layers2(self):
        from dlpy.applications import MobileNetV1
        resnet50 = MobileNetV1(self.s, "MobileNetV1")
        stop_layers = [resnet50.layers[x] for x in [-2, 4, -8] ]
        feature_extractor1 = resnet50.to_functional_model(stop_layers=stop_layers)

    def tearDown(self):
        # tear down tests
        try:
            self.s.terminate()
        except swat.SWATError:
            pass
        del self.s
        swat.reset_option()

if __name__ == '__main__':
    unittest.main()

{'repo_name': 'sassoftware/python-dlpy', 'stars': '159', 'repo_language': 'Python', 'file_name': 'custom.css', 'mime_type': 'text/plain', 'hash': 547260355504760024, 'source_dataset': 'data'}


<?php

/**
 * stub class representing AMQPQueue from pecl-amqp
 */
class AMQPQueue
{
    /**
     * Acknowledge the receipt of a message.
     *
     * This method allows the acknowledgement of a message that is retrieved
     * without the AMQP_AUTOACK flag through AMQPQueue::get() or
     * AMQPQueue::consume()
     *
     * @param string  $delivery_tag The message delivery tag of which to
     *                              acknowledge receipt.
     * @param integer $flags        The only valid flag that can be passed is
     *                              AMQP_MULTIPLE.
     *
     * @throws AMQPChannelException    If the channel is not open.
     * @throws AMQPConnectionException If the connection to the broker was lost.
     *
     * @return boolean
     */
    public function ack($delivery_tag, $flags = AMQP_NOPARAM)
    {
    }

    /**
     * Bind the given queue to a routing key on an exchange.
     *
     * @param string $exchange_name Name of the exchange to bind to.
     * @param string $routing_key   Pattern or routing key to bind with.
     * @param array  $arguments     Additional binding arguments.
     *
     * @throws AMQPChannelException    If the channel is not open.
     * @throws AMQPConnectionException If the connection to the broker was lost.
     *
     * @return boolean
     */
    public function bind($exchange_name, $routing_key = null, array $arguments = array())
    {
    }

    /**
     * Cancel a queue that is already bound to an exchange and routing key.
     *
     * @param string $consumer_tag The consumer tag cancel. If no tag provided,
     *                             or it is empty string, the latest consumer
     *                             tag on this queue will be used and after
     *                             successful request it will set to null.
     *                             If it also empty, no `basic.cancel`
     *                             request will be sent. When consumer_tag give
     *                             and it equals to latest consumer_tag on queue,
     *                             it will be interpreted as latest consumer_tag usage.
     *
     * @throws AMQPChannelException    If the channel is not open.
     * @throws AMQPConnectionException If the connection to the broker was lost.
     *
     * @return bool;
     */
    public function cancel($consumer_tag = '')
    {
    }

    /**
     * Create an instance of an AMQPQueue object.
     *
     * @param AMQPChannel $amqp_channel The amqp channel to use.
     *
     * @throws AMQPQueueException      When amqp_channel is not connected to a
     *                                 broker.
     * @throws AMQPConnectionException If the connection to the broker was lost.
     */
    public function __construct(AMQPChannel $amqp_channel)
    {
    }

    /**
     * Consume messages from a queue.
     *
     * Blocking function that will retrieve the next message from the queue as
     * it becomes available and will pass it off to the callback.
     *
     * @param callable | null $callback    A callback function to which the
     *                              consumed message will be passed. The
     *                              function must accept at a minimum
     *                              one parameter, an AMQPEnvelope object,
     *                              and an optional second parameter
     *                              the AMQPQueue object from which callback
     *                              was invoked. The AMQPQueue::consume() will
     *                              not return the processing thread back to
     *                              the PHP script until the callback
     *                              function returns FALSE.
     *                              If the callback is omitted or null is passed,
     *                              then the messages delivered to this client will
     *                              be made available to the first real callback
     *                              registered. That allows one to have a single
     *                              callback consuming from multiple queues.
     * @param integer $flags        A bitmask of any of the flags: AMQP_AUTOACK,
     *                              AMQP_JUST_CONSUME. Note: when AMQP_JUST_CONSUME
     *                              flag used all other flags are ignored and
     *                              $consumerTag parameter has no sense.
     *                              AMQP_JUST_CONSUME flag prevent from sending
     *                              `basic.consume` request and just run $callback
     *                              if it provided. Calling method with empty $callback
     *                              and AMQP_JUST_CONSUME makes no sense.
     * @param string   $consumerTag A string describing this consumer. Used
     *                              for canceling subscriptions with cancel().
     *
     * @throws AMQPChannelException    If the channel is not open.
     * @throws AMQPConnectionException If the connection to the broker was lost.
     * @throws AMQPEnvelopeException   When no queue found for envelope.
     *
     * @return void
     */
    public function consume(
        callable $callback = null,
        $flags = AMQP_NOPARAM,
        $consumerTag = null
    ) {
    }

    /**
     * Declare a new queue on the broker.
     *
     * @throws AMQPChannelException    If the channel is not open.
     * @throws AMQPConnectionException If the connection to the broker was lost.
     *
     * @return integer the message count.
     */
    public function declareQueue()
    {
    }

    /**
     * Delete a queue from the broker.
     *
     * This includes its entire contents of unread or unacknowledged messages.
     *
     * @param integer $flags        Optionally AMQP_IFUNUSED can be specified
     *                              to indicate the queue should not be
     *                              deleted until no clients are connected to
     *                              it.
     *
     * @throws AMQPChannelException    If the channel is not open.
     * @throws AMQPConnectionException If the connection to the broker was lost.
     *
     * @return integer The number of deleted messages.
     */
    public function delete($flags = AMQP_NOPARAM)
    {
    }

    /**
     * Retrieve the next message from the queue.
     *
     * Retrieve the next available message from the queue. If no messages are
     * present in the queue, this function will return FALSE immediately. This
     * is a non blocking alternative to the AMQPQueue::consume() method.
     * Currently, the only supported flag for the flags parameter is
     * AMQP_AUTOACK. If this flag is passed in, then the message returned will
     * automatically be marked as acknowledged by the broker as soon as the
     * frames are sent to the client.
     *
     * @param integer $flags A bitmask of supported flags for the
     *                       method call. Currently, the only the
     *                       supported flag is AMQP_AUTOACK. If this
     *                       value is not provided, it will use the
     *                       value of ini-setting amqp.auto_ack.
     *
     * @throws AMQPChannelException    If the channel is not open.
     * @throws AMQPConnectionException If the connection to the broker was lost.
     *
     * @return AMQPEnvelope|boolean
     */
    public function get($flags = AMQP_NOPARAM)
    {
    }

    /**
     * Get the argument associated with the given key.
     *
     * @param string $key The key to look up.
     *
     * @return string|integer|boolean The string or integer value associated
     *                                with the given key, or false if the key
     *                                is not set.
     */
    public function getArgument($key)
    {
    }

    /**
     * Get all set arguments as an array of key/value pairs.
     *
     * @return array An array containing all of the set key/value pairs.
     */
    public function getArguments()
    {
    }

    /**
     * Get all the flags currently set on the given queue.
     *
     * @return int An integer bitmask of all the flags currently set on this
     *             exchange object.
     */
    public function getFlags()
    {
    }

    /**
     * Get the configured name.
     *
     * @return string The configured name as a string.
     */
    public function getName()
    {
    }

    /**
     * Mark a message as explicitly not acknowledged.
     *
     * Mark the message identified by delivery_tag as explicitly not
     * acknowledged. This method can only be called on messages that have not
     * yet been acknowledged, meaning that messages retrieved with by
     * AMQPQueue::consume() and AMQPQueue::get() and using the AMQP_AUTOACK
     * flag are not eligible. When called, the broker will immediately put the
     * message back onto the queue, instead of waiting until the connection is
     * closed. This method is only supported by the RabbitMQ broker. The
     * behavior of calling this method while connected to any other broker is
     * undefined.
     *
     * @param string  $delivery_tag Delivery tag of last message to reject.
     * @param integer $flags        AMQP_REQUEUE to requeue the message(s),
     *                              AMQP_MULTIPLE to nack all previous
     *                              unacked messages as well.
     *
     * @throws AMQPChannelException    If the channel is not open.
     * @throws AMQPConnectionException If the connection to the broker was lost.
     *
     * @return boolean
     */
    public function nack($delivery_tag, $flags = AMQP_NOPARAM)
    {
    }

    /**
     * Mark one message as explicitly not acknowledged.
     *
     * Mark the message identified by delivery_tag as explicitly not
     * acknowledged. This method can only be called on messages that have not
     * yet been acknowledged, meaning that messages retrieved with by
     * AMQPQueue::consume() and AMQPQueue::get() and using the AMQP_AUTOACK
     * flag are not eligible.
     *
     * @param string  $delivery_tag Delivery tag of the message to reject.
     * @param integer $flags        AMQP_REQUEUE to requeue the message(s).
     *
     * @throws AMQPChannelException    If the channel is not open.
     * @throws AMQPConnectionException If the connection to the broker was lost.
     *
     * @return boolean
     */
    public function reject($delivery_tag, $flags = AMQP_NOPARAM)
    {
    }

    /**
     * Purge the contents of a queue.
     *
     * @throws AMQPChannelException    If the channel is not open.
     * @throws AMQPConnectionException If the connection to the broker was lost.
     *
     * @return boolean
     */
    public function purge()
    {
    }

    /**
     * Set a queue argument.
     *
     * @param string $key   The key to set.
     * @param mixed  $value The value to set.
     *
     * @return boolean
     */
    public function setArgument($key, $value)
    {
    }

    /**
     * Set all arguments on the given queue.
     *
     * All other argument settings will be wiped.
     *
     * @param array $arguments An array of key/value pairs of arguments.
     *
     * @return boolean
     */
    public function setArguments(array $arguments)
    {
    }

    /**
     * Check whether a queue has specific argument.
     *
     * @param string $key   The key to check.
     *
     * @return boolean
     */
    public function hasArgument($key)
    {
    }

    /**
     * Set the flags on the queue.
     *
     * @param integer $flags A bitmask of flags:
     *                       AMQP_DURABLE, AMQP_PASSIVE,
     *                       AMQP_EXCLUSIVE, AMQP_AUTODELETE.
     *
     * @return boolean
     */
    public function setFlags($flags)
    {
    }

    /**
     * Set the queue name.
     *
     * @param string $queue_name The name of the queue.
     *
     * @return boolean
     */
    public function setName($queue_name)
    {
    }

    /**
     * Remove a routing key binding on an exchange from the given queue.
     *
     * @param string $exchange_name The name of the exchange on which the
     *                              queue is bound.
     * @param string $routing_key   The binding routing key used by the
     *                              queue.
     * @param array  $arguments     Additional binding arguments.
     *
     * @throws AMQPChannelException    If the channel is not open.
     * @throws AMQPConnectionException If the connection to the broker was lost.
     *
     * @return boolean
     */
    public function unbind($exchange_name, $routing_key = null, array $arguments = array())
    {
    }

    /**
     * Get the AMQPChannel object in use
     *
     * @return AMQPChannel
     */
    public function getChannel()
    {
    }

    /**
     * Get the AMQPConnection object in use
     *
     * @return AMQPConnection
     */
    public function getConnection()
    {
    }

    /**
     * Get latest consumer tag. If no consumer available or the latest on was canceled null will be returned.
     *
     * @return string | null
     */
    public function getConsumerTag()
    {
    }

}

{'repo_name': 'php-amqp/php-amqp', 'stars': '439', 'repo_language': 'C', 'file_name': 'AMQPQueueException.php', 'mime_type': 'text/x-php', 'hash': -5544244247055159497, 'source_dataset': 'data'}


//package com.bootdo.common.config;
//
//import com.bootdo.BootdoApplication;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.boot.builder.SpringApplicationBuilder;
//import org.springframework.boot.web.support.SpringBootServletInitializer;
//
///**
// * war包部署需要
// * 修改启动类，继承 SpringBootServletInitializer 并重写 configure 方法
// */
//public class SpringBootSampleApplication extends SpringBootServletInitializer{
//
//    private static final Logger logger = LoggerFactory.getLogger(SpringBootSampleApplication.class);
//
//    @Override
//    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
//        return builder.sources(this.getClass());
//    }
//
//}

{'repo_name': 'lcg0124/bootdo', 'stars': '745', 'repo_language': 'JavaScript', 'file_name': 'TestDemo.java', 'mime_type': 'text/x-java', 'hash': 533418591436389750, 'source_dataset': 'data'}


function global:deactivate ([switch]$NonDestructive) {
    # Revert to original values
    if (Test-Path function:_OLD_VIRTUAL_PROMPT) {
        copy-item function:_OLD_VIRTUAL_PROMPT function:prompt
        remove-item function:_OLD_VIRTUAL_PROMPT
    }

    if (Test-Path env:_OLD_VIRTUAL_PYTHONHOME) {
        copy-item env:_OLD_VIRTUAL_PYTHONHOME env:PYTHONHOME
        remove-item env:_OLD_VIRTUAL_PYTHONHOME
    }

    if (Test-Path env:_OLD_VIRTUAL_PATH) {
        copy-item env:_OLD_VIRTUAL_PATH env:PATH
        remove-item env:_OLD_VIRTUAL_PATH
    }

    if (Test-Path env:VIRTUAL_ENV) {
        remove-item env:VIRTUAL_ENV
    }

    if (!$NonDestructive) {
        # Self destruct!
        remove-item function:deactivate
    }
}

deactivate -nondestructive

$env:VIRTUAL_ENV="__VENV_DIR__"

if (! $env:VIRTUAL_ENV_DISABLE_PROMPT) {
    # Set the prompt to include the env name
    # Make sure _OLD_VIRTUAL_PROMPT is global
    function global:_OLD_VIRTUAL_PROMPT {""}
    copy-item function:prompt function:_OLD_VIRTUAL_PROMPT
    function global:prompt {
        Write-Host -NoNewline -ForegroundColor Green '__VENV_PROMPT__'
        _OLD_VIRTUAL_PROMPT
    }
}

# Clear PYTHONHOME
if (Test-Path env:PYTHONHOME) {
    copy-item env:PYTHONHOME env:_OLD_VIRTUAL_PYTHONHOME
    remove-item env:PYTHONHOME
}

# Add the venv to the PATH
copy-item env:PATH env:_OLD_VIRTUAL_PATH
$env:PATH = "$env:VIRTUAL_ENV\__VENV_BIN_NAME__;$env:PATH"

{'repo_name': 'Source-Python-Dev-Team/Source.Python', 'stars': '107', 'repo_language': 'Python', 'file_name': 'readme.md', 'mime_type': 'text/plain', 'hash': 3839449503105669261, 'source_dataset': 'data'}


/*
 * Copyright LWJGL. All rights reserved.
 * License terms: https://www.lwjgl.org/license
 * MACHINE GENERATED FILE, DO NOT EDIT
 */
package org.lwjgl.vulkan;

import javax.annotation.*;

import java.nio.*;

import org.lwjgl.*;
import org.lwjgl.system.*;

import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.MemoryStack.*;

/**
 * See {@link VkDescriptorSetVariableDescriptorCountLayoutSupport}.
 *
 *
Layout

 *
 *

 * struct VkDescriptorSetVariableDescriptorCountLayoutSupportEXT {
 *     VkStructureType sType;
 *     void * pNext;
 *     uint32_t maxVariableDescriptorCount;
 * }

 */
public class VkDescriptorSetVariableDescriptorCountLayoutSupportEXT extends VkDescriptorSetVariableDescriptorCountLayoutSupport {

    /**
     * Creates a {@code VkDescriptorSetVariableDescriptorCountLayoutSupportEXT} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
     * visible to the struct instance and vice versa.
     *
     *
The created instance holds a strong reference to the container object.

     */
    public VkDescriptorSetVariableDescriptorCountLayoutSupportEXT(ByteBuffer container) {
        super(container);
    }

    /** Sets the specified value to the {@code sType} field. */
    @Override
    public VkDescriptorSetVariableDescriptorCountLayoutSupportEXT sType(@NativeType("VkStructureType") int value) { nsType(address(), value); return this; }
    /** Sets the specified value to the {@code pNext} field. */
    @Override
    public VkDescriptorSetVariableDescriptorCountLayoutSupportEXT pNext(@NativeType("void *") long value) { npNext(address(), value); return this; }

    /** Initializes this struct with the specified values. */
    @Override
    public VkDescriptorSetVariableDescriptorCountLayoutSupportEXT set(
        int sType,
        long pNext
    ) {
        sType(sType);
        pNext(pNext);

        return this;
    }

    /**
     * Copies the specified struct data to this struct.
     *
     * @param src the source struct
     *
     * @return this struct
     */
    public VkDescriptorSetVariableDescriptorCountLayoutSupportEXT set(VkDescriptorSetVariableDescriptorCountLayoutSupportEXT src) {
        memCopy(src.address(), address(), SIZEOF);
        return this;
    }

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

    /** Returns a new {@code VkDescriptorSetVariableDescriptorCountLayoutSupportEXT} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */
    public static VkDescriptorSetVariableDescriptorCountLayoutSupportEXT malloc() {
        return wrap(VkDescriptorSetVariableDescriptorCountLayoutSupportEXT.class, nmemAllocChecked(SIZEOF));
    }

    /** Returns a new {@code VkDescriptorSetVariableDescriptorCountLayoutSupportEXT} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */
    public static VkDescriptorSetVariableDescriptorCountLayoutSupportEXT calloc() {
        return wrap(VkDescriptorSetVariableDescriptorCountLayoutSupportEXT.class, nmemCallocChecked(1, SIZEOF));
    }

    /** Returns a new {@code VkDescriptorSetVariableDescriptorCountLayoutSupportEXT} instance allocated with {@link BufferUtils}. */
    public static VkDescriptorSetVariableDescriptorCountLayoutSupportEXT create() {
        ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF);
        return wrap(VkDescriptorSetVariableDescriptorCountLayoutSupportEXT.class, memAddress(container), container);
    }

    /** Returns a new {@code VkDescriptorSetVariableDescriptorCountLayoutSupportEXT} instance for the specified memory address. */
    public static VkDescriptorSetVariableDescriptorCountLayoutSupportEXT create(long address) {
        return wrap(VkDescriptorSetVariableDescriptorCountLayoutSupportEXT.class, address);
    }

    /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
    @Nullable
    public static VkDescriptorSetVariableDescriptorCountLayoutSupportEXT createSafe(long address) {
        return address == NULL ? null : wrap(VkDescriptorSetVariableDescriptorCountLayoutSupportEXT.class, address);
    }

    /**
     * Returns a new {@link VkDescriptorSetVariableDescriptorCountLayoutSupportEXT.Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed.
     *
     * @param capacity the buffer capacity
     */
    public static VkDescriptorSetVariableDescriptorCountLayoutSupportEXT.Buffer malloc(int capacity) {
        return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity);
    }

    /**
     * Returns a new {@link VkDescriptorSetVariableDescriptorCountLayoutSupportEXT.Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed.
     *
     * @param capacity the buffer capacity
     */
    public static VkDescriptorSetVariableDescriptorCountLayoutSupportEXT.Buffer calloc(int capacity) {
        return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity);
    }

    /**
     * Returns a new {@link VkDescriptorSetVariableDescriptorCountLayoutSupportEXT.Buffer} instance allocated with {@link BufferUtils}.
     *
     * @param capacity the buffer capacity
     */
    public static VkDescriptorSetVariableDescriptorCountLayoutSupportEXT.Buffer create(int capacity) {
        ByteBuffer container = __create(capacity, SIZEOF);
        return wrap(Buffer.class, memAddress(container), capacity, container);
    }

    /**
     * Create a {@link VkDescriptorSetVariableDescriptorCountLayoutSupportEXT.Buffer} instance at the specified memory.
     *
     * @param address  the memory address
     * @param capacity the buffer capacity
     */
    public static VkDescriptorSetVariableDescriptorCountLayoutSupportEXT.Buffer create(long address, int capacity) {
        return wrap(Buffer.class, address, capacity);
    }

    /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
    @Nullable
    public static VkDescriptorSetVariableDescriptorCountLayoutSupportEXT.Buffer createSafe(long address, int capacity) {
        return address == NULL ? null : wrap(Buffer.class, address, capacity);
    }

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

    /** Returns a new {@code VkDescriptorSetVariableDescriptorCountLayoutSupportEXT} instance allocated on the thread-local {@link MemoryStack}. */
    public static VkDescriptorSetVariableDescriptorCountLayoutSupportEXT mallocStack() {
        return mallocStack(stackGet());
    }

    /** Returns a new {@code VkDescriptorSetVariableDescriptorCountLayoutSupportEXT} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */
    public static VkDescriptorSetVariableDescriptorCountLayoutSupportEXT callocStack() {
        return callocStack(stackGet());
    }

    /**
     * Returns a new {@code VkDescriptorSetVariableDescriptorCountLayoutSupportEXT} instance allocated on the specified {@link MemoryStack}.
     *
     * @param stack the stack from which to allocate
     */
    public static VkDescriptorSetVariableDescriptorCountLayoutSupportEXT mallocStack(MemoryStack stack) {
        return wrap(VkDescriptorSetVariableDescriptorCountLayoutSupportEXT.class, stack.nmalloc(ALIGNOF, SIZEOF));
    }

    /**
     * Returns a new {@code VkDescriptorSetVariableDescriptorCountLayoutSupportEXT} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
     *
     * @param stack the stack from which to allocate
     */
    public static VkDescriptorSetVariableDescriptorCountLayoutSupportEXT callocStack(MemoryStack stack) {
        return wrap(VkDescriptorSetVariableDescriptorCountLayoutSupportEXT.class, stack.ncalloc(ALIGNOF, 1, SIZEOF));
    }

    /**
     * Returns a new {@link VkDescriptorSetVariableDescriptorCountLayoutSupportEXT.Buffer} instance allocated on the thread-local {@link MemoryStack}.
     *
     * @param capacity the buffer capacity
     */
    public static VkDescriptorSetVariableDescriptorCountLayoutSupportEXT.Buffer mallocStack(int capacity) {
        return mallocStack(capacity, stackGet());
    }

    /**
     * Returns a new {@link VkDescriptorSetVariableDescriptorCountLayoutSupportEXT.Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero.
     *
     * @param capacity the buffer capacity
     */
    public static VkDescriptorSetVariableDescriptorCountLayoutSupportEXT.Buffer callocStack(int capacity) {
        return callocStack(capacity, stackGet());
    }

    /**
     * Returns a new {@link VkDescriptorSetVariableDescriptorCountLayoutSupportEXT.Buffer} instance allocated on the specified {@link MemoryStack}.
     *
     * @param stack the stack from which to allocate
     * @param capacity the buffer capacity
     */
    public static VkDescriptorSetVariableDescriptorCountLayoutSupportEXT.Buffer mallocStack(int capacity, MemoryStack stack) {
        return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity);
    }

    /**
     * Returns a new {@link VkDescriptorSetVariableDescriptorCountLayoutSupportEXT.Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
     *
     * @param stack the stack from which to allocate
     * @param capacity the buffer capacity
     */
    public static VkDescriptorSetVariableDescriptorCountLayoutSupportEXT.Buffer callocStack(int capacity, MemoryStack stack) {
        return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity);
    }

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

    /** An array of {@link VkDescriptorSetVariableDescriptorCountLayoutSupportEXT} structs. */
    public static class Buffer extends VkDescriptorSetVariableDescriptorCountLayoutSupport.Buffer {

        private static final VkDescriptorSetVariableDescriptorCountLayoutSupportEXT ELEMENT_FACTORY = VkDescriptorSetVariableDescriptorCountLayoutSupportEXT.create(-1L);

        /**
         * Creates a new {@code VkDescriptorSetVariableDescriptorCountLayoutSupportEXT.Buffer} instance backed by the specified container.
         *
         * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
         * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
         * by {@link VkDescriptorSetVariableDescriptorCountLayoutSupportEXT#SIZEOF}, and its mark will be undefined.
         *
         *
The created buffer instance holds a strong reference to the container object.

         */
        public Buffer(ByteBuffer container) {
            super(container);
        }

        public Buffer(long address, int cap) {
            super(address, null, -1, 0, cap, cap);
        }

        Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
            super(address, container, mark, pos, lim, cap);
        }

        @Override
        protected Buffer self() {
            return this;
        }

        @Override
        protected VkDescriptorSetVariableDescriptorCountLayoutSupportEXT getElementFactory() {
            return ELEMENT_FACTORY;
        }

        /** Sets the specified value to the {@code sType} field. */
        @Override
        public VkDescriptorSetVariableDescriptorCountLayoutSupportEXT.Buffer sType(@NativeType("VkStructureType") int value) { VkDescriptorSetVariableDescriptorCountLayoutSupportEXT.nsType(address(), value); return this; }
        /** Sets the specified value to the {@code pNext} field. */
        @Override
        public VkDescriptorSetVariableDescriptorCountLayoutSupportEXT.Buffer pNext(@NativeType("void *") long value) { VkDescriptorSetVariableDescriptorCountLayoutSupportEXT.npNext(address(), value); return this; }

    }

}

{'repo_name': 'LWJGL/lwjgl3', 'stars': '2797', 'repo_language': 'Java', 'file_name': '3.1.2.md', 'mime_type': 'text/plain', 'hash': -1842483764497882171, 'source_dataset': 'data'}


PROG=../../../../bin/7z.so

LOCAL_FLAGS=\
  $(CC_SHARED) \
  -DEXTERNAL_CODECS \
  -DUNICODE -D_UNICODE

include ../../../../makefile.crc32
include ../../../../makefile.machine

PCH_NAME=$(PRE_COMPILED_HEADER)

LOCAL_SHARED=$(LINK_SHARED)
LIBS=$(LOCAL_LIBS_DLL)

# NewHandler.o
COMMON_OBJS = \
  CRC.o \
  IntToString.o \
  MyMap.o \
  MyString.o \
  MyWindows.o \
  MyXml.o \
  StringConvert.o \
  StringToInt.o \
  MyVector.o \
  UTFConvert.o \
  Wildcard.o \

WIN_OBJS = \
  FileDir.o \
  FileFind.o \
  FileIO.o \
  PropVariant.o \
  PropVariantUtils.o \
  Synchronization.o \
  System.o \
  Time.o \

7ZIP_COMMON_OBJS = \
  InBuffer.o \
  InOutTempBuffer.o \
  CreateCoder.o \
  CWrappers.o \
  FilterCoder.o \
  LimitedStreams.o \
  LockedStream.o \
  MethodId.o \
  MethodProps.o \
  MemBlocks.o \
  OffsetStream.o \
  OutBuffer.o \
  OutMemStream.o \
  ProgressMt.o \
  ProgressUtils.o \
  StreamBinder.o \
  StreamObjects.o \
  StreamUtils.o \
  VirtThread.o \

AR_OBJS = \
  ArchiveExports.o \
  DllExports2.o \
  ApmHandler.o \
  ArjHandler.o \
  Bz2Handler.o \
  CpioHandler.o \
  CramfsHandler.o \
  DebHandler.o \
  DeflateProps.o \
  DmgHandler.o \
  ElfHandler.o \
  FatHandler.o \
  FlvHandler.o \
  GzHandler.o \
  LzhHandler.o \
  LzmaHandler.o \
  MachoHandler.o \
  MbrHandler.o \
  MslzHandler.o \
  MubHandler.o \
  NtfsHandler.o \
  PeHandler.o \
  PpmdHandler.o \
  RpmHandler.o \
  SplitHandler.o \
  SwfHandler.o \
  SquashfsHandler.o \
  VhdHandler.o \
  XarHandler.o \
  XzHandler.o \
  ZHandler.o \

AR_COMMON_OBJS = \
  CoderMixer2.o \
  CoderMixer2MT.o \
  CrossThreadProgress.o \
  DummyOutStream.o \
  FindSignature.o \
  InStreamWithCRC.o \
  ItemNameUtils.o \
  MultiStream.o \
  OutStreamWithCRC.o \
  OutStreamWithSha1.o \
  HandlerOut.o \
  ParseProperties.o \

7Z_OBJS = \
  7zCompressionMode.o \
  7zDecode.o \
  7zEncode.o \
  7zExtract.o \
  7zFolderInStream.o \
  7zFolderOutStream.o \
  7zHandler.o \
  7zHandlerOut.o \
  7zHeader.o \
  7zIn.o \
  7zOut.o \
  7zProperties.o \
  7zSpecStream.o \
  7zUpdate.o \
  7zRegister.o \

CAB_OBJS = \
  CabBlockInStream.o \
  CabHandler.o \
  CabHeader.o \
  CabIn.o \
  CabRegister.o \

CHM_OBJS = \
  ChmHandler.o \
  ChmHeader.o \
  ChmIn.o \
  ChmRegister.o \

COM_OBJS = \
  ComHandler.o \
  ComIn.o \
  ComRegister.o \

HFS_OBJS = \
  HfsHandler.o \
  HfsIn.o \
  HfsRegister.o \

ISO_OBJS = \
  IsoHandler.o \
  IsoHeader.o \
  IsoIn.o \
  IsoRegister.o \

NSIS_OBJS = \
  NsisDecode.o \
  NsisHandler.o \
  NsisIn.o \
  NsisRegister.o \

RAR_OBJS = \
  RarHandler.o \
  RarHeader.o \
  RarIn.o \
  RarItem.o \
  RarVolumeInStream.o \
  RarRegister.o \

TAR_OBJS = \
  TarHandler.o \
  TarHandlerOut.o \
  TarHeader.o \
  TarIn.o \
  TarOut.o \
  TarUpdate.o \
  TarRegister.o \

UDF_OBJS = \
  UdfHandler.o \
  UdfIn.o \
  UdfRegister.o \

WIM_OBJS = \
  WimHandler.o \
  WimHandlerOut.o \
  WimIn.o \
  WimRegister.o \

ZIP_OBJS = \
  ZipAddCommon.o \
  ZipHandler.o \
  ZipHandlerOut.o \
  ZipHeader.o \
  ZipIn.o \
  ZipItem.o \
  ZipOut.o \
  ZipUpdate.o \
  ZipRegister.o \

COMPRESS_OBJS = \
  CodecExports.o \
  ArjDecoder1.o \
  ArjDecoder2.o \
  Bcj2Coder.o \
  Bcj2Register.o \
  BcjCoder.o \
  BcjRegister.o \
  BitlDecoder.o \
  BranchCoder.o \
  BranchMisc.o \
  BranchRegister.o \
  ByteSwap.o \
  BZip2Crc.o \
  BZip2Decoder.o \
  BZip2Encoder.o \
  BZip2Register.o \
  CopyCoder.o \
  CopyRegister.o \
  Deflate64Register.o \
  DeflateDecoder.o \
  DeflateEncoder.o \
  DeflateRegister.o \
  DeltaFilter.o \
  Lzma2Decoder.o \
  Lzma2Encoder.o \
  Lzma2Register.o \
  ImplodeDecoder.o \
  ImplodeHuffmanDecoder.o \
  LzhDecoder.o \
  LzmaDecoder.o \
  LzmaEncoder.o \
  LzmaRegister.o \
  LzOutWindow.o \
  Lzx86Converter.o \
  LzxDecoder.o \
  PpmdDecoder.o \
  PpmdEncoder.o \
  PpmdRegister.o \
  PpmdZip.o \
  QuantumDecoder.o \
  ShrinkDecoder.o \
  ZlibDecoder.o \
  ZlibEncoder.o \
  ZDecoder.o \

COMPRESS_OBJS_NON_FREE = \
  Rar1Decoder.o \
  Rar2Decoder.o \
  Rar3Decoder.o \
  Rar3Vm.o \
  RarCodecsRegister.o \

CRYPTO_OBJS = \
  7zAes.o \
  7zAesRegister.o \
  HmacSha1.o \
  MyAes.o \
  Pbkdf2HmacSha1.o \
  RandGen.o \
  Rar20Crypto.o \
  RarAes.o \
  Sha1.o \
  WzAes.o \
  ZipCrypto.o \
  ZipStrong.o \

C_OBJS = \
  7zBuf2.o \
  7zStream.o \
  Aes.o \
  Alloc.o \
  Bra.o \
  Bra86.o \
  BraIA64.o \
  BwtSort.o \
  Delta.o \
  HuffEnc.o \
  LzFind.o \
  LzFindMt.o \
  Lzma2Dec.o \
  Lzma2Enc.o \
  LzmaDec.o \
  LzmaEnc.o \
  MtCoder.o \
  Ppmd7.o \
  Ppmd7Dec.o \
  Ppmd7Enc.o \
  Ppmd8.o \
  Ppmd8Dec.o \
  Ppmd8Enc.o \
  Sha256.o \
  Sort.o \
  Threads.o \
  Xz.o \
  XzCrc64.o \
  XzDec.o \
  XzEnc.o \
  XzIn.o \

OBJS = \
  wine_date_and_time.o \
  myGetTickCount.o \
  $(COMMON_OBJS) \
  $(WIN_OBJS) \
  $(7ZIP_COMMON_OBJS) \
  $(AR_OBJS) \
  $(AR_COMMON_OBJS) \
  $(7Z_OBJS) \
  $(CAB_OBJS) \
  $(CHM_OBJS) \
  $(COM_OBJS) \
  $(HFS_OBJS) \
  $(ISO_OBJS) \
  $(NSIS_OBJS) \
  $(RAR_OBJS) \
  $(TAR_OBJS) \
  $(UDF_OBJS) \
  $(WIM_OBJS) \
  $(ZIP_OBJS) \
  $(COMPRESS_OBJS) \
  $(CRYPTO_OBJS) \
  $(C_OBJS) \
  $(OBJ_CRC32)  \

include ../../../../makefile.glb

{'repo_name': 'punesemu/puNES', 'stars': '168', 'repo_language': 'C++', 'file_name': 'Makefile.am', 'mime_type': 'text/plain', 'hash': 7641600429980888281, 'source_dataset': 'data'}


/*
 * CommandEvent.java
 *
 * Copyright (C) 2020 by RStudio, PBC
 *
 * Unless you have received this program directly from RStudio pursuant
 * to the terms of a commercial license agreement with RStudio, then
 * this program is licensed to you under the terms of version 3 of the
 * GNU Affero General Public License. This program is distributed WITHOUT
 * ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT,
 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the
 * AGPL (http://www.gnu.org/licenses/agpl-3.0.txt) for more details.
 *
 */
package org.rstudio.core.client.command;

import com.google.gwt.event.shared.GwtEvent;

public class CommandEvent extends GwtEvent<CommandHandler>
{
   public static final Type<CommandHandler> TYPE = new Type<CommandHandler>();

   public CommandEvent(AppCommand command)
   {
      command_ = command;
   }

   public AppCommand getCommand()
   {
      return command_;
   }

   @Override
   public Type<CommandHandler> getAssociatedType()
   {
      return TYPE;
   }

   @Override
   protected void dispatch(CommandHandler handler)
   {
      handler.onCommand(command_);
   }

   private final AppCommand command_;
}

{'repo_name': 'rstudio/rstudio', 'stars': '3286', 'repo_language': 'Java', 'file_name': 'provision-nfs4-client.sh', 'mime_type': 'text/plain', 'hash': 8796988134772192870, 'source_dataset': 'data'}