text:
import os
import logging
import ConfigParser

class Config:
    """Reads and writes the config file, adds an update function"""
    template = {
    'DAQBoard' : {
                        'INSTALLED': False,
                        'IO': 'output',
                        'BASE_CHAN': 0,
                        'NUM_CHANS': 16,
                        'STROBED': True,
                        },
    'Network' : {
                        'STIMSERVER_HOST': "192.168.1.101",
                        'EXPERIMENT_HOST': "192.168.1.102",
                        },
    'Viewport' : {
                        'WIDTH_PIX': 1280,
                        'HEIGHT_PIX': 800,
                        'WIDTH_CM':    38.6,
                        'HEIGHT_CM':   29.0,
                        'DISTANCE': 57.0,
                        'GAMMA':    1.0,
                        'INDEX':   0,
                        'MIRRORED': False,
                        'REFRESH_RATE': 60.0,
                        'X_RECTIFICATION': 0.0,
                        'Y_RECTIFICATION': 0.0
                        }
    }
    viewport_prefix = 'LIGHTSTIM_VIEWPORT_'
    def __init__(self):
        logger = logging.getLogger('LightStim.Configuration')
        self.cfg = ConfigParser.ConfigParser()

        user_dir = os.path.expanduser("~")
        current_dir = os.path.expanduser(".")
        self.LIGHTSTIM_SYSTEM_DIR = os.path.split(__file__)[0]
        self.LIGHTSTIM_USER_DIR = os.path.join(user_dir,"LightStim")
        # Is there one in LIGHTSTIM_USER_DIR?
        configFile = os.path.join(self.LIGHTSTIM_USER_DIR,"LightStim.cfg")
        if not os.path.isfile(configFile):
            configFile = os.path.join(current_dir,"LightStim.cfg")
            if not os.path.isfile(configFile):
                configFile = os.path.join(self.LIGHTSTIM_SYSTEM_DIR,"LightStim.cfg")
                if not os.path.isfile(configFile):
                    configFile = None # No file, use defaults specified in environment variables then here
        if configFile:
            self.cfg.read(configFile)
        else:
            raise RuntimeError('No hardware configuration file was found.')

        # Get the values from the configFile. The option names are compared to
        # template options to determine data types.
        self.sections = self.cfg.sections()
        for section in self.sections:
            for template_section in Config.template.iterkeys():
                if section.startswith(template_section):
                    section_template = Config.template[template_section]
            for option in self.cfg.options(section):
                name = option.upper()
                value = self.cfg.get(section,option)
                if value == 'False' or value == 'false':
                    value = False
                elif value == 'True' or value == 'true':
                    value = True
                try:
                    template_value = section_template[name]
                except KeyError:
                    logger.error('Cannot understand option name:%s in section:%s.' %(name,section))
                else:
                    if isinstance(template_value, bool):
                        value = self.cfg.getboolean(section, option)
                    elif isinstance(template_value, int):
                        value = self.cfg.getint(section, option)
                    elif isinstance(template_value, float):
                        value = self.cfg.getfloat(section, option)
                    elif isinstance(template_value, str):
                        value = self.cfg.get(section, option)
                    setattr(self,'LIGHTSTIM_'+section.upper()+'_'+name,value)

    def get_screen_width_pix(self,viewports_list):
        known_viewports = self.get_known_viewports()
        min_viewport_order = min([self.get_viewport_index(viewport_name) for viewport_name in viewports_list])
        max_viewport_order = max([self.get_viewport_index(viewport_name) for viewport_name in viewports_list])
        screen_viewports = known_viewports[min_viewport_order:max_viewport_order+1]
        return sum([self.get_viewport_width_pix(viewport_name) for viewport_name in screen_viewports])
    def get_screen_height_pix(self,viewports_list):
        return max([self.get_viewport_height_pix(viewport_name) for viewport_name in viewports_list])
    def get_known_viewports(self):
        viewports = [section[len('Viewport_'):] for section in self.sections if section.startswith('Viewport_')]
        # sorted from viewport index
        return sorted(viewports,key=self.get_viewport_index)
    def get_viewport_width_pix(self,viewport_name):
        return getattr(self, Config.viewport_prefix+viewport_name.upper()+'_'+'WIDTH_PIX')
    def get_viewport_height_pix(self,viewport_name):
        return getattr(self, Config.viewport_prefix+viewport_name.upper()+'_'+'HEIGHT_PIX')
    def get_viewport_width_cm(self,viewport_name):
        return getattr(self, Config.viewport_prefix+viewport_name.upper()+'_'+'WIDTH_CM')
    def get_viewport_height_cm(self,viewport_name):
        return getattr(self, Config.viewport_prefix+viewport_name.upper()+'_'+'HEIGHT_CM')
    def get_viewport_distance_cm(self,viewport_name):
        return getattr(self, Config.viewport_prefix+viewport_name.upper()+'_'+'DISTANCE')
    def get_viewport_index(self,viewport_name):
        return getattr(self, Config.viewport_prefix+viewport_name.upper()+'_'+'INDEX')
    def get_viewport_offset(self,viewport_name):
        known_viewports = self.get_known_viewports()
        left_viewports = known_viewports[:self.get_viewport_index(viewport_name)]
        return sum([self.get_viewport_width_pix(viewport_name) for viewport_name in left_viewports])
    def get_viewport_mirrored(self,viewport_name):
        return getattr(self, Config.viewport_prefix+viewport_name.upper()+'_'+'MIRRORED')
    def get_viewport_refresh_rate(self,viewport_name):
        return getattr(self, Config.viewport_prefix+viewport_name.upper()+'_'+'REFRESH_RATE')
    def get_viewport_gamma(self,viewport_name):
        return getattr(self, Config.viewport_prefix+viewport_name.upper()+'_'+'GAMMA')
    def is_viewport_mirrored(self,viewport_name):
        return getattr(self, Config.viewport_prefix+viewport_name.upper()+'_'+'MIRRORED')
    def get_viewport_x_rectification_deg(self,viewport_name):
        return getattr(self, Config.viewport_prefix+viewport_name.upper()+'_'+'X_RECTIFICATION')
    def get_viewport_y_rectification_deg(self,viewport_name):
        return getattr(self, Config.viewport_prefix+viewport_name.upper()+'_'+'Y_RECTIFICATION')

    def assume_viewport_refresh_rate(self):
        stim_viewport_refresh_rates = [self.get_viewport_refresh_rate(viewport) \
                                       for viewport in self.get_known_viewports() if viewport != 'control']
        refresh_rate = stim_viewport_refresh_rates[0] if len(stim_viewport_refresh_rates)>0 \
                                                      else self.get_viewport_refresh_rate('control')
        return refresh_rate

    def check_configuration(self):
        self.check_viewport_size()
        self.check_viewport_refresh_rate()

    def check_viewport_size(self):
        logger = logging.getLogger('LightStim.Configuration')
        stim_viewports = [viewport for viewport in self.get_known_viewports() if viewport != 'control']
        stim_viewport_sizes = [(self.get_viewport_width_pix(viewport), self.get_viewport_height_pix(viewport)) \
                               for viewport in stim_viewports]
        unique_sizes = set(stim_viewport_sizes)
        if len(unique_sizes)>1:
            logger.warning('Sizes of stimulus viewports are not the same in configuration file.')
        control_viewport_size = self.get_viewport_width_pix('control'), self.get_viewport_height_pix('control')
        for size in unique_sizes:
            if size[0]>control_viewport_size[0] or size[1]>control_viewport_size[1]:
                viewport_index = stim_viewport_sizes.index(size)
                logger.warning('Size of stimulus viewport \"%s\" is larger than that of control '
                               'viewport in configuration file.' %stim_viewports[viewport_index])

    def check_viewport_refresh_rate(self):
        """ Check refresh rate consistency across all viewports except control viewport.
        """
        logger = logging.getLogger('LightStim.Configuration')
        stim_viewport_refresh_rates = [self.get_viewport_refresh_rate(viewport) \
                                      for viewport in self.get_known_viewports() if viewport != 'control']
        unique_rates = set(stim_viewport_refresh_rates)
        if len(unique_rates)>1:
            logger.warning('Refresh rates of stimulus viewports are not the same in configuration file. Severe problems could happen '
                           'in subsequent stimulus presentation relating to temporal properties.')

redpajama_set_name: RedPajamaGithub


text:
    <uib-accordion close-others="oneAtATime" ng-if="vmShared.resultQueries" >
        <uib-accordion-group ng-repeat="obj in vmShared.resultQueries">
            <uib-accordion-heading>

                <button class="btn btn-info" ui-sref="listqueries.show-query" ng-click="listQ.showQuery(obj._source.queryObject.label)">{{obj._source.queryObject.label}}</button>
            </uib-accordion-heading>

        </uib-accordion-group>
    </uib-accordion>


text:
package sun.bob.mcalendar.fragments;

import android.graphics.Color;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.view.animation.Animation;
import android.view.animation.Transformation;
import android.widget.LinearLayout;

import sun.bob.mcalendar.R;
import sun.bob.mcalendar.activities.MainActivity;
import sun.bob.mcalendar.adapters.TaskAdapter;
import sun.bob.mcalendar.constants.ClickedBackground;
import sun.bob.mcalendarview.MarkStyle;
import sun.bob.mcalendarview.listeners.OnDateClickListener;
import sun.bob.mcalendarview.listeners.OnMonthChangeListener;
import sun.bob.mcalendarview.mCalendarView;
import sun.bob.mcalendarview.utils.CurrentCalendar;
import sun.bob.mcalendarview.vo.DateData;

/**
 * Created by bob.sun on 15/10/21.
 */
public class FragmentCalendar extends Fragment {

    RecyclerView recyclerView;
    mCalendarView calendarView;
    View holder;
    LinearLayout listWrapper;
    LinearLayout calendarWrapper;
    //if true? => initial state;
    //if false? => changed state;
    /**
     * if true? > initial state;
     * if false? > changed state;
     */
    boolean mState = true;
    boolean calendarIsDrawn = false;
    boolean listViewIsDrawn = false;
    int initialCalednarViewHeight = 0;
    int initialListViewHeight = 0;

    int lastChangedCalendarViewHeight = 0;
    int lastChangedListViewHeight = 0;
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState){
        View ret = inflater.inflate(R.layout.fragment_calendar, null);
        calendarWrapper = (LinearLayout)ret.findViewById(R.id.calendar_wrapper);
        listWrapper = (LinearLayout)ret.findViewById(R.id.list_wrapper);
        listWrapper.setVerticalScrollBarEnabled(true);
        calendarView =
                ((mCalendarView) ret.findViewById(R.id.id_mcalendarview))
                .hasTitle(false)
                .setMarkedStyle(MarkStyle.DOT, Color.rgb(63, 81, 181))
                .setOnMonthChangeListener(new MonthChangeListener())
                .setOnDateClickListener(new DateClickListener());

        recyclerView = (RecyclerView) ret.findViewById(R.id.id_calendar_task);
        recyclerView.setAdapter(new TaskAdapter(getActivity(), CurrentCalendar.getCurrentDateData()));
        recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
        listWrapper.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
            @Override
            public void onGlobalLayout() {
                if(!listViewIsDrawn) {
                    listViewIsDrawn = true;
                    initialListViewHeight = listWrapper.getHeight();
                }
            }
        });
        calendarWrapper.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener(){
            @Override
            public void onGlobalLayout() {
                if(!calendarIsDrawn) {
                    calendarIsDrawn = true;
                    initialCalednarViewHeight = calendarWrapper.getHeight();
                }
            }
        });

        holder = ret.findViewById(R.id.holder);
        holder.setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View v, MotionEvent event) {
                switch(event.getAction()) {
                    case MotionEvent.ACTION_DOWN :
                        if(mState) {
                            final ResizeAnimation resizeAnim1 = new ResizeAnimation(listWrapper);
                            resizeAnim1.setDuration((int)(initialListViewHeight / v.getContext().getResources().getDisplayMetrics().density));
                            resizeAnim1.setParams(initialListViewHeight, 700);

                            final ResizeAnimation resizeAnim2 = new ResizeAnimation(calendarWrapper);
                            resizeAnim2.setDuration((int)(initialCalednarViewHeight / v.getContext().getResources().getDisplayMetrics().density));
                            resizeAnim2.setParams(initialCalednarViewHeight, 150);

                            listWrapper.startAnimation(resizeAnim1);
                            calendarWrapper.startAnimation(resizeAnim2);

                        } else {
                            final ResizeAnimation resizeAnim1 = new ResizeAnimation(listWrapper);
                            resizeAnim1.setDuration((int)(initialListViewHeight / v.getContext().getResources().getDisplayMetrics().density));
                            resizeAnim1.setParams(700, initialListViewHeight);

                            final ResizeAnimation resizeAnim2 = new ResizeAnimation(calendarWrapper);
                            resizeAnim2.setDuration((int)(initialCalednarViewHeight / v.getContext().getResources().getDisplayMetrics().density));
                            resizeAnim2.setParams(150, initialCalednarViewHeight);

                            listWrapper.startAnimation(resizeAnim1);
                            calendarWrapper.startAnimation(resizeAnim2);
                        }
                        setCurrentState(mState ? false : true);
                        break;
                }
                return true;
            }
        });
        return ret;
    }

    class MonthChangeListener extends OnMonthChangeListener {

        @Override
        public void onMonthChange(int year, int month) {
            ((MainActivity) getActivity()).toolbar.setTitle(new StringBuilder().append("").append(year).append(" - ").append(month).toString());
        }
    }
    class DateClickListener extends OnDateClickListener{

        private View lastClicked;
        private DateData lastClickedDate;

        @Override
        public void onDateClick(View view, DateData date) {
            if (lastClicked != null){
                if (lastClickedDate.equals(CurrentCalendar.getCurrentDateData())){
                    lastClicked.setBackground(MarkStyle.todayBackground);
                } else {
                    lastClicked.setBackground(null);
                }
            }
            view.setBackground(ClickedBackground.background);
            lastClicked = view;
            lastClickedDate = date;
            ((TaskAdapter) recyclerView.getAdapter()).changeDate(date);
        }
    }
    private void setCurrentState(boolean state) {
        mState = state;
    }
    public class ResizeAnimation extends Animation {

        private int startHeight;
        private int deltaHeight; // distance between start and end height
        private View view;
        public ResizeAnimation(int startHeight, int endHeight, View view) {
            this.startHeight = startHeight;
            this.deltaHeight = endHeight - this.startHeight;
        }
        public ResizeAnimation (View v) {
            this.view = v;
        }

        @Override
        protected void applyTransformation(float interpolatedTime, Transformation t) {
            view.getLayoutParams().height = (int) (startHeight + deltaHeight * interpolatedTime);
            view.requestLayout();
        }

        public void setParams(int start, int end) {
            this.startHeight = start;
            deltaHeight = end - startHeight;
        }

        @Override
        public void setDuration(long durationMillis) {
            super.setDuration(durationMillis);
        }

        @Override
        public boolean willChangeBounds() {
            return true;
        }
    }
}


text:
using System;
using System.Linq;
using System.Reflection;
using FluentModelBuilder.Configuration;
using FluentModelBuilder.Tests.Core;
using FluentModelBuilder.TestTarget;
using Microsoft.EntityFrameworkCore;
using Xunit;

namespace FluentModelBuilder.Tests
{
    public class BuildingModelFromSingleAssemblyWithWhere : TestBase<SingleAssemblyWithWhereFixture, DbContext>
    {
        public BuildingModelFromSingleAssemblyWithWhere(SingleAssemblyWithWhereFixture fixture) : base(fixture)
        {
        }

        [Theory]
        [InlineData(0, typeof(EntityOne))]
        [InlineData(1, typeof(EntityTwo))]
        public void MapsEntity(int index, Type expectedType)
        {
            Assert.Equal(expectedType, EntityTypes.ElementAt(index).ClrType);
        }

        [Theory]
        [InlineData(0, 0, "Id")]
        [InlineData(0, 1, "IgnoredInOverride")]
        [InlineData(0, 2, "NotIgnored")]

        [InlineData(1, 0, "Id")]
        public void MapsEntityProperty(int elementIndex, int propertyIndex, string name)
        {
            var properties = GetProperties(elementIndex);
            Assert.Equal(name, properties.ElementAt(propertyIndex).Name);
        }
    }

    public class SingleAssemblyWithWhereFixture : FluentModelFixtureBase<DbContext>
    {
        protected override void ConfigureMappings(FluentModelBuilderConfiguration configuration)
        {
            configuration.Add(
                From.AssemblyOf<EntityBase>().Where(type => type.GetTypeInfo().IsSubclassOf(typeof (EntityBase))));
        }
    }
}


text:
import pprint, csv, string, random, sys, math
from nltk.tokenize import word_tokenize
from collections import Counter
from sklearn import svm

#from nltk.tag import pos_tag
#import stanford_parser_pipe
#print stanford_parser_pipe.parse('Type John in the First Name field')
#sys.exit(0)

def tokenize_command(command):
    command = unicode(command, 'utf-8')
    return [token.lower().strip(string.punctuation) for token in word_tokenize(command) if token not in string.punctuation]

def untokenize_subcommand(sub):
    return ' '.join(sub)

def subcommands(command):
    subs = []
    for window_size in range(1, len(command)+1):
        for i in range(0, len(command)-window_size+1):
            subs.append((
                command[i:i+window_size],
                i, i+window_size
            ))
    return subs

def build_unigram_model(corpus):
    words = reduce(lambda x,y: x+y, (tokenize_command(sentence) for sentence in corpus))
    norm = float(len(words))
    model = Counter()

    for w in words:
        model[w] += 1

    def evalmodel(w):
        # Laplace smoothed!
        return (model[w.lower().strip(string.punctuation)]+1.0) / norm

    return evalmodel

def build_idf_model(corpus):
    sentences = [tokenize_command(sentence) for sentence in corpus]
    words = set(reduce(lambda x,y: x+y, sentences))

    model = {}

    for word in words:
        model[word] = math.log(len(sentences) / (sum([1.0 for sentence in sentences if word in sentence]) + 1.0))

    def evalmodel(w):
        # Laplace smoothed!
        return model.get(w.lower().strip(string.punctuation), len(sentences)) / (1.0*len(sentences))

    return evalmodel

# A list of documents (lists of words)
CORPUS = [x[1] for x in csv.reader(open('data/corpora/sendacard_corpus.tsv', 'rb'), delimiter='\t')]
CORPUS += [x[1] for x in csv.reader(open('data/corpora/hipmunk_corpus.tsv', 'rb'), delimiter='\t')]

UNIGRAM_MODEL = build_unigram_model(CORPUS)
IDF_MODEL = build_idf_model(CORPUS)

def feats(subwords, command, start, end):
    single_subword = 1 if len(subwords) == 1 else 0
    double_subword = 1 if len(subwords) == 2 else 0
    big_subword = 1 if len(subwords) > 2 else 0

    action_words = 'press hit click type enter put'.split(' ')
    contains_action_word = 1 if any([w.lower() in action_words for w in subwords]) else -1

    stop_words = 'the in as for to'.split(' ')
    contains_stop_word = 1 if any([w.lower() in stop_words for w in subwords]) else -1

    # Note that this is not the phrase likelihood, but the average term likelihood
    word_entropy = sum([UNIGRAM_MODEL(w) for w in subwords]) / len(subwords)

    tf_idf = sum([IDF_MODEL(w) for w in subwords]) / len(subwords)

    #tags = [(word, tag) for word, tag in pos_tag(command)][start:end]
    #taglist = [tag for word, tag in tags]

    #has_nn = 'NN' in taglist or 'NNP' in taglist
    #has_dt = 'DT' in taglist
    #has_in = 'IN' in taglist

    return [
        single_subword, double_subword, big_subword,
        contains_action_word ,contains_stop_word,
        word_entropy, tf_idf,
        #has_nn, has_dt, has_in
    ]

def read_data(path):
    data = list(csv.reader(open(path, 'rb'), delimiter='\t'))
    return [(sentence.strip(), text.strip()) for seq,sentence,action,element,text in data if action == 'type']

def build_model(train):
    feature_vectors = []
    labels = []

    for sentence, correct in train:
        for subwords, start, end in subcommands(tokenize_command(sentence)):
            f = feats(subwords, sentence, start, end)

            label = -1
            if ' '.join([w.strip(string.punctuation) for w in subwords]).lower() == correct.lower():
                label = 1

            feature_vectors.append(f)
            labels.append(label)

    clf = svm.LinearSVC()
    clf.fit(feature_vectors, labels)

    return clf

def build_default_model():
    model = build_model(read_data('data/corpora/sendacard_corpus.tsv'))

    def evalmodel(subwords):
        v = model.decision_function(feats(subwords, None, None, None))[0]
        return 1 + v

    return evalmodel

if __name__ == '__main__':
    model = build_default_model()

    total_correct = 0

    test = read_data('data/corpora/sendacard_mturk_corpus.tsv')

    for sentence, correct in test:
        print sentence, '=>', correct

        best = Counter()
        for subwords, start, end in subcommands(tokenize_command(sentence)):
            #f = feats(subwords, sentence, start, end)
            #prediction, decision_f = clf.predict(f)[0], clf.decision_function(f)[0]
            best[tuple(subwords)] += model(subwords)

        best_cmd, best_score = best.most_common(1)[0]
        if ' '.join([w.strip(string.punctuation) for w in best_cmd]).lower() == correct.lower():
            total_correct += 1
        else:
            print '\tIncorrect:', best_cmd

        for cmd, score in best.most_common(3):
            print '\t', ' '.join(cmd), score

    print 'Accuracy:', (total_correct*1.0) / len(test)


text:
package com.promostree.domain.entities;

import java.util.Date;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.transaction.Transactional;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

import com.fasterxml.jackson.annotation.JsonBackReference;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonManagedReference;

@Entity(name="brand")
@Table(name="brand")
public class Brand {
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private  Long id;
	private  String name;
	@Temporal(TemporalType.DATE)
	@NotNull
	private Date createdDate;
	private boolean active;

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name="venues_brands",
	inverseJoinColumns={@JoinColumn(name="venue_id", referencedColumnName="id")},
	joinColumns={@JoinColumn(name="brand_id", referencedColumnName="id")}
	)
	@JsonManagedReference
	@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
	@Fetch(value = FetchMode.SUBSELECT)
	private  List<Venue> venues;

	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public List<Venue> getVenues() {
		return venues;
	}
	public void setVenues(List<Venue> venues) {
		this.venues = venues;
	}
	public Date getCreatedDate() {
		return createdDate;
	}
	public void setCreatedDate(Date createdDate) {
		this.createdDate = createdDate;
	}
	public boolean isActive() {
		return active;
	}
	public void setActive(boolean active) {
		this.active = active;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + (active ? 1231 : 1237);
		result = prime * result
				+ ((createdDate == null) ? 0 : createdDate.hashCode());
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		result = prime * result + ((venues == null) ? 0 : venues.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Brand other = (Brand) obj;
		if (active != other.active)
			return false;
		if (createdDate == null) {
			if (other.createdDate != null)
				return false;
		} else if (!createdDate.equals(other.createdDate))
			return false;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		if (venues == null) {
			if (other.venues != null)
				return false;
		} else if (!venues.equals(other.venues))
			return false;
		return true;
	}
	@Override
	public String toString() {
		return "Brand [id=" + id + ", name=" + name + ", createdDate="
				+ createdDate + ", active=" + active + ", venues=" + venues
				+ "]";
	}

}


text:
<?php

class Facade_WP_MetaBox_Template_ImageDubbel extends Facade_WP_MetaBox_Template
{
  public function getKeys()
  {
    return
      [
        $this->id . '-thumb',
        $this->id . '-image',
        $this->id . '-alt'
      ];
  }
}


text:
import tornado.httpserver
import tornado.ioloop
import tornado.web
import tornado.options

from tornado.options import define, options
define("port", default=8000, help="run on the given port", type=int)

class MainHandler(tornado.web.RequestHandler):
    def get(self):
        cookie = self.get_secure_cookie("count")
        count = int(cookie) + 1 if cookie else 1

        countString = "1 time" if count == 1 else "%d times" % count

        self.set_secure_cookie("count", str(count))

        self.write(
            '<title>Cookie Counter</title>'
            '
You've viewed this page %s times.
' % countString+
            ''
        )

if __name__ == "__main__":
    tornado.options.parse_command_line()

    settings = {
        "cookie_secret": "bZJc2sWbQLKos6GkHn/VB9oXwQt8S0R0kRvJ5/xJ89E="
    }

    application = tornado.web.Application([
        (r'/', MainHandler)
    ], **settings)

    http_server = tornado.httpserver.HTTPServer(application)
    http_server.listen(options.port)
    tornado.ioloop.IOLoop.instance().start()


text:
{% load staticfiles %}
<html>
   <head>
      <link href="{% static 'bootstrap/css/bootstrap.min.css' %}"
            rel="stylesheet" media="screen">
   </head>

   <body>
      {% block content %}
      {% endblock %}

      <script src="{ static 'bootstrap/js/bootstrap.min.js' %}"></script>
   </body>
</html>


text:
import collections
import itertools
from typing import Iterable, List, NamedTuple, Optional, Tuple

from data import max_heap
from data.alphabets import morse
from puzzle.problems import problem
from puzzle.steps import generate_solutions

_IGNORE_DELIMITER = 'ignored'
_CHARACTER_DELIMITER = 'character delimiter'
_WORD_DELIMITER = 'word delimiter'
_DOT = '.'
_DASH = '-'
_MORSE_DENSITY = 3.3  # Typical number of morse characters per character.
_TARGET_WORD_LENGTH = 3  # Require 3+ letters.
_TARGET_LENGTH = _MORSE_DENSITY * _TARGET_WORD_LENGTH

class _Interpretation(NamedTuple):
  dot: str
  dash: str
  character_delimiter: Optional[str]
  word_delimiter: Optional[str]
  ignored: set

# "Most common" interpretation.
_ALPHABET = _Interpretation(
    '.',
    '-',
    ' ',
    '/',
    set(),
)

class MorseProblem(problem.Problem):
  def __init__(self, name: str, lines: List[str], **kwargs) -> None:
    super(MorseProblem, self).__init__(name, lines, **kwargs)
    self._normalized = '\n'.join(lines)
    self._frequencies = collections.Counter(self._normalized)
    for c in list(self._frequencies.keys()):
      if c.isspace():  # Ignore whitespace in input.
        del self._frequencies[c]

  @staticmethod
  def score(lines: List[str]) -> float:
    return _score(lines)

  def _solve(self) -> dict:
    raise NotImplementedError()  # Explicitly unsupported.

  def _solve_iter(self) -> generate_solutions.Solutions:
    fringe: max_heap.MaxHeap[Tuple[generate_solutions.Solutions, str, bool]] = (
      max_heap.MaxHeap())
    solution_buffer: max_heap.MaxHeap[generate_solutions.Solutions] = (
      max_heap.MaxHeap())
    # Initialize options with weights.
    for weight, interpretation in _generate_interpretations(self._normalized):
      fringe.push(weight, self._iter_interpretation(interpretation))
    while fringe:
      group_generator, group_weight = fringe.pop_with_weight()
      if fringe:
        next_best_weight = fringe.best_weight()
      else:
        next_best_weight = float('-inf')
      while next_best_weight < self._solution_constraints.weight_threshold:
        yield StopIteration()  # Good solutions are impossible.
      yield from solution_buffer.pop_with_weight_until(next_best_weight)
      for result in group_generator:
        (solution, weight), notes, has_ignored = result
        if has_ignored and solution in self._notes:
          continue  # Skip duplicates which can occur with ignored characters.
        self._notes[solution] = notes  # Save (and throw away) notes.
        solution_weight = group_weight * weight
        if solution_weight > next_best_weight:
          yield solution, solution_weight
        else:
          solution_buffer.push(solution_weight, solution)
          # Abandon this generator for now.
          fringe.push(group_weight, group_generator)
          break
    yield from solution_buffer.pop_with_weight_until(float('-inf'))

  def _iter_interpretation(
      self, interpretation: _Interpretation
  ) -> Tuple[generate_solutions.Solutions, str, bool]:
    acc = []
    result = []
    for c in self._normalized:
      if c == interpretation.dot:
        acc.append('.')
      elif c == interpretation.dash:
        acc.append('-')
      elif c in (
          interpretation.character_delimiter, interpretation.word_delimiter):
        buffer = ''.join(acc)
        acc.clear()
        if not buffer:
          pass
        elif buffer in morse.LOOKUP:
          result.append(morse.LOOKUP[buffer])
        else:
          # Turns out this was an invalid interpretation?
          return
        if c == interpretation.word_delimiter:
          result.append(' ')
      elif c in interpretation.ignored:
        continue
      else:
        raise ValueError(
            'Unexpected "%s" for interpretation %s' % (c, interpretation))
    if acc:
      buffer = ''.join(acc)
      if buffer in morse.LOOKUP:
        result.append(morse.LOOKUP[buffer])
      else:
        return  # TODO: Attempt inserting delimiters.
    solution = (''.join(result), 1.0)
    yield (
      solution, _interpretation_notes(interpretation),
      bool(interpretation.ignored))

def _score(lines: List[str]) -> float:
  counts = collections.Counter()
  size = 0
  for line in lines:
    counts.update(line)
    size += len(line)
    if len(counts) > len(_ALPHABET):
      return 0
  if len(counts) < 2:
    return 0  # Minimal input.
  # There are [1, _ALPHABET] symbols.
  if all(c in _ALPHABET for c in counts):
    return 1  # Looks like ordinary morse.
  elif '.' in counts and '-' in counts:
    margin_of_error = 0.1
  elif len(counts) < len(_ALPHABET) - 1:  # No ignored symbols
    margin_of_error = 0.5
  else:
    margin_of_error = 1.0
  # Increase confidence asymptotically with the size of input. Long inputs
  # with only 3 symbols are very morse-like.
  return max((
    0, (1 - margin_of_error) + (margin_of_error * (1 - _TARGET_LENGTH / size))
  ))

def _generate_interpretations(
    given: str) -> Iterable[Tuple[float, _Interpretation]]:
  results = []
  frequencies = collections.Counter(given)
  (_, first_n), (_, second_n) = frequencies.most_common(2)
  max_score = first_n * first_n + second_n + 1  # +1 to reserve true 1.0.
  def _scored_interpretation(
      dot: str, dash: str, character_delimiter: Optional[str],
      word_delimiter: Optional[str], ignored: set, weight_penalty: float,
  ) -> Tuple[float, _Interpretation]:
    interpretation = _Interpretation(
        dot, dash, character_delimiter, word_delimiter, ignored)
    if dot == '.' and dash == '-':
      # Very probable assignment.
      base_score = max_score
    else:
      base_score = (first_n * frequencies[dot] + frequencies[dash])
      if dot == '-' and dash == '.':
        # Improbable but interesting assignment.
        base_score *= 0.8
    if ignored and not word_delimiter:
      penalty = len(ignored)  # Discourage wasted characters.
    else:
      penalty = 0
    # Prefer assigning (dot, dash) to 1st and 2nd most common, respectively.
    return (
      weight_penalty * base_score / (max_score + penalty),
      interpretation,
    )
  n_chars = len(frequencies)
  for x, y in itertools.combinations(frequencies, 2):
    if n_chars == 2:
      character_delimiter = None
      word_delimiter = None
      ignored = set()
      results.append(_scored_interpretation(
          x, y, character_delimiter, word_delimiter, ignored, 1.0))
      results.append(_scored_interpretation(
          y, x, character_delimiter, word_delimiter, ignored, 1.0))
    elif n_chars == 3:
      character_delimiter = None
      for c in frequencies:
        if c in (x, y):
          continue
        character_delimiter = c
        break
      # Ensure character_delimiter is never consecutive.
      if character_delimiter * 2 in given:
        continue  # Repeated delimiter appears in input.
      word_delimiter = None
      ignored = set()
      results.append(_scored_interpretation(
          x, y, character_delimiter, word_delimiter, ignored, 1.0))
      results.append(_scored_interpretation(
          y, x, character_delimiter, word_delimiter, ignored, 1.0))
    else:
      # Need to choose both a character and word delimiter.
      options = []
      for c in frequencies:
        if c in (x, y):
          continue
        options.append(c)
      # 2+ items in options. Validate delimiters never repeat.
      last = None
      for character_delimiter, word_delimiter in itertools.permutations(
          options, 2):
        if given[-1] == word_delimiter:
          continue  # This interpretation would require a space at the end.
        need_char = False  # Allow arbitrary delimiters to start.
        saw_word_delimiter = False  # Require character between word_delimiter.
        max_word_length = 0
        acc_word_length = 0
        for c in given:
          if c != word_delimiter:
            pass
          elif saw_word_delimiter:
            break  # Two word delimiters occurred between a character.
          else:
            saw_word_delimiter = True
            max_word_length = max(acc_word_length, max_word_length)
            acc_word_length = 0
          if c in (x, y):
            need_char = False  # Found a character. Reset expectations.
            saw_word_delimiter = False
            acc_word_length += 1
          elif need_char and c == last:
            break  # Needed a character and delimiter repeated. Break.
          elif c in (character_delimiter, word_delimiter):
            need_char = True  # Expect a character.
          last = c
        else:
          # 'break' never happened
          ignored = set()
          for c in options:
            if c in (character_delimiter, word_delimiter):
              continue
            ignored.add(c)
          if given.startswith(word_delimiter) or given.endswith(word_delimiter):
            weight_penalty = 0.25
          else:
            weight_penalty = 1.0
          if max_word_length < _TARGET_WORD_LENGTH:
            weight_penalty *= 0.1
          results.append(_scored_interpretation(
              x, y, character_delimiter, word_delimiter, ignored,
              weight_penalty))
          results.append(_scored_interpretation(
              y, x, character_delimiter, word_delimiter, ignored,
              weight_penalty))
          # Perhaps word delimiters are ignored.
          ignored = ignored.copy()
          ignored.add(word_delimiter)
          results.append(_scored_interpretation(
              x, y, character_delimiter, None, ignored, weight_penalty * 0.9))
          results.append(_scored_interpretation(
              y, x, character_delimiter, None, ignored, weight_penalty * 0.9))
          # Perhaps all delimiters are ignored.
          ignored = ignored.copy()
          ignored.add(character_delimiter)
          results.append(_scored_interpretation(
              x, y, None, None, ignored, weight_penalty * 0.8))
          results.append(_scored_interpretation(
              y, x, None, None, ignored, weight_penalty * 0.8))
  return sorted(results, key=lambda key: key[0], reverse=True)

def _interpretation_notes(interpretation) -> List[str]:
  parts = [
    'dot: %s' % repr(interpretation.dot),
    'dash: %s' % repr(interpretation.dash),
  ]
  if interpretation.character_delimiter:
    parts.append(
        'character delimiter: %s' % repr(interpretation.character_delimiter))
  if interpretation.word_delimiter:
    parts.append('space: %s' % repr(interpretation.word_delimiter))
  if interpretation.ignored:
    parts.append('ignored: %s' % repr(''.join(sorted(interpretation.ignored))))
  return parts


text:
using System.Xml.Serialization;

namespace WarHub.ArmouryModel.Source
{
    /// <summary>
    /// Describes metadata of an item, further along referred to as target item.
    /// </summary>
    [WhamNodeCore]
    public sealed partial record MetadataCore
    {
        /// <summary>
        /// Gets an identifier of the target item described by this meta within some collection.
        /// </summary>
        public string? Identifier { get; init; }

        /// <summary>
        /// Gets an identifier of an item preceding the target item.
        /// </summary>
        public string? PrevIdentifier { get; init; }

        /// <summary>
        /// Gets sequence number of the target item within some collection, defaults to 0.
        /// </summary>
        public int Sequence { get; init; }
    }
}


text:
class Service::SqsQueue < Service
  string :aws_access_key, :sqs_queue_name
  password :aws_secret_key
  white_list :aws_access_key, :sqs_queue_name

  # receive_event()
  def receive_event
    return unless data && payload

    if data['aws_access_key'].to_s.empty?
      raise_config_error "You must define an AWS access key."
    end

    if data['aws_secret_key'].to_s.empty?
      raise_config_error "You must define an AWS secret key."
    end

    if data['sqs_queue_name'].to_s.empty?
      raise_config_error "You must define an SQS queue."
    end

    # Encode payload to JSON
    payload_json_data = generate_json(payload)

    # Send payload to SQS queue
    notify_sqs( access_key(), secret_key(), queue_name(), payload_json_data )
  end

  # notify_sqs()
  # Note: If the queue does not exist, it is automatically created
  def notify_sqs(aws_access_key, aws_secret_key, queue_name, payload)
    sqs = RightAws::SqsGen2.new(aws_access_key, aws_secret_key)
    queue = sqs.queue(queue_name)
    queue.send_message(clean_for_json(payload))
  end

  def access_key
    data['aws_access_key'].strip
  end

  def secret_key
    data['aws_secret_key'].strip
  end

  def queue_name
    data['sqs_queue_name'].strip
  end

end


text:
import android.accounts.Account;
import android.accounts.AccountManager;
import android.app.AlarmManager;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.net.Uri;
import android.preference.PreferenceManager;
import android.util.Log;
import com.google.android.libraries.social.autobackup.AutoBackupStalledReceiver;
import com.google.android.libraries.social.autobackup.FolderAutoBackupReceiver;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
import java.util.concurrent.TimeUnit;

public final class hcw
{
  private static final long a = TimeUnit.DAYS.toMillis(2L);
  private static final long b = TimeUnit.DAYS.toMillis(1L);
  private static final Uri c = Uri.parse("https://support.google.com/mobile/?p=google_settings_auto_backup");
  private static final mcs d = new mcs("debug.plus.ab_setup_notif", (byte)0);
  private static final mcs e = new mcs("debug.plus.ab_migrate_notif", (byte)0);

  public static long a()
  {
    return TimeUnit.DAYS.toMillis(90L) / 2L;
  }

  public static void a(Context paramContext)
  {
    ((NotificationManager)paramContext.getSystemService("notification")).cancel(String.valueOf(paramContext.getPackageName()).concat(":notifications:setup_backup"), efj.Fo);
  }

  public static void a(Context paramContext, int paramInt)
  {
    ((NotificationManager)paramContext.getSystemService("notification")).cancel(f(paramContext, paramInt), efj.Fn);
  }

  public static void a(Context paramContext, int paramInt1, int paramInt2, int paramInt3, boolean paramBoolean)
  {
    if (hbj.b(paramContext)) {
      return;
    }
    Intent localIntent = ((hcv)mbb.a(paramContext, hcv.class)).a(paramContext, paramInt1);
    localIntent.setPackage(paramContext.getPackageName());
    localIntent.addFlags(335544320);
    PendingIntent localPendingIntent = PendingIntent.getActivity(paramContext, (int)System.currentTimeMillis(), localIntent, 0);
    String str1 = b(paramContext, Math.max(paramInt3 - paramInt2, 0));
    if (paramBoolean) {}
    for (int i = efj.Fx;; i = efj.Fv)
    {
      int j = efj.Fj;
      dk localdk = new dk(paramContext);
      localdk.x.icon = j;
      localdk.a(16, true);
      localdk.b = dk.a(paramContext.getString(efj.FA));
      String str2 = paramContext.getString(i, new Object[] { str1 });
      localdk.x.tickerText = dk.a(str2);
      localdk.c = dk.a(paramContext.getString(i, new Object[] { str1 }));
      localdk.d = localPendingIntent;
      ((NotificationManager)paramContext.getSystemService("notification")).notify(f(paramContext, paramInt1), efj.Fn, localdk.a());
      return;
    }
  }

  public static void a(Context paramContext, int paramInt, String paramString1, String paramString2)
  {
    if (hbj.b(paramContext)) {}
    fe localfe;
    do
    {
      return;
      Intent localIntent = ((hcv)mbb.a(paramContext, hcv.class)).b(paramContext, paramInt);
      localfe = new fe(paramContext);
      localfe.a(localIntent);
    } while (hbj.a(paramContext));
    dk localdk1 = new dk(paramContext);
    PendingIntent localPendingIntent1 = localfe.a((int)System.currentTimeMillis(), 134217728, null);
    String str = paramContext.getString(efj.FE);
    localdk1.b = dk.a(paramContext.getString(efj.FF));
    localdk1.c = dk.a(String.format(str, new Object[] { paramString1 }));
    int i = efj.Ff;
    localdk1.x.icon = i;
    localdk1.d = localPendingIntent1;
    int j = efj.Fg;
    CharSequence localCharSequence1 = paramContext.getText(efj.FC);
    int k = FolderAutoBackupReceiver.b;
    FolderAutoBackupReceiver.b = k + 1;
    PendingIntent localPendingIntent2 = FolderAutoBackupReceiver.a(paramContext, "com.google.android.libraries.social.autobackup.ACTION_SKIP_FOLDER_BACKUP", paramString2, k);
    if (Log.isLoggable("FolderABReceiver", 3))
    {
      int i2 = FolderAutoBackupReceiver.b;
      new StringBuilder(62).append("created skip folder PendingIntent with requestCode=").append(i2);
    }
    dk localdk2 = localdk1.a(j, localCharSequence1, localPendingIntent2);
    int m = efj.Fh;
    CharSequence localCharSequence2 = paramContext.getText(efj.FD);
    int n = FolderAutoBackupReceiver.a;
    FolderAutoBackupReceiver.a = n + 1;
    PendingIntent localPendingIntent3 = FolderAutoBackupReceiver.a(paramContext, "com.google.android.libraries.social.autobackup.ACTION_ENABLE_FOLDER_BACKUP", paramString2, n);
    if (Log.isLoggable("FolderABReceiver", 3))
    {
      int i1 = FolderAutoBackupReceiver.a;
      new StringBuilder(64).append("created enable folder PendingIntent with requestCode=").append(i1);
    }
    localdk2.a(m, localCharSequence2, localPendingIntent3).a(16, true);
    ((NotificationManager)paramContext.getSystemService("notification")).notify(efj.Fm, localdk1.b());
  }

  public static void a(Context paramContext, long paramLong)
  {
    SharedPreferences.Editor localEditor = PreferenceManager.getDefaultSharedPreferences(paramContext).edit();
    localEditor.putLong("iu.auto_backup_notification_timestamp", paramLong);
    try
    {
      localEditor.putInt("iu.auto_backup_notification_version_code", paramContext.getPackageManager().getPackageInfo(paramContext.getPackageName(), 0).versionCode);
      localEditor.apply();
      return;
    }
    catch (PackageManager.NameNotFoundException localNameNotFoundException)
    {
      for (;;)
      {
        Log.e("ABNotifications", "Cannot get package version", localNameNotFoundException);
      }
    }
  }

  public static void a(Context paramContext, long paramLong, boolean paramBoolean)
  {
    long l1 = System.currentTimeMillis();
    AlarmManager localAlarmManager;
    PendingIntent localPendingIntent;
    if (AutoBackupStalledReceiver.a(paramContext, false, paramLong) == null)
    {
      localAlarmManager = (AlarmManager)paramContext.getSystemService("alarm");
      localPendingIntent = AutoBackupStalledReceiver.a(paramContext, true, paramLong);
      if (!paramBoolean) {
        break label57;
      }
    }
    label57:
    for (long l2 = b;; l2 = a)
    {
      localAlarmManager.set(0, l2 + l1, localPendingIntent);
      return;
    }
  }

  public static String b(Context paramContext, int paramInt)
  {
    if (paramInt < 900)
    {
      int k = efj.Fw;
      Object[] arrayOfObject3 = new Object[1];
      arrayOfObject3[0] = Integer.valueOf(paramInt);
      return paramContext.getString(k, arrayOfObject3);
    }
    if (paramInt < 921600)
    {
      int j = efj.Fu;
      Object[] arrayOfObject2 = new Object[1];
      arrayOfObject2[0] = Double.valueOf(Math.max(paramInt / 1024.0D, 1.0D));
      return paramContext.getString(j, arrayOfObject2);
    }
    int i = efj.Fy;
    Object[] arrayOfObject1 = new Object[1];
    arrayOfObject1[0] = Double.valueOf(Math.max(paramInt / 1048576.0D, 1.0D));
    return paramContext.getString(i, arrayOfObject1);
  }

  public static void b(Context paramContext)
  {
    PendingIntent localPendingIntent = AutoBackupStalledReceiver.a(paramContext, false, 0L);
    if (localPendingIntent != null) {
      ((AlarmManager)paramContext.getSystemService("alarm")).cancel(localPendingIntent);
    }
    ((NotificationManager)paramContext.getSystemService("notification")).cancel(String.valueOf(paramContext.getPackageName()).concat(":notifications:backup_stalled"), efj.Fo);
  }

  public static void c(Context paramContext) {}

  public static void c(Context paramContext, int paramInt)
  {
    hcv localhcv = (hcv)mbb.b(paramContext, hcv.class);
    if (localhcv == null) {}
    while (hbj.a(paramContext)) {
      return;
    }
    Intent localIntent = localhcv.d(paramContext, paramInt);
    fe localfe = new fe(paramContext);
    localfe.a(localIntent);
    dk localdk = new dk(paramContext);
    PendingIntent localPendingIntent = localfe.a((int)System.currentTimeMillis(), 134217728, null);
    String str = paramContext.getString(efj.Fr);
    localdk.b = dk.a(paramContext.getString(efj.Fq));
    localdk.c = dk.a(str);
    int i = efj.Ff;
    localdk.x.icon = i;
    localdk.d = localPendingIntent;
    localdk.h = 2;
    localdk.a(2, true);
    ((NotificationManager)paramContext.getSystemService("notification")).notify(efj.Fk, localdk.b());
    ((hal)mbb.a(paramContext, hal.class)).e(paramContext, paramInt);
  }

  public static void d(Context paramContext)
  {
    if (((hba)mbb.a(paramContext, hba.class)).c()) {}
    ArrayList localArrayList;
    do
    {
      do
      {
        return;
      } while ((hbj.d(paramContext)) || (hbj.a(paramContext)) || (System.currentTimeMillis() - f(paramContext) < TimeUnit.DAYS.toMillis(90L)));
      Account[] arrayOfAccount = AccountManager.get(paramContext).getAccountsByType("com.google");
      localArrayList = new ArrayList(arrayOfAccount.length);
      int i = arrayOfAccount.length;
      for (int j = 0; j < i; j++)
      {
        Account localAccount = arrayOfAccount[j];
        if (!localAccount.name.toLowerCase(Locale.getDefault()).endsWith("@youtube.com")) {
          localArrayList.add(localAccount);
        }
      }
    } while ((Collections.unmodifiableList(localArrayList).isEmpty()) || (hbj.b(paramContext)));
    mbb.a(paramContext, hcv.class);
  }

  public static void d(Context paramContext, int paramInt)
  {
    hcv localhcv = (hcv)mbb.b(paramContext, hcv.class);
    if (localhcv == null) {}
    while (hbj.a(paramContext)) {
      return;
    }
    Intent localIntent = localhcv.e(paramContext, paramInt);
    fe localfe = new fe(paramContext);
    localfe.a(localIntent);
    dk localdk = new dk(paramContext);
    PendingIntent localPendingIntent = localfe.a((int)System.currentTimeMillis(), 134217728, null);
    String str = paramContext.getString(efj.Ft);
    localdk.b = dk.a(paramContext.getString(efj.Fs));
    localdk.c = dk.a(str);
    int i = efj.Ff;
    localdk.x.icon = i;
    localdk.d = localPendingIntent;
    localdk.h = 0;
    ((NotificationManager)paramContext.getSystemService("notification")).notify(efj.Fl, localdk.b());
    ((hal)mbb.a(paramContext, hal.class)).d(paramContext, paramInt);
  }

  public static void e(Context paramContext)
  {
    if (!hbj.e(paramContext)) {
      b(paramContext);
    }
  }

  public static void e(Context paramContext, int paramInt)
  {
    b(paramContext);
    a(paramContext, paramInt);
  }

  private static long f(Context paramContext)
  {
    SharedPreferences localSharedPreferences = PreferenceManager.getDefaultSharedPreferences(paramContext);
    if (!localSharedPreferences.contains("iu.auto_backup_notification_timestamp"))
    {
      long l = paramContext.getSharedPreferences("accounts", 0).getLong("ab_notification_timestamp", 0L);
      if (l > 0L)
      {
        a(paramContext, l);
        return l;
      }
    }
    return localSharedPreferences.getLong("iu.auto_backup_notification_timestamp", 0L);
  }

  private static String f(Context paramContext, int paramInt)
  {
    String str1 = ((giz)mbb.a(paramContext, giz.class)).a(paramInt).b("gaia_id");
    if (paramInt == -1) {
      return null;
    }
    String str2 = String.valueOf(paramContext.getPackageName());
    return 22 + String.valueOf(str2).length() + String.valueOf(str1).length() + str2 + ":notifications:gaiaid:" + str1;
  }
}

/* Location:           F:\apktool\apktool\com.google.android.apps.plus\classes-dex2jar.jar

 * Qualified Name:     hcw

 * JD-Core Version:    0.7.0.1

 */


text:
namespace FakeItEasy.Specs
{
    using System.Collections.Generic;
    using System.Diagnostics.CodeAnalysis;
    using FluentAssertions;
    using Machine.Specifications;

    public interface IHaveInterestingProperties
    {
        IHaveInterestingProperties FakeableProperty { get; }

        UnfakeableClass UnfakeableProperty { get; }

        [SuppressMessage("Microsoft.Design",
            "CA1023:IndexersShouldNotBeMultidimensional", Justification = "Required for testing.")]
        [SuppressMessage("Microsoft.Design",
            "CA1002:DoNotExposeGenericLists", Justification = "Required for testing.")]
        List<string> this[int index1, bool index2] { get; set; }
    }

    public sealed class UnfakeableClass
    {
        private static int nextId;
        private readonly int id;

        public UnfakeableClass()
        {
            this.id = ++nextId;
        }

        public override string ToString()
        {
            return string.Concat("UnfakeableClass ", this.id);
        }
    }

    public class when_setting_the_value_of_an_indexed_property
    {
        private static IHaveInterestingProperties subject;

        Establish context = () =>
        {
            subject = A.Fake<IHaveInterestingProperties>();
        };

        Because of = () => subject[17, true] = new List<string> { "hippo", "lemur" };

        It should_return_the_value_to_the_getter_with_same_indexes =
            () => subject[17, true].Should().BeEquivalentTo("hippo", "lemur");

        It should_return_the_same_instance_each_time_the_getter_is_called_with_those_indexes =
            () =>
            {
                var firstResult = subject[17, true];
                var secondResult = subject[17, true];
                ReferenceEquals(firstResult, secondResult)
                    .Should().BeTrue("property getters should return the same object every time");
            };

        It should_return_the_default_value_to_getters_with_different_indexes =
            () =>
            {
                var result = subject[-183, true];
                result.Should().BeEmpty();
            };

        It should_return_the_same_instance_each_time_the_getter_is_called_with_other_indexes =
            () =>
            {
                var firstResult = subject[18, false];
                var secondResult = subject[18, false];
                ReferenceEquals(firstResult, secondResult)
                    .Should().BeTrue("property getters should return the same object every time");
            };
    }

    public class when_setting_the_value_of_an_indexed_property_for_different_indexes
    {
        private static IHaveInterestingProperties subject;

        Establish context = () =>
        {
            subject = A.Fake<IHaveInterestingProperties>();
        };

        Because of = () =>
        {
            subject[17, true] = new List<string> { "hippo", "lemur" };
            subject[17, false] = new List<string> { "corgi", "chicken" };
        };

        It should_return_the_correct_value_for_the_first_indexes =
            () => subject[17, true].Should().BeEquivalentTo("hippo", "lemur");

        It should_return_the_correct_value_for_the_second_indexes =
            () => subject[17, false].Should().BeEquivalentTo("corgi", "chicken");
    }

    public class when_getting_the_value_of_an_unconfigured_fakeable_property
    {
        private static IHaveInterestingProperties subject;
        private static IHaveInterestingProperties firstValue;
        private static IHaveInterestingProperties secondValue;

        Establish context = () =>
        {
            subject = A.Fake<IHaveInterestingProperties>();
        };

        Because of = () =>
        {
            firstValue = subject.FakeableProperty;
            secondValue = subject.FakeableProperty;
        };

        It should_not_return_null =
            () => firstValue.Should().NotBeNull();

        It should_return_the_same_instance_on_a_subsequent_get =
            () => secondValue.Should().BeSameAs(firstValue);
    }

    public class when_getting_the_value_of_an_unconfigured_unfakeable_property
    {
        private static IHaveInterestingProperties subject;
        private static UnfakeableClass firstValue;
        private static UnfakeableClass secondValue;

        Establish context = () =>
        {
            subject = A.Fake<IHaveInterestingProperties>();
        };

        Because of = () =>
        {
            firstValue = subject.UnfakeableProperty;
            secondValue = subject.UnfakeableProperty;
        };

        It should_not_return_null_if_dummy_can_be_made =
            () => firstValue.Should().NotBeNull();

        It should_return_the_same_instance_on_a_subsequent_get =
            () => secondValue.Should().BeSameAs(firstValue);
    }
}


text:
package api

import (
	"encoding/json"
	log "github.com/Sirupsen/logrus"
	"net/http"
	"strconv"

	"github.com/backerman/evego"
	"github.com/backerman/eveindy/pkg/db"
	"github.com/backerman/eveindy/pkg/server"
	"github.com/zenazn/goji/web"
)

// UnusedSalvage returns a web handler function that identifies a user's salvage
// drops that are unused by any blueprint they own.
func UnusedSalvage(localdb db.LocalDB, sde evego.Database, sess server.Sessionizer) web.HandlerFunc {
	return func(c web.C, w http.ResponseWriter, r *http.Request) {
		s := sess.GetSession(&c, w, r)
		myUserID := s.User
		charID, err := strconv.Atoi(c.URLParams["charID"])
		if err != nil {
			http.Error(w, `{"status": "Error", "error": "Invalid character ID supplied."}`,
				http.StatusBadRequest)
			return
		}
		salvage, err := localdb.UnusedSalvage(myUserID, charID)
		if err != nil {
			http.Error(w, `{"status": "Error", "error": "Unable to access database."}`,
				http.StatusInternalServerError)
			log.Printf("Error accessing database with user %v, character %v: %v", myUserID, charID, err)
			return
		}
		stations := make(map[string]*evego.Station)
		itemInfo := make(map[string]*evego.Item)
		for i := range salvage {
			item := &salvage[i]
			if _, found := stations[strconv.Itoa(item.StationID)]; !found {
				stn, err := localdb.StationForID(item.StationID)
				if err == nil {
					stations[strconv.Itoa(item.StationID)] = stn
				} else {
					// This should really not friggin' happen.
					http.Error(w, `{"status": "Error", "error": "Unable to look up station/outpost."}`,
						http.StatusInternalServerError)
					log.Printf("Unable to look up station/outpost ID %v: %v", item.StationID, err)
					return
				}
			}
			typeIDStr := strconv.Itoa(item.TypeID)
			if _, found := itemInfo[typeIDStr]; !found {
				thisItem, err := sde.ItemForID(item.TypeID)
				if err == nil {
					itemInfo[typeIDStr] = thisItem
				}
			}
		}
		response := struct {
			Items    []evego.InventoryItem     `json:"items"`
			Stations map[string]*evego.Station `json:"stations"`
			ItemInfo map[string]*evego.Item    `json:"itemInfo"`
		}{salvage, stations, itemInfo}
		salvageJSON, err := json.Marshal(&response)
		if err != nil {
			http.Error(w, `{"status": "Error", "error": "Unable to marshal JSON."}`,
				http.StatusInternalServerError)
			log.Printf("Error marshalling JSON unused salvage with user %v, character %v: %v", myUserID, charID, err)
			return
		}
		w.Write(salvageJSON)
		return

	}
}


text:
import { describe, it } from '@ephox/bedrock-client';
import { TinyAssertions, TinyHooks, TinySelections, TinyUiActions } from '@ephox/wrap-mcagar';

import Editor from 'tinymce/core/api/Editor';
import Plugin from 'tinymce/plugins/lists/Plugin';

describe('browser.tinymce.plugins.lists.ToggleListWithEmptyLiTest', () => {
  const hook = TinyHooks.bddSetupLight<Editor>({
    indent: false,
    plugins: 'lists',
    toolbar: 'bullist',
    base_url: '/project/tinymce/js/tinymce'
  }, [ Plugin ], true);

  it('TBA: toggle bullet list on list with two empty LIs', async () => {
    const editor = hook.editor();
    editor.setContent('

a

b

');
    TinySelections.setSelection(editor, [ 0, 0, 0 ], 0, [ 0, 3, 0 ], 1);
    // Wait for toolbar button to be active
    await TinyUiActions.pWaitForUi(editor, 'button[aria-label="Bullet list"].tox-tbtn--enabled');
    TinyUiActions.clickOnToolbar(editor, 'button[aria-label="Bullet list"]');
    TinyAssertions.assertContent(editor, '
a

b
');
  });
});


text:
package org.apache.drill.exec.store.hive;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.hadoop.hive.metastore.api.FieldSchema;
import org.apache.hadoop.hive.metastore.api.Order;
import org.apache.hadoop.hive.metastore.api.Partition;
import org.apache.hadoop.hive.metastore.api.SerDeInfo;
import org.apache.hadoop.hive.metastore.api.StorageDescriptor;
import org.apache.hadoop.hive.metastore.api.Table;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.google.common.collect.Lists;

@JsonTypeName("table")
public class HiveTable {

  @JsonIgnore
  private Table table;

  @JsonProperty
  public String tableName;
  @JsonProperty
  public String dbName;
  @JsonProperty
  public String owner;
  @JsonProperty
  public int createTime;
  @JsonProperty
  public int lastAccessTime;
  @JsonProperty
  public int retention;
  @JsonProperty
  public StorageDescriptorWrapper sd;
  @JsonProperty
  public List<FieldSchemaWrapper> partitionKeys;
  @JsonProperty
  public Map<String,String> parameters;
  @JsonProperty
  public String viewOriginalText;
  @JsonProperty
  public String viewExpandedText;
  @JsonProperty
  public String tableType;

  @JsonIgnore
  public final Map<String, String> partitionNameTypeMap = new HashMap<>();

  @JsonCreator
  public HiveTable(@JsonProperty("tableName") String tableName, @JsonProperty("dbName") String dbName, @JsonProperty("owner") String owner, @JsonProperty("createTime") int createTime,
                   @JsonProperty("lastAccessTime") int lastAccessTime, @JsonProperty("retention") int retention, @JsonProperty("sd") StorageDescriptorWrapper sd,
                   @JsonProperty("partitionKeys") List<FieldSchemaWrapper> partitionKeys, @JsonProperty("parameters") Map<String, String> parameters,
                   @JsonProperty("viewOriginalText") String viewOriginalText, @JsonProperty("viewExpandedText") String viewExpandedText, @JsonProperty("tableType") String tableType
  ) {
    this.tableName = tableName;
    this.dbName = dbName;
    this.owner = owner;
    this.createTime = createTime;
    this.lastAccessTime = lastAccessTime;
    this.retention = retention;
    this.sd = sd;
    this.partitionKeys = partitionKeys;
    this.parameters = parameters;
    this.viewOriginalText = viewOriginalText;
    this.viewExpandedText = viewExpandedText;
    this.tableType = tableType;

    List<FieldSchema> partitionKeysUnwrapped = Lists.newArrayList();
    for (FieldSchemaWrapper w : partitionKeys) {
      partitionKeysUnwrapped.add(w.getFieldSchema());
      partitionNameTypeMap.put(w.name, w.type);
    }
    StorageDescriptor sdUnwrapped = sd.getSd();
    this.table = new Table(tableName, dbName, owner, createTime, lastAccessTime, retention, sdUnwrapped, partitionKeysUnwrapped,
        parameters, viewOriginalText, viewExpandedText, tableType);
  }

  public HiveTable(Table table) {
    if (table == null) {
      return;
    }
    this.table = table;
    this.tableName = table.getTableName();
    this.dbName = table.getDbName();
    this.owner = table.getOwner();
    this.createTime = table.getCreateTime();
    this.lastAccessTime = table.getLastAccessTime();
    this.retention = table.getRetention();
    this.sd = new StorageDescriptorWrapper(table.getSd());
    this.partitionKeys = Lists.newArrayList();
    for (FieldSchema f : table.getPartitionKeys()) {
      this.partitionKeys.add(new FieldSchemaWrapper(f));
      partitionNameTypeMap.put(f.getName(), f.getType());
    }
    this.parameters = table.getParameters();
    this.viewOriginalText = table.getViewOriginalText();
    this.viewExpandedText = table.getViewExpandedText();
    this.tableType = table.getTableType();
  }

  @JsonIgnore
  public Table getTable() {
    return table;
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder("Table(");

    sb.append("dbName:");
    sb.append(this.dbName);
    sb.append(", ");

    sb.append("tableName:");
    sb.append(this.tableName);
    sb.append(")");

    return sb.toString();
  }

  public static class HivePartition {

    @JsonIgnore
    private Partition partition;

    @JsonProperty
    public List<String> values;
    @JsonProperty
    public String tableName;
    @JsonProperty
    public String dbName;
    @JsonProperty
    public int createTime;
    @JsonProperty
    public int lastAccessTime;
    @JsonProperty
    public StorageDescriptorWrapper sd;
    @JsonProperty
    public Map<String,String> parameters;

    @JsonCreator
    public HivePartition(@JsonProperty("values") List<String> values, @JsonProperty("tableName") String tableName, @JsonProperty("dbName") String dbName, @JsonProperty("createTime") int createTime,
                         @JsonProperty("lastAccessTime") int lastAccessTime,  @JsonProperty("sd") StorageDescriptorWrapper sd,
                         @JsonProperty("parameters") Map<String, String> parameters
    ) {
      this.values = values;
      this.tableName = tableName;
      this.dbName = dbName;
      this.createTime = createTime;
      this.lastAccessTime = lastAccessTime;
      this.sd = sd;
      this.parameters = parameters;

      StorageDescriptor sdUnwrapped = sd.getSd();
      this.partition = new org.apache.hadoop.hive.metastore.api.Partition(values, tableName, dbName, createTime, lastAccessTime, sdUnwrapped, parameters);
    }

    public HivePartition(Partition partition) {
      if (partition == null) {
        return;
      }
      this.partition = partition;
      this.values = partition.getValues();
      this.tableName = partition.getTableName();
      this.dbName = partition.getDbName();
      this.createTime = partition.getCreateTime();
      this.lastAccessTime = partition.getLastAccessTime();
      this.sd = new StorageDescriptorWrapper(partition.getSd());
      this.parameters = partition.getParameters();
    }

    @JsonIgnore
    public Partition getPartition() {
      return partition;
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("Partition(");
      sb.append("values:");
      sb.append(this.values);
      sb.append(")");
      return sb.toString();
    }
  }

  public static class StorageDescriptorWrapper {
    @JsonIgnore
    private StorageDescriptor sd;
    @JsonProperty
    public List<FieldSchemaWrapper> cols;
    @JsonProperty
    public String location;
    @JsonProperty
    public String inputFormat;
    @JsonProperty
    public String outputFormat;
    @JsonProperty
    public boolean compressed;
    @JsonProperty
    public int numBuckets;
    @JsonProperty
    public SerDeInfoWrapper serDeInfo;
    //    @JsonProperty
//    public List<String> bucketCols;
    @JsonProperty
    public List<OrderWrapper> sortCols;
    @JsonProperty
    public Map<String,String> parameters;

    @JsonCreator
    public StorageDescriptorWrapper(@JsonProperty("cols") List<FieldSchemaWrapper> cols, @JsonProperty("location") String location, @JsonProperty("inputFormat") String inputFormat,
                                    @JsonProperty("outputFormat") String outputFormat, @JsonProperty("compressed") boolean compressed, @JsonProperty("numBuckets") int numBuckets,
                                    @JsonProperty("serDeInfo") SerDeInfoWrapper serDeInfo,  @JsonProperty("sortCols") List<OrderWrapper> sortCols,
                                    @JsonProperty("parameters") Map<String,String> parameters) {
      this.cols = cols;
      this.location = location;
      this.inputFormat = inputFormat;
      this.outputFormat = outputFormat;
      this.compressed = compressed;
      this.numBuckets = numBuckets;
      this.serDeInfo = serDeInfo;
//      this.bucketCols = bucketCols;
      this.sortCols = sortCols;
      this.parameters = parameters;
      List<FieldSchema> colsUnwrapped = Lists.newArrayList();
      for (FieldSchemaWrapper w: cols) {
        colsUnwrapped.add(w.getFieldSchema());
      }
      SerDeInfo serDeInfoUnwrapped = serDeInfo.getSerDeInfo();
      List<Order> sortColsUnwrapped = Lists.newArrayList();
      for (OrderWrapper w : sortCols) {
        sortColsUnwrapped.add(w.getOrder());
      }
//      this.sd = new StorageDescriptor(colsUnwrapped, location, inputFormat, outputFormat, compressed, numBuckets, serDeInfoUnwrapped,
//              bucketCols, sortColsUnwrapped, parameters);
      this.sd = new StorageDescriptor(colsUnwrapped, location, inputFormat, outputFormat, compressed, numBuckets, serDeInfoUnwrapped,
          null, sortColsUnwrapped, parameters);
    }

    public StorageDescriptorWrapper(StorageDescriptor sd) {
      this.sd = sd;
      this.cols = Lists.newArrayList();
      for (FieldSchema f : sd.getCols()) {
        this.cols.add(new FieldSchemaWrapper(f));
      }
      this.location = sd.getLocation();
      this.inputFormat = sd.getInputFormat();
      this.outputFormat = sd.getOutputFormat();
      this.compressed = sd.isCompressed();
      this.numBuckets = sd.getNumBuckets();
      this.serDeInfo = new SerDeInfoWrapper(sd.getSerdeInfo());
//      this.bucketCols = sd.getBucketCols();
      this.sortCols = Lists.newArrayList();
      for (Order o : sd.getSortCols()) {
        this.sortCols.add(new OrderWrapper(o));
      }
      this.parameters = sd.getParameters();
    }

    @JsonIgnore
    public StorageDescriptor getSd() {
      return sd;
    }

  }

  public static class SerDeInfoWrapper {
    @JsonIgnore
    private SerDeInfo serDeInfo;
    @JsonProperty
    public String name;
    @JsonProperty
    public String serializationLib;
    @JsonProperty
    public Map<String,String> parameters;

    @JsonCreator
    public SerDeInfoWrapper(@JsonProperty("name") String name, @JsonProperty("serializationLib") String serializationLib, @JsonProperty("parameters") Map<String, String> parameters) {
      this.name = name;
      this.serializationLib = serializationLib;
      this.parameters = parameters;
      this.serDeInfo = new SerDeInfo(name, serializationLib, parameters);
    }

    public SerDeInfoWrapper(SerDeInfo serDeInfo) {
      this.serDeInfo = serDeInfo;
      this.name = serDeInfo.getName();
      this.serializationLib = serDeInfo.getSerializationLib();
      this.parameters = serDeInfo.getParameters();
    }

    @JsonIgnore
    public SerDeInfo getSerDeInfo() {
      return serDeInfo;
    }
  }

  public static class FieldSchemaWrapper {
    @JsonIgnore
    private FieldSchema fieldSchema;
    @JsonProperty
    public String name;
    @JsonProperty
    public String type;
    @JsonProperty
    public String comment;

    @JsonCreator
    public FieldSchemaWrapper(@JsonProperty("name") String name, @JsonProperty("type") String type, @JsonProperty("comment") String comment) {
      this.name = name;
      this.type = type;
      this.comment = comment;
      this.fieldSchema = new FieldSchema(name, type, comment);
    }

    public FieldSchemaWrapper(FieldSchema fieldSchema) {
      this.fieldSchema = fieldSchema;
      this.name = fieldSchema.getName();
      this.type = fieldSchema.getType();
      this.comment = fieldSchema.getComment();
    }

    @JsonIgnore
    public FieldSchema getFieldSchema() {
      return fieldSchema;
    }
  }

  public static class OrderWrapper {
    @JsonIgnore
    private Order ord;
    @JsonProperty
    public String col;
    @JsonProperty
    public int order;

    @JsonCreator
    public OrderWrapper(@JsonProperty("col") String col, @JsonProperty("order") int order) {
      this.col = col;
      this.order = order;
    }

    public OrderWrapper(Order ord) {
      this.ord = ord;
      this.col = ord.getCol();
      this.order = ord.getOrder();
    }

    @JsonIgnore
    public Order getOrder() {
      return ord;
    }
  }

  public Map<String, String> getPartitionNameTypeMap() {
    return partitionNameTypeMap;
  }

}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TSQL.Clauses
{
	public class TSQLWithClause : TSQLClause
	{
		internal TSQLWithClause()
		{

		}
	}
}