text:
"""
A lightweight wrapper around Python's sqlite3 database, with a dict-like interface
and multi-thread access support::

>>> mydict = SqliteDict('some.db', autocommit=True) # the mapping will be persisted to file `some.db`
>>> mydict['some_key'] = any_picklable_object
>>> print mydict['some_key']
>>> print len(mydict) # etc... all dict functions work

Pickle is used internally to serialize the values. Keys are strings.

If you don't use autocommit (default is no autocommit for performance), then
don't forget to call `mydict.commit()` when done with a transaction.

"""

import sqlite3
import os
import sys
import tempfile
import random
import logging
import traceback

from threading import Thread

try:
    __version__ = __import__('pkg_resources').get_distribution('sqlitedict').version
except:
    __version__ = '?'

major_version = sys.version_info[0]
if major_version < 3:  # py <= 2.x
    if sys.version_info[1] < 5:  # py <= 2.4
        raise ImportError("sqlitedict requires python 2.5 or higher (python 3.3 or higher supported)")

    # necessary to use exec()_ as this would be a SyntaxError in python3.
    # this is an exact port of six.reraise():
    def exec_(_code_, _globs_=None, _locs_=None):
        """Execute code in a namespace."""
        if _globs_ is None:
            frame = sys._getframe(1)
            _globs_ = frame.f_globals
            if _locs_ is None:
                _locs_ = frame.f_locals
            del frame
        elif _locs_ is None:
            _locs_ = _globs_
        exec("""exec _code_ in _globs_, _locs_""")

    exec_("def reraise(tp, value, tb=None):\n"
          "    raise tp, value, tb\n")
else:
    def reraise(tp, value, tb=None):
        if value is None:
            value = tp()
        if value.__traceback__ is not tb:
            raise value.with_traceback(tb)
        raise value

try:
    from cPickle import dumps, loads, HIGHEST_PROTOCOL as PICKLE_PROTOCOL
except ImportError:
    from pickle import dumps, loads, HIGHEST_PROTOCOL as PICKLE_PROTOCOL

# some Python 3 vs 2 imports
try:
    from collections import UserDict as DictClass
except ImportError:
    from UserDict import DictMixin as DictClass

try:
    from queue import Queue
except ImportError:
    from Queue import Queue

logger = logging.getLogger(__name__)

def open(*args, **kwargs):
    """See documentation of the SqliteDict class."""
    return SqliteDict(*args, **kwargs)

def encode(obj):
    """Serialize an object using pickle to a binary format accepted by SQLite."""
    return sqlite3.Binary(dumps(obj, protocol=PICKLE_PROTOCOL))

def decode(obj):
    """Deserialize objects retrieved from SQLite."""
    return loads(bytes(obj))

class SqliteDict(DictClass):
    VALID_FLAGS = ['c', 'r', 'w', 'n']

    def __init__(self, filename=None, tablename='unnamed', flag='c',
                 autocommit=False, journal_mode="DELETE", encode=encode, decode=decode):
        """
        Initialize a thread-safe sqlite-backed dictionary. The dictionary will
        be a table `tablename` in database file `filename`. A single file (=database)
        may contain multiple tables.

        If no `filename` is given, a random file in temp will be used (and deleted
        from temp once the dict is closed/deleted).

        If you enable `autocommit`, changes will be committed after each operation
        (more inefficient but safer). Otherwise, changes are committed on `self.commit()`,
        `self.clear()` and `self.close()`.

        Set `journal_mode` to 'OFF' if you're experiencing sqlite I/O problems
        or if you need performance and don't care about crash-consistency.

        The `flag` parameter. Exactly one of:
          'c': default mode, open for read/write, creating the db/table if necessary.
          'w': open for r/w, but drop `tablename` contents first (start with empty table)
          'r': open as read-only
          'n': create a new database (erasing any existing tables, not just `tablename`!).

        The `encode` and `decode` parameters are used to customize how the values
        are serialized and deserialized.
        The `encode` parameter must be a function that takes a single Python
        object and returns a serialized representation.
        The `decode` function must be a function that takes the serialized
        representation produced by `encode` and returns a deserialized Python
        object.
        The default is to use pickle.

        """
        self.in_temp = filename is None
        if self.in_temp:
            randpart = hex(random.randint(0, 0xffffff))[2:]
            filename = os.path.join(tempfile.gettempdir(), 'sqldict' + randpart)

        if flag not in SqliteDict.VALID_FLAGS:
            raise RuntimeError("Unrecognized flag: %s" % flag)
        self.flag = flag

        if flag == 'n':
            if os.path.exists(filename):
                os.remove(filename)

        dirname = os.path.dirname(filename)
        if dirname:
            if not os.path.exists(dirname):
                raise RuntimeError('Error! The directory does not exist, %s' % dirname)

        self.filename = filename
        if '"' in tablename:
            raise ValueError('Invalid tablename %r' % tablename)
        self.tablename = tablename
        self.autocommit = autocommit
        self.journal_mode = journal_mode
        self.encode = encode
        self.decode = decode

        logger.info("opening Sqlite table %r in %s" % (tablename, filename))
        MAKE_TABLE = 'CREATE TABLE IF NOT EXISTS "%s" (key TEXT PRIMARY KEY, value BLOB)' % self.tablename
        self.conn = self._new_conn()
        self.conn.execute(MAKE_TABLE)
        self.conn.commit()
        if flag == 'w':
            self.clear()

    def _new_conn(self):
        return SqliteMultithread(self.filename, autocommit=self.autocommit, journal_mode=self.journal_mode)

    def __enter__(self):
        if not hasattr(self, 'conn') or self.conn is None:
            self.conn = self._new_conn()
        return self

    def __exit__(self, *exc_info):
        self.close()

    def __str__(self):
        return "SqliteDict(%s)" % (self.filename)

    def __repr__(self):
        return str(self)  # no need of something complex

    def __len__(self):
        # `select count (*)` is super slow in sqlite (does a linear scan!!)
        # As a result, len() is very slow too once the table size grows beyond trivial.
        # We could keep the total count of rows ourselves, by means of triggers,
        # but that seems too complicated and would slow down normal operation
        # (insert/delete etc).
        GET_LEN = 'SELECT COUNT(*) FROM "%s"' % self.tablename
        rows = self.conn.select_one(GET_LEN)[0]
        return rows if rows is not None else 0

    def __bool__(self):
        # No elements is False, otherwise True
        GET_MAX = 'SELECT MAX(ROWID) FROM "%s"' % self.tablename
        m = self.conn.select_one(GET_MAX)[0]
        # Explicit better than implicit and bla bla
        return True if m is not None else False

    def iterkeys(self):
        GET_KEYS = 'SELECT key FROM "%s" ORDER BY rowid' % self.tablename
        for key in self.conn.select(GET_KEYS):
            yield key[0]

    def itervalues(self):
        GET_VALUES = 'SELECT value FROM "%s" ORDER BY rowid' % self.tablename
        for value in self.conn.select(GET_VALUES):
            yield self.decode(value[0])

    def iteritems(self):
        GET_ITEMS = 'SELECT key, value FROM "%s" ORDER BY rowid' % self.tablename
        for key, value in self.conn.select(GET_ITEMS):
            yield key, self.decode(value)

    def keys(self):
        return self.iterkeys() if major_version > 2 else list(self.iterkeys())

    def values(self):
        return self.itervalues() if major_version > 2 else list(self.itervalues())

    def items(self):
        return self.iteritems() if major_version > 2 else list(self.iteritems())

    def __contains__(self, key):
        HAS_ITEM = 'SELECT 1 FROM "%s" WHERE key = ?' % self.tablename
        return self.conn.select_one(HAS_ITEM, (key,)) is not None

    def __getitem__(self, key):
        GET_ITEM = 'SELECT value FROM "%s" WHERE key = ?' % self.tablename
        item = self.conn.select_one(GET_ITEM, (key,))
        if item is None:
            raise KeyError(key)
        return self.decode(item[0])

    def __setitem__(self, key, value):
        if self.flag == 'r':
            raise RuntimeError('Refusing to write to read-only SqliteDict')

        ADD_ITEM = 'REPLACE INTO "%s" (key, value) VALUES (?,?)' % self.tablename
        self.conn.execute(ADD_ITEM, (key, self.encode(value)))

    def __delitem__(self, key):
        if self.flag == 'r':
            raise RuntimeError('Refusing to delete from read-only SqliteDict')

        if key not in self:
            raise KeyError(key)
        DEL_ITEM = 'DELETE FROM "%s" WHERE key = ?' % self.tablename
        self.conn.execute(DEL_ITEM, (key,))

    def update(self, items=(), **kwds):
        if self.flag == 'r':
            raise RuntimeError('Refusing to update read-only SqliteDict')

        try:
            items = items.items()
        except AttributeError:
            pass
        items = [(k, self.encode(v)) for k, v in items]

        UPDATE_ITEMS = 'REPLACE INTO "%s" (key, value) VALUES (?, ?)' % self.tablename
        self.conn.executemany(UPDATE_ITEMS, items)
        if kwds:
            self.update(kwds)

    def __iter__(self):
        return self.iterkeys()

    def clear(self):
        if self.flag == 'r':
            raise RuntimeError('Refusing to clear read-only SqliteDict')

        CLEAR_ALL = 'DELETE FROM "%s";' % self.tablename  # avoid VACUUM, as it gives "OperationalError: database schema has changed"
        self.conn.commit()
        self.conn.execute(CLEAR_ALL)
        self.conn.commit()

    @staticmethod
    def get_tablenames(filename):
        """get the names of the tables in an sqlite db as a list"""
        if not os.path.isfile(filename):
            raise IOError('file %s does not exist' % (filename))
        GET_TABLENAMES = 'SELECT name FROM sqlite_master WHERE type="table"'
        with sqlite3.connect(filename) as conn:
            cursor = conn.execute(GET_TABLENAMES)
            res = cursor.fetchall()

        return [name[0] for name in res]

    def commit(self, blocking=True):
        """
        Persist all data to disk.

        When `blocking` is False, the commit command is queued, but the data is
        not guaranteed persisted (default implication when autocommit=True).
        """
        if self.conn is not None:
            self.conn.commit(blocking)
    sync = commit

    def close(self, do_log=True, force=False):
        if do_log:
            logger.debug("closing %s" % self)
        if hasattr(self, 'conn') and self.conn is not None:
            if self.conn.autocommit and not force:
                # typically calls to commit are non-blocking when autocommit is
                # used.  However, we need to block on close() to ensure any
                # awaiting exceptions are handled and that all data is
                # persisted to disk before returning.
                self.conn.commit(blocking=True)
            self.conn.close(force=force)
            self.conn = None
        if self.in_temp:
            try:
                os.remove(self.filename)
            except:
                pass

    def terminate(self):
        """Delete the underlying database file. Use with care."""
        if self.flag == 'r':
            raise RuntimeError('Refusing to terminate read-only SqliteDict')

        self.close()

        if self.filename == ':memory:':
            return

        logger.info("deleting %s" % self.filename)
        try:
            if os.path.isfile(self.filename):
                os.remove(self.filename)
        except (OSError, IOError):
            logger.exception("failed to delete %s" % (self.filename))

    def __del__(self):
        # like close(), but assume globals are gone by now (do not log!)
        try:
            self.close(do_log=False, force=True)
        except Exception:
            # prevent error log flood in case of multiple SqliteDicts
            # closed after connection lost (exceptions are always ignored
            # in __del__ method.
            pass

# Adding extra methods for python 2 compatibility (at import time)
if major_version == 2:
    SqliteDict.__nonzero__ = SqliteDict.__bool__
    del SqliteDict.__bool__  # not needed and confusing
#endclass SqliteDict

class SqliteMultithread(Thread):
    """
    Wrap sqlite connection in a way that allows concurrent requests from multiple threads.

    This is done by internally queueing the requests and processing them sequentially
    in a separate thread (in the same order they arrived).

    """
    def __init__(self, filename, autocommit, journal_mode):
        super(SqliteMultithread, self).__init__()
        self.filename = filename
        self.autocommit = autocommit
        self.journal_mode = journal_mode
        # use request queue of unlimited size
        self.reqs = Queue()
        self.setDaemon(True)  # python2.5-compatible
        self.exception = None
        self.log = logging.getLogger('sqlitedict.SqliteMultithread')
        self.start()

    def run(self):
        if self.autocommit:
            conn = sqlite3.connect(self.filename, isolation_level=None, check_same_thread=False)
        else:
            conn = sqlite3.connect(self.filename, check_same_thread=False)
        conn.execute('PRAGMA journal_mode = %s' % self.journal_mode)
        conn.text_factory = str
        cursor = conn.cursor()
        conn.commit()
        cursor.execute('PRAGMA synchronous=OFF')

        res = None
        while True:
            req, arg, res, outer_stack = self.reqs.get()
            if req == '--close--':
                assert res, ('--close-- without return queue', res)
                break
            elif req == '--commit--':
                conn.commit()
                if res:
                    res.put('--no more--')
            else:
                try:
                    cursor.execute(req, arg)
                except Exception as err:
                    # Retry once
                    try:
                        cursor.execute(req, arg)
                    except Exception as err:
                        self.exception = (e_type, e_value, e_tb) = sys.exc_info()
                        inner_stack = traceback.extract_stack()

                        # An exception occurred in our thread, but we may not
                        # immediately able to throw it in our calling thread, if it has
                        # no return `res` queue: log as level ERROR both the inner and
                        # outer exception immediately.
                        #
                        # Any iteration of res.get() or any next call will detect the
                        # inner exception and re-raise it in the calling Thread; though
                        # it may be confusing to see an exception for an unrelated
                        # statement, an ERROR log statement from the 'sqlitedict.*'
                        # namespace contains the original outer stack location.
                        self.log.error('Inner exception:')
                        for item in traceback.format_list(inner_stack):
                            self.log.error(item)
                        self.log.error('')  # deliniate traceback & exception w/blank line
                        for item in traceback.format_exception_only(e_type, e_value):
                            self.log.error(item)

                        self.log.error('')  # exception & outer stack w/blank line
                        self.log.error('Outer stack:')
                        for item in traceback.format_list(outer_stack):
                            self.log.error(item)
                        self.log.error('Exception will be re-raised at next call.')

                if res:
                    for rec in cursor:
                        res.put(rec)
                    res.put('--no more--')

                if self.autocommit:
                    conn.commit()

        self.log.debug('received: %s, send: --no more--', req)
        conn.close()
        res.put('--no more--')

    def check_raise_error(self):
        """
        Check for and raise exception for any previous sqlite query.

        For the `execute*` family of method calls, such calls are non-blocking and any
        exception raised in the thread cannot be handled by the calling Thread (usually
        MainThread).  This method is called on `close`, and prior to any subsequent
        calls to the `execute*` methods to check for and raise an exception in a
        previous call to the MainThread.
        """
        if self.exception:
            e_type, e_value, e_tb = self.exception

            # clear self.exception, if the caller decides to handle such
            # exception, we should not repeatedly re-raise it.
            self.exception = None

            self.log.error('An exception occurred from a previous statement, view '
                           'the logging namespace "sqlitedict" for outer stack.')

            # The third argument to raise is the traceback object, and it is
            # substituted instead of the current location as the place where
            # the exception occurred, this is so that when using debuggers such
            # as `pdb', or simply evaluating the naturally raised traceback, we
            # retain the original (inner) location of where the exception
            # occurred.
            reraise(e_type, e_value, e_tb)

    def execute(self, req, arg=None, res=None):
        """
        `execute` calls are non-blocking: just queue up the request and return immediately.
        """
        self.check_raise_error()

        # NOTE: This might be a lot of information to pump into an input
        # queue, affecting performance.  I've also seen earlier versions of
        # jython take a severe performance impact for throwing exceptions
        # so often.
        stack = traceback.extract_stack()[:-1]
        self.reqs.put((req, arg or tuple(), res, stack))

    def executemany(self, req, items):
        for item in items:
            self.execute(req, item)
        self.check_raise_error()

    def select(self, req, arg=None):
        """
        Unlike sqlite's native select, this select doesn't handle iteration efficiently.

        The result of `select` starts filling up with values as soon as the
        request is dequeued, and although you can iterate over the result normally
        (`for res in self.select(): ...`), the entire result will be in memory.
        """
        res = Queue()  # results of the select will appear as items in this queue
        self.execute(req, arg, res)
        while True:
            rec = res.get()
            self.check_raise_error()
            if rec == '--no more--':
                break
            yield rec

    def select_one(self, req, arg=None):
        """Return only the first row of the SELECT, or None if there are no matching rows."""
        try:
            return next(iter(self.select(req, arg)))
        except StopIteration:
            return None

    def commit(self, blocking=True):
        if blocking:
            # by default, we await completion of commit() unless
            # blocking=False.  This ensures any available exceptions for any
            # previous statement are thrown before returning, and that the
            # data has actually persisted to disk!
            self.select_one('--commit--')
        else:
            # otherwise, we fire and forget as usual.
            self.execute('--commit--')

    def close(self, force=False):
        if force:
            # If a SqliteDict is being killed or garbage-collected, then select_one()
            # could hang forever because run() might already have exited and therefore
            # can't process the request. Instead, push the close command to the requests
            # queue directly. If run() is still alive, it will exit gracefully. If not,
            # then there's nothing we can do anyway.
            self.reqs.put(('--close--', None, Queue(), None))
        else:
            # we abuse 'select' to "iter" over a "--close--" statement so that we
            # can confirm the completion of close before joining the thread and
            # returning (by semaphore '--no more--'
            self.select_one('--close--')
            self.join()
#endclass SqliteMultithread


text:
@class MilestoneDetailsDataSource, Milestone;
@class NetworkAwareViewController, TicketsViewController;
@class MilestoneHeaderView;

@interface MilestoneDetailsDisplayMgr :
    NSObject
    <NetworkAwareViewControllerDelegate, MilestoneDetailsDataSourceDelegate>
{
    NetworkAwareViewController * networkAwareViewController;
    TicketsViewController * ticketsViewController;
    MilestoneHeaderView * milestoneHeaderView;
    UISegmentedControl * ticketFilterControl;

    MilestoneDetailsDataSource * detailsDataSource;

    NSMutableDictionary * openTicketData;
    NSMutableDictionary * closedTicketData;

    Milestone * milestone;
    id milestoneKey;
    id projectKey;
}

#pragma mark Initialization

- (id)initWithMilestoneDetailsDataSource:(MilestoneDetailsDataSource *)ds;

#pragma mark Display milestone details

- (void)displayDetailsForMilestone:(Milestone *)aMilsetone
                  withMilestoneKey:(id)milestoneKey
                        projectKey:(id)projectKey
              navigationController:(UINavigationController *)navController;

@end

redpajama_set_name: RedPajamaGithub


text:
<?php

// Exit if the file is accessed directly over web
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

add_action( 'groups_delete_group', 'mpp_delete_galleries_for_group' ); //group id

function mpp_delete_galleries_for_group( $group_id ) {

	//DELETE ALL Galleries

	$query = new MPP_Gallery_Query( array( 'component_id' => $group_id, 'fields' => 'ids', 'component' => 'groups' ) );
	$ids = $query->get_ids();

	//Delete all galleries
	foreach ( $ids as $gallery_id ) {
		mpp_delete_gallery( $gallery_id );
	}
}


text:
<?php

namespace Alhames\ApiHelperBundle\Security\Core\Exception;

use Alhames\ApiHelperBundle\Account\AbstractAccount;
use Symfony\Component\Security\Core\Exception\AuthenticationException;

/**
 * Class ServiceAccountNotFoundException.
 */
class ServiceAccountNotFoundException extends AuthenticationException
{
    /** @var AbstractAccount */
    protected $account;

    /**
     * {@inheritdoc}
     */
    public function getMessageKey()
    {
        return 'Service account could not be found.';
    }

    /**
     * @return AbstractAccount
     */
    public function getAccount()
    {
        return $this->account;
    }

    /**
     * @param AbstractAccount $account
     *
     * @return static
     */
    public function setAccount(AbstractAccount $account)
    {
        $this->account = $account;

        return $this;
    }

    /**
     * {@inheritdoc}
     */
    public function serialize()
    {
        return serialize([$this->account, parent::serialize()]);
    }

    /**
     * {@inheritdoc}
     */
    public function unserialize($str)
    {
        list($this->account, $parentStr) = unserialize($str);
        parent::unserialize($parentStr);
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using Epi.Cloud.BLL;
using Epi.Cloud.Common.BusinessObjects;
using Epi.Cloud.Common.Extensions;
using Epi.Cloud.Common.Message;
using Epi.Cloud.Facades.Interfaces;
using Epi.Cloud.Interfaces.DataInterfaces;
using Epi.Cloud.MVC.Extensions;
using Epi.Common.Exceptions;

namespace Epi.Cloud.DataEntryServices
{
    public class FormSettingsService : IFormSettingsService
	{
        private readonly IFormSettingFacade _formSettingFacade;
		private readonly IFormInfoDao _formInfoDao;
		private readonly IUserDao _userDao;

		public FormSettingsService(IFormSettingFacade formSettingFacade,
									IFormInfoDao formInfoDao,
									IUserDao userDao)
		{
			_formSettingFacade = formSettingFacade;
            _formInfoDao = formInfoDao;
			_userDao = userDao;
		}

        public List<FormSettingResponse> GetFormSettingsList(List<FormSettingRequest> formSettingRequestList)
        {
            List<FormSettingResponse> formSettingResponseList = new List<FormSettingResponse>();

            var formIds = formSettingRequestList.Select(f => f.FormInfo.FormId).ToList();
            var currentOrgId = formSettingRequestList[0].CurrentOrgId;

            Epi.Web.BLL.FormSetting formSettingImplementation = new Epi.Web.BLL.FormSetting(_formSettingFacade, _userDao);
            var formSettingBOList = formSettingImplementation.GetFormSettingsList(formIds, currentOrgId);

            for (int i = 0; i < formSettingBOList.Count(); ++i)
            {
                var formSettingRequest = formSettingRequestList[i];
                var formInfo = formSettingRequest.FormInfo;
                var formId = formInfo.FormId.ToString();
                var userId = formInfo.UserId;
                var formSettingResponse = CreateFormSettingResponse(formId, userId, formSettingBOList[i]);
                formSettingResponseList.Add(formSettingResponse);
            }
            return formSettingResponseList;
        }

        public FormSettingResponse GetFormSettings(FormSettingRequest formSettingRequest)
		{
			try
            {
                var formInfo = formSettingRequest.FormInfo;
                var formId = formInfo.FormId.ToString();
                var userId = formInfo.UserId;
                var currentOrgId = formSettingRequest.CurrentOrgId;

                Epi.Web.BLL.FormSetting formSettingImplementation = new Epi.Web.BLL.FormSetting(_formSettingFacade, _userDao);
                var formSettingBO = formSettingImplementation.GetFormSettings(formId, currentOrgId);
                var formSettingResponse = CreateFormSettingResponse(formId, userId, formSettingBO);
                return formSettingResponse;
            }
            catch (Exception ex)
			{
				throw new FaultException<CustomFaultException>(new CustomFaultException(ex));
			}
		}

        private FormSettingResponse CreateFormSettingResponse(string formId, int userId, FormSettingBO formSettingBO)
        {
			FormSettingResponse response = new FormSettingResponse();

            var formInfoImplementation = new FormInfo(_formInfoDao);
            var formInfoBO = formInfoImplementation.GetFormInfoByFormId(formId, userId);

            response.FormInfo = formInfoBO.ToFormInfoDTO();
            response.FormSetting = formSettingBO.ToFormSettingDTO();

            return response;
        }

        public FormSettingResponse SaveSettings(FormSettingRequest formSettingRequest)
		{
			FormSettingResponse response = new FormSettingResponse();
			try
			{
				Epi.Web.BLL.FormSetting formSettingImplementation = new Epi.Web.BLL.FormSetting(_formSettingFacade, _userDao);
				if (formSettingRequest.FormSetting.Count() > 0)
				{
					foreach (var item in formSettingRequest.FormSetting)
					{
						formSettingImplementation.UpdateFormSettings(formSettingRequest.FormInfo.IsDraftMode, item);

					}
					string Message = formSettingImplementation.SaveSettings(formSettingRequest.FormInfo.IsDraftMode, formSettingRequest.FormSetting[0], formSettingRequest.CurrentOrgId);
				}

				return response;
			}
			catch (Exception ex)
			{
				throw new FaultException<CustomFaultException>(new CustomFaultException(ex));
			}
		}
	}
}


text:
<!doctype html>

    <meta charset='utf-8'>
    <meta http-equiv='X-UA-Compatible' content='IE-edge'>
    <title>diablourbano</title>
    <meta name='description' content='personal access for diablourbano, software developer, software engineering, photographer'>
    <meta name='viewport' content='width=device-width, initial-scale=1'>

    <link rel="icon" type="image/png" href="images/logo-ico.png" />

    <link rel='stylesheet' href='http://yui.yahooapis.com/pure/0.6.0/pure-min.css'>

      <link rel='stylesheet' href='http://yui.yahooapis.com/pure/0.6.0/grids-responsive-min.css'>

    <link rel='stylesheet' href='styles/fonts.css'>

    <link rel='stylesheet' href='styles/main.css'>
    <link rel='stylesheet' href='styles/colors.css'>


text:
namespace bp = boost::python;

struct ConstBaseIterator_less__std_scope_map_less_CEGUI_scope_String_comma__CEGUI_scope_WindowFactory_ptr__comma__CEGUI_scope_StringFastLessCompare_comma__std_scope_allocator_less_std_scope_pair_less_CEGUI_scope_String_const_comma__CEGUI_scope_WindowFactory_ptr__greater___greater___greater__comma__CEGUI_scope_WindowFactory_ptr___greater__wrapper : CEGUI::ConstBaseIterator< std::map<CEGUI::String, CEGUI::WindowFactory*, CEGUI::StringFastLessCompare, std::allocator<std::pair<CEGUI::String const, CEGUI::WindowFactory*> > >, CEGUI::WindowFactory* >, bp::wrapper< CEGUI::ConstBaseIterator< std::map<CEGUI::String, CEGUI::WindowFactory*, CEGUI::StringFastLessCompare, std::allocator<std::pair<CEGUI::String const, CEGUI::WindowFactory*> > >, CEGUI::WindowFactory* > > {

    ConstBaseIterator_less__std_scope_map_less_CEGUI_scope_String_comma__CEGUI_scope_WindowFactory_ptr__comma__CEGUI_scope_StringFastLessCompare_comma__std_scope_allocator_less_std_scope_pair_less_CEGUI_scope_String_const_comma__CEGUI_scope_WindowFactory_ptr__greater___greater___greater__comma__CEGUI_scope_WindowFactory_ptr___greater__wrapper( )
    : CEGUI::ConstBaseIterator<std::map<CEGUI::String, CEGUI::WindowFactory*, CEGUI::StringFastLessCompare, std::allocator<std::pair<CEGUI::String const, CEGUI::WindowFactory*> > >, CEGUI::WindowFactory*>( )
      , bp::wrapper< CEGUI::ConstBaseIterator< std::map<CEGUI::String, CEGUI::WindowFactory*, CEGUI::StringFastLessCompare, std::allocator<std::pair<CEGUI::String const, CEGUI::WindowFactory*> > >, CEGUI::WindowFactory* > >(){
        // null constructor

    }

    virtual ::CEGUI::WindowFactory * getCurrentValue(  ) const {
        bp::override func_getCurrentValue = this->get_override( "getCurrentValue" );
        return func_getCurrentValue(  );
    }

};

void register_ConstBaseIterator_e31fba8abb652b91e7a416a794506e4f_class(){

    { //::CEGUI::ConstBaseIterator< std::map<CEGUI::String, CEGUI::WindowFactory*, CEGUI::StringFastLessCompare, std::allocator<std::pair<CEGUI::String const, CEGUI::WindowFactory*> > >, CEGUI::WindowFactory* >
        typedef bp::class_< ConstBaseIterator_less__std_scope_map_less_CEGUI_scope_String_comma__CEGUI_scope_WindowFactory_ptr__comma__CEGUI_scope_StringFastLessCompare_comma__std_scope_allocator_less_std_scope_pair_less_CEGUI_scope_String_const_comma__CEGUI_scope_WindowFactory_ptr__greater___greater___greater__comma__CEGUI_scope_WindowFactory_ptr___greater__wrapper, boost::noncopyable > ConstBaseIterator_e31fba8abb652b91e7a416a794506e4f_exposer_t;
        ConstBaseIterator_e31fba8abb652b91e7a416a794506e4f_exposer_t ConstBaseIterator_e31fba8abb652b91e7a416a794506e4f_exposer = ConstBaseIterator_e31fba8abb652b91e7a416a794506e4f_exposer_t( "ConstBaseIterator_e31fba8abb652b91e7a416a794506e4f", bp::no_init );
        bp::scope ConstBaseIterator_e31fba8abb652b91e7a416a794506e4f_scope( ConstBaseIterator_e31fba8abb652b91e7a416a794506e4f_exposer );
        ConstBaseIterator_e31fba8abb652b91e7a416a794506e4f_exposer.def( bp::init< >("*************************************************************************\n\
           No default construction available\n\
        *************************************************************************\n") );
        { //::CEGUI::ConstBaseIterator< std::map<CEGUI::String, CEGUI::WindowFactory*, CEGUI::StringFastLessCompare, std::allocator<std::pair<CEGUI::String const, CEGUI::WindowFactory*> > >, CEGUI::WindowFactory* >::getCurrentValue

            typedef CEGUI::ConstBaseIterator< std::map<CEGUI::String, CEGUI::WindowFactory*, CEGUI::StringFastLessCompare, std::allocator<std::pair<CEGUI::String const, CEGUI::WindowFactory*> > >, CEGUI::WindowFactory* > exported_class_t;
            typedef ::CEGUI::WindowFactory * ( exported_class_t::*getCurrentValue_function_type )(  ) const;

            ConstBaseIterator_e31fba8abb652b91e7a416a794506e4f_exposer.def(
                "getCurrentValue"
                , bp::pure_virtual( getCurrentValue_function_type(&::CEGUI::ConstBaseIterator< std::map<CEGUI::String, CEGUI::WindowFactory*, CEGUI::StringFastLessCompare, std::allocator<std::pair<CEGUI::String const, CEGUI::WindowFactory*> > >, CEGUI::WindowFactory* >::getCurrentValue) )
                , bp::return_value_policy< bp::reference_existing_object >()
                , "*!\n\
            \n\
               Return the value for the item at the current iterator position.\n\
            *\n" );

        }
        { //::CEGUI::ConstBaseIterator< std::map<CEGUI::String, CEGUI::WindowFactory*, CEGUI::StringFastLessCompare, std::allocator<std::pair<CEGUI::String const, CEGUI::WindowFactory*> > >, CEGUI::WindowFactory* >::isAtEnd

            typedef CEGUI::ConstBaseIterator< std::map<CEGUI::String, CEGUI::WindowFactory*, CEGUI::StringFastLessCompare, std::allocator<std::pair<CEGUI::String const, CEGUI::WindowFactory*> > >, CEGUI::WindowFactory* > exported_class_t;
            typedef bool ( exported_class_t::*isAtEnd_function_type )(  ) const;

            ConstBaseIterator_e31fba8abb652b91e7a416a794506e4f_exposer.def(
                "isAtEnd"
                , isAtEnd_function_type( &::CEGUI::ConstBaseIterator< std::map<CEGUI::String, CEGUI::WindowFactory*, CEGUI::StringFastLessCompare, std::allocator<std::pair<CEGUI::String const, CEGUI::WindowFactory*> > >, CEGUI::WindowFactory* >::isAtEnd )
                , "*!\n\
            \n\
               Return whether the current iterator position is at the end of the iterators range.\n\
            *\n" );

        }
        { //::CEGUI::ConstBaseIterator< std::map<CEGUI::String, CEGUI::WindowFactory*, CEGUI::StringFastLessCompare, std::allocator<std::pair<CEGUI::String const, CEGUI::WindowFactory*> > >, CEGUI::WindowFactory* >::isAtStart

            typedef CEGUI::ConstBaseIterator< std::map<CEGUI::String, CEGUI::WindowFactory*, CEGUI::StringFastLessCompare, std::allocator<std::pair<CEGUI::String const, CEGUI::WindowFactory*> > >, CEGUI::WindowFactory* > exported_class_t;
            typedef bool ( exported_class_t::*isAtStart_function_type )(  ) const;

            ConstBaseIterator_e31fba8abb652b91e7a416a794506e4f_exposer.def(
                "isAtStart"
                , isAtStart_function_type( &::CEGUI::ConstBaseIterator< std::map<CEGUI::String, CEGUI::WindowFactory*, CEGUI::StringFastLessCompare, std::allocator<std::pair<CEGUI::String const, CEGUI::WindowFactory*> > >, CEGUI::WindowFactory* >::isAtStart )
                , "*!\n\
            \n\
               Return whether the current iterator position is at the start of the iterators range.\n\
            *\n" );

        }
        ConstBaseIterator_e31fba8abb652b91e7a416a794506e4f_exposer.def( bp::self != bp::self );
        { //::CEGUI::ConstBaseIterator< std::map<CEGUI::String, CEGUI::WindowFactory*, CEGUI::StringFastLessCompare, std::allocator<std::pair<CEGUI::String const, CEGUI::WindowFactory*> > >, CEGUI::WindowFactory* >::operator=

            typedef CEGUI::ConstBaseIterator< std::map<CEGUI::String, CEGUI::WindowFactory*, CEGUI::StringFastLessCompare, std::allocator<std::pair<CEGUI::String const, CEGUI::WindowFactory*> > >, CEGUI::WindowFactory* > exported_class_t;
            typedef ::CEGUI::ConstBaseIterator< std::map<CEGUI::String, CEGUI::WindowFactory*, CEGUI::StringFastLessCompare, std::allocator<std::pair<CEGUI::String const, CEGUI::WindowFactory*> > >, CEGUI::WindowFactory* > & ( exported_class_t::*assign_function_type )( ::CEGUI::ConstBaseIterator< std::map<CEGUI::String, CEGUI::WindowFactory*, CEGUI::StringFastLessCompare, std::allocator<std::pair<CEGUI::String const, CEGUI::WindowFactory*> > >, CEGUI::WindowFactory* > const & ) ;

            ConstBaseIterator_e31fba8abb652b91e7a416a794506e4f_exposer.def(
                "assign"
                , assign_function_type( &::CEGUI::ConstBaseIterator< std::map<CEGUI::String, CEGUI::WindowFactory*, CEGUI::StringFastLessCompare, std::allocator<std::pair<CEGUI::String const, CEGUI::WindowFactory*> > >, CEGUI::WindowFactory* >::operator= )
                , ( bp::arg("rhs") )
                , bp::return_self< >()
                , "*!\n\
            \n\
               ConstBaseIterator assignment operator\n\
            *\n" );

        }
        ConstBaseIterator_e31fba8abb652b91e7a416a794506e4f_exposer.def( bp::self == bp::self );
        { //::CEGUI::ConstBaseIterator< std::map<CEGUI::String, CEGUI::WindowFactory*, CEGUI::StringFastLessCompare, std::allocator<std::pair<CEGUI::String const, CEGUI::WindowFactory*> > >, CEGUI::WindowFactory* >::toEnd

            typedef CEGUI::ConstBaseIterator< std::map<CEGUI::String, CEGUI::WindowFactory*, CEGUI::StringFastLessCompare, std::allocator<std::pair<CEGUI::String const, CEGUI::WindowFactory*> > >, CEGUI::WindowFactory* > exported_class_t;
            typedef void ( exported_class_t::*toEnd_function_type )(  ) ;

            ConstBaseIterator_e31fba8abb652b91e7a416a794506e4f_exposer.def(
                "toEnd"
                , toEnd_function_type( &::CEGUI::ConstBaseIterator< std::map<CEGUI::String, CEGUI::WindowFactory*, CEGUI::StringFastLessCompare, std::allocator<std::pair<CEGUI::String const, CEGUI::WindowFactory*> > >, CEGUI::WindowFactory* >::toEnd )
                , "*!\n\
            \n\
               Set the iterator current position to the end position.\n\
            *\n" );

        }
        { //::CEGUI::ConstBaseIterator< std::map<CEGUI::String, CEGUI::WindowFactory*, CEGUI::StringFastLessCompare, std::allocator<std::pair<CEGUI::String const, CEGUI::WindowFactory*> > >, CEGUI::WindowFactory* >::toStart

            typedef CEGUI::ConstBaseIterator< std::map<CEGUI::String, CEGUI::WindowFactory*, CEGUI::StringFastLessCompare, std::allocator<std::pair<CEGUI::String const, CEGUI::WindowFactory*> > >, CEGUI::WindowFactory* > exported_class_t;
            typedef void ( exported_class_t::*toStart_function_type )(  ) ;

            ConstBaseIterator_e31fba8abb652b91e7a416a794506e4f_exposer.def(
                "toStart"
                , toStart_function_type( &::CEGUI::ConstBaseIterator< std::map<CEGUI::String, CEGUI::WindowFactory*, CEGUI::StringFastLessCompare, std::allocator<std::pair<CEGUI::String const, CEGUI::WindowFactory*> > >, CEGUI::WindowFactory* >::toStart )
                , "*!\n\
            \n\
               Set the iterator current position to the start position.\n\
            *\n" );

        }
    }

}


text:
'use strict';

var assign  = require('object-assign');
var compare = require('../utils/compare');

var createEventFactory = require('../flux/event').createEventFactory;
var registerStore      = require('../flux/stores').registerStore;

var ACTION_MONITOR_EVENT_NAME = 'action-monitor.status-change';
var ACTION_MONITOR_STORE_NAME = '$ActionMonitorStore';

var EventFactory = createEventFactory({ CHANGE: ACTION_MONITOR_EVENT_NAME }, {
  actionStateChange : function(payload) {
    return this.createEvent(this.EVENTS.CHANGE, payload);
  }
});

/**
 * An object that represents an Action status
 * @param {number} action_id - action id
 * @param {string} state     - action state ('tracking', 'resolved', 'rejected')
 * @param {*}      [data]    - action data
 * @constructor
 */
var ActionStatus = function(action_id, state, data) {
  //
  // Accessors
  //

  /**
   * Action Id
   * @returns {number} action id
   */
  this.actionId = function() {
    return action_id;
  };

  /**
   * Extra data (or error if the action was rejected) associated with this action
   * @returns {*} any data
   */
  this.data = function() {
    return data;
  };

  /**
   * Current state of the action
   * @returns {string} current state (tracking/resolved/rejected)
   */
  this.state = function() {
    return state;
  };

  /**
   * Whether the action is still in progress
   * @returns {boolean} true if action is in progress
   */
  this.inProgress = function() {
    return state == 'tracking';
  };

  /**
   * Whether the action has completed
   * @returns {boolean} true if action has completed
   */
  this.isResolved = function() {
    return state == 'resolved';
  };

  /**
   * Whether the action has failed
   * @returns {boolean} true if action has failed
   */
  this.isRejected = function() {
    return state == 'rejected';
  };
};

/**
 * Flux Store for keeping track of Action statuses
 * @type {{}}
 */
var ActionMonitorStore = {
  $initialize : function() {
    this.statuses = {};
  },

  $processEvent : function(event) {
    switch(event.name()) {
      case ACTION_MONITOR_EVENT_NAME:
        this._processStatusChange(event.payload());
        break;
      default:
        break;
    }
  },

  //
  // Accessors
  //

  /**
   * Get the status of an Action
   * @param {number} action_id - action id
   * @returns {ActionStatus}
   */
  getActionStatus : function(action_id) {
    return this.statuses[action_id];
  },

  //
  // Private
  //

  _processStatusChange : function(payload) {
    var action_id = payload.action_id;
    var status    = null;

    switch (payload.state) {
      case 'track':
        status = new ActionStatus(action_id, 'tracking');
        break;
      case 'resolve':
        status = new ActionStatus(action_id, 'resolved', payload.data);
        break;
      case 'reject':
        status = new ActionStatus(action_id, 'rejected', payload.data);
        break;
    }

    if (status) {
      this.statuses[action_id] = status;
      this.emitChange();
    }
  }
};

/**
 * Action Status change callback
 * @callback ActionMonitorCallback
 * @param {ActionStatus} action_status - current action status
 */

/**
 * React Mixin for listening to Action status change
 * @type {*}
 * @example
 * React.createClass({
 *   mixins: [dyna.DynaFluxMixin(), dyna.addons.ActionMonitorMixin],
 *
 *   // ...
 *
 *   _buzzerClick : function() {
 *     var action = ActionFactory.buzzClick();
 *     this.monitorAction(action, this._actionUpdate);
 *     action.dispatch(this.flux().action_dispatcher);
 *   },
 *
 *   _actionUpdate : function(action_status) {
 *     this.setState({ action_state : action_status.inProgress() ? 'processing' : 'clicked' });
 *   }
 * });
 */
var ActionMonitorMixin = {
  componentWillMount : function() {
    this.__action_listeners = [];
    this.flux().store(ACTION_MONITOR_STORE_NAME).addChangeListener(this.__processActionChange);
  },

  componentWillUnmount : function() {
    this.flux().store(ACTION_MONITOR_STORE_NAME).removeChangeListener(this.__processActionChange);
  },

  /**
   * Listen for change in Action state.
   * The provided callback will be called upon changes of Action states.
   * The listener will automatically be removed after the Action is resolved/rejected.
   * @param {Action}                action   - action to listen for
   * @param {ActionMonitorCallback} callback - listener callback
   */
  monitorAction : function(action, callback) {
    this.__action_listeners.push({ action_id: action.id(), callback: callback });
  },

  __processActionChange : function() {
    var self = this;

    var completed = [];
    var callbacks = [];

    this.__action_listeners.forEach(function(listener, index) {
      var action_id = listener.action_id;
      var status    = self.flux().store(ACTION_MONITOR_STORE_NAME).getActionStatus(action_id);

      if (status && status.state != listener.state) {
        listener.state = status.state;
        if (listener.callback) callbacks.push(listener.callback.bind(self, status));
        if (status.isResolved() || status.isRejected()) completed.unshift(index);
      }
    });

    // removes listeners for completed actions
    completed.forEach(function(index) {
      self.__action_listeners.splice(index, 1);
    });

    // executes the listener callbacks
    callbacks.forEach(function(cb) { cb(); });
  }
};

/**
 * Object for updating the state of Action
 * @param {EventDispatcher} event_dispatcher - event dispatcher instance
 * @constructor
 * @example
 * // In Flux coordinator
 * var ActionMonitor = new dyna.addons.ActionMonitor(this.flux.event_dispatcher);
 *
 * ActionMonitor.start(action);
 * setTimeout(function() {
 *   EventFactory.someEvent().dispatch(self.flux.event_dispatcher);
 *   ActionMonitor.resolve(action);
 * }, 3000);
 */
var ActionMonitor = function(event_dispatcher) {
  /**
   * Start monitoring an Action
   * @param {Action} action - action to monitor
   */
  this.start = function(action) {
    EventFactory.actionStateChange({
      action_id: action.id(),
      state    : 'track'
    }).dispatch(event_dispatcher);
  };

  /**
   * Resolve a monitored Action
   * @param {Action} action - action to resolve
   * @param {*}      data   - any data to be pass along with the state change
   */
  this.resolve = function(action, data) {
    EventFactory.actionStateChange({
      action_id: action.id(),
      state    : 'resolve',
      data     : data
    }).dispatch(event_dispatcher);
  };

  /**
   * Reject a monitored Action
   * @param {Action} action - action to reject
   * @param {*}      error  - any error/data to be pass along with the state change
   */
  this.reject = function(action, error) {
    EventFactory.actionStateChange({
      action_id: action.id(),
      state    : 'reject',
      data     : error
    }).dispatch(event_dispatcher);
  };
};

//
// Exports
//

// register the ActionMonitorStore as a built-in store
registerStore(ACTION_MONITOR_STORE_NAME, ActionMonitorStore);

module.exports = {
  ActionMonitor     : ActionMonitor,
  ActionMonitorMixin: ActionMonitorMixin
};


text:
(function() {

    'use strict';

    angular
        .module('app.patientManage')
        .controller('PatientManageController', PatientManageController);

    /** @ngInject */
    function PatientManageController($scope, $rootScope, CONFIG) {

        var vm = this;

		$scope.detailFrame = CONFIG.peerPageUrl + 'doctor/patientManage?doctor=' + $rootScope.login._id;
    }

})();


text:
<?php include_javascripts(); ?>

<form id="form_new_link" action="<?php echo url_for('link/' . ($form->getObject()->isNew() ? 'create' : 'update') . (!$form->getObject()->isNew() ? '?id=' . $form->getObject()->getId() : '')) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
    <?php if (!$form->getObject()->isNew()): ?>
        <input type="hidden" name="sf_method" value="put" />
    <?php endif; ?>

                    <?php echo $form->renderHiddenFields(false) ?>
                    <?php if (!$form->getObject()->isNew()): ?>

                         <?php echo link_to('Delete', 'link/delete?id=' . $form->getObject()->getId() . '&duid=' . $duid, array('method' => 'delete', 'confirm' => 'Are you sure?', 'class' => 'button')) ?>
                         <?php echo link_to('Publish', 'pubs/publishing?model=link&duid=' . $duid . '&record=' . $form->getObject()->getId(), array('class' => 'button', 'id' => 'publish')) ?>
                    <?php endif; ?>

            <?php echo $form->renderGlobalErrors() ?>
            <?php if ($form->getObject()->isNew()): ?>

                        <?php echo $form['url']->render(array('size' => '30')) ?>

                    <input type="submit" value="<?php echo __('Attach', null, 'pubs')?>" class="button" style="float: right" />

            <?php endif; ?>

</form>


text:
<?php

namespace Shopware\SwagDefaultSort\Components\DataAccess\Translate;

use Shopware\SwagDefaultSort\Components\SortDefinition\AbstractSortDefinition;

/**
 * Class TranslateFilter.
 *
 * From configUid -> readable string with snippet namespace
 */
class FromDefinitionUidFilter implements FilterInterface
{
    /**
     * @var \Enlight_Components_Snippet_Namespace
     */
    private $snippetNamespace;

    /**
     * @param \Enlight_Components_Snippet_Namespace $snippetNamespace
     */
    public function __construct(\Enlight_Components_Snippet_Namespace $snippetNamespace)
    {
        $this->snippetNamespace = $snippetNamespace;
    }

    /**
     * {@inheritdoc}
     */
    public function filter($value)
    {
        if (!$value instanceof AbstractSortDefinition) {
            throw new \InvalidArgumentException('Unable to generate translation $value of wrong type');
        }

        $ret = $this->snippetNamespace->get(
            $this->getSanitizedValue($value->getUniqueIdentifier())
        );

        if (!$ret) {
            return $value;
        }

        return $ret;
    }

    /**
     * @param string $value
     *
     * @return string
     */
    private function getSanitizedValue($value)
    {
        return strtolower(str_replace('::', '_', $value));
    }
}


text:
========
Overview
========

.. start-badges

.. list-table::
    :stub-columns: 1

    * - docs
      - |docs|
    * - tests
      - | |travis| |requires|
        | |codecov|
    * - package
      - |version| |downloads| |wheel| |supported-versions| |supported-implementations|

.. |docs| image:: https://readthedocs.org/projects/staps/badge/?style=flat
    :target: https://readthedocs.org/projects/staps
    :alt: Documentation Status

.. |travis| image:: https://travis-ci.org/fladi/staps.svg?branch=master
    :alt: Travis-CI Build Status
    :target: https://travis-ci.org/fladi/staps

.. |requires| image:: https://requires.io/github/fladi/staps/requirements.svg?branch=master
    :alt: Requirements Status
    :target: https://requires.io/github/fladi/staps/requirements/?branch=master

.. |codecov| image:: https://codecov.io/github/fladi/staps/coverage.svg?branch=master
    :alt: Coverage Status
    :target: https://codecov.io/github/fladi/staps

.. |version| image:: https://img.shields.io/pypi/v/staps.svg?style=flat
    :alt: PyPI Package latest release
    :target: https://pypi.python.org/pypi/staps

.. |downloads| image:: https://img.shields.io/pypi/dm/staps.svg?style=flat
    :alt: PyPI Package monthly downloads
    :target: https://pypi.python.org/pypi/staps

.. |wheel| image:: https://img.shields.io/pypi/wheel/staps.svg?style=flat
    :alt: PyPI Wheel
    :target: https://pypi.python.org/pypi/staps

.. |supported-versions| image:: https://img.shields.io/pypi/pyversions/staps.svg?style=flat
    :alt: Supported versions
    :target: https://pypi.python.org/pypi/staps

.. |supported-implementations| image:: https://img.shields.io/pypi/implementation/staps.svg?style=flat
    :alt: Supported implementations
    :target: https://pypi.python.org/pypi/staps

.. end-badges

Simple Throw-Away Publish/Subscribe. Create channels simply by connecting one or mote websocket clients to a random URL path on a webserver with staps. Not
meant to be used with webbrowsers but as a cheap way to let multiple websocket clients written outside the browser communicate with each other.

* Free software: BSD license

Installation
============

::

    pip install staps

Documentation
=============

https://staps.readthedocs.io/en/latest/

Development
===========

To run the all tests run::

    tox

Note, to combine the coverage data from all the tox environments run:

.. list-table::
    :widths: 10 90
    :stub-columns: 1

    - - Windows
      - ::

            set PYTEST_ADDOPTS=--cov-append
            tox

    - - Other
      - ::

            PYTEST_ADDOPTS=--cov-append tox


text:
#include "usart.h"

// Do we want USART?
#ifdef COM_USART

// Check if F_CPU is set
#ifndef F_CPU
#error F_CPU is not set but required for USART
#endif // F_CPU

// Define buffer ring size if not defined
#ifndef COM_USART_BUFFER_RING_SIZE
#define COM_USART_BUFFER_RING_SIZE 64
#endif // COM_USART_BUFFER_RING_SIZE

// Buffer ring struct
typedef struct ringbuffer {
    uint8_t buffer[COM_USART_BUFFER_RING_SIZE];
    volatile uint8_t head;
    volatile uint8_t tail;
} ringbuffer_t;

// Create buffer ring
ringbuffer_t com_usart_tx_buffer_ring = { { 0 }, 0, 0 };

void usart_init(usart_config_t *config) {
    // Disable transmit and receive
    UCSR0B &= ~((1 << RXEN0) | (1 << TXEN0));

    // Set UCSR0A register
    // Set double speed and calculate brr divider
    if (config->doublespeed) {
        UCSR0A |= (1 << U2X0);
        // Calculate baudrate divider
        UBRR0 = ((F_CPU / (8UL * config->baudrate)) - 1);
    } else {
        UCSR0A &= ~(1 << U2X0);
        // Calculate baudrate divider
        UBRR0 = ((F_CPU / (16UL * config->baudrate)) - 1);
    }

    // Set multi-processor mode
    if (config->multiprocessormode) {
        UCSR0A |= (1 << MPCM0);
    } else {
        UCSR0A &= ~(1 << MPCM0);
    }

    // Set UCSR0B register
    // Receive enable/disable
    if (config->enable_rx) {
        UCSR0B |= (1 << RXEN0);
    } else {
        UCSR0B &= ~(1 << RXEN0);
    }

    // Transmit enable/disable
    // Set interrupt accordingly
    if (config->enable_tx) {
        UCSR0B |= (1 << TXEN0) | (1 << UDRIE0);
    } else {
        UCSR0B &= ~((1 << TXEN0) | (1 << UDRIE0));
    }

}

void usart_get_default_config(usart_config_t *config) {
    // Make sure we have a valid pointer
    if (!config)
        return;

    config->baudrate = 9600;
    config->doublespeed = 0;
    config->multiprocessormode = 0;
    config->enable_rx = 1;
    config->enable_tx = 1;
}

// Send if tx buffer has contents
ISR(USART0_UDRE_vect) {
    if (com_usart_tx_buffer_ring.head == com_usart_tx_buffer_ring.tail) {
        // Buffer empty, disable interrupt
        UCSR0B &= ~(1 << UDRIE0);
    } else {
        // Get data to send
        uint8_t value = com_usart_tx_buffer_ring.buffer[com_usart_tx_buffer_ring.tail];
        com_usart_tx_buffer_ring.tail = (com_usart_tx_buffer_ring.tail + 1) % COM_USART_BUFFER_RING_SIZE;
        // Send next byte
        UDR0 = value;
    }
}

void usart_send(uint8_t data) {
    // Get index + 1 of buffer head
    uint8_t index = (com_usart_tx_buffer_ring.head + 1) % COM_USART_BUFFER_RING_SIZE;

    // If the tx buffer is full, wait until interrupt handler empties
    // a slot in the buffer to write to.
    while (index == com_usart_tx_buffer_ring.tail) {
        continue;
    }

    // Write the byte
    com_usart_tx_buffer_ring.buffer[com_usart_tx_buffer_ring.head] = data;
    com_usart_tx_buffer_ring.head = index;

    // Set data registry empty bit
    UCSR0B |= (1 << UDRIE0);
    // Clear the transmit complete bit
    UCSR0A &= ~(1 << TXC0);
}

void usart_send_string(char *data) {
    while (*data) {
        usart_send(*data++);
    }
}

void usart_send_string_n(char *data, uint16_t length) {
    while (*data && length--) {
        usart_send(*data++);
    }
}

void usart_send_string_p(const char *pdata) {
    char c;
    while ((c = pgm_read_byte(pdata++))) {
        usart_send(c);
    }
}

#endif // COM_USART


text:
$(document).ready(function() {

    // DropCap.js
    var dropcaps = document.querySelectorAll(".dropcap");
    window.Dropcap.layout(dropcaps, 2);

    // Responsive-Nav
    var nav = responsiveNav(".nav-collapse");

    // Round Reading Time
    $(".time").text(function(index, value) {
        return Math.round(parseFloat(value));
    });

});

// anchor on headings
var anchorForId = function(id) {
    var anchor = document.createElement("a");
    anchor.className = "header-link";
    anchor.href = "#" + id;
    anchor.innerHTML = "<i class=\"fa fa-link\"></i>";
    return anchor;
};

var linkifyAnchors = function(level, containingElement) {
    var headers = containingElement.getElementsByTagName("h" + level);
    for (var h = 0; h < headers.length; h++) {
        var header = headers[h];

        if (typeof header.id !== "undefined" && header.id !== "") {
            header.appendChild(anchorForId(header.id));
        }
    }
};

document.onreadystatechange = function() {
    if (this.readyState === "complete") {
        var contentBlock = document.getElementsByClassName("js-anchors")[0];
        if (!contentBlock) {
            return;
        }
        for (var level = 1; level <= 6; level++) {
            linkifyAnchors(level, contentBlock);
        }
    }
};


text:
import { module } from 'angular';
import { react2angular } from 'react2angular';

import { ArtifactList } from './ArtifactList';
import { withErrorBoundary } from '../../presentation/SpinErrorBoundary';

export const ARTIFACT_LIST = 'spinnaker.core.pipeline.status.artifactList';
module(ARTIFACT_LIST, []).component(
  'artifactList',
  react2angular(withErrorBoundary(ArtifactList, 'artifactList'), ['artifacts']),
);


text:
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="24dp"
    android:viewportWidth="24"
    android:viewportHeight="24"
    android:tint="?attr/colorControlNormal">
  <path
      android:fillColor="@android:color/white"
      android:pathData="M10.95,19.1 L14.275,13.075H1.925V10.925H14.275L10.95,4.9L22.1,12Z"/>
</vector>


text:
#pragma once

#ifndef _MSC_VER
#define _GNU_SOURCE  /* for strndup() */
#include <syslog.h>
#else
typedef int mode_t;
#endif
#include <fcntl.h>

#include "rdsysqueue.h"

#include "rdkafka.h"
#include "rd.h"
#include "rdlog.h"
#include "rdtime.h"
#include "rdaddr.h"
#include "rdinterval.h"
#include "rdavg.h"

#if WITH_SSL
#include <openssl/ssl.h>
#endif

typedef struct rd_kafka_itopic_s rd_kafka_itopic_t;
typedef struct rd_ikafka_s rd_ikafka_t;

#define rd_kafka_assert(rk, cond) do {                                  \
                if (unlikely(!(cond)))                                  \
                        rd_kafka_crash(__FILE__,__LINE__, __FUNCTION__, \
                                       (rk), "assert: " # cond);        \
        } while (0)

/* Debug assert, only enabled with --enable-devel */
#if ENABLE_DEVEL == 1
#define rd_dassert(cond) rd_kafka_assert(NULL, cond)
#else
#define rd_dassert(cond)  do {} while (0)
#endif

/** Assert if reached */
#define RD_NOTREACHED() rd_kafka_assert(NULL, !*"/* NOTREACHED */ violated")

void
RD_NORETURN
rd_kafka_crash (const char *file, int line, const char *function,
                rd_kafka_t *rk, const char *reason);

/* Forward declarations */
struct rd_kafka_s;
struct rd_kafka_itopic_s;
struct rd_kafka_msg_s;
struct rd_kafka_broker_s;

typedef RD_SHARED_PTR_TYPE(, struct rd_kafka_toppar_s) shptr_rd_kafka_toppar_t;
typedef RD_SHARED_PTR_TYPE(, struct rd_kafka_itopic_s) shptr_rd_kafka_itopic_t;

#include "rdkafka_op.h"
#include "rdkafka_queue.h"
#include "rdkafka_msg.h"
#include "rdkafka_proto.h"
#include "rdkafka_buf.h"
#include "rdkafka_pattern.h"
#include "rdkafka_conf.h"
#include "rdkafka_transport.h"
#include "rdkafka_timer.h"
#include "rdkafka_assignor.h"

/**
 * Protocol level sanity
 */
#define RD_KAFKAP_BROKERS_MAX     1000
#define RD_KAFKAP_TOPICS_MAX      10000
#define RD_KAFKAP_PARTITIONS_MAX  10000

#define RD_KAFKA_OFFSET_IS_LOGICAL(OFF)  ((OFF) < 0)

/**
 * Kafka handle, internal representation of the application's rd_kafka_t.
 */

typedef RD_SHARED_PTR_TYPE(shptr_rd_ikafka_s, rd_ikafka_t) shptr_rd_ikafka_t;

struct rd_kafka_s {
	rd_kafka_q_t rk_rep;   /* kafka -> application reply queue */
	rd_kafka_q_t rk_ops;   /* any -> rdkafka main thread ops */

	TAILQ_HEAD(, rd_kafka_broker_s) rk_brokers;
	rd_atomic32_t              rk_broker_cnt;
	rd_atomic32_t              rk_broker_down_cnt;
        mtx_t                      rk_internal_rkb_lock;
	rd_kafka_broker_t         *rk_internal_rkb;

	TAILQ_HEAD(, rd_kafka_itopic_s)  rk_topics;
	int              rk_topic_cnt;

        struct rd_kafka_cgrp_s *rk_cgrp;

	char             rk_name[128];
	rd_kafkap_str_t *rk_clientid;
	rd_kafka_conf_t  rk_conf;
	int              rk_flags;
	rd_atomic32_t    rk_terminate;
	rwlock_t         rk_lock;
	rd_kafka_type_t  rk_type;
	struct timeval   rk_tv_state_change;

	rd_atomic32_t    rk_last_throttle;  /* Last throttle_time_ms value
					     * from broker. */

        /* Locks: rd_kafka_*lock() */
        rd_ts_t          rk_ts_metadata;    /* Timestamp of most recent
                                             * metadata. */

        /* Simple consumer count:
         *  >0: Running in legacy / Simple Consumer mode,
         *   0: No consumers running
         *  <0: Running in High level consumer mode */
        rd_atomic32_t    rk_simple_cnt;

	const rd_kafkap_bytes_t *rk_null_bytes;

	union {
		struct {
			rd_atomic32_t msg_cnt;  /* current message count */
		} producer;
	} rk_u;
#define rk_consumer rk_u.consumer
#define rk_producer rk_u.producer

        rd_kafka_timers_t rk_timers;
	thrd_t rk_thread;
};

#define rd_kafka_wrlock(rk)    rwlock_wrlock(&(rk)->rk_lock)
#define rd_kafka_rdlock(rk)    rwlock_rdlock(&(rk)->rk_lock)
#define rd_kafka_rdunlock(rk)    rwlock_rdunlock(&(rk)->rk_lock)
#define rd_kafka_wrunlock(rk)    rwlock_wrunlock(&(rk)->rk_lock)

void rd_kafka_destroy_final (rd_kafka_t *rk);

/**
 * Returns true if 'rk' handle is terminating.
 */
#define rd_kafka_terminating(rk) (rd_atomic32_get(&(rk)->rk_terminate))

#define rd_kafka_is_simple_consumer(rk) \
        (rd_atomic32_get(&(rk)->rk_simple_cnt) > 0)
int rd_kafka_simple_consumer_add (rd_kafka_t *rk);

#include "rdkafka_topic.h"
#include "rdkafka_partition.h"

/**
 * Debug contexts
 */
#define RD_KAFKA_DBG_GENERIC    0x1
#define RD_KAFKA_DBG_BROKER     0x2
#define RD_KAFKA_DBG_TOPIC      0x4
#define RD_KAFKA_DBG_METADATA   0x8
#define RD_KAFKA_DBG_PRODUCER   0x10
#define RD_KAFKA_DBG_QUEUE      0x20
#define RD_KAFKA_DBG_MSG        0x40
#define RD_KAFKA_DBG_PROTOCOL   0x80
#define RD_KAFKA_DBG_CGRP       0x100
#define RD_KAFKA_DBG_SECURITY   0x200
#define RD_KAFKA_DBG_FETCH      0x400
#define RD_KAFKA_DBG_ALL        0xfff

void rd_kafka_log_buf (const rd_kafka_t *rk, int level,
		       const char *fac, const char *buf);
void rd_kafka_log0(const rd_kafka_t *rk, const char *extra, int level,
	const char *fac, const char *fmt, ...)	RD_FORMAT(printf, 5, 6);

#define rd_kafka_log(rk,level,fac,...) rd_kafka_log0(rk,NULL,level,fac,__VA_ARGS__)
#define rd_kafka_dbg(rk,ctx,fac,...) do {				  \
		if (unlikely((rk)->rk_conf.debug & (RD_KAFKA_DBG_ ## ctx))) \
			rd_kafka_log0(rk,NULL,LOG_DEBUG,fac,__VA_ARGS__); \
	} while (0)

/* NOTE: The local copy of _logname is needed due rkb_logname_lock lock-ordering
 *       when logging another broker's name in the message. */
#define rd_rkb_log(rkb,level,fac,...) do {				\
		char _logname[RD_KAFKA_NODENAME_SIZE];			\
                mtx_lock(&(rkb)->rkb_logname_lock);                     \
		strncpy(_logname, rkb->rkb_logname, sizeof(_logname)-1); \
		_logname[RD_KAFKA_NODENAME_SIZE-1] = '\0';		\
                mtx_unlock(&(rkb)->rkb_logname_lock);                   \
		rd_kafka_log0((rkb)->rkb_rk, _logname,			\
                              level, fac, __VA_ARGS__);                 \
        } while (0)

#define rd_rkb_dbg(rkb,ctx,fac,...) do {				\
		if (unlikely((rkb)->rkb_rk->rk_conf.debug &		\
			     (RD_KAFKA_DBG_ ## ctx))) {			\
			rd_rkb_log(rkb, LOG_DEBUG, fac, __VA_ARGS__);	\
                }                                                       \
	} while (0)

extern rd_kafka_resp_err_t RD_TLS rd_kafka_last_error_code;

static RD_UNUSED RD_INLINE
rd_kafka_resp_err_t rd_kafka_set_last_error (rd_kafka_resp_err_t err,
					     int errnox) {
	if (errnox)
		errno = errnox;
	rd_kafka_last_error_code = err;
	return err;
}

extern rd_atomic32_t rd_kafka_thread_cnt_curr;

extern char RD_TLS rd_kafka_thread_name[64];

int rd_kafka_path_is_dir (const char *path);

int rd_kafka_poll_cb (rd_kafka_t *rk, rd_kafka_op_t *rko,
                      int cb_type, void *opaque);

rd_kafka_resp_err_t rd_kafka_subscribe_rkt (rd_kafka_itopic_t *rkt);


text:
"""Test Motor, an asynchronous driver for MongoDB and Tornado."""

import logging
import unittest
from test.test_environment import CLIENT_PEM, db_user, env  # noqa: F401
from unittest import SkipTest

try:
    # Enable the fault handler to dump the traceback of each running
    # thread
    # after a segfault.
    import faulthandler

    faulthandler.enable()
    # Dump the tracebacks of all threads after 25 minutes.
    if hasattr(faulthandler, "dump_traceback_later"):
        faulthandler.dump_traceback_later(25 * 60)
except ImportError:
    pass

def suppress_tornado_warnings():
    for name in ["tornado.general", "tornado.access"]:
        logger = logging.getLogger(name)
        logger.setLevel(logging.ERROR)

class SkippedModule(object):
    def __init__(self, name, reason):
        def runTest(self):
            raise SkipTest(str(reason))

        self.test_case = type(str(name), (unittest.TestCase,), {"runTest": runTest})

class MotorTestLoader(unittest.TestLoader):
    def __init__(self, avoid=None, reason=None):
        super().__init__()
        self._avoid = []

    def avoid(self, *prefixes, **kwargs):
        """Skip a module.

        The usual "raise SkipTest" from a module doesn't work if the module
        won't even parse in Python 2, so prevent TestLoader from importing
        modules with the given prefix.

        "prefix" is a path prefix like "asyncio_tests".
        """
        for prefix in prefixes:
            self._avoid.append((prefix, kwargs["reason"]))

    def _get_module_from_name(self, name):
        for prefix, reason in self._avoid:
            if name.startswith(prefix):
                return SkippedModule(name, reason)

        return super()._get_module_from_name(name)

class MockRequestHandler(object):
    """For testing MotorGridOut.stream_to_handler."""

    def __init__(self):
        self.n_written = 0

    def write(self, data):
        self.n_written += len(data)

    def flush(self):
        pass


text:
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using EPiServer.HtmlParsing;
using EPiServer.Web.Mvc.Html;

namespace Geta.EPi.Extensions.Helpers
{
    /// <summary>
    ///     Helper methods for working with EPiServer XForms.
    /// </summary>
    public static class XFormHelper
    {
        /// <summary>
        ///     Dictionary of TABLE tags and matching HTML classes for markup replacements
        ///     when cleaning XForm using <see cref="XFormHelper.CleanupXFormHtmlMarkup" />
        ///     method with parameter addClassAttribute = true
        /// </summary>
        public static Dictionary<string, string> TableTagCssClasses = new Dictionary<string, string>
        {
            {"table", "xform-table"},
            {"tr", "xform-row"},
            {"td", "xform-col"},
            {"tbody", "xform-body-col-{0}"},
            {"thead", "xform-thead"}
        };

        /// <summary>
        /// Gets number of table columns from html fragment collection.
        /// </summary>
        /// <param name="htmlFragments"></param>
        /// <returns></returns>
        public static int GetNumberOfTableColumns(IEnumerable<HtmlFragment> htmlFragments)
        {
            var fragmentsList = htmlFragments.ToList();
            var firstTrIndex = fragmentsList.FindIndex(x => x.Name == "tr");
            var tdCount = 0;

            if (firstTrIndex > -1)
            {
                for (int index = firstTrIndex + 1; index < fragmentsList.Count; index++)
                {
                    var fragment = fragmentsList[index];

                    if (fragment.Name == "tr")
                    {
                        break;
                    }

                    if (fragment.Name == "td" && fragment.FragmentType == HtmlFragmentType.Element)
                    {
                        tdCount++;
                    }
                }
            }

            if (tdCount == 0)
                tdCount++;

            return tdCount;
        }

        /// <summary>
        /// Renders clean XForm HTML markup. Replaces tables with divs.
        /// </summary>
        /// <param name="helper">HtmlHelper</param>
        /// <param name="htmlFragments">IEnumerable<HtmlFragment></param>
        public static void RenderCleanXFormHtmlMarkup(this HtmlHelper helper, IEnumerable<HtmlFragment> htmlFragments)
        {
            int numTableColumns = GetNumberOfTableColumns(htmlFragments);

            foreach (var htmlFragment in htmlFragments)
            {
                helper.ViewContext.Writer.Write(helper.Fragment(CleanupXFormHtmlMarkup(htmlFragment, true, numTableColumns)));
            }
        }

        /// <summary>
        ///     Replaces XForm HTML tables with more semantic markup.
        /// </summary>
        /// <param name="htmlFragment">HtmlFragment of XForm</param>
        /// <param name="addClassAttribute">
        ///     Will add individual HTML class for each element.
        ///     For matching HTML classes see <see cref="XFormHelper.TableTagCssClasses" />
        /// </param>
        /// <param name="numTableColumns">Number of columns in the XForm table. Use GetNumberOfTableColumns to retrieve the value.</param>
        /// <returns>Modified HtmlFragment</returns>
        public static HtmlFragment CleanupXFormHtmlMarkup(HtmlFragment htmlFragment, bool addClassAttribute = true, int numTableColumns = 1)
        {
            var originalTag = htmlFragment.Name;

            if (!IsTableFragment(htmlFragment))
            {
                return htmlFragment;
            }

            htmlFragment.Name = "div";
            var elFragment = htmlFragment as ElementFragment;

            if (elFragment != null)
            {
                RemoveAttribute(elFragment, "valign");

                if (addClassAttribute)
                {
                    AddClassAttribute(originalTag, elFragment, numTableColumns);
                }
            }

            return htmlFragment;
        }

        private static void AddClassAttribute(string originalTag, ElementFragment elFragment, int numTableColumns)
        {
            var classAttribute = GetCssClass(originalTag, numTableColumns);

            if (classAttribute != null)
                elFragment.Attributes.Add(classAttribute);
        }

        private static void RemoveAttribute(ElementFragment elFragment, string attribute)
        {
            if (elFragment.HasAttributes && elFragment.Attributes[attribute] != null)
            {
                elFragment.Attributes.Remove(attribute);
            }
        }

        private static bool IsTableFragment(HtmlFragment htmlFragment)
        {
            var tableTags = new[] {"table", "tr", "td", "thead", "tfoot", "tbody"};
            return tableTags.Contains(htmlFragment.Name);
        }

        private static AttributeFragment GetCssClass(string tag, int numTableColumns)
        {
            string cssClass = TableTagCssClasses[tag];

            if (tag == "tbody")
            {
                cssClass = numTableColumns == 1 ? "xform-body" : string.Format(cssClass, numTableColumns);
            }

            return new AttributeFragment
            {
                Name = "class",
                Value = cssClass
            };
        }
    }
}


text:
"""DialogFlow Detect Intent Python sample, text input and sentiment analysis."""

# [START dialogflow_cx_v3_detect_intent_sentiment_analysis_async]
import uuid

from google.cloud.dialogflowcx_v3beta1.services.sessions import SessionsClient
from google.cloud.dialogflowcx_v3beta1.types import session

def run_sample():
    # TODO(developer): Update these values when running the function
    project_id = "YOUR-PROJECT-ID"
    location = "YOUR-LOCATION-ID"
    agent_id = "YOUR-AGENT-ID"
    text = "Perfect!"
    language_code = "en-us"

    detect_intent_with_sentiment_analysis(
        project_id,
        location,
        agent_id,
        text,
        language_code,
    )

def detect_intent_with_sentiment_analysis(
    project_id,
    location,
    agent_id,
    text,
    language_code,
):
    """Returns the result of detect intent with sentiment analysis"""

    client_options = None
    if location != "global":
        api_endpoint = f"{location}-dialogflow.googleapis.com:443"
        print(f"API Endpoint: {api_endpoint}\n")
        client_options = {"api_endpoint": api_endpoint}
    session_client = SessionsClient(client_options=client_options)
    session_id = str(uuid.uuid4())

    session_path = session_client.session_path(
        project=project_id,
        location=location,
        agent=agent_id,
        session=session_id,
    )

    text_input = session.TextInput(text=text)
    query_input = session.QueryInput(
      text=text_input,
      language_code=language_code
    )
    query_params = session.QueryParameters(
      analyze_query_text_sentiment=True,
    )
    request = session.DetectIntentRequest(
        session=session_path,
        query_input=query_input,
        query_params=query_params,
    )

    response = session_client.detect_intent(request=request)
    score = response.query_result.sentiment_analysis_result.score
    print('Sentiment Score: {score}')
    return score

# [END dialogflow_cx_v3_detect_intent_sentiment_analysis_async]

if __name__ == "__main__":
    run_sample()


text:
<!DOCTYPE html>

  <meta charset="UTF-8">
  <title>Code Coverage for /var/www/github/ksutils/src/KsUtils/Validator/NotEmpty.php</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link href="css/bootstrap.min.css" rel="stylesheet">
  <link href="css/bootstrap-responsive.min.css" rel="stylesheet">
  <link href="css/style.css" rel="stylesheet">

 /

var /

www /

github /

ksutils /

src /

KsUtils /

Validator /

NotEmpty.php

Code Coverage

Classes and Traits

Functions and Methods

Lines

      Total

100.00%

1 / 1

100.00%

2 / 2

      <acronym title="Change Risk Anti-Patterns (CRAP) Index">CRAP</acronym>

100.00%

3 / 3

      NotEmpty

100.00%

1 / 1

100.00%

2 / 2

      3

100.00%

3 / 3

       __construct()

100.00%

1 / 1

      1

100.00%

2 / 2

       hasError($value)

100.00%

1 / 1

      2

100.00%

1 / 1

1
	<?php

2

3
	namespace KsUtils\Validator;

4

5
	/**

6
	 * Not empty Validator

7
	 * @author kostya

8
	 */

9
	class NotEmpty extends \KsUtils\Validator

10
	{

11
	    public function __construct()

12
	    {

13
	        $this->setErrorTpl("Must not be empty: [%s]");

14
	    }

15

16
	    /**

17
	     * @inheritdoc

18
	     */

19
	    protected function hasError($value)

20
	    {

21
	        return is_null($value) || trim($value) === "";

22
	    }

23
	}

Legend

     Executed
     Not Executed
     Dead Code

     Generated by PHP_CodeCoverage 1.2.12 using PHP 5.3.10-1ubuntu3.11 and PHPUnit 3.7.22 at Thu Apr 17 19:15:06 MSK 2014.


text:
[Home](./index.md) > [puppeteer](./puppeteer.md) > [Protocol](./puppeteer.protocol.md) > [Debugger](./puppeteer.protocol.debugger.md) > [ScopeType](./puppeteer.protocol.debugger.scopetype.md)

## Protocol.Debugger.ScopeType enum

Signature:

```typescript
export const enum ScopeType
```

## Enumeration Members

|  Member | Value | Description |
|  --- | --- | --- |
|  Block | 'block' |  |
|  Catch | 'catch' |  |
|  Closure | 'closure' |  |
|  Eval | 'eval' |  |
|  Global | 'global' |  |
|  Local | 'local' |  |
|  Module | 'module' |  |
|  Script | 'script' |  |
|  WasmExpressionStack | 'wasm-expression-stack' |  |
|  With | 'with' |  |


text:
// <copyright file="Event.cs" company="ViewTonic contributors">
//  Copyright (c) ViewTonic contributors. All rights reserved.
// </copyright>

namespace ViewTonic.Sdk
{
    using System.Diagnostics;

    // TODO (Cameron): Consider struct?
    [DebuggerDisplay("{SequenceNumber}: {Payload}")]
    public class Event
    {
        public long SequenceNumber { get; set; }

        public object Payload { get; set; }
    }
}


text:
package com.zjgsu.abroadStu.persistence;

import com.zjgsu.abroadStu.model.CourseInstance;
import com.zjgsu.abroadStu.model.CourseStudent;
import com.zjgsu.abroadStu.model.CourseTeacher;
import com.zjgsu.abroadStu.model.CourseTemplate;
import com.zjgsu.abroadStu.model.http.CourseInstanceDTO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Created by JIADONG on 16/4/14.
 */
public interface CourseMapper {

    List<CourseTemplate> selectCourseTemplateByProfessionId(@Param("professionId")Integer professionId);

    void insertCourseTemplate(List<CourseTemplate> courseTemplateList);

    List<CourseInstance> getCourseInstanceList();

    List<Integer> getCourseStudentList(@Param("id")Integer id);

    List<Integer> getCourseTeacherList(@Param("id")Integer id);

    void addCourseInstance (CourseInstance courseInstance);

    void addCourseStudents(List<CourseStudent> courseStudentList);

    void addCourseTeachers(List<CourseTeacher> courseTeacherList);

    List<CourseInstanceDTO> getCourseInstanceListByStudent(@Param("id")Integer id);

    List<CourseInstanceDTO> getCourseInstanceListByProfessionId(@Param("id")Integer id);

    List<CourseInstanceDTO> getCourseInstanceListByTeacher(@Param("id")Integer id);

    void deleteInstance(@Param("id")Integer id);

    void deleteStudentRelation(@Param("id")Integer id);

    void deleteTeacherRelation(@Param("id")Integer id);

 }


text:
namespace RecursiveChangeFileAttrib.Storage
{
    using System;
    using System.IO;
    using System.Windows.Forms;

    using Newtonsoft.Json;

    using RecursiveChangeFileAttrib.Utilities;

    public class SettingsManager<TSettings>
        where TSettings : new()
    {
        #region Constants

        private const string FILE_SETTINGS = @"settings.json";

        #endregion

        #region Fields

        private readonly string _path;

        #endregion

        #region Constructors and Destructors

        public SettingsManager()
        {
            string dirAsm = FileSystemHelper.GetAssemblyDirectory();

            this._path = Path.Combine(dirAsm, FILE_SETTINGS);
        }

        #endregion

        #region Public Properties

        public TSettings App { get; set; }

        #endregion

        #region Public Methods and Operators

        public void Read()
        {
            if (File.Exists(this._path))
            {
                try
                {
                    this.App = Json<TSettings>.Read(this._path);
                }
                catch (Exception)
                {
                    this.App = new TSettings();
                }
            }
            else
            {
                this.App = new TSettings();
            }
        }

        public void Save()
        {
            var serializer = new JsonSerializer { Formatting = Formatting.Indented };

            try
            {
                Json<TSettings>.Write(this._path, this.App, serializer);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }

        #endregion
    }
}


text:
@interface MZColorsViewController : UIViewController

@end


text:
/**
 * File: init.js
 *
 * initializes the app code
 *
 * @requires jquery
 *
 */

//Tip: root is just the window object

(function(root, factory) {
  // LAUNCHER MODULE EXECUTION (EXECUTION CALL)
  // This example launches the factory function without requiring anything.
  // Add your modules/libraries to the array argument.
  // Use this as a main execution of launcher module.
  if (typeof define == 'function' && define.amd) require(['jquery'],factory);
  else  factory(root.$);
  // AUGMENT EXISITING MODULES (EXECUTION CALL)
  // UNCOMMENT BELOW AND COMMENT OUT OTHER EXECUTION CALLS
  // Use this to modify existing libraries
  //if (typeof define == 'function' && define.amd)define(['ExistingModule'],factory);
  //else  root.ExistingModule = factory(root.ExistingModule);
  // CREATE A NEW MODULE (EXECUTION CALL)
  // UNCOMMENT BELOW AND COMMENT OUT OTHER EXECUTION CALLS
  //if (typeof define == 'function' && define.amd)define(['ExistingModule'],factory);
  //else  root.NewModuleName = factory(root.ExistingModule);
}(this, function($){

    //This should bring in you main app functions
    //and execute them.
    console.log($.fn.jquery);

}));


text:
var forOwn = require('../object/forOwn');

/**
 * Encode object into a query string.
 */
function encode(obj) {
    var query = [];
    forOwn(obj, function (val, key) {
        query.push(key + '=' + encodeURIComponent(val));
    });
    return (query.length) ? '?' + query.join('&') : '';
}

module.exports = encode;


text:
<?php

echo $response->getReasonPhrase();


text:
package net.geektop.common.encryption;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.test.context.SpringBootTest;

/**
 * @author Alex
 * @version V1.0
 * @Package net.geektop.common.encryption
 * @date 2020/9/9 18:41
 */
@SpringBootTest
class PGPEncryptHelperTest {

  private static final Logger logger = LoggerFactory.getLogger(PGPEncryptHelperTest.class);

}