text:
<?php
function kadence_custom_css() {

global $virtue;
//Logo
if(isset($virtue['logo_padding_top'])) {
$logo_padding_top = '#logo {padding-top:'.$virtue['logo_padding_top'].'px;}';
} else {
  $logo_padding_top = '#logo {padding-top:25px;}';
}
if(isset($virtue['logo_padding_bottom'])) {
 $logo_padding_bottom = '#logo {padding-bottom:'.$virtue['logo_padding_bottom'].'px;}';
 } else {
  $logo_padding_bottom = '#logo {padding-bottom:10px;}';
 }
 if(isset($virtue['logo_padding_left'])) {
 $logo_padding_left = '#logo {margin-left:'.$virtue['logo_padding_left'].'px;}';
 } else {
$logo_padding_left = '#logo {margin-left:0px;}';
 }
 if(isset($virtue['logo_padding_right'])) {
  $logo_padding_right = '#logo {margin-right:'.$virtue['logo_padding_right'].'px;}';
} else {
  $logo_padding_right = '#logo {margin-right:0px;}';
}
if(isset($virtue['menu_margin_top'])) {
 $menu_margin_top = '#nav-main {margin-top:'.$virtue['menu_margin_top'].'px;}';
 } else {
  $menu_margin_top = '#nav-main {margin-top:40px;}';
 }
 if(isset($virtue['menu_margin_bottom'])) {
 $menu_margin_bottom = '#nav-main {margin-bottom:'.$virtue['menu_margin_bottom'].'px;}';
} else {
  $menu_margin_bottom = '#nav-main {margin-bottom:10px;}';
}
//Typography
  if(!empty($virtue['font_h1'])) {
  $font_family = '.headerfont, .tp-caption {font-family:'.$virtue['font_h1']['font-family'].';}
  .topbarmenu ul li {font-family:'.$virtue['font_primary_menu']['font-family'].';}
  #kadbreadcrumbs {font-family:'.$virtue['font_p']['font-family'].';}';
} else {
  $font_family = '';
}

//Basic Styling

if(!empty($virtue['primary_color'])) {
  $primaryrgb = kadence_hex2rgb($virtue['primary_color']);
  $color_primary = '.home-message:hover {background-color:'.$virtue['primary_color'].'; background-color: rgba('.$primaryrgb[0].', '.$primaryrgb[1].', '.$primaryrgb[2].', 0.6);}
  nav.woocommerce-pagination ul li a:hover, .wp-pagenavi a:hover, .panel-heading .accordion-toggle, .variations .kad_radio_variations label:hover, .variations .kad_radio_variations label.selectedValue {border-color: '.$virtue['primary_color'].';}
  a, #nav-main ul.sf-menu ul li a:hover, .product_price ins .amount, .price ins .amount, .color_primary, .primary-color, #logo a.brand, #nav-main ul.sf-menu a:hover,
  .woocommerce-message:before, .woocommerce-info:before, #nav-second ul.sf-menu a:hover, .footerclass a:hover, .posttags a:hover, .subhead a:hover, .nav-trigger-case:hover .kad-menu-name,
  .nav-trigger-case:hover .kad-navbtn, #kadbreadcrumbs a:hover, #wp-calendar a {color: '.$virtue['primary_color'].';}
.widget_price_filter .ui-slider .ui-slider-handle, .product_item .kad_add_to_cart:hover, .product_item:hover .kad_add_to_cart:hover, .kad-btn-primary, html .woocommerce-page .widget_layered_nav ul.yith-wcan-label li a:hover, html .woocommerce-page .widget_layered_nav ul.yith-wcan-label li.chosen a,
.product-category.grid_item a:hover h5, .woocommerce-message .button, .widget_layered_nav_filters ul li a, .widget_layered_nav ul li.chosen a, .wpcf7 input.wpcf7-submit, .yith-wcan .yith-wcan-reset-navigation,
#containerfooter .menu li a:hover, .bg_primary, .portfolionav a:hover, .home-iconmenu a:hover, p.demo_store, .topclass, #commentform .form-submit #submit, .kad-hover-bg-primary:hover, .widget_shopping_cart_content .checkout,
.login .form-row .button, .variations .kad_radio_variations label.selectedValue, #payment #place_order, .checkout-button, input[type="submit"].button, .order-actions .button  {background: '.$virtue['primary_color'].';}';
} else {
  $color_primary = '';
}
if(!empty($virtue['primary20_color'])) {
  $color_primary30 =  'a:hover {color: '.$virtue['primary20_color'].';} .kad-btn-primary:hover, .login .form-row .button:hover, #payment #place_order:hover, .yith-wcan .yith-wcan-reset-navigation:hover, .widget_shopping_cart_content .checkout:hover,
.woocommerce-message .button:hover, #commentform .form-submit #submit:hover, .wpcf7 input.wpcf7-submit:hover, .widget_layered_nav_filters ul li a:hover,
.widget_layered_nav ul li.chosen a:hover, .checkout-button:hover, .order-actions .button:hover, input[type="submit"].button:hover, .product_item:hover .kad_add_to_cart  {background: '.$virtue['primary20_color'].';}';
} else {
  $color_primary30 = '';
}
if(!empty($virtue['gray_font_color'])) {
  $color_grayfont = '.color_gray, .subhead, .subhead a, .posttags, .posttags a, .product_meta a {color:'.$virtue['gray_font_color'].';}';
} else {
  $color_grayfont = '';
}
if(!empty($virtue['footerfont_color'])) {
  $color_footerfont = '#containerfooter h3, #containerfooter, .footercredits p, .footerclass a, .footernav ul li a {color:'.$virtue['footerfont_color'].';}';
} else {
  $color_footerfont = '';
}

//Advanced Styling

if(!empty($virtue['content_bg_color'])) {
$content_bg_color = $virtue['content_bg_color'];
} else {
  $content_bg_color = '';
}
if(!empty($virtue['bg_content_bg_img']['url'])) {
  $content_bg_img = 'url('.$virtue['bg_content_bg_img']['url'].')';
} else {
  $content_bg_img = '';
}
if(!empty($virtue['content_bg_repeat'])) {
$content_bg_repeat = $virtue['content_bg_repeat'];
} else {
  $content_bg_repeat = '';
}
if(!empty($virtue['content_bg_placementx'])) {
  $content_bg_x = $virtue['content_bg_placementx'];
} else {
  $content_bg_x = '';
}
if (!empty($virtue['content_bg_placementy'])) {
$content_bg_y = $virtue['content_bg_placementy'];
} else {
  $content_bg_y = '';
}
if(!empty($virtue['content_bg_color']) || !empty($virtue['bg_content_bg_img']['url'])) {
    $contentclass = '.contentclass, .nav-tabs>.active>a, .nav-tabs>.active>a:hover, .nav-tabs>.active>a:focus {background:'.$content_bg_color.' '.$content_bg_img.' '.$content_bg_repeat.' '.$content_bg_x.' '.$content_bg_y.';}';
  } else {
    $contentclass = '';
  }
if(!empty($virtue['header_bg_color'])) {
  $header_bg_color = $virtue['header_bg_color'];
  } else {
    $header_bg_color = '';
  }
  if(!empty($virtue['bg_header_bg_img']['url'])) {
    $header_bg_img = 'url('.$virtue['bg_header_bg_img']['url'].')';
  } else {
    $header_bg_img = '';
  }
  if(!empty($virtue['header_bg_repeat'])) {
  $header_bg_repeat = $virtue['header_bg_repeat'];
  } else {
    $header_bg_repeat = '';
  }
  if(!empty($virtue['header_bg_placementx'])) {
  $header_bg_x = $virtue['header_bg_placementx'];
  } else {
    $header_bg_x = '';
  }
  if(!empty($virtue['header_bg_placementy'])) {
  $header_bg_y = $virtue['header_bg_placementy'];
  } else {
    $header_bg_y = '';
  }
  if(!empty($virtue['header_bg_color']) || !empty($virtue['bg_header_bg_img']['url'])) {
    $headerclass = '.headerclass {background:'.$header_bg_color.' '.$header_bg_img.' '.$header_bg_repeat.' '.$header_bg_x.' '.$header_bg_y.';}';
  } else {
    $headerclass = '';
  }
if(!empty($virtue['topbar_bg_color'])) {
$topbar_bg_color = $virtue['topbar_bg_color'];
} else {
  $topbar_bg_color = '';
}
if(!empty($virtue['bg_topbar_bg_img']['url'])) {
  $topbar_bg_img = 'url('.$virtue['bg_topbar_bg_img']['url'].')';
} else {
  $topbar_bg_img = '';
}
if(!empty($virtue['topbar_bg_repeat'])) {
$topbar_bg_repeat = $virtue['topbar_bg_repeat'];
} else {
  $topbar_bg_repeat = '';
}
if(!empty($virtue['topbar_bg_placementx'])) {
$topbar_bg_x = $virtue['topbar_bg_placementx'];
} else {
  $topbar_bg_x = '';
}
if(!empty($virtue['topbar_bg_placementy'])) {
$topbar_bg_y = $virtue['topbar_bg_placementy'];
} else {
  $topbar_bg_y = '';
}
if(!empty($virtue['topbar_bg_color']) || !empty($virtue['bg_topbar_bg_img']['url'])) {
    $topbarclass = '.topclass {background:'.$topbar_bg_color.' '.$topbar_bg_img.' '.$topbar_bg_repeat.' '.$topbar_bg_x.' '.$topbar_bg_y.';}';
  } else {
    $topbarclass = '';
  }
if(!empty($virtue['menu_bg_color'])) {
$menu_bg_color = $virtue['menu_bg_color'];
} else {
  $menu_bg_color = '';
}
if(!empty($virtue['menu_bg_img']['url'])) {
 $menu_bg_img = 'url('.$virtue['menu_bg_img']['url'].')';
} else {
  $menu_bg_img = '';
}
if(!empty($virtue['menu_bg_repeat'])) {
$menu_bg_repeat = $virtue['menu_bg_repeat'];
} else {
  $menu_bg_repeat = '';
}
if(!empty($virtue['menu_bg_placementx'])) {
$menu_bg_x = $virtue['menu_bg_placementx'];
} else {
  $menu_bg_x = '';
}
if(!empty($virtue['menu_bg_placementy'])) {
$menu_bg_y = $virtue['menu_bg_placementy'];
} else {
  $menu_bg_y = '';
}
if(!empty($virtue['menu_bg_color']) || !empty($virtue['bg_menu_bg_img']['url'])) {
    $menuclass = '.navclass {background:'.$menu_bg_color.' '.$menu_bg_img.' '.$menu_bg_repeat.' '.$menu_bg_x.' '.$menu_bg_y.';}';
  } else {
    $menuclass = '';
  }

if(!empty($virtue['mobile_bg_color'])) {
$mobile_bg_color = $virtue['mobile_bg_color'];
} else {
  $mobile_bg_color = '';
}
if(!empty($virtue['bg_mobile_bg_img']['url'])) {
  $mobile_bg_img = 'url('.$virtue['bg_mobile_bg_img']['url'].')';
} else {
  $mobile_bg_img = '';
}
if(!empty($virtue['mobile_bg_repeat'])) {
$mobile_bg_repeat = $virtue['mobile_bg_repeat'];
} else {
  $mobile_bg_repeat = '';
}
if(!empty($virtue['mobile_bg_placementx'])) {
$mobile_bg_x = $virtue['mobile_bg_placementx'];
} else {
  $mobile_bg_x = '';
}
if(!empty($virtue['mobile_bg_placementy'])) {
$mobile_bg_y = $virtue['mobile_bg_placementy'];
} else {
  $mobile_bg_y = '';
}
if(!empty($virtue['mobile_bg_color']) || !empty($virtue['bg_mobile_bg_img']['url'])) {
    $mobileclass = '.mobileclass {background:'.$mobile_bg_color.' '.$mobile_bg_img.' '.$mobile_bg_repeat.' '.$mobile_bg_x.' '.$mobile_bg_y.';}';
  } else {
    $mobileclass = '';
  }

if(!empty($virtue['footer_bg_color'])) {
$footer_bg_color = $virtue['footer_bg_color'];
} else {
  $footer_bg_color = '';
}
if(!empty($virtue['bg_footer_bg_img']['url'])) {
 $footer_bg_img = 'url('.$virtue['bg_footer_bg_img']['url'].')';
} else {
  $footer_bg_img = '';
}
if(!empty($virtue['footer_bg_repeat'])) {
$footer_bg_repeat = $virtue['footer_bg_repeat'];
} else {
  $footer_bg_repeat = '';
}
if(!empty($virtue['footer_bg_placementx'])) {
$footer_bg_x = $virtue['footer_bg_placementx'];
} else {
  $footer_bg_x = '';
}
if(!empty($virtue['footer_bg_placementy'])) {
$footer_bg_y = $virtue['footer_bg_placementy'];
} else {
  $footer_bg_y = '';
}
if(!empty($virtue['footer_bg_color']) || !empty($virtue['bg_footer_bg_img']['url'])) {
    $footerclass = '.footerclass {background:'.$footer_bg_color.' '.$footer_bg_img.' '.$footer_bg_repeat.' '.$footer_bg_x.' '.$footer_bg_y.';}';
  } else {
    $footerclass = '';
  }
if(!empty($virtue['boxed_bg_color'])) {
$boxedbg_color = $virtue['boxed_bg_color'];
} else {
  $boxedbg_color = '';
}
if(!empty($virtue['bg_boxed_bg_img']['url'])) {
  $boxedbg_img = 'url('.$virtue['bg_boxed_bg_img']['url'].')';
} else {
  $boxedbg_img = '';
}
if(!empty($virtue['boxed_bg_repeat'])) {
$boxedbg_repeat = $virtue['boxed_bg_repeat'];
} else {
  $boxedbg_repeat = '';
}
if(!empty($virtue['boxed_bg_placementx'])) {
$boxedbg_x = $virtue['boxed_bg_placementx'];
} else {
  $boxedbg_x = '';
}
if(!empty($virtue['boxed_bg_placementy'])) {
$boxedbg_y = $virtue['boxed_bg_placementy'];
} else {
  $boxedbg_y = '';
}
if(!empty($virtue['boxed_bg_fixed'])) {
$boxedbg_fixed = $virtue['boxed_bg_fixed'];
} else {
  $boxedbg_fixed = '';
}
if(!empty($virtue['boxed_bg_color']) || !empty($virtue['bg_boxed_bg_img']['url'])) {
    $boxedclass = 'body {background:'.$boxedbg_color.' '.$boxedbg_img.' '.$boxedbg_repeat.' '.$boxedbg_x.' '.$boxedbg_y.'; background-attachment:'.$boxedbg_fixed.';}';
  } else {
    $boxedclass = '';
  }

  if(isset($virtue['shop_title_uppercase']) and $virtue['shop_title_uppercase'] == 0) {
  $ptitle_uppercase = '.product_item .product_details h5 {text-transform: none;}';
} else {
  $ptitle_uppercase = '';
}
  if(!empty($virtue['x2_virtue_logo_upload']['url'])) {
  $x2logo = ' @media (max-width: 767px) {#logo .kad-standard-logo {display: none;} #logo .kad-retina-logo {display: block;}}';
} else {
  $x2logo = '';
}
  if(!empty($virtue['shop_title_min_height'])) {
  $ptitle_minheight = '.product_item .product_details h5 {min-height:'.$virtue['shop_title_min_height'].'px;}';
} else {
  $ptitle_minheight = '';
}
if(isset($virtue['logo_layout']) and ($virtue['logo_layout'] == 'logocenter')) {
  $menu_layout_center = '@media (max-width: 979px) {.nav-trigger .nav-trigger-case {position: static; display: block; width: 100%;}}';
  } else {
  $menu_layout_center = '';
  }

  if(isset($virtue['hide_author']) and ($virtue['hide_author'] == 0)) {
  $show_author = '.kad-hidepostauthortop, .postauthortop {display:none;}';
  } else {
  $show_author = '';
  }
    if(isset($virtue['topbar_layout']) and ($virtue['topbar_layout'] == 1)) {
  $topbar_layout = '.kad-topbar-left, .kad-topbar-left .topbarmenu {float:right;} .kad-topbar-left .topbar_social, .kad-topbar-left .topbarmenu ul, .kad-topbar-left .kad-cart-total,.kad-topbar-right #topbar-search .form-search{float:left}';
  } else {
  $topbar_layout = '';
  }
  if(isset($virtue['hide_image_border']) and ($virtue['hide_image_border'] == 1)) {
  $wp_image_border = '[class*="wp-image"] {-webkit-box-shadow: none;-moz-box-shadow: none;box-shadow: none;border:none;}[class*="wp-image"]:hover {-webkit-box-shadow: none;-moz-box-shadow: none;box-shadow: none;border:none;}';
  } else {
  $wp_image_border = '';
  }

if (!empty($virtue['custom_css'])) {
  $custom_css = $virtue['custom_css'];
} else {
  $custom_css = '';
}

$kad_custom_css = '<style type="text/css">'.$logo_padding_top.$logo_padding_bottom.$logo_padding_left.$logo_padding_right.$menu_margin_top.$menu_margin_bottom.$font_family.$color_primary.$color_primary30.$color_grayfont
.$color_footerfont.$contentclass.$topbarclass.$headerclass.$menuclass.$mobileclass.$footerclass.$boxedclass.$show_author.$ptitle_uppercase.$menu_layout_center.$x2logo.$ptitle_minheight.$topbar_layout.$wp_image_border.$custom_css.'</style>';
  echo $kad_custom_css;
}
function kad_custom_css_output() {
 echo get_option('kad_css_custom');
}
add_action('wp_head', 'kadence_custom_css');
?>


text:
double HML_OptimumOfTestFunction_Binary(int *Optimum, int VHML_N);
double HML_OptimumOfTestFunction_Binary(int *Optimum, int VHML_N, TypeOfTestFunction Type);

redpajama_set_name: RedPajamaGithub


text:
package org.jetbrains.jps.model;

import com.intellij.openapi.application.PathManager;
import com.intellij.openapi.application.ex.PathManagerEx;
import com.intellij.openapi.util.io.FileUtil;
import org.jetbrains.jps.util.JpsPathUtil;
import org.jetbrains.jps.model.java.*;
import org.jetbrains.jps.model.library.JpsLibrary;
import org.jetbrains.jps.model.library.JpsOrderRootType;
import org.jetbrains.jps.model.library.JpsTypedLibrary;
import org.jetbrains.jps.model.library.sdk.JpsSdk;
import org.jetbrains.jps.model.module.JpsLibraryDependency;
import org.jetbrains.jps.model.module.JpsModule;

import java.io.File;
import java.io.IOException;
import java.util.Arrays;

/**
 * @author nik
 */
public class JpsDependenciesEnumeratorTest extends JpsJavaModelTestCase {
  private JpsTypedLibrary<JpsSdk<JpsDummyElement>> myJdk;
  private JpsModule myModule;

  @Override
  public void setUp() throws Exception {
    super.setUp();
    File home = PathManagerEx.findFileUnderCommunityHome("java/mockJDK-1.7");
    myJdk = myModel.getGlobal().addSdk("mockJDK-1.7", home.getAbsolutePath(), "1.7", JpsJavaSdkType.INSTANCE);
    myJdk.addRoot(getRtJar(), JpsOrderRootType.COMPILED);
    myModule = addModule();
    myModule.getSdkReferencesTable().setSdkReference(JpsJavaSdkType.INSTANCE, myJdk.getProperties().createReference());
    myModule.getDependenciesList().addSdkDependency(JpsJavaSdkType.INSTANCE);
  }

  public void testLibrary() throws Exception {
    JpsModuleRootModificationUtil.addDependency(myModule, createJDomLibrary());

    assertClassRoots(orderEntries(myModule), getRtJar(), getJDomJar());
    assertClassRoots(orderEntries(myModule).withoutSdk(), getJDomJar());
    assertClassRoots(orderEntries(myModule).withoutSdk().productionOnly().runtimeOnly(), getJDomJar());
    assertClassRoots(orderEntries(myModule).withoutLibraries(), getRtJar());
    assertSourceRoots(orderEntries(myModule), getJDomSources());
  }

  private String getJDomSources() {
    return getJarUrlFromLibDir("src/jdom.zip");
  }

  private String getJDomJar() {
    return getJarUrlFromLibDir("jdom.jar");
  }

  private String getAsmJar() {
    return getJarUrlFromLibDir("asm.jar");
  }

  private String getJarUrlFromLibDir(final String relativePath) {
    return JpsPathUtil.getLibraryRootUrl(PathManager.findFileInLibDirectory(relativePath));
  }

  private String getRtJar() {
    return JpsPathUtil.getLibraryRootUrl(PathManagerEx.findFileUnderCommunityHome("java/mockJDK-1.7/jre/lib/rt.jar"));
  }

  private JpsLibrary createJDomLibrary() {
    JpsLibrary library = addLibrary("jdom");
    library.addRoot(getJDomJar(), JpsOrderRootType.COMPILED);
    library.addRoot(getJDomSources(), JpsOrderRootType.SOURCES);
    return library;
  }

  private JpsLibrary createAsmLibrary() {
    JpsLibrary library = addLibrary("asm");
    library.addRoot(getAsmJar(), JpsOrderRootType.COMPILED);
    return library;
  }

  public void testModuleSources() throws Exception {
    final String srcRoot = addSourceRoot(myModule, false);
    final String testRoot = addSourceRoot(myModule, true);
    final String output = setModuleOutput(myModule, false);
    final String testOutput = setModuleOutput(myModule, true);

    assertClassRoots(orderEntries(myModule).withoutSdk(), testOutput, output);
    assertClassRoots(orderEntries(myModule).withoutSdk().productionOnly(), output);
    assertSourceRoots(orderEntries(myModule), srcRoot, testRoot);
    assertSourceRoots(orderEntries(myModule).productionOnly(), srcRoot);

    assertEnumeratorRoots(orderEntries(myModule).withoutSdk().classes().withoutSelfModuleOutput(), output);
    assertEnumeratorRoots(orderEntries(myModule).withoutSdk().productionOnly().classes().withoutSelfModuleOutput());
  }

  public void testLibraryScope() throws Exception {
    JpsLibraryDependency dependency = myModule.getDependenciesList().addLibraryDependency(createJDomLibrary());
    getJavaService().getOrCreateDependencyExtension(dependency).setScope(JpsJavaDependencyScope.RUNTIME);
    JpsModuleRootModificationUtil.addDependency(myModule, createJDomLibrary(), JpsJavaDependencyScope.RUNTIME, false);

    assertClassRoots(orderEntries(myModule).withoutSdk(), getJDomJar());
    assertClassRoots(orderEntries(myModule).withoutSdk().exportedOnly());
    assertClassRoots(orderEntries(myModule).withoutSdk().compileOnly());
  }

  public void testModuleDependency() throws Exception {
    final JpsModule dep = addModule("dep");
    final String depSrcRoot = addSourceRoot(dep, false);
    final String depTestRoot = addSourceRoot(dep, true);
    final String depOutput = setModuleOutput(dep, false);
    final String depTestOutput = setModuleOutput(dep, true);
    JpsModuleRootModificationUtil.addDependency(dep, createJDomLibrary(), JpsJavaDependencyScope.COMPILE, true);
    JpsModuleRootModificationUtil.addDependency(myModule, dep, JpsJavaDependencyScope.COMPILE, true);

    final String srcRoot = addSourceRoot(myModule, false);
    final String testRoot = addSourceRoot(myModule, true);
    final String output = setModuleOutput(myModule, false);
    final String testOutput = setModuleOutput(myModule, true);

    assertClassRoots(orderEntries(myModule).withoutSdk(), testOutput, output, depTestOutput, depOutput);
    assertClassRoots(orderEntries(myModule).withoutSdk().recursively(), testOutput, output, depTestOutput, depOutput, getJDomJar());
    assertSourceRoots(orderEntries(myModule), srcRoot, testRoot, depSrcRoot, depTestRoot);
    assertSourceRoots(orderEntries(myModule).recursively(), srcRoot, testRoot, depSrcRoot, depTestRoot, getJDomSources());

    assertClassRoots(orderEntries(myModule).withoutSdk().withoutModuleSourceEntries().recursively(), getJDomJar());
    assertSourceRoots(orderEntries(myModule).withoutSdk().withoutModuleSourceEntries().recursively(), getJDomSources());
    assertEnumeratorRoots(orderEntries(myModule).withoutSdk().withoutModuleSourceEntries().recursively().classes(), getJDomJar());
    assertEnumeratorRoots(orderEntries(myModule).withoutSdk().withoutModuleSourceEntries().recursively().sources(), getJDomSources());

    assertEnumeratorRoots(orderEntries(myModule).withoutSdk().recursively().classes().withoutSelfModuleOutput(),
                          output, depTestOutput, depOutput, getJDomJar());
    assertEnumeratorRoots(orderEntries(myModule).productionOnly().withoutSdk().recursively().classes().withoutSelfModuleOutput(),
                          depOutput, getJDomJar());

    assertClassRoots(orderEntries(myModule).withoutSdk().withoutDepModules().withoutModuleSourceEntries().recursively(), getJDomJar());
    assertEnumeratorRoots(
      orderEntries(myModule).productionOnly().withoutSdk().withoutDepModules().withoutModuleSourceEntries().recursively().classes(),
      getJDomJar());
    assertClassRoots(orderEntries(myModule).withoutSdk().withoutDepModules().withoutModuleSourceEntries());
    assertEnumeratorRoots(orderEntries(myModule).productionOnly().withoutModuleSourceEntries().withoutSdk().withoutDepModules().classes());
  }

  public void testModuleJpsJavaDependencyScope() throws Exception {
    final JpsModule dep = addModule("dep");
    JpsModuleRootModificationUtil.addDependency(dep, createJDomLibrary(), JpsJavaDependencyScope.COMPILE, true);
    JpsModuleRootModificationUtil.addDependency(myModule, dep, JpsJavaDependencyScope.TEST, true);

    assertClassRoots(orderEntries(myModule).withoutSdk());
    assertClassRoots(orderEntries(myModule).withoutSdk().recursively(), getJDomJar());
    assertClassRoots(orderEntries(myModule).withoutSdk().exportedOnly().recursively(), getJDomJar());
    assertClassRoots(orderEntries(myModule).withoutSdk().productionOnly().recursively());

    assertClassRoots(orderEntries(myProject).withoutSdk(), getJDomJar());
    assertClassRoots(orderEntries(myProject).withoutSdk().productionOnly(), getJDomJar());
  }

  public void testNotExportedLibrary() throws Exception {
    final JpsModule dep = addModule("dep");
    JpsModuleRootModificationUtil.addDependency(dep, createJDomLibrary(), JpsJavaDependencyScope.COMPILE, false);
    JpsModuleRootModificationUtil.addDependency(myModule, createAsmLibrary(), JpsJavaDependencyScope.COMPILE, false);
    JpsModuleRootModificationUtil.addDependency(myModule, dep, JpsJavaDependencyScope.COMPILE, false);

    assertClassRoots(orderEntries(myModule).withoutSdk(), getAsmJar());
    assertClassRoots(orderEntries(myModule).withoutSdk().recursively(), getAsmJar(), getJDomJar());
    assertClassRoots(orderEntries(myModule).withoutSdk().recursively().exportedOnly(), getAsmJar());
    assertClassRoots(orderEntries(myModule).withoutSdk().exportedOnly().recursively());
  }

  public void testJdkIsNotExported() throws Exception {
    assertClassRoots(orderEntries(myModule).exportedOnly());
  }

  public void testProject() throws Exception {
    JpsModuleRootModificationUtil.addDependency(myModule, createJDomLibrary());

    final String srcRoot = addSourceRoot(myModule, false);
    final String testRoot = addSourceRoot(myModule, true);
    final String output = setModuleOutput(myModule, false);
    final String testOutput = setModuleOutput(myModule, true);

    assertClassRoots(orderEntries(myProject).withoutSdk(), testOutput, output, getJDomJar());
    assertSourceRoots(orderEntries(myProject).withoutSdk(), srcRoot, testRoot, getJDomSources());
  }

  public void testModules() throws Exception {
    JpsModuleRootModificationUtil.addDependency(myModule, createJDomLibrary());

    final String srcRoot = addSourceRoot(myModule, false);
    final String testRoot = addSourceRoot(myModule, true);
    final String output = setModuleOutput(myModule, false);
    final String testOutput = setModuleOutput(myModule, true);

    assertClassRoots(getJavaService().enumerateDependencies(Arrays.asList(myModule)).withoutSdk(),
                     testOutput, output, getJDomJar());
    assertSourceRoots(getJavaService().enumerateDependencies(Arrays.asList(myModule)).withoutSdk(),
                      srcRoot, testRoot, getJDomSources());
  }

  private String setModuleOutput(JpsModule module, boolean tests) {
    try {
      File file = FileUtil.createTempDirectory(module.getName(), tests ? "testSrc" : "src");
      JpsJavaModuleExtension extension = getJavaService().getOrCreateModuleExtension(module);
      String url = JpsPathUtil.getLibraryRootUrl(file);
      if (tests) {
        extension.setTestOutputUrl(url);
      }
      else {
        extension.setOutputUrl(url);
      }
      return url;
    }
    catch (IOException e) {
      throw new RuntimeException(e);
    }
  }

  private String addSourceRoot(JpsModule module, boolean tests) {
    try {
      File file = FileUtil.createTempDirectory(module.getName(), tests ? "testSrc" : "src");
      return module.addSourceRoot(JpsPathUtil.getLibraryRootUrl(file), tests ? JavaSourceRootType.TEST_SOURCE : JavaSourceRootType.SOURCE).getUrl();
    }
    catch (IOException e) {
      throw new RuntimeException(e);
    }
  }

  private JpsJavaDependenciesEnumerator orderEntries(JpsProject project) {
    return JpsJavaExtensionService.dependencies(project);
  }

  private static JpsJavaDependenciesEnumerator orderEntries(JpsModule module) {
    return JpsJavaExtensionService.dependencies(module);
  }

  private static void assertClassRoots(final JpsJavaDependenciesEnumerator enumerator, String... urls) {
    assertEnumeratorRoots(enumerator.classes(), urls);
  }

  private static void assertSourceRoots(final JpsJavaDependenciesEnumerator enumerator, String... urls) {
    assertEnumeratorRoots(enumerator.sources(), urls);
  }

  private static void assertEnumeratorRoots(JpsJavaDependenciesRootsEnumerator rootsEnumerator, String... urls) {
    assertOrderedEquals(rootsEnumerator.getUrls(), urls);
  }
}


text:
#region Alchemi Copyright and License Notice

#endregion

using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;

using Alchemi.Core.Utility;

namespace Alchemi.Core.Owner
{
    /// <summary>
    /// The GConnection class represents a connection to a Alchemi manager.
    /// It is a container for the properties such as host, port, securityCredentials etc... used to connect to the manager.
    /// </summary>
    [Serializable]
    public partial class GConnection : Component
    {
        #region Constructors
        public GConnection()
        {
            InitializeComponent();
        }

        public GConnection(IContainer container)
        {
            container.Add(this);

            InitializeComponent();
        }

        /// <summary>
        /// Creates a new GConnection
        /// </summary>
        /// <param name="host">The host.</param>
        /// <param name="port">The port.</param>
        /// <param name="username">The username.</param>
        /// <param name="password">The password.</param>
        public GConnection(string host, int port, string username, string password)
        {
            RemoteEP.Host = host;
            RemoteEP.Port = port;
            _Username = username;
            _Password = password;
        }
        #endregion

        #region Property - Host
        //private string _Host = "localhost"; //now in EndPoint property. Jure Subara
        /// <summary>
        /// Gets or sets the host name of the Alchemi manager
        /// </summary>
        public string Host
        {
            get { return RemoteEP.Host; }
            set { RemoteEP.Host = value; }
        }
        #endregion

        #region Property - Port
        //private int _Port = 9000; //now in EndPoint property. Jure Subara
        /// <summary>
        /// Gets or sets the port number of the Alchemi manager
        /// </summary>
        public int Port
        {
            get { return RemoteEP.Port; }
            set { RemoteEP.Port = value; }
        }
        #endregion

        #region Property - Username
        private string _Username = "";
        /// <summary>
        /// Gets or sets the username used to connect to the manager
        /// </summary>
        public string Username
        {
            get { return _Username; }
            set { _Username = value; }
        }
        #endregion

        #region Property - Password
        private string _Password = "";
        /// <summary>
        /// Gets or sets the password used to connect to the manager
        /// </summary>
        public string Password
        {
            get { return _Password; }
            set { _Password = value; }
        }
        #endregion

        #region Property - RemoteEP
        private EndPoint _RemoteEP = null;
        /// <summary>
        /// Gets the EndPoint object associated with this GConnection.
        /// </summary>
        public EndPoint RemoteEP
        {
            get
            {
                //return new EndPoint(_Host, _Port, RemotingMechanism.TcpBinary); //needed to remove this if other remoting mechanism needs to be used
                if (_RemoteEP == null)
                    _RemoteEP = new EndPoint();

                return _RemoteEP;
            }

            set
            {
                _RemoteEP = value;
            }
        }
        #endregion

        #region Property - Credentials
        /// <summary>
        /// Gets the SecurityCredentials object associated with this GConnection.
        /// </summary>
        public SecurityCredentials Credentials
        {
            get
            {
                return new SecurityCredentials(_Username, _Password);
            }
        }
        #endregion

        /// <summary>
        /// Gets an instance of the GConnection class, from values input through the console.
        /// </summary>
        /// <param name="defaultHost">The default host.</param>
        /// <param name="defaultPort">The default port.</param>
        /// <param name="defaultUsername">The default username.</param>
        /// <param name="defaultPassword">The default password.</param>
        /// <returns>GConnection</returns>
        public static GConnection FromConsole(string defaultHost, string defaultPort, string defaultUsername, string defaultPassword)
        {
            string host = Utils.ValueFromConsole("Host", defaultHost);
            string port = Utils.ValueFromConsole("Port", defaultPort);
            string username = Utils.ValueFromConsole("Username", defaultUsername);
            string password = Utils.ValueFromConsole("Password", defaultPassword);

            Console.WriteLine();

            return new GConnection(host, int.Parse(port), username, password);
        }
    }
}


text:
package org.apache.commons.math3.optimization;

/**
 * Target of the optimization procedure.
 * They are the values which the objective vector function must reproduce
 * When the parameters of the model have been optimized.
 * <br/>
 * Immutable class.
 *
 * @version $Id: Target.java 1422230 2012-12-15 12:11:13Z erans $
 * @deprecated As of 3.1 (to be removed in 4.0).
 * @since 3.1
 */
@Deprecated
public class Target implements OptimizationData {
    /** Target values (of the objective vector function). */
    private final double[] target;

    /**
     * @param observations Target values.
     */
    public Target(double[] observations) {
        target = observations.clone();
    }

    /**
     * Gets the initial guess.
     *
     * @return the initial guess.
     */
    public double[] getTarget() {
        return target.clone();
    }
}


text:
import { IncomingMessage, ServerResponse, createServer } from 'http';
import { inject } from 'shot';

// Declare internals

async function main() {
    const dispatch = (req: IncomingMessage, res: ServerResponse) => {
        const reply = 'Hello World';
        res.writeHead(200, { 'Content-Type': 'text/plain', 'Content-Length': reply.length });
        res.end(reply);
    };

    const server = createServer(dispatch);

    console.log((await inject(dispatch, { method: 'get', url: '/', headers: { test: 'asd', test2: ['a', 'b'] } })).payload);
}


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

public class AsteroidEmitter : MonoBehaviour {

    /// <summary>
    /// List of rock prefabs to use. Currently only one
    /// </summary>
    [SerializeField]
    private GameObject[] asteroidsPrefabs = new GameObject[4];

    /// <summary>
    /// List of currently active/flying asteroids
    /// </summary>
    private List<Asteroid> activeAsteroids;

    /// <summary>
    /// Routine for periodically firing off asteroids
    /// </summary>
    private IEnumerator emitter;

    /// <summary>
    /// The time bewteen asteroid emission
    /// </summary>
    private float timer;

	/// <summary>
    /// Instantiate the emitter
    /// </summary>
	void Start () {
        activeAsteroids = new List<Asteroid>();
        emitter = EmitterRoutine();
        timer = 1 / GameManager.Instance.level;
        StartCoroutine(emitter);
	}

    /// <summary>
    /// Start up the emission routine when the emitter is activated
    /// </summary>
    void OnEnable()
    {
        if (emitter != null)
        {
            // set the time between emissions to be inversely proportional to the current level
            timer = 1.0f / GameManager.Instance.level;
            StartCoroutine(emitter);
        }
    }

    /// <summary>
    /// When the emitter is disabled stop the emission routine
    /// </summary>
    void OnDisable()
    {
        if (emitter != null)
        {
            StopCoroutine(emitter);
        }
    }

#if UNITY_EDITOR

    // just highlight the emitter in the editor
    void OnDrawGizmos()
    {
        Gizmos.color = Color.white;
        Gizmos.DrawWireCube(transform.position, transform.localScale);
    }
#endif

    /// <summary>
    /// This routine creates a field of asteroids based upon the bounds of the emitter object.
    /// </summary>
    /// <returns></returns>
    private IEnumerator EmitterRoutine()
    {
        while (enabled)
        {
            yield return new WaitForSeconds(timer);

            for (int i = 0; i < 3; i++)
            {
                GameObject temp = GameObject.Instantiate(asteroidsPrefabs[0]);
                Vector3 pos = new Vector3();

                //assuming position is (0x,0y,nz)
                pos.x = Random.Range(-transform.localScale.x, transform.localScale.x);
                pos.y = Random.Range(-transform.localScale.y, transform.localScale.y);
                pos.z = transform.position.z;

                temp.transform.position = pos;
                temp.GetComponent<Asteroid>().onDestroyed += GameManager.Instance.OnDestroyedAsteroid;

                activeAsteroids.Add(temp.GetComponent<Asteroid>());
            }
        }
    }
}


text:
package org.apache.sshd.common;

/**
 * This interface defines constants for the SSH protocol.
 *
 * @author Apache MINA SSHD Project
 */
public final class SshConstants {

    //
    // SSH message identifiers
    //

    public static final byte SSH_MSG_DISCONNECT = 1;
    public static final byte SSH_MSG_IGNORE = 2;
    public static final byte SSH_MSG_UNIMPLEMENTED = 3;
    public static final byte SSH_MSG_DEBUG = 4;
    public static final byte SSH_MSG_SERVICE_REQUEST = 5;
    public static final byte SSH_MSG_SERVICE_ACCEPT = 6;
    public static final byte SSH_MSG_KEXINIT = 20;
    public static final int MSG_KEX_COOKIE_SIZE = 16;
    public static final byte SSH_MSG_NEWKEYS = 21;

    public static final byte SSH_MSG_KEX_FIRST = 30;
    public static final byte SSH_MSG_KEX_LAST = 49;

    public static final byte SSH_MSG_KEXDH_INIT = 30;
    public static final byte SSH_MSG_KEXDH_REPLY = 31;

    public static final byte SSH_MSG_KEX_DH_GEX_REQUEST_OLD = 30;
    public static final byte SSH_MSG_KEX_DH_GEX_GROUP = 31;
    public static final byte SSH_MSG_KEX_DH_GEX_INIT = 32;
    public static final byte SSH_MSG_KEX_DH_GEX_REPLY = 33;
    public static final byte SSH_MSG_KEX_DH_GEX_REQUEST = 34;

    public static final byte SSH_MSG_USERAUTH_REQUEST = 50;
    public static final byte SSH_MSG_USERAUTH_FAILURE = 51;
    public static final byte SSH_MSG_USERAUTH_SUCCESS = 52;
    public static final byte SSH_MSG_USERAUTH_BANNER = 53;

    public static final byte SSH_MSG_USERAUTH_INFO_REQUEST = 60;
    public static final byte SSH_MSG_USERAUTH_INFO_RESPONSE = 61;

    public static final byte SSH_MSG_USERAUTH_PK_OK = 60;

    public static final byte SSH_MSG_USERAUTH_PASSWD_CHANGEREQ = 60;

    public static final byte SSH_MSG_USERAUTH_GSSAPI_MIC = 66;

    public static final byte SSH_MSG_GLOBAL_REQUEST = 80;
    public static final byte SSH_MSG_REQUEST_SUCCESS = 81;
    public static final byte SSH_MSG_REQUEST_FAILURE = 82;
    public static final byte SSH_MSG_CHANNEL_OPEN = 90;
    public static final byte SSH_MSG_CHANNEL_OPEN_CONFIRMATION = 91;
    public static final byte SSH_MSG_CHANNEL_OPEN_FAILURE = 92;
    public static final byte SSH_MSG_CHANNEL_WINDOW_ADJUST = 93;
    public static final byte SSH_MSG_CHANNEL_DATA = 94;
    public static final byte SSH_MSG_CHANNEL_EXTENDED_DATA = 95;
    public static final byte SSH_MSG_CHANNEL_EOF = 96;
    public static final byte SSH_MSG_CHANNEL_CLOSE = 97;
    public static final byte SSH_MSG_CHANNEL_REQUEST = 98;
    public static final byte SSH_MSG_CHANNEL_SUCCESS = 99;
    public static final byte SSH_MSG_CHANNEL_FAILURE = 100;

    //
    // Disconnect error codes
    //
    public static final int SSH2_DISCONNECT_HOST_NOT_ALLOWED_TO_CONNECT = 1;
    public static final int SSH2_DISCONNECT_PROTOCOL_ERROR = 2;
    public static final int SSH2_DISCONNECT_KEY_EXCHANGE_FAILED = 3;
    public static final int SSH2_DISCONNECT_HOST_AUTHENTICATION_FAILED = 4;
    public static final int SSH2_DISCONNECT_RESERVED = 4;
    public static final int SSH2_DISCONNECT_MAC_ERROR = 5;
    public static final int SSH2_DISCONNECT_COMPRESSION_ERROR = 6;
    public static final int SSH2_DISCONNECT_SERVICE_NOT_AVAILABLE = 7;
    public static final int SSH2_DISCONNECT_PROTOCOL_VERSION_NOT_SUPPORTED = 8;
    public static final int SSH2_DISCONNECT_HOST_KEY_NOT_VERIFIABLE = 9;
    public static final int SSH2_DISCONNECT_CONNECTION_LOST = 10;
    public static final int SSH2_DISCONNECT_BY_APPLICATION = 11;
    public static final int SSH2_DISCONNECT_TOO_MANY_CONNECTIONS = 12;
    public static final int SSH2_DISCONNECT_AUTH_CANCELLED_BY_USER = 13;
    public static final int SSH2_DISCONNECT_NO_MORE_AUTH_METHODS_AVAILABLE = 14;
    public static final int SSH2_DISCONNECT_ILLEGAL_USER_NAME = 15;

    //
    // Open error codes
    //

    public static final int SSH_OPEN_ADMINISTRATIVELY_PROHIBITED = 1;
    public static final int SSH_OPEN_CONNECT_FAILED = 2;
    public static final int SSH_OPEN_UNKNOWN_CHANNEL_TYPE = 3;
    public static final int SSH_OPEN_RESOURCE_SHORTAGE = 4;

    private SshConstants() {
        throw new UnsupportedOperationException("No instance allowed");
    }

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
 Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.

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

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
-->
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <parent>
        <groupId>org.wso2.carbon.identity.mgt</groupId>
        <artifactId>carbon-identity-mgt-test-artifacts</artifactId>
        <version>1.0.0-SNAPSHOT</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <artifactId>in-memory-connectors-test-artifact</artifactId>
    <packaging>bundle</packaging>
    <name>WSO2 Carbon Identity Management - Test In-memory Connectors</name>
    <url>http://maven.apache.org</url>

    <dependencies>
        <dependency>
            <groupId>org.wso2.carbon.identity.mgt</groupId>
            <artifactId>org.wso2.carbon.identity.mgt</artifactId>
        </dependency>
    </dependencies>

    <properties>
        <private.package>org.wso2.carbon.identity.mgt.store.connector.inmemory.internal</private.package>
        <export.package>
            !org.wso2.carbon.identity.mgt.store.connector.inmemory.internal,
            org.wso2.carbon.identity.mgt.store.connector.inmemory.*
        </export.package>
        <import.package>
            org.osgi.framework.*;version="${osgi.framework.package.import.version.range}",
            org.osgi.service.permissionadmin.*;version="${org.osgi.service.permissionadmin.import.version.range}",
            org.slf4j.*;version="${slf4j.logging.package.import.version.range}",
            javax.security.auth.*,
            org.osgi.service.component.annotations.*;version="${org.osgi.service.component.annotations.version.range}",
            org.wso2.carbon.identity.mgt.*;version="${org.wso2.carbon.identity.mgt.version.range}"
        </import.package>

        <carbon.component>
            osgi.service;
            objectClass="org.wso2.carbon.identity.mgt.connector.CredentialStoreConnectorFactory",
            osgi.service;
            objectClass="org.wso2.carbon.identity.mgt.connector.IdentityStoreConnectorFactory"
        </carbon.component>

        <dsannotations>*</dsannotations>

        <!-- OSGi API version range-->
        <osgi.framework.package.import.version.range>[1.8.0, 2.0.0)</osgi.framework.package.import.version.range>
        <org.osgi.service.permissionadmin.import.version.range>[1.2.0, 1.3.0)
        </org.osgi.service.permissionadmin.import.version.range>
        <org.osgi.service.component.annotations.version.range>[1.2.0, 1.3.0)
        </org.osgi.service.component.annotations.version.range>
        <org.osgi.service.jndi.version.range>[1.0.0, 1.1.0)</org.osgi.service.jndi.version.range>
        <org.wso2.carbon.datasource.version.range>[1.0.0, 1.1.0)</org.wso2.carbon.datasource.version.range>
        <org.wso2.carbon.identity.mgt.version.range>[1.0.0, 1.1.0)</org.wso2.carbon.identity.mgt.version.range>

        <!-- Dependency package version ranges -->

        <!--Logging API version range-->
        <slf4j.logging.package.import.version.range>[1.7.1, 2.0.0)</slf4j.logging.package.import.version.range>

    </properties>
</project>


text:
package com.facebook.stetho.inspector.protocol.module;

import android.graphics.Color;
import com.facebook.stetho.common.Accumulator;
import com.facebook.stetho.common.ArrayListAccumulator;
import com.facebook.stetho.common.LogUtil;
import com.facebook.stetho.common.UncheckedCallable;
import com.facebook.stetho.common.Util;
import com.facebook.stetho.inspector.elements.DocumentView;
import com.facebook.stetho.inspector.elements.Document;
import com.facebook.stetho.inspector.elements.ElementInfo;
import com.facebook.stetho.inspector.elements.NodeDescriptor;
import com.facebook.stetho.inspector.elements.NodeType;
import com.facebook.stetho.inspector.helper.ChromePeerManager;
import com.facebook.stetho.inspector.helper.PeersRegisteredListener;
import com.facebook.stetho.inspector.jsonrpc.JsonRpcException;
import com.facebook.stetho.inspector.jsonrpc.JsonRpcPeer;
import com.facebook.stetho.inspector.jsonrpc.JsonRpcResult;
import com.facebook.stetho.inspector.jsonrpc.protocol.JsonRpcError;
import com.facebook.stetho.inspector.protocol.ChromeDevtoolsDomain;
import com.facebook.stetho.inspector.protocol.ChromeDevtoolsMethod;
import com.facebook.stetho.json.ObjectMapper;
import com.facebook.stetho.json.annotation.JsonProperty;
import org.json.JSONObject;

import javax.annotation.Nullable;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;

public class DOM implements ChromeDevtoolsDomain {
  private final ObjectMapper mObjectMapper;
  private final Document mDocument;
  private final Map<String, List<Integer>> mSearchResults;
  private final AtomicInteger mResultCounter;
  private final ChromePeerManager mPeerManager;
  private final DocumentUpdateListener mListener;

  private ChildNodeRemovedEvent mCachedChildNodeRemovedEvent;
  private ChildNodeInsertedEvent mCachedChildNodeInsertedEvent;

  public DOM(Document document) {
    mObjectMapper = new ObjectMapper();
    mDocument = Util.throwIfNull(document);
    mSearchResults = Collections.synchronizedMap(
      new HashMap<String, List<Integer>>());
    mResultCounter = new AtomicInteger(0);
    mPeerManager = new ChromePeerManager();
    mPeerManager.setListener(new PeerManagerListener());
    mListener = new DocumentUpdateListener();
  }

  @ChromeDevtoolsMethod
  public void enable(JsonRpcPeer peer, JSONObject params) {
    mPeerManager.addPeer(peer);
  }

  @ChromeDevtoolsMethod
  public void disable(JsonRpcPeer peer, JSONObject params) {
    mPeerManager.removePeer(peer);
  }

  @ChromeDevtoolsMethod
  public JsonRpcResult getDocument(JsonRpcPeer peer, JSONObject params) {
    final GetDocumentResponse result = new GetDocumentResponse();

    result.root = mDocument.postAndWait(new UncheckedCallable<Node>() {
      @Override
      public Node call() {
        Object element = mDocument.getRootElement();
        return createNodeForElement(element, mDocument.getDocumentView(), null);
      }
    });

    return result;
  }

  @ChromeDevtoolsMethod
  public void highlightNode(JsonRpcPeer peer, JSONObject params) {
    final HighlightNodeRequest request =
      mObjectMapper.convertValue(params, HighlightNodeRequest.class);
    if (request.nodeId == null) {
      LogUtil.w("DOM.highlightNode was not given a nodeId; JS objectId is not supported");
      return;
    }

    final RGBAColor contentColor = request.highlightConfig.contentColor;
    if (contentColor == null) {
      LogUtil.w("DOM.highlightNode was not given a color to highlight with");
      return;
    }

    mDocument.postAndWait(new Runnable() {
      @Override
      public void run() {
        Object element = mDocument.getElementForNodeId(request.nodeId);
        if (element != null) {
          mDocument.highlightElement(element, contentColor.getColor());
        }
      }
    });
  }

  @ChromeDevtoolsMethod
  public void hideHighlight(JsonRpcPeer peer, JSONObject params) {
    mDocument.postAndWait(new Runnable() {
      @Override
      public void run() {
        mDocument.hideHighlight();
      }
    });
  }

  @ChromeDevtoolsMethod
  public ResolveNodeResponse resolveNode(JsonRpcPeer peer, JSONObject params)
      throws JsonRpcException {
    final ResolveNodeRequest request = mObjectMapper.convertValue(params, ResolveNodeRequest.class);

    final Object element = mDocument.postAndWait(new UncheckedCallable<Object>() {
      @Override
      public Object call() {
        return mDocument.getElementForNodeId(request.nodeId);
      }
    });

    if (element == null) {
      throw new JsonRpcException(
          new JsonRpcError(
              JsonRpcError.ErrorCode.INVALID_PARAMS,
              "No known nodeId=" + request.nodeId,
              null /* data */));
    }

    int mappedObjectId = Runtime.mapObject(peer, element);

    Runtime.RemoteObject remoteObject = new Runtime.RemoteObject();
    remoteObject.type = Runtime.ObjectType.OBJECT;
    remoteObject.subtype = Runtime.ObjectSubType.NODE;
    remoteObject.className = element.getClass().getName();
    remoteObject.value = null; // not a primitive
    remoteObject.description = null; // not sure what this does...
    remoteObject.objectId = String.valueOf(mappedObjectId);
    ResolveNodeResponse response = new ResolveNodeResponse();
    response.object = remoteObject;

    return response;
  }

  @ChromeDevtoolsMethod
  public void setAttributesAsText(JsonRpcPeer peer, JSONObject params) {
    final SetAttributesAsTextRequest request = mObjectMapper.convertValue(
        params,
        SetAttributesAsTextRequest.class);

    mDocument.postAndWait(new Runnable() {
      @Override
      public void run() {
        Object element = mDocument.getElementForNodeId(request.nodeId);
        if (element != null) {
          mDocument.setAttributesAsText(element, request.text);
        }
      }
    });
  }

  @ChromeDevtoolsMethod
  public void setInspectModeEnabled(JsonRpcPeer peer, JSONObject params) {
    final SetInspectModeEnabledRequest request = mObjectMapper.convertValue(
        params,
        SetInspectModeEnabledRequest.class);

    mDocument.postAndWait(new Runnable() {
      @Override
      public void run() {
        mDocument.setInspectModeEnabled(request.enabled);
      }
    });
  }

  @ChromeDevtoolsMethod
  public PerformSearchResponse performSearch(JsonRpcPeer peer, final JSONObject params) {
    final PerformSearchRequest request = mObjectMapper.convertValue(
        params,
        PerformSearchRequest.class);

    final ArrayListAccumulator<Integer> resultNodeIds = new ArrayListAccumulator<>();

    mDocument.postAndWait(new Runnable() {
      @Override
      public void run() {
        mDocument.findMatchingElements(request.query, resultNodeIds);
      }
    });

    // Each search action has a unique ID so that
    // it can be queried later.
    final String searchId = String.valueOf(mResultCounter.getAndIncrement());

    mSearchResults.put(searchId, resultNodeIds);

    final PerformSearchResponse response = new PerformSearchResponse();
    response.searchId = searchId;
    response.resultCount = resultNodeIds.size();

    return response;
  }

  @ChromeDevtoolsMethod
  public GetSearchResultsResponse getSearchResults(JsonRpcPeer peer, JSONObject params) {
    final GetSearchResultsRequest request = mObjectMapper.convertValue(
        params,
        GetSearchResultsRequest.class);

    if (request.searchId == null) {
      LogUtil.w("searchId may not be null");
      return null;
    }

    final List<Integer> results = mSearchResults.get(request.searchId);

    if (results == null) {
      LogUtil.w("\"" + request.searchId + "\" is not a valid reference to a search result");
      return null;
    }

    final List<Integer> resultsRange = results.subList(request.fromIndex, request.toIndex);

    final GetSearchResultsResponse response = new GetSearchResultsResponse();
    response.nodeIds = resultsRange;

    return response;
  }

  @ChromeDevtoolsMethod
  public void discardSearchResults(JsonRpcPeer peer, JSONObject params) {
    final DiscardSearchResultsRequest request = mObjectMapper.convertValue(
      params,
      DiscardSearchResultsRequest.class);

    if (request.searchId != null) {
      mSearchResults.remove(request.searchId);
    }
  }

  private Node createNodeForElement(
      Object element,
      DocumentView view,
      @Nullable Accumulator<Object> processedElements) {
    if (processedElements != null) {
      processedElements.store(element);
    }

    NodeDescriptor descriptor = mDocument.getNodeDescriptor(element);

    Node node = new DOM.Node();
    node.nodeId = mDocument.getNodeIdForElement(element);
    node.nodeType = descriptor.getNodeType(element);
    node.nodeName = descriptor.getNodeName(element);
    node.localName = descriptor.getLocalName(element);
    node.nodeValue = descriptor.getNodeValue(element);

    Document.AttributeListAccumulator accumulator = new Document.AttributeListAccumulator();
    descriptor.getAttributes(element, accumulator);

    // Attributes
    node.attributes = accumulator;

    // Children
    ElementInfo elementInfo = view.getElementInfo(element);
    List<Node> childrenNodes = (elementInfo.children.size() == 0)
        ? Collections.<Node>emptyList()
        : new ArrayList<Node>(elementInfo.children.size());

    for (int i = 0, N = elementInfo.children.size(); i < N; ++i) {
      final Object childElement = elementInfo.children.get(i);
      Node childNode = createNodeForElement(childElement, view, processedElements);
      childrenNodes.add(childNode);
    }

    node.children = childrenNodes;
    node.childNodeCount = childrenNodes.size();

    return node;
  }

  private ChildNodeInsertedEvent acquireChildNodeInsertedEvent() {
    ChildNodeInsertedEvent childNodeInsertedEvent = mCachedChildNodeInsertedEvent;
    if (childNodeInsertedEvent == null) {
      childNodeInsertedEvent = new ChildNodeInsertedEvent();
    }
    mCachedChildNodeInsertedEvent = null;
    return childNodeInsertedEvent;
  }

  private void releaseChildNodeInsertedEvent(ChildNodeInsertedEvent childNodeInsertedEvent) {
    childNodeInsertedEvent.parentNodeId = -1;
    childNodeInsertedEvent.previousNodeId = -1;
    childNodeInsertedEvent.node = null;
    if (mCachedChildNodeInsertedEvent == null) {
      mCachedChildNodeInsertedEvent = childNodeInsertedEvent;
    }
  }

  private ChildNodeRemovedEvent acquireChildNodeRemovedEvent() {
    ChildNodeRemovedEvent childNodeRemovedEvent = mCachedChildNodeRemovedEvent;
    if (childNodeRemovedEvent == null) {
      childNodeRemovedEvent = new ChildNodeRemovedEvent();
    }
    mCachedChildNodeRemovedEvent = null;
    return childNodeRemovedEvent;
  }

  private void releaseChildNodeRemovedEvent(ChildNodeRemovedEvent childNodeRemovedEvent) {
    childNodeRemovedEvent.parentNodeId = -1;
    childNodeRemovedEvent.nodeId = -1;
    if (mCachedChildNodeRemovedEvent == null) {
      mCachedChildNodeRemovedEvent = childNodeRemovedEvent;
    }
  }

  private final class DocumentUpdateListener implements Document.UpdateListener {
    public void onAttributeModified(Object element, String name, String value) {
      AttributeModifiedEvent message = new AttributeModifiedEvent();
      message.nodeId = mDocument.getNodeIdForElement(element);
      message.name = name;
      message.value = value;
      mPeerManager.sendNotificationToPeers("DOM.attributeModified", message);
    }

    public void onAttributeRemoved(Object element, String name) {
      AttributeRemovedEvent message = new AttributeRemovedEvent();
      message.nodeId = mDocument.getNodeIdForElement(element);
      message.name = name;
      mPeerManager.sendNotificationToPeers("DOM.attributeRemoved", message);
    }

    public void onInspectRequested(Object element) {
      Integer nodeId = mDocument.getNodeIdForElement(element);
      if (nodeId == null) {
        LogUtil.d(
            "DocumentProvider.Listener.onInspectRequested() " +
                "called for a non-mapped node: element=%s",
            element);
      } else {
        InspectNodeRequestedEvent message = new InspectNodeRequestedEvent();
        message.nodeId = nodeId;
        mPeerManager.sendNotificationToPeers("DOM.inspectNodeRequested", message);
      }
    }

    public void onChildNodeRemoved(
        int parentNodeId,
        int nodeId) {
      ChildNodeRemovedEvent removedEvent = acquireChildNodeRemovedEvent();

      removedEvent.parentNodeId = parentNodeId;
      removedEvent.nodeId = nodeId;
      mPeerManager.sendNotificationToPeers("DOM.childNodeRemoved", removedEvent);

      releaseChildNodeRemovedEvent(removedEvent);
    }

    public void onChildNodeInserted(
        DocumentView view,
        Object element,
        int parentNodeId,
        int previousNodeId,
        Accumulator<Object> insertedElements) {
      ChildNodeInsertedEvent insertedEvent = acquireChildNodeInsertedEvent();

      insertedEvent.parentNodeId = parentNodeId;
      insertedEvent.previousNodeId = previousNodeId;
      insertedEvent.node = createNodeForElement(element, view, insertedElements);

      mPeerManager.sendNotificationToPeers("DOM.childNodeInserted", insertedEvent);

      releaseChildNodeInsertedEvent(insertedEvent);
    }
  }

  private final class PeerManagerListener extends PeersRegisteredListener {
    @Override
    protected synchronized void onFirstPeerRegistered() {
      mDocument.addRef();
      mDocument.addUpdateListener(mListener);
    }

    @Override
    protected synchronized void onLastPeerUnregistered() {
      mSearchResults.clear();
      mDocument.removeUpdateListener(mListener);
      mDocument.release();
    }
  }

  private static class GetDocumentResponse implements JsonRpcResult {
    @JsonProperty(required = true)
    public Node root;
  }

  private static class Node implements JsonRpcResult {
    @JsonProperty(required = true)
    public int nodeId;

    @JsonProperty(required = true)
    public NodeType nodeType;

    @JsonProperty(required = true)
    public String nodeName;

    @JsonProperty(required = true)
    public String localName;

    @JsonProperty(required = true)
    public String nodeValue;

    @JsonProperty
    public Integer childNodeCount;

    @JsonProperty
    public List<Node> children;

    @JsonProperty
    public List<String> attributes;
  }

  private static class AttributeModifiedEvent {
    @JsonProperty(required = true)
    public int nodeId;

    @JsonProperty(required = true)
    public String name;

    @JsonProperty(required = true)
    public String value;
  }

  private static class AttributeRemovedEvent {
    @JsonProperty(required = true)
    public int nodeId;

    @JsonProperty(required = true)
    public String name;
  }

  private static class ChildNodeInsertedEvent {
    @JsonProperty(required = true)
    public int parentNodeId;

    @JsonProperty(required = true)
    public int previousNodeId;

    @JsonProperty(required = true)
    public Node node;
  }

  private static class ChildNodeRemovedEvent {
    @JsonProperty(required = true)
    public int parentNodeId;

    @JsonProperty(required = true)
    public int nodeId;
  }

  private static class HighlightNodeRequest {
    @JsonProperty(required = true)
    public HighlightConfig highlightConfig;

    @JsonProperty
    public Integer nodeId;

    @JsonProperty
    public String objectId;
  }

  private static class HighlightConfig {
    @JsonProperty
    public RGBAColor contentColor;
  }

  private static class InspectNodeRequestedEvent {
    @JsonProperty
    public int nodeId;
  }

  private static class SetInspectModeEnabledRequest {
    @JsonProperty(required = true)
    public boolean enabled;

    @JsonProperty
    public Boolean inspectShadowDOM;

    @JsonProperty
    public HighlightConfig highlightConfig;
  }

  private static class RGBAColor {
    @JsonProperty(required = true)
    public int r;

    @JsonProperty(required = true)
    public int g;

    @JsonProperty(required = true)
    public int b;

    @JsonProperty
    public Double a;

    public int getColor() {
      byte alpha;
      if (this.a == null) {
        alpha = (byte)255;
      } else {
        long aLong = Math.round(this.a * 255.0);
        alpha = (aLong < 0) ? (byte)0 : (aLong >= 255) ? (byte)255 : (byte)aLong;
      }

      return Color.argb(alpha, this.r, this.g, this.b);
    }
  }

  private static class ResolveNodeRequest {
    @JsonProperty(required = true)
    public int nodeId;

    @JsonProperty
    public String objectGroup;
  }

  private static class SetAttributesAsTextRequest {
    @JsonProperty(required = true)
    public int nodeId;

    @JsonProperty(required = true)
    public String text;
  }

  private static class ResolveNodeResponse implements JsonRpcResult {
    @JsonProperty(required = true)
    public Runtime.RemoteObject object;
  }

  private static class PerformSearchRequest {
    @JsonProperty(required = true)
    public String query;

    @JsonProperty
    public Boolean includeUserAgentShadowDOM;
  }

  private static class PerformSearchResponse implements JsonRpcResult {
    @JsonProperty(required = true)
    public String searchId;

    @JsonProperty(required = true)
    public int resultCount;
  }

  private static class GetSearchResultsRequest {
    @JsonProperty(required = true)
    public String searchId;

    @JsonProperty(required = true)
    public int fromIndex;

    @JsonProperty(required = true)
    public int toIndex;
  }

  private static class GetSearchResultsResponse implements JsonRpcResult {
    @JsonProperty(required = true)
    public List<Integer> nodeIds;
  }

  private static class DiscardSearchResultsRequest {
    @JsonProperty(required = true)
    public String searchId;
  }
}


text:
package executor

import (
	"context"

	"github.com/pingcap/errors"
	"github.com/pingcap/tidb/bindinfo"
	"github.com/pingcap/tidb/domain"
	"github.com/pingcap/tidb/parser/ast"
	plannercore "github.com/pingcap/tidb/planner/core"
	"github.com/pingcap/tidb/util/chunk"
)

// SQLBindExec represents a bind executor.
type SQLBindExec struct {
	baseExecutor

	sqlBindOp    plannercore.SQLBindOpType
	normdOrigSQL string
	bindSQL      string
	charset      string
	collation    string
	db           string
	isGlobal     bool
	bindAst      ast.StmtNode
}

// Next implements the Executor Next interface.
func (e *SQLBindExec) Next(ctx context.Context, req *chunk.Chunk) error {
	req.Reset()
	switch e.sqlBindOp {
	case plannercore.OpSQLBindCreate:
		return e.createSQLBind()
	case plannercore.OpSQLBindDrop:
		return e.dropSQLBind()
	case plannercore.OpFlushBindings:
		return e.flushBindings()
	case plannercore.OpCaptureBindings:
		e.captureBindings()
	case plannercore.OpEvolveBindings:
		return e.evolveBindings()
	case plannercore.OpReloadBindings:
		return e.reloadBindings()
	default:
		return errors.Errorf("unsupported SQL bind operation: %v", e.sqlBindOp)
	}
	return nil
}

func (e *SQLBindExec) dropSQLBind() error {
	var bindInfo *bindinfo.Binding
	if e.bindSQL != "" {
		bindInfo = &bindinfo.Binding{
			BindSQL:   e.bindSQL,
			Charset:   e.charset,
			Collation: e.collation,
		}
	}
	if !e.isGlobal {
		handle := e.ctx.Value(bindinfo.SessionBindInfoKeyType).(*bindinfo.SessionHandle)
		return handle.DropBindRecord(e.normdOrigSQL, e.db, bindInfo)
	}
	return domain.GetDomain(e.ctx).BindHandle().DropBindRecord(e.normdOrigSQL, e.db, bindInfo)
}

func (e *SQLBindExec) createSQLBind() error {
	// For audit log, SQLBindExec execute "explain" statement internally, save and recover stmtctx
	// is necessary to avoid 'create binding' been recorded as 'explain'.
	saveStmtCtx := e.ctx.GetSessionVars().StmtCtx
	defer func() {
		e.ctx.GetSessionVars().StmtCtx = saveStmtCtx
	}()

	bindInfo := bindinfo.Binding{
		BindSQL:   e.bindSQL,
		Charset:   e.charset,
		Collation: e.collation,
		Status:    bindinfo.Using,
		Source:    bindinfo.Manual,
	}
	record := &bindinfo.BindRecord{
		OriginalSQL: e.normdOrigSQL,
		Db:          e.db,
		Bindings:    []bindinfo.Binding{bindInfo},
	}
	if !e.isGlobal {
		handle := e.ctx.Value(bindinfo.SessionBindInfoKeyType).(*bindinfo.SessionHandle)
		return handle.CreateBindRecord(e.ctx, record)
	}
	return domain.GetDomain(e.ctx).BindHandle().CreateBindRecord(e.ctx, record)
}

func (e *SQLBindExec) flushBindings() error {
	return domain.GetDomain(e.ctx).BindHandle().FlushBindings()
}

func (e *SQLBindExec) captureBindings() {
	domain.GetDomain(e.ctx).BindHandle().CaptureBaselines()
}

func (e *SQLBindExec) evolveBindings() error {
	return domain.GetDomain(e.ctx).BindHandle().HandleEvolvePlanTask(e.ctx, true)
}

func (e *SQLBindExec) reloadBindings() error {
	return domain.GetDomain(e.ctx).BindHandle().ReloadBindings()
}


text:
require "spec_helper"
require "generators/kuva/assets_generator"

module Kuva
  module Generators
    describe AssetsGenerator do
      destination File.expand_path("../../../../tmp", __FILE__)

      let(:javascript) { file("app/assets/javascripts/kuva.js.coffee") }
      let(:stylesheet) { file("app/assets/stylesheets/kuva.css.sass") }

      before do
        prepare_destination
        run_generator
      end

      it "generates app/assets/javascript/kuva.js.coffee" do
        expect(javascript).to exist
      end

      it "generates app/assets/stylesheets/kuva.css.sass" do
        expect(stylesheet).to exist
      end

      after do
        FileUtils.rm_rf File.expand_path("../../../../tmp", __FILE__)
      end
    end
  end
end


text:
namespace Repositories.Interface
{
	public interface IGenericRepository<T> : IDeleteRepository<T>
	{

	}
}


text:
import React , { Component , PropTypes } from 'react';
import { css,pureRender } from './enhance/index';
import createEnhance from './core/createEnhance'

@createEnhance(css)
export default class ButtonRow extends Component{
    static displayName = "ButtonRow";
    render=()=>{
        const {
            className ,
            children ,
            round ,
            color ,
            big ,
            ...other
        } = this.props;

        let cloneProps = {
            fill:false,
            wrap:false,
            big,
            color,
            round
        };
        let buttons = React.Children.map(children,(button)=>{
            return React.cloneElement(button,cloneProps);
        });
        return (
            <p {...other} className={this.mergeClass("buttons-row",className)}>
                {buttons}
            </p>
        );
    }

}