text:
package org.apache.hadoop.yarn.server.nodemanager.containermanager.monitor;

import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.metrics2.MetricsCollector;
import org.apache.hadoop.metrics2.MetricsInfo;
import org.apache.hadoop.metrics2.MetricsSource;
import org.apache.hadoop.metrics2.MetricsSystem;
import org.apache.hadoop.metrics2.annotation.Metric;
import org.apache.hadoop.metrics2.annotation.Metrics;
import org.apache.hadoop.metrics2.lib.DefaultMetricsSystem;
import org.apache.hadoop.metrics2.lib.MetricsRegistry;
import org.apache.hadoop.metrics2.lib.MutableGaugeInt;
import org.apache.hadoop.metrics2.lib.MutableStat;
import org.apache.hadoop.yarn.api.records.ContainerId;

import java.util.HashMap;
import java.util.Map;
import java.util.Timer;
import java.util.TimerTask;

import static org.apache.hadoop.metrics2.lib.Interns.info;

@InterfaceAudience.Private
@Metrics(context="container")
public class ContainerMetrics implements MetricsSource {

  public static final String PMEM_LIMIT_METRIC_NAME = "pMemLimit";
  public static final String VMEM_LIMIT_METRIC_NAME = "vMemLimit";
  public static final String VCORE_LIMIT_METRIC_NAME = "vCoreLimit";
  public static final String PMEM_USAGE_METRIC_NAME = "pMemUsage";

  @Metric
  public MutableStat pMemMBsStat;

  @Metric
  public MutableGaugeInt pMemLimitMbs;

  @Metric
  public MutableGaugeInt vMemLimitMbs;

  @Metric
  public MutableGaugeInt cpuVcores;

  static final MetricsInfo RECORD_INFO =
      info("ContainerResource", "Resource limit and usage by container");

  public static final MetricsInfo PROCESSID_INFO =
      info("ContainerPid", "Container Process Id");

  final MetricsInfo recordInfo;
  final MetricsRegistry registry;
  final ContainerId containerId;
  final MetricsSystem metricsSystem;

  // Metrics publishing status
  private long flushPeriodMs;
  private boolean flushOnPeriod = false; // true if period elapsed
  private boolean finished = false; // true if container finished
  private boolean unregister = false; // unregister
  private Timer timer; // lazily initialized

  /**
   * Simple metrics cache to help prevent re-registrations.
   */
  protected final static Map<ContainerId, ContainerMetrics>
      usageMetrics = new HashMap<>();

  ContainerMetrics(
      MetricsSystem ms, ContainerId containerId, long flushPeriodMs) {
    this.recordInfo =
        info(sourceName(containerId), RECORD_INFO.description());
    this.registry = new MetricsRegistry(recordInfo);
    this.metricsSystem = ms;
    this.containerId = containerId;
    this.flushPeriodMs = flushPeriodMs;
    scheduleTimerTaskIfRequired();

    this.pMemMBsStat = registry.newStat(
        PMEM_USAGE_METRIC_NAME, "Physical memory stats", "Usage", "MBs", true);
    this.pMemLimitMbs = registry.newGauge(
        PMEM_LIMIT_METRIC_NAME, "Physical memory limit in MBs", 0);
    this.vMemLimitMbs = registry.newGauge(
        VMEM_LIMIT_METRIC_NAME, "Virtual memory limit in MBs", 0);
    this.cpuVcores = registry.newGauge(
        VCORE_LIMIT_METRIC_NAME, "CPU limit in number of vcores", 0);
  }

  ContainerMetrics tag(MetricsInfo info, ContainerId containerId) {
    registry.tag(info, containerId.toString());
    return this;
  }

  static String sourceName(ContainerId containerId) {
    return RECORD_INFO.name() + "_" + containerId.toString();
  }

  public static ContainerMetrics forContainer(
      ContainerId containerId, long flushPeriodMs) {
    return forContainer(
        DefaultMetricsSystem.instance(), containerId, flushPeriodMs);
  }

  synchronized static ContainerMetrics forContainer(
      MetricsSystem ms, ContainerId containerId, long flushPeriodMs) {
    ContainerMetrics metrics = usageMetrics.get(containerId);
    if (metrics == null) {
      metrics = new ContainerMetrics(
          ms, containerId, flushPeriodMs).tag(RECORD_INFO, containerId);

      // Register with the MetricsSystems
      if (ms != null) {
        metrics =
            ms.register(sourceName(containerId),
                "Metrics for container: " + containerId, metrics);
      }
      usageMetrics.put(containerId, metrics);
    }

    return metrics;
  }

  @Override
  public synchronized void getMetrics(MetricsCollector collector, boolean all) {
    //Container goes through registered -> finished -> unregistered.
    if (unregister) {
      metricsSystem.unregisterSource(recordInfo.name());
      usageMetrics.remove(containerId);
      return;
    }

    if (finished || flushOnPeriod) {
      registry.snapshot(collector.addRecord(registry.info()), all);
    }

    if (finished) {
      this.unregister = true;
    } else if (flushOnPeriod) {
      flushOnPeriod = false;
      scheduleTimerTaskIfRequired();
    }
  }

  public synchronized void finished() {
    this.finished = true;
    if (timer != null) {
      timer.cancel();
      timer = null;
    }
  }

  public void recordMemoryUsage(int memoryMBs) {
    this.pMemMBsStat.add(memoryMBs);
  }

  public void recordProcessId(String processId) {
    registry.tag(PROCESSID_INFO, processId);
  }

  public void recordResourceLimit(int vmemLimit, int pmemLimit, int cpuVcores) {
    this.vMemLimitMbs.set(vmemLimit);
    this.pMemLimitMbs.set(pmemLimit);
    this.cpuVcores.set(cpuVcores);
  }

  private synchronized void scheduleTimerTaskIfRequired() {
    if (flushPeriodMs > 0) {
      // Lazily initialize timer
      if (timer == null) {
        this.timer = new Timer("Metrics flush checker", true);
      }
      TimerTask timerTask = new TimerTask() {
        @Override
        public void run() {
          synchronized (ContainerMetrics.this) {
            if (!finished) {
              flushOnPeriod = true;
            }
          }
        }
      };
      timer.schedule(timerTask, flushPeriodMs);
    }
  }
}


text:
import {Howl} from 'howler';
import audioSpriteSheet from '../../dist/audio.json';

const sound = new Howl(audioSpriteSheet);

export default sound;

redpajama_set_name: RedPajamaGithub


text:
<?php

/**
 * Message translations for backend.
 *
 * NOTE: this file must be saved in UTF-8 encoding.
 */
return [
    'Login' => 'Авторизация',
    'Surname' => 'Фамилия',
    'Name' => 'Имя',
    'Middle Name' => 'Отчество',
    'Birthday' => 'День рождения',
    'Gender' => 'Пол',
    'Affiliate' => 'Аффилиат',
    'Phone' => 'Телефон',
    'Email' => 'Email',
    'Status' => 'Статус',
    'Created at' => 'Создан',
    'Updated at' => 'Последнее обновление',
    'Password' => 'Пароль',
    'Password repeat' => 'Повторите пароль',
    'Remember me' => 'Запомнить',
    'Restore password' => 'Восстановить пароль',
    'Avatar' => 'Аватар',
    'Bonus balance' => 'Бонусный баланс',
    'Balance' => 'Баланс',
    'Male' => 'Муж.',
    'Female' => 'Жен.',
    'Banned' => 'Забанен',
    'New' => 'Новый',
    'News' => 'Новости',
    'Active' => 'Активирован',
    'Profile' => 'Профиль',
    'Logout' => 'Выход',
    'Sign up' => 'Регистрация',
    'About' => 'О компании',
    'Contact' => 'Контакты',
    'Send' => 'Отправить',
    'Submit' => 'Отправить',
    'Subject' => 'Тема',
    'Body' => 'Сообщение',
    'Home' => 'Главная',
    'Save' => 'Сохранить',
    'Timetable' => 'Расписание',
    'Cabinet' => 'Личный кабинет',
    'Please choose your new password:' => 'Введите новый пароль:',
    'Reset password' => 'Сброс пароля',
    'Verification Code' => 'Код подтверждения',
    'Only first name' => 'Только имя (одно слово)',
    'This phone has already been taken.' => 'Указанный телефон уже зарегистрирован.',
    'This email address has already been taken.' => 'Указанный email уже зарегистрирован.',
    'Your Account Info' => 'Данные для входа в личный кабинет',
    'Please fill out the following fields to sign up. Password entry will be sent to your email.' => 'Для регистрации, заполните все поля. Пароль для входа, будет отправлен на указанный email.',
    'There was an error sending email.' => 'Произошла ошибка при отправке сообщения.',
    'Thank you for contacting us. We will respond to you as soon as possible.' => 'Благодарим за ваше письмео. В скором времени, мы обязательно вам ответим.',
    'New password was saved.' => 'Новый пароль успешно сохранен.',
    'Sorry, we are unable to reset password for email provided.' => 'Извините, что-то пошло не так, нам не удалось отправить информацию для сброса пароля, на ваш email.',
    '{Name}, password to access your account on the site {serverName}' => '{Name}, пароль для доступа в ваш аккаунт на сайте {serverName}',
    'Request password reset' => 'Запросить сброс пароля',
    'Please fill out your email. A link to reset password will be sent there.' => 'Пожалуйста, введите email указанный при регистрации. Ссылка для восстановления пароля будет отправлена на него.',
    'Check your email for further instructions.' => 'Проверьте свой email для дальнейших инструкций.',
    'Your password has been sent to: {email}' => 'Ваш пароль был отправлен на email: {email}',
];


text:
/**
 * DE_AKQUINET package declaration.
 * This declaration makes sure to not erase the
 * current declaration. If the package does not
 * exist an empty object is created.
 * @default {}
 */
var DE_AKQUINET = DE_AKQUINET || {};

/**
 * Creates an abstract component. This method is not intended to be used,
 * and is just here for documentation purpose. Indeed, the returned object
 * contains the four required methods that <bold>all</bold> component must
 * have. Any Javascript object with those 4 methods can be cosidered as a
 * valid component.
 * The four required methods are:
 *

 *
getComponentName() : return the default component name

 *
configurate(hub, [configuration]) : configures the component

 *
start() / stop() : called when the component is started / stopped

 *

 * Returned objects do not intend to be used, they are just mock / empty instances.
 * @constructor
 */
DE_AKQUINET.AbstractComponent = function() {

    /**
     * Gets the component name.
     * If an 'id' is given in the hub configuration, this method is replaced.
     * @return the component name
     * @public
     */
    this.getComponentName = function() {
        throw "AbstractComponent is an abstract class";
    };

    /**
     * Configures the component.
     * This method is called by the hub when the component starts or
     * when the component is plugged when the hub is already started.
     * @param hub the hub
     * @param configuration optional parameter used to pass the compoment
     * configuration. The configuration object is a simple map
     * key/value.
     * @public
     */
    this.configure = function(hub, configuration) {
        throw "AbstractComponent is an abstract class";
    };

    /**
     * Starts the component.
     * This method is called by the hub when the hub starts or
     * when the component is plugged when the hub is already started.
     * This methods is always called after the configure method.
     * Once called the component can send events and used bound
     * components.
     */
    this.start = function() {
        throw "AbstractComponent is an abstract class";
    };

    /**
     * Stop the component.
     * This method is called by the hub when the hub is stopped or
     * when the component is unplugged.
     * This methods is always called after the start method.
     * Once called, the component must not send events or
     * access bound components.
     */
    this.stop = function() {
        throw "AbstractComponent is an abstract class";
    };

};


text:
import resetLastItemScanned from './resetLastItemScanned';
import resetStores from './resetStores';
import setLastItemScanned from './setLastItemScanned';

export {
  resetLastItemScanned,
  resetStores,
  setLastItemScanned,
};


text:
* Übungsblätter
* Probeklausuren
* Altklausuren von der FIN
* w3schools
* YouTube tutorials
* Aufgaben googeln
* Beispiele im Repo

# Noch Fragen?

# Vielen Dank

## &

# Viel Erfolg


text:
<!DOCTYPE html>

  {% include head.html %}

    {% include offcanvas-button.html %}

    {% include top-address-bar.html %}

      {% include navbar.html %}

      {%  if page.path contains '_posts' or page.path contains 'blog' %}

                    {{ content }}

      {% else %}

        {{ content }}

      {% endif %}

      {% include brand-ticker.html %}
      {% include footer.html %}
      {% include offcanvas.html %}

    {% include analytics.html %}
    {% include livechat.html %}


text:
package cluster

import (
	"errors"
	"fmt"
	"math"
	"testing"
	"time"

	"github.com/samalba/dockerclient"
	"github.com/samalba/dockerclient/mockclient"
	"github.com/samalba/dockerclient/nopclient"
	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/mock"
)

var (
	mockInfo = &dockerclient.Info{
		ID:              "id",
		Name:            "name",
		NCPU:            10,
		MemTotal:        20,
		Driver:          "driver-test",
		ExecutionDriver: "execution-driver-test",
		KernelVersion:   "1.2.3",
		OperatingSystem: "golang",
		Labels:          []string{"foo=bar"},
	}

	mockVersion = &dockerclient.Version{
		Version: "1.6.2",
	}

	engOpts = &EngineOpts{
		RefreshMinInterval: time.Duration(30) * time.Second,
		RefreshMaxInterval: time.Duration(60) * time.Second,
		FailureRetry:       3,
	}
)

func TestSetEngineState(t *testing.T) {
	engine := NewEngine("test", 0, engOpts)
	assert.True(t, engine.state == statePending)
	engine.setState(stateUnhealthy)
	assert.True(t, engine.state == stateUnhealthy)
	engine.setState(stateHealthy)
	assert.True(t, engine.state == stateHealthy)
}

func TestErrMsg(t *testing.T) {
	engine := NewEngine("test", 0, engOpts)
	assert.True(t, len(engine.ErrMsg()) == 0)
	message := "cannot connect"
	engine.setErrMsg(message)
	assert.True(t, engine.ErrMsg() == message)
}

func TestCheckConnectionErr(t *testing.T) {
	engine := NewEngine("test", 0, engOpts)
	engine.setState(stateHealthy)
	assert.True(t, engine.failureCount == 0)
	err := dockerclient.ErrConnectionRefused
	engine.CheckConnectionErr(err)
	assert.True(t, len(engine.ErrMsg()) > 0)
	assert.True(t, engine.failureCount == 1)
	engine.CheckConnectionErr(err)
	assert.True(t, engine.failureCount == 2)
	err = nil
	engine.CheckConnectionErr(err)
	assert.True(t, engine.failureCount == 0)
	assert.True(t, len(engine.ErrMsg()) == 0)
}

func TestEngineFailureCount(t *testing.T) {
	engine := NewEngine("test", 0, engOpts)
	engine.setState(stateHealthy)
	for i := 0; i < engine.opts.FailureRetry; i++ {
		assert.True(t, engine.IsHealthy())
		engine.incFailureCount()
	}
	assert.False(t, engine.IsHealthy())
	assert.True(t, engine.failureCount == engine.opts.FailureRetry)
	engine.resetFailureCount()
	assert.True(t, engine.failureCount == 0)
}

func TestHealthINdicator(t *testing.T) {
	engine := NewEngine("test", 0, engOpts)
	assert.True(t, engine.state == statePending)
	assert.True(t, engine.HealthIndicator() == 0)
	engine.setState(stateUnhealthy)
	assert.True(t, engine.HealthIndicator() == 0)
	engine.setState(stateHealthy)
	assert.True(t, engine.HealthIndicator() == 100)
	engine.incFailureCount()
	assert.True(t, engine.HealthIndicator() == (int64)(100-100/engine.opts.FailureRetry))
}

func TestEngineConnectionFailure(t *testing.T) {
	engine := NewEngine("test", 0, engOpts)
	assert.False(t, engine.isConnected())

	// Always fail.
	client := mockclient.NewMockClient()
	client.On("Info").Return(&dockerclient.Info{}, errors.New("fail"))

	// Connect() should fail
	assert.Error(t, engine.ConnectWithClient(client))

	// isConnected() should return false
	nop := nopclient.NewNopClient()
	assert.Error(t, engine.ConnectWithClient(nop))
	assert.False(t, engine.isConnected())

	client.Mock.AssertExpectations(t)
}

func TestOutdatedEngine(t *testing.T) {
	engine := NewEngine("test", 0, engOpts)
	client := mockclient.NewMockClient()
	client.On("Info").Return(&dockerclient.Info{}, nil)

	assert.Error(t, engine.ConnectWithClient(client))

	nop := nopclient.NewNopClient()
	assert.Error(t, engine.ConnectWithClient(nop))
	assert.False(t, engine.isConnected())

	client.Mock.AssertExpectations(t)
}

func TestEngineCpusMemory(t *testing.T) {
	engine := NewEngine("test", 0, engOpts)
	engine.setState(stateUnhealthy)
	assert.False(t, engine.isConnected())

	client := mockclient.NewMockClient()
	client.On("Info").Return(mockInfo, nil)
	client.On("Version").Return(mockVersion, nil)
	client.On("ListContainers", true, false, "").Return([]dockerclient.Container{}, nil)
	client.On("ListImages", mock.Anything).Return([]*dockerclient.Image{}, nil)
	client.On("ListVolumes", mock.Anything).Return([]*dockerclient.Volume{}, nil)
	client.On("ListNetworks", mock.Anything).Return([]*dockerclient.NetworkResource{}, nil)
	client.On("StartMonitorEvents", mock.Anything, mock.Anything, mock.Anything).Return()

	assert.NoError(t, engine.ConnectWithClient(client))
	assert.True(t, engine.isConnected())
	assert.True(t, engine.IsHealthy())

	assert.Equal(t, engine.UsedCpus(), int64(0))
	assert.Equal(t, engine.UsedMemory(), int64(0))

	client.Mock.AssertExpectations(t)
}

func TestEngineSpecs(t *testing.T) {
	engine := NewEngine("test", 0, engOpts)
	engine.setState(stateUnhealthy)
	assert.False(t, engine.isConnected())

	client := mockclient.NewMockClient()
	client.On("Info").Return(mockInfo, nil)
	client.On("Version").Return(mockVersion, nil)
	client.On("ListContainers", true, false, "").Return([]dockerclient.Container{}, nil)
	client.On("ListImages", mock.Anything).Return([]*dockerclient.Image{}, nil)
	client.On("ListVolumes", mock.Anything).Return([]*dockerclient.Volume{}, nil)
	client.On("ListNetworks", mock.Anything).Return([]*dockerclient.NetworkResource{}, nil)
	client.On("StartMonitorEvents", mock.Anything, mock.Anything, mock.Anything).Return()

	assert.NoError(t, engine.ConnectWithClient(client))
	assert.True(t, engine.isConnected())
	assert.True(t, engine.IsHealthy())

	assert.Equal(t, engine.Cpus, mockInfo.NCPU)
	assert.Equal(t, engine.Memory, mockInfo.MemTotal)
	assert.Equal(t, engine.Labels["storagedriver"], mockInfo.Driver)
	assert.Equal(t, engine.Labels["executiondriver"], mockInfo.ExecutionDriver)
	assert.Equal(t, engine.Labels["kernelversion"], mockInfo.KernelVersion)
	assert.Equal(t, engine.Labels["operatingsystem"], mockInfo.OperatingSystem)
	assert.Equal(t, engine.Labels["foo"], "bar")

	client.Mock.AssertExpectations(t)
}

func TestEngineState(t *testing.T) {
	engine := NewEngine("test", 0, engOpts)
	engine.setState(stateUnhealthy)
	assert.False(t, engine.isConnected())

	client := mockclient.NewMockClient()
	client.On("Info").Return(mockInfo, nil)
	client.On("Version").Return(mockVersion, nil)
	client.On("StartMonitorEvents", mock.Anything, mock.Anything, mock.Anything).Return()

	// The client will return one container at first, then a second one will appear.
	client.On("ListContainers", true, false, "").Return([]dockerclient.Container{{Id: "one"}}, nil).Once()
	client.On("ListImages", mock.Anything).Return([]*dockerclient.Image{}, nil).Once()
	client.On("ListVolumes", mock.Anything).Return([]*dockerclient.Volume{}, nil)
	client.On("ListNetworks", mock.Anything).Return([]*dockerclient.NetworkResource{}, nil)
	client.On("InspectContainer", "one").Return(&dockerclient.ContainerInfo{Config: &dockerclient.ContainerConfig{CpuShares: 100}}, nil).Once()
	client.On("ListContainers", true, false, fmt.Sprintf("{%q:[%q]}", "id", "two")).Return([]dockerclient.Container{{Id: "two"}}, nil).Once()
	client.On("InspectContainer", "two").Return(&dockerclient.ContainerInfo{Config: &dockerclient.ContainerConfig{CpuShares: 100}}, nil).Once()

	assert.NoError(t, engine.ConnectWithClient(client))
	assert.True(t, engine.isConnected())

	// The engine should only have a single container at this point.
	containers := engine.Containers()
	assert.Len(t, containers, 1)
	if containers[0].Id != "one" {
		t.Fatalf("Missing container: one")
	}

	// Fake an event which will trigger a refresh. The second container will appear.
	engine.handler(&dockerclient.Event{ID: "two", Status: "created"}, nil)
	containers = engine.Containers()
	assert.Len(t, containers, 2)
	if containers[0].Id != "one" && containers[1].Id != "one" {
		t.Fatalf("Missing container: one")
	}
	if containers[0].Id != "two" && containers[1].Id != "two" {
		t.Fatalf("Missing container: two")
	}

	client.Mock.AssertExpectations(t)
}

func TestCreateContainer(t *testing.T) {
	var (
		config = &ContainerConfig{dockerclient.ContainerConfig{
			Image:     "busybox",
			CpuShares: 1,
			Cmd:       []string{"date"},
			Tty:       false,
		}}
		engine = NewEngine("test", 0, engOpts)
		client = mockclient.NewMockClient()
	)

	engine.setState(stateUnhealthy)
	client.On("Info").Return(mockInfo, nil)
	client.On("Version").Return(mockVersion, nil)
	client.On("StartMonitorEvents", mock.Anything, mock.Anything, mock.Anything).Return()
	client.On("ListContainers", true, false, "").Return([]dockerclient.Container{}, nil).Once()
	client.On("ListImages", mock.Anything).Return([]*dockerclient.Image{}, nil).Once()
	client.On("ListVolumes", mock.Anything).Return([]*dockerclient.Volume{}, nil)
	client.On("ListNetworks", mock.Anything).Return([]*dockerclient.NetworkResource{}, nil)
	assert.NoError(t, engine.ConnectWithClient(client))
	assert.True(t, engine.isConnected())

	mockConfig := config.ContainerConfig
	mockConfig.CpuShares = int64(math.Ceil(float64(config.CpuShares*1024) / float64(mockInfo.NCPU)))
	mockConfig.HostConfig.CpuShares = mockConfig.CpuShares

	// Everything is ok
	name := "test1"
	id := "id1"
	var auth *dockerclient.AuthConfig
	client.On("CreateContainer", &mockConfig, name, auth).Return(id, nil).Once()
	client.On("ListContainers", true, false, fmt.Sprintf(`{"id":[%q]}`, id)).Return([]dockerclient.Container{{Id: id}}, nil).Once()
	client.On("ListImages", mock.Anything).Return([]*dockerclient.Image{}, nil).Once()
	client.On("ListVolumes", mock.Anything).Return([]*dockerclient.Volume{}, nil)
	client.On("ListNetworks", mock.Anything).Return([]*dockerclient.NetworkResource{}, nil)
	client.On("InspectContainer", id).Return(&dockerclient.ContainerInfo{Config: &config.ContainerConfig}, nil).Once()
	container, err := engine.Create(config, name, false, auth)
	assert.Nil(t, err)
	assert.Equal(t, container.Id, id)
	assert.Len(t, engine.Containers(), 1)

	// Image not found, pullImage == false
	name = "test2"
	mockConfig.CpuShares = int64(math.Ceil(float64(config.CpuShares*1024) / float64(mockInfo.NCPU)))
	client.On("CreateContainer", &mockConfig, name, auth).Return("", dockerclient.ErrImageNotFound).Once()
	container, err = engine.Create(config, name, false, auth)
	assert.Equal(t, err, dockerclient.ErrImageNotFound)
	assert.Nil(t, container)

	// Image not found, pullImage == true, and the image can be pulled successfully
	name = "test3"
	id = "id3"
	mockConfig.CpuShares = int64(math.Ceil(float64(config.CpuShares*1024) / float64(mockInfo.NCPU)))
	client.On("PullImage", config.Image+":latest", mock.Anything).Return(nil).Once()
	client.On("CreateContainer", &mockConfig, name, auth).Return("", dockerclient.ErrImageNotFound).Once()
	client.On("CreateContainer", &mockConfig, name, auth).Return(id, nil).Once()
	client.On("ListContainers", true, false, fmt.Sprintf(`{"id":[%q]}`, id)).Return([]dockerclient.Container{{Id: id}}, nil).Once()
	client.On("ListImages", mock.Anything).Return([]*dockerclient.Image{}, nil).Once()
	client.On("ListVolumes", mock.Anything).Return([]*dockerclient.Volume{}, nil)
	client.On("ListNetworks", mock.Anything).Return([]*dockerclient.NetworkResource{}, nil)
	client.On("InspectContainer", id).Return(&dockerclient.ContainerInfo{Config: &config.ContainerConfig}, nil).Once()
	container, err = engine.Create(config, name, true, auth)
	assert.Nil(t, err)
	assert.Equal(t, container.Id, id)
	assert.Len(t, engine.Containers(), 2)
}

func TestImages(t *testing.T) {
	engine := NewEngine("test", 0, engOpts)
	engine.setState(stateHealthy)
	engine.images = []*Image{
		{dockerclient.Image{Id: "a"}, engine},
		{dockerclient.Image{Id: "b"}, engine},
		{dockerclient.Image{Id: "c"}, engine},
	}

	result := engine.Images()
	assert.Equal(t, len(result), 3)
}

func TestTotalMemory(t *testing.T) {
	engine := NewEngine("test", 0.05, engOpts)
	engine.Memory = 1024
	assert.Equal(t, engine.TotalMemory(), int64(1024+1024*5/100))

	engine = NewEngine("test", 0, engOpts)
	engine.Memory = 1024
	assert.Equal(t, engine.TotalMemory(), int64(1024))
}

func TestTotalCpus(t *testing.T) {
	engine := NewEngine("test", 0.05, engOpts)
	engine.Cpus = 2
	assert.Equal(t, engine.TotalCpus(), int64(2+2*5/100))

	engine = NewEngine("test", 0, engOpts)
	engine.Cpus = 2
	assert.Equal(t, engine.TotalCpus(), int64(2))
}

func TestUsedCpus(t *testing.T) {
	var (
		containerNcpu = []int64{1, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47}
		hostNcpu      = []int64{1, 2, 4, 8, 10, 12, 16, 20, 32, 36, 40, 48}
	)

	engine := NewEngine("test", 0, engOpts)
	engine.setState(stateHealthy)
	client := mockclient.NewMockClient()

	for _, hn := range hostNcpu {
		for _, cn := range containerNcpu {
			if cn <= hn {
				mockInfo.NCPU = hn
				cpuShares := int64(math.Ceil(float64(cn*1024) / float64(mockInfo.NCPU)))

				client.On("Info").Return(mockInfo, nil)
				client.On("Version").Return(mockVersion, nil)
				client.On("StartMonitorEvents", mock.Anything, mock.Anything, mock.Anything).Return()
				client.On("ListImages", mock.Anything).Return([]*dockerclient.Image{}, nil).Once()
				client.On("ListContainers", true, false, "").Return([]dockerclient.Container{{Id: "test"}}, nil).Once()
				client.On("ListVolumes", mock.Anything).Return([]*dockerclient.Volume{}, nil)
				client.On("ListNetworks", mock.Anything).Return([]*dockerclient.NetworkResource{}, nil)
				client.On("InspectContainer", "test").Return(&dockerclient.ContainerInfo{Config: &dockerclient.ContainerConfig{CpuShares: cpuShares}}, nil).Once()
				engine.ConnectWithClient(client)

				assert.Equal(t, engine.UsedCpus(), cn)
			}
		}
	}
}

func TestContainerRemovedDuringRefresh(t *testing.T) {
	var (
		container1 = dockerclient.Container{Id: "c1"}
		container2 = dockerclient.Container{Id: "c2"}
		info1      *dockerclient.ContainerInfo
		info2      = &dockerclient.ContainerInfo{Id: "c2", Config: &dockerclient.ContainerConfig{}}
	)

	engine := NewEngine("test", 0, engOpts)
	engine.setState(stateUnhealthy)
	assert.False(t, engine.isConnected())

	// A container is removed before it can be inspected.
	client := mockclient.NewMockClient()

	client.On("Info").Return(mockInfo, nil)
	client.On("Version").Return(mockVersion, nil)
	client.On("ListImages", mock.Anything).Return([]*dockerclient.Image{}, nil)
	client.On("StartMonitorEvents", mock.Anything, mock.Anything, mock.Anything).Return()
	client.On("ListContainers", true, false, "").Return([]dockerclient.Container{container1, container2}, nil)
	client.On("ListVolumes", mock.Anything).Return([]*dockerclient.Volume{}, nil)
	client.On("ListNetworks", mock.Anything).Return([]*dockerclient.NetworkResource{}, nil)
	client.On("InspectContainer", "c1").Return(info1, errors.New("Not found"))
	client.On("InspectContainer", "c2").Return(info2, nil)

	assert.NoError(t, engine.ConnectWithClient(client))
	assert.Nil(t, engine.RefreshContainers(true))

	// List of containers is still valid
	containers := engine.Containers()
	assert.Len(t, containers, 1)
	assert.Equal(t, containers[0].Id, "c2")

	client.Mock.AssertExpectations(t)
}


text:
<?php

declare(strict_types=1);

namespace Scheb\Tombstone\Core;

class PathNormalizer
{
    public const NORMALIZED_DIRECTORY_SEPARATOR = '/';

    public static function normalizeDirectorySeparator(string $path): string
    {
        return str_replace('\\', self::NORMALIZED_DIRECTORY_SEPARATOR, $path);
    }

    public static function normalizeDirectorySeparatorForEnvironment(string $path): string
    {
        return strtr($path, [
            '\\' => DIRECTORY_SEPARATOR,
            '/' => DIRECTORY_SEPARATOR,
        ]);
    }
}


text:
<!doctype html>
<!-- This file is generated by build.py. -->
<title>input tall.jpg; overflow:visible; -o-object-fit:none; -o-object-position:center right</title>
<link rel="stylesheet" href="../../support/reftests.css">
<link rel='match' href='visible_none_center_right-ref.html'>
<style>
 #test > * { overflow:visible; -o-object-fit:none; -o-object-position:center right }
</style>
<div id="test">
 <input type=image src="../../support/tall.jpg">
</div>


text:
// +build !ignore_autogenerated

// Code generated by openapi-gen. DO NOT EDIT.

// This file was autogenerated by openapi-gen. Do not edit it manually!

package v1alpha2

import (
	spec "github.com/go-openapi/spec"
	common "k8s.io/kube-openapi/pkg/common"
)

func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition {
	return map[string]common.OpenAPIDefinition{
		"./pkg/apis/serving/v1alpha2.AIXExplainerSpec":        schema_pkg_apis_serving_v1alpha2_AIXExplainerSpec(ref),
		"./pkg/apis/serving/v1alpha2.AlibiExplainerSpec":      schema_pkg_apis_serving_v1alpha2_AlibiExplainerSpec(ref),
		"./pkg/apis/serving/v1alpha2.Batcher":                 schema_pkg_apis_serving_v1alpha2_Batcher(ref),
		"./pkg/apis/serving/v1alpha2.CustomSpec":              schema_pkg_apis_serving_v1alpha2_CustomSpec(ref),
		"./pkg/apis/serving/v1alpha2.DeploymentSpec":          schema_pkg_apis_serving_v1alpha2_DeploymentSpec(ref),
		"./pkg/apis/serving/v1alpha2.EndpointSpec":            schema_pkg_apis_serving_v1alpha2_EndpointSpec(ref),
		"./pkg/apis/serving/v1alpha2.ExplainerSpec":           schema_pkg_apis_serving_v1alpha2_ExplainerSpec(ref),
		"./pkg/apis/serving/v1alpha2.InferenceService":        schema_pkg_apis_serving_v1alpha2_InferenceService(ref),
		"./pkg/apis/serving/v1alpha2.InferenceServiceList":    schema_pkg_apis_serving_v1alpha2_InferenceServiceList(ref),
		"./pkg/apis/serving/v1alpha2.InferenceServiceSpec":    schema_pkg_apis_serving_v1alpha2_InferenceServiceSpec(ref),
		"./pkg/apis/serving/v1alpha2.InferenceServiceStatus":  schema_pkg_apis_serving_v1alpha2_InferenceServiceStatus(ref),
		"./pkg/apis/serving/v1alpha2.LightGBMSpec":            schema_pkg_apis_serving_v1alpha2_LightGBMSpec(ref),
		"./pkg/apis/serving/v1alpha2.Logger":                  schema_pkg_apis_serving_v1alpha2_Logger(ref),
		"./pkg/apis/serving/v1alpha2.ONNXSpec":                schema_pkg_apis_serving_v1alpha2_ONNXSpec(ref),
		"./pkg/apis/serving/v1alpha2.PMMLSpec":                schema_pkg_apis_serving_v1alpha2_PMMLSpec(ref),
		"./pkg/apis/serving/v1alpha2.PredictorSpec":           schema_pkg_apis_serving_v1alpha2_PredictorSpec(ref),
		"./pkg/apis/serving/v1alpha2.PyTorchSpec":             schema_pkg_apis_serving_v1alpha2_PyTorchSpec(ref),
		"./pkg/apis/serving/v1alpha2.SKLearnSpec":             schema_pkg_apis_serving_v1alpha2_SKLearnSpec(ref),
		"./pkg/apis/serving/v1alpha2.StatusConfigurationSpec": schema_pkg_apis_serving_v1alpha2_StatusConfigurationSpec(ref),
		"./pkg/apis/serving/v1alpha2.TensorflowSpec":          schema_pkg_apis_serving_v1alpha2_TensorflowSpec(ref),
		"./pkg/apis/serving/v1alpha2.TransformerSpec":         schema_pkg_apis_serving_v1alpha2_TransformerSpec(ref),
		"./pkg/apis/serving/v1alpha2.TritonSpec":              schema_pkg_apis_serving_v1alpha2_TritonSpec(ref),
		"./pkg/apis/serving/v1alpha2.XGBoostSpec":             schema_pkg_apis_serving_v1alpha2_XGBoostSpec(ref),
		//TODO: `make generate` will remove this due to knative version upgrade but is used by python client
		"knative.dev/pkg/apis.URL":                      schema_knativedev_pkg_apis_URL(ref),
		"knative.dev/pkg/apis.Condition":                schema_knativedev_pkg_apis_Condition(ref),
		"knative.dev/pkg/apis.VolatileTime":             schema_knativedev_pkg_apis_VolatileTime(ref),
		"knative.dev/pkg/apis/duck/v1beta1.Addressable": schema_pkg_apis_duck_v1beta1_Addressable(ref),
	}
}

func schema_pkg_apis_serving_v1alpha2_AIXExplainerSpec(ref common.ReferenceCallback) common.OpenAPIDefinition {
	return common.OpenAPIDefinition{
		Schema: spec.Schema{
			SchemaProps: spec.SchemaProps{
				Description: "AIXExplainerSpec defines the arguments for configuring an AIX Explanation Server",
				Type:        []string{"object"},
				Properties: map[string]spec.Schema{
					"type": {
						SchemaProps: spec.SchemaProps{
							Description: "The type of AIX explainer",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"storageUri": {
						SchemaProps: spec.SchemaProps{
							Description: "The location of a trained explanation model",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"runtimeVersion": {
						SchemaProps: spec.SchemaProps{
							Description: "Defaults to latest AIX Version",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"resources": {
						SchemaProps: spec.SchemaProps{
							Description: "Defaults to requests and limits of 1CPU, 2Gb MEM.",
							Ref:         ref("k8s.io/api/core/v1.ResourceRequirements"),
						},
					},
					"config": {
						SchemaProps: spec.SchemaProps{
							Description: "Inline custom parameter settings for explainer",
							Type:        []string{"object"},
							AdditionalProperties: &spec.SchemaOrBool{
								Allows: true,
								Schema: &spec.Schema{
									SchemaProps: spec.SchemaProps{
										Type:   []string{"string"},
										Format: "",
									},
								},
							},
						},
					},
				},
				Required: []string{"type"},
			},
		},
		Dependencies: []string{
			"k8s.io/api/core/v1.ResourceRequirements"},
	}
}

func schema_pkg_apis_serving_v1alpha2_AlibiExplainerSpec(ref common.ReferenceCallback) common.OpenAPIDefinition {
	return common.OpenAPIDefinition{
		Schema: spec.Schema{
			SchemaProps: spec.SchemaProps{
				Description: "AlibiExplainerSpec defines the arguments for configuring an Alibi Explanation Server",
				Type:        []string{"object"},
				Properties: map[string]spec.Schema{
					"type": {
						SchemaProps: spec.SchemaProps{
							Description: "The type of Alibi explainer",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"storageUri": {
						SchemaProps: spec.SchemaProps{
							Description: "The location of a trained explanation model",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"runtimeVersion": {
						SchemaProps: spec.SchemaProps{
							Description: "Alibi docker image version which defaults to latest release",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"resources": {
						SchemaProps: spec.SchemaProps{
							Description: "Defaults to requests and limits of 1CPU, 2Gb MEM.",
							Ref:         ref("k8s.io/api/core/v1.ResourceRequirements"),
						},
					},
					"config": {
						SchemaProps: spec.SchemaProps{
							Description: "Inline custom parameter settings for explainer",
							Type:        []string{"object"},
							AdditionalProperties: &spec.SchemaOrBool{
								Allows: true,
								Schema: &spec.Schema{
									SchemaProps: spec.SchemaProps{
										Type:   []string{"string"},
										Format: "",
									},
								},
							},
						},
					},
				},
				Required: []string{"type"},
			},
		},
		Dependencies: []string{
			"k8s.io/api/core/v1.ResourceRequirements"},
	}
}

func schema_pkg_apis_serving_v1alpha2_Batcher(ref common.ReferenceCallback) common.OpenAPIDefinition {
	return common.OpenAPIDefinition{
		Schema: spec.Schema{
			SchemaProps: spec.SchemaProps{
				Description: "Batcher provides optional payload batcher for all endpoints",
				Type:        []string{"object"},
				Properties: map[string]spec.Schema{
					"maxBatchSize": {
						SchemaProps: spec.SchemaProps{
							Description: "MaxBatchSize of batcher service",
							Type:        []string{"integer"},
							Format:      "int32",
						},
					},
					"maxLatency": {
						SchemaProps: spec.SchemaProps{
							Description: "MaxLatency of batcher service",
							Type:        []string{"integer"},
							Format:      "int32",
						},
					},
					"timeout": {
						SchemaProps: spec.SchemaProps{
							Description: "Timeout of batcher service",
							Type:        []string{"integer"},
							Format:      "int32",
						},
					},
				},
			},
		},
	}
}

func schema_pkg_apis_serving_v1alpha2_CustomSpec(ref common.ReferenceCallback) common.OpenAPIDefinition {
	return common.OpenAPIDefinition{
		Schema: spec.Schema{
			SchemaProps: spec.SchemaProps{
				Description: "CustomSpec provides a hook for arbitrary container configuration.",
				Type:        []string{"object"},
				Properties: map[string]spec.Schema{
					"container": {
						SchemaProps: spec.SchemaProps{
							Ref: ref("k8s.io/api/core/v1.Container"),
						},
					},
				},
				Required: []string{"container"},
			},
		},
		Dependencies: []string{
			"k8s.io/api/core/v1.Container"},
	}
}

func schema_pkg_apis_serving_v1alpha2_DeploymentSpec(ref common.ReferenceCallback) common.OpenAPIDefinition {
	return common.OpenAPIDefinition{
		Schema: spec.Schema{
			SchemaProps: spec.SchemaProps{
				Description: "DeploymentSpec defines the configuration for a given InferenceService service component",
				Type:        []string{"object"},
				Properties: map[string]spec.Schema{
					"serviceAccountName": {
						SchemaProps: spec.SchemaProps{
							Description: "ServiceAccountName is the name of the ServiceAccount to use to run the service",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"minReplicas": {
						SchemaProps: spec.SchemaProps{
							Description: "Minimum number of replicas which defaults to 1, when minReplicas = 0 pods scale down to 0 in case of no traffic",
							Type:        []string{"integer"},
							Format:      "int32",
						},
					},
					"maxReplicas": {
						SchemaProps: spec.SchemaProps{
							Description: "This is the up bound for autoscaler to scale to",
							Type:        []string{"integer"},
							Format:      "int32",
						},
					},
					"parallelism": {
						SchemaProps: spec.SchemaProps{
							Description: "Parallelism specifies how many requests can be processed concurrently, this sets the hard limit of the container concurrency(https://knative.dev/docs/serving/autoscaling/concurrency).",
							Type:        []string{"integer"},
							Format:      "int32",
						},
					},
					"logger": {
						SchemaProps: spec.SchemaProps{
							Description: "Activate request/response logging",
							Ref:         ref("./pkg/apis/serving/v1alpha2.Logger"),
						},
					},
					"batcher": {
						SchemaProps: spec.SchemaProps{
							Description: "Activate request batching",
							Ref:         ref("./pkg/apis/serving/v1alpha2.Batcher"),
						},
					},
				},
			},
		},
		Dependencies: []string{
			"./pkg/apis/serving/v1alpha2.Batcher", "./pkg/apis/serving/v1alpha2.Logger"},
	}
}

func schema_pkg_apis_serving_v1alpha2_EndpointSpec(ref common.ReferenceCallback) common.OpenAPIDefinition {
	return common.OpenAPIDefinition{
		Schema: spec.Schema{
			SchemaProps: spec.SchemaProps{
				Type: []string{"object"},
				Properties: map[string]spec.Schema{
					"predictor": {
						SchemaProps: spec.SchemaProps{
							Description: "Predictor defines the model serving spec",
							Ref:         ref("./pkg/apis/serving/v1alpha2.PredictorSpec"),
						},
					},
					"explainer": {
						SchemaProps: spec.SchemaProps{
							Description: "Explainer defines the model explanation service spec, explainer service calls to predictor or transformer if it is specified.",
							Ref:         ref("./pkg/apis/serving/v1alpha2.ExplainerSpec"),
						},
					},
					"transformer": {
						SchemaProps: spec.SchemaProps{
							Description: "Transformer defines the pre/post processing before and after the predictor call, transformer service calls to predictor service.",
							Ref:         ref("./pkg/apis/serving/v1alpha2.TransformerSpec"),
						},
					},
				},
				Required: []string{"predictor"},
			},
		},
		Dependencies: []string{
			"./pkg/apis/serving/v1alpha2.ExplainerSpec", "./pkg/apis/serving/v1alpha2.PredictorSpec", "./pkg/apis/serving/v1alpha2.TransformerSpec"},
	}
}

func schema_pkg_apis_serving_v1alpha2_ExplainerSpec(ref common.ReferenceCallback) common.OpenAPIDefinition {
	return common.OpenAPIDefinition{
		Schema: spec.Schema{
			SchemaProps: spec.SchemaProps{
				Description: "ExplainerSpec defines the arguments for a model explanation server, The following fields follow a \"1-of\" semantic. Users must specify exactly one spec.",
				Type:        []string{"object"},
				Properties: map[string]spec.Schema{
					"alibi": {
						SchemaProps: spec.SchemaProps{
							Description: "Spec for alibi explainer",
							Ref:         ref("./pkg/apis/serving/v1alpha2.AlibiExplainerSpec"),
						},
					},
					"aix": {
						SchemaProps: spec.SchemaProps{
							Description: "Spec for AIX explainer",
							Ref:         ref("./pkg/apis/serving/v1alpha2.AIXExplainerSpec"),
						},
					},
					"custom": {
						SchemaProps: spec.SchemaProps{
							Description: "Spec for a custom explainer",
							Ref:         ref("./pkg/apis/serving/v1alpha2.CustomSpec"),
						},
					},
					"serviceAccountName": {
						SchemaProps: spec.SchemaProps{
							Description: "ServiceAccountName is the name of the ServiceAccount to use to run the service",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"minReplicas": {
						SchemaProps: spec.SchemaProps{
							Description: "Minimum number of replicas which defaults to 1, when minReplicas = 0 pods scale down to 0 in case of no traffic",
							Type:        []string{"integer"},
							Format:      "int32",
						},
					},
					"maxReplicas": {
						SchemaProps: spec.SchemaProps{
							Description: "This is the up bound for autoscaler to scale to",
							Type:        []string{"integer"},
							Format:      "int32",
						},
					},
					"parallelism": {
						SchemaProps: spec.SchemaProps{
							Description: "Parallelism specifies how many requests can be processed concurrently, this sets the hard limit of the container concurrency(https://knative.dev/docs/serving/autoscaling/concurrency).",
							Type:        []string{"integer"},
							Format:      "int32",
						},
					},
					"logger": {
						SchemaProps: spec.SchemaProps{
							Description: "Activate request/response logging",
							Ref:         ref("./pkg/apis/serving/v1alpha2.Logger"),
						},
					},
					"batcher": {
						SchemaProps: spec.SchemaProps{
							Description: "Activate request batching",
							Ref:         ref("./pkg/apis/serving/v1alpha2.Batcher"),
						},
					},
				},
			},
		},
		Dependencies: []string{
			"./pkg/apis/serving/v1alpha2.AIXExplainerSpec", "./pkg/apis/serving/v1alpha2.AlibiExplainerSpec", "./pkg/apis/serving/v1alpha2.Batcher", "./pkg/apis/serving/v1alpha2.CustomSpec", "./pkg/apis/serving/v1alpha2.Logger"},
	}
}

func schema_pkg_apis_serving_v1alpha2_InferenceService(ref common.ReferenceCallback) common.OpenAPIDefinition {
	return common.OpenAPIDefinition{
		Schema: spec.Schema{
			SchemaProps: spec.SchemaProps{
				Description: "InferenceService is the Schema for the services API",
				Type:        []string{"object"},
				Properties: map[string]spec.Schema{
					"kind": {
						SchemaProps: spec.SchemaProps{
							Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"apiVersion": {
						SchemaProps: spec.SchemaProps{
							Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"metadata": {
						SchemaProps: spec.SchemaProps{
							Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"),
						},
					},
					"spec": {
						SchemaProps: spec.SchemaProps{
							Ref: ref("./pkg/apis/serving/v1alpha2.InferenceServiceSpec"),
						},
					},
					"status": {
						SchemaProps: spec.SchemaProps{
							Ref: ref("./pkg/apis/serving/v1alpha2.InferenceServiceStatus"),
						},
					},
				},
			},
		},
		Dependencies: []string{
			"./pkg/apis/serving/v1alpha2.InferenceServiceSpec", "./pkg/apis/serving/v1alpha2.InferenceServiceStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"},
	}
}

func schema_pkg_apis_serving_v1alpha2_InferenceServiceList(ref common.ReferenceCallback) common.OpenAPIDefinition {
	return common.OpenAPIDefinition{
		Schema: spec.Schema{
			SchemaProps: spec.SchemaProps{
				Description: "InferenceServiceList contains a list of Service",
				Type:        []string{"object"},
				Properties: map[string]spec.Schema{
					"kind": {
						SchemaProps: spec.SchemaProps{
							Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"apiVersion": {
						SchemaProps: spec.SchemaProps{
							Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"metadata": {
						SchemaProps: spec.SchemaProps{
							Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"),
						},
					},
					"items": {
						VendorExtensible: spec.VendorExtensible{
							Extensions: spec.Extensions{
								"x-kubernetes-list-type": "set",
							},
						},
						SchemaProps: spec.SchemaProps{
							Type: []string{"array"},
							Items: &spec.SchemaOrArray{
								Schema: &spec.Schema{
									SchemaProps: spec.SchemaProps{
										Ref: ref("./pkg/apis/serving/v1alpha2.InferenceService"),
									},
								},
							},
						},
					},
				},
				Required: []string{"items"},
			},
		},
		Dependencies: []string{
			"./pkg/apis/serving/v1alpha2.InferenceService", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"},
	}
}

func schema_pkg_apis_serving_v1alpha2_InferenceServiceSpec(ref common.ReferenceCallback) common.OpenAPIDefinition {
	return common.OpenAPIDefinition{
		Schema: spec.Schema{
			SchemaProps: spec.SchemaProps{
				Description: "InferenceServiceSpec defines the desired state of InferenceService",
				Type:        []string{"object"},
				Properties: map[string]spec.Schema{
					"default": {
						SchemaProps: spec.SchemaProps{
							Description: "Default defines default InferenceService endpoints",
							Ref:         ref("./pkg/apis/serving/v1alpha2.EndpointSpec"),
						},
					},
					"canary": {
						SchemaProps: spec.SchemaProps{
							Description: "Canary defines alternate endpoints to route a percentage of traffic.",
							Ref:         ref("./pkg/apis/serving/v1alpha2.EndpointSpec"),
						},
					},
					"canaryTrafficPercent": {
						SchemaProps: spec.SchemaProps{
							Description: "CanaryTrafficPercent defines the percentage of traffic going to canary InferenceService endpoints",
							Type:        []string{"integer"},
							Format:      "int32",
						},
					},
				},
				Required: []string{"default"},
			},
		},
		Dependencies: []string{
			"./pkg/apis/serving/v1alpha2.EndpointSpec"},
	}
}

func schema_pkg_apis_serving_v1alpha2_InferenceServiceStatus(ref common.ReferenceCallback) common.OpenAPIDefinition {
	return common.OpenAPIDefinition{
		Schema: spec.Schema{
			SchemaProps: spec.SchemaProps{
				Description: "InferenceServiceStatus defines the observed state of InferenceService",
				Type:        []string{"object"},
				Properties: map[string]spec.Schema{
					"observedGeneration": {
						SchemaProps: spec.SchemaProps{
							Description: "ObservedGeneration is the 'Generation' of the Service that was last processed by the controller.",
							Type:        []string{"integer"},
							Format:      "int64",
						},
					},
					"conditions": {
						VendorExtensible: spec.VendorExtensible{
							Extensions: spec.Extensions{
								"x-kubernetes-patch-merge-key": "type",
								"x-kubernetes-patch-strategy":  "merge",
							},
						},
						SchemaProps: spec.SchemaProps{
							Description: "Conditions the latest available observations of a resource's current state.",
							Type:        []string{"array"},
							Items: &spec.SchemaOrArray{
								Schema: &spec.Schema{
									SchemaProps: spec.SchemaProps{
										Ref: ref("knative.dev/pkg/apis.Condition"),
									},
								},
							},
						},
					},
					"url": {
						SchemaProps: spec.SchemaProps{
							Description: "URL of the InferenceService",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"traffic": {
						SchemaProps: spec.SchemaProps{
							Description: "Traffic percentage that goes to default services",
							Type:        []string{"integer"},
							Format:      "int32",
						},
					},
					"canaryTraffic": {
						SchemaProps: spec.SchemaProps{
							Description: "Traffic percentage that goes to canary services",
							Type:        []string{"integer"},
							Format:      "int32",
						},
					},
					"default": {
						SchemaProps: spec.SchemaProps{
							Description: "Statuses for the default endpoints of the InferenceService",
							Type:        []string{"object"},
							AdditionalProperties: &spec.SchemaOrBool{
								Allows: true,
								Schema: &spec.Schema{
									SchemaProps: spec.SchemaProps{
										Ref: ref("./pkg/apis/serving/v1alpha2.StatusConfigurationSpec"),
									},
								},
							},
						},
					},
					"canary": {
						SchemaProps: spec.SchemaProps{
							Description: "Statuses for the canary endpoints of the InferenceService",
							Type:        []string{"object"},
							AdditionalProperties: &spec.SchemaOrBool{
								Allows: true,
								Schema: &spec.Schema{
									SchemaProps: spec.SchemaProps{
										Ref: ref("./pkg/apis/serving/v1alpha2.StatusConfigurationSpec"),
									},
								},
							},
						},
					},
					"address": {
						SchemaProps: spec.SchemaProps{
							Description: "Addressable URL for eventing",
							Ref:         ref("knative.dev/pkg/apis/duck/v1beta1.Addressable"),
						},
					},
				},
			},
		},
		Dependencies: []string{
			"./pkg/apis/serving/v1alpha2.StatusConfigurationSpec", "knative.dev/pkg/apis.Condition", "knative.dev/pkg/apis/duck/v1beta1.Addressable"},
	}
}

func schema_pkg_apis_serving_v1alpha2_Logger(ref common.ReferenceCallback) common.OpenAPIDefinition {
	return common.OpenAPIDefinition{
		Schema: spec.Schema{
			SchemaProps: spec.SchemaProps{
				Description: "Logger provides optional payload logging for all endpoints",
				Type:        []string{"object"},
				Properties: map[string]spec.Schema{
					"url": {
						SchemaProps: spec.SchemaProps{
							Description: "URL to send request logging CloudEvents",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"mode": {
						SchemaProps: spec.SchemaProps{
							Description: "What payloads to log: [all, request, response]",
							Type:        []string{"string"},
							Format:      "",
						},
					},
				},
			},
		},
	}
}

func schema_pkg_apis_serving_v1alpha2_ONNXSpec(ref common.ReferenceCallback) common.OpenAPIDefinition {
	return common.OpenAPIDefinition{
		Schema: spec.Schema{
			SchemaProps: spec.SchemaProps{
				Description: "ONNXSpec defines arguments for configuring ONNX model serving.",
				Type:        []string{"object"},
				Properties: map[string]spec.Schema{
					"storageUri": {
						SchemaProps: spec.SchemaProps{
							Description: "The URI of the exported onnx model(model.onnx)",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"runtimeVersion": {
						SchemaProps: spec.SchemaProps{
							Description: "ONNXRuntime docker image versions, default version can be set in the inferenceservice configmap",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"resources": {
						SchemaProps: spec.SchemaProps{
							Description: "Defaults to requests and limits of 1CPU, 2Gb MEM.",
							Ref:         ref("k8s.io/api/core/v1.ResourceRequirements"),
						},
					},
				},
				Required: []string{"storageUri"},
			},
		},
		Dependencies: []string{
			"k8s.io/api/core/v1.ResourceRequirements"},
	}
}

func schema_pkg_apis_serving_v1alpha2_LightGBMSpec(ref common.ReferenceCallback) common.OpenAPIDefinition {
	return common.OpenAPIDefinition{
		Schema: spec.Schema{
			SchemaProps: spec.SchemaProps{
				Description: "LightGBMSpec defines arguments for configuring LightGBM model serving.",
				Type:        []string{"object"},
				Properties: map[string]spec.Schema{
					"storageUri": {
						SchemaProps: spec.SchemaProps{
							Description: "The URI of the trained model which contains model.lightgbm",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"runtimeVersion": {
						SchemaProps: spec.SchemaProps{
							Description: "LightGBM KFServer docker image version which defaults to latest release",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"resources": {
						SchemaProps: spec.SchemaProps{
							Description: "Defaults to requests and limits of 1CPU, 2Gb MEM.",
							Ref:         ref("k8s.io/api/core/v1.ResourceRequirements"),
						},
					},
				},
				Required: []string{"storageUri"},
			},
		},
		Dependencies: []string{
			"k8s.io/api/core/v1.ResourceRequirements"},
	}
}

func schema_pkg_apis_serving_v1alpha2_PMMLSpec(ref common.ReferenceCallback) common.OpenAPIDefinition {
	return common.OpenAPIDefinition{
		Schema: spec.Schema{
			SchemaProps: spec.SchemaProps{
				Description: "PMMLSpec defines arguments for configuring PMML model serving.",
				Type:        []string{"object"},
				Properties: map[string]spec.Schema{
					"storageUri": {
						SchemaProps: spec.SchemaProps{
							Description: "The URI of the trained model which contains model.pmml",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"runtimeVersion": {
						SchemaProps: spec.SchemaProps{
							Description: "PMML KFServer docker image version which defaults to latest release",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"resources": {
						SchemaProps: spec.SchemaProps{
							Description: "Defaults to requests and limits of 1CPU, 2Gb MEM.",
							Ref:         ref("k8s.io/api/core/v1.ResourceRequirements"),
						},
					},
				},
				Required: []string{"storageUri"},
			},
		},
		Dependencies: []string{
			"k8s.io/api/core/v1.ResourceRequirements"},
	}
}

func schema_pkg_apis_serving_v1alpha2_PredictorSpec(ref common.ReferenceCallback) common.OpenAPIDefinition {
	return common.OpenAPIDefinition{
		Schema: spec.Schema{
			SchemaProps: spec.SchemaProps{
				Description: "PredictorSpec defines the configuration for a predictor, The following fields follow a \"1-of\" semantic. Users must specify exactly one spec.",
				Type:        []string{"object"},
				Properties: map[string]spec.Schema{
					"custom": {
						SchemaProps: spec.SchemaProps{
							Description: "Spec for a custom predictor",
							Ref:         ref("./pkg/apis/serving/v1alpha2.CustomSpec"),
						},
					},
					"tensorflow": {
						SchemaProps: spec.SchemaProps{
							Description: "Spec for Tensorflow Serving (https://github.com/tensorflow/serving)",
							Ref:         ref("./pkg/apis/serving/v1alpha2.TensorflowSpec"),
						},
					},
					"triton": {
						SchemaProps: spec.SchemaProps{
							Description: "Spec for Triton Inference Server (https://github.com/triton-inference-server/server)",
							Ref:         ref("./pkg/apis/serving/v1alpha2.TritonSpec"),
						},
					},
					"xgboost": {
						SchemaProps: spec.SchemaProps{
							Description: "Spec for XGBoost predictor",
							Ref:         ref("./pkg/apis/serving/v1alpha2.XGBoostSpec"),
						},
					},
					"sklearn": {
						SchemaProps: spec.SchemaProps{
							Description: "Spec for SKLearn predictor",
							Ref:         ref("./pkg/apis/serving/v1alpha2.SKLearnSpec"),
						},
					},
					"onnx": {
						SchemaProps: spec.SchemaProps{
							Description: "Spec for ONNX runtime (https://github.com/microsoft/onnxruntime)",
							Ref:         ref("./pkg/apis/serving/v1alpha2.ONNXSpec"),
						},
					},
					"pytorch": {
						SchemaProps: spec.SchemaProps{
							Description: "Spec for PyTorch predictor",
							Ref:         ref("./pkg/apis/serving/v1alpha2.PyTorchSpec"),
						},
					},
					"pmml": {
						SchemaProps: spec.SchemaProps{
							Description: "Spec for PMML predictor",
							Ref:         ref("./pkg/apis/serving/v1alpha2.PMMLSpec"),
						},
					},
					"lightgbm": {
						SchemaProps: spec.SchemaProps{
							Description: "Spec for LightGBM predictor",
							Ref:         ref("./pkg/apis/serving/v1alpha2.LightGBMSpec"),
						},
					},
					"serviceAccountName": {
						SchemaProps: spec.SchemaProps{
							Description: "ServiceAccountName is the name of the ServiceAccount to use to run the service",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"minReplicas": {
						SchemaProps: spec.SchemaProps{
							Description: "Minimum number of replicas which defaults to 1, when minReplicas = 0 pods scale down to 0 in case of no traffic",
							Type:        []string{"integer"},
							Format:      "int32",
						},
					},
					"maxReplicas": {
						SchemaProps: spec.SchemaProps{
							Description: "This is the up bound for autoscaler to scale to",
							Type:        []string{"integer"},
							Format:      "int32",
						},
					},
					"parallelism": {
						SchemaProps: spec.SchemaProps{
							Description: "Parallelism specifies how many requests can be processed concurrently, this sets the hard limit of the container concurrency(https://knative.dev/docs/serving/autoscaling/concurrency).",
							Type:        []string{"integer"},
							Format:      "int32",
						},
					},
					"logger": {
						SchemaProps: spec.SchemaProps{
							Description: "Activate request/response logging",
							Ref:         ref("./pkg/apis/serving/v1alpha2.Logger"),
						},
					},
					"batcher": {
						SchemaProps: spec.SchemaProps{
							Description: "Activate request batching",
							Ref:         ref("./pkg/apis/serving/v1alpha2.Batcher"),
						},
					},
				},
			},
		},
		Dependencies: []string{
			"./pkg/apis/serving/v1alpha2.Batcher", "./pkg/apis/serving/v1alpha2.CustomSpec", "./pkg/apis/serving/v1alpha2.LightGBMSpec", "./pkg/apis/serving/v1alpha2.Logger", "./pkg/apis/serving/v1alpha2.ONNXSpec", "./pkg/apis/serving/v1alpha2.PMMLSpec", "./pkg/apis/serving/v1alpha2.PyTorchSpec", "./pkg/apis/serving/v1alpha2.SKLearnSpec", "./pkg/apis/serving/v1alpha2.TensorflowSpec", "./pkg/apis/serving/v1alpha2.TritonSpec", "./pkg/apis/serving/v1alpha2.XGBoostSpec"},
	}
}

func schema_pkg_apis_serving_v1alpha2_PyTorchSpec(ref common.ReferenceCallback) common.OpenAPIDefinition {
	return common.OpenAPIDefinition{
		Schema: spec.Schema{
			SchemaProps: spec.SchemaProps{
				Description: "PyTorchSpec defines arguments for configuring PyTorch model serving.",
				Type:        []string{"object"},
				Properties: map[string]spec.Schema{
					"storageUri": {
						SchemaProps: spec.SchemaProps{
							Description: "The URI of the trained model which contains model.pt",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"modelClassName": {
						SchemaProps: spec.SchemaProps{
							Description: "Defaults PyTorch model class name to 'PyTorchModel'",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"runtimeVersion": {
						SchemaProps: spec.SchemaProps{
							Description: "PyTorch KFServer docker image version which defaults to latest release",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"resources": {
						SchemaProps: spec.SchemaProps{
							Description: "Defaults to requests and limits of 1CPU, 2Gb MEM.",
							Ref:         ref("k8s.io/api/core/v1.ResourceRequirements"),
						},
					},
				},
				Required: []string{"storageUri"},
			},
		},
		Dependencies: []string{
			"k8s.io/api/core/v1.ResourceRequirements"},
	}
}

func schema_pkg_apis_serving_v1alpha2_SKLearnSpec(ref common.ReferenceCallback) common.OpenAPIDefinition {
	return common.OpenAPIDefinition{
		Schema: spec.Schema{
			SchemaProps: spec.SchemaProps{
				Description: "SKLearnSpec defines arguments for configuring SKLearn model serving.",
				Type:        []string{"object"},
				Properties: map[string]spec.Schema{
					"storageUri": {
						SchemaProps: spec.SchemaProps{
							Description: "The URI of the trained model which contains model.pickle, model.pkl or model.joblib",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"runtimeVersion": {
						SchemaProps: spec.SchemaProps{
							Description: "SKLearn KFServer docker image version which defaults to latest release",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"resources": {
						SchemaProps: spec.SchemaProps{
							Description: "Defaults to requests and limits of 1CPU, 2Gb MEM.",
							Ref:         ref("k8s.io/api/core/v1.ResourceRequirements"),
						},
					},
				},
				Required: []string{"storageUri"},
			},
		},
		Dependencies: []string{
			"k8s.io/api/core/v1.ResourceRequirements"},
	}
}

func schema_pkg_apis_serving_v1alpha2_StatusConfigurationSpec(ref common.ReferenceCallback) common.OpenAPIDefinition {
	return common.OpenAPIDefinition{
		Schema: spec.Schema{
			SchemaProps: spec.SchemaProps{
				Description: "StatusConfigurationSpec describes the state of the configuration receiving traffic.",
				Type:        []string{"object"},
				Properties: map[string]spec.Schema{
					"name": {
						SchemaProps: spec.SchemaProps{
							Description: "Latest revision name that is in ready state",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"host": {
						SchemaProps: spec.SchemaProps{
							Description: "Host name of the service",
							Type:        []string{"string"},
							Format:      "",
						},
					},
				},
			},
		},
	}
}

func schema_pkg_apis_serving_v1alpha2_TensorflowSpec(ref common.ReferenceCallback) common.OpenAPIDefinition {
	return common.OpenAPIDefinition{
		Schema: spec.Schema{
			SchemaProps: spec.SchemaProps{
				Description: "TensorflowSpec defines arguments for configuring Tensorflow model serving.",
				Type:        []string{"object"},
				Properties: map[string]spec.Schema{
					"storageUri": {
						SchemaProps: spec.SchemaProps{
							Description: "The URI for the saved model(https://www.tensorflow.org/tutorials/keras/save_and_load)",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"runtimeVersion": {
						SchemaProps: spec.SchemaProps{
							Description: "TFServing docker image version(https://hub.docker.com/r/tensorflow/serving), default version can be set in the inferenceservice configmap.",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"resources": {
						SchemaProps: spec.SchemaProps{
							Description: "Defaults to requests and limits of 1CPU, 2Gb MEM.",
							Ref:         ref("k8s.io/api/core/v1.ResourceRequirements"),
						},
					},
				},
				Required: []string{"storageUri"},
			},
		},
		Dependencies: []string{
			"k8s.io/api/core/v1.ResourceRequirements"},
	}
}

func schema_pkg_apis_serving_v1alpha2_TransformerSpec(ref common.ReferenceCallback) common.OpenAPIDefinition {
	return common.OpenAPIDefinition{
		Schema: spec.Schema{
			SchemaProps: spec.SchemaProps{
				Description: "TransformerSpec defines transformer service for pre/post processing",
				Type:        []string{"object"},
				Properties: map[string]spec.Schema{
					"custom": {
						SchemaProps: spec.SchemaProps{
							Description: "Spec for a custom transformer",
							Ref:         ref("./pkg/apis/serving/v1alpha2.CustomSpec"),
						},
					},
					"serviceAccountName": {
						SchemaProps: spec.SchemaProps{
							Description: "ServiceAccountName is the name of the ServiceAccount to use to run the service",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"minReplicas": {
						SchemaProps: spec.SchemaProps{
							Description: "Minimum number of replicas which defaults to 1, when minReplicas = 0 pods scale down to 0 in case of no traffic",
							Type:        []string{"integer"},
							Format:      "int32",
						},
					},
					"maxReplicas": {
						SchemaProps: spec.SchemaProps{
							Description: "This is the up bound for autoscaler to scale to",
							Type:        []string{"integer"},
							Format:      "int32",
						},
					},
					"parallelism": {
						SchemaProps: spec.SchemaProps{
							Description: "Parallelism specifies how many requests can be processed concurrently, this sets the hard limit of the container concurrency(https://knative.dev/docs/serving/autoscaling/concurrency).",
							Type:        []string{"integer"},
							Format:      "int32",
						},
					},
					"logger": {
						SchemaProps: spec.SchemaProps{
							Description: "Activate request/response logging",
							Ref:         ref("./pkg/apis/serving/v1alpha2.Logger"),
						},
					},
					"batcher": {
						SchemaProps: spec.SchemaProps{
							Description: "Activate request batching",
							Ref:         ref("./pkg/apis/serving/v1alpha2.Batcher"),
						},
					},
				},
			},
		},
		Dependencies: []string{
			"./pkg/apis/serving/v1alpha2.Batcher", "./pkg/apis/serving/v1alpha2.CustomSpec", "./pkg/apis/serving/v1alpha2.Logger"},
	}
}

func schema_pkg_apis_serving_v1alpha2_TritonSpec(ref common.ReferenceCallback) common.OpenAPIDefinition {
	return common.OpenAPIDefinition{
		Schema: spec.Schema{
			SchemaProps: spec.SchemaProps{
				Description: "TritonSpec defines arguments for configuring Triton Inference Server.",
				Type:        []string{"object"},
				Properties: map[string]spec.Schema{
					"storageUri": {
						SchemaProps: spec.SchemaProps{
							Description: "The URI for the trained model repository(https://docs.nvidia.com/deeplearning/triton-inference-server/master-user-guide/docs/model_repository.html)",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"runtimeVersion": {
						SchemaProps: spec.SchemaProps{
							Description: "Triton Inference Server docker image version, default version can be set in the inferenceservice configmap",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"resources": {
						SchemaProps: spec.SchemaProps{
							Description: "Defaults to requests and limits of 1CPU, 2Gb MEM.",
							Ref:         ref("k8s.io/api/core/v1.ResourceRequirements"),
						},
					},
				},
				Required: []string{"storageUri"},
			},
		},
		Dependencies: []string{
			"k8s.io/api/core/v1.ResourceRequirements"},
	}
}

func schema_pkg_apis_serving_v1alpha2_XGBoostSpec(ref common.ReferenceCallback) common.OpenAPIDefinition {
	return common.OpenAPIDefinition{
		Schema: spec.Schema{
			SchemaProps: spec.SchemaProps{
				Description: "XGBoostSpec defines arguments for configuring XGBoost model serving.",
				Type:        []string{"object"},
				Properties: map[string]spec.Schema{
					"storageUri": {
						SchemaProps: spec.SchemaProps{
							Description: "The URI of the trained model which contains model.bst",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"nthread": {
						SchemaProps: spec.SchemaProps{
							Description: "Number of thread to be used by XGBoost",
							Type:        []string{"integer"},
							Format:      "int32",
						},
					},
					"runtimeVersion": {
						SchemaProps: spec.SchemaProps{
							Description: "XGBoost KFServer docker image version which defaults to latest release",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"resources": {
						SchemaProps: spec.SchemaProps{
							Description: "Defaults to requests and limits of 1CPU, 2Gb MEM.",
							Ref:         ref("k8s.io/api/core/v1.ResourceRequirements"),
						},
					},
				},
				Required: []string{"storageUri"},
			},
		},
		Dependencies: []string{
			"k8s.io/api/core/v1.ResourceRequirements"},
	}
}

//TODO: `make generate` will remove this due to knative version upgrade - not sure specifically why
func schema_knativedev_pkg_apis_Condition(ref common.ReferenceCallback) common.OpenAPIDefinition {
	return common.OpenAPIDefinition{
		Schema: spec.Schema{
			SchemaProps: spec.SchemaProps{
				Description: "Conditions defines a readiness condition for a Knative resource. See: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties",
				Type:        []string{"object"},
				Properties: map[string]spec.Schema{
					"type": {
						SchemaProps: spec.SchemaProps{
							Description: "Type of condition.",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"status": {
						SchemaProps: spec.SchemaProps{
							Description: "Status of the condition, one of True, False, Unknown.",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"severity": {
						SchemaProps: spec.SchemaProps{
							Description: "Severity with which to treat failures of this type of condition. When this is not specified, it defaults to Error.",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"lastTransitionTime": {
						SchemaProps: spec.SchemaProps{
							Description: "LastTransitionTime is the last time the condition transitioned from one status to another. We use VolatileTime in place of metav1.Time to exclude this from creating equality.Semantic differences (all other things held constant).",
							Ref:         ref("knative.dev/pkg/apis.VolatileTime"),
						},
					},
					"reason": {
						SchemaProps: spec.SchemaProps{
							Description: "The reason for the condition's last transition.",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"message": {
						SchemaProps: spec.SchemaProps{
							Description: "A human readable message indicating details about the transition.",
							Type:        []string{"string"},
							Format:      "",
						},
					},
				},
				Required: []string{"type", "status"},
			},
		},
		Dependencies: []string{
			"knative.dev/pkg/apis.VolatileTime"},
	}
}

func schema_knativedev_pkg_apis_VolatileTime(ref common.ReferenceCallback) common.OpenAPIDefinition {
	return common.OpenAPIDefinition{
		Schema: spec.Schema{
			SchemaProps: spec.SchemaProps{
				Description: "VolatileTime wraps metav1.Time",
				Type:        []string{"object"},
				Properties: map[string]spec.Schema{
					"Time": {
						SchemaProps: spec.SchemaProps{
							Type:   []string{"string"},
							Format: "date-time",
						},
					},
				},
				Required: []string{"Time"},
			},
		},
	}
}

func schema_knativedev_pkg_apis_URL(ref common.ReferenceCallback) common.OpenAPIDefinition {
	return common.OpenAPIDefinition{
		Schema: spec.Schema{
			SchemaProps: spec.SchemaProps{
				Description: "URL is an alias of url.URL. It has custom json marshal methods that enable it to be used in K8s CRDs such that the CRD resource will have the URL but operator code can can work with url.URL struct",
				Type:        []string{"object"},
				Properties: map[string]spec.Schema{
					"Scheme": {
						SchemaProps: spec.SchemaProps{
							Type:   []string{"string"},
							Format: "",
						},
					},
					"Opaque": {
						SchemaProps: spec.SchemaProps{
							Type:   []string{"string"},
							Format: "",
						},
					},
					"User": {
						SchemaProps: spec.SchemaProps{
							Description: "encoded opaque data",
							Ref:         ref("net/url.Userinfo"),
						},
					},
					"Host": {
						SchemaProps: spec.SchemaProps{
							Description: "username and password information",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"Path": {
						SchemaProps: spec.SchemaProps{
							Description: "host or host:port",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"RawPath": {
						SchemaProps: spec.SchemaProps{
							Description: "path (relative paths may omit leading slash)",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"ForceQuery": {
						SchemaProps: spec.SchemaProps{
							Description: "encoded path hint (see EscapedPath method)",
							Type:        []string{"boolean"},
							Format:      "",
						},
					},
					"RawQuery": {
						SchemaProps: spec.SchemaProps{
							Description: "append a query ('?') even if RawQuery is empty",
							Type:        []string{"string"},
							Format:      "",
						},
					},
					"Fragment": {
						SchemaProps: spec.SchemaProps{
							Description: "encoded query values, without '?'",
							Type:        []string{"string"},
							Format:      "",
						},
					},
				},
				Required: []string{"Scheme", "Opaque", "User", "Host", "Path", "RawPath", "ForceQuery", "RawQuery", "Fragment"},
			},
		},
		Dependencies: []string{
			"net/url.Userinfo"},
	}
}

func schema_pkg_apis_duck_v1beta1_Addressable(ref common.ReferenceCallback) common.OpenAPIDefinition {
	return common.OpenAPIDefinition{
		Schema: spec.Schema{
			SchemaProps: spec.SchemaProps{
				Type: []string{"object"},
				Properties: map[string]spec.Schema{
					"url": {
						SchemaProps: spec.SchemaProps{
							Ref: ref("knative.dev/pkg/apis.URL"),
						},
					},
				},
			},
		},
		Dependencies: []string{
			"knative.dev/pkg/apis.URL"},
	}
}


text:
namespace network {
namespace test {

// AbstractTrustworthinessTest below abstracts away differences between
// network::IsOriginPotentiallyTrustworthy and
// blink::SecurityOrigin::IsPotentiallyTrustworthy by parametrizing the tests
// with a class that has to expose the same members as url::UrlOriginTestTraits
// and the following extra members:
//   static bool IsOriginPotentiallyTrustworthy(const OriginType& origin);
//   static bool IsUrlPotentiallyTrustworthy(base::StringPiece str);
//   static bool IsOriginOfLocalhost(const OriginType& origin);
template <typename TTrustworthinessTraits>
class AbstractTrustworthinessTest
    : public url::AbstractOriginTest<TTrustworthinessTraits> {
 protected:
  // Wrappers that help ellide away TTrustworthinessTraits.
  //
  // Note that calling the wrappers needs to be prefixed with `this->...` to
  // avoid hitting: explicit qualification required to use member 'FooBar'
  // from dependent base class.
  using OriginType = typename TTrustworthinessTraits::OriginType;
  bool IsOriginPotentiallyTrustworthy(const OriginType& origin) {
    return TTrustworthinessTraits::IsOriginPotentiallyTrustworthy(origin);
  }
  bool IsOriginPotentiallyTrustworthy(base::StringPiece str) {
    auto origin = this->CreateOriginFromString(str);
    return TTrustworthinessTraits::IsOriginPotentiallyTrustworthy(origin);
  }
  bool IsUrlPotentiallyTrustworthy(base::StringPiece str) {
    return TTrustworthinessTraits::IsUrlPotentiallyTrustworthy(str);
  }
  bool IsOriginOfLocalhost(const OriginType& origin) {
    return TTrustworthinessTraits::IsOriginOfLocalhost(origin);
  }
};

TYPED_TEST_SUITE_P(AbstractTrustworthinessTest);

TYPED_TEST_P(AbstractTrustworthinessTest, OpaqueOrigins) {
  auto unique_origin = this->CreateUniqueOpaqueOrigin();
  EXPECT_FALSE(this->IsOriginPotentiallyTrustworthy(unique_origin));

  auto example_origin = this->CreateOriginFromString("https://www.example.com");
  auto opaque_origin = this->DeriveNewOpaqueOrigin(example_origin);
  EXPECT_FALSE(this->IsOriginPotentiallyTrustworthy(opaque_origin));
}

TYPED_TEST_P(AbstractTrustworthinessTest, OriginFromString) {
  EXPECT_FALSE(this->IsOriginPotentiallyTrustworthy("about:blank"));
  EXPECT_FALSE(this->IsOriginPotentiallyTrustworthy("about:blank#ref"));
  EXPECT_FALSE(this->IsOriginPotentiallyTrustworthy("about:srcdoc"));
  EXPECT_FALSE(
      this->IsOriginPotentiallyTrustworthy("javascript:alert('blah')"));
  EXPECT_FALSE(this->IsOriginPotentiallyTrustworthy("data:test/plain;blah"));

  EXPECT_TRUE(this->IsOriginPotentiallyTrustworthy(
      "quic-transport://example.com/counter"));
}

TYPED_TEST_P(AbstractTrustworthinessTest, CustomSchemes) {
  // Custom testing schemes are registered in url::AbstractOriginTest::SetUp.
  // Let's double-check that schemes we test with have the expected properties.
  EXPECT_TRUE(base::Contains(url::GetSecureSchemes(), "sec"));
  EXPECT_TRUE(base::Contains(url::GetSecureSchemes(), "sec-std-with-host"));
  EXPECT_TRUE(base::Contains(url::GetSecureSchemes(), "sec-noaccess"));
  EXPECT_TRUE(base::Contains(url::GetNoAccessSchemes(), "sec-noaccess"));
  EXPECT_TRUE(base::Contains(url::GetNoAccessSchemes(), "noaccess"));
  EXPECT_TRUE(GURL("sec-std-with-host://blah/x.js").IsStandard());

  // Unrecognized / unknown schemes are not trustworthy.
  EXPECT_FALSE(
      this->IsOriginPotentiallyTrustworthy("unknown-scheme://example.com"));
  EXPECT_FALSE(
      this->IsUrlPotentiallyTrustworthy("unknown-scheme://example.com"));

  // Secure URLs are trustworthy, even if their scheme is also marked as
  // no-access, or are not marked as standard.  See also //chrome-layer
  // ChromeContentClientTest.AdditionalSchemes test and
  // https://crbug.com/734581.
  EXPECT_TRUE(this->IsUrlPotentiallyTrustworthy("sec://blah/x.js"));
  EXPECT_TRUE(
      this->IsUrlPotentiallyTrustworthy("sec-std-with-host://blah/x.js"));
  EXPECT_TRUE(this->IsUrlPotentiallyTrustworthy("sec-noaccess://blah/x.js"));
  EXPECT_TRUE(
      this->IsOriginPotentiallyTrustworthy("sec-std-with-host://blah/x.js"));
  // No-access and non-standard/non-local schemes translate into an
  // untrustworthy, opaque origin.
  // TODO(lukasza): Maybe if the spec had a notion of an origin *precursor*,
  // then it could inspect the scheme of the precursor.  After this, it may be
  // possible to EXPECT_TRUE below...
  EXPECT_FALSE(this->IsOriginPotentiallyTrustworthy("sec://blah/x.js"));
  EXPECT_FALSE(
      this->IsOriginPotentiallyTrustworthy("sec-noaccess://blah/x.js"));

  // No-access, non-secure schemes are untrustworthy.
  EXPECT_FALSE(this->IsUrlPotentiallyTrustworthy("noaccess:blah"));
  EXPECT_FALSE(this->IsOriginPotentiallyTrustworthy("noaccess:blah"));

  // Standard, but non-secure schemes are untrustworthy.
  EXPECT_FALSE(this->IsUrlPotentiallyTrustworthy("std-with-host://blah/x.js"));
  EXPECT_FALSE(
      this->IsOriginPotentiallyTrustworthy("std-with-host://blah/x.js"));
}

TYPED_TEST_P(AbstractTrustworthinessTest, UrlFromString) {
  EXPECT_TRUE(this->IsUrlPotentiallyTrustworthy("about:blank"));
  EXPECT_TRUE(this->IsUrlPotentiallyTrustworthy("about:blank?x=2"));
  EXPECT_TRUE(this->IsUrlPotentiallyTrustworthy("about:blank#ref"));
  EXPECT_TRUE(this->IsUrlPotentiallyTrustworthy("about:blank?x=2#ref"));

  EXPECT_TRUE(this->IsUrlPotentiallyTrustworthy("about:srcdoc"));
  EXPECT_TRUE(this->IsUrlPotentiallyTrustworthy("about:srcdoc?x=2"));
  EXPECT_TRUE(this->IsUrlPotentiallyTrustworthy("about:srcdoc#ref"));
  EXPECT_TRUE(this->IsUrlPotentiallyTrustworthy("about:srcdoc?x=2#ref"));

  // The test expectations below document the current behavior, that "emerges"
  // from how out implementation of IsUrlPotentiallyTrustworthy treats scenarios
  // that are not covered by the spec.  The current behavior might or might not
  // be the desirable long-term behavior (it just accidentally emerged from the
  // current implentattion).  In particular, not how
  // https://www.w3.org/TR/secure-contexts/#is-url-trustworthy only mentions how
  // to deal with "about:srcdoc" and "about:blank", and how
  // https://github.com/w3c/webappsec-secure-contexts/issues/85 discusses
  // general treatment of "secure" / "authenticated" schemes (see also
  // IsSchemeConsideredAuthenticated in product code).
  EXPECT_TRUE(this->IsUrlPotentiallyTrustworthy("about:about"));
  EXPECT_TRUE(this->IsUrlPotentiallyTrustworthy("about:mumble"));

  EXPECT_TRUE(this->IsUrlPotentiallyTrustworthy("data:test/plain;blah"));
  EXPECT_TRUE(this->IsUrlPotentiallyTrustworthy("data:text/html,Hello"));
  EXPECT_FALSE(this->IsUrlPotentiallyTrustworthy("javascript:alert('blah')"));

  EXPECT_TRUE(
      this->IsUrlPotentiallyTrustworthy("https://example.com/fun.html"));
  EXPECT_FALSE(
      this->IsUrlPotentiallyTrustworthy("http://example.com/fun.html"));

  EXPECT_FALSE(this->IsUrlPotentiallyTrustworthy("ftp://example.com/"));

  EXPECT_TRUE(this->IsUrlPotentiallyTrustworthy("wss://example.com/fun.html"));
  EXPECT_FALSE(this->IsUrlPotentiallyTrustworthy("ws://example.com/fun.html"));

  EXPECT_FALSE(
      this->IsUrlPotentiallyTrustworthy("http://localhost.com/fun.html"));
  EXPECT_TRUE(
      this->IsUrlPotentiallyTrustworthy("https://localhost.com/fun.html"));

  EXPECT_FALSE(
      this->IsUrlPotentiallyTrustworthy("http://127.example.com/fun.html"));
  EXPECT_TRUE(
      this->IsUrlPotentiallyTrustworthy("https://127.example.com/fun.html"));

  EXPECT_FALSE(this->IsUrlPotentiallyTrustworthy("http://[::2]/fun.html"));
  EXPECT_FALSE(
      this->IsUrlPotentiallyTrustworthy("http://[::1].example.com/fun.html"));

  // IPv4 mapped IPv6 literals for loopback.
  EXPECT_FALSE(this->IsUrlPotentiallyTrustworthy("http://[::ffff:127.0.0.1]/"));
  EXPECT_FALSE(this->IsUrlPotentiallyTrustworthy("http://[::ffff:7f00:1]"));

  // IPv4 compatible IPv6 literal for loopback.
  EXPECT_FALSE(this->IsUrlPotentiallyTrustworthy("http://[::127.0.0.1]"));

  EXPECT_FALSE(this->IsUrlPotentiallyTrustworthy("http://loopback"));

  // Legacy localhost names.
  EXPECT_FALSE(
      this->IsUrlPotentiallyTrustworthy("http://localhost.localdomain"));
  EXPECT_FALSE(this->IsUrlPotentiallyTrustworthy("http://localhost6"));
  EXPECT_FALSE(
      this->IsUrlPotentiallyTrustworthy("ftp://localhost6.localdomain6"));

  EXPECT_FALSE(this->IsUrlPotentiallyTrustworthy(
      "filesystem:http://www.example.com/temporary/"));
  EXPECT_FALSE(this->IsUrlPotentiallyTrustworthy(
      "filesystem:ftp://www.example.com/temporary/"));
  EXPECT_TRUE(this->IsUrlPotentiallyTrustworthy(
      "filesystem:https://www.example.com/temporary/"));

  EXPECT_FALSE(this->IsUrlPotentiallyTrustworthy(
      "blob:http://www.example.com/guid-goes-here"));
  EXPECT_FALSE(this->IsUrlPotentiallyTrustworthy(
      "blob:ftp://www.example.com/guid-goes-here"));
  EXPECT_TRUE(this->IsUrlPotentiallyTrustworthy(
      "blob:https://www.example.com/guid-goes-here"));

  EXPECT_FALSE(
      this->IsUrlPotentiallyTrustworthy("filesystem:data:text/html,Hello"));
  EXPECT_FALSE(this->IsUrlPotentiallyTrustworthy("filesystem:about:blank"));
  EXPECT_FALSE(this->IsUrlPotentiallyTrustworthy(
      "blob:blob:https://example.com/578223a1-8c13-17b3-84d5-eca045ae384a"));
  EXPECT_FALSE(this->IsUrlPotentiallyTrustworthy(
      "filesystem:blob:https://example.com/"
      "578223a1-8c13-17b3-84d5-eca045ae384a"));

  EXPECT_TRUE(this->IsUrlPotentiallyTrustworthy(
      "quic-transport://example.com/counter"));

  // These tests are imported from IsPotentiallyTrustworthy.Url.
  EXPECT_TRUE(this->IsUrlPotentiallyTrustworthy("file:///test/fun.html"));
  EXPECT_TRUE(this->IsUrlPotentiallyTrustworthy("file:///test/"));
  EXPECT_TRUE(this->IsUrlPotentiallyTrustworthy("file://localhost/test/"));
  EXPECT_TRUE(this->IsUrlPotentiallyTrustworthy("file://otherhost/test/"));

  EXPECT_TRUE(this->IsUrlPotentiallyTrustworthy("http://localhost/fun.html"));
  EXPECT_TRUE(this->IsUrlPotentiallyTrustworthy("http://localhost./fun.html"));
  EXPECT_TRUE(
      this->IsUrlPotentiallyTrustworthy("http://pumpkin.localhost/fun.html"));
  EXPECT_TRUE(this->IsUrlPotentiallyTrustworthy(
      "http://crumpet.pumpkin.localhost/fun.html"));
  EXPECT_TRUE(this->IsUrlPotentiallyTrustworthy(
      "http://pumpkin.localhost:8080/fun.html"));
  EXPECT_TRUE(this->IsUrlPotentiallyTrustworthy(
      "http://crumpet.pumpkin.localhost:3000/fun.html"));

  EXPECT_TRUE(this->IsUrlPotentiallyTrustworthy("http://127.0.0.1/fun.html"));
  EXPECT_TRUE(this->IsUrlPotentiallyTrustworthy("ftp://127.0.0.1/fun.html"));
  EXPECT_TRUE(this->IsUrlPotentiallyTrustworthy("http://127.3.0.1/fun.html"));

  EXPECT_TRUE(this->IsUrlPotentiallyTrustworthy("http://[::1]/fun.html"));

  EXPECT_TRUE(this->IsUrlPotentiallyTrustworthy(
      "filesystem:ftp://127.0.0.1/temporary/"));
  EXPECT_TRUE(
      this->IsUrlPotentiallyTrustworthy("blob:ftp://127.0.0.1/guid-goes-here"));

  EXPECT_FALSE(this->IsUrlPotentiallyTrustworthy("blob:data:text/html,Hello"));
  EXPECT_FALSE(this->IsUrlPotentiallyTrustworthy("blob:about:blank"));

  // These tests are imported from SecurityOriginTest.IsSecure.
  EXPECT_TRUE(this->IsUrlPotentiallyTrustworthy("file:///etc/passwd"));
  EXPECT_FALSE(this->IsUrlPotentiallyTrustworthy("blob:data:text/html,Hello"));
  EXPECT_FALSE(this->IsUrlPotentiallyTrustworthy("blob:about:blank"));
  EXPECT_FALSE(
      this->IsUrlPotentiallyTrustworthy("filesystem:data:text/html,Hello"));
  EXPECT_FALSE(this->IsUrlPotentiallyTrustworthy("filesystem:about:blank"));
  EXPECT_FALSE(this->IsUrlPotentiallyTrustworthy(""));
  EXPECT_FALSE(this->IsUrlPotentiallyTrustworthy("\0"));

  // These tests are imported from SecurityOriginTest.IsSecureForLocalServers.
  EXPECT_TRUE(this->IsUrlPotentiallyTrustworthy("http://localhost/"));
  EXPECT_TRUE(this->IsUrlPotentiallyTrustworthy("http://localhost:8080/"));
  EXPECT_TRUE(this->IsUrlPotentiallyTrustworthy("http://127.0.0.1/"));
  EXPECT_TRUE(this->IsUrlPotentiallyTrustworthy("http://127.0.0.1:8080/"));
  EXPECT_TRUE(this->IsUrlPotentiallyTrustworthy("http://[::1]/"));
  EXPECT_TRUE(this->IsUrlPotentiallyTrustworthy("http://vhost.localhost/"));
}

TYPED_TEST_P(AbstractTrustworthinessTest, TestcasesInheritedFromBlink) {
  struct TestCase {
    bool is_potentially_trustworthy;
    bool is_localhost;
    const char* url;
  };

  TestCase inputs[] = {
      // Access is granted to webservers running on localhost.
      {true, true, "http://localhost"},
      {true, true, "http://localhost."},
      {true, true, "http://LOCALHOST"},
      {true, true, "http://localhost:100"},
      {true, true, "http://a.localhost"},
      {true, true, "http://a.b.localhost"},
      {true, true, "http://127.0.0.1"},
      {true, true, "http://127.0.0.2"},
      {true, true, "http://127.1.0.2"},
      {true, true, "http://0177.00.00.01"},
      {true, true, "http://[::1]"},
      {true, true, "http://[0:0::1]"},
      {true, true, "http://[0:0:0:0:0:0:0:1]"},
      {true, true, "http://[::1]:21"},
      {true, true, "http://127.0.0.1:8080"},
      {true, true, "ftp://127.0.0.1"},
      {true, true, "ftp://127.0.0.1:443"},
      {true, true, "ws://127.0.0.1"},

      // Non-localhost over HTTP
      {false, false, "http://[1::]"},
      {false, false, "http://[::2]"},
      {false, false, "http://[1::1]"},
      {false, false, "http://[1:2::3]"},
      {false, false, "http://[::127.0.0.1]"},
      {false, false, "http://a.127.0.0.1"},
      {false, false, "http://127.0.0.1.b"},
      {false, false, "http://localhost.a"},

      // loopback resolves to localhost on Windows, but not
      // recognized generically here.
      {false, false, "http://loopback"},

      // IPv4 mapped IPv6 literals for 127.0.0.1.
      {false, false, "http://[::ffff:127.0.0.1]"},
      {false, false, "http://[::ffff:7f00:1]"},

      // IPv4 compatible IPv6 literal for 127.0.0.1.
      {false, false, "http://[::127.0.0.1]"},

      // Legacy localhost names.
      {false, false, "http://localhost.localdomain"},
      {false, false, "http://localhost6"},
      {false, false, "ftp://localhost6.localdomain6"},

      // Secure transports are considered trustworthy.
      {true, false, "https://foobar.com"},
      {true, false, "wss://foobar.com"},
      {true, false, "quic-transport://example.com/counter"},

      // Insecure transports are not considered trustworthy.
      {false, false, "ftp://foobar.com"},
      {false, false, "http://foobar.com"},
      {false, false, "http://foobar.com:443"},
      {false, false, "ws://foobar.com"},
      {false, false, "custom-scheme://example.com"},

      // Local files are considered trustworthy.
      {true, false, "file:///home/foobar/index.html"},

      // blob: URLs must look to the inner URL's origin, and apply the same
      // rules as above. Spot check some of them
      {true, true,
       "blob:http://localhost:1000/578223a1-8c13-17b3-84d5-eca045ae384a"},
      {true, false,
       "blob:https://foopy:99/578223a1-8c13-17b3-84d5-eca045ae384a"},
      {false, false, "blob:http://baz:99/578223a1-8c13-17b3-84d5-eca045ae384a"},
      {false, false, "blob:ftp://evil:99/578223a1-8c13-17b3-84d5-eca045ae384a"},
      {false, false, "blob:data:text/html,Hello"},
      {false, false, "blob:about:blank"},
      {false, false,
       "blob:blob:https://example.com/578223a1-8c13-17b3-84d5-eca045ae384a"},

      // filesystem: URLs work the same as blob: URLs, and look to the inner
      // URL for security origin.
      {true, true, "filesystem:http://localhost:1000/foo"},
      {true, false, "filesystem:https://foopy:99/foo"},
      {false, false, "filesystem:http://baz:99/foo"},
      {false, false, "filesystem:ftp://evil:99/foo"},
      {false, false, "filesystem:data:text/html,Hello"},
      {false, false, "filesystem:about:blank"},
      {false, false,
       "filesystem:blob:https://example.com/"
       "578223a1-8c13-17b3-84d5-eca045ae384a"},

      // about: and data: URLs.
      {false, false, "about:blank"},
      {false, false, "about:srcdoc"},
      {false, false, "data:text/html,Hello"},
  };

  for (size_t i = 0; i < std::size(inputs); ++i) {
    SCOPED_TRACE(inputs[i].url);
    auto origin = this->CreateOriginFromString(inputs[i].url);
    EXPECT_EQ(inputs[i].is_potentially_trustworthy,
              this->IsOriginPotentiallyTrustworthy(origin));
    EXPECT_EQ(inputs[i].is_localhost, this->IsOriginOfLocalhost(origin));

    GURL test_gurl(inputs[i].url);
    if (!(test_gurl.SchemeIsBlob() || test_gurl.SchemeIsFileSystem())) {
      // Check that the origin's notion of localhost matches //net's notion of
      // localhost. This is skipped for blob: and filesystem: URLs since
      // blink::SecurityOrigin uses their inner URL's origin.
      EXPECT_EQ(net::IsLocalhost(GURL(inputs[i].url)),
                this->IsOriginOfLocalhost(origin));
    }
  }
}

TYPED_TEST_P(AbstractTrustworthinessTest, IsTrustworthyWithPattern) {
  const struct HostnamePatternCase {
    const char* pattern;
    const char* url;
    bool expected_secure;
  } kTestCases[] = {
      {"http://bar.foo.com", "http://bar.foo.com", true},
      {"*.baz.com", "http://bar.baz.com", true},
      {"http://foo", "*.foo.com", false},
  };

  for (const auto& test : kTestCases) {
    EXPECT_FALSE(this->IsUrlPotentiallyTrustworthy(test.url));
    base::test::ScopedCommandLine scoped_command_line;
    base::CommandLine* command_line =
        scoped_command_line.GetProcessCommandLine();
    command_line->AppendSwitchASCII(
        network::switches::kUnsafelyTreatInsecureOriginAsSecure, test.pattern);
    network::SecureOriginAllowlist::GetInstance().ResetForTesting();
    EXPECT_EQ(this->IsUrlPotentiallyTrustworthy(test.url),
              test.expected_secure);
  }
}

REGISTER_TYPED_TEST_SUITE_P(AbstractTrustworthinessTest,
                            OpaqueOrigins,
                            OriginFromString,
                            CustomSchemes,
                            UrlFromString,
                            TestcasesInheritedFromBlink,
                            IsTrustworthyWithPattern);

}  // namespace test
}  // namespace network

#endif  // SERVICES_NETWORK_PUBLIC_CPP_IS_POTENTIALLY_TRUSTWORTHY_UNITTEST_H_


text:
    describe google_compute_region_instance_group_managers(project: 'chef-inspec-gcp', region: 'europe-west2') do
      its('count') { should be <= 100}
    end

### Test that an expected instance_group is available for the project

    describe google_compute_region_instance_group_managers(project: 'chef-inspec-gcp', region: 'europe-west2') do
      its('instance_group_names') { should include "my-instance-group-name" }
    end

### Test that a subset of all instance_groups matching "mig*" have size greater than zero

    google_compute_region_instance_group_managers(project: 'chef-inspec-gcp', region: 'europe-west2').where(instance_group_name: /^mig/).instance_group_names.each do |instance_group_name|
      describe google_compute_instance_group(project: 'chef-inspec-gcp', region: 'europe-west2', name: instance_group_name) do
        it { should exist }
        its('target_size') { should be > 0 }
      end
    end


text:
Version 1.5.0 *(2020-09-20)*
----------------------------

* AndroidX :tada:

Version 1.4.5 *(2016-04-04)*
----------------------------

Fixed accidental API 19 usage

Version 1.4.4 *(2015-12-29)*
----------------------------

`Runnable` passed in `withEndAction` no longer getting called when animation is canceled.

Version 1.4.3 *(2015-12-28)*
----------------------------

Restoring previously used `LayerType` when using `withLayer()` option.

Version 1.4.2 *(2015-12-18)*
----------------------------

A temp method (`waitForAnimationStart()`) mistakenly included in the 1.3.0 release has been removed

Version 1.4.1 *(2015-12-18)*
----------------------------

 * Added missing exception when there's no Percent Support Library in the project and user is trying to animate percent parameters
 * Size percent argument type corrected

Version 1.4.0 *(2015-12-14)*
----------------------------

Animating `aspectRatio` (from Percent Support Library) introduced

 Version 1.3.0 *(2015-12-14)*
----------------------------

 * Animating `percent` parameters in Percent Support Library `Views` introduced.
 * Support Libraries no longer included in the aar.

Version 1.2.1 *(2015-12-10)*
----------------------------

Margin bug fixes.

Version 1.2.0 *(2015-10-30)*
----------------------------

Animating `scrollX` and `scrollY` introduced.

Version 1.1.0 *(2015-10-14)*
----------------------------

The ability to animate `View's`:

 * `dimensions`
 * `padding`
 * `margin`

has been added;

Version 1.0.0 *(2015-09-22)*
----------------------------

Initial release.


text:
namespace cricket {
#if defined(HAVE_WEBRTC_VOICE)
#define AUDIO_ENG_NAME WebRtcVoiceEngine
#else
#define AUDIO_ENG_NAME NullVoiceEngine
#endif //HAVE_WEBRTC_VOICE

const int MediaEngineInterface::kDefaultAudioDelayOffset = 0;

#if defined(HAVE_WEBRTC_VIDEO)
template<>
CompositeMediaEngine<WebRtcVoiceEngine, WebRtcVideoEngine>::
    CompositeMediaEngine() {
  video_.SetVoiceEngine(&voice_);
}
#endif //HAVE_WEBRTC_VIDEO

#if defined(HAVE_WEBRTC_VIDEO)
#define VIDEO_ENG_NAME WebRtcVideoEngine
#else
#define VIDEO_ENG_NAME NullVideoEngine
#endif //HAVE_WEBRTC_VIDEO

MediaEngineInterface* MediaEngineFactory::Create() {
#if defined(HAVE_LINPHONE)
  return new LinphoneMediaEngine("", "");
#elif defined(AUDIO_ENG_NAME) && defined(VIDEO_ENG_NAME)
  return new CompositeMediaEngine<AUDIO_ENG_NAME, VIDEO_ENG_NAME>();
#else
 return new NullMediaEngine();
#endif //HAVE_LINPHONE
}

};  // namespace cricket


text:
#ifndef __COMMON_INCLUDE_COMMUNICATION_AREA_H
#define __COMMON_INCLUDE_COMMUNICATION_AREA_H

#include <stdint.h>

/*
 * Communication area definition:
 */

typedef struct {
    uint32_t jtag_disabled;
    uint32_t resume_address;
    uint32_t resume_address_complement;
} __attribute__ ((packed)) resume_communication_area;

/*
 * Area of memory used to communicate between boot ROM and second stage FW.
 * This area is located at the highest end of the RAM. So any addition to the
 * area needs to happen BEFORE the existing fields.
 *
 * NOTE: COMMUNICATION_AREA_LENGTH must match _communication_area_size in
 * common.ld!
 */
#define COMMUNICATION_AREA_LENGTH   1024
#define EUID_LENGTH         8
#define S2_FW_ID_LENGTH     32
#define S2_KEY_NAMELENGTH   96
#define RESUME_ADDR_LENGTH  (sizeof(resume_address_communication_area))

typedef enum {
    SHARED_FUNCTION_SHA256_INIT,
    SHARED_FUNCTION_SHA256_PROCESS,
    SHARED_FUNCTION_SHA256_HASH,
    SHARED_FUNCTION_RSA2048_VERIFY,
    SHARED_FUNCTION_ENTER_STANDBY,
    NUMBER_OF_SHARED_FUNCTIONS
} shared_function_index;

#define EPSK_SIZE           56
#define ESSK_SIZE           32
#define ERGS_SIZE           32
#define ERRK_N_SIZE         256
typedef struct {
    uint8_t epsk[EPSK_SIZE];
    uint8_t essk[ESSK_SIZE];
    uint8_t ergs[ERGS_SIZE];
    uint8_t errk_n[ERRK_N_SIZE];
} __attribute__ ((packed)) secret_keys_comm_area;

typedef struct {
    secret_keys_comm_area keys;
} __attribute__ ((packed)) second_stage_comm_area;

#define COMMUNICATION_AREA_DATA_FIELDS \
    second_stage_comm_area second_stage; \
    void * shared_functions[NUMBER_OF_SHARED_FUNCTIONS]; \
    unsigned char endpoint_unique_id[EUID_LENGTH]; \
    unsigned char stage_2_firmware_identity[S2_FW_ID_LENGTH]; \
    char stage_2_validation_key_name[S2_KEY_NAMELENGTH]; \
    char build_timestamp[16]; \
    char firmware_package_name[48]; \
    resume_communication_area resume_data

typedef struct {
    COMMUNICATION_AREA_DATA_FIELDS;
} __attribute__ ((packed)) communication_area_defined;

#define PAD_LENGTH  (COMMUNICATION_AREA_LENGTH - \
                     sizeof(communication_area_defined))

typedef struct {
    unsigned char padding[PAD_LENGTH];
    COMMUNICATION_AREA_DATA_FIELDS;
} __attribute__ ((packed)) communication_area;

extern unsigned char _communication_area;

static inline void *get_shared_function(shared_function_index index) {
    if (index >= NUMBER_OF_SHARED_FUNCTIONS) {
        dbgprint("shared-fn index too big\n");
        return NULL;
    }

    communication_area *p = (communication_area *)&_communication_area;
    return p->shared_functions[index];
}

static inline void set_shared_function(shared_function_index index,
                                        void *func) {
    if (index >= NUMBER_OF_SHARED_FUNCTIONS) {
        dbgprint("shared-fn index too big\n");
        return;
    }

    communication_area *p = (communication_area *)&_communication_area;
    p->shared_functions[index] = func;
}

#endif /* __COMMON_INCLUDE__COMMUNICATION_AREA_H */


text:
package com.konkerlabs.platform.registry.web.converters;

import org.apache.commons.lang3.StringUtils;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

@Component
public class MaskPasswordConverter implements Converter<String, String> {

	@Override
	public String convert(String source) {

		if (source == null) {
			return null;
		} else {
			return StringUtils.leftPad("", source.length(), '*');
		}

	}

}