text:
package features

import (
	"k8s.io/apimachinery/pkg/util/runtime"
	genericfeatures "k8s.io/apiserver/pkg/features"
	utilfeature "k8s.io/apiserver/pkg/util/feature"
	"k8s.io/component-base/featuregate"
)

const (
	// Every feature gate should add method here following this template:
	//
	// // owner: @username
	// // alpha: v1.X
	// MyFeature featuregate.Feature = "MyFeature"

	// owner: @tallclair
	// beta: v1.4
	AppArmor featuregate.Feature = "AppArmor"

	// owner: @mtaufen
	// alpha: v1.4
	// beta: v1.11
	DynamicKubeletConfig featuregate.Feature = "DynamicKubeletConfig"

	// owner: @pweil-
	// alpha: v1.5
	//
	// Default userns=host for containers that are using other host namespaces, host mounts, the pod
	// contains a privileged container, or specific non-namespaced capabilities (MKNOD, SYS_MODULE,
	// SYS_TIME). This should only be enabled if user namespace remapping is enabled in the docker daemon.
	ExperimentalHostUserNamespaceDefaultingGate featuregate.Feature = "ExperimentalHostUserNamespaceDefaulting"

	// owner: @jiayingz
	// beta: v1.10
	//
	// Enables support for Device Plugins
	DevicePlugins featuregate.Feature = "DevicePlugins"

	// owner: @dxist
	// alpha: v1.16
	//
	// Enables support of HPA scaling to zero pods when an object or custom metric is configured.
	HPAScaleToZero featuregate.Feature = "HPAScaleToZero"

	// owner: @Huang-Wei
	// beta: v1.13
	// ga: v1.18
	//
	// Changes the logic behind evicting Pods from not ready Nodes
	// to take advantage of NoExecute Taints and Tolerations.
	TaintBasedEvictions featuregate.Feature = "TaintBasedEvictions"

	// owner: @mikedanese
	// alpha: v1.7
	// beta: v1.12
	//
	// Gets a server certificate for the kubelet from the Certificate Signing
	// Request API instead of generating one self signed and auto rotates the
	// certificate as expiration approaches.
	RotateKubeletServerCertificate featuregate.Feature = "RotateKubeletServerCertificate"

	// owner: @mikedanese
	// beta: v1.8
	// ga: v1.19
	//
	// Automatically renews the client certificate used for communicating with
	// the API server as the certificate approaches expiration.
	RotateKubeletClientCertificate featuregate.Feature = "RotateKubeletClientCertificate"

	// owner: @jinxu
	// beta: v1.10
	//
	// New local storage types to support local storage capacity isolation
	LocalStorageCapacityIsolation featuregate.Feature = "LocalStorageCapacityIsolation"

	// owner: @gnufied
	// beta: v1.11
	// Ability to Expand persistent volumes
	ExpandPersistentVolumes featuregate.Feature = "ExpandPersistentVolumes"

	// owner: @mlmhl
	// beta: v1.15
	// Ability to expand persistent volumes' file system without unmounting volumes.
	ExpandInUsePersistentVolumes featuregate.Feature = "ExpandInUsePersistentVolumes"

	// owner: @gnufied
	// alpha: v1.14
	// beta: v1.16
	// Ability to expand CSI volumes
	ExpandCSIVolumes featuregate.Feature = "ExpandCSIVolumes"

	// owner: @verb
	// alpha: v1.16
	//
	// Allows running an ephemeral container in pod namespaces to troubleshoot a running pod.
	EphemeralContainers featuregate.Feature = "EphemeralContainers"

	// owner: @sjenning
	// alpha: v1.11
	//
	// Allows resource reservations at the QoS level preventing pods at lower QoS levels from
	// bursting into resources requested at higher QoS levels (memory only for now)
	QOSReserved featuregate.Feature = "QOSReserved"

	// owner: @ConnorDoyle
	// alpha: v1.8
	// beta: v1.10
	//
	// Alternative container-level CPU affinity policies.
	CPUManager featuregate.Feature = "CPUManager"

	// owner: @szuecs
	// alpha: v1.12
	//
	// Enable nodes to change CPUCFSQuotaPeriod
	CPUCFSQuotaPeriod featuregate.Feature = "CustomCPUCFSQuotaPeriod"

	// owner: @lmdaly
	// alpha: v1.16
	// beta: v1.18
	//
	// Enable resource managers to make NUMA aligned decisions
	TopologyManager featuregate.Feature = "TopologyManager"

	// owner: @sjenning
	// beta: v1.11
	//
	// Enable pods to set sysctls on a pod
	Sysctls featuregate.Feature = "Sysctls"

	// owner @smarterclayton
	// alpha: v1.16
	// beta:  v1.19
	//
	// Enable legacy behavior to vary cluster functionality on the node-role.kubernetes.io labels. On by default (legacy), will be turned off in 1.18.
	LegacyNodeRoleBehavior featuregate.Feature = "LegacyNodeRoleBehavior"

	// owner @brendandburns
	// alpha: v1.9
	// beta:  v1.19
	//
	// Enable nodes to exclude themselves from service load balancers
	ServiceNodeExclusion featuregate.Feature = "ServiceNodeExclusion"

	// owner @smarterclayton
	// alpha: v1.16
	// beta:  v1.19
	//
	// Enable nodes to exclude themselves from network disruption checks
	NodeDisruptionExclusion featuregate.Feature = "NodeDisruptionExclusion"

	// owner: @saad-ali
	// alpha: v1.12
	// beta:  v1.14
	// GA:    v1.18
	// Enable all logic related to the CSIDriver API object in storage.k8s.io
	CSIDriverRegistry featuregate.Feature = "CSIDriverRegistry"

	// owner: @verult
	// alpha: v1.12
	// beta:  v1.14
	// ga:    v1.17
	// Enable all logic related to the CSINode API object in storage.k8s.io
	CSINodeInfo featuregate.Feature = "CSINodeInfo"

	// owner: @screeley44
	// alpha: v1.9
	// beta:  v1.13
	// ga: 	  v1.18
	//
	// Enable Block volume support in containers.
	BlockVolume featuregate.Feature = "BlockVolume"

	// owner: @pospispa
	// GA: v1.11
	//
	// Postpone deletion of a PV or a PVC when they are being used
	StorageObjectInUseProtection featuregate.Feature = "StorageObjectInUseProtection"

	// owner: @dims, @derekwaynecarr
	// alpha: v1.10
	// beta: v1.14
	// GA: v1.20
	//
	// Implement support for limiting pids in pods
	SupportPodPidsLimit featuregate.Feature = "SupportPodPidsLimit"

	// owner: @feiskyer
	// alpha: v1.10
	//
	// Enable Hyper-V containers on Windows
	HyperVContainer featuregate.Feature = "HyperVContainer"

	// owner: @mikedanese
	// beta: v1.12
	//
	// Implement TokenRequest endpoint on service account resources.
	TokenRequest featuregate.Feature = "TokenRequest"

	// owner: @mikedanese
	// beta: v1.12
	//
	// Enable ServiceAccountTokenVolumeProjection support in ProjectedVolumes.
	TokenRequestProjection featuregate.Feature = "TokenRequestProjection"

	// owner: @mikedanese
	// alpha: v1.13
	//
	// Migrate ServiceAccount volumes to use a projected volume consisting of a
	// ServiceAccountTokenVolumeProjection. This feature adds new required flags
	// to the API server.
	BoundServiceAccountTokenVolume featuregate.Feature = "BoundServiceAccountTokenVolume"

	// owner: @mtaufen
	// alpha: v1.18
	// beta: v1.20
	//
	// Enable OIDC discovery endpoints (issuer and JWKS URLs) for the service
	// account issuer in the API server.
	// Note these endpoints serve minimally-compliant discovery docs that are
	// intended to be used for service account token verification.
	ServiceAccountIssuerDiscovery featuregate.Feature = "ServiceAccountIssuerDiscovery"

	// owner: @Random-Liu
	// beta: v1.11
	//
	// Enable container log rotation for cri container runtime
	CRIContainerLogRotation featuregate.Feature = "CRIContainerLogRotation"

	// owner: @krmayankk
	// beta: v1.14
	//
	// Enables control over the primary group ID of containers' init processes.
	RunAsGroup featuregate.Feature = "RunAsGroup"

	// owner: @saad-ali
	// ga
	//
	// Allow mounting a subpath of a volume in a container
	// Do not remove this feature gate even though it's GA
	VolumeSubpath featuregate.Feature = "VolumeSubpath"

	// owner: @gnufied
	// beta : v1.12
	// GA   : v1.17

	//
	// Add support for volume plugins to report node specific
	// volume limits
	AttachVolumeLimit featuregate.Feature = "AttachVolumeLimit"

	// owner: @ravig
	// alpha: v1.11
	//
	// Include volume count on node to be considered for balanced resource allocation while scheduling.
	// A node which has closer cpu,memory utilization and volume count is favoured by scheduler
	// while making decisions.
	BalanceAttachedNodeVolumes featuregate.Feature = "BalanceAttachedNodeVolumes"

	// owner: @vladimirvivien
	// alpha: v1.11
	// beta:  v1.14
	// ga: 	  v1.18
	//
	// Enables CSI to use raw block storage volumes
	CSIBlockVolume featuregate.Feature = "CSIBlockVolume"

	// owner: @pohly
	// alpha: v1.14
	// beta: v1.16
	//
	// Enables CSI Inline volumes support for pods
	CSIInlineVolume featuregate.Feature = "CSIInlineVolume"

	// owner: @pohly
	// alpha: v1.19
	//
	// Enables tracking of available storage capacity that CSI drivers provide.
	CSIStorageCapacity featuregate.Feature = "CSIStorageCapacity"

	// owner: @alculquicondor
	// alpha: v1.19
	//
	// Enables the use of PodTopologySpread scheduling plugin to do default
	// spreading and disables legacy SelectorSpread plugin.
	DefaultPodTopologySpread featuregate.Feature = "DefaultPodTopologySpread"

	// owner: @pohly
	// alpha: v1.19
	//
	// Enables generic ephemeral inline volume support for pods
	GenericEphemeralVolume featuregate.Feature = "GenericEphemeralVolume"

	// owner: @tallclair
	// alpha: v1.12
	// beta:  v1.14
	//
	// Enables RuntimeClass, for selecting between multiple runtimes to run a pod.
	RuntimeClass featuregate.Feature = "RuntimeClass"

	// owner: @mtaufen
	// alpha: v1.12
	// beta:  v1.14
	// GA: v1.17
	//
	// Kubelet uses the new Lease API to report node heartbeats,
	// (Kube) Node Lifecycle Controller uses these heartbeats as a node health signal.
	NodeLease featuregate.Feature = "NodeLease"

	// owner: @janosi
	// alpha: v1.12
	//
	// Enables SCTP as new protocol for Service ports, NetworkPolicy, and ContainerPort in Pod/Containers definition
	SCTPSupport featuregate.Feature = "SCTPSupport"

	// owner: @xing-yang
	// alpha: v1.12
	// beta: v1.17
	//
	// Enable volume snapshot data source support.
	VolumeSnapshotDataSource featuregate.Feature = "VolumeSnapshotDataSource"

	// owner: @jessfraz
	// alpha: v1.12
	//
	// Enables control over ProcMountType for containers.
	ProcMountType featuregate.Feature = "ProcMountType"

	// owner: @janetkuo
	// alpha: v1.12
	//
	// Allow TTL controller to clean up Pods and Jobs after they finish.
	TTLAfterFinished featuregate.Feature = "TTLAfterFinished"

	// owner: @dashpole
	// alpha: v1.13
	// beta: v1.15
	//
	// Enables the kubelet's pod resources grpc endpoint
	KubeletPodResources featuregate.Feature = "KubeletPodResources"

	// owner: @davidz627
	// alpha: v1.14
	// beta: v1.17
	//
	// Enables the in-tree storage to CSI Plugin migration feature.
	CSIMigration featuregate.Feature = "CSIMigration"

	// owner: @davidz627
	// alpha: v1.14
	// beta: v1.17
	//
	// Enables the GCE PD in-tree driver to GCE CSI Driver migration feature.
	CSIMigrationGCE featuregate.Feature = "CSIMigrationGCE"

	// owner: @davidz627
	// alpha: v1.17
	//
	// Disables the GCE PD in-tree driver.
	// Expects GCE PD CSI Driver to be installed and configured on all nodes.
	CSIMigrationGCEComplete featuregate.Feature = "CSIMigrationGCEComplete"

	// owner: @leakingtapan
	// alpha: v1.14
	// beta: v1.17
	//
	// Enables the AWS EBS in-tree driver to AWS EBS CSI Driver migration feature.
	CSIMigrationAWS featuregate.Feature = "CSIMigrationAWS"

	// owner: @leakingtapan
	// alpha: v1.17
	//
	// Disables the AWS EBS in-tree driver.
	// Expects AWS EBS CSI Driver to be installed and configured on all nodes.
	CSIMigrationAWSComplete featuregate.Feature = "CSIMigrationAWSComplete"

	// owner: @andyzhangx
	// alpha: v1.15
	// beta: v1.19
	//
	// Enables the Azure Disk in-tree driver to Azure Disk Driver migration feature.
	CSIMigrationAzureDisk featuregate.Feature = "CSIMigrationAzureDisk"

	// owner: @andyzhangx
	// alpha: v1.17
	//
	// Disables the Azure Disk in-tree driver.
	// Expects Azure Disk CSI Driver to be installed and configured on all nodes.
	CSIMigrationAzureDiskComplete featuregate.Feature = "CSIMigrationAzureDiskComplete"

	// owner: @andyzhangx
	// alpha: v1.15
	//
	// Enables the Azure File in-tree driver to Azure File Driver migration feature.
	CSIMigrationAzureFile featuregate.Feature = "CSIMigrationAzureFile"

	// owner: @andyzhangx
	// alpha: v1.17
	//
	// Disables the Azure File in-tree driver.
	// Expects Azure File CSI Driver to be installed and configured on all nodes.
	CSIMigrationAzureFileComplete featuregate.Feature = "CSIMigrationAzureFileComplete"

	// owner: @divyenpatel
	// beta: v1.19 (requires: vSphere vCenter/ESXi Version: 7.0u1, HW Version: VM version 15)
	//
	// Enables the vSphere in-tree driver to vSphere CSI Driver migration feature.
	CSIMigrationvSphere featuregate.Feature = "CSIMigrationvSphere"

	// owner: @divyenpatel
	// beta: v1.19 (requires: vSphere vCenter/ESXi Version: 7.0u1, HW Version: VM version 15)
	//
	// Disables the vSphere in-tree driver.
	// Expects vSphere CSI Driver to be installed and configured on all nodes.
	CSIMigrationvSphereComplete featuregate.Feature = "CSIMigrationvSphereComplete"

	// owner: @huffmanca
	// alpha: v1.19
	//
	// Determines if a CSI Driver supports applying fsGroup.
	CSIVolumeFSGroupPolicy featuregate.Feature = "CSIVolumeFSGroupPolicy"

	// owner: @gnufied
	// alpha: v1.18
	// Allows user to configure volume permission change policy for fsGroups when mounting
	// a volume in a Pod.
	ConfigurableFSGroupPolicy featuregate.Feature = "ConfigurableFSGroupPolicy"

	// owner: @RobertKrawitz, @derekwaynecarr
	// beta: v1.15
	// GA: v1.20
	//
	// Implement support for limiting pids in nodes
	SupportNodePidsLimit featuregate.Feature = "SupportNodePidsLimit"

	// owner: @wk8
	// alpha: v1.14
	// beta: v1.16
	//
	// Enables GMSA support for Windows workloads.
	WindowsGMSA featuregate.Feature = "WindowsGMSA"

	// owner: @bclau
	// alpha: v1.16
	// beta: v1.17
	// GA: v1.18
	//
	// Enables support for running container entrypoints as different usernames than their default ones.
	WindowsRunAsUserName featuregate.Feature = "WindowsRunAsUserName"

	// owner: @adisky
	// alpha: v1.14
	// beta: v1.18
	//
	// Enables the OpenStack Cinder in-tree driver to OpenStack Cinder CSI Driver migration feature.
	CSIMigrationOpenStack featuregate.Feature = "CSIMigrationOpenStack"

	// owner: @adisky
	// alpha: v1.17
	//
	// Disables the OpenStack Cinder in-tree driver.
	// Expects the OpenStack Cinder CSI Driver to be installed and configured on all nodes.
	CSIMigrationOpenStackComplete featuregate.Feature = "CSIMigrationOpenStackComplete"

	// owner: @MrHohn
	// alpha: v1.15
	// beta:  v1.16
	// GA: v1.17
	//
	// Enables Finalizer Protection for Service LoadBalancers.
	ServiceLoadBalancerFinalizer featuregate.Feature = "ServiceLoadBalancerFinalizer"

	// owner: @RobertKrawitz
	// alpha: v1.15
	//
	// Allow use of filesystems for ephemeral storage monitoring.
	// Only applies if LocalStorageCapacityIsolation is set.
	LocalStorageCapacityIsolationFSQuotaMonitoring featuregate.Feature = "LocalStorageCapacityIsolationFSQuotaMonitoring"

	// owner: @denkensk
	// alpha: v1.15
	// beta: v1.19
	//
	// Enables NonPreempting option for priorityClass and pod.
	NonPreemptingPriority featuregate.Feature = "NonPreemptingPriority"

	// owner: @j-griffith
	// alpha: v1.15
	// beta: v1.16
	// GA: v1.18
	//
	// Enable support for specifying an existing PVC as a DataSource
	VolumePVCDataSource featuregate.Feature = "VolumePVCDataSource"

	// owner: @egernst
	// alpha: v1.16
	// beta: v1.18
	//
	// Enables PodOverhead, for accounting pod overheads which are specific to a given RuntimeClass
	PodOverhead featuregate.Feature = "PodOverhead"

	// owner: @khenidak
	// alpha: v1.15
	//
	// Enables ipv6 dual stack
	IPv6DualStack featuregate.Feature = "IPv6DualStack"

	// owner: @robscott @freehan
	// alpha: v1.16
	//
	// Enable Endpoint Slices for more scalable Service endpoints.
	EndpointSlice featuregate.Feature = "EndpointSlice"

	// owner: @robscott @freehan
	// alpha: v1.18
	// beta: v1.19
	//
	// Enable Endpoint Slice consumption by kube-proxy for improved scalability.
	EndpointSliceProxying featuregate.Feature = "EndpointSliceProxying"

	// owner: @robscott @kumarvin123
	// alpha: v1.19
	//
	// Enable Endpoint Slice consumption by kube-proxy in Windows for improved scalability.
	WindowsEndpointSliceProxying featuregate.Feature = "WindowsEndpointSliceProxying"

	// owner: @Huang-Wei
	// alpha: v1.16
	// beta: v1.18
	// GA: v1.19
	//
	// Schedule pods evenly across available topology domains.
	EvenPodsSpread featuregate.Feature = "EvenPodsSpread"

	// owner: @matthyx
	// alpha: v1.16
	// beta: v1.18
	// GA: v1.20
	//
	// Enables the startupProbe in kubelet worker.
	StartupProbe featuregate.Feature = "StartupProbe"

	// owner: @deads2k
	// beta: v1.17
	//
	// Enables the users to skip TLS verification of kubelets on pod logs requests
	AllowInsecureBackendProxy featuregate.Feature = "AllowInsecureBackendProxy"

	// owner: @mortent
	// alpha: v1.3
	// beta:  v1.5
	//
	// Enable all logic related to the PodDisruptionBudget API object in policy
	PodDisruptionBudget featuregate.Feature = "PodDisruptionBudget"

	// owner: @m1093782566
	// alpha: v1.17
	//
	// Enables topology aware service routing
	ServiceTopology featuregate.Feature = "ServiceTopology"

	// owner: @robscott
	// alpha: v1.18
	// beta:  v1.19
	//
	// Enables AppProtocol field for Services and Endpoints.
	ServiceAppProtocol featuregate.Feature = "ServiceAppProtocol"

	// owner: @wojtek-t
	// alpha: v1.18
	// beta: v1.19
	//
	// Enables a feature to make secrets and configmaps data immutable.
	ImmutableEphemeralVolumes featuregate.Feature = "ImmutableEphemeralVolumes"

	// owner: @bart0sh
	// alpha: v1.18
	// beta: v1.19
	//
	// Enables usage of HugePages-<size> in a volume medium,
	// e.g. emptyDir:
	//        medium: HugePages-1Gi
	HugePageStorageMediumSize featuregate.Feature = "HugePageStorageMediumSize"

	// owner: @freehan
	// GA: v1.18
	//
	// Enable ExternalTrafficPolicy for Service ExternalIPs.
	// This is for bug fix #69811
	ExternalPolicyForExternalIP featuregate.Feature = "ExternalPolicyForExternalIP"

	// owner: @bswartz
	// alpha: v1.18
	//
	// Enables usage of any object for volume data source in PVCs
	AnyVolumeDataSource featuregate.Feature = "AnyVolumeDataSource"

	// owner: @javidiaz
	// alpha: v1.19
	//
	// Allow setting the Fully Qualified Domain Name (FQDN) in the hostname of a Pod. If a Pod does not
	// have FQDN, this feature has no effect.
	SetHostnameAsFQDN featuregate.Feature = "SetHostnameAsFQDN"

	// owner: @ksubrmnn
	// alpha: v1.14
	// beta: v1.20
	//
	// Allows kube-proxy to run in Overlay mode for Windows
	WinOverlay featuregate.Feature = "WinOverlay"

	// owner: @ksubrmnn
	// alpha: v1.14
	//
	// Allows kube-proxy to create DSR loadbalancers for Windows
	WinDSR featuregate.Feature = "WinDSR"

	// owner: @RenaudWasTaken @dashpole
	// alpha: v1.19
	//
	// Disables Accelerator Metrics Collected by Kubelet
	DisableAcceleratorUsageMetrics featuregate.Feature = "DisableAcceleratorUsageMetrics"
)

func init() {
	runtime.Must(utilfeature.DefaultMutableFeatureGate.Add(defaultKubernetesFeatureGates))
}

// defaultKubernetesFeatureGates consists of all known Kubernetes-specific feature keys.
// To add a new feature, define a key for it above and add it here. The features will be
// available throughout Kubernetes binaries.
var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{
	AppArmor:             {Default: true, PreRelease: featuregate.Beta},
	DynamicKubeletConfig: {Default: true, PreRelease: featuregate.Beta},
	ExperimentalHostUserNamespaceDefaultingGate: {Default: false, PreRelease: featuregate.Beta},
	DevicePlugins:                  {Default: true, PreRelease: featuregate.Beta},
	TaintBasedEvictions:            {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.19
	RotateKubeletServerCertificate: {Default: true, PreRelease: featuregate.Beta},
	RotateKubeletClientCertificate: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.20
	LocalStorageCapacityIsolation:  {Default: true, PreRelease: featuregate.Beta},
	Sysctls:                        {Default: true, PreRelease: featuregate.Beta},
	EphemeralContainers:            {Default: false, PreRelease: featuregate.Alpha},
	QOSReserved:                    {Default: false, PreRelease: featuregate.Alpha},
	ExpandPersistentVolumes:        {Default: true, PreRelease: featuregate.Beta},
	ExpandInUsePersistentVolumes:   {Default: true, PreRelease: featuregate.Beta},
	ExpandCSIVolumes:               {Default: true, PreRelease: featuregate.Beta},
	AttachVolumeLimit:              {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.19
	CPUManager:                     {Default: true, PreRelease: featuregate.Beta},
	CPUCFSQuotaPeriod:              {Default: false, PreRelease: featuregate.Alpha},
	TopologyManager:                {Default: true, PreRelease: featuregate.Beta},
	ServiceNodeExclusion:           {Default: true, PreRelease: featuregate.Beta},
	NodeDisruptionExclusion:        {Default: true, PreRelease: featuregate.Beta},
	CSIDriverRegistry:              {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.20
	CSINodeInfo:                    {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.19
	BlockVolume:                    {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.20
	StorageObjectInUseProtection:   {Default: true, PreRelease: featuregate.GA},
	SupportPodPidsLimit:            {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.21
	SupportNodePidsLimit:           {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.21
	HyperVContainer:                {Default: false, PreRelease: featuregate.Alpha},
	TokenRequest:                   {Default: true, PreRelease: featuregate.Beta},
	TokenRequestProjection:         {Default: true, PreRelease: featuregate.Beta},
	BoundServiceAccountTokenVolume: {Default: false, PreRelease: featuregate.Alpha},
	ServiceAccountIssuerDiscovery:  {Default: true, PreRelease: featuregate.Beta},
	CRIContainerLogRotation:        {Default: true, PreRelease: featuregate.Beta},
	CSIMigration:                   {Default: true, PreRelease: featuregate.Beta},
	CSIMigrationGCE:                {Default: false, PreRelease: featuregate.Beta}, // Off by default (requires GCE PD CSI Driver)
	CSIMigrationGCEComplete:        {Default: false, PreRelease: featuregate.Alpha},
	CSIMigrationAWS:                {Default: false, PreRelease: featuregate.Beta}, // Off by default (requires AWS EBS CSI driver)
	CSIMigrationAWSComplete:        {Default: false, PreRelease: featuregate.Alpha},
	CSIMigrationAzureDisk:          {Default: false, PreRelease: featuregate.Beta}, // Off by default (requires Azure Disk CSI driver)
	CSIMigrationAzureDiskComplete:  {Default: false, PreRelease: featuregate.Alpha},
	CSIMigrationAzureFile:          {Default: false, PreRelease: featuregate.Alpha},
	CSIMigrationAzureFileComplete:  {Default: false, PreRelease: featuregate.Alpha},
	CSIMigrationvSphere:            {Default: false, PreRelease: featuregate.Beta},
	CSIMigrationvSphereComplete:    {Default: false, PreRelease: featuregate.Beta},
	RunAsGroup:                     {Default: true, PreRelease: featuregate.Beta},
	CSIMigrationOpenStack:          {Default: false, PreRelease: featuregate.Beta}, // Off by default (requires OpenStack Cinder CSI driver)
	CSIMigrationOpenStackComplete:  {Default: false, PreRelease: featuregate.Alpha},
	VolumeSubpath:                  {Default: true, PreRelease: featuregate.GA},
	ConfigurableFSGroupPolicy:      {Default: false, PreRelease: featuregate.Alpha},
	BalanceAttachedNodeVolumes:     {Default: false, PreRelease: featuregate.Alpha},
	CSIBlockVolume:                 {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.20
	CSIInlineVolume:                {Default: true, PreRelease: featuregate.Beta},
	CSIStorageCapacity:             {Default: false, PreRelease: featuregate.Alpha},
	GenericEphemeralVolume:         {Default: false, PreRelease: featuregate.Alpha},
	CSIVolumeFSGroupPolicy:         {Default: false, PreRelease: featuregate.Alpha},
	RuntimeClass:                   {Default: true, PreRelease: featuregate.Beta},
	NodeLease:                      {Default: true, PreRelease: featuregate.GA, LockToDefault: true},
	SCTPSupport:                    {Default: true, PreRelease: featuregate.Beta},
	VolumeSnapshotDataSource:       {Default: true, PreRelease: featuregate.Beta},
	ProcMountType:                  {Default: false, PreRelease: featuregate.Alpha},
	TTLAfterFinished:               {Default: false, PreRelease: featuregate.Alpha},
	KubeletPodResources:            {Default: true, PreRelease: featuregate.Beta},
	WindowsGMSA:                    {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.20
	WindowsRunAsUserName:           {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.20
	ServiceLoadBalancerFinalizer:   {Default: true, PreRelease: featuregate.GA, LockToDefault: true},
	LocalStorageCapacityIsolationFSQuotaMonitoring: {Default: false, PreRelease: featuregate.Alpha},
	NonPreemptingPriority:                          {Default: true, PreRelease: featuregate.Beta},
	VolumePVCDataSource:                            {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.20
	PodOverhead:                                    {Default: true, PreRelease: featuregate.Beta},
	IPv6DualStack:                                  {Default: false, PreRelease: featuregate.Alpha},
	EndpointSlice:                                  {Default: true, PreRelease: featuregate.Beta},
	EndpointSliceProxying:                          {Default: true, PreRelease: featuregate.Beta},
	WindowsEndpointSliceProxying:                   {Default: false, PreRelease: featuregate.Alpha},
	EvenPodsSpread:                                 {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.21
	StartupProbe:                                   {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.21
	AllowInsecureBackendProxy:                      {Default: true, PreRelease: featuregate.Beta},
	PodDisruptionBudget:                            {Default: true, PreRelease: featuregate.Beta},
	ServiceTopology:                                {Default: false, PreRelease: featuregate.Alpha},
	ServiceAppProtocol:                             {Default: true, PreRelease: featuregate.Beta},
	ImmutableEphemeralVolumes:                      {Default: true, PreRelease: featuregate.Beta},
	HugePageStorageMediumSize:                      {Default: true, PreRelease: featuregate.Beta},
	ExternalPolicyForExternalIP:                    {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.22
	AnyVolumeDataSource:                            {Default: false, PreRelease: featuregate.Alpha},
	DefaultPodTopologySpread:                       {Default: false, PreRelease: featuregate.Alpha},
	SetHostnameAsFQDN:                              {Default: false, PreRelease: featuregate.Alpha},
	WinOverlay:                                     {Default: true, PreRelease: featuregate.Beta},
	WinDSR:                                         {Default: false, PreRelease: featuregate.Alpha},
	DisableAcceleratorUsageMetrics:                 {Default: false, PreRelease: featuregate.Alpha},

	// inherited features from generic apiserver, relisted here to get a conflict if it is changed
	// unintentionally on either side:
	genericfeatures.StreamingProxyRedirects: {Default: true, PreRelease: featuregate.Deprecated},
	genericfeatures.ValidateProxyRedirects:  {Default: true, PreRelease: featuregate.Beta},
	genericfeatures.AdvancedAuditing:        {Default: true, PreRelease: featuregate.GA},
	genericfeatures.APIResponseCompression:  {Default: true, PreRelease: featuregate.Beta},
	genericfeatures.APIListChunking:         {Default: true, PreRelease: featuregate.Beta},
	genericfeatures.DryRun:                  {Default: true, PreRelease: featuregate.GA},
	genericfeatures.ServerSideApply:         {Default: true, PreRelease: featuregate.Beta},
	genericfeatures.APIPriorityAndFairness:  {Default: false, PreRelease: featuregate.Alpha},
	genericfeatures.WarningHeaders:          {Default: true, PreRelease: featuregate.Beta},

	// features that enable backwards compatibility but are scheduled to be removed
	// ...
	HPAScaleToZero:         {Default: false, PreRelease: featuregate.Alpha},
	LegacyNodeRoleBehavior: {Default: true, PreRelease: featuregate.Beta},
}


text:
const ghpages = require('gh-pages');
const path = require('path');
const pkg = require('../projects/ng-lightning/package.json');

ghpages.clean();
ghpages.publish(path.join(__dirname, '../dist/ng-lightning-app'), {
  message: 'chore(release): v' + pkg.version,
}, function (err) {
  if (err) {
    console.log('Error while publishing demo.', err);
    throw err;
  }
  console.log('Demo published!');
});

redpajama_set_name: RedPajamaGithub


text:
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-190 -220 700 700">
 <title>Performance test, animation over a background with filters. Reporting time via JS framework.</title>
 <defs>
   <filter id="Turb2" filterUnits="objectBoundingBox">
     <feTurbulence type="turbulence" baseFrequency="0.02" numOctaves="1" result="turb1">
     </feTurbulence>
     <feDiffuseLighting id="turb1" in="turb1" resultScale="1" surfaceScale="10" diffuseConstant="1" result="diffuse">
     <feDistantLight id="light" azimuth="135" elevation="60"/>
     </feDiffuseLighting>
     <feSpecularLighting in="turb1" surfaceScale="10" specularConstant="1" specularExponent="20" lighting-color="blue" result="specularOut">
     <feDistantLight id="light" azimuth="135" elevation="60"/>
     </feSpecularLighting>
   </filter>
 </defs>
 <script type="text/javascript">
  var start = new Date();
  var max = 30;
 </script>
 <text x="-150" y="-200" font-size="20">SVG Performance test.</text>
 <text x="200" y="-200" font-size="20">Test not started.</text>
 <g id="graphic-static" buffered-rendering="static">
   <rect fill="none" stroke="black" x="-183" y="-144" width="493" height="509" style="filter:url(#Turb2)"/>
 </g>
 <circle id="ball" cx="0" cy="0" r="50" fill="yellow" fill-opacity="0.5"/>
 <script type="text/javascript"><![CDATA[
  var svg = document.getElementsByTagNameNS('http://www.w3.org/2000/svg', 'svg')[0];
  var c = document.getElementsByTagNameNS('http://www.w3.org/2000/svg', 'circle')[0];
  var t = document.getElementsByTagNameNS('http://www.w3.org/2000/svg', 'text')[1];
  var g = document.getElementById('graphic-static');
  var cx = parseInt(c.getAttribute('cx'));
  var cy = parseInt(c.getAttribute('cy'));
  var r = parseInt(c.getAttribute('r'));
  var dx = 5;
  var dy = -5;
  var count = 0;
  function bounce() {
   if ((cx + r + dx > 390) || (cx - r + dx < -190))
     dx =- dx;
   cx += dx;
   if ((cy + r + dy > 390) || (cy - r + dy < -190))
     dy =- dy;
   cy += dy;
   c.setAttribute('cx', cx);
   c.setAttribute('cy', cy);
   ++count;
   if (count < max) {
     window.setTimeout(bounce, 50)
     t.firstChild.data = 'Test in progress... ' + count + ' of ' + max;
   } else {
     var end = new Date();
     var elapsed = end - start;
     t.firstChild.data = 'Test finished in ' + elapsed/1000 + "seconds"
     try{top.opener.rr(elapsed);}catch(e){}
   }
}
   window.setTimeout(bounce, 100);
 ]]></script>
</svg>

<!-- This document saved from http://wwwi.palace.opera.no/~ed/svg/perf/buffered-rendering/bufferedrendering.xml -->


text:
#include "tr/xqp/serial/deser.h"

#include "tr/xqp/visitor/ASTVisitor.h"
#include "ASTOrder.h"

void ASTOrder::accept(ASTVisitor &v)
{
    v.addToPath(this);
    v.visit(*this);
    v.removeFromPath(this);
}

ASTNode *ASTOrder::dup()
{
    return new ASTOrder(cd, mod);
}

ASTNode *ASTOrder::createNode(scheme_list &sl)
{
    ASTNodeCommonData cd;
    opt mod;

    U_ASSERT(sl[1].type == SCM_LIST && sl[2].type == SCM_NUMBER);

    cd = dsGetASTCommonFromSList(*sl[1].internal.list);
    mod = opt(atoi(sl[2].internal.num));

    return new ASTOrder(cd, mod);
}

void ASTOrder::modifyChild(const ASTNode *oldc, ASTNode *newc)
{
}


text:
if ((env.get_day_of_year() > 140) and (env.get_day_of_year() < 270)):
    cu.thermal_led = False
else:
    cu.thermal_led = True

# Sommer-Winter-regel. Funktioniert noch nicht so gut (etwa 200 Euro schlechter als ohne Regeln


text:
#include "reflect.h"

#include <algorithm>
#include <sstream>

namespace reflect {

/******************************************************************************/
/* TYPE                                                                       */
/******************************************************************************/

Type::
Type(std::string id) :
    id_(std::move(id)), parent_(nullptr), pointee_(nullptr)
{}

bool
Type::
isChildOf(const Type* other) const
{
    if (this == other) return true;

    if (isPointer() && other->isPointer()) {
        if (pointer() != other->pointer()) return false;
        return pointee()->isChildOf(other->pointee());
    }

    return parent_ && parent_->isChildOf(other);
}

bool
Type::
isParentOf(const Type* other) const
{
    return other->isChildOf(this);
}

bool
Type::
hasConverter(const Type* other) const
{
    return hasFunction("operator " + other->id() + "()");
}

const Function&
Type::
converter(const Type* other) const
{
    auto& fns = function("operator " + other->id() + "()");

    if (fns.size() > 1) {
        reflectError("<%s> has too many converters for <%s>",
                id_, other->id());
    }

    return fns[0];
}

bool
Type::
isCopiable() const
{
    if (!hasFunction(id_)) return false;

    auto& fns = function(id_);
    return fns.test(
            Argument(this, RefType::Copy, false),
            { Argument(this, RefType::Copy, false) });
}

bool
Type::
isMovable() const
{
    if (!hasFunction(id_)) return false;

    auto& fns = function(id_);
    return fns.test(
            Argument(this, RefType::Copy, false),
            { Argument(this, RefType::RValue, false) });
}

void
Type::
addFunction(const std::string& name, Function&& fn)
{
    auto it = fields_.find(name);
    if (it != fields_.end()) {
        reflectError("function <%s> already exists as field <%s> in <%s>",
                name, it->second.print(), id());
    }

    fns_[name].add(std::move(fn));
}

void
Type::
functions(std::vector<std::string>& result) const
{
    result.reserve(result.size() + fns_.size());

    for (const auto& f : fns_)
        result.push_back(f.first);

    if (parent_) parent_->functions(result);
}

std::vector<std::string>
Type::
functions() const
{
    std::vector<std::string> result;
    functions(result);

    std::sort(result.begin(), result.end());
    result.erase(std::unique(result.begin(), result.end()), result.end());

    return result;
}

bool
Type::
hasFunction(const std::string& fn) const
{
    if (fns_.count(fn)) return true;
    return parent_ ? parent_->hasFunction(fn) : false;
}

Overloads&
Type::
function(const std::string& fn)
{
    auto it = fns_.find(fn);
    if (it == fns_.end())
        reflectError("<%s> doesn't have an immediate function <%s>", id_, fn);

    return it->second;
}

const Overloads&
Type::
function(const std::string& fn) const
{
    auto it = fns_.find(fn);
    if (it != fns_.end()) return it->second;

    if (!parent_)
        reflectError("<%s> doesn't have a function <%s>", id_, fn);

    return parent_->function(fn);
}

void
Type::
addField(const std::string& name, Field&& field)
{
    auto it = fns_.find(name);
    if (it != fns_.end()) {
        reflectError("field <%s> already exists as function <%s> in <%s>",
                field.print(), it->second.print(), id());
    }

    auto ret = fields_.emplace(name, std::move(field));
    if (!ret.second) {
        reflectError("field <%s> already exists as field <%s> in <%s>",
                field.print(), ret.first->second.print(), id());
    }
}

void
Type::
fields(std::vector<std::string>& result) const
{
    result.reserve(result.size() + fields_.size());

    for (const auto& field : fields_)
        result.push_back(field.first);

    if (parent_) parent_->fields(result);
}

std::vector<std::string>
Type::
fields() const
{
    std::vector<std::string> result;
    fields(result);

    std::sort(result.begin(), result.end());
    result.erase(std::unique(result.begin(), result.end()), result.end());

    return result;
}

bool
Type::
hasField(const std::string& field) const
{
    if (fields_.count(field)) return true;
    return parent_ ? parent_->hasField(field) : false;
}

Field&
Type::
field(const std::string& field)
{
    auto it = fields_.find(field);
    if (it == fields_.end())
        reflectError("<%s> doesn't have an immediate field <%s>", id_, field);

    return it->second;
}

const Field&
Type::
field(const std::string& field) const
{
    auto it = fields_.find(field);
    if (it != fields_.end()) return it->second;

    if (!parent_)
        reflectError("<%s> doesn't have a field <%s>", id_, field);

    return parent_->field(field);
}

bool
Type::
isPointer() const
{
    return is("pointer");
}

std::string
Type::
pointer() const
{
    if (!isPointer()) reflectError("<%s> is not a pointer", id());
    return pointer_;
}

const Type*
Type::
pointee() const
{
    if (!isPointer()) reflectError("<%s> is not a pointer", id());
    return pointee_;
}

void
Type::
setPointer(std::string pointer, const Type* pointee)
{
    if (isPointer()) reflectError("<%s> is already a pointer", id());

    addTrait("pointer");
    pointer_ = std::move(pointer);
    pointee_ = pointee;
}

Value
Type::
alloc() const
{
    return call<Value>("new");
}

namespace  {

std::vector<const Field*>
sortedFields(const std::unordered_map<std::string, Field>& fields)
{
    std::vector<const Field*> result;
    result.reserve(fields.size());

    for (const auto& field : fields)
        result.push_back(&field.second);

    std::sort(result.begin(), result.end(), [](const Field* lhs, const Field* rhs) {
                return lhs->offset() < rhs->offset();
            });

    return result;
}

} // namespace anonymous

std::string
Type::
print(size_t indent) const
{
    enum { PadInc = 4 };

    std::stringstream ss;
    std::string pad0(indent, ' ');

    indent += PadInc;
    std::string pad1(indent, ' ');
    std::string pad2(indent + PadInc, ' ');

    bool before = false;
    auto sep = [&] (bool next) {
        if (!next) return;
        if (before) ss << pad1 << "\n";
        before = next;
    };

    ss << pad0 << "type " << id_ << "\n";
    ss << pad0 << "{\n";

    sep(parent_);
    if (parent_) ss << parent_->print(indent) << "\n";

    auto hasTraits = !traits().empty();
    sep(hasTraits);
    if (hasTraits) ss << pad1 << Traits::print() << "\n";

    sep(!fields_.empty());
    for (const auto& field : sortedFields(fields_))
        ss << pad1 << field->print() << "\n";

    sep(!fns_.empty());
    for (const auto& fn : fns_) {
        ss << pad1 << fn.first << ":\n";
        ss << fn.second.print(indent + PadInc);
    }

    ss << pad0 << "}";

    return ss.str();
}

} // reflect


text:
package mud.objects.items;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.EnumSet;

import mud.ObjectFlag;

import mud.interfaces.Drinkable;
import mud.interfaces.MagicItem;
import mud.interfaces.Stackable;

import mud.magic.Spell;
import mud.misc.Effect;
import mud.objects.Item;
import mud.objects.ItemTypes;
import mud.utils.Utils;

public class Potion extends Item implements Drinkable, MagicItem, Stackable<Potion> {
	/**
	 * Flag: I
	 * ItemType: Potion
	 */

	/* minor problem in that it is silly to have a potion or a spell or both,
	 * really I should just have one. The point is that you can drink a potion
	 * to get a result. I suppose a potion of say polymorph should not allow
	 * you to choose, but that should be decided by the potion makers such
	 * that it is a potion of 'polymorph to cat' for instance.
	 */

	public Potion p;         // nested copy of itself, for implementing stacks

	private Spell spell;    // a spell the potion will cast on you
	private Effect effect;  // an effect the potion will give you

	public Potion() {
		super(-1, "Potion", "An empty glass potion bottle.");

		this.item_type = ItemTypes.POTION;

		this.drinkable = true;

		this.p = null;

		this.spell = null;
		this.effect = null;
	}

	public Potion(final Effect effect) {
		super(-1, "Potion", "A potion of " + effect.getName());

		this.item_type = ItemTypes.POTION;

		this.drinkable = true;

		this.p = null;

		this.spell = null;
		this.effect = effect;
	}

	public Potion(final Spell spell) {
		super(-1, "Potion", "A potion of " + spell.getName());

		this.item_type = ItemTypes.POTION;

		this.drinkable = true;

		this.p = null;

		this.spell = spell;
		this.effect = null;
	}

	/**
	 * Object Loading Constructor
	 *
	 * Use this only for testing purposes and loading objects into the
	 * server database, for anything else, use one of the other two constructors
	 * that have parameters.
	 *
	 *
	 * @param name
	 * @param description
	 * @param location
	 * @param tempDBREF
	 * @param stack_size
	 * @param spellName
	 */
	public Potion(int dbref, String name, final EnumSet<ObjectFlag> flags, String description, int location) {
		super(dbref, name, flags, description, location);

		this.item_type = ItemTypes.POTION;

		this.drinkable = true;

		this.p = null;

		this.spell = null;
		this.effect = null;
	}

	@Override
	public Double getWeight() {
		return 0.5;
	}

	@Override
	public void setWeight(Double newWeight) {
		// do nothing
	}

	@Override
	public List<Effect> getEffects() {
		return Collections.unmodifiableList(new ArrayList<Effect>());
	}

	public int size() {
		return stackSize();
	}

	@Override
	public int stackSize() {
		if (this.p != null) {
			return 1 + p.stackSize();
		}
		else {
			return 1;
		}
	}

	@Override
	public boolean stack(Potion object) {
		boolean result = false;

		if( this.getName().equals( object.getName() ) ) { // name equality is treated as Item equality
			if( stackSize() < Stackable.maxDepth ) {
				if ( p == null ) {
					object.setLocation( this.getDBRef() ); // the new location of the arrow in question is the old arrow
					p = object;

					result = true;
				}
				else result = p.stack(object);
			}
		}

		return result;
	}

	@Override
	public Potion split(int number) {
		if (number > 0 && stackSize() > number) {
			if (p == null) {
				return this;
			}
			else {
				Potion prev = null;
				Potion curr = this;

				int qty = 0;

				while (qty < stackSize() - number) {
					prev = curr;
					curr = curr.p;
					qty++;
				}

				prev.p = null;

				return curr;
			}
		}
		else {
			return null;
		}
	}

	@Override
	public Spell getSpell() {
		return this.spell;
	}

	@Override
	public List<Spell> getSpells() {
		return new ArrayList<Spell>();
	}

	@Override
	public Effect getEffect() {
		return this.effect;
	}

	@Override
	public String toDB() {
		final String[] output = new String[2];

		output[0] = this.stackSize() + "";          // how many potion are stacked together

		if (this.effect == null) {
			if (this.spell != null) output[1] = this.spell.getName(); // spell
			else                    output[1] = "null";
		}
		else {
			output[1] = this.effect.getName();
		}

		return super.toDB() + "#" + Utils.join(output, "#");
	}

	@Override
	public String toString() {
		return this.name + " (" + this.stackSize() + ")";
	}
}


text:
package com.ctrip.xpipe.redis.meta.server.crdt.replication;

public interface PeerMasterStateManager {

}


text:
package io.victoralbertos.example_retrofit.data;

import io.victoralbertos.example_retrofit.BuildConfig;
import io.victoralbertos.example_retrofit.domain.Repo;
import io.victoralbertos.example_retrofit.domain.User;
import io.victoralbertos.mockery.api.Mockery;
import java.util.List;
import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

public enum Repository {
  POOL;

  private RestApi restApi;
  private boolean mock = true;

  Repository() {
    initRestApi();
  }

  public void useMock() {
    this.mock = true;
    initRestApi();
  }

  public void useReal() {
    this.mock = false;
    initRestApi();
  }

  private void initRestApi() {
    if(!BuildConfig.DEBUG) {
      restApi = real();
      return;
    }

    restApi = mock ? mock() : real();
  }

  private RestApi mock() {
    return new Mockery.Builder<RestApi>()
        .mock(RestApi.class)
        .build();
  }

  private RestApi real() {
    return new Retrofit.Builder()
    .baseUrl(RestApi.URL_BASE)
    .addConverterFactory(GsonConverterFactory.create())
    .build().create(RestApi.class);
  }

  public Call<User> getUserByName(String username) {
    return restApi.getUserByName(username);
  }

  public Call<List<User>> getUsers(int lastIdQueried, int perPage) {
    return restApi.getUsers(lastIdQueried, perPage);
  }

  public Call<List<Repo>> getRepos(String username, String type, String direction) {
    return restApi.getRepos(username, type, direction);
  }

}


text:
js.extend('lsn.ext.svn.view', function (js) {

  this.View = function (app) {
    this.app = app;
  };

  var _proto = this.View.prototype = js.lang.createMethods();

  _proto.disableControls = function () {
    this.ctrls = js.dom.getElementsByTagName(js.dom.getBody(),
      ['INPUT', 'SELECT', 'BUTTON']);
    for (var i = 0, ctrl; ctrl = this.ctrls[i]; i++) {
      js.dom.setAttribute(ctrl, 'disabled', 'disabled');
    }
  };

  _proto.enableControls = function () {
    for (var i = 0, ctrl; ctrl = this.ctrls[i]; i++) {
      js.dom.removeAttribute(ctrl, 'disabled');
    }
  };

});

js.extend('lsn.ext.svn.view', function (js) {

  var CView = js.lsn.ext.svn.view.View;
  var _meta = [#:json ./metadata.hf];

  this.StatusView = function () {
    CView.apply(this, arguments);
    this.cboxStates = {};
  };

  var _proto = this.StatusView.prototype = js.lang.createMethods(CView);

  _proto.getRootElement = function () {
    return this.uiRoot || this.createUI();
  };

  _proto.createUI = function () {
    this.uiMessages = js.dom.createElement('div');
    this.uiButtons = js.dom.createElement('div');
    this.uiTbody = js.dom.createElement('tbody');
    this.uiToggleAll = js.dom.createElement('input', {
      'type': 'checkbox',
      'checked': 'checked',
      'onChange': [this.onToggleAll, this]
    });
    this.uiRoot = js.dom.createElement('div', [
      'table', [
        'thead', ['tr', [
          'th', [this.uiToggleAll],
          'th=Action',
          'th=Status',
          'th=Path',
        ]],
        this.uiTbody
      ],
      this.uiButtons,
      this.uiMessages
    ]);
    this.uiBtnCommit = js.dom.createElement('button', {
      'type': 'button',
      'value': 'action:doCommit',
      'innerHTML': "Commit changes to repository"
    });
    this.app.attachElement(this.uiBtnCommit);
    return this.uiRoot;
  };

  _proto.onToggleAll = function (event) {
    var toggleBox = js.dom.getEventTarget(event);
    var isChecked = js.dom.getValue(toggleBox);
    var checkBoxes = js.dom.getElementsByTagName(this.uiTbody, 'INPUT');
    for (var i = 0, checkBox; checkBox = checkBoxes[i]; i++) {
      if (js.dom.hasClassName(checkBox, 'status-I')) continue;
      js.dom.setValue(checkBox, isChecked ? true : false);
      this.applyCheckboxState(checkBox);
    }
  };

  _proto.clear = function () {
    js.dom.removeChildren(this.uiTbody);
    js.dom.removeChildren(this.uiMessages);
    js.dom.removeElement(this.uiBtnCommit);
    js.dom.setClassName(this.uiMessages, '');
    js.dom.setValue(this.uiToggleAll, true);
  };

  _proto.updateUI = function (data) {
    var result = data.getObject();
    var errors = [];
    var rows = [];
    for (var i = 0, item; item = result[i]; i++) {
      if (!item['status']) {
        errors.push(item['output']);
        continue;
      }
      var name = 'item:' + item['uid'];
      var wasChecked = this.cboxStates[name];
      var isChecked = js.util.defined(wasChecked)
        ? wasChecked
        : item['status'] != 'I';
      var checkBox = js.dom.createElement('input', {
        'class': 'status-' + item['status'],
        'type': 'checkbox',
        'autocomplete': 'off',
        'onclick': [this.onToggle, this, [item]],
        'name': name,
        'value': item['path']
      });
      if (isChecked) js.dom.setValue(checkBox, true);
      var pathColumn = ['A', {
        'href': item['path'],
        'innerHTML': item['path'],
        'target': '_blank'
      }];
      if (item['status'] == 'M') {
        var btnDiff = js.dom.createElement('A.action', {
          'href': '#action:doDiff:' + item['path'],
          'innerHTML': 'diff'
        });
        this.app.attachElement(btnDiff);
        pathColumn.push('#text= (', btnDiff, '#text=)');
      }

      var select = this.createActionDropdown(item['uid'], item['status']);
      var tr = js.dom.createElement('tr', {
        'class': item['status'] + (isChecked ? ' checked' : ''),
      }, [
        'td', [checkBox],
        'td', [select],
        'td', [this.getStatusText(item['status'])],
        'td', pathColumn
      ]);
      js.dom.addEventListener(select, 'change', this.onChangeAction, this, [select, tr]);
      this.onChangeAction(null, select, tr);
      rows.push(tr);
    }
    if (rows.length > 0) {
      js.dom.appendChildren(this.uiTbody, rows);
      js.dom.appendChild(this.uiButtons, this.uiBtnCommit);
    }
    if (errors.length > 0) {
      js.dom.addClassName(this.uiMessages, 'error');
      for (var i = 0; i < errors.length; i++) {
        js.dom.appendChildren(this.uiMessages,
          js.dom.createElements('CODE', ['#text', {'nodeValue': errors[i]}], 'BR')
        );
      }
    }
  };

  _proto.onChangeAction = function (event, select, tr) {
    var option = select.children[select.selectedIndex];
    var cssClass = js.dom.hasClassName(tr, 'checked') ? 'checked ' : '';
    cssClass += option.value;
    js.dom.setAttribute(tr, 'class', cssClass);
  };

  _proto.onToggle = function (event) {
    var cbox = js.dom.getEventTarget(event);
    this.applyCheckboxState(cbox);
  };

  _proto.applyCheckboxState = function (cbox) {
    var td = cbox.parentNode;
    var tr = td.parentNode;
    var isChecked = js.dom.getValue(cbox) ? true : false;
    if (isChecked) {
      js.dom.addClassName(tr, 'checked');
    } else {
      js.dom.removeClassName(tr, 'checked');
    }
    var name = js.dom.getAttribute(cbox, 'name');
    this.cboxStates[name] = isChecked;
  };

  _proto.createActionDropdown = function (id, status) {
    var options = [];
    var selected = _meta['default_action'][status] || 'skip';
    for (var i = 0, props; props = _meta['actions'][i]; i++) {
      var opt = js.dom.createElement('option.' + props.value, props);
      if (props.value == selected) {
        js.dom.setAttribute(opt, 'selected', 'selected');
      }
      options.push(opt);
    };
    return js.dom.createElement('select', {'name': 'action:' + id}, options);
  };

  _proto.getStatusText = function (status) {
    var statusMessage = _meta['status_text'][status] || 'ERROR!';
    var text = status + ' (' + statusMessage + ')';
    return js.dom.createElement('#text=' + text);
  };

});

js.extend('lsn.ext.svn.view', function (js) {

  var CView = js.lsn.ext.svn.view.View;

  this.OutputView = function () {
    CView.apply(this, arguments);
  };

  var OutputView = this.OutputView.prototype = js.lang.createMethods(CView);

  OutputView.getRootElement = function () {
    return this.uiRoot || this.createUI();
  };

  OutputView.createUI = function () {
    return this.uiRoot = js.dom.createElement('DIV.results');
  };

  OutputView.clear = function () {
    var root = this.getRootElement();
    js.dom.removeChildren(root);
  };

  OutputView.updateUI = function (data) {
    var part = typeof(data) == 'string'
      ? ['result', data]
      : data.getObject();
    var line = js.dom.createElement('DIV', [
      'PRE.' + part[0], [
        '#text', {
          'nodeValue': part[1]
        }
      ]
    ]);
    js.dom.appendChild(this.getRootElement(), line);
  }

});

js.extend('lsn.ext.svn.view', function (js) {

  var CView = js.lsn.ext.svn.view.View;

  this.DiffView = function () {
    CView.apply(this, arguments);
  };

  var DiffView = this.DiffView.prototype = js.lang.createMethods(CView);

  DiffView.getRootElement = function () {
    return this.uiRoot || this.createUI();
  };

  DiffView.createUI = function () {
    return this.uiRoot = js.dom.createElement('DIV');
  };

  DiffView.clear = function () {
    var root = this.getRootElement();
    js.dom.removeChildren(root);
  };

  DiffView.updateUI = function (data) {
    var part = typeof(data) == 'string'
      ? ['result', data]
      : data.getObject();
    var pre = null;
    if (part[0] === 'result') {
      pre = this.highlight(part[1] + "\r\n");
    } else if (part[0] === 'status') {
      pre = js.dom.createElement(
        'PRE.status', ['#text', {'nodeValue': part[1]}]
      );
    }
    if (pre) js.dom.appendChild(this.uiRoot, pre);
  };

  DiffView.highlight = function (line) {
    var pre = js.dom.createElement('PRE', ['#text', {'nodeValue': line}]);
    var classNames = ['result'];
    var isFinal = false;
    [#:for (syn) in "./syntax.hf/diff"]
    if (!isFinal && line.match([#syn/match])) {
      classNames.push('[#syn/name]');
      isFinal = '[#syn/final]' ? true : false;
    }
    [#:end for]
    js.dom.addClassNames(pre, classNames);
    return pre;
  };

});

// @namespace lsn.ext.svn.app
js.extend('lsn.ext.svn.app', function (js) {

  var CApplication = js.lsn.app.Application;

  /**
   * @class Application
   * Controller class for this extension module.
   */

  this.Application = function () {
    CApplication.apply(this);
    this.ctrls = null;
    this.diffView = new js.lsn.ext.svn.view.DiffView(this);
    this.outputView = new js.lsn.ext.svn.view.OutputView(this);
    this.statusView = new js.lsn.ext.svn.view.StatusView(this);
  };

  var _proto = this.Application.prototype = js.lang.createMethods(
    CApplication
  );

  /**
   * @function onPageLoad
   * @overrides CApplication
   */

  _proto.onPageLoad = function (event) {
    CApplication.prototype.onPageLoad.apply(this, arguments);
    this.ui.outputArea.appendChild(this.diffView.getRootElement());
    this.ui.outputArea.appendChild(this.outputView.getRootElement());
    this.ui.statusArea.appendChild(this.statusView.getRootElement());
    this.doRefresh();
  };

  /**
   * @function doToggle
   * Toggle the display of the specified element.
   */

  _proto.doToggle = function (handle, elemId) {
    js.dom.toggleDisplay(elemId);
    js.dom.toggleClassName(handle, 'sel');
  };

  /**
   * @function clearOutput
   */

  _proto.clearOutput = function () {
    this.diffView.clear();
    this.outputView.clear();
  };

  /**
   * @function doExec
   * Execute a subversion command.
   */

  _proto.doExec = function (handle, command) {
    this.clearOutput();
    var svn = new js.lsn.ext.svn.Subversion('exec', this.outputView);
    svn.submit({'command': command});
  };

  /**
   * @function doRefresh
   * Fetch the status of the working directories.
   */

  _proto.doRefresh = function (handle) {
    this.statusView.clear();
    var svn = new js.lsn.ext.svn.Subversion('status', this.statusView);
    svn.submit();
  };

  /**
   * @function doCommit
   * Commit select changes to repository.
   */

  _proto.doCommit = function (handle) {
    this.clearOutput();
    var comment = prompt('Please enter your comment:');
    if (comment === null) return;
    var svn = new js.lsn.ext.svn.Subversion('commit', this.outputView);
    var values = js.dom.getValues(this.ui.statusArea);
    values.comment = comment;
    svn.addEventListener('onSuccess', function (req) {
      this.doRefresh();
    }, this);
    svn.submit(values);
  };

  /**
   * @function doDiff
   * Execute a subversion diff of the given file.
   */

  _proto.doDiff = function (handle, path) {
    this.clearOutput();
    var svn = new js.lsn.ext.svn.Subversion('diff', this.diffView);
    svn.submit({'path': path});
  };

});

js.extend('lsn.ext.svn', function (js) {

  var CHTTPStream = js.http.Stream;

  this.Subversion = function (command, view) {
    CHTTPStream.call(this, '[#`./module.pm`]/' + command);
    this.view = view;
    this.mask = new js.lsn.Mask();
  };

  var _proto = this.Subversion.prototype = js.lang.createMethods(
    CHTTPStream
  );

  _proto.onCreate = function () {
    this.mask.show();
  };

  _proto.onComplete = function () {
    this.mask.hide();
  };

  _proto.onReceive = function (data) {
    this.view.updateUI(data);
  };

});

js.extend('local', function (js) {

  this.settings = [#:js:var ./settings.hf];
  this.config = [#:js:var ./module.pm/get_config];
  this.app = new js.lsn.ext.svn.app.Application();

});


text:
<?xml version="1.0" encoding="utf-8" ?>
<phpunit bootstrap="../vendor/autoload.php">

    <testsuites>
        <testsuite name="The project's test suite">
            <directory>./tests</directory>
        </testsuite>
    </testsuites>

    <filter>
        <whitelist processUncoveredFilesFromWhitelist="false">
            <directory suffix=".php">../src/</directory>
        </whitelist>
        <blacklist>
            <directory suffix=".php">../vendor/</directory>
            <directory suffix=".php">../tests/</directory>
        </blacklist>
    </filter>
</phpunit>


text:
/**************************************************************************//**
 * @file     PWM.c
 * @version  V1.00
 * $Revision: 4 $
 * $Date: 13/09/30 6:48p $
 * @brief    MINI51 series PWM driver source file
 *
 * @note
 * Copyright (C) 2013 Nuvoton Technology Corp. All rights reserved.
*****************************************************************************/
#include "Mini51Series.h"

/** @addtogroup MINI51_Device_Driver MINI51 Device Driver
  @{
*/

/** @addtogroup MINI51_PWM_Driver PWM Driver
  @{
*/

/** @addtogroup MINI51_PWM_EXPORTED_FUNCTIONS PWM Exported Functions
  @{
*/

/**
 * @brief This function config PWM generator and get the nearest frequency in edge aligned auto-reload mode
 * @param[in] pwm The base address of PWM module
 * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5
 * @param[in] u32Frequncy Target generator frequence
 * @param[in] u32DutyCycle Target generator duty cycle precentage. Valid range are between 0 ~ 100. 10 means 10%, 20 means 20%...
 * @return Nearest frequence clock in nano second
 * @note Since every two channels, (0 & 1), (2 & 3), (4 & 5), shares a prescaler. Call this API to configure PWM frequency may affect
 *       existing frequency of other channel.
 */
uint32_t PWM_ConfigOutputChannel (PWM_T *pwm,
                                  uint32_t u32ChannelNum,
                                  uint32_t u32Frequncy,
                                  uint32_t u32DutyCycle)
{
    uint32_t i = SystemCoreClock / u32Frequncy;
    uint8_t  u8Divider = 1, u8Prescale = 0xFF;
    uint16_t u16CNR = 0xFFFF;

    for(; u8Divider < 17; u8Divider <<= 1) {  // clk divider could only be 1, 2, 4, 8, 16
        i = (SystemCoreClock / u32Frequncy) / u8Divider;
        // If target value is larger than CNR * prescale, need to use a larger divider
        if(i > (0x10000 * 0x100))
            continue;

        // CNR = 0xFFFF + 1, get a prescaler that CNR value is below 0xFFFF
        u8Prescale = (i + 0xFFFF)/ 0x10000;

        // u8Prescale must at least be 2, otherwise the output stop
        if(u8Prescale < 3)
            u8Prescale = 2;

        i /= u8Prescale;

        if(i <= 0x10000) {
            if(i == 1)
                u16CNR = 1;     // Too fast, and PWM cannot generat expected frequency...
            else
                u16CNR = i;
            break;
        }

    }
    // Store return value here 'cos we're gonna change u8Divider & u8Prescale & u16CNR to the real value to fill into register
    i = SystemCoreClock / (u8Prescale * u8Divider * u16CNR);

    u8Prescale -= 1;
    u16CNR -= 1;
    // convert to real register value
    if(u8Divider == 1)
        u8Divider = 4;
    else if (u8Divider == 2)
        u8Divider = 0;
    else if (u8Divider == 4)
        u8Divider = 1;
    else if (u8Divider == 8)
        u8Divider = 2;
    else // 16
        u8Divider = 3;

    // every two channels share a prescaler
    PWM->PPR = (PWM->PPR & ~(PWM_PPR_CP01_Msk << ((u32ChannelNum >> 1) * 8))) | (u8Prescale << ((u32ChannelNum >> 1) * 8));
    PWM->CSR = (PWM->CSR & ~(PWM_CSR_CSR0_Msk << (4 * u32ChannelNum))) | (u8Divider << (4 * u32ChannelNum));
    PWM->PCR |= PWM_PCR_CH0MOD_Msk << (4 * u32ChannelNum);
    PWM->CMR[u32ChannelNum] = u32DutyCycle * (u16CNR + 1) / 100 - 1;
    PWM->CNR[u32ChannelNum] = u16CNR;

    return(i);
}

/**
 * @brief This function start PWM module
 * @param[in] pwm The base address of PWM module
 * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel.
 *                           Bit 0 is channel 0, bit 1 is channel 1...
 * @return None
 */
void PWM_Start (PWM_T *pwm, uint32_t u32ChannelMask)
{
    uint32_t u32Mask = 0, i;
    for(i = 0; i < PWM_CHANNEL_NUM; i ++) {
        if(u32ChannelMask & (1 << i)) {
            u32Mask |= (PWM_PCR_CH0EN_Msk << (i * 4));
        }
    }

    PWM->PCR |= u32Mask;
}

/**
 * @brief This function stop PWM module
 * @param[in] pwm The base address of PWM module
 * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel.
 *                           Bit 0 is channel 0, bit 1 is channel 1...
 * @return None
 */
void PWM_Stop (PWM_T *pwm, uint32_t u32ChannelMask)
{
    uint32_t i;
    for(i = 0; i < PWM_CHANNEL_NUM; i ++) {
        if(u32ChannelMask & (1 << i)) {
            PWM->CNR[i] = 0;
        }
    }

}

/**
 * @brief This function stop PWM generation immediately by clear channel enable bit
 * @param[in] pwm The base address of PWM module
 * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel.
 *                           Bit 0 is channel 0, bit 1 is channel 1...
 * @return None
 */
void PWM_ForceStop (PWM_T *pwm, uint32_t u32ChannelMask)
{
    uint32_t u32Mask = 0, i;
    for(i = 0; i < PWM_CHANNEL_NUM; i ++) {
        if(u32ChannelMask & (1 << i)) {
            u32Mask |= (PWM_PCR_CH0EN_Msk << (i * 4));
        }
    }

    PWM->PCR &= ~u32Mask;
}

/**
 * @brief This function enable selected channel to trigger ADC
 * @param[in] pwm The base address of PWM module
 * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5
 * @param[in] u32Condition The condition to trigger ADC. Combination of following conditions:
 *                  - \ref PWM_TRIGGER_ADC_CNTR_IS_0
 *                  - \ref PWM_TRIGGER_ADC_CNTR_IS_CMR_D
 *                  - \ref PWM_TRIGGER_ADC_CNTR_IS_CNR
 *                  - \ref PWM_TRIGGER_ADC_CNTR_IS_CMR_U
 * @return None
 */
void PWM_EnableADCTrigger (PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32Condition)
{
    if(u32ChannelNum < 4) {
        PWM->TRGCON0 = (PWM->TRGCON0 & ~((PWM_TRIGGER_ADC_CNTR_IS_0 |
                                          PWM_TRIGGER_ADC_CNTR_IS_CMR_D |
                                          PWM_TRIGGER_ADC_CNTR_IS_CNR |
                                          PWM_TRIGGER_ADC_CNTR_IS_CMR_U ) << (8 * u32ChannelNum))) | (u32Condition << (8 * u32ChannelNum));
    } else {
        PWM->TRGCON1 = (PWM->TRGCON1 & ~((PWM_TRIGGER_ADC_CNTR_IS_0 |
                                          PWM_TRIGGER_ADC_CNTR_IS_CMR_D |
                                          PWM_TRIGGER_ADC_CNTR_IS_CNR |
                                          PWM_TRIGGER_ADC_CNTR_IS_CMR_U ) << (8 * (u32ChannelNum - 4)))) | (u32Condition << (8 * (u32ChannelNum - 4)));

    }
}

/**
 * @brief This function disable selected channel to trigger ADC
 * @param[in] pwm The base address of PWM module
 * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5
 * @return None
 */
void PWM_DisableADCTrigger (PWM_T *pwm, uint32_t u32ChannelNum)
{
    if(u32ChannelNum < 4) {
            PWM->TRGCON0 = (PWM->TRGCON0 & ~((PWM_TRIGGER_ADC_CNTR_IS_0 |
                                          PWM_TRIGGER_ADC_CNTR_IS_CMR_D |
                                          PWM_TRIGGER_ADC_CNTR_IS_CNR |
                                          PWM_TRIGGER_ADC_CNTR_IS_CMR_U ) << (8 * u32ChannelNum)));
    } else {
            PWM->TRGCON1 = (PWM->TRGCON1 & ~((PWM_TRIGGER_ADC_CNTR_IS_0 |
                                          PWM_TRIGGER_ADC_CNTR_IS_CMR_D |
                                          PWM_TRIGGER_ADC_CNTR_IS_CNR |
                                          PWM_TRIGGER_ADC_CNTR_IS_CMR_U ) << (8 * (u32ChannelNum - 4))));
    }
}

/**
 * @brief This function clear selected channel trigger ADC flag
 * @param[in] pwm The base address of PWM module
 * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5
 * @param[in] u32Condition PWM triggered ADC flag to be cleared. A combination of following flags:
 *                  - \ref PWM_TRIGGER_ADC_CNTR_IS_0
 *                  - \ref PWM_TRIGGER_ADC_CNTR_IS_CMR_D
 *                  - \ref PWM_TRIGGER_ADC_CNTR_IS_CNR
 *                  - \ref PWM_TRIGGER_ADC_CNTR_IS_CMR_U
 * @return None
 */
void PWM_ClearADCTriggerFlag (PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32Condition)
{
    if(u32ChannelNum < 4) {
            PWM->TRGSTS0 |= (u32Condition << (8 * u32ChannelNum));
    } else {
            PWM->TRGSTS1 |= (u32Condition << (8 * (u32ChannelNum - 4)));
    }
}

/**
 * @brief This function get selected channel trigger ADC flag
 * @param[in] pwm The base address of PWM module
 * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5
 * @return Combination of following trigger conditions which triggered ADC
 *                  - \ref PWM_TRIGGER_ADC_CNTR_IS_0
 *                  - \ref PWM_TRIGGER_ADC_CNTR_IS_CMR_D
 *                  - \ref PWM_TRIGGER_ADC_CNTR_IS_CNR
 *                  - \ref PWM_TRIGGER_ADC_CNTR_IS_CMR_U
 */
uint32_t PWM_GetADCTriggerFlag (PWM_T *pwm, uint32_t u32ChannelNum)
{
    uint32_t u32Ret;

    if(u32ChannelNum < 4) {
            u32Ret = PWM->TRGSTS0 >> (8 * u32ChannelNum);
    } else {
            u32Ret = PWM->TRGSTS1 >> (8 * (u32ChannelNum - 4 ));
    }

    return (u32Ret & (PWM_TRIGGER_ADC_CNTR_IS_0 |
                      PWM_TRIGGER_ADC_CNTR_IS_CMR_D |
                      PWM_TRIGGER_ADC_CNTR_IS_CNR |
                      PWM_TRIGGER_ADC_CNTR_IS_CMR_U));
}

/**
 * @brief This function enable fault break of selected channels
 * @param[in] pwm The base address of PWM module
 * @param[in] u32ChannelMask Thie parameter is not used
 * @param[in] u32LevelMask Output high or low while fault break occures, each bit represent the level of a channel
 *                         while fault break occures. Bit 0 represents channel 0, bit 1 represents channel 1...
 *                         , bit 6 represnt D6, and bit 7 represents D7
 * @param[in] u32BreakSource Fault brake source, could be one of following source
 *                  - \ref PWM_FB0_EINT0
 *                  - \ref PWM_FB0_ACMP1
 *                  - \ref PWM_FB1_EINT1
 *                  - \ref PWM_FB1_ACMP0
 * @return None
 */
void PWM_EnableFaultBreak (PWM_T *pwm,
                           uint32_t u32ChannelMask,
                           uint32_t u32LevelMask,
                           uint32_t u32BreakSource)
{
    PWM->PFBCON = (u32LevelMask << PWM_PFBCON_PWMBKO0_Pos) | u32BreakSource;
}

/**
 * @brief This function clear fault break flag
 * @param[in] pwm The base address of PWM module
 * @param[in] u32BreakSource This parameter is not used
 * @return None
 * @note After fault break occured, application must clear fault breaj source before re-enable PWM output
 */
void PWM_ClearFaultBreakFlag (PWM_T *pwm, uint32_t u32BreakSource)
{
    PWM->PFBCON = PWM_PFBCON_BKF_Msk;
}

/**
 * @brief This function enables PWM output generation of selected channels
 * @param[in] pwm The base address of PWM module
 * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel.
 *                           Set bit 0 to 1 enables channel 0 output, set bit 1 to 1 enables channel 1 output...
 * @return None
 */
void PWM_EnableOutput (PWM_T *pwm, uint32_t u32ChannelMask)
{
    PWM->POE |= u32ChannelMask;
}

/**
 * @brief This function disables PWM output generation of selected channels
 * @param[in] pwm The base address of PWM module
 * @param[in] u32ChannelMask Combination of enabled channels. Each bit corresponds to a channel
 *                           Set bit 0 to 1 disables channel 0 output, set bit 1 to 1 disables channel 1 output...
 * @return None
 */
void PWM_DisableOutput (PWM_T *pwm, uint32_t u32ChannelMask)
{
    PWM->POE &= ~u32ChannelMask;
}

/**
 * @brief This function enable Dead zone of selected channel
 * @param[in] pwm The base address of PWM module
 * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5
 * @param[in] u32Duration Dead Zone length in PWM clock count, valid values are between 0~0xFF, but 0 means there is no
 *                        dead zone.
 * @return None
 */
void PWM_EnableDeadZone (PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32Duration)
{
    // every two channels shares the same setting
    u32ChannelNum >>= 1;
    // set duration
    PWM->PDZIR = (PWM->PDZIR & ~(PWM_DZIR_DZI01_Msk << (8 * u32ChannelNum))) | (u32Duration << (8 * u32ChannelNum));
    // enable dead zone
    PWM->PCR |= (PWM_PCR_DZEN01_Msk << u32ChannelNum);
}

/**
 * @brief This function disable Dead zone of selected channel
 * @param[in] pwm The base address of PWM module
 * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5
 * @return None
 */
void PWM_DisableDeadZone (PWM_T *pwm, uint32_t u32ChannelNum)
{
    // every two channels shares the same setting
    u32ChannelNum >>= 1;
    // enable dead zone
    PWM->PCR &= ~(PWM_PCR_DZEN01_Msk << u32ChannelNum);
}

/**
 * @brief This function enable duty interrupt of selected channel
 * @param[in] pwm The base address of PWM module
 * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5
 * @param[in] u32IntDutyType This parameter is not used
 * @return None
 */
void PWM_EnableDutyInt (PWM_T *pwm, uint32_t u32ChannelNum, uint32_t u32IntDutyType)
{
    PWM->PIER |= (PWM_PIER_PWMDIE0_Msk << u32ChannelNum);
}

/**
 * @brief This function disable duty interrupt of selected channel
 * @param[in] pwm The base address of PWM module
 * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5
 * @return None
 */
void PWM_DisableDutyInt (PWM_T *pwm, uint32_t u32ChannelNum)
{
    PWM->PIER &= ~(PWM_PIER_PWMDIE0_Msk << u32ChannelNum);
}

/**
 * @brief This function clears duty interrupt flag of selected channel
 * @param[in] pwm The base address of PWM module
 * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5
 * @return None
 */
void PWM_ClearDutyIntFlag (PWM_T *pwm, uint32_t u32ChannelNum)
{
     PWM->PIIR &= ~(PWM_PIIR_PWMDIF0_Msk << u32ChannelNum);
}

/**
 * @brief This function get duty interrupt flag of selected channel
 * @param[in] pwm The base address of PWM module
 * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5
 * @return Duty interrupt flag of specified channel
 * @retval 0 Duty interrupt did not occured
 * @retval 1 Duty interrupt occured
 */
uint32_t PWM_GetDutyIntFlag (PWM_T *pwm, uint32_t u32ChannelNum)
{
     return(PWM->PIIR & (PWM_PIIR_PWMDIF0_Msk << u32ChannelNum) ? 1 : 0);
}

/**
 * @brief This function enable fault brake interrupt
 * @param[in] pwm The base address of PWM module
 * @param[in] u32BreakSource This parameter is not used
 * @return None
 */
void PWM_EnableFaultBreakInt (PWM_T *pwm, uint32_t u32BreakSource)
{
    PWM->PIER |= PWM_PIER_BRKIE_Msk;
}

/**
 * @brief This function disable fault brake interrupt
 * @param[in] pwm The base address of PWM module
 * @param[in] u32BreakSource This parameter is not used
 * @return None
 */
void PWM_DisableFaultBreakInt (PWM_T *pwm, uint32_t u32BreakSource)
{
    PWM->PIER &= ~PWM_PIER_BRKIE_Msk;
}

/**
 * @brief This function clear fault brake interrupt of selected source
 * @param[in] pwm The base address of PWM module
 * @param[in] u32BreakSource Fault break source, could be either
 *                  - \ref PWM_PIIR_BKF0_Msk, or
 *                  - \ref PWM_PIIR_BKF1_Msk
 * @return None
 */
void PWM_ClearFaultBreakIntFlag (PWM_T *pwm, uint32_t u32BreakSource)
{
    PWM->PIIR = u32BreakSource;
}

/**
 * @brief This function get fault brake interrupt of selected source
 * @param[in] pwm The base address of PWM module
 * @param[in] u32BreakSource Fault break source, could be either
 *                  - \ref PWM_PIIR_BKF0_Msk, or
 *                  - \ref PWM_PIIR_BKF1_Msk
 * @return Fault break interrupt flag of specified source
 * @retval 0 Fault break interrupt did not occured
 * @retval 1 Fault break interrupt occured
 */
uint32_t PWM_GetFaultBreakIntFlag (PWM_T *pwm, uint32_t u32BreakSource)
{
    return (PWM->PIIR & u32BreakSource ? 1 : 0);
}

/**
 * @brief This function enable period interrupt of selected channel
 * @param[in] pwm The base address of PWM module
 * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5
 * @param[in] u32IntPeriodType Period interrupt type, could be either
 *              - \ref PWM_PERIOD_INT_UNDERFLOW
 *              - \ref PWM_PERIOD_INT_MATCH_CNR
 * @return None
 * @note All channels share the same period interrupt type setting.
 */
void PWM_EnablePeriodInt (PWM_T *pwm, uint32_t u32ChannelNum,  uint32_t u32IntPeriodType)
{
    PWM->PIER = (PWM->PIER & ~PWM_PIER_INT_TYPE_Msk) | (PWM_PIER_PWMPIE0_Msk << u32ChannelNum) | u32IntPeriodType;
}

/**
 * @brief This function disable period interrupt of selected channel
 * @param[in] pwm The base address of PWM module
 * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5
 * @return None
 */
void PWM_DisablePeriodInt (PWM_T *pwm, uint32_t u32ChannelNum)
{
    PWM->PIER &= ~(PWM_PIER_PWMPIE0_Msk << u32ChannelNum);
}

/**
 * @brief This function clear period interrupt of selected channel
 * @param[in] pwm The base address of PWM module
 * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5
 * @return None
 */
void PWM_ClearPeriodIntFlag (PWM_T *pwm, uint32_t u32ChannelNum)
{
    PWM->PIIR |= (PWM_PIIR_PWMPIF0_Msk << u32ChannelNum);
}

/**
 * @brief This function get period interrupt of selected channel
 * @param[in] pwm The base address of PWM module
 * @param[in] u32ChannelNum PWM channel number. Valid values are between 0~5
 * @return Period interrupt flag of specified channel
 * @retval 0 Period interrupt did not occured
 * @retval 1 Period interrupt occured
 */
uint32_t PWM_GetPeriodIntFlag (PWM_T *pwm, uint32_t u32ChannelNum)
{
    return(PWM->PIIR & (PWM_PIIR_PWMPIF0_Msk << u32ChannelNum) ? 1 : 0);
}

/*@}*/ /* end of group MINI51_PWM_EXPORTED_FUNCTIONS */

/*@}*/ /* end of group MINI51_PWM_Driver */

/*@}*/ /* end of group MINI51_Device_Driver */

/*** (C) COPYRIGHT 2013 Nuvoton Technology Corp. ***/


text:
class AcDbRegion: public  AcDbEntity
{
public:
    AcDbRegion();
    virtual ~AcDbRegion();
    ACDB_DECLARE_MEMBERS(AcDbRegion);

    static
    Acad::ErrorStatus createFromCurves(const AcDbVoidPtrArray& curveSegments,
                                       AcDbVoidPtrArray& regions);

    virtual Acad::ErrorStatus getPerimeter(double&) const;
    virtual Acad::ErrorStatus getArea(double& regionArea) const;

    virtual void*             ASMBodyCopy(bool bDeepCopy = false) const; // INTERNAL USE ONLY
    virtual void const *      getLockedASMBody();                        // INTERNAL USE ONLY
    virtual void              unlockASMBody();                           // INTERNAL USE ONLY
    virtual void*             getLockedWritableASMBody();                // INTERNAL USE ONLY
    virtual void              commitWritableASMBody();                   // INTERNAL USE ONLY
    virtual Acad::ErrorStatus setASMBody(const void* modelerBody);       // INTERNAL USE ONLY

    virtual Acad::ErrorStatus getAreaProp(
                                 const AcGePoint3d&  origin,
                                 const AcGeVector3d& xAxis,
                                 const AcGeVector3d& yAxis,
                                 double&             perimeter,
                                 double&             area,
                                 AcGePoint2d&        centroid,
                                 double              momInertia[2],
                                 double&             prodInertia,
                                 double              prinMoments[2],
                                 AcGeVector2d        prinAxes[2],
                                 double              radiiGyration[2],
                                 AcGePoint2d&        extentsLow,
                                 AcGePoint2d&        extentsHigh)const;

    virtual Acad::ErrorStatus getPlane(AcGePlane& regionPlane) const;

    ACDB_PORT virtual void dragStatus(const AcDb::DragStat) override;

    virtual Adesk::Boolean    isNull () const;
    virtual Acad::ErrorStatus getNormal(AcGeVector3d&) const;

    virtual AcDbSubentId      internalSubentId      (void* ent) const;                // INTERNAL USE ONLY
    virtual void*             internalSubentPtr     (const AcDbSubentId& id) const;   // INTERNAL USE ONLY

    virtual Acad::ErrorStatus booleanOper(AcDb::BoolOperType operation, AcDbRegion* otherRegion);

    virtual Adesk::UInt32 numChanges() const;

    ACDB_PORT virtual bool usesGraphicsCache();

protected:

    virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const override;
};

#pragma pack(pop)

#endif


text:
package android.filterfw.core;

import android.filterfw.core.Filter;
import android.filterfw.core.Scheduler;

/**
 * @hide
 */
public class SimpleScheduler extends Scheduler {

    public SimpleScheduler(FilterGraph graph) {
        super(graph);
    }

    @Override
    public void reset() {
    }

    @Override
    public Filter scheduleNextNode() {
        for (Filter filter : getGraph().getFilters()) {
            if (filter.canProcess())
                return filter;
        }
        return null;
    }

}


text:
package object

import (
	"nimona.io/pkg/crypto"
)

type (
	PolicyType       string
	PolicyAction     string
	PolicyEffect     string
	EvaluationResult string

	// Policy for object metadata
	Policy struct {
		Name      string             `nimona:"name:s"`
		Type      PolicyType         `nimona:"type:s"`
		Subjects  []crypto.PublicKey `nimona:"subjects:as"`
		Resources []string           `nimona:"resources:as"`
		Actions   []PolicyAction     `nimona:"actions:as"`
		Effect    PolicyEffect       `nimona:"effect:s"`
	}

	// Policies
	Policies []Policy

	// evaluation state
	evaluation struct {
		// target
		subject  crypto.PublicKey
		resource string
		action   PolicyAction
		// result
		explicitMatches int
		effect          EvaluationResult
	}
)

const (
	// Policy types
	SignaturePolicy PolicyType = "signature"

	// Policy actions
	ReadAction PolicyAction = "read"

	// Policy effects
	AllowEffect PolicyEffect = "allow"
	DenyEffect  PolicyEffect = "deny"

	// Policy Evaluation results
	Deny  EvaluationResult = "deny"
	Allow EvaluationResult = "allow"
)

func (p Policy) Evaluate(
	subject crypto.PublicKey,
	resource string,
	action PolicyAction,
) EvaluationResult {
	e := &evaluation{
		subject:  subject,
		resource: resource,
		action:   action,
		effect:   Allow,
	}
	e.Process(p)
	return e.effect
}

func (ps Policies) Evaluate(
	subject crypto.PublicKey,
	resource string,
	action PolicyAction,
) EvaluationResult {
	e := &evaluation{
		subject:  subject,
		resource: resource,
		action:   action,
		effect:   Allow,
	}
	for _, p := range ps {
		e.Process(p)
	}
	return e.effect
}

func (e *evaluation) Process(
	p Policy,
) {
	explicitMatches := 0
	subjectMatches := len(p.Subjects) == 0
	if len(p.Subjects) > 0 {
		for _, s := range p.Subjects {
			if e.subject.Equals(s) {
				explicitMatches++
				subjectMatches = true
				break
			}
		}
	}

	resourceMatches := len(p.Resources) == 0
	if len(p.Resources) > 0 {
		for _, s := range p.Resources {
			if e.resource == s {
				explicitMatches++
				resourceMatches = true
				break
			}
		}
	}

	actionMatches := len(p.Actions) == 0
	if len(p.Actions) > 0 {
		for _, s := range p.Actions {
			if e.action == s {
				explicitMatches++
				actionMatches = true
				break
			}
		}
	}

	policyMatched := subjectMatches && resourceMatches && actionMatches
	if policyMatched {
		if explicitMatches >= e.explicitMatches {
			e.effect = EvaluationResult(p.Effect)
			e.explicitMatches = explicitMatches
		}
	}
}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <string name="app_name">Ecoteck Remote Control</string>

</resources>


text:
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeFamilies #-}

module Database.Esqueleto.Experimental.ToAlias
    where

import Database.Esqueleto.Internal.Internal hiding (From, from, on)
import Database.Esqueleto.Internal.PersistentImport

{-# DEPRECATED ToAliasT "This type alias doesn't do anything. Please delete it. Will be removed in the next release." #-}
type ToAliasT a = a

-- Tedious tuple magic
class ToAlias a where
    toAlias :: a -> SqlQuery a

instance ToAlias (SqlExpr (Value a)) where
    toAlias e@(ERaw m f)
      | Just _ <- sqlExprMetaAlias m = pure e
      | otherwise = do
            ident <- newIdentFor (DBName "v")
            pure $ ERaw noMeta{sqlExprMetaAlias = Just ident} f

instance ToAlias (SqlExpr (Entity a)) where
    toAlias e@(ERaw m f)
      | Just _ <- sqlExprMetaAlias m = pure e
      | otherwise = do
           ident <- newIdentFor (DBName "v")
           pure $ ERaw m{sqlExprMetaIsReference = False, sqlExprMetaAlias = Just ident} f

instance ToAlias (SqlExpr (Maybe (Entity a))) where
    -- FIXME: Code duplication because the compiler doesnt like half final encoding
    toAlias e@(ERaw m f)
      | Just _ <- sqlExprMetaAlias m = pure e
      | otherwise = do
           ident <- newIdentFor (DBName "v")
           pure $ ERaw m{sqlExprMetaIsReference = False, sqlExprMetaAlias = Just ident} f

instance (ToAlias a, ToAlias b) => ToAlias (a,b) where
    toAlias (a,b) = (,) <$> toAlias a <*> toAlias b

instance ( ToAlias a
         , ToAlias b
         , ToAlias c
         ) => ToAlias (a,b,c) where
    toAlias x = to3 <$> (toAlias $ from3 x)

instance ( ToAlias a
         , ToAlias b
         , ToAlias c
         , ToAlias d
         ) => ToAlias (a,b,c,d) where
    toAlias x = to4 <$> (toAlias $ from4 x)

instance ( ToAlias a
         , ToAlias b
         , ToAlias c
         , ToAlias d
         , ToAlias e
         ) => ToAlias (a,b,c,d,e) where
    toAlias x = to5 <$> (toAlias $ from5 x)

instance ( ToAlias a
         , ToAlias b
         , ToAlias c
         , ToAlias d
         , ToAlias e
         , ToAlias f
         ) => ToAlias (a,b,c,d,e,f) where
    toAlias x = to6 <$> (toAlias $ from6 x)

instance ( ToAlias a
         , ToAlias b
         , ToAlias c
         , ToAlias d
         , ToAlias e
         , ToAlias f
         , ToAlias g
         ) => ToAlias (a,b,c,d,e,f,g) where
    toAlias x = to7 <$> (toAlias $ from7 x)

instance ( ToAlias a
         , ToAlias b
         , ToAlias c
         , ToAlias d
         , ToAlias e
         , ToAlias f
         , ToAlias g
         , ToAlias h
         ) => ToAlias (a,b,c,d,e,f,g,h) where
    toAlias x = to8 <$> (toAlias $ from8 x)


text:
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.jetbrains.python.codeInsight.stdlib;

import com.intellij.openapi.diagnostic.Logger;
import com.jetbrains.python.PythonHelpersLocator;
import org.jetbrains.annotations.Nullable;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.Collection;
import java.util.Set;
import java.util.stream.Collectors;

/**
 * @author vlan
 */
public final class PyStdlibUtil {
  @Nullable private static final Set<String> PACKAGES = loadStdlibPackagesList();

  private PyStdlibUtil() {
  }

  @Nullable
  public static Collection<String> getPackages() {
    return PACKAGES;
  }

  @Nullable
  private static Set<String> loadStdlibPackagesList() {
    final Logger log = Logger.getInstance(PyStdlibUtil.class.getName());
    final String helperPath = PythonHelpersLocator.getHelperPath("/tools/stdlib_packages.txt");
    try (BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(helperPath), StandardCharsets.UTF_8))) {
      return reader.lines().collect(Collectors.toSet());
    }
    catch (IOException e) {
      log.error("Cannot read list of standard library packages: " + e.getMessage());
    }
    return null;
  }
}


text:
{% extends 'password/base.html' %}
{% load i18n %}
{% block title %}Change password{% endblock %}

{% block page_header %}
  {% include "horizon/common/_page_header.html" with title=_("Change password") %}
{% endblock page_header %}

{% block settings_main %}
  {% include "password/password.html" %}
{% endblock %}


text:
import _ from 'lodash';
import IndexedArray from 'ui/indexed_array';
import AggTypesAggParamsProvider from 'ui/agg_types/agg_params';
export default function VisTypeSchemasFactory(Private) {
  let AggParams = Private(AggTypesAggParamsProvider);

  function Schemas(schemas) {
    let self = this;

    _(schemas || [])
    .map(function (schema) {
      if (!schema.name) throw new Error('all schema must have a unique name');

      if (schema.name === 'split') {
        schema.params = [
          {
            name: 'row',
            default: true
          }
        ];
        schema.editor = require('plugins/kbn_vislib_vis_types/controls/rows_or_columns.html');
      } else if (schema.name === 'radius') {
        schema.editor = require('plugins/kbn_vislib_vis_types/controls/radius_ratio_option.html');
      }

      _.defaults(schema, {
        min: 0,
        max: Infinity,
        group: 'buckets',
        title: schema.name,
        aggFilter: '*',
        editor: false,
        params: [],
        deprecate: false
      });

      // convert the params into a params registry
      schema.params = new AggParams(schema.params);

      return schema;
    })
    .tap(function (schemas) {
      self.all = new IndexedArray({
        index: ['name'],
        group: ['group'],
        immutable: true,
        initialSet: schemas
      });
    })
    .groupBy('group')
    .forOwn(function (group, groupName) {
      self[groupName] = new IndexedArray({
        index: ['name'],
        immutable: true,
        initialSet: group
      });
    })
    .commit();
  }

  return Schemas;
};


text:
#include <wx/wxprec.h>
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif

#include <wx/fileconf.h>
#include <wx/gbsizer.h>
#include <wx/notifmsg.h>

#include "../parser/LogFileUtility.h"

#include "../modules/ExpModule.h"
#include "../modules/ApModule.h"
#include "../modules/KinahModule.h"
#include "../modules/SoulHealerModule.h"
#include "../modules/GpModule.h"

#include "../modules/HuntingModule.h"
#include "../modules/ItemAcquisitionModule.h"

#include "../modules/ProfessionModule.h"

#include "ModuleWindowSelectionFrame.h"

#include "ExpFrame.h"
#include "ApFrame.h"
#include "GpFrame.h"
#include "KinahFrame.h"

#include "ProfessionLevelingFrame.h"
#include "ProfessionFrame.h"

#include "ItemAcquisitionFrame.h"
#include "ItemConsumptionFrame.h"
#include "ItemBundleFrame.h"
#include "ItemRollsFrame.h"

#include "MobKillsFrame.h"
#include "PlayerKillsFrame.h"

#include "../lookups/ExpChart60.h"
#include "../lookups/ExpChartKR51.h"
#include "../lookups/ExpChartNA40.h"
#include "../lookups/ExpChartEU49.h"

#include "TestFrame.h"

#define APP_TITLE "Aion Grind Meter"
#define APP_VERSION "2.4.7"

#define MAINFRAME_WIDTH 230
#define MAINFRAME_HEIGHT 100
#define MAINPANEL_HEIGHT 40

#define LOG_FILE "Chat.log"

#define AION_BIN_32 "/bin32/AION.bin"
#define AION_BIN_64 "/bin64/AION.bin"

#define INI_FILE "aiongrindmeter.ini"

enum
{
    TIMER_ID,
	WINDOW_MENU_BUTTON_ID
};

class MainFrame: public wxFrame
{

public:
	MainFrame(string& aionPath, const wxPoint& pos);
	//MainFrame(const wxString& title, const wxPoint& pos, const wxSize& size);

	wxDECLARE_EVENT_TABLE();
private:
	bool started;

	string aionPath;
	ExpModule expModule;
	ApModule apModule;
	GpModule gpModule;
	KinahModule kinahModule;
	SoulHealerModule soulHealerModule;

	HuntingModule huntingModule;
	ItemAcquisitionModule itemAcquisitionModule;

	ProfessionModule professionModule;

	LogFileUtility logFileUtility;

	ApChart apChart;

	wxTimer timer;

	ModuleWindowSelectionFrame* moduleWindowSelectionFrame;

	ExpFrame* expFrame;
	ApFrame* apFrame;
	GpFrame* gpFrame;
	KinahFrame* kinahFrame;

	ProfessionLevelingFrame* professionLevelingFrame;
	ProfessionFrame* gatherFrame;
	ProfessionFrame* craftFrame;

	ItemAcquisitionFrame* itemAcquisitionFrame;
	ItemConsumptionFrame* itemConsumptionFrame;
	ItemBundleFrame* itemBundleFrame;
	ItemRollsFrame* itemRollsFrame;

	MobKillsFrame* mobKillsFrame;
	PlayerKillsFrame* playerKillsFrame;

	TestFrame* testFrame;
	/*
	Frame* expFrame;
	Frame* apFrame;
	*/

	wxBoxSizer* parentSizer;
	wxPanel* panel;

	wxButton* windowMenuButton;

	void OnTimer(wxTimerEvent& event);
	void OnWindowMenuButton(wxCommandEvent& event) {moduleWindowSelectionFrame->Show();}

	void OnClose(wxCloseEvent& event);

	int ticksPerRefresh;
	int tickCounter;

	SystemCFG systemCFG;

};


text:
package org.apache.flink.runtime.rest.util;

import org.apache.flink.api.common.JobID;
import org.apache.flink.runtime.concurrent.FutureUtils;
import org.apache.flink.runtime.executiongraph.AccessExecutionGraph;
import org.apache.flink.runtime.rest.handler.legacy.ExecutionGraphCache;
import org.apache.flink.runtime.webmonitor.RestfulGateway;

import java.util.concurrent.CompletableFuture;

/** {@link ExecutionGraphCache} which does nothing. */
public enum NoOpExecutionGraphCache implements ExecutionGraphCache {
    INSTANCE;

    @Override
    public int size() {
        return 0;
    }

    @Override
    public CompletableFuture<AccessExecutionGraph> getExecutionGraph(
            JobID jobId, RestfulGateway restfulGateway) {
        return FutureUtils.completedExceptionally(
                new UnsupportedOperationException(
                        "NoOpExecutionGraphCache does not support to retrieve execution graphs"));
    }

    @Override
    public void cleanup() {}

    @Override
    public void close() {}
}


text:
class GenericTorchObject:

    def __str__(self):
        retval = self.__class__.__name__ + " {"

        for key, value in self.__dict__.items():
            retval += ' ' + str(key) + "=" + str(value)

        retval += " }"

        return retval


text:
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
 * Form edit view
 *
 * @package PhpMyAdmin-Setup
 */

if (!defined('PHPMYADMIN')) {
    exit;
}

/**
 * Core libraries.
 */
require_once './libraries/config/Form.class.php';
require_once './libraries/config/FormDisplay.class.php';
require_once './setup/lib/form_processing.lib.php';

require './libraries/config/setup.forms.php';

$formset_id = PMA_isValid($_GET['formset'], 'scalar') ? $_GET['formset'] : null;
$mode = isset($_GET['mode']) ? $_GET['mode'] : null;
if (! isset($forms[$formset_id]) || substr($formset_id, 0, 1) === '_') {
    PMA_fatalError(__('Incorrect formset, check $formsets array in setup/frames/form.inc.php'));
}

if (isset($GLOBALS['strConfigFormset_' . $formset_id])) {
    echo '<h2>' . $GLOBALS['strConfigFormset_' . $formset_id] . '</h2>';
}
$form_display = new FormDisplay();
foreach ($forms[$formset_id] as $form_name => $form) {
    $form_display->registerForm($form_name, $form);
}
process_formset($form_display);
?>


text:
extern "C" {
#endif

#define _STR(A) #A
#define STR(A) _STR(A)
#define ASSERT(A) if(!(A)) fail(__FILE__  " " STR(__LINE__));

#define malloc test_malloc
#define free test_free

void *test_malloc(int size);
void test_free(void *);
void fail(const char *s);

#ifdef __cplusplus
}
#endif

#endif

#endif


text:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>privacy on Website of RRMaximiliano</title>
    <link>https://example.com/tags/privacy/</link>
    <description>Recent content in privacy on Website of RRMaximiliano</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Sun, 10 Mar 2019 00:00:00 +0000</lastBuildDate><atom:link href="https://example.com/tags/privacy/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Rich Content</title>
      <link>https://example.com/post/rich-content/</link>
      <pubDate>Sun, 10 Mar 2019 00:00:00 +0000</pubDate>

      <guid>https://example.com/post/rich-content/</guid>
      <description>
Hugo ships with several Built-in Shortcodes for rich content, along with a Privacy Config and a set of Simple Shortcodes that enable static and no-JS versions of various social media embeds.
</description>
    </item>

  </channel>
</rss>


text:
<?php

require_once HTML_PURIFIER_LIB_PATH . '/HTMLPurifier/DefinitionCache/Serializer.php';
require_once HTML_PURIFIER_LIB_PATH . '/HTMLPurifier/DefinitionCache/Null.php';

require_once HTML_PURIFIER_LIB_PATH . '/HTMLPurifier/DefinitionCache/Decorator.php';
require_once HTML_PURIFIER_LIB_PATH . '/HTMLPurifier/DefinitionCache/Decorator/Memory.php';
require_once HTML_PURIFIER_LIB_PATH . '/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php';

/**
 * Abstract class representing Definition cache managers that implements
 * useful common methods and is a factory.
 * @todo Get some sort of versioning variable so the library can easily
 *       invalidate the cache with a new version
 * @todo Make the test runner cache aware and allow the user to easily
 *       flush the cache
 * @todo Create a separate maintenance file advanced users can use to
 *       cache their custom HTMLDefinition, which can be loaded
 *       via a configuration directive
 * @todo Implement memcached
 */
class HTMLPurifier_DefinitionCache
{

    var $type;

    /**
     * @param $name Type of definition objects this instance of the
     *      cache will handle.
     */
    function HTMLPurifier_DefinitionCache($type) {
        $this->type = $type;
    }

    /**
     * Generates a unique identifier for a particular configuration
     * @param Instance of HTMLPurifier_Config
     */
    function generateKey($config) {
        return $config->version . '-' . // possibly replace with function calls
               $config->getBatchSerial($this->type) . '-' .
               $config->get($this->type, 'DefinitionRev');
    }

    /**
     * Tests whether or not a key is old with respect to the configuration's
     * version and revision number.
     * @param $key Key to test
     * @param $config Instance of HTMLPurifier_Config to test against
     */
    function isOld($key, $config) {
        if (substr_count($key, '-') < 2) return true;
        list($version, $hash, $revision) = explode('-', $key, 3);
        $compare = version_compare($version, $config->version);
        // version mismatch, is always old
        if ($compare != 0) return true;
        // versions match, ids match, check revision number
        if (
            $hash == $config->getBatchSerial($this->type) &&
            $revision < $config->get($this->type, 'DefinitionRev')
        ) return true;
        return false;
    }

    /**
     * Checks if a definition's type jives with the cache's type
     * @note Throws an error on failure
     * @param $def Definition object to check
     * @return Boolean true if good, false if not
     */
    function checkDefType($def) {
        if ($def->type !== $this->type) {
            trigger_error("Cannot use definition of type {$def->type} in cache for {$this->type}");
            return false;
        }
        return true;
    }

    /**
     * Adds a definition object to the cache
     */
    function add($def, $config) {
        trigger_error('Cannot call abstract method', E_USER_ERROR);
    }

    /**
     * Unconditionally saves a definition object to the cache
     */
    function set($def, $config) {
        trigger_error('Cannot call abstract method', E_USER_ERROR);
    }

    /**
     * Replace an object in the cache
     */
    function replace($def, $config) {
        trigger_error('Cannot call abstract method', E_USER_ERROR);
    }

    /**
     * Retrieves a definition object from the cache
     */
    function get($config) {
        trigger_error('Cannot call abstract method', E_USER_ERROR);
    }

    /**
     * Removes a definition object to the cache
     */
    function remove($config) {
        trigger_error('Cannot call abstract method', E_USER_ERROR);
    }

    /**
     * Clears all objects from cache
     */
    function flush($config) {
        trigger_error('Cannot call abstract method', E_USER_ERROR);
    }

    /**
     * Clears all expired (older version or revision) objects from cache
     * @note Be carefuly implementing this method as flush. Flush must
     *       not interfere with other Definition types, and cleanup()
     *       should not be repeatedly called by userland code.
     */
    function cleanup($config) {
        trigger_error('Cannot call abstract method', E_USER_ERROR);
    }
}