text:
package com.g10.ssm.po.testdatabase;

import java.util.ArrayList;
import java.util.List;

public class SubjectExample {
    protected String orderByClause;

    protected boolean distinct;

    protected List<Criteria> oredCriteria;

    public SubjectExample() {
        oredCriteria = new ArrayList<Criteria>();
    }

    public void setOrderByClause(String orderByClause) {
        this.orderByClause = orderByClause;
    }

    public String getOrderByClause() {
        return orderByClause;
    }

    public void setDistinct(boolean distinct) {
        this.distinct = distinct;
    }

    public boolean isDistinct() {
        return distinct;
    }

    public List<Criteria> getOredCriteria() {
        return oredCriteria;
    }

    public void or(Criteria criteria) {
        oredCriteria.add(criteria);
    }

    public Criteria or() {
        Criteria criteria = createCriteriaInternal();
        oredCriteria.add(criteria);
        return criteria;
    }

    public Criteria createCriteria() {
        Criteria criteria = createCriteriaInternal();
        if (oredCriteria.size() == 0) {
            oredCriteria.add(criteria);
        }
        return criteria;
    }

    protected Criteria createCriteriaInternal() {
        Criteria criteria = new Criteria();
        return criteria;
    }

    public void clear() {
        oredCriteria.clear();
        orderByClause = null;
        distinct = false;
    }

    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<Criterion>();
        }

        public boolean isValid() {
            return criteria.size() > 0;
        }

        public List<Criterion> getAllCriteria() {
            return criteria;
        }

        public List<Criterion> getCriteria() {
            return criteria;
        }

        protected void addCriterion(String condition) {
            if (condition == null) {
                throw new RuntimeException("Value for condition cannot be null");
            }
            criteria.add(new Criterion(condition));
        }

        protected void addCriterion(String condition, Object value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value));
        }

        protected void addCriterion(String condition, Object value1, Object value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value1, value2));
        }

        public Criteria andSubjectIdIsNull() {
            addCriterion("subject_id is null");
            return (Criteria) this;
        }

        public Criteria andSubjectIdIsNotNull() {
            addCriterion("subject_id is not null");
            return (Criteria) this;
        }

        public Criteria andSubjectIdEqualTo(Integer value) {
            addCriterion("subject_id =", value, "subjectId");
            return (Criteria) this;
        }

        public Criteria andSubjectIdNotEqualTo(Integer value) {
            addCriterion("subject_id <>", value, "subjectId");
            return (Criteria) this;
        }

        public Criteria andSubjectIdGreaterThan(Integer value) {
            addCriterion("subject_id >", value, "subjectId");
            return (Criteria) this;
        }

        public Criteria andSubjectIdGreaterThanOrEqualTo(Integer value) {
            addCriterion("subject_id >=", value, "subjectId");
            return (Criteria) this;
        }

        public Criteria andSubjectIdLessThan(Integer value) {
            addCriterion("subject_id <", value, "subjectId");
            return (Criteria) this;
        }

        public Criteria andSubjectIdLessThanOrEqualTo(Integer value) {
            addCriterion("subject_id <=", value, "subjectId");
            return (Criteria) this;
        }

        public Criteria andSubjectIdIn(List<Integer> values) {
            addCriterion("subject_id in", values, "subjectId");
            return (Criteria) this;
        }

        public Criteria andSubjectIdNotIn(List<Integer> values) {
            addCriterion("subject_id not in", values, "subjectId");
            return (Criteria) this;
        }

        public Criteria andSubjectIdBetween(Integer value1, Integer value2) {
            addCriterion("subject_id between", value1, value2, "subjectId");
            return (Criteria) this;
        }

        public Criteria andSubjectIdNotBetween(Integer value1, Integer value2) {
            addCriterion("subject_id not between", value1, value2, "subjectId");
            return (Criteria) this;
        }

        public Criteria andSubjectTypeIsNull() {
            addCriterion("subject_type is null");
            return (Criteria) this;
        }

        public Criteria andSubjectTypeIsNotNull() {
            addCriterion("subject_type is not null");
            return (Criteria) this;
        }

        public Criteria andSubjectTypeEqualTo(String value) {
            addCriterion("subject_type =", value, "subjectType");
            return (Criteria) this;
        }

        public Criteria andSubjectTypeNotEqualTo(String value) {
            addCriterion("subject_type <>", value, "subjectType");
            return (Criteria) this;
        }

        public Criteria andSubjectTypeGreaterThan(String value) {
            addCriterion("subject_type >", value, "subjectType");
            return (Criteria) this;
        }

        public Criteria andSubjectTypeGreaterThanOrEqualTo(String value) {
            addCriterion("subject_type >=", value, "subjectType");
            return (Criteria) this;
        }

        public Criteria andSubjectTypeLessThan(String value) {
            addCriterion("subject_type <", value, "subjectType");
            return (Criteria) this;
        }

        public Criteria andSubjectTypeLessThanOrEqualTo(String value) {
            addCriterion("subject_type <=", value, "subjectType");
            return (Criteria) this;
        }

        public Criteria andSubjectTypeLike(String value) {
            addCriterion("subject_type like", value, "subjectType");
            return (Criteria) this;
        }

        public Criteria andSubjectTypeNotLike(String value) {
            addCriterion("subject_type not like", value, "subjectType");
            return (Criteria) this;
        }

        public Criteria andSubjectTypeIn(List<String> values) {
            addCriterion("subject_type in", values, "subjectType");
            return (Criteria) this;
        }

        public Criteria andSubjectTypeNotIn(List<String> values) {
            addCriterion("subject_type not in", values, "subjectType");
            return (Criteria) this;
        }

        public Criteria andSubjectTypeBetween(String value1, String value2) {
            addCriterion("subject_type between", value1, value2, "subjectType");
            return (Criteria) this;
        }

        public Criteria andSubjectTypeNotBetween(String value1, String value2) {
            addCriterion("subject_type not between", value1, value2, "subjectType");
            return (Criteria) this;
        }

        public Criteria andSubjectPatternIsNull() {
            addCriterion("subject_pattern is null");
            return (Criteria) this;
        }

        public Criteria andSubjectPatternIsNotNull() {
            addCriterion("subject_pattern is not null");
            return (Criteria) this;
        }

        public Criteria andSubjectPatternEqualTo(String value) {
            addCriterion("subject_pattern =", value, "subjectPattern");
            return (Criteria) this;
        }

        public Criteria andSubjectPatternNotEqualTo(String value) {
            addCriterion("subject_pattern <>", value, "subjectPattern");
            return (Criteria) this;
        }

        public Criteria andSubjectPatternGreaterThan(String value) {
            addCriterion("subject_pattern >", value, "subjectPattern");
            return (Criteria) this;
        }

        public Criteria andSubjectPatternGreaterThanOrEqualTo(String value) {
            addCriterion("subject_pattern >=", value, "subjectPattern");
            return (Criteria) this;
        }

        public Criteria andSubjectPatternLessThan(String value) {
            addCriterion("subject_pattern <", value, "subjectPattern");
            return (Criteria) this;
        }

        public Criteria andSubjectPatternLessThanOrEqualTo(String value) {
            addCriterion("subject_pattern <=", value, "subjectPattern");
            return (Criteria) this;
        }

        public Criteria andSubjectPatternLike(String value) {
            addCriterion("subject_pattern like", value, "subjectPattern");
            return (Criteria) this;
        }

        public Criteria andSubjectPatternNotLike(String value) {
            addCriterion("subject_pattern not like", value, "subjectPattern");
            return (Criteria) this;
        }

        public Criteria andSubjectPatternIn(List<String> values) {
            addCriterion("subject_pattern in", values, "subjectPattern");
            return (Criteria) this;
        }

        public Criteria andSubjectPatternNotIn(List<String> values) {
            addCriterion("subject_pattern not in", values, "subjectPattern");
            return (Criteria) this;
        }

        public Criteria andSubjectPatternBetween(String value1, String value2) {
            addCriterion("subject_pattern between", value1, value2, "subjectPattern");
            return (Criteria) this;
        }

        public Criteria andSubjectPatternNotBetween(String value1, String value2) {
            addCriterion("subject_pattern not between", value1, value2, "subjectPattern");
            return (Criteria) this;
        }

        public Criteria andContentIsNull() {
            addCriterion("content is null");
            return (Criteria) this;
        }

        public Criteria andContentIsNotNull() {
            addCriterion("content is not null");
            return (Criteria) this;
        }

        public Criteria andContentEqualTo(String value) {
            addCriterion("content =", value, "content");
            return (Criteria) this;
        }

        public Criteria andContentNotEqualTo(String value) {
            addCriterion("content <>", value, "content");
            return (Criteria) this;
        }

        public Criteria andContentGreaterThan(String value) {
            addCriterion("content >", value, "content");
            return (Criteria) this;
        }

        public Criteria andContentGreaterThanOrEqualTo(String value) {
            addCriterion("content >=", value, "content");
            return (Criteria) this;
        }

        public Criteria andContentLessThan(String value) {
            addCriterion("content <", value, "content");
            return (Criteria) this;
        }

        public Criteria andContentLessThanOrEqualTo(String value) {
            addCriterion("content <=", value, "content");
            return (Criteria) this;
        }

        public Criteria andContentLike(String value) {
            addCriterion("content like", value, "content");
            return (Criteria) this;
        }

        public Criteria andContentNotLike(String value) {
            addCriterion("content not like", value, "content");
            return (Criteria) this;
        }

        public Criteria andContentIn(List<String> values) {
            addCriterion("content in", values, "content");
            return (Criteria) this;
        }

        public Criteria andContentNotIn(List<String> values) {
            addCriterion("content not in", values, "content");
            return (Criteria) this;
        }

        public Criteria andContentBetween(String value1, String value2) {
            addCriterion("content between", value1, value2, "content");
            return (Criteria) this;
        }

        public Criteria andContentNotBetween(String value1, String value2) {
            addCriterion("content not between", value1, value2, "content");
            return (Criteria) this;
        }

        public Criteria andAnswerIsNull() {
            addCriterion("answer is null");
            return (Criteria) this;
        }

        public Criteria andAnswerIsNotNull() {
            addCriterion("answer is not null");
            return (Criteria) this;
        }

        public Criteria andAnswerEqualTo(String value) {
            addCriterion("answer =", value, "answer");
            return (Criteria) this;
        }

        public Criteria andAnswerNotEqualTo(String value) {
            addCriterion("answer <>", value, "answer");
            return (Criteria) this;
        }

        public Criteria andAnswerGreaterThan(String value) {
            addCriterion("answer >", value, "answer");
            return (Criteria) this;
        }

        public Criteria andAnswerGreaterThanOrEqualTo(String value) {
            addCriterion("answer >=", value, "answer");
            return (Criteria) this;
        }

        public Criteria andAnswerLessThan(String value) {
            addCriterion("answer <", value, "answer");
            return (Criteria) this;
        }

        public Criteria andAnswerLessThanOrEqualTo(String value) {
            addCriterion("answer <=", value, "answer");
            return (Criteria) this;
        }

        public Criteria andAnswerLike(String value) {
            addCriterion("answer like", value, "answer");
            return (Criteria) this;
        }

        public Criteria andAnswerNotLike(String value) {
            addCriterion("answer not like", value, "answer");
            return (Criteria) this;
        }

        public Criteria andAnswerIn(List<String> values) {
            addCriterion("answer in", values, "answer");
            return (Criteria) this;
        }

        public Criteria andAnswerNotIn(List<String> values) {
            addCriterion("answer not in", values, "answer");
            return (Criteria) this;
        }

        public Criteria andAnswerBetween(String value1, String value2) {
            addCriterion("answer between", value1, value2, "answer");
            return (Criteria) this;
        }

        public Criteria andAnswerNotBetween(String value1, String value2) {
            addCriterion("answer not between", value1, value2, "answer");
            return (Criteria) this;
        }

        public Criteria andKnowlegePointIsNull() {
            addCriterion("knowlege_point is null");
            return (Criteria) this;
        }

        public Criteria andKnowlegePointIsNotNull() {
            addCriterion("knowlege_point is not null");
            return (Criteria) this;
        }

        public Criteria andKnowlegePointEqualTo(String value) {
            addCriterion("knowlege_point =", value, "knowlegePoint");
            return (Criteria) this;
        }

        public Criteria andKnowlegePointNotEqualTo(String value) {
            addCriterion("knowlege_point <>", value, "knowlegePoint");
            return (Criteria) this;
        }

        public Criteria andKnowlegePointGreaterThan(String value) {
            addCriterion("knowlege_point >", value, "knowlegePoint");
            return (Criteria) this;
        }

        public Criteria andKnowlegePointGreaterThanOrEqualTo(String value) {
            addCriterion("knowlege_point >=", value, "knowlegePoint");
            return (Criteria) this;
        }

        public Criteria andKnowlegePointLessThan(String value) {
            addCriterion("knowlege_point <", value, "knowlegePoint");
            return (Criteria) this;
        }

        public Criteria andKnowlegePointLessThanOrEqualTo(String value) {
            addCriterion("knowlege_point <=", value, "knowlegePoint");
            return (Criteria) this;
        }

        public Criteria andKnowlegePointLike(String value) {
            addCriterion("knowlege_point like", value, "knowlegePoint");
            return (Criteria) this;
        }

        public Criteria andKnowlegePointNotLike(String value) {
            addCriterion("knowlege_point not like", value, "knowlegePoint");
            return (Criteria) this;
        }

        public Criteria andKnowlegePointIn(List<String> values) {
            addCriterion("knowlege_point in", values, "knowlegePoint");
            return (Criteria) this;
        }

        public Criteria andKnowlegePointNotIn(List<String> values) {
            addCriterion("knowlege_point not in", values, "knowlegePoint");
            return (Criteria) this;
        }

        public Criteria andKnowlegePointBetween(String value1, String value2) {
            addCriterion("knowlege_point between", value1, value2, "knowlegePoint");
            return (Criteria) this;
        }

        public Criteria andKnowlegePointNotBetween(String value1, String value2) {
            addCriterion("knowlege_point not between", value1, value2, "knowlegePoint");
            return (Criteria) this;
        }

        public Criteria andSubjectMatterIsNull() {
            addCriterion("subject_matter is null");
            return (Criteria) this;
        }

        public Criteria andSubjectMatterIsNotNull() {
            addCriterion("subject_matter is not null");
            return (Criteria) this;
        }

        public Criteria andSubjectMatterEqualTo(String value) {
            addCriterion("subject_matter =", value, "subjectMatter");
            return (Criteria) this;
        }

        public Criteria andSubjectMatterNotEqualTo(String value) {
            addCriterion("subject_matter <>", value, "subjectMatter");
            return (Criteria) this;
        }

        public Criteria andSubjectMatterGreaterThan(String value) {
            addCriterion("subject_matter >", value, "subjectMatter");
            return (Criteria) this;
        }

        public Criteria andSubjectMatterGreaterThanOrEqualTo(String value) {
            addCriterion("subject_matter >=", value, "subjectMatter");
            return (Criteria) this;
        }

        public Criteria andSubjectMatterLessThan(String value) {
            addCriterion("subject_matter <", value, "subjectMatter");
            return (Criteria) this;
        }

        public Criteria andSubjectMatterLessThanOrEqualTo(String value) {
            addCriterion("subject_matter <=", value, "subjectMatter");
            return (Criteria) this;
        }

        public Criteria andSubjectMatterLike(String value) {
            addCriterion("subject_matter like", value, "subjectMatter");
            return (Criteria) this;
        }

        public Criteria andSubjectMatterNotLike(String value) {
            addCriterion("subject_matter not like", value, "subjectMatter");
            return (Criteria) this;
        }

        public Criteria andSubjectMatterIn(List<String> values) {
            addCriterion("subject_matter in", values, "subjectMatter");
            return (Criteria) this;
        }

        public Criteria andSubjectMatterNotIn(List<String> values) {
            addCriterion("subject_matter not in", values, "subjectMatter");
            return (Criteria) this;
        }

        public Criteria andSubjectMatterBetween(String value1, String value2) {
            addCriterion("subject_matter between", value1, value2, "subjectMatter");
            return (Criteria) this;
        }

        public Criteria andSubjectMatterNotBetween(String value1, String value2) {
            addCriterion("subject_matter not between", value1, value2, "subjectMatter");
            return (Criteria) this;
        }

        public Criteria andTestDatabaseMatterIsNull() {
            addCriterion("test_database_matter is null");
            return (Criteria) this;
        }

        public Criteria andTestDatabaseMatterIsNotNull() {
            addCriterion("test_database_matter is not null");
            return (Criteria) this;
        }

        public Criteria andTestDatabaseMatterEqualTo(String value) {
            addCriterion("test_database_matter =", value, "testDatabaseMatter");
            return (Criteria) this;
        }

        public Criteria andTestDatabaseMatterNotEqualTo(String value) {
            addCriterion("test_database_matter <>", value, "testDatabaseMatter");
            return (Criteria) this;
        }

        public Criteria andTestDatabaseMatterGreaterThan(String value) {
            addCriterion("test_database_matter >", value, "testDatabaseMatter");
            return (Criteria) this;
        }

        public Criteria andTestDatabaseMatterGreaterThanOrEqualTo(String value) {
            addCriterion("test_database_matter >=", value, "testDatabaseMatter");
            return (Criteria) this;
        }

        public Criteria andTestDatabaseMatterLessThan(String value) {
            addCriterion("test_database_matter <", value, "testDatabaseMatter");
            return (Criteria) this;
        }

        public Criteria andTestDatabaseMatterLessThanOrEqualTo(String value) {
            addCriterion("test_database_matter <=", value, "testDatabaseMatter");
            return (Criteria) this;
        }

        public Criteria andTestDatabaseMatterLike(String value) {
            addCriterion("test_database_matter like", value, "testDatabaseMatter");
            return (Criteria) this;
        }

        public Criteria andTestDatabaseMatterNotLike(String value) {
            addCriterion("test_database_matter not like", value, "testDatabaseMatter");
            return (Criteria) this;
        }

        public Criteria andTestDatabaseMatterIn(List<String> values) {
            addCriterion("test_database_matter in", values, "testDatabaseMatter");
            return (Criteria) this;
        }

        public Criteria andTestDatabaseMatterNotIn(List<String> values) {
            addCriterion("test_database_matter not in", values, "testDatabaseMatter");
            return (Criteria) this;
        }

        public Criteria andTestDatabaseMatterBetween(String value1, String value2) {
            addCriterion("test_database_matter between", value1, value2, "testDatabaseMatter");
            return (Criteria) this;
        }

        public Criteria andTestDatabaseMatterNotBetween(String value1, String value2) {
            addCriterion("test_database_matter not between", value1, value2, "testDatabaseMatter");
            return (Criteria) this;
        }

        public Criteria andTestDatabaseIdIsNull() {
            addCriterion("test_database_id is null");
            return (Criteria) this;
        }

        public Criteria andTestDatabaseIdIsNotNull() {
            addCriterion("test_database_id is not null");
            return (Criteria) this;
        }

        public Criteria andTestDatabaseIdEqualTo(Long value) {
            addCriterion("test_database_id =", value, "testDatabaseId");
            return (Criteria) this;
        }

        public Criteria andTestDatabaseIdNotEqualTo(Long value) {
            addCriterion("test_database_id <>", value, "testDatabaseId");
            return (Criteria) this;
        }

        public Criteria andTestDatabaseIdGreaterThan(Long value) {
            addCriterion("test_database_id >", value, "testDatabaseId");
            return (Criteria) this;
        }

        public Criteria andTestDatabaseIdGreaterThanOrEqualTo(Long value) {
            addCriterion("test_database_id >=", value, "testDatabaseId");
            return (Criteria) this;
        }

        public Criteria andTestDatabaseIdLessThan(Long value) {
            addCriterion("test_database_id <", value, "testDatabaseId");
            return (Criteria) this;
        }

        public Criteria andTestDatabaseIdLessThanOrEqualTo(Long value) {
            addCriterion("test_database_id <=", value, "testDatabaseId");
            return (Criteria) this;
        }

        public Criteria andTestDatabaseIdIn(List<Long> values) {
            addCriterion("test_database_id in", values, "testDatabaseId");
            return (Criteria) this;
        }

        public Criteria andTestDatabaseIdNotIn(List<Long> values) {
            addCriterion("test_database_id not in", values, "testDatabaseId");
            return (Criteria) this;
        }

        public Criteria andTestDatabaseIdBetween(Long value1, Long value2) {
            addCriterion("test_database_id between", value1, value2, "testDatabaseId");
            return (Criteria) this;
        }

        public Criteria andTestDatabaseIdNotBetween(Long value1, Long value2) {
            addCriterion("test_database_id not between", value1, value2, "testDatabaseId");
            return (Criteria) this;
        }

        public Criteria andNameIsNull() {
            addCriterion("name is null");
            return (Criteria) this;
        }

        public Criteria andNameIsNotNull() {
            addCriterion("name is not null");
            return (Criteria) this;
        }

        public Criteria andNameEqualTo(Integer value) {
            addCriterion("name =", value, "name");
            return (Criteria) this;
        }

        public Criteria andNameNotEqualTo(Integer value) {
            addCriterion("name <>", value, "name");
            return (Criteria) this;
        }

        public Criteria andNameGreaterThan(Integer value) {
            addCriterion("name >", value, "name");
            return (Criteria) this;
        }

        public Criteria andNameGreaterThanOrEqualTo(Integer value) {
            addCriterion("name >=", value, "name");
            return (Criteria) this;
        }

        public Criteria andNameLessThan(Integer value) {
            addCriterion("name <", value, "name");
            return (Criteria) this;
        }

        public Criteria andNameLessThanOrEqualTo(Integer value) {
            addCriterion("name <=", value, "name");
            return (Criteria) this;
        }

        public Criteria andNameIn(List<Integer> values) {
            addCriterion("name in", values, "name");
            return (Criteria) this;
        }

        public Criteria andNameNotIn(List<Integer> values) {
            addCriterion("name not in", values, "name");
            return (Criteria) this;
        }

        public Criteria andNameBetween(Integer value1, Integer value2) {
            addCriterion("name between", value1, value2, "name");
            return (Criteria) this;
        }

        public Criteria andNameNotBetween(Integer value1, Integer value2) {
            addCriterion("name not between", value1, value2, "name");
            return (Criteria) this;
        }

        public Criteria andReviewTypeIsNull() {
            addCriterion("review_type is null");
            return (Criteria) this;
        }

        public Criteria andReviewTypeIsNotNull() {
            addCriterion("review_type is not null");
            return (Criteria) this;
        }

        public Criteria andReviewTypeEqualTo(Integer value) {
            addCriterion("review_type =", value, "reviewType");
            return (Criteria) this;
        }

        public Criteria andReviewTypeNotEqualTo(Integer value) {
            addCriterion("review_type <>", value, "reviewType");
            return (Criteria) this;
        }

        public Criteria andReviewTypeGreaterThan(Integer value) {
            addCriterion("review_type >", value, "reviewType");
            return (Criteria) this;
        }

        public Criteria andReviewTypeGreaterThanOrEqualTo(Integer value) {
            addCriterion("review_type >=", value, "reviewType");
            return (Criteria) this;
        }

        public Criteria andReviewTypeLessThan(Integer value) {
            addCriterion("review_type <", value, "reviewType");
            return (Criteria) this;
        }

        public Criteria andReviewTypeLessThanOrEqualTo(Integer value) {
            addCriterion("review_type <=", value, "reviewType");
            return (Criteria) this;
        }

        public Criteria andReviewTypeIn(List<Integer> values) {
            addCriterion("review_type in", values, "reviewType");
            return (Criteria) this;
        }

        public Criteria andReviewTypeNotIn(List<Integer> values) {
            addCriterion("review_type not in", values, "reviewType");
            return (Criteria) this;
        }

        public Criteria andReviewTypeBetween(Integer value1, Integer value2) {
            addCriterion("review_type between", value1, value2, "reviewType");
            return (Criteria) this;
        }

        public Criteria andReviewTypeNotBetween(Integer value1, Integer value2) {
            addCriterion("review_type not between", value1, value2, "reviewType");
            return (Criteria) this;
        }

        public Criteria andReviewMessageIsNull() {
            addCriterion("review_message is null");
            return (Criteria) this;
        }

        public Criteria andReviewMessageIsNotNull() {
            addCriterion("review_message is not null");
            return (Criteria) this;
        }

        public Criteria andReviewMessageEqualTo(String value) {
            addCriterion("review_message =", value, "reviewMessage");
            return (Criteria) this;
        }

        public Criteria andReviewMessageNotEqualTo(String value) {
            addCriterion("review_message <>", value, "reviewMessage");
            return (Criteria) this;
        }

        public Criteria andReviewMessageGreaterThan(String value) {
            addCriterion("review_message >", value, "reviewMessage");
            return (Criteria) this;
        }

        public Criteria andReviewMessageGreaterThanOrEqualTo(String value) {
            addCriterion("review_message >=", value, "reviewMessage");
            return (Criteria) this;
        }

        public Criteria andReviewMessageLessThan(String value) {
            addCriterion("review_message <", value, "reviewMessage");
            return (Criteria) this;
        }

        public Criteria andReviewMessageLessThanOrEqualTo(String value) {
            addCriterion("review_message <=", value, "reviewMessage");
            return (Criteria) this;
        }

        public Criteria andReviewMessageLike(String value) {
            addCriterion("review_message like", value, "reviewMessage");
            return (Criteria) this;
        }

        public Criteria andReviewMessageNotLike(String value) {
            addCriterion("review_message not like", value, "reviewMessage");
            return (Criteria) this;
        }

        public Criteria andReviewMessageIn(List<String> values) {
            addCriterion("review_message in", values, "reviewMessage");
            return (Criteria) this;
        }

        public Criteria andReviewMessageNotIn(List<String> values) {
            addCriterion("review_message not in", values, "reviewMessage");
            return (Criteria) this;
        }

        public Criteria andReviewMessageBetween(String value1, String value2) {
            addCriterion("review_message between", value1, value2, "reviewMessage");
            return (Criteria) this;
        }

        public Criteria andReviewMessageNotBetween(String value1, String value2) {
            addCriterion("review_message not between", value1, value2, "reviewMessage");
            return (Criteria) this;
        }
    }

    public static class Criteria extends GeneratedCriteria {

        protected Criteria() {
            super();
        }
    }

    public static class Criterion {
        private String condition;

        private Object value;

        private Object secondValue;

        private boolean noValue;

        private boolean singleValue;

        private boolean betweenValue;

        private boolean listValue;

        private String typeHandler;

        public String getCondition() {
            return condition;
        }

        public Object getValue() {
            return value;
        }

        public Object getSecondValue() {
            return secondValue;
        }

        public boolean isNoValue() {
            return noValue;
        }

        public boolean isSingleValue() {
            return singleValue;
        }

        public boolean isBetweenValue() {
            return betweenValue;
        }

        public boolean isListValue() {
            return listValue;
        }

        public String getTypeHandler() {
            return typeHandler;
        }

        protected Criterion(String condition) {
            super();
            this.condition = condition;
            this.typeHandler = null;
            this.noValue = true;
        }

        protected Criterion(String condition, Object value, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.typeHandler = typeHandler;
            if (value instanceof List<?>) {
                this.listValue = true;
            } else {
                this.singleValue = true;
            }
        }

        protected Criterion(String condition, Object value) {
            this(condition, value, null);
        }

        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.secondValue = secondValue;
            this.typeHandler = typeHandler;
            this.betweenValue = true;
        }

        protected Criterion(String condition, Object value, Object secondValue) {
            this(condition, value, secondValue, null);
        }
    }
}


text: export RUBY=ruby-head

redpajama_set_name: RedPajamaGithub


text:
from django.db import models
from django.db.models import fields
from django_extensions.db.models import TimeStampedModel
# Create your models here.

class Word(TimeStampedModel):
	word = fields.CharField(max_length=256, blank=False)

	def __str__(self):
		return self.word


text:
<?php
/**
 * Interface for classes implementing a controller.
 *
 * @package CTripleGem
 */
interface IController {
	public function Index();
}


text:
<?php
class GroupTest extends PHPUnit_Framework_TestCase
{
  public function setUp()
  {
    $this->group = new Group(array('user' => new FauxObject));
    $this->group->config = json_decode(json_encode(array('application' => array('appId' => 'foo'), 'user' => array('email' => 'bar'))));
  }

  public function testCreateNotValidated()
  {
    $res = $this->group->create(array());
    $this->assertFalse($res, 'An empty array should not pass validation and return FALSE');

    $res = $this->group->create(array('appId' => 'foo'));
    $this->assertFalse($res, 'With "name" missing should not pass validation and return FALSE');
  }

  public function testCreateCouldNotGetNextId()
  {
    $user = $this->getMock('User', array('getNextId'));
    $user->expects($this->any())
      ->method('getNextId')
      ->will($this->returnValue(false));
    $this->group->inject('user', $user);

    $res = $this->group->create(array('appId' => 'foo', 'name' => 'bar'));
    $this->assertFalse($res, 'When the next id cannot be retrieved it should return FALSE');
  }

  public function testCreateFailure()
  {
    $user = $this->getMock('User', array('getNextId'));
    $user->expects($this->any())
      ->method('getNextId')
      ->will($this->returnValue('a'));
    $db = $this->getMock('Db', array('putGroup'));
    $db->expects($this->any())
      ->method('putGroup')
      ->will($this->returnValue(false));
    $this->group->inject('user', $user);
    $this->group->inject('db', $db);

    $res = $this->group->create(array('appId' => 'foo', 'name' => 'bar'));
    $this->assertFalse($res, 'When posting to db fails it should return FALSE');
  }

  public function testCreateSuccess()
  {
    $user = $this->getMock('User', array('getNextId'));
    $user->expects($this->any())
      ->method('getNextId')
      ->will($this->returnValue('abc'));
    $db = $this->getMock('Db', array('putGroup'));
    $db->expects($this->any())
      ->method('putGroup')
      ->will($this->returnValue(true));
    $this->group->inject('user', $user);
    $this->group->inject('db', $db);

    $res = $this->group->create(array('appId' => 'foo', 'name' => 'bar'));
    $this->assertEquals('abc', $res, 'A successful creation should return the id');
  }

  public function testDeleteFailure()
  {
    $db = $this->getMock('Db', array('deleteGroup'));
    $db->expects($this->any())
      ->method('deleteGroup')
      ->will($this->returnValue(false));
    $this->group->inject('db', $db);

    $res = $this->group->delete('abc');
    $this->assertFalse($res, 'When delete fails it should return FALSE');
  }

  public function testDeleteSuccess()
  {
    $db = $this->getMock('Db', array('deleteGroup'));
    $db->expects($this->any())
      ->method('deleteGroup')
      ->will($this->returnValue(true));
    $this->group->inject('db', $db);

    $res = $this->group->delete('abc');
    $this->assertTrue($res, 'When delete fails it should return TRUE');
  }

  public function testGetGroupFailure()
  {
    $db = $this->getMock('Db', array('getGroup'));
    $db->expects($this->any())
      ->method('getGroup')
      ->will($this->returnValue(false));
    $this->group->inject('db', $db);

    $res = $this->group->getGroup('abc');
    $this->assertFalse($res, 'When db->getGroup returns FALSE group->getGroup should also');
  }

  public function testGetGroupSuccess()
  {
    $return = array('foo' => 'bar');
    $db = $this->getMock('Db', array('getGroup'));
    $db->expects($this->any())
      ->method('getGroup')
      ->will($this->returnValue($return));
    $this->group->inject('db', $db);

    $res = $this->group->getGroup('abc');
    $this->assertEquals($return, $res, 'When successful getGroup from group should return what db returns');
  }

  public function testGetGroupsFailure()
  {
    $db = $this->getMock('Db', array('getGroups'));
    $db->expects($this->any())
      ->method('getGroups')
      ->will($this->returnValue(false));
    $this->group->inject('db', $db);

    $res = $this->group->getGroups();
    $this->assertFalse($res, 'When db->getGroups returns FALSE group->getGroups should also');
  }

  public function testGetGroupsSuccess()
  {
    $return = array('foo' => 'bar');
    $db = $this->getMock('Db', array('getGroups'));
    $db->expects($this->any())
      ->method('getGroups')
      ->will($this->returnValue($return));
    $this->group->inject('db', $db);

    $res = $this->group->getGroups();
    $this->assertEquals($return, $res, 'When successful getGroups from group should return what db returns');
  }

  public function testUpdateNotValidated()
  {
    $res = $this->group->update('a', array());
    $this->assertFalse($res, 'An empty array should not pass validation and return FALSE');

    $res = $this->group->update('a', array('appId' => 'foo'));
    $this->assertFalse($res, 'With "name" missing should not pass validation and return FALSE');
  }

  public function testUpdateFailure()
  {
    $db = $this->getMock('Db', array('postGroup'));
    $db->expects($this->any())
      ->method('postGroup')
      ->will($this->returnValue(false));
    $this->group->inject('db', $db);

    $res = $this->group->update('a', array('name' => 'foobar'));
    $this->assertFalse($res, 'When an update fails FALSE should be returned');
  }

  public function testUpdateSuccess()
  {
    $db = $this->getMock('Db', array('postGroup'));
    $db->expects($this->any())
      ->method('postGroup')
      ->will($this->returnValue(true));
    $this->group->inject('db', $db);

    $res = $this->group->update('a', array('name' => 'foobar'));
    $this->assertTrue($res, 'When an update succeeds TRUE should be returned');
  }
}


text:
/*************************************************************************/
/*  editor_feature_profile.cpp                                           */
/*************************************************************************/
/*                       This file is part of:                           */
/*                           GODOT ENGINE                                */
/*                      https://godotengine.org                          */
/*************************************************************************/
/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur.                 */
/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md).   */
/*                                                                       */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the       */
/* "Software"), to deal in the Software without restriction, including   */
/* without limitation the rights to use, copy, modify, merge, publish,   */
/* distribute, sublicense, and/or sell copies of the Software, and to    */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions:                                             */
/*                                                                       */
/* The above copyright notice and this permission notice shall be        */
/* included in all copies or substantial portions of the Software.       */
/*                                                                       */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,       */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF    */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY  */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,  */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE     */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                */
/*************************************************************************/

#include "editor_feature_profile.h"

#include "core/io/dir_access.h"
#include "core/io/json.h"
#include "editor/editor_file_dialog.h"
#include "editor/editor_node.h"
#include "editor/editor_paths.h"
#include "editor/editor_property_name_processor.h"
#include "editor/editor_scale.h"
#include "editor/editor_settings.h"

const char *EditorFeatureProfile::feature_names[FEATURE_MAX] = {
	TTRC("3D Editor"),
	TTRC("Script Editor"),
	TTRC("Asset Library"),
	TTRC("Scene Tree Editing"),
	TTRC("Node Dock"),
	TTRC("FileSystem Dock"),
	TTRC("Import Dock"),
};

const char *EditorFeatureProfile::feature_descriptions[FEATURE_MAX] = {
	TTRC("Allows to view and edit 3D scenes."),
	TTRC("Allows to edit scripts using the integrated script editor."),
	TTRC("Provides built-in access to the Asset Library."),
	TTRC("Allows editing the node hierarchy in the Scene dock."),
	TTRC("Allows to work with signals and groups of the node selected in the Scene dock."),
	TTRC("Allows to browse the local file system via a dedicated dock."),
	TTRC("Allows to configure import settings for individual assets. Requires the FileSystem dock to function."),
};

const char *EditorFeatureProfile::feature_identifiers[FEATURE_MAX] = {
	"3d",
	"script",
	"asset_lib",
	"scene_tree",
	"node_dock",
	"filesystem_dock",
	"import_dock",
};

void EditorFeatureProfile::set_disable_class(const StringName &p_class, bool p_disabled) {
	if (p_disabled) {
		disabled_classes.insert(p_class);
	} else {
		disabled_classes.erase(p_class);
	}
}

bool EditorFeatureProfile::is_class_disabled(const StringName &p_class) const {
	if (p_class == StringName()) {
		return false;
	}
	return disabled_classes.has(p_class) || is_class_disabled(ClassDB::get_parent_class_nocheck(p_class));
}

void EditorFeatureProfile::set_disable_class_editor(const StringName &p_class, bool p_disabled) {
	if (p_disabled) {
		disabled_editors.insert(p_class);
	} else {
		disabled_editors.erase(p_class);
	}
}

bool EditorFeatureProfile::is_class_editor_disabled(const StringName &p_class) const {
	if (p_class == StringName()) {
		return false;
	}
	return disabled_editors.has(p_class) || is_class_editor_disabled(ClassDB::get_parent_class_nocheck(p_class));
}

void EditorFeatureProfile::set_disable_class_property(const StringName &p_class, const StringName &p_property, bool p_disabled) {
	if (p_disabled) {
		if (!disabled_properties.has(p_class)) {
			disabled_properties[p_class] = HashSet<StringName>();
		}

		disabled_properties[p_class].insert(p_property);
	} else {
		ERR_FAIL_COND(!disabled_properties.has(p_class));
		disabled_properties[p_class].erase(p_property);
		if (disabled_properties[p_class].is_empty()) {
			disabled_properties.erase(p_class);
		}
	}
}

bool EditorFeatureProfile::is_class_property_disabled(const StringName &p_class, const StringName &p_property) const {
	if (!disabled_properties.has(p_class)) {
		return false;
	}

	if (!disabled_properties[p_class].has(p_property)) {
		return false;
	}

	return true;
}

bool EditorFeatureProfile::has_class_properties_disabled(const StringName &p_class) const {
	return disabled_properties.has(p_class);
}

void EditorFeatureProfile::set_item_collapsed(const StringName &p_class, bool p_collapsed) {
	if (p_collapsed) {
		collapsed_classes.insert(p_class);
	} else {
		collapsed_classes.erase(p_class);
	}
}

bool EditorFeatureProfile::is_item_collapsed(const StringName &p_class) const {
	return collapsed_classes.has(p_class);
}

void EditorFeatureProfile::set_disable_feature(Feature p_feature, bool p_disable) {
	ERR_FAIL_INDEX(p_feature, FEATURE_MAX);
	features_disabled[p_feature] = p_disable;
}

bool EditorFeatureProfile::is_feature_disabled(Feature p_feature) const {
	ERR_FAIL_INDEX_V(p_feature, FEATURE_MAX, false);
	return features_disabled[p_feature];
}

String EditorFeatureProfile::get_feature_name(Feature p_feature) {
	ERR_FAIL_INDEX_V(p_feature, FEATURE_MAX, String());
	return feature_names[p_feature];
}

String EditorFeatureProfile::get_feature_description(Feature p_feature) {
	ERR_FAIL_INDEX_V(p_feature, FEATURE_MAX, String());
	return feature_descriptions[p_feature];
}

Error EditorFeatureProfile::save_to_file(const String &p_path) {
	Dictionary data;
	data["type"] = "feature_profile";
	Array dis_classes;
	for (const StringName &E : disabled_classes) {
		dis_classes.push_back(String(E));
	}
	dis_classes.sort();
	data["disabled_classes"] = dis_classes;

	Array dis_editors;
	for (const StringName &E : disabled_editors) {
		dis_editors.push_back(String(E));
	}
	dis_editors.sort();
	data["disabled_editors"] = dis_editors;

	Array dis_props;

	for (KeyValue<StringName, HashSet<StringName>> &E : disabled_properties) {
		for (const StringName &F : E.value) {
			dis_props.push_back(String(E.key) + ":" + String(F));
		}
	}

	data["disabled_properties"] = dis_props;

	Array dis_features;
	for (int i = 0; i < FEATURE_MAX; i++) {
		if (features_disabled[i]) {
			dis_features.push_back(feature_identifiers[i]);
		}
	}

	data["disabled_features"] = dis_features;

	Ref<FileAccess> f = FileAccess::open(p_path, FileAccess::WRITE);
	ERR_FAIL_COND_V_MSG(f.is_null(), ERR_CANT_CREATE, "Cannot create file '" + p_path + "'.");

	JSON json;
	String text = json.stringify(data, "\t");
	f->store_string(text);
	return OK;
}

Error EditorFeatureProfile::load_from_file(const String &p_path) {
	Error err;
	String text = FileAccess::get_file_as_string(p_path, &err);
	if (err != OK) {
		return err;
	}

	JSON json;
	err = json.parse(text);
	if (err != OK) {
		ERR_PRINT("Error parsing '" + p_path + "' on line " + itos(json.get_error_line()) + ": " + json.get_error_message());
		return ERR_PARSE_ERROR;
	}

	Dictionary data = json.get_data();

	if (!data.has("type") || String(data["type"]) != "feature_profile") {
		ERR_PRINT("Error parsing '" + p_path + "', it's not a feature profile.");
		return ERR_PARSE_ERROR;
	}

	disabled_classes.clear();

	if (data.has("disabled_classes")) {
		Array disabled_classes_arr = data["disabled_classes"];
		for (int i = 0; i < disabled_classes_arr.size(); i++) {
			disabled_classes.insert(disabled_classes_arr[i]);
		}
	}

	disabled_editors.clear();

	if (data.has("disabled_editors")) {
		Array disabled_editors_arr = data["disabled_editors"];
		for (int i = 0; i < disabled_editors_arr.size(); i++) {
			disabled_editors.insert(disabled_editors_arr[i]);
		}
	}

	disabled_properties.clear();

	if (data.has("disabled_properties")) {
		Array disabled_properties_arr = data["disabled_properties"];
		for (int i = 0; i < disabled_properties_arr.size(); i++) {
			String s = disabled_properties_arr[i];
			set_disable_class_property(s.get_slice(":", 0), s.get_slice(":", 1), true);
		}
	}

	if (data.has("disabled_features")) {
		Array disabled_features_arr = data["disabled_features"];
		for (int i = 0; i < FEATURE_MAX; i++) {
			bool found = false;
			String f = feature_identifiers[i];
			for (int j = 0; j < disabled_features_arr.size(); j++) {
				String fd = disabled_features_arr[j];
				if (fd == f) {
					found = true;
					break;
				}
			}

			features_disabled[i] = found;
		}
	}

	return OK;
}

void EditorFeatureProfile::_bind_methods() {
	ClassDB::bind_method(D_METHOD("set_disable_class", "class_name", "disable"), &EditorFeatureProfile::set_disable_class);
	ClassDB::bind_method(D_METHOD("is_class_disabled", "class_name"), &EditorFeatureProfile::is_class_disabled);

	ClassDB::bind_method(D_METHOD("set_disable_class_editor", "class_name", "disable"), &EditorFeatureProfile::set_disable_class_editor);
	ClassDB::bind_method(D_METHOD("is_class_editor_disabled", "class_name"), &EditorFeatureProfile::is_class_editor_disabled);

	ClassDB::bind_method(D_METHOD("set_disable_class_property", "class_name", "property", "disable"), &EditorFeatureProfile::set_disable_class_property);
	ClassDB::bind_method(D_METHOD("is_class_property_disabled", "class_name", "property"), &EditorFeatureProfile::is_class_property_disabled);

	ClassDB::bind_method(D_METHOD("set_disable_feature", "feature", "disable"), &EditorFeatureProfile::set_disable_feature);
	ClassDB::bind_method(D_METHOD("is_feature_disabled", "feature"), &EditorFeatureProfile::is_feature_disabled);

	ClassDB::bind_method(D_METHOD("get_feature_name", "feature"), &EditorFeatureProfile::_get_feature_name);

	ClassDB::bind_method(D_METHOD("save_to_file", "path"), &EditorFeatureProfile::save_to_file);
	ClassDB::bind_method(D_METHOD("load_from_file", "path"), &EditorFeatureProfile::load_from_file);

	BIND_ENUM_CONSTANT(FEATURE_3D);
	BIND_ENUM_CONSTANT(FEATURE_SCRIPT);
	BIND_ENUM_CONSTANT(FEATURE_ASSET_LIB);
	BIND_ENUM_CONSTANT(FEATURE_SCENE_TREE);
	BIND_ENUM_CONSTANT(FEATURE_NODE_DOCK);
	BIND_ENUM_CONSTANT(FEATURE_FILESYSTEM_DOCK);
	BIND_ENUM_CONSTANT(FEATURE_IMPORT_DOCK);
	BIND_ENUM_CONSTANT(FEATURE_MAX);
}

EditorFeatureProfile::EditorFeatureProfile() {}

//////////////////////////

void EditorFeatureProfileManager::_notification(int p_what) {
	switch (p_what) {
		case NOTIFICATION_READY: {
			current_profile = EDITOR_GET("_default_feature_profile");
			if (!current_profile.is_empty()) {
				current.instantiate();
				Error err = current->load_from_file(EditorPaths::get_singleton()->get_feature_profiles_dir().path_join(current_profile + ".profile"));
				if (err != OK) {
					ERR_PRINT("Error loading default feature profile: " + current_profile);
					current_profile = String();
					current.unref();
				}
			}
			_update_profile_list(current_profile);
		} break;

		case NOTIFICATION_THEME_CHANGED: {
			// Make sure that the icons are correctly adjusted if the theme's lightness was switched.
			_update_selected_profile();
		} break;
	}
}

String EditorFeatureProfileManager::_get_selected_profile() {
	int idx = profile_list->get_selected();
	if (idx < 0) {
		return String();
	}

	return profile_list->get_item_metadata(idx);
}

void EditorFeatureProfileManager::_update_profile_list(const String &p_select_profile) {
	String selected_profile;
	if (p_select_profile.is_empty()) { //default, keep
		if (profile_list->get_selected() >= 0) {
			selected_profile = profile_list->get_item_metadata(profile_list->get_selected());
			if (!FileAccess::exists(EditorPaths::get_singleton()->get_feature_profiles_dir().path_join(selected_profile + ".profile"))) {
				selected_profile = String(); //does not exist
			}
		}
	} else {
		selected_profile = p_select_profile;
	}

	Vector<String> profiles;
	Ref<DirAccess> d = DirAccess::open(EditorPaths::get_singleton()->get_feature_profiles_dir());
	ERR_FAIL_COND_MSG(d.is_null(), "Cannot open directory '" + EditorPaths::get_singleton()->get_feature_profiles_dir() + "'.");

	d->list_dir_begin();
	while (true) {
		String f = d->get_next();
		if (f.is_empty()) {
			break;
		}

		if (!d->current_is_dir()) {
			int last_pos = f.rfind(".profile");
			if (last_pos != -1) {
				profiles.push_back(f.substr(0, last_pos));
			}
		}
	}

	profiles.sort();

	profile_list->clear();

	for (int i = 0; i < profiles.size(); i++) {
		String name = profiles[i];

		if (i == 0 && selected_profile.is_empty()) {
			selected_profile = name;
		}

		if (name == current_profile) {
			name += " " + TTR("(current)");
		}
		profile_list->add_item(name);
		int index = profile_list->get_item_count() - 1;
		profile_list->set_item_metadata(index, profiles[i]);
		if (profiles[i] == selected_profile) {
			profile_list->select(index);
		}
	}

	class_list_vbc->set_visible(!selected_profile.is_empty());
	property_list_vbc->set_visible(!selected_profile.is_empty());
	no_profile_selected_help->set_visible(selected_profile.is_empty());
	profile_actions[PROFILE_CLEAR]->set_disabled(current_profile.is_empty());
	profile_actions[PROFILE_ERASE]->set_disabled(selected_profile.is_empty());
	profile_actions[PROFILE_EXPORT]->set_disabled(selected_profile.is_empty());
	profile_actions[PROFILE_SET]->set_disabled(selected_profile.is_empty());

	current_profile_name->set_text(!current_profile.is_empty() ? current_profile : TTR("(none)"));

	_update_selected_profile();
}

void EditorFeatureProfileManager::_profile_action(int p_action) {
	switch (p_action) {
		case PROFILE_CLEAR: {
			EditorSettings::get_singleton()->set("_default_feature_profile", "");
			EditorSettings::get_singleton()->save();
			current_profile = "";
			current.unref();

			_update_profile_list();
			_emit_current_profile_changed();
		} break;
		case PROFILE_SET: {
			String selected = _get_selected_profile();
			ERR_FAIL_COND(selected.is_empty());
			if (selected == current_profile) {
				return; // Nothing to do here.
			}
			EditorSettings::get_singleton()->set("_default_feature_profile", selected);
			EditorSettings::get_singleton()->save();
			current_profile = selected;
			current = edited;

			_update_profile_list();
			_emit_current_profile_changed();
		} break;
		case PROFILE_IMPORT: {
			import_profiles->popup_file_dialog();
		} break;
		case PROFILE_EXPORT: {
			export_profile->popup_file_dialog();
			export_profile->set_current_file(_get_selected_profile() + ".profile");
		} break;
		case PROFILE_NEW: {
			new_profile_dialog->popup_centered(Size2(240, 60) * EDSCALE);
			new_profile_name->clear();
			new_profile_name->grab_focus();
		} break;
		case PROFILE_ERASE: {
			String selected = _get_selected_profile();
			ERR_FAIL_COND(selected.is_empty());

			erase_profile_dialog->set_text(vformat(TTR("Remove currently selected profile, '%s'? Cannot be undone."), selected));
			erase_profile_dialog->popup_centered(Size2(240, 60) * EDSCALE);
		} break;
	}
}

void EditorFeatureProfileManager::_erase_selected_profile() {
	String selected = _get_selected_profile();
	ERR_FAIL_COND(selected.is_empty());
	Ref<DirAccess> da = DirAccess::open(EditorPaths::get_singleton()->get_feature_profiles_dir());
	ERR_FAIL_COND_MSG(da.is_null(), "Cannot open directory '" + EditorPaths::get_singleton()->get_feature_profiles_dir() + "'.");

	da->remove(selected + ".profile");
	if (selected == current_profile) {
		_profile_action(PROFILE_CLEAR);
	} else {
		_update_profile_list();
	}
}

void EditorFeatureProfileManager::_create_new_profile() {
	String name = new_profile_name->get_text().strip_edges();
	if (!name.is_valid_filename() || name.contains(".")) {
		EditorNode::get_singleton()->show_warning(TTR("Profile must be a valid filename and must not contain '.'"));
		return;
	}
	String file = EditorPaths::get_singleton()->get_feature_profiles_dir().path_join(name + ".profile");
	if (FileAccess::exists(file)) {
		EditorNode::get_singleton()->show_warning(TTR("Profile with this name already exists."));
		return;
	}

	Ref<EditorFeatureProfile> new_profile;
	new_profile.instantiate();
	new_profile->save_to_file(file);

	_update_profile_list(name);
	// The newly created profile is the first one, make it the current profile automatically.
	if (profile_list->get_item_count() == 1) {
		_profile_action(PROFILE_SET);
	}
}

void EditorFeatureProfileManager::_profile_selected(int p_what) {
	_update_selected_profile();
}

void EditorFeatureProfileManager::_fill_classes_from(TreeItem *p_parent, const String &p_class, const String &p_selected) {
	TreeItem *class_item = class_list->create_item(p_parent);
	class_item->set_cell_mode(0, TreeItem::CELL_MODE_CHECK);
	class_item->set_icon(0, EditorNode::get_singleton()->get_class_icon(p_class, "Node"));
	String text = p_class;

	bool disabled = edited->is_class_disabled(p_class);
	bool disabled_editor = edited->is_class_editor_disabled(p_class);
	bool disabled_properties = edited->has_class_properties_disabled(p_class);
	if (disabled) {
		class_item->set_custom_color(0, class_list->get_theme_color(SNAME("disabled_font_color"), SNAME("Editor")));
	} else if (disabled_editor && disabled_properties) {
		text += " " + TTR("(Editor Disabled, Properties Disabled)");
	} else if (disabled_properties) {
		text += " " + TTR("(Properties Disabled)");
	} else if (disabled_editor) {
		text += " " + TTR("(Editor Disabled)");
	}
	class_item->set_text(0, text);
	class_item->set_editable(0, true);
	class_item->set_selectable(0, true);
	class_item->set_metadata(0, p_class);

	bool collapsed = edited->is_item_collapsed(p_class);
	class_item->set_collapsed(collapsed);

	if (p_class == p_selected) {
		class_item->select(0);
	}
	if (disabled) {
		//class disabled, do nothing else (do not show further)
		return;
	}

	class_item->set_checked(0, true); // if its not disabled, its checked

	List<StringName> child_classes;
	ClassDB::get_direct_inheriters_from_class(p_class, &child_classes);
	child_classes.sort_custom<StringName::AlphCompare>();

	for (const StringName &name : child_classes) {
		if (String(name).begins_with("Editor") || ClassDB::get_api_type(name) != ClassDB::API_CORE) {
			continue;
		}
		_fill_classes_from(class_item, name, p_selected);
	}
}

void EditorFeatureProfileManager::_class_list_item_selected() {
	if (updating_features) {
		return;
	}

	property_list->clear();

	TreeItem *item = class_list->get_selected();
	if (!item) {
		return;
	}

	Variant md = item->get_metadata(0);
	if (md.get_type() == Variant::STRING || md.get_type() == Variant::STRING_NAME) {
		String class_name = md;
		String class_description;

		DocTools *dd = EditorHelp::get_doc_data();
		HashMap<String, DocData::ClassDoc>::Iterator E = dd->class_list.find(class_name);
		if (E) {
			class_description = DTR(E->value.brief_description);
		}

		description_bit->set_text(class_description);
	} else if (md.get_type() == Variant::INT) {
		int feature_id = md;
		String feature_description = EditorFeatureProfile::get_feature_description(EditorFeatureProfile::Feature(feature_id));

		description_bit->set_text(TTRGET(feature_description));
		return;
	} else {
		return;
	}

	String class_name = md;
	if (edited->is_class_disabled(class_name)) {
		return;
	}

	updating_features = true;
	TreeItem *root = property_list->create_item();
	TreeItem *options = property_list->create_item(root);
	options->set_text(0, TTR("Class Options:"));

	{
		TreeItem *option = property_list->create_item(options);
		option->set_cell_mode(0, TreeItem::CELL_MODE_CHECK);
		option->set_editable(0, true);
		option->set_selectable(0, true);
		option->set_checked(0, !edited->is_class_editor_disabled(class_name));
		option->set_text(0, TTR("Enable Contextual Editor"));
		option->set_metadata(0, CLASS_OPTION_DISABLE_EDITOR);
	}

	List<PropertyInfo> props;
	ClassDB::get_property_list(class_name, &props, true);

	bool has_editor_props = false;
	for (const PropertyInfo &E : props) {
		if (E.usage & PROPERTY_USAGE_EDITOR) {
			has_editor_props = true;
			break;
		}
	}

	if (has_editor_props) {
		TreeItem *properties = property_list->create_item(root);
		properties->set_text(0, TTR("Class Properties:"));

		const EditorPropertyNameProcessor::Style text_style = EditorPropertyNameProcessor::get_settings_style();
		const EditorPropertyNameProcessor::Style tooltip_style = EditorPropertyNameProcessor::get_tooltip_style(text_style);

		for (const PropertyInfo &E : props) {
			String name = E.name;
			if (!(E.usage & PROPERTY_USAGE_EDITOR)) {
				continue;
			}
			const String text = EditorPropertyNameProcessor::get_singleton()->process_name(name, text_style);
			const String tooltip = EditorPropertyNameProcessor::get_singleton()->process_name(name, tooltip_style);

			TreeItem *property = property_list->create_item(properties);
			property->set_cell_mode(0, TreeItem::CELL_MODE_CHECK);
			property->set_editable(0, true);
			property->set_selectable(0, true);
			property->set_checked(0, !edited->is_class_property_disabled(class_name, name));
			property->set_text(0, text);
			property->set_tooltip_text(0, tooltip);
			property->set_metadata(0, name);
			String icon_type = Variant::get_type_name(E.type);
			property->set_icon(0, EditorNode::get_singleton()->get_class_icon(icon_type));
		}
	}

	updating_features = false;
}

void EditorFeatureProfileManager::_class_list_item_edited() {
	if (updating_features) {
		return;
	}

	TreeItem *item = class_list->get_edited();
	if (!item) {
		return;
	}

	bool checked = item->is_checked(0);

	Variant md = item->get_metadata(0);
	if (md.get_type() == Variant::STRING || md.get_type() == Variant::STRING_NAME) {
		String class_selected = md;
		edited->set_disable_class(class_selected, !checked);
		_save_and_update();
		_update_selected_profile();
	} else if (md.get_type() == Variant::INT) {
		int feature_selected = md;
		edited->set_disable_feature(EditorFeatureProfile::Feature(feature_selected), !checked);
		_save_and_update();
	}
}

void EditorFeatureProfileManager::_class_list_item_collapsed(Object *p_item) {
	if (updating_features) {
		return;
	}

	TreeItem *item = Object::cast_to<TreeItem>(p_item);
	if (!item) {
		return;
	}

	Variant md = item->get_metadata(0);
	if (md.get_type() != Variant::STRING && md.get_type() != Variant::STRING_NAME) {
		return;
	}

	String class_name = md;
	bool collapsed = item->is_collapsed();
	edited->set_item_collapsed(class_name, collapsed);
}

void EditorFeatureProfileManager::_property_item_edited() {
	if (updating_features) {
		return;
	}

	TreeItem *class_item = class_list->get_selected();
	if (!class_item) {
		return;
	}

	Variant md = class_item->get_metadata(0);
	if (md.get_type() != Variant::STRING && md.get_type() != Variant::STRING_NAME) {
		return;
	}

	String class_name = md;

	TreeItem *item = property_list->get_edited();
	if (!item) {
		return;
	}
	bool checked = item->is_checked(0);

	md = item->get_metadata(0);
	if (md.get_type() == Variant::STRING || md.get_type() == Variant::STRING_NAME) {
		String property_selected = md;
		edited->set_disable_class_property(class_name, property_selected, !checked);
		_save_and_update();
		_update_selected_profile();
	} else if (md.get_type() == Variant::INT) {
		int feature_selected = md;
		switch (feature_selected) {
			case CLASS_OPTION_DISABLE_EDITOR: {
				edited->set_disable_class_editor(class_name, !checked);
				_save_and_update();
				_update_selected_profile();
			} break;
		}
	}
}

void EditorFeatureProfileManager::_update_selected_profile() {
	String class_selected;
	int feature_selected = -1;

	if (class_list->get_selected()) {
		Variant md = class_list->get_selected()->get_metadata(0);
		if (md.get_type() == Variant::STRING || md.get_type() == Variant::STRING_NAME) {
			class_selected = md;
		} else if (md.get_type() == Variant::INT) {
			feature_selected = md;
		}
	}

	class_list->clear();

	String profile = _get_selected_profile();
	if (profile.is_empty()) { //nothing selected, nothing edited
		property_list->clear();
		edited.unref();
		return;
	}

	if (profile == current_profile) {
		edited = current; //reuse current profile (which is what editor uses)
		ERR_FAIL_COND(current.is_null()); //nothing selected, current should never be null
	} else {
		//reload edited, if different from current
		edited.instantiate();
		Error err = edited->load_from_file(EditorPaths::get_singleton()->get_feature_profiles_dir().path_join(profile + ".profile"));
		ERR_FAIL_COND_MSG(err != OK, "Error when loading editor feature profile from file '" + EditorPaths::get_singleton()->get_feature_profiles_dir().path_join(profile + ".profile") + "'.");
	}

	updating_features = true;

	TreeItem *root = class_list->create_item();

	TreeItem *features = class_list->create_item(root);
	TreeItem *last_feature = nullptr;
	features->set_text(0, TTR("Main Features:"));
	for (int i = 0; i < EditorFeatureProfile::FEATURE_MAX; i++) {
		TreeItem *feature;
		if (i == EditorFeatureProfile::FEATURE_IMPORT_DOCK) {
			feature = class_list->create_item(last_feature);
		} else {
			feature = class_list->create_item(features);
			last_feature = feature;
		}
		feature->set_cell_mode(0, TreeItem::CELL_MODE_CHECK);
		feature->set_text(0, TTRGET(EditorFeatureProfile::get_feature_name(EditorFeatureProfile::Feature(i))));
		feature->set_selectable(0, true);
		feature->set_editable(0, true);
		feature->set_metadata(0, i);
		if (!edited->is_feature_disabled(EditorFeatureProfile::Feature(i))) {
			feature->set_checked(0, true);
		}

		if (i == feature_selected) {
			feature->select(0);
		}
	}

	TreeItem *classes = class_list->create_item(root);
	classes->set_text(0, TTR("Nodes and Classes:"));

	_fill_classes_from(classes, "Node", class_selected);
	_fill_classes_from(classes, "Resource", class_selected);

	updating_features = false;

	_class_list_item_selected();
}

void EditorFeatureProfileManager::_import_profiles(const Vector<String> &p_paths) {
	//test it first
	for (int i = 0; i < p_paths.size(); i++) {
		Ref<EditorFeatureProfile> profile;
		profile.instantiate();
		Error err = profile->load_from_file(p_paths[i]);
		String basefile = p_paths[i].get_file();
		if (err != OK) {
			EditorNode::get_singleton()->show_warning(vformat(TTR("File '%s' format is invalid, import aborted."), basefile));
			return;
		}

		String dst_file = EditorPaths::get_singleton()->get_feature_profiles_dir().path_join(basefile);

		if (FileAccess::exists(dst_file)) {
			EditorNode::get_singleton()->show_warning(vformat(TTR("Profile '%s' already exists. Remove it first before importing, import aborted."), basefile.get_basename()));
			return;
		}
	}

	//do it second
	for (int i = 0; i < p_paths.size(); i++) {
		Ref<EditorFeatureProfile> profile;
		profile.instantiate();
		Error err = profile->load_from_file(p_paths[i]);
		ERR_CONTINUE(err != OK);
		String basefile = p_paths[i].get_file();
		String dst_file = EditorPaths::get_singleton()->get_feature_profiles_dir().path_join(basefile);
		profile->save_to_file(dst_file);
	}

	_update_profile_list();
	// The newly imported profile is the first one, make it the current profile automatically.
	if (profile_list->get_item_count() == 1) {
		_profile_action(PROFILE_SET);
	}
}

void EditorFeatureProfileManager::_export_profile(const String &p_path) {
	ERR_FAIL_COND(edited.is_null());
	Error err = edited->save_to_file(p_path);
	if (err != OK) {
		EditorNode::get_singleton()->show_warning(vformat(TTR("Error saving profile to path: '%s'."), p_path));
	}
}

void EditorFeatureProfileManager::_save_and_update() {
	String edited_path = _get_selected_profile();
	ERR_FAIL_COND(edited_path.is_empty());
	ERR_FAIL_COND(edited.is_null());

	edited->save_to_file(EditorPaths::get_singleton()->get_feature_profiles_dir().path_join(edited_path + ".profile"));

	if (edited == current) {
		update_timer->start();
	}
}

void EditorFeatureProfileManager::_emit_current_profile_changed() {
	emit_signal(SNAME("current_feature_profile_changed"));
}

void EditorFeatureProfileManager::notify_changed() {
	_emit_current_profile_changed();
}

Ref<EditorFeatureProfile> EditorFeatureProfileManager::get_current_profile() {
	return current;
}

EditorFeatureProfileManager *EditorFeatureProfileManager::singleton = nullptr;

void EditorFeatureProfileManager::_bind_methods() {
	ClassDB::bind_method("_update_selected_profile", &EditorFeatureProfileManager::_update_selected_profile);

	ADD_SIGNAL(MethodInfo("current_feature_profile_changed"));
}

EditorFeatureProfileManager::EditorFeatureProfileManager() {
	VBoxContainer *main_vbc = memnew(VBoxContainer);
	add_child(main_vbc);

	HBoxContainer *name_hbc = memnew(HBoxContainer);
	current_profile_name = memnew(LineEdit);
	name_hbc->add_child(current_profile_name);
	current_profile_name->set_text(TTR("(none)"));
	current_profile_name->set_editable(false);
	current_profile_name->set_h_size_flags(Control::SIZE_EXPAND_FILL);
	profile_actions[PROFILE_CLEAR] = memnew(Button(TTR("Reset to Default")));
	name_hbc->add_child(profile_actions[PROFILE_CLEAR]);
	profile_actions[PROFILE_CLEAR]->set_disabled(true);
	profile_actions[PROFILE_CLEAR]->connect("pressed", callable_mp(this, &EditorFeatureProfileManager::_profile_action).bind(PROFILE_CLEAR));

	main_vbc->add_margin_child(TTR("Current Profile:"), name_hbc);

	main_vbc->add_child(memnew(HSeparator));

	HBoxContainer *profiles_hbc = memnew(HBoxContainer);
	profile_list = memnew(OptionButton);
	profile_list->set_h_size_flags(Control::SIZE_EXPAND_FILL);
	profiles_hbc->add_child(profile_list);
	profile_list->connect("item_selected", callable_mp(this, &EditorFeatureProfileManager::_profile_selected));

	profile_actions[PROFILE_NEW] = memnew(Button(TTR("Create Profile")));
	profiles_hbc->add_child(profile_actions[PROFILE_NEW]);
	profile_actions[PROFILE_NEW]->connect("pressed", callable_mp(this, &EditorFeatureProfileManager::_profile_action).bind(PROFILE_NEW));

	profile_actions[PROFILE_ERASE] = memnew(Button(TTR("Remove Profile")));
	profiles_hbc->add_child(profile_actions[PROFILE_ERASE]);
	profile_actions[PROFILE_ERASE]->set_disabled(true);
	profile_actions[PROFILE_ERASE]->connect("pressed", callable_mp(this, &EditorFeatureProfileManager::_profile_action).bind(PROFILE_ERASE));

	main_vbc->add_margin_child(TTR("Available Profiles:"), profiles_hbc);

	HBoxContainer *current_profile_hbc = memnew(HBoxContainer);

	profile_actions[PROFILE_SET] = memnew(Button(TTR("Make Current")));
	current_profile_hbc->add_child(profile_actions[PROFILE_SET]);
	profile_actions[PROFILE_SET]->set_disabled(true);
	profile_actions[PROFILE_SET]->connect("pressed", callable_mp(this, &EditorFeatureProfileManager::_profile_action).bind(PROFILE_SET));

	current_profile_hbc->add_child(memnew(VSeparator));

	profile_actions[PROFILE_IMPORT] = memnew(Button(TTR("Import")));
	current_profile_hbc->add_child(profile_actions[PROFILE_IMPORT]);
	profile_actions[PROFILE_IMPORT]->connect("pressed", callable_mp(this, &EditorFeatureProfileManager::_profile_action).bind(PROFILE_IMPORT));

	profile_actions[PROFILE_EXPORT] = memnew(Button(TTR("Export")));
	current_profile_hbc->add_child(profile_actions[PROFILE_EXPORT]);
	profile_actions[PROFILE_EXPORT]->set_disabled(true);
	profile_actions[PROFILE_EXPORT]->connect("pressed", callable_mp(this, &EditorFeatureProfileManager::_profile_action).bind(PROFILE_EXPORT));

	main_vbc->add_child(current_profile_hbc);

	h_split = memnew(HSplitContainer);
	h_split->set_v_size_flags(Control::SIZE_EXPAND_FILL);
	main_vbc->add_child(h_split);

	class_list_vbc = memnew(VBoxContainer);
	h_split->add_child(class_list_vbc);
	class_list_vbc->set_h_size_flags(Control::SIZE_EXPAND_FILL);

	class_list = memnew(Tree);
	class_list_vbc->add_margin_child(TTR("Configure Selected Profile:"), class_list, true);
	class_list->set_hide_root(true);
	class_list->set_edit_checkbox_cell_only_when_checkbox_is_pressed(true);
	class_list->connect("cell_selected", callable_mp(this, &EditorFeatureProfileManager::_class_list_item_selected));
	class_list->connect("item_edited", callable_mp(this, &EditorFeatureProfileManager::_class_list_item_edited), CONNECT_DEFERRED);
	class_list->connect("item_collapsed", callable_mp(this, &EditorFeatureProfileManager::_class_list_item_collapsed));
	// It will be displayed once the user creates or chooses a profile.
	class_list_vbc->hide();

	property_list_vbc = memnew(VBoxContainer);
	h_split->add_child(property_list_vbc);
	property_list_vbc->set_h_size_flags(Control::SIZE_EXPAND_FILL);

	description_bit = memnew(EditorHelpBit);
	property_list_vbc->add_margin_child(TTR("Description:"), description_bit, false);
	description_bit->set_custom_minimum_size(Size2(0, 80) * EDSCALE);

	property_list = memnew(Tree);
	property_list_vbc->add_margin_child(TTR("Extra Options:"), property_list, true);
	property_list->set_hide_root(true);
	property_list->set_hide_folding(true);
	property_list->set_edit_checkbox_cell_only_when_checkbox_is_pressed(true);
	property_list->connect("item_edited", callable_mp(this, &EditorFeatureProfileManager::_property_item_edited), CONNECT_DEFERRED);
	// It will be displayed once the user creates or chooses a profile.
	property_list_vbc->hide();

	no_profile_selected_help = memnew(Label(TTR("Create or import a profile to edit available classes and properties.")));
	// Add some spacing above the help label.
	Ref<StyleBoxEmpty> sb = memnew(StyleBoxEmpty);
	sb->set_default_margin(SIDE_TOP, 20 * EDSCALE);
	no_profile_selected_help->add_theme_style_override("normal", sb);
	no_profile_selected_help->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER);
	no_profile_selected_help->set_v_size_flags(Control::SIZE_EXPAND_FILL);
	h_split->add_child(no_profile_selected_help);

	new_profile_dialog = memnew(ConfirmationDialog);
	new_profile_dialog->set_title(TTR("Create Profile"));
	VBoxContainer *new_profile_vb = memnew(VBoxContainer);
	new_profile_dialog->add_child(new_profile_vb);
	Label *new_profile_label = memnew(Label);
	new_profile_label->set_text(TTR("New profile name:"));
	new_profile_vb->add_child(new_profile_label);
	new_profile_name = memnew(LineEdit);
	new_profile_vb->add_child(new_profile_name);
	new_profile_name->set_custom_minimum_size(Size2(300 * EDSCALE, 1));
	add_child(new_profile_dialog);
	new_profile_dialog->connect("confirmed", callable_mp(this, &EditorFeatureProfileManager::_create_new_profile));
	new_profile_dialog->register_text_enter(new_profile_name);
	new_profile_dialog->set_ok_button_text(TTR("Create"));

	erase_profile_dialog = memnew(ConfirmationDialog);
	add_child(erase_profile_dialog);
	erase_profile_dialog->set_title(TTR("Remove Profile"));
	erase_profile_dialog->connect("confirmed", callable_mp(this, &EditorFeatureProfileManager::_erase_selected_profile));

	import_profiles = memnew(EditorFileDialog);
	add_child(import_profiles);
	import_profiles->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILES);
	import_profiles->add_filter("*.profile", TTR("Godot Feature Profile"));
	import_profiles->connect("files_selected", callable_mp(this, &EditorFeatureProfileManager::_import_profiles));
	import_profiles->set_title(TTR("Import Profile(s)"));
	import_profiles->set_access(EditorFileDialog::ACCESS_FILESYSTEM);

	export_profile = memnew(EditorFileDialog);
	add_child(export_profile);
	export_profile->set_file_mode(EditorFileDialog::FILE_MODE_SAVE_FILE);
	export_profile->add_filter("*.profile", TTR("Godot Feature Profile"));
	export_profile->connect("file_selected", callable_mp(this, &EditorFeatureProfileManager::_export_profile));
	export_profile->set_title(TTR("Export Profile"));
	export_profile->set_access(EditorFileDialog::ACCESS_FILESYSTEM);

	set_title(TTR("Manage Editor Feature Profiles"));
	EDITOR_DEF("_default_feature_profile", "");

	update_timer = memnew(Timer);
	update_timer->set_wait_time(1); //wait a second before updating editor
	add_child(update_timer);
	update_timer->connect("timeout", callable_mp(this, &EditorFeatureProfileManager::_emit_current_profile_changed));
	update_timer->set_one_shot(true);

	singleton = this;
}


text:
enum gopy_types {
    GoPyNilType,
    GoPyBaseObject_Type,
    GoPyBool_Type,
    GoPyCFunction_Type,
    GoPyCode_Type,
    GoPyComplex_Type,
    GoPyDict_Type,
    GoPyExc_TypeError,
    GoPyFloat_Type,
    GoPyFrozenSet_Type,
    GoPyFunction_Type,
    GoPyList_Type,
    GoPyLong_Type,
    GoPyModule_Type,
    GoPyObject_Type,
    GoPyObject_TypeCheck,
    GoPySet_Type,
    GoPyTuple_Type,
    GoPyType_Type,
    GoPyUnicode_Type,
    GoPyOtherType
};
#endif


text:
data_bag_item = data_bag_item('global-properties', 'company')

template '/etc/motd.tail' do
  source 'motd.tail.erb'
  mode '0644'

  company_name = data_bag_item['name']
  filler = '#' * company_name.length
  space_filler = ' ' * company_name.length

  variables(
    :company_name => company_name,
    :filler => filler,
    :space_filler => space_filler
  )
  action :create
end


text:
system to store and analyze timeseries data in a huge manner

no dependency to any type of database, all stored on local or remote filesystem
accessible through python module, or RestFul Web API


text:
//Db transaction

package shorm

import "database/sql"

type DbTrans struct {
	engine  *Engine
	tx      *sql.Tx
	session *Session
}

func newDbTrans(e *Engine, shardValue int64) (*DbTrans, error) {
	trans := &DbTrans{engine: e, session: e.StartSession()}
	group, has := e.cluster.findGroup(shardValue)
	if !has {
		group, _ = e.cluster.DefaultGroup()
	}
	node, _ := group.GetMaster()
	var err error
	trans.tx, err = node.Db.Begin()
	if err != nil {
		if trans.tx != nil {
			trans.tx.Rollback()
		}
		return nil, err
	}
	return trans, nil
}

func (d *DbTrans) Commit() error {
	d.engine.EndSession(d.session)
	return d.tx.Commit()
}

func (d *DbTrans) Table(name string) *DbTrans {
	d.session.Table(name)
	return d

}
func (d *DbTrans) Rollback() error {
	d.engine.EndSession(d.session)
	return d.tx.Rollback()
}

func (d *DbTrans) Cols(cols string) *DbTrans {
	d.session.Cols(cols)
	return d
}

func (d *DbTrans) Omit(cols string) *DbTrans {
	d.session.Omit(cols)
	return d
}

func (d *DbTrans) Id(id interface{}) *DbTrans {
	d.session.Id(id)
	return d
}

func (d *DbTrans) Where(clause string, args ...interface{}) *DbTrans {
	d.session.Where(clause, args...)
	return d
}

func (d *DbTrans) And(clause string, args ...interface{}) *DbTrans {
	d.session.And(clause, args...)
	return d
}

func (d *DbTrans) In(colName string, args ...interface{}) *DbTrans {
	d.session.In(colName, args...)
	return d
}

func (d *DbTrans) Exec(sql string, args ...interface{}) *DbTrans {
	d.session.Exec(sql, args...)
	return d
}

func (d *DbTrans) Insert(model interface{}) error {
	return d.session.insertWithTx(d.tx, model)
}

func (d *DbTrans) InsertSlice(slicePtr interface{}) error {
	return d.session.insertSliceWithTx(d.tx, slicePtr)
}

func (d *DbTrans) Update(model interface{}) error {
	return d.session.updateWithTx(d.tx, model)
}

func (d *DbTrans) Delete(model interface{}) error {
	return d.session.deleteWithTx(d.tx, model)
}


text:
NAMESPACE('ria.mvc', function () {
    "use strict";

    /**
     * @class ria.mvc.IReadonlySession
     */
    INTERFACE(
        'IReadonlySession', [
            [[String, Object]],
            Object, function get(key, def_) {}
        ]);
});


text:
using namespace KFS;

/// A few commonly needed counters
Counter gOpenNetFds("Open network fds");
Counter gOpenDiskFds("Open disk fds");
Counter gNetBytesRead("Bytes read from network");
Counter gNetBytesWritten("Bytes written to network");
Counter gDiskBytesRead("Bytes read from disk");
Counter gDiskBytesWritten("Bytes written to disk");
// track the # of failed read/writes
Counter gDiskIOErrors("Disk I/O errors");

CounterManager gCounterManager;

void InitCounterManager()
{
    gCounterManager.AddCounter(&gOpenNetFds);
    gCounterManager.AddCounter(&gOpenDiskFds);

    gCounterManager.AddCounter(&gNetBytesRead);
    gCounterManager.AddCounter(&gNetBytesWritten);

    gCounterManager.AddCounter(&gDiskBytesRead);
    gCounterManager.AddCounter(&gDiskBytesWritten);

    gCounterManager.AddCounter(&gDiskIOErrors);

}


text:
var Case = require('Case');
const DOM = require('DOM');
var IsUnreadable = require('IsUnreadable');
var ALinksAreSeparatedByPrintableCharacters = {
  run: function (test) {
    test.get('scope').forEach(function (scope) {
      DOM.scry('a', scope).forEach(function (element) {
        var _case = test.add(Case({
          element: element
        }));
        // Only test if there's another a tag.
        var next = DOM.next(element);
        if (next && DOM.is(next, 'a')) {
          if (IsUnreadable(element.nextSibling.wholeText)) {
            _case.set({
              status: 'failed'
            });
          }
          else {
            _case.set({
              status: 'passed'
            });
          }
        }
      });
    });
  },

  meta: {
    testability: 1,
    title: {
      en: 'Lists of links should be seperated by printable characters',
      nl: 'Lijsten met links moeten gescheiden worden door afdrukbare tekens'
    },
    description: {
      en: 'If a list of links is provided within the same element, those links should be seperated by a non-linked, printable character. Structures like lists are not included in this.',
      nl: 'Als een rij met links binnen eenzelfde element staat, moeten de links gescheiden zijn door een niet-gelinkt, afdrukbaar teken. Dit geldt niet voor een gestructureerde lijst.'
    },
    guidelines: [

    ],
    tags: [
      'link',
      'content'
    ]
  }
};
module.exports = ALinksAreSeparatedByPrintableCharacters;


text:
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace TRSZoom
{
    public class TRSZoomButton : ESRI.ArcGIS.Desktop.AddIns.Button
    {
        public TRSZoomButton()
        {
        }

        protected override void OnClick()
        {
            //
            //  TODO: Sample code showing how to access button host
            //
            ArcMap.Application.CurrentTool = null;
            var window = GetDockableWindow(ThisAddIn.IDs.TRSZoomDockableWindow);
            window.Show(true);
        }
        internal static ESRI.ArcGIS.Framework.IDockableWindow GetDockableWindow(string id)
        {
            // Use GetDockableWindow directly intead of FromID as we want the client IDockableWindow not the internal class
            ESRI.ArcGIS.esriSystem.UID dockWinID = new ESRI.ArcGIS.esriSystem.UIDClass();
            dockWinID.Value = id;
            return ArcMap.DockableWindowManager.GetDockableWindow(dockWinID);
        }
        protected override void OnUpdate()
        {
            Enabled = ArcMap.Application != null;
        }
    }

}


text:
package com.fasterxml.jackson.core.sym;

public final class Name2 extends Name
{
  final int mQuad1;
  final int mQuad2;

  Name2(String paramString, int paramInt1, int paramInt2, int paramInt3)
  {
    super(paramString, paramInt1);
    this.mQuad1 = paramInt2;
    this.mQuad2 = paramInt3;
  }

  public final boolean equals(int paramInt)
  {
    return false;
  }

  public final boolean equals(int paramInt1, int paramInt2)
  {
    return (paramInt1 == this.mQuad1) && (paramInt2 == this.mQuad2);
  }

  public final boolean equals(int[] paramArrayOfInt, int paramInt)
  {
    return (paramInt == 2) && (paramArrayOfInt[0] == this.mQuad1) && (paramArrayOfInt[1] == this.mQuad2);
  }
}

/* Location:           /Users/vikas/Documents/Mhacks_Real_app/classes-dex2jar.jar
 * Qualified Name:     com.fasterxml.jackson.core.sym.Name2
 * JD-Core Version:    0.6.2
 */


text:
using System;
using CheckMapp.Model;

namespace CheckMapp.Design
{
    public class DesignDataService
    {

    }
}


text:
<?php

namespace Symfony\Component\VarDumper\Caster;

use Symfony\Component\VarDumper\Cloner\Stub;

/**
 * Represents a list of function arguments.
 *
 * @author Nicolas Grekas <p@tchwork.com>
 */
class ArgsStub extends EnumStub
{
    private static $parameters = [];

    public function __construct(array $args, string $function, ?string $class)
    {
        [$variadic, $params] = self::getParameters($function, $class);

        $values = [];
        foreach ($args as $k => $v) {
            $values[$k] = !\is_scalar($v) && !$v instanceof Stub ? new CutStub($v) : $v;
        }
        if (null === $params) {
            parent::__construct($values, false);

            return;
        }
        if (\count($values) < \count($params)) {
            $params = \array_slice($params, 0, \count($values));
        } elseif (\count($values) > \count($params)) {
            $values[] = new EnumStub(array_splice($values, \count($params)), false);
            $params[] = $variadic;
        }
        if (['...'] === $params) {
            $this->dumpKeys = false;
            $this->value = $values[0]->value;
        } else {
            $this->value = array_combine($params, $values);
        }
    }

    private static function getParameters(string $function, ?string $class): array
    {
        if (isset(self::$parameters[$k = $class.'::'.$function])) {
            return self::$parameters[$k];
        }

        try {
            $r = null !== $class ? new \ReflectionMethod($class, $function) : new \ReflectionFunction($function);
        } catch (\ReflectionException $e) {
            return [null, null];
        }

        $variadic = '...';
        $params = [];
        foreach ($r->getParameters() as $v) {
            $k = '$'.$v->name;
            if ($v->isPassedByReference()) {
                $k = '&'.$k;
            }
            if ($v->isVariadic()) {
                $variadic .= $k;
            } else {
                $params[] = $k;
            }
        }

        return self::$parameters[$k] = [$variadic, $params];
    }
}


text:
import React from 'react'
import {FloatingActionButton} from 'material-ui'
import ContentAdd from 'material-ui/svg-icons/content/add'
import {connect} from 'react-redux'
import _, {get, isEmpty, isEqual, filter, map, find, sortBy, findIndex} from 'lodash'
import {List} from 'material-ui'
import {push} from 'react-router-redux'
import {compose} from 'recompose'
import {graphql, gql} from 'react-apollo'
import Folder from '../site_tree_element'
import {showNotification} from '../../actions'
import {t} from '../../common/utils'
import folders from '../../graphql/folders.gql'
import NewFolder from './new_folder'

const folderIcon =

class Tree extends React.Component {
  constructor(props) {
    super(props)
    this.state = {
      folders: []
    }
  }

  hover(id) {
    this.setState({hover: id})
  }

  move(id, targetId, action) {
    if (id === targetId) {
      return
    }
    const collection = this.state.folders
    const target = find(collection, {id: targetId})
    const self = find(collection, {id})
    let {parent} = target
    let sortedItems
    if (action === 'move') {
      parent = target.id
      sortedItems = [...filter(collection, {parent: target}), self]
    } else {
      let sortableItems = _(collection)
        .reject({id})
        .filter({parent})
        .sortBy('position')
        .value()
      const i = findIndex(sortableItems, {id: targetId})
      sortedItems = action === 'before' ?
      [...sortableItems.slice(0, i), {...self, parent}, target, ...sortableItems.slice(i+1, sortableItems.length)] :
      [...sortableItems.slice(0, i), target, {...self, parent}, ...sortableItems.slice(i+1, sortableItems.length)]
      sortedItems = map(sortedItems, (item, position) => ({...item, position}))
    }

    this.setState({hover: null})

    return this.props.saveOrder({
      variables: {folders: map(sortedItems, 'id'), parent},
      optimisticResponse: {
        __typename: 'Mutation',
        orderFolders: sortedItems,
      },
    })
      .then(({data}) => {
        this.props.showNotification("Order saved")
      })
      .catch((error) => {
        this.props.showNotification("Ooops, could not save new page order")
      })
  }

  componentWillReceiveProps({folders}) {
    if (folders) {
      this.setState({folders})
    }
  }

  renderFolder(folder) {
    let props = {}
    const subFolders = filter(this.state.folders, ({parent}) => parent === folder.id)
    if (!isEmpty(subFolders)) {
      props = {
        // primaryTogglesNestedList: true,
        // initiallyOpen: this.props.fullPath.includes(folder.id),
        nestedItems: map(sortBy(subFolders, 'position'), this.renderFolder.bind(this)),
      }
    }
    const textStyle = folder.hidden ? {textDecoration: 'line-through', color: '#888'} : {}
    return (
      <Folder
        leftIcon={folderIcon}
        primaryText={t(folder.name, this.props.locale)}
        innerDivStyle={textStyle}
        key={folder.id}
        id={folder.id}
        hover={folder.id === this.state.hover}
        position={folder.position}
        parent={folder.parent}
        onMove={this.move.bind(this)}
        onHover={this.hover.bind(this)}
        onTouchTap={() => this.props.push(`/catalog/${this.props.catalog}/folder/${folder.id}`)}
        {...props}
      />
    )
  }

  render() {
    const folders = sortBy(this.state.folders.filter(f => !f.parent), 'position')
    return (
      <List>
        {folders.map(folder => this.renderFolder(folder))}
      </List>
    )
  }

  onClickNode(node) {
    this.setState({
      active: node,
    })
  }

  shouldComponentUpdate(newProps, newState) {
    return !isEqual(this.props, newProps) || !isEqual(this.state, newState)
  }
}

const mapStateToProps = ({app: {locale}}, {data}) => {
  return {
    folders: get(data, 'folders', []),
    locale
  }
}

const saveOrder = gql`
mutation orderFolders($folders: [ID!]!, $parent: ID) {
  orderFolders(folders: $folders, parent: $parent) {
    id
    parent
    position
    name
    hidden
  }
}
`

const enhance = compose(
  graphql(folders, {
    options: ({catalog}) => ({variables: {catalog}})
  }),
  graphql(saveOrder, {name: 'saveOrder'}),
  connect(mapStateToProps, {push, showNotification}),
)
const ConnectedTree = enhance(Tree)

class TreeWrapper extends React.Component {
  constructor(props) {
    super(props)
    this.state = {}
  }

  render() {
    const {match, history, catalog, children} = this.props
    const childrenWithParams = React.Children.map(children, child => {
      return React.cloneElement(child, {match})
    })
    return (

        <NewFolder
          parent={match.params.folder}
          open={this.state.addFolder || false}
          catalog={catalog}
          onFolderSaved={() => this.setState({addFolder: false})}
          onClose={() => this.setState({addFolder: false})}
        />

          <ConnectedTree activePage={match.params.folder} catalog={catalog} />

          {childrenWithParams}

          {match.params.folder && <FloatingActionButton secondary
            onTouchTap={() => this.setState({addFolder: true})}
          >

          </FloatingActionButton>}
          {match.params.folder && <FloatingActionButton secondary
            onTouchTap={() => history.push(`/catalog/${catalog}/folder/${match.params.folder}/item/new`)}
            style={{marginLeft: 10}}
          >
            <ContentAdd />
          </FloatingActionButton>}
          {!match.params.folder && <FloatingActionButton secondary
            onTouchTap={() => history.push(`/catalog/${catalog}/item/new`)}
            style={{marginLeft: 10}}
          >
            <ContentAdd />
          </FloatingActionButton>}

    )
  }
}

export {TreeWrapper}


text:
#include "ESPBeam.h"
#include "../BlammoEngine/Camera.h"
#include "../BlammoEngine/Collision.h"

ESPBeam::ESPBeam(const ColourRGBA& colour, const Vector3D& beamLineVec, const Vector3D& rotationalVec,
                 const ESPInterval& amplitudeVariationAmt, const ESPInterval& lineDistVariationAmt) :
startSegment(new ESPBeamSegment(NULL)), colour(colour),
lifeTimeInSecs(0.0), currLifeTickCount(0.0),
rotationalVec(rotationalVec), beamLineVec(beamLineVec),
amplitudeVariationAmt(amplitudeVariationAmt), lineDistVariationAmt(lineDistVariationAmt) {
}

ESPBeam::~ESPBeam() {
	delete startSegment;
	startSegment = NULL;
}

void ESPBeam::Draw(const Point3D& startPt, const Point3D& endPt, const Camera& camera) const {
	std::list<const ESPBeamSegment*> beamSegs;
	beamSegs.push_back(this->startSegment);

	// Figure out the thickness (in pixels) of the line based on the camera distance and the
	// thickness of the beam in world units...

	// Calculate the distance from the camera along the look vector that the beam is...
	//Vector3D cameraViewVec   = camera.GetNormalizedViewVector();
	Vector3D distVec = Point3D::GetMidPoint(startPt, endPt) - camera.GetCurrentCameraPosition();
	float distanceFromCamera = distVec.length();

	// Calculate the height of the screen in world space
	float screenHeightInWorldUnits = 2.0f * tan(Trig::degreesToRadians(camera.GetFOVAngleInDegrees() / 2.0f)) * distanceFromCamera;
	// Now we simply use a ratio between the world units and the pixels based on the height of the screen
	float thicknessInPixels = static_cast<float>(this->thickness * camera.GetWindowHeight()) / screenHeightInWorldUnits;

	// Make sure we don't exceed the limits of OpenGL line widths
	float minMaxLineWidth[2];
	glGetFloatv(GL_ALIASED_LINE_WIDTH_RANGE, minMaxLineWidth);
	thicknessInPixels = std::min<float>(minMaxLineWidth[1], std::max<float>(minMaxLineWidth[0], thicknessInPixels));

    glColor4f(this->colour.R(), this->colour.G(), this->colour.B(), this->colour.A());

    glPointSize(thicknessInPixels);
    glBegin(GL_POINTS);
    while (!beamSegs.empty()) {
        const ESPBeamSegment* currSeg = beamSegs.front();
        beamSegs.pop_front();
        glVertex3fv(currSeg->GetEndPoint().begin());

        const std::list<ESPBeamSegment*>& childSegs = currSeg->GetChildSegments();
        if (childSegs.size() == 1) {
            beamSegs.push_back(childSegs.front());
        }
    }
    glEnd();

    beamSegs.push_back(this->startSegment);
	glLineWidth(thicknessInPixels);
	glBegin(GL_LINE_STRIP);
	while (!beamSegs.empty()) {
		const ESPBeamSegment* currSeg = beamSegs.front();
		beamSegs.pop_front();
		glVertex3fv(currSeg->GetEndPoint().begin());

		const std::list<ESPBeamSegment*>& childSegs = currSeg->GetChildSegments();
		if (childSegs.size() == 1) {
			beamSegs.push_back(childSegs.front());
		}
	}
	glEnd();

}