text:
- [Material Design guidelines: Lists](https://material.io/guidelines/components/lists.html)
- [Material Components Web](https://material.io/components/web/catalog/lists/)

### Usage

**Example: Settings Page**

```
<demo-mobile class='demo-settings-page'>
  <List avatarList>
    <List.Item>
      <List.Item.StartDetail component='img' src='https://www.google.com/images/branding/googleg/1x/googleg_standard_color_128dp.png' />
      <List.Item.Text>
        Guten Ye
        <List.Item.Text.Secondary>Apple Id, iCloud, iTunes & App Store</List.Item.Text.Secondary>
      </List.Item.Text>
      <List.Item.EndDetail className='material-icons'>keyboard_arrow_right</List.Item.EndDetail>
    </List.Item>
  </List>
  <seperator />

  <List>
    <List.Item>
      <List.Item.StartDetail className='material-icons'>network_wifi</List.Item.StartDetail>
      Wi-Fi
      <List.Item.EndDetail className='material-icons'>keyboard_arrow_right</List.Item.EndDetail>
    </List.Item>
    <List.Divider inset />
    <List.Item>
      <List.Item.StartDetail className='material-icons'>bluetooth</List.Item.StartDetail>
      Bluetooth
      <List.Item.EndDetail className='material-icons'>keyboard_arrow_right</List.Item.EndDetail>
    </List.Item>
  </List>
</demo-mobile>
```

**Single-line List**

```
window.List = require('./index').default;
<div>
<List>
  {_.times(2).map(i =>
    <List.Item key={i}>Hello</List.Item>
  )}
</List>

<h>Start Detail</h>
<List>
  {_.times(2).map(i =>
    <List.Item key={i}>
      <List.Item.StartDetail className='material-icons'>network_wifi</List.Item.StartDetail>
      Hello
   </List.Item>
  )}
</List>

<h>Avatar List</h>
<List avatarList>
  {_.times(2).map(i =>
    <List.Item key={i}>
      <List.Item.StartDetail component='img' src='http://via.placeholder.com/40x40' />
      Hello
   </List.Item>
  )}
</List>

<h>End Detail</h>
<List>
  {_.times(2).map(i =>
    <List.Item key={i}>
      Hello
      <List.Item.EndDetail className='material-icons'>favorite_border</List.Item.EndDetail>
   </List.Item>
  )}
</List>

<h>Start Detail + End Detail</h>
<List>
  {_.times(2).map(i =>
    <List.Item key={i}>
      <List.Item.StartDetail className='bg1' />
      Hello
      <List.Item.EndDetail className='material-icons'>favorite_border</List.Item.EndDetail>
   </List.Item>
  )}
</List>
</div>
```

**Two-line List**

```
<div>
<List>
  {_.times(2).map(i =>
    <List.Item key={i}>
      <List.Item.Text>
        Hello
        <List.Item.Text.Secondary>Secondary Text</List.Item.Text.Secondary>
      </List.Item.Text>
    </List.Item>
  )}
</List>
</div>
```

**List Dividers**

```
<div>
<List>
  <List.Item>Hello</List.Item>
  <List.Divider />
  <List.Item>Hello</List.Item>
</List>

<List>
  <List.Item><List.Item.StartDetail className='bg1' />Hello</List.Item>
  <List.Divider inset />
  <List.Item><List.Item.StartDetail className='bg1' />Hello</List.Item>
</List>
</div>
```

**List Groups**

```
<List.Group>
  <List.Group.Subheader>List 1</List.Group.Subheader>
  <List>{_.times(2).map(i => <List.Item key={i}><List.Item.StartDetail className='bg1' />Hello</List.Item>)}</List>

  <List.Divider inset component='hr' />

  <List.Group.Subheader>List 2</List.Group.Subheader>
  <List>{_.times(2).map(i => <List.Item key={i}><List.Item.StartDetail className='bg1' />Hello</List.Item>)}</List>
</List.Group>
```

**With custom component**

```
<List>
  <List.Item component='a' href='#link-a'>Link A</List.Item>
  <List.Item component='a' href='#link-b'>Link B</List.Item>
</List>
```


text:
using System;
using System.Globalization;
using System.Management.Automation;
using Microsoft.Management.Infrastructure;

namespace Microsoft.PowerShell.Cmdletization.Cim
{
    internal class CimJobContext
    {
        internal CimJobContext(
            CimCmdletInvocationContext cmdletInvocationContext,
            CimSession session,
            object targetObject)
        {
            this.CmdletInvocationContext = cmdletInvocationContext;

            this.Session = session;
            this.TargetObject = targetObject ?? this.ClassName;
        }

        public CimCmdletInvocationContext CmdletInvocationContext { get; private set; }

        public CimSession Session { get; private set; }
        public object TargetObject { get; private set; }

        public string ClassName
        {
            get
            {
                return GetCimClassName(this.CmdletInvocationContext.CmdletDefinitionContext.CmdletizationClassName);
            }
        }

        public string ClassNameOrNullIfResourceUriIsUsed
        {
            get
            {
                if (this.CmdletInvocationContext.CmdletDefinitionContext.ResourceUri != null)
                {
                    return null;
                }
                return this.ClassName;
            }
        }

        public string Namespace
        {
            get
            {
                if (!string.IsNullOrEmpty(this.CmdletInvocationContext.NamespaceOverride))
                {
                    return this.CmdletInvocationContext.NamespaceOverride;
                }
                return GetCimNamespace(this.CmdletInvocationContext.CmdletDefinitionContext.CmdletizationClassName);
            }
        }

        private static void ExtractCimNamespaceAndClassName(string cmdletizationClassName, out string cimNamespace, out string cimClassName)
        {
            int indexOfLastBackslash = cmdletizationClassName.LastIndexOf('\\');
            int indexOfLastForwardSlash = cmdletizationClassName.LastIndexOf('/');
            int indexOfLastSeparator = Math.Max(indexOfLastBackslash, indexOfLastForwardSlash);
            if (indexOfLastSeparator != (-1))
            {
                cimNamespace = cmdletizationClassName.Substring(0, indexOfLastSeparator);
                cimClassName = cmdletizationClassName.Substring(indexOfLastSeparator + 1, cmdletizationClassName.Length - indexOfLastSeparator - 1);
            }
            else
            {
                cimNamespace = null;
                cimClassName = cmdletizationClassName;
            }
        }

        private static string GetCimClassName(string cmdletizationClassName)
        {
            string throwAway;
            string cimClassName;
            ExtractCimNamespaceAndClassName(cmdletizationClassName, out throwAway, out cimClassName);
            return cimClassName;
        }

        private static string GetCimNamespace(string cmdletizationClassName)
        {
            string cimNamespace;
            string throwAway;
            ExtractCimNamespaceAndClassName(cmdletizationClassName, out cimNamespace, out throwAway);
            return cimNamespace;
        }

        internal string PrependComputerNameToMessage(string message)
        {
            string computerName = this.Session.ComputerName;
            if (computerName == null)
            {
                return message;
            }

            return string.Format(
                CultureInfo.InvariantCulture,
                CmdletizationResources.CimJob_ComputerNameConcatenationTemplate,
                computerName,
                message);
        }

        public InvocationInfo CmdletInvocationInfo
        {
            get { return this.CmdletInvocationContext.CmdletInvocationInfo; }
        }

        public string CmdletizationClassName
        {
            get { return this.CmdletInvocationContext.CmdletDefinitionContext.CmdletizationClassName; }
        }

        public Version CmdletizationModuleVersion
        {
            get { return this.CmdletInvocationContext.CmdletDefinitionContext.CmdletizationModuleVersion; }
        }

        public ActionPreference ErrorActionPreference
        {
            get { return this.CmdletInvocationContext.ErrorActionPreference; }
        }

        public ActionPreference WarningActionPreference
        {
            get { return this.CmdletInvocationContext.WarningActionPreference; }
        }

        public ActionPreference VerboseActionPreference
        {
            get { return this.CmdletInvocationContext.VerboseActionPreference; }
        }

        public ActionPreference DebugActionPreference
        {
            get { return this.CmdletInvocationContext.DebugActionPreference; }
        }

        public bool IsRunningInBackground
        {
            get { return this.CmdletInvocationContext.IsRunningInBackground; }
        }

        public MshCommandRuntime.ShouldProcessPossibleOptimization ShouldProcessOptimization
        {
            get { return this.CmdletInvocationContext.ShouldProcessOptimization; }
        }

        public bool ShowComputerName
        {
            get { return this.CmdletInvocationContext.ShowComputerName; }
        }

        public bool SupportsShouldProcess
        {
            get { return this.CmdletInvocationContext.CmdletDefinitionContext.SupportsShouldProcess; }
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
using Newtonsoft.Json;

namespace Bot.Builder.ChannelConnector.Facebook.Schema
{
    public class FacebookAccount
    {
        [JsonProperty("id")]
        public string Id { get; set; }
    }
}


text:
using System.Reflection;
using System.Runtime.InteropServices;

[assembly: AssemblyTitle("Microsoft.Xaml.Interactions.DesignTools")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Microsoft.Xaml.Interactions.DesignTools")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2015-2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("b6f7c183-33a0-4942-b680-97bea6011890")]


text:
/**
 */
package CIM15.IEC61968.Customers;

import CIM15.IEC61968.Common.Document;

import CIM15.IEC61968.Metering.ServiceDeliveryPoint;

import CIM15.IEC61968.PaymentMetering.Transaction;

import java.util.Collection;

import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.util.BasicInternalEList;
import org.eclipse.emf.ecore.util.InternalEList;

/**
 *
 * A representation of the model object 'Pricing Structure'.
 *
 *
 *

 * The following features are supported:
 *

 *
{@link CIM15.IEC61968.Customers.PricingStructure#getDailyFloorUsage Daily Floor Usage}

 *
{@link CIM15.IEC61968.Customers.PricingStructure#getDailyCeilingUsage Daily Ceiling Usage}

 *
{@link CIM15.IEC61968.Customers.PricingStructure#getServiceCategory Service Category}

 *
{@link CIM15.IEC61968.Customers.PricingStructure#isTaxExemption Tax Exemption}

 *
{@link CIM15.IEC61968.Customers.PricingStructure#getCode Code}

 *
{@link CIM15.IEC61968.Customers.PricingStructure#getCustomerAgreements Customer Agreements}

 *
{@link CIM15.IEC61968.Customers.PricingStructure#getServiceDeliveryPoints Service Delivery Points}

 *
{@link CIM15.IEC61968.Customers.PricingStructure#getTariffs Tariffs}

 *
{@link CIM15.IEC61968.Customers.PricingStructure#getTransactions Transactions}

 *
{@link CIM15.IEC61968.Customers.PricingStructure#getDailyEstimatedUsage Daily Estimated Usage}

 *
{@link CIM15.IEC61968.Customers.PricingStructure#getRevenueKind Revenue Kind}

 *

 *

 *
 * @generated
 */
public class PricingStructure extends Document {
	/**
	 * The default value of the '{@link #getDailyFloorUsage() Daily Floor Usage}' attribute.
	 *
	 *
	 * @see #getDailyFloorUsage()
	 * @generated
	 * @ordered
	 */
	protected static final int DAILY_FLOOR_USAGE_EDEFAULT = 0;

	/**
	 * The cached value of the '{@link #getDailyFloorUsage() Daily Floor Usage}' attribute.
	 *
	 *
	 * @see #getDailyFloorUsage()
	 * @generated
	 * @ordered
	 */
	protected int dailyFloorUsage = DAILY_FLOOR_USAGE_EDEFAULT;

	/**
	 * This is true if the Daily Floor Usage attribute has been set.
	 *
	 *
	 * @generated
	 * @ordered
	 */
	protected boolean dailyFloorUsageESet;

	/**
	 * The default value of the '{@link #getDailyCeilingUsage() Daily Ceiling Usage}' attribute.
	 *
	 *
	 * @see #getDailyCeilingUsage()
	 * @generated
	 * @ordered
	 */
	protected static final int DAILY_CEILING_USAGE_EDEFAULT = 0;

	/**
	 * The cached value of the '{@link #getDailyCeilingUsage() Daily Ceiling Usage}' attribute.
	 *
	 *
	 * @see #getDailyCeilingUsage()
	 * @generated
	 * @ordered
	 */
	protected int dailyCeilingUsage = DAILY_CEILING_USAGE_EDEFAULT;

	/**
	 * This is true if the Daily Ceiling Usage attribute has been set.
	 *
	 *
	 * @generated
	 * @ordered
	 */
	protected boolean dailyCeilingUsageESet;

	/**
	 * The cached value of the '{@link #getServiceCategory() Service Category}' reference.
	 *
	 *
	 * @see #getServiceCategory()
	 * @generated
	 * @ordered
	 */
	protected ServiceCategory serviceCategory;

	/**
	 * The default value of the '{@link #isTaxExemption() Tax Exemption}' attribute.
	 *
	 *
	 * @see #isTaxExemption()
	 * @generated
	 * @ordered
	 */
	protected static final boolean TAX_EXEMPTION_EDEFAULT = false;

	/**
	 * The cached value of the '{@link #isTaxExemption() Tax Exemption}' attribute.
	 *
	 *
	 * @see #isTaxExemption()
	 * @generated
	 * @ordered
	 */
	protected boolean taxExemption = TAX_EXEMPTION_EDEFAULT;

	/**
	 * This is true if the Tax Exemption attribute has been set.
	 *
	 *
	 * @generated
	 * @ordered
	 */
	protected boolean taxExemptionESet;

	/**
	 * The default value of the '{@link #getCode() Code}' attribute.
	 *
	 *
	 * @see #getCode()
	 * @generated
	 * @ordered
	 */
	protected static final String CODE_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getCode() Code}' attribute.
	 *
	 *
	 * @see #getCode()
	 * @generated
	 * @ordered
	 */
	protected String code = CODE_EDEFAULT;

	/**
	 * This is true if the Code attribute has been set.
	 *
	 *
	 * @generated
	 * @ordered
	 */
	protected boolean codeESet;

	/**
	 * The cached value of the '{@link #getCustomerAgreements() Customer Agreements}' reference list.
	 *
	 *
	 * @see #getCustomerAgreements()
	 * @generated
	 * @ordered
	 */
	protected EList<CustomerAgreement> customerAgreements;

	/**
	 * The cached value of the '{@link #getServiceDeliveryPoints() Service Delivery Points}' reference list.
	 *
	 *
	 * @see #getServiceDeliveryPoints()
	 * @generated
	 * @ordered
	 */
	protected EList<ServiceDeliveryPoint> serviceDeliveryPoints;

	/**
	 * The cached value of the '{@link #getTariffs() Tariffs}' reference list.
	 *
	 *
	 * @see #getTariffs()
	 * @generated
	 * @ordered
	 */
	protected EList<Tariff> tariffs;

	/**
	 * The cached value of the '{@link #getTransactions() Transactions}' reference list.
	 *
	 *
	 * @see #getTransactions()
	 * @generated
	 * @ordered
	 */
	protected EList<Transaction> transactions;

	/**
	 * The default value of the '{@link #getDailyEstimatedUsage() Daily Estimated Usage}' attribute.
	 *
	 *
	 * @see #getDailyEstimatedUsage()
	 * @generated
	 * @ordered
	 */
	protected static final int DAILY_ESTIMATED_USAGE_EDEFAULT = 0;

	/**
	 * The cached value of the '{@link #getDailyEstimatedUsage() Daily Estimated Usage}' attribute.
	 *
	 *
	 * @see #getDailyEstimatedUsage()
	 * @generated
	 * @ordered
	 */
	protected int dailyEstimatedUsage = DAILY_ESTIMATED_USAGE_EDEFAULT;

	/**
	 * This is true if the Daily Estimated Usage attribute has been set.
	 *
	 *
	 * @generated
	 * @ordered
	 */
	protected boolean dailyEstimatedUsageESet;

	/**
	 * The default value of the '{@link #getRevenueKind() Revenue Kind}' attribute.
	 *
	 *
	 * @see #getRevenueKind()
	 * @generated
	 * @ordered
	 */
	protected static final RevenueKind REVENUE_KIND_EDEFAULT = RevenueKind.IRRIGATION;

	/**
	 * The cached value of the '{@link #getRevenueKind() Revenue Kind}' attribute.
	 *
	 *
	 * @see #getRevenueKind()
	 * @generated
	 * @ordered
	 */
	protected RevenueKind revenueKind = REVENUE_KIND_EDEFAULT;

	/**
	 * This is true if the Revenue Kind attribute has been set.
	 *
	 *
	 * @generated
	 * @ordered
	 */
	protected boolean revenueKindESet;

	/**
	 *
	 *
	 * @generated
	 */
	protected PricingStructure() {
		super();
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return CustomersPackage.Literals.PRICING_STRUCTURE;
	}

	/**
	 * Returns the value of the 'Daily Floor Usage' attribute.
	 *
	 *

	 * If the meaning of the 'Daily Floor Usage' attribute isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Daily Floor Usage' attribute.
	 * @see #isSetDailyFloorUsage()
	 * @see #unsetDailyFloorUsage()
	 * @see #setDailyFloorUsage(int)
	 * @generated
	 */
	public int getDailyFloorUsage() {
		return dailyFloorUsage;
	}

	/**
	 * Sets the value of the '{@link CIM15.IEC61968.Customers.PricingStructure#getDailyFloorUsage Daily Floor Usage}' attribute.
	 *
	 *
	 * @param value the new value of the 'Daily Floor Usage' attribute.
	 * @see #isSetDailyFloorUsage()
	 * @see #unsetDailyFloorUsage()
	 * @see #getDailyFloorUsage()
	 * @generated
	 */
	public void setDailyFloorUsage(int newDailyFloorUsage) {
		dailyFloorUsage = newDailyFloorUsage;
		dailyFloorUsageESet = true;
	}

	/**
	 * Unsets the value of the '{@link CIM15.IEC61968.Customers.PricingStructure#getDailyFloorUsage Daily Floor Usage}' attribute.
	 *
	 *
	 * @see #isSetDailyFloorUsage()
	 * @see #getDailyFloorUsage()
	 * @see #setDailyFloorUsage(int)
	 * @generated
	 */
	public void unsetDailyFloorUsage() {
		dailyFloorUsage = DAILY_FLOOR_USAGE_EDEFAULT;
		dailyFloorUsageESet = false;
	}

	/**
	 * Returns whether the value of the '{@link CIM15.IEC61968.Customers.PricingStructure#getDailyFloorUsage Daily Floor Usage}' attribute is set.
	 *
	 *
	 * @return whether the value of the 'Daily Floor Usage' attribute is set.
	 * @see #unsetDailyFloorUsage()
	 * @see #getDailyFloorUsage()
	 * @see #setDailyFloorUsage(int)
	 * @generated
	 */
	public boolean isSetDailyFloorUsage() {
		return dailyFloorUsageESet;
	}

	/**
	 * Returns the value of the 'Daily Ceiling Usage' attribute.
	 *
	 *

	 * If the meaning of the 'Daily Ceiling Usage' attribute isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Daily Ceiling Usage' attribute.
	 * @see #isSetDailyCeilingUsage()
	 * @see #unsetDailyCeilingUsage()
	 * @see #setDailyCeilingUsage(int)
	 * @generated
	 */
	public int getDailyCeilingUsage() {
		return dailyCeilingUsage;
	}

	/**
	 * Sets the value of the '{@link CIM15.IEC61968.Customers.PricingStructure#getDailyCeilingUsage Daily Ceiling Usage}' attribute.
	 *
	 *
	 * @param value the new value of the 'Daily Ceiling Usage' attribute.
	 * @see #isSetDailyCeilingUsage()
	 * @see #unsetDailyCeilingUsage()
	 * @see #getDailyCeilingUsage()
	 * @generated
	 */
	public void setDailyCeilingUsage(int newDailyCeilingUsage) {
		dailyCeilingUsage = newDailyCeilingUsage;
		dailyCeilingUsageESet = true;
	}

	/**
	 * Unsets the value of the '{@link CIM15.IEC61968.Customers.PricingStructure#getDailyCeilingUsage Daily Ceiling Usage}' attribute.
	 *
	 *
	 * @see #isSetDailyCeilingUsage()
	 * @see #getDailyCeilingUsage()
	 * @see #setDailyCeilingUsage(int)
	 * @generated
	 */
	public void unsetDailyCeilingUsage() {
		dailyCeilingUsage = DAILY_CEILING_USAGE_EDEFAULT;
		dailyCeilingUsageESet = false;
	}

	/**
	 * Returns whether the value of the '{@link CIM15.IEC61968.Customers.PricingStructure#getDailyCeilingUsage Daily Ceiling Usage}' attribute is set.
	 *
	 *
	 * @return whether the value of the 'Daily Ceiling Usage' attribute is set.
	 * @see #unsetDailyCeilingUsage()
	 * @see #getDailyCeilingUsage()
	 * @see #setDailyCeilingUsage(int)
	 * @generated
	 */
	public boolean isSetDailyCeilingUsage() {
		return dailyCeilingUsageESet;
	}

	/**
	 * Returns the value of the 'Service Category' reference.
	 * It is bidirectional and its opposite is '{@link CIM15.IEC61968.Customers.ServiceCategory#getPricingStructures Pricing Structures}'.
	 *
	 *

	 * If the meaning of the 'Service Category' reference isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Service Category' reference.
	 * @see #setServiceCategory(ServiceCategory)
	 * @see CIM15.IEC61968.Customers.ServiceCategory#getPricingStructures
	 * @generated
	 */
	public ServiceCategory getServiceCategory() {
		if (serviceCategory != null && serviceCategory.eIsProxy()) {
			InternalEObject oldServiceCategory = (InternalEObject)serviceCategory;
			serviceCategory = (ServiceCategory)eResolveProxy(oldServiceCategory);
			if (serviceCategory != oldServiceCategory) {
			}
		}
		return serviceCategory;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public ServiceCategory basicGetServiceCategory() {
		return serviceCategory;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public NotificationChain basicSetServiceCategory(ServiceCategory newServiceCategory, NotificationChain msgs) {
		ServiceCategory oldServiceCategory = serviceCategory;
		serviceCategory = newServiceCategory;
		return msgs;
	}

	/**
	 * Sets the value of the '{@link CIM15.IEC61968.Customers.PricingStructure#getServiceCategory Service Category}' reference.
	 *
	 *
	 * @param value the new value of the 'Service Category' reference.
	 * @see #getServiceCategory()
	 * @generated
	 */
	public void setServiceCategory(ServiceCategory newServiceCategory) {
		if (newServiceCategory != serviceCategory) {
			NotificationChain msgs = null;
			if (serviceCategory != null)
				msgs = ((InternalEObject)serviceCategory).eInverseRemove(this, CustomersPackage.SERVICE_CATEGORY__PRICING_STRUCTURES, ServiceCategory.class, msgs);
			if (newServiceCategory != null)
				msgs = ((InternalEObject)newServiceCategory).eInverseAdd(this, CustomersPackage.SERVICE_CATEGORY__PRICING_STRUCTURES, ServiceCategory.class, msgs);
			msgs = basicSetServiceCategory(newServiceCategory, msgs);
			if (msgs != null) msgs.dispatch();
		}
	}

	/**
	 * Returns the value of the 'Tax Exemption' attribute.
	 *
	 *

	 * If the meaning of the 'Tax Exemption' attribute isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Tax Exemption' attribute.
	 * @see #isSetTaxExemption()
	 * @see #unsetTaxExemption()
	 * @see #setTaxExemption(boolean)
	 * @generated
	 */
	public boolean isTaxExemption() {
		return taxExemption;
	}

	/**
	 * Sets the value of the '{@link CIM15.IEC61968.Customers.PricingStructure#isTaxExemption Tax Exemption}' attribute.
	 *
	 *
	 * @param value the new value of the 'Tax Exemption' attribute.
	 * @see #isSetTaxExemption()
	 * @see #unsetTaxExemption()
	 * @see #isTaxExemption()
	 * @generated
	 */
	public void setTaxExemption(boolean newTaxExemption) {
		taxExemption = newTaxExemption;
		taxExemptionESet = true;
	}

	/**
	 * Unsets the value of the '{@link CIM15.IEC61968.Customers.PricingStructure#isTaxExemption Tax Exemption}' attribute.
	 *
	 *
	 * @see #isSetTaxExemption()
	 * @see #isTaxExemption()
	 * @see #setTaxExemption(boolean)
	 * @generated
	 */
	public void unsetTaxExemption() {
		taxExemption = TAX_EXEMPTION_EDEFAULT;
		taxExemptionESet = false;
	}

	/**
	 * Returns whether the value of the '{@link CIM15.IEC61968.Customers.PricingStructure#isTaxExemption Tax Exemption}' attribute is set.
	 *
	 *
	 * @return whether the value of the 'Tax Exemption' attribute is set.
	 * @see #unsetTaxExemption()
	 * @see #isTaxExemption()
	 * @see #setTaxExemption(boolean)
	 * @generated
	 */
	public boolean isSetTaxExemption() {
		return taxExemptionESet;
	}

	/**
	 * Returns the value of the 'Code' attribute.
	 *
	 *

	 * If the meaning of the 'Code' attribute isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Code' attribute.
	 * @see #isSetCode()
	 * @see #unsetCode()
	 * @see #setCode(String)
	 * @generated
	 */
	public String getCode() {
		return code;
	}

	/**
	 * Sets the value of the '{@link CIM15.IEC61968.Customers.PricingStructure#getCode Code}' attribute.
	 *
	 *
	 * @param value the new value of the 'Code' attribute.
	 * @see #isSetCode()
	 * @see #unsetCode()
	 * @see #getCode()
	 * @generated
	 */
	public void setCode(String newCode) {
		code = newCode;
		codeESet = true;
	}

	/**
	 * Unsets the value of the '{@link CIM15.IEC61968.Customers.PricingStructure#getCode Code}' attribute.
	 *
	 *
	 * @see #isSetCode()
	 * @see #getCode()
	 * @see #setCode(String)
	 * @generated
	 */
	public void unsetCode() {
		code = CODE_EDEFAULT;
		codeESet = false;
	}

	/**
	 * Returns whether the value of the '{@link CIM15.IEC61968.Customers.PricingStructure#getCode Code}' attribute is set.
	 *
	 *
	 * @return whether the value of the 'Code' attribute is set.
	 * @see #unsetCode()
	 * @see #getCode()
	 * @see #setCode(String)
	 * @generated
	 */
	public boolean isSetCode() {
		return codeESet;
	}

	/**
	 * Returns the value of the 'Customer Agreements' reference list.
	 * The list contents are of type {@link CIM15.IEC61968.Customers.CustomerAgreement}.
	 * It is bidirectional and its opposite is '{@link CIM15.IEC61968.Customers.CustomerAgreement#getPricingStructures Pricing Structures}'.
	 *
	 *

	 * If the meaning of the 'Customer Agreements' reference list isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Customer Agreements' reference list.
	 * @see CIM15.IEC61968.Customers.CustomerAgreement#getPricingStructures
	 * @generated
	 */
	public EList<CustomerAgreement> getCustomerAgreements() {
		if (customerAgreements == null) {
			customerAgreements = new BasicInternalEList<CustomerAgreement>(CustomerAgreement.class);
		}
		return customerAgreements;
	}

	/**
	 * Returns the value of the 'Service Delivery Points' reference list.
	 * The list contents are of type {@link CIM15.IEC61968.Metering.ServiceDeliveryPoint}.
	 * It is bidirectional and its opposite is '{@link CIM15.IEC61968.Metering.ServiceDeliveryPoint#getPricingStructures Pricing Structures}'.
	 *
	 *

	 * If the meaning of the 'Service Delivery Points' reference list isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Service Delivery Points' reference list.
	 * @see CIM15.IEC61968.Metering.ServiceDeliveryPoint#getPricingStructures
	 * @generated
	 */
	public EList<ServiceDeliveryPoint> getServiceDeliveryPoints() {
		if (serviceDeliveryPoints == null) {
			serviceDeliveryPoints = new BasicInternalEList<ServiceDeliveryPoint>(ServiceDeliveryPoint.class);
		}
		return serviceDeliveryPoints;
	}

	/**
	 * Returns the value of the 'Tariffs' reference list.
	 * The list contents are of type {@link CIM15.IEC61968.Customers.Tariff}.
	 * It is bidirectional and its opposite is '{@link CIM15.IEC61968.Customers.Tariff#getPricingStructures Pricing Structures}'.
	 *
	 *

	 * If the meaning of the 'Tariffs' reference list isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Tariffs' reference list.
	 * @see CIM15.IEC61968.Customers.Tariff#getPricingStructures
	 * @generated
	 */
	public EList<Tariff> getTariffs() {
		if (tariffs == null) {
			tariffs = new BasicInternalEList<Tariff>(Tariff.class);
		}
		return tariffs;
	}

	/**
	 * Returns the value of the 'Transactions' reference list.
	 * The list contents are of type {@link CIM15.IEC61968.PaymentMetering.Transaction}.
	 * It is bidirectional and its opposite is '{@link CIM15.IEC61968.PaymentMetering.Transaction#getPricingStructure Pricing Structure}'.
	 *
	 *

	 * If the meaning of the 'Transactions' reference list isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Transactions' reference list.
	 * @see CIM15.IEC61968.PaymentMetering.Transaction#getPricingStructure
	 * @generated
	 */
	public EList<Transaction> getTransactions() {
		if (transactions == null) {
			transactions = new BasicInternalEList<Transaction>(Transaction.class);
		}
		return transactions;
	}

	/**
	 * Returns the value of the 'Daily Estimated Usage' attribute.
	 *
	 *

	 * If the meaning of the 'Daily Estimated Usage' attribute isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Daily Estimated Usage' attribute.
	 * @see #isSetDailyEstimatedUsage()
	 * @see #unsetDailyEstimatedUsage()
	 * @see #setDailyEstimatedUsage(int)
	 * @generated
	 */
	public int getDailyEstimatedUsage() {
		return dailyEstimatedUsage;
	}

	/**
	 * Sets the value of the '{@link CIM15.IEC61968.Customers.PricingStructure#getDailyEstimatedUsage Daily Estimated Usage}' attribute.
	 *
	 *
	 * @param value the new value of the 'Daily Estimated Usage' attribute.
	 * @see #isSetDailyEstimatedUsage()
	 * @see #unsetDailyEstimatedUsage()
	 * @see #getDailyEstimatedUsage()
	 * @generated
	 */
	public void setDailyEstimatedUsage(int newDailyEstimatedUsage) {
		dailyEstimatedUsage = newDailyEstimatedUsage;
		dailyEstimatedUsageESet = true;
	}

	/**
	 * Unsets the value of the '{@link CIM15.IEC61968.Customers.PricingStructure#getDailyEstimatedUsage Daily Estimated Usage}' attribute.
	 *
	 *
	 * @see #isSetDailyEstimatedUsage()
	 * @see #getDailyEstimatedUsage()
	 * @see #setDailyEstimatedUsage(int)
	 * @generated
	 */
	public void unsetDailyEstimatedUsage() {
		dailyEstimatedUsage = DAILY_ESTIMATED_USAGE_EDEFAULT;
		dailyEstimatedUsageESet = false;
	}

	/**
	 * Returns whether the value of the '{@link CIM15.IEC61968.Customers.PricingStructure#getDailyEstimatedUsage Daily Estimated Usage}' attribute is set.
	 *
	 *
	 * @return whether the value of the 'Daily Estimated Usage' attribute is set.
	 * @see #unsetDailyEstimatedUsage()
	 * @see #getDailyEstimatedUsage()
	 * @see #setDailyEstimatedUsage(int)
	 * @generated
	 */
	public boolean isSetDailyEstimatedUsage() {
		return dailyEstimatedUsageESet;
	}

	/**
	 * Returns the value of the 'Revenue Kind' attribute.
	 * The literals are from the enumeration {@link CIM15.IEC61968.Customers.RevenueKind}.
	 *
	 *

	 * If the meaning of the 'Revenue Kind' attribute isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Revenue Kind' attribute.
	 * @see CIM15.IEC61968.Customers.RevenueKind
	 * @see #isSetRevenueKind()
	 * @see #unsetRevenueKind()
	 * @see #setRevenueKind(RevenueKind)
	 * @generated
	 */
	public RevenueKind getRevenueKind() {
		return revenueKind;
	}

	/**
	 * Sets the value of the '{@link CIM15.IEC61968.Customers.PricingStructure#getRevenueKind Revenue Kind}' attribute.
	 *
	 *
	 * @param value the new value of the 'Revenue Kind' attribute.
	 * @see CIM15.IEC61968.Customers.RevenueKind
	 * @see #isSetRevenueKind()
	 * @see #unsetRevenueKind()
	 * @see #getRevenueKind()
	 * @generated
	 */
	public void setRevenueKind(RevenueKind newRevenueKind) {
		revenueKind = newRevenueKind == null ? REVENUE_KIND_EDEFAULT : newRevenueKind;
		revenueKindESet = true;
	}

	/**
	 * Unsets the value of the '{@link CIM15.IEC61968.Customers.PricingStructure#getRevenueKind Revenue Kind}' attribute.
	 *
	 *
	 * @see #isSetRevenueKind()
	 * @see #getRevenueKind()
	 * @see #setRevenueKind(RevenueKind)
	 * @generated
	 */
	public void unsetRevenueKind() {
		revenueKind = REVENUE_KIND_EDEFAULT;
		revenueKindESet = false;
	}

	/**
	 * Returns whether the value of the '{@link CIM15.IEC61968.Customers.PricingStructure#getRevenueKind Revenue Kind}' attribute is set.
	 *
	 *
	 * @return whether the value of the 'Revenue Kind' attribute is set.
	 * @see #unsetRevenueKind()
	 * @see #getRevenueKind()
	 * @see #setRevenueKind(RevenueKind)
	 * @generated
	 */
	public boolean isSetRevenueKind() {
		return revenueKindESet;
	}

	/**
	 *
	 *
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case CustomersPackage.PRICING_STRUCTURE__SERVICE_CATEGORY:
				if (serviceCategory != null)
					msgs = ((InternalEObject)serviceCategory).eInverseRemove(this, CustomersPackage.SERVICE_CATEGORY__PRICING_STRUCTURES, ServiceCategory.class, msgs);
				return basicSetServiceCategory((ServiceCategory)otherEnd, msgs);
			case CustomersPackage.PRICING_STRUCTURE__CUSTOMER_AGREEMENTS:
				return ((InternalEList<InternalEObject>)(InternalEList<?>)getCustomerAgreements()).basicAdd(otherEnd, msgs);
			case CustomersPackage.PRICING_STRUCTURE__SERVICE_DELIVERY_POINTS:
				return ((InternalEList<InternalEObject>)(InternalEList<?>)getServiceDeliveryPoints()).basicAdd(otherEnd, msgs);
			case CustomersPackage.PRICING_STRUCTURE__TARIFFS:
				return ((InternalEList<InternalEObject>)(InternalEList<?>)getTariffs()).basicAdd(otherEnd, msgs);
			case CustomersPackage.PRICING_STRUCTURE__TRANSACTIONS:
				return ((InternalEList<InternalEObject>)(InternalEList<?>)getTransactions()).basicAdd(otherEnd, msgs);
		}
		return super.eInverseAdd(otherEnd, featureID, msgs);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case CustomersPackage.PRICING_STRUCTURE__SERVICE_CATEGORY:
				return basicSetServiceCategory(null, msgs);
			case CustomersPackage.PRICING_STRUCTURE__CUSTOMER_AGREEMENTS:
				return ((InternalEList<?>)getCustomerAgreements()).basicRemove(otherEnd, msgs);
			case CustomersPackage.PRICING_STRUCTURE__SERVICE_DELIVERY_POINTS:
				return ((InternalEList<?>)getServiceDeliveryPoints()).basicRemove(otherEnd, msgs);
			case CustomersPackage.PRICING_STRUCTURE__TARIFFS:
				return ((InternalEList<?>)getTariffs()).basicRemove(otherEnd, msgs);
			case CustomersPackage.PRICING_STRUCTURE__TRANSACTIONS:
				return ((InternalEList<?>)getTransactions()).basicRemove(otherEnd, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case CustomersPackage.PRICING_STRUCTURE__DAILY_FLOOR_USAGE:
				return getDailyFloorUsage();
			case CustomersPackage.PRICING_STRUCTURE__DAILY_CEILING_USAGE:
				return getDailyCeilingUsage();
			case CustomersPackage.PRICING_STRUCTURE__SERVICE_CATEGORY:
				if (resolve) return getServiceCategory();
				return basicGetServiceCategory();
			case CustomersPackage.PRICING_STRUCTURE__TAX_EXEMPTION:
				return isTaxExemption();
			case CustomersPackage.PRICING_STRUCTURE__CODE:
				return getCode();
			case CustomersPackage.PRICING_STRUCTURE__CUSTOMER_AGREEMENTS:
				return getCustomerAgreements();
			case CustomersPackage.PRICING_STRUCTURE__SERVICE_DELIVERY_POINTS:
				return getServiceDeliveryPoints();
			case CustomersPackage.PRICING_STRUCTURE__TARIFFS:
				return getTariffs();
			case CustomersPackage.PRICING_STRUCTURE__TRANSACTIONS:
				return getTransactions();
			case CustomersPackage.PRICING_STRUCTURE__DAILY_ESTIMATED_USAGE:
				return getDailyEstimatedUsage();
			case CustomersPackage.PRICING_STRUCTURE__REVENUE_KIND:
				return getRevenueKind();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case CustomersPackage.PRICING_STRUCTURE__DAILY_FLOOR_USAGE:
				setDailyFloorUsage((Integer)newValue);
				return;
			case CustomersPackage.PRICING_STRUCTURE__DAILY_CEILING_USAGE:
				setDailyCeilingUsage((Integer)newValue);
				return;
			case CustomersPackage.PRICING_STRUCTURE__SERVICE_CATEGORY:
				setServiceCategory((ServiceCategory)newValue);
				return;
			case CustomersPackage.PRICING_STRUCTURE__TAX_EXEMPTION:
				setTaxExemption((Boolean)newValue);
				return;
			case CustomersPackage.PRICING_STRUCTURE__CODE:
				setCode((String)newValue);
				return;
			case CustomersPackage.PRICING_STRUCTURE__CUSTOMER_AGREEMENTS:
				getCustomerAgreements().clear();
				getCustomerAgreements().addAll((Collection<? extends CustomerAgreement>)newValue);
				return;
			case CustomersPackage.PRICING_STRUCTURE__SERVICE_DELIVERY_POINTS:
				getServiceDeliveryPoints().clear();
				getServiceDeliveryPoints().addAll((Collection<? extends ServiceDeliveryPoint>)newValue);
				return;
			case CustomersPackage.PRICING_STRUCTURE__TARIFFS:
				getTariffs().clear();
				getTariffs().addAll((Collection<? extends Tariff>)newValue);
				return;
			case CustomersPackage.PRICING_STRUCTURE__TRANSACTIONS:
				getTransactions().clear();
				getTransactions().addAll((Collection<? extends Transaction>)newValue);
				return;
			case CustomersPackage.PRICING_STRUCTURE__DAILY_ESTIMATED_USAGE:
				setDailyEstimatedUsage((Integer)newValue);
				return;
			case CustomersPackage.PRICING_STRUCTURE__REVENUE_KIND:
				setRevenueKind((RevenueKind)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case CustomersPackage.PRICING_STRUCTURE__DAILY_FLOOR_USAGE:
				unsetDailyFloorUsage();
				return;
			case CustomersPackage.PRICING_STRUCTURE__DAILY_CEILING_USAGE:
				unsetDailyCeilingUsage();
				return;
			case CustomersPackage.PRICING_STRUCTURE__SERVICE_CATEGORY:
				setServiceCategory((ServiceCategory)null);
				return;
			case CustomersPackage.PRICING_STRUCTURE__TAX_EXEMPTION:
				unsetTaxExemption();
				return;
			case CustomersPackage.PRICING_STRUCTURE__CODE:
				unsetCode();
				return;
			case CustomersPackage.PRICING_STRUCTURE__CUSTOMER_AGREEMENTS:
				getCustomerAgreements().clear();
				return;
			case CustomersPackage.PRICING_STRUCTURE__SERVICE_DELIVERY_POINTS:
				getServiceDeliveryPoints().clear();
				return;
			case CustomersPackage.PRICING_STRUCTURE__TARIFFS:
				getTariffs().clear();
				return;
			case CustomersPackage.PRICING_STRUCTURE__TRANSACTIONS:
				getTransactions().clear();
				return;
			case CustomersPackage.PRICING_STRUCTURE__DAILY_ESTIMATED_USAGE:
				unsetDailyEstimatedUsage();
				return;
			case CustomersPackage.PRICING_STRUCTURE__REVENUE_KIND:
				unsetRevenueKind();
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case CustomersPackage.PRICING_STRUCTURE__DAILY_FLOOR_USAGE:
				return isSetDailyFloorUsage();
			case CustomersPackage.PRICING_STRUCTURE__DAILY_CEILING_USAGE:
				return isSetDailyCeilingUsage();
			case CustomersPackage.PRICING_STRUCTURE__SERVICE_CATEGORY:
				return serviceCategory != null;
			case CustomersPackage.PRICING_STRUCTURE__TAX_EXEMPTION:
				return isSetTaxExemption();
			case CustomersPackage.PRICING_STRUCTURE__CODE:
				return isSetCode();
			case CustomersPackage.PRICING_STRUCTURE__CUSTOMER_AGREEMENTS:
				return customerAgreements != null && !customerAgreements.isEmpty();
			case CustomersPackage.PRICING_STRUCTURE__SERVICE_DELIVERY_POINTS:
				return serviceDeliveryPoints != null && !serviceDeliveryPoints.isEmpty();
			case CustomersPackage.PRICING_STRUCTURE__TARIFFS:
				return tariffs != null && !tariffs.isEmpty();
			case CustomersPackage.PRICING_STRUCTURE__TRANSACTIONS:
				return transactions != null && !transactions.isEmpty();
			case CustomersPackage.PRICING_STRUCTURE__DAILY_ESTIMATED_USAGE:
				return isSetDailyEstimatedUsage();
			case CustomersPackage.PRICING_STRUCTURE__REVENUE_KIND:
				return isSetRevenueKind();
		}
		return super.eIsSet(featureID);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (dailyFloorUsage: ");
		if (dailyFloorUsageESet) result.append(dailyFloorUsage); else result.append("<unset>");
		result.append(", dailyCeilingUsage: ");
		if (dailyCeilingUsageESet) result.append(dailyCeilingUsage); else result.append("<unset>");
		result.append(", taxExemption: ");
		if (taxExemptionESet) result.append(taxExemption); else result.append("<unset>");
		result.append(", code: ");
		if (codeESet) result.append(code); else result.append("<unset>");
		result.append(", dailyEstimatedUsage: ");
		if (dailyEstimatedUsageESet) result.append(dailyEstimatedUsage); else result.append("<unset>");
		result.append(", revenueKind: ");
		if (revenueKindESet) result.append(revenueKind); else result.append("<unset>");
		result.append(')');
		return result.toString();
	}

} // PricingStructure


text:
import os, sys

# nothing to test until we put VMODL back in the VIB
# See https://github.com/vmware/docker-volume-vsphere/pull/975 for details.
if "INSTALL_VMODL" not in os.environ:
    print("Skipping VMODL test - INSTALL_VMODL is not defined")
    sys.exit(0)

import ssl
sys.path.append('/lib64/python3.5/site-packages/pyMo/vim/vsan')
sys.path.append('/lib/python2.7/site-packages/pyMo/vim/vsan')

import pyVim
import pyVim.connect
import pyVim.host
import pyVmomi
import pyVmomi.VmomiSupport
from pyVmomi import vim, vmodl
from vsanPerfPyMo import VsanPerformanceManager
import random
import unittest
import log_config
import vmdk_ops
import vmdk_ops_test
import vmdk_utils
import VsphereContainerService

si = None

TENANT_NAME = "TEST_TENANT_NAME"
TENANT_DESC = "TEST_TENANT_DESCRIPTION"
NEW_TENANT_NAME = "TEST_TENANT_NAME_2"
NEW_TENANT_DESC = "TEST_TENANT_DESCRIPTION_2"
TENANT_PREFIX = "TEST_TENANT_"
LONG_TENANT_NAME = "01234567890123456789012345678901234567890123456789\
                    012345678901234"
LONG_TENANT_DESC = "01234567890123456789012345678901234567890123456789\
                    01234567890123456789012345678901234567890123456789\
                    01234567890123456789012345678901234567890123456789\
                    01234567890123456789012345678901234567890123456789\
                    01234567890123456789012345678901234567890123456789\
                    0123456"
VM_NOT_EXIST = "VM_NOT_EXIST"
DS_NOT_EXIST = "DS_NOT_EXIST"

def connect_to_vcs(host="localhost", port=443):
    """
    Connect to VCS - currently utilizing VSAN mgmt service on ESX (/vsan) - and return SOAP stub
    """

    si = vmdk_ops.get_si()
    # pylint: disable=no-member
    hostSystem = pyVim.host.GetHostSystem(si)
    token = hostSystem.configManager.vsanSystem.FetchVsanSharedSecret()
    version = pyVmomi.VmomiSupport.newestVersions.Get("vim")
    stub = pyVmomi.SoapStubAdapter(host=host,
                                   port=port,
                                   version=version,
                                   path="/vsan",
                                   poolSize=0)
    vpm = vim.cluster.VsanPerformanceManager("vsan-performance-manager", stub)

    # Disable certificate check during SSL communication
    disable_certificate_check()

    logged_in = vpm.Login(token)
    if not logged_in:
        print("Failed to get sims stub for host %s" % host)
        raise OSError("Failed to login to VSAN mgmt server")

    return stub

def disable_certificate_check():
    ssl._create_default_https_context = ssl._create_unverified_context

def get_tenants(stub):
    vcs = vim.vcs.VsphereContainerService("vsphere-container-service", stub)
    tenantMgr = vcs.GetTenantManager()
    return tenantMgr.GetTenants()

class TestVsphereContainerService(unittest.TestCase):
    """
    Unit tests for VsphereContainerServiceImpl
    """

    vcs = None
    tenantMgr = None

    random_id = random.randint(0, 65536)
    vm1_name = 'vm1_name_' + str(random_id)
    vm1 = None

    random_id = random.randint(0, 65536)
    vm2_name = 'vm2_name_' + str(random_id)
    vm2 = None

    datastore = None
    datastore2 = None

    @classmethod
    def setUpClass(cls):
        stub = connect_to_vcs()
        cls.vcs = vim.vcs.VsphereContainerService("vsphere-container-service", stub)
        cls.tenantMgr = cls.vcs.GetTenantManager()
        cls.setup_datastore()
        cls.create_vms()

    @classmethod
    def setup_datastore(cls):
        datastores = vmdk_utils.get_datastore_objects()
        if datastores:
            cls.datastore = datastores[0].info.name
            if len(datastores) > 1:
                cls.datastore2 = datastores[1].info.name
        else:
            cls.fail("Datastore is not available!")

    @classmethod
    def create_vms(cls):
        si = vmdk_ops.get_si()
        error, cls.vm1 = vmdk_ops_test.create_vm(si=si,
                                                 vm_name=cls.vm1_name,
                                                 datastore_name=cls.datastore)
        if error:
            cls.fail("Failed to create VM1!")

        error, cls.vm2 = vmdk_ops_test.create_vm(si=si,
                                                 vm_name=cls.vm2_name,
                                                 datastore_name=cls.datastore)
        if error:
            cls.fail("Failed to create VM2!")

    @classmethod
    def tearDownClass(cls):
        """ Cleanup after all tests """
        cls.cleanup_vms()

    @classmethod
    def cleanup_vms(cls):
        si = vmdk_ops.get_si()
        vmdk_ops_test.remove_vm(si, cls.vm1)
        vmdk_ops_test.remove_vm(si, cls.vm2)

    def tearDown(self):
        """ Cleanup after each test """
        self.cleanup_tenants()

    def cleanup_tenants(self):
        tenants = self.tenantMgr.GetTenants()
        for tenant in tenants:
            if tenant.name.startswith(TENANT_PREFIX):
                self.tenantMgr.RemoveTenant(tenant.name)

    def test_create_tenant(self):
        # Create a tenant
        tenant = self.tenantMgr.CreateTenant(name=TENANT_NAME, description=TENANT_DESC)

        # Verify the result
        self.assertTrue(tenant)
        self.assertEqual(tenant.name, TENANT_NAME)
        self.assertEqual(tenant.description, TENANT_DESC)

    def test_create_tenant_invalid_args(self):
        # Create a tenant with empty name
        empty_name = ""
        with self.assertRaises(vmodl.fault.InvalidArgument):
            self.tenantMgr.CreateTenant(name=empty_name)

        # Create a tenant with name longer than 64 characters
        with self.assertRaises(vmodl.fault.InvalidArgument):
            self.tenantMgr.CreateTenant(name=LONG_TENANT_NAME)

        # Create a tenant with description longer than 256 characters
        with self.assertRaises(vmodl.fault.InvalidArgument):
            self.tenantMgr.CreateTenant(name=TENANT_NAME, description=LONG_TENANT_DESC)

    def test_create_tenant_already_exists(self):
        # Create a tenant
        self.tenantMgr.CreateTenant(name=TENANT_NAME, description=TENANT_DESC)

        # Create a tenant with same name
        with self.assertRaises(vim.fault.AlreadyExists):
            self.tenantMgr.CreateTenant(name=TENANT_NAME, description=TENANT_DESC)

    def test_get_tenant(self):
        # Create a tenant
        self.tenantMgr.CreateTenant(name=TENANT_NAME, description=TENANT_DESC)

        # Get the tenant
        tenants = self.tenantMgr.GetTenants(name=TENANT_NAME)

        # Verify the result
        self.assertTrue(tenants)
        self.assertEqual(tenants[0].name, TENANT_NAME)
        self.assertEqual(tenants[0].description, TENANT_DESC)

    def test_get_tenant_not_exists(self):
        # Get the tenant
        tenants = self.tenantMgr.GetTenants(name=TENANT_NAME)

        # Verify the result
        self.assertFalse(tenants)

    def test_get_all_tenants(self):
        # Create 2 tenants
        self.tenantMgr.CreateTenant(name=TENANT_NAME, description=TENANT_DESC)
        self.tenantMgr.CreateTenant(name=NEW_TENANT_NAME, description=NEW_TENANT_NAME)

        # Get all tenants
        tenants = self.tenantMgr.GetTenants()

        # Verify the result
        self.assertTrue(tenants)
        self.assertEqual(len(tenants), 3) # plus DEFAULT tenant

    def test_remove_tenant(self):
        # Create a tenant
        self.tenantMgr.CreateTenant(name=TENANT_NAME, description=TENANT_DESC)

        # Remove the tenant
        self.tenantMgr.RemoveTenant(name=TENANT_NAME)

        # Verify the result
        tenants = self.tenantMgr.GetTenants(name=TENANT_NAME)
        self.assertFalse(tenants)

    def test_remove_tenant_not_exists(self):
        # Remove a tenant not exists
        with self.assertRaises(vim.fault.NotFound):
            self.tenantMgr.RemoveTenant(name=TENANT_NAME)

    def test_update_tenant(self):
        # Create a tenant
        tenant = self.tenantMgr.CreateTenant(name=TENANT_NAME, description=TENANT_DESC)

        # Update the tenant
        self.tenantMgr.UpdateTenant(name=TENANT_NAME, new_name=NEW_TENANT_NAME, description=NEW_TENANT_DESC)

        # Verify the result
        tenants = self.tenantMgr.GetTenants(name=NEW_TENANT_NAME)
        self.assertTrue(tenants)
        self.assertEqual(tenants[0].name, NEW_TENANT_NAME)
        self.assertEqual(tenants[0].description, NEW_TENANT_DESC)

    def test_update_tenant_invalid_args(self):
        # Create a tenant
        tenant = self.tenantMgr.CreateTenant(name=TENANT_NAME, description=TENANT_DESC)

        # Update the tenant with same name
        with self.assertRaises(vmodl.fault.InvalidArgument):
            self.tenantMgr.UpdateTenant(name=TENANT_NAME, new_name=TENANT_NAME)

        # Update a tenant with empty name
        empty_name = ""
        with self.assertRaises(vmodl.fault.InvalidArgument):
            self.tenantMgr.UpdateTenant(name=TENANT_NAME, new_name=empty_name)

        # Update the tenant with new name longer than 64 characters
        with self.assertRaises(vmodl.fault.InvalidArgument):
            self.tenantMgr.UpdateTenant(name=TENANT_NAME, new_name=LONG_TENANT_NAME)

        # Create a tenant with new description longer than 256 characters
        with self.assertRaises(vmodl.fault.InvalidArgument):
            self.tenantMgr.UpdateTenant(name=TENANT_NAME, new_name=NEW_TENANT_NAME, description=LONG_TENANT_DESC)

    def test_update_tenant_not_exists(self):
        # Update a tenant not exists
        with self.assertRaises(vim.fault.NotFound):
            self.tenantMgr.UpdateTenant(name=TENANT_NAME, new_name=NEW_TENANT_NAME)

    def test_update_tenant_already_exists(self):
        # Create 2 tenants
        self.tenantMgr.CreateTenant(name=TENANT_NAME, description=TENANT_DESC)
        self.tenantMgr.CreateTenant(name=NEW_TENANT_NAME, description=NEW_TENANT_DESC)

        # Update one tenant with same name as the other tenant
        with self.assertRaises(vim.fault.AlreadyExists):
            self.tenantMgr.UpdateTenant(name=TENANT_NAME, new_name=NEW_TENANT_NAME)

    def test_add_vms(self):
        # Create a tenant
        tenant = self.tenantMgr.CreateTenant(name=TENANT_NAME, description=TENANT_DESC)

        # Add a VM to the tenant
        vms = [self.vm1_name]
        self.tenantMgr.AddVMs(tenant, vms)

        # Verify the result
        result=self.tenantMgr.GetTenants(name=TENANT_NAME)
        self.assertTrue(result)
        self.assertEqual(result[0].vms, vms)

    def test_add_vms_tenant_not_exists(self):
        # Create a tenant
        tenant = self.tenantMgr.CreateTenant(name=TENANT_NAME, description=TENANT_DESC)

        # Remove the tenant
        self.tenantMgr.RemoveTenant(name=TENANT_NAME)

        # Add a VM to the noon-existent tenant
        vms = [self.vm1_name]
        with self.assertRaises(vim.fault.NotFound):
            self.tenantMgr.AddVMs(tenant, vms)

    def test_add_vms_already_exists(self):
        # Create a tenant
        tenant = self.tenantMgr.CreateTenant(name=TENANT_NAME, description=TENANT_DESC)

        # Add a VM to the tenant
        vms = [self.vm1_name]
        self.tenantMgr.AddVMs(tenant, vms)

        # Add the same VM again
        with self.assertRaises(vim.fault.AlreadyExists):
            self.tenantMgr.AddVMs(tenant, vms)

    def test_add_vms_not_exist(self):
        # Create a tenant
        tenant = self.tenantMgr.CreateTenant(name=TENANT_NAME, description=TENANT_DESC)

        # Add a non-existent VM to the tenant
        vms = [VM_NOT_EXIST]
        with self.assertRaises(vmodl.fault.InvalidArgument):
            self.tenantMgr.AddVMs(tenant, vms)

    def test_remove_vms(self):
        # Create a tenant
        tenant = self.tenantMgr.CreateTenant(name=TENANT_NAME, description=TENANT_DESC)

        # Add 2 VMs to the tenant
        vms = [self.vm1_name, self.vm2_name]
        self.tenantMgr.AddVMs(tenant, vms)

        # Remove the VMs from the tenant
        self.tenantMgr.RemoveVMs(tenant, vms)

        # Verify the result
        result = self.tenantMgr.GetTenants(name=TENANT_NAME)
        self.assertTrue(result)
        self.assertEqual(result[0].vms, [])

    def test_remove_vms_tenant_not_exists(self):
        # Create a tenant
        tenant = self.tenantMgr.CreateTenant(name=TENANT_NAME, description=TENANT_DESC)

        # Remove the tenant
        self.tenantMgr.RemoveTenant(name=TENANT_NAME)

        # Remove a VM from the non-existent tenant
        vms = [self.vm1_name]
        with self.assertRaises(vim.fault.NotFound):
            self.tenantMgr.RemoveVMs(tenant, vms)

    def test_remove_vms_not_exist(self):
        # Create a tenant
        tenant = self.tenantMgr.CreateTenant(name=TENANT_NAME, description=TENANT_DESC)

        # Remove a non-existent VM from the tenant
        vms = [VM_NOT_EXIST]
        with self.assertRaises(vmodl.fault.InvalidArgument):
            self.tenantMgr.RemoveVMs(tenant, vms)

    def test_remove_vms_not_related(self):
        # Create a tenant
        tenant = self.tenantMgr.CreateTenant(name=TENANT_NAME, description=TENANT_DESC)

        # Remove a VM not belonging to this tenant
        vms = [self.vm1_name]
        with self.assertRaises(vmodl.fault.InvalidArgument):
            self.tenantMgr.RemoveVMs(tenant, vms)

    def test_get_vms(self):
        # Create a tenant
        tenant = self.tenantMgr.CreateTenant(name=TENANT_NAME, description=TENANT_DESC)

        # Add 2 VMs to the tenant
        vms = [self.vm1_name, self.vm2_name]
        self.tenantMgr.AddVMs(tenant, vms)

        # Verify the result
        result = self.tenantMgr.GetTenants(name=TENANT_NAME)
        self.assertTrue(result)
        self.assertEqual(result[0].vms, vms)

    def test_replace_vms(self):
        # Create a tenant
        tenant = self.tenantMgr.CreateTenant(name=TENANT_NAME, description=TENANT_DESC)

        # Add VM1 to the tenant
        vm1 = [self.vm1_name]
        self.tenantMgr.AddVMs(tenant, vm1)

        # Replace with VM2
        vm2 = [self.vm2_name]
        self.tenantMgr.ReplaceVMs(tenant, vm2)

        # Verify the result
        result = self.tenantMgr.GetTenants(name=TENANT_NAME)
        self.assertTrue(result)
        vms = result[0].vms
        self.assertEqual(vms, vm2)

    def test_replace_vms_tenant_not_exists(self):
        # Create a tenant
        tenant = self.tenantMgr.CreateTenant(name=TENANT_NAME, description=TENANT_DESC)

        # Remove the tenant
        self.tenantMgr.RemoveTenant(name=TENANT_NAME)

        # Replace a VM for the non-existent tenant
        vms = [self.vm1_name]
        with self.assertRaises(vim.fault.NotFound):
            self.tenantMgr.ReplaceVMs(tenant, vms)

    def test_replace_vms_not_exist(self):
        # Create a tenant
        tenant = self.tenantMgr.CreateTenant(name=TENANT_NAME, description=TENANT_DESC)

        # Add a VM to the tenant
        vms = [self.vm1_name]
        self.tenantMgr.AddVMs(tenant, vms)

        # Replace a non-existent VM for the tenant
        vms = [VM_NOT_EXIST]
        with self.assertRaises(vmodl.fault.InvalidArgument):
            self.tenantMgr.ReplaceVMs(tenant, vms)

    def create_privilege(self):
        privilege = vim.vcs.storage.DatastoreAccessPrivilege()
        privilege.datastore =  self.datastore
        privilege.allow_create = True
        privilege.volume_max_size = 512
        privilege.volume_total_size = 1024
        return privilege

    def create_privilege_2(self):
        privilege = vim.vcs.storage.DatastoreAccessPrivilege()
        privilege.datastore = self.datastore2
        privilege.allow_create = False
        privilege.volume_max_size = 1024
        privilege.volume_total_size = 2048
        return privilege

    def test_add_privilege(self):
        # Create a tenant
        tenant = self.tenantMgr.CreateTenant(name=TENANT_NAME, description=TENANT_DESC)

        # Create a privilege
        privilege = self.create_privilege()

        # Add privilege to the tenant
        self.tenantMgr.AddPrivilege(tenant, privilege)

        # Verify the privilege
        result = self.tenantMgr.GetTenants(name=TENANT_NAME)
        self.assertTrue(result)
        p = result[0].privileges
        self.assertTrue(p)
        self.assertEqual(p[0].datastore, self.datastore)
        self.assertEqual(p[0].allow_create, True)
        self.assertEqual(p[0].volume_max_size, 512)
        self.assertEqual(p[0].volume_total_size, 1024)

        # Verify the default datastore
        self.assertEqual(result[0].default_datastore, self.datastore)

    def test_add_privilege_default_datastore_false(self):
        if not self.datastore2:
            return

        # Create a tenant
        tenant = self.tenantMgr.CreateTenant(name=TENANT_NAME, description=TENANT_DESC)

        # Create 2 privileges
        p1 = self.create_privilege()
        p2 = self.create_privilege_2()

        # Add the 1st privilege to the tenant
        self.tenantMgr.AddPrivilege(tenant, p1)

        # Add the 2nd privilege to the tenant, with default_datastore set to false
        self.tenantMgr.AddPrivilege(tenant, p2, default_datastore=False)

        # Get the tenant
        result = self.tenantMgr.GetTenants(name=TENANT_NAME)
        self.assertTrue(result)

        # Verify the default datastore
        self.assertEqual(result[0].default_datastore, self.datastore)

    def test_add_privilege_default_datastore_true(self):
        if not self.datastore2:
            return

        # Create a tenant
        tenant = self.tenantMgr.CreateTenant(name=TENANT_NAME, description=TENANT_DESC)

        # Create 2 privileges
        p1 = self.create_privilege()
        p2 = self.create_privilege_2()

        # Add the 1st privilege to the tenant
        self.tenantMgr.AddPrivilege(tenant, p1)

        # Add the 2nd privilege to the tenant, with default_datastore set to true
        self.tenantMgr.AddPrivilege(tenant, p2, default_datastore=True)

        # Get the tenant
        result = self.tenantMgr.GetTenants(name=TENANT_NAME)
        self.assertTrue(result)

        # Verify the default datastore
        self.assertEqual(result[0].default_datastore, self.datastore2)

    def test_add_privilege_tenant_not_exists(self):
        # Create a tenant
        tenant = self.tenantMgr.CreateTenant(name=TENANT_NAME, description=TENANT_DESC)

        # Remove the tenant
        self.tenantMgr.RemoveTenant(name=TENANT_NAME)

        # Create a privilege
        privilege = self.create_privilege()

        # Add privilege to the non-existent tenant
        with self.assertRaises(vim.fault.NotFound):
            self.tenantMgr.AddPrivilege(tenant, privilege)

    def test_add_privilege_already_exists(self):
        # Create a tenant
        tenant = self.tenantMgr.CreateTenant(name=TENANT_NAME, description=TENANT_DESC)

        # Create a privilege
        privilege = self.create_privilege()

        # Add the privilege to the tenant
        self.tenantMgr.AddPrivilege(tenant, privilege)

        # Add the same privilege to the tenant again
        with self.assertRaises(vim.fault.AlreadyExists):
            self.tenantMgr.AddPrivilege(tenant, privilege)

    def test_add_privilege_invalid_datastore(self):
        # Create a tenant
        tenant = self.tenantMgr.CreateTenant(name=TENANT_NAME, description=TENANT_DESC)

        # Create a privilege with invalid datastore
        privilege = vim.vcs.storage.DatastoreAccessPrivilege()
        privilege.datastore = DS_NOT_EXIST
        privilege.allow_create = False
        privilege.volume_max_size = 1024
        privilege.volume_total_size = 2048

        # Add the privilege to the tenant
        with self.assertRaises(vmodl.fault.InvalidArgument):
            self.tenantMgr.AddPrivilege(tenant, privilege)

    def test_add_privilege_invalid_volume_size(self):
        """ Test add privilege with volume_total_size lesser than existing volume_max_size """

        # Create a tenant
        tenant = self.tenantMgr.CreateTenant(name=TENANT_NAME, description=TENANT_DESC)

        # Create a privilege with invalid volume size settings
        privilege = vim.vcs.storage.DatastoreAccessPrivilege()
        privilege.datastore = self.datastore
        privilege.allow_create = False
        privilege.volume_max_size = 2048
        privilege.volume_total_size = 1024

        # Add the privilege to the tenant
        with self.assertRaises(vmodl.fault.InvalidArgument):
            self.tenantMgr.AddPrivilege(tenant, privilege)

    def test_remove_privilege(self):
        # Create a tenant
        tenant = self.tenantMgr.CreateTenant(name=TENANT_NAME, description=TENANT_DESC)

        # Create a privilege
        privilege = self.create_privilege()

        # Add privilege to the tenant
        self.tenantMgr.AddPrivilege(tenant, privilege)

        # Remove privilege from the tenant
        self.tenantMgr.RemovePrivilege(tenant, self.datastore)

        # Verify the privilege
        result = self.tenantMgr.GetTenants(name=TENANT_NAME)
        self.assertTrue(result)
        self.assertFalse(result[0].privileges)

        # Verify the default datastore
        self.assertFalse(result[0].default_datastore)

    def test_remove_privilege_tenant_not_exists(self):
        # Create a tenant
        tenant = self.tenantMgr.CreateTenant(name=TENANT_NAME, description=TENANT_DESC)

        # Create a privilege
        privilege = self.create_privilege()

        # Add privilege to the tenant
        self.tenantMgr.AddPrivilege(tenant, privilege)

        # Remove the tenant
        self.tenantMgr.RemoveTenant(name=TENANT_NAME)

        # Remove privilege from the non-existent tenant
        with self.assertRaises(vim.fault.NotFound):
            self.tenantMgr.RemovePrivilege(tenant, privilege.datastore)

    def test_remove_privilege_invalid_arg_1(self):
        # Create a tenant
        tenant = self.tenantMgr.CreateTenant(name=TENANT_NAME, description=TENANT_DESC)

        # Remove a privilege with non-existent datastore from the tenant
        with self.assertRaises(vmodl.fault.InvalidArgument):
            self.tenantMgr.RemovePrivilege(tenant, DS_NOT_EXIST)

    def test_remove_privilege_invalid_arg_2(self):
        # Create a tenant
        tenant = self.tenantMgr.CreateTenant(name=TENANT_NAME, description=TENANT_DESC)

        # Remove a privilege not associated with this tenant
        with self.assertRaises(vmodl.fault.InvalidArgument):
            self.tenantMgr.RemovePrivilege(tenant, self.datastore)

    def test_update_privilege(self):
        # Create a tenant
        tenant = self.tenantMgr.CreateTenant(name=TENANT_NAME, description=TENANT_DESC)

        # Create a privilege
        privilege = self.create_privilege()

        # Add privilege to the tenant
        self.tenantMgr.AddPrivilege(tenant, privilege)

        # Update the privilege
        self.tenantMgr.UpdatePrivilege(tenant, self.datastore, allow_create=False, volume_max_size=1024, volume_total_size=2048)

        # Verify the privilege
        result = self.tenantMgr.GetTenants(name=TENANT_NAME)
        self.assertTrue(result)
        p = result[0].privileges
        self.assertTrue(p)
        self.assertEqual(p[0].datastore, self.datastore)
        self.assertEqual(p[0].allow_create, False)
        self.assertEqual(p[0].volume_max_size, 1024)
        self.assertEqual(p[0].volume_total_size, 2048)

    def test_update_privilege_with_invalid_volume_size(self):
        """ Test privilege update with volume_max_size greater than volume_total_size """

        # Create a tenant
        tenant = self.tenantMgr.CreateTenant(name=TENANT_NAME, description=TENANT_DESC)

        # Create a privilege without volume size settings
        privilege = vim.vcs.storage.DatastoreAccessPrivilege()
        privilege.datastore =  self.datastore
        privilege.allow_create = True

        # Add privilege to the tenant
        self.tenantMgr.AddPrivilege(tenant, privilege)

        # Update the privilege with invalid volume size
        with self.assertRaises(vmodl.fault.InvalidArgument):
            self.tenantMgr.UpdatePrivilege(tenant, self.datastore, volume_max_size=2048, volume_total_size=1024)

    def test_update_privilege_with_invalid_total_size(self):
        """ Test privilege update with volume_total_size lesser than existing volume_max_size """

        # Create a tenant
        tenant = self.tenantMgr.CreateTenant(name=TENANT_NAME, description=TENANT_DESC)

        # Create a privilege without volume size settings
        privilege = vim.vcs.storage.DatastoreAccessPrivilege()
        privilege.datastore =  self.datastore
        privilege.allow_create = True
        privilege.volume_max_size = 2048

        # Add privilege to the tenant
        self.tenantMgr.AddPrivilege(tenant, privilege)

        # Update the privilege with invalid volume size
        with self.assertRaises(vmodl.fault.InvalidArgument):
            self.tenantMgr.UpdatePrivilege(tenant, self.datastore, volume_total_size=1024)

    def test_update_privilege_with_invalid_max_size(self):
        """ Test privilege update with volume_max_size greater than existing volume_total_size """

        # Create a tenant
        tenant = self.tenantMgr.CreateTenant(name=TENANT_NAME, description=TENANT_DESC)

        # Create a privilege without volume size settings
        privilege = vim.vcs.storage.DatastoreAccessPrivilege()
        privilege.datastore =  self.datastore
        privilege.allow_create = True
        privilege.volume_total_size = 1024

        # Add privilege to the tenant
        self.tenantMgr.AddPrivilege(tenant, privilege)

        # Update the privilege with invalid volume size
        with self.assertRaises(vmodl.fault.InvalidArgument):
            self.tenantMgr.UpdatePrivilege(tenant, self.datastore, volume_max_size=2048)

    def test_update_privilege_tenant_not_exists(self):
        # Create a tenant
        tenant = self.tenantMgr.CreateTenant(name=TENANT_NAME, description=TENANT_DESC)

        # Create a privilege
        privilege = self.create_privilege()

        # Add privilege to the tenant
        self.tenantMgr.AddPrivilege(tenant, privilege)

        # Remove the tenant
        self.tenantMgr.RemoveTenant(name=TENANT_NAME)

        # Update the privilege
        with self.assertRaises(vim.fault.NotFound):
            self.tenantMgr.UpdatePrivilege(tenant, self.datastore, allow_create=False, volume_max_size=1024, volume_total_size=2048)

    def test_update_privilege_datastore_not_exists(self):
        # Create a tenant
        tenant = self.tenantMgr.CreateTenant(name=TENANT_NAME, description=TENANT_DESC)

        # Update the privilege with non-existent datastore
        with self.assertRaises(vmodl.fault.InvalidArgument):
            self.tenantMgr.UpdatePrivilege(tenant, DS_NOT_EXIST, allow_create=False, volume_max_size=1024, volume_total_size=2048)

    def test_update_privilege_datastore_not_related(self):
        # Create a tenant
        tenant = self.tenantMgr.CreateTenant(name=TENANT_NAME, description=TENANT_DESC)

        # Update the privilege with a datastore not associated with this tenant
        with self.assertRaises(vmodl.fault.InvalidArgument):
            self.tenantMgr.UpdatePrivilege(tenant, self.datastore, allow_create=False, volume_max_size=1024, volume_total_size=2048)

    def test_get_privilege(self):
        # Create a tenant
        tenant = self.tenantMgr.CreateTenant(name=TENANT_NAME, description=TENANT_DESC)

        # Create a privilege
        p1 = self.create_privilege()

        # Add privileges to the tenant
        self.tenantMgr.AddPrivilege(tenant, p1)

        # Get the tenant
        result = self.tenantMgr.GetTenants(name=TENANT_NAME)
        self.assertTrue(result)

        # Verify the privilege
        privileges = result[0].privileges
        self.assertTrue(privileges)
        self.assertEqual(len(privileges), 1)

        privilege = privileges[0]
        self.assertTrue(privilege)

        self.assertEqual(privilege.allow_create, True)
        self.assertEqual(privilege.volume_max_size, 512)
        self.assertEqual(privilege.volume_total_size, 1024)

    def test_get_privileges(self):
        if not self.datastore2:
            return

        # Create a tenant
        tenant = self.tenantMgr.CreateTenant(name=TENANT_NAME, description=TENANT_DESC)

        # Create 2 privileges
        p1 = self.create_privilege()
        p2 = self.create_privilege_2()

        # Add privileges to the tenant
        self.tenantMgr.AddPrivilege(tenant, p1)
        self.tenantMgr.AddPrivilege(tenant, p2)

        # Get the tenant
        result = self.tenantMgr.GetTenants(name=TENANT_NAME)
        self.assertTrue(result)

        # Verify the privileges
        privileges = result[0].privileges
        self.assertTrue(privileges)
        self.assertEqual(len(privileges), 2)

        privilege1 = None
        privilege2 = None
        for privilege in privileges:
            if privilege.datastore == self.datastore:
                privilege1 = privilege
            elif privilege.datastore == self.datastore2:
                privilege2 = privilege
        self.assertTrue(privilege1)
        self.assertTrue(privilege2)

        self.assertEqual(privilege1.allow_create, True)
        self.assertEqual(privilege1.volume_max_size, 512)
        self.assertEqual(privilege1.volume_total_size, 1024)

        self.assertEqual(privilege2.allow_create, False)
        self.assertEqual(privilege2.volume_max_size, 1024)
        self.assertEqual(privilege2.volume_total_size, 2048)

if __name__ == "__main__":
    log_config.configure()
    unittest.main()


text:
namespace CGAL {

namespace Surface_mesh_simplification
{

//
// Implementation of the vertex-pair collapse triangulated surface mesh simplification algorithm
//
template<class ECM_
        ,class ShouldStop_
        ,class VertexIndexMap_
        ,class EdgeIndexMap_
        ,class EdgeIsBorderMap_
        ,class EdgeIsConstrainedMap_
        ,class GetCost_
        ,class GetPlacement_
        ,class VisitorT_
        >
class EdgeCollapse
{
public:

  typedef ECM_              ECM ;
  typedef ShouldStop_       ShouldStop ;
  typedef VertexIndexMap_   VertexIndexMap ;
  typedef EdgeIndexMap_     EdgeIndexMap ;
  typedef EdgeIsBorderMap_  EdgeIsBorderMap ;
  typedef EdgeIsConstrainedMap_ EdgeIsConstrainedMap;
  typedef GetCost_          GetCost ;
  typedef GetPlacement_     GetPlacement ;
  typedef VisitorT_         VisitorT ;

  typedef EdgeCollapse Self ;

  typedef Edge_profile<ECM> Profile ;

  typedef boost::graph_traits  <ECM>       GraphTraits ;
  typedef boost::graph_traits  <ECM const> ConstGraphTraits ;
  typedef halfedge_graph_traits<ECM>       HalfedgeGraphTraits ;

  typedef typename GraphTraits::vertex_descriptor      vertex_descriptor ;
  typedef typename GraphTraits::vertex_iterator        vertex_iterator ;
  typedef typename GraphTraits::edge_descriptor        edge_descriptor ;
  typedef typename GraphTraits::edge_iterator          edge_iterator ;
  typedef typename GraphTraits::out_edge_iterator      out_edge_iterator ;
  typedef typename GraphTraits::in_edge_iterator       in_edge_iterator ;
  typedef typename GraphTraits::traversal_category     traversal_category ;
  typedef typename GraphTraits::edges_size_type        size_type ;

  typedef typename ConstGraphTraits::vertex_descriptor const_vertex_descriptor ;
  typedef typename ConstGraphTraits::edge_descriptor   const_edge_descriptor ;
  typedef typename ConstGraphTraits::in_edge_iterator  const_in_edge_iterator ;

  typedef typename HalfedgeGraphTraits::undirected_edge_iterator undirected_edge_iterator ;
  typedef typename HalfedgeGraphTraits::Point                    Point ;

  typedef typename GetCost     ::result_type Cost_type ;
  typedef typename GetPlacement::result_type Placement_type ;

  typedef typename Kernel_traits<Point>::Kernel Kernel ;

  typedef typename Kernel::Equal_3 Equal_3 ;

  typedef typename Kernel::Vector_3 Vector ;
  typedef typename Kernel::FT       FT ;

  struct Compare_id
  {
    Compare_id() : mAlgorithm(0) {}

    Compare_id( Self const* aAlgorithm ) : mAlgorithm(aAlgorithm) {}

    bool operator() ( edge_descriptor const& a, edge_descriptor const& b ) const
    {
      return mAlgorithm->get_directed_edge_id(a) < mAlgorithm->get_directed_edge_id(b);
    }

    Self const* mAlgorithm ;
  } ;

  struct Compare_cost
  {
    Compare_cost() : mAlgorithm(0) {}

    Compare_cost( Self const* aAlgorithm ) : mAlgorithm(aAlgorithm) {}

    bool operator() ( edge_descriptor const& a, edge_descriptor const& b ) const
    {
      // NOTE: A cost is an optional<> value.
      // Absent optionals are ordered first; that is, "none < T" and "T > none" for any defined T != none.
      // In consequence, edges with undefined costs will be promoted to the top of the priority queue and poped out first.
      return mAlgorithm->get_data(a).cost() < mAlgorithm->get_data(b).cost();
    }

    Self const* mAlgorithm ;
  } ;

  struct Undirected_edge_id : boost::put_get_helper<size_type, Undirected_edge_id>
  {
    typedef boost::readable_property_map_tag category;
    typedef size_type                        value_type;
    typedef size_type                        reference;
    typedef edge_descriptor                  key_type;

    Undirected_edge_id() : mAlgorithm(0) {}

    Undirected_edge_id( Self const* aAlgorithm ) : mAlgorithm(aAlgorithm) {}

    size_type operator[] ( edge_descriptor const& e ) const { return mAlgorithm->get_undirected_edge_id(e); }

    Self const* mAlgorithm ;
  } ;

  typedef Modifiable_priority_queue<edge_descriptor,Compare_cost,Undirected_edge_id> PQ ;
  typedef typename PQ::handle pq_handle ;

  // An Edge_data is associated with EVERY _undirected_ edge in the mesh (collapsable or not).
  // It relates the edge with the PQ-handle needed to update the priority queue
  // It also relates the edge with a policy-based cache
  class Edge_data
  {
  public :

    Edge_data() : mPQHandle() {}

    Cost_type const& cost() const { return mCost ; }
    Cost_type      & cost()       { return mCost ; }

    pq_handle PQ_handle() const { return mPQHandle ;}

    bool is_in_PQ() const { return mPQHandle != PQ::null_handle() ; }

    void set_PQ_handle( pq_handle h ) { mPQHandle = h ; }

    void reset_PQ_handle() { mPQHandle = PQ::null_handle() ; }

  private:

    Cost_type mCost ;
    pq_handle mPQHandle ;
  } ;
  typedef Edge_data* Edge_data_ptr ;
  typedef boost::scoped_array<Edge_data> Edge_data_array ;

public:

  EdgeCollapse( ECM&                        aSurface
              , ShouldStop           const& aShouldStop
              , VertexIndexMap       const& aVertex_index_map
              , EdgeIndexMap         const& aEdge_index_map
              , EdgeIsBorderMap      const& aEdge_is_border_map
              , EdgeIsConstrainedMap const& aEdge_is_constrained_map
              , GetCost              const& aGetCost
              , GetPlacement         const& aGetPlacement
              , VisitorT                    aVisitor
              ) ;

  int run() ;

private:

  void Collect();
  void Loop();
  bool Is_collapse_topologically_valid( Profile const& aProfile ) ;
  bool Is_tetrahedron( edge_descriptor const& h1 ) ;
  bool Is_open_triangle( edge_descriptor const& h1 ) ;
  bool Is_collapse_geometrically_valid( Profile const& aProfile, Placement_type aPlacement ) ;
  void Collapse( Profile const& aProfile, Placement_type aPlacement ) ;
  void Update_neighbors( vertex_descriptor const& aKeptV ) ;

  Profile create_profile ( edge_descriptor const& aEdge )
  {
    return Profile(aEdge,mSurface,Vertex_index_map,Edge_index_map,Edge_is_border_map);
  }

  size_type get_directed_edge_id   ( const_edge_descriptor const& aEdge ) const { return Edge_index_map[aEdge]; }
  size_type get_undirected_edge_id ( const_edge_descriptor const& aEdge ) const { return get_directed_edge_id(aEdge) / 2 ; }

  bool is_primary_edge ( const_edge_descriptor const& aEdge ) const { return ( get_directed_edge_id(aEdge) % 2 ) == 0 ; }

  edge_descriptor primary_edge ( edge_descriptor const& aEdge )
  {
    return is_primary_edge(aEdge) ? aEdge : opposite_edge(aEdge,mSurface) ;
  }

  bool is_border ( const_edge_descriptor const& aEdge ) const { return Edge_is_border_map[aEdge] ; }

  bool is_constrained( const_edge_descriptor const& aEdge ) const { return get(Edge_is_constrained_map,aEdge); }
  bool is_constrained( const_vertex_descriptor const& aVertex ) const;

  bool is_border_or_constrained( const_edge_descriptor const& aEdge ) const { return Edge_is_border_map[aEdge] ||
                                                                                Edge_is_constrained_map[aEdge];}

  bool is_undirected_edge_a_border ( const_edge_descriptor const& aEdge ) const
  {
    return is_border(aEdge) || is_border(opposite_edge(aEdge,mSurface)) ;
  }

  bool is_border ( const_vertex_descriptor const& aV ) const ;

  bool is_border_or_constrained ( const_vertex_descriptor const& aV ) const ;

  bool are_shared_triangles_valid( Point const& p0, Point const& p1, Point const& p2, Point const& p3 ) const ;

  edge_descriptor find_connection ( const_vertex_descriptor const& v0, const_vertex_descriptor const& v1 ) const ;

  vertex_descriptor find_exterior_link_triangle_3rd_vertex ( const_edge_descriptor const& e, const_vertex_descriptor const& v0, const_vertex_descriptor const& v1 ) const ;

  Edge_data& get_data ( edge_descriptor const& aEdge ) const
  {
    CGAL_assertion( is_primary_edge(aEdge) ) ;
    return mEdgeDataArray[get_undirected_edge_id(aEdge)];
  }

  Point const& get_point ( const_vertex_descriptor const& aV ) const
  {
    return get(vertex_point,mSurface,aV);
  }

  boost::tuple<const_vertex_descriptor,const_vertex_descriptor> get_vertices( const_edge_descriptor const& aEdge ) const
  {
    const_vertex_descriptor p,q ;
    p = boost::source(aEdge,mSurface);
    q = boost::target(aEdge,mSurface);
    return boost::make_tuple(p,q);
  }

  boost::tuple<vertex_descriptor,vertex_descriptor> get_vertices( edge_descriptor const& aEdge )
  {
    vertex_descriptor p,q ;
    p = boost::source(aEdge,mSurface);
    q = boost::target(aEdge,mSurface);
    return boost::make_tuple(p,q);
  }

  std::string vertex_to_string( const_vertex_descriptor const& v ) const
  {
    Point const& p = get_point(v);
    return boost::str( boost::format("[V%1%:%2%]") % get(Vertex_index_map,v) % xyz_to_string(p) ) ;
  }

  std::string edge_to_string ( const_edge_descriptor const& aEdge ) const
  {
    const_vertex_descriptor p,q ; boost::tie(p,q) = get_vertices(aEdge);
    return boost::str( boost::format("{E%1% %2%->%3%}%4%") % get(Edge_index_map,aEdge) % vertex_to_string(p) % vertex_to_string(q) % ( is_border(aEdge) ? " (BORDER)" : ( is_border(aEdge->opposite()) ? " (~BORDER)": "" ) ) ) ;
  }

  Cost_type get_cost ( Profile const& aProfile ) const
  {
    return Get_cost(aProfile, get_placement(aProfile) );
  }

  Placement_type get_placement( Profile const& aProfile ) const
  {
    return Get_placement(aProfile);
  }

  void insert_in_PQ( edge_descriptor const& aEdge, Edge_data& aData )
  {
    CGAL_SURF_SIMPL_TEST_assertion(is_primary_edge(aEdge)) ;
    CGAL_SURF_SIMPL_TEST_assertion(!aData.is_in_PQ());
    CGAL_SURF_SIMPL_TEST_assertion(!mPQ->contains(aEdge) ) ;

    aData.set_PQ_handle(mPQ->push(aEdge));

    CGAL_SURF_SIMPL_TEST_assertion(aData.is_in_PQ());
    CGAL_SURF_SIMPL_TEST_assertion(mPQ->contains(aEdge) ) ;
  }

  void update_in_PQ( edge_descriptor const& aEdge, Edge_data& aData )
  {
    CGAL_SURF_SIMPL_TEST_assertion(is_primary_edge(aEdge)) ;
    CGAL_SURF_SIMPL_TEST_assertion(aData.is_in_PQ());
    CGAL_SURF_SIMPL_TEST_assertion(mPQ->contains(aEdge) ) ;

    aData.set_PQ_handle(mPQ->update(aEdge,aData.PQ_handle())) ;

    CGAL_SURF_SIMPL_TEST_assertion(aData.is_in_PQ());
    CGAL_SURF_SIMPL_TEST_assertion(mPQ->contains(aEdge) ) ;
  }

  void remove_from_PQ( edge_descriptor const& aEdge, Edge_data& aData )
  {
    CGAL_SURF_SIMPL_TEST_assertion(is_primary_edge(aEdge)) ;
    CGAL_SURF_SIMPL_TEST_assertion(aData.is_in_PQ());
    CGAL_SURF_SIMPL_TEST_assertion(mPQ->contains(aEdge) ) ;

    aData.set_PQ_handle(mPQ->erase(aEdge,aData.PQ_handle()));

    CGAL_SURF_SIMPL_TEST_assertion(!aData.is_in_PQ());
    CGAL_SURF_SIMPL_TEST_assertion(!mPQ->contains(aEdge) ) ;
  }

  optional<edge_descriptor> pop_from_PQ()
  {
    optional<edge_descriptor> rEdge = mPQ->extract_top();
    if ( rEdge )
    {
      CGAL_SURF_SIMPL_TEST_assertion(is_primary_edge(*rEdge) ) ;
      CGAL_SURF_SIMPL_TEST_assertion(get_data(*rEdge).is_in_PQ()) ;

      get_data(*rEdge).reset_PQ_handle();

      CGAL_SURF_SIMPL_TEST_assertion(!get_data(*rEdge).is_in_PQ() ) ;
      CGAL_SURF_SIMPL_TEST_assertion(!mPQ->contains(*rEdge)) ;
    }
    return rEdge ;
  }

  /// Functions to ensure the backward compatibility before addition of the constrained edge map
  template<class AEdgeIsConstrainedMap>
  vertex_descriptor
  halfedge_collapse_bk_compatibility(
    edge_descriptor const& pq, AEdgeIsConstrainedMap aEdge_is_constrained_map)
  {
    return halfedge_collapse(pq, mSurface, aEdge_is_constrained_map);
  }

  template<class ECM>
  vertex_descriptor
  halfedge_collapse_bk_compatibility(
    edge_descriptor const& pq, No_constrained_edge_map<ECM> )
  {
    return halfedge_collapse(pq, mSurface);
  }
  ///

  /// We wrap this test to avoid penalizing runtime when no constraints are present
  template<class AEdgeIsConstrainedMap>
  bool
  is_edge_adjacent_to_a_constrained_edge(
    Profile const& aProfile, AEdgeIsConstrainedMap)
  {
    return is_constrained(aProfile.v0()) && is_constrained(aProfile.v1());
  }

  template<class ECM>
  bool
  is_edge_adjacent_to_a_constrained_edge(
    edge_descriptor const&, No_constrained_edge_map<ECM> )
  {
    return false;
  }
  ///

private:

  ECM&                   mSurface ;

  ShouldStop           const& Should_stop ;
  VertexIndexMap       const& Vertex_index_map ;
  EdgeIndexMap         const& Edge_index_map ;
  EdgeIsBorderMap      const& Edge_is_border_map;
  EdgeIsConstrainedMap const& Edge_is_constrained_map;
  GetCost              const& Get_cost ;
  GetPlacement         const& Get_placement ;
  VisitorT                    Visitor ;

private:

  Edge_data_array mEdgeDataArray ;

  boost::scoped_ptr<PQ> mPQ ;

  std::size_t mInitialEdgeCount ;
  std::size_t mCurrentEdgeCount ;

  FT          mcMaxDihedralAngleCos2 ;

  CGAL_ECMS_DEBUG_CODE ( unsigned mStep ; )
} ;

} // namespace Surface_mesh_simplification

} //namespace CGAL

#include <CGAL/Surface_mesh_simplification/Detail/Edge_collapse_impl.h>

#endif // CGAL_SURFACE_MESH_SIMPLIFICATION_I_EDGE_COLLAPSE_H //
// EOF //


text:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <!--<type name="Jh\Import\AttributeProcessor\AttributeProcessor">-->
        <!--<arguments>-->
            <!--<argument name="attributeProcessors" xsi:type="array">-->
                <!--<item name="brand" xsi:type="object">Jh\Import\AttributeProcessor\Brand</item>-->
            <!--</argument>-->
        <!--</arguments>-->
    <!--</type>-->
    <virtualType name="jh_import_reader" type="Magento\Framework\Config\Reader\Filesystem">
        <arguments>
            <argument name="converter" xsi:type="object">Jh\Import\Config\Converter</argument>
            <argument name="schemaLocator" xsi:type="object">Jh\Import\Config\SchemaLocator</argument>
            <argument name="fileName" xsi:type="string">imports.xml</argument>
            <argument name="idAttributes" xsi:type="array">
                <item name="/config/db" xsi:type="string">name</item>
                <item name="/config/files" xsi:type="string">name</item>
                <item name="/config/webapi" xsi:type="string">name</item>
            </argument>
        </arguments>
    </virtualType>
    <type name="Jh\Import\Config\Data">
        <arguments>
            <argument name="reader" xsi:type="object">jh_import_reader</argument>
            <argument name="cacheId" xsi:type="string">jh_import_config_cache</argument>
        </arguments>
    </type>
    <preference for="Symfony\Component\Console\Output\OutputInterface" type="Symfony\Component\Console\Output\ConsoleOutput" />
    <type name="Magento\Framework\Console\CommandList">
        <arguments>
            <argument name="commands" xsi:type="array">
                <item name="import_list" xsi:type="object">Jh\Import\Command\ListImportsCommand</item>
                <item name="import_run" xsi:type="object">Jh\Import\Command\RunImportCommand</item>
                <item name="import_view_log" xsi:type="object">Jh\Import\Command\ViewLogsCommand</item>
                <item name="import_unlock" xsi:type="object">Jh\Import\Command\UnlockImportCommand</item>
                <item name="import_locks" xsi:type="object">Jh\Import\Command\ViewLocksCommand</item>
                <item name="import_clear_last_log" xsi:type="object">Jh\Import\Command\ClearLastImportLogCommand</item>
            </argument>
        </arguments>
    </type>

    <type name="Jh\Import\Command\ClearLastImportLogCommand">
        <arguments>
            <argument name="resourceConnection" xsi:type="object">Magento\Framework\App\ResourceConnection\Proxy</argument>
        </arguments>
    </type>
    <type name="Jh\Import\Command\ListImportsCommand">
        <arguments>
            <argument name="cronConfig" xsi:type="object">Magento\Cron\Model\Config\Proxy</argument>
        </arguments>
    </type>

    <type name="Magento\Framework\Event\Config">
        <plugin name="jh_import_event_observer_disable" type="Jh\Import\Writer\Utils\DisableEventObserver"/>
    </type>

    <!-- reporting -->
    <preference for="Jh\Import\Report\Handler\Email\Strategy\EmailHandlerStrategy" type="Jh\Import\Report\Handler\Email\Strategy\FingersCrossedMax" />

    <!-- admin area -->
    <type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
        <arguments>
            <argument name="collections" xsi:type="array">
                <item name="import_history_listing_data_source" xsi:type="string">import_history_grid_collection</item>
                <item name="import_history_log_listing_data_source" xsi:type="string">import_history_log_grid_collection</item>
                <item name="import_history_item_log_listing_data_source" xsi:type="string">import_history_item_log_grid_collection</item>
                <item name="import_listing_data_source" xsi:type="string">import_listing</item>
            </argument>
        </arguments>
    </type>

    <virtualType name="import_listing" type="Jh\Import\Ui\Component\Listing\ImportSearchResult">
    </virtualType>

    <virtualType name="import_history_grid_collection" type="\Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">
        <arguments>
            <argument name="mainTable" xsi:type="string">jh_import_history</argument>
            <argument name="resourceModel" xsi:type="string">Jh\Import\Entity\ImportHistoryResource</argument>
        </arguments>
    </virtualType>
    <virtualType name="import_history_log_grid_collection" type="\Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">
        <arguments>
            <argument name="mainTable" xsi:type="string">jh_import_history_log</argument>
            <argument name="resourceModel" xsi:type="string">Jh\Import\Entity\ImportHistoryLogResource</argument>
        </arguments>
    </virtualType>
    <virtualType name="import_history_item_log_grid_collection" type="\Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">
        <arguments>
            <argument name="mainTable" xsi:type="string">jh_import_history_item_log</argument>
            <argument name="resourceModel" xsi:type="string">Jh\Import\Entity\ImportHistoryItemLogResource</argument>
        </arguments>
    </virtualType>

    <!-- Logger section -->
    <virtualType name="Jh\Import\Logger\AllSeverityHandler" type="Magento\Framework\Logger\Handler\Base">
        <arguments>
            <argument name="fileName" xsi:type="string">/var/log/data-migration.log</argument>
        </arguments>
    </virtualType>

    <virtualType name="Jh\Import\Logger\ImportLogger" type="Magento\Framework\Logger\Monolog">
        <arguments>
            <argument name="handlers" xsi:type="array">
                <item name="debug" xsi:type="object">Jh\Import\Logger\AllSeverityHandler</item>
            </argument>
        </arguments>
    </virtualType>
    <!-- End of Logger section -->

    <!-- Constructor arguments section -->
    <type name="Jh\Import\Progress\CliProgress">
        <arguments>
            <argument name="logger" xsi:type="object">Jh\Import\Logger\ImportLogger</argument>
        </arguments>
    </type>

    <type name="Jh\Import\Source\Webapi">
        <arguments>
            <argument name="httpClient" xsi:type="object">GuzzleHttp\Client</argument>
        </arguments>
    </type>
    <!-- End of constructor arguments section -->
</config>


text:
class ServiceConfiguration < ActiveRecord::Base

  include Engines::Api

  attr_accessor :service, :name, :no_save, :label, :description, :engines_api_error

  has_many :variables, as: :variable_consumer, dependent: :destroy
  accepts_nested_attributes_for :variables

  def load
    assign_attributes(service.configurator_params_for name)
    self
  end

  def persist!
    valid? && save
  end

  def save
    result = engines_api.update_service_configuration(update_service_configuration_params)
    if !result.was_success
      @engines_api_error = "Unable to configure service. " +
                            "Called 'update_service_configuration' with params :service_name :configurator_name :variables. " +
                            (result.result_mesg.present? ? result.result_mesg : "No result message given by engines api.")
    end
    result.was_success
  end

  def new_record?
    false
  end

  # def variable_values
  #   @variable_values ||= @service.service_configuration_variables_for(name)
  # end

  def update_service_configuration_params
    { service_name: service.container_name, configurator_name: name, variables: update_service_configuration_variables_params }
  end

  def update_service_configuration_variables_params
    {}.tap do |result|
      variables.each do |variable|
        result[variable.name.to_sym] = variable.value
      end
    end
  end

end


text:
<?php

/**
 * @category   PHP
 * @package    CodeCoverage
 * @author     Arne Blankerts <arne@blankerts.de>
 * @copyright  Sebastian Bergmann <sebastian@phpunit.de>
 * @license    http://www.opensource.org/licenses/BSD-3-Clause  The BSD 3-Clause License
 * @link       http://github.com/sebastianbergmann/php-code-coverage
 * @since      Class available since Release 2.0.0
 */
class PHP_CodeCoverage_Report_XML_File_Unit
{
    /**
     * @var DOMElement
     */
    private $contextNode;

    public function __construct(DOMElement $context, $name)
    {
        $this->contextNode = $context;

        $this->setName($name);
    }

    private function setName($name)
    {
        $this->contextNode->setAttribute('name', $name);
    }

    public function setLines($start, $executable, $executed)
    {
        $this->contextNode->setAttribute('start', $start);
        $this->contextNode->setAttribute('executable', $executable);
        $this->contextNode->setAttribute('executed', $executed);
    }

    public function setCrap($crap)
    {
        $this->contextNode->setAttribute('crap', $crap);
    }

    public function setPackage($full, $package, $sub, $category)
    {
        $node = $this->contextNode->getElementsByTagNameNS(
            'http://schema.phpunit.de/coverage/1.0',
            'package'
        )->item(0);

        if (!$node) {
            $node = $this->contextNode->appendChild(
                $this->contextNode->ownerDocument->createElementNS(
                    'http://schema.phpunit.de/coverage/1.0',
                    'package'
                )
            );
        }

        $node->setAttribute('full', $full);
        $node->setAttribute('name', $package);
        $node->setAttribute('sub', $sub);
        $node->setAttribute('category', $category);
    }

    public function setNamespace($namespace)
    {
        $node = $this->contextNode->getElementsByTagNameNS(
            'http://schema.phpunit.de/coverage/1.0',
            'namespace'
        )->item(0);

        if (!$node) {
            $node = $this->contextNode->appendChild(
                $this->contextNode->ownerDocument->createElementNS(
                    'http://schema.phpunit.de/coverage/1.0',
                    'namespace'
                )
            );
        }

        $node->setAttribute('name', $namespace);
    }

    public function addMethod($name)
    {
        $node = $this->contextNode->appendChild(
            $this->contextNode->ownerDocument->createElementNS(
                'http://schema.phpunit.de/coverage/1.0',
                'method'
            )
        );

        return new PHP_CodeCoverage_Report_XML_File_Method($node, $name);
    }
}


text:
var ember;
(function (ember) {
    "use strict";
    var CustomBootstraper = (function () {
        function CustomBootstraper() {
        }
        CustomBootstraper.prototype.configValidationFLows = function (validationFlowService) {
            validationFlowService.atForm("TestForm").forValidationObject("Password").continueWith("ConfirmPassword");
        };
        return CustomBootstraper;
    })();
    ember.CustomBootstraper = CustomBootstraper;
})(ember || (ember = {}));
//# sourceMappingURL=custombootstraper.js.map


text:
<!DOCTYPE html>

theme: jekyll-theme-cayman

<title>Hello World</title>
<link rel="stylesheet" href="web css.css">

Hello World

I am Olivia and this is my website

This is Max, my pet


text:
package service

import (
	"crypto/aes"
	"encoding/base64"
	"encoding/json"
	"errors"
	"fmt"
	"github.com/gocraft/web"
	"github.com/smancke/gogallery/imglib"
	"log"
	"net/http"
	"time"
)

type AuthCookie struct {
	DisplayName string   `json:"displayName"`
	UserName    string   `json:"userName"`
	Groups      []string `json:"groups"`
	LastSeen    int64    `json:"lastSeen"`
	UserId      string   `json:"userId"`
}

func getVerifiedAuthCookie(r *web.Request) (*AuthCookie, error) {
	if testOverwriteUsername != "" {
		return &AuthCookie{
			UserName:    testOverwriteUsername,
			DisplayName: testOverwriteUsername,
		}, nil
	}

	authCookie, err := readCookie(r, Cfg("cookieName"), Cfg("session_secret"))
	if err != nil {
		return nil, err
	}

	lastSeen := time.Unix(int64(authCookie.LastSeen/1000), 0)
	sessionDuration := time.Minute * time.Duration(CfgInt("sessionLifetimeMinutes"))
	validUntil := lastSeen.Add(sessionDuration)

	if validUntil.Before(time.Now()) {
		return authCookie, fmt.Errorf("session expired")
	}
	return authCookie, nil
}

func (userApi *UserApi) UserRequired(rw web.ResponseWriter, r *web.Request, next web.NextMiddlewareFunc) {

	authCookie, err := getVerifiedAuthCookie(r)
	if err != nil {
		log.Printf("not logged in: %v, %#v", err, authCookie)
		sendError(rw, "not logged in", http.StatusForbidden)
		return
	}

	user, err := userApi.Lib().UserByUsername(authCookie.UserName)
	if err == nil && user != nil {
		userApi.user = user
	} else {
		userApi.user = &imglib.User{
			UserName: authCookie.UserName,
			NickName: authCookie.DisplayName,
		}
		err := userApi.Lib().CreateUser(userApi.user)
		if err != nil {
			panic(err)
		}
	}
	next(rw, r)
}

func readCookie(r *web.Request, cookieName string, secret string) (*AuthCookie, error) {
	rawCookie, err := r.Cookie(cookieName)
	if err != nil {
		return nil, err
	}

	jsonData, err := decrypt([]byte(rawCookie.Value), secret)
	if err != nil {
		return nil, err
	}

	jsonData, err = pkcs5UnPadding(jsonData)
	if err != nil {
		return nil, err
	}

	cookie := AuthCookie{}
	err = json.Unmarshal(jsonData, &cookie)
	if err != nil {
		return nil, err
	}
	return &cookie, nil
}

func decrypt(data []byte, secret string) ([]byte, error) {
	data, err := base64.StdEncoding.DecodeString(string(data))
	if err != nil {
		return nil, err
	}

	aes, err := aes.NewCipher([]byte(secret))
	if err != nil {
		log.Printf("error on AES cipher creation: %v", err)
		return nil, err
	}

	bs := aes.BlockSize()
	if len(data)%bs != 0 {
		return nil, fmt.Errorf("AES need a multiple of the blocksize")
	}

	decrypted := make([]byte, len(data))
	decryptedComplete := decrypted
	for len(data) > 0 {
		aes.Decrypt(decrypted, data)
		decrypted = decrypted[bs:]
		data = data[bs:]
	}
	return decryptedComplete, nil
}

func pkcs5UnPadding(src []byte) ([]byte, error) {
	length := len(src)
	unpadding := int(src[length-1])
	rindex := length - unpadding
	if rindex < 0 || rindex >= length {
		return nil, errors.New("wrong rindex for unpadding okcs5 cookie")
	}
	return src[:rindex], nil
}


text:
Article 2228
----
La prescription se compte par jours, et non par heures.


text:
cask 'font-irish-grover' do
  version :latest
  sha256 :no_check

  # github.com/google/fonts was verified as official when first introduced to the cask
  url 'https://github.com/google/fonts/raw/master/apache/irishgrover/IrishGrover.ttf'
  name 'Irish Grover'
  homepage 'http://www.google.com/fonts/specimen/Irish+Grover'

  font 'IrishGrover.ttf'
end