text:
#ifndef COST_H
#define COST_H

#include "nodes/plannodes.h"
#include "nodes/relation.h"

/* defaults for costsize.c's Cost parameters */
/* NB: cost-estimation code should use the variables, not these constants! */
/* If you change these, update backend/utils/misc/postgresql.sample.conf */
#define DEFAULT_SEQ_PAGE_COST  1.0
#define DEFAULT_RANDOM_PAGE_COST  4.0
#define DEFAULT_CPU_TUPLE_COST	0.01
#define DEFAULT_CPU_INDEX_TUPLE_COST 0.005
#define DEFAULT_CPU_OPERATOR_COST  0.0025
#define DEFAULT_PARALLEL_TUPLE_COST 0.1
#define DEFAULT_PARALLEL_SETUP_COST  1000.0

#define DEFAULT_EFFECTIVE_CACHE_SIZE  524288	/* measured in pages */

typedef enum
{
	CONSTRAINT_EXCLUSION_OFF,	/* do not use c_e */
	CONSTRAINT_EXCLUSION_ON,	/* apply c_e to all rels */
	CONSTRAINT_EXCLUSION_PARTITION	/* apply c_e to otherrels only */
}			ConstraintExclusionType;

/*
 * prototypes for costsize.c
 *	  routines to compute costs and sizes
 */

/* parameter variables and flags */
extern PGDLLIMPORT double seq_page_cost;
extern PGDLLIMPORT double random_page_cost;
extern PGDLLIMPORT double cpu_tuple_cost;
extern PGDLLIMPORT double cpu_index_tuple_cost;
extern PGDLLIMPORT double cpu_operator_cost;
extern PGDLLIMPORT double parallel_tuple_cost;
extern PGDLLIMPORT double parallel_setup_cost;
extern PGDLLIMPORT int effective_cache_size;
extern PGDLLIMPORT Cost disable_cost;
extern PGDLLIMPORT int	max_parallel_workers_per_gather;
extern PGDLLIMPORT bool enable_seqscan;
extern PGDLLIMPORT bool enable_indexscan;
extern PGDLLIMPORT bool enable_indexonlyscan;
extern PGDLLIMPORT bool enable_bitmapscan;
extern PGDLLIMPORT bool enable_tidscan;
extern PGDLLIMPORT bool enable_sort;
extern PGDLLIMPORT bool enable_hashagg;
extern PGDLLIMPORT bool enable_nestloop;
extern PGDLLIMPORT bool enable_material;
extern PGDLLIMPORT bool enable_mergejoin;
extern PGDLLIMPORT bool enable_hashjoin;
extern PGDLLIMPORT bool enable_gathermerge;
extern PGDLLIMPORT int	constraint_exclusion;

extern double clamp_row_est(double nrows);
extern double index_pages_fetched(double tuples_fetched, BlockNumber pages,
					double index_pages, PlannerInfo *root);
extern void cost_seqscan(Path *path, PlannerInfo *root, RelOptInfo *baserel,
			 ParamPathInfo *param_info);
extern void cost_samplescan(Path *path, PlannerInfo *root, RelOptInfo *baserel,
				ParamPathInfo *param_info);
extern void cost_index(IndexPath *path, PlannerInfo *root,
		   double loop_count, bool partial_path);
extern void cost_bitmap_heap_scan(Path *path, PlannerInfo *root, RelOptInfo *baserel,
					  ParamPathInfo *param_info,
					  Path *bitmapqual, double loop_count);
extern void cost_bitmap_and_node(BitmapAndPath *path, PlannerInfo *root);
extern void cost_bitmap_or_node(BitmapOrPath *path, PlannerInfo *root);
extern void cost_bitmap_tree_node(Path *path, Cost *cost, Selectivity *selec);
extern void cost_tidscan(Path *path, PlannerInfo *root,
			 RelOptInfo *baserel, List *tidquals, ParamPathInfo *param_info);
extern void cost_subqueryscan(SubqueryScanPath *path, PlannerInfo *root,
				  RelOptInfo *baserel, ParamPathInfo *param_info);
extern void cost_functionscan(Path *path, PlannerInfo *root,
				  RelOptInfo *baserel, ParamPathInfo *param_info);
extern void cost_tableexprscan(Path *path, PlannerInfo *root,
				   RelOptInfo *baserel, ParamPathInfo *param_info);
extern void cost_valuesscan(Path *path, PlannerInfo *root,
				RelOptInfo *baserel, ParamPathInfo *param_info);
extern void cost_tablefuncscan(Path *path, PlannerInfo *root,
				   RelOptInfo *baserel, ParamPathInfo *param_info);
extern void cost_ctescan(Path *path, PlannerInfo *root,
			 RelOptInfo *baserel, ParamPathInfo *param_info);
extern void cost_namedtuplestorescan(Path *path, PlannerInfo *root,
						 RelOptInfo *baserel, ParamPathInfo *param_info);
extern void cost_recursive_union(Path *runion, Path *nrterm, Path *rterm);
extern void cost_sort(Path *path, PlannerInfo *root,
		  List *pathkeys, Cost input_cost, double tuples, int width,
		  Cost comparison_cost, int sort_mem,
		  double limit_tuples);
extern void cost_merge_append(Path *path, PlannerInfo *root,
				  List *pathkeys, int n_streams,
				  Cost input_startup_cost, Cost input_total_cost,
				  double tuples);
extern void cost_material(Path *path,
			  Cost input_startup_cost, Cost input_total_cost,
			  double tuples, int width);
extern void cost_agg(Path *path, PlannerInfo *root,
		 AggStrategy aggstrategy, const AggClauseCosts *aggcosts,
		 int numGroupCols, double numGroups,
		 Cost input_startup_cost, Cost input_total_cost,
		 double input_tuples);
extern void cost_windowagg(Path *path, PlannerInfo *root,
			   List *windowFuncs, int numPartCols, int numOrderCols,
			   Cost input_startup_cost, Cost input_total_cost,
			   double input_tuples);
extern void cost_group(Path *path, PlannerInfo *root,
		   int numGroupCols, double numGroups,
		   Cost input_startup_cost, Cost input_total_cost,
		   double input_tuples);
extern void initial_cost_nestloop(PlannerInfo *root,
					  JoinCostWorkspace *workspace,
					  JoinType jointype,
					  Path *outer_path, Path *inner_path,
					  JoinPathExtraData *extra);
extern void final_cost_nestloop(PlannerInfo *root, NestPath *path,
					JoinCostWorkspace *workspace,
					JoinPathExtraData *extra);
extern void initial_cost_mergejoin(PlannerInfo *root,
					   JoinCostWorkspace *workspace,
					   JoinType jointype,
					   List *mergeclauses,
					   Path *outer_path, Path *inner_path,
					   List *outersortkeys, List *innersortkeys,
					   JoinPathExtraData *extra);
extern void final_cost_mergejoin(PlannerInfo *root, MergePath *path,
					 JoinCostWorkspace *workspace,
					 JoinPathExtraData *extra);
extern void initial_cost_hashjoin(PlannerInfo *root,
					  JoinCostWorkspace *workspace,
					  JoinType jointype,
					  List *hashclauses,
					  Path *outer_path, Path *inner_path,
					  JoinPathExtraData *extra);
extern void final_cost_hashjoin(PlannerInfo *root, HashPath *path,
					JoinCostWorkspace *workspace,
					JoinPathExtraData *extra);
extern void cost_gather(GatherPath *path, PlannerInfo *root,
			RelOptInfo *baserel, ParamPathInfo *param_info, double *rows);
extern void cost_subplan(PlannerInfo *root, SubPlan *subplan, Plan *plan);
extern void cost_qual_eval(QualCost *cost, List *quals, PlannerInfo *root);
extern void cost_qual_eval_node(QualCost *cost, Node *qual, PlannerInfo *root);
extern void compute_semi_anti_join_factors(PlannerInfo *root,
							   RelOptInfo *outerrel,
							   RelOptInfo *innerrel,
							   JoinType jointype,
							   SpecialJoinInfo *sjinfo,
							   List *restrictlist,
							   SemiAntiJoinFactors *semifactors);
extern void set_baserel_size_estimates(PlannerInfo *root, RelOptInfo *rel);
extern double get_parameterized_baserel_size(PlannerInfo *root,
							   RelOptInfo *rel,
							   List *param_clauses);
extern double get_parameterized_joinrel_size(PlannerInfo *root,
							   RelOptInfo *rel,
							   Path *outer_path,
							   Path *inner_path,
							   SpecialJoinInfo *sjinfo,
							   List *restrict_clauses);
extern void set_joinrel_size_estimates(PlannerInfo *root, RelOptInfo *rel,
						   RelOptInfo *outer_rel,
						   RelOptInfo *inner_rel,
						   SpecialJoinInfo *sjinfo,
						   List *restrictlist);
extern void set_subquery_size_estimates(PlannerInfo *root, RelOptInfo *rel);
extern void set_function_size_estimates(PlannerInfo *root, RelOptInfo *rel);
extern void set_values_size_estimates(PlannerInfo *root, RelOptInfo *rel);
extern void set_cte_size_estimates(PlannerInfo *root, RelOptInfo *rel,
					   double cte_rows);
extern void set_tablefunc_size_estimates(PlannerInfo *root, RelOptInfo *rel);
extern void set_namedtuplestore_size_estimates(PlannerInfo *root, RelOptInfo *rel);
extern void set_foreign_size_estimates(PlannerInfo *root, RelOptInfo *rel);
extern PathTarget *set_pathtarget_cost_width(PlannerInfo *root, PathTarget *target);
extern double compute_bitmap_pages(PlannerInfo *root, RelOptInfo *baserel,
					 Path *bitmapqual, int loop_count, Cost *cost, double *tuple);

/*
 * prototypes for clausesel.c
 *	  routines to compute clause selectivities
 */
extern Selectivity clauselist_selectivity(PlannerInfo *root,
					   List *clauses,
					   int varRelid,
					   JoinType jointype,
					   SpecialJoinInfo *sjinfo);
extern Selectivity clause_selectivity(PlannerInfo *root,
				   Node *clause,
				   int varRelid,
				   JoinType jointype,
				   SpecialJoinInfo *sjinfo);
extern void cost_gather_merge(GatherMergePath *path, PlannerInfo *root,
				  RelOptInfo *rel, ParamPathInfo *param_info,
				  Cost input_startup_cost, Cost input_total_cost,
				  double *rows);

#endif							/* COST_H */


text:
[![NPM version][npm-image]][npm-url]
[![NPM downloads][downloads-image]][downloads-url]

[![Github NodeJS][github-nodejs]][github-action-url]
[![Codecov][codecov-image]][codecov-url]

[![Semantic Release][semantic-release-image]][semantic-release-url]

[![Visual Studio Code][vscode-image]][vscode-url]
[![Wallaby.js][wallaby-image]][wallaby-url]

Color map generator with no dependency.

Inspired from [`colormap`](https://github.com/bpostlethwaite/colormap).

## `createColors(from, to, shades, alpha?)`

```ts
import { createColors } from 'color-map'

// creates array of [r,g,b,a]
const rgbaRange = createColors([0, 0, 255], [0, 255, 128], 72, [0, 1])

// creates array of [r,g,b,1]
const rgbRange = createColors([0, 0, 255], [0, 255, 128], 72)
```

## `rgbHex(rgb)`

```ts
import { rgbHex } from 'color-map'

rgbHex([0, 128, 255]) // '#0080ff'
rgbHex([0, 128, 255, 0.3]) // '#0080ff'
```

## `rgbaString(rgba)`

```ts
import { rgbaString } from 'color-map'

rgbaString([0, 128, 255, 0.2]) // 'rgba(0,128,255,0.2)`

```

## `createColorsFromMap(colormap, shades, alpha?)`

```ts
import { createColorsFromMap, ColorMap } from 'color-map'

const summer: ColorMap = [{ index: 0, rgb: [0,128,102] }, { index: 1, rgb: [255,255,102] }]

const colors = createColorsFromMap(summer, 60)
```

## Contribute

```sh
# after fork and clone
npm install

# begin making changes
git checkout -b <branch>
npm run watch

# after making change(s)
git commit -m "<commit message>"
git push

# create PR
```

[codecov-image]: https://codecov.io/gh/unional/color-map/branch/master/graph/badge.svg
[codecov-url]: https://codecov.io/gh/unional/color-map
[downloads-image]: https://img.shields.io/npm/dm/color-map.svg?style=flat
[downloads-url]: https://npmjs.org/package/color-map
[github-nodejs]: https://github.com/unional/color-map/workflows/nodejs/badge.svg
[github-action-url]: https://github.com/unional/color-map/actions
[npm-image]: https://img.shields.io/npm/v/color-map.svg?style=flat
[npm-url]: https://npmjs.org/package/color-map
[semantic-release-image]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
[semantic-release-url]: https://github.com/semantic-release/semantic-release
[vscode-image]: https://img.shields.io/badge/vscode-ready-green.svg
[vscode-url]: https://code.visualstudio.com/
[wallaby-image]: https://img.shields.io/badge/wallaby.js-configured-green.svg
[wallaby-url]: https://wallabyjs.com

redpajama_set_name: RedPajamaGithub


text:
OpenS3 Utils
============

.. automodule:: openS3.utils
   :members:


text:
"""CLI Module

This module helps enable the CLI."""
import sys
import logging
import traceback
import time, datetime
from colorama import Fore

from mookfist_lled_controller import scan_bridges
from mookfist_lled_controller import create_bridge

from mookfist_lled_controller import logger
from mookfist_lled_controller.exceptions import UnsupportedVersion
from mookfist_lled_controller.exceptions import InvalidGroup
from mookfist_lled_controller.exceptions import NoBridgeFound

LVL_NAMES = {
    'DEBUG': Fore.CYAN,
    'INFO': Fore.GREEN,
    'WARNING': Fore.YELLOW,
    'ERROR': Fore.RED,
    'CRTICIAL': Fore.MAGENTA
}

class ColoredFormatter(logging.Formatter):
    """Colord log formatter"""
    def __init__(self, *args, **kwargs):
        logging.Formatter.__init__(self, *args, **kwargs)
        self.timer = datetime.datetime.now()

    def format(self, record):
        lvlname_color = LVL_NAMES[record.levelname]

        lvlname = record.levelname.ljust(8)

        timestamp = datetime.datetime.now() - self.timer

        lvl = '%s[%s%s%s]' % (Fore.WHITE, lvlname_color, lvlname, Fore.WHITE)
        msg = '%s %s %s%s' % (timestamp, lvl, Fore.RESET, record.msg)
        return msg

def configure_logger(debug=False):
    """Configure a logger with colored output"""

    formatter = logger.ColoredFormatter()
    handler   = logging.StreamHandler(sys.stdout)
    handler.setFormatter(formatter)

    log = logging.getLogger()

    if debug == True:
        log.setLevel(logging.DEBUG)
        handler.setLevel(logging.DEBUG)
    else:
        log.setLevel(logging.INFO)
        handler.setLevel(logging.INFO)

    log.addHandler(handler)

class Main(object):
    """the application"""

    def __init__(self, arguments):

        if arguments['fade']:
            self.action = 'fade'
        elif arguments['fadec']:
            self.action = 'fadec'
        elif arguments['color']:
            self.action = 'color'
        elif arguments['rgb']:
            self.action = 'rgb'
        elif arguments['brightness']:
            self.action = 'brightness'
        elif arguments['on']:
            self.action = ['on']
        elif arguments['off']:
            self.action = 'off'
        elif arguments['white']:
            self.action = 'white'
        elif arguments['colorcycle']:
            self.action = 'colorcycle'

        if arguments['--bridge-version'] == '4' or arguments['--bridge-version'] == '5':
            self.bridge_version = 4
        elif arguments['--bridge-version'] == '6':
            self.bridge_version = 6
        elif arguments['--bridge-version'] != None:
            raise UnsupportedVersion
        else:
            self.bridge_version = 4

        self.log = logging.getLogger('lled')

        self.arguments = arguments

    def action_fade(self):
        start = int(self.arguments['<start>'])
        end   = int(self.arguments['<end>'])

        if (start > end):
            steps = -1
        else:
            steps = 1

        self.log.info('Transitioning brightness from %s%% to %s%%' % (start, end))

        self.bridge.on(self.arguments['--group'])

        for brightness in range(start, end, steps):
            self.bridge.brightness(brightness, self.arguments['--group'])

    def action_fadec(self):
        start = int(self.arguments['<start>'])
        end   = int(self.arguments['<end>'])

        if (start > end):
            steps = -1
        else:
            steps = 1

        self.log.info('Transitioning color from %s to %s' % (start, end))

        for color in range(start,end,steps):
            self.bridge.color(color, self.arguments['--group'])

    def action_color(self):
        color = int(self.arguments['<color>'])
        self.log.info('Setting color to %s' % color)
        self.bridge.color(color, self.arguments['--group'])

    def action_white(self):
        self.log.info('Setting color to white')
        self.bridge.white(self.arguments['--group'])

    def action_brightness(self):
        brightness = int(self.arguments['<brightness>'])
        self.log.info('Setting brightness to %s%%' % brightness)
        self.bridge.brightness(brightness, self.arguments['--group'])

    def action_on(self):
        self.log.info('Turning lights on')
        self.bridge.on(self.arguments['--group'])

    def action_off(self):
        self.log.info('Turning lights off')
        self.bridge.off(self.arguments['--group'])

    def action_rgb(self):
        r = int(self.arguments['<r>'])
        g = int(self.arguments['<g>'])
        b = int(self.arguments['<b>'])

        self.log.info('Setting color to rgb(%s, %s, %s)' % (r, g, b))
        self.bridge.color_rgb(r, g, b, self.arguments['--group'])

    def action_colorcycle(self):
        for x in range(0,256):
            if x < 0:
                x = x + 255
            elif x > 255:
                x = x - 255
            self.log.info('Setting color to %s' % x)
            self.bridge.color(x, self.arguments['--group'])

    def route_action(self):
        if self.arguments['fade']:
            self.action_fade()
        elif self.arguments['fadec']:
            self.action_fadec()
        elif self.arguments['color']:
            self.action_color()
        elif self.arguments['brightness']:
            self.action_brightness()
        elif self.arguments['on']:
            self.action_on()
        elif self.arguments['off']:
            self.action_off()
        elif self.arguments['white']:
            self.action_white()
        elif self.arguments['rgb']:
            self.action_rgb()
        elif self.arguments['colorcycle']:
            self.action_colorcycle()

    def run(self):
        try:
            if (self.arguments['--bridge-ip']):
                host = self.arguments['--bridge-ip']
            else:
                self.log.info('Scanning for bridge...')
                bridges = scan_bridges(self.bridge_version)
                self.log.info('Found %s bridge(s)' % len(bridges))

                if len(bridges) > 1:
                    self.log.warning('Multiple bridges have been found. I will choose the first one I saw')
                    self.log.warning('If you really don\'t want me to do that, then use the --bridge-ip (and --bridge-port if needed) flags when using this tool')

                    self.log.info('--- Available Bridges')
                    for bridge in bridges:
                        self.log.info('    %s - %s' % (bridge[0], bridge[1]))
                elif len(bridges) == 0:
                    raise NoBridgeFound

                host = bridges[0][0]

            rc = 1
            if self.arguments['--repeat']:
                rc = int(self.arguments['--repeat'])

            pause = 100
            if self.arguments['--pause']:
                pause = int(self.arguments['--pause'])

            version = 4
            if self.arguments['--bridge-version']:
                version = int(self.arguments['--bridge-version'])

            if version == 4 or version == 5:
                port = 8899
            elif version == 6:
                port = 5987
            elif self.arguments['--bridge-port']:
                port = int(self.arguments['--bridge-port'])

            self.log.info('--- Bridge Details')
            self.log.info('Version: %s' % version)
            self.log.info('IP: %s' % host)
            self.log.info('Port: %s' % port)
            self.log.debug('--- Settings')
            self.log.debug('Pause: %sms' % pause)
            self.log.debug('Command Repeat: %s' % rc)

            self.bridge = create_bridge(version, host, port, pause, rc)

            self.route_action()
        except UnsupportedVersion:
            self.log.error('The chosen bridge version is unsupported')
        except InvalidGroup as e:
            exc_type, exc_value, exc_traceback = sys.exc_info()
            self.log.error('Groups can be numbered 1 through 4 only')
            self.log.error(traceback.format_exception(exc_type, exc_value, exc_traceback))
        except NoBridgeFound:
            self.log.error('Sorry, I was not able to find any bridges. So either give me the IP (and port number) of the bridge you wish to use, or figure out why I can not find any bridges')


text:
"""
Copyright 2013 Steven Diamond

This file is part of CVXPY.

CVXPY is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

CVXPY is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with CVXPY.  If not, see <http://www.gnu.org/licenses/>.
"""

import cvxpy.interface as intf
import cvxpy.utilities as u
import cvxpy.settings as s
from cvxpy.utilities import performance_utils as pu
from cvxpy.constraints import EqConstraint, LeqConstraint
from cvxpy.expressions import types
import abc
import numpy as np

def _cast_other(binary_op):
    """Casts the second argument of a binary operator as an Expression.

    Args:
        binary_op: A binary operator in the Expression class.

    Returns:
        A wrapped binary operator that can handle non-Expression arguments.
    """
    def cast_op(self, other):
        """A wrapped binary operator that can handle non-Expression arguments.
        """
        other = self.cast_to_const(other)
        return binary_op(self, other)
    return cast_op

class Expression(u.Canonical):
    """
    A mathematical expression in a convex optimization problem.
    """

    __metaclass__ = abc.ABCMeta

    # Handles arithmetic operator overloading with Numpy.
    __array_priority__ = 100

    def __array__(self):
        """Prevents Numpy == from iterating over the Expression.
        """
        return np.array([s.NP_EQUAL_STR], dtype="object")

    @abc.abstractmethod
    def value(self):
        """Returns the numeric value of the expression.

        Returns:
            A numpy matrix or a scalar.
        """
        return NotImplemented

    def __str__(self):
        """Returns a string showing the mathematical expression.
        """
        return self.name()

    def __repr__(self):
        """Returns a string with information about the expression.
        """
        return "Expression(%s, %s, %s)" % (self.curvature,
                                           self.sign,
                                           self.size)

    @abc.abstractmethod
    def name(self):
        """Returns the string representation of the expression.
        """
        return NotImplemented

    @abc.abstractmethod
    def init_dcp_attr(self):
        """Determines the curvature, sign, and shape from the arguments.
        """
        return NotImplemented

    # Curvature properties.

    @property
    def curvature(self):
        """ Returns the curvature of the expression.
        """
        return str(self._dcp_attr.curvature)

    def is_constant(self):
        """Is the expression constant?
        """
        return self._dcp_attr.curvature.is_constant()

    def is_affine(self):
        """Is the expression affine?
        """
        return self._dcp_attr.curvature.is_affine()

    def is_convex(self):
        """Is the expression convex?
        """
        return self._dcp_attr.curvature.is_convex()

    def is_concave(self):
        """Is the expression concave?
        """
        return self._dcp_attr.curvature.is_concave()

    def is_dcp(self):
        """Is the expression DCP compliant? (i.e., no unknown curvatures).
        """
        return self._dcp_attr.curvature.is_dcp()

    # Sign properties.

    @property
    def sign(self):
        """ Returns the sign of the expression.
        """
        return str(self._dcp_attr.sign)

    def is_zero(self):
        """Is the expression all zero?
        """
        return self._dcp_attr.sign.is_zero()

    def is_positive(self):
        """Is the expression positive?
        """
        return self._dcp_attr.sign.is_positive()

    def is_negative(self):
        """Is the expression negative?
        """
        return self._dcp_attr.sign.is_negative()

    # The shape of the expression, an object.
    @property
    def shape(self):
        """ Returns the shape of the expression.
        """
        return self._dcp_attr.shape

    @property
    def size(self):
        """ Returns the (row, col) dimensions of the expression.
        """
        return self.shape.size

    def is_scalar(self):
        """Is the expression a scalar?
        """
        return self.size == (1, 1)

    def is_vector(self):
        """Is the expression a column or row vector?
        """
        return min(self.size) == 1

    def is_matrix(self):
        """Is the expression a matrix?
        """
        return self.size[0] > 1 and self.size[1] > 1

    def __getitem__(self, key):
        """Return a slice/index into the expression.
        """
        # Indexing into a scalar returns the scalar.
        if self.is_scalar():
            return self
        else:
            return types.index()(self, key)

    @property
    def T(self):
        """The transpose of an expression.
        """
        # Transpose of a scalar is that scalar.
        if self.is_scalar():
            return self
        else:
            return types.transpose()(self)

    def __pow__(self, power):
        """The power operator.
        """
        if not np.isscalar(power):
            raise TypeError("Power must be a numeric scalar.")
        elif power == 2:
            return types.square()(self)
        elif power == 0.5:
            return types.sqrt()(self)
        elif power == -1:
            return types.inv_pos()(self)
        else:
            raise ValueError("Invalid power: %d." % power)

    # Arithmetic operators.
    @staticmethod
    def cast_to_const(expr):
        """Converts a non-Expression to a Constant.
        """
        return expr if isinstance(expr, Expression) else types.constant()(expr)

    @_cast_other
    def __add__(self, other):
        """The sum of two expressions.
        """
        return types.add_expr()([self, other])

    @_cast_other
    def __radd__(self, other):
        """Called for Number + Expression.
        """
        return other + self

    @_cast_other
    def __sub__(self, other):
        """The difference of two expressions.
        """
        return self + -other

    @_cast_other
    def __rsub__(self, other):
        """Called for Number - Expression.
        """
        return other - self

    @_cast_other
    def __mul__(self, other):
        """The product of two expressions.
        """
        # Cannot multiply two non-constant expressions.
        if not self.is_constant() and \
           not other.is_constant():
            raise TypeError("Cannot multiply two non-constants.")
        # Multiplying by a constant on the right is handled differently
        # from multiplying by a constant on the left.
        elif self.is_constant():
            return types.mul_expr()(self, other)
        # Having the constant on the left is more efficient.
        elif self.is_scalar() or other.is_scalar():
            return types.mul_expr()(other, self)
        else:
            return types.rmul_expr()(self, other)

    @_cast_other
    def __truediv__(self, other):
        """One expression divided by another.
        """
        return self.__div__(other)

    @_cast_other
    def __div__(self, other):
        """One expression divided by another.
        """
        # Can only divide by scalar constants.
        if other.is_constant() and other.is_scalar():
            return types.div_expr()(self, other)
        else:
            raise TypeError("Can only divide by a scalar constant.")

    @_cast_other
    def __rdiv__(self, other):
        """Called for Number / Expression.
        """
        return other / self

    @_cast_other
    def __rtruediv__(self, other):
        """Called for Number / Expression.
        """
        return other / self

    @_cast_other
    def __rmul__(self, other):
        """Called for Number * Expression.
        """
        return other * self

    def __neg__(self):
        """The negation of the expression.
        """
        return types.neg_expr()(self)

    #needed for python3:
    def __hash__(self):
        return id(self)

    # Comparison operators.
    @_cast_other
    def __eq__(self, other):
        """Returns an equality constraint.
        """
        return EqConstraint(self, other)

    @_cast_other
    def __le__(self, other):
        """Returns an inequality constraint.
        """
        return LeqConstraint(self, other)

    def __lt__(self, other):
        """Returns an inequality constraint.
        """
        return self <= other

    @_cast_other
    def __ge__(self, other):
        """Returns an inequality constraint.
        """
        return other.__le__(self)

    def __gt__(self, other):
        """Returns an inequality constraint.
        """
        return self >= other


text:
'use strict';

jest
  .dontMock('worker-farm')
  .dontMock('../../lib/ModuleTransport')
  .dontMock('../index');

jest.mock('fs');

var Cache = require('../../Cache');

var OPTIONS = {
  transformModulePath: '/foo/bar',
  cache: new Cache({}),
};

describe('Transformer', function() {
  var Transformer;
  var workers;

  beforeEach(function() {
    workers = jest.genMockFn();
    jest.setMock('worker-farm', jest.genMockFn().mockImpl(function() {
      return workers;
    }));
    require('fs').readFile.mockImpl(function(file, callback) {
      callback(null, 'content');
    });
    Transformer = require('../');
  });

  pit('should loadFileAndTransform', function() {
    workers.mockImpl(function(data, callback) {
      callback(null, { code: 'transformed', map: 'sourceMap' });
    });
    require('fs').readFile.mockImpl(function(file, callback) {
      callback(null, 'content');
    });

    return new Transformer(OPTIONS).loadFileAndTransform('file')
      .then(function(data) {
        expect(data).toEqual({
          code: 'transformed',
          map: 'sourceMap',
          sourcePath: 'file',
          sourceCode: 'content'
        });
      });
  });

  pit('should add file info to parse errors', function() {
    var message = 'message';
    var snippet = 'snippet';

    require('fs').readFile.mockImpl(function(file, callback) {
      callback(null, 'var x;\nvar answer = 1 = x;');
    });

    workers.mockImpl(function(data, callback) {
      var babelError = new SyntaxError(message);
      babelError.type = 'SyntaxError';
      babelError.description = message;
      babelError.loc = {
        line: 2,
        column: 15,
      };
      babelError.codeFrame = snippet;
      callback(babelError);
    });

    return new Transformer(OPTIONS).loadFileAndTransform('foo-file.js')
      .catch(function(error) {
        expect(error.type).toEqual('TransformError');
        expect(error.message).toBe('SyntaxError ' + message);
        expect(error.lineNumber).toBe(2);
        expect(error.column).toBe(15);
        expect(error.filename).toBe('foo-file.js');
        expect(error.description).toBe(message);
        expect(error.snippet).toBe(snippet);
      });
  });
});


text:
namespace {

static bool SetMotionBuffer(content::DeviceMotionHardwareBuffer* buffer,
    bool enabled) {
  if (!buffer)
    return false;
  buffer->seqlock.WriteBegin();
  buffer->data.allAvailableSensorsAreActive = enabled;
  buffer->seqlock.WriteEnd();
  return true;
}

static bool SetOrientationBuffer(
    content::DeviceOrientationHardwareBuffer* buffer, bool enabled) {
  if (!buffer)
    return false;
  buffer->seqlock.WriteBegin();
  buffer->data.allAvailableSensorsAreActive = enabled;
  buffer->seqlock.WriteEnd();
  return true;
}

}  // namespace

namespace content {

DataFetcherSharedMemory::DataFetcherSharedMemory()
    : motion_buffer_(NULL), orientation_buffer_(NULL) {
}

DataFetcherSharedMemory::~DataFetcherSharedMemory() {
}

bool DataFetcherSharedMemory::Start(ConsumerType consumer_type, void* buffer) {
  DCHECK(buffer);

  switch (consumer_type) {
    case CONSUMER_TYPE_MOTION:
      motion_buffer_ = static_cast<DeviceMotionHardwareBuffer*>(buffer);
      UMA_HISTOGRAM_BOOLEAN("InertialSensor.MotionDefaultAvailable", false);
      return SetMotionBuffer(motion_buffer_, true);
    case CONSUMER_TYPE_ORIENTATION:
      orientation_buffer_ =
          static_cast<DeviceOrientationHardwareBuffer*>(buffer);
      UMA_HISTOGRAM_BOOLEAN("InertialSensor.OrientationDefaultAvailable",
          false);
      return SetOrientationBuffer(orientation_buffer_, true);
    default:
      NOTREACHED();
  }
  return false;
}

bool DataFetcherSharedMemory::Stop(ConsumerType consumer_type) {
  switch (consumer_type) {
    case CONSUMER_TYPE_MOTION:
      return SetMotionBuffer(motion_buffer_, false);
    case CONSUMER_TYPE_ORIENTATION:
      return SetOrientationBuffer(orientation_buffer_, false);
    default:
      NOTREACHED();
  }
  return false;
}

}  // namespace content


text:
layout: default
description: Description of the oasisctl list example command
title: Oasisctl List Example
---
# Oasisctl List Example

List example ...

## Synopsis

List example ...

```
oasisctl list example [flags]
```

## Options

```
  -h, --help   help for example
```

## Options inherited from parent commands

```
      --endpoint string   API endpoint of the ArangoDB Oasis (default "api.cloud.arangodb.com")
      --format string     Output format (table|json) (default "table")
      --token string      Token used to authenticate at ArangoDB Oasis
```

## See also

* [oasisctl list](oasisctl-list.html)	 - List resources
* [oasisctl list example installations](oasisctl-list-example-installations.html)	 - List all example dataset installations for a deployment


text:
"""
DOC
"""
from __future__ import unicode_literals, print_function, division
import os
import site

__author__ = "Serge Kilimoff-Goriatchkine"
__email__ = "serge.kilimoff@gmail.com"
__license__ = 'MIT license'

# append current directory to paths system
current_directory = os.path.split(__file__)[0]
site.addsitedir(current_directory)


text:
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

//-----------------------------------------------------------------------------
// testcase by Gianugo Rabellino <gianugo@apache.org>
var BUGNUMBER = 276103;
var summary = 'link foo and null bytes';
var actual = '';
var expect = '';

printBugNumber(BUGNUMBER);
printStatus (summary);

var testString = "test|string";
var idx = testString.indexOf("|");
var link = testString.substring(0, idx);
var desc = testString.substring(idx + 1);

expect = 'string';
actual = desc.link(link);

reportCompare(expect, actual, summary);


text:
	x

		x

	x	x

xx	xx	x

xxxxxxxxx	xx	x


text:
  	<uib-accordion-group ng-controller="accordionController"
     ng-click="selectedCourse=course.ident" is-open="status.open">
        <uib-accordion-heading>
            {{course.major.ident}} {{course.ident}} - {{course.name}}

        </uib-accordion-heading>

      		<course-candidate-section-item></course-candidate-section-item>

  	</uib-accordion-group>


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>CUDNN Frontend API: Class Members - Typedefs</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="navtree.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

CUDNN Frontend API
    8.3.0

- a -

adapter_type
: nlohmann::detail::container_input_adapter_factory_impl::container_input_adapter_factory< ContainerType, void_t< decltype(begin(std::declval< ContainerType >()), end(std::declval< ContainerType >()))> >
, nlohmann::detail::iterator_input_adapter_factory< IteratorType, Enable >
, nlohmann::detail::iterator_input_adapter_factory< IteratorType, enable_if_t< is_iterator_of_multibyte< IteratorType >::value > >

allocator_type
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >

array_t
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >
, nlohmann::detail::iter_impl< BasicJsonType >

- b -

base_adapter_type
: nlohmann::detail::iterator_input_adapter_factory< IteratorType, enable_if_t< is_iterator_of_multibyte< IteratorType >::value > >

base_iterator
: nlohmann::detail::json_reverse_iterator< Base >

basic_json_t
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >

binary_char_t
: nlohmann::detail::serializer< BasicJsonType >

binary_reader
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >

binary_t
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >
, nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >
, nlohmann::detail::binary_writer< BasicJsonType, CharType >
, nlohmann::detail::is_sax< SAX, BasicJsonType >
, nlohmann::detail::is_sax_static_asserts< SAX, BasicJsonType >
, nlohmann::detail::json_sax_acceptor< BasicJsonType >
, nlohmann::detail::json_sax_dom_callback_parser< BasicJsonType >
, nlohmann::detail::json_sax_dom_parser< BasicJsonType >
, nlohmann::json_sax< BasicJsonType >

binary_writer
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >

boolean_t
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >

- c -

cbor_tag_handler_t
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >

char_int_type
: nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >
, nlohmann::detail::lexer< BasicJsonType, InputAdapterType >

char_type
: nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >
, nlohmann::detail::file_input_adapter
, nlohmann::detail::input_stream_adapter
, nlohmann::detail::iterator_input_adapter< IteratorType >
, nlohmann::detail::iterator_input_adapter_factory< IteratorType, Enable >
, nlohmann::detail::iterator_input_adapter_factory< IteratorType, enable_if_t< is_iterator_of_multibyte< IteratorType >::value > >
, nlohmann::detail::lexer< BasicJsonType, InputAdapterType >
, nlohmann::detail::wide_string_input_adapter< BaseInputAdapter, WideCharType >

CompatibleLimits
: nlohmann::detail::is_compatible_integer_type_impl< RealIntegerType, CompatibleNumberIntegerType, enable_if_t< std::is_integral< RealIntegerType >::value &&std::is_integral< CompatibleNumberIntegerType >::value &&!std::is_same< bool, CompatibleNumberIntegerType >::value > >

const_iterator
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >

const_pointer
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >

const_reference
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >

const_reverse_iterator
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >

Container
: nlohmann::ordered_map< Key, T, IgnoredLess, Allocator >

container_type
: nlohmann::byte_container_with_subtype< BinaryType >

- d -

difference_type
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >
, nlohmann::detail::iter_impl< BasicJsonType >
, nlohmann::detail::iteration_proxy_value< IteratorType >
, nlohmann::detail::iterator_traits< T *, enable_if_t< std::is_object< T >::value > >
, nlohmann::detail::iterator_types< It, void_t< typename It::difference_type, typename It::value_type, typename It::pointer, typename It::reference, typename It::iterator_category > >
, nlohmann::detail::json_reverse_iterator< Base >
, nlohmann::detail::primitive_iterator_t

- e -

error_handler_t
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >

exception
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >

exception_t
: nlohmann::detail::is_sax< SAX, BasicJsonType >
, nlohmann::detail::is_sax_static_asserts< SAX, BasicJsonType >

- f -

FeatureVectorToPlanMap
: cudnn_frontend::ExecutionPlanCache_v1

- i -

initializer_list_t
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >

input_format_t
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >

internal_iterator
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >

invalid_iterator
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >

iter_impl
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >

iteration_proxy
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >

iterator
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >

iterator_category
: nlohmann::detail::iter_impl< BasicJsonType >
, nlohmann::detail::iteration_proxy_value< IteratorType >
, nlohmann::detail::iterator_traits< T *, enable_if_t< std::is_object< T >::value > >
, nlohmann::detail::iterator_types< It, void_t< typename It::difference_type, typename It::value_type, typename It::pointer, typename It::reference, typename It::iterator_category > >

iterator_type
: nlohmann::detail::iterator_input_adapter_factory< IteratorType, Enable >
, nlohmann::detail::iterator_input_adapter_factory< IteratorType, enable_if_t< is_iterator_of_multibyte< IteratorType >::value > >

- j -

json_pointer
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >

json_reverse_iterator
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >

json_sax_t
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >
, nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >

json_serializer
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >

- k -

key_type
: nlohmann::ordered_map< Key, T, IgnoredLess, Allocator >

- l -

lexer_t
: nlohmann::detail::parser< BasicJsonType, InputAdapterType >

- m -

mapped_type
: nlohmann::ordered_map< Key, T, IgnoredLess, Allocator >

Message_t
: cudnn_frontend::OperationBuilder_v8

- n -

number_float_t
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >
, nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >
, nlohmann::detail::binary_writer< BasicJsonType, CharType >
, nlohmann::detail::is_sax< SAX, BasicJsonType >
, nlohmann::detail::is_sax_static_asserts< SAX, BasicJsonType >
, nlohmann::detail::json_sax_acceptor< BasicJsonType >
, nlohmann::detail::json_sax_dom_callback_parser< BasicJsonType >
, nlohmann::detail::json_sax_dom_parser< BasicJsonType >
, nlohmann::detail::lexer< BasicJsonType, InputAdapterType >
, nlohmann::detail::parser< BasicJsonType, InputAdapterType >
, nlohmann::detail::serializer< BasicJsonType >
, nlohmann::json_sax< BasicJsonType >

number_integer_t
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >
, nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >
, nlohmann::detail::is_sax< SAX, BasicJsonType >
, nlohmann::detail::is_sax_static_asserts< SAX, BasicJsonType >
, nlohmann::detail::json_sax_acceptor< BasicJsonType >
, nlohmann::detail::json_sax_dom_callback_parser< BasicJsonType >
, nlohmann::detail::json_sax_dom_parser< BasicJsonType >
, nlohmann::detail::lexer< BasicJsonType, InputAdapterType >
, nlohmann::detail::parser< BasicJsonType, InputAdapterType >
, nlohmann::detail::serializer< BasicJsonType >
, nlohmann::json_sax< BasicJsonType >

number_unsigned_t
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >
, nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >
, nlohmann::detail::is_sax< SAX, BasicJsonType >
, nlohmann::detail::is_sax_static_asserts< SAX, BasicJsonType >
, nlohmann::detail::json_sax_acceptor< BasicJsonType >
, nlohmann::detail::json_sax_dom_callback_parser< BasicJsonType >
, nlohmann::detail::json_sax_dom_parser< BasicJsonType >
, nlohmann::detail::lexer< BasicJsonType, InputAdapterType >
, nlohmann::detail::parser< BasicJsonType, InputAdapterType >
, nlohmann::detail::serializer< BasicJsonType >
, nlohmann::json_sax< BasicJsonType >

- o -

object_comparator_t
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >

object_t
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >
, nlohmann::detail::is_compatible_object_type_impl< BasicJsonType, CompatibleObjectType, enable_if_t< is_detected< mapped_type_t, CompatibleObjectType >::value &&is_detected< key_type_t, CompatibleObjectType >::value > >
, nlohmann::detail::is_constructible_object_type_impl< BasicJsonType, ConstructibleObjectType, enable_if_t< is_detected< mapped_type_t, ConstructibleObjectType >::value &&is_detected< key_type_t, ConstructibleObjectType >::value > >
, nlohmann::detail::iter_impl< BasicJsonType >

other_error
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >

other_iter_impl
: nlohmann::detail::iter_impl< BasicJsonType >

out_of_range
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >

output_adapter_t
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >

- p -

parse_error
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >

parse_event_t
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >
, nlohmann::detail::json_sax_dom_callback_parser< BasicJsonType >

parser_callback_t
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >
, nlohmann::detail::json_sax_dom_callback_parser< BasicJsonType >

pointer
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >
, nlohmann::detail::iter_impl< BasicJsonType >
, nlohmann::detail::iteration_proxy_value< IteratorType >
, nlohmann::detail::iterator_traits< T *, enable_if_t< std::is_object< T >::value > >
, nlohmann::detail::iterator_types< It, void_t< typename It::difference_type, typename It::value_type, typename It::pointer, typename It::reference, typename It::iterator_category > >

primitive_iterator_t
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >

- r -

RealLimits
: nlohmann::detail::is_compatible_integer_type_impl< RealIntegerType, CompatibleNumberIntegerType, enable_if_t< std::is_integral< RealIntegerType >::value &&std::is_integral< CompatibleNumberIntegerType >::value &&!std::is_same< bool, CompatibleNumberIntegerType >::value > >

reference
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >
, nlohmann::detail::iter_impl< BasicJsonType >
, nlohmann::detail::iteration_proxy_value< IteratorType >
, nlohmann::detail::iterator_traits< T *, enable_if_t< std::is_object< T >::value > >
, nlohmann::detail::iterator_types< It, void_t< typename It::difference_type, typename It::value_type, typename It::pointer, typename It::reference, typename It::iterator_category > >
, nlohmann::detail::json_reverse_iterator< Base >

require_input_iter
: nlohmann::ordered_map< Key, T, IgnoredLess, Allocator >

reverse_iterator
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >

- s -

SaturationTracker
: cudnn_frontend::ExecutionPlanCache_v2

serializer
: nlohmann::detail::has_from_json< BasicJsonType, T, enable_if_t< !is_basic_json< T >::value > >
, nlohmann::detail::has_non_default_from_json< BasicJsonType, T, enable_if_t< !is_basic_json< T >::value > >
, nlohmann::detail::has_to_json< BasicJsonType, T, enable_if_t< !is_basic_json< T >::value > >

size_type
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >

string_t
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >
, nlohmann::detail::binary_reader< BasicJsonType, InputAdapterType, SAX >
, nlohmann::detail::binary_writer< BasicJsonType, CharType >
, nlohmann::detail::is_sax< SAX, BasicJsonType >
, nlohmann::detail::is_sax_static_asserts< SAX, BasicJsonType >
, nlohmann::detail::json_sax_acceptor< BasicJsonType >
, nlohmann::detail::json_sax_dom_callback_parser< BasicJsonType >
, nlohmann::detail::json_sax_dom_parser< BasicJsonType >
, nlohmann::detail::lexer< BasicJsonType, InputAdapterType >
, nlohmann::detail::parser< BasicJsonType, InputAdapterType >
, nlohmann::detail::serializer< BasicJsonType >
, nlohmann::json_sax< BasicJsonType >

string_type
: nlohmann::detail::iteration_proxy_value< IteratorType >

- t -

token_type
: nlohmann::detail::lexer< BasicJsonType, InputAdapterType >
, nlohmann::detail::parser< BasicJsonType, InputAdapterType >

traits
: nlohmann::detail::is_iterator_traits< iterator_traits< T > >

type
: nlohmann::detail::detector< Default, AlwaysVoid, Op, Args >
, nlohmann::detail::detector< Default, void_t< Op< Args... > >, Op, Args... >
, nlohmann::detail::make_void< Ts >
, nlohmann::detail::utility_internal::Extend< integer_sequence< T, Ints... >, SeqSize, 0 >
, nlohmann::detail::utility_internal::Extend< integer_sequence< T, Ints... >, SeqSize, 1 >
, nlohmann::detail::utility_internal::Gen< T, N >
, nlohmann::detail::utility_internal::Gen< T, 0 >
, std::tuple_element< N, ::nlohmann::detail::iteration_proxy_value< IteratorType > >

type_error
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >

- v -

value_t
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >
, nlohmann::detail::detector< Default, AlwaysVoid, Op, Args >
, nlohmann::detail::detector< Default, void_t< Op< Args... > >, Op, Args... >

value_type
: nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >
, nlohmann::detail::integer_sequence< T, Ints >
, nlohmann::detail::is_iterator_of_multibyte< T >
, nlohmann::detail::iter_impl< BasicJsonType >
, nlohmann::detail::iteration_proxy_value< IteratorType >
, nlohmann::detail::iterator_traits< T *, enable_if_t< std::is_object< T >::value > >
, nlohmann::detail::iterator_types< It, void_t< typename It::difference_type, typename It::value_type, typename It::pointer, typename It::reference, typename It::iterator_category > >
, nlohmann::detail::json_ref< BasicJsonType >

Generated by

     1.8.13


text:
#ifndef EVENT_H
#define EVENT_H

#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>

#define queue_struct(T) \
struct \
{ \
	T * data; \
	size_t size; \
	size_t back, front; \
}

#define queue_init(queue) \
	queue->data = 0; \
	queue->size = 0; \
	queue->front = 0; \
	queue->back = 0

#define queue_deinit(queue) \
	free((queue)->data); \
	(queue)->data = 0; \
	(queue)->size = 0; \
	(queue)->front = 0; \
	(queue)->back = 0

#define queue_empty(queue) (queue->back == queue->front)
#define queue_back(queue) (queue->data[queue->back])
#define queue_front(queue) (queue->data[queue->front])

//extern void queue_resize(void * data,

#define queue_pop(queue) \
	if((queue)->back != (queue)->front) \
	{ \
		free((queue)->data[(queue)->front].data); \
		(queue)->data[(queue)->front].data = 0; \
 \
		(queue)->front = ((queue)->front + 1) % (queue)->size; \
	}

#define queue_

#define queue_push(queue, val) \
	if((queue)->back != (queue)->front) \
	{ \
		free((queue)->data[(queue)->front].data); \
		(queue)->data[(queue)->front].data = 0; \
 \
		(queue)->front = ((queue)->front + 1) % (queue)->size; \
	}

	   /*
	if(!buf->size || ((buf->back + 1) % buf->size) == buf->front)
	{
		size_t new_size = buf->size ? buf->size * 2 : 32;
		event_t * new_events = malloc(sizeof(event_t)*new_size);

		for(size_t i = 0;i < buf->size;i ++)
		{
			//printf("Copying %u to %u\n", i, (i + buf->back) % buf->size);
			new_events[i] = buf->events[(i + buf->back) % buf->size];
		}
	}

	event_t newevent = *event;
	newevent.data = malloc(event->size);

	buf->events[buf->back] = newevent;

	buf->back = (buf->back + 1) % buf->size;

extern void queue_init(eventbuf_t * buf);
extern void queue_deinit(eventbuf_t * buf);

extern void queue_push(eventbuf_t * buf, const event_t * event);
extern bool queue_front(const eventbuf_t * buf, event_t * event);
extern bool queue_back(const eventbuf_t * buf, event_t * event);
extern void queue_pop(eventbuf_t * buf);
	*/

#endif


text:
import re
import urllib2
import urlparse

from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_unicode

# These values, if given to validate(), will trigger the self.required check.
EMPTY_VALUES = (None, '', [], (), {})

try:
    from django.conf import settings
    URL_VALIDATOR_USER_AGENT = settings.URL_VALIDATOR_USER_AGENT
except ImportError:
    # It's OK if Django settings aren't configured.
    URL_VALIDATOR_USER_AGENT = 'Django (http://www.djangoproject.com/)'

class RegexValidator(object):
    regex = ''
    message = _(u'Enter a valid value.')
    code = 'invalid'

    def __init__(self, regex=None, message=None, code=None):
        if regex is not None:
            self.regex = regex
        if message is not None:
            self.message = message
        if code is not None:
            self.code = code

        if isinstance(self.regex, basestring):
            self.regex = re.compile(regex)

    def __call__(self, value):
        """
        Validates that the input matches the regular expression.
        """
        if not self.regex.search(smart_unicode(value)):
            raise ValidationError(self.message, code=self.code)

class HeadRequest(urllib2.Request):
    def get_method(self):
        return "HEAD"

class URLValidator(RegexValidator):
    regex = re.compile(
        r'^(?:http|ftp)s?://' # http:// or https://
        r'(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?)|' #domain...
        r'localhost|' #localhost...
        r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})' # ...or ip
        r'(?::\d+)?' # optional port
        r'(?:/?|[/?]\S+)$', re.IGNORECASE)

    def __init__(self, verify_exists=False, validator_user_agent=URL_VALIDATOR_USER_AGENT):
        super(URLValidator, self).__init__()
        self.verify_exists = verify_exists
        self.user_agent = validator_user_agent

    def __call__(self, value):
        try:
            super(URLValidator, self).__call__(value)
        except ValidationError, e:
            # Trivial case failed. Try for possible IDN domain
            if value:
                value = smart_unicode(value)
                scheme, netloc, path, query, fragment = urlparse.urlsplit(value)
                try:
                    netloc = netloc.encode('idna') # IDN -> ACE
                except UnicodeError: # invalid domain part
                    raise e
                url = urlparse.urlunsplit((scheme, netloc, path, query, fragment))
                super(URLValidator, self).__call__(url)
            else:
                raise
        else:
            url = value

        if self.verify_exists:
            headers = {
                "Accept": "text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5",
                "Accept-Language": "en-us,en;q=0.5",
                "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7",
                "Connection": "close",
                "User-Agent": self.user_agent,
            }
            url = url.encode('utf-8')
            broken_error = ValidationError(
                _(u'This URL appears to be a broken link.'), code='invalid_link')
            try:
                req = HeadRequest(url, None, headers)
                u = urllib2.urlopen(req)
            except ValueError:
                raise ValidationError(_(u'Enter a valid URL.'), code='invalid')
            except urllib2.HTTPError, e:
                if e.code in (405, 501):
                    # Try a GET request (HEAD refused)
                    # See also: http://www.w3.org/Protocols/rfc2616/rfc2616.html
                    try:
                        req = urllib2.Request(url, None, headers)
                        u = urllib2.urlopen(req)
                    except:
                        raise broken_error
                else:
                    raise broken_error
            except: # urllib2.URLError, httplib.InvalidURL, etc.
                raise broken_error

def validate_integer(value):
    try:
        int(value)
    except (ValueError, TypeError), e:
        raise ValidationError('')

class EmailValidator(RegexValidator):

    def __call__(self, value):
        try:
            super(EmailValidator, self).__call__(value)
        except ValidationError, e:
            # Trivial case failed. Try for possible IDN domain-part
            if value and u'@' in value:
                parts = value.split(u'@')
                domain_part = parts[-1]
                try:
                    parts[-1] = parts[-1].encode('idna')
                except UnicodeError:
                    raise e
                super(EmailValidator, self).__call__(u'@'.join(parts))
            else:
                raise

email_re = re.compile(
    r"(^[-!#$%&'*+/=?^_`{}|~0-9A-Z]+(\.[-!#$%&'*+/=?^_`{}|~0-9A-Z]+)*"  # dot-atom
    r'|^"([\001-\010\013\014\016-\037!#-\[\]-\177]|\\[\001-011\013\014\016-\177])*"' # quoted-string
    r')@(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+[A-Z]{2,6}\.?$', re.IGNORECASE)  # domain
validate_email = EmailValidator(email_re, _(u'Enter a valid e-mail address.'), 'invalid')

slug_re = re.compile(r'^[-\w]+$')
validate_slug = RegexValidator(slug_re, _(u"Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens."), 'invalid')

ipv4_re = re.compile(r'^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$')
validate_ipv4_address = RegexValidator(ipv4_re, _(u'Enter a valid IPv4 address.'), 'invalid')

comma_separated_int_list_re = re.compile('^[\d,]+$')
validate_comma_separated_integer_list = RegexValidator(comma_separated_int_list_re, _(u'Enter only digits separated by commas.'), 'invalid')

class BaseValidator(object):
    compare = lambda self, a, b: a is not b
    clean   = lambda self, x: x
    message = _(u'Ensure this value is %(limit_value)s (it is %(show_value)s).')
    code = 'limit_value'

    def __init__(self, limit_value):
        self.limit_value = limit_value

    def __call__(self, value):
        cleaned = self.clean(value)
        params = {'limit_value': self.limit_value, 'show_value': cleaned}
        if self.compare(cleaned, self.limit_value):
            raise ValidationError(
                self.message % params,
                code=self.code,
                params=params,
            )

class MaxValueValidator(BaseValidator):
    compare = lambda self, a, b: a > b
    message = _(u'Ensure this value is less than or equal to %(limit_value)s.')
    code = 'max_value'

class MinValueValidator(BaseValidator):
    compare = lambda self, a, b: a < b
    message = _(u'Ensure this value is greater than or equal to %(limit_value)s.')
    code = 'min_value'

class MinLengthValidator(BaseValidator):
    compare = lambda self, a, b: a < b
    clean   = lambda self, x: len(x)
    message = _(u'Ensure this value has at least %(limit_value)d characters (it has %(show_value)d).')
    code = 'min_length'

class MaxLengthValidator(BaseValidator):
    #compare = lambda self, a, b: a > b
    compare = lambda self, a, b: False if b is None else a > b
    clean   = lambda self, x: len(x)
    message = _(u'Ensure this value has at most %(limit_value)d characters (it has %(show_value)d).')
    code = 'max_length'


text:
#include "config.h"
#include "SVGRenderStyleDefs.h"

#include "RenderStyle.h"
#include "SVGRenderStyle.h"

namespace WebCore {

StyleFillData::StyleFillData()
    : opacity(SVGRenderStyle::initialFillOpacity())
    , paintType(SVGRenderStyle::initialFillPaintType())
    , paintColor(SVGRenderStyle::initialFillPaintColor())
    , paintUri(SVGRenderStyle::initialFillPaintUri())
    , visitedLinkPaintType(SVGRenderStyle::initialStrokePaintType())
    , visitedLinkPaintColor(SVGRenderStyle::initialFillPaintColor())
    , visitedLinkPaintUri(SVGRenderStyle::initialFillPaintUri())
{
}

inline StyleFillData::StyleFillData(const StyleFillData& other)
    : RefCounted<StyleFillData>()
    , opacity(other.opacity)
    , paintType(other.paintType)
    , paintColor(other.paintColor)
    , paintUri(other.paintUri)
    , visitedLinkPaintType(other.visitedLinkPaintType)
    , visitedLinkPaintColor(other.visitedLinkPaintColor)
    , visitedLinkPaintUri(other.visitedLinkPaintUri)
{
}

PassRef<StyleFillData> StyleFillData::copy() const
{
    return adoptRef(*new StyleFillData(*this));
}

bool StyleFillData::operator==(const StyleFillData& other) const
{
    return opacity == other.opacity
        && paintType == other.paintType
        && paintColor == other.paintColor
        && paintUri == other.paintUri
        && visitedLinkPaintType == other.visitedLinkPaintType
        && visitedLinkPaintColor == other.visitedLinkPaintColor
        && visitedLinkPaintUri == other.visitedLinkPaintUri;
}

StyleStrokeData::StyleStrokeData()
    : opacity(SVGRenderStyle::initialStrokeOpacity())
    , miterLimit(SVGRenderStyle::initialStrokeMiterLimit())
    , width(SVGRenderStyle::initialStrokeWidth())
    , dashOffset(SVGRenderStyle::initialStrokeDashOffset())
    , dashArray(SVGRenderStyle::initialStrokeDashArray())
    , paintType(SVGRenderStyle::initialStrokePaintType())
    , paintColor(SVGRenderStyle::initialStrokePaintColor())
    , paintUri(SVGRenderStyle::initialStrokePaintUri())
    , visitedLinkPaintType(SVGRenderStyle::initialStrokePaintType())
    , visitedLinkPaintColor(SVGRenderStyle::initialStrokePaintColor())
    , visitedLinkPaintUri(SVGRenderStyle::initialStrokePaintUri())
{
}

inline StyleStrokeData::StyleStrokeData(const StyleStrokeData& other)
    : RefCounted<StyleStrokeData>()
    , opacity(other.opacity)
    , miterLimit(other.miterLimit)
    , width(other.width)
    , dashOffset(other.dashOffset)
    , dashArray(other.dashArray)
    , paintType(other.paintType)
    , paintColor(other.paintColor)
    , paintUri(other.paintUri)
    , visitedLinkPaintType(other.visitedLinkPaintType)
    , visitedLinkPaintColor(other.visitedLinkPaintColor)
    , visitedLinkPaintUri(other.visitedLinkPaintUri)
{
}

PassRef<StyleStrokeData> StyleStrokeData::copy() const
{
    return adoptRef(*new StyleStrokeData(*this));
}

bool StyleStrokeData::operator==(const StyleStrokeData& other) const
{
    return width == other.width
        && opacity == other.opacity
        && miterLimit == other.miterLimit
        && dashOffset == other.dashOffset
        && dashArray == other.dashArray
        && paintType == other.paintType
        && paintColor == other.paintColor
        && paintUri == other.paintUri
        && visitedLinkPaintType == other.visitedLinkPaintType
        && visitedLinkPaintColor == other.visitedLinkPaintColor
        && visitedLinkPaintUri == other.visitedLinkPaintUri;
}

StyleStopData::StyleStopData()
    : opacity(SVGRenderStyle::initialStopOpacity())
    , color(SVGRenderStyle::initialStopColor())
{
}

inline StyleStopData::StyleStopData(const StyleStopData& other)
    : RefCounted<StyleStopData>()
    , opacity(other.opacity)
    , color(other.color)
{
}

PassRef<StyleStopData> StyleStopData::copy() const
{
    return adoptRef(*new StyleStopData(*this));
}

bool StyleStopData::operator==(const StyleStopData& other) const
{
    return color == other.color
        && opacity == other.opacity;
}

StyleTextData::StyleTextData()
    : kerning(SVGRenderStyle::initialKerning())
{
}

inline StyleTextData::StyleTextData(const StyleTextData& other)
    : RefCounted<StyleTextData>()
    , kerning(other.kerning)
{
}

PassRef<StyleTextData> StyleTextData::copy() const
{
    return adoptRef(*new StyleTextData(*this));
}

bool StyleTextData::operator==(const StyleTextData& other) const
{
    return kerning == other.kerning;
}

StyleMiscData::StyleMiscData()
    : floodColor(SVGRenderStyle::initialFloodColor())
    , floodOpacity(SVGRenderStyle::initialFloodOpacity())
    , lightingColor(SVGRenderStyle::initialLightingColor())
    , baselineShiftValue(SVGRenderStyle::initialBaselineShiftValue())
{
}

inline StyleMiscData::StyleMiscData(const StyleMiscData& other)
    : RefCounted<StyleMiscData>()
    , floodColor(other.floodColor)
    , floodOpacity(other.floodOpacity)
    , lightingColor(other.lightingColor)
    , baselineShiftValue(other.baselineShiftValue)
{
}

PassRef<StyleMiscData> StyleMiscData::copy() const
{
    return adoptRef(*new StyleMiscData(*this));
}

bool StyleMiscData::operator==(const StyleMiscData& other) const
{
    return floodOpacity == other.floodOpacity
        && floodColor == other.floodColor
        && lightingColor == other.lightingColor
        && baselineShiftValue == other.baselineShiftValue;
}

StyleShadowSVGData::StyleShadowSVGData()
{
}

inline StyleShadowSVGData::StyleShadowSVGData(const StyleShadowSVGData& other)
    : RefCounted<StyleShadowSVGData>()
    , shadow(other.shadow ? std::make_unique<ShadowData>(*other.shadow) : nullptr)
{
}

PassRef<StyleShadowSVGData> StyleShadowSVGData::copy() const
{
    return adoptRef(*new StyleShadowSVGData(*this));
}

bool StyleShadowSVGData::operator==(const StyleShadowSVGData& other) const
{
    if ((!shadow && other.shadow) || (shadow && !other.shadow))
        return false;
    if (shadow && other.shadow && (*shadow != *other.shadow))
        return false;
    return true;
}

StyleResourceData::StyleResourceData()
    : clipper(SVGRenderStyle::initialClipperResource())
    , filter(SVGRenderStyle::initialFilterResource())
    , masker(SVGRenderStyle::initialMaskerResource())
{
}

inline StyleResourceData::StyleResourceData(const StyleResourceData& other)
    : RefCounted<StyleResourceData>()
    , clipper(other.clipper)
    , filter(other.filter)
    , masker(other.masker)
{
}

PassRef<StyleResourceData> StyleResourceData::copy() const
{
    return adoptRef(*new StyleResourceData(*this));
}

bool StyleResourceData::operator==(const StyleResourceData& other) const
{
    return clipper == other.clipper
        && filter == other.filter
        && masker == other.masker;
}

StyleInheritedResourceData::StyleInheritedResourceData()
    : markerStart(SVGRenderStyle::initialMarkerStartResource())
    , markerMid(SVGRenderStyle::initialMarkerMidResource())
    , markerEnd(SVGRenderStyle::initialMarkerEndResource())
{
}

inline StyleInheritedResourceData::StyleInheritedResourceData(const StyleInheritedResourceData& other)
    : RefCounted<StyleInheritedResourceData>()
    , markerStart(other.markerStart)
    , markerMid(other.markerMid)
    , markerEnd(other.markerEnd)
{
}

PassRef<StyleInheritedResourceData> StyleInheritedResourceData::copy() const
{
    return adoptRef(*new StyleInheritedResourceData(*this));
}

bool StyleInheritedResourceData::operator==(const StyleInheritedResourceData& other) const
{
    return markerStart == other.markerStart
        && markerMid == other.markerMid
        && markerEnd == other.markerEnd;
}

}


text:
using System.IO;
using System.Text;
using Newtonsoft.Json.Linq;
using Nostrum;

namespace TCC.Update
{
    public static class OpcodeDownloader
    {
        public static bool DownloadOpcodesIfNotExist(uint version, string directory)
        {
            return DownloadOpcode(version, directory);
        }
        public static bool DownloadSysmsgIfNotExist(uint version, string directory, int revision = 0)
        {
            return DownloadSysmsg(version, directory, revision);
        }
        private static bool IsFileValid(string filename)
        {
            return File.Exists(filename);
            //if (!File.Exists(filename)) return false;
            //if (!App.Settings.CheckOpcodesHash) return true;
            //var localHash = HashUtils.GenerateFileHash(filename);
            //if (localHash == "")
            //{
            //    WindowManager.ViewModels.NotificationArea.Enqueue("TCC", "Failed to check opcode file hash.\n Skipping download...", Data.NotificationType.Warning);
            //    return true;
            //}
            //using (var c = MiscUtils.GetDefaultWebClient())
            //{
            //    try
            //    {
            //        var st = c.OpenRead("https://raw.githubusercontent.com/caali-hackerman/tera-data/master/mappings.json");
            //        if (st != null)
            //        {
            //            var sr = new StreamReader(st);
            //            var sMappings = sr.ReadToEnd();
            //            var jMappings = JObject.Parse(sMappings);
            //            var reg = Game.Server.Region;
            //            var jReg = jMappings[reg];
            //            var remoteHash = jReg["protocol_hash"].Value<string>();
            //            if (localHash == remoteHash) return true;
            //        }
            //    }
            //    catch
            //    {
            //        return false;
            //    }
            //}

            //return false;
        }
        private static bool DownloadOpcode(uint version, string directory)
        {
            Directory.CreateDirectory(directory);
            var ret = false;
            var filename = Path.Combine(directory, $"protocol.{version}.map");
            if (IsFileValid(filename)) return true;

            try
            {
                DownloadJson("https://raw.githubusercontent.com/tera-toolbox/tera-toolbox/master/data/data.json", filename, version);
                ret = IsFileValid(filename);
            }
            catch { /* ignored*/ }
            if (ret) return true;

            try
            {
                Download($"https://raw.githubusercontent.com/tera-toolbox/tera-data/master/map_base/protocol.{version}.map", filename);
                ret = IsFileValid(filename);
            }
            catch { /* ignored*/ }
            if (ret) return true;

            try
            {
                Download($"https://raw.githubusercontent.com/neowutran/TeraDpsMeterData/master/opcodes/protocol.{version}.map", filename);
                ret = IsFileValid(filename);
            }
            catch { /* ignored*/ }

            return ret;
        }

        public static bool DownloadSysmsg(uint version, string directory, int revision = 0)
        {
            Directory.CreateDirectory(directory);

            var filename = Path.Combine(directory, $"sysmsg.{revision / 100}.map");
            if (File.Exists(filename)) return true;
            else
            {
                try
                {
                    Download($"https://raw.githubusercontent.com/neowutran/TeraDpsMeterData/master/opcodes/sysmsg.{revision / 100}.map", filename);
                    return true;
                }
                catch { /* ignored*/ }
            }
            filename = Path.Combine(directory, $"sysmsg.{version}.map");
            if (File.Exists(filename)) return true;
            else
            {
                try
                {
                    Download($"https://raw.githubusercontent.com/neowutran/TeraDpsMeterData/master/opcodes/sysmsg.{version}.map", filename);
                    return true;
                }
                catch { /* ignored*/ }
            }
            return false;
        }

        private static void Download(string remote, string local)
        {
            using var client = MiscUtils.GetDefaultWebClient();
            client.DownloadFile(remote, local);
        }

        private static void DownloadJson(string remote, string filename, uint version)
        {
            using var client = MiscUtils.GetDefaultWebClient();
            var data = client.DownloadString(remote);
            var json = JObject.Parse(data);
            var jMap = json["maps"];
            var jVersion = jMap?[version.ToString()];
            var sb = new StringBuilder();
            if (jVersion == null) return;
            foreach (var jOpcode in jVersion.Children())
            {
                sb.AppendLine($"{((JProperty)jOpcode).Name} {((JProperty)jOpcode).Value}");
            }

            File.WriteAllText(filename, sb.ToString());
        }
    }
}


text:
from distutils.version import LooseVersion

import aldryn_apphooks_config
from django.db import migrations, models

class Migration(migrations.Migration):
    dependencies = [
        ("djangocms_blog", "0021_auto_20160823_2008"),
    ]

    if LooseVersion(aldryn_apphooks_config.__version__) > LooseVersion("0.3.0"):
        operations = [
            migrations.AlterField(
                model_name="blogconfig",
                name="namespace",
                field=models.CharField(default=None, max_length=100, unique=True, verbose_name="Instance namespace"),
            ),
            migrations.AlterField(
                model_name="blogconfig",
                name="type",
                field=models.CharField(max_length=100, verbose_name="Type"),
            ),
        ]


text:
import * as React from 'react';
import {
  createContext,
  forwardRef,
  Fragment,
  memo,
  useCallback,
  useContext,
  useDebugValue,
  useEffect,
  useState,
} from 'react';

const object = {
  string: 'abc',
  number: 123,
  boolean: true,
  null: null,
  undefined: undefined,
  array: ['a', 'b', 'c'],
  object: {foo: 1, bar: 2, baz: 3},
};

function useNestedInnerHook() {
  return useState(123);
}
function useNestedOuterHook() {
  return useNestedInnerHook();
}

function useCustomObject() {
  useDebugValue(object);
  return useState(123);
}

function useDeepHookA() {
  useDebugValue('useDeepHookA');
  useDeepHookB();
}
function useDeepHookB() {
  useDebugValue('useDeepHookB');
  useDeepHookC();
}
function useDeepHookC() {
  useDebugValue('useDeepHookC');
  useDeepHookD();
}
function useDeepHookD() {
  useDebugValue('useDeepHookD');
  useDeepHookE();
}
function useDeepHookE() {
  useDebugValue('useDeepHookE');
  useDeepHookF();
}
function useDeepHookF() {
  useDebugValue('useDeepHookF');
}

const ContextA = createContext('A');
const ContextB = createContext('B');

function FunctionWithHooks(props: any, ref: React$Ref<any>) {
  const [count, updateCount] = useState(0);
  // eslint-disable-next-line no-unused-vars
  const contextValueA = useContext(ContextA);

  // eslint-disable-next-line no-unused-vars
  const [_, __] = useState(object);

  // Custom hook with a custom debug label
  const debouncedCount = useDebounce(count, 1000);

  useCustomObject();

  const onClick = useCallback(
    function onClick() {
      updateCount(count + 1);
    },
    [count],
  );

  // Tests nested custom hooks
  useNestedOuterHook();

  // eslint-disable-next-line no-unused-vars
  const contextValueB = useContext(ContextB);

  // Verify deep nesting doesn't break
  useDeepHookA();

  return <button onClick={onClick}>Count: {debouncedCount}</button>;
}
const MemoWithHooks = memo(FunctionWithHooks);
const ForwardRefWithHooks = forwardRef(FunctionWithHooks);

function wrapWithHoc(Component) {
  function Hoc() {
    return <Component />;
  }
  // $FlowFixMe
  const displayName = Component.displayName || Component.name;
  // $FlowFixMe[incompatible-type] found when upgrading Flow
  Hoc.displayName = `withHoc(${displayName})`;
  return Hoc;
}
const HocWithHooks = wrapWithHoc(FunctionWithHooks);

export default function CustomHooks(): React.Node {
  return (
    <Fragment>
      <FunctionWithHooks />
      <MemoWithHooks />
      <ForwardRefWithHooks />
      <HocWithHooks />
    </Fragment>
  );
}

// Below copied from https://usehooks.com/
function useDebounce(value, delay) {
  // State and setters for debounced value
  const [debouncedValue, setDebouncedValue] = useState(value);

  // Show the value in DevTools
  useDebugValue(debouncedValue);

  useEffect(
    () => {
      // Update debounced value after delay
      const handler = setTimeout(() => {
        setDebouncedValue(value);
      }, delay);

      // Cancel the timeout if value changes (also on delay change or unmount)
      // This is how we prevent debounced value from updating if value is changed ...
      // .. within the delay period. Timeout gets cleared and restarted.
      return () => {
        clearTimeout(handler);
      };
    },
    [value, delay], // Only re-call effect if value or delay changes
  );

  return debouncedValue;
}
// Above copied from https://usehooks.com/


text:
#ifndef RGB_DEPTH_SYNC_UTIL_H_
#define RGB_DEPTH_SYNC_UTIL_H_

#include "tango_client_api.h"  // NOLINT
#include "tango-gl/util.h"

namespace rgb_depth_sync {
// Utility functioins for Synchronization application.
namespace util {
// Returns a transformation matrix from a given TangoPoseData structure.
// - pose_data: The original pose is used for the conversion.
glm::mat4 GetMatrixFromPose(const TangoPoseData* pose_data);
}  // namespace util
}  // namespace rgb_depth_sync

#endif  // RGB_DEPTH_SYNC_UTIL_H_


text:
<?php

namespace JHWEB\ContravencionalBundle\Controller;

use JHWEB\ContravencionalBundle\Entity\CvAuCfgTipo;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;use Symfony\Component\HttpFoundation\Request;

/**
 * Cvaucfgtipo controller.
 *
 * @Route("cvaucfgtipo")
 */
class CvAuCfgTipoController extends Controller
{
    /**
     * Lists all cvAuCfgTipo entities.
     *
     * @Route("/", name="cvaucfgtipo_index")
     * @Method("GET")
     */
    public function indexAction()
    {
        $helpers = $this->get("app.helpers");

        $em = $this->getDoctrine()->getManager();

        $tipos = $em->getRepository('JHWEBContravencionalBundle:CvAuCfgTipo')->findBy(
            array(
                'activo' => true
            )
        );

        $response['data'] = array();

        if ($tipos) {
            $response = array(
                'status' => 'success',
                'code' => 200,
                'message' => count($tipos)." registros encontrados",
                'data'=> $tipos,
            );
        }

        return $helpers->json($response);
    }

    /**
     * Creates a new cvAuCfgTipo entity.
     *
     * @Route("/new", name="cvaucfgtipo_new")
     * @Method({"GET", "POST"})
     */
    public function newAction(Request $request)
    {
        $helpers = $this->get("app.helpers");
        $hash = $request->get("authorization", null);
        $authCheck = $helpers->authCheck($hash);

        if ($authCheck== true) {
            $json = $request->get("data",null);
            $params = json_decode($json);

            $em = $this->getDoctrine()->getManager();

            $tipo = new CvAuCfgTipo();

            if ($params->idFormato) {
                $formato = $em->getRepository('JHWEBConfigBundle:CfgAdmFormato')->find(
                    $params->idFormato
                );
                $tipo->setFormato($formato);
            }

            if ($params->finaliza) {
                $tiposOld = $em->getRepository('JHWEBContravencionalBundle:CvAuCfgTipo')->findByFinaliza(
                    true
                );

                foreach ($tiposOld as $key => $tipoOld) {
                    $tipoOld->setFinaliza(false);
                    $em->flush();
                }
            }
            $tipo->setFinaliza($params->finaliza);
            $tipo->setNombre(mb_strtoupper($params->nombre, 'utf-8'));
            $tipo->setActivo(true);

            $em->persist($tipo);
            $em->flush();

            $response = array(
                'title' => 'Perfecto!',
                'status' => 'success',
                'code' => 200,
                'message' => "Registro creado con exito",
            );
        }else{
            $response = array(
                'title' => 'Error!',
                'status' => 'error',
                'code' => 400,
                'message' => "Autorizacion no valida",
            );
        }

        return $helpers->json($response);
    }

    /**
     * Finds and displays a cvAuCfgTipo entity.
     *
     * @Route("/show", name="cvaucfgtipo_show")
     * @Method({"GET", "POST"})
     */
    public function showAction(Request $request)
    {
        $helpers = $this->get("app.helpers");
        $hash = $request->get("authorization", null);
        $authCheck = $helpers->authCheck($hash);

        if ($authCheck == true) {
            $json = $request->get("data",null);
            $params = json_decode($json);

            $em = $this->getDoctrine()->getManager();

            $tipo = $em->getRepository('JHWEBContravencionalBundle:CvAuCfgTipo')->find(
                $params->id
            );

            if ($tipo) {
                $comparendo = $em->getRepository('JHWEBContravencionalBundle:CvCdoComparendo')->find(
                    $params->idComparendo
                );

                $template = $helpers->generateTemplate(
                    $comparendo,
                    $tipo->getFormato()->getCuerpo()
                );

                if ($template) {
                    $response = array(
                        'title' => 'Perfecto!',
                        'status' => 'success',
                        'code' => 200,
                        'message' => "Plantilla encontrada.",
                        'data'=> array(
                            'tipo' => $tipo,
                            'template' => $template,
                        )
                    );
                }else{
                    $response = array(
                        'title' => 'Atención!',
                        'status' => 'warning',
                        'code' => 400,
                        'message' => 'La plantilla no pudo ser generada.',
                    );
                }
            }else{
                $response = array(
                    'title' => 'Atención!',
                    'status' => 'warning',
                    'code' => 400,
                    'message' => 'El tipo de audiencia no se encuentra en la base de datos.',
                );
            }
        }else{
            $response = array(
                'title' => 'Error!',
                'status' => 'error',
                'code' => 400,
                'message' => 'Autorizacion no valida',
            );
        }

        return $helpers->json($response);
    }

    /**
     * Displays a form to edit an existing cvAuCfgTipo entity.
     *
     * @Route("/edit", name="cvaucfgtipo_edit")
     * @Method({"GET", "POST"})
     */
    public function editAction(Request $request)
    {
        $helpers = $this->get("app.helpers");
        $hash = $request->get("authorization", null);
        $authCheck = $helpers->authCheck($hash);

        if ($authCheck==true) {
            $json = $request->get("data",null);
            $params = json_decode($json);

            $em = $this->getDoctrine()->getManager();

            $tipo = $em->getRepository("JHWEBContravencionalBundle:CvAuCfgTipo")->find(
                $params->id
            );

            if ($tipo) {
                if ($params->formato) {
                    $formato = $em->getRepository('JHWEBConfigBundle:CfgAdmFormato')->find(
                        $params->formato
                    );
                    $tipo->setFormato($formato);
                }

                if ($params->finaliza) {
                    $tiposOld = $em->getRepository('JHWEBContravencionalBundle:CvAuCfgTipo')->findByFinaliza(
                        true
                    );

                    foreach ($tiposOld as $key => $tipoOld) {
                        $tipoOld->setFinaliza(false);
                        $em->flush();
                    }
                }
                $tipo->setFinaliza($params->finaliza);
                $tipo->setNombre(mb_strtoupper($params->nombre, 'utf-8'));

                $em->flush();

                $response = array(
                    'status' => 'success',
                    'code' => 200,
                    'message' => "Registro actualizado con exito",
                    'data'=> $tipo,
                );
            }else{
                $response = array(
                    'status' => 'error',
                    'code' => 400,
                    'message' => "El registro no se encuentra en la base de datos",
                );
            }
        }else{
            $response = array(
                'status' => 'error',
                'code' => 400,
                'message' => "Autorizacion no valida para editar",
            );
        }

        return $helpers->json($response);
    }

    /**
     * Deletes a cvAuCfgTipo entity.
     *
     * @Route("/delete", name="cvaucfgtipo_delete")
     * @Method("POST")
     */
    public function deleteAction(Request $request, CvAuCfgTipo $cvAuCfgTipo)
    {
        $form = $this->createDeleteForm($cvAuCfgTipo);
        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $em->remove($cvAuCfgTipo);
            $em->flush();
        }

        return $this->redirectToRoute('cvaucfgtipo_index');
    }

    /**
     * Creates a form to delete a cvAuCfgTipo entity.
     *
     * @param CvAuCfgTipo $cvAuCfgTipo The cvAuCfgTipo entity
     *
     * @return \Symfony\Component\Form\Form The form
     */
    private function createDeleteForm(CvAuCfgTipo $cvAuCfgTipo)
    {
        return $this->createFormBuilder()
            ->setAction($this->generateUrl('cvaucfgtipo_delete', array('id' => $cvAuCfgTipo->getId())))
            ->setMethod('DELETE')
            ->getForm()
        ;
    }

    /* =================================================== */

    /**
     * Listado de tipos de audiencia para seleccion con busqueda
     *
     * @Route("/select", name="cvaucfgtipo_select")
     * @Method({"GET", "POST"})
     */
    public function selectAction()
    {
        $helpers = $this->get("app.helpers");
        $em = $this->getDoctrine()->getManager();

        $tipos = $em->getRepository('JHWEBContravencionalBundle:CvAuCfgTipo')->findBy(
            array('activo' => true)
        );

        $response = null;

        foreach ($tipos as $key => $tipo) {
            $response[$key] = array(
                'value' => $tipo->getId(),
                'label' => $tipo->getNombre(),
            );
        }

        return $helpers->json($response);
    }
}


text:
/*****************************************************************************************************************************************
Author: Michael Shoots
Email: michael.shoots@live.com
Project: Open Space 4x
License: MIT License
Notes:
******************************************************************************************************************************************/

using UnityEngine;

public sealed class CampaignShipYardScreen : ShipyardBaseScreen
{
    #region Variables
    #endregion

    public CampaignShipYardScreen()
    {
        Initialize();
    }

    public override void Update()
    {
        base.Update();
    }

    public override void Draw()
    {
        base.Draw();
    }

    protected override void CloseScreen()
    {
        if (unitModel != null)
            Object.Destroy(unitModel);
        GameManager.instance.ChangeScreen(new CampaignPlayScreen());
    }
}


text:
#pragma once

#include "common/wrapped_pool.h"
#include "core/core.h"
#include "core/resource_manager.h"
#include "serialise/serialiser.h"
#include "d3d8_common.h"

enum D3D8ResourceType
{
  Resource_Unknown = 0,
  Resource_VertexBuffer,
  Resource_IndexBuffer,
};

struct D3D8ResourceRecord : public ResourceRecord
{
  enum
  {
    NullResource = NULL
  };

  D3D8ResourceRecord(ResourceId id) : ResourceRecord(id, true) {}
};

struct D3D8InitialContents
{
  template <typename Configuration>
  void Free(ResourceManager<Configuration> *rm)
  {
  }
};

struct D3D8ResourceManagerConfiguration
{
  typedef IUnknown *WrappedResourceType;
  typedef IUnknown *RealResourceType;
  typedef D3D8ResourceRecord RecordType;
  typedef D3D8InitialContents InitialContentData;
};

class D3D8ResourceManager : public ResourceManager<D3D8ResourceManagerConfiguration>
{
public:
  D3D8ResourceManager(CaptureState &state, WrappedD3DDevice8 *dev)
      : ResourceManager(state), m_Device(dev)
  {
  }

private:
  bool AutoReferenceResource(ResourceId id, D3D8ResourceRecord *record);
  ResourceId GetID(IUnknown *res);

  bool ResourceTypeRelease(IUnknown *res);

  bool Prepare_InitialState(IUnknown *res);
  uint64_t GetSize_InitialState(ResourceId id, const D3D8InitialContents &data);
  bool Serialise_InitialState(WriteSerialiser &ser, ResourceId id, D3D8ResourceRecord *record,
                              const D3D8InitialContents *data);
  void Create_InitialState(ResourceId id, IUnknown *live, bool hasData);
  void Apply_InitialState(IUnknown *live, const D3D8InitialContents &data);

  WrappedD3DDevice8 *m_Device;
};


text:
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2016-2017 FIRST. All Rights Reserved.                        */
/* Open Source Software - may be modified and shared by FRC teams. The code   */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project.                                                               */
/*----------------------------------------------------------------------------*/

package edu.wpi.first.wpilibj;

import edu.wpi.first.wpilibj.util.BaseSystemNotInitializedException;

public class Timer {
  private static StaticInterface impl;

  @SuppressWarnings("MethodName")
  public static void SetImplementation(StaticInterface ti) {
    impl = ti;
  }

  /**
   * Return the system clock time in seconds. Return the time from the FPGA hardware clock in
   * seconds since the FPGA started.
   *
   * @return Robot running time in seconds.
   */
  @SuppressWarnings("AbbreviationAsWordInName")
  public static double getFPGATimestamp() {
    if (impl != null) {
      return impl.getFPGATimestamp();
    } else {
      throw new BaseSystemNotInitializedException(StaticInterface.class, Timer.class);
    }
  }

  /**
   * Return the approximate match time The FMS does not currently send the official match time to
   * the robots This returns the time since the enable signal sent from the Driver Station At the
   * beginning of autonomous, the time is reset to 0.0 seconds At the beginning of teleop, the time
   * is reset to +15.0 seconds If the robot is disabled, this returns 0.0 seconds Warning: This is
   * not an official time (so it cannot be used to argue with referees).
   *
   * @return Match time in seconds since the beginning of autonomous
   */
  public static double getMatchTime() {
    if (impl != null) {
      return impl.getMatchTime();
    } else {
      throw new BaseSystemNotInitializedException(StaticInterface.class, Timer.class);
    }
  }

  /**
   * Pause the thread for a specified time. Pause the execution of the thread for a specified period
   * of time given in seconds. Motors will continue to run at their last assigned values, and
   * sensors will continue to update. Only the task containing the wait will pause until the wait
   * time is expired.
   *
   * @param seconds Length of time to pause
   */
  public static void delay(final double seconds) {
    if (impl != null) {
      impl.delay(seconds);
    } else {
      throw new BaseSystemNotInitializedException(StaticInterface.class, Timer.class);
    }
  }

  public interface StaticInterface {
    @SuppressWarnings("AbbreviationAsWordInName")
    double getFPGATimestamp();

    double getMatchTime();

    void delay(final double seconds);

    @SuppressWarnings("JavadocMethod")
    Interface newTimer();
  }

  private final Interface m_timer;

  @SuppressWarnings("JavadocMethod")
  public Timer() {
    if (impl != null) {
      m_timer = impl.newTimer();
    } else {
      throw new BaseSystemNotInitializedException(StaticInterface.class, Timer.class);
    }
  }

  /**
   * Get the current time from the timer. If the clock is running it is derived from the current
   * system clock the start time stored in the timer class. If the clock is not running, then return
   * the time when it was last stopped.
   *
   * @return Current time value for this timer in seconds
   */
  public double get() {
    return m_timer.get();
  }

  /**
   * Reset the timer by setting the time to 0. Make the timer startTime the current time so new
   * requests will be relative now
   */
  public void reset() {
    m_timer.reset();
  }

  /**
   * Start the timer running. Just set the running flag to true indicating that all time requests
   * should be relative to the system clock.
   */
  public void start() {
    m_timer.start();
  }

  /**
   * Stop the timer. This computes the time as of now and clears the running flag, causing all
   * subsequent time requests to be read from the accumulated time rather than looking at the system
   * clock.
   */
  public void stop() {
    m_timer.stop();
  }

  /**
   * Check if the period specified has passed and if it has, advance the start time by that period.
   * This is useful to decide if it's time to do periodic work without drifting later by the time it
   * took to get around to checking.
   *
   * @param period The period to check for (in seconds).
   * @return If the period has passed.
   */
  public boolean hasPeriodPassed(double period) {
    return m_timer.hasPeriodPassed(period);
  }

  public interface Interface {
    /**
     * Get the current time from the timer. If the clock is running it is derived from the current
     * system clock the start time stored in the timer class. If the clock is not running, then
     * return the time when it was last stopped.
     *
     * @return Current time value for this timer in seconds
     */
    double get();

    /**
     * Reset the timer by setting the time to 0. Make the timer startTime the current time so new
     * requests will be relative now
     */
    void reset();

    /**
     * Start the timer running. Just set the running flag to true indicating that all time requests
     * should be relative to the system clock.
     */
    void start();

    /**
     * Stop the timer. This computes the time as of now and clears the running flag, causing all
     * subsequent time requests to be read from the accumulated time rather than looking at the
     * system clock.
     */
    void stop();

    /**
     * Check if the period specified has passed and if it has, advance the start time by that
     * period. This is useful to decide if it's time to do periodic work without drifting later by
     * the time it took to get around to checking.
     *
     * @param period The period to check for (in seconds).
     * @return If the period has passed.
     */
    boolean hasPeriodPassed(double period);
  }
}