text:
namespace base {
class TickClock;
}

namespace cc {
struct BeginMainFrameMetrics;
}

namespace ukm {
class UkmRecorder;
}

namespace blink {

enum class DocumentUpdateReason;

// This class aggregates and records time based UKM and UMA metrics
// for LocalFrameView. The simplest way to use it is via the
// SCOPED_UMA_AND_UKM_TIMER macro combined with
// LocalFrameView::RecordEndOfFrameMetrics.
//
// It takes the following constructor parameters:
// - source_id: UKM Source ID associated with the events.
// - recorder: UkmRecorder which will handle the events
//
// The aggregator manages all of the UKM and UMA names for LocalFrameView.
// It constructs and takes ownership of the UMA counters when constructed
// itself. We do this to localize all UMA and UKM metrics in one place, so
// that adding a metric is localized to the cc file of this class, protected
// from errors that might arise when adding names in multiple places.
//
// After the aggregator is created, one can create ScopedUkmHierarchicalTimer
// objects that will measure the time, in microseconds, from creation until
// the object is destroyed for sub-metrics. When destroyed, it may record
// a sample into the aggregator and the current frame's accumulated time for
// that metric, and it always reports UMA values.
//
// See the MetricNames enum below for the set of metrics recorded. Add an
// entry to that enum to add a new metric.
//
// When the primary timed execution completes, this aggregator stores the
// primary time and computes metrics that depend on it. UMA metrics are updated
// at this time.
//
// A UKM event is generated according to a sampling strategy, with the goal
// being to choose one frame to report before First Contentful Paint and
// one frame to report during the subsequent document lifetime. We maintain
// a copy of the current sample, and randomly choose to update it on each frame
// such that any given frame is equally likely to be the final sample.
//
// Sample usage (see also SCOPED_UMA_AND_UKM_TIMER):
//   std::unique_ptr<LocalFrameUkmAggregator> aggregator(
//      new LocalFrameUkmAggregator(
//              GetSourceId(),
//              GetUkmRecorder());
//   ...
//   {
//     auto timer =
//         aggregator->GetScopedTimer(static_cast<size_t>(
//             LocalFrameUkmAggregator::MetricNames::kMetric2));
//     ...
//   }
//   // At this point data for kMetric2 is recorded.
//   ...
//   // When the primary time completes
//   aggregator->RecordEndOfFrameMetrics(start, end, trackers);
//   // This records a primary sample and the sub-metrics that depend on it.
//   // It may generate an event. trackers is a bit encoding of the active frame
//.  // sequence trackers, informing us of why the BeginMainFrame was requested.
//
// In the example above, the event name is "my_event". It will measure 4
// metrics:
//   "primary_metric",
//   "sub_metric1",
//   "sub_metric2",
//   "sub_metric3"
//
// It will report 4 UMA values:
//   "primary_uma_counter",
//   "sub_uma_metric1", "sub_uma_metric2", "sub_uma_metric3"
//
// Note that these have to be specified in the appropriate ukm.xml file
// and histograms.xml file. Runtime errors indicate missing or mis-named
// metrics.
//
// If the source_id/recorder changes then a new  LocalFrameUkmAggregator has to
// be created.

// Defines a UKM that is part of a hierarchical ukm, recorded in
// microseconds equal to the duration of the current lexical scope after
// declaration of the macro. Example usage:
//
// void LocalFrameView::DoExpensiveThing() {
//   SCOPED_UMA_AND_UKM_TIMER(kUkmEnumName);
//   // Do computation of expensive thing
//
// }
//
// |ukm_enum| should be an entry in LocalFrameUkmAggregator's enum of
// metric names (which in turn corresponds to names from ukm.xml).
#define SCOPED_UMA_AND_UKM_TIMER(aggregator, ukm_enum) \
  auto scoped_ukm_hierarchical_timer =                 \
      aggregator.GetScopedTimer(static_cast<size_t>(ukm_enum));

class CORE_EXPORT LocalFrameUkmAggregator
    : public RefCounted<LocalFrameUkmAggregator> {
 public:
  // Changing these values requires changing the names of metrics specified
  // below. For every metric name added here, add an entry in the array in
  // metrics_data() below.
  enum MetricId {
    kCompositingCommit,
    kCompositingInputs,
    kImplCompositorCommit,
    kIntersectionObservation,
    kIntersectionObservationInternalCount,
    kIntersectionObservationJavascriptCount,
    kPaint,
    kPrePaint,
    kStyle,
    kLayout,
    kHandleInputEvents,
    kAnimate,
    kUpdateLayers,
    kWaitForCommit,
    kDisplayLockIntersectionObserver,
    kJavascriptIntersectionObserver,
    kLazyLoadIntersectionObserver,
    kMediaIntersectionObserver,
    kAnchorElementMetricsIntersectionObserver,
    kUpdateViewportIntersection,
    kForcedStyleAndLayout,
    kContentDocumentUpdate,
    kHitTestDocumentUpdate,
    kJavascriptDocumentUpdate,
    kScrollDocumentUpdate,
    kServiceDocumentUpdate,
    kUserDrivenDocumentUpdate,
    kParseStyleSheet,
    kAccessibility,
    kCount,
    kMainFrame
  };

  // For metrics that require it, this converts the input value to use
  // exponential bucketing.
  static int64_t ApplyBucketIfNecessary(int64_t value, unsigned metric_id);

  typedef struct MetricInitializationData {
    const char* const name;
    bool has_uma;
  } MetricInitializationData;

 private:
  friend class LocalFrameUkmAggregatorTest;
  friend class LocalFrameUkmAggregatorSimTest;

  // Primary metric name
  static const char* primary_metric_name() { return "MainFrame"; }

  // Add an entry in this array every time a new metric is added.
  static base::span<const MetricInitializationData> metrics_data() {
    static const MetricInitializationData data[] = {
        {"CompositingCommit", true},
        {"CompositingInputs", true},
        {"ImplCompositorCommit", true},
        {"IntersectionObservation", true},
        {"IntersectionObservationInternalCount", true},
        {"IntersectionObservationJavascriptCount", true},
        {"Paint", true},
        {"PrePaint", true},
        {"Style", true},
        {"Layout", true},
        {"HandleInputEvents", true},
        {"Animate", true},
        {"UpdateLayers", false},
        {"WaitForCommit", true},
        {"DisplayLockIntersectionObserver", true},
        {"JavascriptIntersectionObserver", true},
        {"LazyLoadIntersectionObserver", true},
        {"MediaIntersectionObserver", true},
        {"AnchorElementMetricsIntersectionObserver", true},
        {"UpdateViewportIntersection", true},
        {"ForcedStyleAndLayout", true},
        {"ContentDocumentUpdate", true},
        {"HitTestDocumentUpdate", true},
        {"JavascriptDocumentUpdate", true},
        {"ScrollDocumentUpdate", true},
        {"ServiceDocumentUpdate", true},
        {"UserDrivenDocumentUpdate", true},
        {"ParseStyleSheet", true},
        {"Accessibility", true}};
    static_assert(std::size(data) == kCount, "Metrics data mismatch");
    return data;
  }

 public:
  // This class will start a timer upon creation, which will end when the
  // object is destroyed. Upon destruction it will record a sample into the
  // aggregator that created the scoped timer. It will also record an event
  // into the histogram counter.
  class CORE_EXPORT ScopedUkmHierarchicalTimer {
    STACK_ALLOCATED();

   public:
    ScopedUkmHierarchicalTimer(ScopedUkmHierarchicalTimer&&);
    ScopedUkmHierarchicalTimer(const ScopedUkmHierarchicalTimer&) = delete;
    ScopedUkmHierarchicalTimer& operator=(const ScopedUkmHierarchicalTimer&) =
        delete;
    ~ScopedUkmHierarchicalTimer();

   private:
    friend class LocalFrameUkmAggregator;

    ScopedUkmHierarchicalTimer(scoped_refptr<LocalFrameUkmAggregator>,
                               size_t metric_index,
                               const base::TickClock* clock);

    scoped_refptr<LocalFrameUkmAggregator> aggregator_;
    const size_t metric_index_;
    const base::TickClock* clock_;
    const base::TimeTicks start_time_;
  };

  // This is an optimization for the case where we would otherwise instantiate a
  // ScopedUkmHierarchicalTimer in the body of a loop. On some platforms,
  // TickClock::NowTicks() is weirdly expensive. Compared to
  // ScopedUkmHierarchicalTimer, this class makes fewer calls to NowTicks() by
  // reusing a single timestamp as the end of one measurement and the beginning
  // of the next.
  class CORE_EXPORT IterativeTimer {
    STACK_ALLOCATED();

   public:
    IterativeTimer(LocalFrameUkmAggregator&);
    ~IterativeTimer();
    // Start a time interval measurement for the given metric, completing the
    // prior interval measurement if necessary.
    void StartInterval(int64_t metric_index);

   private:
    void Record(bool should_record_prev_metric, bool should_record_next_metric);
    scoped_refptr<LocalFrameUkmAggregator> aggregator_;
    base::TimeTicks start_time_;
    int64_t metric_index_ = -1;
  };

  LocalFrameUkmAggregator(int64_t source_id, ukm::UkmRecorder*);
  LocalFrameUkmAggregator(const LocalFrameUkmAggregator&) = delete;
  LocalFrameUkmAggregator& operator=(const LocalFrameUkmAggregator&) = delete;
  ~LocalFrameUkmAggregator();

  const base::TickClock* GetClock() const { return clock_; }

  // For performance reasons, we don't record all metrics for all frames.
  bool ShouldMeasureMetric(int64_t metric_id) const;

  // Create a scoped timer with the index of the metric. Note the index must
  // correspond to the matching index in metric_names.
  ScopedUkmHierarchicalTimer GetScopedTimer(size_t metric_index);

  // Record a main frame time metric, that also computes the ratios for the
  // sub-metrics and generates UMA samples. UKM is only reported when
  // BeginMainFrame() had been called. All counters are cleared when this method
  // is called. trackers is a bit encoding of the active frame sequence
  // trackers, telling us the reasons for requesting a BeginMainFrame.
  void RecordEndOfFrameMetrics(base::TimeTicks start,
                               base::TimeTicks end,
                               cc::ActiveFrameSequenceTrackers trackers);

  // Record a sample for a sub-metric. This should only be used when
  // a ScopedUkmHierarchicalTimer cannot be used (such as when the timed
  // interval does not fall inside a single calling function).
  void RecordTimerSample(size_t metric_index,
                         base::TimeTicks start,
                         base::TimeTicks end);

  // Record a sample for a count-based sub-metric.
  void RecordCountSample(size_t metric_index, int64_t count);

  // Record a ForcedLayout sample. The reason will determine which, if any,
  // additional metrics are reported in order to diagnose the cause of
  // ForcedLayout regressions.
  void RecordForcedLayoutSample(DocumentUpdateReason reason,
                                base::TimeTicks start,
                                base::TimeTicks end);

  // Record a sample for the impl-side compositor processing.
  // - requested is the time the renderer proxy requests a commit
  // - started is the time the impl thread begins processing the request
  // - completed is the time the renderer proxy receives notification that the
  //   commit is complete.
  void RecordImplCompositorSample(base::TimeTicks requested,
                                  base::TimeTicks started,
                                  base::TimeTicks completed);

  // Mark the beginning of a main frame update.
  void BeginMainFrame();

  // Inform the aggregator that we have reached First Contentful Paint.
  // The UKM event for the pre-FCP period will be recorded and UMA for
  // aggregated contributions to FCP are reported.
  void DidReachFirstContentfulPaint();

  bool InMainFrameUpdate() { return in_main_frame_update_; }

  // Populate a BeginMainFrameMetrics structure with the latency numbers for
  // the most recent frame. Must be called when within a main frame update.
  // That is, after calling BeginMainFrame and before calling
  // RecordEndOfFrameMetrics.
  std::unique_ptr<cc::BeginMainFrameMetrics> GetBeginMainFrameMetrics();

  bool IsBeforeFCPForTesting() const;

  void SetIntersectionObserverSamplePeriod(size_t period) {
    intersection_observer_sample_period_ = period;
  }

 private:
  struct AbsoluteMetricRecord {
    std::unique_ptr<CustomCountHistogram> pre_fcp_uma_counter;
    std::unique_ptr<CustomCountHistogram> post_fcp_uma_counter;
    std::unique_ptr<CustomCountHistogram> uma_aggregate_counter;

    // Accumulated at each sample, then reset with a call to
    // RecordEndOfFrameMetrics.
    int64_t interval_count = 0;

    // Accumulated at each sample when within a BeginMainFrame,
    // reset with a call to RecordEndOfFrameMetrics.
    int64_t main_frame_count = 0;

    // Accumulated at each sample up to the time of First Contentful Paint.
    int64_t pre_fcp_aggregate = 0;

    void reset();
  };

  struct SampleToRecord {
    int64_t primary_metric_count;
    std::array<int64_t, kCount> sub_metrics_counts;
    std::array<int64_t, kCount> sub_main_frame_counts;
    cc::ActiveFrameSequenceTrackers trackers;
  };

  void UpdateEventTimeAndUpdateSampleIfNeeded(
      cc::ActiveFrameSequenceTrackers trackers);
  void UpdateSample(cc::ActiveFrameSequenceTrackers trackers);
  void ResetAllMetrics();

  // Reports the current sample to the UKM system. Called on the first main
  // frame update after First Contentful Paint and at destruction. Also resets
  // the frame count.
  void ReportUpdateTimeEvent();

  // Reports the Blink.PageLoad to the UKM system. Called on the first main
  // frame after First Contentful Paint.
  void ReportPreFCPEvent();

  // To test event sampling. Controls whether we update the current sample
  // on the next frame, or do not. Values persist until explicitly changed.
  void ChooseNextFrameForTest();
  void DoNotChooseNextFrameForTest();

  // The caller is the owner of the |clock|. The |clock| must outlive the
  // LocalFrameUkmAggregator.
  void SetTickClockForTesting(const base::TickClock* clock);

  // UKM system data
  const int64_t source_id_;
  ukm::UkmRecorder* const recorder_;
  const base::TickClock* clock_;

  // Event and metric data
  const char* const event_name_;
  AbsoluteMetricRecord primary_metric_;
  std::array<AbsoluteMetricRecord, kCount> absolute_metric_records_;

  // The current sample to report. When RecordEvent() is called we
  // check for uniform_random[0,1) < 1 / n where n is the number of frames
  // we have seen (including this one). If true, we replace the sample with
  // the current frame data. The result is a uniformly randomly chosen frame
  // in the period between the frame counter being reset and the recording
  // to the UKM system of the current sample.
  // This process is designed to get maximum utility while only sending 2
  // events per page load, which in turn maximizes client counts.
  SampleToRecord current_sample_;
  unsigned frames_since_last_report_ = 0;

  // Control for the ForcedStyleAndUpdate UMA metric sampling
  unsigned mean_calls_between_forced_style_layout_uma_ = 500;
  unsigned calls_to_next_forced_style_layout_uma_ = 0;

  // Set by BeginMainFrame() and cleared in RecordMEndOfFrameMetrics.
  // Main frame metrics are only recorded if this is true.
  bool in_main_frame_update_ = false;

  // A bitfield maintaining state for first contentful paint.
  enum FCPState { kBeforeFCPSignal, kThisFrameReachedFCP, kHavePassedFCP };
  FCPState fcp_state_ = kBeforeFCPSignal;

  // A bitfield used to control updating the sample for tests.
  enum SampleControlForTest {
    kNoPreference,
    kMustChooseNextFrame,
    kMustNotChooseNextFrame
  };
  SampleControlForTest next_frame_sample_control_for_test_ = kNoPreference;

  // When they are collected, the overhead of granular IntersectionObserver
  // metrics is a large part of overall LocalFrameUkmAggregator overhead. The
  // granular metrics are useful for pinpointing regressions, but we can get
  // most of the benefit even if we downsample them. This value controls how
  // frequently we collect granular IntersectionObserver metrics.
  size_t intersection_observer_sample_period_ = 1;
};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_CORE_FRAME_LOCAL_FRAME_UKM_AGGREGATOR_H_


text:
using System.Text;

namespace Microsoft.PythonTools.Parsing.Ast {
    public class StarredExpression : Expression {
        private readonly Expression _expr;

        public StarredExpression(Expression expr) {
            _expr = expr;
        }

        public Expression Expression {
            get {
                return _expr;
            }
        }

        public override void Walk(PythonWalker walker) {
            if (walker.Walk(this)) {
                _expr.Walk(walker);
            }
        }

        internal override string CheckAssign() {
            return null;
        }

        internal override string CheckAugmentedAssign() {
            return "invalid syntax";
        }

        internal override void AppendCodeString(StringBuilder res, PythonAst ast, CodeFormattingOptions format) {
            res.Append(this.GetProceedingWhiteSpace(ast));
            res.Append('*');
            _expr.AppendCodeString(res, ast, format);
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
package put.poznan.ai.dao;

import java.util.List;

import put.poznan.ai.models.User;

public interface UserDao extends BaseDao<User> {

	public List<User> selectByUsername(String username);

}


text:
IWNDProc* WNDProcController::m_instance = NULL;
LRESULT WNDProcController::GlobalWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
	switch(uMsg) {
		case WM_ACTIVATE: { m_instance->WND_ACTIVATE(wParam); break; }
		case WM_CLOSE: { m_instance->WND_CLOSE(wParam); break; }
		case WM_CREATE: { m_instance->WND_CREATE(wParam); break; }
		case WM_DESTROY: { m_instance->WND_DESTROY(wParam); break; }
		case WM_MOUSEMOVE: { m_instance->WND_MOUSEMOVE(wParam); break; }
		case WM_KEYUP: { m_instance->WND_KEYUP(wParam); break; }
		case WM_KEYDOWN: { m_instance->WND_KEYDOWN(wParam); break; }
		case WM_TIMER: { m_instance->WND_TIMER(wParam); break; }
		case WM_USER: { m_instance->WND_USER(wParam); break; }
		case WM_PAINT: { m_instance->WND_PAINT(wParam); break; }
		case WM_QUIT: { m_instance->WND_QUIT(wParam); break; }
		case WM_SIZE: { m_instance->WND_SIZE(wParam); break; }
		case WM_LBUTTONDOWN: { m_instance->WND_LBUTTONDOWN(wParam); break; }
		case WM_LBUTTONUP: { m_instance->WND_LBUTTONUP(wParam); break; }
		case WM_RBUTTONDOWN: { m_instance->WND_RBUTTONDOWN(wParam); break; }
		case WM_RBUTTONUP: { m_instance->WND_RBUTTONUP(wParam); break; }
	}

	return DefWindowProc(hWnd, uMsg, wParam, lParam);
}

void WNDProcMultyController::WND_ACTIVATE(WPARAM& wparam) {
	for(UINT i=0; i < m_array.Size(); i++) {
		m_array.GetAt(i)->WND_ACTIVATE(wparam);
	}
}
void WNDProcMultyController::WND_CLOSE(WPARAM& wparam) {
	for(UINT i=0; i < m_array.Size(); i++) {
		m_array.GetAt(i)->WND_CLOSE(wparam);
	}
}
void WNDProcMultyController::WND_CREATE(WPARAM& wparam) {
	for(UINT i=0; i < m_array.Size(); i++) {
		m_array.GetAt(i)->WND_CREATE(wparam);
	}
}
void WNDProcMultyController::WND_DESTROY(WPARAM& wparam) {
	for(UINT i=0; i < m_array.Size(); i++) {
		m_array.GetAt(i)->WND_DESTROY(wparam);
	}
}
void WNDProcMultyController::WND_MOUSEMOVE(WPARAM& wparam) {
	for(UINT i=0; i < m_array.Size(); i++) {
		m_array.GetAt(i)->WND_MOUSEMOVE(wparam);
	}
}
void WNDProcMultyController::WND_KEYUP(WPARAM& wparam) {
	for(UINT i=0; i < m_array.Size(); i++) {
		m_array.GetAt(i)->WND_KEYUP(wparam);
	}
}
void WNDProcMultyController::WND_KEYDOWN(WPARAM& wparam) {
	for(UINT i=0; i < m_array.Size(); i++) {
		m_array.GetAt(i)->WND_KEYDOWN(wparam);
	}
}
void WNDProcMultyController::WND_TIMER(WPARAM& wparam) {
	for(UINT i=0; i < m_array.Size(); i++) {
		m_array.GetAt(i)->WND_TIMER(wparam);
	}
}
void WNDProcMultyController::WND_USER(WPARAM& wparam) {
	for(UINT i=0; i < m_array.Size(); i++) {
		m_array.GetAt(i)->WND_USER(wparam);
	}
}
void WNDProcMultyController::WND_PAINT(WPARAM& wparam) {
	for(UINT i=0; i < m_array.Size(); i++) {
		m_array.GetAt(i)->WND_PAINT(wparam);
	}
}
void WNDProcMultyController::WND_QUIT(WPARAM& wparam) {
	for(UINT i=0; i < m_array.Size(); i++) {
		m_array.GetAt(i)->WND_QUIT(wparam);
	}
}
void WNDProcMultyController::WND_SIZE(WPARAM& wparam) {
	for(UINT i=0; i < m_array.Size(); i++) {
		m_array.GetAt(i)->WND_SIZE(wparam);
	}
}
void WNDProcMultyController::Add(IWNDProc* value) {
	m_array.Add(value);
}
WNDProcMultyController::~WNDProcMultyController() {
	for(UINT i=0; i < m_array.Size(); i++) {
		delete m_array.GetAt(i);
	}
}


text:
class SearchCategory < ActiveRecord::Base
  has_many :menu_item_category
end


text:
package com.haulmont.chile.core.datatypes.impl;

import com.haulmont.bali.util.ParamsMap;
import com.haulmont.chile.core.annotations.JavaClass;
import com.haulmont.chile.core.datatypes.*;
import com.haulmont.cuba.core.global.AppBeans;
import org.apache.commons.lang3.StringUtils;
import org.dom4j.Element;

import javax.annotation.Nullable;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.Map;
import java.util.TimeZone;

@JavaClass(Date.class)
public class DateTimeDatatype implements Datatype<Date>, ParameterizedDatatype, TimeZoneAwareDatatype {

    private String formatPattern;

    public DateTimeDatatype(Element element) {
        formatPattern = element.attributeValue("format");
    }

    @Override
    public String format(@Nullable Object value) {
        if (value == null) {
            return "";
        } else {
            DateFormat format;
            if (formatPattern != null) {
                format = new SimpleDateFormat(formatPattern);
            } else {
                format = DateFormat.getDateInstance();
            }
            return format.format((value));
        }
    }

    @Override
    public String format(@Nullable Object value, Locale locale) {
        return format(value, locale, null);
    }

    @Override
    public String format(@Nullable Object value, Locale locale, @Nullable TimeZone timeZone) {
        if (value == null) {
            return "";
        }

        FormatStrings formatStrings = AppBeans.get(FormatStringsRegistry.class).getFormatStrings(locale);
        if (formatStrings == null) {
            return format(value);
        }

        DateFormat format = new SimpleDateFormat(formatStrings.getDateTimeFormat());
        if (timeZone != null) {
            format.setTimeZone(timeZone);
        }

        return format.format(value);
    }

    @Override
    public Date parse(String value) throws ParseException {
        if (StringUtils.isBlank(value)) {
            return null;
        }

        DateFormat format;
        if (formatPattern != null) {
            format = new SimpleDateFormat(formatPattern);
        } else {
            format = DateFormat.getDateInstance();
        }
        return format.parse(value.trim());
    }

    @Override
    public Date parse(String value, Locale locale) throws ParseException {
        return parse(value, locale, null);
    }

    @Nullable
    public Date parse(@Nullable String value, Locale locale, @Nullable TimeZone timeZone) throws ParseException {
        if (StringUtils.isBlank(value)) {
            return null;
        }

        FormatStrings formatStrings = AppBeans.get(FormatStringsRegistry.class).getFormatStrings(locale);
        if (formatStrings == null) {
            return parse(value);
        }

        DateFormat format = new SimpleDateFormat(formatStrings.getDateTimeFormat());

        if (timeZone != null) {
            format.setTimeZone(timeZone);
        }

        return format.parse(value.trim());
    }

    @Override
    public Map<String, Object> getParameters() {
        return ParamsMap.of("format", formatPattern);
    }

    @Override
    public String toString() {
        return getClass().getSimpleName();
    }

    @Deprecated
    public final static String NAME = "dateTime";
}


text:
var GameObject = require("./GameObject");

/**
 * Game objects meant to be carried, used, or manipulated somehow.
 * @extends GameObject
 */
class Item extends GameObject{
}

module.exports = Item;


text:
function [ ] = init2()

addpath('/net/escanaba/z/ewwei/testCode/alg');
addpath('/net/escanaba/z/ewwei/testCode/alg/mex/src/fdk-cuda');
setup;
cbct_back test;


text:
package com.coolweather.util;

import android.content.Context;
import android.content.SharedPreferences;
import android.util.Log;
import com.coolweather.db.CoolWeatherDB;
import org.json.JSONArray;
import org.json.JSONObject;

/**
 * Created by wsb on 2015/12/25.
 */
public class Utility {
    /**
     * 解析和处理服务器返回的省级数据
     */
    public synchronized static boolean handleProvincesResponseWithGSON(CoolWeatherDB coolWeatherDB,JSONObject obj) {

            try {
                //使用JSONObject解析JSON数据

                JSONArray jsonArray=obj.getJSONArray("result");//根据键名获取JSON数组并遍历
                for(int i=0;i<jsonArray.length();i++){
                    JSONObject object=(JSONObject)jsonArray.opt(i);//遍历JSON数组并调用saveCity存入数据库中
                    coolWeatherDB.saveCity(object);
                }
            }catch (Exception e){
                e.printStackTrace();
            }
            return true;

    }

    /**
     *
     * @param context 上下文

     * @return
     */
    public synchronized static void handleTodayWeatherResponse(Context context,JSONObject obj) {

            try {
                //使用JSONObject解析JSON数据

                JSONObject object = obj.getJSONObject("result");
                object = object.getJSONObject("today");
//                "today": {
//                    "city": "天津",
//                            "date_y": "2014年03月21日",
//                            "week": "星期五",
//                            "temperature": "8℃~20℃",	/*今日温度*/
//                            "weather": "晴转霾",	/*今日天气*/
//                            "weather_id": {	/*天气唯一标识*/
//                        "fa": "00",	/*天气标识00:晴*/
//                                "fb": "53"	/*天气标识53:霾 如果fa不等于fb,说明是组合天气*/
//                    },
//
// wind": "西南风微风",
//                "dressing_index": "较冷", /*穿衣指数*/
//                        "dressing_advice": "建议着大衣、呢外套加毛衣、卫衣等服装。",	/*穿衣建议*/
//                        "uv_index": "中等",	/*紫外线强度*/
//                        "comfort_index": "",/*舒适度指数*/
//                        "wash_index": "较适宜",	/*洗车指数*/
//                        "travel_index": "适宜",	/*旅游指数*/
//                        "exercise_index": "较适宜",	/*晨练指数*/
//                        "drying_index": ""/*干燥指数*/
                String city=object.getString("city");
                String date_y=object.getString("date_y");
                String week=object.getString("week");
                String temp=object.getString("temperature");
                String weather =object.getString("weather");
                String dressing_index=object.getString("dressing_index");
                String dressing_advice=object.getString("dressing_advice");
                String uv_index=object.getString("uv_index");/*紫外线强度*/
                String comfort_index=object.getString("comfort_index");/*舒适度指数*/
                String wash_index=object.getString("wash_index");/*洗车指数*/
                String travel_index=object.getString("travel_index");/*旅游指数*/
                String exercise_index=object.getString("exercise_index");/*晨练指数*/
                String drying_index=object.getString("drying_index");/*干燥指数*/
                SharedPreferences.Editor editor = context.getSharedPreferences("today"
                        , context.MODE_PRIVATE).edit();
                editor.putString("city",city);
                editor.putString("温度范围",temp);
                editor.putString("天气",weather);
                editor.putString("dressing_index",dressing_index);
                editor.putString("dressing_advice",dressing_advice);
                editor.putString("星期",week);
                editor.putString("日期",date_y);
                editor.putString("紫外线",uv_index);
                editor.putString("舒适度",comfort_index);
                editor.putString("洗车指数",wash_index);
                editor.putString("旅游指数",travel_index);
                editor.putString("锻炼指数",exercise_index);
                editor.putString("干燥指数",drying_index);
                editor.commit();

//                    Log.d("today is ",object.getString("date_y"));
//                    Log.d("今天是: ",object.getString("week"));
//                    Log.d("气温是: ", object.getString("temperature"));
//                    Log.d("风向是 ",object.getString("wind"));
//                    Log.d("穿衣指数",object.getString("dressing_index"));
//                    Log.d("穿衣建议",object.getString("dressing_advice"));
                //实况天气
            }
            catch(Exception e){
            e.printStackTrace();
        }

    }

    /**
     * 点击更新时调用显示当前实况天气.
     * @param context
     *
     * @return
     */
    public synchronized static void handleRecentlyWeatherResponse(Context context,JSONObject obj) {

            try {

                JSONObject object=obj.getJSONObject("result");
                object=object.getJSONObject("sk");
                SharedPreferences.Editor editor=context.getSharedPreferences("recentlyWeather"
                        ,context.MODE_PRIVATE).edit();
                editor.putString("当前温度",object.getString("temp"));
                editor.putString("当前风向", object.getString("wind_direction"));
                editor.putString("当前风力",object.getString("wind_strength"));
                editor.putString("当前湿度",object.getString("humidity"));
                editor.putString("更新时间", object.getString("time"));
                editor.commit();

            } catch (Exception e) {
                e.printStackTrace();

            }
    }

    public static synchronized  void handleFutureWeatherResponse(Context context,JSONObject obj) {

            try {

                JSONObject object=obj.getJSONObject("result");
                JSONArray jsonArray=object.getJSONArray("future");

                for(int i=1;i<jsonArray.length();i++) {
                    SharedPreferences.Editor editor=context.getSharedPreferences("FutureWeather"+i
                            ,context.MODE_PRIVATE).edit();
                    object=(JSONObject)jsonArray.opt(i);
                    editor.putString("日期", object.getString("date"));
                    editor.putString("温度", object.getString("temperature"));
                    editor.putString("天气", object.getString("weather"));
                    editor.putString("星期", object.getString("week"));
                    object = object.getJSONObject("weather_id");
                    Log.d("fa",object.getString("fa"));
                    Log.d("fb",object.getString("fb"));
                    editor.putString("fa", object.getString("fa"));
                    editor.putString("fb", object.getString("fb"));
                    editor.commit();
                };
            } catch (Exception e) {
                e.printStackTrace();
            }

        }

}


text:
__author__ = 'Godfrey Takavarasha'

import os
import time
import json
import datecalc
from httplib2 import Http
from datetime import date
from datetime import timedelta
from apiclient.discovery import build
from apiclient.errors import HttpError
from oauth2client.client import SignedJwtAssertionCredentials

dir = os.path.dirname(__file__)

def get_ga_service(client_email, private_key):
    """ Initialises a ga service object

    :param client_email: application's email address
    :param private_key: application's private key
    :return: instance of google analytics service object
    """

    service_account_name = 'https://www.googleapis.com/auth/analytics.readonly'
    credentials = SignedJwtAssertionCredentials(client_email, private_key, service_account_name)
    http = credentials.authorize(Http())
    return build('analytics', 'v3', http=http)

def get_results(service, profile_id, start_date, end_date, metrics, dimensions, filters):
    """ Gets query results from the ga service

    """

    # We will most likely encounter [Quota Error: User Rate Limit Exceeded] errors. The internet says
    # it is best to pause for a second when you encounter the error and try again. Here we implement
    # a strategy of waiting 1 seconds the first time, then 2 seconds the second time, then 3 seconds
    # the third time, after which we give up and let the error propagate through the call chain. The
    # for loop is redundant if the call to ga() succeeds since our call is a return statement.

    for sleep_duration in [1, 2, 3]:
        try:
            return service.data().ga().get(
                ids="ga:" + profile_id,
                start_date=start_date,
                end_date=end_date,
                metrics=metrics,
                dimensions=dimensions,
                filters=filters).execute()
        except HttpError as e:
            print e
            for x in e:
                print x
            time.sleep(sleep_duration)

def print_data_table(results):
    """ *** This is throw away code that prints the results from the call to ga().get()

    :param results:
    :return:
    """
    # Print headers.
    output = []
    for header in results.get('columnHeaders'):
        output.append('%30s' % header.get('name'))
        print ''.join(output)

    # Print rows.
    if results.get('rows', []):
        for row in results.get('rows'):
            output = []
            for cell in row:
                output.append('%30s' % cell)
            print ''.join(output)
    else:
        print 'No Results Found'

def get_application_email_address():
    """ Returns the email address of the application

    :return: str
    """
    base_path = os.path.split(os.path.split(dir)[0])[0]
    with open(os.path.join(base_path, 'secrets/application-email-address.txt'), 'r') as f:
        return f.read()

def get_application_private_key():
    """ Returns the private key of the application

    :return: byte
    """
    base_path = os.path.split(os.path.split(dir)[0])[0]
    with open(os.path.join(base_path, 'secrets/application-private-key.p12'), 'rb') as f:
        return f.read()

def get_ga_metrics_list():
    """ Gets the list of metrics we are interested in scraping

    :return: json: list of metrics to download from ga
    """
    with open(os.path.join(dir, 'metrics.json'), 'r') as f:
        return json.loads(f.read())['metric_list']

def get_results_value(results):
    """ Gets the value in the last column of the first row of the ga results

    :param results: dict: results from the ga analytics query
    :return: int: the value from the results
    """

    if results.get('rows', []):
        return results.get('rows')[0][-1]
    return None

def collect_period_ga_data(service, metric_def_list, period_def):
    """ Collects

    :param service: the ga service object
    :param metric_def_list: the list of metric definitions
    :param period_def: period defini
    :return: list, a list of dicts containing metric data
    """
    ga_data = []
    for metric_def in metric_def_list:
        metrics = metric_def['metrics']
        dimensions = ''
        filters = ''
        if len(metric_def['filters']) > 0:
            for filter_def in metric_def['filters']:
                dimensions += ',' + filter_def['dimension']
                if filter_def['value']:
                    filters += ';{0}=={1}'.format(filter_def['dimension'], filter_def['value'])
            dimensions = dimensions[1:]
            filters = filters[1:]

        # Send the None value to ga().get() if there are no dimensions
        if len(dimensions) == 0:
            dimensions = None

        # Send the None value to ga().get() instead of an empty string if there are no filters.
        # Sending an empty string will throw a ValueError exception
        if len(filters) == 0:
            filters = None

        #Send the query to ga()
        results = get_results(
            service=service,
            profile_id="85660823",
            start_date=period_def["period_start_date"],
            end_date=period_def["period_end_date"],
            metrics=metrics,
            dimensions=dimensions,
            filters=filters
        )

        ga_data.append({
            "metricid": metric_def['metricid'],
            "period": period_def["period"],
            "period_start_date": period_def["period_start_date"],
            "period_end_date": period_def["period_end_date"],
            "period_type": period_def["period_type"],
            "value": get_results_value(results)
        })

        # print ga_data[len(ga_data)-1]

    return ga_data

def get_all_previous_periods(base_date):
    """ Returns an array of all the previous periods that are supported

    :param base_date:
    :return:
    """
    periods = []
    for flag in datecalc.PeriodTypes.Allowed_Period_Types:
        if flag == datecalc.PeriodTypes.Day:
            prev_period = base_date + timedelta(days=-1)
        elif flag == datecalc.PeriodTypes.Week:
            prev_period = base_date + timedelta(weeks=-1)
        elif flag == datecalc.PeriodTypes.Month:
            prev_period = datecalc.add_months(base_date, -1)
        elif flag == datecalc.PeriodTypes.Quarter:
            prev_period = datecalc.add_months(base_date, -3)
        elif flag == datecalc.PeriodTypes.Year:
            prev_period = datecalc.add_months(base_date, -12)

        periods.append(
            {
                "period": datecalc.get_period(prev_period, flag),
                "period_start_date": datecalc.period_start_date(prev_period, flag).isoformat(),
                "period_end_date": datecalc.period_end_date(prev_period, flag).isoformat()
            }
        )
    return periods

def collect_ga_data(base_date):
    data = []
    metrics_list = get_ga_metrics_list()
    period_defs = [
        {
            "period": datecalc.get_period(base_date, datecalc.PeriodTypes.Week),
            "period_start_date": datecalc.period_start_date(base_date, datecalc.PeriodTypes.Week).isoformat(),
            "period_end_date": datecalc.period_end_date(base_date, datecalc.PeriodTypes.Week).isoformat(),
            "period_type": "w"
        }
    ]
    service = get_ga_service(
        client_email=get_application_email_address(),
        private_key=get_application_private_key()
    )
    for period_def in period_defs:
        period_data = collect_period_ga_data(
            service=service,
            metric_def_list=metrics_list,
            period_def=period_def
        )
        for item in period_data:
            data.append(item)
    return data

def get_last_weeks_data():
    return collect_ga_data(date.today() - timedelta(weeks=1))

def main():
    print get_last_weeks_data()

if __name__ == "__main__":
    main()


text:
from xml.dom import minidom
from xml.parsers.expat import ExpatError

class XmlEditor(object):
    def __init__(self, xmlstring=""):
        self.string = xmlstring
        try:
            self.tree = minidom.parseString(xmlstring)
        except ExpatError as e:
            raise ValueError(e)

    def to_string(self):
        return self.string


text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: diplomacy_tensorflow/core/framework/variable.proto

#ifndef PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fvariable_2eproto
#define PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fvariable_2eproto

#include <string>

#include <google/protobuf/stubs/common.h>

#if GOOGLE_PROTOBUF_VERSION < 3006001
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers.  Please update
#error your headers.
#endif
#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers.  Please
#error regenerate this file with a newer version of protoc.
#endif

#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/arena.h>
#include <google/protobuf/arenastring.h>
#include <google/protobuf/generated_message_table_driven.h>
#include <google/protobuf/generated_message_util.h>
#include <google/protobuf/inlined_string_field.h>
#include <google/protobuf/metadata.h>
#include <google/protobuf/message.h>
#include <google/protobuf/repeated_field.h>  // IWYU pragma: export
#include <google/protobuf/extension_set.h>  // IWYU pragma: export
#include <google/protobuf/unknown_field_set.h>
// @@protoc_insertion_point(includes)
#define PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fvariable_2eproto

namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fvariable_2eproto {
// Internal implementation detail -- do not use these members.
struct TableStruct {
  static const ::google::protobuf::internal::ParseTableField entries[];
  static const ::google::protobuf::internal::AuxillaryParseTableField aux[];
  static const ::google::protobuf::internal::ParseTable schema[2];
  static const ::google::protobuf::internal::FieldMetadata field_metadata[];
  static const ::google::protobuf::internal::SerializationTable serialization_table[];
  static const ::google::protobuf::uint32 offsets[];
};
void AddDescriptors();
}  // namespace protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fvariable_2eproto
namespace diplomacy {
namespace tensorflow {
class SaveSliceInfoDef;
class SaveSliceInfoDefDefaultTypeInternal;
extern SaveSliceInfoDefDefaultTypeInternal _SaveSliceInfoDef_default_instance_;
class VariableDef;
class VariableDefDefaultTypeInternal;
extern VariableDefDefaultTypeInternal _VariableDef_default_instance_;
}  // namespace tensorflow
}  // namespace diplomacy
namespace google {
namespace protobuf {
template<> ::diplomacy::tensorflow::SaveSliceInfoDef* Arena::CreateMaybeMessage<::diplomacy::tensorflow::SaveSliceInfoDef>(Arena*);
template<> ::diplomacy::tensorflow::VariableDef* Arena::CreateMaybeMessage<::diplomacy::tensorflow::VariableDef>(Arena*);
}  // namespace protobuf
}  // namespace google
namespace diplomacy {
namespace tensorflow {

// ===================================================================

class VariableDef : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.VariableDef) */ {
 public:
  VariableDef();
  virtual ~VariableDef();

  VariableDef(const VariableDef& from);

  inline VariableDef& operator=(const VariableDef& from) {
    CopyFrom(from);
    return *this;
  }
  #if LANG_CXX11
  VariableDef(VariableDef&& from) noexcept
    : VariableDef() {
    *this = ::std::move(from);
  }

  inline VariableDef& operator=(VariableDef&& from) noexcept {
    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
      if (this != &from) InternalSwap(&from);
    } else {
      CopyFrom(from);
    }
    return *this;
  }
  #endif
  inline ::google::protobuf::Arena* GetArena() const final {
    return GetArenaNoVirtual();
  }
  inline void* GetMaybeArenaPointer() const final {
    return MaybeArenaPtr();
  }
  static const ::google::protobuf::Descriptor* descriptor();
  static const VariableDef& default_instance();

  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
  static inline const VariableDef* internal_default_instance() {
    return reinterpret_cast<const VariableDef*>(
               &_VariableDef_default_instance_);
  }
  static constexpr int kIndexInFileMessages =
    0;

  void UnsafeArenaSwap(VariableDef* other);
  void Swap(VariableDef* other);
  friend void swap(VariableDef& a, VariableDef& b) {
    a.Swap(&b);
  }

  // implements Message ----------------------------------------------

  inline VariableDef* New() const final {
    return CreateMaybeMessage<VariableDef>(NULL);
  }

  VariableDef* New(::google::protobuf::Arena* arena) const final {
    return CreateMaybeMessage<VariableDef>(arena);
  }
  void CopyFrom(const ::google::protobuf::Message& from) final;
  void MergeFrom(const ::google::protobuf::Message& from) final;
  void CopyFrom(const VariableDef& from);
  void MergeFrom(const VariableDef& from);
  void Clear() final;
  bool IsInitialized() const final;

  size_t ByteSizeLong() const final;
  bool MergePartialFromCodedStream(
      ::google::protobuf::io::CodedInputStream* input) final;
  void SerializeWithCachedSizes(
      ::google::protobuf::io::CodedOutputStream* output) const final;
  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
      bool deterministic, ::google::protobuf::uint8* target) const final;
  int GetCachedSize() const final { return _cached_size_.Get(); }

  private:
  void SharedCtor();
  void SharedDtor();
  void SetCachedSize(int size) const final;
  void InternalSwap(VariableDef* other);
  protected:
  explicit VariableDef(::google::protobuf::Arena* arena);
  private:
  static void ArenaDtor(void* object);
  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
  private:
  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
    return _internal_metadata_.arena();
  }
  inline void* MaybeArenaPtr() const {
    return _internal_metadata_.raw_arena_ptr();
  }
  public:

  ::google::protobuf::Metadata GetMetadata() const final;

  // nested types ----------------------------------------------------

  // accessors -------------------------------------------------------

  // string variable_name = 1;
  void clear_variable_name();
  static const int kVariableNameFieldNumber = 1;
  const ::std::string& variable_name() const;
  void set_variable_name(const ::std::string& value);
  #if LANG_CXX11
  void set_variable_name(::std::string&& value);
  #endif
  void set_variable_name(const char* value);
  void set_variable_name(const char* value, size_t size);
  ::std::string* mutable_variable_name();
  ::std::string* release_variable_name();
  void set_allocated_variable_name(::std::string* variable_name);
  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
  "    string fields are deprecated and will be removed in a"
  "    future release.")
  ::std::string* unsafe_arena_release_variable_name();
  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
  "    string fields are deprecated and will be removed in a"
  "    future release.")
  void unsafe_arena_set_allocated_variable_name(
      ::std::string* variable_name);

  // string initializer_name = 2;
  void clear_initializer_name();
  static const int kInitializerNameFieldNumber = 2;
  const ::std::string& initializer_name() const;
  void set_initializer_name(const ::std::string& value);
  #if LANG_CXX11
  void set_initializer_name(::std::string&& value);
  #endif
  void set_initializer_name(const char* value);
  void set_initializer_name(const char* value, size_t size);
  ::std::string* mutable_initializer_name();
  ::std::string* release_initializer_name();
  void set_allocated_initializer_name(::std::string* initializer_name);
  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
  "    string fields are deprecated and will be removed in a"
  "    future release.")
  ::std::string* unsafe_arena_release_initializer_name();
  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
  "    string fields are deprecated and will be removed in a"
  "    future release.")
  void unsafe_arena_set_allocated_initializer_name(
      ::std::string* initializer_name);

  // string snapshot_name = 3;
  void clear_snapshot_name();
  static const int kSnapshotNameFieldNumber = 3;
  const ::std::string& snapshot_name() const;
  void set_snapshot_name(const ::std::string& value);
  #if LANG_CXX11
  void set_snapshot_name(::std::string&& value);
  #endif
  void set_snapshot_name(const char* value);
  void set_snapshot_name(const char* value, size_t size);
  ::std::string* mutable_snapshot_name();
  ::std::string* release_snapshot_name();
  void set_allocated_snapshot_name(::std::string* snapshot_name);
  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
  "    string fields are deprecated and will be removed in a"
  "    future release.")
  ::std::string* unsafe_arena_release_snapshot_name();
  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
  "    string fields are deprecated and will be removed in a"
  "    future release.")
  void unsafe_arena_set_allocated_snapshot_name(
      ::std::string* snapshot_name);

  // string initial_value_name = 6;
  void clear_initial_value_name();
  static const int kInitialValueNameFieldNumber = 6;
  const ::std::string& initial_value_name() const;
  void set_initial_value_name(const ::std::string& value);
  #if LANG_CXX11
  void set_initial_value_name(::std::string&& value);
  #endif
  void set_initial_value_name(const char* value);
  void set_initial_value_name(const char* value, size_t size);
  ::std::string* mutable_initial_value_name();
  ::std::string* release_initial_value_name();
  void set_allocated_initial_value_name(::std::string* initial_value_name);
  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
  "    string fields are deprecated and will be removed in a"
  "    future release.")
  ::std::string* unsafe_arena_release_initial_value_name();
  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
  "    string fields are deprecated and will be removed in a"
  "    future release.")
  void unsafe_arena_set_allocated_initial_value_name(
      ::std::string* initial_value_name);

  // .diplomacy.tensorflow.SaveSliceInfoDef save_slice_info_def = 4;
  bool has_save_slice_info_def() const;
  void clear_save_slice_info_def();
  static const int kSaveSliceInfoDefFieldNumber = 4;
  private:
  const ::diplomacy::tensorflow::SaveSliceInfoDef& _internal_save_slice_info_def() const;
  public:
  const ::diplomacy::tensorflow::SaveSliceInfoDef& save_slice_info_def() const;
  ::diplomacy::tensorflow::SaveSliceInfoDef* release_save_slice_info_def();
  ::diplomacy::tensorflow::SaveSliceInfoDef* mutable_save_slice_info_def();
  void set_allocated_save_slice_info_def(::diplomacy::tensorflow::SaveSliceInfoDef* save_slice_info_def);
  void unsafe_arena_set_allocated_save_slice_info_def(
      ::diplomacy::tensorflow::SaveSliceInfoDef* save_slice_info_def);
  ::diplomacy::tensorflow::SaveSliceInfoDef* unsafe_arena_release_save_slice_info_def();

  // bool is_resource = 5;
  void clear_is_resource();
  static const int kIsResourceFieldNumber = 5;
  bool is_resource() const;
  void set_is_resource(bool value);

  // bool trainable = 7;
  void clear_trainable();
  static const int kTrainableFieldNumber = 7;
  bool trainable() const;
  void set_trainable(bool value);

  // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.VariableDef)
 private:

  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
  typedef void InternalArenaConstructable_;
  typedef void DestructorSkippable_;
  ::google::protobuf::internal::ArenaStringPtr variable_name_;
  ::google::protobuf::internal::ArenaStringPtr initializer_name_;
  ::google::protobuf::internal::ArenaStringPtr snapshot_name_;
  ::google::protobuf::internal::ArenaStringPtr initial_value_name_;
  ::diplomacy::tensorflow::SaveSliceInfoDef* save_slice_info_def_;
  bool is_resource_;
  bool trainable_;
  mutable ::google::protobuf::internal::CachedSize _cached_size_;
  friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fvariable_2eproto::TableStruct;
};
// -------------------------------------------------------------------

class SaveSliceInfoDef : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:diplomacy.tensorflow.SaveSliceInfoDef) */ {
 public:
  SaveSliceInfoDef();
  virtual ~SaveSliceInfoDef();

  SaveSliceInfoDef(const SaveSliceInfoDef& from);

  inline SaveSliceInfoDef& operator=(const SaveSliceInfoDef& from) {
    CopyFrom(from);
    return *this;
  }
  #if LANG_CXX11
  SaveSliceInfoDef(SaveSliceInfoDef&& from) noexcept
    : SaveSliceInfoDef() {
    *this = ::std::move(from);
  }

  inline SaveSliceInfoDef& operator=(SaveSliceInfoDef&& from) noexcept {
    if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
      if (this != &from) InternalSwap(&from);
    } else {
      CopyFrom(from);
    }
    return *this;
  }
  #endif
  inline ::google::protobuf::Arena* GetArena() const final {
    return GetArenaNoVirtual();
  }
  inline void* GetMaybeArenaPointer() const final {
    return MaybeArenaPtr();
  }
  static const ::google::protobuf::Descriptor* descriptor();
  static const SaveSliceInfoDef& default_instance();

  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
  static inline const SaveSliceInfoDef* internal_default_instance() {
    return reinterpret_cast<const SaveSliceInfoDef*>(
               &_SaveSliceInfoDef_default_instance_);
  }
  static constexpr int kIndexInFileMessages =
    1;

  void UnsafeArenaSwap(SaveSliceInfoDef* other);
  void Swap(SaveSliceInfoDef* other);
  friend void swap(SaveSliceInfoDef& a, SaveSliceInfoDef& b) {
    a.Swap(&b);
  }

  // implements Message ----------------------------------------------

  inline SaveSliceInfoDef* New() const final {
    return CreateMaybeMessage<SaveSliceInfoDef>(NULL);
  }

  SaveSliceInfoDef* New(::google::protobuf::Arena* arena) const final {
    return CreateMaybeMessage<SaveSliceInfoDef>(arena);
  }
  void CopyFrom(const ::google::protobuf::Message& from) final;
  void MergeFrom(const ::google::protobuf::Message& from) final;
  void CopyFrom(const SaveSliceInfoDef& from);
  void MergeFrom(const SaveSliceInfoDef& from);
  void Clear() final;
  bool IsInitialized() const final;

  size_t ByteSizeLong() const final;
  bool MergePartialFromCodedStream(
      ::google::protobuf::io::CodedInputStream* input) final;
  void SerializeWithCachedSizes(
      ::google::protobuf::io::CodedOutputStream* output) const final;
  ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
      bool deterministic, ::google::protobuf::uint8* target) const final;
  int GetCachedSize() const final { return _cached_size_.Get(); }

  private:
  void SharedCtor();
  void SharedDtor();
  void SetCachedSize(int size) const final;
  void InternalSwap(SaveSliceInfoDef* other);
  protected:
  explicit SaveSliceInfoDef(::google::protobuf::Arena* arena);
  private:
  static void ArenaDtor(void* object);
  inline void RegisterArenaDtor(::google::protobuf::Arena* arena);
  private:
  inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
    return _internal_metadata_.arena();
  }
  inline void* MaybeArenaPtr() const {
    return _internal_metadata_.raw_arena_ptr();
  }
  public:

  ::google::protobuf::Metadata GetMetadata() const final;

  // nested types ----------------------------------------------------

  // accessors -------------------------------------------------------

  // repeated int64 full_shape = 2;
  int full_shape_size() const;
  void clear_full_shape();
  static const int kFullShapeFieldNumber = 2;
  ::google::protobuf::int64 full_shape(int index) const;
  void set_full_shape(int index, ::google::protobuf::int64 value);
  void add_full_shape(::google::protobuf::int64 value);
  const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
      full_shape() const;
  ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
      mutable_full_shape();

  // repeated int64 var_offset = 3;
  int var_offset_size() const;
  void clear_var_offset();
  static const int kVarOffsetFieldNumber = 3;
  ::google::protobuf::int64 var_offset(int index) const;
  void set_var_offset(int index, ::google::protobuf::int64 value);
  void add_var_offset(::google::protobuf::int64 value);
  const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
      var_offset() const;
  ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
      mutable_var_offset();

  // repeated int64 var_shape = 4;
  int var_shape_size() const;
  void clear_var_shape();
  static const int kVarShapeFieldNumber = 4;
  ::google::protobuf::int64 var_shape(int index) const;
  void set_var_shape(int index, ::google::protobuf::int64 value);
  void add_var_shape(::google::protobuf::int64 value);
  const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
      var_shape() const;
  ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
      mutable_var_shape();

  // string full_name = 1;
  void clear_full_name();
  static const int kFullNameFieldNumber = 1;
  const ::std::string& full_name() const;
  void set_full_name(const ::std::string& value);
  #if LANG_CXX11
  void set_full_name(::std::string&& value);
  #endif
  void set_full_name(const char* value);
  void set_full_name(const char* value, size_t size);
  ::std::string* mutable_full_name();
  ::std::string* release_full_name();
  void set_allocated_full_name(::std::string* full_name);
  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
  "    string fields are deprecated and will be removed in a"
  "    future release.")
  ::std::string* unsafe_arena_release_full_name();
  PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for"
  "    string fields are deprecated and will be removed in a"
  "    future release.")
  void unsafe_arena_set_allocated_full_name(
      ::std::string* full_name);

  // @@protoc_insertion_point(class_scope:diplomacy.tensorflow.SaveSliceInfoDef)
 private:

  ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
  template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
  typedef void InternalArenaConstructable_;
  typedef void DestructorSkippable_;
  ::google::protobuf::RepeatedField< ::google::protobuf::int64 > full_shape_;
  mutable int _full_shape_cached_byte_size_;
  ::google::protobuf::RepeatedField< ::google::protobuf::int64 > var_offset_;
  mutable int _var_offset_cached_byte_size_;
  ::google::protobuf::RepeatedField< ::google::protobuf::int64 > var_shape_;
  mutable int _var_shape_cached_byte_size_;
  ::google::protobuf::internal::ArenaStringPtr full_name_;
  mutable ::google::protobuf::internal::CachedSize _cached_size_;
  friend struct ::protobuf_diplomacy_5ftensorflow_2fcore_2fframework_2fvariable_2eproto::TableStruct;
};
// ===================================================================

// ===================================================================

#ifdef __GNUC__
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif  // __GNUC__
// VariableDef

// string variable_name = 1;
inline void VariableDef::clear_variable_name() {
  variable_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline const ::std::string& VariableDef::variable_name() const {
  // @@protoc_insertion_point(field_get:diplomacy.tensorflow.VariableDef.variable_name)
  return variable_name_.Get();
}
inline void VariableDef::set_variable_name(const ::std::string& value) {

  variable_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
  // @@protoc_insertion_point(field_set:diplomacy.tensorflow.VariableDef.variable_name)
}
#if LANG_CXX11
inline void VariableDef::set_variable_name(::std::string&& value) {

  variable_name_.Set(
    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
  // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.VariableDef.variable_name)
}
#endif
inline void VariableDef::set_variable_name(const char* value) {
  GOOGLE_DCHECK(value != NULL);

  variable_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
              GetArenaNoVirtual());
  // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.VariableDef.variable_name)
}
inline void VariableDef::set_variable_name(const char* value,
    size_t size) {

  variable_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
  // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.VariableDef.variable_name)
}
inline ::std::string* VariableDef::mutable_variable_name() {

  // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.VariableDef.variable_name)
  return variable_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline ::std::string* VariableDef::release_variable_name() {
  // @@protoc_insertion_point(field_release:diplomacy.tensorflow.VariableDef.variable_name)

  return variable_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline void VariableDef::set_allocated_variable_name(::std::string* variable_name) {
  if (variable_name != NULL) {

  } else {

  }
  variable_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), variable_name,
      GetArenaNoVirtual());
  // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.VariableDef.variable_name)
}
inline ::std::string* VariableDef::unsafe_arena_release_variable_name() {
  // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.VariableDef.variable_name)
  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);

  return variable_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      GetArenaNoVirtual());
}
inline void VariableDef::unsafe_arena_set_allocated_variable_name(
    ::std::string* variable_name) {
  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
  if (variable_name != NULL) {

  } else {

  }
  variable_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      variable_name, GetArenaNoVirtual());
  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.VariableDef.variable_name)
}

// string initial_value_name = 6;
inline void VariableDef::clear_initial_value_name() {
  initial_value_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline const ::std::string& VariableDef::initial_value_name() const {
  // @@protoc_insertion_point(field_get:diplomacy.tensorflow.VariableDef.initial_value_name)
  return initial_value_name_.Get();
}
inline void VariableDef::set_initial_value_name(const ::std::string& value) {

  initial_value_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
  // @@protoc_insertion_point(field_set:diplomacy.tensorflow.VariableDef.initial_value_name)
}
#if LANG_CXX11
inline void VariableDef::set_initial_value_name(::std::string&& value) {

  initial_value_name_.Set(
    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
  // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.VariableDef.initial_value_name)
}
#endif
inline void VariableDef::set_initial_value_name(const char* value) {
  GOOGLE_DCHECK(value != NULL);

  initial_value_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
              GetArenaNoVirtual());
  // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.VariableDef.initial_value_name)
}
inline void VariableDef::set_initial_value_name(const char* value,
    size_t size) {

  initial_value_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
  // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.VariableDef.initial_value_name)
}
inline ::std::string* VariableDef::mutable_initial_value_name() {

  // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.VariableDef.initial_value_name)
  return initial_value_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline ::std::string* VariableDef::release_initial_value_name() {
  // @@protoc_insertion_point(field_release:diplomacy.tensorflow.VariableDef.initial_value_name)

  return initial_value_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline void VariableDef::set_allocated_initial_value_name(::std::string* initial_value_name) {
  if (initial_value_name != NULL) {

  } else {

  }
  initial_value_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), initial_value_name,
      GetArenaNoVirtual());
  // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.VariableDef.initial_value_name)
}
inline ::std::string* VariableDef::unsafe_arena_release_initial_value_name() {
  // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.VariableDef.initial_value_name)
  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);

  return initial_value_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      GetArenaNoVirtual());
}
inline void VariableDef::unsafe_arena_set_allocated_initial_value_name(
    ::std::string* initial_value_name) {
  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
  if (initial_value_name != NULL) {

  } else {

  }
  initial_value_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      initial_value_name, GetArenaNoVirtual());
  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.VariableDef.initial_value_name)
}

// string initializer_name = 2;
inline void VariableDef::clear_initializer_name() {
  initializer_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline const ::std::string& VariableDef::initializer_name() const {
  // @@protoc_insertion_point(field_get:diplomacy.tensorflow.VariableDef.initializer_name)
  return initializer_name_.Get();
}
inline void VariableDef::set_initializer_name(const ::std::string& value) {

  initializer_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
  // @@protoc_insertion_point(field_set:diplomacy.tensorflow.VariableDef.initializer_name)
}
#if LANG_CXX11
inline void VariableDef::set_initializer_name(::std::string&& value) {

  initializer_name_.Set(
    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
  // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.VariableDef.initializer_name)
}
#endif
inline void VariableDef::set_initializer_name(const char* value) {
  GOOGLE_DCHECK(value != NULL);

  initializer_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
              GetArenaNoVirtual());
  // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.VariableDef.initializer_name)
}
inline void VariableDef::set_initializer_name(const char* value,
    size_t size) {

  initializer_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
  // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.VariableDef.initializer_name)
}
inline ::std::string* VariableDef::mutable_initializer_name() {

  // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.VariableDef.initializer_name)
  return initializer_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline ::std::string* VariableDef::release_initializer_name() {
  // @@protoc_insertion_point(field_release:diplomacy.tensorflow.VariableDef.initializer_name)

  return initializer_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline void VariableDef::set_allocated_initializer_name(::std::string* initializer_name) {
  if (initializer_name != NULL) {

  } else {

  }
  initializer_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), initializer_name,
      GetArenaNoVirtual());
  // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.VariableDef.initializer_name)
}
inline ::std::string* VariableDef::unsafe_arena_release_initializer_name() {
  // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.VariableDef.initializer_name)
  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);

  return initializer_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      GetArenaNoVirtual());
}
inline void VariableDef::unsafe_arena_set_allocated_initializer_name(
    ::std::string* initializer_name) {
  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
  if (initializer_name != NULL) {

  } else {

  }
  initializer_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      initializer_name, GetArenaNoVirtual());
  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.VariableDef.initializer_name)
}

// string snapshot_name = 3;
inline void VariableDef::clear_snapshot_name() {
  snapshot_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline const ::std::string& VariableDef::snapshot_name() const {
  // @@protoc_insertion_point(field_get:diplomacy.tensorflow.VariableDef.snapshot_name)
  return snapshot_name_.Get();
}
inline void VariableDef::set_snapshot_name(const ::std::string& value) {

  snapshot_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
  // @@protoc_insertion_point(field_set:diplomacy.tensorflow.VariableDef.snapshot_name)
}
#if LANG_CXX11
inline void VariableDef::set_snapshot_name(::std::string&& value) {

  snapshot_name_.Set(
    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
  // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.VariableDef.snapshot_name)
}
#endif
inline void VariableDef::set_snapshot_name(const char* value) {
  GOOGLE_DCHECK(value != NULL);

  snapshot_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
              GetArenaNoVirtual());
  // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.VariableDef.snapshot_name)
}
inline void VariableDef::set_snapshot_name(const char* value,
    size_t size) {

  snapshot_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
  // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.VariableDef.snapshot_name)
}
inline ::std::string* VariableDef::mutable_snapshot_name() {

  // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.VariableDef.snapshot_name)
  return snapshot_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline ::std::string* VariableDef::release_snapshot_name() {
  // @@protoc_insertion_point(field_release:diplomacy.tensorflow.VariableDef.snapshot_name)

  return snapshot_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline void VariableDef::set_allocated_snapshot_name(::std::string* snapshot_name) {
  if (snapshot_name != NULL) {

  } else {

  }
  snapshot_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), snapshot_name,
      GetArenaNoVirtual());
  // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.VariableDef.snapshot_name)
}
inline ::std::string* VariableDef::unsafe_arena_release_snapshot_name() {
  // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.VariableDef.snapshot_name)
  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);

  return snapshot_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      GetArenaNoVirtual());
}
inline void VariableDef::unsafe_arena_set_allocated_snapshot_name(
    ::std::string* snapshot_name) {
  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
  if (snapshot_name != NULL) {

  } else {

  }
  snapshot_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      snapshot_name, GetArenaNoVirtual());
  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.VariableDef.snapshot_name)
}

// .diplomacy.tensorflow.SaveSliceInfoDef save_slice_info_def = 4;
inline bool VariableDef::has_save_slice_info_def() const {
  return this != internal_default_instance() && save_slice_info_def_ != NULL;
}
inline void VariableDef::clear_save_slice_info_def() {
  if (GetArenaNoVirtual() == NULL && save_slice_info_def_ != NULL) {
    delete save_slice_info_def_;
  }
  save_slice_info_def_ = NULL;
}
inline const ::diplomacy::tensorflow::SaveSliceInfoDef& VariableDef::_internal_save_slice_info_def() const {
  return *save_slice_info_def_;
}
inline const ::diplomacy::tensorflow::SaveSliceInfoDef& VariableDef::save_slice_info_def() const {
  const ::diplomacy::tensorflow::SaveSliceInfoDef* p = save_slice_info_def_;
  // @@protoc_insertion_point(field_get:diplomacy.tensorflow.VariableDef.save_slice_info_def)
  return p != NULL ? *p : *reinterpret_cast<const ::diplomacy::tensorflow::SaveSliceInfoDef*>(
      &::diplomacy::tensorflow::_SaveSliceInfoDef_default_instance_);
}
inline ::diplomacy::tensorflow::SaveSliceInfoDef* VariableDef::release_save_slice_info_def() {
  // @@protoc_insertion_point(field_release:diplomacy.tensorflow.VariableDef.save_slice_info_def)

  ::diplomacy::tensorflow::SaveSliceInfoDef* temp = save_slice_info_def_;
  if (GetArenaNoVirtual() != NULL) {
    temp = ::google::protobuf::internal::DuplicateIfNonNull(temp);
  }
  save_slice_info_def_ = NULL;
  return temp;
}
inline ::diplomacy::tensorflow::SaveSliceInfoDef* VariableDef::unsafe_arena_release_save_slice_info_def() {
  // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.VariableDef.save_slice_info_def)

  ::diplomacy::tensorflow::SaveSliceInfoDef* temp = save_slice_info_def_;
  save_slice_info_def_ = NULL;
  return temp;
}
inline ::diplomacy::tensorflow::SaveSliceInfoDef* VariableDef::mutable_save_slice_info_def() {

  if (save_slice_info_def_ == NULL) {
    auto* p = CreateMaybeMessage<::diplomacy::tensorflow::SaveSliceInfoDef>(GetArenaNoVirtual());
    save_slice_info_def_ = p;
  }
  // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.VariableDef.save_slice_info_def)
  return save_slice_info_def_;
}
inline void VariableDef::set_allocated_save_slice_info_def(::diplomacy::tensorflow::SaveSliceInfoDef* save_slice_info_def) {
  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
  if (message_arena == NULL) {
    delete save_slice_info_def_;
  }
  if (save_slice_info_def) {
    ::google::protobuf::Arena* submessage_arena =
      ::google::protobuf::Arena::GetArena(save_slice_info_def);
    if (message_arena != submessage_arena) {
      save_slice_info_def = ::google::protobuf::internal::GetOwnedMessage(
          message_arena, save_slice_info_def, submessage_arena);
    }

  } else {

  }
  save_slice_info_def_ = save_slice_info_def;
  // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.VariableDef.save_slice_info_def)
}

// bool is_resource = 5;
inline void VariableDef::clear_is_resource() {
  is_resource_ = false;
}
inline bool VariableDef::is_resource() const {
  // @@protoc_insertion_point(field_get:diplomacy.tensorflow.VariableDef.is_resource)
  return is_resource_;
}
inline void VariableDef::set_is_resource(bool value) {

  is_resource_ = value;
  // @@protoc_insertion_point(field_set:diplomacy.tensorflow.VariableDef.is_resource)
}

// bool trainable = 7;
inline void VariableDef::clear_trainable() {
  trainable_ = false;
}
inline bool VariableDef::trainable() const {
  // @@protoc_insertion_point(field_get:diplomacy.tensorflow.VariableDef.trainable)
  return trainable_;
}
inline void VariableDef::set_trainable(bool value) {

  trainable_ = value;
  // @@protoc_insertion_point(field_set:diplomacy.tensorflow.VariableDef.trainable)
}

// -------------------------------------------------------------------

// SaveSliceInfoDef

// string full_name = 1;
inline void SaveSliceInfoDef::clear_full_name() {
  full_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline const ::std::string& SaveSliceInfoDef::full_name() const {
  // @@protoc_insertion_point(field_get:diplomacy.tensorflow.SaveSliceInfoDef.full_name)
  return full_name_.Get();
}
inline void SaveSliceInfoDef::set_full_name(const ::std::string& value) {

  full_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
  // @@protoc_insertion_point(field_set:diplomacy.tensorflow.SaveSliceInfoDef.full_name)
}
#if LANG_CXX11
inline void SaveSliceInfoDef::set_full_name(::std::string&& value) {

  full_name_.Set(
    &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
  // @@protoc_insertion_point(field_set_rvalue:diplomacy.tensorflow.SaveSliceInfoDef.full_name)
}
#endif
inline void SaveSliceInfoDef::set_full_name(const char* value) {
  GOOGLE_DCHECK(value != NULL);

  full_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
              GetArenaNoVirtual());
  // @@protoc_insertion_point(field_set_char:diplomacy.tensorflow.SaveSliceInfoDef.full_name)
}
inline void SaveSliceInfoDef::set_full_name(const char* value,
    size_t size) {

  full_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
      reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
  // @@protoc_insertion_point(field_set_pointer:diplomacy.tensorflow.SaveSliceInfoDef.full_name)
}
inline ::std::string* SaveSliceInfoDef::mutable_full_name() {

  // @@protoc_insertion_point(field_mutable:diplomacy.tensorflow.SaveSliceInfoDef.full_name)
  return full_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline ::std::string* SaveSliceInfoDef::release_full_name() {
  // @@protoc_insertion_point(field_release:diplomacy.tensorflow.SaveSliceInfoDef.full_name)

  return full_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline void SaveSliceInfoDef::set_allocated_full_name(::std::string* full_name) {
  if (full_name != NULL) {

  } else {

  }
  full_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), full_name,
      GetArenaNoVirtual());
  // @@protoc_insertion_point(field_set_allocated:diplomacy.tensorflow.SaveSliceInfoDef.full_name)
}
inline ::std::string* SaveSliceInfoDef::unsafe_arena_release_full_name() {
  // @@protoc_insertion_point(field_unsafe_arena_release:diplomacy.tensorflow.SaveSliceInfoDef.full_name)
  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);

  return full_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      GetArenaNoVirtual());
}
inline void SaveSliceInfoDef::unsafe_arena_set_allocated_full_name(
    ::std::string* full_name) {
  GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
  if (full_name != NULL) {

  } else {

  }
  full_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      full_name, GetArenaNoVirtual());
  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:diplomacy.tensorflow.SaveSliceInfoDef.full_name)
}

// repeated int64 full_shape = 2;
inline int SaveSliceInfoDef::full_shape_size() const {
  return full_shape_.size();
}
inline void SaveSliceInfoDef::clear_full_shape() {
  full_shape_.Clear();
}
inline ::google::protobuf::int64 SaveSliceInfoDef::full_shape(int index) const {
  // @@protoc_insertion_point(field_get:diplomacy.tensorflow.SaveSliceInfoDef.full_shape)
  return full_shape_.Get(index);
}
inline void SaveSliceInfoDef::set_full_shape(int index, ::google::protobuf::int64 value) {
  full_shape_.Set(index, value);
  // @@protoc_insertion_point(field_set:diplomacy.tensorflow.SaveSliceInfoDef.full_shape)
}
inline void SaveSliceInfoDef::add_full_shape(::google::protobuf::int64 value) {
  full_shape_.Add(value);
  // @@protoc_insertion_point(field_add:diplomacy.tensorflow.SaveSliceInfoDef.full_shape)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
SaveSliceInfoDef::full_shape() const {
  // @@protoc_insertion_point(field_list:diplomacy.tensorflow.SaveSliceInfoDef.full_shape)
  return full_shape_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
SaveSliceInfoDef::mutable_full_shape() {
  // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.SaveSliceInfoDef.full_shape)
  return &full_shape_;
}

// repeated int64 var_offset = 3;
inline int SaveSliceInfoDef::var_offset_size() const {
  return var_offset_.size();
}
inline void SaveSliceInfoDef::clear_var_offset() {
  var_offset_.Clear();
}
inline ::google::protobuf::int64 SaveSliceInfoDef::var_offset(int index) const {
  // @@protoc_insertion_point(field_get:diplomacy.tensorflow.SaveSliceInfoDef.var_offset)
  return var_offset_.Get(index);
}
inline void SaveSliceInfoDef::set_var_offset(int index, ::google::protobuf::int64 value) {
  var_offset_.Set(index, value);
  // @@protoc_insertion_point(field_set:diplomacy.tensorflow.SaveSliceInfoDef.var_offset)
}
inline void SaveSliceInfoDef::add_var_offset(::google::protobuf::int64 value) {
  var_offset_.Add(value);
  // @@protoc_insertion_point(field_add:diplomacy.tensorflow.SaveSliceInfoDef.var_offset)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
SaveSliceInfoDef::var_offset() const {
  // @@protoc_insertion_point(field_list:diplomacy.tensorflow.SaveSliceInfoDef.var_offset)
  return var_offset_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
SaveSliceInfoDef::mutable_var_offset() {
  // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.SaveSliceInfoDef.var_offset)
  return &var_offset_;
}

// repeated int64 var_shape = 4;
inline int SaveSliceInfoDef::var_shape_size() const {
  return var_shape_.size();
}
inline void SaveSliceInfoDef::clear_var_shape() {
  var_shape_.Clear();
}
inline ::google::protobuf::int64 SaveSliceInfoDef::var_shape(int index) const {
  // @@protoc_insertion_point(field_get:diplomacy.tensorflow.SaveSliceInfoDef.var_shape)
  return var_shape_.Get(index);
}
inline void SaveSliceInfoDef::set_var_shape(int index, ::google::protobuf::int64 value) {
  var_shape_.Set(index, value);
  // @@protoc_insertion_point(field_set:diplomacy.tensorflow.SaveSliceInfoDef.var_shape)
}
inline void SaveSliceInfoDef::add_var_shape(::google::protobuf::int64 value) {
  var_shape_.Add(value);
  // @@protoc_insertion_point(field_add:diplomacy.tensorflow.SaveSliceInfoDef.var_shape)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
SaveSliceInfoDef::var_shape() const {
  // @@protoc_insertion_point(field_list:diplomacy.tensorflow.SaveSliceInfoDef.var_shape)
  return var_shape_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
SaveSliceInfoDef::mutable_var_shape() {
  // @@protoc_insertion_point(field_mutable_list:diplomacy.tensorflow.SaveSliceInfoDef.var_shape)
  return &var_shape_;
}

#ifdef __GNUC__
  #pragma GCC diagnostic pop
#endif  // __GNUC__
// -------------------------------------------------------------------

// @@protoc_insertion_point(namespace_scope)

}  // namespace tensorflow
}  // namespace diplomacy

// @@protoc_insertion_point(global_scope)

#endif  // PROTOBUF_INCLUDED_diplomacy_5ftensorflow_2fcore_2fframework_2fvariable_2eproto


text:
- With pull requests:
  - Open your pull request against `master`
  - Your pull request should have no more than two commits, if not you should squash them.
  - It should pass all tests in the available continuous integration systems such as GitHub Actions.
  - You should add/modify tests to cover your proposed code changes.
  - If your pull request contains a new feature, please document it on the README.


text:
package boofcv.examples;

import boofcv.core.image.ConvertBufferedImage;
import boofcv.factory.transform.pyramid.FactoryPyramid;
import boofcv.gui.image.ImagePyramidPanel;
import boofcv.gui.image.ShowImages;
import boofcv.io.image.UtilImageIO;
import boofcv.struct.image.ImageFloat32;
import boofcv.struct.image.ImageSingleBand;
import boofcv.struct.pyramid.PyramidDiscrete;
import boofcv.struct.pyramid.PyramidFloat;

import java.awt.image.BufferedImage;

/**
 * Demonstrates how to construct and display a {@link PyramidFloat}.  Float pyramids require only require
 * that each layer's scale be larger than the scale of the previous layer. Interpolation is used to allow
 * sub-sampling at arbitrary scales.  All of this additional flexibility comes at the cost of speed
 * when compared to a {@link PyramidDiscrete}.
 *
 * @author Peter Abeles
 */
public class ExamplePyramidFloat<T extends ImageSingleBand> {

	// specifies the image type
	Class<T> imageType;
	// The pyramid data structure
	PyramidFloat<T> pyramid;

	public ExamplePyramidFloat(Class<T> imageType) {
		this.imageType = imageType;
	}

	/**
	 * Creates a fairly standard pyramid and updater.
	 */
	public void standard() {
		// Scale factory for each layer can be any floating point value which is larger than
		// the previous layer's scale.
		double scales[] = new double[]{1,1.5,2,2.5,3,5,8,15};
		// the amount of blur which is applied to each layer in the pyramid after the previous layer has been sampled
		double sigmas[] = new double[]{1,1,1,1,1,1,1,1};
		pyramid = FactoryPyramid.floatGaussian(scales,sigmas,imageType);
	}

	/**
	 * Updates and displays the pyramid.
	 */
	public void process( BufferedImage image ) {
		T input = ConvertBufferedImage.convertFromSingle(image, null, imageType);
		pyramid.process(input);

		ImagePyramidPanel<T> gui = new ImagePyramidPanel<T>();
		gui.set(pyramid, true);
		gui.render();

		ShowImages.showWindow(gui,"Image Pyramid Float");

		// To get an image at any of the scales simply call this get function
		T imageAtScale = pyramid.getLayer(1);

		ShowImages.showWindow(ConvertBufferedImage.convertTo(imageAtScale,null),"Image at layer 1");
	}

	public static void main( String[] args ) {
		BufferedImage image = UtilImageIO.loadImage("../data/evaluation/standard/barbara.png");

		ExamplePyramidFloat<ImageFloat32> app = new ExamplePyramidFloat<ImageFloat32>(ImageFloat32.class);
//		ExamplePyramidFloat<ImageUInt8> app = new ExamplePyramidFloat<ImageUInt8>(ImageUInt8.class);

		app.standard();
		app.process(image);
	}
}


text:
from __future__ import unicode_literals

from django.db import models, migrations
from django.conf import settings

class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='BookSale',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('title', models.CharField(max_length=255)),
                ('authors', models.CharField(max_length=255, verbose_name=b'Author(s)')),
                ('isbn', models.CharField(max_length=20, null=True, verbose_name=b'ISBN', blank=True)),
                ('edition', models.CharField(max_length=30, null=True, blank=True)),
                ('condition', models.IntegerField(choices=[(0, b'like new'), (1, b'very good'), (2, b'good'), (3, b'usable')])),
                ('price', models.DecimalField(max_digits=5, decimal_places=2)),
                ('is_recoop', models.BooleanField(default=False)),
                ('recoop_id', models.IntegerField(unique=True, null=True)),
                ('posted', models.DateTimeField(auto_now_add=True)),
                ('buyer', models.ForeignKey(related_name='book_purchases_set', blank=True, to=settings.AUTH_USER_MODEL, null=True)),
                ('seller', models.ForeignKey(related_name='book_sales_set', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['posted'],
            },
            bases=(models.Model,),
        ),
    ]