text:
       <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-navbar-collapse">
           Toggle navigation

       </button>
       Songs
       Artists

Admin

Sign In

       <form id="search" class="navbar-form navbar-right" >

               <input id="querySearch" type="text" class="form-control" placeholder="Search">

           <button type="submit" class="btn btn-default ">Submit</button>
       </form>

${searchResult}


text:
This book is an compendium to a workshop exploring
[genetic programming][genetic-programming]. Genetic programming is

> a technique whereby computer programs are encoded as a set of genes that are
> then modified (evolved) using an evolutionary algorithm.

This book will explain various ideas and will ground them by discussing ways you
could implement them. It will provide you with a practical introduction to
genetic programming and hones it with exercises, both pen and paper as
implementation exercises.

Each chapter will introduce ideas needed to create your own, or work with a,
genetic programming environment, that can solve a certain problem. The ideas
will be illustrated by the following projects.

1. [Nadezhda][cockroach] was the name of a cockroach sent into space to study
   its behavior. Even though cockroaches have far more intricate behavior than
   we attribute them during this problem, we like to stay in the space theme.
   You can inspect the code in the `nadezhda` directory.
   This project is used as an illustration to explore the concepts of genetic
   programming. It is very much a toy problem, but it can illustrate the
   important concepts.
2. [AGC][agc] is an abbreviation for _Apollo's Guidance Computer_ that was
   responsible for aiding in computations of guidance, navigation and control
   of the space craft. If you want, you could implement this yourself, if you
   follow the project in this book.
   This project is a bit more involved than Nadezhda, and allows you to take a
   genetic programming framework for a spin. You can use your new found skills
   from the ground up to really test your understanding.
3. [Lunar Lander][lunar] tries to land safely on the surface of the moon. The
   catch is that you are giving control to a program that a computer wrote. This
   project demonstrates that hard problems can be solved by genetic programming.
   You can inspect the result in `moonlander-ast-rust`.
   This project is included to focus on the interesting aspects of genetic
   programming. I.e. how to find a good fitness function for my problem.

[genetic-programming]: https://en.wikipedia.org/wiki/Genetic_programming
[cockroach]: https://en.wikipedia.org/wiki/Nadezhda_(cockroach)
[agc]: https://en.wikipedia.org/wiki/Apollo_Guidance_Computer
[lunar]: http://moonlander.seb.ly/

redpajama_set_name: RedPajamaGithub


text:
import httplib
import urllib
import urlparse
import os

from cactus.utils.helpers import CaseInsensitiveDict

EXTERNAL_SCHEMES = ("//", "http://", "https://", "mailto:")

def getURLHeaders(url):
    url = urlparse.urlparse(url)

    conn = httplib.HTTPConnection(url.netloc)
    conn.request('HEAD', urllib.quote(url.path))

    response = conn.getresponse()

    return CaseInsensitiveDict(response.getheaders())

def is_external(url):
    for scheme in EXTERNAL_SCHEMES:
        if url.startswith(scheme):
            return True
    return False

def path_to_url(path):
    """
    Convert a system path to an URL
    """
    return path.replace(os.sep, "/")

def URLHelperMixinFactory(class_name, property_name):

    inner_property_name = "_" + property_name

    def setter(self, value):
        setattr(self, inner_property_name, value)

    def getter(self):
        return path_to_url(getattr(self, inner_property_name))

    def deleter(self):
        delattr(self, inner_property_name)

    return type(class_name, (object,), {
        property_name: property(getter, setter, deleter)
    })

class ResourceURLHelperMixin(
    URLHelperMixinFactory("LinkURLHelperMixin", "link_url"),
    URLHelperMixinFactory("FinalURLHelperMixin", "final_url")
):
    """
    This helper lets us set the `link_url` and `final_url` for our resources and ensure that we get compliant URLS on
    all systems, including Windows where os.path is not a POSIX path.
    """


text:
class ResetOracleDatasetCounts < ActiveRecord::Migration
  def up
    OracleSchema.all.each do |schema|
      Schema.reset_counters(schema.id, :active_tables_and_views)
    end
  end

  def down
  end
end


text:
$LOAD_PATH.unshift File.expand_path('..', __FILE__)
require 'forwardable'
require 'deprecated'
require 'java'
include Java

%w(commons-jxpath-1.3.jar commons-exec-1.1.jar protobuf-java-2.4.1.jar
    selenium-java-2.13.0.jar operalaunchers-0.3.jar operadriver-v0.8.1.jar
    guava-10.0.1.jar).each { |jar| require "operadriver/#{jar}" }

include_class org.openqa.selenium.WebDriver
include_class org.openqa.selenium.remote.RemoteWebElement
include_class org.openqa.selenium.NoSuchElementException
include_class org.openqa.selenium.interactions.Actions
include_class org.openqa.selenium.remote.DesiredCapabilities
include_class com.opera.core.systems.OperaDriver
include_class com.opera.core.systems.OperaWebElement
include_class com.opera.core.systems.settings.OperaDriverSettings

# Desktop stuff
include_class com.opera.core.systems.OperaDesktopDriver
include_class com.opera.core.systems.scope.protos.DesktopWmProtos
include_class com.opera.core.systems.scope.protos.SystemInputProtos
include_class com.opera.core.systems.QuickWidget
include_class com.opera.core.systems.QuickMenu
include_class com.opera.core.systems.QuickMenuItem

$KCODE = 'u'  # UTF-8 support

class Object
  def truthy?
    self && [true, 'true', 'yes', 'y', '1', 1].include?(self)
  end
end

# TODO This should be replaced when we decide upon a better way of
# enabling the Watir 3 API.
module OperaWatir
  @current_api = 2

  # Set the API version you wish to use.  Please note that setting
  # this after OperaWatir::Browser has been initialized will have no
  # affect.
  #
  # @param number [Integer] API version to use
  def self.api=(number)
    @current_api = number.to_i
  end

  # Queries which API to use.
  #
  # @return [Integer] Desired API version
  def self.api
    @current_api
  end
end

require 'operawatir/version'
require 'operawatir/platform'
require 'operawatir/keys'
require 'operawatir/screenshot'
require 'operawatir/preferences'
require 'operawatir/spatnav'
require 'operawatir/actions'
require 'operawatir/utils'

require 'operawatir/exceptions'
require 'operawatir/selector'
require 'operawatir/element'
require 'operawatir/collection'
require 'operawatir/window'
require 'operawatir/browser'

require 'operawatir/compat'

# Desktop stuff
require 'operawatir/desktop_enums'
require 'operawatir/desktop_common'
require 'operawatir/clickable_item'
require 'operawatir/desktop_container'
require 'operawatir/desktop_browser'
require 'operawatir/quickwidgets'
require 'operawatir/desktop_exceptions'


text:
/* Generated by Font Squirrel (http://www.fontsquirrel.com) on August 2, 2013 */

@font-face {
    font-family: 'amaticbold';
    src: url('amatic-bold-webfont.eot');
    src: url('amatic-bold-webfont.eot?#iefix') format('embedded-opentype'),
         url('amatic-bold-webfont.woff') format('woff'),
         url('amatic-bold-webfont.ttf') format('truetype'),
         url('amatic-bold-webfont.svg#amaticbold') format('svg');
    font-weight: normal;
    font-style: normal;

}

@font-face {
    font-family: 'amatic_scregular';
    src: url('amaticsc-regular-webfont.eot');
    src: url('amaticsc-regular-webfont.eot?#iefix') format('embedded-opentype'),
         url('amaticsc-regular-webfont.woff') format('woff'),
         url('amaticsc-regular-webfont.ttf') format('truetype'),
         url('amaticsc-regular-webfont.svg#amatic_scregular') format('svg');
    font-weight: normal;
    font-style: normal;

}


text:
/*
 * kmp_lock.h -- lock header file
 * $Revision: 42489 $
 * $Date: 2013-07-08 11:00:09 -0500 (Mon, 08 Jul 2013) $
 */

/* <copyright>
    Copyright (c) 1997-2013 Intel Corporation.  All Rights Reserved.

    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:

      * Redistributions of source code must retain the above copyright
        notice, this list of conditions and the following disclaimer.
      * 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.
      * Neither the name of Intel Corporation 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
    HOLDER 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.

</copyright> */

#ifndef KMP_LOCK_H
#define KMP_LOCK_H

#include <limits.h>    // CHAR_BIT
#include <stddef.h>    // offsetof

#include "kmp_os.h"
#include "kmp_debug.h"

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus

// ----------------------------------------------------------------------------
// Have to copy these definitions from kmp.h because kmp.h cannot be included
// due to circular dependencies.  Will undef these at end of file.

#define KMP_PAD(type, sz)     (sizeof(type) + (sz - ((sizeof(type) - 1) % (sz)) - 1))
#define KMP_GTID_DNE (-2)

// Forward declaration of ident and ident_t

struct ident;
typedef struct ident ident_t;

// End of copied code.
// ----------------------------------------------------------------------------

//
// We need to know the size of the area we can assume that the compiler(s)
// allocated for obects of type omp_lock_t and omp_nest_lock_t.  The Intel
// compiler always allocates a pointer-sized area, as does visual studio.
//
// gcc however, only allocates 4 bytes for regular locks, even on 64-bit
// intel archs.  It allocates at least 8 bytes for nested lock (more on
// recent versions), but we are bounded by the pointer-sized chunks that
// the Intel compiler allocates.
//

#if KMP_OS_LINUX && defined(KMP_GOMP_COMPAT)
# define OMP_LOCK_T_SIZE        sizeof(int)
# define OMP_NEST_LOCK_T_SIZE   sizeof(void *)
#else
# define OMP_LOCK_T_SIZE        sizeof(void *)
# define OMP_NEST_LOCK_T_SIZE   sizeof(void *)
#endif

//
// The Intel compiler allocates a 32-byte chunk for a critical section.
// Both gcc and visual studio only allocate enough space for a pointer.
// Sometimes we know that the space was allocated by the Intel compiler.
//
#define OMP_CRITICAL_SIZE       sizeof(void *)
#define INTEL_CRITICAL_SIZE     32

//
// lock flags
//
typedef kmp_uint32 kmp_lock_flags_t;

#define kmp_lf_critical_section 1

//
// When a lock table is used, the indices are of kmp_lock_index_t
//
typedef kmp_uint32 kmp_lock_index_t;

//
// When memory allocated for locks are on the lock pool (free list),
// it is treated as structs of this type.
//
struct kmp_lock_pool {
    union kmp_user_lock *next;
    kmp_lock_index_t index;
};

typedef struct kmp_lock_pool kmp_lock_pool_t;

extern void __kmp_validate_locks( void );

// ----------------------------------------------------------------------------
//
//  There are 5 lock implementations:
//
//       1. Test and set locks.
//       2. futex locks (Linux* OS on x86 and Intel(R) Many Integrated Core architecture)
//       3. Ticket (Lamport bakery) locks.
//       4. Queuing locks (with separate spin fields).
//       5. DRPA (Dynamically Reconfigurable Distributed Polling Area) locks
//
//   and 3 lock purposes:
//
//       1. Bootstrap locks -- Used for a few locks available at library startup-shutdown time.
//          These do not require non-negative global thread ID's.
//       2. Internal RTL locks -- Used everywhere else in the RTL
//       3. User locks (includes critical sections)
//
// ----------------------------------------------------------------------------

// ============================================================================
// Lock implementations.
// ============================================================================

// ----------------------------------------------------------------------------
// Test and set locks.
//
// Non-nested test and set locks differ from the other lock kinds (except
// futex) in that we use the memory allocated by the compiler for the lock,
// rather than a pointer to it.
//
// On lin32, lin_32e, and win_32, the space allocated may be as small as 4
// bytes, so we have to use a lock table for nested locks, and avoid accessing
// the depth_locked field for non-nested locks.
//
// Information normally available to the tools, such as lock location,
// lock usage (normal lock vs. critical section), etc. is not available with
// test and set locks.
// ----------------------------------------------------------------------------

struct kmp_base_tas_lock {
    volatile kmp_int32 poll;         // 0 => unlocked
                                     // locked: (gtid+1) of owning thread
    kmp_int32          depth_locked; // depth locked, for nested locks only
};

typedef struct kmp_base_tas_lock kmp_base_tas_lock_t;

union kmp_tas_lock {
    kmp_base_tas_lock_t lk;
    kmp_lock_pool_t pool;   // make certain struct is large enough
    double lk_align;        // use worst case alignment
                            // no cache line padding
};

typedef union kmp_tas_lock kmp_tas_lock_t;

//
// Static initializer for test and set lock variables. Usage:
//    kmp_tas_lock_t xlock = KMP_TAS_LOCK_INITIALIZER( xlock );
//
#define KMP_TAS_LOCK_INITIALIZER( lock ) { { 0, 0 } }

extern void __kmp_acquire_tas_lock( kmp_tas_lock_t *lck, kmp_int32 gtid );
extern int __kmp_test_tas_lock( kmp_tas_lock_t *lck, kmp_int32 gtid );
extern void __kmp_release_tas_lock( kmp_tas_lock_t *lck, kmp_int32 gtid );
extern void __kmp_init_tas_lock( kmp_tas_lock_t *lck );
extern void __kmp_destroy_tas_lock( kmp_tas_lock_t *lck );

extern void __kmp_acquire_nested_tas_lock( kmp_tas_lock_t *lck, kmp_int32 gtid );
extern int __kmp_test_nested_tas_lock( kmp_tas_lock_t *lck, kmp_int32 gtid );
extern void __kmp_release_nested_tas_lock( kmp_tas_lock_t *lck, kmp_int32 gtid );
extern void __kmp_init_nested_tas_lock( kmp_tas_lock_t *lck );
extern void __kmp_destroy_nested_tas_lock( kmp_tas_lock_t *lck );

#if KMP_OS_LINUX && (KMP_ARCH_X86 || KMP_ARCH_X86_64)

// ----------------------------------------------------------------------------
// futex locks.  futex locks are only available on Linux* OS.
//
// Like non-nested test and set lock, non-nested futex locks use the memory
// allocated by the compiler for the lock, rather than a pointer to it.
//
// Information normally available to the tools, such as lock location,
// lock usage (normal lock vs. critical section), etc. is not available with
// test and set locks.  With non-nested futex locks, the lock owner is not
// even available.
// ----------------------------------------------------------------------------

struct kmp_base_futex_lock {
    volatile kmp_int32 poll;         // 0 => unlocked
                                     // 2*(gtid+1) of owning thread, 0 if unlocked
                                     // locked: (gtid+1) of owning thread
    kmp_int32          depth_locked; // depth locked, for nested locks only
};

typedef struct kmp_base_futex_lock kmp_base_futex_lock_t;

union kmp_futex_lock {
    kmp_base_futex_lock_t lk;
    kmp_lock_pool_t pool;   // make certain struct is large enough
    double lk_align;        // use worst case alignment
                            // no cache line padding
};

typedef union kmp_futex_lock kmp_futex_lock_t;

//
// Static initializer for futex lock variables. Usage:
//    kmp_futex_lock_t xlock = KMP_FUTEX_LOCK_INITIALIZER( xlock );
//
#define KMP_FUTEX_LOCK_INITIALIZER( lock ) { { 0, 0 } }

extern void __kmp_acquire_futex_lock( kmp_futex_lock_t *lck, kmp_int32 gtid );
extern int __kmp_test_futex_lock( kmp_futex_lock_t *lck, kmp_int32 gtid );
extern void __kmp_release_futex_lock( kmp_futex_lock_t *lck, kmp_int32 gtid );
extern void __kmp_init_futex_lock( kmp_futex_lock_t *lck );
extern void __kmp_destroy_futex_lock( kmp_futex_lock_t *lck );

extern void __kmp_acquire_nested_futex_lock( kmp_futex_lock_t *lck, kmp_int32 gtid );
extern int __kmp_test_nested_futex_lock( kmp_futex_lock_t *lck, kmp_int32 gtid );
extern void __kmp_release_nested_futex_lock( kmp_futex_lock_t *lck, kmp_int32 gtid );
extern void __kmp_init_nested_futex_lock( kmp_futex_lock_t *lck );
extern void __kmp_destroy_nested_futex_lock( kmp_futex_lock_t *lck );

#endif // KMP_OS_LINUX && (KMP_ARCH_X86 || KMP_ARCH_X86_64)

// ----------------------------------------------------------------------------
// Ticket locks.
// ----------------------------------------------------------------------------

struct kmp_base_ticket_lock {
    // `initialized' must be the first entry in the lock data structure!
    volatile union kmp_ticket_lock * initialized;  // points to the lock union if in initialized state
    ident_t const *     location;     // Source code location of omp_init_lock().
    volatile kmp_uint32 next_ticket;  // ticket number to give to next thread which acquires
    volatile kmp_uint32 now_serving;  // ticket number for thread which holds the lock
    volatile kmp_int32  owner_id;     // (gtid+1) of owning thread, 0 if unlocked
    kmp_int32           depth_locked; // depth locked, for nested locks only
    kmp_lock_flags_t    flags;        // lock specifics, e.g. critical section lock
};

typedef struct kmp_base_ticket_lock kmp_base_ticket_lock_t;

union KMP_ALIGN_CACHE kmp_ticket_lock {
    kmp_base_ticket_lock_t lk;       // This field must be first to allow static initializing.
    kmp_lock_pool_t pool;
    double                 lk_align; // use worst case alignment
    char                   lk_pad[ KMP_PAD( kmp_base_ticket_lock_t, CACHE_LINE ) ];
};

typedef union kmp_ticket_lock kmp_ticket_lock_t;

//
// Static initializer for simple ticket lock variables. Usage:
//    kmp_ticket_lock_t xlock = KMP_TICKET_LOCK_INITIALIZER( xlock );
// Note the macro argument. It is important to make var properly initialized.
//
#define KMP_TICKET_LOCK_INITIALIZER( lock ) { { (kmp_ticket_lock_t *) & (lock), NULL, 0, 0, 0, -1 } }

extern void __kmp_acquire_ticket_lock( kmp_ticket_lock_t *lck, kmp_int32 gtid );
extern int __kmp_test_ticket_lock( kmp_ticket_lock_t *lck, kmp_int32 gtid );
extern int __kmp_test_ticket_lock_with_cheks( kmp_ticket_lock_t *lck, kmp_int32 gtid );
extern void __kmp_release_ticket_lock( kmp_ticket_lock_t *lck, kmp_int32 gtid );
extern void __kmp_init_ticket_lock( kmp_ticket_lock_t *lck );
extern void __kmp_destroy_ticket_lock( kmp_ticket_lock_t *lck );

extern void __kmp_acquire_nested_ticket_lock( kmp_ticket_lock_t *lck, kmp_int32 gtid );
extern int __kmp_test_nested_ticket_lock( kmp_ticket_lock_t *lck, kmp_int32 gtid );
extern void __kmp_release_nested_ticket_lock( kmp_ticket_lock_t *lck, kmp_int32 gtid );
extern void __kmp_init_nested_ticket_lock( kmp_ticket_lock_t *lck );
extern void __kmp_destroy_nested_ticket_lock( kmp_ticket_lock_t *lck );

// ----------------------------------------------------------------------------
// Queuing locks.
// ----------------------------------------------------------------------------

#if KMP_USE_ADAPTIVE_LOCKS

struct kmp_adaptive_lock;

typedef struct kmp_adaptive_lock kmp_adaptive_lock_t;

#if KMP_DEBUG_ADAPTIVE_LOCKS

struct kmp_adaptive_lock_statistics {
    /* So we can get stats from locks that haven't been destroyed. */
    kmp_adaptive_lock_t * next;
    kmp_adaptive_lock_t * prev;

    /* Other statistics */
    kmp_uint32 successfulSpeculations;
    kmp_uint32 hardFailedSpeculations;
    kmp_uint32 softFailedSpeculations;
    kmp_uint32 nonSpeculativeAcquires;
    kmp_uint32 nonSpeculativeAcquireAttempts;
    kmp_uint32 lemmingYields;
};

typedef struct kmp_adaptive_lock_statistics kmp_adaptive_lock_statistics_t;

extern void __kmp_print_speculative_stats();
extern void __kmp_init_speculative_stats();

#endif // KMP_DEBUG_ADAPTIVE_LOCKS

struct kmp_adaptive_lock
{
    /* Values used for adaptivity.
     * Although these are accessed from multiple threads we don't access them atomically,
     * because if we miss updates it probably doesn't matter much. (It just affects our
     * decision about whether to try speculation on the lock).
     */
    kmp_uint32 volatile badness;
    kmp_uint32 volatile acquire_attempts;
    /* Parameters of the lock. */
    kmp_uint32 max_badness;
    kmp_uint32 max_soft_retries;

#if KMP_DEBUG_ADAPTIVE_LOCKS
    kmp_adaptive_lock_statistics_t volatile stats;
#endif
};

#endif // KMP_USE_ADAPTIVE_LOCKS

struct kmp_base_queuing_lock {

    //  `initialized' must be the first entry in the lock data structure!
    volatile union kmp_queuing_lock *initialized; // Points to the lock union if in initialized state.

    ident_t const *     location;     // Source code location of omp_init_lock().

    KMP_ALIGN( 8 )                    // tail_id  must be 8-byte aligned!

    volatile kmp_int32  tail_id;      // (gtid+1) of thread at tail of wait queue, 0 if empty
                                      // Must be no padding here since head/tail used in 8-byte CAS
    volatile kmp_int32  head_id;      // (gtid+1) of thread at head of wait queue, 0 if empty
                                      // Decl order assumes little endian
    // bakery-style lock
    volatile kmp_uint32 next_ticket;  // ticket number to give to next thread which acquires
    volatile kmp_uint32 now_serving;  // ticket number for thread which holds the lock
    volatile kmp_int32  owner_id;     // (gtid+1) of owning thread, 0 if unlocked
    kmp_int32           depth_locked; // depth locked, for nested locks only

    kmp_lock_flags_t    flags;        // lock specifics, e.g. critical section lock
#if KMP_USE_ADAPTIVE_LOCKS
    KMP_ALIGN(CACHE_LINE)
    kmp_adaptive_lock_t adaptive;     // Information for the speculative adaptive lock
#endif
};

typedef struct kmp_base_queuing_lock kmp_base_queuing_lock_t;

KMP_BUILD_ASSERT( offsetof( kmp_base_queuing_lock_t, tail_id ) % 8 == 0 );

union KMP_ALIGN_CACHE kmp_queuing_lock {
    kmp_base_queuing_lock_t lk;       // This field must be first to allow static initializing.
    kmp_lock_pool_t pool;
    double                   lk_align; // use worst case alignment
    char                     lk_pad[ KMP_PAD( kmp_base_queuing_lock_t, CACHE_LINE ) ];
};

typedef union kmp_queuing_lock kmp_queuing_lock_t;

extern void __kmp_acquire_queuing_lock( kmp_queuing_lock_t *lck, kmp_int32 gtid );
extern int __kmp_test_queuing_lock( kmp_queuing_lock_t *lck, kmp_int32 gtid );
extern void __kmp_release_queuing_lock( kmp_queuing_lock_t *lck, kmp_int32 gtid );
extern void __kmp_init_queuing_lock( kmp_queuing_lock_t *lck );
extern void __kmp_destroy_queuing_lock( kmp_queuing_lock_t *lck );

extern void __kmp_acquire_nested_queuing_lock( kmp_queuing_lock_t *lck, kmp_int32 gtid );
extern int __kmp_test_nested_queuing_lock( kmp_queuing_lock_t *lck, kmp_int32 gtid );
extern void __kmp_release_nested_queuing_lock( kmp_queuing_lock_t *lck, kmp_int32 gtid );
extern void __kmp_init_nested_queuing_lock( kmp_queuing_lock_t *lck );
extern void __kmp_destroy_nested_queuing_lock( kmp_queuing_lock_t *lck );

// ----------------------------------------------------------------------------
// DRDPA ticket locks.
// ----------------------------------------------------------------------------

struct kmp_base_drdpa_lock {
    //
    // All of the fields on the first cache line are only written when
    // initializing or reconfiguring the lock.  These are relatively rare
    // operations, so data from the first cache line will usually stay
    // resident in the cache of each thread trying to acquire the lock.
    //
    // initialized must be the first entry in the lock data structure!
    //
    KMP_ALIGN_CACHE

    volatile union kmp_drdpa_lock * initialized;    // points to the lock union if in initialized state
    ident_t const *                 location;       // Source code location of omp_init_lock().
    volatile struct kmp_lock_poll {
        kmp_uint64 poll;
    } * volatile polls;
    volatile kmp_uint64             mask;           // is 2**num_polls-1 for mod op
    kmp_uint64                      cleanup_ticket; // thread with cleanup ticket
    volatile struct kmp_lock_poll * old_polls;      // will deallocate old_polls
    kmp_uint32                      num_polls;      // must be power of 2

    //
    // next_ticket it needs to exist in a separate cache line, as it is
    // invalidated every time a thread takes a new ticket.
    //
    KMP_ALIGN_CACHE

    volatile kmp_uint64             next_ticket;

    //
    // now_serving is used to store our ticket value while we hold the lock.
    // It has a slighly different meaning in the DRDPA ticket locks (where
    // it is written by the acquiring thread) than it does in the simple
    // ticket locks (where it is written by the releasing thread).
    //
    // Since now_serving is only read an written in the critical section,
    // it is non-volatile, but it needs to exist on a separate cache line,
    // as it is invalidated at every lock acquire.
    //
    // Likewise, the vars used for nested locks (owner_id and depth_locked)
    // are only written by the thread owning the lock, so they are put in
    // this cache line.  owner_id is read by other threads, so it must be
    // declared volatile.
    //
    KMP_ALIGN_CACHE

    kmp_uint64                      now_serving;    // doesn't have to be volatile
    volatile kmp_uint32             owner_id;       // (gtid+1) of owning thread, 0 if unlocked
    kmp_int32                       depth_locked;   // depth locked
    kmp_lock_flags_t                flags;          // lock specifics, e.g. critical section lock
};

typedef struct kmp_base_drdpa_lock kmp_base_drdpa_lock_t;

union KMP_ALIGN_CACHE kmp_drdpa_lock {
    kmp_base_drdpa_lock_t lk;       // This field must be first to allow static initializing. */
    kmp_lock_pool_t pool;
    double                lk_align; // use worst case alignment
    char                  lk_pad[ KMP_PAD( kmp_base_drdpa_lock_t, CACHE_LINE ) ];
};

typedef union kmp_drdpa_lock kmp_drdpa_lock_t;

extern void __kmp_acquire_drdpa_lock( kmp_drdpa_lock_t *lck, kmp_int32 gtid );
extern int __kmp_test_drdpa_lock( kmp_drdpa_lock_t *lck, kmp_int32 gtid );
extern void __kmp_release_drdpa_lock( kmp_drdpa_lock_t *lck, kmp_int32 gtid );
extern void __kmp_init_drdpa_lock( kmp_drdpa_lock_t *lck );
extern void __kmp_destroy_drdpa_lock( kmp_drdpa_lock_t *lck );

extern void __kmp_acquire_nested_drdpa_lock( kmp_drdpa_lock_t *lck, kmp_int32 gtid );
extern int __kmp_test_nested_drdpa_lock( kmp_drdpa_lock_t *lck, kmp_int32 gtid );
extern void __kmp_release_nested_drdpa_lock( kmp_drdpa_lock_t *lck, kmp_int32 gtid );
extern void __kmp_init_nested_drdpa_lock( kmp_drdpa_lock_t *lck );
extern void __kmp_destroy_nested_drdpa_lock( kmp_drdpa_lock_t *lck );

// ============================================================================
// Lock purposes.
// ============================================================================

// ----------------------------------------------------------------------------
// Bootstrap locks.
// ----------------------------------------------------------------------------

// Bootstrap locks -- very few locks used at library initialization time.
// Bootstrap locks are currently implemented as ticket locks.
// They could also be implemented as test and set lock, but cannot be
// implemented with other lock kinds as they require gtids which are not
// available at initialization time.

typedef kmp_ticket_lock_t kmp_bootstrap_lock_t;

#define KMP_BOOTSTRAP_LOCK_INITIALIZER( lock ) KMP_TICKET_LOCK_INITIALIZER( (lock) )

inline void
__kmp_acquire_bootstrap_lock( kmp_bootstrap_lock_t *lck )
{
    __kmp_acquire_ticket_lock( lck, KMP_GTID_DNE );
}

inline int
__kmp_test_bootstrap_lock( kmp_bootstrap_lock_t *lck )
{
    return __kmp_test_ticket_lock( lck, KMP_GTID_DNE );
}

inline void
__kmp_release_bootstrap_lock( kmp_bootstrap_lock_t *lck )
{
    __kmp_release_ticket_lock( lck, KMP_GTID_DNE );
}

inline void
__kmp_init_bootstrap_lock( kmp_bootstrap_lock_t *lck )
{
    __kmp_init_ticket_lock( lck );
}

inline void
__kmp_destroy_bootstrap_lock( kmp_bootstrap_lock_t *lck )
{
    __kmp_destroy_ticket_lock( lck );
}

// ----------------------------------------------------------------------------
// Internal RTL locks.
// ----------------------------------------------------------------------------

//
// Internal RTL locks are also implemented as ticket locks, for now.
//
// FIXME - We should go through and figure out which lock kind works best for
// each internal lock, and use the type deeclaration and function calls for
// that explicit lock kind (and get rid of this section).
//

typedef kmp_ticket_lock_t kmp_lock_t;

inline void
__kmp_acquire_lock( kmp_lock_t *lck, kmp_int32 gtid )
{
    __kmp_acquire_ticket_lock( lck, gtid );
}

inline int
__kmp_test_lock( kmp_lock_t *lck, kmp_int32 gtid )
{
    return __kmp_test_ticket_lock( lck, gtid );
}

inline void
__kmp_release_lock( kmp_lock_t *lck, kmp_int32 gtid )
{
    __kmp_release_ticket_lock( lck, gtid );
}

inline void
__kmp_init_lock( kmp_lock_t *lck )
{
    __kmp_init_ticket_lock( lck );
}

inline void
__kmp_destroy_lock( kmp_lock_t *lck )
{
    __kmp_destroy_ticket_lock( lck );
}

// ----------------------------------------------------------------------------
// User locks.
// ----------------------------------------------------------------------------

//
// Do not allocate objects of type union kmp_user_lock!!!
// This will waste space unless __kmp_user_lock_kind == lk_drdpa.
// Instead, check the value of __kmp_user_lock_kind and allocate objects of
// the type of the appropriate union member, and cast their addresses to
// kmp_user_lock_p.
//

enum kmp_lock_kind {
    lk_default = 0,
    lk_tas,
#if KMP_OS_LINUX && (KMP_ARCH_X86 || KMP_ARCH_X86_64)
    lk_futex,
#endif
    lk_ticket,
    lk_queuing,
    lk_drdpa,
#if KMP_USE_ADAPTIVE_LOCKS
    lk_adaptive
#endif // KMP_USE_ADAPTIVE_LOCKS
};

typedef enum kmp_lock_kind kmp_lock_kind_t;

extern kmp_lock_kind_t __kmp_user_lock_kind;

union kmp_user_lock {
    kmp_tas_lock_t     tas;
#if KMP_OS_LINUX && (KMP_ARCH_X86 || KMP_ARCH_X86_64)
    kmp_futex_lock_t   futex;
#endif
    kmp_ticket_lock_t  ticket;
    kmp_queuing_lock_t queuing;
    kmp_drdpa_lock_t   drdpa;
#if KMP_USE_ADAPTIVE_LOCKS
    kmp_adaptive_lock_t     adaptive;
#endif // KMP_USE_ADAPTIVE_LOCKS
    kmp_lock_pool_t    pool;
};

typedef union kmp_user_lock *kmp_user_lock_p;

extern size_t __kmp_base_user_lock_size;
extern size_t __kmp_user_lock_size;

extern kmp_int32 ( *__kmp_get_user_lock_owner_ )( kmp_user_lock_p lck );

inline kmp_int32
__kmp_get_user_lock_owner( kmp_user_lock_p lck )
{
    KMP_DEBUG_ASSERT( __kmp_get_user_lock_owner_ != NULL );
    return ( *__kmp_get_user_lock_owner_ )( lck );
}

extern void ( *__kmp_acquire_user_lock_with_checks_ )( kmp_user_lock_p lck, kmp_int32 gtid );

#if KMP_OS_LINUX && (KMP_ARCH_X86 || KMP_ARCH_X86_64)

#define __kmp_acquire_user_lock_with_checks(lck,gtid)                                           \
    if (__kmp_user_lock_kind == lk_tas) {                                                       \
        if ( __kmp_env_consistency_check ) {                                                    \
            char const * const func = "omp_set_lock";                                           \
            if ( ( sizeof ( kmp_tas_lock_t ) <= OMP_LOCK_T_SIZE )                               \
                && lck->tas.lk.depth_locked != -1 ) {                                           \
                KMP_FATAL( LockNestableUsedAsSimple, func );                                    \
            }                                                                                \
            if ( ( gtid >= 0 ) && ( lck->tas.lk.poll - 1 == gtid ) ) {                          \
                KMP_FATAL( LockIsAlreadyOwned, func );                                          \
            }                                                                                \
        }                                                                                \
        if ( __sync_val_compare_and_swap( &(lck->tas.lk.poll), 0, gtid + 1 ) ) {                \
            kmp_uint32 spins;                                                                   \
            KMP_FSYNC_PREPARE( lck );                                                           \
            KMP_INIT_YIELD( spins );                                                            \
            if ( TCR_4(__kmp_nth) > (__kmp_avail_proc ? __kmp_avail_proc : __kmp_xproc) ) {     \
                KMP_YIELD( TRUE );                                                              \
            } else {                                                                            \
                KMP_YIELD_SPIN( spins );                                                        \
            }                                                                                \
            while ( __sync_val_compare_and_swap( &(lck->tas.lk.poll), 0, gtid + 1 ) ) {         \
                if ( TCR_4(__kmp_nth) > (__kmp_avail_proc ? __kmp_avail_proc : __kmp_xproc) ) { \
                    KMP_YIELD( TRUE );                                                          \
                } else {                                                                        \
                    KMP_YIELD_SPIN( spins );                                                    \
                }                                                                               \
            }                                                                                \
        }                                                                                \
        KMP_FSYNC_ACQUIRED( lck );                                                              \
    } else {                                                                                \
        KMP_DEBUG_ASSERT( __kmp_acquire_user_lock_with_checks_ != NULL );                       \
        ( *__kmp_acquire_user_lock_with_checks_ )( lck, gtid );                                 \
    }

#else
inline void
__kmp_acquire_user_lock_with_checks( kmp_user_lock_p lck, kmp_int32 gtid )
{
    KMP_DEBUG_ASSERT( __kmp_acquire_user_lock_with_checks_ != NULL );
    ( *__kmp_acquire_user_lock_with_checks_ )( lck, gtid );
}
#endif

extern int ( *__kmp_test_user_lock_with_checks_ )( kmp_user_lock_p lck, kmp_int32 gtid );

#if KMP_OS_LINUX && (KMP_ARCH_X86 || KMP_ARCH_X86_64)

#include "kmp_i18n.h"                       /* AC: KMP_FATAL definition */
extern int __kmp_env_consistency_check;     /* AC: copy from kmp.h here */
inline int
__kmp_test_user_lock_with_checks( kmp_user_lock_p lck, kmp_int32 gtid )
{
    if ( __kmp_user_lock_kind == lk_tas ) {
        if ( __kmp_env_consistency_check ) {
            char const * const func = "omp_test_lock";
            if ( ( sizeof ( kmp_tas_lock_t ) <= OMP_LOCK_T_SIZE )
                && lck->tas.lk.depth_locked != -1 ) {
                KMP_FATAL( LockNestableUsedAsSimple, func );
            }
        }
        return !__sync_val_compare_and_swap( &(lck->tas.lk.poll), 0, gtid + 1 );
    } else {
        KMP_DEBUG_ASSERT( __kmp_test_user_lock_with_checks_ != NULL );
        return ( *__kmp_test_user_lock_with_checks_ )( lck, gtid );
    }
}
#else
inline int
__kmp_test_user_lock_with_checks( kmp_user_lock_p lck, kmp_int32 gtid )
{
    KMP_DEBUG_ASSERT( __kmp_test_user_lock_with_checks_ != NULL );
    return ( *__kmp_test_user_lock_with_checks_ )( lck, gtid );
}
#endif

extern void ( *__kmp_release_user_lock_with_checks_ )( kmp_user_lock_p lck, kmp_int32 gtid );

inline void
__kmp_release_user_lock_with_checks( kmp_user_lock_p lck, kmp_int32 gtid )
{
    KMP_DEBUG_ASSERT( __kmp_release_user_lock_with_checks_ != NULL );
    ( *__kmp_release_user_lock_with_checks_ ) ( lck, gtid );
}

extern void ( *__kmp_init_user_lock_with_checks_ )( kmp_user_lock_p lck );

inline void
__kmp_init_user_lock_with_checks( kmp_user_lock_p lck )
{
    KMP_DEBUG_ASSERT( __kmp_init_user_lock_with_checks_ != NULL );
    ( *__kmp_init_user_lock_with_checks_ )( lck );
}

//
// We need a non-checking version of destroy lock for when the RTL is
// doing the cleanup as it can't always tell if the lock is nested or not.
//
extern void ( *__kmp_destroy_user_lock_ )( kmp_user_lock_p lck );

inline void
__kmp_destroy_user_lock( kmp_user_lock_p lck )
{
    KMP_DEBUG_ASSERT( __kmp_destroy_user_lock_ != NULL );
    ( *__kmp_destroy_user_lock_ )( lck );
}

extern void ( *__kmp_destroy_user_lock_with_checks_ )( kmp_user_lock_p lck );

inline void
__kmp_destroy_user_lock_with_checks( kmp_user_lock_p lck )
{
    KMP_DEBUG_ASSERT( __kmp_destroy_user_lock_with_checks_ != NULL );
    ( *__kmp_destroy_user_lock_with_checks_ )( lck );
}

extern void ( *__kmp_acquire_nested_user_lock_with_checks_ )( kmp_user_lock_p lck, kmp_int32 gtid );

#if KMP_OS_LINUX && (KMP_ARCH_X86 || KMP_ARCH_X86_64)

#define __kmp_acquire_nested_user_lock_with_checks(lck,gtid)                                        \
    if (__kmp_user_lock_kind == lk_tas) {                                                           \
        if ( __kmp_env_consistency_check ) {                                                        \
            char const * const func = "omp_set_nest_lock";                                          \
            if ( ( sizeof ( kmp_tas_lock_t ) <= OMP_NEST_LOCK_T_SIZE )                              \
                && lck->tas.lk.depth_locked == -1 ) {                                               \
                KMP_FATAL( LockSimpleUsedAsNestable, func );                                        \
            }                                                                                \
        }                                                                                \
        if ( lck->tas.lk.poll - 1 == gtid ) {                                                       \
            lck->tas.lk.depth_locked += 1;                                                          \
        } else {                                                                                \
            if ( __sync_val_compare_and_swap( &(lck->tas.lk.poll), 0, gtid + 1 ) ) {                \
                kmp_uint32 spins;                                                                   \
                KMP_FSYNC_PREPARE( lck );                                                           \
                KMP_INIT_YIELD( spins );                                                            \
                if ( TCR_4(__kmp_nth) > (__kmp_avail_proc ? __kmp_avail_proc : __kmp_xproc) ) {     \
                    KMP_YIELD( TRUE );                                                              \
                } else {                                                                            \
                    KMP_YIELD_SPIN( spins );                                                        \
                }                                                                                \
                while ( __sync_val_compare_and_swap( &(lck->tas.lk.poll), 0, gtid + 1 ) ) {         \
                    if ( TCR_4(__kmp_nth) > (__kmp_avail_proc ? __kmp_avail_proc : __kmp_xproc) ) { \
                        KMP_YIELD( TRUE );                                                          \
                    } else {                                                                        \
                        KMP_YIELD_SPIN( spins );                                                    \
                    }                                                                               \
                }                                                                                \
            }                                                                                \
            lck->tas.lk.depth_locked = 1;                                                           \
        }                                                                                \
        KMP_FSYNC_ACQUIRED( lck );                                                                  \
    } else {                                                                                \
        KMP_DEBUG_ASSERT( __kmp_acquire_nested_user_lock_with_checks_ != NULL );                    \
        ( *__kmp_acquire_nested_user_lock_with_checks_ )( lck, gtid );                              \
    }

#else
inline void
__kmp_acquire_nested_user_lock_with_checks( kmp_user_lock_p lck, kmp_int32 gtid )
{
    KMP_DEBUG_ASSERT( __kmp_acquire_nested_user_lock_with_checks_ != NULL );
    ( *__kmp_acquire_nested_user_lock_with_checks_ )( lck, gtid );
}
#endif

extern int ( *__kmp_test_nested_user_lock_with_checks_ )( kmp_user_lock_p lck, kmp_int32 gtid );

#if KMP_OS_LINUX && (KMP_ARCH_X86 || KMP_ARCH_X86_64)
inline int
__kmp_test_nested_user_lock_with_checks( kmp_user_lock_p lck, kmp_int32 gtid )
{
    if ( __kmp_user_lock_kind == lk_tas ) {
        int retval;
        if ( __kmp_env_consistency_check ) {
            char const * const func = "omp_test_nest_lock";
            if ( ( sizeof ( kmp_tas_lock_t ) <= OMP_NEST_LOCK_T_SIZE )
                && lck->tas.lk.depth_locked == -1 ) {
                KMP_FATAL( LockSimpleUsedAsNestable, func );
            }
        }
        KMP_DEBUG_ASSERT( gtid >= 0 );
        if ( lck->tas.lk.poll - 1 == gtid ) {   /* __kmp_get_tas_lock_owner( lck ) == gtid */
            return ++lck->tas.lk.depth_locked;  /* same owner, depth increased */
        }
        retval = !__sync_val_compare_and_swap( &(lck->tas.lk.poll), 0, gtid + 1 );
        if ( retval ) {
            KMP_MB();
            lck->tas.lk.depth_locked = 1;
        }
        return retval;
    } else {
        KMP_DEBUG_ASSERT( __kmp_test_nested_user_lock_with_checks_ != NULL );
        return ( *__kmp_test_nested_user_lock_with_checks_ )( lck, gtid );
    }
}
#else
inline int
__kmp_test_nested_user_lock_with_checks( kmp_user_lock_p lck, kmp_int32 gtid )
{
    KMP_DEBUG_ASSERT( __kmp_test_nested_user_lock_with_checks_ != NULL );
    return ( *__kmp_test_nested_user_lock_with_checks_ )( lck, gtid );
}
#endif

extern void ( *__kmp_release_nested_user_lock_with_checks_ )( kmp_user_lock_p lck, kmp_int32 gtid );

inline void
__kmp_release_nested_user_lock_with_checks( kmp_user_lock_p lck, kmp_int32 gtid )
{
    KMP_DEBUG_ASSERT( __kmp_release_nested_user_lock_with_checks_ != NULL );
    ( *__kmp_release_nested_user_lock_with_checks_ )( lck, gtid );
}

extern void ( *__kmp_init_nested_user_lock_with_checks_ )( kmp_user_lock_p lck );

inline void __kmp_init_nested_user_lock_with_checks( kmp_user_lock_p lck )
{
    KMP_DEBUG_ASSERT( __kmp_init_nested_user_lock_with_checks_ != NULL );
    ( *__kmp_init_nested_user_lock_with_checks_ )( lck );
}

extern void ( *__kmp_destroy_nested_user_lock_with_checks_ )( kmp_user_lock_p lck );

inline void
__kmp_destroy_nested_user_lock_with_checks( kmp_user_lock_p lck )
{
    KMP_DEBUG_ASSERT( __kmp_destroy_nested_user_lock_with_checks_ != NULL );
    ( *__kmp_destroy_nested_user_lock_with_checks_ )( lck );
}

//
// user lock functions which do not necessarily exist for all lock kinds.
//
// The "set" functions usually have wrapper routines that check for a NULL set
// function pointer and call it if non-NULL.
//
// In some cases, it makes sense to have a "get" wrapper function check for a
// NULL get function pointer and return NULL / invalid value / error code if
// the function pointer is NULL.
//
// In other cases, the calling code really should differentiate between an
// unimplemented function and one that is implemented but returning NULL /
// invalied value.  If this is the case, no get function wrapper exists.
//

extern int ( *__kmp_is_user_lock_initialized_ )( kmp_user_lock_p lck );

// no set function; fields set durining local allocation

extern const ident_t * ( *__kmp_get_user_lock_location_ )( kmp_user_lock_p lck );

inline const ident_t *
__kmp_get_user_lock_location( kmp_user_lock_p lck )
{
    if ( __kmp_get_user_lock_location_  != NULL ) {
        return ( *__kmp_get_user_lock_location_ )( lck );
    }
    else {
        return NULL;
    }
}

extern void ( *__kmp_set_user_lock_location_ )( kmp_user_lock_p lck, const ident_t *loc );

inline void
__kmp_set_user_lock_location( kmp_user_lock_p lck, const ident_t *loc )
{
    if ( __kmp_set_user_lock_location_  != NULL ) {
        ( *__kmp_set_user_lock_location_ )( lck, loc );
    }
}

extern kmp_lock_flags_t ( *__kmp_get_user_lock_flags_ )( kmp_user_lock_p lck );

extern void ( *__kmp_set_user_lock_flags_ )( kmp_user_lock_p lck, kmp_lock_flags_t flags );

inline void
__kmp_set_user_lock_flags( kmp_user_lock_p lck, kmp_lock_flags_t flags )
{
    if ( __kmp_set_user_lock_flags_  != NULL ) {
        ( *__kmp_set_user_lock_flags_ )( lck, flags );
    }
}

//
// The fuction which sets up all of the vtbl pointers for kmp_user_lock_t.
//
extern void __kmp_set_user_lock_vptrs( kmp_lock_kind_t user_lock_kind );

// ----------------------------------------------------------------------------
// User lock table & lock allocation
// ----------------------------------------------------------------------------

/*
    On 64-bit Linux* OS (and OS X*) GNU compiler allocates only 4 bytems memory for lock variable, which
    is not enough to store a pointer, so we have to use lock indexes instead of pointers and
    maintain lock table to map indexes to pointers.

    Note: The first element of the table is not a pointer to lock! It is a pointer to previously
    allocated table (or NULL if it is the first table).

    Usage:

        if ( OMP_LOCK_T_SIZE < sizeof( <lock> ) ) { // or OMP_NEST_LOCK_T_SIZE
            Lock table is fully utilized. User locks are indexes, so table is
            used on user lock operation.
            Note: it may be the case (lin_32) that we don't need to use a lock
            table for regular locks, but do need the table for nested locks.
        }
        else {
            Lock table initialized but not actually used.
        }
*/

struct kmp_lock_table {
    kmp_lock_index_t  used;      // Number of used elements
    kmp_lock_index_t  allocated; // Number of allocated elements
    kmp_user_lock_p * table;     // Lock table.
};

typedef struct kmp_lock_table kmp_lock_table_t;

extern kmp_lock_table_t __kmp_user_lock_table;
extern kmp_user_lock_p __kmp_lock_pool;

struct kmp_block_of_locks {
    struct kmp_block_of_locks * next_block;
    void *                      locks;
};

typedef struct kmp_block_of_locks kmp_block_of_locks_t;

extern kmp_block_of_locks_t *__kmp_lock_blocks;
extern int __kmp_num_locks_in_block;

extern kmp_user_lock_p __kmp_user_lock_allocate( void **user_lock, kmp_int32 gtid, kmp_lock_flags_t flags = 0 );
extern void __kmp_user_lock_free( void **user_lock, kmp_int32 gtid, kmp_user_lock_p lck );
extern kmp_user_lock_p __kmp_lookup_user_lock( void **user_lock, char const *func );
extern void __kmp_cleanup_user_locks();

#define KMP_CHECK_USER_LOCK_INIT() \
        {                                                               \
            if ( ! TCR_4( __kmp_init_user_locks ) ) {                   \
                __kmp_acquire_bootstrap_lock( &__kmp_initz_lock );      \
                if ( ! TCR_4( __kmp_init_user_locks ) ) {               \
                    TCW_4( __kmp_init_user_locks, TRUE );               \
                }                                                       \
                __kmp_release_bootstrap_lock( &__kmp_initz_lock );      \
            }                                                           \
        }

#undef KMP_PAD
#undef KMP_GTID_DNE

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus

#endif /* KMP_LOCK_H */


text:
..
      Copyright 2013 François Rossigneux (Inria)

      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.

=======================
Working with the Source
=======================

Setting up a Development Sandbox
================================

1. Set up a server or virtual machine.

2. Clone the kwapi project to the machine::

    $ git clone https://github.com/lpouillo/kwapi-g5k.git
    $ cd ./kwapi-g5k

3. Once this is done, use develop option of `setup.py` file to install kwapi locally::

    $ python setup.py develop

4. If some dependant packages are missing, fix them with `pip install`::

    $ pip install -r requirments.txt

4. You can start to hack kwapi. If you are preparing a patch, create a topic branch and switch to
   it before making any changes::

    $ git checkout -b TOPIC-BRANCH

5. Use git to push your changes and ask for a pull request.

6. Package your solution for Debian installation::

    $ python setup.py --command-packages=stdeb.command bdist_deb
    $ cd deb_dist/

   All the deb archives are exported in this directory.

7. Import the new generated packages of kwapi-g5k on the remote apt repository.

8. Execute Puppet on the VM to install the latest version of Kwapi or simply run::

    $ apt-get update && apt-get install python-kwapi-g5k

Code Reviews
============

Kwapi uses the GitHub to hos all code and developer documentation contributions.
You can report an issue or a feature request on this repository.

Bugzilla can also be used for API related bugs or device configuration problems.

.. _Kwapi on GitHub: http://github.com/lpouillo/kwapi-g5k/issues
.. _Bugzilla on Grid'5000: https://intranet.grid5000.fr/bugzilla/


text:
conversations = {}
make_me_mod_queries = {}
change_account_queries = {}


text:
Configuration

Name

 {{cluster.clusterName}}

Storage Type

 {{cluster.storageType.type}}

Cluster Type

 {{cluster.clusterType.type}}

Workload

 {{cluster.workload.type}}

Deployment Type

 {{cluster.deploymentType.type}}

Hosts

         Hostname

      IP Address
      Type
      Cluster IP Adress

        {{host.hostname}}
        {{host.ipaddress}}
        {{host.isMon ? 'Monitor' : 'OSD'}}
        {{host.ipaddress}}


text:
using namespace boost::python;
using namespace GafferBindings;
using namespace Gaffer;

static std::string maskedMemberPlugRepr( const CompoundDataPlug::MemberPlug *plug, unsigned flagsMask )
{
	// the only reason we have a different __repr__ implementation than Gaffer::Plug is
	// because we can't determine the nested class name from a PyObject.
	std::string result = "Gaffer.CompoundDataPlug.MemberPlug( \"" + plug->getName().string() + "\", ";

	if( plug->direction()!=Plug::In )
	{
		result += "direction = " + PlugSerialiser::directionRepr( plug->direction() ) + ", ";
	}

	const unsigned flags = plug->getFlags() & flagsMask;
	if( flags != Plug::Default )
	{
		result += "flags = " + PlugSerialiser::flagsRepr( flags ) + ", ";
	}

	result += ")";

	return result;
}

static std::string memberPlugRepr( const CompoundDataPlug::MemberPlug *plug )
{
	return maskedMemberPlugRepr( plug, Plug::All );
}

static CompoundDataPlugPtr compoundDataPlugConstructor( const char *name, Plug::Direction direction, unsigned flags, tuple children )
{
	CompoundDataPlugPtr result = new CompoundDataPlug( name, direction, flags );
	size_t s = extract<size_t>( children.attr( "__len__" )() );
	for( size_t i=0; i<s; i++ )
	{
		Gaffer::PlugPtr c = extract<Gaffer::PlugPtr>( children[i] );
		result->addChild( c );
	}
	return result;
}

static Gaffer::CompoundDataPlug::MemberPlugPtr addMemberWrapper( CompoundDataPlug &p, const std::string &name, IECore::DataPtr value, const std::string &plugName, unsigned plugFlags )
{
	return p.addMember( name, value.get(), plugName, plugFlags );
}

static Gaffer::CompoundDataPlug::MemberPlugPtr addMemberWrapper2( CompoundDataPlug &p, const std::string &name, ValuePlug *valuePlug, const std::string &plugName )
{
	return p.addMember( name, valuePlug, plugName );
}

static Gaffer::CompoundDataPlug::MemberPlugPtr addOptionalMemberWrapper( CompoundDataPlug &p, const std::string &name, IECore::DataPtr value, const std::string plugName, unsigned plugFlags, bool enabled )
{
	return p.addOptionalMember( name, value.get(), plugName, plugFlags, enabled );
}

static Gaffer::CompoundDataPlug::MemberPlugPtr addOptionalMemberWrapper2( CompoundDataPlug &p, const std::string &name, ValuePlug *valuePlug, const std::string &plugName, bool enabled )
{
	return p.addOptionalMember( name, valuePlug, plugName, enabled );
}

static tuple memberDataAndNameWrapper( CompoundDataPlug &p, const CompoundDataPlug::MemberPlug *member )
{
	std::string name;
	IECore::DataPtr d = p.memberDataAndName( member, name );
	return boost::python::make_tuple( d, name );
}

static void fillCompoundData( const CompoundDataPlug &p, IECore::CompoundData *d )
{
	p.fillCompoundData( d->writable() );
}

static void fillCompoundObject( const CompoundDataPlug &p, IECore::CompoundObject *o )
{
	p.fillCompoundObject( o->members() );
}

class MemberPlugSerialiser : public CompoundPlugSerialiser
{

	public :

		virtual std::string constructor( const Gaffer::GraphComponent *graphComponent, const Serialisation &serialisation ) const
		{
			return maskedMemberPlugRepr( static_cast<const CompoundDataPlug::MemberPlug *>( graphComponent ), Plug::All & ~Plug::ReadOnly );
		}

		virtual bool childNeedsConstruction( const Gaffer::GraphComponent *child ) const
		{
			// if the parent is dynamic then all the children will need construction.
			const Plug *parent = child->parent<Plug>();
			return parent->getFlags( Gaffer::Plug::Dynamic );
		}

};

void GafferBindings::bindCompoundDataPlug()
{

	scope s = PlugClass<CompoundDataPlug>()
		.def( "__init__", make_constructor( compoundDataPlugConstructor, default_call_policies(),
				(
					arg( "name" ) = GraphComponent::defaultName<CompoundDataPlug>(),
					arg( "direction" ) = Gaffer::Plug::In,
					arg( "flags" ) = Gaffer::Plug::Default,
					arg( "children" ) = tuple()
				)
			)
		)
		.def( "addMember", &addMemberWrapper, ( arg_( "name" ), arg_( "defaultValue" ), arg_( "plugName" ) = "member1", arg_( "plugFlags" ) = Plug::Default | Plug::Dynamic ) )
		.def( "addMember", &addMemberWrapper2, ( arg_( "name" ), arg_( "valuePlug" ), arg_( "plugName" ) = "member1" ) )
		.def( "addOptionalMember", &addOptionalMemberWrapper, ( arg_( "name" ), arg_( "defaultValue" ), arg_( "plugName" ) = "member1", arg_( "plugFlags" ) = Plug::Default | Plug::Dynamic, arg_( "enabled" ) = false ) )
		.def( "addOptionalMember", &addOptionalMemberWrapper2, ( arg_( "name" ), arg_( "valuePlug" ), arg_( "plugName" ) = "member1", arg_( "enabled" ) = false ) )
		.def( "addMembers", &CompoundDataPlug::addMembers, ( arg_( "members" ), arg_( "useNameAsPlugName" ) = false ) )
		.def( "memberDataAndName", &memberDataAndNameWrapper )
		.def( "fillCompoundData", &fillCompoundData )
		.def( "fillCompoundObject", &fillCompoundObject )
	;

	PlugClass<CompoundDataPlug::MemberPlug>()
		.def( init<const char *, Plug::Direction, unsigned>(
				(
					boost::python::arg_( "name" )=GraphComponent::defaultName<CompoundDataPlug::MemberPlug>(),
					boost::python::arg_( "direction" )=Plug::In,
					boost::python::arg_( "flags" )=Plug::Default
				)
			)
		)
		.def( "__repr__", memberPlugRepr )
	;

	Serialisation::registerSerialiser( Gaffer::CompoundDataPlug::MemberPlug::staticTypeId(), new MemberPlugSerialiser );

}


text:
import Ember from 'ember';
import { task, timeout } from 'ember-concurrency';

export default Ember.Component.extend({
  status: null,

// BEGIN-SNIPPET task-function-syntax-1
  waitAFewSeconds: task(function * () {
    this.set('status', "Gimme one second...");
    yield timeout(1000);
    this.set('status', "Gimme one more second...");
    yield timeout(1000);
    this.set('status', "OK, I'm done.");
  }),
// END-SNIPPET
});


text:
Contributing to Odoo
====================

[Full contribution guidelines](https://github.com/odoo/odoo/wiki/Contributing)

TL;DR

* Use this [template](https://github.com/odoo/odoo/wiki/Contributing#reporting-issues) when reporting issues, and please search for duplicates first!
* Pull requests must be made against the [correct version](https://github.com/odoo/odoo/wiki/Contributing#against-which-version-should-i-submit-a-patch)
* There are restrictions on the kind of [changes allowed in stable series](https://github.com/odoo/odoo/wiki/Contributing#what-does-stable-mean)


text:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace UI
{
    /// <summary>
    /// Logique d'interaction pour GameMenu.xaml
    /// </summary>
    public partial class GameMenu : Page
    {
        public GameMenu()
        {
            InitializeComponent();
        }

        private void newGame(object sender, RoutedEventArgs e)
        {
            this.NavigationService.Source = new System.Uri("/CharacterSelection.xaml", System.UriKind.Relative);
        }
        private void optionButton(object sender, RoutedEventArgs e)
        {
            /*ProcessStartInfo notepadStartInfo = new ProcessStartInfo("notepad.exe ./README.md");
            Process notepad = new Process();
            notepad.StartInfo = notepadStartInfo;
            notepad.Start();*/
            string[] lines = System.IO.File.ReadAllLines(@"..\..\resources\README.md");
            string text = "";
            foreach (string line in lines)
            {
                text += "\n" + line;
            }
            MessageBox.Show(text);
        }

        private void exitButton(object sender, RoutedEventArgs e)
        {
            Application.Current.Shutdown();
        }
    }
}


text:
using System;
using System.Windows;

namespace WPFUtility {
    public static class WindowGenerator {
        public static void CreateAndShow(Func<Action, ViewModelBase> contentGenerator, bool resizeable, double height, double width, string backgroundColor) {
            var window = new VMHostWindowView();
            var content = new VMHostWindowViewModel(contentGenerator(window.Close), backgroundColor);
            SetupWindow(window, content, resizeable, height, width);
            window.Show();
        }

        public static bool? CreateAndShowModal(Func<Action, ViewModelBase> contentGenerator, bool resizeable, double height, double width, string backgroundColor) {
            var window = new VMHostWindowView();
            var content = new VMHostWindowViewModel(contentGenerator(window.Close), backgroundColor);
            SetupWindow(window, content, resizeable, height, width);
            return window.ShowDialog();
        }

        public static void Popup(string message, double height, double width, string backgroundColor) {
            CreateAndShowModal(x => new MessageViewModel(message), false, height, width, backgroundColor);
        }

        private static void SetupWindow(VMHostWindowView window, VMHostWindowViewModel content, bool resizeable, double height, double width) {
            window.Owner = Application.Current.MainWindow;
            window.Height = height;
            window.Width = width;
            window.DataContext = content;
            window.ResizeMode = resizeable ? ResizeMode.CanResize : ResizeMode.NoResize;
        }
    }
}


text:
<!DOCTYPE html>
<html>
  <head>
    <meta charset=UTF-8>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Angular2 Seed</title>
    <base href="/">
  </head>
  <body>

    <seed-app>
      Loading...
    </seed-app>

    <script src="/polyfills.bundle.js"></script>
    <script src="/vendor.bundle.js"></script>
    <script src="/app.bundle.js"></script>

  </body>
</html>


text:
require 'test_helper'

class NewsHelperTest < ActionView::TestCase
end


text:
package database

import (
    "fmt"
    "os"
)

func Init() {
    if !needsInit() {
        return
    }
    fmt.Println("Creating database.")

    createUserTable()
    createPostTable()
}

func needsInit() bool {
    db := Get()
    query := "SELECT name FROM sqlite_master WHERE type='table' AND name='" + user_table_name + "';"

    rows, err := db.Query(query)
    if err != nil {
        fmt.Println(err)
        os.Exit(1)
    }

    if !rows.Next() {
        return true
    }
    return false
}

func createUserTable() {
    db := Get()

    createUser := "CREATE TABLE " + user_table_name +
        "(user_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," +
        "name TEXT NOT NULL," +
        "email TEXT NOT NULL UNIQUE);"

    _, err := db.Exec(createUser)
    if err != nil {
        fmt.Println(err)
        os.Exit(1)
    }
}

func createPostTable() {
    db := Get()

    createPost := "CREATE TABLE " + post_table_name +
        "(post_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," +
        "user_id INTEGER NOT NULL," +
        "date INTEGER," +
        "title TEXT," +
        "contents TEXT," +
        "FOREIGN KEY(user_id) REFERENCES user(user_id));"

    _, err := db.Exec(createPost)
    if err != nil {
        fmt.Println(err)
        os.Exit(1)
    }
}


text:
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.SignalR;
using PlanningPoker.Data.DTOs;

namespace PlanningPoker.Web.Hubs
{
  public static class GameEvents
  {
    internal static string Send = "Send";
    internal static string GameJoined = "GameJoined";
    internal static string UserJoined = "UserJoined";
    internal static string UserLeft = "UserLeft";
    internal static string CardPlayed = "CardPlayed";
    internal static string CardsShown = "CardsShown";
    internal static string NewGameStarted = "NewGameStarted";
  }
  public class GameHub : Hub
  {
    public override async Task OnDisconnectedAsync(Exception exception)
    {
      var user = ConnectedUsers.GetByConnectionId(Context.ConnectionId);
      ConnectedUsers.GameUsers.Remove(user);
      await Clients.Group(user.GroupId).SendAsync(GameEvents.UserLeft, ConnectedUsers.GetByGroup(user.GroupId));
      await Groups.RemoveFromGroupAsync(Context.ConnectionId, user.GroupId);
      await base.OnDisconnectedAsync(exception);
    }

    public async void JoinGroup(JoinGameRequestDto request)
    {
      var user = new GameUser
      {
        Name = request.Name,
        GroupId = request.GroupId,
        ConnectionId = Context.ConnectionId
      };

      ConnectedUsers.GameUsers.Add(user);

      await Groups.AddToGroupAsync(Context.ConnectionId, user.GroupId);
      await Clients.Client(Context.ConnectionId).SendAsync(GameEvents.GameJoined, user);
      await Clients.Group(user.GroupId).SendAsync(GameEvents.UserJoined, ConnectedUsers.GetByGroup(user.GroupId));
    }

    public async void PlayCard(string card)
    {
      var user = ConnectedUsers.GetByConnectionId(Context.ConnectionId);
      await Clients.Group(user.GroupId).SendAsync(GameEvents.CardPlayed, new CardDTO
      {
        ConnectionId = user.ConnectionId,
        Card = card
      });
    }

    public async void ShowCards()
    {
      var user = ConnectedUsers.GetByConnectionId(Context.ConnectionId);
      await Clients.Group(user.GroupId).SendAsync(GameEvents.CardsShown);
    }

    public async void StartNewGame()
    {
      var user = ConnectedUsers.GetByConnectionId(Context.ConnectionId);
      await Clients.Group(user.GroupId).SendAsync(GameEvents.NewGameStarted);
    }
  }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Versioning;
using System.Text;

namespace NuGet.Client.VisualStudio.UI
{
    public class UiPackageDependencySet
    {
        public FrameworkName TargetFramework { get; private set; }
        public IReadOnlyCollection<UiPackageDependency> Dependencies { get; private set; }
        public UiPackageDependencySet(FrameworkName targetFramework, IEnumerable<UiPackageDependency> dependencies)
        {
            TargetFramework = targetFramework;
            Dependencies = dependencies.ToList().AsReadOnly();
        }
    }
}


text:
/**
 * Generated by Agitar build: AgitarOne Version 6.0.0.000018 (Build date: Sep 06, 2013) [6.0.0.000018]
 * JDK Version: 1.6.0_14
 *
 * Generated on 2014-3-11 13:28:11
 * Time to generate: 00:34.969 seconds
 *
 *
 * agitar.src.md5=com.huawei.ism.openapi.manager.DeviceManager:36401e5da1853903815023aa87a18529
 *
 */

package com.huawei.ism.openapi.manager;

import com.agitar.lib.junit.AgitarTestCase;
import com.agitar.lib.mockingbird.Mockingbird;
import com.huawei.ism.openapi.common.commu.rest.RestRequestHandler;
import com.huawei.ism.openapi.common.exception.ApiException;
import com.huawei.ism.openapi.ethport.ETHPortHandlerImp;
import com.huawei.ism.openapi.fcinitiator.system.systime.SystemTimeHandlerImpl;
import com.huawei.ism.openapi.login.LoginMo;
import java.net.URI;
import java.util.Map;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.conn.ClientConnectionManager;

public class DeviceManagerAgitarTest extends AgitarTestCase {

    public Class getTargetClass()  {
        return DeviceManager.class;
    }

    public void testConstructor() throws Throwable {
        DeviceManager deviceManager = new DeviceManager("testDeviceManagerUserName", "testDeviceManagerPwd", "testDeviceManagerIp", 100);
        assertEquals("deviceManager.getScope()", "0", deviceManager.getScope());
        assertNull("deviceManager.loginManager", getPrivateField(deviceManager, "loginManager"));
        assertNull("deviceManager.iBaseTokenString", getPrivateField(deviceManager, "iBaseTokenString"));
        assertEquals("deviceManager.getIP()", "testDeviceManagerIp", deviceManager.getIP());
        assertNull("deviceManager.handlerFactory", getPrivateField(deviceManager, "handlerFactory"));
        assertEquals("deviceManager.handlersMap.size()", 0, ((Map) getPrivateField(deviceManager, "handlersMap")).size());
        assertEquals("deviceManager.getPort()", 100, deviceManager.getPort());
        assertNull("deviceManager.getDeviceId()", deviceManager.getDeviceId());
        assertNotNull("deviceManager.restRequestHandler", getPrivateField(deviceManager, "restRequestHandler"));
        assertEquals("deviceManager.pwd", "testDeviceManagerPwd", getPrivateField(deviceManager, "pwd"));
        assertEquals("deviceManager.userName", "testDeviceManagerUserName", getPrivateField(deviceManager, "userName"));
    }

    public void testConstructor1() throws Throwable {
        DeviceManager deviceManager = new DeviceManager("testDeviceManagerUserName", "testDeviceManagerPwd", "testDeviceManagerScope", "testDeviceManagerIp", 100);
        assertEquals("deviceManager.getScope()", "testDeviceManagerScope", deviceManager.getScope());
        assertNull("deviceManager.loginManager", getPrivateField(deviceManager, "loginManager"));
        assertNull("deviceManager.iBaseTokenString", getPrivateField(deviceManager, "iBaseTokenString"));
        assertEquals("deviceManager.getIP()", "testDeviceManagerIp", deviceManager.getIP());
        assertNull("deviceManager.handlerFactory", getPrivateField(deviceManager, "handlerFactory"));
        assertEquals("deviceManager.handlersMap.size()", 0, ((Map) getPrivateField(deviceManager, "handlersMap")).size());
        assertEquals("deviceManager.getPort()", 100, deviceManager.getPort());
        assertNull("deviceManager.getDeviceId()", deviceManager.getDeviceId());
        assertNotNull("deviceManager.restRequestHandler", getPrivateField(deviceManager, "restRequestHandler"));
        assertEquals("deviceManager.pwd", "testDeviceManagerPwd", getPrivateField(deviceManager, "pwd"));
        assertEquals("deviceManager.userName", "testDeviceManagerUserName", getPrivateField(deviceManager, "userName"));
    }

    public void testGetDeviceId() throws Throwable {
        DeviceManager deviceManager = new DeviceManager("testDeviceManagerUserName", "testDeviceManagerPwd", "testDeviceManagerScope", "testDeviceManagerIp", 100);
        String result = deviceManager.getDeviceId();
        assertNull("result", result);
    }

    public void testGetHandler() throws Throwable {
        DeviceManager deviceManager = new DeviceManager("testDeviceManagerUserName", "testDeviceManagerPwd", "testDeviceManagerIp", 100);
        ETHPortHandlerImp result = (ETHPortHandlerImp) deviceManager.getHandler("ethport");
        assertNotNull("deviceManager.handlerFactory", getPrivateField(deviceManager, "handlerFactory"));
        assertEquals("deviceManager.handlersMap.size()", 1, ((Map) getPrivateField(deviceManager, "handlersMap")).size());
        assertNotNull("result", result);
    }

    public void testGetHandler1() throws Throwable {
        DeviceManager deviceManager = new DeviceManager("testDeviceManagerUserName", "testDeviceManagerPwd", "testDeviceManagerIp", 100);
        Object result = deviceManager.getHandler("testDeviceManagerHandlerName");
        assertNotNull("deviceManager.handlerFactory", getPrivateField(deviceManager, "handlerFactory"));
        assertNull("result", result);
        assertEquals("deviceManager.handlersMap.size()", 0, ((Map) getPrivateField(deviceManager, "handlersMap")).size());
    }

    public void testGetHandler2() throws Throwable {
        DeviceManager deviceManager = new DeviceManager("testDeviceManagerUserName", "testDeviceManagerPwd", "testDeviceManagerIp", 100);
        SystemTimeHandlerImpl handler = (SystemTimeHandlerImpl) deviceManager.getHandler("SystemTimezone");
        SystemTimeHandlerImpl result = (SystemTimeHandlerImpl) deviceManager.getHandler("SystemTimezone");
        assertSame("result", handler, result);
        assertEquals("deviceManager.handlersMap.size()", 1, ((Map) getPrivateField(deviceManager, "handlersMap")).size());
    }

    public void testGetHandler3() throws Throwable {
        DeviceManager deviceManager = new DeviceManager("testDeviceManagerUserName", "testDeviceManagerPwd", "testDeviceManagerIp", 100);
        deviceManager.getHandler("testDeviceManagerHandlerName");
        Object result = deviceManager.getHandler("testDeviceManagerHandlerName");
        assertNull("result", result);
        assertEquals("deviceManager.handlersMap.size()", 0, ((Map) getPrivateField(deviceManager, "handlersMap")).size());
    }

    public void testGetIP() throws Throwable {
        DeviceManager deviceManager = new DeviceManager("testDeviceManagerUserName", "testDeviceManagerPwd", "testDeviceManagerIp", 100);
        String result = deviceManager.getIP();
        assertEquals("result", "testDeviceManagerIp", result);
    }

    public void testGetPort() throws Throwable {
        DeviceManager deviceManager = new DeviceManager("testDeviceManagerUserName", "testDeviceManagerPwd", "testDeviceManagerIp", 100);
        int result = deviceManager.getPort();
        assertEquals("result", 100, result);
    }

    public void testGetScope() throws Throwable {
        DeviceManager deviceManager = new DeviceManager("testDeviceManagerUserName", "testDeviceManagerPwd", "testDeviceManagerScope", "testDeviceManagerIp", 100);
        String result = deviceManager.getScope();
        assertEquals("result", "testDeviceManagerScope", result);
    }

    public void testKeepAliveWithAggressiveMocks() throws Throwable {
        DeviceManager deviceManager = (DeviceManager) Mockingbird.getProxyObject(DeviceManager.class, true);
        Mockingbird.enterRecordingMode();
        Mockingbird.replaceObjectForRecording(RestRequestHandler.class, "<init>(java.lang.String,int)", Mockingbird.getProxyObject(RestRequestHandler.class));
        setPrivateField(deviceManager, "loginManager", null);
        setPrivateField(deviceManager, "restRequestHandler", null);
        setPrivateField(deviceManager, "ip", "");
        setPrivateField(deviceManager, "port", new Integer(0));
        setPrivateField(deviceManager, "deviceID", "");
        LoginManager loginManager = (LoginManager) Mockingbird.getProxyObject(LoginManager.class);
        Mockingbird.replaceObjectForRecording(LoginManager.class, "<init>(com.huawei.ism.openapi.common.commu.rest.RestRequestHandler)", loginManager);
        Mockingbird.setReturnValue(false, Mockingbird.getProxyObject(StringBuilder.class), "toString", "()java.lang.String", "", 1);
        loginManager.keepAlive("");
        Mockingbird.setNormalReturnForVoid();
        Mockingbird.enterTestMode(DeviceManager.class);
        deviceManager.keepAlive();
        assertNotNull("deviceManager.loginManager", getPrivateField(deviceManager, "loginManager"));
        assertNotNull("deviceManager.restRequestHandler", getPrivateField(deviceManager, "restRequestHandler"));
    }

    public void testLoginDeviceWithAggressiveMocks() throws Throwable {
        DeviceManager deviceManager = (DeviceManager) Mockingbird.getProxyObject(DeviceManager.class, true);
        Mockingbird.enterRecordingMode();
        Mockingbird.replaceObjectForRecording(RestRequestHandler.class, "<init>(java.lang.String,int)", Mockingbird.getProxyObject(RestRequestHandler.class));
        LoginMo loginMo = (LoginMo) Mockingbird.getProxyObject(LoginMo.class);
        setPrivateField(deviceManager, "loginManager", null);
        setPrivateField(deviceManager, "restRequestHandler", null);
        setPrivateField(deviceManager, "ip", "");
        setPrivateField(deviceManager, "port", new Integer(0));
        setPrivateField(deviceManager, "userName", "");
        setPrivateField(deviceManager, "pwd", "");
        setPrivateField(deviceManager, "scope", "");
        LoginManager loginManager = (LoginManager) Mockingbird.getProxyObject(LoginManager.class);
        Mockingbird.replaceObjectForRecording(LoginManager.class, "<init>(com.huawei.ism.openapi.common.commu.rest.RestRequestHandler)", loginManager);
        Mockingbird.setReturnValue(false, loginManager, "loginDevice", "(java.lang.String,java.lang.String,java.lang.String,java.lang.String)com.huawei.ism.openapi.login.LoginMo", loginMo, 1);
        Mockingbird.setReturnValue(loginMo.getDeviceId(), "");
        Mockingbird.setReturnValue(loginMo.getBaseToken(), "");
        Mockingbird.enterTestMode(DeviceManager.class);
        deviceManager.loginDevice();
        assertNotNull("deviceManager.loginManager", getPrivateField(deviceManager, "loginManager"));
        assertEquals("deviceManager.iBaseTokenString", "", getPrivateField(deviceManager, "iBaseTokenString"));
        assertEquals("deviceManager.getDeviceId()", "", deviceManager.getDeviceId());
        assertNotNull("deviceManager.restRequestHandler", getPrivateField(deviceManager, "restRequestHandler"));
    }

    public void testLoginDeviceWithAggressiveMocks1() throws Throwable {
        DeviceManager deviceManager = (DeviceManager) Mockingbird.getProxyObject(DeviceManager.class, true);
        Mockingbird.enterRecordingMode();
        Mockingbird.replaceObjectForRecording(RestRequestHandler.class, "<init>(java.lang.String,int)", Mockingbird.getProxyObject(RestRequestHandler.class));
        setPrivateField(deviceManager, "loginManager", null);
        setPrivateField(deviceManager, "restRequestHandler", null);
        setPrivateField(deviceManager, "ip", "");
        setPrivateField(deviceManager, "port", new Integer(0));
        setPrivateField(deviceManager, "userName", "");
        setPrivateField(deviceManager, "pwd", "");
        setPrivateField(deviceManager, "scope", "");
        LoginManager loginManager = (LoginManager) Mockingbird.getProxyObject(LoginManager.class);
        Mockingbird.replaceObjectForRecording(LoginManager.class, "<init>(com.huawei.ism.openapi.common.commu.rest.RestRequestHandler)", loginManager);
        Mockingbird.setReturnValue(false, loginManager, "loginDevice", "(java.lang.String,java.lang.String,java.lang.String,java.lang.String)com.huawei.ism.openapi.login.LoginMo", null, 1);
        Mockingbird.enterTestMode(DeviceManager.class);
        deviceManager.loginDevice();
        assertNotNull("deviceManager.loginManager", getPrivateField(deviceManager, "loginManager"));
        assertNull("deviceManager.iBaseTokenString", getPrivateField(deviceManager, "iBaseTokenString"));
        assertNull("deviceManager.getDeviceId()", deviceManager.getDeviceId());
        assertNotNull("deviceManager.restRequestHandler", getPrivateField(deviceManager, "restRequestHandler"));
    }

    public void testLogoutDeviceWithAggressiveMocks() throws Throwable {
        DeviceManager deviceManager = (DeviceManager) Mockingbird.getProxyObject(DeviceManager.class, true);
        Mockingbird.enterRecordingMode();
        Mockingbird.replaceObjectForRecording(RestRequestHandler.class, "<init>(java.lang.String,int)", Mockingbird.getProxyObject(RestRequestHandler.class));
        setPrivateField(deviceManager, "loginManager", null);
        setPrivateField(deviceManager, "restRequestHandler", null);
        setPrivateField(deviceManager, "ip", "");
        setPrivateField(deviceManager, "port", new Integer(0));
        LoginManager loginManager = (LoginManager) Mockingbird.getProxyObject(LoginManager.class);
        Mockingbird.replaceObjectForRecording(LoginManager.class, "<init>(com.huawei.ism.openapi.common.commu.rest.RestRequestHandler)", loginManager);
        loginManager.logoutDevice("xxxxx/sessions");
        Mockingbird.setNormalReturnForVoid();
        Mockingbird.enterTestMode(DeviceManager.class);
        deviceManager.logoutDevice();
        assertNull("deviceManager.loginManager", getPrivateField(deviceManager, "loginManager"));
        assertNull("deviceManager.handlerFactory", getPrivateField(deviceManager, "handlerFactory"));
        assertNull("deviceManager.getDeviceId()", deviceManager.getDeviceId());
        assertNull("deviceManager.restRequestHandler", getPrivateField(deviceManager, "restRequestHandler"));
    }

    public void testSetConnectionTimeout() throws Throwable {
        DeviceManager deviceManager = new DeviceManager("testDeviceManagerUserName", "testDeviceManagerPwd", "testDeviceManagerIp", 100);
        deviceManager.setConnectionTimeout(100);
        assertNotNull("deviceManager.restRequestHandler", getPrivateField(deviceManager, "restRequestHandler"));
    }

    public void testSetConnectionTimeoutWithAggressiveMocks() throws Throwable {
        DeviceManager deviceManager = (DeviceManager) Mockingbird.getProxyObject(DeviceManager.class, true);
        setPrivateField(deviceManager, "restRequestHandler", null);
        Mockingbird.enterTestMode(DeviceManager.class);
        deviceManager.setConnectionTimeout(0);
        assertNull("deviceManager.restRequestHandler", getPrivateField(deviceManager, "restRequestHandler"));
    }

    public void testSetLogListener() throws Throwable {
        DeviceManager.setLogListener(null);
        assertTrue("Test call resulted in expected outcome", true);
    }

    public void testSetSocTimeout() throws Throwable {
        DeviceManager deviceManager = new DeviceManager("testDeviceManagerUserName", "testDeviceManagerPwd", "testDeviceManagerIp", 100);
        deviceManager.setSocTimeout(100);
        assertNotNull("deviceManager.restRequestHandler", getPrivateField(deviceManager, "restRequestHandler"));
    }

    public void testSetSocTimeoutWithAggressiveMocks() throws Throwable {
        DeviceManager deviceManager = (DeviceManager) Mockingbird.getProxyObject(DeviceManager.class, true);
        setPrivateField(deviceManager, "restRequestHandler", null);
        Mockingbird.enterTestMode(DeviceManager.class);
        deviceManager.setSocTimeout(0);
        assertNull("deviceManager.restRequestHandler", getPrivateField(deviceManager, "restRequestHandler"));
    }

    public void testKeepAliveThrowsApiException() throws Throwable {
        DeviceManager deviceManager = new DeviceManager("testDeviceManagerUserName", "testDeviceManagerPwd", "/", 100);
        try {
            deviceManager.keepAlive();
            fail("Expected ApiException to be thrown");
        } catch (ApiException ex) {
            Object privateField = getPrivateField(getPrivateField(deviceManager, "restRequestHandler"), "httpClientManager");
            ClientConnectionManager connectionManager = ((HttpClient) getPrivateField(privateField, "httpClient")).getConnectionManager();
            assertNotNull("deviceManager.restRequestHandler.httpClientManager.httpClient.getConnectionManager().getSchemeRegistry()", connectionManager.getSchemeRegistry());
            assertNotNull("deviceManager.loginManager", getPrivateField(deviceManager, "loginManager"));
            assertEquals("ex.getMessage()", "URI does not specify a valid host name: https:///:100/deviceManager/rest/null/server/loginInfo", ex.getMessage());
            assertThrownBy(RestRequestHandler.class, ex);
            assertEquals("ex.getErrMessage().getErrorDescription()", "URI does not specify a valid host name: https:///:100/deviceManager/rest/null/server/loginInfo", ex.getErrMessage().getErrorDescription());
            assertEquals("ex.getException().getClass()", ClientProtocolException.class, ex.getException().getClass());
            assertNotNull("deviceManager.restRequestHandler", getPrivateField(deviceManager, "restRequestHandler"));
        }
    }

    public void testKeepAliveThrowsApiException1() throws Throwable {
        DeviceManager deviceManager = new DeviceManager("testDeviceManagerUserName", "testDeviceManagerPwd", "/", 100);
        try {
            deviceManager.keepAlive();
            fail("Expected ApiException to be thrown");
        } catch (ApiException ex) {
            Object privateField = getPrivateField(getPrivateField(deviceManager, "restRequestHandler"), "httpClientManager");
            ClientConnectionManager connectionManager = ((HttpClient) getPrivateField(privateField, "httpClient")).getConnectionManager();
            assertNotNull("deviceManager.restRequestHandler.httpClientManager.httpClient.getConnectionManager().getSchemeRegistry()", connectionManager.getSchemeRegistry());
            assertNotNull("deviceManager.loginManager", getPrivateField(deviceManager, "loginManager"));
            assertEquals("ex.getMessage()", "URI does not specify a valid host name: https:///:100/deviceManager/rest/null/server/loginInfo", ex.getMessage());
            assertThrownBy(RestRequestHandler.class, ex);
            assertEquals("ex.getErrMessage().getErrorDescription()", "URI does not specify a valid host name: https:///:100/deviceManager/rest/null/server/loginInfo", ex.getErrMessage().getErrorDescription());
            assertEquals("ex.getException().getClass()", ClientProtocolException.class, ex.getException().getClass());
            assertNotNull("deviceManager.restRequestHandler", getPrivateField(deviceManager, "restRequestHandler"));
        }
    }

    public void testKeepAliveThrowsIllegalArgumentException() throws Throwable {
        DeviceManager deviceManager = new DeviceManager("testDeviceManagerUserName", "testDeviceManagerPwd", "testDeviceManager\rIp", 100);
        try {
            deviceManager.keepAlive();
            fail("Expected IllegalArgumentException to be thrown");
        } catch (IllegalArgumentException ex) {
            assertNotNull("deviceManager.loginManager", getPrivateField(deviceManager, "loginManager"));
            assertNull("ex.getMessage()", ex.getMessage());
            assertThrownBy(URI.class, ex);
            assertNotNull("deviceManager.restRequestHandler", getPrivateField(deviceManager, "restRequestHandler"));
        }
    }

    public void testLoginDeviceThrowsApiException() throws Throwable {
        DeviceManager deviceManager = new DeviceManager("testDeviceManagerUserName", "testDeviceManagerPwd", "testDeviceManagerScope", "/d", 100);
        try {
            deviceManager.loginDevice();
            fail("Expected ApiException to be thrown");
        } catch (ApiException ex) {
            Object privateField = getPrivateField(getPrivateField(deviceManager, "restRequestHandler"), "httpClientManager");
            ClientConnectionManager connectionManager = ((HttpClient) getPrivateField(privateField, "httpClient")).getConnectionManager();
            assertNotNull("deviceManager.restRequestHandler.httpClientManager.httpClient.getConnectionManager().getSchemeRegistry()", connectionManager.getSchemeRegistry());
            assertNotNull("deviceManager.loginManager", getPrivateField(deviceManager, "loginManager"));
            assertEquals("ex.getMessage()", "URI does not specify a valid host name: https:///d:100/deviceManager/rest/xxxxx/sessions", ex.getMessage());
            assertThrownBy(RestRequestHandler.class, ex);
            assertEquals("ex.getErrMessage().getErrorDescription()", "URI does not specify a valid host name: https:///d:100/deviceManager/rest/xxxxx/sessions", ex.getErrMessage().getErrorDescription());
            assertEquals("ex.getException().getClass()", ClientProtocolException.class, ex.getException().getClass());
            assertNull("deviceManager.iBaseTokenString", getPrivateField(deviceManager, "iBaseTokenString"));
            assertNull("deviceManager.getDeviceId()", deviceManager.getDeviceId());
            assertNotNull("deviceManager.restRequestHandler", getPrivateField(deviceManager, "restRequestHandler"));
        }
    }

    public void testLoginDeviceThrowsIllegalArgumentException() throws Throwable {
        DeviceManager deviceManager = new DeviceManager("testDeviceManagerUserName", "testDeviceManagerPwd", "testDeviceManager\rIp", 100);
        try {
            deviceManager.loginDevice();
            fail("Expected IllegalArgumentException to be thrown");
        } catch (IllegalArgumentException ex) {
            assertNotNull("deviceManager.loginManager", getPrivateField(deviceManager, "loginManager"));
            assertNull("ex.getMessage()", ex.getMessage());
            assertThrownBy(URI.class, ex);
            assertNull("deviceManager.iBaseTokenString", getPrivateField(deviceManager, "iBaseTokenString"));
            assertNull("deviceManager.getDeviceId()", deviceManager.getDeviceId());
            assertNotNull("deviceManager.restRequestHandler", getPrivateField(deviceManager, "restRequestHandler"));
        }
    }

    public void testLoginDeviceThrowsIllegalArgumentException1() throws Throwable {
        DeviceManager deviceManager = new DeviceManager("testDeviceManagerUserName", "testDeviceManagerPwd", "testDeviceManager\rIp", 100);
        try {
            deviceManager.loginDevice();
            fail("Expected IllegalArgumentException to be thrown");
        } catch (IllegalArgumentException ex) {
            assertNotNull("deviceManager.loginManager", getPrivateField(deviceManager, "loginManager"));
            assertNull("ex.getMessage()", ex.getMessage());
            assertThrownBy(URI.class, ex);
            assertNull("deviceManager.iBaseTokenString", getPrivateField(deviceManager, "iBaseTokenString"));
            assertNull("deviceManager.getDeviceId()", deviceManager.getDeviceId());
            assertNotNull("deviceManager.restRequestHandler", getPrivateField(deviceManager, "restRequestHandler"));
        }
    }

    public void testLogoutDeviceThrowsApiException() throws Throwable {
        DeviceManager deviceManager = new DeviceManager("testDeviceManagerUserName", "testDeviceManagerPwd", "testDeviceManagerScope", "/d", 100);
        try {
            deviceManager.logoutDevice();
            fail("Expected ApiException to be thrown");
        } catch (ApiException ex) {
            Object privateField = getPrivateField(getPrivateField(deviceManager, "restRequestHandler"), "httpClientManager");
            ClientConnectionManager connectionManager = ((HttpClient) getPrivateField(privateField, "httpClient")).getConnectionManager();
            assertNotNull("deviceManager.restRequestHandler.httpClientManager.httpClient.getConnectionManager().getSchemeRegistry()", connectionManager.getSchemeRegistry());
            assertNotNull("deviceManager.loginManager", getPrivateField(deviceManager, "loginManager"));
            assertEquals("ex.getMessage()", "URI does not specify a valid host name: https:///d:100/deviceManager/rest/xxxxx/sessions", ex.getMessage());
            assertThrownBy(RestRequestHandler.class, ex);
            assertEquals("ex.getErrMessage().getErrorDescription()", "URI does not specify a valid host name: https:///d:100/deviceManager/rest/xxxxx/sessions", ex.getErrMessage().getErrorDescription());
            assertEquals("ex.getException().getClass()", ClientProtocolException.class, ex.getException().getClass());
            assertNull("deviceManager.handlerFactory", getPrivateField(deviceManager, "handlerFactory"));
            assertNull("deviceManager.getDeviceId()", deviceManager.getDeviceId());
            assertNotNull("deviceManager.restRequestHandler", getPrivateField(deviceManager, "restRequestHandler"));
        }
    }

    public void testLogoutDeviceThrowsIllegalArgumentException() throws Throwable {
        DeviceManager deviceManager = new DeviceManager("testDeviceManagerUserName", "testDeviceManagerPwd", "testDeviceManager\rIp", 100);
        try {
            deviceManager.logoutDevice();
            fail("Expected IllegalArgumentException to be thrown");
        } catch (IllegalArgumentException ex) {
            assertNotNull("deviceManager.loginManager", getPrivateField(deviceManager, "loginManager"));
            assertNull("ex.getMessage()", ex.getMessage());
            assertThrownBy(URI.class, ex);
            assertNull("deviceManager.handlerFactory", getPrivateField(deviceManager, "handlerFactory"));
            assertNull("deviceManager.getDeviceId()", deviceManager.getDeviceId());
            assertNotNull("deviceManager.restRequestHandler", getPrivateField(deviceManager, "restRequestHandler"));
        }
    }

    public void testLogoutDeviceThrowsIllegalArgumentException1() throws Throwable {
        DeviceManager deviceManager = new DeviceManager("testDeviceManagerUserName", "testDeviceManagerPwd", "testDeviceManager\rIp", 100);
        try {
            deviceManager.logoutDevice();
            fail("Expected IllegalArgumentException to be thrown");
        } catch (IllegalArgumentException ex) {
            assertNotNull("deviceManager.loginManager", getPrivateField(deviceManager, "loginManager"));
            assertNull("ex.getMessage()", ex.getMessage());
            assertThrownBy(URI.class, ex);
            assertNull("deviceManager.handlerFactory", getPrivateField(deviceManager, "handlerFactory"));
            assertNull("deviceManager.getDeviceId()", deviceManager.getDeviceId());
            assertNotNull("deviceManager.restRequestHandler", getPrivateField(deviceManager, "restRequestHandler"));
        }
    }
}


text:
using System;
using System.Collections.Generic;
using System.Text;

namespace PmSys
{
    /// <summary>
    /// PmSys»º´æÀà
    /// </summary>
    public class FrameWorkCache
    {
        private static IFrameWorkCache _FrameWorkCache = null;

        static FrameWorkCache()
        {
            _FrameWorkCache = (IFrameWorkCache)Activator.CreateInstance(Common.GetCachenamespace, Common.GetCacheclassName).Unwrap();
        }

        /// <summary>
        /// ÔÚÏßÓû§½Ó¿Ú
        /// </summary>
        /// <returns>IFrameWorkOnlineʵÏÖÀà</returns>
        public static IFrameWorkCache Instance()
        {
            return _FrameWorkCache;
        }
    }
}


text:
<?php

namespace UserBundle\Tests\Controller;

use Tests\UserBundle\Controller\Base\LoggedUserWebTestCase as Base;

class UserControllerTest extends Base
{
    /**
     * Test if user can log as admin and access user path
     */
    public function testLoginUser(){
        $this->logInUser();

        $crawler = $this->client->request('GET', '/user/');
        $this->assertTrue($this->client->getResponse()->isSuccessful());
        $this->assertEquals(200, $this->client->getResponse()->getStatusCode());

        $crawler = $this->client->request('GET', '/admin/');
        $this->assertEquals(403,  $this->client->getResponse()->getStatusCode());
    }

    /**
     * Test User Homepage
     */
    public function testHomePage()
    {
        $this->logInUser();

        $crawler = $this->client->request('GET', '/user/');

        $this->assertEquals(200, $this->client->getResponse()->getStatusCode());
    }
}


text:
// Copyright 2016 The Draco Authors.
//
// 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.
//
#ifndef DRACO_COMPRESSION_MESH_TRAVERSER_MESH_ATTRIBUTE_INDICES_ENCODING_OBSERVER_H_
#define DRACO_COMPRESSION_MESH_TRAVERSER_MESH_ATTRIBUTE_INDICES_ENCODING_OBSERVER_H_

#include "draco/compression/attributes/mesh_attribute_indices_encoding_data.h"
#include "draco/compression/attributes/points_sequencer.h"
#include "draco/mesh/mesh.h"

namespace draco {

// Class that can be used to generate encoding (and decoding) order of attribute
// values based on the traversal of the encoded mesh. The class should be used
// as the TraversalObserverT member of a Traverser class such as the
// DepthFirstTraverser (depth_first_traverser.h).
// TODO(b/199760123): Rename to AttributeIndicesCodingTraverserObserver.
template <class CornerTableT>
class MeshAttributeIndicesEncodingObserver {
 public:
  MeshAttributeIndicesEncodingObserver()
      : att_connectivity_(nullptr),
        encoding_data_(nullptr),
        mesh_(nullptr),
        sequencer_(nullptr) {}
  MeshAttributeIndicesEncodingObserver(
      const CornerTableT *connectivity, const Mesh *mesh,
      PointsSequencer *sequencer,
      MeshAttributeIndicesEncodingData *encoding_data)
      : att_connectivity_(connectivity),
        encoding_data_(encoding_data),
        mesh_(mesh),
        sequencer_(sequencer) {}

  // Interface for TraversalObserverT

  void OnNewFaceVisited(FaceIndex /* face */) {}

  inline void OnNewVertexVisited(VertexIndex vertex, CornerIndex corner) {
    const PointIndex point_id =
        mesh_->face(FaceIndex(corner.value() / 3))[corner.value() % 3];
    // Append the visited attribute to the encoding order.
    sequencer_->AddPointId(point_id);

    // Keep track of visited corners.
    encoding_data_->encoded_attribute_value_index_to_corner_map.push_back(
        corner);

    encoding_data_
        ->vertex_to_encoded_attribute_value_index_map[vertex.value()] =
        encoding_data_->num_values;

    encoding_data_->num_values++;
  }

 private:
  const CornerTableT *att_connectivity_;
  MeshAttributeIndicesEncodingData *encoding_data_;
  const Mesh *mesh_;
  PointsSequencer *sequencer_;
};

}  // namespace draco

#endif  // DRACO_COMPRESSION_MESH_TRAVERSER_MESH_ATTRIBUTE_INDICES_ENCODING_OBSERVER_H_


text:
NS_ASSUME_NONNULL_BEGIN

@class SentryDsn, SentryEvent;

@interface SentryNSURLRequest : NSMutableURLRequest

- (_Nullable instancetype)initStoreRequestWithDsn:(SentryDsn *)dsn
                                         andEvent:(SentryEvent *)event
                                 didFailWithError:(NSError *_Nullable *_Nullable)error;

- (_Nullable instancetype)initStoreRequestWithDsn:(SentryDsn *)dsn
                                          andData:(NSData *)data
                                 didFailWithError:(NSError *_Nullable *_Nullable)error;

- (_Nullable instancetype)initEnvelopeRequestWithDsn:(SentryDsn *)dsn
                                             andData:(NSData *)data
                                    didFailWithError:(NSError *_Nullable *_Nullable)error;

@end

NS_ASSUME_NONNULL_END


text:
package com.blazebit.persistence.view;

import java.lang.annotation.ElementType;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Adds a named filter to an entity view.
 *
 * @author Christian Beikov
 * @since 1.0.0
 */
@Target({ ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
@Repeatable(ViewFilters.class)
public @interface ViewFilter {

    /**
     * Returns the name of the filter.
     *
     * @return The name of the filter
     */
    String name();

    /**
     * The filter class that should be used for filtering.
     *
     * @return The filter class
     */
    Class<? extends ViewFilterProvider> value();
}