text:
using LightBDD.Core.Formatting;
using System;

namespace LightBDD.Core.Configuration
{
    /// <summary>
    /// Configuration class allowing to customize name formatting behavior.
    /// </summary>
    public class NameFormatterConfiguration : FeatureConfiguration
    {
        private INameFormatter _formatter;

        /// <summary>
        /// Returns formatter.
        /// </summary>
        /// <exception cref="InvalidOperationException">Thrown when formatter was not set.</exception>
        public INameFormatter GetFormatter() => _formatter ?? throw new InvalidOperationException($"{nameof(INameFormatter)} was not specified.");

        /// <summary>
        /// Sets <paramref name="formatter"/> as a default formatter to be used by LightBDD. The formatter can be retrieved by <see cref="GetFormatter"/>() method call.
        /// </summary>
        /// <param name="formatter">New formatter to set.</param>
        /// <returns>Self.</returns>
        /// <exception cref="ArgumentNullException">Throws when <paramref name="formatter"/> is null.</exception>
        public NameFormatterConfiguration UpdateFormatter(INameFormatter formatter)
        {
            ThrowIfSealed();
            _formatter = formatter ?? throw new ArgumentNullException(nameof(formatter));
            return this;
        }
    }
}


text:
/**
* <auto-generated />
* This file was generated by a StringTemplate 4 template.
* Don't change it directly as your change would get overwritten. Instead, make changes
* to the .stg file (i.e. the StringTemplate 4 template file) and save it to regenerate this file.
*
* For more infor on StringTemplate 4 template please go to -
* https://github.com/antlr/antlrcs
*
* @author  Kola Oyewumi
* @version 1.0.0
* @since   2017-01-03
*
* A class which represents the opportunities_contacts table.
*/

package com.sugaronrest.modules;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonRootName;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.sugaronrest.restapicalls.Module;
import com.sugaronrest.restapicalls.CustomDateDeserializer;
import com.sugaronrest.restapicalls.CustomDateSerializer;

import java.util.Date;

@Module(name = "", tablename = "opportunities_contacts")
@JsonRootName(value = "opportunities_contacts")
@JsonIgnoreProperties(ignoreUnknown = true)
public class OpportunitiesContacts {
    public String getId() {
        return id;
    }

    public void setId(String value) {
        id = value;
    }
    public String getContactId() {
        return contactId;
    }

    public void setContactId(String value) {
        contactId = value;
    }
    public String getOpportunityId() {
        return opportunityId;
    }

    public void setOpportunityId(String value) {
        opportunityId = value;
    }
    public String getContactRole() {
        return contactRole;
    }

    public void setContactRole(String value) {
        contactRole = value;
    }
    public Date getDateModified() {
        return dateModified;
    }

    public void setDateModified(Date value) {
        dateModified = value;
    }
    public Integer getDeleted() {
        return deleted;
    }

    public void setDeleted(Integer value) {
        deleted = value;
    }

    @JsonProperty("id")
    private String id;

    @JsonProperty("contact_id")
    private String contactId;

    @JsonProperty("opportunity_id")
    private String opportunityId;

    @JsonProperty("contact_role")
    private String contactRole;

    @JsonProperty("date_modified")
    @JsonDeserialize(using = CustomDateDeserializer.class)
    @JsonSerialize(using = CustomDateSerializer.class)
    private Date dateModified;

    @JsonProperty("deleted")
    private Integer deleted;

}

redpajama_set_name: RedPajamaGithub


text:
package ytbot

import (
	"encoding/json"
	"io/ioutil"
	"log"
	"path"
	"path/filepath"
	"runtime"
	"time"
)

type BotJob struct {
	Channel         string        `json:"Channel"`
	Subreddit       string        `json:"subreddit"`
	RegExp          string        `json:"regexp"`
	PollingDuration time.Duration `json:"pollingduration"`
}

type BotJobs struct {
	JobSlice []BotJob `json:"jobs"`
}

// PollingDuration is unmarshalled as nanoseconds, change unit to seconds
func (job *BotJob) UnmarshalJSON(b []byte) error {

	type BotJobAlias BotJob
	tempJob := &struct {
		PollingDuration time.Duration `json:"pollingduration"`
		*BotJobAlias
	}{
		BotJobAlias: (*BotJobAlias)(job),
	}

	if err := json.Unmarshal(b, &tempJob); err != nil {
		return err
	}

	job.PollingDuration = tempJob.PollingDuration * time.Second
	return nil
}

func ReadJobs() *BotJobs {

	jobs := new(BotJobs)

	_, filename, _, ok := runtime.Caller(0)
	if !ok {
		log.Fatal("No caller information")
	}

	jobFile, err := ioutil.ReadFile(filepath.Join(path.Dir(filename), "job.json"))
	if err != nil {
		log.Fatal(err)
	}

	json.Unmarshal(jobFile, jobs)
	return jobs
}


text:
package navalwar.server.gameengine.info;

import java.util.List;

public interface IWarInfo {

	public int getWarID();
	public String getName();
	public String getDesc();
	public int getNumArmies();
	public int getNumFightingArmies();
	public List<Integer> getArmiesIDs();

}


text:
package ru.job4j.addresses;

import java.util.Objects;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
/**
 * Класс AddressTest тестирует класс Address.
 *
 * @author Gureyev Ilya (mailto:ill-jah@yandex.ru)
 * @version 2019-03-11
 * @since 2019-03-11
 */
public class AddressTest {
    /**
     * Объект адреса.
     */
    private Address address;
    /**
     * Действия перед тестом.
     */
    @Before
    public void beforeTest() {
        this.address = new Address(0, 1, "Охотный ряд", "Москва");
    }
    /**
     * Тестирует public boolean equals(Object obj).
     * Две ссылки на один объект.
     */
    @Test
    public void testEqualsSameRef() {
        assertEquals(this.address, this.address);
    }
    /**
     * Тестирует public boolean equals(Object obj).
     * Сравнение с null.
     */
    @Test
    public void testEqualsWithNull() {
        assertFalse(this.address.equals(null));
    }
    /**
     * Тестирует public boolean equals(Object obj).
     * Сравнение с объектом другого класса.
     */
    @Test
    public void testEqualsWithDifferentClassObject() {
        assertFalse(this.address.equals(new Integer(0)));
    }
    /**
     * Тестирует public boolean equals(Object obj).
     * Разный номер квартиры.
     */
    @Test
    public void testEqualsWithObjectWithDifferentApartment() {
        Address address2 = new Address(100500, 1, "Охотный ряд", "Москва");
        assertFalse(this.address.equals(address2));
    }
    /**
     * Тестирует public boolean equals(Object obj).
     * Разный номер дома.
     */
    @Test
    public void testEqualsWithObjectWithDifferentHome() {
        Address address2 = new Address(0, 100500, "Охотный ряд", "Москва");
        assertFalse(this.address.equals(address2));
    }
    /**
     * Тестирует public boolean equals(Object obj).
     * Разная улица.
     */
    @Test
    public void testEqualsWithObjectWithDifferentStreet() {
        Address address2 = new Address(0, 1, "Маховая", "Москва");
        assertFalse(this.address.equals(address2));
    }
    /**
     * Тестирует public boolean equals(Object obj).
     * Разный город.
     */
    @Test
    public void testEqualsWithObjectWithDifferentCity() {
        Address address2 = new Address(0, 1, "Охотный ряд", "Питер");
        assertFalse(this.address.equals(address2));
    }
    /**
     * Тестирует public int getApartment().
     */
    @Test
    public void testGetApartment() {
        assertEquals(0, this.address.getApartment());
    }
    /**
     * Тестирует public String getCity().
     */
    @Test
    public void testGetCity() {
        assertEquals("Москва", this.address.getCity());
    }
    /**
     * Тестирует public int getHome().
     */
    @Test
    public void testGetHome() {
        assertEquals(1, this.address.getHome());
    }
    /**
     * Тестирует public String getStreet().
     */
    @Test
    public void testGetStreet() {
        assertEquals("Охотный ряд", this.address.getStreet());
    }
    /**
     * Тестирует public int hashCode().
     */
    @Test
    public void testHashCode() {
        int expected = Objects.hash(this.address.getApartment(), this.address.getCity(), this.address.getHome(), this.address.getStreet());
        assertEquals(expected, this.address.hashCode());
    }
    /**
     * Тестирует public void setApartment(int apartment).
     */
    @Test
    public void testSetApartment() {
        final int expected = 100500;
        this.address.setApartment(expected);
        assertEquals(expected, this.address.getApartment());
    }
    /**
     * Тестирует public void setCity(String city).
     */
    @Test
    public void testSetCity() {
        this.address.setCity("Питер");
        assertEquals("Питер", this.address.getCity());
    }
    /**
     * Тестирует public void setHome(int home).
     */
    @Test
    public void testSetHome() {
        final int expected = 100500;
        this.address.setHome(expected);
        assertEquals(expected, this.address.getHome());
    }
    /**
     * Тестирует public void setStreet(String street).
     */
    @Test
    public void testSetStreet() {
        this.address.setStreet("Моховая");
        assertEquals("Моховая", this.address.getStreet());
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android">

    <Button
        android:id="@+id/btnTask"
        style="@style/ContextMenuButton"
        android:text="Methode Pembayaran"
        android:textColor="@color/btn_context_menu_text_red" />

    <Button
        android:id="@+id/btnInstantPayment"
        style="@style/ContextMenuButton"
        android:text="Instant Payment" />

    <Button
        android:id="@+id/btnTransferBank"
        style="@style/ContextMenuButton"
        android:text="Transfer Bank" />

    <View
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="#eeeeee" />

    <Button
        android:id="@+id/btnCancel"
        style="@style/ContextMenuButton"
        android:text="CANCEL" />

</merge>


text:
package com.google.api.ads.adwords.jaxws.v201601.cm;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;

/**
 *
 *             A conversion tracker created through AdWords Conversion Tracking.
 *
 *
 *
Java class for AdWordsConversionTracker complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="AdWordsConversionTracker">
 *   <complexContent>
 *     <extension base="{https://adwords.google.com/api/adwords/cm/v201601}ConversionTracker">
 *       <sequence>
 *         <element name="snippet" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         <element name="textFormat" type="{https://adwords.google.com/api/adwords/cm/v201601}AdWordsConversionTracker.TextFormat" minOccurs="0"/>
 *         <element name="conversionPageLanguage" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         <element name="backgroundColor" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         <element name="trackingCodeType" type="{https://adwords.google.com/api/adwords/cm/v201601}AdWordsConversionTracker.TrackingCodeType" minOccurs="0"/>
 *       </sequence>
 *     </extension>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "AdWordsConversionTracker", propOrder = {
    "snippet",
    "textFormat",
    "conversionPageLanguage",
    "backgroundColor",
    "trackingCodeType"
})
public class AdWordsConversionTracker
    extends ConversionTracker
{

    protected String snippet;
    @XmlSchemaType(name = "string")
    protected AdWordsConversionTrackerTextFormat textFormat;
    protected String conversionPageLanguage;
    protected String backgroundColor;
    @XmlSchemaType(name = "string")
    protected AdWordsConversionTrackerTrackingCodeType trackingCodeType;

    /**
     * Gets the value of the snippet property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getSnippet() {
        return snippet;
    }

    /**
     * Sets the value of the snippet property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setSnippet(String value) {
        this.snippet = value;
    }

    /**
     * Gets the value of the textFormat property.
     *
     * @return
     *     possible object is
     *     {@link AdWordsConversionTrackerTextFormat }
     *
     */
    public AdWordsConversionTrackerTextFormat getTextFormat() {
        return textFormat;
    }

    /**
     * Sets the value of the textFormat property.
     *
     * @param value
     *     allowed object is
     *     {@link AdWordsConversionTrackerTextFormat }
     *
     */
    public void setTextFormat(AdWordsConversionTrackerTextFormat value) {
        this.textFormat = value;
    }

    /**
     * Gets the value of the conversionPageLanguage property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getConversionPageLanguage() {
        return conversionPageLanguage;
    }

    /**
     * Sets the value of the conversionPageLanguage property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setConversionPageLanguage(String value) {
        this.conversionPageLanguage = value;
    }

    /**
     * Gets the value of the backgroundColor property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getBackgroundColor() {
        return backgroundColor;
    }

    /**
     * Sets the value of the backgroundColor property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setBackgroundColor(String value) {
        this.backgroundColor = value;
    }

    /**
     * Gets the value of the trackingCodeType property.
     *
     * @return
     *     possible object is
     *     {@link AdWordsConversionTrackerTrackingCodeType }
     *
     */
    public AdWordsConversionTrackerTrackingCodeType getTrackingCodeType() {
        return trackingCodeType;
    }

    /**
     * Sets the value of the trackingCodeType property.
     *
     * @param value
     *     allowed object is
     *     {@link AdWordsConversionTrackerTrackingCodeType }
     *
     */
    public void setTrackingCodeType(AdWordsConversionTrackerTrackingCodeType value) {
        this.trackingCodeType = value;
    }

}


text:
This project shows how Selenium can be used together with JGiven
1. Ensure Google Chrome is installed on your machine,
2. Run `gradle build`
3. Open `build/reports/jgiven/test/html/index.html`


text:
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
		xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd">
	<changeSet id="0066_extend_weapon" author="cezarykluczynski">
		<addColumn schemaName="stapi" tableName="weapon">
			<column name="directed_energy_weapon" type="boolean"/>
			<column name="explosive_weapon" type="boolean"/>
			<column name="projectile_weapon" type="boolean"/>
			<column name="fictional_weapon" type="boolean"/>
		</addColumn>
	</changeSet>
</databaseChangeLog>


text:
{% load static %}
{% load notifications_tags %}
<!DOCTYPE html>

<title>{% block title %}konkourse{% endblock title %}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta property="og:image" content="{% static "img/logo-white.png" %}">
<meta property="og:image:type" content="image/png">
<meta property="og:image:width" content="200">
<meta property="og:image:height" content="200">
<meta name="description" content="Konkourse is a social network that connects people and ideas. Now open for public consumption to students at select universities.">
<meta property="og:description" content="Konkourse is a social network that connects people and ideas. Now open for public consumption to students at select universities.">
{% block includes %}

<link rel="shortcut icon" href="{% static "img/favicon.png" %}">

<link rel="stylesheet" href="{% static "css/bootstrap.css" %}">
<link rel="stylesheet" href="{% static "css/datepicker/datepicker.css" %}">
<link rel="stylesheet" href="{% static "css/jasny/jasny-bootstrap.css" %}">
<link rel="stylesheet" href="{% static "css/font-awesome.css" %}">
<link rel="stylesheet" href="{% static "css/font-awesome-ie7.min.css" %}">

<link rel="stylesheet" href="{% static "css/app.css" %}">
<link rel="stylesheet" href="{% static "css/timepicker/bootstrap-timepicker.min.css" %}">
<link rel="stylesheet" href="{% static "css/jquery-ui-smoothness/jquery-ui.css" %}">
  {% endblock includes %}
  {% block script %}
  {% endblock script %}{% block style %}
  {% endblock style %}
  {% load widget_tweaks %}

{% block menubar %}
 {% if user.is_authenticated and user.is_active %}

	          {% if user.notifications.unread.count > 0 %}
                {{user.notifications.unread.count}}
              {% endif %}

          <form id="searchform" class="navbar-search pull-left" action="/search/?q=">
            <input name="q" id="id_q" type="text" placeholder="Search for people" autocomplete="off" style="width:310px; margin-top:4px; margin-bottom:1px;">
          </form>

 {{ user.first_name }} {{user.last_name}}

View Profile

Edit Profile

Settings

Logout

    {% if error_message %}

        ×
        Error! {{error_message}}

  {% endif %}
        {% else %}

            <form class="form-inline" method="post" action="/account/login/" autocomplete="off" style="margin-bottom:0px;">
              {% csrf_token %}
              <input type="text" class="span3" name="username" placeholder="Email or Username" style="margin-top:6px;">
              <input type="password" class="span3" name="password" placeholder="Password" style="margin-top:6px;">
              <button type="submit" class="btn">Login</button>
            </form>

  {% if error_message %}

        ×
        Error! {{error_message}}

  {% endif %}
{% endif %}
{% endblock menubar %}
{% block content %}
{% endblock content %}


text:
package CoreClasses;

/**
 * Created by alireza on 2/4/16.
 * Mobile Application Developer Base on Mashhad
 * Email : Alireza.karimi.67@gmail.com
 * Tell : +989362397176
 * Website : www.Alirezakarimi.ir
 */

/**
 *
Key value core class

 * This class used for insert any kind data in local database

 * Key is column name
 * value is an object for column data . in databse helper class this object convert to right data type
 *
 * @author AlirezaKarimi
 * @version  1.0.0
 *
 * @see DataBase.DataBaseHelper
 * @see DataBase.DataBaseHelper
 */
public class classesKeyValue {
    private Object value;
    private String key;

    public String getKey() {
        return this.key;
    }

    public void setKey(String _key) {

        this.key = _key;
    }

    public Object getValue() {
        return this.value;
    }

    public void setValue(Object _value) {
        this.value = _value;
    }

    public classesKeyValue(String key, Object value) {
        super();
        this.key = key;
        this.value = value;
    }

    public classesKeyValue() {
        super();
    }

}


text:
/**
 * Angular 2 decorators and services
 */
import {
  Component,
  OnInit,
  ViewEncapsulation
} from '@angular/core';
import { AppState } from './app.service';

/**
 * App Component
 * Top Level Component
 */
@Component({
  selector: 'app',
  encapsulation: ViewEncapsulation.None,
  styleUrls: [
    './app.component.css'
  ],
  template: `

        Index

        Home

        Detail

        Barrel

        About

      <router-outlet></router-outlet>

this.appState.state = {{ appState.state | json }}

      WebPack Angular 2 Starter by @AngularClass

  `
})
export class AppComponent implements OnInit {
  public angularclassLogo = 'assets/img/weback.jpg';
  public name = 'Angular 2 Webpack Starter';
  public url = 'https://twitter.com/AngularClass';

  constructor(
    public appState: AppState
  ) {}

  public ngOnInit() {
    console.log('Initial App State', this.appState.state);
  }

}

/**
 * Please review the https://github.com/AngularClass/angular2-examples/ repo for
 * more angular app examples that you may copy/paste
 * (The examples may not be updated as quickly. Please open an issue on github for us to update it)
 * For help or questions please contact us at @AngularClass on twitter
 * or our chat on Slack at https://AngularClass.com/slack-join
 */


text:
<iframe src="http://player.vimeo.com/video/15171352?autoplay=1" width="575" height="323" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>

> _"When we forget ourselves, we are the universe.."_ Hakui

[**Communitas**](http://patriciogonzalezvivo.com/2010/communitas/) is an interactive table for collective drawings.

Communitas was develop for Interactivos 2010 at Espacio Fundación Telefónica

[ ![sponsor](http://patriciogonzalezvivo.com/2010/communitas/sponsor.jpg)](http://www.espacioft.org.ar/)

![01](http://patriciogonzalezvivo.com/2010/communitas/01.jpg)
![02](http://patriciogonzalezvivo.com/2010/communitas/02.jpg)
![03](http://patriciogonzalezvivo.com/2010/communitas/03.jpg)
![04](http://patriciogonzalezvivo.com/2010/communitas/04.jpg)
![05](http://patriciogonzalezvivo.com/2010/communitas/05.jpg)
![06](http://patriciogonzalezvivo.com/2010/communitas/06.jpg)
![07](http://patriciogonzalezvivo.com/2010/communitas/07.jpg)
![08](http://patriciogonzalezvivo.com/2010/communitas/08.jpg)
![09](http://patriciogonzalezvivo.com/2010/communitas/09.jpg)
![10](http://patriciogonzalezvivo.com/2010/communitas/10.jpg)


text:
try:
    import metaarray
    HAVE_METAARRAY = True
except:
    HAVE_METAARRAY = False

from pyqtgraph.Qt import QtCore
from GraphicsObject import GraphicsObject
from PlotCurveItem import PlotCurveItem
from ScatterPlotItem import ScatterPlotItem
import numpy as np
import scipy
import pyqtgraph.functions as fn
import pyqtgraph.debug as debug

class PlotDataItem(GraphicsObject):
    """
    **Bases:** :class:`GraphicsObject <pyqtgraph.GraphicsObject>`

    GraphicsItem for displaying plot curves, scatter plots, or both.
    While it is possible to use :class:`PlotCurveItem <pyqtgraph.PlotCurveItem>` or
    :class:`ScatterPlotItem <pyqtgraph.ScatterPlotItem>` individually, this class
    provides a unified interface to both. Inspances of :class:`PlotDataItem` are
    usually created by plot() methods such as :func:`pyqtgraph.plot` and
    :func:`PlotItem.plot() <pyqtgraph.PlotItem.plot>`.

    ============================== ==============================================
    **Signals:**
    sigPlotChanged(self)           Emitted when the data in this item is updated.
    sigClicked(self)               Emitted when the item is clicked.
    sigPointsClicked(self, points) Emitted when a plot point is clicked
                                   Sends the list of points under the mouse.
    ============================== ==============================================
    """

    sigPlotChanged = QtCore.Signal(object)
    sigClicked = QtCore.Signal(object)
    sigPointsClicked = QtCore.Signal(object, object)

    def __init__(self, *args, **kargs):
        """
        There are many different ways to create a PlotDataItem:

        **Data initialization arguments:** (x,y data only)

            =================================== ======================================
            PlotDataItem(xValues, yValues)      x and y values may be any sequence (including ndarray) of real numbers
            PlotDataItem(yValues)               y values only -- x will be automatically set to range(len(y))
            PlotDataItem(x=xValues, y=yValues)  x and y given by keyword arguments
            PlotDataItem(ndarray(Nx2))          numpy array with shape (N, 2) where x=data[:,0] and y=data[:,1]
            =================================== ======================================

        **Data initialization arguments:** (x,y data AND may include spot style)

            ===========================   =========================================
            PlotDataItem(recarray)        numpy array with dtype=[('x', float), ('y', float), ...]
            PlotDataItem(list-of-dicts)   [{'x': x, 'y': y, ...},   ...]
            PlotDataItem(dict-of-lists)   {'x': [...], 'y': [...],  ...}
            PlotDataItem(MetaArray)       1D array of Y values with X sepecified as axis values
                                          OR 2D array with a column 'y' and extra columns as needed.
            ===========================   =========================================

        **Line style keyword arguments:**
            ==========   ================================================
            pen          pen to use for drawing line between points.
                         Default is solid grey, 1px width. Use None to disable line drawing.
                         May be any single argument accepted by :func:`mkPen() <pyqtgraph.mkPen>`
            shadowPen    pen for secondary line to draw behind the primary line. disabled by default.
                         May be any single argument accepted by :func:`mkPen() <pyqtgraph.mkPen>`
            fillLevel    fill the area between the curve and fillLevel
            fillBrush    fill to use when fillLevel is specified
                         May be any single argument accepted by :func:`mkBrush() <pyqtgraph.mkBrush>`
            ==========   ================================================

        **Point style keyword arguments:**

            ============   ================================================
            symbol         (str) symbol to use for drawing points OR list of symbols, one per point. Default is no symbol.
                           options are o, s, t, d, +
            symbolPen      outline pen for drawing points OR list of pens, one per point
                           May be any single argument accepted by :func:`mkPen() <pyqtgraph.mkPen>`
            symbolBrush    brush for filling points OR list of brushes, one per point
                           May be any single argument accepted by :func:`mkBrush() <pyqtgraph.mkBrush>`
            symbolSize     diameter of symbols OR list of diameters
            pxMode         (bool) If True, then symbolSize is specified in pixels. If False, then symbolSize is
                           specified in data coordinates.
            ============   ================================================

        **Optimization keyword arguments:**

            ==========   ================================================
            identical    spots are all identical. The spot image will be rendered only once and repeated for every point
            decimate     (int) decimate data
            ==========   ================================================

        **Meta-info keyword arguments:**

            ==========   ================================================
            name         name of dataset. This would appear in a legend
            ==========   ================================================
        """
        GraphicsObject.__init__(self)
        self.setFlag(self.ItemHasNoContents)
        self.xData = None
        self.yData = None
        self.xDisp = None
        self.yDisp = None
        #self.curves = []
        #self.scatters = []
        self.curve = PlotCurveItem()
        self.scatter = ScatterPlotItem()
        self.curve.setParentItem(self)
        self.scatter.setParentItem(self)

        self.curve.sigClicked.connect(self.curveClicked)
        self.scatter.sigClicked.connect(self.scatterClicked)

        #self.clear()
        self.opts = {
            'fftMode': False,
            'logMode': [False, False],
            'downsample': False,
            'alphaHint': 1.0,
            'alphaMode': False,

            'pen': (200,200,200),
            'shadowPen': None,
            'fillLevel': None,
            'fillBrush': None,

            'symbol': None,
            'symbolSize': 10,
            'symbolPen': (200,200,200),
            'symbolBrush': (50, 50, 150),
            'identical': False,

            'data': None,
        }
        self.setData(*args, **kargs)

    def implements(self, interface=None):
        ints = ['plotData']
        if interface is None:
            return ints
        return interface in ints

    def boundingRect(self):
        return QtCore.QRectF()  ## let child items handle this

    def setAlpha(self, alpha, auto):
        self.opts['alphaHint'] = alpha
        self.opts['alphaMode'] = auto
        self.setOpacity(alpha)
        #self.update()

    def setFftMode(self, mode):
        self.opts['fftMode'] = mode
        self.xDisp = self.yDisp = None
        self.updateItems()

    def setLogMode(self, xMode, yMode):
        self.opts['logMode'] = (xMode, yMode)
        self.xDisp = self.yDisp = None
        self.updateItems()

    def setPointMode(self, mode):
        self.opts['pointMode'] = mode
        self.update()

    def setPen(self, *args, **kargs):
        """
        | Sets the pen used to draw lines between points.
        | *pen* can be a QPen or any argument accepted by :func:`pyqtgraph.mkPen() <pyqtgraph.mkPen>`
        """
        pen = fn.mkPen(*args, **kargs)
        self.opts['pen'] = pen
        #self.curve.setPen(pen)
        #for c in self.curves:
            #c.setPen(pen)
        #self.update()
        self.updateItems()

    def setShadowPen(self, *args, **kargs):
        """
        | Sets the shadow pen used to draw lines between points (this is for enhancing contrast or
          emphacizing data).
        | This line is drawn behind the primary pen (see :func:`setPen() <pyqtgraph.PlotDataItem.setPen>`)
          and should generally be assigned greater width than the primary pen.
        | *pen* can be a QPen or any argument accepted by :func:`pyqtgraph.mkPen() <pyqtgraph.mkPen>`
        """
        pen = fn.mkPen(*args, **kargs)
        self.opts['shadowPen'] = pen
        #for c in self.curves:
            #c.setPen(pen)
        #self.update()
        self.updateItems()

    def setFillBrush(self, *args, **kargs):
        brush = fn.mkBrush(*args, **kargs)
        self.opts['fillBrush'] = brush
        self.updateItems()

    def setBrush(self, *args, **kargs):
        return self.setFillBrush(*args, **kargs)

    def setFillLevel(self, level):
        self.opts['fillLevel'] = level
        self.updateItems()

    def setSymbol(self, symbol):
        self.opts['symbol'] = symbol
        #self.scatter.setSymbol(symbol)
        self.updateItems()

    def setSymbolPen(self, *args, **kargs):
        pen = fn.mkPen(*args, **kargs)
        self.opts['symbolPen'] = pen
        #self.scatter.setSymbolPen(pen)
        self.updateItems()

    def setSymbolBrush(self, *args, **kargs):
        brush = fn.mkBrush(*args, **kargs)
        self.opts['symbolBrush'] = brush
        #self.scatter.setSymbolBrush(brush)
        self.updateItems()

    def setSymbolSize(self, size):
        self.opts['symbolSize'] = size
        #self.scatter.setSymbolSize(symbolSize)
        self.updateItems()

    def setDownsampling(self, ds):
        if self.opts['downsample'] != ds:
            self.opts['downsample'] = ds
            self.xDisp = self.yDisp = None
            self.updateItems()

    def setData(self, *args, **kargs):
        """
        Clear any data displayed by this item and display new data.
        See :func:`__init__() <pyqtgraph.PlotDataItem.__init__>` for details; it accepts the same arguments.
        """

        #self.clear()
        prof = debug.Profiler('PlotDataItem.setData (0x%x)' % id(self), disabled=True)
        y = None
        x = None
        if len(args) == 1:
            data = args[0]
            dt = dataType(data)
            if dt == 'empty':
                pass
            elif dt == 'listOfValues':
                y = np.array(data)
            elif dt == 'Nx2array':
                x = data[:,0]
                y = data[:,1]
            elif dt == 'recarray' or dt == 'dictOfLists':
                if 'x' in data:
                    x = np.array(data['x'])
                if 'y' in data:
                    y = np.array(data['y'])
            elif dt ==  'listOfDicts':
                if 'x' in data[0]:
                    x = np.array([d.get('x',None) for d in data])
                if 'y' in data[0]:
                    y = np.array([d.get('y',None) for d in data])
                for k in ['data', 'symbolSize', 'symbolPen', 'symbolBrush', 'symbolShape']:
                    kargs[k] = [d.get(k, None) for d in data]
            elif dt == 'MetaArray':
                y = data.view(np.ndarray)
                x = data.xvals(0).view(np.ndarray)
            else:
                raise Exception('Invalid data type %s' % type(data))

        elif len(args) == 2:
            seq = ('listOfValues', 'MetaArray')
            if dataType(args[0]) not in seq or  dataType(args[1]) not in seq:
                raise Exception('When passing two unnamed arguments, both must be a list or array of values. (got %s, %s)' % (str(type(args[0])), str(type(args[1]))))
            if not isinstance(args[0], np.ndarray):
                x = np.array(args[0])
            else:
                x = args[0].view(np.ndarray)
            if not isinstance(args[1], np.ndarray):
                y = np.array(args[1])
            else:
                y = args[1].view(np.ndarray)

        if 'x' in kargs:
            x = kargs['x']
        if 'y' in kargs:
            y = kargs['y']

        prof.mark('interpret data')
        ## pull in all style arguments.
        ## Use self.opts to fill in anything not present in kargs.

        ## if symbol pen/brush are given with no symbol, then assume symbol is 'o'
        if 'symbol' not in kargs and ('symbolPen' in kargs or 'symbolBrush' in kargs or 'symbolSize' in kargs):
            kargs['symbol'] = 'o'

        if 'brush' in kargs:
            kargs['fillBrush'] = kargs['brush']

        for k in self.opts.keys():
            if k in kargs:
                self.opts[k] = kargs[k]

        #curveArgs = {}
        #for k in ['pen', 'shadowPen', 'fillLevel', 'brush']:
            #if k in kargs:
                #self.opts[k] = kargs[k]
            #curveArgs[k] = self.opts[k]

        #scatterArgs = {}
        #for k,v in [('symbolPen','pen'), ('symbolBrush','brush'), ('symbol','symbol')]:
            #if k in kargs:
                #self.opts[k] = kargs[k]
            #scatterArgs[v] = self.opts[k]

        if y is None:
            return
        if y is not None and x is None:
            x = np.arange(len(y))

        if isinstance(x, list):
            x = np.array(x)
        if isinstance(y, list):
            y = np.array(y)

        self.xData = x.view(np.ndarray)  ## one last check to make sure there are no MetaArrays getting by
        self.yData = y.view(np.ndarray)
        self.xDisp = None
        self.yDisp = None
        prof.mark('set data')

        self.updateItems()
        prof.mark('update items')
        view = self.getViewBox()
        if view is not None:
            view.itemBoundsChanged(self)  ## inform view so it can update its range if it wants
        self.sigPlotChanged.emit(self)
        prof.mark('emit')
        prof.finish()

    def updateItems(self):
        #for c in self.curves+self.scatters:
            #if c.scene() is not None:
                #c.scene().removeItem(c)

        curveArgs = {}
        for k,v in [('pen','pen'), ('shadowPen','shadowPen'), ('fillLevel','fillLevel'), ('fillBrush', 'brush')]:
            curveArgs[v] = self.opts[k]

        scatterArgs = {}
        for k,v in [('symbolPen','pen'), ('symbolBrush','brush'), ('symbol','symbol'), ('symbolSize', 'size'), ('data', 'data')]:
            if k in self.opts:
                scatterArgs[v] = self.opts[k]

        x,y = self.getData()

        if curveArgs['pen'] is not None or (curveArgs['brush'] is not None and curveArgs['fillLevel'] is not None):
            self.curve.setData(x=x, y=y, **curveArgs)
            self.curve.show()
        else:
            self.curve.hide()
            #curve = PlotCurveItem(x=x, y=y, **curveArgs)
            #curve.setParentItem(self)
            #self.curves.append(curve)

        if scatterArgs['symbol'] is not None:
            self.scatter.setData(x=x, y=y, **scatterArgs)
            self.scatter.show()
        else:
            self.scatter.hide()
            #sp = ScatterPlotItem(x=x, y=y, **scatterArgs)
            #sp.setParentItem(self)
            #self.scatters.append(sp)

    def getData(self):
        if self.xData is None:
            return (None, None)
        if self.xDisp is None:
            nanMask = np.isnan(self.xData) | np.isnan(self.yData) | np.isinf(self.xData) | np.isinf(self.yData)
            if any(nanMask):
                x = self.xData[~nanMask]
                y = self.yData[~nanMask]
            else:
                x = self.xData
                y = self.yData
            ds = self.opts['downsample']
            if ds > 1:
                x = x[::ds]
                #y = resample(y[:len(x)*ds], len(x))  ## scipy.signal.resample causes nasty ringing
                y = y[::ds]
            if self.opts['fftMode']:
                f = np.fft.fft(y) / len(y)
                y = abs(f[1:len(f)/2])
                dt = x[-1] - x[0]
                x = np.linspace(0, 0.5*len(x)/dt, len(y))
            if self.opts['logMode'][0]:
                x = np.log10(x)
            if self.opts['logMode'][1]:
                y = np.log10(y)
            if any(self.opts['logMode']):  ## re-check for NANs after log
                nanMask = np.isinf(x) | np.isinf(y) | np.isnan(x) | np.isnan(y)
                if any(nanMask):
                    x = x[~nanMask]
                    y = y[~nanMask]
            self.xDisp = x
            self.yDisp = y
        #print self.yDisp.shape, self.yDisp.min(), self.yDisp.max()
        #print self.xDisp.shape, self.xDisp.min(), self.xDisp.max()
        return self.xDisp, self.yDisp

    def dataBounds(self, ax, frac=1.0):
        (x, y) = self.getData()
        if x is None or len(x) == 0:
            return (0, 0)

        if ax == 0:
            d = x
        elif ax == 1:
            d = y

        if frac >= 1.0:
            return (np.min(d), np.max(d))
        elif frac <= 0.0:
            raise Exception("Value for parameter 'frac' must be > 0. (got %s)" % str(frac))
        else:
            return (scipy.stats.scoreatpercentile(d, 50 - (frac * 50)), scipy.stats.scoreatpercentile(d, 50 + (frac * 50)))

    def clear(self):
        #for i in self.curves+self.scatters:
            #if i.scene() is not None:
                #i.scene().removeItem(i)
        #self.curves = []
        #self.scatters = []
        self.xData = None
        self.yData = None
        self.xDisp = None
        self.yDisp = None
        self.curve.setData([])
        self.scatter.setData([])

    def appendData(self, *args, **kargs):
        pass

    def curveClicked(self):
        self.sigClicked.emit(self)

    def scatterClicked(self, plt, points):
        self.sigClicked.emit(self)
        self.sigPointsClicked.emit(self, points)

def dataType(obj):
    if hasattr(obj, '__len__') and len(obj) == 0:
        return 'empty'
    if isSequence(obj):
        first = obj[0]
        if isinstance(obj, np.ndarray):
            if HAVE_METAARRAY and isinstance(obj, metaarray.MetaArray):
                return 'MetaArray'
            if obj.ndim == 1:
                if obj.dtype.names is None:
                    return 'listOfValues'
                else:
                    return 'recarray'
            elif obj.ndim == 2 and obj.dtype.names is None and obj.shape[1] == 2:
                return 'Nx2array'
            else:
                raise Exception('array shape must be (N,) or (N,2); got %s instead' % str(obj.shape))
        elif isinstance(first, dict):
            return 'listOfDict'
        else:
            return 'listOfValues'
    elif isinstance(obj, dict):
        return 'dict'

def isSequence(obj):
    return isinstance(obj, list) or isinstance(obj, np.ndarray)

#class TableData:
    #"""
    #Class for presenting multiple forms of tabular data through a consistent interface.
    #May contain:
        #- numpy record array
        #- list-of-dicts (all dicts are _not_ required to have the same keys)
        #- dict-of-lists
        #- dict (single record)
               #Note: if all the values in this record are lists, it will be interpreted as multiple records

    #Data can be accessed and modified by column, by row, or by value
        #data[columnName]
        #data[rowId]
        #data[columnName, rowId] = value
        #data[columnName] = [value, value, ...]
        #data[rowId] = {columnName: value, ...}
    #"""

    #def __init__(self, data):
        #self.data = data
        #if isinstance(data, np.ndarray):
            #self.mode = 'array'
        #elif isinstance(data, list):
            #self.mode = 'list'
        #elif isinstance(data, dict):
            #types = set(map(type, data.values()))
            ### dict may be a dict-of-lists or a single record
            #types -= set([list, np.ndarray]) ## if dict contains any non-sequence values, it is probably a single record.
            #if len(types) != 0:
                #self.data = [self.data]
                #self.mode = 'list'
            #else:
                #self.mode = 'dict'
        #elif isinstance(data, TableData):
            #self.data = data.data
            #self.mode = data.mode
        #else:
            #raise TypeError(type(data))

        #for fn in ['__getitem__', '__setitem__']:
            #setattr(self, fn, getattr(self, '_TableData'+fn+self.mode))

    #def originalData(self):
        #return self.data

    #def toArray(self):
        #if self.mode == 'array':
            #return self.data
        #if len(self) < 1:
            ##return np.array([])  ## need to return empty array *with correct columns*, but this is very difficult, so just return None
            #return None
        #rec1 = self[0]
        #dtype = functions.suggestRecordDType(rec1)
        ##print rec1, dtype
        #arr = np.empty(len(self), dtype=dtype)
        #arr[0] = tuple(rec1.values())
        #for i in xrange(1, len(self)):
            #arr[i] = tuple(self[i].values())
        #return arr

    #def __getitem__array(self, arg):
        #if isinstance(arg, tuple):
            #return self.data[arg[0]][arg[1]]
        #else:
            #return self.data[arg]

    #def __getitem__list(self, arg):
        #if isinstance(arg, basestring):
            #return [d.get(arg, None) for d in self.data]
        #elif isinstance(arg, int):
            #return self.data[arg]
        #elif isinstance(arg, tuple):
            #arg = self._orderArgs(arg)
            #return self.data[arg[0]][arg[1]]
        #else:
            #raise TypeError(type(arg))

    #def __getitem__dict(self, arg):
        #if isinstance(arg, basestring):
            #return self.data[arg]
        #elif isinstance(arg, int):
            #return dict([(k, v[arg]) for k, v in self.data.iteritems()])
        #elif isinstance(arg, tuple):
            #arg = self._orderArgs(arg)
            #return self.data[arg[1]][arg[0]]
        #else:
            #raise TypeError(type(arg))

    #def __setitem__array(self, arg, val):
        #if isinstance(arg, tuple):
            #self.data[arg[0]][arg[1]] = val
        #else:
            #self.data[arg] = val

    #def __setitem__list(self, arg, val):
        #if isinstance(arg, basestring):
            #if len(val) != len(self.data):
                #raise Exception("Values (%d) and data set (%d) are not the same length." % (len(val), len(self.data)))
            #for i, rec in enumerate(self.data):
                #rec[arg] = val[i]
        #elif isinstance(arg, int):
            #self.data[arg] = val
        #elif isinstance(arg, tuple):
            #arg = self._orderArgs(arg)
            #self.data[arg[0]][arg[1]] = val
        #else:
            #raise TypeError(type(arg))

    #def __setitem__dict(self, arg, val):
        #if isinstance(arg, basestring):
            #if len(val) != len(self.data[arg]):
                #raise Exception("Values (%d) and data set (%d) are not the same length." % (len(val), len(self.data[arg])))
            #self.data[arg] = val
        #elif isinstance(arg, int):
            #for k in self.data:
                #self.data[k][arg] = val[k]
        #elif isinstance(arg, tuple):
            #arg = self._orderArgs(arg)
            #self.data[arg[1]][arg[0]] = val
        #else:
            #raise TypeError(type(arg))

    #def _orderArgs(self, args):
        ### return args in (int, str) order
        #if isinstance(args[0], basestring):
            #return (args[1], args[0])
        #else:
            #return args

    #def __iter__(self):
        #for i in xrange(len(self)):
            #yield self[i]

    #def __len__(self):
        #if self.mode == 'array' or self.mode == 'list':
            #return len(self.data)
        #else:
            #return max(map(len, self.data.values()))

    #def columnNames(self):
        #"""returns column names in no particular order"""
        #if self.mode == 'array':
            #return self.data.dtype.names
        #elif self.mode == 'list':
            #names = set()
            #for row in self.data:
                #names.update(row.keys())
            #return list(names)
        #elif self.mode == 'dict':
            #return self.data.keys()

    #def keys(self):
        #return self.columnNames()


text:
#pragma once

#include <stddef.h> // For size_t
#include <string.h> // for strlen
#include <string>
#include <vector>

#include "path/base.h"

class WinPath : public BasePath<WinPath> {
public:
    using BasePath<WinPath>::BasePath;

    static const char defaultSep = '\\';
    static const bool caseSensitive = false;

    static int cmp(char a, char b);

    static inline bool isSep(char c) {
        return c == '/' || c == '\\';
    }

    size_t rootLength() const;
};


text:
<!doctype html>

  <meta charset="utf-8">

  <link rel="import" href="../../../polymer.html">
  <link rel="import" href="../../../src/lib/experimental/patch-dom.html">
  <link rel="import" href="patch-dom-elements.html">

<x-test></x-test>

<x-test-no-distribute>

Bar

Foo

</x-test-no-distribute>


text:
"""
Test that RelativePath(s, d) doesn't return a path starting with '..' when
s is textually below d, but is also a symlink to a file that is not below d.

Returning .. in this case would break the Ninja generator in such a case,
because it computes output directories by concatenating paths, and concat'ing
a path starting with .. can unexpectedly erase other parts of the path. It's
difficult to test this directly since the test harness assumes toplevel_dir is
the root of the repository, but this test should at least verify that the
required behavior doesn't change.
"""

import TestGyp
import os
import sys
import tempfile

if sys.platform != 'win32':
  test = TestGyp.TestGyp()

  # Copy hello.gyp and hello.c to temporary named files, which will then be
  # symlinked back and processed. Note that we don't ask gyp to touch the
  # original files at all; they are only there as source material for the copy.
  # That's why hello.gyp references symlink_hello.c instead of hello.c.
  with tempfile.NamedTemporaryFile(mode='w+') as gyp_file:
    with tempfile.NamedTemporaryFile(mode='w+') as c_file:
      with open('hello.gyp') as orig_gyp_file:
        gyp_file.write(orig_gyp_file.read())
        gyp_file.flush()
      with open('hello.c') as orig_c_file:
        c_file.write(orig_c_file.read())
        c_file.flush()
      # We need to flush the files because we want to read them before closing
      # them, since when they are closed they will be deleted.

      # Don't proceed with the test on a system that doesn't let you read from
      # a still-open temporary file.
      if os.path.getsize(gyp_file.name) == 0:
        raise OSError("Copy to temporary file didn't work.")

      symlink_gyp = test.built_file_path('symlink_hello.gyp')
      symlink_c = test.built_file_path('symlink_hello.c')
      outdir = os.path.dirname(symlink_gyp)

      # Make sure the outdir exists.
      try:
        os.makedirs(outdir)
      except OSError:
        if not os.path.isdir(outdir):
          raise
      os.symlink(gyp_file.name, symlink_gyp)
      os.symlink(c_file.name, symlink_c)

      # Run gyp on the symlinked files.
      test.run_gyp(symlink_gyp, chdir=outdir)
      test.build(symlink_gyp, chdir=outdir)
      test.run_built_executable('symlink_hello', stdout="Hello, world!\n",
                                chdir=outdir)

      test.pass_test()


text:
namespace leveldb_proto {
class ProtoDatabaseProvider;
}  // namespace leveldb_proto

namespace network {
class SharedURLLoaderFactory;
}  // namespace network

namespace optimization_guide {
class TabUrlProvider;
class TopHostProvider;
class OptimizationGuideStore;
class OptimizationTargetModelObserver;
class PredictionManager;
class HintsManager;
}  // namespace optimization_guide

class BrowserList;
class OptimizationGuideLogger;
class OptimizationGuideNavigationData;
class PrefService;

namespace web {
class BrowserState;
class NavigationContext;
}  // namespace web

// A BrowserState keyed service that is used to own the underlying Optimization
// Guide components. This is a rough copy of the OptimizationGuideKeyedService
// in //chrome/browser that is used for non-iOS. It cannot be directly used due
// to the platform differences of the common data structures -
// NavigationContext vs NavigationHandle, BrowserState vs Profile, etc.
// TODO(crbug.com/1240907): Add support for clearing the hints when browsing
// data is cleared.
class OptimizationGuideService
    : public KeyedService,
      public optimization_guide::NewOptimizationGuideDecider,
      public optimization_guide::OptimizationGuideModelProvider {
 public:
  // BackgroundDownloadService is only available once the profile is fully
  // initialized and that cannot be done as part of `Initialize`. Get a provider
  // to retrieve the service when it is needed.
  using BackgroundDownloadServiceProvider =
      base::OnceCallback<download::BackgroundDownloadService*(void)>;
  OptimizationGuideService(
      leveldb_proto::ProtoDatabaseProvider* proto_db_provider,
      const base::FilePath& profile_path,
      bool off_the_record,
      const std::string& application_locale,
      base::WeakPtr<optimization_guide::OptimizationGuideStore> hint_store,
      base::WeakPtr<optimization_guide::OptimizationGuideStore>
          prediction_model_and_features_store,
      PrefService* pref_service,
      BrowserList* browser_list,
      scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
      BackgroundDownloadServiceProvider background_download_service_provider);
  ~OptimizationGuideService() override;

  OptimizationGuideService(const OptimizationGuideService&) = delete;
  OptimizationGuideService& operator=(const OptimizationGuideService&) = delete;

  // Some initialization parts must be done once the browser_state is fully
  // initialized.
  void DoFinalInit();

  // Registers the optimization types that intend to be queried during the
  // session. It is expected for this to be called right after the browser has
  // been initialized.
  void RegisterOptimizationTypes(
      const std::vector<optimization_guide::proto::OptimizationType>&
          optimization_types) override;

  // optimization_guide::NewOptimizationGuideDecider implementation:
  // WARNING: This API is not quite ready for general use. Use
  // CanApplyOptimizationAsync or CanApplyOptimization using NavigationHandle
  // instead.
  void CanApplyOptimization(
      const GURL& url,
      optimization_guide::proto::OptimizationType optimization_type,
      optimization_guide::OptimizationGuideDecisionCallback callback) override;

  // Returns whether `optimization_type` can be applied for `url`. This should
  // only be called for main frame navigations or future main frame navigations.
  optimization_guide::OptimizationGuideDecision CanApplyOptimization(
      const GURL& url,
      optimization_guide::proto::OptimizationType optimization_type,
      optimization_guide::OptimizationMetadata* optimization_metadata) override;

  // Invokes `callback` with the decision for the URL contained in
  // `navigation_context` and `optimization_type`, when sufficient information
  // has been collected to make the decision. This should only be called for
  // main frame navigations.
  void CanApplyOptimizationAsync(
      web::NavigationContext* navigation_context,
      optimization_guide::proto::OptimizationType optimization_type,
      optimization_guide::OptimizationGuideDecisionCallback callback);

  // optimization_guide::OptimizationGuideModelProvider implementation
  void AddObserverForOptimizationTargetModel(
      optimization_guide::proto::OptimizationTarget optimization_target,
      const absl::optional<optimization_guide::proto::Any>& model_metadata,
      optimization_guide::OptimizationTargetModelObserver* observer) override;
  void RemoveObserverForOptimizationTargetModel(
      optimization_guide::proto::OptimizationTarget optimization_target,
      optimization_guide::OptimizationTargetModelObserver* observer) override;

  // These functions are not private but are for optimization_guide component
  // internal use only.

  // Called when browsing data is cleared for the user.
  void OnBrowsingDataRemoved();

  // Getter for the hint manager.
  optimization_guide::HintsManager* GetHintsManager();

  // Getter for the prediction manager.
  optimization_guide::PredictionManager* GetPredictionManager();

  // Getter for the optimization guide logger.
  OptimizationGuideLogger* GetOptimizationGuideLogger() {
    return optimization_guide_logger_.get();
  }

 private:
  friend class OptimizationGuideServiceTest;
  friend class OptimizationGuideTabHelper;
  friend class OptimizationGuideTestAppInterfaceWrapper;

  // Notifies `hints_manager_` that the navigation associated with
  // `navigation_data` has started or redirected.
  void OnNavigationStartOrRedirect(
      OptimizationGuideNavigationData* navigation_data);

  // Notifies `hints_manager_` that the navigation associated with
  // `navigation_redirect_chain` has finished.
  void OnNavigationFinish(const std::vector<GURL>& navigation_redirect_chain);

  // KeyedService implementation:
  void Shutdown() override;

  // optimization_guide::NewOptimizationGuideDecider implementation:
  void CanApplyOptimizationOnDemand(
      const std::vector<GURL>& urls,
      const base::flat_set<optimization_guide::proto::OptimizationType>&
          optimization_types,
      optimization_guide::proto::RequestContext request_context,
      optimization_guide::OnDemandOptimizationGuideDecisionRepeatingCallback
          callback) override;

  // The store of hints.
  std::unique_ptr<optimization_guide::OptimizationGuideStore> hint_store_;

  // Manages the storing, loading, and fetching of hints.
  std::unique_ptr<optimization_guide::HintsManager> hints_manager_;

  // The top host provider to use for fetching information for the user's top
  // hosts. Will be null if the user has not consented to this type of browser
  // behavior.
  std::unique_ptr<optimization_guide::TopHostProvider> top_host_provider_;

  // The tab URL provider to use for fetching information for the user's active
  // tabs. Will be null if the user is off the record.
  std::unique_ptr<optimization_guide::TabUrlProvider> tab_url_provider_;

  std::unique_ptr<OptimizationGuideLogger> optimization_guide_logger_;

  // The store of optimization target prediction models and features.
  std::unique_ptr<optimization_guide::OptimizationGuideStore>
      prediction_model_and_features_store_;

  // Manages the storing, loading, and evaluating of optimization target
  // prediction models.
  std::unique_ptr<optimization_guide::PredictionManager> prediction_manager_;

  // The PrefService of the browser state this service is linked to.
  PrefService* const pref_service_ = nullptr;

  // Whether the service is linked to an incognito browser state.
  const bool off_the_record_ = false;

  SEQUENCE_CHECKER(sequence_checker_);
};

#endif  // IOS_CHROME_BROWSER_OPTIMIZATION_GUIDE_OPTIMIZATION_GUIDE_SERVICE_H_


text:
astrobase.lcproc.awsrun module
==============================

.. automodule:: astrobase.lcproc.awsrun
    :members:
    :undoc-members:
    :show-inheritance: