text:
package com.hortonworks.streamline.registries.dashboard.entites;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.hortonworks.registries.common.Schema;
import com.hortonworks.registries.storage.PrimaryKey;
import com.hortonworks.registries.storage.annotation.StorableEntity;
import com.hortonworks.registries.storage.catalog.AbstractStorable;

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

@StorableEntity
public class Datasource extends AbstractStorable {
    public static final String NAMESPACE = "datasource";
    public static final String ID = "id";

    private Long id;
    private String name;
    private String description;
    private String type;
    private String url;
    private String data;
    private Long timestamp;
    private Long dashboardId;

    @JsonIgnore
    @Override
    public String getNameSpace() {
        return NAMESPACE;
    }

    @JsonIgnore
    @Override
    public PrimaryKey getPrimaryKey() {
        Map<Schema.Field, Object> fieldToObjectMap = new HashMap<>();
        fieldToObjectMap.put(new Schema.Field(ID, Schema.Type.LONG), this.id);
        fieldToObjectMap.put(new Schema.Field(Dashboard.DASHBOARD_ID, Schema.Type.LONG), this.dashboardId);
        return new PrimaryKey(fieldToObjectMap);
    }

    @Override
    public Long getId() {
        return id;
    }

    @Override
    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getData() {
        return data;
    }

    public void setData(String data) {
        this.data = data;
    }

    public Long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(Long timestamp) {
        this.timestamp = timestamp;
    }

    public Long getDashboardId() {
        return dashboardId;
    }

    public void setDashboardId(Long dashboardId) {
        this.dashboardId = dashboardId;
    }

    @Override
    public String toString() {
        return "Datasource{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", description='" + description + '\'' +
                ", type='" + type + '\'' +
                ", url='" + url + '\'' +
                ", data='" + data + '\'' +
                ", timestamp=" + timestamp +
                ", dashboardId=" + dashboardId +
                "} " + super.toString();
    }
}


text:
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Spark.CSharp.Core;

using Microsoft.Spark.CSharp.Streaming;
using Microsoft.Spark.CSharp.Samples;

using NUnit.Framework;

namespace Microsoft.Spark.CSharp
{
    class DStreamSamples
    {
        private static int count;
        private static bool stopFileServer;
        private static void StartFileServer(StreamingContext ssc, string directory, string pattern, int loops = 1)
        {
            string testDir = Path.Combine(directory, "test");
            if (!Directory.Exists(testDir))
                Directory.CreateDirectory(testDir);

            stopFileServer = false;

            string[] files = Directory.GetFiles(directory, pattern);

            Task.Run(() =>
            {
                int loop = 0;
                while (!stopFileServer)
                {
                    if (loop++ < loops)
                    {
                        DateTime now = DateTime.Now;
                        foreach (string path in files)
                        {
                            string text = File.ReadAllText(path);
                            File.WriteAllText(testDir + "\\" + now.ToBinary() + "_" + Path.GetFileName(path), text);
                        }
                    }
                    System.Threading.Thread.Sleep(200);
                }

                ssc.Stop();
            });

            System.Threading.Thread.Sleep(1);
        }

        [Sample("experimental")]
        internal static void DStreamTextFileSample()
        {
            count = 0;

            string directory = SparkCLRSamples.Configuration.SampleDataLocation;
            string checkpointPath = Path.Combine(directory, "checkpoint");

            SparkContext sc = SparkCLRSamples.SparkContext;
            var b = sc.Broadcast<int>(0);

            StreamingContext ssc = StreamingContext.GetOrCreate(checkpointPath,
                () =>
                {

                    StreamingContext context = new StreamingContext(sc, 2);
                    context.Checkpoint(checkpointPath);

                    var lines = context.TextFileStream(Path.Combine(directory, "test"));
                    lines = context.Union(lines, lines);
                    var words = lines.FlatMap(l => l.Split(' '));
                    var pairs = words.Map(w => new KeyValuePair<string, int>(w, 1));

                    // since operations like ReduceByKey, Join and UpdateStateByKey are
                    // separate dstream transformations defined in CSharpDStream.scala
                    // an extra CSharpRDD is introduced in between these operations
                    var wordCounts = pairs.ReduceByKey((x, y) => x + y);
                    var join = wordCounts.Window(2, 2).Join(wordCounts, 2);
                    var state = join.UpdateStateByKey<string, Tuple<int, int>, int>(new UpdateStateHelper(b).Execute);

                    state.ForeachRDD((time, rdd) =>
                    {
                        // there's chance rdd.Take conflicts with ssc.Stop
                        if (stopFileServer)
                            return;

                        object[] taken = rdd.Take(10);
                        Console.WriteLine("-------------------------------------------");
                        Console.WriteLine("Time: {0}", time);
                        Console.WriteLine("-------------------------------------------");
                        foreach (object record in taken)
                        {
                            Console.WriteLine(record);

                            var countByWord = (KeyValuePair<string, int>)record;
                            Assert.AreEqual(countByWord.Value, countByWord.Key == "The" || countByWord.Key == "lazy" || countByWord.Key == "dog" ? 92 : 88);
                        }
                        Console.WriteLine();

                        stopFileServer = true;
                    });

                    return context;
                });

            StartFileServer(ssc, directory, "words.txt");

            ssc.Start();

            ssc.AwaitTermination();
        }

        private static string brokers = ConfigurationManager.AppSettings["KafkaTestBrokers"] ?? "127.0.0.1:9092";
        private static string topic = ConfigurationManager.AppSettings["KafkaTestTopic"] ?? "test";
        // expected partitions
        private static int partitions = int.Parse(ConfigurationManager.AppSettings["KafkaTestPartitions"] ?? "10");
        // total message count
        private static uint  messages = uint.Parse(ConfigurationManager.AppSettings["KafkaMessageCount"] ?? "100");

        /// <summary>
        /// start a local kafka service and create a 'test' topic with some data before running this sample
        /// e.g. create 2 partitions with 100 messages which will be repartitioned into 10 RDD partitions
        /// TODO: automate kafka service
        /// </summary>
        [Sample("experimental")]
        internal static void DStreamDirectKafkaWithRepartitionSample()
        {
            count = 0;

            string directory = SparkCLRSamples.Configuration.SampleDataLocation;
            string checkpointPath = Path.Combine(directory, "checkpoint");

            StreamingContext ssc = StreamingContext.GetOrCreate(checkpointPath,
                () =>
                {
                    SparkContext sc = SparkCLRSamples.SparkContext;
                    StreamingContext context = new StreamingContext(sc, 2);
                    context.Checkpoint(checkpointPath);

                    var kafkaParams = new Dictionary<string, string> {
                        {"metadata.broker.list", brokers},
                        {"auto.offset.reset", "smallest"}
                    };

                    var dstream = KafkaUtils.CreateDirectStreamWithRepartition(context, new List<string> { topic }, kafkaParams, new Dictionary<string, long>(), partitions);

                    dstream.ForeachRDD((time, rdd) =>
                        {
                            long batchCount = rdd.Count();
                            int numPartitions = rdd.GetNumPartitions();

                            Console.WriteLine("-------------------------------------------");
                            Console.WriteLine("Time: {0}", time);
                            Console.WriteLine("-------------------------------------------");
                            Console.WriteLine("Count: " + batchCount);
                            Console.WriteLine("Partitions: " + numPartitions);

                            // only first batch has data and is repartitioned into 10 partitions
                            if (count++ == 0)
                            {
                                Assert.AreEqual(messages, batchCount);
                                Assert.IsTrue(numPartitions >= partitions);
                            }
                            else
                            {
                                Assert.AreEqual(0, batchCount);
                                Assert.IsTrue(numPartitions == 0);
                            }
                        });

                    return context;
                });

            ssc.Start();
            ssc.AwaitTermination();
        }

        /// <summary>
        /// A sample shows that ConstantInputDStream is an input stream that always returns the same mandatory input RDD at every batch time.
        /// </summary>
        [Sample("experimental")]
        internal static void DStreamConstantDStreamSample()
        {
            var sc = SparkCLRSamples.SparkContext;
            var ssc = new StreamingContext(sc, 2);

            const int count = 100;
            const int partitions = 2;

            // create the RDD
            var seedRDD = sc.Parallelize(Enumerable.Range(0, 100), 2);
            var dstream = new ConstantInputDStream<int>(seedRDD, ssc);

            dstream.ForeachRDD((time, rdd) =>
            {
                long batchCount = rdd.Count();
                int numPartitions = rdd.GetNumPartitions();

                Console.WriteLine("-------------------------------------------");
                Console.WriteLine("Time: {0}", time);
                Console.WriteLine("-------------------------------------------");
                Console.WriteLine("Count: " + batchCount);
                Console.WriteLine("Partitions: " + numPartitions);
                Assert.AreEqual(count, batchCount);
                Assert.AreEqual(partitions, numPartitions);
            });

            ssc.Start();
            ssc.AwaitTermination();
        }
    }

    // Use this helper class to test broacast variable in streaming application
    [Serializable]
    internal class UpdateStateHelper
    {
        private Broadcast<int> b;

        internal UpdateStateHelper(Broadcast<int> b)
        {
            this.b = b;
        }

        internal int Execute(IEnumerable<Tuple<int, int>> vs, int s)
        {
            int result = vs.Sum(x => x.Item1 + x.Item2) + s + b.Value;
            return result;
        }
    }

}

redpajama_set_name: RedPajamaGithub


text:
Okres (sek.) pomiêdzy przeszukaniami kolejki odroczeñ

<tt>queue_run_delay</tt>

Ten parametr okre¶la okres w sekundach pomiêdzy przeszukaniami kolejki
odroczeñ przez zarz±dcê kolejki.


text:
a {
    text-decoration-style: dashed;
}


text:
//
//  Generated by the J2ObjC translator.  DO NOT EDIT!
//  source: ./queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/config/StandardQueryConfigHandler.java
//

#include "J2ObjC_header.h"

#pragma push_macro("INCLUDE_ALL_OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler")
#ifdef RESTRICT_OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler
#define INCLUDE_ALL_OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler 0
#else
#define INCLUDE_ALL_OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler 1
#endif
#undef RESTRICT_OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler

#if __has_feature(nullability)
#pragma clang diagnostic push
#pragma GCC diagnostic ignored "-Wnullability"
#pragma GCC diagnostic ignored "-Wnullability-completeness"
#endif

#if !defined (OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_) && (INCLUDE_ALL_OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler || defined(INCLUDE_OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler))
#define OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_

#define RESTRICT_OrgApacheLuceneQueryparserFlexibleCoreConfigQueryConfigHandler 1
#define INCLUDE_OrgApacheLuceneQueryparserFlexibleCoreConfigQueryConfigHandler 1
#include "org/apache/lucene/queryparser/flexible/core/config/QueryConfigHandler.h"

/*!
 @brief This query configuration handler is used for almost every processor defined
  in the StandardQueryNodeProcessorPipeline processor pipeline.It holds
  configuration methods that reproduce the configuration methods that could be set on the old
  lucene 2.4 QueryParser class.
 - seealso: StandardQueryNodeProcessorPipeline
 */
@interface OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler : OrgApacheLuceneQueryparserFlexibleCoreConfigQueryConfigHandler

#pragma mark Public

- (instancetype __nonnull)init;

@end

J2OBJC_EMPTY_STATIC_INIT(OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler)

FOUNDATION_EXPORT void OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_init(OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler *self);

FOUNDATION_EXPORT OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler *new_OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_init(void) NS_RETURNS_RETAINED;

FOUNDATION_EXPORT OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler *create_OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_init(void);

J2OBJC_TYPE_LITERAL_HEADER(OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler)

#endif

#if !defined (OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys_) && (INCLUDE_ALL_OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler || defined(INCLUDE_OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys))
#define OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys_

@class OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey;

/*!
 @brief Class holding keys for StandardQueryNodeProcessorPipeline options.
 */
@interface OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys : NSObject
@property (readonly, class, strong) OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *ENABLE_POSITION_INCREMENTS NS_SWIFT_NAME(ENABLE_POSITION_INCREMENTS);
@property (readonly, class, strong) OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *LOWERCASE_EXPANDED_TERMS NS_SWIFT_NAME(LOWERCASE_EXPANDED_TERMS);
@property (readonly, class, strong) OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *ALLOW_LEADING_WILDCARD NS_SWIFT_NAME(ALLOW_LEADING_WILDCARD);
@property (readonly, class, strong) OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *ANALYZER NS_SWIFT_NAME(ANALYZER);
@property (readonly, class, strong) OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *DEFAULT_OPERATOR NS_SWIFT_NAME(DEFAULT_OPERATOR);
@property (readonly, class, strong) OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *PHRASE_SLOP NS_SWIFT_NAME(PHRASE_SLOP);
@property (readonly, class, strong) OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *LOCALE NS_SWIFT_NAME(LOCALE);
@property (readonly, class, strong) OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *TIMEZONE NS_SWIFT_NAME(TIMEZONE);
@property (readonly, class, strong) OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *MULTI_TERM_REWRITE_METHOD NS_SWIFT_NAME(MULTI_TERM_REWRITE_METHOD);
@property (readonly, class, strong) OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *MULTI_FIELDS NS_SWIFT_NAME(MULTI_FIELDS);
@property (readonly, class, strong) OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *FIELD_BOOST_MAP NS_SWIFT_NAME(FIELD_BOOST_MAP);
@property (readonly, class, strong) OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *FIELD_DATE_RESOLUTION_MAP NS_SWIFT_NAME(FIELD_DATE_RESOLUTION_MAP);
@property (readonly, class, strong) OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *FUZZY_CONFIG NS_SWIFT_NAME(FUZZY_CONFIG);
@property (readonly, class, strong) OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *DATE_RESOLUTION NS_SWIFT_NAME(DATE_RESOLUTION);
@property (readonly, class, strong) OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *BOOST NS_SWIFT_NAME(BOOST);
@property (readonly, class, strong) OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *NUMERIC_CONFIG NS_SWIFT_NAME(NUMERIC_CONFIG);
@property (readonly, class, strong) OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *NUMERIC_CONFIG_MAP NS_SWIFT_NAME(NUMERIC_CONFIG_MAP);

#pragma mark Public

- (instancetype __nonnull)init;

@end

J2OBJC_STATIC_INIT(OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys)

/*!
 @brief Key used to set whether position increments is enabled
 - seealso: StandardQueryParser#setEnablePositionIncrements(boolean)
 - seealso: StandardQueryParser#getEnablePositionIncrements()
 */
inline OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys_get_ENABLE_POSITION_INCREMENTS(void);
/*! INTERNAL ONLY - Use accessor function from above. */
FOUNDATION_EXPORT OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys_ENABLE_POSITION_INCREMENTS;
J2OBJC_STATIC_FIELD_OBJ_FINAL(OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys, ENABLE_POSITION_INCREMENTS, OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *)

/*!
 @brief Key used to set whether expanded terms should be lower-cased
 - seealso: StandardQueryParser#setLowercaseExpandedTerms(boolean)
 - seealso: StandardQueryParser#getLowercaseExpandedTerms()
 */
inline OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys_get_LOWERCASE_EXPANDED_TERMS(void);
/*! INTERNAL ONLY - Use accessor function from above. */
FOUNDATION_EXPORT OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys_LOWERCASE_EXPANDED_TERMS;
J2OBJC_STATIC_FIELD_OBJ_FINAL(OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys, LOWERCASE_EXPANDED_TERMS, OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *)

/*!
 @brief Key used to set whether leading wildcards are supported
 - seealso: StandardQueryParser#setAllowLeadingWildcard(boolean)
 - seealso: StandardQueryParser#getAllowLeadingWildcard()
 */
inline OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys_get_ALLOW_LEADING_WILDCARD(void);
/*! INTERNAL ONLY - Use accessor function from above. */
FOUNDATION_EXPORT OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys_ALLOW_LEADING_WILDCARD;
J2OBJC_STATIC_FIELD_OBJ_FINAL(OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys, ALLOW_LEADING_WILDCARD, OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *)

/*!
 @brief Key used to set the Analyzer used for terms found in the query
 - seealso: StandardQueryParser#setAnalyzer(Analyzer)
 - seealso: StandardQueryParser#getAnalyzer()
 */
inline OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys_get_ANALYZER(void);
/*! INTERNAL ONLY - Use accessor function from above. */
FOUNDATION_EXPORT OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys_ANALYZER;
J2OBJC_STATIC_FIELD_OBJ_FINAL(OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys, ANALYZER, OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *)

/*!
 @brief Key used to set the default boolean operator
 - seealso: StandardQueryParser#setDefaultOperator(org.apache.lucene.queryparser.flexible.standard.config.StandardQueryConfigHandler.Operator)
 - seealso: StandardQueryParser#getDefaultOperator()
 */
inline OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys_get_DEFAULT_OPERATOR(void);
/*! INTERNAL ONLY - Use accessor function from above. */
FOUNDATION_EXPORT OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys_DEFAULT_OPERATOR;
J2OBJC_STATIC_FIELD_OBJ_FINAL(OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys, DEFAULT_OPERATOR, OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *)

/*!
 @brief Key used to set the default phrase slop
 - seealso: StandardQueryParser#setPhraseSlop(int)
 - seealso: StandardQueryParser#getPhraseSlop()
 */
inline OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys_get_PHRASE_SLOP(void);
/*! INTERNAL ONLY - Use accessor function from above. */
FOUNDATION_EXPORT OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys_PHRASE_SLOP;
J2OBJC_STATIC_FIELD_OBJ_FINAL(OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys, PHRASE_SLOP, OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *)

/*!
 @brief Key used to set the Locale used when parsing the query
 - seealso: StandardQueryParser#setLocale(Locale)
 - seealso: StandardQueryParser#getLocale()
 */
inline OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys_get_LOCALE(void);
/*! INTERNAL ONLY - Use accessor function from above. */
FOUNDATION_EXPORT OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys_LOCALE;
J2OBJC_STATIC_FIELD_OBJ_FINAL(OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys, LOCALE, OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *)

inline OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys_get_TIMEZONE(void);
/*! INTERNAL ONLY - Use accessor function from above. */
FOUNDATION_EXPORT OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys_TIMEZONE;
J2OBJC_STATIC_FIELD_OBJ_FINAL(OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys, TIMEZONE, OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *)

/*!
 @brief Key used to set the RewriteMethod used when creating queries
 - seealso: StandardQueryParser#setMultiTermRewriteMethod(org.apache.lucene.search.MultiTermQuery.RewriteMethod)
 - seealso: StandardQueryParser#getMultiTermRewriteMethod()
 */
inline OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys_get_MULTI_TERM_REWRITE_METHOD(void);
/*! INTERNAL ONLY - Use accessor function from above. */
FOUNDATION_EXPORT OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys_MULTI_TERM_REWRITE_METHOD;
J2OBJC_STATIC_FIELD_OBJ_FINAL(OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys, MULTI_TERM_REWRITE_METHOD, OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *)

/*!
 @brief Key used to set the fields a query should be expanded to when the field
  is null
 - seealso: StandardQueryParser#setMultiFields(CharSequence[])
 - seealso: StandardQueryParser#getMultiFields(CharSequence[])
 */
inline OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys_get_MULTI_FIELDS(void);
/*! INTERNAL ONLY - Use accessor function from above. */
FOUNDATION_EXPORT OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys_MULTI_FIELDS;
J2OBJC_STATIC_FIELD_OBJ_FINAL(OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys, MULTI_FIELDS, OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *)

/*!
 @brief Key used to set a field to boost map that is used to set the boost for each field
 - seealso: StandardQueryParser#setFieldsBoost(Map)
 - seealso: StandardQueryParser#getFieldsBoost()
 */
inline OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys_get_FIELD_BOOST_MAP(void);
/*! INTERNAL ONLY - Use accessor function from above. */
FOUNDATION_EXPORT OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys_FIELD_BOOST_MAP;
J2OBJC_STATIC_FIELD_OBJ_FINAL(OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys, FIELD_BOOST_MAP, OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *)

/*!
 @brief Key used to set a field to Resolution map that is used
  to normalize each date field value.
 - seealso: StandardQueryParser#setDateResolutionMap(Map)
 - seealso: StandardQueryParser#getDateResolutionMap()
 */
inline OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys_get_FIELD_DATE_RESOLUTION_MAP(void);
/*! INTERNAL ONLY - Use accessor function from above. */
FOUNDATION_EXPORT OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys_FIELD_DATE_RESOLUTION_MAP;
J2OBJC_STATIC_FIELD_OBJ_FINAL(OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys, FIELD_DATE_RESOLUTION_MAP, OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *)

/*!
 @brief Key used to set the FuzzyConfig used to create fuzzy queries.
 - seealso: StandardQueryParser#setFuzzyMinSim(float)
 - seealso: StandardQueryParser#setFuzzyPrefixLength(int)
 - seealso: StandardQueryParser#getFuzzyMinSim()
 - seealso: StandardQueryParser#getFuzzyPrefixLength()
 */
inline OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys_get_FUZZY_CONFIG(void);
/*! INTERNAL ONLY - Use accessor function from above. */
FOUNDATION_EXPORT OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys_FUZZY_CONFIG;
J2OBJC_STATIC_FIELD_OBJ_FINAL(OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys, FUZZY_CONFIG, OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *)

/*!
 @brief Key used to set default Resolution.
 - seealso: StandardQueryParser#setDateResolution(org.apache.lucene.document.DateTools.Resolution)
 - seealso: StandardQueryParser#getDateResolution()
 */
inline OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys_get_DATE_RESOLUTION(void);
/*! INTERNAL ONLY - Use accessor function from above. */
FOUNDATION_EXPORT OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys_DATE_RESOLUTION;
J2OBJC_STATIC_FIELD_OBJ_FINAL(OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys, DATE_RESOLUTION, OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *)

/*!
 @brief Key used to set the boost value in FieldConfig objects.
 - seealso: StandardQueryParser#setFieldsBoost(Map)
 - seealso: StandardQueryParser#getFieldsBoost()
 */
inline OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys_get_BOOST(void);
/*! INTERNAL ONLY - Use accessor function from above. */
FOUNDATION_EXPORT OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys_BOOST;
J2OBJC_STATIC_FIELD_OBJ_FINAL(OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys, BOOST, OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *)

/*!
 @brief Key used to set a field to its NumericConfig.
 - seealso: StandardQueryParser#setNumericConfigMap(Map)
 - seealso: StandardQueryParser#getNumericConfigMap()
 */
inline OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys_get_NUMERIC_CONFIG(void);
/*! INTERNAL ONLY - Use accessor function from above. */
FOUNDATION_EXPORT OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys_NUMERIC_CONFIG;
J2OBJC_STATIC_FIELD_OBJ_FINAL(OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys, NUMERIC_CONFIG, OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *)

/*!
 @brief Key used to set the NumericConfig in FieldConfig for numeric fields.
 - seealso: StandardQueryParser#setNumericConfigMap(Map)
 - seealso: StandardQueryParser#getNumericConfigMap()
 */
inline OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys_get_NUMERIC_CONFIG_MAP(void);
/*! INTERNAL ONLY - Use accessor function from above. */
FOUNDATION_EXPORT OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys_NUMERIC_CONFIG_MAP;
J2OBJC_STATIC_FIELD_OBJ_FINAL(OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys, NUMERIC_CONFIG_MAP, OrgApacheLuceneQueryparserFlexibleCoreConfigConfigurationKey *)

FOUNDATION_EXPORT void OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys_init(OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys *self);

FOUNDATION_EXPORT OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys *new_OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys_init(void) NS_RETURNS_RETAINED;

FOUNDATION_EXPORT OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys *create_OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys_init(void);

J2OBJC_TYPE_LITERAL_HEADER(OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_ConfigurationKeys)

#endif

#if !defined (OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_Operator_) && (INCLUDE_ALL_OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler || defined(INCLUDE_OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_Operator))
#define OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_Operator_

#define RESTRICT_JavaLangEnum 1
#define INCLUDE_JavaLangEnum 1
#include "java/lang/Enum.h"

@class IOSObjectArray;

typedef NS_ENUM(NSUInteger, OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_Operator_Enum) {
  OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_Operator_Enum_AND = 0,
  OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_Operator_Enum_OR = 1,
};

/*!
 @brief Boolean Operator: AND or OR
 */
@interface OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_Operator : JavaLangEnum

@property (readonly, class, nonnull) OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_Operator *AND NS_SWIFT_NAME(AND);
@property (readonly, class, nonnull) OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_Operator *OR NS_SWIFT_NAME(OR);
#pragma mark Public

+ (OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_Operator *)valueOfWithNSString:(NSString *)name;

+ (IOSObjectArray *)values;

#pragma mark Package-Private

- (OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_Operator_Enum)toNSEnum;

@end

J2OBJC_STATIC_INIT(OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_Operator)

/*! INTERNAL ONLY - Use enum accessors declared below. */
FOUNDATION_EXPORT OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_Operator *OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_Operator_values_[];

inline OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_Operator *OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_Operator_get_AND(void);
J2OBJC_ENUM_CONSTANT(OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_Operator, AND)

inline OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_Operator *OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_Operator_get_OR(void);
J2OBJC_ENUM_CONSTANT(OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_Operator, OR)

FOUNDATION_EXPORT IOSObjectArray *OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_Operator_values(void);

FOUNDATION_EXPORT OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_Operator *OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_Operator_valueOfWithNSString_(NSString *name);

FOUNDATION_EXPORT OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_Operator *OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_Operator_fromOrdinal(NSUInteger ordinal);

J2OBJC_TYPE_LITERAL_HEADER(OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler_Operator)

#endif

#if __has_feature(nullability)
#pragma clang diagnostic pop
#endif
#pragma pop_macro("INCLUDE_ALL_OrgApacheLuceneQueryparserFlexibleStandardConfigStandardQueryConfigHandler")


text:
setupdict= {
    'name': 'txAMQP',
    'version': '0.6.2',
    'author': 'Esteve Fernandez',
    'author_email': 'esteve@fluidinfo.com',
    'url': 'https://launchpad.net/txamqp',
    'description': 'Python library for communicating with AMQP peers and brokers using Twisted',
    'long_description': '''This project contains all the necessary code to connect, send and receive messages to/from an AMQP-compliant peer or broker (Qpid, OpenAMQ, RabbitMQ) using Twisted.

It also includes support for using Thrift RPC over AMQP in Twisted applications.

txAMQP is sponsored by the friendly folks at Fluidinfo (http://www.fluidinfo.com).'''
    }

try:
    from setuptools import setup, find_packages
except ImportError:
    from distutils.core import setup
    setupdict['packages'] = ['txamqp', 'txamqp.contrib', 'txamqp.contrib.thrift']
    setupdict['package_dir'] = {
        'txamqp': 'src/txamqp',
        'txamqp.contrib': 'src/txamqp/contrib',
        'txamqp.contrib.thrift': 'src/txamqp/contrib/thrift',
    }
else:
    setupdict['packages'] = find_packages('src')
    setupdict['package_dir'] = { '': 'src' }
    setupdict['install_requires'] = ['Twisted']

setup(**setupdict)


text:
package org.hoteia.qalingo.core.solr.bean;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import org.apache.solr.client.solrj.beans.Field;

public class CatalogCategorySolr {

    @Field
	private Long id;

    @Field
    private String name;

    @Field
	private String description;

    @Field
	private Boolean isDefault;

    @Field
	private Boolean isMaster;

    @Field
	private String code;

    @Field
    private Set<CatalogCategorySolr> catalogCategories = new HashSet<CatalogCategorySolr>();

    @Field
    private Set<ProductSkuSolr> productMarketings = new HashSet<ProductSkuSolr>();

    @Field
    private String random;

    @Field("datecreate")
    private Date dateCreate;

    @Field("dateupdate")
    private Date dateUpdate;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
        return name;
    }

	public void setName(String name) {
        this.name = name;
    }

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Boolean getIsDefault() {
		return isDefault;
	}

	public void setIsDefault(Boolean isDefault) {
		this.isDefault = isDefault;
	}

	public Boolean getIsMaster() {
		return isMaster;
	}

	public void setIsMaster(Boolean isMaster) {
		this.isMaster = isMaster;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public Set<CatalogCategorySolr> getCatalogCategories() {
		return catalogCategories;
	}

	public void setCatalogCategories(Set<CatalogCategorySolr> catalogCategories) {
		this.catalogCategories = catalogCategories;
	}

	public Set<ProductSkuSolr> getProductMarketings() {
		return productMarketings;
	}

	public void setProductMarketings(Set<ProductSkuSolr> productMarketings) {
		this.productMarketings = productMarketings;
	}

	public String getRandom() {
        return random;
    }

	public void setRandom(String random) {
        this.random = random;
    }

	public Date getDateCreate() {
		return dateCreate;
	}

	public void setDateCreate(Date dateCreate) {
		this.dateCreate = dateCreate;
	}

	public Date getDateUpdate() {
		return dateUpdate;
	}

	public void setDateUpdate(Date dateUpdate) {
		this.dateUpdate = dateUpdate;
	}

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((code == null) ? 0 : code.hashCode());
        result = prime * result + ((id == null) ? 0 : id.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        CatalogCategorySolr other = (CatalogCategorySolr) obj;
        if (code == null) {
            if (other.code != null)
                return false;
        } else if (!code.equals(other.code))
            return false;
        if (id == null) {
            if (other.id != null)
                return false;
        } else if (!id.equals(other.id))
            return false;
        return true;
    }

    @Override
    public String toString() {
        return "CatalogCategorySolr [id=" + id + ", name=" + name + ", description=" + description + ", isDefault=" + isDefault + ", isMaster=" + isMaster + ", code=" + code + ", catalogCategories="
                + catalogCategories + ", productMarketings=" + productMarketings + ", dateCreate=" + dateCreate + ", dateUpdate=" + dateUpdate + "]";
    }

}


text:
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_cpu_mgmt_class
from units.modules.utils import set_module_args
from .nvos_module import TestNvosModule

class TestCpuMgmtClassModule(TestNvosModule):

    module = pn_cpu_mgmt_class

    def setUp(self):
        self.mock_run_nvos_commands = patch('ansible.modules.network.netvisor.pn_cpu_mgmt_class.run_cli')
        self.run_nvos_commands = self.mock_run_nvos_commands.start()

    def tearDown(self):
        self.mock_run_nvos_commands.stop()

    def run_cli_patch(self, module, cli, state_map):
        if state_map['update'] == 'cpu-mgmt-class-modify':
            results = dict(
                changed=True,
                cli_cmd=cli
            )
        module.exit_json(**results)

    def load_fixtures(self, commands=None, state=None, transport='cli'):
        self.run_nvos_commands.side_effect = self.run_cli_patch

    def test_cpu_mgmt_class_modify_t1(self):
        set_module_args({'pn_cliswitch': 'sw01', 'pn_name': 'icmp',
                         'pn_rate_limit': '10000', 'pn_burst_size': '14000', 'state': 'update'})
        result = self.execute_module(changed=True, state='update')
        expected_cmd = ' switch sw01 cpu-mgmt-class-modify name icmp  burst-size 14000 rate-limit 10000'
        self.assertEqual(result['cli_cmd'], expected_cmd)

    def test_cpu_mgmt_class_modify_t2(self):
        set_module_args({'pn_cliswitch': 'sw01', 'pn_name': 'ssh',
                         'pn_rate_limit': '10000', 'pn_burst_size': '100000', 'state': 'update'})
        result = self.execute_module(changed=True, state='update')
        expected_cmd = ' switch sw01 cpu-mgmt-class-modify name ssh  burst-size 100000 rate-limit 10000'
        self.assertEqual(result['cli_cmd'], expected_cmd)


text:
<?php

namespace App\Http\Controllers\Admin;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class AdminsController extends Controller
{
    public function updatePassword(Request $request)
    {
        $this->validate($request, [
            'old_password' => 'required',
            'new_password' => 'required|min:6|max:32',
            'confirm_password' => 'required',
        ], [
            'old_password.required' => '旧密码不能为空',
            'new_password.required' => '新密码不能为空',
            'new_password.min' => '新密码至少要6位',
            'confirm_password.required' => '确认密码不能为空',
        ]);

        $user = auth()->user();

        if(! \Hash::check($request->get('old_password'), $user->password)) {
            return response()->json(['old_password' => '旧密码错误']);
        }

        $user->password = bcrypt($request->get('new_password'));
        $user->save();

        return response()->json(['status' => 'OK']);
    }
}


text:
import declare from 'dojo/_base/declare';
import lang from 'dojo/_base/lang';
import format from 'crm/Format';
import Detail from 'argos/Detail';
import MODEL_NAMES from '../../Models/Names';
import utility from '../../Utility';
import getResource from 'argos/I18n';

const resource = getResource('erpInvoicesDetail');

const __class = declare('crm.Integrations.BOE.Views.ERPInvoices.Detail', [Detail], {
  // Localization
  titleText: resource.titleText,
  accountText: resource.accountText,
  statusText: resource.statusText,
  ownerText: resource.ownerText,
  termsText: resource.termsText,
  statusDateText: resource.statusDateText,
  unknownText: resource.unknownText,
  descriptionText: resource.descriptionText,
  invoiceNumberText: resource.invoiceNumberText,
  extendedBaseAmountText: resource.extendedBaseAmountText,
  extendedAmountText: resource.extendedAmountText,
  totalBaseAmountText: resource.totalBaseAmountText,
  totalAmountText: resource.totalAmountText,
  nameText: resource.nameText,
  mainPhoneText: resource.mainPhoneText,
  addressText: resource.addressText,
  actionsText: resource.actionsText,
  relatedItemsText: resource.relatedItemsText,
  invoiceItemsText: resource.invoiceItemsText,
  receivablesText: resource.receivablesText,
  billToText: resource.billToText,
  shipToText: resource.shipToText,
  salesPersonsText: resource.salesPersonsText,
  entityText: resource.entityText,
  documentDateText: resource.documentDateText,

  // View Properties
  id: 'invoice_detail',
  modelName: MODEL_NAMES.ERPINVOICE,
  resourceKind: 'erpInvoices',
  enableOffline: true,

  callMainPhone: function callMainPhone() {
    this.recordCallToHistory(lang.hitch(this, function initiateCall() {
      App.initiateCall(this.entry.MainPhone);
    }));
  },
  formatPicklist: function formatPicklist(property) {
    return format.picklist(this.app.picklistService, this._model, property);
  },
  createLayout: function createLayout() {
    return this.layout || (this.layout = [{
      title: this.actionsText,
      list: true,
      cls: 'action-list',
      name: 'QuickActionsSection',
      children: [],
    }, {
      title: this.detailsText,
      name: 'DetailsSection',
      children: [{
        name: 'InvoiceNumber',
        property: 'InvoiceNumber',
        label: this.invoiceNumberText,
      }, {
        name: 'AccountName',
        property: 'Account.AccountName',
        label: this.accountText,
        descriptor: 'AccountName',
        view: 'account_detail',
        key: 'Account.$key',
      }, {
        name: 'Description',
        property: 'Description',
        label: this.descriptionText,
      }, {
        label: this.extendedBaseAmountText,
        name: 'ErpExtendedBaseAmount',
        property: 'ErpExtendedBaseAmount',
        renderer: (value) => {
          return utility.formatMultiCurrency(value, this.entry.BaseCurrencyCode);
        },
      }, {
        label: this.extendedAmountText,
        name: 'ErpExtendedAmount',
        property: 'ErpExtendedAmount',
        renderer: (value) => {
          return utility.formatMultiCurrency(value, this.entry.CurrencyCode);
        },
      }, {
        label: this.totalBaseAmountText,
        name: 'ErpTotalBaseAmount',
        property: 'ErpTotalBaseAmount',
        renderer: (value) => {
          return utility.formatMultiCurrency(value, this.entry.BaseCurrencyCode);
        },
      }, {
        label: this.totalAmountText,
        name: 'GrandTotal',
        property: 'GrandTotal',
        renderer: (value) => {
          return utility.formatMultiCurrency(value, this.entry.CurrencyCode);
        },
      }, {
        name: 'ErpStatus',
        property: 'ErpStatus',
        label: this.statusText,
        renderer: this.formatPicklist('ErpStatus'),
      }, {
        name: 'ErpStatusDate',
        property: 'ErpStatusDate',
        label: this.statusDateText,
        renderer: format.date.bindDelegate(this, null, true),
      }, {
        name: 'ErpDocumentDate',
        property: 'ErpDocumentDate',
        label: this.documentDateText,
        renderer: function renderer(data) {
          return format.date(data);
        },
      }, {
        name: 'ErpPaymentTermId',
        property: 'ErpPaymentTermId',
        label: this.termsText,
      }],
    }, {
      title: this.billToText,
      name: 'BillToSection',
      children: [{
        name: 'BillToName',
        property: 'ErpBillTo.Name',
        label: this.nameText,
        view: 'erpbillto_detail',
        key: 'ErpBillTo.$key',
      }, {
        name: 'BillToMainPhone',
        property: 'ErpBillTo.MainPhone',
        label: this.mainPhoneText,
      }, {
        name: 'BillToAddress',
        property: 'ErpBillTo.Address',
        label: this.addressText,
        renderer: (val) => {
          if (val) {
            return format.address(val);
          }
        },
      }],
    }, {
      title: this.shipToText,
      name: 'ShipSection',
      children: [{
        name: 'ShipToName',
        property: 'ErpShipTo.Name',
        label: this.nameText,
        view: 'erpshipto_detail',
        key: 'ErpShipTo.$key',
      }, {
        name: 'ShipToMainPhone',
        property: 'ErpShipTo.MainPhone',
        label: this.mainPhoneText,
      }, {
        name: 'ShipToAddress',
        property: 'ErpShipTo.Address',
        label: this.addressText,
        renderer: (val) => {
          if (val) {
            return format.address(val);
          }
        },
      }],
    }, {
      title: this.relatedItemsText,
      list: true,
      name: 'RelatedItemsSection',
      children: [{
        name: 'ERPInvoiceItemsRelated',
        label: this.invoiceItemsText,
        where: this.formatRelatedQuery.bindDelegate(this, 'ErpInvoice.Id eq "${0}"'),
        view: 'invoice_items_related',
      }, {
        name: 'ERPReceivable',
        label: this.receivablesText,
        where: this.formatRelatedQuery.bindDelegate(this, 'ErpInvoice.Id eq "${0}"'),
        view: 'invoice_receivables_related',
      },
      ],
    }]);
  },
});

lang.setObject('icboe.Views.ERPInvoices.Detail', __class);
export default __class;


text:
from anillo.http import responses
from werkzeug.debug.tbtools import get_current_traceback

def wrap_exception_handler(render_function=None, content_type="text/html"):
    if render_function is None:
        render_function = lambda tb: tb.render_full()

    def middleware(func):
        def wrapper(request, *args, **kwargs):
            try:
                response = func(request, *args, **kwargs)
            except Exception:
                tb = get_current_traceback()
                return responses.InternalServerError(render_function(tb), headers={"Content-type": content_type})

            return response
        return wrapper
    return middleware


text:
Executing arbitrary expressions like enabled by the expression parser of
mathjs involves a risk in general. When you're using mathjs to let users
execute arbitrary expressions, it's good to take a moment to think about
possible security and stability implications, especially when running
the code server side.

## Security risks

A user could try to inject malicious JavaScript code via the expression
parser. The expression parser of mathjs offers a sandboxed environment
to execute expressions which should make this impossible. It's possible
though that there is an unknown security hole, so it's important to be
careful, especially when allowing server side execution of arbitrary
expressions.

The expression parser of mathjs parses the input in a controlled
way into an expression tree, then compiles it into fast performing
JavaScript using JavaScript's `eval` before actually evaluating the
expression. The parser actively prevents access to JavaScripts internal
`eval` and `new Function` which are the main cause of security attacks.

When running a node.js server, it's good to be aware of the different
types of security risks. The risk whe running inside a browser may be
limited though it's good to be aware of [Cross side scripting (XSS)](https://www.wikiwand.com/en/Cross-site_scripting) vulnerabilities. A nice overview of
security risks of a node.js servers is listed in an article [Node.js security checklist](https://blog.risingstack.com/node-js-security-checklist/) by Gergely Nemeth.

### Less vulnerable expression parser

There is a small number of functions which yield the biggest security
risk in the expression parser:

- `import` and `createUnit` which alter the built-in functionality and
  allow overriding existing functions and units.
- `eval`, `parse`, `simplify`, and `derivative` which parse arbitrary
  input into a manipulable expression tree.

To make the expression parser less vulnerable whilst still supporting
most functionality, these functions can be disabled:

```js
var math = require('mathjs');
var limitedEval = math.eval;

math.import({
  'import':     function () { throw new Error('Function import is disabled') },
  'createUnit': function () { throw new Error('Function createUnit is disabled') },
  'eval':       function () { throw new Error('Function eval is disabled') },
  'parse':      function () { throw new Error('Function parse is disabled') },
  'simplify':   function () { throw new Error('Function simplify is disabled') },
  'derivative': function () { throw new Error('Function derivative is disabled') }
}, {override: true});

console.log(limitedEval('sqrt(16)'));     // Ok, 4
console.log(limitedEval('parse("2+3")')); // Error: Function parse is disabled
```

### Found a security vulnerability? Please report in private!

You found a security vulnerability? Awesome! We hope you don't have bad
intentions and want to help fix the issue. Please report the
vulnerability in a private way by contacting one of the maintainers
via mail or an other private channel. That way we can work together
on a fix before sharing the issue with everybody including the bad guys.

## Stability risks

A user could accidentally or on purpose execute a
heavy expression like creating a huge matrix. That can let the
JavaScript engine run out of memory or freeze it when the CPU goes
to 100% for a long time.

To protect against this sort of issue, one can run the expression parser
in a separate Web Worker or child_process, so it can't affect the
main process. The workers can be killed when it runs for too
long or consumes too much memory. A useful library in this regard
is [workerpool](https://github.com/josdejong/workerpool), which makes
it easy to manage a pool of workers in both browser and node.js.