text:
<?php
namespace Aws\ServiceDiscovery;

use Aws\AwsClient;

/**
 * This client is used to interact with the **Amazon Route 53 Auto Naming** service.
 * @method \Aws\Result createPrivateDnsNamespace(array $args = [])
 * @method \GuzzleHttp\Promise\Promise createPrivateDnsNamespaceAsync(array $args = [])
 * @method \Aws\Result createPublicDnsNamespace(array $args = [])
 * @method \GuzzleHttp\Promise\Promise createPublicDnsNamespaceAsync(array $args = [])
 * @method \Aws\Result createService(array $args = [])
 * @method \GuzzleHttp\Promise\Promise createServiceAsync(array $args = [])
 * @method \Aws\Result deleteNamespace(array $args = [])
 * @method \GuzzleHttp\Promise\Promise deleteNamespaceAsync(array $args = [])
 * @method \Aws\Result deleteService(array $args = [])
 * @method \GuzzleHttp\Promise\Promise deleteServiceAsync(array $args = [])
 * @method \Aws\Result deregisterInstance(array $args = [])
 * @method \GuzzleHttp\Promise\Promise deregisterInstanceAsync(array $args = [])
 * @method \Aws\Result getInstance(array $args = [])
 * @method \GuzzleHttp\Promise\Promise getInstanceAsync(array $args = [])
 * @method \Aws\Result getInstancesHealthStatus(array $args = [])
 * @method \GuzzleHttp\Promise\Promise getInstancesHealthStatusAsync(array $args = [])
 * @method \Aws\Result getNamespace(array $args = [])
 * @method \GuzzleHttp\Promise\Promise getNamespaceAsync(array $args = [])
 * @method \Aws\Result getOperation(array $args = [])
 * @method \GuzzleHttp\Promise\Promise getOperationAsync(array $args = [])
 * @method \Aws\Result getService(array $args = [])
 * @method \GuzzleHttp\Promise\Promise getServiceAsync(array $args = [])
 * @method \Aws\Result listInstances(array $args = [])
 * @method \GuzzleHttp\Promise\Promise listInstancesAsync(array $args = [])
 * @method \Aws\Result listNamespaces(array $args = [])
 * @method \GuzzleHttp\Promise\Promise listNamespacesAsync(array $args = [])
 * @method \Aws\Result listOperations(array $args = [])
 * @method \GuzzleHttp\Promise\Promise listOperationsAsync(array $args = [])
 * @method \Aws\Result listServices(array $args = [])
 * @method \GuzzleHttp\Promise\Promise listServicesAsync(array $args = [])
 * @method \Aws\Result registerInstance(array $args = [])
 * @method \GuzzleHttp\Promise\Promise registerInstanceAsync(array $args = [])
 * @method \Aws\Result updateService(array $args = [])
 * @method \GuzzleHttp\Promise\Promise updateServiceAsync(array $args = [])
 */
class ServiceDiscoveryClient extends AwsClient {}


text:
import { Model, attr } from 'ember-model';

export default Model.extend({
  id: attr(),
  name: attr()
}).reopenClass({
  url: "/api/v1/users"
});

redpajama_set_name: RedPajamaGithub


text:
package org.auraframework.util.json;

import java.io.IOException;

import org.auraframework.util.json.Json.Serialization.ReferenceType;
import org.auraframework.util.json.Json.Serialization.ReferenceScope;

/**
 * serialize some thing
 */
public interface JsonSerializer<T> {

    /**
     * serialize the thing
     */
    void serialize(Json json, T value) throws IOException;

    /**
     * Get the reference type for the value's Class. Defaults to NONE
     */
    ReferenceType getReferenceType(T value);

    /**
     * Get the reference type for the value's Class. Defaults to NONE
     */
    ReferenceScope getReferenceScope(T value);

    public static abstract class IdentitySerializer<T> implements JsonSerializer<T> {
        @Override
        public final ReferenceType getReferenceType(T value) {
            return ReferenceType.IDENTITY;
        }

        @Override
        public final ReferenceScope getReferenceScope(T value) {
            return ReferenceScope.ACTION;
        }
    }

    public static abstract class NoneSerializer<T> implements JsonSerializer<T> {
        @Override
        public final ReferenceType getReferenceType(T value) {
            return ReferenceType.NONE;
        }

        @Override
        public final ReferenceScope getReferenceScope(T value) {
            return ReferenceScope.ACTION;
        }
    }

}


text:
package io.aeron.driver;

import io.aeron.driver.media.UdpChannel;

/**
 * Supplier of {@link MaxMulticastFlowControl} strategy implementations.
 */
public class MaxMulticastFlowControlSupplier implements FlowControlSupplier
{
    /**
     * {@inheritDoc}
     */
    public FlowControl newInstance(final UdpChannel udpChannel, final int streamId, final long registrationId)
    {
        return MaxMulticastFlowControl.INSTANCE;
    }
}


text: Organizations = new Mongo.Collection("organizations");


text:
When declaring the **type signature of a virtual_func**,
any polymorphic classe/struct type is considered virtual.
To treat a polymorphic type as a non-virtual,
wrap it with **```_static<>```** in the declaration as in:

using type = void (_static<Base&>, Base*);

: only 'Base*' is considered virtual.

**Consecutive  \_static<>**'s  can be combined into one:

void (_static<Base&>, _static<Base*>, _static<Base&&>, Base*);

is equivalent to

void (_static<Base&, Base*, Base&&>, Base*);

For non-polymorphic or primitive types that are considered non-virtual,   _static<> has no effects.

void (_static<int>)   is equivalent to   void (int)

and also

void (_static<Base&>, int, _static<Base&&>, Base*);
//is equivalent to
void (_static<Base&, int, Base&&>, Base*);


text:
<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "mind_case".
 *
 * @property integer $id
 * @property string $title
 * @property string $content
 * @property string $from
 * @property integer $create_time
 * @property integer $read_count
 */
class MindCase extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'mind_case';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['title', 'from'], 'required'],
            [['content'], 'string'],
            [['create_time', 'read_count','sort'], 'integer'],
            ['sort','default','value'=>0],
            [['title', 'from'], 'string', 'max' => 255],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => '自增ID',
            'title' => '标题',
            'content' => '内容',
            'from' => '来源',
            'create_time' => '发布时间',
            'read_count' => '阅读数',
            'sort'=>'排序'
        ];
    }
    public function beforeSave($insert)
    {
        if($this->isNewRecord){
            $this->create_time=time();
        }
        return parent::beforeSave($insert); // TODO: Change the autogenerated stub
    }
}


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

namespace PBR.IrradianceConversion {
    partial class CubemapNode {
        private const string vertexCode = @"#version 330 core
layout (location = 0) in vec3 aPos;

out vec3 WorldPos;

uniform mat4 projection;
uniform mat4 view;

void main()
{
    WorldPos = aPos;
    gl_Position =  projection * view * vec4(WorldPos, 1.0);
}
";

        private const string fragmentCode = @"#version 330 core
out vec4 FragColor;
in vec3 WorldPos;

uniform sampler2D equirectangularMap;

const vec2 invAtan = vec2(0.1591, 0.3183);
vec2 SampleSphericalMap(vec3 v)
{
    vec2 uv = vec2(atan(v.z, v.x), asin(v.y));
    uv *= invAtan;
    uv += 0.5;
    return uv;
}

void main()
{
    vec2 uv = SampleSphericalMap(normalize(WorldPos));
    vec3 color = texture(equirectangularMap, uv).rgb;

    FragColor = vec4(color, 1.0);
}
";
    }
}


text:
#ifndef TARGET_CONFIG_H
#define TARGET_CONFIG_H

#define FLASH_SECTOR_SIZE                  (4096)
#define TARGET_AUTO_INCREMENT_PAGE_SIZE    (1024)

#endif


text:
'use strict';

angular.module('core').controller('HomeController', ['$scope', '$http', 'Authentication', 'Criteria',
	function($scope, $http, Authentication, Criteria) {
		// This provides Authentication context.
		$scope.authentication = Authentication;

		$scope.criteria = Criteria.query();

		// Check Criterium
		// @ToDo: Migrate this to a Service
		$scope.check = function() {
			// Construct array of criteria id to check
			var checkCriteria = $scope.criteria;
			var trueCriteriumIds = [];
			for (var i = 0; i < checkCriteria.length; i++) {
				var checkCriterium = checkCriteria[i];
				if (checkCriterium.check === true) {
					trueCriteriumIds.push(checkCriterium._id);
				}
			}

			// PUT criteria results to Server + Check them
			$http.put('/check', {trueCriteriumIds: trueCriteriumIds}).
			  success(function(data, status, headers, config) {
					// Display Result based on Server Check
					if (data.check) {
						$scope.template = 'yes';
					} else {
						$scope.template = 'no';
					}
			  });
	  };

		/* Map Functions
		  Adapted from examples at:
			https://developers.google.com/maps/documentation/javascript/examples/place-search
			https://developers.google.com/maps/articles/geolocation
			*/

		var initialLocation;
		var map;
		var infowindow;
		var wellington = new google.maps.LatLng(-41.29, 174.78);

		$scope.initialize = function() {
			var browserSupportFlag;

			var myOptions = {
				zoom: 12,
				mapTypeId: google.maps.MapTypeId.ROADMAP
			};
			map = new google.maps.Map(document.getElementById('map-canvas'), myOptions);

			// Try W3C Geolocation (Preferred)
			if(navigator.geolocation) {
				browserSupportFlag = true;
				navigator.geolocation.getCurrentPosition(function(position) {
					initialLocation = new google.maps.LatLng(position.coords.latitude,position.coords.longitude);
					map.setCenter(initialLocation);
					placeSearch(initialLocation);
				}, function() {
					handleNoGeolocation(browserSupportFlag);
				}, {timeout:5000});
			}
			// Browser doesn't support Geolocation
			else {
				browserSupportFlag = false;
				handleNoGeolocation(browserSupportFlag);
			}
		};

		function handleNoGeolocation(errorFlag) {
			if (errorFlag === true) {
				alert('Geolocation service failed.');
				initialLocation = wellington;
			} else {
				alert('Your browser does not support geolocation.');
				initialLocation = wellington;
			}
			map.setCenter(initialLocation);
			placeSearch(initialLocation);
		}

		function placeSearch(initialLocation) {
			var request = {
				location: initialLocation,
				radius: 10000,
				types: ['doctor', 'hospital']
			};
			infowindow = new google.maps.InfoWindow();
			var service = new google.maps.places.PlacesService(map);
			service.nearbySearch(request, callback);
		}

		function callback(results, status) {
			if (status === google.maps.places.PlacesServiceStatus.OK) {
				for (var i = 0; i < results.length; i++) {
					createMarker(results[i]);
				}
			}
		}

		function createMarker(place) {
			var placeLoc = place.geometry.location;
			var marker = new google.maps.Marker({
				map: map,
				position: place.geometry.location
			});

			google.maps.event.addListener(marker, 'click', function() {
				infowindow.setContent(place.name);
				infowindow.open(map, this);
			});
		}
	}
]);


text:
<?php

$frontend = array(

    'frontend' => array(

        'header'   => array(

            array( 'type' => 'open' ),

            array(
                'name' => __( 'Frontend Settings', 'yith-woocommerce-ajax-navigation' ),
                'type' => 'title'
            ),

            array( 'type' => 'close' )
        ),

        'settings' => array(

            array( 'type' => 'open' ),

            array(
                'id'   => 'yith_wcan_frontend_description',
                'name' => _x( 'How To:', 'Admin panel: option description', 'yith-woocommerce-ajax-navigation' ),
                'type' => 'wcan_description',
                'desc' => _x( "If your theme is using WooCommerce standard templates, you don't need to change the following values.
                                Otherwise, add the classes used in the templates of your theme.
                                If you don't know how to do, please contact the developer of your theme to be correctly instructed.", 'Admin: Panel section description', 'yith-woocommerce-ajax-navigation' ),
            ),

            array(
                'name' => __( 'Product Container', 'yith-woocommerce-ajax-navigation' ),
                'desc' => __( 'Enter here the CSS class or id for the product container', 'yith-woocommerce-ajax-navigation' ) . ' (Default: .products)',
                'id'   => 'yith_wcan_ajax_shop_container',
                'type' => 'text',
                'std'  => '.products'
            ),

            array(
                'name' => __( 'Shop Pagination Container', 'yith-woocommerce-ajax-navigation' ),
                'desc' => __( 'Enter here the CSS class or id for the shop pagination container', 'yith-woocommerce-ajax-navigation' ) . ' (Default: nav.woocommerce-pagination)',
                'id'   => 'yith_wcan_ajax_shop_pagination',
                'type' => 'text',
                'std'  => 'nav.woocommerce-pagination'
            ),

            array(
                'name' => __( 'Result Count Container', 'yith-woocommerce-ajax-navigation' ),
                'desc' => __( 'Enter here the CSS class or id for the results count container', 'yith-woocommerce-ajax-navigation' ) . ' (Default: .woocommerce-result-count)',
                'id'   => 'yith_wcan_ajax_shop_result_container',
                'type' => 'text',
                'std'  => '.woocommerce-result-count'
            ),

            array(
                'name' => __( 'Scroll top anchor', 'yith-woocommerce-ajax-navigation' ),
                'desc' => __( 'Enter here the HTML tag for the scroll to top feature', 'yith-woocommerce-ajax-navigation' ) . ' (Default: .yit-wcan-container)',
                'id'   => 'yith_wcan_ajax_scroll_top_class',
                'type' => 'text',
                'std'  => '.yit-wcan-container'
            ),

            array(
                'name'    => __( 'Order by', 'yith-woocommerce-ajax-navigation' ),
                'desc'    => __( 'Sort by number of products contained or alphabetically', 'yith-woocommerce-ajax-navigation' ),
                'id'      => 'yith_wcan_ajax_shop_terms_order',
                'type'    => 'select',
                'options' => array(
                    'alphabetical'  => __( 'Alphabetically', 'yith-woocommerce-ajax-navigation' ),
                    'menu_order'    => __( 'WooCommerce Default', 'yith-woocommerce-ajax-navigation' )
                ),
                'std'     => 'alphabetical'
            ),

            array( 'type' => 'close' ),
        ),
    )
);

return apply_filters( 'yith_wcan_panel_frontend_options', $frontend );


text:
package urlFilter;

import java.net.URI;
import java.net.URISyntaxException;
import java.util.Collection;

import dataType.Link;

public class FilterByAnchors implements FilterInt
{
	public Collection<Link> filter(String domainName, Collection<Link> links)
	{
		int lastBackSlash, lastHash;

		for(Link l : links)
		{
			//compaire the positions of the last slash with the last #
			//to see if the link is an anchor link
			lastBackSlash = l.getUrl().lastIndexOf('/');
			lastHash = l.getUrl().lastIndexOf('#');
			if(lastBackSlash < lastHash)
				try
				{
					l.setURI(new URI(l.getUrl().substring(0, lastHash)));
				} catch (URISyntaxException e)
				{

				}
		}
		return links;
	}

}


text:
package com.manywho.services.twilio.types;

import com.manywho.sdk.enums.ContentType;
import com.manywho.sdk.services.annotations.Id;
import com.manywho.sdk.services.annotations.TypeElement;
import com.manywho.sdk.services.annotations.TypeProperty;
import org.hibernate.validator.constraints.NotEmpty;

@TypeElement(name = Recording.NAME)
public class Recording {
    public final static String NAME = "Recording";
    public final static String PROPERTY_TRANSCRIPTION = "Transcription";
    public final static String PROPERTY_URL = "Url";

    @Id
    private String id;

    @TypeProperty(name = PROPERTY_TRANSCRIPTION, contentType = ContentType.String, bound = false)
    @NotEmpty(message = "The Transcription value must not be null or blank")
    private String transcription;

    @TypeProperty(name = PROPERTY_URL, contentType = ContentType.String, bound = false)
    @NotEmpty(message = "The Url value must not be null or blank")
    private String url;

    public String getTranscription() {
        return transcription;
    }

    public String getUrl() {
        return url;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public void setTranscription(String transcription) {
        this.transcription = transcription;
    }

    public void setUrl(String url) {
        this.url = url;
    }
}


text:
package com.ebayopensource.webrex.resource;

import java.io.UnsupportedEncodingException;
import java.net.URL;

import com.ebayopensource.webrex.resource.api.IInlineResource;
import com.ebayopensource.webrex.resource.api.IResourceContext;
import com.ebayopensource.webrex.resource.api.IResourceLibrary;
import com.ebayopensource.webrex.resource.api.IResourceLocale;
import com.ebayopensource.webrex.resource.api.IResourceUrn;
import com.ebayopensource.webrex.resource.api.ITemplateContext;
import com.ebayopensource.webrex.util.Checksum;

public class InlineResource extends Resource implements IInlineResource {

   private static final String INLINE = "inline";

   private static IResourceUrn createUrn(String inlineText, String resType) {
      String resourcePath = '/' + Checksum.checksum(inlineText);

      return new ResourceUrn(resType, INLINE, resourcePath);
   }

   private String m_inlineText;

   protected InlineResource(IResourceUrn urn, URL physicalUrl, IResourceLocale locale, IResourceLibrary libraryInfo) {
      super(urn, physicalUrl, locale, libraryInfo);
   }

   public InlineResource(String inlineText, String resType) {
      super(createUrn(inlineText, resType), null, null, null);
      m_inlineText = inlineText;
   }

   @Override
   public String getContent(IResourceContext context) {
      return m_inlineText;
   }

   @Override
   public String getInlineText() {
      return m_inlineText;
   }

   @Override
   public long getLastModified() {
      return 0;
   }

   @Override
   public byte[] getOriginalBinaryContent() {
      String content = getOriginalContent();
      if (content != null) {
         try {
            return content.getBytes("utf-8");
         } catch (UnsupportedEncodingException e) {
            return content.getBytes();
         }
      }

      return null;
   }

   @Override
   public byte[] getOriginalBinaryContent(ITemplateContext context) {
      return getOriginalBinaryContent();
   }

   @Override
   public String getOriginalContent() {
      return m_inlineText;
   }

   @Override
   public String getOriginalContent(ITemplateContext context) {
      return getOriginalContent();
   }

}


text:
<!DOCTYPE html>

      <meta charset="utf-8">
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <meta name="description" content="">
      <meta name="author" content="">
      <title>Heroic Features - Start Bootstrap Template</title>

      <link href="./dist/css/bootstrap.css" rel="stylesheet">
      <link href="https://fonts.googleapis.com/icon?family=Material+Icons"
         rel="stylesheet">

Recuperar contraseña

Hemos envíado un mensaje a la dirección de correo electrónico registrada con el usuario name-user

                          <button type="submit" class="btn btn-success btn-block" >Regresar</button>


text:
from setuptools import setup

setup(name='filesdb',
      version='2.2.2',
      description='A simple tool for tracking files',
      author='Steven Tilley',
      author_email='steventilleyii@gmail.com',
      scripts=['test_filesdb.py'],
      packages=['filesdb'],
      entry_points={'console_scripts': ['filesdb = filesdb.__main__:main']},
      python_requires='>=3',
      tests_require=['pytest'],
      setup_requires=['pytest-runner'],
      url='https://github.com/stilley2/filesdb',
      license='MIT',
      )


text:
//
// MDSSchema.cpp
//
// Definitions of structures which define the schema, including attributes
// and indexes, for the standard tables that are part of the MDS database.
//

#include "MDSSchema.h"
#include <Security/mds_schema.h>
#include <cstring>

namespace Security
{

/*
 * There appears to be a bug in AppleDatabase which prevents our assigning
 * schema to the meta-tables.
 */
#define DEFINE_META_TABLES		0

/* indicates "no MDSNameValuePair table" in a RELATION_INFO declaration. */
#define NO_NVP	NULL

//
// Schema for the lone table in the Object Directory Database.
//
static const CSSM_DB_ATTRIBUTE_INFO objectAttrs[] = {
	DB_ATTRIBUTE(ModuleID, STRING),
	DB_ATTRIBUTE(Manifest, BLOB),
	DB_ATTRIBUTE(ModuleName, STRING),
	DB_ATTRIBUTE(Path, STRING),
	DB_ATTRIBUTE(ProductVersion, STRING),

	/* not in the CDSA spec; denotes a plugin which is statically linked to CSSM */
	DB_ATTRIBUTE(BuiltIn, UINT32),
};

static const CSSM_DB_INDEX_INFO objectIndex[] = {
	UNIQUE_INDEX_ATTRIBUTE(ModuleID, STRING)
};

const RelationInfo kObjectRelation =
	RELATION_INFO(MDS_OBJECT_RECORDTYPE,
		objectAttrs,
		NO_NVP,			// no symbolic names
		objectIndex);

//
// Schema for the various tables in the CDSA Directory Database.
//

// CSSM Relation.
static const CSSM_DB_ATTRIBUTE_INFO cssmAttrs[] =
{
	DB_ATTRIBUTE(ModuleID, STRING),
	DB_ATTRIBUTE(CDSAVersion, STRING),
	DB_ATTRIBUTE(Vendor, STRING),
	DB_ATTRIBUTE(Desc, STRING),
	DB_ATTRIBUTE(NativeServices, UINT32),
};

static const MDSNameValuePair *cssmNvp[] = {
	NULL, NULL,	NULL, NULL,
	MDSServiceNames
};

static const CSSM_DB_INDEX_INFO cssmIndex[] =
{
	UNIQUE_INDEX_ATTRIBUTE(ModuleID, STRING)
};

// KRMM Relation.
static const CSSM_DB_ATTRIBUTE_INFO krmmAttrs[] =
{
	DB_ATTRIBUTE(CSSMGuid, STRING),
	DB_ATTRIBUTE(PolicyType, UINT32),
	DB_ATTRIBUTE(PolicyName, STRING),
	DB_ATTRIBUTE(PolicyPath, STRING),
	DB_ATTRIBUTE(PolicyInfo, BLOB),
	DB_ATTRIBUTE(PolicyManifest, BLOB),
	/*
	 * This attribute is not defined in the CDSA spec. It's only here, in the schema,
	 * to avoid throwing exceptions when searching a DB for any records associated
	 * with a specified GUID - in all other schemas, a guid is specified as a
	 * ModuleID.
	 */
	DB_ATTRIBUTE(ModuleID, STRING),
};

static const MDSNameValuePair *krmmNvp[] = {
	NULL, MDSKrPolicyTypeNames, NULL, NULL,
	NULL, NULL,
};

static const CSSM_DB_INDEX_INFO krmmIndex[] =
{
	UNIQUE_INDEX_ATTRIBUTE(CSSMGuid, STRING),
	UNIQUE_INDEX_ATTRIBUTE(PolicyType, UINT32)
};

// EMM Relation.
static const CSSM_DB_ATTRIBUTE_INFO emmAttrs[] =
{
	DB_ATTRIBUTE(ModuleID, STRING),
	DB_ATTRIBUTE(Manifest, BLOB),
	DB_ATTRIBUTE(ModuleName, STRING),
	DB_ATTRIBUTE(Path, STRING),
	DB_ATTRIBUTE(CDSAVersion, STRING),
	DB_ATTRIBUTE(EMMSpecVersion, STRING),
	DB_ATTRIBUTE(Desc, STRING),
	DB_ATTRIBUTE(PolicyStmt, BLOB),
	DB_ATTRIBUTE(EmmVersion, STRING),
	DB_ATTRIBUTE(EmmVendor, STRING),
	DB_ATTRIBUTE(EmmType, UINT32),		// does this need a name/value table?
};

static const CSSM_DB_INDEX_INFO emmIndex[] =
{
	UNIQUE_INDEX_ATTRIBUTE(ModuleID, STRING)
};

// Primary EMM Service Provider Relation.
static const CSSM_DB_ATTRIBUTE_INFO emmPrimaryAttrs[] =
{
	DB_ATTRIBUTE(ModuleID, STRING),
	DB_ATTRIBUTE(SSID, UINT32),
	DB_ATTRIBUTE(ServiceType, UINT32),
	DB_ATTRIBUTE(Manifest, BLOB),
	DB_ATTRIBUTE(ModuleName, STRING),
	DB_ATTRIBUTE(ProductVersion, STRING),
	DB_ATTRIBUTE(Vendor, STRING),
	DB_ATTRIBUTE(SampleTypes, MULTI_UINT32),
	DB_ATTRIBUTE(AclSubjectTypes, MULTI_UINT32),
	DB_ATTRIBUTE(AuthTags, MULTI_UINT32),
	DB_ATTRIBUTE(EmmSpecVersion, STRING),
};

static const MDSNameValuePair *emmPrimaryNvp[] = {
	NULL, NULL,	NULL, NULL,
	NULL, NULL,	NULL, MDSSampleTypeNames,
	MDSAclSubjectTypeNames,
	MDSAclAuthTagNames,
	NULL
};

static const CSSM_DB_INDEX_INFO emmPrimaryIndex[] =
{
	UNIQUE_INDEX_ATTRIBUTE(ModuleID, STRING),
	UNIQUE_INDEX_ATTRIBUTE(SSID, UINT32),
	UNIQUE_INDEX_ATTRIBUTE(ServiceType, UINT32)
};

// Common Relation.
static const CSSM_DB_ATTRIBUTE_INFO commonAttrs[] =
{
	DB_ATTRIBUTE(ModuleID, STRING),
	DB_ATTRIBUTE(Manifest, BLOB),
	DB_ATTRIBUTE(ModuleName, STRING),
	DB_ATTRIBUTE(Path, STRING),
	DB_ATTRIBUTE(CDSAVersion, STRING),
	DB_ATTRIBUTE(Desc, STRING),
	DB_ATTRIBUTE(DynamicFlag, UINT32),
	DB_ATTRIBUTE(MultiThreadFlag, UINT32),
	DB_ATTRIBUTE(ServiceMask, UINT32),
};

static const MDSNameValuePair *commonNvp[] = {
	NULL, NULL,	NULL, NULL,
	NULL, NULL,	NULL, NULL,
	MDSServiceNames
};

static const CSSM_DB_INDEX_INFO commonIndex[] =
{
	UNIQUE_INDEX_ATTRIBUTE(ModuleID, STRING)
};

// CSP Primary Relation.
static const CSSM_DB_ATTRIBUTE_INFO cspPrimaryAttrs[] =
{
	DB_ATTRIBUTE(ModuleID, STRING),
	DB_ATTRIBUTE(SSID, UINT32),
	DB_ATTRIBUTE(Manifest, BLOB),
	DB_ATTRIBUTE(ModuleName, STRING),
	DB_ATTRIBUTE(ProductVersion, STRING),
	DB_ATTRIBUTE(Vendor, STRING),
	DB_ATTRIBUTE(CspType, UINT32),
	DB_ATTRIBUTE(CspFlags, UINT32),
	DB_ATTRIBUTE(CspCustomFlags, UINT32),
	DB_ATTRIBUTE(UseeTags, MULTI_UINT32),
	DB_ATTRIBUTE(SampleTypes, MULTI_UINT32),
	DB_ATTRIBUTE(AclSubjectTypes, MULTI_UINT32),
	DB_ATTRIBUTE(AuthTags, MULTI_UINT32),
};

static const MDSNameValuePair *cspPrimaryNvp[] = {
	NULL, NULL,	NULL, NULL,
	NULL, NULL,
	MDSCspTypeNames,
	MDSCspFlagsNames,
	NULL,
	MDSUseeTagsNames,
	MDSSampleTypeNames,
	MDSAclSubjectTypeNames,
	MDSAclAuthTagNames
};

static const CSSM_DB_INDEX_INFO cspPrimaryIndex[] =
{
	UNIQUE_INDEX_ATTRIBUTE(ModuleID, STRING),
	UNIQUE_INDEX_ATTRIBUTE(SSID, UINT32)
};

// CSP Capabilities Relation.
static const CSSM_DB_ATTRIBUTE_INFO cspCapabilitiesAttrs[] =
{
	DB_ATTRIBUTE(ModuleID, STRING),
	DB_ATTRIBUTE(SSID, UINT32),
	DB_ATTRIBUTE(UseeTag, UINT32),
	DB_ATTRIBUTE(ContextType, UINT32),
	DB_ATTRIBUTE(AlgType, UINT32),
	DB_ATTRIBUTE(GroupId, UINT32),
	DB_ATTRIBUTE(AttributeType, UINT32),
	DB_ATTRIBUTE(AttributeValue, MULTI_UINT32),
	DB_ATTRIBUTE(Description, STRING),
};
static const MDSNameValuePair *cspCapabilitiesNvp[] = {
	NULL,
	NULL,
	MDSUseeTagsNames,
	MDSContextTypeNames,
	MDSAlgorithmNames,
	NULL,
	MDSAttributeTypeNames,
	NULL,
	NULL
};

static const CSSM_DB_INDEX_INFO cspCapabilitiesIndex[] =
{
	UNIQUE_INDEX_ATTRIBUTE(ModuleID, STRING),
	UNIQUE_INDEX_ATTRIBUTE(SSID, UINT32),
	UNIQUE_INDEX_ATTRIBUTE(UseeTag, UINT32),
	UNIQUE_INDEX_ATTRIBUTE(ContextType, UINT32),
	UNIQUE_INDEX_ATTRIBUTE(AlgType, UINT32),
	UNIQUE_INDEX_ATTRIBUTE(GroupId, UINT32),
	UNIQUE_INDEX_ATTRIBUTE(AttributeType, STRING)
};

// special case "subschema" for parsing CSPCapabilities. These arrays correspond
// dictionaries within a CSPCapabilities info file; they are not part of
// our DB's schema. They are declared only to streamline the
// MDSAttrParser::parseCspCapabilitiesRecord function. No index info is needed.

// top-level info, applied to the dictionary for the whole file.
static const CSSM_DB_ATTRIBUTE_INFO kAttributesCSPCapabilitiesDict1[] =
{
	DB_ATTRIBUTE(ModuleID, STRING),
	DB_ATTRIBUTE(SSID, UINT32),
};
const RelationInfo CSPCapabilitiesDict1RelInfo =
	RELATION_INFO(
		MDS_CDSADIR_CSP_CAPABILITY_RECORDTYPE,		// actually a don't care
		kAttributesCSPCapabilitiesDict1,
		NULL,										// no NVP needed
		NULL);										// no index

// "Capabilities" is an array of dictionaries of these
static const CSSM_DB_ATTRIBUTE_INFO kAttributesCSPCapabilitiesDict2[] =
{
	DB_ATTRIBUTE(AlgType, UINT32),
	DB_ATTRIBUTE(ContextType, UINT32),
	DB_ATTRIBUTE(UseeTag, UINT32),
	DB_ATTRIBUTE(Description, STRING),
};
static const MDSNameValuePair *CSPCapabilitiesDict2Nvp[] = {
	MDSAlgorithmNames,
	MDSContextTypeNames,
	MDSUseeTagsNames,
	NULL
};
const RelationInfo CSPCapabilitiesDict2RelInfo =
	RELATION_INFO(
		MDS_CDSADIR_CSP_CAPABILITY_RECORDTYPE,		// actually a don't care
		kAttributesCSPCapabilitiesDict2,
		CSPCapabilitiesDict2Nvp,
		NULL);										// no index

// Within a Capabilities array, the Attributes array is an array of
// Dictionaries of these.
static const CSSM_DB_ATTRIBUTE_INFO kAttributesCSPCapabilitiesDict3[] =
{
	DB_ATTRIBUTE(AttributeType, UINT32),
	DB_ATTRIBUTE(AttributeValue, MULTI_UINT32),
};
static const MDSNameValuePair *CSPCapabilitiesDict3Nvp[] = {
	MDSAttributeTypeNames,
	NULL
};
const RelationInfo CSPCapabilitiesDict3RelInfo =
	RELATION_INFO(
		MDS_CDSADIR_CSP_CAPABILITY_RECORDTYPE,		// actually a don't care
		kAttributesCSPCapabilitiesDict3,
		CSPCapabilitiesDict3Nvp,
		NULL);

// CSP Encapsulated Products Relation.
static const CSSM_DB_ATTRIBUTE_INFO cspEncapsulatedAttrs[] =
{
	DB_ATTRIBUTE(ModuleID, STRING),
	DB_ATTRIBUTE(SSID, UINT32),
	DB_ATTRIBUTE(ProductDesc, STRING),
	DB_ATTRIBUTE(ProductVendor, STRING),
	DB_ATTRIBUTE(ProductVersion, STRING),
	DB_ATTRIBUTE(ProductFlags, UINT32),
	DB_ATTRIBUTE(CustomFlags, UINT32),
	DB_ATTRIBUTE(StandardDesc, STRING),
	DB_ATTRIBUTE(StandardVersion, STRING),
	DB_ATTRIBUTE(ReaderDesc, STRING),
	DB_ATTRIBUTE(ReaderVendor, STRING),
	DB_ATTRIBUTE(ReaderVersion, STRING),
	DB_ATTRIBUTE(ReaderFirmwareVersion, STRING),
	DB_ATTRIBUTE(ReaderFlags, UINT32),
	DB_ATTRIBUTE(ReaderCustomFlags, UINT32),
	DB_ATTRIBUTE(ReaderSerialNumber, STRING),
};

static const MDSNameValuePair *cspEncapsulatedNvp[] = {
	NULL, NULL,	NULL, NULL,
	NULL, NULL,	NULL, NULL,
	NULL, NULL,	NULL, NULL,
	NULL, MDSCspReaderFlagsNames, NULL, NULL
};

static const CSSM_DB_INDEX_INFO cspEncapsulatedIndex[] =
{
	UNIQUE_INDEX_ATTRIBUTE(ModuleID, STRING),
	UNIQUE_INDEX_ATTRIBUTE(SSID, UINT32)
};

// CSP Smartcardinfo Relation.
static const CSSM_DB_ATTRIBUTE_INFO cspSmartCardAttrs[] =
{
	DB_ATTRIBUTE(ModuleID, STRING),
	DB_ATTRIBUTE(SSID, UINT32),
	DB_ATTRIBUTE(ScDesc, STRING),
	DB_ATTRIBUTE(ScVendor, STRING),
	DB_ATTRIBUTE(ScVersion, STRING),
	DB_ATTRIBUTE(ScFirmwareVersion, STRING),
	DB_ATTRIBUTE(ScFlags, UINT32),
	DB_ATTRIBUTE(ScCustomFlags, UINT32),
	DB_ATTRIBUTE(ScSerialNumber, STRING),
};
static const MDSNameValuePair *cspSmartCardNvp[] = {
	NULL, NULL,	NULL, NULL,
	NULL, NULL,	MDSCspScFlagsNames, NULL,
	NULL,
};

static const CSSM_DB_INDEX_INFO cspSmartCardIndex[] =
{
	UNIQUE_INDEX_ATTRIBUTE(ModuleID, STRING),
	UNIQUE_INDEX_ATTRIBUTE(SSID, UINT32),
	UNIQUE_INDEX_ATTRIBUTE(ScDesc, STRING),
	UNIQUE_INDEX_ATTRIBUTE(ScVendor, STRING),
	UNIQUE_INDEX_ATTRIBUTE(ScVersion, STRING),
	UNIQUE_INDEX_ATTRIBUTE(ScFirmwareVersion, STRING),
	UNIQUE_INDEX_ATTRIBUTE(ScFlags, UINT32)
};

// DL Primary Relation.
static const CSSM_DB_ATTRIBUTE_INFO dlPrimaryAttrs[] =
{
	DB_ATTRIBUTE(ModuleID, STRING),
	DB_ATTRIBUTE(SSID, UINT32),
	DB_ATTRIBUTE(Manifest, BLOB),
	DB_ATTRIBUTE(ModuleName, STRING),
	DB_ATTRIBUTE(ProductVersion, STRING),
	DB_ATTRIBUTE(Vendor, STRING),
	DB_ATTRIBUTE(DLType, UINT32),
	DB_ATTRIBUTE(QueryLimitsFlag, UINT32),			// a completely bogus attr; see spec
	DB_ATTRIBUTE(SampleTypes, MULTI_UINT32),
	DB_ATTRIBUTE(AclSubjectTypes, MULTI_UINT32),
	DB_ATTRIBUTE(AuthTags, MULTI_UINT32),
	DB_ATTRIBUTE(ConjunctiveOps, MULTI_UINT32),
	DB_ATTRIBUTE(RelationalOps, MULTI_UINT32),
};
static const MDSNameValuePair *dlPrimaryNvp[] = {
	NULL, NULL,	NULL, NULL,
	NULL, NULL,	MDSDlTypeNames, NULL,
	MDSSampleTypeNames,
	MDSAclSubjectTypeNames,
	MDSAclAuthTagNames,
	MDSDbConjunctiveNames,
	MDSDbOperatorNames
};
static const CSSM_DB_INDEX_INFO dlPrimaryIndex[] =
{
	UNIQUE_INDEX_ATTRIBUTE(ModuleID, STRING),
	UNIQUE_INDEX_ATTRIBUTE(SSID, UINT32)
};

// DL Encapsulated Products Relation.
static const CSSM_DB_ATTRIBUTE_INFO dlEncapsulatedAttrs[] =
{
	DB_ATTRIBUTE(ModuleID, STRING),
	DB_ATTRIBUTE(SSID, UINT32),
	DB_ATTRIBUTE(ProductDesc, STRING),
	DB_ATTRIBUTE(ProductVendor, STRING),
	DB_ATTRIBUTE(ProductVersion, STRING),
	DB_ATTRIBUTE(ProductFlags, UINT32),
	DB_ATTRIBUTE(StandardDesc, STRING),
	DB_ATTRIBUTE(StandardVersion, STRING),
	DB_ATTRIBUTE(Protocol, UINT32),
	DB_ATTRIBUTE(RetrievalMode, UINT32),
};

static const MDSNameValuePair *dlEncapsulatedNvp[] = {
	NULL, NULL,	NULL, NULL,
	NULL, NULL,	NULL, NULL,
	MDSNetProtocolNames,
	MDSDbRetrievalModeNames
};

static const CSSM_DB_INDEX_INFO dlEncapsulatedIndex[] =
{
	UNIQUE_INDEX_ATTRIBUTE(ModuleID, STRING),
	UNIQUE_INDEX_ATTRIBUTE(SSID, UINT32)
};

// CL Primary Relation.
static const CSSM_DB_ATTRIBUTE_INFO clPrimaryAttrs[] =
{
	DB_ATTRIBUTE(ModuleID, STRING),
	DB_ATTRIBUTE(SSID, UINT32),
	DB_ATTRIBUTE(Manifest, BLOB),
	DB_ATTRIBUTE(ModuleName, STRING),
	DB_ATTRIBUTE(ProductVersion, STRING),
	DB_ATTRIBUTE(Vendor, STRING),
	DB_ATTRIBUTE(CertTypeFormat, UINT32),
	DB_ATTRIBUTE(CrlTypeFormat, UINT32),
	DB_ATTRIBUTE(CertFieldNames, BLOB),
	DB_ATTRIBUTE(BundleTypeFormat, MULTI_UINT32),
	DB_ATTRIBUTE(XlationTypeFormat, MULTI_UINT32),
	DB_ATTRIBUTE(TemplateFieldNames, BLOB),
};

static const MDSNameValuePair *clPrimaryNvp[] = {
	NULL, NULL,	NULL, NULL,
	NULL, NULL,	MDSCertTypeNames, MDSCrlTypeNames,
	NULL,
	MDSCertBundleTypeNames,
	MDSCertTypeNames,		// translation type - same as cert type - right?
	NULL
};

static const CSSM_DB_INDEX_INFO clPrimaryIndex[] =
{
	UNIQUE_INDEX_ATTRIBUTE(ModuleID, STRING),
	UNIQUE_INDEX_ATTRIBUTE(SSID, UINT32)
};

// CL Encapsulated Products Relation.
static const CSSM_DB_ATTRIBUTE_INFO clEncapsulatedAttrs[] =
{
	DB_ATTRIBUTE(ModuleID, STRING),
	DB_ATTRIBUTE(SSID, UINT32),
	DB_ATTRIBUTE(ProductDesc, STRING),
	DB_ATTRIBUTE(ProductVendor, STRING),
	DB_ATTRIBUTE(ProductVersion, STRING),
	DB_ATTRIBUTE(ProductFlags, UINT32),
	DB_ATTRIBUTE(StandardDesc, STRING),
	DB_ATTRIBUTE(StandardVersion, STRING),
};

static const CSSM_DB_INDEX_INFO clEncapsulatedIndex[] =
{
	UNIQUE_INDEX_ATTRIBUTE(ModuleID, STRING),
	UNIQUE_INDEX_ATTRIBUTE(SSID, UINT32)
};

// TP Primary Relation.
static const CSSM_DB_ATTRIBUTE_INFO tpPrimaryAttrs[] =
{
	DB_ATTRIBUTE(ModuleID, STRING),
	DB_ATTRIBUTE(SSID, UINT32),
	DB_ATTRIBUTE(Manifest, BLOB),
	DB_ATTRIBUTE(ModuleName, STRING),
	DB_ATTRIBUTE(ProductVersion, STRING),
	DB_ATTRIBUTE(Vendor, STRING),
	DB_ATTRIBUTE(CertTypeFormat, UINT32),
	DB_ATTRIBUTE(SampleTypes, MULTI_UINT32),
	DB_ATTRIBUTE(AclSubjectTypes, MULTI_UINT32),
	DB_ATTRIBUTE(AuthTags, MULTI_UINT32),
};

static const MDSNameValuePair *tpPrimaryNvp[] = {
	NULL, NULL,	NULL, NULL,
	NULL, NULL,
	MDSCertTypeNames,
	MDSSampleTypeNames,
	MDSAclSubjectTypeNames,
	MDSAclAuthTagNames,
};

static const CSSM_DB_INDEX_INFO tpPrimaryIndex[] =
{
	UNIQUE_INDEX_ATTRIBUTE(ModuleID, STRING),
	UNIQUE_INDEX_ATTRIBUTE(SSID, UINT32)
};

// TP Policy-OIDs Relation.
static const CSSM_DB_ATTRIBUTE_INFO tpPolicyOidsAttrs[] =
{
	DB_ATTRIBUTE(ModuleID, STRING),
	DB_ATTRIBUTE(SSID, UINT32),
	DB_ATTRIBUTE(OID, BLOB),
	DB_ATTRIBUTE(Value, BLOB),
};

static const CSSM_DB_INDEX_INFO tpPolicyOidsIndex[] =
{
	UNIQUE_INDEX_ATTRIBUTE(ModuleID, STRING),
	UNIQUE_INDEX_ATTRIBUTE(SSID, UINT32),
	UNIQUE_INDEX_ATTRIBUTE(OID, BLOB)
};

// special case "subschema" for parsing tpPolicyOidsAttrs. These arrays correspond
// dictionaries within a tpPolicyOidsAttrs info file; they are not part of
// our DB's schema. They are declared only to streamline the
// MDSAttrParser::parseTpPolicyOidsRecord function. No index info is needed.

// top-level info, applied to the dictionary for the whole file.
static const CSSM_DB_ATTRIBUTE_INFO tpPolicyOidsDict1[] =
{
	DB_ATTRIBUTE(ModuleID, STRING),
	DB_ATTRIBUTE(SSID, UINT32),
};
const RelationInfo TpPolicyOidsDict1RelInfo =
	RELATION_INFO(
		MDS_CDSADIR_TP_OIDS_RECORDTYPE,				// actually a don't care
		tpPolicyOidsDict1,
		NULL,										// no NVP needed
		NULL);										// no index

// One element of the "Policies" array maps to one of these.
static const CSSM_DB_ATTRIBUTE_INFO tpPolicyOidsDict2[] =
{
	DB_ATTRIBUTE(OID, BLOB),
	DB_ATTRIBUTE(Value, BLOB),
};
const RelationInfo TpPolicyOidsDict2RelInfo =
	RELATION_INFO(
		MDS_CDSADIR_TP_OIDS_RECORDTYPE,				// actually a don't care
		tpPolicyOidsDict2,
		NULL,										// no NVP needed
		NULL);										// no index

// TP Encapsulated Products Relation.
static const CSSM_DB_ATTRIBUTE_INFO tpEncapsulatedAttrs[] =
{
	DB_ATTRIBUTE(ModuleID, STRING),
	DB_ATTRIBUTE(SSID, UINT32),
	DB_ATTRIBUTE(ProductDesc, STRING),
	DB_ATTRIBUTE(ProductVendor, STRING),
	DB_ATTRIBUTE(ProductVersion, STRING),
	DB_ATTRIBUTE(ProductFlags, UINT32),				// vendor-specific, right?
	DB_ATTRIBUTE(AuthorityRequestType, MULTI_UINT32),
	DB_ATTRIBUTE(StandardDesc, STRING),
	DB_ATTRIBUTE(StandardVersion, STRING),
	DB_ATTRIBUTE(ProtocolDesc, STRING),
	DB_ATTRIBUTE(ProtocolFlags, UINT32),
	DB_ATTRIBUTE(CertClassName, STRING),
	DB_ATTRIBUTE(RootCertificate, BLOB),
	DB_ATTRIBUTE(RootCertTypeFormat, UINT32),
};
static const MDSNameValuePair *tpEncapsulatedNvp[] = {
	NULL, NULL,	NULL, NULL,
	NULL, NULL,	MDSTpAuthRequestNames,	NULL,
	NULL, NULL,	NULL, NULL,
	NULL, MDSCertTypeNames
};

static const CSSM_DB_INDEX_INFO tpEncapsulatedIndex[] =
{
	UNIQUE_INDEX_ATTRIBUTE(ModuleID, STRING),
	UNIQUE_INDEX_ATTRIBUTE(SSID, UINT32)
};

#if 	DEFINE_META_TABLES
// MDS Schema Relations (meta) Relation.
static const CSSM_DB_ATTRIBUTE_INFO mdsSchemaRelationsAttrs[] =
{
	DB_ATTRIBUTE(RelationID, UINT32),
	DB_ATTRIBUTE(RelationName, STRING),
};

static const CSSM_DB_INDEX_INFO mdsSchemaRelationsIndex[] =
{
	UNIQUE_INDEX_ATTRIBUTE(RelationID, UINT32),
};

// MDS Schema Attributes (meta) Relation.
static const CSSM_DB_ATTRIBUTE_INFO mdsSchemaAttributesAttrs[] =
{
	DB_ATTRIBUTE(RelationID, UINT32),
	DB_ATTRIBUTE(AttributeID, UINT32),
	DB_ATTRIBUTE(AttributeNameFormat, UINT32),
	DB_ATTRIBUTE(AttributeName, STRING),
	DB_ATTRIBUTE(AttributeNameID, BLOB),
	DB_ATTRIBUTE(AttributeFormat, UINT32),
};

static const CSSM_DB_INDEX_INFO mdsSchemaAttributesIndex[] =
{
	UNIQUE_INDEX_ATTRIBUTE(RelationID, UINT32),
	UNIQUE_INDEX_ATTRIBUTE(AttributeID, UINT32)
};

// MDS Schema Indexes (meta) Relation.
static const CSSM_DB_ATTRIBUTE_INFO mdsSchemaIndexesAttrs[] =
{
	DB_ATTRIBUTE(RelationID, UINT32),
	DB_ATTRIBUTE(IndexID, UINT32),
	DB_ATTRIBUTE(AttributeID, UINT32),
	DB_ATTRIBUTE(IndexType, UINT32),
	DB_ATTRIBUTE(IndexedDataLocation, UINT32),
};

static const CSSM_DB_INDEX_INFO mdsSchemaIndexesIndex[] =
{
	UNIQUE_INDEX_ATTRIBUTE(RelationID, UINT32),
	UNIQUE_INDEX_ATTRIBUTE(IndexID, UINT32)
};

#endif	/* DEFINE_META_TABLES */

// AC Primary Relation.
static const CSSM_DB_ATTRIBUTE_INFO acPrimaryAttrs[] =
{
	DB_ATTRIBUTE(ModuleID, STRING),
	DB_ATTRIBUTE(SSID, UINT32),
	DB_ATTRIBUTE(Manifest, BLOB),
	DB_ATTRIBUTE(ModuleName, STRING),
	DB_ATTRIBUTE(ProductVersion, STRING),
	DB_ATTRIBUTE(Vendor, STRING),
};

static const CSSM_DB_INDEX_INFO acPrimaryIndex[] =
{
	UNIQUE_INDEX_ATTRIBUTE(ModuleID, STRING),
	UNIQUE_INDEX_ATTRIBUTE(SSID, UINT32)
};

// KR Primary Relation.
static const CSSM_DB_ATTRIBUTE_INFO krPrimaryAttrs[] =
{
	DB_ATTRIBUTE(ModuleID, STRING),
	DB_ATTRIBUTE(SSID, UINT32),
	DB_ATTRIBUTE(Manifest, BLOB),
	DB_ATTRIBUTE(ModuleName, STRING),
	DB_ATTRIBUTE(CompatCSSMVersion, STRING),
	DB_ATTRIBUTE(Version, STRING),
	DB_ATTRIBUTE(Vendor, STRING),
	DB_ATTRIBUTE(Description, STRING),
	DB_ATTRIBUTE(ConfigFileLocation, STRING),
};

static const CSSM_DB_INDEX_INFO krPrimaryIndex[] =
{
	UNIQUE_INDEX_ATTRIBUTE(ModuleID, STRING),
	UNIQUE_INDEX_ATTRIBUTE(SSID, UINT32)
};

// list of all built-in schema for the CDSA Directory DB.
const RelationInfo kMDSRelationInfo[] =
{
	RELATION_INFO(MDS_CDSADIR_CSSM_RECORDTYPE,
		cssmAttrs,
		cssmNvp,
		cssmIndex),
	RELATION_INFO(MDS_CDSADIR_KRMM_RECORDTYPE,
		krmmAttrs,
		krmmNvp,
		krmmIndex),
	RELATION_INFO(MDS_CDSADIR_EMM_RECORDTYPE,
		emmAttrs,
		NO_NVP,		// FIXME - what is the uint32 EmmType here?
		emmIndex),
	RELATION_INFO(MDS_CDSADIR_EMM_PRIMARY_RECORDTYPE,
		emmPrimaryAttrs,
		emmPrimaryNvp,
		emmPrimaryIndex),
	RELATION_INFO(MDS_CDSADIR_COMMON_RECORDTYPE,
		commonAttrs,
		commonNvp,
		commonIndex),
	RELATION_INFO(MDS_CDSADIR_CSP_PRIMARY_RECORDTYPE,
		cspPrimaryAttrs,
		cspPrimaryNvp,
		cspPrimaryIndex),
	RELATION_INFO(MDS_CDSADIR_CSP_CAPABILITY_RECORDTYPE,
		cspCapabilitiesAttrs,
		cspCapabilitiesNvp,
		cspCapabilitiesIndex),
	RELATION_INFO(MDS_CDSADIR_CSP_ENCAPSULATED_PRODUCT_RECORDTYPE,
		cspEncapsulatedAttrs,
		cspEncapsulatedNvp,
		cspEncapsulatedIndex),
	RELATION_INFO(MDS_CDSADIR_CSP_SC_INFO_RECORDTYPE,
		cspSmartCardAttrs,
		cspSmartCardNvp,
		cspSmartCardIndex),
	RELATION_INFO(MDS_CDSADIR_DL_PRIMARY_RECORDTYPE,
		dlPrimaryAttrs,
		dlPrimaryNvp,
		dlPrimaryIndex),
	RELATION_INFO(MDS_CDSADIR_DL_ENCAPSULATED_PRODUCT_RECORDTYPE,
		dlEncapsulatedAttrs,
		dlEncapsulatedNvp,
		dlEncapsulatedIndex),
	RELATION_INFO(MDS_CDSADIR_CL_PRIMARY_RECORDTYPE,
		clPrimaryAttrs,
		clPrimaryNvp,
		clPrimaryIndex),
	RELATION_INFO(MDS_CDSADIR_CL_ENCAPSULATED_PRODUCT_RECORDTYPE,
		clEncapsulatedAttrs,
		NO_NVP,		// none needed
		clEncapsulatedIndex),
	RELATION_INFO(MDS_CDSADIR_TP_PRIMARY_RECORDTYPE,
		tpPrimaryAttrs,
		tpPrimaryNvp,
		tpPrimaryIndex),
	RELATION_INFO(MDS_CDSADIR_TP_OIDS_RECORDTYPE,
		tpPolicyOidsAttrs,
		NO_NVP,		// none needed
		tpPolicyOidsIndex),
	RELATION_INFO(MDS_CDSADIR_TP_ENCAPSULATED_PRODUCT_RECORDTYPE,
		tpEncapsulatedAttrs,
		tpEncapsulatedNvp,
		tpEncapsulatedIndex),
	#if	DEFINE_META_TABLES
	RELATION_INFO(MDS_CDSADIR_MDS_SCHEMA_RELATIONS,
		mdsSchemaRelationsAttrs,
		NO_NVP,
		mdsSchemaRelationsIndex),
	RELATION_INFO(MDS_CDSADIR_MDS_SCHEMA_ATTRIBUTES,
		mdsSchemaAttributesAttrs,
		NO_NVP,
		mdsSchemaAttributesIndex),
	RELATION_INFO(MDS_CDSADIR_MDS_SCHEMA_INDEXES,
		mdsSchemaIndexesAttrs,
		NO_NVP,
		mdsSchemaIndexesIndex),
	#endif	/* DEFINE_META_TABLES */
	RELATION_INFO(MDS_CDSADIR_AC_PRIMARY_RECORDTYPE,
		acPrimaryAttrs,
		NO_NVP,		// none needed
		acPrimaryIndex),
	RELATION_INFO(MDS_CDSADIR_KR_PRIMARY_RECORDTYPE,
		krPrimaryAttrs,
		NO_NVP,		// none needed
		krPrimaryIndex)
};

const unsigned kNumMdsRelations = sizeof(kMDSRelationInfo) / sizeof(RelationInfo);

// Map a CSSM_DB_RECORDTYPE to a RelationInfo *.
extern const RelationInfo *MDSRecordTypeToRelation(
	CSSM_DB_RECORDTYPE recordType)
{
	const RelationInfo *relInfo = kMDSRelationInfo;
	unsigned dex;

	for(dex=0; dex<kNumMdsRelations; dex++) {
		if(relInfo->DataRecordType == recordType) {
			return relInfo;
		}
		relInfo++;
	}
	if(recordType == MDS_OBJECT_RECORDTYPE) {
		return &kObjectRelation;
	}
	return NULL;
}

// same as above, based on record type as string.
extern const RelationInfo *MDSRecordTypeNameToRelation(
	const char *recordTypeName)
{
	const RelationInfo *relInfo = kMDSRelationInfo;
	unsigned dex;

	for(dex=0; dex<kNumMdsRelations; dex++) {
		if(!strcmp(recordTypeName, relInfo->relationName)) {
			return relInfo;
		}
		relInfo++;
	}
	return NULL;
}

} // end namespace Security


text:
namespace Archient.Web.Extensions
{
    using System;

    public static class IApplicationBuilderExtensions
    {

    }
}


text:
package com.esri.geoevent.solutions.processor.symbollookup;

import java.util.Collection;
import java.util.Iterator;
import java.util.List;

import com.esri.ges.core.geoevent.FieldDefinition;
import com.esri.ges.core.geoevent.GeoEventDefinition;
import com.esri.ges.core.property.PropertyDefinition;
import com.esri.ges.core.property.PropertyException;
import com.esri.ges.core.property.PropertyType;
import com.esri.ges.manager.geoeventdefinition.GeoEventDefinitionManager;
import com.esri.ges.processor.GeoEventProcessorDefinitionBase;

public class SymbolNameToIdProcessorDefinition extends GeoEventProcessorDefinitionBase
{
	private GeoEventDefinitionManager manager = null;

	public SymbolNameToIdProcessorDefinition()
	{
		;
	}

	public void setManager(GeoEventDefinitionManager m) throws PropertyException {
		this.manager = m;

		PropertyDefinition procSymbolNameSource = new PropertyDefinition("symbolNameSource",
				PropertyType.String, "", "SymbolName Source", "Source of SymbolName Value", true, false);
		procSymbolNameSource.addAllowedValue("Event");
		propertyDefinitions.put(procSymbolNameSource.getPropertyName(), procSymbolNameSource);

		PropertyDefinition procSymbolNameEvent = new PropertyDefinition("symbolNameEvent",
				PropertyType.String, "", "SymbolName Event Field", "Geoevent field containing SymbolName data", true, false);
		procSymbolNameEvent.setDependsOn("symbolNameSource=Event");
		SetGeoEventAllowedFields(procSymbolNameEvent);
		propertyDefinitions.put(procSymbolNameEvent.getPropertyName(), procSymbolNameEvent);

		PropertyDefinition procSymbolIdSource = new PropertyDefinition("symbolIdSource",
				PropertyType.String, "", "SymbolId Source", "Source of SymbolId Value", true, false);
		procSymbolIdSource.addAllowedValue("Event");
		propertyDefinitions.put(procSymbolIdSource.getPropertyName(), procSymbolIdSource);

		PropertyDefinition procSymbolIdEvent = new PropertyDefinition("symbolIdEvent",
				PropertyType.String, "", "SymbolId Event Field", "Geoevent field containing SymbolId data", true, false);
		procSymbolIdEvent.setDependsOn("symbolIdSource=Event");
		SetGeoEventAllowedFields(procSymbolIdEvent);
		propertyDefinitions.put(procSymbolIdEvent.getPropertyName(), procSymbolIdEvent);

	}

	private void SetGeoEventAllowedFields(PropertyDefinition pd)
	{
		if (this.manager == null)
			return;

		Collection<GeoEventDefinition> geodefs = this.manager.listAllGeoEventDefinitions();
		if (geodefs == null)
			return;

		Iterator<GeoEventDefinition> it = geodefs.iterator();
		GeoEventDefinition geoEventDef;
		while (it.hasNext())
		{
			geoEventDef = it.next();
			String defName = geoEventDef.getName();
			List<FieldDefinition> fieldDefs = geoEventDef.getFieldDefinitions();

			if (fieldDefs != null)
			{
				int fieldDefSize = fieldDefs.size();

				for(int i = 0; i < fieldDefSize; ++i)
				{
					String fld = geoEventDef.getFieldDefinitions().get(i).getName();
					pd.addAllowedValue(defName + ":" + fld);
				}
			}
		}
	}

	@Override
	public String getName()
	{
		return "SymbolNameToIdProcessor";
	}

	@Override
	public String getDomain()
	{
		return "com.esri.geoevent.solutions.processor.symbollookup";
	}

	@Override
	public String getVersion()
	{
		return "10.2.0";
	}

	@Override
	public String getLabel()
	{
		return "Symbol Name To Id Processor";
	}

	@Override
	public String getDescription()
	{
		return "Converts well known symbol names to Symbol ID Codes (SIDCs).";
	}

	@Override
	public String getContactInfo()
	{
		return "geoeventprocessor@esri.com";
	}
}


text:
const resizeTo = require('terra-toolkit/lib/nightwatch/responsive-helpers').resizeTo;

module.exports = resizeTo(['medium'], {
  'Displays a props table': (browser) => {
    browser.url(`${browser.launchUrl}/#/tests/markdown/default`)
      .assert.elementPresent('[class*="markdown-body"]');
  },

  'Displays the component title': (browser) => {
    browser.url(`${browser.launchUrl}/#/tests/markdown/default`)
      .assert.elementPresent('#terra-mock-component');
  },

  'Displays the component getting started section': (browser) => {
    browser.url(`${browser.launchUrl}/#/tests/markdown/default`)
      .assert.elementPresent('#getting-started');
  },

  'Displays the component usage section': (browser) => {
    browser.url(`${browser.launchUrl}/#/tests/markdown/default`)
      .assert.elementPresent('#usage');
  },

  'Displays the component example code': (browser) => {
    browser.url(`${browser.launchUrl}/#/tests/markdown/default`)
      .assert.elementPresent('.lang-jsx');
  },

  'Displays the component features': (browser) => {
    browser.url(`${browser.launchUrl}/#/tests/markdown/default`)
      .assert.elementPresent('#component-features');
  },
});


text:
package org.zerhusen.security.rest;

import com.fasterxml.jackson.annotation.JsonProperty;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.zerhusen.security.rest.dto.LoginDto;
import org.zerhusen.security.jwt.JWTFilter;
import org.zerhusen.security.jwt.TokenProvider;

import javax.validation.Valid;

/**
 * Controller to authenticate users.
 */
@RestController
@RequestMapping("/api")
public class AuthenticationRestController {

   private final TokenProvider tokenProvider;

   private final AuthenticationManagerBuilder authenticationManagerBuilder;

   public AuthenticationRestController(TokenProvider tokenProvider, AuthenticationManagerBuilder authenticationManagerBuilder) {
      this.tokenProvider = tokenProvider;
      this.authenticationManagerBuilder = authenticationManagerBuilder;
   }

   @PostMapping("/authenticate")
   public ResponseEntity<JWTToken> authorize(@Valid @RequestBody LoginDto loginDto) {

      UsernamePasswordAuthenticationToken authenticationToken =
         new UsernamePasswordAuthenticationToken(loginDto.getUsername(), loginDto.getPassword());

      Authentication authentication = authenticationManagerBuilder.getObject().authenticate(authenticationToken);
      SecurityContextHolder.getContext().setAuthentication(authentication);

      boolean rememberMe = (loginDto.isRememberMe() == null) ? false : loginDto.isRememberMe();
      String jwt = tokenProvider.createToken(authentication, rememberMe);

      HttpHeaders httpHeaders = new HttpHeaders();
      httpHeaders.add(JWTFilter.AUTHORIZATION_HEADER, "Bearer " + jwt);

      return new ResponseEntity<>(new JWTToken(jwt), httpHeaders, HttpStatus.OK);
   }

   /**
    * Object to return as body in JWT Authentication.
    */
   static class JWTToken {

      private String idToken;

      JWTToken(String idToken) {
         this.idToken = idToken;
      }

      @JsonProperty("id_token")
      String getIdToken() {
         return idToken;
      }

      void setIdToken(String idToken) {
         this.idToken = idToken;
      }
   }
}


text:
package hex.deeplearning;

import hex.*;
import hex.deeplearning.DeepLearningModel.DeepLearningModelOutput;
import hex.schemas.DeepLearningV3;
import hex.schemas.ModelBuilderSchema;
import water.*;
import water.exceptions.H2OModelBuilderIllegalArgumentException;
import water.fvec.Frame;
import water.fvec.RebalanceDataSet;
import water.fvec.Vec;
import water.init.Linpack;
import water.init.NetworkTest;
import water.util.*;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;

import static water.util.MRUtils.sampleFrame;
import static water.util.MRUtils.sampleFrameStratified;

/**
 * Deep Learning Neural Net implementation based on MRTask
 */
public class DeepLearning extends ModelBuilder<DeepLearningModel,DeepLearningParameters,DeepLearningModelOutput> {
  /**
   * Main constructor from Deep Learning parameters
   * @param parms
   */
  public DeepLearning( DeepLearningParameters parms ) {
    super("DeepLearning", parms);
    init(false);
  }

  /**
   * Types of models we can build with DeepLearning
   * @return
   */
  @Override public ModelCategory[] can_build() {
    return new ModelCategory[]{
            ModelCategory.Regression,
            ModelCategory.Binomial,
            ModelCategory.Multinomial,
            ModelCategory.AutoEncoder
    };
  }
  public ModelBuilderSchema schema() { return new DeepLearningV3(); }
  @Override public BuilderVisibility builderVisibility() { return BuilderVisibility.Stable; };
  @Override public boolean isSupervised() { return !_parms._autoencoder; }

  /** Start the DeepLearning training Job on an F/J thread.
   * @param work
   * @param restartTimer*/
  @Override protected Job<DeepLearningModel> trainModelImpl(long work, boolean restartTimer) {
    // We look at _train before init(true) is called, so step around that here:
    return start(new DeepLearningDriver(), work, restartTimer);
  }

  @Override
  public long progressUnits() {
    long work = 1;
    if (null != _train)
      work = (long)(_parms._epochs * _train.numRows());
    return Math.max(1, work);
  }

  /** Initialize the ModelBuilder, validating all arguments and preparing the
   *  training frame.  This call is expected to be overridden in the subclasses
   *  and each subclass will start with "super.init();".  This call is made
   *  by the front-end whenever the GUI is clicked, and needs to be fast;
   *  heavy-weight prep needs to wait for the trainModel() call.
   *
   *  Validate the very large number of arguments in the DL Parameter directly. */
  @Override public void init(boolean expensive) {
    super.init(expensive);
    _parms.validate(this, expensive);
    if (expensive && error_count() == 0) checkMemoryFootPrint();
  }

  /**
   * Helper to create the DataInfo object from training/validation frames and the DL parameters
   * @param train Training frame
   * @param valid Validation frame
   * @param parms Model parameters
   * @return
   */
  static DataInfo makeDataInfo(Frame train, Frame valid, DeepLearningParameters parms) {
    double x = 0.782347234;
    boolean identityLink = new Distribution(parms._distribution, parms._tweedie_power).link(x) == x;
    return new DataInfo(
            Key.make(), //dest key
            train,
            valid,
            parms._autoencoder ? 0 : 1, //nResponses
            parms._autoencoder || parms._use_all_factor_levels, //use all FactorLevels for auto-encoder
            parms._autoencoder ? DataInfo.TransformType.NORMALIZE : parms._sparse ? DataInfo.TransformType.DESCALE : DataInfo.TransformType.STANDARDIZE, //transform predictors
            train.lastVec().isCategorical() ? DataInfo.TransformType.NONE : identityLink ? DataInfo.TransformType.STANDARDIZE : DataInfo.TransformType.NONE, //transform response for regression with identity link
            parms._missing_values_handling == DeepLearningParameters.MissingValuesHandling.Skip, //whether to skip missing
            false, // do not replace NAs in numeric cols with mean
            true,  // always add a bucket for missing values
            parms._weights_column != null, // observation weights
            parms._offset_column != null,
            parms._fold_column != null
      );
  }

  @Override protected void checkMemoryFootPrint() {
    if (_parms._checkpoint != null) return;
    long p = _train.degreesOfFreedom() - (_parms._autoencoder ? 0 : _train.lastVec().cardinality());
    String[][] dom = _train.domains();
    // hack: add the factor levels for the NAs
    for (int i=0; i<_train.numCols()-(_parms._autoencoder ? 0 : 1); ++i) {
      if (dom[i] != null) {
        p++;
      }
    }
//    assert(makeDataInfo(_train, _valid, _parms).fullN() == p);
    long output = _parms._autoencoder ? p : Math.abs(_train.lastVec().cardinality());
    // weights
    long model_size = p * _parms._hidden[0];
    int layer=1;
    for (; layer < _parms._hidden.length; ++layer)
      model_size += _parms._hidden[layer-1] * _parms._hidden[layer];
    model_size += _parms._hidden[layer-1] * output;

    // biases
    for (layer=0; layer < _parms._hidden.length; ++layer)
      model_size += _parms._hidden[layer];
    model_size += output;

    if (model_size > 1e8) {
      String msg = "Model is too large: " + model_size + " parameters. Try reducing the number of neurons in the hidden layers (or reduce the number of categorical factors).";
      error("_hidden", msg);
      cancel(msg);
    }
  }

  @Override
  public void modifyParmsForCrossValidationSplits(int i, int N, Key<Model> model_id) {
    super.modifyParmsForCrossValidationSplits(i, N, model_id);
    if (_parms._overwrite_with_best_model) {
      warn("_overwrite_with_best_model",
              "Disabling overwrite_with_best_model for cross-validation split " + (i+1) + "/" + N + ": No early stopping.");
      _parms._overwrite_with_best_model = false;
    }
  }

  @Override
  public void modifyParmsForCrossValidationMainModel(int N) {
    super.modifyParmsForCrossValidationMainModel(N);
    if (_parms._overwrite_with_best_model) {
      warn("_overwrite_with_best_model", "Disabling overwrite_with_best_model for cross-validation main model: No early stopping.");
      _parms._overwrite_with_best_model = false;
    }
  }

  public class DeepLearningDriver extends H2O.H2OCountedCompleter<DeepLearningDriver> {
    protected DeepLearningDriver() { super(true); } // bump priority of drivers
    @Override protected void compute2() {
      try {
        long cs = _parms.checksum();
        init(true);
        // Read lock input
        _parms.read_lock_frames(DeepLearning.this);
        // Something goes wrong
        if (error_count() > 0){
          DeepLearning.this.updateValidationMessages();
          throw H2OModelBuilderIllegalArgumentException.makeFromBuilder(DeepLearning.this);
        }
        buildModel();
        if (isRunning()) done();                 // Job done!
        //check that _parms isn't changed during DL model training
        long cs2 = _parms.checksum();
        assert(cs == cs2);
      } catch( Throwable t ) {
        Job thisJob = DKV.getGet(_key);
        if (thisJob._state == JobState.CANCELLED) {
          Log.info("Job cancelled by user.");
        } else {
          t.printStackTrace();
          failed(t);
          throw t;
        }
      } finally {
        updateModelOutput();
        _parms.read_unlock_frames(DeepLearning.this);
      }
      tryComplete();
    }

    Key self() { return _key; }
    /**
     * Train a Deep Learning model, assumes that all members are populated
     * If checkpoint == null, then start training a new model, otherwise continue from a checkpoint
     */
    public final void buildModel() {
      Scope.enter();
      DeepLearningModel cp = null;
      if (_parms._checkpoint == null) {
        cp = new DeepLearningModel(dest(), _parms, new DeepLearningModel.DeepLearningModelOutput(DeepLearning.this), _train, _valid, nclasses());
        cp.model_info().initializeMembers();
      } else {
        final DeepLearningModel previous = DKV.getGet(_parms._checkpoint);
        if (previous == null) throw new IllegalArgumentException("Checkpoint not found.");
        Log.info("Resuming from checkpoint.");
        new ProgressUpdate("Resuming from checkpoint").fork(_progressKey);

        if( isClassifier() != previous._output.isClassifier() )
          throw new IllegalArgumentException("Response type must be the same as for the checkpointed model.");
        if( isSupervised() != previous._output.isSupervised() )
          throw new IllegalArgumentException("Model type must be the same as for the checkpointed model.");

        // check the user-given arguments for consistency
        DeepLearningParameters oldP = previous._parms; //sanitized parameters for checkpointed model
        DeepLearningParameters newP = _parms; //user-given parameters for restart

        DeepLearningParameters oldP2 = (DeepLearningParameters)oldP.clone();
        DeepLearningParameters newP2 = (DeepLearningParameters)newP.clone();
        DeepLearningParameters.Sanity.modifyParms(oldP, oldP2, nclasses()); //sanitize the user-given parameters
        DeepLearningParameters.Sanity.modifyParms(newP, newP2, nclasses()); //sanitize the user-given parameters
        DeepLearningParameters.Sanity.checkpoint(oldP2, newP2);

        try {
          final DataInfo dinfo = makeDataInfo(_train, _valid, _parms);
          DKV.put(dinfo);
          cp = new DeepLearningModel(dest(), _parms, previous, false, dinfo);
          cp.write_lock(self());

          if (!Arrays.equals(cp._output._names, previous._output._names)) {
            throw new IllegalArgumentException("The columns of the training data must be the same as for the checkpointed model. Check ignored columns (or disable ignore_const_cols).");
          }
          if (!Arrays.deepEquals(cp._output._domains, previous._output._domains)) {
            throw new IllegalArgumentException("Categorical factor levels of the training data must be the same as for the checkpointed model.");
          }
          if (dinfo.fullN() != previous.model_info().data_info().fullN()) {
            throw new IllegalArgumentException("Total number of predictors is different than for the checkpointed model.");
          }

          // these are the mutable parameters that are to be used by the model (stored in model_info._parms)
          final DeepLearningParameters actualNewP = cp.model_info().get_params(); //actually used parameters for model building (defaults filled in, etc.)
          assert (actualNewP != previous.model_info().get_params());
          assert (actualNewP != newP);
          assert (actualNewP != oldP);
          DeepLearningParameters.Sanity.update(actualNewP, newP, nclasses());

          Log.info("Adding " + String.format("%.3f", previous.epoch_counter) + " epochs from the checkpointed model.");
          cp.update(self());
        } finally {
          if (cp != null) cp.unlock(self());
        }
      }
      trainModel(cp);

      // clean up, but don't delete the model and the training/validation model metrics
      List<Key> keep = new ArrayList<>();
      try {
        keep.add(dest());
        keep.add(cp.model_info().data_info()._key);
        // Do not remove training metrics
        keep.add(cp._output._training_metrics._key);
        // And validation model metrics
        if (cp._output._validation_metrics != null) {
          keep.add(cp._output._validation_metrics._key);
        }
        if (cp._output.weights != null && cp._output.biases != null) {
          for (Key k : Arrays.asList(cp._output.weights)) {
            keep.add(k);
            for (Vec vk : ((Frame) DKV.getGet(k)).vecs()) {
              keep.add(vk._key);
            }
          }
          for (Key k : Arrays.asList(cp._output.biases)) {
            keep.add(k);
            for (Vec vk : ((Frame) DKV.getGet(k)).vecs()) {
              keep.add(vk._key);
            }
          }
        }
      } finally {
        Scope.exit(keep.toArray(new Key[0]));
      }
    }

    /**
     * Train a Deep Learning neural net model
     * @param model Input model (e.g., from initModel(), or from a previous training run)
     * @return Trained model
     */
    public final DeepLearningModel trainModel(DeepLearningModel model) {
      Frame validScoreFrame = null;
      Frame train, trainScoreFrame;
      try {
//      if (checkpoint == null && !quiet_mode) logStart(); //if checkpoint is given, some Job's params might be uninitialized (but the restarted model's parameters are correct)
        if (model == null) {
          model = DKV.get(dest()).get();
        }
        Log.info("Model category: " + (_parms._autoencoder ? "Auto-Encoder" : isClassifier() ? "Classification" : "Regression"));
        final long model_size = model.model_info().size();
        Log.info("Number of model parameters (weights/biases): " + String.format("%,d", model_size));
        model.write_lock(self());
        new ProgressUpdate("Setting up training data...").fork(_progressKey);
        final DeepLearningParameters mp = model.model_info().get_params();

        // temporary frames of the same "name" as the orig _train/_valid (asking the parameter's Key, not the actual frame)
        // Note: don't put into DKV or they would overwrite the _train/_valid frames!
        Frame tra_fr = new Frame(mp._train, _train.names(), _train.vecs());
        Frame val_fr = _valid != null ? new Frame(mp._valid,_valid.names(), _valid.vecs()) : null;

        train = tra_fr;
        if (mp._force_load_balance) {
          new ProgressUpdate("Load balancing training data...").fork(_progressKey);
          train = reBalance(train, mp._replicate_training_data /*rebalance into only 4*cores per node*/, mp._train.toString() + "." + model._key.toString() + ".temporary.train");
        }
        if (model._output.isClassifier() && mp._balance_classes) {
          new ProgressUpdate("Balancing class distribution of training data...").fork(_progressKey);
          float[] trainSamplingFactors = new float[train.lastVec().domain().length]; //leave initialized to 0 -> will be filled up below
          if (mp._class_sampling_factors != null) {
            if (mp._class_sampling_factors.length != train.lastVec().domain().length)
              throw new IllegalArgumentException("class_sampling_factors must have " + train.lastVec().domain().length + " elements");
            trainSamplingFactors = mp._class_sampling_factors.clone(); //clone: don't modify the original
          }
          train = sampleFrameStratified(
                  train, train.lastVec(), train.vec(model._output.weightsName()), trainSamplingFactors, (long)(mp._max_after_balance_size*train.numRows()), mp._seed, true, false);
          Vec l = train.lastVec();
          Vec w = train.vec(model._output.weightsName());
          MRUtils.ClassDist cd = new MRUtils.ClassDist(l);
          model._output._modelClassDist = _weights != null ? cd.doAll(l, w).rel_dist() : cd.doAll(l).rel_dist();
        }
        model.training_rows = train.numRows();
        trainScoreFrame = sampleFrame(train, mp._score_training_samples, mp._seed); //training scoring dataset is always sampled uniformly from the training dataset
        if( trainScoreFrame != train ) _delete_me.add(trainScoreFrame);

        if (!_parms._quiet_mode) Log.info("Number of chunks of the training data: " + train.anyVec().nChunks());
        if (val_fr != null) {
          model.validation_rows = val_fr.numRows();
          // validation scoring dataset can be sampled in multiple ways from the given validation dataset
          if (model._output.isClassifier() && mp._balance_classes && mp._score_validation_sampling == DeepLearningParameters.ClassSamplingMethod.Stratified) {
            new ProgressUpdate("Sampling validation data (stratified)...").fork(_progressKey);
            validScoreFrame = sampleFrameStratified(val_fr, val_fr.lastVec(),  val_fr.vec(model._output.weightsName()), null,
                    mp._score_validation_samples > 0 ? mp._score_validation_samples : val_fr.numRows(), mp._seed +1, false /* no oversampling */, false);
          } else {
            new ProgressUpdate("Sampling validation data...").fork(_progressKey);
            validScoreFrame = sampleFrame(val_fr, mp._score_validation_samples, mp._seed +1);
            if( validScoreFrame != val_fr ) _delete_me.add(validScoreFrame);
          }
          if (mp._force_load_balance) {
            new ProgressUpdate("Balancing class distribution of validation data...").fork(_progressKey);
            validScoreFrame = reBalance(validScoreFrame, false /*always split up globally since scoring should be distributed*/, mp._valid.toString() + "." + model._key.toString() + ".temporary.valid");
          }
          if (!_parms._quiet_mode) Log.info("Number of chunks of the validation data: " + validScoreFrame.anyVec().nChunks());
        }

        // Set train_samples_per_iteration size (cannot be done earlier since this depends on whether stratified sampling is done)
        model.actual_train_samples_per_iteration = computeTrainSamplesPerIteration(mp, train.numRows(), model);
        // Determine whether shuffling is enforced
        if(mp._replicate_training_data && (model.actual_train_samples_per_iteration == train.numRows()*(mp._single_node_mode ?1:H2O.CLOUD.size())) && !mp._shuffle_training_data && H2O.CLOUD.size() > 1 && !mp._reproducible) {
          Log.info("Enabling training data shuffling, because all nodes train on the full dataset (replicated training data).");
          mp._shuffle_training_data = true;
        }
        if(!mp._shuffle_training_data && model.actual_train_samples_per_iteration == train.numRows() && train.anyVec().nChunks()==1) {
          Log.info("Enabling training data shuffling to avoid training rows in the same order over and over (no Hogwild since there's only 1 chunk).");
          mp._shuffle_training_data = true;
        }

        if (!mp._quiet_mode) Log.info("Initial model:\n" + model.model_info());
        if (_parms._autoencoder) {
          new ProgressUpdate("Scoring null model of autoencoder...").fork(_progressKey);
          Log.info("Scoring the null model of the autoencoder.");
          model.doScoring(trainScoreFrame, validScoreFrame, self(), null, 0); //get the null model reconstruction error
        }
        // put the initial version of the model into DKV
        model.update(self());
        model._timeLastScoreEnter = System.currentTimeMillis(); //to keep track of time per iteration, must be called before first call to doScoring
        Log.info("Starting to train the Deep Learning model.");
        new ProgressUpdate("Training...").fork(_progressKey);

        //main loop
        int iteration = 1;
        do {
          model.set_model_info(mp._epochs == 0 ? model.model_info() : H2O.CLOUD.size() > 1 && mp._replicate_training_data ? (mp._single_node_mode ?
                  new DeepLearningTask2(self(), train, model.model_info(), rowFraction(train, mp, model), iteration).doAll(Key.make(H2O.SELF)).model_info() : //replicated data + single node mode
                  new DeepLearningTask2(self(), train, model.model_info(), rowFraction(train, mp, model), iteration).doAllNodes(             ).model_info()): //replicated data + multi-node mode
                  new DeepLearningTask (self(),        model.model_info(), rowFraction(train, mp, model), iteration).doAll     (    train    ).model_info()); //distributed data (always in multi-node mode)
        }
        while (isRunning() && model.doScoring(trainScoreFrame, validScoreFrame, self(), _progressKey, iteration++));

        // replace the model with the best model so far (if it's better)
        if (isRunning() && _parms._overwrite_with_best_model && model.actual_best_model_key != null && _parms._nfolds == 0) {
          DeepLearningModel best_model = DKV.getGet(model.actual_best_model_key);
          if (best_model != null && best_model.error() < model.error() && Arrays.equals(best_model.model_info().units, model.model_info().units)) {
            if (!_parms._quiet_mode) {
              Log.info("Setting the model to be the best model so far (based on scoring history).");
            }
            DeepLearningModelInfo mi = best_model.model_info().deep_clone();
            // Don't cheat - count full amount of training samples, since that's the amount of training it took to train (without finding anything better)
            mi.set_processed_global(model.model_info().get_processed_global());
            mi.set_processed_local(model.model_info().get_processed_local());
            model.set_model_info(mi);
            model.update(self());
            model.doScoring(trainScoreFrame, validScoreFrame, self(), _progressKey, iteration);
            assert(best_model.error() == model.error());
          }
        }

        if (!_parms._quiet_mode) {
          Log.info("==============================================================================================================================================================================");
          if (isCancelledOrCrashed()) {
            Log.info("Deep Learning model training was interrupted.");
          } else {
            Log.info("Finished training the Deep Learning model (" + iteration + " Map/Reduce iterations)");
            Log.info(model);
          }
          Log.info("==============================================================================================================================================================================");
        }
      }
      finally {
        if (model != null) {
          model.deleteElasticAverageModels();
          model.unlock(self());
          if (model.actual_best_model_key != null) {
            assert (model.actual_best_model_key != model._key);
            DKV.remove(model.actual_best_model_key);
          }
        }
        for (Frame f : _delete_me) f.delete(); //delete internally rebalanced frames
      }
      return model;
    }
    transient HashSet<Frame> _delete_me = new HashSet<>();

    /**
     * Rebalance a frame for load balancing
     * @param fr Input frame
     * @param local whether to only create enough chunks to max out all cores on one node only
     * @return Frame that has potentially more chunks
     */
    private Frame reBalance(final Frame fr, boolean local, final String name) {
      int chunks = (int)Math.min( 4 * H2O.NUMCPUS * (local ? 1 : H2O.CLOUD.size()), fr.numRows());
      if (fr.anyVec().nChunks() > chunks && !_parms._reproducible) {
        Log.info("Dataset already contains " + fr.anyVec().nChunks() + " chunks. No need to rebalance.");
        return fr;
      } else if (_parms._reproducible) {
        Log.warn("Reproducibility enforced - using only 1 thread - can be slow.");
        chunks = 1;
      }
      if (!_parms._quiet_mode) Log.info("ReBalancing dataset into (at least) " + chunks + " chunks.");
      Key newKey = Key.make(name + ".chunks" + chunks);
      RebalanceDataSet rb = new RebalanceDataSet(fr, newKey, chunks);
      H2O.submitTask(rb);
      rb.join();
      Frame f = DKV.get(newKey).get();
      _delete_me.add(f);
      return f;
    }

    /**
     * Compute the actual train_samples_per_iteration size from the user-given parameter
     * @param mp Model parameter (DeepLearning object)
     * @param numRows number of training rows
     * @param model DL model
     * @return The total number of training rows to be processed per iteration (summed over on all nodes)
     */
    private long computeTrainSamplesPerIteration(final DeepLearningParameters mp, final long numRows, final DeepLearningModel model) {
      long tspi = mp._train_samples_per_iteration;
      assert(tspi == 0 || tspi == -1 || tspi == -2 || tspi >= 1);
      if (tspi == 0 || (!mp._replicate_training_data && tspi == -1) ) {
        tspi = numRows;
        if (!mp._quiet_mode) Log.info("Setting train_samples_per_iteration (" + mp._train_samples_per_iteration + ") to one epoch: #rows (" + tspi + ").");
      }
      else if (tspi == -1) {
        tspi = (mp._single_node_mode ? 1 : H2O.CLOUD.size()) * numRows;
        if (!mp._quiet_mode) Log.info("Setting train_samples_per_iteration (" + mp._train_samples_per_iteration + ") to #nodes x #rows (" + tspi + ").");
      } else if (tspi == -2) {
        // automatic tuning based on CPU speed, network speed and model size

        // measure cpu speed
        double total_gflops = 0;
        for (H2ONode h2o : H2O.CLOUD._memary) {
          HeartBeat hb = h2o._heartbeat;
          total_gflops += hb._gflops;
        }
        if (mp._single_node_mode) total_gflops /= H2O.CLOUD.size();
        if (total_gflops == 0) {
          total_gflops = Linpack.run(H2O.SELF._heartbeat._cpus_allowed) * (mp._single_node_mode ? 1 : H2O.CLOUD.size());
        }

        final long model_size = model.model_info().size();
        int[] msg_sizes = new int[]{ 1, (int)(model_size*4) == (model_size*4) ? (int)(model_size*4) : Integer.MAX_VALUE };
        double[] microseconds_collective = new double[msg_sizes.length];
        NetworkTest.NetworkTester nt = new NetworkTest.NetworkTester(msg_sizes,null,microseconds_collective,model_size>1e6 ? 1 : 5 /*repeats*/,false,true /*only collectives*/);
        nt.compute2();

        //length of the network traffic queue based on log-tree rollup (2 log(nodes))
        int network_queue_length = mp._single_node_mode || H2O.CLOUD.size() == 1? 1 : 2*(int)Math.floor(Math.log(H2O.CLOUD.size())/Math.log(2));

        // heuristics
        double flops_overhead_per_row = 30;
        if (mp._activation == DeepLearningParameters.Activation.Maxout || mp._activation == DeepLearningParameters.Activation.MaxoutWithDropout) {
          flops_overhead_per_row *= 8;
        } else if (mp._activation == DeepLearningParameters.Activation.Tanh || mp._activation == DeepLearningParameters.Activation.TanhWithDropout) {
          flops_overhead_per_row *= 5;
        }

        // target fraction of comm vs cpu time: 5%
        double fraction = mp._single_node_mode || H2O.CLOUD.size() == 1 ? 1e-3 : mp._target_ratio_comm_to_comp; //one single node mode, there's no model averaging effect, so less need to shorten the M/R iteration

        // estimate the time for communication (network) and training (compute)
        model.time_for_communication_us = (H2O.CLOUD.size() == 1 ? 1e4 /* add 10ms for single-node */ : 0) + network_queue_length * microseconds_collective[1];
        double time_per_row_us  = flops_overhead_per_row * model_size / (total_gflops * 1e9) / H2O.SELF._heartbeat._cpus_allowed * 1e6;

        // compute the optimal number of training rows per iteration
        // fraction := time_comm_us / (time_comm_us + tspi * time_per_row_us)  ==>  tspi = (time_comm_us/fraction - time_comm_us)/time_per_row_us
        tspi = (long)((model.time_for_communication_us / fraction - model.time_for_communication_us)/ time_per_row_us);

        tspi = Math.min(tspi, (mp._single_node_mode ? 1 : H2O.CLOUD.size()) * numRows * 10); //not more than 10x of what train_samples_per_iteration=-1 would do

        // If the number is close to a multiple of epochs, use that -> prettier scoring
        if (tspi > numRows && Math.abs(tspi % numRows)/(double)numRows < 0.2)  tspi = tspi - tspi % numRows;
        tspi = Math.min(tspi, (long)(mp._epochs * numRows / 10)); //limit to number of epochs desired, but at least 10 iterations total
        if (H2O.CLOUD.size() == 1 || mp._single_node_mode) {
          tspi = Math.min(tspi, 10*(int)(1e6/time_per_row_us)); //in single-node mode, only run for at most 10 seconds
        }
        tspi = Math.max(1, tspi); //at least 1 row
        tspi = Math.min(100000, tspi); //at most 100k rows for initial guess - can always relax later on

        if (!mp._quiet_mode) {
          Log.info("Auto-tuning parameter 'train_samples_per_iteration':");
          Log.info("Estimated compute power : " + (int)total_gflops + " GFlops");
          Log.info("Estimated time for comm : " + PrettyPrint.usecs((long) model.time_for_communication_us));
          Log.info("Estimated time per row  : " + ((long)time_per_row_us > 0 ? PrettyPrint.usecs((long) time_per_row_us) : time_per_row_us + " usecs"));
          Log.info("Estimated training speed: " + (int)(1e6/time_per_row_us) + " rows/sec");
          Log.info("Setting train_samples_per_iteration (" + mp._train_samples_per_iteration + ") to auto-tuned value: " + tspi);
        }

      } else {
        // limit user-given value to number of epochs desired
        tspi = Math.max(1, Math.min(tspi, (long) (mp._epochs * numRows)));
      }
      assert(tspi != 0 && tspi != -1 && tspi != -2 && tspi >= 1);
      model.tspiGuess = tspi;
      return tspi;
    }

    /**
     * Compute the fraction of rows that need to be used for training during one iteration
     * @param numRows number of training rows
     * @param train_samples_per_iteration number of training rows to be processed per iteration
     * @param replicate_training_data whether of not the training data is replicated on each node
     * @return fraction of rows to be used for training during one iteration
     */
    private float computeRowUsageFraction(final long numRows, final long train_samples_per_iteration, final boolean replicate_training_data) {
      float rowUsageFraction = (float)train_samples_per_iteration / numRows;
      if (replicate_training_data) rowUsageFraction /= H2O.CLOUD.size();
      assert(rowUsageFraction > 0);
      return rowUsageFraction;
    }
    private float rowFraction(Frame train, DeepLearningParameters p, DeepLearningModel m) {
      return computeRowUsageFraction(train.numRows(), m.actual_train_samples_per_iteration, p._replicate_training_data);
    }
  }
}


text:
> Create beautiful LaTeX documents with Markdown

WriTeX gives you a workflow for creating print documents (PDF) super-easily; the power of LaTeX with the simplicity of Markdown.

## Setup

Install the WriTeX CLI globally using npm:

```
npm install -g writex
```

WriTeX makes use of [Pandoc](http://johnmacfarlane.net/pandoc/) and LaTeX. [Download and install Pandoc from here.](http://johnmacfarlane.net/pandoc/installing.html). LaTeX comes in different distributions; I recommend [TeX Live](http://www.tug.org/texlive/) for Linux, [MacTeX](https://tug.org/mactex/) for Mac OS X, and [MiKTeX](http://miktex.org/) for Windows.

## Scaffolding a new project

Besides the WriTeX CLI, you will also need a WriTeX template for your document. Templates are installed via npm and you can [find a list of available templates here](https://www.npmjs.com/browse/keyword/writex-template).

> At the time being, project scaffolding is not yet implemented. However, you can manually install the template and copy the config file into the project directory as follows (using the writex-article template as an example):
> 1. Install the template `npm install --save-dev writex-template`
> 2. Copy config file  `cp node_modules/writex-template/writex.yaml ./`

## Writing and Configuring

If your project is set up, you can start writing. All your content belongs in Markdown files with the `.md` suffix. The filenames should be prefixed by a number, so that they are ordered properly (otherwise, WriTeX will not compile them into the `\begin{document} ... \end{document}` area of your LaTeX document):

```
my-project/
- 0-introduction.md
- 1-research.md
- 2-design.md
- 3-implementation.md
- 4-evaluation.md
- 5-conclusion.md
- references.bib
- writex.yaml
```

### Configuration

You can configure some basic parameters of your project in the `writex.yaml` file. Some parameters are necessary for every WriTeX project, some are specific to a certain template. The values under `document` are used by the template to fill certain fields. They depend very much on the used template; an article needs different metadata than, for example, a letter.

An exemplary WriTeX config file:

```yaml
template: article
abstract: false
bibtex: false
engine: xelatex
document:
  author: Arthur Authory
  date: \today
  title: A splendid article
  subtitle: How to write a headline that means absolutely nothing
```

In this example, both `document` and `abstract` are specific to the template ([writex-article](https://github.com/tvooo/writex-article)). All other parameters are universal WriTeX parameters.

### Bibliographies

For the time being, WriTeX supports BibLaTeX bibliographies via `biber`. You can enable them in the config file, setting `bibtex` to `true`. The BibLaTeX file **must** be named `references.bib`. WriTeX will automatically take care of the proper compilation: `latex->biber->latex->latex`.

This is intented to become more flexible in the future, with support for `bibtex` and configurable filenames as well.

### Special content

There are some occasions where your template provides space for special content that does not belong into the regular flow of your document. One such example is an *abstract*, as implemented by the [writex-article](https://github.com/tvooo/writex-article) template.

Special content must not be prefixed by a number, so that it is not included in the `\begin{document} ... \end{document}` area of your LaTeX document.

> **Example:** To enable the use of an *abstract* in the [writex-article](https://github.com/tvooo/writex-article) template, you have to create a file `abstract.md`, fill it with your abstract, and set the `abstract` field in the `writex.yaml` config file to `true`.

For information on the special content that is supported by your template, refer to your template's README.

## Compiling

So you are all set, a first draft is written and you want to see how your PDF looks?

Simply run WriTeX in your project folder:

```
writex
```

It will run through all the steps necessary and spit out your PDF in the end.

### Watch and compile

WriTeX can watch for changes to your Markdown files and compile the new version of your PDF document automatically, which is quite convenient:

```
writex watch
```

## Future plans

I've got quite a bit planned for WriTeX, mostly for my own convenience:

* `writex-acm`, a template for creating ACM research papers
* `writex-book`, a template based on KOMA-Script's `scrbook` document type
* `writex-tvooo-book`, a variation of `writex-book` with custom fonts and a custom title page, glossaries etc.
* `writex-tvooo-article`, a variation of `writex-article` with custom fonts
* Scaffolding of your own WriTeX templates
* Scaffolding of a project using an existing template
* A little website with a nice, illustratory explanation
* Maybe offer the whole process online; on-the-fly PDF generation from pasted Markdown, with your chosen template


text:
import ensurepip

if __name__ == "__main__":
    ensurepip._main()


text: <select name="game" class="game" data-bind="options: GameList, optionsText: 'Name', value: SelectedGame"></select>


text:
@interface PodsDummy_TMKit : NSObject
@end
@implementation PodsDummy_TMKit
@end


text:
package io.cdap.wrangler.statistics;

import io.cdap.wrangler.api.Row;
import io.dataapps.chlorine.finder.FinderEngine;

import java.util.List;
import java.util.Map;

/**
 * Created by nitin on 2/4/17.
 */
public class BasicStatistics implements Statistics {
  private final FinderEngine engine;

  public BasicStatistics() throws Exception {
    engine = new FinderEngine("wrangler-finder.xml", true, false);
  }

  @Override
  public Row aggregate(List<Row> rows) {
    ColumnMetric types = new ColumnMetric();
    ColumnMetric stats = new ColumnMetric();

    Double count = new Double(0);
    for (Row row : rows) {
      ++count;
      for (int i = 0; i < row.length(); ++i) {
        String column = row.getColumn(i);
        Object object = row.getValue(i);

        if (object == null) {
          stats.increment(column, "null");
        } else {
          stats.increment(column, "non-null");
        }

        if (object instanceof String) {
          String value = ((String) object);
          if (value.isEmpty()) {
            stats.increment(column, "empty");
          } else {
            Map<String, List<String>> finds = engine.findWithType(value);
            for (String find : finds.keySet()) {
              types.increment(column, find);
            }
          }
        }
      }
    }

    Row rowTypes = new Row();
    for (String column : types.getColumns()) {
      rowTypes.add(column, types.percentage(column, count));
    }

    Row rowStats = new Row();
    for (String column : stats.getColumns()) {
      rowStats.add(column, stats.percentage(column, count));
    }

    Row row = new Row();
    row.add("types", rowTypes);
    row.add("stats", rowStats);
    row.add("total", count);

    return row;
  }
}


text:
Wordpress plugin for the twitter-api-php

For more information about twitter-api-php refer to https://github.com/J7mbo/twitter-api-php

This plugin just permits you to set your twitter api credentials from the wordpress backend.

The aim of this wp plugin is simple. You need to:

- Enable the plugin
- Create a twitter app on the twitter developer site
- Grab your access tokens from the twitter developer site
- Configure them in your Wordpress backend
- Access the twitter api client via yourWordpress.com/path/to/plugin/folder/wp-twitter-api/api.php?search=ANYTHING

The response is exactly the same as you get wtih the twitter-api-php of J7mbo and is in JSON.

More endpoints will follow.


text:
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using ClaySharp;

namespace Orchard.DisplayManagement.Shapes {
    public class ShapeDebugView {
        private readonly Shape _shape;

        public ShapeDebugView(Shape shape) {
            _shape = shape;
        }

        public ShapeMetadata Metadata { get { return _shape.Metadata; } }

        public string Id { get { return _shape.Id; } }
        public IList<string> Classes { get { return _shape.Classes; } }
        public IDictionary<string, string> Attributes { get { return _shape.Attributes; } }
        public IEnumerable<dynamic> Items { get { return _shape.Items; } }

        [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
        public KeyValuePairs[] ClayProperties {
            get {
                var members = new Dictionary<string, object>();
                ((IClayBehaviorProvider)_shape).Behavior.GetMembers(() => null, _shape, members);

                return members.Keys.Select(key => new KeyValuePairs(key, members[key])).ToArray();
            }
        }

        [DebuggerDisplay(" { _shapeType == null ? _value : \"Shape: \" + _shapeType}", Name = "{_key,nq}")]
        public class KeyValuePairs {

            public KeyValuePairs(object key, object value) {
                try {
                    var dynProxyGetTarget = value.GetType().GetMethod("DynProxyGetTarget");
                    if (dynProxyGetTarget != null) {
                        _value = dynProxyGetTarget.Invoke(value, null);
                        _shapeType = ((IShape)_value).Metadata.Type;
                    }
                    else {
                        _value = value;
                    }
                }
                catch {
                    _value = value;
                }

                _key = key;
            }

            [DebuggerBrowsable(DebuggerBrowsableState.Never)]
            private object _key;

            [DebuggerBrowsable(DebuggerBrowsableState.Never)]
            private object _shapeType;

            [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
            private object _value;
        }
    }
}


text:
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields
import uuid

class Migration(migrations.Migration):

    dependencies = [("conference", "0007_remove_special_place")]

    operations = [
        migrations.CreateModel(
            name="News",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "created",
                    model_utils.fields.AutoCreatedField(
                        default=django.utils.timezone.now,
                        editable=False,
                        verbose_name="created",
                    ),
                ),
                (
                    "modified",
                    model_utils.fields.AutoLastModifiedField(
                        default=django.utils.timezone.now,
                        editable=False,
                        verbose_name="modified",
                    ),
                ),
                (
                    "uuid",
                    models.CharField(
                        default=uuid.uuid4, max_length=40, unique=True
                    ),
                ),
                ("title", models.CharField(max_length=255)),
                ("slug", models.SlugField()),
                ("content", models.TextField()),
                (
                    "status",
                    models.PositiveIntegerField(
                        choices=[
                            (0, "Draft"),
                            (10, "Published"),
                            (20, "Deleted"),
                        ]
                    ),
                ),
                (
                    "published_date",
                    models.DateTimeField(blank=True, null=True),
                ),
                (
                    "conference",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="conference.Conference",
                    ),
                ),
            ],
            options={"ordering": ["-published_date"]},
        )
    ]