text:
This console application shows how you can migrate data coming from InfoPath XML files into SharePoint list items

### Applies to ###
-  Office 365
-  SharePoint 2013/2016 on-premises

### Solution ###
Solution | Author(s)
---------|----------
EmpRegConsole | Raja Shekar Bhumireddy, Bert Jansen (**Microsoft**)

### Version history ###
Version  | Date | Comments
---------| -----| --------
1.0  | August 27th 2015 | Initial release

### Disclaimer ###
**THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**

----------

# Introduction#
When an existing InfoPath form is transformed to a new solution like a SharePoint Add-In it often also means that the existing data created using that InfoPath form needs to be retained. InfoPath by default persists data using the InfoPath XML specification...so we have a set of InfoPath XML files. This simple console application shows how you can read those InfoPath XML files, read the relevant data from them and create equivalent items in a SharePoint list.

# Important coding techniques #
## Getting the data from the InfoPath XML files ##
Below snippet shows how to grab relevant properties from the InfoPath XML file.

```C#
File ipFile = item.File;
ClientResult<System.IO.Stream> streamItem = ipFile.OpenBinaryStream();
clientContext.Load(ipFile);
clientContext.ExecuteQuery();

System.IO.MemoryStream memStream = new System.IO.MemoryStream();
streamItem.Value.CopyTo(memStream);
memStream.Position = 0;

XmlDocument ipXML = new XmlDocument();
ipXML.Load(memStream);
XmlNamespaceManager ns = new XmlNamespaceManager(ipXML.NameTable);
ns.AddNamespace("my", ipXML.DocumentElement.NamespaceURI);

XPathNavigator empNavigator = ipXML.CreateNavigator();
employee = new Employees();
employee.Name = empNavigator.SelectSingleNode("/my:EmployeeForm/my:txtName", ns).Value;
employee.UserID = empNavigator.SelectSingleNode("/my:EmployeeForm/my:txtUserID", ns).Value;
employee.Manager = empNavigator.SelectSingleNode("/my:EmployeeForm/my:txtManager", ns).Value;
employee.Number = empNavigator.SelectSingleNode("/my:EmployeeForm/my:txtEmpNumber", ns).Value;
employee.Designation = empNavigator.SelectSingleNode("/my:EmployeeForm/my:ddlDesignation", ns).Value;
employee.Locaiton = empNavigator.SelectSingleNode("/my:EmployeeForm/my:ddlCity", ns).Value;

XmlNodeList nodeSkills = ipXML.SelectNodes("//my:Skill", ns);
StringBuilder sbSkills = new StringBuilder();
foreach (XmlNode nodeSkill in nodeSkills)
{
    XmlNodeList lstSkill = nodeSkill.ChildNodes;
    sbSkills.Append(lstSkill[0].InnerText).Append(",").Append(lstSkill[1].InnerText).Append(";");
} //foreach (XmlNode nodeSkill in nodeSkills)

employee.Skills= sbSkills.ToString();
```

Notice how we transform a multi-value InfoPath item (```Skill```) to a comma delimited list in this implementation, but one could also store data in different SharePoint lists if that would be more appropriate.

## Authenticating to SharePoint ##
This sample is taken a simple approach that works in on-premises by simply taking the credentials of the user executing the code:

```C#
using (ClientContext clientContext = new ClientContext(sharePointSiteUrl))
{
    Employees employee;
    Web web = clientContext.Web;
    List libInfoPath = web.Lists.GetByTitle(infoPathLibName); // EmpRegLib

    var ipItems = libInfoPath.GetItems(CamlQuery.CreateAllItemsQuery());
    clientContext.Load(ipItems);
    clientContext.ExecuteQuery();

    foreach (ListItem item in ipItems)
    {
        ReadInfoPathFile(clientContext, web, item, out employee);
        AddInfoPathToList(clientContext, web, employee);
    } // foreach (ListItem item in ipItems)
}
```

If you're migrating from an Office 365 list with InfoPath XML files or in case you want to specify a different user please checkout the [AuthenticationManager class](https://github.com/OfficeDev/PnP-Sites-Core/blob/dev/Core/OfficeDevPnP.Core/AuthenticationManager.cs) and [documentation](https://github.com/OfficeDev/PnP-Sites-Core/blob/dev/Core/README.md#authenticationmanagercs) from the [PnP-Sites-Core repository](https://github.com/OfficeDev/PnP-Sites-Core/tree/dev).

<img src="https://telemetry.sharepointpnp.com/pnp-transformation/infopath/migration/empregconsole" />


text:
<?php
/**
 * Bootstrapping functions, essential and needed for Tahiti to work together with some common helpers.
 *
 */

/**
 * Default exception handler.
 *
 */
function myExceptionHandler($exception) {
  echo "Tahiti: Uncaught exception:
" . $exception->getMessage() . "

" . $exception->getTraceAsString(), "
";
}
set_exception_handler('myExceptionHandler');

/**
 * Autoloader for classes.
 *
 */
function myAutoloader($class) {
    $path = TAHITI_INSTALL_PATH . "/src/{$class}/{$class}.php";
    if(is_file($path)) {
        include($path);
    }
    else {
        throw new Exception("Classfile '{$class}' does not exists.");
    }
}
spl_autoload_register('myAutoloader');

/**
 * Dump all contents of a variabel.
 *
 */
function dump($a) {
  echo '
' . print_r($a, 1) . '
';
}

redpajama_set_name: RedPajamaGithub


text:
$(document).ready(function () {
    $("#chatContainer").perfectScrollbar();

    window.onbeforeunload = function (e) {
        var e = e || window.event;

        //IE & Firefox
        if (e) {
            e.returnValue = 'Are you sure?';
        }
        // For Safari
        return 'Czy na pewno chcesz opuscic chat' + unsubChat();
    };

    $('#forms').submit(function () {
        var value = $('#m').val();
        applyToCommands(value);
        $('#m').val('');
        return false;
    });
});
function scrollAndRefresh(){
    $('html, body').animate({
        scrollTop: $(document).height()
    }, 1000);
    refreshScrollbar($(window).width(),$(window).height()-50)
}
function appendMessage(msg) {
    $('#messages').append($('<li>').html(msg));
}
function parseAndAppendMessage(incomingObject) {
    $('#messages').append($('<li>')
            .append($("<span>").html(incomingObject.name + ":").css("color", incomingObject.color))
            .append($("<p>").html(incomingObject.chatMessage).emoticonize())
    );
    scrollAndRefresh();
    console.log(incomingObject.id);
    lastMessage = incomingObject.id > lastMessage ? incomingObject.id : lastMessage;
}
function unsubChat() {
    connection.abort();
    var toBeSent = {
        name: nickname,
        color: currentColor,
        chatMessage: [nickname, " opuścił chat"].join(""),
        currentTime: new Date().getTime(),
        channel: currentChannel
    };
    $.ajax({
        method: "POST",
        url: "unsub",
        data: JSON.stringify(toBeSent),
        dataType: "json",
        contentType: "application/json; charset=utf-8"
    });
    return "Poszło"
}
function poll() {
    var toBeSent = {
        name: nickname,
        channel: currentChannel,
        currentTime: lastMessage
    };
    connection = $.ajax({
        method: "POST",
        url: "poll",
        success: function (data) {
            console.log("SUCCESS " + JSON.stringify(data));
            $.each(data, function (index, element) {
                parseAndAppendMessage(element)
            });
        },
        complete: function(error){
            poll()
        },
        data: JSON.stringify(toBeSent),
        dataType: "json",
        contentType: "application/json; charset=utf-8"
    })
}

function getListOfActiveUsers(){
    $.ajax({
        method: "GET",
        url: "listusers",
        dataType: "json",
        contentType: "application/json; charset=utf-8",
        success: function (response) {
            console.log(response);
            cos = response
            var accumulator = "Online: ";
            for(var i=0; i < response.length; i++){
                //TODO: Lagpoint poprawic, ale teraz nie chce mi sie z tym bawic, z niewiadomych powodow concat nie dziala
                accumulator += response[i] + " "
            }
            appendMessage(accumulator)
        }
    });
}

//TODO: Zrobić, tak aby ta funkcja nie była konieczna, bo jest bardzo niebezpieczna, ale w tym konkretnym momencie mi się nie chce.
function emitMessageAs(data, nick, color) {
    var toBeSent = {
        name: nick,
        channel: currentChannel,
        color: color,
        chatMessage: data,
        currentTime: new Date().getTime()
    };
    $.ajax({
        url: "sendMessage",
        method: "POST",
        dataType: "json",
        contentType: "application/json; charset=utf-8",
        traditional: true,
        success: function (data) {
            console.log(data);
        },
        data: JSON.stringify(toBeSent)
    });
}

function emitMessage(data) {
    emitMessageAs(data, nickname, currentColor)
}

$(document).ready(function () {
    poll();
});


text:
<?php
namespace Zf2datatable\Form\Element;

use \Zend\Form\Element\Textarea as Textarea;

class CKEditor extends Textarea{

}

?>


text:
module Spree
  module CreditCards
    class Find
      def execute(scope:, params:)
        return scope.default.take if params[:id].eql?('default')
        return scope.where(payment_method_id: params[:filter]['payment_method_id']) if params[:filter].present?

        scope
      end
    end
  end
end


text:
<?php

require_once('config.php');

$content = file_get_contents('https://api.buycraft.net/v4?action=packages&secret=' . $buycraftSecret);
$json = json_decode($content, true);

$content1 = file_get_contents('https://api.buycraft.net/v4?action=info&secret=' . $buycraftSecret);
$json1 = json_decode($content1, true);

$categories = array();

foreach($json['payload'] as $package){
    $category = $package['category'];
    if(array_key_exists($category, $categories)) {
       array_push($categories[$category], $package);
    } else {
        $categories[$category] = array($package);
    }
}

foreach(array_keys($categories) as $cat) {
    $content2 = file_get_contents('https://api.buycraft.net/v4?action=categories&secret=' . $buycraftSecret);
    $json2 = json_decode($content2, true);

    $catName = "Error";

    foreach($json2['payload'] as $cat1) {
        if($cat1['id'] == $cat) {
            $catName = $cat1['name'];
        }
    }

    echo "

" . $catName . "
";
    foreach($categories[$cat] as $package) {
        echo "

" . $package['name'] . "
" . $package['description'] . "

Buy for " . $package['price'] . " " . $json1['payload']['serverCurrency'] . "

";
    }
    echo "

";
}

?>


text:
from msrest import Serializer, Deserializer
from typing import Any, AsyncIterable, Optional, Union

from azure.core.async_paging import AsyncItemPaged

from .. import models as _models

class WebSiteManagementClientOperationsMixin(object):

    async def check_name_availability(
        self,
        name: str,
        type: Union[str, "_models.CheckNameResourceTypes"],
        is_fqdn: Optional[bool] = None,
        **kwargs: Any
    ) -> _models.ResourceNameAvailability:
        """Check if a resource name is available.

        Description for Check if a resource name is available.

        :param name: Resource name to verify.
        :type name: str
        :param type: Resource type used for verification.
        :type type: str or ~azure.mgmt.web.v2022_03_01.models.CheckNameResourceTypes
        :param is_fqdn: Is fully qualified domain name. Default value is None.
        :type is_fqdn: bool
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: ResourceNameAvailability, or the result of cls(response)
        :rtype: ~azure.mgmt.web.v2022_03_01.models.ResourceNameAvailability
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        api_version = self._get_api_version('check_name_availability')
        if api_version == '2016-03-01':
            from ..v2016_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2018-02-01':
            from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2019-08-01':
            from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-06-01':
            from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-09-01':
            from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-12-01':
            from ..v2020_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-01-01':
            from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-01-15':
            from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-03-01':
            from ..v2021_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2022-03-01':
            from ..v2022_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        else:
            raise ValueError("API version {} does not have operation 'check_name_availability'".format(api_version))
        mixin_instance = OperationClass()
        mixin_instance._client = self._client
        mixin_instance._config = self._config
        mixin_instance._serialize = Serializer(self._models_dict(api_version))
        mixin_instance._serialize.client_side_validation = False
        mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
        return await mixin_instance.check_name_availability(name, type, is_fqdn, **kwargs)

    async def get_publishing_user(
        self,
        **kwargs: Any
    ) -> _models.User:
        """Gets publishing user.

        Description for Gets publishing user.

        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: User, or the result of cls(response)
        :rtype: ~azure.mgmt.web.v2022_03_01.models.User
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        api_version = self._get_api_version('get_publishing_user')
        if api_version == '2016-03-01':
            from ..v2016_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2018-02-01':
            from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2019-08-01':
            from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-06-01':
            from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-09-01':
            from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-12-01':
            from ..v2020_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-01-01':
            from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-01-15':
            from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-03-01':
            from ..v2021_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2022-03-01':
            from ..v2022_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        else:
            raise ValueError("API version {} does not have operation 'get_publishing_user'".format(api_version))
        mixin_instance = OperationClass()
        mixin_instance._client = self._client
        mixin_instance._config = self._config
        mixin_instance._serialize = Serializer(self._models_dict(api_version))
        mixin_instance._serialize.client_side_validation = False
        mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
        return await mixin_instance.get_publishing_user(**kwargs)

    async def get_source_control(
        self,
        source_control_type: str,
        **kwargs: Any
    ) -> _models.SourceControl:
        """Gets source control token.

        Description for Gets source control token.

        :param source_control_type: Type of source control.
        :type source_control_type: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: SourceControl, or the result of cls(response)
        :rtype: ~azure.mgmt.web.v2022_03_01.models.SourceControl
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        api_version = self._get_api_version('get_source_control')
        if api_version == '2016-03-01':
            from ..v2016_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2018-02-01':
            from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2019-08-01':
            from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-06-01':
            from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-09-01':
            from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-12-01':
            from ..v2020_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-01-01':
            from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-01-15':
            from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-03-01':
            from ..v2021_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2022-03-01':
            from ..v2022_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        else:
            raise ValueError("API version {} does not have operation 'get_source_control'".format(api_version))
        mixin_instance = OperationClass()
        mixin_instance._client = self._client
        mixin_instance._config = self._config
        mixin_instance._serialize = Serializer(self._models_dict(api_version))
        mixin_instance._serialize.client_side_validation = False
        mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
        return await mixin_instance.get_source_control(source_control_type, **kwargs)

    async def get_subscription_deployment_locations(
        self,
        **kwargs: Any
    ) -> _models.DeploymentLocations:
        """Gets list of available geo regions plus ministamps.

        Description for Gets list of available geo regions plus ministamps.

        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: DeploymentLocations, or the result of cls(response)
        :rtype: ~azure.mgmt.web.v2022_03_01.models.DeploymentLocations
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        api_version = self._get_api_version('get_subscription_deployment_locations')
        if api_version == '2016-03-01':
            from ..v2016_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2018-02-01':
            from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2019-08-01':
            from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-06-01':
            from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-09-01':
            from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-12-01':
            from ..v2020_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-01-01':
            from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-01-15':
            from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-03-01':
            from ..v2021_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2022-03-01':
            from ..v2022_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        else:
            raise ValueError("API version {} does not have operation 'get_subscription_deployment_locations'".format(api_version))
        mixin_instance = OperationClass()
        mixin_instance._client = self._client
        mixin_instance._config = self._config
        mixin_instance._serialize = Serializer(self._models_dict(api_version))
        mixin_instance._serialize.client_side_validation = False
        mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
        return await mixin_instance.get_subscription_deployment_locations(**kwargs)

    def list_billing_meters(
        self,
        billing_location: Optional[str] = None,
        os_type: Optional[str] = None,
        **kwargs: Any
    ) -> AsyncIterable[_models.BillingMeterCollection]:
        """Gets a list of meters for a given location.

        Description for Gets a list of meters for a given location.

        :param billing_location: Azure Location of billable resource. Default value is None.
        :type billing_location: str
        :param os_type: App Service OS type meters used for. Default value is None.
        :type os_type: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: An iterator like instance of either BillingMeterCollection or the result of
         cls(response)
        :rtype:
         ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2022_03_01.models.BillingMeterCollection]
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        api_version = self._get_api_version('list_billing_meters')
        if api_version == '2018-02-01':
            from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2019-08-01':
            from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-06-01':
            from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-09-01':
            from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-12-01':
            from ..v2020_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-01-01':
            from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-01-15':
            from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-03-01':
            from ..v2021_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2022-03-01':
            from ..v2022_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        else:
            raise ValueError("API version {} does not have operation 'list_billing_meters'".format(api_version))
        mixin_instance = OperationClass()
        mixin_instance._client = self._client
        mixin_instance._config = self._config
        mixin_instance._serialize = Serializer(self._models_dict(api_version))
        mixin_instance._serialize.client_side_validation = False
        mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
        return mixin_instance.list_billing_meters(billing_location, os_type, **kwargs)

    def list_custom_host_name_sites(
        self,
        hostname: Optional[str] = None,
        **kwargs: Any
    ) -> AsyncIterable[_models.CustomHostnameSitesCollection]:
        """Get custom hostnames under this subscription.

        Get custom hostnames under this subscription.

        :param hostname: Specific hostname. Default value is None.
        :type hostname: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: An iterator like instance of either CustomHostnameSitesCollection or the result of
         cls(response)
        :rtype:
         ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2022_03_01.models.CustomHostnameSitesCollection]
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        api_version = self._get_api_version('list_custom_host_name_sites')
        if api_version == '2021-03-01':
            from ..v2021_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2022-03-01':
            from ..v2022_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        else:
            raise ValueError("API version {} does not have operation 'list_custom_host_name_sites'".format(api_version))
        mixin_instance = OperationClass()
        mixin_instance._client = self._client
        mixin_instance._config = self._config
        mixin_instance._serialize = Serializer(self._models_dict(api_version))
        mixin_instance._serialize.client_side_validation = False
        mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
        return mixin_instance.list_custom_host_name_sites(hostname, **kwargs)

    def list_geo_regions(
        self,
        sku: Optional[Union[str, "_models.SkuName"]] = None,
        linux_workers_enabled: Optional[bool] = None,
        xenon_workers_enabled: Optional[bool] = None,
        linux_dynamic_workers_enabled: Optional[bool] = None,
        **kwargs: Any
    ) -> AsyncIterable[_models.GeoRegionCollection]:
        """Get a list of available geographical regions.

        Description for Get a list of available geographical regions.

        :param sku: Name of SKU used to filter the regions. Default value is None.
        :type sku: str or ~azure.mgmt.web.v2022_03_01.models.SkuName
        :param linux_workers_enabled: Specify :code:`<code>true</code>` if you want to filter to only
         regions that support Linux workers. Default value is None.
        :type linux_workers_enabled: bool
        :param xenon_workers_enabled: Specify :code:`<code>true</code>` if you want to filter to only
         regions that support Xenon workers. Default value is None.
        :type xenon_workers_enabled: bool
        :param linux_dynamic_workers_enabled: Specify :code:`<code>true</code>` if you want to filter
         to only regions that support Linux Consumption Workers. Default value is None.
        :type linux_dynamic_workers_enabled: bool
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: An iterator like instance of either GeoRegionCollection or the result of cls(response)
        :rtype:
         ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2022_03_01.models.GeoRegionCollection]
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        api_version = self._get_api_version('list_geo_regions')
        if api_version == '2016-03-01':
            from ..v2016_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2018-02-01':
            from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2019-08-01':
            from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-06-01':
            from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-09-01':
            from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-12-01':
            from ..v2020_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-01-01':
            from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-01-15':
            from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-03-01':
            from ..v2021_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2022-03-01':
            from ..v2022_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        else:
            raise ValueError("API version {} does not have operation 'list_geo_regions'".format(api_version))
        mixin_instance = OperationClass()
        mixin_instance._client = self._client
        mixin_instance._config = self._config
        mixin_instance._serialize = Serializer(self._models_dict(api_version))
        mixin_instance._serialize.client_side_validation = False
        mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
        return mixin_instance.list_geo_regions(sku, linux_workers_enabled, xenon_workers_enabled, linux_dynamic_workers_enabled, **kwargs)

    def list_premier_add_on_offers(
        self,
        **kwargs: Any
    ) -> AsyncIterable[_models.PremierAddOnOfferCollection]:
        """List all premier add-on offers.

        Description for List all premier add-on offers.

        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: An iterator like instance of either PremierAddOnOfferCollection or the result of
         cls(response)
        :rtype:
         ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2022_03_01.models.PremierAddOnOfferCollection]
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        api_version = self._get_api_version('list_premier_add_on_offers')
        if api_version == '2016-03-01':
            from ..v2016_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2018-02-01':
            from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2019-08-01':
            from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-06-01':
            from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-09-01':
            from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-12-01':
            from ..v2020_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-01-01':
            from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-01-15':
            from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-03-01':
            from ..v2021_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2022-03-01':
            from ..v2022_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        else:
            raise ValueError("API version {} does not have operation 'list_premier_add_on_offers'".format(api_version))
        mixin_instance = OperationClass()
        mixin_instance._client = self._client
        mixin_instance._config = self._config
        mixin_instance._serialize = Serializer(self._models_dict(api_version))
        mixin_instance._serialize.client_side_validation = False
        mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
        return mixin_instance.list_premier_add_on_offers(**kwargs)

    def list_site_identifiers_assigned_to_host_name(
        self,
        name_identifier: _models.NameIdentifier,
        **kwargs: Any
    ) -> AsyncIterable[_models.IdentifierCollection]:
        """List all apps that are assigned to a hostname.

        Description for List all apps that are assigned to a hostname.

        :param name_identifier: Hostname information.
        :type name_identifier: ~azure.mgmt.web.v2022_03_01.models.NameIdentifier
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: An iterator like instance of either IdentifierCollection or the result of
         cls(response)
        :rtype:
         ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2022_03_01.models.IdentifierCollection]
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        api_version = self._get_api_version('list_site_identifiers_assigned_to_host_name')
        if api_version == '2016-03-01':
            from ..v2016_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2018-02-01':
            from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2019-08-01':
            from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-06-01':
            from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-09-01':
            from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-12-01':
            from ..v2020_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-01-01':
            from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-01-15':
            from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-03-01':
            from ..v2021_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2022-03-01':
            from ..v2022_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        else:
            raise ValueError("API version {} does not have operation 'list_site_identifiers_assigned_to_host_name'".format(api_version))
        mixin_instance = OperationClass()
        mixin_instance._client = self._client
        mixin_instance._config = self._config
        mixin_instance._serialize = Serializer(self._models_dict(api_version))
        mixin_instance._serialize.client_side_validation = False
        mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
        return mixin_instance.list_site_identifiers_assigned_to_host_name(name_identifier, **kwargs)

    async def list_skus(
        self,
        **kwargs: Any
    ) -> _models.SkuInfos:
        """List all SKUs.

        Description for List all SKUs.

        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: SkuInfos, or the result of cls(response)
        :rtype: ~azure.mgmt.web.v2022_03_01.models.SkuInfos
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        api_version = self._get_api_version('list_skus')
        if api_version == '2016-03-01':
            from ..v2016_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2018-02-01':
            from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2019-08-01':
            from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-06-01':
            from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-09-01':
            from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-12-01':
            from ..v2020_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-01-01':
            from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-01-15':
            from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-03-01':
            from ..v2021_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2022-03-01':
            from ..v2022_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        else:
            raise ValueError("API version {} does not have operation 'list_skus'".format(api_version))
        mixin_instance = OperationClass()
        mixin_instance._client = self._client
        mixin_instance._config = self._config
        mixin_instance._serialize = Serializer(self._models_dict(api_version))
        mixin_instance._serialize.client_side_validation = False
        mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
        return await mixin_instance.list_skus(**kwargs)

    def list_source_controls(
        self,
        **kwargs: Any
    ) -> AsyncIterable[_models.SourceControlCollection]:
        """Gets the source controls available for Azure websites.

        Description for Gets the source controls available for Azure websites.

        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: An iterator like instance of either SourceControlCollection or the result of
         cls(response)
        :rtype:
         ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.web.v2022_03_01.models.SourceControlCollection]
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        api_version = self._get_api_version('list_source_controls')
        if api_version == '2016-03-01':
            from ..v2016_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2018-02-01':
            from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2019-08-01':
            from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-06-01':
            from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-09-01':
            from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-12-01':
            from ..v2020_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-01-01':
            from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-01-15':
            from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-03-01':
            from ..v2021_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2022-03-01':
            from ..v2022_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        else:
            raise ValueError("API version {} does not have operation 'list_source_controls'".format(api_version))
        mixin_instance = OperationClass()
        mixin_instance._client = self._client
        mixin_instance._config = self._config
        mixin_instance._serialize = Serializer(self._models_dict(api_version))
        mixin_instance._serialize.client_side_validation = False
        mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
        return mixin_instance.list_source_controls(**kwargs)

    async def move(  # pylint: disable=inconsistent-return-statements
        self,
        resource_group_name: str,
        move_resource_envelope: _models.CsmMoveResourceEnvelope,
        **kwargs: Any
    ) -> None:
        """Move resources between resource groups.

        Description for Move resources between resource groups.

        :param resource_group_name: Name of the resource group to which the resource belongs.
        :type resource_group_name: str
        :param move_resource_envelope: Object that represents the resource to move.
        :type move_resource_envelope: ~azure.mgmt.web.v2022_03_01.models.CsmMoveResourceEnvelope
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: None, or the result of cls(response)
        :rtype: None
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        api_version = self._get_api_version('move')
        if api_version == '2016-03-01':
            from ..v2016_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2018-02-01':
            from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2019-08-01':
            from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-06-01':
            from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-09-01':
            from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-12-01':
            from ..v2020_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-01-01':
            from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-01-15':
            from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-03-01':
            from ..v2021_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2022-03-01':
            from ..v2022_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        else:
            raise ValueError("API version {} does not have operation 'move'".format(api_version))
        mixin_instance = OperationClass()
        mixin_instance._client = self._client
        mixin_instance._config = self._config
        mixin_instance._serialize = Serializer(self._models_dict(api_version))
        mixin_instance._serialize.client_side_validation = False
        mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
        return await mixin_instance.move(resource_group_name, move_resource_envelope, **kwargs)

    async def update_publishing_user(
        self,
        user_details: _models.User,
        **kwargs: Any
    ) -> _models.User:
        """Updates publishing user.

        Description for Updates publishing user.

        :param user_details: Details of publishing user.
        :type user_details: ~azure.mgmt.web.v2022_03_01.models.User
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: User, or the result of cls(response)
        :rtype: ~azure.mgmt.web.v2022_03_01.models.User
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        api_version = self._get_api_version('update_publishing_user')
        if api_version == '2016-03-01':
            from ..v2016_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2018-02-01':
            from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2019-08-01':
            from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-06-01':
            from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-09-01':
            from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-12-01':
            from ..v2020_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-01-01':
            from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-01-15':
            from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-03-01':
            from ..v2021_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2022-03-01':
            from ..v2022_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        else:
            raise ValueError("API version {} does not have operation 'update_publishing_user'".format(api_version))
        mixin_instance = OperationClass()
        mixin_instance._client = self._client
        mixin_instance._config = self._config
        mixin_instance._serialize = Serializer(self._models_dict(api_version))
        mixin_instance._serialize.client_side_validation = False
        mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
        return await mixin_instance.update_publishing_user(user_details, **kwargs)

    async def update_source_control(
        self,
        source_control_type: str,
        request_message: _models.SourceControl,
        **kwargs: Any
    ) -> _models.SourceControl:
        """Updates source control token.

        Description for Updates source control token.

        :param source_control_type: Type of source control.
        :type source_control_type: str
        :param request_message: Source control token information.
        :type request_message: ~azure.mgmt.web.v2022_03_01.models.SourceControl
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: SourceControl, or the result of cls(response)
        :rtype: ~azure.mgmt.web.v2022_03_01.models.SourceControl
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        api_version = self._get_api_version('update_source_control')
        if api_version == '2016-03-01':
            from ..v2016_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2018-02-01':
            from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2019-08-01':
            from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-06-01':
            from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-09-01':
            from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-12-01':
            from ..v2020_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-01-01':
            from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-01-15':
            from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-03-01':
            from ..v2021_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2022-03-01':
            from ..v2022_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        else:
            raise ValueError("API version {} does not have operation 'update_source_control'".format(api_version))
        mixin_instance = OperationClass()
        mixin_instance._client = self._client
        mixin_instance._config = self._config
        mixin_instance._serialize = Serializer(self._models_dict(api_version))
        mixin_instance._serialize.client_side_validation = False
        mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
        return await mixin_instance.update_source_control(source_control_type, request_message, **kwargs)

    async def validate(
        self,
        resource_group_name: str,
        validate_request: _models.ValidateRequest,
        **kwargs: Any
    ) -> _models.ValidateResponse:
        """Validate if a resource can be created.

        Description for Validate if a resource can be created.

        :param resource_group_name: Name of the resource group to which the resource belongs.
        :type resource_group_name: str
        :param validate_request: Request with the resources to validate.
        :type validate_request: ~azure.mgmt.web.v2022_03_01.models.ValidateRequest
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: ValidateResponse, or the result of cls(response)
        :rtype: ~azure.mgmt.web.v2022_03_01.models.ValidateResponse
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        api_version = self._get_api_version('validate')
        if api_version == '2016-03-01':
            from ..v2016_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2018-02-01':
            from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2019-08-01':
            from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-06-01':
            from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-09-01':
            from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-12-01':
            from ..v2020_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-01-01':
            from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-01-15':
            from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-03-01':
            from ..v2021_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2022-03-01':
            from ..v2022_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        else:
            raise ValueError("API version {} does not have operation 'validate'".format(api_version))
        mixin_instance = OperationClass()
        mixin_instance._client = self._client
        mixin_instance._config = self._config
        mixin_instance._serialize = Serializer(self._models_dict(api_version))
        mixin_instance._serialize.client_side_validation = False
        mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
        return await mixin_instance.validate(resource_group_name, validate_request, **kwargs)

    async def validate_container_settings(
        self,
        resource_group_name: str,
        validate_container_settings_request: _models.ValidateContainerSettingsRequest,
        **kwargs: Any
    ) -> Any:
        """Validate if the container settings are correct.

        Validate if the container settings are correct.

        :param resource_group_name: Name of the resource group to which the resource belongs.
        :type resource_group_name: str
        :param validate_container_settings_request:
        :type validate_container_settings_request:
         ~azure.mgmt.web.v2018_02_01.models.ValidateContainerSettingsRequest
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: any, or the result of cls(response)
        :rtype: any
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        api_version = self._get_api_version('validate_container_settings')
        if api_version == '2018-02-01':
            from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        else:
            raise ValueError("API version {} does not have operation 'validate_container_settings'".format(api_version))
        mixin_instance = OperationClass()
        mixin_instance._client = self._client
        mixin_instance._config = self._config
        mixin_instance._serialize = Serializer(self._models_dict(api_version))
        mixin_instance._serialize.client_side_validation = False
        mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
        return await mixin_instance.validate_container_settings(resource_group_name, validate_container_settings_request, **kwargs)

    async def validate_move(  # pylint: disable=inconsistent-return-statements
        self,
        resource_group_name: str,
        move_resource_envelope: _models.CsmMoveResourceEnvelope,
        **kwargs: Any
    ) -> None:
        """Validate whether a resource can be moved.

        Description for Validate whether a resource can be moved.

        :param resource_group_name: Name of the resource group to which the resource belongs.
        :type resource_group_name: str
        :param move_resource_envelope: Object that represents the resource to move.
        :type move_resource_envelope: ~azure.mgmt.web.v2022_03_01.models.CsmMoveResourceEnvelope
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: None, or the result of cls(response)
        :rtype: None
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        api_version = self._get_api_version('validate_move')
        if api_version == '2016-03-01':
            from ..v2016_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2018-02-01':
            from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2019-08-01':
            from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-06-01':
            from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-09-01':
            from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-12-01':
            from ..v2020_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-01-01':
            from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-01-15':
            from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-03-01':
            from ..v2021_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2022-03-01':
            from ..v2022_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        else:
            raise ValueError("API version {} does not have operation 'validate_move'".format(api_version))
        mixin_instance = OperationClass()
        mixin_instance._client = self._client
        mixin_instance._config = self._config
        mixin_instance._serialize = Serializer(self._models_dict(api_version))
        mixin_instance._serialize.client_side_validation = False
        mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
        return await mixin_instance.validate_move(resource_group_name, move_resource_envelope, **kwargs)

    async def verify_hosting_environment_vnet(
        self,
        parameters: _models.VnetParameters,
        **kwargs: Any
    ) -> _models.VnetValidationFailureDetails:
        """Verifies if this VNET is compatible with an App Service Environment by analyzing the Network
        Security Group rules.

        Description for Verifies if this VNET is compatible with an App Service Environment by
        analyzing the Network Security Group rules.

        :param parameters: VNET information.
        :type parameters: ~azure.mgmt.web.v2022_03_01.models.VnetParameters
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: VnetValidationFailureDetails, or the result of cls(response)
        :rtype: ~azure.mgmt.web.v2022_03_01.models.VnetValidationFailureDetails
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        api_version = self._get_api_version('verify_hosting_environment_vnet')
        if api_version == '2016-03-01':
            from ..v2016_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2018-02-01':
            from ..v2018_02_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2019-08-01':
            from ..v2019_08_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-06-01':
            from ..v2020_06_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-09-01':
            from ..v2020_09_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2020-12-01':
            from ..v2020_12_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-01-01':
            from ..v2021_01_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-01-15':
            from ..v2021_01_15.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2021-03-01':
            from ..v2021_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        elif api_version == '2022-03-01':
            from ..v2022_03_01.aio.operations import WebSiteManagementClientOperationsMixin as OperationClass
        else:
            raise ValueError("API version {} does not have operation 'verify_hosting_environment_vnet'".format(api_version))
        mixin_instance = OperationClass()
        mixin_instance._client = self._client
        mixin_instance._config = self._config
        mixin_instance._serialize = Serializer(self._models_dict(api_version))
        mixin_instance._serialize.client_side_validation = False
        mixin_instance._deserialize = Deserializer(self._models_dict(api_version))
        return await mixin_instance.verify_hosting_environment_vnet(parameters, **kwargs)


text:
/*
 * Created on Apr 22, 2005
 */
package net.sf.launch4j.config;

/**
 * @author Copyright (C) 2005 Grzegorz Kowal
 */
public class ConfigPersisterException extends Exception {

	public ConfigPersisterException(String msg, Throwable t) {
		super(msg, t);
	}

	public ConfigPersisterException(Throwable t) {
		super(t);
	}
}


text:
/*
  RobotParams.h - A very simple class that is used to pass around robot specific parameters

  Dr. Rainer Hessmer, Decmber, 2010.
  Released into the public domain.
*/

#ifndef RobotParams_h
#define RobotParams_h

#include "WProgram.h"

#define PI 3.14159265

class RobotParams
{
	public:
		bool IsInitialized;
		double WheelDiameter;
		double TrackWidth;
		double CountsPerRevolution;
		double DistancePerCount;
		double RadiansPerCount;

		RobotParams()
		{
			IsInitialized = false;
		}

		// initializes robot params wheel diameter [m], trackwidth [m], ticks per revolution
		void Initialize(double wheelDiameter, double trackWidth, int countsPerRevolution)
		{
			WheelDiameter = wheelDiameter;
			TrackWidth = trackWidth;
			CountsPerRevolution = countsPerRevolution;

			DistancePerCount = (PI * wheelDiameter) / (double)countsPerRevolution;
			RadiansPerCount = DistancePerCount / trackWidth;

			IsInitialized = true;
		}
};

#endif


text:
from quiz.models import Question, Lesson, Answer, Unity, Media, Result

from django.contrib import admin

class UnityAdmin(admin.ModelAdmin):
    list_display = ('id', 'number', 'name', 'description', )
    list_filter = ('number', 'name', 'description', )
    search_fields = ('id', 'number', 'name', 'description', )

admin.site.register(Unity, UnityAdmin)

class AnswerAdmin(admin.ModelAdmin):
    list_display = ('id', 'name', 'extra')
    list_filter = ('name', 'extra',)

admin.site.register(Answer, AnswerAdmin)

class LessonAdmin(admin.ModelAdmin):
    list_display = ('id', 'name',)
    list_filter = ('name', )

admin.site.register(Lesson, LessonAdmin)

class MediaAdmin(admin.ModelAdmin):
    list_display = ('id', 'name', 'url', )
    list_filter = ('name', )

admin.site.register(Media, MediaAdmin)

class QuestionAdmin(admin.ModelAdmin):

    list_display = ('id', 'name', 'answer_correct', 'lesson', 'audio', 'image')
    list_filter = ('name', 'lesson')
    ordering = ['id']
    search_fields = ('id', 'name', 'answer_correct', 'lesson', )
    filter_horizontal = ('answers', )

    def lookup_allowed(self, lookup, value):
        return True

admin.site.register(Question, QuestionAdmin)

class ResultAdmin(admin.ModelAdmin):
    list_display = ('id', 'user', 'lesson', 'correct', 'question',)
    list_filter = ('user', 'lesson', 'correct', 'question',)

admin.site.register(Result, ResultAdmin)


text:
// Copyright 2007, 2010, 2012 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package org.apache.tapestry5.services;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * Marker annotation for services that are provided by the Tapestry core module. Also, used as
 * the marker annotation for the core {@link org.apache.tapestry5.services.javascript.JavaScriptStack}.
 */
@Target(
{ ElementType.PARAMETER, ElementType.FIELD, ElementType.METHOD })
@Retention(RUNTIME)
@Documented
public @interface Core
{

}


text:
export = [
    require('./barebones'),
    require('./express'),
    require('./hapi'),
    require('./koa'),
    require('./restify'),
];


text:
#include <aws/migrationhubstrategy/model/ListApplicationComponentsRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>

#include <utility>

using namespace Aws::MigrationHubStrategyRecommendations::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;

ListApplicationComponentsRequest::ListApplicationComponentsRequest() :
    m_applicationComponentCriteria(ApplicationComponentCriteria::NOT_SET),
    m_applicationComponentCriteriaHasBeenSet(false),
    m_filterValueHasBeenSet(false),
    m_groupIdFilterHasBeenSet(false),
    m_maxResults(0),
    m_maxResultsHasBeenSet(false),
    m_nextTokenHasBeenSet(false),
    m_sort(SortOrder::NOT_SET),
    m_sortHasBeenSet(false)
{
}

Aws::String ListApplicationComponentsRequest::SerializePayload() const
{
  JsonValue payload;

  if(m_applicationComponentCriteriaHasBeenSet)
  {
   payload.WithString("applicationComponentCriteria", ApplicationComponentCriteriaMapper::GetNameForApplicationComponentCriteria(m_applicationComponentCriteria));
  }

  if(m_filterValueHasBeenSet)
  {
   payload.WithString("filterValue", m_filterValue);

  }

  if(m_groupIdFilterHasBeenSet)
  {
   Aws::Utils::Array<JsonValue> groupIdFilterJsonList(m_groupIdFilter.size());
   for(unsigned groupIdFilterIndex = 0; groupIdFilterIndex < groupIdFilterJsonList.GetLength(); ++groupIdFilterIndex)
   {
     groupIdFilterJsonList[groupIdFilterIndex].AsObject(m_groupIdFilter[groupIdFilterIndex].Jsonize());
   }
   payload.WithArray("groupIdFilter", std::move(groupIdFilterJsonList));

  }

  if(m_maxResultsHasBeenSet)
  {
   payload.WithInteger("maxResults", m_maxResults);

  }

  if(m_nextTokenHasBeenSet)
  {
   payload.WithString("nextToken", m_nextToken);

  }

  if(m_sortHasBeenSet)
  {
   payload.WithString("sort", SortOrderMapper::GetNameForSortOrder(m_sort));
  }

  return payload.View().WriteReadable();
}


text:
class XmlFileWriter : public XmlWriter {
public:

  class XFW_SerializeOracle {
  public:
    virtual ~XFW_SerializeOracle() {}
    virtual bool shouldSerialize(SourceLocManager::File const *) {return true;}
    virtual bool shouldSerialize(HashLineMap const *) {return true;}
    virtual bool shouldSerialize(HashLineMap::HashLine const *) {return true;}
  };

  XFW_SerializeOracle *serializeOracle_m;

  XmlFileWriter(IdentityManager &idmgr0, ostream *out0, int &depth0, bool indent0,
                XFW_SerializeOracle *serializeOracle0);
  virtual ~XmlFileWriter() {}

  void toXml(SourceLocManager::FileList &files);
  void toXml(SourceLocManager::File *file);
  // this is an exception to the generic toXml() mechanism since
  // lineLengths are not self-contained
  void toXml_lineLengths(SourceLocManager::File *file);
  void toXml(HashLineMap *hashLines);
  void toXml(HashLineMap::HashLine *hashLine);
};

#endif // XML_FILE_WRITER_H


text:
require 'filispin/rails/filispin-rails'

module Filispin
  autoload :Config, File.dirname(__FILE__) + '/filispin/config'
  autoload :Block, File.dirname(__FILE__) + '/filispin/block'
  autoload :OnceBlock, File.dirname(__FILE__) + '/filispin/once_block'
  autoload :Results, File.dirname(__FILE__) + '/filispin/results'
  autoload :Runner, File.dirname(__FILE__) + '/filispin/runner'
  autoload :Scenario, File.dirname(__FILE__) + '/filispin/scenario'
  autoload :Request, File.dirname(__FILE__) + '/filispin/operations/request'
  autoload :ThinkFor, File.dirname(__FILE__) + '/filispin/operations/think_for'
  autoload :Format, File.dirname(__FILE__) + '/filispin/util/format'
  autoload :Parameters, File.dirname(__FILE__) + '/filispin/util/parameters'
  autoload :Progress, File.dirname(__FILE__) + '/filispin/util/progress'
  autoload :Stats, File.dirname(__FILE__) + '/filispin/util/stats'
  autoload :Timer, File.dirname(__FILE__) + '/filispin/util/timer'
  autoload :BlockBuilder, File.dirname(__FILE__) + '/filispin/dsl/block_builder'
  autoload :OnceBlockBuilder, File.dirname(__FILE__) + '/filispin/dsl/once_block_builder'
  autoload :GlobalConfig, File.dirname(__FILE__) + '/filispin/dsl/global_config'
  autoload :ScenarioBuilder, File.dirname(__FILE__) + '/filispin/dsl/scenario_builder'

  def self.run_load_test(files)
    config = Config.load files
    Runner.new(config).run_load_test
  end

  def self.run_stress_test(files)
    config = Config.load files
    Runner.new(config).run_stress_test
  end
end


text:
#ifndef _SERVICE_OBJ_H_
#define _SERVICE_OBJ_H_

class IServiceObj
{
public:
    IServiceObj() { };
    void Destroy() { delete this; };
protected:
    virtual ~IServiceObj() = 0;
};

#endif /* _SERVICE_OBJ_H_ */


text:
package org.dainst.chronontology.handler;

import org.dainst.chronontology.Constants;
import org.dainst.chronontology.handler.dispatch.ConnectDispatcher;
import org.dainst.chronontology.handler.dispatch.Dispatcher;
import org.dainst.chronontology.handler.model.RightsValidator;
import org.testng.annotations.Test;

import java.io.IOException;

/**
 * @author Daniel M. de Oliveira
 */
public class ConnectDispatcherStatusCodesTest extends StatusCodesTest {

    private final Dispatcher dispatcher = new ConnectDispatcher(mockDS1,mockDS2);
    private final PutDocumentHandler putDocumentHandler = new PutDocumentHandler(dispatcher,new RightsValidator());
    private final PostDocumentHandler postDocumentHandler = new PostDocumentHandler(dispatcher,new RightsValidator());

    @Test
    public void ds1ReturnFalseOnPost() throws IOException {
        t(false,true,postDocumentHandler,Constants.HTTP_INTERNAL_SERVER_ERROR);
    }

    @Test
    public void ds2ReturnFalseOnPost() throws IOException {
        t(true,false,postDocumentHandler,Constants.HTTP_INTERNAL_SERVER_ERROR);
    }

    @Test
    public void okOnPost() throws IOException {
        t(true,true,postDocumentHandler,Constants.HTTP_CREATED);
    }

    @Test
    public void ds1ReturnFalseOnPut() throws IOException {
        t(false,true,putDocumentHandler,Constants.HTTP_INTERNAL_SERVER_ERROR);
    }

    @Test
    public void ds2ReturnFalseOnPut() throws IOException {
        t(true,false,putDocumentHandler,Constants.HTTP_INTERNAL_SERVER_ERROR);
    }

    @Test
    public void okOnPut() throws IOException {
        t(true,true,putDocumentHandler,Constants.HTTP_CREATED);
    }
}


text:
package com.amazonaws.services.storagegateway.model;

import java.io.Serializable;
import com.amazonaws.AmazonWebServiceRequest;

/**
 *

 * DescribeVTLDevicesInput
 *

 */
public class DescribeVTLDevicesRequest extends AmazonWebServiceRequest
        implements Serializable, Cloneable {

    private String gatewayARN;
    /**
     *

     * An array of strings, where each string represents the Amazon Resource
     * Name (ARN) of a VTL device.
     *

     * <note>All of the specified VTL devices must be from the same gateway. If
     * no VTL devices are specified, the result will contain all devices on the
     * specified gateway.</note>
     */
    private com.amazonaws.internal.SdkInternalList<String> vTLDeviceARNs;
    /**
     *

     * An opaque string that indicates the position at which to begin describing
     * the VTL devices.
     *

     */
    private String marker;
    /**
     *

     * Specifies that the number of VTL devices described be limited to the
     * specified number.
     *

     */
    private Integer limit;

    /**
     * @param gatewayARN
     */
    public void setGatewayARN(String gatewayARN) {
        this.gatewayARN = gatewayARN;
    }

    /**
     * @return
     */
    public String getGatewayARN() {
        return this.gatewayARN;
    }

    /**
     * @param gatewayARN
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public DescribeVTLDevicesRequest withGatewayARN(String gatewayARN) {
        setGatewayARN(gatewayARN);
        return this;
    }

    /**
     *

     * An array of strings, where each string represents the Amazon Resource
     * Name (ARN) of a VTL device.
     *

     * <note>All of the specified VTL devices must be from the same gateway. If
     * no VTL devices are specified, the result will contain all devices on the
     * specified gateway.</note>
     *
     * @return An array of strings, where each string represents the Amazon
     *         Resource Name (ARN) of a VTL device.
 <note>All of the
     *         specified VTL devices must be from the same gateway. If no VTL
     *         devices are specified, the result will contain all devices on the
     *         specified gateway.
     */
    public java.util.List<String> getVTLDeviceARNs() {
        if (vTLDeviceARNs == null) {
            vTLDeviceARNs = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return vTLDeviceARNs;
    }

    /**
     *

     * An array of strings, where each string represents the Amazon Resource
     * Name (ARN) of a VTL device.
     *

     * <note>All of the specified VTL devices must be from the same gateway. If
     * no VTL devices are specified, the result will contain all devices on the
     * specified gateway.</note>
     *
     * @param vTLDeviceARNs
     *        An array of strings, where each string represents the Amazon
     *        Resource Name (ARN) of a VTL device.
 <note>All of the
     *        specified VTL devices must be from the same gateway. If no VTL
     *        devices are specified, the result will contain all devices on the
     *        specified gateway.
     */
    public void setVTLDeviceARNs(java.util.Collection<String> vTLDeviceARNs) {
        if (vTLDeviceARNs == null) {
            this.vTLDeviceARNs = null;
            return;
        }

        this.vTLDeviceARNs = new com.amazonaws.internal.SdkInternalList<String>(
                vTLDeviceARNs);
    }

    /**
     *

     * An array of strings, where each string represents the Amazon Resource
     * Name (ARN) of a VTL device.
     *

     * <note>All of the specified VTL devices must be from the same gateway. If
     * no VTL devices are specified, the result will contain all devices on the
     * specified gateway.</note>
     *

     * NOTE: This method appends the values to the existing list (if
     * any). Use {@link #setVTLDeviceARNs(java.util.Collection)} or
     * {@link #withVTLDeviceARNs(java.util.Collection)} if you want to override
     * the existing values.
     *

     *
     * @param vTLDeviceARNs
     *        An array of strings, where each string represents the Amazon
     *        Resource Name (ARN) of a VTL device.
 <note>All of the
     *        specified VTL devices must be from the same gateway. If no VTL
     *        devices are specified, the result will contain all devices on the
     *        specified gateway.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public DescribeVTLDevicesRequest withVTLDeviceARNs(String... vTLDeviceARNs) {
        if (this.vTLDeviceARNs == null) {
            setVTLDeviceARNs(new com.amazonaws.internal.SdkInternalList<String>(
                    vTLDeviceARNs.length));
        }
        for (String ele : vTLDeviceARNs) {
            this.vTLDeviceARNs.add(ele);
        }
        return this;
    }

    /**
     *

     * An array of strings, where each string represents the Amazon Resource
     * Name (ARN) of a VTL device.
     *

     * <note>All of the specified VTL devices must be from the same gateway. If
     * no VTL devices are specified, the result will contain all devices on the
     * specified gateway.</note>
     *
     * @param vTLDeviceARNs
     *        An array of strings, where each string represents the Amazon
     *        Resource Name (ARN) of a VTL device.
 <note>All of the
     *        specified VTL devices must be from the same gateway. If no VTL
     *        devices are specified, the result will contain all devices on the
     *        specified gateway.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public DescribeVTLDevicesRequest withVTLDeviceARNs(
            java.util.Collection<String> vTLDeviceARNs) {
        setVTLDeviceARNs(vTLDeviceARNs);
        return this;
    }

    /**
     *

     * An opaque string that indicates the position at which to begin describing
     * the VTL devices.
     *

     *
     * @param marker
     *        An opaque string that indicates the position at which to begin
     *        describing the VTL devices.
     */
    public void setMarker(String marker) {
        this.marker = marker;
    }

    /**
     *

     * An opaque string that indicates the position at which to begin describing
     * the VTL devices.
     *

     *
     * @return An opaque string that indicates the position at which to begin
     *         describing the VTL devices.
     */
    public String getMarker() {
        return this.marker;
    }

    /**
     *

     * An opaque string that indicates the position at which to begin describing
     * the VTL devices.
     *

     *
     * @param marker
     *        An opaque string that indicates the position at which to begin
     *        describing the VTL devices.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public DescribeVTLDevicesRequest withMarker(String marker) {
        setMarker(marker);
        return this;
    }

    /**
     *

     * Specifies that the number of VTL devices described be limited to the
     * specified number.
     *

     *
     * @param limit
     *        Specifies that the number of VTL devices described be limited to
     *        the specified number.
     */
    public void setLimit(Integer limit) {
        this.limit = limit;
    }

    /**
     *

     * Specifies that the number of VTL devices described be limited to the
     * specified number.
     *

     *
     * @return Specifies that the number of VTL devices described be limited to
     *         the specified number.
     */
    public Integer getLimit() {
        return this.limit;
    }

    /**
     *

     * Specifies that the number of VTL devices described be limited to the
     * specified number.
     *

     *
     * @param limit
     *        Specifies that the number of VTL devices described be limited to
     *        the specified number.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public DescribeVTLDevicesRequest withLimit(Integer limit) {
        setLimit(limit);
        return this;
    }

    /**
     * Returns a string representation of this object; useful for testing and
     * debugging.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getGatewayARN() != null)
            sb.append("GatewayARN: " + getGatewayARN() + ",");
        if (getVTLDeviceARNs() != null)
            sb.append("VTLDeviceARNs: " + getVTLDeviceARNs() + ",");
        if (getMarker() != null)
            sb.append("Marker: " + getMarker() + ",");
        if (getLimit() != null)
            sb.append("Limit: " + getLimit());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof DescribeVTLDevicesRequest == false)
            return false;
        DescribeVTLDevicesRequest other = (DescribeVTLDevicesRequest) obj;
        if (other.getGatewayARN() == null ^ this.getGatewayARN() == null)
            return false;
        if (other.getGatewayARN() != null
                && other.getGatewayARN().equals(this.getGatewayARN()) == false)
            return false;
        if (other.getVTLDeviceARNs() == null ^ this.getVTLDeviceARNs() == null)
            return false;
        if (other.getVTLDeviceARNs() != null
                && other.getVTLDeviceARNs().equals(this.getVTLDeviceARNs()) == false)
            return false;
        if (other.getMarker() == null ^ this.getMarker() == null)
            return false;
        if (other.getMarker() != null
                && other.getMarker().equals(this.getMarker()) == false)
            return false;
        if (other.getLimit() == null ^ this.getLimit() == null)
            return false;
        if (other.getLimit() != null
                && other.getLimit().equals(this.getLimit()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode
                + ((getGatewayARN() == null) ? 0 : getGatewayARN().hashCode());
        hashCode = prime
                * hashCode
                + ((getVTLDeviceARNs() == null) ? 0 : getVTLDeviceARNs()
                        .hashCode());
        hashCode = prime * hashCode
                + ((getMarker() == null) ? 0 : getMarker().hashCode());
        hashCode = prime * hashCode
                + ((getLimit() == null) ? 0 : getLimit().hashCode());
        return hashCode;
    }

    @Override
    public DescribeVTLDevicesRequest clone() {
        return (DescribeVTLDevicesRequest) super.clone();
    }
}


text:
package location

import (
	"time"

	"github.com/gotk/pg"
	"github.com/guregu/null"
)

type Model struct {
	Id         null.Int  `db:"id,autofilled,pk"          json:"id"`
	State      int       `db:"state"                     json:"state"`
	CreatedAt  time.Time `db:"created_at,autofilled"     json:"createdAt"`
	UpdatedAt  time.Time `db:"updated_at,autofilled"     json:"updatedAt"`
	Name       string    `db:"name"                      json:"name"`
	StaticURL  string    `db:"static_url"                json:"staticURL"`
	StaticPath string    `db:"static_path"               json:"staticPath"`
	JsonData   pg.JSONB  `db:"json_data"                 json:"jsonData,omitempty"`
}

func (_ *Model) Table() string { return "storage.location" }


text:
<?php

namespace SpBar\Bundle\BlogBundle\Twig;

class BlogExtension extends \Twig_Extension
{

    public function getFunctions()
    {
        return array(
            new \Twig_SimpleFunction('excerpt', array($this, 'truncateContent')),
            new \Twig_SimpleFunction('minifyTitle', array($this, 'getMinifiedTitle')),
            // new \Twig_SimpleFunction('featuredImage', array($this, 'showFeaturedImage')),
        );
    }

    public function truncateContent($text, $length=500) {
        $filtered = preg_replace('/(<img[^>]+>)/i', '[IMAGE]', $text);
        $output = substr($filtered, 0, $length);

        return $output;
    }

    public function getMinifiedTitle($title, $length=null, $minify = true)
    {
        if($minify==false)
        {
            return $title;
        }
        if(strlen($title) >= $length)
        {
            return substr($title, 0, $length)."...";
        }else{
            return $title;
        }
    }

    // public function showFeaturedImage($path)
    // {
    //     if(!$path || $path==null)
    //     {
    //         return 'blog/images/featured/default.jpg';
    //     }else{
    //         return 'uploads/elfinder/featured/'.
    //     }
    // }

    public function getName()
    {
        return 'spbar.blog_extension';
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Anal. Mus. nac. B. Aires, Ser. 3 19(12): 295 (1909)

#### Original name
Ravenelia cebil Speg.

### Remarks
null


text:
public class Test{
  public static void foo() {}
  int a = 0;
  int b = <ref>foo;
}


text:
#pragma once
#include <aws/directconnect/DirectConnect_EXPORTS.h>
#include <aws/directconnect/DirectConnectRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>

namespace Aws
{
namespace DirectConnect
{
namespace Model
{

  /**
   */
  class AWS_DIRECTCONNECT_API ConfirmTransitVirtualInterfaceRequest : public DirectConnectRequest
  {
  public:
    ConfirmTransitVirtualInterfaceRequest();

    // Service request name is the Operation name which will send this request out,
    // each operation should has unique request name, so that we can get operation's name from this request.
    // Note: this is not true for response, multiple operations may have the same response name,
    // so we can not get operation's name from response.
    inline virtual const char* GetServiceRequestName() const override { return "ConfirmTransitVirtualInterface"; }

    Aws::String SerializePayload() const override;

    Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;

    /**
     *
The ID of the virtual interface.

     */
    inline const Aws::String& GetVirtualInterfaceId() const{ return m_virtualInterfaceId; }

    /**
     *
The ID of the virtual interface.

     */
    inline bool VirtualInterfaceIdHasBeenSet() const { return m_virtualInterfaceIdHasBeenSet; }

    /**
     *
The ID of the virtual interface.

     */
    inline void SetVirtualInterfaceId(const Aws::String& value) { m_virtualInterfaceIdHasBeenSet = true; m_virtualInterfaceId = value; }

    /**
     *
The ID of the virtual interface.

     */
    inline void SetVirtualInterfaceId(Aws::String&& value) { m_virtualInterfaceIdHasBeenSet = true; m_virtualInterfaceId = std::move(value); }

    /**
     *
The ID of the virtual interface.

     */
    inline void SetVirtualInterfaceId(const char* value) { m_virtualInterfaceIdHasBeenSet = true; m_virtualInterfaceId.assign(value); }

    /**
     *
The ID of the virtual interface.

     */
    inline ConfirmTransitVirtualInterfaceRequest& WithVirtualInterfaceId(const Aws::String& value) { SetVirtualInterfaceId(value); return *this;}

    /**
     *
The ID of the virtual interface.

     */
    inline ConfirmTransitVirtualInterfaceRequest& WithVirtualInterfaceId(Aws::String&& value) { SetVirtualInterfaceId(std::move(value)); return *this;}

    /**
     *
The ID of the virtual interface.

     */
    inline ConfirmTransitVirtualInterfaceRequest& WithVirtualInterfaceId(const char* value) { SetVirtualInterfaceId(value); return *this;}

    /**
     *
The ID of the Direct Connect gateway.

     */
    inline const Aws::String& GetDirectConnectGatewayId() const{ return m_directConnectGatewayId; }

    /**
     *
The ID of the Direct Connect gateway.

     */
    inline bool DirectConnectGatewayIdHasBeenSet() const { return m_directConnectGatewayIdHasBeenSet; }

    /**
     *
The ID of the Direct Connect gateway.

     */
    inline void SetDirectConnectGatewayId(const Aws::String& value) { m_directConnectGatewayIdHasBeenSet = true; m_directConnectGatewayId = value; }

    /**
     *
The ID of the Direct Connect gateway.

     */
    inline void SetDirectConnectGatewayId(Aws::String&& value) { m_directConnectGatewayIdHasBeenSet = true; m_directConnectGatewayId = std::move(value); }

    /**
     *
The ID of the Direct Connect gateway.

     */
    inline void SetDirectConnectGatewayId(const char* value) { m_directConnectGatewayIdHasBeenSet = true; m_directConnectGatewayId.assign(value); }

    /**
     *
The ID of the Direct Connect gateway.

     */
    inline ConfirmTransitVirtualInterfaceRequest& WithDirectConnectGatewayId(const Aws::String& value) { SetDirectConnectGatewayId(value); return *this;}

    /**
     *
The ID of the Direct Connect gateway.

     */
    inline ConfirmTransitVirtualInterfaceRequest& WithDirectConnectGatewayId(Aws::String&& value) { SetDirectConnectGatewayId(std::move(value)); return *this;}

    /**
     *
The ID of the Direct Connect gateway.

     */
    inline ConfirmTransitVirtualInterfaceRequest& WithDirectConnectGatewayId(const char* value) { SetDirectConnectGatewayId(value); return *this;}

  private:

    Aws::String m_virtualInterfaceId;
    bool m_virtualInterfaceIdHasBeenSet;

    Aws::String m_directConnectGatewayId;
    bool m_directConnectGatewayIdHasBeenSet;
  };

} // namespace Model
} // namespace DirectConnect
} // namespace Aws


text:
package org.sagebionetworks.repo.web.service;

import static org.junit.Assert.assertEquals;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import org.junit.Before;
import org.junit.Test;
import org.sagebionetworks.repo.model.search.query.FacetSort;
import org.sagebionetworks.repo.model.search.query.FacetSortOptions;
import org.sagebionetworks.repo.model.search.query.FacetTopN;
import org.sagebionetworks.repo.model.search.query.KeyList;
import org.sagebionetworks.repo.model.search.query.KeyValue;
import org.sagebionetworks.repo.model.search.query.SearchQuery;

public class SearchUtilTest {
	private SearchQuery query;
	private String queryStr;

	private List<String> q;
	private List<KeyValue> bq;
	private List<KeyValue> bqNot;
	private List<KeyValue> bq2;
	private List<KeyValue> bqSpecialChar;

	private static final String EXPECTED_QUERY_PREFIX = "q.parser=structured&q=";

	private String encodeUTF8(String s) throws UnsupportedEncodingException{
		return URLEncoder.encode(s, "UTF-8");
	}

	@Before
	public void before() throws Exception {
		query = new SearchQuery();
		// q
		q = new ArrayList<String>();
		q.add("hello");
		q.add("world");

		// bq
		bq = new ArrayList<KeyValue>();
		KeyValue kv = new KeyValue();
		kv.setKey("Facet1");
		kv.setValue("Value1");
		bq.add(kv);

		bq2 = new ArrayList<KeyValue>();
		kv = new KeyValue();
		kv.setKey("Facet1");
		kv.setValue("..2000");
		bq2.add(kv);

		bqNot = new ArrayList<KeyValue>();
		kv = new KeyValue();
		kv.setKey("Facet1");
		kv.setValue("Value1");
		kv.setNot(true);
		bqNot.add(kv);
		kv = new KeyValue();
		kv.setKey("Facet2");
		kv.setValue("Value2");
		bqNot.add(kv);

		bqSpecialChar = new ArrayList<KeyValue>();
		kv = new KeyValue();
		kv.setKey("Facet1");
		kv.setValue("c:\\dave's_folde,r");
		bqSpecialChar.add(kv);
	}
	@Test (expected = IllegalArgumentException.class)
	public void testNullQuery() throws Exception{
		// null input
		SearchUtil.generateStructuredQueryString(null);
	}

	@Test(expected = IllegalArgumentException.class)
	public void testNoQueryContent() throws Exception{
		// no actual query content
		SearchUtil.generateStructuredQueryString( new SearchQuery() );
	}
	@Test (expected = IllegalArgumentException.class)
	public void testEmptyQuery() throws Exception{
		// empty query
		query.setQueryTerm(Arrays.asList(new String[] {""}));
		SearchUtil.generateStructuredQueryString(query);
	}

	@Test
	public void testRegularQueryOnly() throws Exception{

		// query only
		query.setQueryTerm(q);
		queryStr = SearchUtil.generateStructuredQueryString(query);
		assertEquals(EXPECTED_QUERY_PREFIX+encodeUTF8("(and 'hello' 'world')"), queryStr);
	}

	@Test
	public void testRegularQueryWithPrefix() throws Exception{
		// q
		q.add("somePrefix*");
		query.setQueryTerm(q);
		queryStr = SearchUtil.generateStructuredQueryString(query);
		assertEquals(EXPECTED_QUERY_PREFIX+encodeUTF8("(and 'hello' 'world' (prefix 'somePrefix'))"), queryStr);
	}

	@Test
	public void testBooleanQuery() throws Exception{
		// boolean query only
		query.setBooleanQuery(bq);
		queryStr = SearchUtil.generateStructuredQueryString(query);
		assertEquals(EXPECTED_QUERY_PREFIX+encodeUTF8("(and Facet1:'Value1')"), queryStr);
	}

	@Test
	public void testBooleanQueryWithPrefix() throws Exception{
		KeyValue prefixKV = new KeyValue();
		prefixKV.setKey("someField");
		prefixKV.setValue("somePrefix*");
		bq.add(prefixKV);
		query.setBooleanQuery(bq);
		queryStr = SearchUtil.generateStructuredQueryString(query);
		assertEquals(EXPECTED_QUERY_PREFIX+encodeUTF8("(and Facet1:'Value1' (prefix field=someField 'somePrefix'))"), queryStr);
	}

	@Test
	public void testBooleanQueryWithBlankRegularQuery() throws Exception{
		// boolean query with blank single q
		query.setQueryTerm(Arrays.asList(new String[] {""}));
		query.setBooleanQuery(bq);
		queryStr = SearchUtil.generateStructuredQueryString(query);
		assertEquals(EXPECTED_QUERY_PREFIX+encodeUTF8("(and Facet1:'Value1')"), queryStr);
	}

	@Test
	public void testBooleanQueryContinuous() throws Exception{
		// continuous bq
		query.setBooleanQuery(bq2);
		queryStr = SearchUtil.generateStructuredQueryString(query);
		assertEquals(EXPECTED_QUERY_PREFIX+encodeUTF8("(and (range field=Facet1 {,2000]))"), queryStr);
	}

	@Test
	public void testNegatedBooleanQuery() throws Exception{
		// negated boolean query
		query.setBooleanQuery(bqNot);
		queryStr = SearchUtil.generateStructuredQueryString(query);
		assertEquals(EXPECTED_QUERY_PREFIX + encodeUTF8("(and (not Facet1:'Value1') Facet2:'Value2')"), queryStr);
	}

	@Test
	public void testSpecialCharactersInBooleanQuery() throws Exception{
		// special characters in boolean query
		query.setBooleanQuery(bqSpecialChar);
		queryStr = SearchUtil.generateStructuredQueryString(query);
		assertEquals(EXPECTED_QUERY_PREFIX + "%28and+Facet1%3A%27c%3A%5C%5Cdave%5C%27s_folde%2Cr%27%29", queryStr);
	}
	@Test
	public void testRegularQueryAndBooleanQuery() throws Exception{
		// Both q and bq
		query.setBooleanQuery(bq);
		query.setQueryTerm(q);
		queryStr = SearchUtil.generateStructuredQueryString(query);
		assertEquals(EXPECTED_QUERY_PREFIX + encodeUTF8("(and (and 'hello' 'world') Facet1:'Value1')"), queryStr);
	}

	@Test
	public void testFacets() throws Exception{
		// facets
		query.setQueryTerm(q);
		List<String> facets = new ArrayList<String>();
		facets.add("facet1");
		facets.add("facet2");
		query.setQueryTerm(q);
		query.setFacet(facets);
		queryStr = SearchUtil.generateStructuredQueryString(query);
		assertEquals( EXPECTED_QUERY_PREFIX + encodeUTF8("(and 'hello' 'world')")+"&facet.facet1=" + encodeUTF8("{}") + "&facet.facet2=" + encodeUTF8("{}"), queryStr);
	}

	@Test (expected = IllegalArgumentException.class)
	public void testFacetConstraints() throws Exception{
		// facet field constraints
		query.setQueryTerm(q);
		List<KeyList> facetFieldConstraints = new ArrayList<KeyList>();
		KeyList ffc1 = new KeyList();
		ffc1.setKey("facet1");
		ffc1.setValues(Arrays.asList(new String[] { "one,two\\three", "dave's", "regular" }));
		facetFieldConstraints.add(ffc1);
		KeyList ffc2 = new KeyList();
		ffc2.setKey("facet2");
		ffc2.setValues(Arrays.asList(new String[] { "123", "4..5" }));
		facetFieldConstraints.add(ffc2);
		query.setFacetFieldConstraints(facetFieldConstraints);
		queryStr = SearchUtil.generateStructuredQueryString(query);
	}
	@Test (expected = IllegalArgumentException.class)
	public void testFacetSort() throws Exception{
		// facet field sort
		query.setQueryTerm(q);
		List<FacetSort> facetFieldSorts = null;
		FacetSort fs = null;

		fs = new FacetSort();
		fs.setFacetName("facet1");
		fs.setSortType(FacetSortOptions.ALPHA);
		facetFieldSorts = new ArrayList<FacetSort>();
		facetFieldSorts.add(fs);
		query.setQueryTerm(q);
		query.setFacetFieldSort(facetFieldSorts);
		queryStr = SearchUtil.generateStructuredQueryString(query);
	}

	@Test(expected = IllegalArgumentException.class)
	public void testFacetFieldTopN() throws Exception{
		// facet field top N
		List<FacetTopN> topNList = new ArrayList<FacetTopN>();
		FacetTopN topn = null;

		topn = new FacetTopN();
		topn.setKey("facet1");
		topn.setValue(new Long(10));
		topNList.add(topn);

		topn = new FacetTopN();
		topn.setKey("facet2");
		topn.setValue(new Long(20));
		topNList.add(topn);

		query.setQueryTerm(q);
		query.setFacetFieldTopN(topNList);
		queryStr = SearchUtil.generateStructuredQueryString(query);
	}
	@Test (expected=IllegalArgumentException.class)
	public void testRank() throws Exception{
		query.setQueryTerm(q);
		query.setRank(Arrays.asList(new String[]{"rankfield1", "-rankfield2"}));
		queryStr = SearchUtil.generateStructuredQueryString(query);
	}

	@Test
	public void testReturnFields() throws Exception{
		// return fields
		query.setQueryTerm(q);
		query.setReturnFields(Arrays.asList(new String[] { "retF1", "retF2" }));
		queryStr = SearchUtil.generateStructuredQueryString(query);
		assertEquals(EXPECTED_QUERY_PREFIX+encodeUTF8("(and 'hello' 'world')")+ "&return=" + encodeUTF8("retF1,retF2"), queryStr);

	}
	@Test
	public void testSizeParameter() throws Exception{
		// size
		query.setQueryTerm(q);
		query.setSize(new Long(100));
		queryStr = SearchUtil.generateStructuredQueryString(query);
		assertEquals( EXPECTED_QUERY_PREFIX+encodeUTF8("(and 'hello' 'world')") +"&size=100", queryStr);
	}
	@Test
	public void testStartParameter() throws Exception{
		// start
		query.setQueryTerm(q);
		query.setStart(new Long(10));
		queryStr = SearchUtil.generateStructuredQueryString(query);
		assertEquals( EXPECTED_QUERY_PREFIX+encodeUTF8("(and 'hello' 'world')") +"&start=10", queryStr);
	}
}