text:
{-# LANGUAGE GADTs, LambdaCase, OverloadedStrings, ScopedTypeVariables,
 TemplateHaskell #-}
module Web.Slack.Types.Event  where

import Web.Slack.Types.Channel
import Web.Slack.Types.Bot
import Web.Slack.Types.Base
import Web.Slack.Types.User
import Web.Slack.Types.File
import Web.Slack.Types.IM
import Web.Slack.Types.Id
import Web.Slack.Types.Item
import Web.Slack.Types.Comment
import Web.Slack.Types.Error
import Web.Slack.Types.Event.Subtype
import Web.Slack.Types.Group
import Web.Slack.Types.Time
import Web.Slack.Types.Presence

import Data.Aeson
import Data.Aeson.Types

import Control.Lens.TH
import Control.Applicative
import Data.Text (Text)
import qualified Data.Text as T
import Data.Monoid
import Prelude

type Domain = Text

data Event where
  Hello :: Event
  Message :: ChannelId -> Submitter -> Text -> SlackTimeStamp -> Maybe Subtype -> Maybe Edited -> Event
  HiddenMessage :: ChannelId -> Submitter -> SlackTimeStamp -> Maybe Subtype -> Event
  ChannelMarked :: ChannelId -> SlackTimeStamp -> Event
  ChannelCreated :: Channel -> Event
  ChannelJoined :: Channel -> Event
  ChannelLeft   :: Channel -> Event
  ChannelDeleted :: ChannelId -> Event
  ChannelRename :: ChannelRenameInfo -> Event
  ChannelArchive :: ChannelId -> UserId -> Event
  ChannelUnarchive :: ChannelId -> UserId -> Event
  ChannelHistoryChanged :: SlackTimeStamp -> SlackTimeStamp -> SlackTimeStamp -> Event
  ImCreated :: UserId -> IM -> Event
  ImOpen :: UserId -> IMId -> Event
  ImClose :: UserId -> IMId -> Event
  ImMarked :: IMId -> SlackTimeStamp -> Event
  ImHistoryChanged :: SlackTimeStamp -> SlackTimeStamp -> SlackTimeStamp -> Event
  GroupJoined :: Group -> Event
  GroupLeft :: Group -> Event
  GroupOpen :: UserId -> GroupId -> Event
  GroupClose :: UserId -> GroupId -> Event
  GroupArchive :: GroupId -> Event
  GroupUnarchive :: GroupId -> Event
  GroupRename :: ChannelRenameInfo -> Event
  GroupMarked :: GroupId -> SlackTimeStamp -> Event
  GroupHistoryChanged :: SlackTimeStamp -> SlackTimeStamp -> SlackTimeStamp -> Event
  FileCreated :: File -> Event
  FileShared :: File -> Event
  FileUnshared :: File -> Event
  FilePublic :: File -> Event
  FilePrivate :: FileId -> Event
  FileChange  :: File -> Event
  FileDeleted :: FileId -> SlackTimeStamp -> Event
  FileCommentAdded :: File -> Comment -> Event
  FileCommentEdited :: File -> Comment -> Event
  FileCommentDeleted :: File -> CommentId -> Event
  PresenceChange :: UserId -> Presence -> Event
  ManualPresenceChange :: Presence -> Event
  PrefChange :: Pref -> Event
  UserChange :: User -> Event
  TeamJoin :: User -> Event
  ReactionAdded :: UserId -> Maybe Text -> Item -> SlackTimeStamp -> Event
  ReactionRemoved :: UserId -> Maybe Text -> Item -> SlackTimeStamp -> Event
  StarAdded :: UserId -> Item -> SlackTimeStamp -> Event
  StarRemoved :: UserId -> Item -> SlackTimeStamp -> Event
  EmojiChanged :: SlackTimeStamp -> Event
  CommandsChanged :: SlackTimeStamp -> Event
  TeamPrefChange :: Pref -> Event
  TeamRenameEvent :: Text -> Event
  TeamDomainChange :: URL -> Domain -> Event
  EmailDomainChange :: Domain -> SlackTimeStamp -> Event
  BotChanged :: Bot -> Event
  BotAdded :: Bot -> Event
  AccountsChanged :: Event
  UserTyping :: ChannelId -> UserId -> Event
  MessageResponse :: Int -> SlackTimeStamp -> Text -> Event
  MessageError :: Int -> SlackError -> Event
  StatusChange :: UserId -> Text -> SlackTimeStamp -> Event
  Pong :: Time -> Event
  ReconnectUrl :: URL -> Event
  TeamMigrationStarted :: Event
  -- Unstable
  PinAdded :: Event
  PinRemoved :: Event
  NoEvent :: Event
  -- Parsing failing of an event
  UnknownEvent :: Value -> Event
  deriving (Show)

type Pref = (Text, Value)

instance FromJSON Event where
  parseJSON o@(Object v) = do
    (typ :: Maybe Text) <- v .:? "type"
    case typ of
      Just t -> parseType o t
      Nothing -> do
        (ok :: Bool) <- v .: "ok"
        if ok
          then MessageResponse <$> v .: "reply_to" <*> v .: "ts" <*> v .: "text"
          else MessageError <$> v .: "reply_to" <*> v .: "error"
  parseJSON Null = return NoEvent
  parseJSON _ = error "Expecting object: Event"

parseType :: Value -> Text -> Parser Event
parseType o@(Object v) typ =
    case typ of
      "hello" -> return Hello

      "message" -> do
        subt <- (\case
                  Nothing -> return Nothing
                  Just r  -> Just <$> subtype r o) =<< v .:? "subtype"
        submitter <- case subt of
                      Just (SBotMessage bid _ _) -> return $ BotComment bid
                      _ -> maybe System UserComment <$> v .:? "user"
        (v .: "channel") :: Parser ChannelId
        hidden <- (\case {Just True -> True; _ -> False}) <$> v .:? "hidden"
        if not hidden
          then Message <$>  v .: "channel" <*> pure submitter  <*> v .: "text" <*> v .: "ts" <*> pure subt <*> v .:? "edited"
          else HiddenMessage <$>  v .: "channel" <*> pure submitter  <*> v .: "ts" <*> pure subt
      "user_typing" -> UserTyping <$> v .: "channel" <*> v .: "user"
      "presence_change" -> PresenceChange <$> v .: "user" <*> v .: "presence"
      "channel_marked"  -> ChannelMarked <$> v .: "channel" <*> v .: "ts"
      "channel_created" -> ChannelCreated <$> v .: "channel"
      "channel_joined"  -> ChannelJoined <$> v .: "channel"
      "channel_left"    -> ChannelLeft <$> v .: "channel"
      "channel_deleted" -> ChannelDeleted <$> v .: "channel"
      "channel_rename"  -> ChannelRename <$> v .: "channel"
      "channel_archive" -> ChannelArchive <$> v .: "channel" <*> v .: "user"
      "channel_unarchive" -> ChannelUnarchive <$> v .: "channel" <*> v .: "user"
      "channel_history_changed" -> ChannelHistoryChanged <$> v .: "latest" <*> v .: "ts" <*> v .: "event_ts"
      "im_open"     -> ImOpen <$> v .: "user" <*> v .: "channel"
      "im_created" -> ImCreated <$> v .: "user" <*> v .: "channel"
      "im_close" -> ImClose <$> v .: "user" <*> v .: "channel"
      "im_marked" -> ImMarked <$> v .: "channel" <*> v .: "ts"
      "im_history_changed" -> ImHistoryChanged <$> v .: "latest" <*> v .: "ts" <*> v .: "event_ts"
      "group_joined" -> GroupJoined <$> v .: "channel"
      "group_left" ->  GroupLeft <$> v  .: "channel"
      "group_open" ->  GroupOpen <$> v .: "user" <*> v .: "channel"
      "group_close" -> GroupClose <$> v .: "user" <*> v .: "channel"
      "group_archive" -> GroupArchive <$> v .: "channel"
      "group_unarchive" -> GroupUnarchive <$> v .: "channel"
      "group_rename" -> GroupRename <$> v .: "channel"
      "group_marked" -> GroupMarked <$> v .: "channel" <*> v .: "ts"
      "group_history_changed" -> GroupHistoryChanged <$> v .: "latest" <*> v .: "ts" <*> v .: "event_ts"
      "file_created" -> FileCreated <$> v .: "file"
      "file_shared"  -> FileShared <$> v .: "file"
      "file_unshared" -> FileUnshared <$> v .: "file"
      "file_public"  -> FilePublic <$> v .: "file"
      "file_private" -> FilePrivate <$> v .: "file"
      "file_change"  -> FileChange <$> v .: "file"
      "file_deleted"  -> FileDeleted <$> v .: "file_id" <*> v .: "event_ts"
      "file_comment_added" -> FileCommentAdded <$> v .: "file" <*> v .: "comment"
      "file_comment_edited" -> FileCommentEdited <$> v .: "file" <*> v .: "comment"
      "file_comment_deleted" -> FileCommentDeleted <$> v .: "file" <*> v .: "comment"
      "manual_presence_change" -> ManualPresenceChange <$> v .: "presence"
      "pref_change" -> curry PrefChange <$> v .: "name" <*> v .: "value"
      "user_change" -> UserChange <$> v .: "user"
      "team_join"   -> TeamJoin <$> v .: "user"
      "reaction_added" -> ReactionAdded <$> v .: "user" <*> v .:? "name" <*> v .: "item" <*> v .: "event_ts"
      "reaction_removed" -> ReactionRemoved <$> v .: "user" <*> v .:? "name" <*> v .: "item" <*> v .: "event_ts"
      "star_added" ->  StarAdded <$> v .: "user" <*> v .: "item" <*> v .: "event_ts"
      "star_removed" -> StarRemoved <$> v .: "user" <*> v .: "item" <*> v .: "event_ts"
      "emoji_changed" -> EmojiChanged <$> v .: "event_ts"
      "commands_changed" -> CommandsChanged <$> v .: "event_ts"
      "team_pref_change" -> curry TeamPrefChange <$> v .: "name" <*> v .: "value"
      "team_rename" -> TeamRenameEvent <$> v .: "name"
      "team_domain_change" -> TeamDomainChange <$> v .: "url" <*> v .: "domain"
      "email_domain_changed" -> EmailDomainChange <$> v .: "email_domain" <*> v .: "event_ts"
      "bot_added" -> BotAdded <$> v .:  "bot"
      "bot_changed" -> BotChanged <$> v .: "bot"
      "accounts_changed" -> pure AccountsChanged
      "status_change" -> StatusChange <$> v .: "user" <*> v .: "status" <*> v .: "event_ts"
      "pong" -> Pong <$> v .: "timestamp"
      "reconnect_url" -> ReconnectUrl <$> v .: "url"
      "team_migration_started" -> pure TeamMigrationStarted
      "pin_added" -> pure PinAdded
      "pin_removed" -> pure PinRemoved
      _ -> return $ UnknownEvent o
parseType _ _ = error "Expecting object"

data Submitter = UserComment UserId | BotComment BotId | System deriving (Show, Eq)

data ChannelRenameInfo = ChannelRenameInfo
                       { _channelRenameId      :: ChannelId
                       , _channelRenameName    :: Text
                       , _channelRenameCreated :: Time } deriving Show

makeLenses ''ChannelRenameInfo

instance FromJSON ChannelRenameInfo where
  parseJSON = withObject "ChannelRenameInfo" (\o -> ChannelRenameInfo <$> o .: "id" <*> o .: "name" <*> o .: "created")

makePrisms ''Event


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Web;

namespace WebServer
{
    /// <summary>
    /// Summary description for Deflate
    /// </summary>
    public class Deflate : IHttpHandler
    {
        public void ProcessRequest(HttpContext context)
        {
            string responseBody = "Sending DEFLATE compressed";

            context.Response.Headers.Add("Content-MD5", Convert.ToBase64String(ContentHelper.ComputeMD5Hash(responseBody)));
            context.Response.Headers.Add("Content-Encoding", "deflate");

            context.Response.ContentType = "text/plain";

            byte[] bytes = ContentHelper.GetDeflateBytes(responseBody);
            context.Response.BinaryWrite(bytes);
        }

        public bool IsReusable
        {
            get
            {
                return true;
            }
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
define([
  'backbone',
  'marionette',
  'app/modules/Activity/views/ActivityTree',
  "text!templates/devTools/activity/action.html"
], function(Backbone, Marionette, ActivityTree, tpl) {

  var Action = Backbone.Marionette.LayoutView.extend({

    template: tpl,

    regions: {
      eventTree: '[data-event-tree]'
    },

    ui: {
      toggleBtn: '[data-action="toggle"]'
    },

    events: {
      'click @ui.toggleBtn': 'onClickToggle'
    },

    onClickToggle: function() {
      // only get the events for the first click
      this.model.eventsRoot = this.model.eventsRoot || this.model.getEvents();

      // render ActivityTree view for the first click
      if (!this.getRegion('eventTree').hasView()) {
        this.getRegion('eventTree').show(new ActivityTree({
          model: this.model.eventsRoot
        }));
      }

      this.model.isCollapsed = !this.model.isCollapsed;
      this.toggleNode();
      return false;
    },

    className: function() {
      var collapsedClass = this.model.isCollapsed ? 'is-collapsed' : 'is-expanded';
      return collapsedClass;
    },

    toggleNode: function() {
      this.$el.attr('class', this.className());
      this.$el.children('li').find('.toggle-caret').attr('class', 'toggle-caret glyphicon '+this.chevronClass());
    },

    onRender: function() {
      this.$el.attr('class', this.className());
    },

    serializeData: function() {
      var data = Backbone.Marionette.ItemView.prototype.serializeData.apply(this, this.model);
      data.collapseClass = this.chevronClass();
      return data;
    },

    chevronClass: function() {
      return this.model.isCollapsed ? 'glyphicon-chevron-up' : 'glyphicon-chevron-down'
    }
  });

  return Action;
});


text:
package org.apache.camel.support;

import java.net.URI;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Supplier;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;

import org.apache.camel.AfterPropertiesConfigured;
import org.apache.camel.CamelContext;
import org.apache.camel.CamelContextAware;
import org.apache.camel.Component;
import org.apache.camel.Endpoint;
import org.apache.camel.ExtendedCamelContext;
import org.apache.camel.ResolveEndpointFailedException;
import org.apache.camel.component.extension.ComponentExtension;
import org.apache.camel.spi.Metadata;
import org.apache.camel.spi.PropertyConfigurer;
import org.apache.camel.spi.PropertyConfigurerAware;
import org.apache.camel.support.service.ServiceSupport;
import org.apache.camel.util.ObjectHelper;
import org.apache.camel.util.PropertiesHelper;
import org.apache.camel.util.StringHelper;
import org.apache.camel.util.URISupport;
import org.apache.camel.util.UnsafeUriCharactersEncoder;
import org.apache.camel.util.function.Suppliers;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Default component to use for base for components implementations.
 */
public abstract class DefaultComponent extends ServiceSupport implements Component {

    private static final Logger LOG = LoggerFactory.getLogger(DefaultComponent.class);

    /**
     * Simple RAW() pattern used only for validating URI in this class
     */
    private static final Pattern RAW_PATTERN = Pattern.compile("RAW[({].*&&.*[)}]");

    private volatile PropertyConfigurer componentPropertyConfigurer;
    private volatile PropertyConfigurer endpointPropertyConfigurer;
    private volatile String defaultName;
    private final List<Supplier<ComponentExtension>> extensions = new ArrayList<>();
    private CamelContext camelContext;

    @Metadata(label = "advanced", defaultValue = "true",
              description = "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired)"
                            + " by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component."
                            + " This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.")
    private boolean autowiredEnabled = true;
    @Metadata(label = "consumer",
              description = "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while"
                            + " the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler."
                            + " By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.")
    private boolean bridgeErrorHandler;
    @Metadata(label = "producer",
              description = "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup"
                            + " in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then"
                            + " the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed"
                            + " then creating and starting the producer may take a little time and prolong the total processing time of the processing.")
    private boolean lazyStartProducer;

    public DefaultComponent() {
    }

    public DefaultComponent(CamelContext context) {
        this.camelContext = context;
    }

    @Override
    public Endpoint createEndpoint(String uri, Map<String, Object> properties) throws Exception {
        // need to encode before its safe to parse with java.net.Uri
        String encodedUri = UnsafeUriCharactersEncoder.encode(uri);
        URI u = new URI(encodedUri);
        String path;
        if (u.getScheme() != null) {
            // if there is a scheme then there is also a path
            path = URISupport.extractRemainderPath(u, useRawUri());
        } else {
            // this uri has no context-path as the leading text is the component name (scheme)
            path = null;
        }

        // use encoded or raw uri?
        Map<String, Object> parameters;
        if (useRawUri()) {
            // when using raw uri then the query is taking from the uri as is
            String query;
            int idx = uri.indexOf('?');
            if (idx > -1) {
                query = uri.substring(idx + 1);
            } else {
                query = u.getRawQuery();
            }
            // and use method parseQuery
            parameters = URISupport.parseQuery(query, true);
        } else {
            // however when using the encoded (default mode) uri then the query,
            // is taken from the URI (ensures values is URI encoded)
            // and use method parseParameters
            parameters = URISupport.parseParameters(u);
        }
        if (properties != null) {
            parameters.putAll(properties);
        }
        // This special property is only to identify endpoints in a unique manner
        parameters.remove("hash");

        if (resolveRawParameterValues()) {
            // parameters using raw syntax: RAW(value)
            // should have the token removed, so its only the value we have in parameters, as we are about to create
            // an endpoint and want to have the parameter values without the RAW tokens
            URISupport.resolveRawParameterValues(parameters);
        }

        // use encoded or raw uri?
        uri = useRawUri() ? uri : encodedUri;

        validateURI(uri, path, parameters);
        if (LOG.isTraceEnabled()) {
            // at trace level its okay to have parameters logged, that may contain passwords
            LOG.trace("Creating endpoint uri=[{}], path=[{}], parameters=[{}]", URISupport.sanitizeUri(uri),
                    URISupport.sanitizePath(path), parameters);
        } else if (LOG.isDebugEnabled()) {
            // but at debug level only output sanitized uris
            LOG.debug("Creating endpoint uri=[{}], path=[{}]", URISupport.sanitizeUri(uri), URISupport.sanitizePath(path));
        }

        boolean bridge = bridgeErrorHandler || getCamelContext().getGlobalEndpointConfiguration().isBridgeErrorHandler();
        Boolean bool = getAndRemoveParameter(parameters, "bridgeErrorHandler", Boolean.class);
        if (bool != null) {
            bridge = bool;
        }
        boolean lazy = lazyStartProducer || getCamelContext().getGlobalEndpointConfiguration().isLazyStartProducer();
        bool = getAndRemoveParameter(parameters, "lazyStartProducer", Boolean.class);
        if (bool != null) {
            lazy = bool;
        }
        // camel context can turn off autowire globally unless there is a uri parameter
        boolean autowire = camelContext.isAutowiredEnabled()
                && (autowiredEnabled || getCamelContext().getGlobalEndpointConfiguration().isAutowiredEnabled());
        bool = getAndRemoveParameter(parameters, "autowiredEnabled", Boolean.class);
        if (bool != null) {
            autowire = bool;
        }

        // create endpoint
        Endpoint endpoint = createEndpoint(uri, path, parameters);
        if (endpoint == null) {
            return null;
        }
        // inject camel context
        endpoint.setCamelContext(getCamelContext());

        // and setup those global options afterwards
        if (endpoint instanceof DefaultEndpoint) {
            DefaultEndpoint de = (DefaultEndpoint) endpoint;
            de.setBridgeErrorHandler(bridge);
            de.setLazyStartProducer(lazy);
            de.setAutowiredEnabled(autowire);
        }

        // configure remainder of the parameters
        setProperties(endpoint, parameters);

        // if endpoint is strict (not lenient) and we have unknown parameters configured then
        // fail if there are parameters that could not be set, then they are probably misspell or not supported at all
        if (!endpoint.isLenientProperties()) {
            validateParameters(uri, parameters, null);
        }

        // allow custom configuration after properties has been configured
        if (endpoint instanceof AfterPropertiesConfigured) {
            ((AfterPropertiesConfigured) endpoint).afterPropertiesConfigured(getCamelContext());
        }

        afterConfiguration(uri, path, endpoint, parameters);
        return endpoint;
    }

    @Override
    public Endpoint createEndpoint(String uri) throws Exception {
        return createEndpoint(uri, null);
    }

    @Override
    public boolean useRawUri() {
        // should use encoded uri by default
        return false;
    }

    public boolean isLazyStartProducer() {
        return lazyStartProducer;
    }

    /**
     * Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow
     * CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause
     * the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled
     * during routing messages via Camel's routing error handlers. Beware that when the first message is processed then
     * creating and starting the producer may take a little time and prolong the total processing time of the
     * processing.
     */
    public void setLazyStartProducer(boolean lazyStartProducer) {
        this.lazyStartProducer = lazyStartProducer;
    }

    public boolean isBridgeErrorHandler() {
        return bridgeErrorHandler;
    }

    /**
     * Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the
     * consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by
     * the routing Error Handler.
     *

     * By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be
     * logged at WARN/ERROR level and ignored.
     */
    public void setBridgeErrorHandler(boolean bridgeErrorHandler) {
        this.bridgeErrorHandler = bridgeErrorHandler;
    }

    public boolean isAutowiredEnabled() {
        return autowiredEnabled;
    }

    /**
     * Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as
     * autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets
     * configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection
     * factories, AWS Clients, etc.
     */
    public void setAutowiredEnabled(boolean autowiredEnabled) {
        this.autowiredEnabled = autowiredEnabled;
    }

    /**
     * Strategy to do post configuration logic.
     *

     * Can be used to construct an URI based on the remaining parameters. For example the parameters that configures the
     * endpoint have been removed from the parameters which leaves only the additional parameters left.
     *
     * @param  uri        the uri
     * @param  remaining  the remaining part of the URI without the query parameters or component prefix
     * @param  endpoint   the created endpoint
     * @param  parameters the remaining parameters after the endpoint has been created and parsed the parameters
     * @throws Exception  can be thrown to indicate error creating the endpoint
     */
    protected void afterConfiguration(String uri, String remaining, Endpoint endpoint, Map<String, Object> parameters)
            throws Exception {
        // noop
    }

    /**
     * Strategy for validation of parameters, that was not able to be resolved to any endpoint options.
     *
     * @param  uri                            the uri
     * @param  parameters                     the parameters, an empty map if no parameters given
     * @param  optionPrefix                   optional prefix to filter the parameters for validation. Use <tt>null</tt>
     *                                        for validate all.
     * @throws ResolveEndpointFailedException should be thrown if the URI validation failed
     */
    protected void validateParameters(String uri, Map<String, Object> parameters, String optionPrefix) {
        if (parameters == null || parameters.isEmpty()) {
            return;
        }

        Map<String, Object> param = parameters;
        if (optionPrefix != null) {
            param = PropertiesHelper.extractProperties(parameters, optionPrefix);
        }

        if (param.size() > 0) {
            throw new ResolveEndpointFailedException(
                    uri, "There are " + param.size()
                         + " parameters that couldn't be set on the endpoint."
                         + " Check the uri if the parameters are spelt correctly and that they are properties of the endpoint."
                         + " Unknown parameters=[" + param + "]");
        }
    }

    /**
     * Strategy for validation of the uri when creating the endpoint.
     *
     * @param  uri                            the uri
     * @param  path                           the path - part after the scheme
     * @param  parameters                     the parameters, an empty map if no parameters given
     * @throws ResolveEndpointFailedException should be thrown if the URI validation failed
     */
    protected void validateURI(String uri, String path, Map<String, Object> parameters) {
        // check for uri containing double && markers without include by RAW
        if (uri.contains("&&")) {
            Matcher m = RAW_PATTERN.matcher(uri);
            // we should skip the RAW part
            if (!m.find()) {
                throw new ResolveEndpointFailedException(
                        uri, "Invalid uri syntax: Double && marker found. "
                             + "Check the uri and remove the duplicate & marker.");
            }
        }

        // if we have a trailing & then that is invalid as well
        if (uri.endsWith("&")) {
            throw new ResolveEndpointFailedException(
                    uri, "Invalid uri syntax: Trailing & marker found. "
                         + "Check the uri and remove the trailing & marker.");
        }
    }

    /**
     * Configure if the parameters using the RAW token syntax need to be resolved before being consumed by
     * {@link #createEndpoint(String, Map)}.
     *

     * As the parameters are used to create an endpoint, by default they should have the token removed so its only the
     * value we have in parameters however there are some cases where the endpoint may act as a proxy for another
     * endpoint and you need to preserve the values as they are.
     */
    protected boolean resolveRawParameterValues() {
        // should resolve raw parameters by default
        return true;
    }

    @Override
    public CamelContext getCamelContext() {
        return camelContext;
    }

    @Override
    public void setCamelContext(CamelContext context) {
        this.camelContext = context;
    }

    @Override
    public String getDefaultName() {
        return defaultName;
    }

    @Override
    protected void doBuild() throws Exception {
        if (defaultName == null) {
            org.apache.camel.spi.annotations.Component ann
                    = ObjectHelper.getAnnotation(this, org.apache.camel.spi.annotations.Component.class);
            if (ann != null) {
                defaultName = ann.value();
                // just grab first scheme name if the component has scheme alias (eg http,https)
                if (defaultName.contains(",")) {
                    defaultName = StringHelper.before(defaultName, ",");
                }
            }
        }
        if (defaultName != null) {
            final String componentConfigurerName = defaultName + "-component-configurer";
            componentPropertyConfigurer = getCamelContext().adapt(ExtendedCamelContext.class).getConfigurerResolver()
                    .resolvePropertyConfigurer(componentConfigurerName, getCamelContext());
            final String endpointConfigurerName = defaultName + "-endpoint-configurer";
            endpointPropertyConfigurer = getCamelContext().adapt(ExtendedCamelContext.class).getConfigurerResolver()
                    .resolvePropertyConfigurer(endpointConfigurerName, getCamelContext());
        }
    }

    @Override
    protected void doInit() throws Exception {
        ObjectHelper.notNull(getCamelContext(), "camelContext");
    }

    @Override
    protected void doStart() throws Exception {
        // noop
    }

    @Override
    protected void doStop() throws Exception {
        // noop
    }

    /**
     * A factory method allowing derived components to create a new endpoint from the given URI, remaining path and
     * optional parameters
     *
     * @param  uri        the full URI of the endpoint
     * @param  remaining  the remaining part of the URI without the query parameters or component prefix
     * @param  parameters the optional parameters passed in
     * @return            a newly created endpoint or null if the endpoint cannot be created based on the inputs
     * @throws Exception  is thrown if error creating the endpoint
     */
    protected abstract Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters)
            throws Exception;

    /**
     * Configure an endpoint using the given parameters. In the usual cases, this is the only call needed after having
     * created the endpoint in the {@link #createEndpoint(String, String, Map)} method's implementation.
     *
     * This method will call the {@link Endpoint#configureProperties(Map)} method which should delegate the the
     * endpoint's {@link PropertyConfigurer} instance. In some rare cases, you need to override this method to
     * explicitely set parameters in case a simple generated configurer can not be used.
     *
     * @param endpoint   the endpoint
     * @param parameters properties to set
     */
    protected void setProperties(Endpoint endpoint, Map<String, Object> parameters) throws Exception {
        endpoint.configureProperties(parameters);
    }

    /**
     * Sets the bean properties on the given bean
     *
     * @param bean       the bean
     * @param parameters properties to set
     */
    protected void setProperties(Object bean, Map<String, Object> parameters) throws Exception {
        setProperties(getCamelContext(), bean, parameters);
    }

    /**
     * Sets the bean properties on the given bean using the given {@link CamelContext}.
     *
     * @param camelContext the {@link CamelContext} to use
     * @param bean         the bean
     * @param parameters   properties to set
     */
    protected void setProperties(CamelContext camelContext, Object bean, Map<String, Object> parameters) throws Exception {
        if (parameters == null || parameters.isEmpty()) {
            return;
        }

        PropertyConfigurer configurer;
        if (bean instanceof Component) {
            configurer = getComponentPropertyConfigurer();
        } else if (bean instanceof Endpoint) {
            configurer = getEndpointPropertyConfigurer();
        } else if (bean instanceof PropertyConfigurerAware) {
            configurer = ((PropertyConfigurerAware) bean).getPropertyConfigurer(bean);
        } else {
            configurer = null;
        }
        // use configurer and ignore case as end users may type an option name with mixed case
        PropertyBindingSupport.build().withConfigurer(configurer).withIgnoreCase(true).bind(camelContext, bean, parameters);
    }

    @Override
    public PropertyConfigurer getComponentPropertyConfigurer() {
        return componentPropertyConfigurer;
    }

    @Override
    public PropertyConfigurer getEndpointPropertyConfigurer() {
        return endpointPropertyConfigurer;
    }

    /**
     * Derived classes may wish to overload this to prevent the default introspection of URI parameters on the created
     * {@link Endpoint} instance.
     */
    protected boolean useIntrospectionOnEndpoint() {
        return true;
    }

    /**
     * Gets the parameter and remove it from the parameter map. This method doesn't resolve reference parameters in the
     * registry.
     *
     * @param  parameters the parameters
     * @param  key        the key
     * @param  type       the requested type to convert the value from the parameter
     * @return            the converted value parameter, <tt>null</tt> if parameter does not exists.
     * @see               #resolveAndRemoveReferenceParameter(Map, String, Class)
     */
    public <T> T getAndRemoveParameter(Map<String, Object> parameters, String key, Class<T> type) {
        return getAndRemoveParameter(parameters, key, type, null);
    }

    /**
     * Gets the parameter and remove it from the parameter map. This method doesn't resolve reference parameters in the
     * registry.
     *
     * @param  parameters   the parameters
     * @param  key          the key
     * @param  type         the requested type to convert the value from the parameter
     * @param  defaultValue use this default value if the parameter does not contain the key
     * @return              the converted value parameter
     * @see                 #resolveAndRemoveReferenceParameter(Map, String, Class, Object)
     */
    public <T> T getAndRemoveParameter(Map<String, Object> parameters, String key, Class<T> type, T defaultValue) {
        Object value = parameters.remove(key);
        if (value != null) {
            // if we have a value then convert it
            return CamelContextHelper.mandatoryConvertTo(getCamelContext(), type, value);
        } else {
            value = defaultValue;
        }
        if (value == null) {
            return null;
        }

        return CamelContextHelper.mandatoryConvertTo(getCamelContext(), type, value);
    }

    /**
     * Gets the parameter and remove it from the parameter map. This method resolves reference parameters in the
     * registry as well.
     *
     * @param  parameters the parameters
     * @param  key        the key
     * @param  type       the requested type to convert the value from the parameter
     * @return            the converted value parameter
     */
    public <T> T getAndRemoveOrResolveReferenceParameter(Map<String, Object> parameters, String key, Class<T> type) {
        return getAndRemoveOrResolveReferenceParameter(parameters, key, type, null);
    }

    /**
     * Gets the parameter and remove it from the parameter map. This method resolves reference parameters in the
     * registry as well.
     *
     * @param  parameters   the parameters
     * @param  key          the key
     * @param  type         the requested type to convert the value from the parameter
     * @param  defaultValue use this default value if the parameter does not contain the key
     * @return              the converted value parameter
     */
    public <T> T getAndRemoveOrResolveReferenceParameter(
            Map<String, Object> parameters, String key, Class<T> type, T defaultValue) {
        // the parameter may be the the type already (such as from endpoint-dsl)
        Object value = parameters.remove(key);
        if (value instanceof String) {
            String str = (String) value;
            if (EndpointHelper.isReferenceParameter(str)) {
                return EndpointHelper.resolveReferenceParameter(getCamelContext(), str, type);
            }
        }
        if (type.isInstance(value)) {
            // special for string references
            if (String.class == type) {
                String str = value.toString();
                if (EndpointHelper.isReferenceParameter(str)) {
                    value = EndpointHelper.resolveReferenceParameter(getCamelContext(), str, type);
                }
            }
            return type.cast(value);
        } else if (value == null) {
            return defaultValue;
        } else {
            // okay so it may be a reference so value should be string
            String str = getCamelContext().getTypeConverter().tryConvertTo(String.class, value);
            if (EndpointHelper.isReferenceParameter(str)) {
                return EndpointHelper.resolveReferenceParameter(getCamelContext(), str, type);
            } else {
                return getCamelContext().getTypeConverter().convertTo(type, value);
            }
        }
    }

    /**
     * Resolves a reference parameter in the registry and removes it from the map.
     *
     * @param  <T>                      type of object to lookup in the registry.
     * @param  parameters               parameter map.
     * @param  key                      parameter map key.
     * @param  type                     type of object to lookup in the registry.
     * @return                          the referenced object or null if the parameter map doesn't contain
     *                                  the key.
     * @throws IllegalArgumentException if a non-null reference was not found in registry.
     */
    public <T> T resolveAndRemoveReferenceParameter(Map<String, Object> parameters, String key, Class<T> type) {
        return resolveAndRemoveReferenceParameter(parameters, key, type, null);
    }

    /**
     * Resolves a reference parameter in the registry and removes it from the map.
     *
     * @param  <T>                      type of object to lookup in the registry.
     * @param  parameters               parameter map.
     * @param  key                      parameter map key.
     * @param  type                     type of object to lookup in the registry.
     * @param  defaultValue             default value to use if the parameter map doesn't contain the key.
     * @return                          the referenced object or the default value.
     * @throws IllegalArgumentException if referenced object was not found in registry.
     */
    public <T> T resolveAndRemoveReferenceParameter(Map<String, Object> parameters, String key, Class<T> type, T defaultValue) {
        // the parameter may be the the type already (such as from endpoint-dsl)
        Object value = parameters.remove(key);
        if (value instanceof String) {
            String str = (String) value;
            if (EndpointHelper.isReferenceParameter(str)) {
                return EndpointHelper.resolveReferenceParameter(getCamelContext(), str, type);
            }
        }
        if (type.isInstance(value)) {
            // special for string references
            if (String.class == type) {
                String str = value.toString();
                if (EndpointHelper.isReferenceParameter(str)) {
                    value = EndpointHelper.resolveReferenceParameter(getCamelContext(), str, type);
                }
            }
            return type.cast(value);
        } else if (value == null) {
            return defaultValue;
        } else {
            // okay so it may be a reference so value should be string
            String str = getCamelContext().getTypeConverter().tryConvertTo(String.class, value);
            return EndpointHelper.resolveReferenceParameter(getCamelContext(), str, type);
        }
    }

    /**
     * Resolves a reference list parameter in the registry and removes it from the map.
     *
     * @param  parameters               parameter map.
     * @param  key                      parameter map key.
     * @param  elementType              result list element type.
     * @return                          the list of referenced objects or an empty list if the parameter map doesn't
     *                                  contain the key.
     * @throws IllegalArgumentException if any of the referenced objects was not found in registry.
     * @see                             EndpointHelper#resolveReferenceListParameter(CamelContext, String, Class)
     */
    public <T> List<T> resolveAndRemoveReferenceListParameter(
            Map<String, Object> parameters, String key, Class<T> elementType) {
        return resolveAndRemoveReferenceListParameter(parameters, key, elementType, new ArrayList<>(0));
    }

    /**
     * Resolves a reference list parameter in the registry and removes it from the map.
     *
     * @param  parameters               parameter map.
     * @param  key                      parameter map key.
     * @param  elementType              result list element type.
     * @param  defaultValue             default value to use if the parameter map doesn't contain the key.
     * @return                          the list of referenced objects or the default value.
     * @throws IllegalArgumentException if any of the referenced objects was not found in registry.
     * @see                             EndpointHelper#resolveReferenceListParameter(CamelContext, String, Class)
     */
    @SuppressWarnings("unchecked")
    public <T> List<T> resolveAndRemoveReferenceListParameter(
            Map<String, Object> parameters, String key, Class<T> elementType, List<T> defaultValue) {
        // the value may already be a list such as when using endpoint-dsl
        Object value = getAndRemoveParameter(parameters, key, Object.class);
        if (value instanceof List) {
            return (List<T>) value;
        }
        if (value == null) {
            return defaultValue;
        } else {
            // okay so it may be a reference so value should be string
            String str = getCamelContext().getTypeConverter().tryConvertTo(String.class, value);
            return EndpointHelper.resolveReferenceListParameter(getCamelContext(), str, elementType);
        }
    }

    /**
     * Returns the reminder of the text if it starts with the prefix.
     *

     * Is useable for string parameters that contains commands.
     *
     * @param  prefix the prefix
     * @param  text   the text
     * @return        the reminder, or null if no reminder
     */
    protected String ifStartsWithReturnRemainder(String prefix, String text) {
        if (text.startsWith(prefix)) {
            String remainder = text.substring(prefix.length());
            if (remainder.length() > 0) {
                return remainder;
            }
        }
        return null;
    }

    protected void registerExtension(ComponentExtension extension) {
        extensions.add(() -> extension);
    }

    protected void registerExtension(Supplier<ComponentExtension> supplier) {
        extensions.add(Suppliers.memorize(supplier));
    }

    @Override
    public Collection<Class<? extends ComponentExtension>> getSupportedExtensions() {
        return extensions.stream()
                .map(Supplier::get)
                .map(ComponentExtension::getClass)
                .collect(Collectors.toList());
    }

    @Override
    public <T extends ComponentExtension> Optional<T> getExtension(Class<T> extensionType) {
        return extensions.stream()
                .map(Supplier::get)
                .filter(extensionType::isInstance)
                .findFirst()
                .map(extensionType::cast)
                .map(e -> Component.trySetComponent(e, this))
                .map(e -> CamelContextAware.trySetCamelContext(e, getCamelContext()));
    }
}


text:
import os
from setuptools import setup

# No third party dependencies, so importing the package should be safe.
import temporenc

with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as fp:
    long_description = fp.read()

setup(
    name='temporenc',
    description="Python library for the temporenc format",
    long_description=long_description,
    version=temporenc.__version__,
    author="Wouter Bolsterlee",
    author_email="uws@xs4all.nl",
    url='https://github.com/wbolster/temporenc-python',
    packages=['temporenc'],
    license='BSD',
    classifiers=[
        'Development Status :: 4 - Beta',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 3',
        'Topic :: Database',
        'Topic :: Database :: Database Engines/Servers',
        'Topic :: Software Development :: Libraries',
        'Topic :: Software Development :: Libraries :: Python Modules',
    ],
)


text:
/*
*  Any style that need to use theme colors should be set in "colors.tsx"
*/

/* dont support popout / maximize / close all tabs */
.lm_controls {
    display: none;
}

/*
 * The vertical/horizontal drag handle was too tall/wide
 * It was interfering with tab selection (vertical) and scrolling (horizontal)
 */
.lm_splitter.lm_vertical .lm_drag_handle {
    top: 0px;
    height: 5px;
}
.lm_splitter.lm_horizontal .lm_drag_handle {
    left: 0px;
    width: 5px;
}

/* Change the close tab icon */
.lm_header .lm_tab .lm_close_tab {
    background-image: none;
    top: 2px;
}
.lm_close_tab:before {
    content: '\F00D'; /* cross */
    font-family: FontAwesome;
}

/* Add a tab number */
.spork_jumpIndex {
    position: absolute;
    right: -5px;
    top: -5px;
    background: #ad5000;
    color:#fff;
    font-weight: bold;
    z-index: 4;
    padding: 2px 5px;
    border-radius: 50px;
}
.lm_active .spork_jumpIndex {
  background: #ee7813;
}
/* Add a tab jump move help */
.spork_tabMove {
    position: absolute;
    right: calc(50% - 200px);
    top: calc(50% - 5em);
    background: #333;
    color:#DDD;
    font-weight: bold;
    z-index: 1000;
    padding: 15px 10px;
    border-radius: 4px;
    border: 3px solid #999;
    text-align: center;
    opacity: .8;
}
.spork_tabMove div {
    padding: 5px 0px;
}
.spork_tabMove .keyStrokeStyle {
   font-size: 0.9rem;
   background: #111;
   padding-top: 1px;
   padding-bottom: 1px;
   padding-left: 4px;
   padding-right: 4px;
   border-radius: 5px;
   border: 2px solid;
}

/* Further tab styling */
.lm_tab {
    transition: color .2s;
    font-weight: bold;
}
.lm_tab.lm_active {
    /*color: #6edeef;*/
}

/*
 * Make golden layout content flex based (this is the continer for items)
 * golden layout already gives it an explicit height / width
 * so with just making it a flex continer the children (our tabs) just work ;)
 */
.lm_content {
    display: flex;
    /* color is set in colors.tsx */

}

/**
 * Force the lm_splitter to be above other tab stuff
 */
.lm_splitter {
    z-index: 2;
}

/**
 * Force the lm_dropTargetIndicator to be above other tab stuff
 */
.lm_dropTargetIndicator {
    z-index: 2;
}

/**
 * Style the tab based on saved state
 */
.lm_tab.unsaved {
}
.lm_tab.unsaved .lm_close_tab:before {
    content: '\F1CD'; /* life-ring */
    font-family: FontAwesome;
}

/* Show Tips */
.spork_tipRoot {
    position: absolute;
    top:0;
    bottom:0;
    right:0;
    left:0;
    display: flex;
    pointer-events: none;
    /* color is set in colors.tsx */
}


text:
namespace JiraAssistant.Logic.Settings
{
   public class AnalysisSettings : SettingsBase
   {
      public int NumberOfLastSprintsAnalysed
      {
         get { return (int)GetValue(15L); }
         set { SetValue(value, 15L); }
      }
   }
}


text:
using System;
using System.Threading.Tasks;

namespace Orleans.Runtime.Scheduler
{
    internal class InvokeWorkItem : WorkItemBase
    {
        private static readonly Logger logger = LogManager.GetLogger("InvokeWorkItem", LoggerType.Runtime);
        private readonly ActivationData activation;
        private readonly Message message;
        private readonly Dispatcher dispatcher;

        public InvokeWorkItem(ActivationData activation, Message message, Dispatcher dispatcher)
        {
            if (activation?.GrainInstance == null)
            {
                var str = string.Format("Creating InvokeWorkItem with bad activation: {0}. Message: {1}", activation, message);
                logger.Warn(ErrorCode.SchedulerNullActivation, str);
                throw new ArgumentException(str);
            }

            this.activation = activation;
            this.message = message;
            this.dispatcher = dispatcher;
            this.SchedulingContext = activation.SchedulingContext;
            activation.IncrementInFlightCount();
        }

        #region Implementation of IWorkItem

        public override WorkItemType ItemType
        {
            get { return WorkItemType.Invoke; }
        }

        public override string Name
        {
            get { return String.Format("InvokeWorkItem:Id={0} {1}", message.Id, message.DebugContext); }
        }

        public override void Execute()
        {
            try
            {
                var grain = activation.GrainInstance;
                var runtimeClient = this.dispatcher.RuntimeClient;
                Task task = runtimeClient.Invoke(grain, this.activation, this.message);
                task.ContinueWith(t =>
                {
                    // Note: This runs for all outcomes of resultPromiseTask - both Success or Fault
                    activation.DecrementInFlightCount();
                    this.dispatcher.OnActivationCompletedRequest(activation, message);
                }).Ignore();
            }
            catch (Exception exc)
            {
                logger.Warn(ErrorCode.InvokeWorkItem_UnhandledExceptionInInvoke,
                    String.Format("Exception trying to invoke request {0} on activation {1}.", message, activation), exc);

                activation.DecrementInFlightCount();
                this.dispatcher.OnActivationCompletedRequest(activation, message);
            }
        }

        #endregion

        public override string ToString()
        {
            return String.Format("{0} for activation={1} Message={2}", base.ToString(), activation, message);
        }
    }
}


text:
'use strict'
import {factory, autobind} from 'ng-annotations'

@factory('bModalFactory')
class BModalFactory {

  current

  @autobind
  show (id) {
    if (id === this.current) return

    this.current = id
  }

  @autobind
  hide () {
    this.current = ''
  }

  @autobind
  canShow (id) {
    return this.current === id
  }

  @autobind
  getCurrent () {
    return this.current
  }

  $expose () {
    return {
      show       : this.show,
      hide       : this.hide,
      canShow    : this.canShow,
      getCurrent : this.getCurrent
    }
  }
}

export {BModalFactory}


text:
package org.zeksa.hibernate.labs.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.zeksa.hibernate.labs.assembler.MessageAssembler;
import org.zeksa.hibernate.labs.model.Message;
import org.zeksa.hibernate.labs.model.MessageDTO;
import org.zeksa.hibernate.labs.repository.MessageRepository;

import java.util.List;

@Service("messageService")
public class MessageServiceImpl implements MessageService {

	@Autowired
	MessageRepository messageRepository;

	@Override
	public List<MessageDTO> findByAuthorId(String authorId) {
		List<Message> messages = (List<Message>) messageRepository.findByAuthorId(authorId);
		return MessageAssembler.toDTOList(messages);
	}

	@Override
	public MessageDTO save(MessageDTO dto) {
        Message message=MessageAssembler.fromDTO(dto);
		Message savedMessage=messageRepository.save(message);
		return MessageAssembler.toDTO(savedMessage);
	}
}


text:
"""Test an Edition that tracks LSST document releases (``lsst_doc``)."""

from __future__ import annotations

from typing import TYPE_CHECKING

from keeper.testutils import MockTaskQueue

if TYPE_CHECKING:
    from unittest.mock import Mock

    from keeper.testutils import TestClient

def test_lsst_doc_edition(client: TestClient, mocker: Mock) -> None:
    """Test an edition that tracks LSST Doc semantic versions.

    1. Create a build on `main`; it should be tracked because the LSST_DOC
       mode tracks main if a semantic version tag hasn't been pushed yet.
    2. Create a ticket branch; it isn't tracked.
    3. Create a v1.0 build; it is tracked.
    4. Create another build on `main`; it isn't tracked because we already
       have the v1.0 build.
    5. Create a v0.9 build that is not tracked because it's older.
    6. Create a v1.1 build that **is** tracked because it's newer.
    """
    task_queue = mocker.patch(
        "keeper.taskrunner.inspect_task_queue", return_value=None
    )
    task_queue = MockTaskQueue(mocker)

    # Create default organization
    from keeper.models import Organization, db

    org = Organization(
        slug="test",
        title="Test",
        root_domain="lsst.io",
        fastly_domain="global.ssl.fastly.net",
        bucket_name="bucket-name",
    )
    db.session.add(org)
    db.session.commit()

    # ========================================================================
    # Add product /products/ldm-151
    mocker.resetall()

    p1_data = {
        "slug": "ldm-151",
        "doc_repo": "https://github.com/lsst/LDM-151",
        "main_mode": "lsst_doc",
        "title": "Applications Design",
        "root_domain": "lsst.io",
        "root_fastly_domain": "global.ssl.fastly.net",
        "bucket_name": "bucket-name",
    }
    r = client.post("/products/", p1_data)
    task_queue.apply_task_side_effects()
    p1_url = r.headers["Location"]

    assert r.status == 201

    # ========================================================================
    # Get the URL for the default edition
    r = client.get(p1_url + "/editions/")
    default_edition_url = sorted(r.json["editions"])[0]
    assert default_edition_url == "http://example.test/editions/1"

    # ========================================================================
    # Create a build on 'main'
    mocker.resetall()

    b1_data = {
        "slug": "b1",
        "github_requester": "jonathansick",
        "git_refs": ["main"],
    }
    r = client.post("/products/ldm-151/builds/", b1_data)
    task_queue.apply_task_side_effects()
    b1_url = r.headers["Location"]

    # ========================================================================
    # Confirm build on 'main'
    mocker.resetall()

    r = client.patch(b1_url, {"uploaded": True})
    task_queue.apply_task_side_effects()
    task_queue.assert_edition_build_v1(default_edition_url, b1_url)

    # The 'main' edition was also automatically created to track main.
    r = client.get(p1_url + "/editions/")
    main_edition_url = sorted(r.json["editions"])[1]
    task_queue.assert_edition_build_v1(main_edition_url, b1_url)

    # Check that it's tracking the main branch
    r = client.get(main_edition_url)
    assert r.json["mode"] == "git_ref"
    assert r.json["slug"] == "main"
    assert r.json["title"] == "main"
    assert r.json["tracked_refs"] == ["main"]

    # Test that the default edition updated because there are no builds yet
    # with semantic versions
    r = client.get(default_edition_url)
    assert r.json["build_url"] == b1_url
    assert r.json["pending_rebuild"] is False

    # ========================================================================
    # Create a ticket branch build
    mocker.resetall()

    b2_data = {
        "slug": "b2",
        "github_requester": "jonathansick",
        "git_refs": ["tickets/DM-1"],
    }
    r = client.post("/products/ldm-151/builds/", b2_data)
    task_queue.apply_task_side_effects()
    b2_url = r.headers["Location"]

    # ========================================================================
    # Confirm ticket branch build
    mocker.resetall()

    r = client.patch(b2_url, {"uploaded": True})
    task_queue.apply_task_side_effects()
    task_queue.assert_edition_build_v1(
        "http://example.test/editions/3", b2_url
    )

    # Test that the default edition *did not* update because this build is
    # neither for main nor a semantic version.
    # with semantic versions
    r = client.get(default_edition_url)
    assert r.json["build_url"] == b1_url

    # ========================================================================
    # Create a build with a semantic version tag.
    mocker.resetall()

    b3_data = {
        "slug": "b3",
        "github_requester": "jonathansick",
        "git_refs": ["v1.0"],
    }
    r = client.post("/products/ldm-151/builds/", b3_data)
    task_queue.apply_task_side_effects()
    b3_url = r.headers["Location"]

    # ========================================================================
    # Confirm v1.0 build
    mocker.resetall()

    r = client.patch(b3_url, {"uploaded": True})
    task_queue.apply_task_side_effects()
    task_queue.assert_edition_build_v1(
        "http://example.test/editions/1", b3_url
    )
    task_queue.assert_edition_build_v1(
        "http://example.test/editions/4", b3_url
    )

    # Test that the default edition updated
    r = client.get(default_edition_url)
    assert r.json["build_url"] == b3_url

    # Test that the v1-0 edition updated
    r = client.get("http://example.test/editions/4")
    assert r.json["build_url"] == b3_url

    # ========================================================================
    # Create another build on 'main'
    mocker.resetall()

    b4_data = {
        "slug": "b4",
        "github_requester": "jonathansick",
        "git_refs": ["main"],
    }
    r = client.post("/products/ldm-151/builds/", b4_data)
    task_queue.apply_task_side_effects()
    b4_url = r.headers["Location"]

    # ========================================================================
    # Confirm main build
    mocker.resetall()

    r = client.patch(b4_url, {"uploaded": True})
    task_queue.apply_task_side_effects()

    # Test that the default edition *did not* update because now it's sticking
    # to only show semantic versions.
    r = client.get(default_edition_url)
    assert r.json["build_url"] == b3_url

    # Test that the **main** edition did update, though
    r = client.get(main_edition_url)
    assert r.json["build_url"] == b4_url

    # ========================================================================
    # Create a build with a **older** semantic version tag.
    mocker.resetall()

    b5_data = {
        "slug": "b5",
        "github_requester": "jonathansick",
        "git_refs": ["v0.9"],
    }
    r = client.post("/products/ldm-151/builds/", b5_data)
    task_queue.apply_task_side_effects()
    b5_url = r.headers["Location"]

    # ========================================================================
    # Confirm v0.9 build
    mocker.resetall()

    r = client.patch(b5_url, {"uploaded": True})
    task_queue.apply_task_side_effects()

    # Test that the default edition *did not* update b/c it's older
    r = client.get(default_edition_url)
    assert r.json["build_url"] == b3_url

    # ========================================================================
    # Create a build with a **newer** semantic version tag.
    mocker.resetall()

    b6_data = {
        "slug": "b6",
        "github_requester": "jonathansick",
        "git_refs": ["v1.1"],
    }
    r = client.post("/products/ldm-151/builds/", b6_data)
    task_queue.apply_task_side_effects()
    b6_url = r.headers["Location"]

    mocker.resetall()
    r = client.patch(b6_url, {"uploaded": True})
    task_queue.apply_task_side_effects()

    # Test that the default edition updated
    r = client.get(default_edition_url)
    assert r.json["build_url"] == b6_url

    task_queue.assert_edition_build_v1(
        "http://example.test/editions/1", b6_url
    )
    task_queue.assert_edition_build_v1(
        "http://example.test/editions/6", b6_url
    )


text:
<?php
/* SVN FILE: $Id: article_featureds_tags_fixture.php 6311 2008-01-02 06:33:52Z phpnut $ */
/**
 * Short description for file.
 *
 * Long description for file
 *
 * PHP versions 4 and 5
 *
 * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
 * Copyright 2005-2008, Cake Software Foundation, Inc.
 *								1785 E. Sahara Avenue, Suite 490-204
 *								Las Vegas, Nevada 89104
 *
 *  Licensed under The Open Group Test Suite License
 *  Redistributions of files must retain the above copyright notice.
 *
 * @filesource
 * @copyright		Copyright 2005-2008, Cake Software Foundation, Inc.
 * @link				https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
 * @package			cake.tests
 * @subpackage		cake.tests.fixtures
 * @since			CakePHP(tm) v 1.2.0.4667
 * @version			$Revision: 6311 $
 * @modifiedby		$LastChangedBy: phpnut $
 * @lastmodified	$Date: 2008-01-02 00:33:52 -0600 (Wed, 02 Jan 2008) $
 * @license			http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
 */
/**
 * Short description for class.
 *
 * @package		cake.tests
 * @subpackage	cake.tests.fixtures
 */
class ArticleFeaturedsTagsFixture extends CakeTestFixture {
	var $name = 'ArticleFeaturedsTags';

	var $fields = array(
		'article_featured_id' => array('type' => 'integer', 'null' => false),
		'tag_id' => array('type' => 'integer', 'null' => false),
		'indexes' => array('UNIQUE_FEATURED' => array('column'=> array('article_featured_id', 'tag_id'), 'unique'=> 1))
	);
}

?>


text:
Simple modules for functional programming, done for fun.

## Usage

```javascript
import sequence from 'funny-sequence'

const greatestRoundedUp = sequence(Math.ceil, Math.max)

greatestRoundedUp(1.2, 2.3, 3.4) // 4
```

## License

The MIT License (MIT). Copyright (c) 2016 Luís Rodrigues.


text:
package com.sentenial.ws.client.mandate;

import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for MandateRequestMode.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *

 *

 * <simpleType name="MandateRequestMode">
 *   <restriction base="{http://www.w3.org/2001/XMLSchema}token">
 *     <enumeration value="VALIDATE_CREATE_UNSIGNED_PDF"/>
 *     <enumeration value="CREATE_MANDATE_PDF_SIGNED"/>
 *   </restriction>
 * </simpleType>
 *

 *
 */
@XmlType(name = "MandateRequestMode", namespace = "urn:com:sentenial:origix:ws:common:types")
@XmlEnum
public enum MandateRequestMode {

    VALIDATE_CREATE_UNSIGNED_PDF,
    CREATE_MANDATE_PDF_SIGNED;

    public String value() {
        return name();
    }

    public static MandateRequestMode fromValue(String v) {
        return valueOf(v);
    }

}


text:
# Localization

Existing ShuweeAdminBundle translations can be overwritten as any other translations (see http://symfony.com/doc/current/bundles/override.html#translations)

You can define labels and descriptions for each of your custom admin classes.  This can be done with either translation keys or content strings.
Symfony best practices recommend using translation keys (see http://symfony.com/doc/current/best_practices/i18n.html#translation-keys)
Add your translations for those keys in you own ShuweeAdminBundle.en.po file (i.e. in app/Resources/translations).

In your admin class:
```php
/**
  * @return array Options
  */
 public function getOptions() {
     return array(
         'label' => 'admin.post.label',
         'description' => 'admin.post.description',
         'menu_section' => 'admin.menu.blog.label',
         'preview_url_callback' => function($entity) {
             return $entity->getId();
         }
     );
 }
```

In your translation file (.po):
```pot
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: en\n"

msgid "admin.post.label"
msgstr "{0} Blocs|{1} Bloc|]1,Inf] Blocs"
msgid "admin.post.description"
msgstr "A blog post is a journal entry."
msgid "admin.menu.blog.label"
msgstr "Blog"
```


text:
All URIs are relative to *https://api.voximplant.com/platform_api/*

Method | HTTP request | Description
------------- | ------------- | -------------
[**addSipWhiteListItem**](ManagingSIPWhiteListApi.md#addSipWhiteListItem) | **POST** /AddSipWhiteListItem |
[**delSipWhiteListItem**](ManagingSIPWhiteListApi.md#delSipWhiteListItem) | **POST** /DelSipWhiteListItem |
[**getSipWhiteList**](ManagingSIPWhiteListApi.md#getSipWhiteList) | **POST** /GetSipWhiteList |
[**setSipWhiteListItem**](ManagingSIPWhiteListApi.md#setSipWhiteListItem) | **POST** /SetSipWhiteListItem |

# **addSipWhiteListItem**
> \Voximplant\Model\AddSipWhiteListItemAPIResponse addSipWhiteListItem($sip_whitelist_network)

Adds a new network address to the SIP white list.

### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: api_key
Voximplant\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Voximplant\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'Bearer');
// Configure API key authorization: account_name
Voximplant\Configuration::getDefaultConfiguration()->setApiKey('account_name', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Voximplant\Configuration::getDefaultConfiguration()->setApiKeyPrefix('account_name', 'Bearer');

$api_instance = new Voximplant\Api\ManagingSIPWhiteListApi();
$sip_whitelist_network = "sip_whitelist_network_example"; // string | The network address in format A.B.C.D/L or A.B.C.D/a.b.c.d (example 192.168.1.5/16).

try {
    $result = $api_instance->addSipWhiteListItem($sip_whitelist_network);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ManagingSIPWhiteListApi->addSipWhiteListItem: ', $e->getMessage(), PHP_EOL;
}
?>
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **sip_whitelist_network** | **string**| The network address in format A.B.C.D/L or A.B.C.D/a.b.c.d (example 192.168.1.5/16). |

### Return type

[**\Voximplant\Model\AddSipWhiteListItemAPIResponse**](../Model/AddSipWhiteListItemAPIResponse.md)

### Authorization

[api_key](../../README.md#api_key), [account_name](../../README.md#account_name)

### HTTP request headers

 - **Content-Type**: application/x-www-form-urlencoded
 - **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)

# **delSipWhiteListItem**
> \Voximplant\Model\ActivateCallerIDAPIResponse delSipWhiteListItem($sip_whitelist_id)

Deletes the network address from the SIP white list.

### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: api_key
Voximplant\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Voximplant\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'Bearer');
// Configure API key authorization: account_name
Voximplant\Configuration::getDefaultConfiguration()->setApiKey('account_name', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Voximplant\Configuration::getDefaultConfiguration()->setApiKeyPrefix('account_name', 'Bearer');

$api_instance = new Voximplant\Api\ManagingSIPWhiteListApi();
$sip_whitelist_id = 3.4; // float | The SIP white list item ID to delete.

try {
    $result = $api_instance->delSipWhiteListItem($sip_whitelist_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ManagingSIPWhiteListApi->delSipWhiteListItem: ', $e->getMessage(), PHP_EOL;
}
?>
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **sip_whitelist_id** | **float**| The SIP white list item ID to delete. |

### Return type

[**\Voximplant\Model\ActivateCallerIDAPIResponse**](../Model/ActivateCallerIDAPIResponse.md)

### Authorization

[api_key](../../README.md#api_key), [account_name](../../README.md#account_name)

### HTTP request headers

 - **Content-Type**: application/x-www-form-urlencoded
 - **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)

# **getSipWhiteList**
> \Voximplant\Model\GetSipWhiteListAPIResponse getSipWhiteList($sip_whitelist_id, $count, $offset)

Gets the SIP white list.

### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: api_key
Voximplant\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Voximplant\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'Bearer');
// Configure API key authorization: account_name
Voximplant\Configuration::getDefaultConfiguration()->setApiKey('account_name', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Voximplant\Configuration::getDefaultConfiguration()->setApiKeyPrefix('account_name', 'Bearer');

$api_instance = new Voximplant\Api\ManagingSIPWhiteListApi();
$sip_whitelist_id = 3.4; // float | The SIP white list item ID to filter
$count = 3.4; // float | The max returning record count.
$offset = 3.4; // float | The record count to omit.

try {
    $result = $api_instance->getSipWhiteList($sip_whitelist_id, $count, $offset);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ManagingSIPWhiteListApi->getSipWhiteList: ', $e->getMessage(), PHP_EOL;
}
?>
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **sip_whitelist_id** | **float**| The SIP white list item ID to filter | [optional]
 **count** | **float**| The max returning record count. | [optional]
 **offset** | **float**| The record count to omit. | [optional]

### Return type

[**\Voximplant\Model\GetSipWhiteListAPIResponse**](../Model/GetSipWhiteListAPIResponse.md)

### Authorization

[api_key](../../README.md#api_key), [account_name](../../README.md#account_name)

### HTTP request headers

 - **Content-Type**: application/x-www-form-urlencoded
 - **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)

# **setSipWhiteListItem**
> \Voximplant\Model\ActivateCallerIDAPIResponse setSipWhiteListItem($sip_whitelist_id, $sip_whitelist_network)

Edits the SIP white list.

### Example
```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: api_key
Voximplant\Configuration::getDefaultConfiguration()->setApiKey('api_key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Voximplant\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_key', 'Bearer');
// Configure API key authorization: account_name
Voximplant\Configuration::getDefaultConfiguration()->setApiKey('account_name', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Voximplant\Configuration::getDefaultConfiguration()->setApiKeyPrefix('account_name', 'Bearer');

$api_instance = new Voximplant\Api\ManagingSIPWhiteListApi();
$sip_whitelist_id = 3.4; // float | The SIP white list item ID
$sip_whitelist_network = "sip_whitelist_network_example"; // string | The new network address in format A.B.C.D/L or A.B.C.D/a.b.c.d (example 192.168.1.5/16)

try {
    $result = $api_instance->setSipWhiteListItem($sip_whitelist_id, $sip_whitelist_network);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ManagingSIPWhiteListApi->setSipWhiteListItem: ', $e->getMessage(), PHP_EOL;
}
?>
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **sip_whitelist_id** | **float**| The SIP white list item ID |
 **sip_whitelist_network** | **string**| The new network address in format A.B.C.D/L or A.B.C.D/a.b.c.d (example 192.168.1.5/16) |

### Return type

[**\Voximplant\Model\ActivateCallerIDAPIResponse**](../Model/ActivateCallerIDAPIResponse.md)

### Authorization

[api_key](../../README.md#api_key), [account_name](../../README.md#account_name)

### HTTP request headers

 - **Content-Type**: application/x-www-form-urlencoded
 - **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)


text:
#ifndef QABSTRACTLAYOUTSTYLEINFO_P_H
#define QABSTRACTLAYOUTSTYLEINFO_P_H

//
//  W A R N I N G
//  -------------
//
// This file is not part of the Qt API.  It exists purely as an
// implementation detail.  This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//

#include <QtCore/qnamespace.h>
#include "qlayoutpolicy_p.h"

QT_BEGIN_NAMESPACE

class Q_GUI_EXPORT QAbstractLayoutStyleInfo {
public:
    typedef enum {
        Unknown = 0,
        Changed,
        Unchanged
    } ChangedState;

    QAbstractLayoutStyleInfo() : m_isWindow(false), m_changed(Changed) {}
    virtual ~QAbstractLayoutStyleInfo() {}
    virtual qreal combinedLayoutSpacing(QLayoutPolicy::ControlTypes /*controls1*/,
                                        QLayoutPolicy::ControlTypes /*controls2*/, Qt::Orientation /*orientation*/) const {
        return -1;
    }

    virtual qreal perItemSpacing(QLayoutPolicy::ControlType /*control1*/,
                                 QLayoutPolicy::ControlType /*control2*/,
                                 Qt::Orientation /*orientation*/) const {
        return -1;
    }

    virtual qreal spacing(Qt::Orientation orientation) const = 0;

    virtual bool hasChangedCore() const = 0;

    void updateChanged(ChangedState change) {
        m_changed = change;
    }

    bool hasChanged() const;

    virtual void invalidate() { updateChanged(Changed);}

    virtual qreal windowMargin(Qt::Orientation orientation) const = 0;

    bool isWindow() const {
        return m_isWindow;
    }

protected:
    unsigned m_isWindow : 1;
    mutable unsigned m_changed : 2;
};

QT_END_NAMESPACE

#endif // QABSTRACTLAYOUTSTYLEINFO_P_H


text:
1. [Overview](#overview)
2. [Module Description - What the module does and why it is useful](#module-description)
3. [Setup - The basics of getting started with powershell](#setup)
    * [Setup requirements](#setup-requirements)
    * [Beginning with powershell](#beginning-with-powershell)
4. [Usage - Configuration options and additional functionality](#usage)
5. [Reference - An under-the-hood peek at what the module is doing and how](#reference)
5. [Limitations - OS compatibility, etc.](#limitations)
6. [Development - Guide for contributing to the module](#development)

##Overview

This module adds a new exec provider capable of executing PowerShell commands.

##Module Description

Puppet provides a built-in `exec` type that is capable of executing commands. This module adds a `powershell` provider to the `exec` type,  which enables `exec` parameters, listed below. This module is particularly helpful if you need to run PowerShell commands but don't know the details about how PowerShell is executed, since you can technically run PowerShell commands in Puppet without the module.

##Setup

###Setup Requirements
This module requires PowerShell to be installed and the `powershell.exe` to be available in the system PATH.

###Beginning with powershell

The powershell module adapts the Puppet [exec](http://docs.puppet.com/references/stable/type.html#exec) resource to run PowerShell commands. To get started, simply install the module and declare 'powershell' in `provider` with the applicable command.

~~~ puppet
exec { 'RESOURCENAME':
  command   => '$(SOMECOMMAND)',
  provider  => powershell,
}
~~~

##Usage

When using `exec` resources with the `powershell` provider, the `command` parameter must be single-quoted to prevent Puppet from interpolating `$(..)`.

For instance, if you wanted to rename the Guest account:

~~~ puppet
exec { 'rename-guest':
  command   => '$(Get-WMIObject Win32_UserAccount -Filter "Name=\'guest\'").Rename("new-guest")',
  unless    => 'if (Get-WmiObject Win32_UserAccount -Filter "Name=\'guest\'") { exit 1 }',
  provider  => powershell,
}
~~~

Note that the example uses the `unless` parameter to make the resource idempotent. The `command` is only executed if the Guest account does not exist, as indicated by `unless` returning 0.

**Note:** PowerShell variables (e.g. `$_`), must be escaped in Puppet manifests either using backslashes or single quotes.

Alternatively, you can put the PowerShell code for the `command`, `onlyif`, and `unless` parameters into separate files and then invoke the file function in the resource. Templates and the `template()` function could also be used here if the PowerShell scripts need to have access to variables from Puppet.

~~~ puppet
exec { 'rename-guest':
  command   => file('guest/rename-guest.ps1'),
  onlyif    => file('guest/guest-exists.ps1'),
  provider  => powershell,
  logoutput => true,
}
~~~

Each file is a PowerShell script that should be in the module's `files/` folder.

For example, here is the script at: `guest/files/rename-guest.ps1`

~~~ powershell
$obj = $(Get-WMIObject Win32_UserAccount -Filter "Name='Guest'")
$obj.Rename("OtherGuest")
~~~

This has the added benefit of not requiring escaping '$' in the PowerShell code. Note that the files need to have DOS linefeeds or they will not work as expected. One tool for converting UNIX linefeeds to DOS linefeeds is [unix2dos](http://freecode.com/projects/dos2unix).

##Reference

####Provider
* powershell - Adapts the Puppet `exec` resource to run PowerShell commands.

####Parameters
All parameters are optional.

#####`creates`
Specifies the file to look for before running the command. The command will only run if the file doesn't exist. **Note: This parameter will not create a file, it will simpy look for one.** Valid options: A string of the path to the file. Default: Undefined.

#####`cwd`
Sets the directory from which to run the command. Valid options: A string of the directory path. Default: Undefined.

#####`command`
Specifies the actual PowerShell command to execute. Must either be fully qualified or a search path for the command must be provided. Valid options: String. Default: Undefined.

#####`environment`
Sets additional environment variables to set for a command. Valid options: String, or an array of multiple options. Default: Undefined.

#####`logoutput`
Defines whether to log command output in addition to logging the exit code. If you specify 'on_failure', it only logs the output when the command has an exit code that does not match any value specified by the `returns` attribute. Valid options: 'true', 'false', and 'on_failure'. Default: 'on_failure'.

#####`onlyif`
Runs the exec only if the command returns 0. Valid options: String. Default: Undefined.

#####`path`
Specifies the search path used for command execution. Valid options: String of the path, an array, or a semicolon-separated list. Default: Undefined.

#####`refresh`
Refreshes the command. Valid options: String. Default: Undefined.

#####`refreshonly`
Refreshes the command only when a dependent object is changed. Used with `subscribe` and `notify` [metaparameters](http://docs.puppet.com/references/latest/metaparameter.html). Valid options: 'true', 'false'. Default: 'false'.

#####`returns`
Lists the expected return code(s). An error will be returned if the executed command returns something else. Valid options: An array of acceptable return codes or a single value. Default: 0.

#####`timeout`
Sets the maximum time in seconds that the command should take. Valid options: Number or string representation of a number. Default: 300.

#####`tries`
Determines the number of times execution of the command should be attempted. Valid options: Number or a string representation of a number. Default: '1'.

#####`try_sleep`
Specifies the time to sleep in seconds between `tries`. Valid options: Number or a string representation of a number. Default: Undefined.

#####`unless`
Runs the `exec`, unless the command returns 0. Valid options: String. Default: Undefined.

##Limitations

 * Only supported on Windows Server 2003 and above, and Windows 7 and above.

##Development

Puppet Inc modules on the Puppet Forge are open projects, and community contributions are essential for keeping them great. We can't access the huge number of platforms and myriad hardware, software, and deployment configurations that Puppet is intended to serve. We want to keep it as easy as possible to contribute changes so that our modules work in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things. For more information, see our [module contribution guide.](https://docs.puppet.com/forge/contributing.html)


text:
<?php if(!defined('access') or !access) die('This file cannot be directly accessed.'); ?>
<?php $share_modal = function_exists('get_share_modal') ? get_share_modal() : G\get_global("share_modal"); ?>

	<?php _se('Share'); ?>

		<?php echo '
'.join("

"."\n", $share_modal["links_array"]); ?>

			<?php _se('Link'); ?>
			<input type="text" name="modal-share-url" id="modal-share-url" class="text-input" value="<?php echo $share_modal["url"]; ?>" data-focus="select-all">

	<p class="highlight margin-top-20 font-size-small text-align-center<?php if(is_null($share_modal["privacy"]) or $share_modal["privacy"] == "public") echo " soft-hidden"; ?>" data-content="privacy-private"><?php _se('Note: This content is private. Change privacy to "public" to share.'); ?>


text:
<?php

declare(strict_types = 1);

namespace FiveLab\Component\Resource\Resource\Href;

/**
 * Default href value for relation.
 *
 * @author Vitaliy Zhuk <v.zhuk@fivelab.org>
 */
class Href implements HrefInterface
{
    /**
     * @var string
     */
    private string $path;

    /**
     * @var bool
     */
    private bool $templated;

    /**
     * Constructor.
     *
     * @param string $path
     * @param bool   $templated
     */
    public function __construct(string $path, bool $templated = false)
    {
        $this->path = $path;
        $this->templated = $templated;
    }

    /**
     * {@inheritdoc}
     */
    public function getPath(): string
    {
        return $this->path;
    }

    /**
     * Is href templated?
     *
     * @return bool
     */
    public function isTemplated(): bool
    {
        return $this->templated;
    }
}


text:
package org.apache.kafka.streams.kstream.internals;

import org.apache.kafka.common.serialization.Serde;
import org.apache.kafka.streams.kstream.Aggregator;
import org.apache.kafka.streams.kstream.Initializer;
import org.apache.kafka.streams.kstream.KTable;
import org.apache.kafka.streams.state.StoreBuilder;

import java.util.Collections;
import java.util.Set;

class GroupedStreamAggregateBuilder<K, V> {
    private final InternalStreamsBuilder builder;
    private final Serde<K> keySerde;
    private final Serde<V> valueSerde;
    private final boolean repartitionRequired;
    private final Set<String> sourceNodes;
    private final String name;

    final Initializer<Long> countInitializer = new Initializer<Long>() {
        @Override
        public Long apply() {
            return 0L;
        }
    };

    final Aggregator<K, V, Long> countAggregator = new Aggregator<K, V, Long>() {
        @Override
        public Long apply(K aggKey, V value, Long aggregate) {
            return aggregate + 1;
        }
    };

    final Initializer<V> reduceInitializer = new Initializer<V>() {
        @Override
        public V apply() {
            return null;
        }
    };

    GroupedStreamAggregateBuilder(final InternalStreamsBuilder builder,
                                  final Serde<K> keySerde,
                                  final Serde<V> valueSerde,
                                  final boolean repartitionRequired,
                                  final Set<String> sourceNodes,
                                  final String name) {

        this.builder = builder;
        this.keySerde = keySerde;
        this.valueSerde = valueSerde;
        this.repartitionRequired = repartitionRequired;
        this.sourceNodes = sourceNodes;
        this.name = name;
    }

    <T> KTable<K, T> build(final KStreamAggProcessorSupplier<K, ?, V, T> aggregateSupplier,
                           final String functionName,
                           final StoreBuilder storeBuilder,
                           final boolean isQueryable) {
        final String aggFunctionName = builder.newProcessorName(functionName);
        final String sourceName = repartitionIfRequired(storeBuilder.name());
        builder.internalTopologyBuilder.addProcessor(aggFunctionName, aggregateSupplier, sourceName);
        builder.internalTopologyBuilder.addStateStore(storeBuilder, aggFunctionName);

        return new KTableImpl<>(
                builder,
                aggFunctionName,
                aggregateSupplier,
                sourceName.equals(this.name) ? sourceNodes : Collections.singleton(sourceName),
                storeBuilder.name(),
                isQueryable);
    }

    /**
     * @return the new sourceName if repartitioned. Otherwise the name of this stream
     */
    private String repartitionIfRequired(final String queryableStoreName) {
        if (!repartitionRequired) {
            return this.name;
        }
        return KStreamImpl.createRepartitionedSource(builder, keySerde, valueSerde, queryableStoreName, name);
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
in Reumaux, Bidaud & Moënne-Loccoz, Russules Rares ou Méconnues (Marlioz) 289 (1996)

#### Original name
Russula risigallina var. superba Bidaud

### Remarks
null


text:
//========================================================================
//Copyright 2007-2011 David Yu dyuproject@gmail.com
//------------------------------------------------------------------------
//Licensed under the Apache License, Version 2.0 (the "License");
//you may not use this file except in compliance with the License.
//You may obtain a copy of the License at
//http://www.apache.org/licenses/LICENSE-2.0
//Unless required by applicable law or agreed to in writing, software
//distributed under the License is distributed on an "AS IS" BASIS,
//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//See the License for the specific language governing permissions and
//limitations under the License.
//========================================================================

package io.protostuff.me;

import java.io.IOException;

/**
 * A ProtostuffOutput w/c can handle cyclic dependencies when serializing objects with graph transformations.
 *
 * @author David Yu
 * @created Dec 10, 2010
 */
public final class GraphProtostuffOutput extends FilterOutput
{

    private final IdentityMap/* <Object,Integer> */references;
    private int refCount = 0;

    public GraphProtostuffOutput(ProtostuffOutput output)
    {
        super(output);
        references = new IdentityMap/* <Object,Integer> */();
    }

    public GraphProtostuffOutput(ProtostuffOutput output, int initialCapacity)
    {
        super(output);
        references = new IdentityMap/* <Object,Integer> */(initialCapacity);
    }

    public void writeObject(int fieldNumber, Object value, Schema schema,
            boolean repeated) throws IOException
    {
        final ProtostuffOutput output = (ProtostuffOutput) this.output;

        if (references.shouldIncrement(refCount, value, output, fieldNumber))
        {
            refCount++;

            output.tail = output.sink.writeVarInt32(
                    WireFormat.makeTag(fieldNumber, WireFormat.WIRETYPE_START_GROUP),
                    output,
                    output.tail);

            schema.writeTo(this, value);

            output.tail = output.sink.writeVarInt32(
                    WireFormat.makeTag(fieldNumber, WireFormat.WIRETYPE_END_GROUP),
                    output,
                    output.tail);
        }
    }

    /**
     * A trimed-down version of IdentityHashMap w/c caters to the specific needs of {@link GraphOutput}.
     */
    private static final class IdentityMap
    {

        /**
         * The initial capacity used by the no-args constructor. MUST be a power of two. The value 32 corresponds to the
         * (specified) expected maximum size of 21, given a load factor of 2/3.
         */
        private static final int DEFAULT_CAPACITY = 32;

        /**
         * The minimum capacity, used if a lower value is implicitly specified by either of the constructors with
         * arguments. The value 4 corresponds to an expected maximum size of 2, given a load factor of 2/3. MUST be a
         * power of two.
         */
        private static final int MINIMUM_CAPACITY = 4;

        /**
         * The maximum capacity, used if a higher value is implicitly specified by either of the constructors with
         * arguments. MUST be a power of two <= 1<<29.
         */
        private static final int MAXIMUM_CAPACITY = 1 << 29;

        /**
         * The table, resized as necessary. Length MUST always be a power of two.
         */
        private transient Object[] table;

        /**
         * The number of key-value mappings contained in this identity hash map.
         *
         * @serial
         */
        private int size;

        /*
         * The number of modifications, to support fast-fail iterators
         */
        // private transient volatile int modCount;

        /**
         * The next size value at which to resize (capacity * load factor).
         */
        private transient int threshold;

        /**
         * Constructs a new, empty identity hash map with a default expected maximum size (21).
         */
        public IdentityMap()
        {
            init(DEFAULT_CAPACITY);
        }

        /**
         * Constructs a new, empty map with the specified expected maximum size. Putting more than the expected number
         * of key-value mappings into the map may cause the internal data structure to grow, which may be somewhat
         * time-consuming.
         *
         * @param expectedMaxSize
         *            the expected maximum size of the map
         * @throws IllegalArgumentException
         *             if <tt>expectedMaxSize</tt> is negative
         */
        public IdentityMap(int expectedMaxSize)
        {
            if (expectedMaxSize < 0)
                throw new IllegalArgumentException("expectedMaxSize is negative: " + expectedMaxSize);
            init(capacity(expectedMaxSize));
        }

        /**
         * Returns the appropriate capacity for the specified expected maximum size. Returns the smallest power of two
         * between MINIMUM_CAPACITY and MAXIMUM_CAPACITY, inclusive, that is greater than (3 * expectedMaxSize)/2, if
         * such a number exists. Otherwise returns MAXIMUM_CAPACITY. If (3 * expectedMaxSize)/2 is negative, it is
         * assumed that overflow has occurred, and MAXIMUM_CAPACITY is returned.
         */
        private int capacity(int expectedMaxSize)
        {
            // Compute min capacity for expectedMaxSize given a load factor of 2/3
            int minCapacity = (3 * expectedMaxSize) / 2;

            // Compute the appropriate capacity
            int result;
            if (minCapacity > MAXIMUM_CAPACITY || minCapacity < 0)
            {
                result = MAXIMUM_CAPACITY;
            }
            else
            {
                result = MINIMUM_CAPACITY;
                while (result < minCapacity)
                    result <<= 1;
            }
            return result;
        }

        /**
         * Initializes object to be an empty map with the specified initial capacity, which is assumed to be a power of
         * two between MINIMUM_CAPACITY and MAXIMUM_CAPACITY inclusive.
         */
        private void init(int initCapacity)
        {
            // assert (initCapacity & -initCapacity) == initCapacity; // power of 2
            // assert initCapacity >= MINIMUM_CAPACITY;
            // assert initCapacity <= MAXIMUM_CAPACITY;

            threshold = (initCapacity * 2) / 3;
            table = new Object[2 * initCapacity];
        }

        /**
         * Returns index for Object x.
         */
        private static int hash(Object x, int length)
        {
            int h = System.identityHashCode(x);
            // Multiply by -127, and left-shift to use least bit as part of hash
            return ((h << 1) - (h << 8)) & (length - 1);
        }

        /**
         * Circularly traverses table of size len.
         */
        private static int nextKeyIndex(int i, int len)
        {
            return (i + 2 < len ? i + 2 : 0);
        }

        /*
         * Returns the value to which the specified key is mapped, or {@code null} if this map contains no mapping for
         * the key.
         *
         * <p> More formally, if this map contains a mapping from a key {@code k} to a value {@code v} such that {@code
         * (key == k)}, then this method returns {@code v}; otherwise it returns {@code null}. (There can be at most one
         * such mapping.)
         *
         * <p> A return value of {@code null} does not <i>necessarily</i> indicate that the map contains no mapping for
         * the key; it's also possible that the map explicitly maps the key to {@code null}. The {@link #containsKey
         * containsKey} operation may be used to distinguish these two cases.
         *
         * @see #put(Object, Object)
         *
         * public Integer get(Object k) { Object[] tab = table; int len = tab.length; int i = hash(k, len); while (true)
         * { Object item = tab[i]; if (item == k) return (Integer)tab[i + 1]; if (item == null) return null; i =
         * nextKeyIndex(i, len); } }
         *
         * /* Associates the specified value with the specified key in this identity hash map. If the map previously
         * contained a mapping for the key, the old value is replaced.
         *
         * @param key the key with which the specified value is to be associated
         *
         * @param value the value to be associated with the specified key
         *
         * @return the previous value associated with <tt>key</tt>, or <tt>null</tt> if there was no mapping for
         * <tt>key</tt>. (A <tt>null</tt> return can also indicate that the map previously associated <tt>null</tt> with
         * <tt>key</tt>.)
         *
         * @see Object#equals(Object)
         *
         * @see #get(Object)
         *
         * @see #containsKey(Object)
         *
         * public Integer put(Object k, Integer value) { Object[] tab = table; int len = tab.length; int i = hash(k,
         * len);
         *
         * Object item; while ((item = tab[i]) != null) { if (item == k) { Integer oldValue = (Integer)tab[i + 1]; tab[i
         * + 1] = value; return oldValue; } i = nextKeyIndex(i, len); }
         *
         * // modCount++; tab[i] = k; tab[i + 1] = value; if (++size >= threshold) resize(len); // len == 2 * current
         * capacity. return null; }
         */

        /**
         * Returns true if the provided int should increment(unique index id).
         */
        public boolean shouldIncrement(int value, Object k, WriteSession output,
                int fieldNumber) throws IOException
        {
            Object[] tab = table;
            int len = tab.length;
            int i = hash(k, len);

            Object item;
            while ((item = tab[i]) != null)
            {
                if (item == k)
                {
                    output.tail = output.sink.writeVarInt32(
                            ((Integer) tab[i + 1]).intValue(),
                            output,
                            output.sink.writeVarInt32(
                                    WireFormat.makeTag(fieldNumber, WireFormat.WIRETYPE_REFERENCE),
                                    output,
                                    output.tail));

                    return false;
                }
                i = nextKeyIndex(i, len);
            }

            // modCount++;
            tab[i] = k;
            tab[i + 1] = new Integer(value);
            if (++size >= threshold)
                resize(len); // len == 2 * current capacity.
            return true;
        }

        /**
         * Resize the table to hold given capacity.
         *
         * @param newCapacity
         *            the new capacity, must be a power of two.
         */
        private void resize(int newCapacity)
        {
            // assert (newCapacity & -newCapacity) == newCapacity; // power of 2
            int newLength = newCapacity * 2;

            Object[] oldTable = table;
            int oldLength = oldTable.length;
            if (oldLength == 2 * MAXIMUM_CAPACITY)
            { // can't expand any further
                if (threshold == MAXIMUM_CAPACITY - 1)
                    throw new IllegalStateException("Capacity exhausted.");
                threshold = MAXIMUM_CAPACITY - 1; // Gigantic map!
                return;
            }
            if (oldLength >= newLength)
                return;

            Object[] newTable = new Object[newLength];
            threshold = newLength / 3;

            for (int j = 0; j < oldLength; j += 2)
            {
                Object key = oldTable[j];
                if (key != null)
                {
                    Object value = oldTable[j + 1];
                    oldTable[j] = null;
                    oldTable[j + 1] = null;
                    int i = hash(key, newLength);
                    while (newTable[i] != null)
                        i = nextKeyIndex(i, newLength);
                    newTable[i] = key;
                    newTable[i + 1] = value;
                }
            }
            table = newTable;
        }

    }

}


text:
"use strict";
//# sourceMappingURL=serverInterfaces.js.map