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

import CIM15.IEC61970.Domain.DateTimeInterval;

import java.util.Collection;

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

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

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

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

/**
 *
 * A representation of the model object 'Time Schedule'.
 *
 *
 *

 * The following features are supported:
 *

 *
{@link CIM15.IEC61968.Common.TimeSchedule#getRecurrencePeriod Recurrence Period}

 *
{@link CIM15.IEC61968.Common.TimeSchedule#isDisabled Disabled}

 *
{@link CIM15.IEC61968.Common.TimeSchedule#getTimePoints Time Points}

 *
{@link CIM15.IEC61968.Common.TimeSchedule#getOffset Offset}

 *
{@link CIM15.IEC61968.Common.TimeSchedule#getScheduleInterval Schedule Interval}

 *
{@link CIM15.IEC61968.Common.TimeSchedule#getRecurrencePattern Recurrence Pattern}

 *

 *

 *
 * @generated
 */
public class TimeSchedule extends Document {
	/**
	 * The default value of the '{@link #getRecurrencePeriod() Recurrence Period}' attribute.
	 *
	 *
	 * @see #getRecurrencePeriod()
	 * @generated
	 * @ordered
	 */
	protected static final float RECURRENCE_PERIOD_EDEFAULT = 0.0F;

	/**
	 * The cached value of the '{@link #getRecurrencePeriod() Recurrence Period}' attribute.
	 *
	 *
	 * @see #getRecurrencePeriod()
	 * @generated
	 * @ordered
	 */
	protected float recurrencePeriod = RECURRENCE_PERIOD_EDEFAULT;

	/**
	 * This is true if the Recurrence Period attribute has been set.
	 *
	 *
	 * @generated
	 * @ordered
	 */
	protected boolean recurrencePeriodESet;

	/**
	 * The default value of the '{@link #isDisabled() Disabled}' attribute.
	 *
	 *
	 * @see #isDisabled()
	 * @generated
	 * @ordered
	 */
	protected static final boolean DISABLED_EDEFAULT = false;

	/**
	 * The cached value of the '{@link #isDisabled() Disabled}' attribute.
	 *
	 *
	 * @see #isDisabled()
	 * @generated
	 * @ordered
	 */
	protected boolean disabled = DISABLED_EDEFAULT;

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

	/**
	 * The cached value of the '{@link #getTimePoints() Time Points}' reference list.
	 *
	 *
	 * @see #getTimePoints()
	 * @generated
	 * @ordered
	 */
	protected EList<TimePoint> timePoints;

	/**
	 * The default value of the '{@link #getOffset() Offset}' attribute.
	 *
	 *
	 * @see #getOffset()
	 * @generated
	 * @ordered
	 */
	protected static final float OFFSET_EDEFAULT = 0.0F;

	/**
	 * The cached value of the '{@link #getOffset() Offset}' attribute.
	 *
	 *
	 * @see #getOffset()
	 * @generated
	 * @ordered
	 */
	protected float offset = OFFSET_EDEFAULT;

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

	/**
	 * The cached value of the '{@link #getScheduleInterval() Schedule Interval}' containment reference.
	 *
	 *
	 * @see #getScheduleInterval()
	 * @generated
	 * @ordered
	 */
	protected DateTimeInterval scheduleInterval;

	/**
	 * The default value of the '{@link #getRecurrencePattern() Recurrence Pattern}' attribute.
	 *
	 *
	 * @see #getRecurrencePattern()
	 * @generated
	 * @ordered
	 */
	protected static final String RECURRENCE_PATTERN_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getRecurrencePattern() Recurrence Pattern}' attribute.
	 *
	 *
	 * @see #getRecurrencePattern()
	 * @generated
	 * @ordered
	 */
	protected String recurrencePattern = RECURRENCE_PATTERN_EDEFAULT;

	/**
	 * This is true if the Recurrence Pattern attribute has been set.
	 *
	 *
	 * @generated
	 * @ordered
	 */
	protected boolean recurrencePatternESet;

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

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

	/**
	 * Returns the value of the 'Recurrence Period' attribute.
	 *
	 *

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

	 *
	 * @return the value of the 'Recurrence Period' attribute.
	 * @see #isSetRecurrencePeriod()
	 * @see #unsetRecurrencePeriod()
	 * @see #setRecurrencePeriod(float)
	 * @generated
	 */
	public float getRecurrencePeriod() {
		return recurrencePeriod;
	}

	/**
	 * Sets the value of the '{@link CIM15.IEC61968.Common.TimeSchedule#getRecurrencePeriod Recurrence Period}' attribute.
	 *
	 *
	 * @param value the new value of the 'Recurrence Period' attribute.
	 * @see #isSetRecurrencePeriod()
	 * @see #unsetRecurrencePeriod()
	 * @see #getRecurrencePeriod()
	 * @generated
	 */
	public void setRecurrencePeriod(float newRecurrencePeriod) {
		recurrencePeriod = newRecurrencePeriod;
		recurrencePeriodESet = true;
	}

	/**
	 * Unsets the value of the '{@link CIM15.IEC61968.Common.TimeSchedule#getRecurrencePeriod Recurrence Period}' attribute.
	 *
	 *
	 * @see #isSetRecurrencePeriod()
	 * @see #getRecurrencePeriod()
	 * @see #setRecurrencePeriod(float)
	 * @generated
	 */
	public void unsetRecurrencePeriod() {
		recurrencePeriod = RECURRENCE_PERIOD_EDEFAULT;
		recurrencePeriodESet = false;
	}

	/**
	 * Returns whether the value of the '{@link CIM15.IEC61968.Common.TimeSchedule#getRecurrencePeriod Recurrence Period}' attribute is set.
	 *
	 *
	 * @return whether the value of the 'Recurrence Period' attribute is set.
	 * @see #unsetRecurrencePeriod()
	 * @see #getRecurrencePeriod()
	 * @see #setRecurrencePeriod(float)
	 * @generated
	 */
	public boolean isSetRecurrencePeriod() {
		return recurrencePeriodESet;
	}

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

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

	 *
	 * @return the value of the 'Disabled' attribute.
	 * @see #isSetDisabled()
	 * @see #unsetDisabled()
	 * @see #setDisabled(boolean)
	 * @generated
	 */
	public boolean isDisabled() {
		return disabled;
	}

	/**
	 * Sets the value of the '{@link CIM15.IEC61968.Common.TimeSchedule#isDisabled Disabled}' attribute.
	 *
	 *
	 * @param value the new value of the 'Disabled' attribute.
	 * @see #isSetDisabled()
	 * @see #unsetDisabled()
	 * @see #isDisabled()
	 * @generated
	 */
	public void setDisabled(boolean newDisabled) {
		disabled = newDisabled;
		disabledESet = true;
	}

	/**
	 * Unsets the value of the '{@link CIM15.IEC61968.Common.TimeSchedule#isDisabled Disabled}' attribute.
	 *
	 *
	 * @see #isSetDisabled()
	 * @see #isDisabled()
	 * @see #setDisabled(boolean)
	 * @generated
	 */
	public void unsetDisabled() {
		disabled = DISABLED_EDEFAULT;
		disabledESet = false;
	}

	/**
	 * Returns whether the value of the '{@link CIM15.IEC61968.Common.TimeSchedule#isDisabled Disabled}' attribute is set.
	 *
	 *
	 * @return whether the value of the 'Disabled' attribute is set.
	 * @see #unsetDisabled()
	 * @see #isDisabled()
	 * @see #setDisabled(boolean)
	 * @generated
	 */
	public boolean isSetDisabled() {
		return disabledESet;
	}

	/**
	 * Returns the value of the 'Time Points' reference list.
	 * The list contents are of type {@link CIM15.IEC61968.Common.TimePoint}.
	 * It is bidirectional and its opposite is '{@link CIM15.IEC61968.Common.TimePoint#getTimeSchedule Time Schedule}'.
	 *
	 *

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

	 *
	 * @return the value of the 'Time Points' reference list.
	 * @see CIM15.IEC61968.Common.TimePoint#getTimeSchedule
	 * @generated
	 */
	public EList<TimePoint> getTimePoints() {
		if (timePoints == null) {
			timePoints = new BasicInternalEList<TimePoint>(TimePoint.class);
		}
		return timePoints;
	}

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

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

	 *
	 * @return the value of the 'Offset' attribute.
	 * @see #isSetOffset()
	 * @see #unsetOffset()
	 * @see #setOffset(float)
	 * @generated
	 */
	public float getOffset() {
		return offset;
	}

	/**
	 * Sets the value of the '{@link CIM15.IEC61968.Common.TimeSchedule#getOffset Offset}' attribute.
	 *
	 *
	 * @param value the new value of the 'Offset' attribute.
	 * @see #isSetOffset()
	 * @see #unsetOffset()
	 * @see #getOffset()
	 * @generated
	 */
	public void setOffset(float newOffset) {
		offset = newOffset;
		offsetESet = true;
	}

	/**
	 * Unsets the value of the '{@link CIM15.IEC61968.Common.TimeSchedule#getOffset Offset}' attribute.
	 *
	 *
	 * @see #isSetOffset()
	 * @see #getOffset()
	 * @see #setOffset(float)
	 * @generated
	 */
	public void unsetOffset() {
		offset = OFFSET_EDEFAULT;
		offsetESet = false;
	}

	/**
	 * Returns whether the value of the '{@link CIM15.IEC61968.Common.TimeSchedule#getOffset Offset}' attribute is set.
	 *
	 *
	 * @return whether the value of the 'Offset' attribute is set.
	 * @see #unsetOffset()
	 * @see #getOffset()
	 * @see #setOffset(float)
	 * @generated
	 */
	public boolean isSetOffset() {
		return offsetESet;
	}

	/**
	 * Returns the value of the 'Schedule Interval' containment reference.
	 *
	 *

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

	 *
	 * @return the value of the 'Schedule Interval' containment reference.
	 * @see #setScheduleInterval(DateTimeInterval)
	 * @generated
	 */
	public DateTimeInterval getScheduleInterval() {
		return scheduleInterval;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public NotificationChain basicSetScheduleInterval(DateTimeInterval newScheduleInterval, NotificationChain msgs) {
		DateTimeInterval oldScheduleInterval = scheduleInterval;
		scheduleInterval = newScheduleInterval;
		return msgs;
	}

	/**
	 * Sets the value of the '{@link CIM15.IEC61968.Common.TimeSchedule#getScheduleInterval Schedule Interval}' containment reference.
	 *
	 *
	 * @param value the new value of the 'Schedule Interval' containment reference.
	 * @see #getScheduleInterval()
	 * @generated
	 */
	public void setScheduleInterval(DateTimeInterval newScheduleInterval) {
		if (newScheduleInterval != scheduleInterval) {
			NotificationChain msgs = null;
			if (scheduleInterval != null)
				msgs = ((InternalEObject)scheduleInterval).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - CommonPackage.TIME_SCHEDULE__SCHEDULE_INTERVAL, null, msgs);
			if (newScheduleInterval != null)
				msgs = ((InternalEObject)newScheduleInterval).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - CommonPackage.TIME_SCHEDULE__SCHEDULE_INTERVAL, null, msgs);
			msgs = basicSetScheduleInterval(newScheduleInterval, msgs);
			if (msgs != null) msgs.dispatch();
		}
	}

	/**
	 * Returns the value of the 'Recurrence Pattern' attribute.
	 *
	 *

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

	 *
	 * @return the value of the 'Recurrence Pattern' attribute.
	 * @see #isSetRecurrencePattern()
	 * @see #unsetRecurrencePattern()
	 * @see #setRecurrencePattern(String)
	 * @generated
	 */
	public String getRecurrencePattern() {
		return recurrencePattern;
	}

	/**
	 * Sets the value of the '{@link CIM15.IEC61968.Common.TimeSchedule#getRecurrencePattern Recurrence Pattern}' attribute.
	 *
	 *
	 * @param value the new value of the 'Recurrence Pattern' attribute.
	 * @see #isSetRecurrencePattern()
	 * @see #unsetRecurrencePattern()
	 * @see #getRecurrencePattern()
	 * @generated
	 */
	public void setRecurrencePattern(String newRecurrencePattern) {
		recurrencePattern = newRecurrencePattern;
		recurrencePatternESet = true;
	}

	/**
	 * Unsets the value of the '{@link CIM15.IEC61968.Common.TimeSchedule#getRecurrencePattern Recurrence Pattern}' attribute.
	 *
	 *
	 * @see #isSetRecurrencePattern()
	 * @see #getRecurrencePattern()
	 * @see #setRecurrencePattern(String)
	 * @generated
	 */
	public void unsetRecurrencePattern() {
		recurrencePattern = RECURRENCE_PATTERN_EDEFAULT;
		recurrencePatternESet = false;
	}

	/**
	 * Returns whether the value of the '{@link CIM15.IEC61968.Common.TimeSchedule#getRecurrencePattern Recurrence Pattern}' attribute is set.
	 *
	 *
	 * @return whether the value of the 'Recurrence Pattern' attribute is set.
	 * @see #unsetRecurrencePattern()
	 * @see #getRecurrencePattern()
	 * @see #setRecurrencePattern(String)
	 * @generated
	 */
	public boolean isSetRecurrencePattern() {
		return recurrencePatternESet;
	}

	/**
	 *
	 *
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case CommonPackage.TIME_SCHEDULE__TIME_POINTS:
				return ((InternalEList<InternalEObject>)(InternalEList<?>)getTimePoints()).basicAdd(otherEnd, msgs);
		}
		return super.eInverseAdd(otherEnd, featureID, msgs);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case CommonPackage.TIME_SCHEDULE__TIME_POINTS:
				return ((InternalEList<?>)getTimePoints()).basicRemove(otherEnd, msgs);
			case CommonPackage.TIME_SCHEDULE__SCHEDULE_INTERVAL:
				return basicSetScheduleInterval(null, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case CommonPackage.TIME_SCHEDULE__RECURRENCE_PERIOD:
				return getRecurrencePeriod();
			case CommonPackage.TIME_SCHEDULE__DISABLED:
				return isDisabled();
			case CommonPackage.TIME_SCHEDULE__TIME_POINTS:
				return getTimePoints();
			case CommonPackage.TIME_SCHEDULE__OFFSET:
				return getOffset();
			case CommonPackage.TIME_SCHEDULE__SCHEDULE_INTERVAL:
				return getScheduleInterval();
			case CommonPackage.TIME_SCHEDULE__RECURRENCE_PATTERN:
				return getRecurrencePattern();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case CommonPackage.TIME_SCHEDULE__RECURRENCE_PERIOD:
				setRecurrencePeriod((Float)newValue);
				return;
			case CommonPackage.TIME_SCHEDULE__DISABLED:
				setDisabled((Boolean)newValue);
				return;
			case CommonPackage.TIME_SCHEDULE__TIME_POINTS:
				getTimePoints().clear();
				getTimePoints().addAll((Collection<? extends TimePoint>)newValue);
				return;
			case CommonPackage.TIME_SCHEDULE__OFFSET:
				setOffset((Float)newValue);
				return;
			case CommonPackage.TIME_SCHEDULE__SCHEDULE_INTERVAL:
				setScheduleInterval((DateTimeInterval)newValue);
				return;
			case CommonPackage.TIME_SCHEDULE__RECURRENCE_PATTERN:
				setRecurrencePattern((String)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case CommonPackage.TIME_SCHEDULE__RECURRENCE_PERIOD:
				unsetRecurrencePeriod();
				return;
			case CommonPackage.TIME_SCHEDULE__DISABLED:
				unsetDisabled();
				return;
			case CommonPackage.TIME_SCHEDULE__TIME_POINTS:
				getTimePoints().clear();
				return;
			case CommonPackage.TIME_SCHEDULE__OFFSET:
				unsetOffset();
				return;
			case CommonPackage.TIME_SCHEDULE__SCHEDULE_INTERVAL:
				setScheduleInterval((DateTimeInterval)null);
				return;
			case CommonPackage.TIME_SCHEDULE__RECURRENCE_PATTERN:
				unsetRecurrencePattern();
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 *
	 *
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case CommonPackage.TIME_SCHEDULE__RECURRENCE_PERIOD:
				return isSetRecurrencePeriod();
			case CommonPackage.TIME_SCHEDULE__DISABLED:
				return isSetDisabled();
			case CommonPackage.TIME_SCHEDULE__TIME_POINTS:
				return timePoints != null && !timePoints.isEmpty();
			case CommonPackage.TIME_SCHEDULE__OFFSET:
				return isSetOffset();
			case CommonPackage.TIME_SCHEDULE__SCHEDULE_INTERVAL:
				return scheduleInterval != null;
			case CommonPackage.TIME_SCHEDULE__RECURRENCE_PATTERN:
				return isSetRecurrencePattern();
		}
		return super.eIsSet(featureID);
	}

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

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (recurrencePeriod: ");
		if (recurrencePeriodESet) result.append(recurrencePeriod); else result.append("<unset>");
		result.append(", disabled: ");
		if (disabledESet) result.append(disabled); else result.append("<unset>");
		result.append(", offset: ");
		if (offsetESet) result.append(offset); else result.append("<unset>");
		result.append(", recurrencePattern: ");
		if (recurrencePatternESet) result.append(recurrencePattern); else result.append("<unset>");
		result.append(')');
		return result.toString();
	}

} // TimeSchedule


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

    <string name="app_name">Doppler</string>
    <string name="hello_world">Hello world!</string>
    <string name="action_settings">Settings</string>

</resources>

redpajama_set_name: RedPajamaGithub


text: Provide the docker registry you want to use to pull the JNLP image if none is specified


text:
@implementation Player_3

- (void)runWithStick:(Stick *)stick {
    NSLog(@"选手三拿着%@跑", stick);
    [self.nextPlayer runWithStick:stick];
}

@end


text:
package com.ikut.navigation;

public class NavigationItemAdapter {

	public String title;
	public int counter;
	public int icon;
	public boolean isHeader;

	public NavigationItemAdapter(String title, int icon, boolean header,int counter) {
		this.title = title;
		this.icon = icon;
		this.isHeader = header;
		this.counter = counter;
	}

	public NavigationItemAdapter(String title, int icon, boolean header){
		this(title, icon, header, 0 );
	}

	public NavigationItemAdapter(String title, int icon) {
		this(title, icon, false);
	}
}


text:
@interface ARNBlackMagicObject : NSObject

@property (nonatomic, strong) id        testObj;
@property (nonatomic, assign) NSInteger count;
@property (nonatomic, assign) BOOL      testBOOL;
@property (nonatomic, copy) NSString   *testString;
@property (nonatomic, copy) NSArray    *testArray;

+ (void)testBlockClassMethod;
- (void)testBlockInstanceMethod;

+ (NSString *)testClassMethodA;
+ (NSString *)testClassMethodB;

- (NSString *)testInstanceMethodA;
- (NSString *)testInstanceMethodB;

- (void)testSnedMessage1;
- (NSString *)testSnedMessage2;
- (NSString *)testSnedMessage3:(NSString *)text;
- (NSString *)testSnedMessage4:(NSString *)text nextText:(NSString *)nextText;

+ (NSString *)testSnedClassMessage1;
+ (NSString *)testSnedClassMessage2:(NSString *)text;
+ (NSString *)testSnedClassMessage3:(NSString *)text nextText:(NSString *)nextText;

- (void)testAddingWithString:(NSString *)aString number:(NSNumber *)number integerValue:(NSInteger)integerValue;

@end


text:
package renameScrobbles;

import java.util.List;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

/**
 * Handles all the API keys
 * @author Alex
 *
 */
public class APIHandler {

	/**
	 * Reads the api key from the specified file
	 * File should just consist of twos line - the api key, and the secret key
	 * @param directory The path of the file to read the key from
	 * @author Alex
	 */
	public void readApiKeyFromFile(String directory) {
		Path path = Paths.get(directory);
		try {
			List<String> lines = Files.readAllLines(path, StandardCharsets.UTF_8);
			apiKey = lines.get(0);
			apiSecret = lines.get(1);
		} catch (IOException e) {
			apiKey = "";
			apiSecret = "";
		}
	}

	/**
	 * The last fm api key
	 */
	public String apiKey;

	/**
	 * Secret key for the api
	 */
	public String apiSecret;
}


text:
from __future__ import division, print_function
import sys

sys.path.insert(1, "../../")
from tests import pyunit_utils
import numpy as np
from pandas.testing import assert_frame_equal
from sklearn.datasets import make_regression
from sklearn.isotonic import IsotonicRegression
from h2o import H2OFrame
from h2o.expr import ExprNode

def pav(y, X, w):
    # make H2O Frame (y, X, w)
    frame = H2OFrame(np.column_stack((y, X, w)))
    return H2OFrame._expr(expr=ExprNode("isotonic.pav", frame))[["C1", "C2"]]

def test_pav(y, X, w):
    X = X.reshape(-1)
    # run Isotonic Regression to extract thresholds
    iso_reg = IsotonicRegression().fit(X, y, w)
    thresholds_scikit = H2OFrame(np.column_stack(get_thresholds(iso_reg)))
    print(thresholds_scikit.as_data_frame())

    # now invoke H2O PAVA
    thresholds_h2o = pav(y, X, w)
    print(thresholds_h2o.as_data_frame())

    assert_frame_equal(thresholds_scikit.as_data_frame(), thresholds_h2o.as_data_frame())

def is_old_sklearn(fitted):
    # to be compatible with old sklearn (reference version 0.22.1)
    return hasattr(fitted, '_necessary_X_')

def get_thresholds(iso_reg):
    if is_old_sklearn(iso_reg):
        return iso_reg._necessary_y_, iso_reg._necessary_X_
    else:
        return iso_reg.y_thresholds_, iso_reg.X_thresholds_

def test_pav_trivial():
    X = np.array([0.1, 0.2, 0.3])
    y = np.array([0.1, 0.2, 0.3])
    w = np.array([1.0, 1.0, 1.0])
    test_pav(y, X, w)

def test_pav_constant_weights():
    X, y = make_regression(n_samples=10000, n_features=1, random_state=41, noise=0.8)
    w = np.full(y.shape, 1)
    test_pav(y, X, w)

def test_pav_random_weights():
    X, y = make_regression(n_samples=10000, n_features=1, random_state=41, noise=0.8)
    w = np.random.random_sample(y.shape)
    test_pav(y, X, w)

def test_pav_01_weights():
    X, y = make_regression(n_samples=10000, n_features=1, random_state=41, noise=0.8)
    w = np.random.randint(low=0, high=2, size=y.shape)
    test_pav(y, X, w)

if __name__ == "__main__":
    pyunit_utils.run_tests([
        test_pav_trivial,
        test_pav_constant_weights,
        test_pav_random_weights,
        test_pav_01_weights
    ])
else:
    test_pav_trivial()
    test_pav_constant_weights()
    test_pav_random_weights()
    test_pav_01_weights()


text:
namespace energy_control
{
    partial class formMain
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.panelMenu = new System.Windows.Forms.Panel();
            this.lblSeperator2 = new System.Windows.Forms.Label();
            this.lblSeperator3 = new System.Windows.Forms.Label();
            this.btnBills = new System.Windows.Forms.Button();
            this.lblSeperator = new System.Windows.Forms.Label();
            this.btnConsumers = new System.Windows.Forms.Button();
            this.btnConfig = new System.Windows.Forms.Button();
            this.label1 = new System.Windows.Forms.Label();
            this.panelMenu.SuspendLayout();
            this.SuspendLayout();
            //
            // panelMenu
            //
            this.panelMenu.BackColor = System.Drawing.Color.DimGray;
            this.panelMenu.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.panelMenu.Controls.Add(this.label1);
            this.panelMenu.Controls.Add(this.btnConfig);
            this.panelMenu.Controls.Add(this.lblSeperator2);
            this.panelMenu.Controls.Add(this.lblSeperator3);
            this.panelMenu.Controls.Add(this.btnBills);
            this.panelMenu.Controls.Add(this.lblSeperator);
            this.panelMenu.Controls.Add(this.btnConsumers);
            this.panelMenu.Location = new System.Drawing.Point(0, 0);
            this.panelMenu.Name = "panelMenu";
            this.panelMenu.Size = new System.Drawing.Size(176, 360);
            this.panelMenu.TabIndex = 0;
            //
            // lblSeperator2
            //
            this.lblSeperator2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.lblSeperator2.Location = new System.Drawing.Point(-1, 74);
            this.lblSeperator2.Name = "lblSeperator2";
            this.lblSeperator2.Size = new System.Drawing.Size(177, 2);
            this.lblSeperator2.TabIndex = 2;
            //
            // lblSeperator3
            //
            this.lblSeperator3.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.lblSeperator3.Location = new System.Drawing.Point(-2, 99);
            this.lblSeperator3.Name = "lblSeperator3";
            this.lblSeperator3.Size = new System.Drawing.Size(177, 2);
            this.lblSeperator3.TabIndex = 4;
            //
            // btnBills
            //
            this.btnBills.Cursor = System.Windows.Forms.Cursors.Hand;
            this.btnBills.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
            this.btnBills.FlatAppearance.BorderSize = 0;
            this.btnBills.FlatAppearance.MouseDownBackColor = System.Drawing.Color.LightSeaGreen;
            this.btnBills.FlatAppearance.MouseOverBackColor = System.Drawing.Color.MediumTurquoise;
            this.btnBills.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.btnBills.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.btnBills.ForeColor = System.Drawing.Color.White;
            this.btnBills.Location = new System.Drawing.Point(-1, 76);
            this.btnBills.Name = "btnBills";
            this.btnBills.Size = new System.Drawing.Size(176, 23);
            this.btnBills.TabIndex = 3;
            this.btnBills.Text = "Contas";
            this.btnBills.UseVisualStyleBackColor = true;
            this.btnBills.Click += new System.EventHandler(this.btnBills_Click);
            //
            // lblSeperator
            //
            this.lblSeperator.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.lblSeperator.Location = new System.Drawing.Point(-1, 50);
            this.lblSeperator.Name = "lblSeperator";
            this.lblSeperator.Size = new System.Drawing.Size(177, 2);
            this.lblSeperator.TabIndex = 1;
            //
            // btnConsumers
            //
            this.btnConsumers.Cursor = System.Windows.Forms.Cursors.Hand;
            this.btnConsumers.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
            this.btnConsumers.FlatAppearance.BorderSize = 0;
            this.btnConsumers.FlatAppearance.MouseDownBackColor = System.Drawing.Color.LightSeaGreen;
            this.btnConsumers.FlatAppearance.MouseOverBackColor = System.Drawing.Color.MediumTurquoise;
            this.btnConsumers.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.btnConsumers.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.btnConsumers.ForeColor = System.Drawing.Color.White;
            this.btnConsumers.Location = new System.Drawing.Point(0, 51);
            this.btnConsumers.Name = "btnConsumers";
            this.btnConsumers.Size = new System.Drawing.Size(176, 23);
            this.btnConsumers.TabIndex = 0;
            this.btnConsumers.Text = "Consumidores";
            this.btnConsumers.UseVisualStyleBackColor = true;
            this.btnConsumers.Click += new System.EventHandler(this.btnConsumers_Click);
            //
            // btnConfig
            //
            this.btnConfig.Cursor = System.Windows.Forms.Cursors.Hand;
            this.btnConfig.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
            this.btnConfig.FlatAppearance.BorderSize = 0;
            this.btnConfig.FlatAppearance.MouseDownBackColor = System.Drawing.Color.LightSeaGreen;
            this.btnConfig.FlatAppearance.MouseOverBackColor = System.Drawing.Color.MediumTurquoise;
            this.btnConfig.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.btnConfig.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.btnConfig.ForeColor = System.Drawing.Color.White;
            this.btnConfig.Location = new System.Drawing.Point(0, 102);
            this.btnConfig.Name = "btnConfig";
            this.btnConfig.Size = new System.Drawing.Size(176, 23);
            this.btnConfig.TabIndex = 5;
            this.btnConfig.Text = "Configurações";
            this.btnConfig.UseVisualStyleBackColor = true;
            this.btnConfig.Click += new System.EventHandler(this.btnConfig_Click);
            //
            // label1
            //
            this.label1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.label1.Location = new System.Drawing.Point(0, 125);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(177, 2);
            this.label1.TabIndex = 6;
            //
            // formMain
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.AutoSize = true;
            this.BackColor = System.Drawing.Color.White;
            this.ClientSize = new System.Drawing.Size(758, 352);
            this.Controls.Add(this.panelMenu);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            this.IsMdiContainer = true;
            this.MaximizeBox = false;
            this.Name = "formMain";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "Energy Control";
            this.panelMenu.ResumeLayout(false);
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.Panel panelMenu;
        private System.Windows.Forms.Button btnConsumers;
        private System.Windows.Forms.Label lblSeperator;
        private System.Windows.Forms.Label lblSeperator2;
        private System.Windows.Forms.Label lblSeperator3;
        private System.Windows.Forms.Button btnBills;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button btnConfig;
    }
}


text:
IMPLEMENT_SINGLETON(CShaderMgr)

CShaderMgr::CShaderMgr()
{
}

CShaderMgr::~CShaderMgr()
{
	Release();
}

HRESULT CShaderMgr::AddShaderFiles(wstring wstrShaderTag, wstring wstrFilePath, LPCSTR wstrShaderName, LPCSTR wstrShaderVersion, ShaderType _eType)
{
	CShader*		pShader = Find_Shader(wstrShaderTag);
	NULL_CHECK_RETURN(!pShader, E_FAIL);

	pShader = CShader::Create(wstrFilePath, wstrShaderName, wstrShaderVersion, _eType);

	NULL_CHECK_RETURN(pShader, E_FAIL);

	m_mapShader.insert(map<wstring, CShader*>::value_type(wstrShaderTag, pShader));
	return S_OK;
}

CShader * CShaderMgr::Clone_Shader(wstring wstrShaderTag)
{
	CShader*		pShader = Find_Shader(wstrShaderTag);
	if (pShader == NULL)
		return NULL;

	return pShader->CloneShader();
}

CShader * CShaderMgr::Find_Shader(wstring wstrShaderTag)
{
	map<wstring, CShader*>::iterator iter = m_mapShader.find(wstrShaderTag);

	if (iter == m_mapShader.end())
		return NULL;

	return iter->second;
}

void CShaderMgr::Release(void)
{
	map<wstring, CShader*>::iterator iter = m_mapShader.begin();
	map<wstring, CShader*>::iterator iter_end = m_mapShader.end();

	for (iter; iter != iter_end; ++iter)
	{
		Safe_Delete(iter->second);
	}

}