text:
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (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.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is JavaScript Engine testing utilities.
 *
 * The Initial Developer of the Original Code is
 * Mozilla Foundation.
 * Portions created by the Initial Developer are Copyright (C) 2008
 * the Initial Developer. All Rights Reserved.
 *
 * Contributor(s):
 *
 * Alternatively, the contents of this file may be used under the terms of
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 * in which case the provisions of the GPL or the LGPL are applicable instead
 * of those above. If you wish to allow use of your version of this file only
 * under the terms of either the GPL or the LGPL, and not to allow others to
 * use your version of this file under the terms of the MPL, indicate your
 * decision by deleting the provisions above and replace them with the notice
 * and other provisions required by the GPL or the LGPL. If you do not delete
 * the provisions above, a recipient may use your version of this file under
 * the terms of any one of the MPL, the GPL or the LGPL.
 *
 * ***** END LICENSE BLOCK ***** */

gTestfile = 'template.js';

/**
 *  File Name:          template.js
 *  Reference:          ** replace with bugzilla URL or document reference **
 *  Description:        ** replace with description of test **
 *  Author:             ** replace with your e-mail address **
 */

var SECTION = "";       // provide a document reference (ie, ECMA section)
var VERSION = "ECMA";   // Version of JavaScript or ECMA
var TITLE   = "";       // Provide ECMA section title or a description
var BUGNUMBER = "";     // Provide URL to bugsplat or bugzilla report

startTest();               // leave this alone

/*
 * Calls to AddTestCase here. AddTestCase is a function that is defined
 * in shell.js and takes three arguments:
 * - a string representation of what is being tested
 * - the expected result
 * - the actual result
 *
 * For example, a test might look like this:
 *
 * AddTestCase("** description",
 *             "** expected value",
 *             "** actual value");
 */

// leave this alone.  this executes the test cases and
// displays results.
test();


text:
module Course where

import Melchior.Data.String
import Melchior.Dom.Html
import Melchior.Remote.Json
import Melchior.Remote.Internal.Parser
import Melchior.Remote.Internal.ParserUtils

data Course = Course { title :: String, code :: Integer, points :: Integer }

-----------------------------------------------------------------------------
-- Instances
instance JsonSerialisable Course where
  fromJson (Just c) = Course (stringOrError c "title")
                      (floor $ (read (stringOrError c "code") :: Float))
                      (floor $ (read (stringOrError c "points") :: Float))
  fromJson Nothing = Course "not found" (-1) (-1)

instance Renderable Course where
  render c = stringToJSString $ (title c)++(show $ code c)++":"++(show $ points c)

instance JsonWriteable Course where
  asJson c = Just $ parseToJson' (title c) (show $ code c) (show $ points c)

instance Show Course where
  show c = (title c)++(show $ code c)++":"++(show $ points c)

-----------------------------------------------------------------------------
-- Parsing
parseToJson :: JSString -> JSString -> JSString -> JsonObject
parseToJson t c p = parseToJson' (jsStringToString t) (jsStringToString c) (jsStringToString p)

parseToJson' :: String -> String -> String -> JsonObject
parseToJson' t c p = JsonObject [ptitle, pcode, ppoints]
                     where
                       ptitle = JsonPair (JsonString "title", JsonString t)
                       pcode = JsonPair (JsonString "code", JsonString . show $ parseNumber c)
                       ppoints = JsonPair (JsonString "points", JsonString . show $ parseNumber p)

parseNumber :: String -> Int
parseNumber s = case parse numbers s of
  [] -> (-1)
  x -> (read . fst $ head x)
  where numbers = many1 digit

fromString :: String -> Course
fromString s = fromJson $ parseJson s

-----------------------------------------------------------------------------
-- Operations

-- Get the database key
getKey :: Course -> String
getKey c = (title c)++(show $ title c)

-- Update the points value of a course
setPoint :: Course -> Integer -> Course
setPoint c i = Course (title c) (code c) i

-- Update the code value of a course
setCode :: Course -> Integer -> Course
setCode c i = Course (title c) i (points c)

-- Update the title value of a course
setTitle :: Course -> String -> Course
setTitle c s = Course s (code c) (points c)

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace('Firelit');

class VarsStoreDB extends VarsStore {

	private $db;

	public static $config = array(
		'tableName' => 'Vars',
		'maxNameLength' => 32
	);

	public function __construct(Query $queryObject, $config = array()) {

		$this->db = $queryObject;

		// Merge config data with defaults
		self::config($config);

	}

	public static function config($config) {

		self::$config = array_merge(self::$config, $config);

	}

	public function set($name, $value) {

		$this->db->replace(self::$config['tableName'], array(
			'name' => $name,
			'value' => serialize($value)
		));

		if (!$this->db->success())
			throw new \Exception('Error setting value in database.');

	}

	public function get($name) {

		$this->db->select(self::$config['tableName'], array('value'), "`name`=:name", array( 'name' => $name ), 1);

		if (!$this->db->success())
			throw new \Exception('Error getting value from database.');

		if ($row = $this->db->fetch()) return unserialize($row['value']);
		else return null;

	}

	public static function install(Query $query) {
		// One-time install
		// Create the supporting tables in the db

		// Running MySql >= 5.5.3 ? Use utf8mb4 insetad of utf8.
		$sql = "CREATE TABLE IF NOT EXISTS `". self::$config['tableName'] ."` (
			  `name` varchar(". self::$config['maxNameLength'] .") character set utf8 collate utf8_bin NOT NULL,
			  `value` longtext NOT NULL,
			  UNIQUE KEY `name` (`name`)
			) ENGINE=MyISAM DEFAULT CHARSET=utf8;"

		$q = $query->query($sql);

		if (!$q->success())
			throw new \Exception('Install failed! ('. __FILE__ .':'. __LINE__ .')');

		return $query->insertId();

	}

}


text:
#pragma once

#include <lua.h>

/** require('class')
 * Loader function for the 'class' module.
 * Use by calling require('class') from Lua.
 * Returns the new function for creating instances,
 * and the new.class function for creating classes.
 */
int lapi_load_class(lua_State *L);

/** new(class, ...)
 * Creates a new instance of a class,
 *  and calls the constructor using rest of arguments
 */
int lapi_class_new(lua_State *L);

/** new.class(...)
 * Creates a new class, using arguments as parents.
 * All parents are treated as mixins, and are applied right-to-left
 *  (so left-most parents overwrite right-most parents).
 */
int lapi_class_sub(lua_State *L);

// Wrappers for use in C code

/** [-nparents, +1, e]
 * Pops nparents elements off the stack,
 *  and uses them to create a new prototype.
 * The recommended way of populating this
 *  prototype is using luaL_setfuncs().
 * Note that if proto['[getvalue]'] is a
 *  function, it will be used to get the
 *  base value.
 */
void create_class(lua_State *L, int nparents);

/** [-cargs+1, +1, e]
 * Uses prototype at stack index -(cargs+1)
 *  to create a new instance of this class.
 * The top cargs values on the stack are
 *  used as constructor arguments.
 * Note that if proto['[getvalue]'] is a
 *  function, it will be used to get the
 *  base value.
 */
void create_inst(lua_State *L, int cargs);

/** [-nargs, +nresults, e]
 * Calls a method mname on the object at stack index idx,
 *  using nargs from the stack and resulting in
 *  nresults.
 */
void call_method(lua_State *L,
    int idx, const char *mname, int nargs, int nresults);


text:
class Sensor
{
public:
    Sensor();
    double popNextPressurePsiValue();
};


text:
package clojure.lang;

public interface IPersistentList extends Sequential, IPersistentStack{

}


text:
package org.apache.causeway.core.metamodel.facets.actions.validate.method;

import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.util.Optional;
import java.util.function.BiConsumer;

import org.apache.causeway.applib.services.i18n.TranslatableString;
import org.apache.causeway.applib.services.i18n.TranslationContext;
import org.apache.causeway.commons.collections.Can;
import org.apache.causeway.core.metamodel.facetapi.FacetHolder;
import org.apache.causeway.core.metamodel.facets.ImperativeFacet;
import org.apache.causeway.core.metamodel.facets.actions.validate.ActionValidationFacetAbstract;
import org.apache.causeway.core.metamodel.object.ManagedObject;
import org.apache.causeway.core.metamodel.object.MmInvokeUtil;

import lombok.Getter;
import lombok.NonNull;
import lombok.val;

public class ActionValidationFacetViaMethod
extends ActionValidationFacetAbstract
implements ImperativeFacet {

    @Getter(onMethod_ = {@Override}) private final @NonNull Can<Method> methods;
    private final TranslationContext translationContext;
    private final Optional<Constructor<?>> patConstructor;

    public ActionValidationFacetViaMethod(
            final Method method,
            final Optional<Constructor<?>> patConstructor,
            final FacetHolder holder) {

        super(holder);
        this.methods = ImperativeFacet.singleMethod(method);
        this.translationContext = holder.getTranslationContext();
        this.patConstructor = patConstructor;
    }

    @Override
    public Intent getIntent(final Method method) {
        return Intent.CHECK_IF_VALID;
    }

    @Override
    public String invalidReason(final ManagedObject owningAdapter, final Can<ManagedObject> proposedArgumentAdapters) {

        val method = methods.getFirstOrFail();
        final Object returnValue = patConstructor.isPresent()
                ? MmInvokeUtil.invokeWithPAT(patConstructor.get(), method, owningAdapter, proposedArgumentAdapters)
                : MmInvokeUtil.invoke(method, owningAdapter, proposedArgumentAdapters);

        if(returnValue instanceof String) {
            return (String) returnValue;
        }
        if(returnValue instanceof TranslatableString) {
            final TranslatableString ts = (TranslatableString) returnValue;
            return ts.translate(getTranslationService(), translationContext);
        }
        return null;
    }

    @Override
    public void visitAttributes(final BiConsumer<String, Object> visitor) {
        super.visitAttributes(visitor);
        ImperativeFacet.visitAttributes(this, visitor);
    }

}


text:
module Role
  # Helper class, which handles building of a role's #permissions_hash.
  #
  # @param policy [Class] the class used to store a reference to the policy which instantiated this
  # @param attr_opts [Hash, :Symbol] the requested options for attributes to be refined by the permitted method
  # @param assoc_opts [Hash, :Symbol] the requested options for associations to be refined by the permitted method
  # @param scope [String] the scope for the role in String format

  class OptionBuilder

    attr_reader :policy

    def initialize(policy, attr_opts, assoc_opts, scope)
      @policy = policy
      @attr_opts = attr_opts
      @assoc_opts = assoc_opts
      @scope = scope
      freeze
    end

    # Returns a refined hash of attributes and associations the current_user has access to
    def permitted
      return {
        attributes: permitted_options(@attr_opts, 'attributes'),
        associations: permitted_options(@assoc_opts, 'associations')
      }
    end

    private

    # Determines the the kind of method used to declare the option
    #
    # @param *opts [Hash] the hash of attributes or associations for the role
    # @param type [String] the kind of option, can be 'attributes' or 'associations'
    def permitted_options(opts, type)
      if not opts
        permitted =  {}

      elsif opts.is_a? Symbol
        permitted =  handle_default_options(opts, type)
      else
        permitted =  init_options(opts, type)
      end

      return permitted
    end

    # Build hash of options when options are explicitly declared as a Hash
    #
    # @param options [Hash] unrefined hash containing either attributes or associations
    # @param type [String] the type of option to be built, can be 'attributes' or 'associations'
    def init_options(options, type)
      raise ArgumentError, "Permitted #{type}, if declared, must be declared as a Hash or Symbol, expected something along the lines of
                            {show: [:id, :name], create: [:name], update: :all} or :all, got #{options}" unless options.is_a? Hash

      parsed_options = {}
      options.each do |key, value|
        raise ArgumentError, "Expected Symbol or Array, for #{key} attribute, got #{value} of kind #{value.class}" unless _permitted_value_types value

        if key == :save
          actions = [:create, :update]
        else
          actions = [key]
        end

        if value.is_a? Symbol and value == :all
          actions.each do |action|
            parsed_options[action] = remove_restricted(action, type)
          end
          next
        end

        if value.is_a? Array
          actions.each do |action|
            parsed_options[action] = [] unless parsed_options[action].present?
            parsed_options[action] |= value
          end
          next
        end

      end

      return parsed_options
    end

    # Build hash of options when options are implicitly declared as a Symbol, ex: :show_all
    #
    # @param option [Symbol] unrefined hash containing either attributes or associations
    # @param type [String] the type of option to be built, can be 'attributes' or 'associations'
    def handle_default_options(option, type)
      raise ArgumentError, "Permitted options for implicit permission declaration are #{_allowed_access_options},
                            got #{option} instead" unless _allowed_access_options.include? option
      parsed_options = {}
      case option
        when :show_all
          parsed_options[:show] = remove_restricted(:show, type)
        when :save_all
          [:show, :create, :update].each do |action|
            parsed_options[action] = remove_restricted(action, type)
          end
        else
          option_type = option.to_s.gsub('_all', '').to_sym
          [:show, option_type].each do |action|
            parsed_options[action] = remove_restricted(action, type)
          end
      end

      return parsed_options
    end

    # Remove restricted attributes declared in the #policy RESTRICTED_#{key}_#{type} constants
    #
    # @param action [Hash] the action we're fetch the restricted options for
    # @param type [String] the type of option to be built, can be 'attributes' or 'associations'
    def remove_restricted(action, type)
      all_attributes = get_all(type)
      restricted = "#{@policy}::RESTRICTED_#{action.upcase}_#{type.upcase}".constantize

      return restricted.present? ? all_attributes - restricted : all_attributes
    end

    # Returns all attributes of a record or scope defined in the #policy
    def get_all_attributes
      @policy.to_s.gsub('Policy', '').constantize.column_names.map(&:to_sym)
    end

    # Returns all associations of a record or scope defined in the #policy
    def get_all_associations
      @policy.to_s.gsub('Policy', '').constantize.reflect_on_all_associations.map(&:name)
    end

    def get_all(type)
      begin
        send("get_all_#{type}")
      rescue NameError => e
        raise ArgumentError, "#{@policy} does not seem to have a corresponding model: "+
          "#{@policy.to_s.gsub('Policy', '')}, implicit declarations are not allowed => #{e.message}"
      end
    end

    # allowed options for implicit declaration
    def _allowed_access_options
      [:show_all, :save_all, :create_all, :update_all]
    end

    # allowed options for explicit declaration
    def _permitted_value_types(value)
      value.is_a? Symbol or value.is_a? Array
    end

  end
end


text:
sudo salt-key -Ay
cd DeepSea/qa
sudo suites/basic/health-ok.sh --cli


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <ProgressBar
        android:id="@+id/fragment_webview_progressbar"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:visibility="gone" />

    <WebView
        android:id="@+id/fragment_webview_webview"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</RelativeLayout>


text:
package org.apereo.cas.pm.impl;

import lombok.extern.slf4j.Slf4j;
import org.apereo.cas.CipherExecutor;
import org.apereo.cas.authentication.Credential;
import org.apereo.cas.configuration.model.support.pm.PasswordManagementProperties;
import org.apereo.cas.pm.BasePasswordManagementService;
import org.apereo.cas.pm.PasswordChangeBean;

import java.io.Serializable;
import java.util.Map;

/**
 * This is {@link NoOpPasswordManagementService}.
 *
 * @author Misagh Moayyed
 * @since 5.1.0
 */
@Slf4j
public class NoOpPasswordManagementService extends BasePasswordManagementService {
    public NoOpPasswordManagementService(final CipherExecutor<Serializable, String> cipherExecutor,
                                         final String issuer,
                                         final PasswordManagementProperties passwordManagementProperties) {
        super(passwordManagementProperties, cipherExecutor, issuer);
    }

    @Override
    public boolean changeInternal(final Credential c, final PasswordChangeBean bean) {
        return false;
    }

    @Override
    public String findEmail(final String username) {
        return null;
    }

    @Override
    public Map<String, String> getSecurityQuestions(final String username) {
        return null;
    }
}


text:
define(
  [],
  function() {
    "use strict";

    var fs = require('fs'),
        Handlebars = require('./index'),
        basename = require('path').basename,
        uglify = require('uglify-js');

    module.exports.cli = function(opts) {
      if (opts.version) {
        console.log(Handlebars.VERSION);
        return;
      }

      var template = [0];
      if (!opts.templates.length) {
        throw new Handlebars.Exception('Must define at least one template or directory.');
      }

      opts.templates.forEach(function(template) {
        try {
          fs.statSync(template);
        } catch (err) {
          throw new Handlebars.Exception('Unable to open template file "' + template + '"');
        }
      });

      if (opts.simple && opts.min) {
        throw new Handlebars.Exception('Unable to minimze simple output');
      }
      if (opts.simple && (opts.templates.length !== 1 || fs.statSync(opts.templates[0]).isDirectory())) {
        throw new Handlebars.Exception('Unable to output multiple templates in simple mode');
      }

      // Convert the known list into a hash
      var known = {};
      if (opts.known && !Array.isArray(opts.known)) {
        opts.known = [opts.known];
      }
      if (opts.known) {
        for (var i = 0, len = opts.known.length; i < len; i++) {
          known[opts.known[i]] = true;
        }
      }

      // Build file extension pattern
      var extension = opts.extension.replace(/[\\^$*+?.():=!|{}\-\[\]]/g, function(arg) { return '\\' + arg; });
      extension = new RegExp('\\.' + extension + '$');

      var output = [];
      if (!opts.simple) {
        if (opts.amd) {
          output.push('define([\'' + opts.handlebarPath + 'handlebars.runtime\'], function(Handlebars) {\n  Handlebars = Handlebars["default"];');
        } else if (opts.commonjs) {
          output.push('var Handlebars = require("' + opts.commonjs + '");');
        } else {
          output.push('(function() {\n');
        }
        output.push('  var template = Handlebars.template, templates = ');
        output.push(opts.namespace);
        output.push(' = ');
        output.push(opts.namespace);
        output.push(' || {};\n');
      }
      function processTemplate(template, root) {
        var path = template,
            stat = fs.statSync(path);
        if (stat.isDirectory()) {
          fs.readdirSync(template).map(function(file) {
            var path = template + '/' + file;

            if (extension.test(path) || fs.statSync(path).isDirectory()) {
              processTemplate(path, root || template);
            }
          });
        } else {
          var data = fs.readFileSync(path, 'utf8');

          if (opts.bom && data.indexOf('\uFEFF') === 0) {
            data = data.substring(1);
          }

          var options = {
            knownHelpers: known,
            knownHelpersOnly: opts.o
          };

          if (opts.data) {
            options.data = true;
          }

          // Clean the template name
          if (!root) {
            template = basename(template);
          } else if (template.indexOf(root) === 0) {
            template = template.substring(root.length+1);
          }
          template = template.replace(extension, '');

          if (opts.simple) {
            output.push(Handlebars.precompile(data, options) + '\n');
          } else if (opts.partial) {
            if(opts.amd && (opts.templates.length == 1 && !fs.statSync(opts.templates[0]).isDirectory())) {
              output.push('return ');
            }
            output.push('Handlebars.partials[\'' + template + '\'] = template(' + Handlebars.precompile(data, options) + ');\n');
          } else {
            if(opts.amd && (opts.templates.length == 1 && !fs.statSync(opts.templates[0]).isDirectory())) {
              output.push('return ');
            }
            output.push('templates[\'' + template + '\'] = template(' + Handlebars.precompile(data, options) + ');\n');
          }
        }
      }

      opts.templates.forEach(function(template) {
        processTemplate(template, opts.root);
      });

      // Output the content
      if (!opts.simple) {
        if (opts.amd) {
          if(opts.templates.length > 1 || (opts.templates.length == 1 && fs.statSync(opts.templates[0]).isDirectory())) {
            if(opts.partial){
              output.push('return Handlebars.partials;\n');
            } else {
              output.push('return templates;\n');
            }
          }
          output.push('});');
        } else if (!opts.commonjs) {
          output.push('})();');
        }
      }
      output = output.join('');

      if (opts.min) {
        output = uglify.minify(output, {fromString: true}).code;
      }

      if (opts.output) {
        fs.writeFileSync(opts.output, output, 'utf8');
      } else {
        console.log(output);
      }
    };
  });


text:
<?php
namespace teklife\ant;

class Login {
	private $username;
	private $password;
	private $is_valid;

	public $errors = array();

	/**
	* Get username/password on construct then
	* run the checkLogin method to see if the
	* username and password match what is in
	* the database. Doesn't do that yet :)
	*/
	public function __construct($data = array()) {
		$this->username = $data["username"];
		$this->password = $data["password"];
	}

	/**
	* This is just an example
	* @return bool true or false
	*/
	public function checkLogin()
	{
		if($this->username == "levi" AND $this->password == "password")
		{
			return true;
		} else {
			return false;
		}
	}
}


text:
var MultiFileSelector = (function() {
    var selector = {};
    selector.bind = function(singleFileSelectionInput, multiFileSelectionInput,
        singleFileSelectionDiv, multipleFileSelectionDiv, multiChooseFileInput, fileList) {

        selector.singleFileSelectionDiv = singleFileSelectionDiv;
        selector.multipleFileSelectionDiv = multipleFileSelectionDiv;
        selector.multiChooseFileInput = multiChooseFileInput;
        selector.fileList = fileList;
        singleFileSelectionInput.click(function() {
            selector.showSingle();
        });
        multiFileSelectionInput.click(function() {
            selector.showMulti();
        });
        multiChooseFileInput.change(function() {
            selector.showFiles();
        });
    };
    /**
     * Function to show the multiple file section and hide single file selection
     */
    selector.showMulti = function() {
        selector.singleFileSelectionDiv.hide();
        selector.multipleFileSelectionDiv.show();

    };

    /**
     * Function to show the single file section and hide multiple file selection
     */
    selector.showSingle = function() {
        selector.singleFileSelectionDiv.show();
        selector.multipleFileSelectionDiv.hide();
    };

    /**
     * To list out the name of files that selected for IC and OCR.
     */
    selector.showFiles = function() {
        var files = selector.multiChooseFileInput[0].files;
        var list = selector.fileList[0];
        list.innerHTML = '';
        if (files != null) {
            for (var i = 0; i < files.length; i++) {
                list.innerHTML += files[i].name + '\n';
            }
        }
        if (list.innerHTML == '') {
            list.style.display = 'none';
        } else {
            list.style.display = 'block';
        }
    };
    return selector;
})();


text:
.page-user .page-content form {
  margin-bottom: 40px;
}
.page-user .page-content .list-group-item {
  padding: 25px 0;
  border-top-color: #e4eaec;
}
.page-user .page-content .list-group-item:first-child {
  border-top-color: transparent;
}
.page-user .page-content .list-group-item:last-child {
  border-bottom-color: #e4eaec;
}
.page-user .page-content .list-group-item .media-heading > small {
  margin-left: 10px;
}
.page-user .page-content .list-group-item p {
  margin-bottom: 5px;
}
.page-user .page-content .list-group-item .media-right {
  vertical-align: middle;
}
.page-user .page-content .nav-tabs-horizontal {
  position: relative;
}
.page-user .page-content .page-user-sortlist {
  position: absolute;
  right: 0;
  top: 5px;
  z-index: 2;
}
@media (max-width: 768px) {
  .page-user .page-content .page-user-sortlist {
    top: -15px;
  }
}
@media (max-width: 480px) {
  .page-user .page-content .list-group-item .media-right {
    display: block;
    margin-top: 15px;
    text-align: center;
  }
}


text:
configure :build do
  # Minify JavaScript on build
  activate :minify_javascript
  activate :asset_hash
end


text:
var media = require('rtc-media');
var quickconnect = require('../');
var test = require('tape');
var roomId = require('uuid').v4();
var localMedia;

test('can capture a local stream', function(t) {
  t.plan(1);

  localMedia = media();
  localMedia.once('capture', function(stream) {
    t.pass('captured media');
  });
});


text:
""" For a number of years the sessions table at the course level has
been empty.  This critical data is instead stored in a similarly named
table in the master database.  This migration removes this empty,
legacy table.
"""

def up(config, database, semester, course):
    database.execute('DROP TABLE IF EXISTS sessions')
    pass

def down(config, database, semester, course):
    # not necessary to restore -- has not been used in several years
    pass


text:
from django.test import TestCase

from .model_factories import ValueF, SpecificationF, LocalityF

from ..models import ValueArchive

class TestModelLocalityArchive(TestCase):
    def test_valueArchive_fields(self):
        self.assertListEqual(
            [fld.name for fld in ValueArchive._meta.fields], [
                u'id', 'changeset', 'version', 'content_type', 'object_id',
                'locality_id', 'specification_id', 'data'
            ]
        )

    def test_archiving_locality(self):
        specification = SpecificationF.create()
        locality = LocalityF.create()
        value = ValueF.create(
            specification=specification, locality=locality, data='test'
        )

        value.data = 'new data'
        value.save()

        # test save with no changes, should not trigger model archival
        value.save()

        self.assertEqual(ValueArchive.objects.count(), 2)

        self.assertListEqual(
            [val.data for val in ValueArchive.objects.all()],
            ['test', 'new data']
        )

        self.assertListEqual(
            [val.version for val in ValueArchive.objects.all()],
            [1, 2]
        )


text:
"""
Methods for calculating Mutual Information in an embarrassingly parallel way.

Author: Daniel Homola <dani.homola@gmail.com>
License: BSD 3 clause
"""

import numpy as np
from scipy.special import gamma, psi
from sklearn.neighbors import NearestNeighbors
from joblib import Parallel, delayed

def get_mi_vector(MI_FS, F, s):
    """
    Calculates the Mututal Information between each feature in F and s.

    This function is for when |S| > 1. s is the previously selected feature.
    We exploite the fact that this step is embarrassingly parallel.
    """

    MIs = Parallel(n_jobs=MI_FS.n_jobs)(delayed(_get_mi)(f, s, MI_FS)
                                        for f in F)
    return MIs

def _get_mi(f, s, MI_FS):
    n, p = MI_FS.X.shape
    if MI_FS.method in ['JMI', 'JMIM']:
        # JMI & JMIM
        joint = MI_FS.X[:, (s, f)]
        if MI_FS.categorical:
            MI = _mi_dc(joint, MI_FS.y, MI_FS.k)
        else:
            vars = (joint, MI_FS.y)
            MI = _mi_cc(vars, MI_FS.k)
    else:
        # MRMR
        vars = (MI_FS.X[:, s].reshape(n, 1), MI_FS.X[:, f].reshape(n, 1))
        MI = _mi_cc(vars, MI_FS.k)

    # MI must be non-negative
    if MI > 0:
        return MI
    else:
        return np.nan

def get_first_mi_vector(MI_FS, k):
    """
    Calculates the Mututal Information between each feature in X and y.

    This function is for when |S| = 0. We select the first feautre in S.
    """
    n, p = MI_FS.X.shape
    MIs = Parallel(n_jobs=MI_FS.n_jobs)(delayed(_get_first_mi)(i, k, MI_FS)
                                        for i in range(p))
    return MIs

def _get_first_mi(i, k, MI_FS):
    n, p = MI_FS.X.shape
    if MI_FS.categorical:
        x = MI_FS.X[:, i].reshape((n, 1))
        MI = _mi_dc(x, MI_FS.y, k)
    else:
        vars = (MI_FS.X[:, i].reshape((n, 1)), MI_FS.y)
        MI = _mi_cc(vars, k)

    # MI must be non-negative
    if MI > 0:
        return MI
    else:
        return np.nan

def _mi_dc(x, y, k):
    """
    Calculates the mututal information between a continuous vector x and a
    disrete class vector y.

    This implementation can calculate the MI between the joint distribution of
    one or more continuous variables (X[:, 1:3]) with a discrete variable (y).

    Thanks to Adam Pocock, the author of the FEAST package for the idea.

    Brian C. Ross, 2014, PLOS ONE
    Mutual Information between Discrete and Continuous Data Sets
    """

    y = y.flatten()
    n = x.shape[0]
    classes = np.unique(y)
    knn = NearestNeighbors(n_neighbors=k)
    # distance to kth in-class neighbour
    d2k = np.empty(n)
    # number of points within each point's class
    Nx = []
    for yi in y:
        Nx.append(np.sum(y == yi))

    # find the distance of the kth in-class point
    for c in classes:
        mask = np.where(y == c)[0]
        knn.fit(x[mask, :])
        d2k[mask] = knn.kneighbors()[0][:, -1]

    # find the number of points within the distance of the kth in-class point
    knn.fit(x)
    m = knn.radius_neighbors(radius=d2k, return_distance=False)
    m = [i.shape[0] for i in m]

    # calculate MI based on Equation 2 in Ross 2014
    MI = psi(n) - np.mean(psi(Nx)) + psi(k) - np.mean(psi(m))
    return MI

def _mi_cc(variables, k=1):
    """
    Returns the mutual information between any number of variables.

    Here it is used to estimate MI between continuous X(s) and y.
    Written by Gael Varoquaux:
    https://gist.github.com/GaelVaroquaux/ead9898bd3c973c40429
    """

    all_vars = np.hstack(variables)
    return (sum([_entropy(X, k=k) for X in variables]) -
            _entropy(all_vars, k=k))

def _nearest_distances(X, k=1):
    """
    Returns the distance to the kth nearest neighbor for every point in X
    """

    knn = NearestNeighbors(n_neighbors=k, metric='chebyshev')
    knn.fit(X)
    # the first nearest neighbor is itself
    d, _ = knn.kneighbors(X)
    # returns the distance to the kth nearest neighbor
    return d[:, -1]

def _entropy(X, k=1):
    """
    Returns the entropy of the X.

    Written by Gael Varoquaux:
    https://gist.github.com/GaelVaroquaux/ead9898bd3c973c40429

    Parameters
    ----------
    X : array-like, shape (n_samples, n_features)
        The data the entropy of which is computed
    k : int, optional
        number of nearest neighbors for density estimation

    References
    ----------
    Kozachenko, L. F. & Leonenko, N. N. 1987 Sample estimate of entropy
    of a random vector. Probl. Inf. Transm. 23, 95-101.
    See also: Evans, D. 2008 A computationally efficient estimator for
    mutual information, Proc. R. Soc. A 464 (2093), 1203-1215.
    and:

    Kraskov A, Stogbauer H, Grassberger P. (2004). Estimating mutual
    information. Phys Rev E 69(6 Pt 2):066138.

    F. Perez-Cruz, (2008). Estimation of Information Theoretic Measures
    for Continuous Random Variables. Advances in Neural Information
    Processing Systems 21 (NIPS). Vancouver (Canada), December.
    return d*mean(log(r))+log(volume_unit_ball)+log(n-1)-log(k)

    """

    # Distance to kth nearest neighbor
    r = _nearest_distances(X, k)
    n, d = X.shape
    volume_unit_ball = (np.pi ** (.5 * d)) / gamma(.5 * d + 1)
    return (d * np.mean(np.log(r + np.finfo(X.dtype).eps)) +
            np.log(volume_unit_ball) + psi(n) - psi(k))


text:
module HCraft.Renderer.Program.Program where

import Data.HashMap.Strict (HashMap)
import Graphics.Rendering.OpenGL

-- |Program source information
data ProgDesc
  = ProgDesc { pdName :: String
             , pdSources :: [ FilePath ]
             }
  deriving ( Eq, Ord, Show )

-- |Represents an OpenGL program
data ProgObject
  = ProgObject { poHandle   :: Program
               , poUniforms :: HashMap String UniformLocation
               , poAttribs  :: HashMap String AttribLocation
               }
  deriving ( Eq, Show)

-- |List of builtin programs
progBuiltin :: [ ProgDesc ]
progBuiltin
  = [ ProgDesc "sky" [ "shader/sky.vs"
                     , "shader/sky.fs"
                     ]
    , ProgDesc "terrain" [ "shader/terrain.vs"
                         , "shader/terrain.fs"
                         ]
    , ProgDesc "object" [ "shader/object.vs"
                        , "shader/object.fs"
                        ]
    , ProgDesc "depth" [ "shader/depth.vs"
                       , "shader/depth.fs"
                       ]
--  , ProgDesc "dof" [ "shader/dof.cs"
--                   ]
    ]

-- |Builtin attribute locations
progAttribs :: [ ( String, VariableType, AttribLocation ) ]
progAttribs
  = [ ( "in_vertex", FloatVec3, AttribLocation 0 )
    , ( "in_normal", FloatVec3, AttribLocation 1 )
    , ( "in_uv", FloatVec2, AttribLocation 2 )
    , ( "in_tangent", FloatVec3, AttribLocation 3 )
    , ( "in_bitangent", FloatVec3, AttribLocation 4 )
    , ( "in_bweight", FloatVec4, AttribLocation 5 )
    , ( "in_bname", IntVec4, AttribLocation 6 )
    ]

-- |Builtin output locations
progOutputs :: [ ( String, DrawBufferIndex ) ]
progOutputs
  = [ ( "out_color", 0 )
    , ( "out_dfr_color", 0 )
    , ( "out_dfr_normal", 1 )
    ]


text:
<?php

namespace Flower\Resource\Manager;

use Flower\Resource\Exception\RuntimeException;

use Flower\Resource\ResourceClass\ResourceInterface;
use Flower\Resource\Converter\DefaultConverter;
use Flower\Resource\Converter\PersistenceConverterInterface;
use Flower\Resource\Mapper\Mapper;
use Flower\Resource\Mapper\ResourceEntityMapperInterface;
use Flower\Resource\ResourceProviderInterface;
use Flower\Resource\ResourcePluginManagerAwareInterface;
use Flower\Resource\ResourcePluginManagerAwareTrait;

/**
 * Description of ResourceManagerByResourceMapper
 *
 * @author tomoaki
 */
class StandardManager
    implements
        BulkManagerInterface,
        ResourceEntityMapperInterface,
        ResourcePluginManagerAwareInterface{
    use CacheStorageTrait;
    use ResourcePluginManagerAwareTrait;

    /**
     *
     * @var array
     */
    protected $bulkIds = array();

    /**
     *
     * @var array
     */
    protected $objects = array();

    protected $resources = array();

    /**
     *
     * @var mixed
     */
    protected $entity;

    /**
     *
     * @var PersistenceConverterInterface
     */
    protected $converter;

    /**
     *
     * @var ResourceEntityMapperInterface
     */
    protected $mapper;

    /**
     * configオブジェクトパターンによるconfiguration
     * @param \Flower\Resource\Manager\Config $config
     */
    public function __construct(Config $config = null)
    {
        if (null !== $config) {
            $config->configure($this);
        }
    }

    public function setConverter(PersistenceConverterInterface $converter)
    {
        $this->converter = $converter;
    }

    public function getConverter()
    {
        if (!isset($this->converter)) {
            $this->converter = new DefaultConverter;
        }
        return $this->converter;
    }

    public function setMapper(ResourceEntityMapperInterface $mapper)
    {
        $this->mapper = $mapper;
    }

    public function getMapper()
    {
        if (!isset($this->mapper)) {
            $this->mapper = new Mapper;
        }
        return $this->mapper;
    }

    /**
     *
     * @param any $entity
     */
    public function setEntity($entity)
    {
        $this->entity = $entity;
    }

    /**
     *
     * @param mixed $entity
     * @return string saved resourceId
     */
    public function save($entity = null)
    {
        $resource = $this->enResource($entity);
        $this->saveResource($resource);
        return $resource->getResourceId();
    }

    public function saveResource(ResourceInterface $resource)
    {
        /**
         * @var $type string class alias of class implements ResourceInterface
         */
        $kvPair = $this->getConverter()->resourceToKvPair($resource);
        $this->getStorage()->setItems($kvPair);
        return $resource->getResourceId();
    }

    /**
     *
     * @param string $resourceId
     * @param boolean $refresh
     * @return ResourceInterface
     */
    public function get($resourceId, $refresh = false)
    {
        $storage = $this->getStorage();
        if (!$refresh && isset($this->resources[$resourceId])) {
            return $this->resources[$resourceId];
        }
        $keys = $this->getConverter()->resourceIdToKvKeys($resourceId);
        $kvPairs = $storage->getItems($keys);
        $resources = $this->getConverter()->kvPairsToResources($kvPairs);
        //キャッシュにヒットしなければflyweightしない。
        $resource = array_shift($resources);
        if ($resource instanceof ResourceInterface) {
            $this->resources[$resourceId] = $resource;
        }
        return $resource;
    }

    protected function enResource($entity = null)
    {
        if (null === $entity) {
            if (isset($this->entity)) {
                $entity = $this->entity;
            } else {
                throw new RuntimeException('not specified resource nor an entity');
            }
        }

        if ($entity instanceof ResourceProviderInterface) {
            return  $entity->getResource();
        }

        if ($entity instanceof ResourceInterface) {
            return $entity;
        }

        return $this->getMapper()->entityToResource($entity);
    }

    public function addBulkIds(array $resourceIds)
    {
        if (!isset($this->bulkIds)) {
            $this->bulkIds = array();
        }
        $this->setBulkIds(array_merge($this->bulkIds, $resourceIds));
        return $this;
    }

    /**
     *
     * @param type $refresh
     * @return array Associative array of keys and values
     */
    public function bulkGet($refresh = false) {
        if (!isset($this->bulkIds)) {
            return array();
        }
        return $this->getResources($this->bulkIds, $refresh);
    }

    public function getResources(array $resourceIds, $refresh = false)
    {
        $storage = $this->getStorage();
        $objects = $this->resources;
        if ($refresh) {
            $this->resources = array();
            $ids = $resourceIds;
        } else {
            $newIdsCond = function ($v) use ($objects) {
                return is_string($v) && !array_key_exists($v, $objects);
            };
            $ids = array_filter((array) $resourceIds, $newIdsCond );
        }
        $keys = array();
        foreach ($ids as $resourceId) {
            $keys = array_merge($keys, array_values($this->getConverter()->resourceIdToKvKeys($resourceId)));
        }
        $kvPairs = $storage->getItems($keys);
        $newResources = $this->getConverter()->kvPairsToResources($kvPairs);
        foreach ($newResources as $newResource) {
            $this->resources[$newResource->getResourceId()] = $newResource;
        }
        $compares = array_flip($resourceIds);
        return array_intersect_key($this->resources, $compares);
    }

    public function setBulkIds(array $bulkIds)
    {
        //文字列以外のときはWarningを吐いた上で、排除してくれる。
        //重複を排除してくれる。
        //@notice キー名がキー長以下になっていないとFileSystemには格納できない
        $this->bulkIds = array_flip(array_flip($bulkIds));
    }

    public function saveMulti(array $dataArray)
    {
        $kvs = array();
        $targets = array();
        foreach ($dataArray as $val) {
            $resource = $this->enResource($val);
            if ($resource instanceof ResourceInterface) {
                $targets[] = $resource->getResourceId();
                $kvs = $kvs + $this->getConverter()->resourceToKvPair($resource);
            }
        }
        $this->getStorage()->setItems($kvs);
        return $targets;
    }

    /**
     *
     * @param type $callback
     * @param type $entityClass
     * @param type $priority
     * @return \Flower\Resource\Manager\StandardManager
     */
    public function addStrategy($callback, $entityClass, $priority = 0)
    {
        $this->getMapper()->addStrategy($callback, $entityClass, $priority);
        return $this;
    }

    /**
     *
     * @param type $entity
     * @return type
     */
    public function entityToResource($entity)
    {
        return $this->getMapper()->entityToResource($entity);
    }

    /**
     *
     * @param array $strategies
     * @param type $refresh
     * @return type
     */
    public function setStrategies(array $strategies, $refresh = true)
    {
        return $this->getMapper()->setStrategies($strategies, $refresh);
    }

}


text:
body {
    font-family: "Microsoft YaHei";
}

html a:hover {
    text-decoration: none;
}

body .group-container button:focus {
    outline: none;
}

body a:focus {
    text-decoration: none;
}

ul li {
    list-style: none;
}

span:focus {
    outline: 0px;
}

body .has-error .form-control {
    border-color: #a94442 !important;
    -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
}

.x-table-container tbody td .autocut {
    width: inherit;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    -o-text-overflow: ellipsis;
    -icab-text-overflow: ellipsis;
    -khtml-text-overflow: ellipsis;
    -moz-text-overflow: ellipsis;
    -webkit-text-overflow: ellipsis;
    word-break: normal;
    word-wrap: normal;
    cursor: pointer;
}

.sub-add {
    float: right;
}

.select2-container--default .select2-selection--single {
    border-radius: 0px;
    border: 1px solid #ccc;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: #10a1bb;
}

.select2-dropdown {
    border-radius: 0px;
    z-index: 2100;
}

/*nav*/

.group-top {
    height: 60px;
    line-height: 60px;
    background: #2f333e;
}

.group-top .navbar-brand {
    color: #9d9d9d;
    margin-left: 15px;
    float: left;
    height: 60px;
    padding: 15px 15px;
    font-size: 18px;
    line-height: 30px;
}

.group-top .navbar-brand:hover {
    color: #fff;
    background-color: transparent;
}

.group-top .navbar-right {
    margin-right: 39px;
}

.group-top .navbar-right span {
    color: #fff;
    margin-right: 10px;
}

.group-top-userbox {
    position: relative;
}

.group-top-user {
    display: -webkit-inline-box;
    display: inline-block;
}

.group-user-dropdown {
    z-index: 999;
    margin-left: -10px;
    background-color: #FFF;
    box-shadow: 0 0 5px rgba(0, 0, 0, .2);
    border-top: 3px solid #10a1bb;
    width: 120px;
    position: absolute;
    right: -20px;
}

.group-user-dropdown li a {
    padding: 0px;
    height: 38px;
    line-height: 38px;
    text-align: center;
    display: block;
}

.group-user-dropdown li a:hover {
    text-decoration: none;
    background-color: #eee;
}

.group-user-dropdown ul {
    position: relative;
    padding: 0px;
}

.group-user-dropdown i.group-user-dropdownIcon {
    position: absolute;
    top: -69px;
    left: 50px;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #10a1bb;
}

/*main*/

.group-container {
    margin-top: 60px;
}

.main {
    padding-left: 0px;
}

.group-container .sidebar {
    position: fixed;
    top: 60px;
    bottom: 0;
    left: 0;
    z-index: 1000;
    display: block;
    overflow-x: hidden;
    overflow-y: auto;
    background-color: #f5f5f5;
    border-right: 1px solid #eee;
    z-index: 99;
}

.group-nav-sidebar {
    margin: 0px -21px 20px -21px;
}

.group-nav-sidebar li {
    border-bottom: 1px solid #fff;
}

.group-nav-sidebar li a {
    color: #2f333e;
    padding: 13px 25px;
    display: block;
}

.group-nav-sidebar li a .iconfont {
    font-size: 17px;
    margin-right: 7px;
    vertical-align: middle;
}

.group-nav-sidebar li a:hover {
    color: #23527c;
}

.group-nav-sidebar li a.active {
    color: #fff;
    background-color: #10a1bb;
}

.group-subMenu {
    background: #fff;
}

.group-subMenu li {
    border-bottom: 1px solid #eee;
}

.group-subMenu li.active a {
    background-color: #eee;
    color: #23527c;
}

.group-subMenu li a {
    color: #000;
    padding-left: 45px;
}

.group-nav-more {
    float: right;
    font-size: 22px;
    font-weight: normal;
    font-family: "Microsoft YaHei";
    line-height: 12px;
}

.group-icon-caidan {
    font-size: 18px;
    vertical-align: middle;
}

.group-icon-yuanquan {
    margin-right: 6px;
    font-size: 14px;
}

.group-article-top {
    margin: 0px;
    border-bottom: 1px solid #eee;
    background: #FAFBF9;
    padding: 0px 15px;
    font-size: 18px;
    color: #2f333e;
    top: 60px;
    z-index: 99;
}

.group-article-top h3 {
    margin: 0px;
    height: 47px;
    line-height: 47px;
    padding: 0px;
    font-size: 18px;
    float: left;
}

.group-operation-btn {
    margin-right: 22px;
}

.btn-primary,
.btn-danger {
    padding: 3px 16px;
    border: 0px;
    border-radius: 0px;
    font-size: 14px;
    font-weight: normal;
    text-shadow: none;
}

.group-operation-btn {
    margin-top: 14px;
}

.btn-primary {
    color: #fff;
    background: #10a1bb;
    border-radius: 2px;
}

.btn-danger {
    color: #fff;
    background: #d9534f;
    border-radius: 2px;
}

.btn-danger:hover {
    background: #f16e6a;
}

.btn-danger:focus {
    background: #f16e6a;
}

.group-operation-btn .group-article-top h3 span {
    font-size: 16px;
}

.group-article-top .group-icon-207 {
    font-size: 26px;
    vertical-align: middle;
}

.group-article-addButton {
    background: #10a1bb;
    color: #fff;
    border-radius: 2px;
    border: none;
    font-size: 12px;
    padding: 5px 10px 5px 7px;
    margin-right: 21px;
}

.group-article-addButton:hover,
.btn-primary:hover {
    background: #1dc6e4;
    color: #fff;
    text-decoration: none;
}

.group-article-addButton:focus,
.group-article-table .group-article-form-btn:focus,
.btn-primary:focus {
    background: #1dc6e4;
    color: #fff;
    text-decoration: none;
}

.group-article-addButton .group-nav-more {
    float: left;
    margin-right: 4px;
}

/*group-article-table*/

.group-article-table {
    padding: 15px 20px;
    margin-top: 55px;
}

.group-article-table .table th,
.group-users-table .table th {
    border-bottom: 0px;
}

.group-article-table .table th,
.group-article-table .table td {
    text-align: center;
    padding: 6px 2px;
}

.group-article-table .group-articleform-top {
    margin-bottom: 10px;
}

.group-article-table .group-article-form {
    margin-left: 0px;
    margin-right: 20px;
}

.group-article-table .group-article-form label {
    vertical-align: initial;
    display: inline-block;
    padding: 0px;
    font-weight: normal;
    font-size: 14px;
}

.group-article-form input {
    vertical-align: initial;
}

.group-article-form .form-control,
.group-users-form .form-control {
    border-radius: 0px;
    height: 28px;
    line-height: 28px;
    width: 210px;
}

.group-article-form select {
    width: 120px;
    height: 28px;
    border: 1px solid #ccc;
}

.group-article-table .group-article-form-btn {
    background: #10a1bb;
    color: #fff;
    border-radius: 2px;
    border: none;
    font-size: 14px;
    padding: 4px 20px;
    margin-left: 15px;
}

.group-article-table .group-article-form-btn:hover {
    background: #1dc6e4;
}

.group-article-tabelTools a,
.group-site-tabelTools a {
    cursor: pointer;
    border: 1px solid #10a1bb;
    margin: 0px 3px;
    color: #10a1bb;
    font-size: 14px;
    padding: 2px 4px;
}

.group-article-tabelTools a:hover {
    color: #bfbfbe;
    border: 1px solid #bfbfbe;
}

.group-container table td,
.group-container table th {
    text-align: center;
    padding: 11px 0px;
}

.group-article .group-article-table table th {
    cursor: pointer;
}

.group-article-table .group-icon-sort {
    font-size: 13px;
    margin-left: 4px;
}

.group-article .group-article-table .group-article-checkbox {
    width: 3%;
}

.group-article-width5 {
    width: 9%;
}

.site-Keyword {
    width: 200px;
}

/*栏目group-Columns*/

.group-info-select .select2-choice {
    border-radius: 0px;
    border: 0px;
}

.group-Columns-list .ztree {
    margin: 0px;
    background: #fff;
    width: 208px;
    border: 0px;
    overflow: hidden;
}

.group-Columns-list .ztree li a {
    padding: 0px;
    display: inline;
}

.group-Columns {
    position: relative;
    margin-top: 45px;
}

.group-Columns .group-Columns-list {
    width: 210px;
    border: 1px solid #eee;
    position: absolute;
    top: 20px;
    left: 12px;
}

.group-Columns .group-Columns-list h3 {
    font-size: 16px;
    margin: 0px;
    height: 40px;
    line-height: 40px;
    background: #10a1bb;
    color: #fff;
    text-align: center;
    border-bottom: 1px solid #f6f6f6;
}

.group-Columns .group-Columns-ul {
    box-shadow: none;
    margin: 0px;
}

.group-Columns .group-Columns-ul li {
    border: 0px;
    background: #f6f6f6;
    text-align: center;
    border-radius: 0px;
}

.group-Columns .group-Columns-ul li a {
    color: #10a1bb;
}

.group-Columns .group-Columns-ul .group-Columns-Active {
    background: #fff;
    border-left: 2px solid #23b7d2;
}

.group-Columns .group-Columns-ul .group-Columns-Active a {
    color: #10a1bb;
}

.group-Columns .group-Columns-ul li a:hover {
    text-decoration: none;
}

/*栏目详细信息*/

.group-Columns-information {
    margin-left: 260px;
    padding-top: 8px;
}

.column-select {
    position: relative;
}

.select2-column-clear {
    position: absolute;
    right: 9px;
    top: 4px;
    cursor: pointer;
}

/*information-top*/

.group-Columns-information .information-top {
    margin: 0px;
    font-size: 16px;
    line-height: 50px;
    border-bottom: 2px solid #f6f6f6;
}

.group-Columns-information .information-top span {
    border-bottom: 2px solid #10a1bb;
    padding: 15px;
}

/*group-information-form*/

.group-Columns-information .group-information-form {
    margin-top: 40px;
}

.group-information-form label {
    width: 100px;
    text-align: right;
    padding: 0px;
    font-weight: normal;
    margin-right: 11px;
}

.group-information-form .group-information-input input {
    border-radius: 0px;
    border: 1px solid #b6b6b6;
}

.group-information-form .group-information-input {
    width: 300px;
    padding: 0px;
}

.group-information-form .group-information-Parent {
    width: 160px;
}

.group-information-form .group-information-Parent input {
    width: 160px;
    height: 32px;
}

.group-information-form .group-info-ParentButton {
    padding: 0px;
    background: #e0e0e0;
    width: 124px;
    height: 32px;
    border: none;
    margin-left: 16px;
    color: #2f333e;
    font-size: 12px;
}

.group-information-form .group-info-select {
    display: inline-block;
    width: 300px;
    border-radius: 0px;
    border: 1px solid #b6b6b6;
    height: 35px;
    line-height: 35px;
    font-size: 12px;
}

.group-info-select .select2-choice {
    width: 298px;
    margin: 0px;
    border-radius: 0px;
}

.group-information-form .group-information-Sort {
    width: 95px;
}

.group-information-form .group-Columns-button button {
    width: 90px;
    height: 32px;
    color: #fff;
    border-radius: 0px;
    border: 0px;
}

.group-information-form .group-Columns-button .group-Columns-save {
    margin-left: 111px;
    background: #13abc6;
}

.group-information-form .group-Columns-button .group-Columns-dele {
    margin-left: 15px;
    background: #e0e0e0;
    color: #2f333e;
}

/*用户管理*/

.group-users-form {
    padding: 15px 20px;
}

.group-users-table .group-users-form label {
    padding: 0px;
}

.group-users-table {
    padding: 15px 20px;
    margin-top: 45px;
}

.group-users-table .group-users-form-btn {
    background: #10a1bb;
    color: #fff;
    border-radius: 2px;
    border: none;
    font-size: 14px;
    padding: 5px 20px;
    margin-left: 24px;
}

.users-autocut {
    width: inherit;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    -o-text-overflow: ellipsis;
    -icab-text-overflow: ellipsis;
    -khtml-text-overflow: ellipsis;
    -moz-text-overflow: ellipsis;
    -webkit-text-overflow: ellipsis;
    word-break: normal;
    word-wrap: normal;
    padding: 0px 8px;
}

.users-width {
    width: 200px;
    text-align: left !important;
}

.btn_add_user {
    float: right;
    margin-top: 8px;
}

/*站点group-site-table*/

.group-site-table {
    padding: 15px 20px;
    margin-top: 55px;
}

.group-site-table table {
    border: none;
}

.group-site-table .form-horizontal {
    height: 35px;
    background: #10a1bb;
    padding: 0px 15px;
    line-height: 35px;
}

.group-site-table .group-site-tableTitle {
    font-size: 14px;
    color: #fff;
}

.group-site-table .group-site-control {
    height: 23px;
    border: 0px;
    border-radius: 0px;
}

.group-container .group-site-table table th,
.group-container .group-site-table table td {
    text-align: center;
    border: none;
    padding: 11px 0px;
}

.group-site-table .table-striped>tbody>tr:nth-of-type(odd),
.table-striped>tbody>tr:nth-of-type(odd) {
    background-color: #ebf9fb;
}

.group-site-table .group-site-tabelTools .tabelTools-edit,
.group-site-table .group-site-tabelTools a:hover {
    color: #10a1bb;
}

.group-site-table .group-site-tabelTools .tabelTools-edit:hover {
    color: #018af7;
}

.group-site-pagination {
    text-align: center;
}

.group-site-pagination .pagination {
    margin: 0 auto;
    height: 34px;
    line-height: 26px;
    float: right;
}

.group-site-pagination .pagination li span,
.group-site-pagination .pagination li a {
    border-radius: 0px;
    margin: 0px 1px;
    padding: 2px 12px;
}

.group-site-pagination .pagination-active a {
    background: #10a1bb;
    color: #fff;
    border-color: #ddd;
}

.group-site-pagination .pagination li span.pagination-Ellipsis {
    border: 0px;
    padding: 0px;
}

.group-site-pagination .pagination li span.pagination-Ellipsis:hover {
    background: 0px;
}

.group-site-pagination .pagination-left {
    float: left;
    text-align: left;
    margin-left: 24px;
}

.group-site-pagination .pagination-left span,
.group-site-pagination .pagination-last span {
    border: none;
    color: #10a1bb;
    float: none;
    margin: 0px;
    padding: 0px;
}

.group-site-pagination .pagination-last {
    margin: 0px 15px;
    color: #333;
}

.group-site-pagination .pagination li.pagination-last span {
    margin: 0px;
    padding: 0px;
    color: #333;
}

.group-site-pagination .pagination-last input {
    float: none;
    width: 40px;
    height: 20px;
    padding: 0px 7px;
    margin: 0px 8px;
    border: 1px solid #ddd;
}

.group-pagination-btn {
    border-radius: 2px;
    border: none;
    font-size: 14px;
    padding: 1px 12px;
    margin-right: 12px;
    margin-left: 11px;
    color: #171717;
}

.group-pagination-btn:hover {
    background: #10a1bb;
    color: #fff;
    text-decoration: none;
}

.pagination-left .select2-container .select2-choice {
    width: 68px;
    height: 20px;
    line-height: 20px;
}

@media screen and (min-width: 768px) {
    .group-article-top {
        width: 75%;
    }
    .group-article-top {
        left: 25%;
    }
}

@media screen and (min-width: 992px) {
    .group-article-top {
        width: 83.333%;
    }
    .group-article-top {
        left: 16.66666667%;
    }
}

/*选项 option*/

.group-article-top .navbar-brand .breadcrumb {
    padding: 0px;
    margin: 0px;
    background: #FAFBF9;
    display: inline-block;
}

.group-article-top .breadcrumb li a {
    color: #000;
    font-size: 18px;
}

.group-article-top .breadcrumb li a:hover {
    color: #10a1bb;
}

.group-optionForm-container .group-information-form {
    margin-top: 30px;
}

.group-information-input textarea {
    resize: none;
    padding: 6px 12px;
    font-size: 14px;
    color: #555;
    width: 100%;
    border: 1px solid #b6b6b6;
    border-radius: 0px;
}

.group-optionForm-container .group-info-select {
    margin-left: 15px;
}

.group-setting-container {
    margin: 8px 0px 0px 33px;
}

/*已发布的文章 posts-publish*/

.group-postspublish-table {
    margin-top: 20px;
}

.group-postspublish-table .form-horizontal {
    margin-bottom: 10px;
}

.group-postspublish-table form .group-article-form {
    margin-left: 0px;
    margin-right: 20px;
}

.group-postspublish-table form label {
    vertical-align: initial!important;
    display: inline-block;
    padding: 0px;
    font-weight: normal;
    font-size: 14px;
}

.group-postpublish-table {
    margin-left: 260px;
}

.group-postpublish-table form {
    padding-top: 5px;
}

.breadcrumb {
    padding: 0px;
    margin: 0px;
}

.group-article .group-article-top .breadcrumb li {
    font-size: 18px;
}

/*分页 x-paging*/

.x-paging .x-paging-pagination-left {
    float: left;
}

.x-paging .x-paging-right {
    float: right;
}

.x-paging-right ul {
    clear: both;
    float: left;
    margin-right: 10px;
}

.x-paging-right ul li {
    float: left;
}

.x-paging-right ul li a,
.x-paging-right ul li span {
    position: relative;
    border: 1px solid #ddd;
    background-color: #fff;
    color: #337ab7;
    text-decoration: none;
    line-height: 1.42857143;
}

.x-paging-right ul li a {
    margin: 0px 1px;
    padding: 2px 12px;
    border-radius: 0px;
}

.x-paging-right ul li span.pagination-Ellipsis {
    border: none;
    margin: 0px 5px;
}

.x-paging-right li.x-paging-active a,
.x-paging-right li a:hover {
    background: #337ab7;
    color: #fff;
}

.pagination-last {
    float: left;
}

/*添加新文章*/

.group-addNews {
    position: relative;
}

.group-addNews-right {
    position: absolute;
    right: 22px;
    top: 0px;
}

.group-addNews-left {
    margin-right: 300px;
}

.addNews-title-input input {
    border-radius: 0px;
}

.addNews-Columns {
    margin-top: 70px;
    padding: 0px 50px;
}

.addNews-title-input {
    padding: 0px;
}

.addNews-title label {
    width: initial;
}

.addNews-title-editor {
    padding-left: 0px;
    padding-right: 0px;
}

.form-horizontal .addNews-title label {
    font-size: 16px;
    font-weight: normal;
    padding-right: 10px;
    padding-top: 5px;
}

.group-addNews-right {
    width: 300px;
}

.group-addNews-right .addNews-right-top {
    font-size: 16px;
    margin: 0px;
    height: 36px;
    line-height: 36px;
    background: rgba(234, 234, 234, 0.41);
    color: #10a1bb;
    border-bottom: 1px solid #ccc;
    padding-left: 23px;
}

.addNews-tools {
    margin-bottom: 15px;
    border: 1px solid #ccc;
}

.addNews-tools .form-group {
    margin: 20px 22px 15px 22px;
}

.group-addNews-form label {
    font-size: 14px;
    font-weight: normal;
    font-size: 16px;
    font-weight: normal;
    color: #161616;
}

.addNews-summary label {
    font-size: 14px;
    font-weight: normal;
    padding: 0px;
    float: left;
}

.addNews-title-summary {
    padding: 0px;
    width: 210px;
    float: left;
}

.addNews-title-summary textarea {
    resize: none;
    border-radius: 0px;
}

.addNews-gformbox input {
    margin-right: 3px;
}

.addNews-gformbox label,
.addNews-gformbox input {
    float: none;
    width: initial;
    padding: 0px;
    vertical-align: text-top;
    font-size: 14px;
    font-weight: normal;
}

.addNews-gformbox label {
    margin: 0px 5px;
}

.addNwes-choice {
    border: 1px solid #10a1bb;
    padding: 2px 12px;
    border-radius: 2px;
    font-size: 12px;
    color: #10a1bb;
}

.addNwes-choice:hover {
    background: #337ab7;
    color: #fff;
}

/* 添加新文章 >> 选择栏目 Dialog*/

.choice-dialog .ztree {
    width: 400px;
    background: none;
    border: 1px solid #ccc;
    margin: 0px;
    padding: 15px 17px;
}

/*添加站点*/

.addForm-label {
    width: 23%;
    text-align: right;
    display: inline-block;
}

.addForm-label em {
    color: #f00;
}

.addForm-input input {
    width: 75%;
    border-radius: 0px;
    height: 28px;
    line-height: 28px;
    display: inline-block;
}

.addForm-input {
    margin-bottom: 15px;
}

.addForm-input textarea {
    resize: none;
    height: 50px;
    width: 75%;
    display: inline-block;
    vertical-align: -webkit-baseline-middle;
    border-radius: 0px;
}

.addForm-input .select2-container--default .select2-selection--single {
    border-radius: 0px;
}

.addForm-input .select2-container {
    width: 150px;
}

.addForm-input .select2-container--default .select2-selection--single {
    border: 1px solid #ccc;
}

/*暂无数据*/

.no-data {
    padding: 50px 0px;
    color: #a2a2a2;
}

.no-data i {
    font-size: 60px;
}

.no-data p {
    margin-left: 10px;
}

.form-horizontal .table-striped tbody tr.no-data-tr {
    background: none;
}

.form-horizontal .table-striped tbody tr.no-data-tr:hover {
    background: #fff !important;
}

/*选择站点*/

.select-site {
    position: absolute;
    bottom: 0px;
    left: 0px;
    width: 100%;
}

.select-site h2 {
    font-size: 14px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    background: #10a1bb;
    color: #fff;
    cursor: pointer;
}

.select-site h2:hover {
    background: #1395ad;
}

.select-site h2 i {
    margin-right: 10px;
}

.select-sitelist {
    position: absolute;
    left: 0px;
    bottom: 40px;
    width: 100%;
    padding: 0px;
    text-align: center;
    max-height: 280px;
    overflow-x: hidden;
}

.select-sitelist li a {
    color: #2f333e;
    font-size: 14px;
    background: #e0e0e0;
    border-bottom: 1px solid #f5f5f5;
    max-height: 40px;
    line-height: 40px;
    display: block;
    width: inherit;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    word-break: normal;
    word-wrap: normal;
}

.select-sitelist li a.active,
.select-sitelist li a:hover {
    text-decoration: underline;
}

/*栏目管理*/

.users-name {
    font-size: 16px;
    color: #10a1bb;
    padding-left: 10px;
}

/*修改密码*/

.password-form label {
    width: 120px;
    text-align: right;
    padding: 0px;
    font-weight: normal;
    margin-right: 11px;
}

.password-input {
    width: 200px;
}

.password-input input {
    border-radius: 0px;
    border: 1px solid #b6b6b6;
}


text:
using System.Collections.Generic;

namespace AsmResolver.PE.Relocations
{
    /// <summary>
    /// Pairs a segment with relocation information.
    /// </summary>
    public readonly struct RelocatableSegment
    {
        /// <summary>
        /// Creates a new pairing between a segment and relocation information.
        /// </summary>
        /// <param name="segment">The segment.</param>
        /// <param name="relocations">The relocation information.</param>
        public RelocatableSegment(ISegment segment, IReadOnlyList<BaseRelocation> relocations)
        {
            Segment = segment;
            Relocations = relocations;
        }

        /// <summary>
        /// Gets the segment that is relocatable.
        /// </summary>
        public ISegment Segment
        {
            get;
        }

        /// <summary>
        /// Gets the relocation information required to relocate the segment.
        /// </summary>
        public IReadOnlyList<BaseRelocation> Relocations
        {
            get;
        }
    }
}


text:
<!doctype html>

    <meta charset="utf-8">
    <title>Mock Ajax Testing Environment</title>
    <link rel="stylesheet" media="screen" href="css/qunit-1.15.0.css">

        <input type="button" id="btnRunTests" value="Run Tests"/>

        <input type="button" id="btnGetFortune" value="Get Fortune"/>

QUnit Test Suite


text:
/*
 * EntityToString.java criado em 09/09/2012
 *
 * Propriedade de Objectos Fábrica de Software LTDA.
 * Reprodução parcial ou total proibida.
 */
package br.com.objectos.comuns.io;

import java.text.DecimalFormat;
import java.text.NumberFormat;

import com.google.common.base.Function;
import com.google.common.base.MoreObjects;

/**
 * @author marcio.endo@objectos.com.br (Marcio Endo)
 */
public class EntityToString implements Function<Entity, String> {

  private static final NumberFormat fmt = DecimalFormat.getNumberInstance();

  @Override
  public String apply(Entity input) {
    return MoreObjects.toStringHelper(input)
        .addValue(input.booleanValue())
        .addValue(input.booleanoValue())
        .addValue(fmt.format(input.doubleValue()))
        .addValue(input.estadoValue())
        .addValue(input.integerValue())
        .addValue(input.localDate())
        .addValue(input.longValue())
        .addValue(input.stringValue())
        .toString();
  }

}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SOURCE.Domaine;
using SOURCE.Domaine.Results;
using SOURCE.Domaine.Criterias;

namespace SOURCE.Business.Depots
{
    [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.StyleCop.CSharp.DocumentationRules", "SA1600:ElementsMustBeDocumented", Justification = "Definition du modèle de données (beaucoups de tables)")]
    public partial interface IDepotGeneric
    {
        IEnumerable<ComboResultDto> GetCombo(string comboName, long? vueID, long utilisateurID, long? idFonctionnel, long? langueID);
        IEnumerable<AutoCompleteResultDto> GetAutoComplete(string comboName, long? vueID, long utilisateurID, long? idFonctionnel, long? langueID, string searchTerm);
        IEnumerable<ActionResultDto> GetActions(long vueID, long idFonctionnel, long utilisateurID, long actionModeAffichageID, long LangueID);
        IEnumerable<NavBarItemResultDto> GetNavBarItems(long utilisateurID);
        long GetTimeStamp(long utilisateurID, long vueID, long idFonctionnel);
        IEnumerable<DbErrorMsg> CheckValidationBefore(long utilisateurID, long vueID, long idFonctionnel, long langueID, long timeStamp);
        IEnumerable<DbErrorMsg> CheckValidationAfter(long utilisateurID, long vueID, long idFonctionnel, long langueID);
        IEnumerable<DbErrorMsg> DeleteGeneric(long utilisateurID, string tableName, long idFonctionnel);
        IEnumerable<VueResultDto> GetVues(long groupeVueID, long? idFonctionnel, long utilisateurID, long modeAffichageID, long langueID, long? vueID = null);
        GroupeVueResultDto GetGroupeVue(long utilisateurID, long groupeVueID, long? idFonctionnel, long langueID, string tableName);
        IEnumerable<GroupeVueResultDto> GetGroupeVues(long utilisateurID, long? idFonctionnel, string codePage, long langueID);
        IEnumerable<ReportParameterResult> GetReportParameters(long idEdition, long idVue, long idFonctionnel, long utilisateurID);
        void LoginComplete(long utilisateurID);
    }
}


text:
"""
Some correct syntax for variable annotation here.
More examples are in test_grammar and test_parser.
"""

from typing import no_type_check, ClassVar

i: int = 1
j: int
x: float = i/10

def f():
    class C: ...
    return C()

f().new_attr: object = object()

class C:
    def __init__(self, x: int) -> None:
        self.x = x

c = C(5)
c.new_attr: int = 10

__annotations__ = {}

@no_type_check
class NTC:
    def meth(self, param: complex) -> None:
        ...

class CV:
    var: ClassVar['CV']

CV.var = CV()


text:
@implementation MTMsgsStateInfoMessage

- (instancetype)initWithRequestMessageId:(int64_t)requestMessageId info:(NSData *)info
{
    self = [super init];
    if (self != nil)
    {
        _requestMessageId = requestMessageId;
        _info = info;
    }
    return self;
}

@end


text:
<?xml version="1.0" encoding="UTF-8"?>
<GeocodeResponse>
 <status>OK</status>
 <result>
  <type>airport</type>
  <type>establishment</type>
  <type>point_of_interest</type>
  <formatted_address>East Midlands Airport, Castle Donington, Derby DE74 2SA, UK</formatted_address>
  <address_component>
   <long_name>East Midlands Airport</long_name>
   <short_name>East Midlands Airport</short_name>
   <type>airport</type>
   <type>establishment</type>
   <type>point_of_interest</type>
  </address_component>
  <address_component>
   <long_name>Castle Donington</long_name>
   <short_name>Castle Donington</short_name>
   <type>locality</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>Derby</long_name>
   <short_name>Derby</short_name>
   <type>postal_town</type>
  </address_component>
  <address_component>
   <long_name>Leicestershire</long_name>
   <short_name>Leicestershire</short_name>
   <type>administrative_area_level_2</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>England</long_name>
   <short_name>England</short_name>
   <type>administrative_area_level_1</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>United Kingdom</long_name>
   <short_name>GB</short_name>
   <type>country</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>DE74 2SA</long_name>
   <short_name>DE74 2SA</short_name>
   <type>postal_code</type>
  </address_component>
  <geometry>
   <location>
    <lat>52.8293740</lat>
    <lng>-1.3321340</lng>
   </location>
   <location_type>APPROXIMATE</location_type>
   <viewport>
    <southwest>
     <lat>52.8280250</lat>
     <lng>-1.3334830</lng>
    </southwest>
    <northeast>
     <lat>52.8307230</lat>
     <lng>-1.3307850</lng>
    </northeast>
   </viewport>
  </geometry>
  <place_id>ChIJUw57-LLleUgRhd_jTMtyKQM</place_id>
 </result>
</GeocodeResponse>


text:
typedef void (*ontime_callback) (void *mod_name, time_t time);
EVENT_LIST_PROTO(ontime, ontime_callback);
extern event_list_ontime_t el_ontime;

void time_init(void);