text:
namespace net {

// Sendresult is inspired by sendmmsg, but unlike sendmmsg it is not
// convenient to require that a positive |write_count| and a negative
// error code are mutually exclusive.
struct NET_EXPORT SendResult {
  explicit SendResult();
  ~SendResult();
  SendResult(int rv, int write_count, DatagramBuffers buffers);
  SendResult(SendResult& other) = delete;
  SendResult& operator=(SendResult& other) = delete;
  SendResult(SendResult&& other);
  SendResult& operator=(SendResult&& other) = default;
  int rv;
  // number of successful writes.
  int write_count;
  DatagramBuffers buffers;
};

// Don't delay writes more than this.
const base::TimeDelta kWriteAsyncMsThreshold =
    base::TimeDelta::FromMilliseconds(1);
// Prefer local if number of writes is not more than this.
const int kWriteAsyncMinBuffersThreshold = 2;
// Don't allow more than this many outstanding async writes.
const int kWriteAsyncMaxBuffersThreshold = 16;
// PostTask immediately when unwritten buffers reaches this.
const int kWriteAsyncPostBuffersThreshold = kWriteAsyncMaxBuffersThreshold / 2;
// Don't unblock writer unless pending async writes are less than this.
const int kWriteAsyncCallbackBuffersThreshold = kWriteAsyncMaxBuffersThreshold;

// To allow mock |Send|/|Sendmsg| in testing.  This has to be
// reference counted thread safe because |SendBuffers| may be invoked in
// another thread via PostTask*.
class NET_EXPORT UDPSocketStarboardSender
    : public base::RefCountedThreadSafe<UDPSocketStarboardSender> {
 public:
  explicit UDPSocketStarboardSender();

  SendResult SendBuffers(const SbSocket& socket,
                         DatagramBuffers buffers,
                         SbSocketAddress address);

 protected:
  friend class base::RefCountedThreadSafe<UDPSocketStarboardSender>;

  virtual ~UDPSocketStarboardSender();
  virtual int Send(const SbSocket& socket,
                   const char* buf,
                   size_t len,
                   SbSocketAddress address) const;

  SendResult InternalSendBuffers(const SbSocket& socket,
                                 DatagramBuffers buffers,
                                 SbSocketAddress address) const;

 private:
  UDPSocketStarboardSender(const UDPSocketStarboardSender&) = delete;
  UDPSocketStarboardSender& operator=(const UDPSocketStarboardSender&) = delete;
};

class NET_EXPORT UDPSocketStarboard
    : public base::MessageLoopCurrentForIO::Watcher {
 public:
  UDPSocketStarboard(DatagramSocket::BindType bind_type,
                     net::NetLog* net_log,
                     const net::NetLogSource& source);
  virtual ~UDPSocketStarboard();

  // Opens the socket.
  // Returns a net error code.
  int Open(AddressFamily address_family);

  // Binds this socket to |network|. All data traffic on the socket will be sent
  // and received via |network|. Must be called before Connect(). This call will
  // fail if |network| has disconnected. Communication using this socket will
  // fail if |network| disconnects.
  // Returns a net error code.
  int BindToNetwork(NetworkChangeNotifier::NetworkHandle network);

  // Connect the socket to the host at |address|.
  // Should be called after Open().
  // Returns a net error code.
  int Connect(const IPEndPoint& address);

  // Bind the address/port for this socket to |address|.  This is generally
  // only used on a server.  Should be called after Open().
  // Returns a net error code.
  int Bind(const IPEndPoint& address);

  // Close the socket.
  void Close();

  // Copy the remote udp address into |address| and return a network error code.
  int GetPeerAddress(IPEndPoint* address) const;

  // Copy the local udp address into |address| and return a network error code.
  // (similar to getsockname)
  int GetLocalAddress(IPEndPoint* address) const;

  // IO:
  // Multiple outstanding read requests are not supported.
  // Full duplex mode (reading and writing at the same time) is supported

  // Reads from the socket.
  // Only usable from the client-side of a UDP socket, after the socket
  // has been connected.
  int Read(IOBuffer* buf, int buf_len, CompletionOnceCallback callback);

  // Writes to the socket.
  // Only usable from the client-side of a UDP socket, after the socket
  // has been connected.
  int Write(IOBuffer* buf,
            int buf_len,
            CompletionOnceCallback callback,
            const NetworkTrafficAnnotationTag& traffic_annotation);

  // Refer to datagram_client_socket.h
  int WriteAsync(DatagramBuffers buffers,
                 CompletionOnceCallback callback,
                 const NetworkTrafficAnnotationTag& traffic_annotation);
  int WriteAsync(const char* buffer,
                 size_t buf_len,
                 CompletionOnceCallback callback,
                 const NetworkTrafficAnnotationTag& traffic_annotation);

  DatagramBuffers GetUnwrittenBuffers();

  // Reads from a socket and receive sender address information.
  // |buf| is the buffer to read data into.
  // |buf_len| is the maximum amount of data to read.
  // |address| is a buffer provided by the caller for receiving the sender
  //   address information about the received data.  This buffer must be kept
  //   alive by the caller until the callback is placed.
  // |callback| is the callback on completion of the RecvFrom.
  // Returns a net error code, or ERR_IO_PENDING if the IO is in progress.
  // If ERR_IO_PENDING is returned, the caller must keep |buf| and |address|
  // alive until the callback is called.
  int RecvFrom(IOBuffer* buf,
               int buf_len,
               IPEndPoint* address,
               CompletionOnceCallback callback);

  // Sends to a socket with a particular destination.
  // |buf| is the buffer to send.
  // |buf_len| is the number of bytes to send.
  // |address| is the recipient address.
  // |callback| is the user callback function to call on complete.
  // Returns a net error code, or ERR_IO_PENDING if the IO is in progress.
  // If ERR_IO_PENDING is returned, the caller must keep |buf| and |address|
  // alive until the callback is called.
  int SendTo(IOBuffer* buf,
             int buf_len,
             const IPEndPoint& address,
             CompletionOnceCallback callback);

  // Sets the receive buffer size (in bytes) for the socket.
  // Returns a net error code.
  int SetReceiveBufferSize(int32_t size);

  // Sets the send buffer size (in bytes) for the socket.
  // Returns a net error code.
  int SetSendBufferSize(int32_t size);

  // Requests that packets sent by this socket not be fragment, either locally
  // by the host, or by routers (via the DF bit in the IPv4 packet header).
  // May not be supported by all platforms. Returns a return a network error
  // code if there was a problem, but the socket will still be usable. Can not
  // return ERR_IO_PENDING.
  int SetDoNotFragment();

  // If |confirm| is true, then the MSG_CONFIRM flag will be passed to
  // subsequent writes if it's supported by the platform.
  void SetMsgConfirm(bool confirm);

  // Returns true if the socket is already connected or bound.
  bool is_connected() const { return is_connected_; }

  const NetLogWithSource& NetLog() const { return net_log_; }

  // Call this to enable SO_REUSEADDR on the underlying socket.
  // Should be called between Open() and Bind().
  // Returns a net error code.
  int AllowAddressReuse();

  // Call this to allow or disallow sending and receiving packets to and from
  // broadcast addresses.
  // Returns a net error code.
  int SetBroadcast(bool broadcast);

  // Joins the multicast group.
  // |group_address| is the group address to join, could be either
  // an IPv4 or IPv6 address.
  // Returns a net error code.
  int JoinGroup(const IPAddress& group_address) const;

  // Leaves the multicast group.
  // |group_address| is the group address to leave, could be either
  // an IPv4 or IPv6 address. If the socket hasn't joined the group,
  // it will be ignored.
  // It's optional to leave the multicast group before destroying
  // the socket. It will be done by the OS.
  // Returns a net error code.
  int LeaveGroup(const IPAddress& group_address) const;

  // Sets interface to use for multicast. If |interface_index| set to 0,
  // default interface is used.
  // Should be called before Bind().
  // Returns a net error code.
  int SetMulticastInterface(uint32_t interface_index);

  // Sets the time-to-live option for UDP packets sent to the multicast
  // group address. The default value of this option is 1.
  // Cannot be negative or more than 255.
  // Should be called before Bind().
  // Returns a net error code.
  int SetMulticastTimeToLive(int time_to_live);

  // Sets the loopback flag for UDP socket. If this flag is true, the host
  // will receive packets sent to the joined group from itself.
  // The default value of this option is true.
  // Should be called before Bind().
  // Returns a net error code.
  //
  // Note: the behavior of |SetMulticastLoopbackMode| is slightly
  // different between Windows and Unix-like systems. The inconsistency only
  // happens when there are more than one applications on the same host
  // joined to the same multicast group while having different settings on
  // multicast loopback mode. On Windows, the applications with loopback off
  // will not RECEIVE the loopback packets; while on Unix-like systems, the
  // applications with loopback off will not SEND the loopback packets to
  // other applications on the same host. See MSDN: http://goo.gl/6vqbj
  int SetMulticastLoopbackMode(bool loopback);

  // Sets the differentiated services flags on outgoing packets. May not
  // do anything on some platforms.
  // Returns a net error code.
  int SetDiffServCodePoint(DiffServCodePoint dscp);

  // Resets the thread to be used for thread-safety checks.
  void DetachFromThread();

  // Apply |tag| to this socket.
  void ApplySocketTag(const SocketTag& tag);

  void SetWriteAsyncEnabled(bool enabled) { write_async_enabled_ = enabled; }
  bool WriteAsyncEnabled() { return write_async_enabled_; }

  void SetMaxPacketSize(size_t max_packet_size);

  void SetWriteMultiCoreEnabled(bool enabled) {
    write_multi_core_enabled_ = enabled;
  }

  void SetWriteBatchingActive(bool active) { write_batching_active_ = active; }

  void SetWriteAsyncMaxBuffers(int value) {
    LOG(INFO) << "SetWriteAsyncMaxBuffers: " << value;
    write_async_max_buffers_ = value;
  }

  // Enables experimental optimization. This method should be called
  // before the socket is used to read data for the first time.
  void enable_experimental_recv_optimization() {
    DCHECK(SbSocketIsValid(socket_));
    experimental_recv_optimization_enabled_ = true;
  };

 protected:
  // Watcher for WriteAsync paths.
  class WriteAsyncWatcher : public base::MessageLoopCurrentForIO::Watcher {
   public:
    explicit WriteAsyncWatcher(UDPSocketStarboard* socket)
        : socket_(socket), watching_(false) {}

    // MessageLoopCurrentForIO::Watcher methods

    void OnSocketReadyToRead(SbSocket socket) override{};
    void OnSocketReadyToWrite(SbSocket socket) override;

    void set_watching(bool watching) { watching_ = watching; }

    bool watching() { return watching_; }

   private:
    UDPSocketStarboard* const socket_;
    bool watching_;

    DISALLOW_COPY_AND_ASSIGN(WriteAsyncWatcher);
  };

  void IncreaseWriteAsyncOutstanding(int increment) {
    write_async_outstanding_ += increment;
  }

  virtual bool InternalWatchSocket();
  virtual void InternalStopWatchingSocket();

  void SetWriteCallback(CompletionOnceCallback callback) {
    write_callback_ = std::move(callback);
  }

  void DidSendBuffers(SendResult buffers);
  void FlushPending();

  std::unique_ptr<WriteAsyncWatcher> write_async_watcher_;
  scoped_refptr<UDPSocketStarboardSender> sender_;
  std::unique_ptr<DatagramBufferPool> datagram_buffer_pool_;
  // |WriteAsync| pending writes, does not include buffers that have
  // been |PostTask*|'d.
  DatagramBuffers pending_writes_;

 private:
  // MessageLoopCurrentForIO::Watcher implementation.
  void OnSocketReadyToRead(SbSocket socket) override;
  void OnSocketReadyToWrite(SbSocket socket) override;

  int InternalWriteAsync(CompletionOnceCallback callback,
                         const NetworkTrafficAnnotationTag& traffic_annotation);
  bool WatchSocket();
  void StopWatchingSocket();

  void DoReadCallback(int rv);
  void DoWriteCallback(int rv);
  void DidCompleteRead();
  void DidCompleteWrite();

  // Handles stats and logging. |result| is the number of bytes transferred, on
  // success, or the net error code on failure. On success, LogRead takes in a
  // sockaddr and its length, which are mandatory, while LogWrite takes in an
  // optional IPEndPoint.
  void LogRead(int result, const char* bytes, const IPEndPoint* address) const;
  void LogWrite(int result, const char* bytes, const IPEndPoint* address) const;

  // Same as SendTo(), except that address is passed by pointer
  // instead of by reference. It is called from Write() with |address|
  // set to NULL.
  int SendToOrWrite(IOBuffer* buf,
                    int buf_len,
                    const IPEndPoint* address,
                    CompletionOnceCallback callback);

  int InternalConnect(const IPEndPoint& address);
  // Reads data from a UDP socket, if address is not nullptr, the sender's
  // address will be copied to |*address|.
  int InternalRecvFrom(IOBuffer* buf, int buf_len, IPEndPoint* address);
  int InternalSendTo(IOBuffer* buf, int buf_len, const IPEndPoint* address);

  // Applies |socket_options_| to |socket_|. Should be called before
  // Bind().
  int DoBind(const IPEndPoint& address);
  int RandomBind(const IPAddress& address);

  // Helpers for |WriteAsync|
  base::SequencedTaskRunner* GetTaskRunner();
  void OnWriteAsyncTimerFired();
  void LocalSendBuffers();
  void PostSendBuffers();
  int ResetLastAsyncResult();
  int ResetWrittenBytes();

  SbSocket socket_;
  bool is_connected_ = false;

  SbSocketAddressType address_type_;

  // Bitwise-or'd combination of SocketOptions. Specifies the set of
  // options that should be applied to |socket_| before Bind().
  int socket_options_;

  // How to do source port binding, used only when UDPSocket is part of
  // UDPClientSocket, since UDPServerSocket provides Bind.
  DatagramSocket::BindType bind_type_;

  // These are mutable since they're just cached copies to make
  // GetPeerAddress/GetLocalAddress smarter.
  mutable std::unique_ptr<IPEndPoint> local_address_;
  mutable std::unique_ptr<IPEndPoint> remote_address_;

  // The socket's SbSocketWaiter wrappers
  base::MessageLoopCurrentForIO::SocketWatcher socket_watcher_;

  // Various bits to support |WriteAsync()|.
  bool write_async_enabled_ = false;
  bool write_batching_active_ = false;
  bool write_multi_core_enabled_ = false;
  int write_async_max_buffers_ = 16;
  int written_bytes_ = 0;

  int last_async_result_;
  base::RepeatingTimer write_async_timer_;
  bool write_async_timer_running_;
  // Total writes in flight, including those |PostTask*|'d.
  int write_async_outstanding_;

  scoped_refptr<base::SequencedTaskRunner> task_runner_;

  // The buffer used by InternalRead() to retry Read requests
  IOBuffer* read_buf_;
  int read_buf_len_;
  IPEndPoint* recv_from_address_;

  // The buffer used by InternalWrite() to retry Write requests
  IOBuffer* write_buf_;
  int write_buf_len_;
  std::unique_ptr<IPEndPoint> send_to_address_;

  // External callback; called when read is complete.
  CompletionOnceCallback read_callback_;

  // External callback; called when write is complete.
  CompletionOnceCallback write_callback_;

  NetLogWithSource net_log_;

  // If set to true, the socket will use an optimized experimental code path.
  // By default, the value is set to false. To use the optimization, the
  // client of the socket has to opt-in by calling the
  // enable_experimental_recv_optimization() method.
  bool experimental_recv_optimization_enabled_ = false;

  THREAD_CHECKER(thread_checker_);

  // Used for alternate writes that are posted for concurrent execution.
  base::WeakPtrFactory<UDPSocketStarboard> weak_factory_;

  DISALLOW_COPY_AND_ASSIGN(UDPSocketStarboard);
};

}  // namespace net

#endif  // NET_SOCKET_UDP_SOCKET_STARBOARD_H_


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

using System.Text;

namespace HoiioSDK.NET
{
    /// <summary>
    /// CallService class provides acccess to voice-related Hoiio API.
    /// Currently, includes:
    ///  - Make a 2-way callback
    ///  - Make conference calls
    ///  - Get call rates
    ///  - Get call history
    ///  - Get call status
    ///  - Hangup a call
    ///  - Parse call notifications
    /// </summary>
    public class CallService : HttpService
    {
        private static string PARAM_DEST1 = "dest1";
        private static string PARAM_DEST2 = "dest2";
        private static string PARAM_CALLER_ID = "caller_id";
        private static string PARAM_TAG = "tag";
        private static string PARAM_NOTIFY_URL = "notify_url";
        private static string PARAM_FROM = "from";
        private static string PARAM_TO = "to";
        private static string PARAM_PAGE = "page";
        private static string PARAM_TXN_REF = "txn_ref";
        private static string PARAM_DEST = "dest";
        private static string PARAM_ROOM = "room";

        private static string URL_VOICE_CALL = "voice/call";
        private static string URL_VOICE_GET_RATE = "voice/get_rate";
        private static string URL_VOICE_GET_HISTORY = "voice/get_history";
        private static string URL_VOICE_QUERY_STATUS = "voice/query_status";
        private static string URL_VOICE_CONFERENCE = "voice/conference";
        private static string URL_VOICE_HANGUP = "voice/hangup";

        public static Dictionary<String, Object> makeCall(String appId, string accessToken, string dest1, string dest2,
                String callerId, string tag, string notifyUrl)
        {
            Dictionary<String, string> map = initParam(appId, accessToken);

            map.Add(PARAM_DEST2, dest2);
            map.Add(PARAM_DEST1, dest1);
            map.Add(PARAM_CALLER_ID, callerId);
            map.Add(PARAM_TAG, tag);
            map.Add(PARAM_NOTIFY_URL, notifyUrl);

            return doHttpPost(URL_VOICE_CALL, map);
        }

        public static Dictionary<String, Object> getRate(String appId, string accessToken,
                String dest1, string dest2)
        {
            Dictionary<String, string> map = initParam(appId, accessToken);

            map.Add(PARAM_DEST2, dest2);
            map.Add(PARAM_DEST1, dest1);

            return doHttpPost(URL_VOICE_GET_RATE, map);

        }

        public static Dictionary<String, Object> queryStatus(String appId, string accessToken,
                String txnRef)
        {
            Dictionary<String, string> map = initParam(appId, accessToken);

            map.Add(PARAM_TXN_REF, txnRef);

            return doHttpPost(URL_VOICE_QUERY_STATUS, map);
        }

        public static Dictionary<String, Object> getHistory(String appId, string accessToken,
                DateTime from, DateTime to, int page)
        {

            Dictionary<String, string> map = initParam(appId, accessToken);

           map.Add(PARAM_FROM, StringUtil.dateToString(from));
            map.Add(PARAM_TO, StringUtil.dateToString(to));
            map.Add(PARAM_PAGE, page < 0 ? null : page.ToString());

            return doHttpPost(URL_VOICE_GET_HISTORY, map);
        }

        public static Dictionary<String, Object> createConference(String appId, string accessToken,
                String dest, string room, string callerId, string tag,
                String notifyUrl)
        {
            Dictionary<String, string> map = initParam(appId, accessToken);

            map.Add(PARAM_DEST, dest);
            map.Add(PARAM_ROOM, room);
            map.Add(PARAM_CALLER_ID, callerId);
            map.Add(PARAM_TAG, tag);
            map.Add(PARAM_NOTIFY_URL, notifyUrl);

            return doHttpPost(URL_VOICE_CONFERENCE, map);
        }

        public static Dictionary<String, Object> hangup(String appId, string accessToken,
                String txnRef)
        {
            Dictionary<String, string> map = initParam(appId, accessToken);

            map.Add(PARAM_TXN_REF, txnRef);

            return doHttpPost(URL_VOICE_HANGUP, map);
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
@implementation GEBaseOperationQueue

- (void)addOperation:(NSOperation *)operation {

    __weak GEBaseOperationQueue *queue = self;
    __weak NSOperation *weakOp = operation;

    operation.completionBlock = ^() {

        if ([queue.delegate respondsToSelector:@selector(operationQueue:operationDidFinish:)]) {

            // Ensure this will run on the main thread
            dispatch_async(dispatch_get_main_queue(), ^(){
                [queue.delegate operationQueue:queue operationDidFinish:weakOp];
            });
        }
    };

    if ([self.delegate respondsToSelector:@selector(operationQueue:willAddOperation:)]) {

        // Ensure this will run on the main thread
        dispatch_async(dispatch_get_main_queue(), ^(){
            [self.delegate operationQueue:self willAddOperation:operation];
        });
    }

    [super addOperation:operation];
}

@end


text:
module.exports = {
    color: "green"
};


text:
package org.intellij.plugins.relaxNG.compact;

import com.intellij.codeInsight.daemon.EmptyResolveMessageProvider;
import com.intellij.codeInspection.*;
import com.intellij.lang.annotation.Annotation;
import com.intellij.lang.annotation.AnnotationHolder;
import com.intellij.lang.annotation.Annotator;
import com.intellij.openapi.util.TextRange;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiPolyVariantReference;
import com.intellij.psi.PsiReference;
import org.intellij.plugins.relaxNG.compact.psi.*;
import javax.annotation.Nonnull;

import java.text.MessageFormat;

/**
 * Created by IntelliJ IDEA.
* User: sweinreuter
* Date: 10.08.2007
*/
public class ReferenceAnnotator extends RncElementVisitor implements Annotator {
  private AnnotationHolder myHolder;

  @Override
  public synchronized void annotate(@Nonnull PsiElement psiElement, @Nonnull AnnotationHolder holder) {
    myHolder = holder;
    try {
      psiElement.accept(this);
    } finally {
      myHolder = null;
    }
  }

  @Override
  public void visitInclude(RncInclude include) {
    checkReferences(include.getReferences());
  }

  @Override
  public void visitExternalRef(RncExternalRef ref) {
    checkReferences(ref.getReferences());
  }

  @Override
  public void visitRef(RncRef pattern) {
    checkReferences(pattern.getReferences());
  }

  @Override
  public void visitParentRef(RncParentRef pattern) {
    checkReferences(pattern.getReferences());
  }

  @Override
  public void visitName(RncName name) {
    checkReferences(name.getReferences());
  }

  private void checkReferences(PsiReference[] references) {
    for (PsiReference reference : references) {
      if (!reference.isSoft()) {
        if (reference.resolve() == null) {
          if (reference instanceof PsiPolyVariantReference) {
            final PsiPolyVariantReference pvr = (PsiPolyVariantReference)reference;
            if (pvr.multiResolve(false).length == 0) {
              addError(reference);
            }
          } else {
            addError(reference);
          }
        }
      }
    }
  }

  private void addError(PsiReference reference) {
    final TextRange rangeInElement = reference.getRangeInElement();
    final TextRange range = TextRange.from(reference.getElement().getTextRange().getStartOffset()
            + rangeInElement.getStartOffset(), rangeInElement.getLength());

    final Annotation annotation;
    if (reference instanceof EmptyResolveMessageProvider) {
      final String s = ((EmptyResolveMessageProvider)reference).getUnresolvedMessagePattern();
      annotation = myHolder.createErrorAnnotation(range, MessageFormat.format(s, reference.getCanonicalText()));
    }
    else {
      annotation = myHolder.createErrorAnnotation(range, "Cannot resolve symbol");
    }
    annotation.setHighlightType(ProblemHighlightType.LIKE_UNKNOWN_SYMBOL);

    if (reference instanceof LocalQuickFixProvider) {
      LocalQuickFix[] fixes = ((LocalQuickFixProvider)reference).getQuickFixes();
      if (fixes != null) {
        InspectionManager inspectionManager = InspectionManager.getInstance(reference.getElement().getProject());
        for (LocalQuickFix fix : fixes) {
          ProblemDescriptor descriptor = inspectionManager.createProblemDescriptor(reference.getElement(), annotation.getMessage(), fix,
                                                                                ProblemHighlightType.LIKE_UNKNOWN_SYMBOL, true);
          annotation.registerFix(fix, null, null, descriptor);
        }
      }
    }
  }
}


text:
namespace mongocxx {
MONGOCXX_INLINE_NAMESPACE_BEGIN
namespace options {

///
/// Class representing the optional arguments to a MongoDB distinct command.
///
class MONGOCXX_API distinct {
   public:
    ///
    /// Sets the collation for this operation.
    ///
    /// @param collation
    ///   The new collation.
    ///
    /// @return
    ///   A reference to the object on which this member function is being called.  This facilitates
    ///   method chaining.
    ///
    /// @see https://docs.mongodb.com/master/reference/command/distinct/
    ///
    distinct& collation(bsoncxx::document::view_or_value collation);

    ///
    /// Retrieves the current collation for this operation.
    ///
    /// @return
    ///   The current collation.
    ///
    /// @see https://docs.mongodb.com/master/reference/command/distinct/
    ///
    const stdx::optional<bsoncxx::document::view_or_value>& collation() const;

    ///
    /// Sets the maximum amount of time for this operation to run (server-side) in milliseconds.
    ///
    /// @param max_time
    ///   The max amount of time (in milliseconds).
    ///
    /// @return
    ///   A reference to the object on which this member function is being called.  This facilitates
    ///   method chaining.
    ///
    /// @see https://docs.mongodb.com/master/reference/command/distinct/
    ///
    distinct& max_time(std::chrono::milliseconds max_time);

    ///
    /// The current max_time setting.
    ///
    /// @return The current max time (in milliseconds).
    ///
    /// @see https://docs.mongodb.com/master/reference/command/distinct/
    ///
    const stdx::optional<std::chrono::milliseconds>& max_time() const;

    ///
    /// Sets the read_preference for this operation.
    ///
    /// @param rp
    ///   The new read_preference.
    ///
    /// @return
    ///   A reference to the object on which this member function is being called.  This facilitates
    ///   method chaining.
    ///
    /// @see https://docs.mongodb.com/master/reference/command/distinct/
    ///
    distinct& read_preference(class read_preference rp);

    ///
    /// The current read_preference for this operation.
    ///
    /// @return the current read_preference.
    ///
    /// @see https://docs.mongodb.com/master/reference/command/distinct/
    ///
    const stdx::optional<class read_preference>& read_preference() const;

   private:
    stdx::optional<bsoncxx::document::view_or_value> _collation;
    stdx::optional<std::chrono::milliseconds> _max_time;
    stdx::optional<class read_preference> _read_preference;
};

}  // namespace options
MONGOCXX_INLINE_NAMESPACE_END
}  // namespace mongocxx

#include <mongocxx/config/postlude.hpp>


text:
"""
The Armenian calendar begins on 11 July 552 (Julian) and has two modes of
reckoning. The first is the invariant-length version consisting of 12 months
of 30 days each and five epagomenal days; the second is the version
established by Yovhannes Sarkawag in 1084, which fixed the first day of the
year with respect to the Julian calendar and added a sixth epagomenal day
every four years.

By default the invariant calendar is used, but the Sarkawag calendar can be
used beginning with the Armenian year 533 (11 August 1084) by passing the
parameter ``method='sarkawag'`` to the relevant functions.
"""

from math import trunc

from . import gregorian, julian
from .utils import jwday, monthcalendarhelper

EPOCH = 1922501.5  # beginning of proleptic year 0, day 0 of the moveable calendar
EPOCH_SARKAWAG = 2117210.5  # last day of Sarkawag's first cycle
MONTHS = [
    "nawasard",
    "hoṙi",
    "sahmi",
    "trē",
    "kʿałocʿ",
    "aracʿ",
    "mehekan",
    "areg",
    "ahekan",
    "mareri",
    "margacʿ",
    "hroticʿ",
    "aweleacʿ",
]
MONTHS_ARM = [
    "նաւասարդ",
    "հոռի",
    "սահմի",
    "տրէ",
    "քաղոց",
    "արաց",
    "մեհեկան",
    "արեգ",
    "ահեկան",
    "մարերի",
    "մարգաց",
    "հրոտից",
    "աւելեաց",
]

def _valid_date(year, month, day, method=None):
    try:
        assert 1 <= month <= 13, "Month out of range"
    except AssertionError as error:
        raise ValueError from error

    day_max = 30
    method = method or "moveable"

    if method.lower() == "sarkawag":
        year_min = 533
        if month == 13:
            day_max = 6 if leap(year) else 5

    else:
        year_min = 1
        if month == 13:
            day_max = 5

    try:
        assert year >= year_min, "Year out of range for Armenian calendar ({} method)".format(method)
    except AssertionError as err:
        raise ValueError from err

    try:
        assert 1 <= day <= day_max, "Day out of range"
    except AssertionError as err:
        raise ValueError from err

    return True

def leap(year):
    """Return true if the year was a leap year under the system of Sarkawag"""
    if year < 533:
        return False
    return year % 4 == 0

def to_jd(year, month, day, method=None):
    """Convert Armenian date to Julian day count. Use the method of Sarkawag if requested."""
    _valid_date(year, month, day, method)
    yeardays = (month - 1) * 30 + day
    if method == "sarkawag":
        yeardelta = year - 533
        leapdays = trunc(yeardelta / 4)
        return EPOCH_SARKAWAG + (365 * yeardelta) + leapdays + yeardays

    return EPOCH + (365 * year) + yeardays

def from_jd(jd, method=None):
    """Convert a Julian day count to an Armenian date. Use the method of Sarkawag if requested."""
    if method == "sarkawag":
        dc = jd - EPOCH_SARKAWAG
        if dc < 0:
            raise ValueError("Day count out of range for method")
        years = trunc(dc / 365.25)
        yeardays = dc - (365 * years + trunc(years / 4))
        if yeardays == 0:
            yeardays = 366 if years % 4 == 0 else 365
            years -= 1
        months = trunc((yeardays - 1) / 30)
        days = yeardays - (30 * months)
        return years + 533, months + 1, trunc(days)

    dc = jd - EPOCH

    if dc < 0:
        raise ValueError("Day count out of range")

    years = trunc((dc - 1) / 365)
    months = trunc(((dc - 1) % 365) / 30)
    days = dc - (365 * years) - (30 * months)

    return years, months + 1, trunc(days)

def to_julian(year, month, day, method=None):
    """Convert an Armenian date to a Julian date"""
    return julian.from_jd(to_jd(year, month, day, method))

def from_julian(year, month, day, method=None):
    """Convert a Julian date to an Armenian date"""
    return from_jd(julian.to_jd(year, month, day), method)

def to_gregorian(year, month, day, method=None):
    """Convert an Armenian date to a Gregorian date"""
    return gregorian.from_jd(to_jd(year, month, day, method))

def from_gregorian(year, month, day, method=None):
    """Convert a Gregorian date to an Armenian date"""
    return from_jd(gregorian.to_jd(year, month, day), method)

def month_length(year, month, method=None):
    if month > 13:
        raise ValueError("Requested month %d doesn't exist" % month)

    if month == 13:
        return 6 if (method == "sarkawag" and leap(year)) else 5

    return 30

def monthcalendar(year, month, method=None):
    """Returns a matrix representing a month's calendar.
    Each row represents a week; days outside of the month are represented by zeros."""
    start_weekday = jwday(to_jd(year, month, 1, method))
    monthlen = month_length(year, month, method)
    return monthcalendarhelper(start_weekday, monthlen)

def format(year, month, day, lang=None):
    """Convert an Armenian date into a string with the format DD MONTH YYYY."""
    # pylint: disable=redefined-builtin
    lang = lang or "en"
    if lang[0:2] == 'hy' or lang[0:2] == 'am' or lang == 'arm':
        month_name = MONTHS_ARM[month - 1]
    else:
        month = month_name = MONTHS[month - 1]

    return "{0:d} {1:} {2:d}".format(day, month_name, year)

def tostring(year, month, day, lang=None):
    """Kept for backwards compatibility, the format function name will be standard across the library"""
    return format(year, month, day, lang)


text:
var faye = require('../../build/node/faye-node');

var endpoint = process.argv[2] || 'http://localhost:8000/bayeux',
    client   = new faye.Client(endpoint),
    n        = 0;

setInterval(function() {
  client.publish('/chat/tick', {n: ++n});
}, 1000);


text:
package storage::netapp::ontap::restapi::plugin;

use strict;
use warnings;
use base qw(centreon::plugins::script_custom);

sub new {
    my ( $class, %options ) = @_;
    my $self = $class->SUPER::new(package => __PACKAGE__, %options);
    bless $self, $class;

    $self->{version} = '0.1';
    $self->{modes} = {
        'cluster'      => 'storage::netapp::ontap::restapi::mode::cluster',
        'hardware'     => 'storage::netapp::ontap::restapi::mode::hardware',
        'list-volumes' => 'storage::netapp::ontap::restapi::mode::listvolumes',
        'luns'         => 'storage::netapp::ontap::restapi::mode::luns',
        'snapmirrors'  => 'storage::netapp::ontap::restapi::mode::snapmirrors',
        'volumes'      => 'storage::netapp::ontap::restapi::mode::volumes',
        'aggregates'   => 'storage::netapp::ontap::restapi::mode::aggregates'
    };

    $self->{custom_modes}{api} = 'storage::netapp::ontap::restapi::custom::api';
    return $self;
}

1;

__END__

=head1 PLUGIN DESCRIPTION

Check NetApp ONTAP using Rest API.
ONTAP >= 9.6 version.

=cut


text:
/* http://meyerweb.com/eric/tools/css/reset/
   v2.0 | 20110126
   License: none (public domain)
*/

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 100%;
	font: inherit;
	vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
	display: block;
}
body {
	line-height: 1;
}
ol, ul {
	list-style: none;
}
blockquote, q {
	quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
	content: '';
	content: none;
}
table {
	border-collapse: collapse;
	border-spacing: 0;
}

/* Default Styles
--------------------------------------------------------------------*/

body {
	font-family: 'Droid Sans', sans-serif;;
}

.clearfix {
	clear: both;
}

.wrap {
    width: auto;
}

nav {
	padding: 0 10px;
	position: relative;
}

.menu li {
	float: left;
	position: relative;
}

.menu li a {
	color: #444;
	display: block;
	font-size: 14px;
	line-height: 20px;
	padding: 6px 12px;
	margin: 8px 8px;
	vertical-align: middle;
	text-decoration: none;
}

.menu li a:hover {
	background: -webkit-gradient(linear, center top, center bottom, from(#ededed), to(#fff));
	background-image: linear-gradient(#ededed, #fff);
	border-radius: 12px;
	box-shadow: inset 0px 0px 1px 1px rgba(0,0,0,0.1);
	color: #222;
}

/* Dropdown styles */

.menu ul {
	position: absolute;
	left: -9999px;
	list-style: none;
	opacity: 0;
	transition: opacity 1s ease;
}

.menu ul li {
	float: none;
}

.menu ul a {
	white-space: nowrap;
}

/* Displays the dropdown on hover and moves back into position */
.menu li:hover ul {
	background: rgba(255,255,255,0.7);
	border-radius: 0 0 6px 6px;
	box-shadow: inset 0px 2px 4px rgba(0,0,0,0.4);
	left: 5px;
	opacity: 1;
}

/* Persistant Hover State */
.menu li:hover a {
	background: -webkit-gradient(linear, center top, center bottom, from(#ccc), to(#ededed));
	background-image: linear-gradient(#ccc, #ededed);
	border-radius: 12px;
	box-shadow: inset 0px 0px 1px 1px rgba(0,0,0,0.1);
	color: #222;
}

.menu li:hover ul a {
	background: none;
	border-radius: 0;
	box-shadow: none;
}

.menu li:hover ul li a:hover {
	background: -webkit-gradient(linear, center top, center bottom, from(#eee), to(#fff));
	background-image: linear-gradient(#ededed, #fff);
	border-radius: 12px;
	box-shadow: inset 0px 0px 4px 2px rgba(0,0,0,0.3);
}

.cd-top {
  display: inline-block;
  height: 40px;
  width: 40px;
  position: fixed;
  bottom: 40px;
  right: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
  /* image replacement properties */
  overflow: hidden;
  text-indent: 100%;
  white-space: nowrap;
  background: rgba(232, 98, 86, 0.8) url(../img/top.gif) no-repeat center 50%;
  visibility: hidden;
  opacity: 0;
  -webkit-transition: opacity .3s 0s, visibility 0s .3s;
  -moz-transition: opacity .3s 0s, visibility 0s .3s;
  transition: opacity .3s 0s, visibility 0s .3s;
}
.cd-top.cd-is-visible, .cd-top.cd-fade-out, .no-touch .cd-top:hover {
  -webkit-transition: opacity .3s 0s, visibility 0s 0s;
  -moz-transition: opacity .3s 0s, visibility 0s 0s;
  transition: opacity .3s 0s, visibility 0s 0s;
}
.cd-top.cd-is-visible {
  /* the button becomes visible */
  visibility: visible;
  opacity: 1;
}
.cd-top.cd-fade-out {
  /* if the user keeps scrolling down, the button is out of focus and becomes less visible */
  opacity: .5;
}
.no-touch .cd-top:hover {
  background-color: #e86256;
  opacity: 1;
}
@media only screen and (min-width: 768px) {
  .cd-top {
    right: 20px;
    bottom: 20px;
  }
}
@media only screen and (min-width: 1024px) {
  .cd-top {
    height: 60px;
    width: 60px;
    right: 30px;
    bottom: 30px;
  }
}


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

namespace IDL4_EA_Extension
{
    public interface TextOutputInterface
    {
        void OutputText(int depth, String text);
        void OutputText(String text);
        void OutputTextLine(int depth, String text);
        void OutputTextLine(String text);
        void OutputTextLine();

        void Clear();
        int GetCurrentPosition();
        void ClearPositionRange(int beginPosition, int endPosition);

        void SaveToFile(String filePath, String[] preambleLines);
    }
}


text:
require File.expand_path('../../../spec_helper', __FILE__)

describe "Class#initialize" do
  it "is private" do
    Class.should have_private_method(:initialize)
  end

  it "raises a TypeError when called on already initialized classes" do
    lambda{
      Fixnum.send :initialize
    }.should raise_error(TypeError)

    lambda{
      Object.send :initialize
    }.should raise_error(TypeError)
  end

  ruby_version_is "1.9" do
    # See [redmine:2601]
    it "raises a TypeError when called on BasicObject" do
      lambda{
        BasicObject.send :initialize
      }.should raise_error(TypeError)
    end
  end

  describe "when given the Class" do
    before(:each) do
      @uninitialized = Class.allocate
    end

    ruby_version_is ""..."1.9" do
      it "becomes a subclass of the Class" do
        @uninitialized.send :initialize, Class
        @uninitialized.superclass.should equal(Class)
      end
    end

    ruby_version_is "1.9" do
      it "raises a TypeError" do
        lambda{@uninitialized.send(:initialize, Class)}.should raise_error(TypeError)
      end
    end
  end
end


text:
<?xml version="1.0" encoding="UTF-8"?>

<!--L
  Copyright Washington University in St. Louis, SemanticBits, Persistent Systems, Krishagni.

  Distributed under the OSI-approved BSD 3-Clause License.
  See http://ncip.github.com/commons-module/LICENSE.txt for details.
L-->

<ivy-module version="2.0">
	<info organisation="gov.nih.nci.washu-commons" module="washu-commons" revision="1.1.8"
		status="release" />
	<publications>
		<artifact name="washu-commons" type="jar" />
	</publications>
</ivy-module>


text:
<?php

namespace Application\Sonata\UserBundle\Controller;

use Symfony\Component\HttpFoundation\RedirectResponse;
use FOS\UserBundle\Controller\RegistrationController as BaseController;
use Symfony\Component\Security\Core\SecurityContext;

class SecurityController extends BaseController
{
    public function loginAction()
    {
        $request = $this->container->get('request');
        /* @var $request \Symfony\Component\HttpFoundation\Request */
        $session = $request->getSession();
        /* @var $session \Symfony\Component\HttpFoundation\Session\Session */

        // get the error if any (works with forward and redirect -- see below)
        if ($request->attributes->has(SecurityContext::AUTHENTICATION_ERROR)) {
            $error = $request->attributes->get(SecurityContext::AUTHENTICATION_ERROR);
        } elseif (null !== $session && $session->has(SecurityContext::AUTHENTICATION_ERROR)) {
            $error = $session->get(SecurityContext::AUTHENTICATION_ERROR);
            $session->remove(SecurityContext::AUTHENTICATION_ERROR);
        } else {
            $error = '';
        }

        if ($error) {
            // TODO: this is a potential security risk (see http://trac.symfony-project.org/ticket/9523)
            $error = $error->getMessage();
        }
        // last username entered by the user
        $lastUsername = (null === $session) ? '' : $session->get(SecurityContext::LAST_USERNAME);

        $csrfToken = $this->container->get('form.csrf_provider')->generateCsrfToken('authenticate');

        return $this->renderLogin(array(
            'last_username' => $lastUsername,
            'error'         => $error,
            'csrf_token' => $csrfToken,
        ));
    }

    /**
     * Renders the login template with the given parameters. Overwrite this function in
     * an extended controller to provide additional data for the login template.
     *
     * @param array $data
     *
     * @return \Symfony\Component\HttpFoundation\Response
     */
    protected function renderLogin(array $data)
    {
        $template = sprintf('FOSUserBundle:Security:login.html.%s', $this->container->getParameter('fos_user.template.engine'));

        return $this->container->get('templating')->renderResponse($template, $data);
    }

    public function loginWithCodigoAction()
    {
        $request = $this->container->get('request');
        /* @var $request \Symfony\Component\HttpFoundation\Request */
        $session = $request->getSession();
        /* @var $session \Symfony\Component\HttpFoundation\Session\Session */

        // get the error if any (works with forward and redirect -- see below)
        if ($request->attributes->has(SecurityContext::AUTHENTICATION_ERROR)) {
            $error = $request->attributes->get(SecurityContext::AUTHENTICATION_ERROR);
        } elseif (null !== $session && $session->has(SecurityContext::AUTHENTICATION_ERROR)) {
            $error = $session->get(SecurityContext::AUTHENTICATION_ERROR);
            $session->remove(SecurityContext::AUTHENTICATION_ERROR);
        } else {
            $error = '';
        }

        if ($error) {
            // TODO: this is a potential security risk (see http://trac.symfony-project.org/ticket/9523)
            $error = $error->getMessage();
        }
        // last username entered by the user
        $lastUsername = (null === $session) ? '' : $session->get(SecurityContext::LAST_USERNAME);

        $csrfToken = $this->container->get('form.csrf_provider')->generateCsrfToken('authenticate');

        return $this->renderLoginWithCodigo(array(
            'last_username' => $lastUsername,
            'error'         => $error,
            'csrf_token' => $csrfToken,
        ));
    }

    public function dateLoginAction()
    {
        $request = $this->container->get('request');
        /* @var $request \Symfony\Component\HttpFoundation\Request */
        $session = $request->getSession();
        /* @var $session \Symfony\Component\HttpFoundation\Session\Session */

        // get the error if any (works with forward and redirect -- see below)
        if ($request->attributes->has(SecurityContext::AUTHENTICATION_ERROR)) {
            $error = $request->attributes->get(SecurityContext::AUTHENTICATION_ERROR);
        } elseif (null !== $session && $session->has(SecurityContext::AUTHENTICATION_ERROR)) {
            $error = $session->get(SecurityContext::AUTHENTICATION_ERROR);
            $session->remove(SecurityContext::AUTHENTICATION_ERROR);
        } else {
            $error = '';
        }

        if ($error) {
            // TODO: this is a potential security risk (see http://trac.symfony-project.org/ticket/9523)
            $error = $error->getMessage();
        }
        // last username entered by the user
        $lastUsername = (null === $session) ? '' : $session->get(SecurityContext::LAST_USERNAME);

        $csrfToken = $this->container->get('form.csrf_provider')->generateCsrfToken('authenticate');

        return $this->genericRender(array(
            'template' => 'dateLogin',
            'last_username' => $lastUsername,
            'error'         => $error,
            'csrf_token' => $csrfToken,
        ));
    }

    /**
     * Renders the login template with the given parameters. Overwrite this function in
     * an extended controller to provide additional data for the login template.
     *
     * @param array $data
     *
     * @return \Symfony\Component\HttpFoundation\Response
     */
    protected function genericRender(array $data)
    {
        $template = sprintf('FOSUserBundle:Security:%s.html.%s', $data['template'], $this->container->getParameter('fos_user.template.engine'));

        return $this->container->get('templating')->renderResponse($template, $data);
    }

    /**
     * Renders the login template with the given parameters. Overwrite this function in
     * an extended controller to provide additional data for the login template.
     *
     * @param array $data
     *
     * @return \Symfony\Component\HttpFoundation\Response
     */
    protected function renderLoginWithCodigo(array $data)
    {
        $template = sprintf('FOSUserBundle:Security:loginWithCodigo.html.%s', $this->container->getParameter('fos_user.template.engine'));

        return $this->container->get('templating')->renderResponse($template, $data);
    }

}


text:
//
//  CreateAndVisualizeImgSurrogateSemanticAction.cs
//  s.im.pl serialization
//
//  Generated by DotNetTranslator on 11/16/10.
//  Copyright 2010 Interface Ecology Lab.
//

using System;
using System.Collections.Generic;
using System.Diagnostics;
using Ecologylab.BigSemantics.Collecting;
using Ecologylab.BigSemantics.MetadataNS.Builtins;
using Ecologylab.BigSemantics.MetaMetadataNS;
using Simpl.Fundamental.Net;
using Simpl.Serialization.Attributes;
using Ecologylab.BigSemantics.Actions;

namespace Ecologylab.BigSemantics.Actions
{
	/// <summary>
	/// missing java doc comments or could not find the source file.
	/// </summary>
	[SimplInherit]
	[SimplTag("create_and_visualize_img_surrogate")]
    public class CreateAndVisualizeImgSurrogateSemanticOperation : SemanticOperation
	{
        public CreateAndVisualizeImgSurrogateSemanticOperation()
		{ }

	    public override String GetOperationName()
	    {
		    return SemanticOperationStandardMethods.CreateAndVisualizeImgSurrogate;
	    }

	    public override void HandleError()
	    {
	    }

/*        public override Object Perform(Object obj)
        {
            return null;
        }
*/
	    public override Object Perform(Object obj)
	    {
		    Document source	= ResolveSourceDocument();

		    Image image = (Image) GetArgumentObject(SemanticOperationNamedArguments.Metadata);
		    if (image == null)
		    {
			    ParsedUri imagePURL = (ParsedUri) GetArgumentObject(SemanticOperationNamedArguments.ImagePurl);
/*			    if (imagePURL != null)
			    {
				    image								= sessionScope.GetOrConstructImage(imagePURL);

				    //TODO -- if it already exists: (1) do we need to download??
				    //															(2) should we merge metadata
			    }
*/
		    }
		    else
		    {
			    //TODO add to global collections?! if already there merge!
		    }
		    if (image != null && image.Location != null)
		    {
			    image.SemanticsSessionScope = sessionScope as SemanticsSessionScope;

			    Document mixin = (Document) GetArgumentObject(SemanticOperationNamedArguments.Mixin);
			    if (mixin != null)
				    image.AddMixin(mixin);

			    Object captionObject = GetArgumentObject(SemanticOperationNamedArguments.Caption);
                String caption = (captionObject != null) ? captionObject.ToString() : null;

                int width  		 		 		= GetArgumentInteger(SemanticOperationNamedArguments.Width, 0);
			    int height  		 		 	= GetArgumentInteger(SemanticOperationNamedArguments.Height, 0);

			    ParsedUri hrefPURL 		= (ParsedUri) GetArgumentObject(SemanticOperationNamedArguments.Href);
			    Document outlink 			= (Document) GetArgumentObject(SemanticOperationNamedArguments.HrefMetadata);
			    //if (hrefPURL != null & outlink == null)
			//	    outlink				= sessionScope.GetOrConstructDocument(hrefPURL);

			    ImageClipping imageClipping	= image.ConstructClipping(source, outlink, caption, null);
                source.AddClipping(imageClipping);

		        DocumentClosure imageClosure;

                if (this.sessionScope is SemanticsSessionScope)
                {
                    imageClosure = image.GetOrConstructClosure();

                    if (documentParser != null)
                    {
                    }
                    else
                    {
                        //imageClosure.RequestMetadata();
                    }
                }
                else
		        {
		            image.GetOrConstructClosure();
		        }

			    return image;
		    }
		    else
		    {
			    MetaMetadata mm	= GetMetaMetadata();
			    String mmString	= mm != null ? mm.Name : "Couldn't getMetaMetadata()";
			    Debug.WriteLine("Can't createAndVisualizeImgSurrogate because null PURL: " + mmString
					    + " - " + source.Location);
		    }

		    return null;
	    }

	}
}